@unito/integration-sdk 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/handler.js
CHANGED
|
@@ -42,10 +42,10 @@ function assertWebhookParseRequestPayload(body) {
|
|
|
42
42
|
if (typeof body !== 'object' || body === null) {
|
|
43
43
|
throw new BadRequestError('Invalid WebhookParseRequestPayload');
|
|
44
44
|
}
|
|
45
|
-
if (!('payload' in body) || body.payload !== 'string') {
|
|
45
|
+
if (!('payload' in body) || typeof body.payload !== 'string') {
|
|
46
46
|
throw new BadRequestError("Missing required 'payload' property in WebhookParseRequestPayload");
|
|
47
47
|
}
|
|
48
|
-
if (!('url' in body) || body.url !== 'string') {
|
|
48
|
+
if (!('url' in body) || typeof body.url !== 'string') {
|
|
49
49
|
throw new BadRequestError("Missing required 'url' property in WebhookParseRequestPayload");
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -53,13 +53,13 @@ function assertWebhookSubscriptionRequestPayload(body) {
|
|
|
53
53
|
if (typeof body !== 'object' || body === null) {
|
|
54
54
|
throw new BadRequestError('Invalid WebhookSubscriptionRequestPayload');
|
|
55
55
|
}
|
|
56
|
-
if (!('itemPath' in body) || body.itemPath !== 'string') {
|
|
56
|
+
if (!('itemPath' in body) || typeof body.itemPath !== 'string') {
|
|
57
57
|
throw new BadRequestError("Missing required 'itemPath' property in WebhookSubscriptionRequestPayload");
|
|
58
58
|
}
|
|
59
|
-
if (!('targetUrl' in body) || body.targetUrl !== 'string') {
|
|
59
|
+
if (!('targetUrl' in body) || typeof body.targetUrl !== 'string') {
|
|
60
60
|
throw new BadRequestError("Missing required 'targetUrl' property in WebhookSubscriptionRequestPayload");
|
|
61
61
|
}
|
|
62
|
-
if (!('action' in body) || body.action !== 'string') {
|
|
62
|
+
if (!('action' in body) || typeof body.action !== 'string') {
|
|
63
63
|
throw new BadRequestError("Missing required 'action' property in WebhookSubscriptionRequestPayload");
|
|
64
64
|
}
|
|
65
65
|
if (!['start', 'stop'].includes(body.action)) {
|
package/dist/src/index.cjs
CHANGED
|
@@ -565,10 +565,10 @@ function assertWebhookParseRequestPayload(body) {
|
|
|
565
565
|
if (typeof body !== 'object' || body === null) {
|
|
566
566
|
throw new BadRequestError('Invalid WebhookParseRequestPayload');
|
|
567
567
|
}
|
|
568
|
-
if (!('payload' in body) || body.payload !== 'string') {
|
|
568
|
+
if (!('payload' in body) || typeof body.payload !== 'string') {
|
|
569
569
|
throw new BadRequestError("Missing required 'payload' property in WebhookParseRequestPayload");
|
|
570
570
|
}
|
|
571
|
-
if (!('url' in body) || body.url !== 'string') {
|
|
571
|
+
if (!('url' in body) || typeof body.url !== 'string') {
|
|
572
572
|
throw new BadRequestError("Missing required 'url' property in WebhookParseRequestPayload");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
@@ -576,13 +576,13 @@ function assertWebhookSubscriptionRequestPayload(body) {
|
|
|
576
576
|
if (typeof body !== 'object' || body === null) {
|
|
577
577
|
throw new BadRequestError('Invalid WebhookSubscriptionRequestPayload');
|
|
578
578
|
}
|
|
579
|
-
if (!('itemPath' in body) || body.itemPath !== 'string') {
|
|
579
|
+
if (!('itemPath' in body) || typeof body.itemPath !== 'string') {
|
|
580
580
|
throw new BadRequestError("Missing required 'itemPath' property in WebhookSubscriptionRequestPayload");
|
|
581
581
|
}
|
|
582
|
-
if (!('targetUrl' in body) || body.targetUrl !== 'string') {
|
|
582
|
+
if (!('targetUrl' in body) || typeof body.targetUrl !== 'string') {
|
|
583
583
|
throw new BadRequestError("Missing required 'targetUrl' property in WebhookSubscriptionRequestPayload");
|
|
584
584
|
}
|
|
585
|
-
if (!('action' in body) || body.action !== 'string') {
|
|
585
|
+
if (!('action' in body) || typeof body.action !== 'string') {
|
|
586
586
|
throw new BadRequestError("Missing required 'action' property in WebhookSubscriptionRequestPayload");
|
|
587
587
|
}
|
|
588
588
|
if (!['start', 'stop'].includes(body.action)) {
|
|
@@ -985,9 +985,9 @@ class Provider {
|
|
|
985
985
|
/**
|
|
986
986
|
* Initializes a Provider with the given options.
|
|
987
987
|
*
|
|
988
|
-
* @property prepareRequest - function to define the Provider's base URL and specific headers to add to the request.
|
|
989
|
-
* @property
|
|
990
|
-
* @property customErrorHandler - function to handle specific errors returned by the provider.
|
|
988
|
+
* @property {@link prepareRequest} - function to define the Provider's base URL and specific headers to add to the request.
|
|
989
|
+
* @property {@link RateLimiter} - function to limit the rate of calls to the provider based on the caller's credentials.
|
|
990
|
+
* @property {@link customErrorHandler} - function to handle specific errors returned by the provider.
|
|
991
991
|
*/
|
|
992
992
|
constructor(options) {
|
|
993
993
|
this.prepareRequest = options.prepareRequest;
|
|
@@ -97,9 +97,9 @@ export declare class Provider {
|
|
|
97
97
|
/**
|
|
98
98
|
* Initializes a Provider with the given options.
|
|
99
99
|
*
|
|
100
|
-
* @property prepareRequest - function to define the Provider's base URL and specific headers to add to the request.
|
|
101
|
-
* @property
|
|
102
|
-
* @property customErrorHandler - function to handle specific errors returned by the provider.
|
|
100
|
+
* @property {@link prepareRequest} - function to define the Provider's base URL and specific headers to add to the request.
|
|
101
|
+
* @property {@link RateLimiter} - function to limit the rate of calls to the provider based on the caller's credentials.
|
|
102
|
+
* @property {@link customErrorHandler} - function to handle specific errors returned by the provider.
|
|
103
103
|
*/
|
|
104
104
|
constructor(options: {
|
|
105
105
|
prepareRequest: typeof Provider.prototype.prepareRequest;
|
|
@@ -37,9 +37,9 @@ export class Provider {
|
|
|
37
37
|
/**
|
|
38
38
|
* Initializes a Provider with the given options.
|
|
39
39
|
*
|
|
40
|
-
* @property prepareRequest - function to define the Provider's base URL and specific headers to add to the request.
|
|
41
|
-
* @property
|
|
42
|
-
* @property customErrorHandler - function to handle specific errors returned by the provider.
|
|
40
|
+
* @property {@link prepareRequest} - function to define the Provider's base URL and specific headers to add to the request.
|
|
41
|
+
* @property {@link RateLimiter} - function to limit the rate of calls to the provider based on the caller's credentials.
|
|
42
|
+
* @property {@link customErrorHandler} - function to handle specific errors returned by the provider.
|
|
43
43
|
*/
|
|
44
44
|
constructor(options) {
|
|
45
45
|
this.prepareRequest = options.prepareRequest;
|
package/package.json
CHANGED
package/src/handler.ts
CHANGED
|
@@ -217,11 +217,11 @@ function assertWebhookParseRequestPayload(body: unknown): asserts body is API.We
|
|
|
217
217
|
throw new BadRequestError('Invalid WebhookParseRequestPayload');
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
if (!('payload' in body) || body.payload !== 'string') {
|
|
220
|
+
if (!('payload' in body) || typeof body.payload !== 'string') {
|
|
221
221
|
throw new BadRequestError("Missing required 'payload' property in WebhookParseRequestPayload");
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
if (!('url' in body) || body.url !== 'string') {
|
|
224
|
+
if (!('url' in body) || typeof body.url !== 'string') {
|
|
225
225
|
throw new BadRequestError("Missing required 'url' property in WebhookParseRequestPayload");
|
|
226
226
|
}
|
|
227
227
|
}
|
|
@@ -231,15 +231,15 @@ function assertWebhookSubscriptionRequestPayload(body: unknown): asserts body is
|
|
|
231
231
|
throw new BadRequestError('Invalid WebhookSubscriptionRequestPayload');
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
if (!('itemPath' in body) || body.itemPath !== 'string') {
|
|
234
|
+
if (!('itemPath' in body) || typeof body.itemPath !== 'string') {
|
|
235
235
|
throw new BadRequestError("Missing required 'itemPath' property in WebhookSubscriptionRequestPayload");
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
if (!('targetUrl' in body) || body.targetUrl !== 'string') {
|
|
238
|
+
if (!('targetUrl' in body) || typeof body.targetUrl !== 'string') {
|
|
239
239
|
throw new BadRequestError("Missing required 'targetUrl' property in WebhookSubscriptionRequestPayload");
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
if (!('action' in body) || body.action !== 'string') {
|
|
242
|
+
if (!('action' in body) || typeof body.action !== 'string') {
|
|
243
243
|
throw new BadRequestError("Missing required 'action' property in WebhookSubscriptionRequestPayload");
|
|
244
244
|
}
|
|
245
245
|
|
|
@@ -98,9 +98,9 @@ export class Provider {
|
|
|
98
98
|
/**
|
|
99
99
|
* Initializes a Provider with the given options.
|
|
100
100
|
*
|
|
101
|
-
* @property prepareRequest - function to define the Provider's base URL and specific headers to add to the request.
|
|
102
|
-
* @property
|
|
103
|
-
* @property customErrorHandler - function to handle specific errors returned by the provider.
|
|
101
|
+
* @property {@link prepareRequest} - function to define the Provider's base URL and specific headers to add to the request.
|
|
102
|
+
* @property {@link RateLimiter} - function to limit the rate of calls to the provider based on the caller's credentials.
|
|
103
|
+
* @property {@link customErrorHandler} - function to handle specific errors returned by the provider.
|
|
104
104
|
*/
|
|
105
105
|
constructor(options: {
|
|
106
106
|
prepareRequest: typeof Provider.prototype.prepareRequest;
|