Skip to content

Commit

Permalink
Merge pull request #109 from cloudnode-pro/next
Browse files Browse the repository at this point in the history
Bump API version to 5.13.0
  • Loading branch information
zefir-git authored Sep 1, 2023
2 parents b9dfc83 + ff99380 commit 1eb98c5
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 379 deletions.
194 changes: 104 additions & 90 deletions README.md

Large diffs are not rendered by default.

125 changes: 68 additions & 57 deletions browser/Cloudnode.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion browser/Cloudnode.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gen/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "Cloudnode",
"instanceName": "cloudnode",
"baseUrl": "https://api.cloudnode.pro/v5/",
"apiVersion": "5.12.0",
"apiVersion": "5.13.0",
"browserUrl": "https://cdn.jsdelivr.net/npm/cloudnode-ts@latest/browser/Cloudnode.min.js"
}
176 changes: 101 additions & 75 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,14 @@
}
],
"operations": {
"newsletter": {
"newsletters": {
"type": "namespace",
"operations": {
"list": {
"type": "operation",
"description": "List newsletters",
"method": "GET",
"path": "/newsletter",
"path": "/newsletters",
"parameters": {
"query": {
"limit": {
Expand Down Expand Up @@ -539,7 +539,7 @@
"type": "operation",
"description": "Get newsletter",
"method": "GET",
"path": "/newsletter/:id",
"path": "/newsletters/:id",
"parameters": {
"path": {
"id": {
Expand All @@ -559,21 +559,78 @@
"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"
}
]
}
}
},
"subscriptions": {
"type": "namespace",
"operations": {
"list": {
"type": "operation",
"description": "List newsletter subscriptions",
"token": "newsletter.subscriptions.list.own",
"method": "GET",
"path": "/subscriptions",
"parameters": {
"query": {
"limit": {
"description": "The number of subscriptions to return per page. No more than 50.",
"default": "10",
"type": "number",
"required": false
},
"page": {
"description": "The page number. No more than 2³² (4294967296).",
"default": "1",
"type": "number",
"required": false
}
}
},
"returns": [
{
"status": 200,
"type": "DatedNewsletterSubscription[]"
}
]
},
"subscribe": {
"get": {
"type": "operation",
"description": "Subscribe to newsletter",
"method": "POST",
"path": "/newsletter/:id/subscribe",
"description": "Get newsletter subscription",
"method": "GET",
"path": "/subscriptions/:id",
"parameters": {
"path": {
"id": {
"description": "A newsletter ID",
"description": "The ID of the subscription to get",
"type": "string",
"required": true
}
}
},
"returns": [
{
"status": 200,
"type": "DatedNewsletterSubscription"
},
{
"status": 404,
"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"
}
]
},
"create": {
"type": "operation",
"description": "Subscribe to newsletter",
"method": "POST",
"path": "/subscriptions",
"parameters": {
"body": {
"newsletter": {
"description": "The ID of the newsletter to subscribe to",
"type": "string",
"required": true
},
"email": {
"description": "Subscriber's email address",
"type": "string",
Expand All @@ -591,10 +648,6 @@
"status": 201,
"type": "NewsletterSubscription"
},
{
"status": 404,
"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"
},
{
"status": 422,
"type": "Error & {code: \"INVALID_DATA\"}"
Expand All @@ -604,20 +657,15 @@
"type": "Error & {code: \"CONFLICT\"}"
}
]
}
}
},
"newsletters": {
"type": "namespace",
"operations": {
"unsubscribe": {
},
"delete": {
"type": "operation",
"description": "Revoke a subscription (unsubscribe)",
"method": "POST",
"path": "/newsletters/unsubscribe",
"description": "Unsubscribe from newsletter",
"method": "DELETE",
"path": "/subscriptions/:id",
"parameters": {
"body": {
"subscription": {
"path": {
"id": {
"description": "The ID of the subscription to revoke",
"type": "string",
"required": true
Expand All @@ -638,47 +686,18 @@
"type": "Error & {code: \"INVALID_DATA\"}"
}
]
},
"listSubscriptions": {
"type": "operation",
"description": "List subscriptions of the authenticated user",
"token": "newsletter.subscriptions.list.own",
"method": "GET",
"path": "/newsletters/subscriptions",
"parameters": {
"query": {
"limit": {
"description": "The number of subscriptions to return per page. No more than 50.",
"default": "10",
"type": "number",
"required": false
},
"page": {
"description": "The page number. No more than 2³² (4294967296).",
"default": "1",
"type": "number",
"required": false
}
}
},
"returns": [
{
"status": 200,
"type": "DatedNewsletterSubscription[]"
}
]
}
}
},
"token": {
"tokens": {
"type": "namespace",
"operations": {
"list": {
"type": "operation",
"description": "List tokens of user",
"token": "tokens.list.own",
"method": "GET",
"path": "/token",
"path": "/tokens",
"parameters": {
"query": {
"limit": {
Expand Down Expand Up @@ -712,7 +731,7 @@
"description": "Create token",
"token": "tokens.create.own",
"method": "POST",
"path": "/token",
"path": "/tokens",
"parameters": {
"body": {
"permissions": {
Expand Down Expand Up @@ -748,7 +767,7 @@
"description": "Get token details",
"token": "tokens.get.own",
"method": "GET",
"path": "/token/:id",
"path": "/tokens/:id",
"parameters": {
"path": {
"id": {
Expand Down Expand Up @@ -778,7 +797,7 @@
"description": "Revoke token",
"token": "tokens.revoke.own",
"method": "DELETE",
"path": "/token/:id",
"path": "/tokens/:id",
"parameters": {
"path": {
"id": {
Expand All @@ -802,7 +821,7 @@
"type": "Error & {code: \"INVALID_DATA\"}"
},
{
"status": 400,
"status": 423,
"type": "Error & {code: \"MODIFICATION_NOT_ALLOWED\"}"
}
]
Expand All @@ -812,7 +831,7 @@
"description": "Get list of recent requests made with the token",
"token": "tokens.get.own.requests",
"method": "GET",
"path": "/token/:id/requests",
"path": "/tokens/:id/requests",
"parameters": {
"path": {
"id": {
Expand Down Expand Up @@ -856,7 +875,7 @@
"description": "Get a recent request by ID",
"token": "tokens.get.own.requests",
"method": "GET",
"path": "/token/:id/requests/:request",
"path": "/tokens/:id/requests/:request",
"parameters": {
"path": {
"id": {
Expand All @@ -883,24 +902,31 @@
{
"status": 422,
"type": "Error & {code: \"INVALID_DATA\"}"
},
{
"status": 423,
"type": "Error & {code: \"MODIFICATION_NOT_ALLOWED\"}"
}
]
}
}
},
"tokens": {
"type": "namespace",
"operations": {
},
"refresh": {
"type": "operation",
"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.",
"token": "token.refresh",
"method": "POST",
"path": "/token/refresh",
"parameters": {},
"path": "/tokens/:id",
"parameters": {
"path": {
"id": {
"description": "The ID of the token to refresh. Specify `current` to refresh the token that was used to authenticate the request.",
"type": "string | \"current\"",
"required": true
}
}
},
"returns": [
{
"status": 201,
"status": 200,
"type": "Token"
},
{
Expand All @@ -923,7 +949,7 @@
"parameters": {
"body": {
"username": {
"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.",
"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.",
"type": "string",
"required": true
},
Expand Down Expand Up @@ -1037,12 +1063,12 @@
"parameters": {
"body": {
"username": {
"description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
"description": "Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
"type": "string",
"required": true
},
"name": {
"description": "Your full name. Set to `null` to remove.",
"description": "Your full name. Set to `null` to remove. Min 2 characters, max 32. Allowed characters (lowercase as well): A–Z `',-.,` and `ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞSŸ`",
"type": "string | null",
"required": false
}
Expand Down Expand Up @@ -1081,12 +1107,12 @@
"parameters": {
"body": {
"username": {
"description": "Your unique username. Between 3 and 64 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
"description": "Your unique username. Between 3 and 20 characters. Only letters, numbers, dashes and underscores. May not start with `user_`.",
"type": "string",
"required": true
},
"name": {
"description": "Your full name. Set to `null` to remove.",
"description": "Your full name. Set to `null` to remove. Min 2 characters, max 32. Allowed characters (lowercase as well): A–Z `',-.,` and `ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞSŸ`",
"type": "string | null",
"required": true
}
Expand Down
Loading

0 comments on commit 1eb98c5

Please sign in to comment.