@shipfox/api-integration-webhook 12.5.0 → 14.0.0
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/index.ts +2 -1
- package/src/presentation/routes/connections.test.ts +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$ shipfox-swc
|
|
2
|
-
Successfully compiled: 7 files with swc (
|
|
2
|
+
Successfully compiled: 7 files with swc (320.57ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @shipfox/api-integration-webhook
|
|
2
2
|
|
|
3
|
+
## 14.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1b71a66: Exposes each provider's event catalog and the fixed-event providers on the integration validation context. Every provider now refuses the reserved `manual` and `cron` connection slugs.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [18e9bad]
|
|
12
|
+
- Updated dependencies [1b71a66]
|
|
13
|
+
- @shipfox/api-integration-spi@2.0.0
|
|
14
|
+
- @shipfox/api-integration-webhook-dto@14.0.0
|
|
15
|
+
|
|
3
16
|
## 12.5.0
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,15 @@ export interface CreateWebhookIntegrationProviderOptions {
|
|
|
19
19
|
export declare function createWebhookIntegrationProvider(options: CreateWebhookIntegrationProviderOptions): {
|
|
20
20
|
provider: "webhook";
|
|
21
21
|
displayName: string;
|
|
22
|
+
eventCatalog: {
|
|
23
|
+
readonly provider: 'Custom webhook';
|
|
24
|
+
readonly events: readonly [{
|
|
25
|
+
readonly name: "received";
|
|
26
|
+
readonly summary: 'A custom webhook request is accepted.';
|
|
27
|
+
readonly emittedWhen: 'Shipfox accepts a request at the integration connection ingest URL.';
|
|
28
|
+
readonly payloadKind: 'shipfox-normalized';
|
|
29
|
+
}];
|
|
30
|
+
};
|
|
22
31
|
routes: import("@shipfox/node-fastify").RouteGroup[];
|
|
23
32
|
webhookProcessors: {
|
|
24
33
|
routeIds: readonly ['webhook.connection'];
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,aAAa,EACb,iCAAiC,EACjC,4CAA4C,EAC7C,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAAC,aAAa,EAAE,yBAAyB,EAAE,0BAA0B,EAAC,MAAM,eAAe,CAAC;AACnG,YAAY,EACV,oCAAoC,EACpC,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAC,6BAA6B,EAAC,MAAM,4BAA4B,CAAC;AAEzE,MAAM,WAAW,uCAAuC;IACtD,MAAM,EAAE,MAAM;QACZ,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;KACzE,CAAC;IACF,2BAA2B,EAAE,6BAA6B,CAAC;IAC3D,0BAA0B,EAAE,CAAC,MAAM,EAAE;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,KAAK,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAChG,4BAA4B,EAAE,8BAA8B,CAAC;IAC7D,0CAA0C,EAAE,4CAA4C,CAAC;IACzF,2BA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.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WEBHOOK_PROVIDER } from '@shipfox/api-integration-webhook-dto';
|
|
1
|
+
import { WEBHOOK_PROVIDER, webhookEventCatalog } from '@shipfox/api-integration-webhook-dto';
|
|
2
2
|
import { config } from '#config.js';
|
|
3
3
|
import { createGenericWebhookProcessor } from '#core/webhook-processor.js';
|
|
4
4
|
import { createWebhookConnectionRoutes } from '#presentation/routes/connections.js';
|
|
@@ -11,6 +11,7 @@ export function createWebhookIntegrationProvider(options) {
|
|
|
11
11
|
return {
|
|
12
12
|
provider: WEBHOOK_PROVIDER,
|
|
13
13
|
displayName: 'Webhook',
|
|
14
|
+
eventCatalog: webhookEventCatalog,
|
|
14
15
|
routes: [
|
|
15
16
|
createWebhookConnectionRoutes({
|
|
16
17
|
baseUrl,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {\n CreateIntegrationConnectionFn,\n DeleteIntegrationConnectionFn,\n GetIntegrationConnectionByIdFn,\n IntegrationConnection,\n IntegrationTx,\n PublishIntegrationEventReceivedFn,\n UpdateIntegrationConnectionLifecycleStatusFn,\n} from '@shipfox/api-integration-spi';\nimport {WEBHOOK_PROVIDER} from '@shipfox/api-integration-webhook-dto';\nimport {config} from '#config.js';\nimport {createGenericWebhookProcessor} from '#core/webhook-processor.js';\nimport {createWebhookConnectionRoutes} from '#presentation/routes/connections.js';\nimport {createWebhookInboundRoutes} from '#presentation/routes/inbound.js';\n\nexport {redactHeaders, WEBHOOK_FORWARDED_HEADERS, WEBHOOK_INBOUND_BODY_LIMIT} from '#constants.js';\nexport type {\n CreateGenericWebhookProcessorOptions,\n GenericWebhookProcessor,\n} from '#core/webhook-processor.js';\nexport {createGenericWebhookProcessor} from '#core/webhook-processor.js';\n\nexport interface CreateWebhookIntegrationProviderOptions {\n coreDb: () => {\n transaction<T>(callback: (tx: IntegrationTx) => Promise<T>): Promise<T>;\n };\n createIntegrationConnection: CreateIntegrationConnectionFn;\n listIntegrationConnections: (params: {workspaceId: string}) => Promise<IntegrationConnection[]>;\n getIntegrationConnectionById: GetIntegrationConnectionByIdFn;\n updateIntegrationConnectionLifecycleStatus: UpdateIntegrationConnectionLifecycleStatusFn;\n deleteIntegrationConnection: DeleteIntegrationConnectionFn;\n publishIntegrationEventReceived: PublishIntegrationEventReceivedFn;\n baseUrl?: string | undefined;\n}\n\nexport function createWebhookIntegrationProvider(options: CreateWebhookIntegrationProviderOptions) {\n const baseUrl = options.baseUrl ?? config.WEBHOOK_PUBLIC_URL;\n const webhookProcessor = createGenericWebhookProcessor(options);\n return {\n provider: WEBHOOK_PROVIDER,\n displayName: 'Webhook',\n routes: [\n createWebhookConnectionRoutes({\n baseUrl,\n createIntegrationConnection: options.createIntegrationConnection,\n listIntegrationConnections: options.listIntegrationConnections,\n getIntegrationConnectionById: options.getIntegrationConnectionById,\n updateIntegrationConnectionLifecycleStatus:\n options.updateIntegrationConnectionLifecycleStatus,\n deleteIntegrationConnection: options.deleteIntegrationConnection,\n }),\n createWebhookInboundRoutes({\n coreDb: options.coreDb,\n getIntegrationConnectionById: options.getIntegrationConnectionById,\n publishIntegrationEventReceived: options.publishIntegrationEventReceived,\n processor: webhookProcessor,\n }),\n ],\n webhookProcessors: [{routeIds: ['webhook.connection'] as const, processor: webhookProcessor}],\n };\n}\n"],"names":["WEBHOOK_PROVIDER","config","createGenericWebhookProcessor","createWebhookConnectionRoutes","createWebhookInboundRoutes","redactHeaders","WEBHOOK_FORWARDED_HEADERS","WEBHOOK_INBOUND_BODY_LIMIT","createWebhookIntegrationProvider","options","baseUrl","WEBHOOK_PUBLIC_URL","webhookProcessor","provider","displayName","routes","createIntegrationConnection","listIntegrationConnections","getIntegrationConnectionById","updateIntegrationConnectionLifecycleStatus","deleteIntegrationConnection","coreDb","publishIntegrationEventReceived","processor","webhookProcessors","routeIds"],"mappings":"AASA,SAAQA,gBAAgB,QAAO,uCAAuC;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type {\n CreateIntegrationConnectionFn,\n DeleteIntegrationConnectionFn,\n GetIntegrationConnectionByIdFn,\n IntegrationConnection,\n IntegrationTx,\n PublishIntegrationEventReceivedFn,\n UpdateIntegrationConnectionLifecycleStatusFn,\n} from '@shipfox/api-integration-spi';\nimport {WEBHOOK_PROVIDER, webhookEventCatalog} from '@shipfox/api-integration-webhook-dto';\nimport {config} from '#config.js';\nimport {createGenericWebhookProcessor} from '#core/webhook-processor.js';\nimport {createWebhookConnectionRoutes} from '#presentation/routes/connections.js';\nimport {createWebhookInboundRoutes} from '#presentation/routes/inbound.js';\n\nexport {redactHeaders, WEBHOOK_FORWARDED_HEADERS, WEBHOOK_INBOUND_BODY_LIMIT} from '#constants.js';\nexport type {\n CreateGenericWebhookProcessorOptions,\n GenericWebhookProcessor,\n} from '#core/webhook-processor.js';\nexport {createGenericWebhookProcessor} from '#core/webhook-processor.js';\n\nexport interface CreateWebhookIntegrationProviderOptions {\n coreDb: () => {\n transaction<T>(callback: (tx: IntegrationTx) => Promise<T>): Promise<T>;\n };\n createIntegrationConnection: CreateIntegrationConnectionFn;\n listIntegrationConnections: (params: {workspaceId: string}) => Promise<IntegrationConnection[]>;\n getIntegrationConnectionById: GetIntegrationConnectionByIdFn;\n updateIntegrationConnectionLifecycleStatus: UpdateIntegrationConnectionLifecycleStatusFn;\n deleteIntegrationConnection: DeleteIntegrationConnectionFn;\n publishIntegrationEventReceived: PublishIntegrationEventReceivedFn;\n baseUrl?: string | undefined;\n}\n\nexport function createWebhookIntegrationProvider(options: CreateWebhookIntegrationProviderOptions) {\n const baseUrl = options.baseUrl ?? config.WEBHOOK_PUBLIC_URL;\n const webhookProcessor = createGenericWebhookProcessor(options);\n return {\n provider: WEBHOOK_PROVIDER,\n displayName: 'Webhook',\n eventCatalog: webhookEventCatalog,\n routes: [\n createWebhookConnectionRoutes({\n baseUrl,\n createIntegrationConnection: options.createIntegrationConnection,\n listIntegrationConnections: options.listIntegrationConnections,\n getIntegrationConnectionById: options.getIntegrationConnectionById,\n updateIntegrationConnectionLifecycleStatus:\n options.updateIntegrationConnectionLifecycleStatus,\n deleteIntegrationConnection: options.deleteIntegrationConnection,\n }),\n createWebhookInboundRoutes({\n coreDb: options.coreDb,\n getIntegrationConnectionById: options.getIntegrationConnectionById,\n publishIntegrationEventReceived: options.publishIntegrationEventReceived,\n processor: webhookProcessor,\n }),\n ],\n webhookProcessors: [{routeIds: ['webhook.connection'] as const, processor: webhookProcessor}],\n };\n}\n"],"names":["WEBHOOK_PROVIDER","webhookEventCatalog","config","createGenericWebhookProcessor","createWebhookConnectionRoutes","createWebhookInboundRoutes","redactHeaders","WEBHOOK_FORWARDED_HEADERS","WEBHOOK_INBOUND_BODY_LIMIT","createWebhookIntegrationProvider","options","baseUrl","WEBHOOK_PUBLIC_URL","webhookProcessor","provider","displayName","eventCatalog","routes","createIntegrationConnection","listIntegrationConnections","getIntegrationConnectionById","updateIntegrationConnectionLifecycleStatus","deleteIntegrationConnection","coreDb","publishIntegrationEventReceived","processor","webhookProcessors","routeIds"],"mappings":"AASA,SAAQA,gBAAgB,EAAEC,mBAAmB,QAAO,uCAAuC;AAC3F,SAAQC,MAAM,QAAO,aAAa;AAClC,SAAQC,6BAA6B,QAAO,6BAA6B;AACzE,SAAQC,6BAA6B,QAAO,sCAAsC;AAClF,SAAQC,0BAA0B,QAAO,kCAAkC;AAE3E,SAAQC,aAAa,EAAEC,yBAAyB,EAAEC,0BAA0B,QAAO,gBAAgB;AAKnG,SAAQL,6BAA6B,QAAO,6BAA6B;AAezE,OAAO,SAASM,iCAAiCC,OAAgD;IAC/F,MAAMC,UAAUD,QAAQC,OAAO,IAAIT,OAAOU,kBAAkB;IAC5D,MAAMC,mBAAmBV,8BAA8BO;IACvD,OAAO;QACLI,UAAUd;QACVe,aAAa;QACbC,cAAcf;QACdgB,QAAQ;YACNb,8BAA8B;gBAC5BO;gBACAO,6BAA6BR,QAAQQ,2BAA2B;gBAChEC,4BAA4BT,QAAQS,0BAA0B;gBAC9DC,8BAA8BV,QAAQU,4BAA4B;gBAClEC,4CACEX,QAAQW,0CAA0C;gBACpDC,6BAA6BZ,QAAQY,2BAA2B;YAClE;YACAjB,2BAA2B;gBACzBkB,QAAQb,QAAQa,MAAM;gBACtBH,8BAA8BV,QAAQU,4BAA4B;gBAClEI,iCAAiCd,QAAQc,+BAA+B;gBACxEC,WAAWZ;YACb;SACD;QACDa,mBAAmB;YAAC;gBAACC,UAAU;oBAAC;iBAAqB;gBAAWF,WAAWZ;YAAgB;SAAE;IAC/F;AACF"}
|