Skip to content

Commit 89bb378

Browse files
committed
subscriptions.create no longer can return 404
1 parent 5a35dcc commit 89bb378

File tree

7 files changed

+4
-13
lines changed

7 files changed

+4
-13
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ Subscribe to newsletter
490490
- `email` <code>[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)</code> Subscriber's email address.
491491
- `data` <code>[Record](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number) | [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)></code> Additional data that this newsletter requires.
492492
- Returns: <code>[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Cloudnode.ApiResponse](#class-cloudnodeapiresponset)&lt;[Cloudnode.NewsletterSubscription](#interface-cloudnodenewslettersubscription)>></code>
493-
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "RESOURCE_NOT_FOUND"}</code>
494493
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "INVALID_DATA"}</code>
495494
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "CONFLICT"}</code>
496495
- Throws: <code>[Cloudnode.Error](#interface-cloudnodeerror) & {code: "RATE_LIMITED"}</code>

browser/Cloudnode.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,14 @@ class Cloudnode {
280280
* @param newsletter The ID of the newsletter to subscribe to
281281
* @param email Subscriber's email address
282282
* @param data Additional data that this newsletter requires
283-
* @throws {Cloudnode.Error & {code: "RESOURCE_NOT_FOUND"}}
284283
* @throws {Cloudnode.Error & {code: "INVALID_DATA"}}
285284
* @throws {Cloudnode.Error & {code: "CONFLICT"}}
286285
* @throws {Cloudnode.Error & {code: "RATE_LIMITED"}}
287286
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
288287
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
289288
*/
290289
create: async (newsletter, email, data) => {
291-
return await this.#sendRequest({ "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", "required": true }, "data": { "description": "Additional data that this newsletter requires", "type": "Record<string, string | number | boolean>", "required": false } } }, "returns": [{ "status": 201, "type": "NewsletterSubscription" }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { newsletter, email, data });
290+
return await this.#sendRequest({ "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", "required": true }, "data": { "description": "Additional data that this newsletter requires", "type": "Record<string, string | number | boolean>", "required": false } } }, "returns": [{ "status": 201, "type": "NewsletterSubscription" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { newsletter, email, data });
292291
},
293292
/**
294293
* Unsubscribe from newsletter

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.

schema.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,6 @@
648648
"status": 201,
649649
"type": "NewsletterSubscription"
650650
},
651-
{
652-
"status": 404,
653-
"type": "Error & {code: \"RESOURCE_NOT_FOUND\"}"
654-
},
655651
{
656652
"status": 422,
657653
"type": "Error & {code: \"INVALID_DATA\"}"

src/Cloudnode.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ declare class Cloudnode {
9797
* @param newsletter The ID of the newsletter to subscribe to
9898
* @param email Subscriber's email address
9999
* @param data Additional data that this newsletter requires
100-
* @throws {Cloudnode.Error & {code: "RESOURCE_NOT_FOUND"}}
101100
* @throws {Cloudnode.Error & {code: "INVALID_DATA"}}
102101
* @throws {Cloudnode.Error & {code: "CONFLICT"}}
103102
* @throws {Cloudnode.Error & {code: "RATE_LIMITED"}}

src/Cloudnode.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,14 @@ class Cloudnode {
280280
* @param newsletter The ID of the newsletter to subscribe to
281281
* @param email Subscriber's email address
282282
* @param data Additional data that this newsletter requires
283-
* @throws {Cloudnode.Error & {code: "RESOURCE_NOT_FOUND"}}
284283
* @throws {Cloudnode.Error & {code: "INVALID_DATA"}}
285284
* @throws {Cloudnode.Error & {code: "CONFLICT"}}
286285
* @throws {Cloudnode.Error & {code: "RATE_LIMITED"}}
287286
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
288287
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
289288
*/
290289
create: async (newsletter, email, data) => {
291-
return await this.#sendRequest({ "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", "required": true }, "data": { "description": "Additional data that this newsletter requires", "type": "Record<string, string | number | boolean>", "required": false } } }, "returns": [{ "status": 201, "type": "NewsletterSubscription" }, { "status": 404, "type": "Error & {code: \"RESOURCE_NOT_FOUND\"}" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { newsletter, email, data });
290+
return await this.#sendRequest({ "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", "required": true }, "data": { "description": "Additional data that this newsletter requires", "type": "Record<string, string | number | boolean>", "required": false } } }, "returns": [{ "status": 201, "type": "NewsletterSubscription" }, { "status": 422, "type": "Error & {code: \"INVALID_DATA\"}" }, { "status": 409, "type": "Error & {code: \"CONFLICT\"}" }, { "status": 429, "type": "Error & {code: \"RATE_LIMITED\"}" }, { "status": 500, "type": "Error & {code: \"INTERNAL_SERVER_ERROR\"}" }, { "status": 503, "type": "Error & {code: \"MAINTENANCE\"}" }] }, {}, {}, { newsletter, email, data });
292291
},
293292
/**
294293
* Unsubscribe from newsletter

src/Cloudnode.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,14 @@ class Cloudnode {
294294
* @param newsletter The ID of the newsletter to subscribe to
295295
* @param email Subscriber's email address
296296
* @param data Additional data that this newsletter requires
297-
* @throws {Cloudnode.Error & {code: "RESOURCE_NOT_FOUND"}}
298297
* @throws {Cloudnode.Error & {code: "INVALID_DATA"}}
299298
* @throws {Cloudnode.Error & {code: "CONFLICT"}}
300299
* @throws {Cloudnode.Error & {code: "RATE_LIMITED"}}
301300
* @throws {Cloudnode.Error & {code: "INTERNAL_SERVER_ERROR"}}
302301
* @throws {Cloudnode.Error & {code: "MAINTENANCE"}}
303302
*/
304303
create: async (newsletter: string, email: string, data?: Record<string, string | number | boolean>): Promise<Cloudnode.ApiResponse<Cloudnode.NewsletterSubscription>> => {
305-
return await this.#sendRequest<Cloudnode.NewsletterSubscription>({"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","required":true},"data":{"description":"Additional data that this newsletter requires","type":"Record<string, string | number | boolean>","required":false}}},"returns":[{"status":201,"type":"NewsletterSubscription"},{"status":404,"type":"Error & {code: \"RESOURCE_NOT_FOUND\"}"},{"status":422,"type":"Error & {code: \"INVALID_DATA\"}"},{"status":409,"type":"Error & {code: \"CONFLICT\"}"},{"status":429,"type":"Error & {code: \"RATE_LIMITED\"}"},{"status":500,"type":"Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status":503,"type":"Error & {code: \"MAINTENANCE\"}"}]}, {}, {}, {newsletter, email, data});
304+
return await this.#sendRequest<Cloudnode.NewsletterSubscription>({"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","required":true},"data":{"description":"Additional data that this newsletter requires","type":"Record<string, string | number | boolean>","required":false}}},"returns":[{"status":201,"type":"NewsletterSubscription"},{"status":422,"type":"Error & {code: \"INVALID_DATA\"}"},{"status":409,"type":"Error & {code: \"CONFLICT\"}"},{"status":429,"type":"Error & {code: \"RATE_LIMITED\"}"},{"status":500,"type":"Error & {code: \"INTERNAL_SERVER_ERROR\"}"},{"status":503,"type":"Error & {code: \"MAINTENANCE\"}"}]}, {}, {}, {newsletter, email, data});
306305
},
307306
/**
308307
* Unsubscribe from newsletter

0 commit comments

Comments
 (0)