Skip to content

Commit 1eb98c5

Browse files
authored
Merge pull request #109 from cloudnode-pro/next
Bump API version to 5.13.0
2 parents b9dfc83 + ff99380 commit 1eb98c5

File tree

8 files changed

+461
-379
lines changed

8 files changed

+461
-379
lines changed

README.md

Lines changed: 104 additions & 90 deletions
Large diffs are not rendered by default.

browser/Cloudnode.js

Lines changed: 68 additions & 57 deletions
Large diffs are not rendered by default.

browser/Cloudnode.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "Cloudnode",
33
"instanceName": "cloudnode",
44
"baseUrl": "https://api.cloudnode.pro/v5/",
5-
"apiVersion": "5.12.0",
5+
"apiVersion": "5.13.0",
66
"browserUrl": "https://cdn.jsdelivr.net/npm/cloudnode-ts@latest/browser/Cloudnode.min.js"
77
}

schema.json

Lines changed: 101 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -504,14 +504,14 @@
504504
}
505505
],
506506
"operations": {
507-
"newsletter": {
507+
"newsletters": {
508508
"type": "namespace",
509509
"operations": {
510510
"list": {
511511
"type": "operation",
512512
"description": "List newsletters",
513513
"method": "GET",
514-
"path": "/newsletter",
514+
"path": "/newsletters",
515515
"parameters": {
516516
"query": {
517517
"limit": {
@@ -539,7 +539,7 @@
539539
"type": "operation",
540540
"description": "Get newsletter",
541541
"method": "GET",
542-
"path": "/newsletter/:id",
542+
"path": "/newsletters/:id",
543543
"parameters": {
544544
"path": {
545545
"id": {
@@ -559,21 +559,78 @@
559559
"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"
560560
}
561561
]
562+
}
563+
}
564+
},
565+
"subscriptions": {
566+
"type": "namespace",
567+
"operations": {
568+
"list": {
569+
"type": "operation",
570+
"description": "List newsletter subscriptions",
571+
"token": "newsletter.subscriptions.list.own",
572+
"method": "GET",
573+
"path": "/subscriptions",
574+
"parameters": {
575+
"query": {
576+
"limit": {
577+
"description": "The number of subscriptions to return per page. No more than 50.",
578+
"default": "10",
579+
"type": "number",
580+
"required": false
581+
},
582+
"page": {
583+
"description": "The page number. No more than 2³² (4294967296).",
584+
"default": "1",
585+
"type": "number",
586+
"required": false
587+
}
588+
}
589+
},
590+
"returns": [
591+
{
592+
"status": 200,
593+
"type": "DatedNewsletterSubscription[]"
594+
}
595+
]
562596
},
563-
"subscribe": {
597+
"get": {
564598
"type": "operation",
565-
"description": "Subscribe to newsletter",
566-
"method": "POST",
567-
"path": "/newsletter/:id/subscribe",
599+
"description": "Get newsletter subscription",
600+
"method": "GET",
601+
"path": "/subscriptions/:id",
568602
"parameters": {
569603
"path": {
570604
"id": {
571-
"description": "A newsletter ID",
605+
"description": "The ID of the subscription to get",
572606
"type": "string",
573607
"required": true
574608
}
609+
}
610+
},
611+
"returns": [
612+
{
613+
"status": 200,
614+
"type": "DatedNewsletterSubscription"
575615
},
616+
{
617+
"status": 404,
618+
"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"
619+
}
620+
]
621+
},
622+
"create": {
623+
"type": "operation",
624+
"description": "Subscribe to newsletter",
625+
"method": "POST",
626+
"path": "/subscriptions",
627+
"parameters": {
576628
"body": {
629+
"newsletter": {
630+
"description": "The ID of the newsletter to subscribe to",
631+
"type": "string",
632+
"required": true
633+
},
577634
"email": {
578635
"description": "Subscriber's email address",
579636
"type": "string",
@@ -591,10 +648,6 @@
591648
"status": 201,
592649
"type": "NewsletterSubscription"
593650
},
594-
{
595-
"status": 404,
596-
"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"
597-
},
598651
{
599652
"status": 422,
600653
"type": "Error & {code: \"INVALID_DATA\"}"
@@ -604,20 +657,15 @@
604657
"type": "Error & {code: \"CONFLICT\"}"
605658
}
606659
]
607-
}
608-
}
609-
},
610-
"newsletters": {
611-
"type": "namespace",
612-
"operations": {
613-
"unsubscribe": {
660+
},
661+
"delete": {
614662
"type": "operation",
615-
"description": "Revoke a subscription (unsubscribe)",
616-
"method": "POST",
617-
"path": "/newsletters/unsubscribe",
663+
"description": "Unsubscribe from newsletter",
664+
"method": "DELETE",
665+
"path": "/subscriptions/:id",
618666
"parameters": {
619-
"body": {
620-
"subscription": {
667+
"path": {
668+
"id": {
621669
"description": "The ID of the subscription to revoke",
622670
"type": "string",
623671
"required": true
@@ -638,47 +686,18 @@
638686
"type": "Error & {code: \"INVALID_DATA\"}"
639687
}
640688
]
641-
},
642-
"listSubscriptions": {
643-
"type": "operation",
644-
"description": "List subscriptions of the authenticated user",
645-
"token": "newsletter.subscriptions.list.own",
646-
"method": "GET",
647-
"path": "/newsletters/subscriptions",
648-
"parameters": {
649-
"query": {
650-
"limit": {
651-
"description": "The number of subscriptions to return per page. No more than 50.",
652-
"default": "10",
653-
"type": "number",
654-
"required": false
655-
},
656-
"page": {
657-
"description": "The page number. No more than 2³² (4294967296).",
658-
"default": "1",
659-
"type": "number",
660-
"required": false
661-
}
662-
}
663-
},
664-
"returns": [
665-
{
666-
"status": 200,
667-
"type": "DatedNewsletterSubscription[]"
668-
}
669-
]
670689
}
671690
}
672691
},
673-
"token": {
692+
"tokens": {
674693
"type": "namespace",
675694
"operations": {
676695
"list": {
677696
"type": "operation",
678697
"description": "List tokens of user",
679698
"token": "tokens.list.own",
680699
"method": "GET",
681-
"path": "/token",
700+
"path": "/tokens",
682701
"parameters": {
683702
"query": {
684703
"limit": {
@@ -712,7 +731,7 @@
712731
"description": "Create token",
713732
"token": "tokens.create.own",
714733
"method": "POST",
715-
"path": "/token",
734+
"path": "/tokens",
716735
"parameters": {
717736
"body": {
718737
"permissions": {
@@ -748,7 +767,7 @@
748767
"description": "Get token details",
749768
"token": "tokens.get.own",
750769
"method": "GET",
751-
"path": "/token/:id",
770+
"path": "/tokens/:id",
752771
"parameters": {
753772
"path": {
754773
"id": {
@@ -778,7 +797,7 @@
778797
"description": "Revoke token",
779798
"token": "tokens.revoke.own",
780799
"method": "DELETE",
781-
"path": "/token/:id",
800+
"path": "/tokens/:id",
782801
"parameters": {
783802
"path": {
784803
"id": {
@@ -802,7 +821,7 @@
802821
"type": "Error & {code: \"INVALID_DATA\"}"
803822
},
804823
{
805-
"status": 400,
824+
"status": 423,
806825
"type": "Error & {code: \"MODIFICATION_NOT_ALLOWED\"}"
807826
}
808827
]
@@ -812,7 +831,7 @@
812831
"description": "Get list of recent requests made with the token",
813832
"token": "tokens.get.own.requests",
814833
"method": "GET",
815-
"path": "/token/:id/requests",
834+
"path": "/tokens/:id/requests",
816835
"parameters": {
817836
"path": {
818837
"id": {
@@ -856,7 +875,7 @@
856875
"description": "Get a recent request by ID",
857876
"token": "tokens.get.own.requests",
858877
"method": "GET",
859-
"path": "/token/:id/requests/:request",
878+
"path": "/tokens/:id/requests/:request",
860879
"parameters": {
861880
"path": {
862881
"id": {
@@ -883,24 +902,31 @@
883902
{
884903
"status": 422,
885904
"type": "Error & {code: \"INVALID_DATA\"}"
905+
},
906+
{
907+
"status": 423,
908+
"type": "Error & {code: \"MODIFICATION_NOT_ALLOWED\"}"
886909
}
887910
]
888-
}
889-
}
890-
},
891-
"tokens": {
892-
"type": "namespace",
893-
"operations": {
911+
},
894912
"refresh": {
895913
"type": "operation",
896914
"description": "Refresh current token. The token that was used to authenticate the request will be deleted. A new token with a new ID but the same permissions will be created and returned. The lifespan of the new token will be the same as the old one, starting from the time of the request. This operation effectively allows a token to be used indefinitely.",
897915
"token": "token.refresh",
898916
"method": "POST",
899-
"path": "/token/refresh",
900-
"parameters": {},
917+
"path": "/tokens/:id",
918+
"parameters": {
919+
"path": {
920+
"id": {
921+
"description": "The ID of the token to refresh. Specify `current` to refresh the token that was used to authenticate the request.",
922+
"type": "string | \"current\"",
923+
"required": true
924+
}
925+
}
926+
},
901927
"returns": [
902928
{
903-
"status": 201,
929+
"status": 200,
904930
"type": "Token"
905931
},
906932
{
@@ -923,7 +949,7 @@
923949
"parameters": {
924950
"body": {
925951
"username": {
926-
"description": "The username to use for the account. Must be between 3 and 32 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.",
952+
"description": "The username to use for the account. Must be between 3 and 20 characters long. Cannot start with `user_`. May contain only letters, numbers, dashes and underscores. Must be unique.",
927953
"type": "string",
928954
"required": true
929955
},
@@ -1037,12 +1063,12 @@
10371063
"parameters": {
10381064
"body": {
10391065
"username": {
1040-
"description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
1066+
"description": "Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
10411067
"type": "string",
10421068
"required": true
10431069
},
10441070
"name": {
1045-
"description": "Your full name. Set to `null` to remove.",
1071+
"description": "Your full name. Set to `null` to remove. Min 2 characters, max 32. Allowed characters (lowercase as well): A–Z `',-.,` and `ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞSŸ`",
10461072
"type": "string | null",
10471073
"required": false
10481074
}
@@ -1081,12 +1107,12 @@
10811107
"parameters": {
10821108
"body": {
10831109
"username": {
1084-
"description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
1110+
"description": "Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
10851111
"type": "string",
10861112
"required": true
10871113
},
10881114
"name": {
1089-
"description": "Your full name. Set to `null` to remove.",
1115+
"description": "Your full name. Set to `null` to remove. Min 2 characters, max 32. Allowed characters (lowercase as well): A–Z `',-.,` and `ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞSŸ`",
10901116
"type": "string | null",
10911117
"required": true
10921118
}

0 commit comments

Comments
 (0)