@friggframework/devtools 2.0.0--canary.695.5edaa52.0 → 2.0.0--canary.696.5d9f1be.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.
|
@@ -360,6 +360,25 @@ class IntegrationBuilder extends InfrastructureBuilder {
|
|
|
360
360
|
method: 'POST',
|
|
361
361
|
},
|
|
362
362
|
},
|
|
363
|
+
// A provider (the shared runtime for published integration definitions) also receives the
|
|
364
|
+
// webhooks of every type it provides at that type's own URL. HTTP API cannot match part of a
|
|
365
|
+
// segment, so the whole segment is a parameter; literal routes still win over it.
|
|
366
|
+
...(integration.IntegrationProvider
|
|
367
|
+
? [
|
|
368
|
+
{
|
|
369
|
+
httpApi: {
|
|
370
|
+
path: '/api/{integrationType}/webhooks',
|
|
371
|
+
method: 'POST',
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
httpApi: {
|
|
376
|
+
path: '/api/{integrationType}/webhooks/{integrationId}',
|
|
377
|
+
method: 'POST',
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
]
|
|
381
|
+
: []),
|
|
363
382
|
],
|
|
364
383
|
};
|
|
365
384
|
console.log(` ✓ Webhook handler function defined`);
|
|
@@ -620,6 +620,28 @@ describe('IntegrationBuilder', () => {
|
|
|
620
620
|
]);
|
|
621
621
|
});
|
|
622
622
|
|
|
623
|
+
it('gives a provider of integration types the webhook routes of every type it provides', async () => {
|
|
624
|
+
const appDefinition = {
|
|
625
|
+
integrations: [
|
|
626
|
+
{ Definition: { name: 'stripe', webhooks: true } },
|
|
627
|
+
{
|
|
628
|
+
Definition: { name: 'data-defined', webhooks: { enabled: true } },
|
|
629
|
+
IntegrationProvider: { resolve: async () => null, list: async () => [] },
|
|
630
|
+
},
|
|
631
|
+
],
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
const result = await integrationBuilder.build(appDefinition, {});
|
|
635
|
+
|
|
636
|
+
expect(result.functions['data-definedWebhook'].events.map((e) => e.httpApi.path)).toEqual([
|
|
637
|
+
'/api/data-defined-integration/webhooks',
|
|
638
|
+
'/api/data-defined-integration/webhooks/{integrationId}',
|
|
639
|
+
'/api/{integrationType}/webhooks',
|
|
640
|
+
'/api/{integrationType}/webhooks/{integrationId}',
|
|
641
|
+
]);
|
|
642
|
+
expect(result.functions.stripeWebhook.events).toHaveLength(2);
|
|
643
|
+
});
|
|
644
|
+
|
|
623
645
|
it('emits a dedicated per-binding function (namespaced) for Tier 3 extension routes; the main handler keeps only {proxy+}', async () => {
|
|
624
646
|
const appDefinition = {
|
|
625
647
|
integrations: [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.
|
|
4
|
+
"version": "2.0.0--canary.696.5d9f1be.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"frigg": "./frigg-cli/index.js"
|
|
7
7
|
},
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@babel/eslint-parser": "^7.18.9",
|
|
27
27
|
"@babel/parser": "^7.25.3",
|
|
28
28
|
"@babel/traverse": "^7.25.3",
|
|
29
|
-
"@friggframework/core": "2.0.0--canary.
|
|
30
|
-
"@friggframework/schemas": "2.0.0--canary.
|
|
31
|
-
"@friggframework/test": "2.0.0--canary.
|
|
29
|
+
"@friggframework/core": "2.0.0--canary.696.5d9f1be.0",
|
|
30
|
+
"@friggframework/schemas": "2.0.0--canary.696.5d9f1be.0",
|
|
31
|
+
"@friggframework/test": "2.0.0--canary.696.5d9f1be.0",
|
|
32
32
|
"@hapi/boom": "^10.0.1",
|
|
33
33
|
"@inquirer/prompts": "^5.3.8",
|
|
34
34
|
"axios": "^1.18.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"validate-npm-package-name": "^5.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@friggframework/eslint-config": "2.0.0--canary.
|
|
60
|
-
"@friggframework/prettier-config": "2.0.0--canary.
|
|
59
|
+
"@friggframework/eslint-config": "2.0.0--canary.696.5d9f1be.0",
|
|
60
|
+
"@friggframework/prettier-config": "2.0.0--canary.696.5d9f1be.0",
|
|
61
61
|
"aws-sdk-client-mock": "^4.1.0",
|
|
62
62
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
63
63
|
"jest": "^30.1.3",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "5d9f1be29b1cec33fd7ca6ec81b831a3c5a9be48"
|
|
93
93
|
}
|