@friggframework/core 2.0.0--canary.596.97a5c6b.0 → 2.0.0--canary.596.fc8739c.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/core/create-handler.js
CHANGED
|
@@ -80,10 +80,7 @@ const createHandler = (optionByName = {}) => {
|
|
|
80
80
|
// If enabled (i.e. if SECRET_ARN is set in process.env) Fetch secrets from AWS Secrets Manager, and set them as environment variables.
|
|
81
81
|
await secretsToEnv();
|
|
82
82
|
|
|
83
|
-
//
|
|
84
|
-
// Lazy-required so DB-free handlers (e.g. extension webhook
|
|
85
|
-
// receivers with useDatabase:false) never load the Prisma client.
|
|
86
|
-
// $connect is idempotent, so this safely reuses a warm connection.
|
|
83
|
+
// Lazy-required so DB-free handlers never load the Prisma client.
|
|
87
84
|
if (shouldUseDatabase) {
|
|
88
85
|
const { connectPrisma } = require('../database/prisma');
|
|
89
86
|
await connectPrisma();
|
|
@@ -511,10 +511,8 @@ router.get('/health/ready', async (_req, res) => {
|
|
|
511
511
|
});
|
|
512
512
|
});
|
|
513
513
|
|
|
514
|
-
//
|
|
515
|
-
//
|
|
516
|
-
// DB itself and degrades to 503 gracefully. Eager-connect at handler entry
|
|
517
|
-
// would turn a DB outage into a 500 for both (killing healthy containers).
|
|
514
|
+
// DB-free: /health/ready probes the DB itself and degrades to 503. Eager-connect
|
|
515
|
+
// here would turn a DB outage into a 500, killing otherwise-healthy containers.
|
|
518
516
|
const handler = createAppHandler('HTTP Event: Health', router, false);
|
|
519
517
|
|
|
520
518
|
module.exports = { handler, router };
|
|
@@ -56,11 +56,8 @@ for (const IntegrationClass of integrationClasses) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
// can declare the same relative path (e.g. two /webhooks) without colliding.
|
|
62
|
-
// Each per-binding handler carries its own shouldUseDatabase (resolved from
|
|
63
|
-
// the extension/binding `useDatabase`, default false → DB-free receiver).
|
|
59
|
+
// Each extension binding gets its own namespaced handler (/{bindingName}),
|
|
60
|
+
// so two modules' extensions can share a path like /webhooks without colliding.
|
|
64
61
|
const bindingGroups = new Map();
|
|
65
62
|
for (const extRoute of getExtensionRoutes(IntegrationClass)) {
|
|
66
63
|
const namespacedPath = `/${extRoute.bindingName}${extRoute.path}`;
|
|
@@ -94,16 +91,12 @@ for (const IntegrationClass of integrationClasses) {
|
|
|
94
91
|
};
|
|
95
92
|
|
|
96
93
|
for (const [bindingName, group] of bindingGroups) {
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
// the derivation here and there IN SYNC.
|
|
94
|
+
// Wire contract: integration-builder.js (devtools) derives the identical
|
|
95
|
+
// function key for the serverless config. Keep both in sync.
|
|
100
96
|
const fnKey = `${IntegrationClass.Definition.name}__${sanitizeBindingKey(
|
|
101
97
|
bindingName
|
|
102
98
|
)}`;
|
|
103
|
-
//
|
|
104
|
-
// and "hubspot") would silently overwrite each other's handler. The
|
|
105
|
-
// namespaced-path claim() above can't catch it (the paths differ), so
|
|
106
|
-
// fail loud here.
|
|
99
|
+
// Distinct binding keys can sanitize to the same fnKey — fail loud rather than overwrite.
|
|
107
100
|
if (Object.prototype.hasOwnProperty.call(handlers, fnKey)) {
|
|
108
101
|
throw new Error(
|
|
109
102
|
`Integration "${IntegrationClass.Definition.name}" extension handler conflict: ` +
|
|
@@ -199,8 +199,6 @@ function getExtensionRoutes(IntegrationClass) {
|
|
|
199
199
|
integrationName,
|
|
200
200
|
binding
|
|
201
201
|
);
|
|
202
|
-
// useDatabase is resolved at the binding level, falling back to the
|
|
203
|
-
// extension's declared value, then to false (DB-free by default).
|
|
204
202
|
const useDatabase =
|
|
205
203
|
binding.useDatabase ?? binding.extension.useDatabase ?? false;
|
|
206
204
|
const routes = binding.extension.routes || [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.596.
|
|
4
|
+
"version": "2.0.0--canary.596.fc8739c.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@friggframework/eslint-config": "2.0.0--canary.596.
|
|
42
|
-
"@friggframework/prettier-config": "2.0.0--canary.596.
|
|
43
|
-
"@friggframework/test": "2.0.0--canary.596.
|
|
41
|
+
"@friggframework/eslint-config": "2.0.0--canary.596.fc8739c.0",
|
|
42
|
+
"@friggframework/prettier-config": "2.0.0--canary.596.fc8739c.0",
|
|
43
|
+
"@friggframework/test": "2.0.0--canary.596.fc8739c.0",
|
|
44
44
|
"@prisma/client": "^6.17.0",
|
|
45
45
|
"@types/lodash": "4.17.15",
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "fc8739c1c49a9731b8465e0d5e864c71db20c581"
|
|
84
84
|
}
|