@unito/integration-sdk 0.1.8 → 0.1.9
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.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
2
|
import * as API from '@unito/integration-api';
|
|
3
|
-
import { GetItemContext, GetCollectionContext, CreateItemContext, UpdateItemContext, DeleteItemContext, GetCredentialAccountContext, ParseWebhooksContext, UpdateWebhookSubscriptionsContext,
|
|
3
|
+
import { GetItemContext, GetCollectionContext, CreateItemContext, UpdateItemContext, DeleteItemContext, GetCredentialAccountContext, ParseWebhooksContext, UpdateWebhookSubscriptionsContext, AcknowledgeWebhooksContext } from './resources/context.js';
|
|
4
4
|
/**
|
|
5
5
|
* Handler called to get an individual item.
|
|
6
6
|
*/
|
|
@@ -36,7 +36,7 @@ export type UpdateWebhookSubscriptionsHandler = (context: UpdateWebhookSubscript
|
|
|
36
36
|
/**
|
|
37
37
|
* Handler called to acknowledge the reception of a webhook.
|
|
38
38
|
*/
|
|
39
|
-
export type
|
|
39
|
+
export type AcknowledgeWebhooksHandler = (context: AcknowledgeWebhooksContext<any, any, any>) => Promise<API.WebhookAcknowledgeResponsePayload>;
|
|
40
40
|
type ItemHandlers = {
|
|
41
41
|
getItem?: GetItemHandler;
|
|
42
42
|
getCollection?: GetCollectionHandler;
|
|
@@ -54,7 +54,7 @@ type WebhookSubscriptionHandlers = {
|
|
|
54
54
|
updateWebhookSubscriptions: UpdateWebhookSubscriptionsHandler;
|
|
55
55
|
};
|
|
56
56
|
type AcknowledgeWebhookHandlers = {
|
|
57
|
-
acknowledgeWebhooks:
|
|
57
|
+
acknowledgeWebhooks: AcknowledgeWebhooksHandler;
|
|
58
58
|
};
|
|
59
59
|
export type HandlersInput = ItemHandlers | CredentialAccountHandlers | ParseWebhookHandlers | WebhookSubscriptionHandlers | AcknowledgeWebhookHandlers;
|
|
60
60
|
export declare class Handler {
|
|
@@ -69,7 +69,7 @@ export type ParseWebhooksContext<P extends Record<string, string> = Record<strin
|
|
|
69
69
|
export type UpdateWebhookSubscriptionsContext<P extends Record<string, string> = Record<string, never>, Q extends Record<string, string> = Record<string, never>, B extends API.WebhookSubscriptionRequestPayload = API.WebhookSubscriptionRequestPayload> = Context<P, Q> & {
|
|
70
70
|
body: B;
|
|
71
71
|
};
|
|
72
|
-
export type
|
|
72
|
+
export type AcknowledgeWebhooksContext<P extends Record<string, string> = Record<string, never>, Q extends Record<string, string> = Record<string, never>, B extends API.WebhookParseRequestPayload = API.WebhookParseRequestPayload> = Omit<Context<P, Q>, 'credentials'> & {
|
|
73
73
|
body: B;
|
|
74
74
|
};
|
|
75
75
|
interface ParsedQueryString {
|
package/package.json
CHANGED
package/src/handler.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
GetCredentialAccountContext,
|
|
12
12
|
ParseWebhooksContext,
|
|
13
13
|
UpdateWebhookSubscriptionsContext,
|
|
14
|
-
|
|
14
|
+
AcknowledgeWebhooksContext,
|
|
15
15
|
} from './resources/context.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -63,8 +63,8 @@ export type UpdateWebhookSubscriptionsHandler = (
|
|
|
63
63
|
/**
|
|
64
64
|
* Handler called to acknowledge the reception of a webhook.
|
|
65
65
|
*/
|
|
66
|
-
export type
|
|
67
|
-
context:
|
|
66
|
+
export type AcknowledgeWebhooksHandler = (
|
|
67
|
+
context: AcknowledgeWebhooksContext<any, any, any>,
|
|
68
68
|
) => Promise<API.WebhookAcknowledgeResponsePayload>;
|
|
69
69
|
|
|
70
70
|
type ItemHandlers = {
|
|
@@ -88,7 +88,7 @@ type WebhookSubscriptionHandlers = {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
type AcknowledgeWebhookHandlers = {
|
|
91
|
-
acknowledgeWebhooks:
|
|
91
|
+
acknowledgeWebhooks: AcknowledgeWebhooksHandler;
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
export type HandlersInput =
|
package/src/resources/context.ts
CHANGED
|
@@ -101,7 +101,7 @@ export type UpdateWebhookSubscriptionsContext<
|
|
|
101
101
|
B extends API.WebhookSubscriptionRequestPayload = API.WebhookSubscriptionRequestPayload,
|
|
102
102
|
> = Context<P, Q> & { body: B };
|
|
103
103
|
|
|
104
|
-
export type
|
|
104
|
+
export type AcknowledgeWebhooksContext<
|
|
105
105
|
P extends Record<string, string> = Record<string, never>,
|
|
106
106
|
Q extends Record<string, string> = Record<string, never>,
|
|
107
107
|
B extends API.WebhookParseRequestPayload = API.WebhookParseRequestPayload,
|