@almadar/integrations 2.38.0 → 2.40.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/dist/index.d.ts +51 -5
- package/dist/index.js +118 -39
- package/dist/index.js.map +1 -1
- package/dist/mocks/index.js +13 -6
- package/dist/mocks/index.js.map +1 -1
- package/dist/runtime/index.d.ts +10 -2
- package/dist/runtime/index.js +129 -41
- package/dist/runtime/index.js.map +1 -1
- package/dist/{store-RNvxZO-q.d.ts → store-DG5OGiuQ.d.ts} +8 -2
- package/package.json +3 -3
package/dist/mocks/index.js
CHANGED
|
@@ -361,8 +361,8 @@ var serviceCredentials = {
|
|
|
361
361
|
{ envVar: "REDIS_URL", required: true, description: "Redis connection URL" }
|
|
362
362
|
],
|
|
363
363
|
oauth: [
|
|
364
|
-
{ envVar: "OAUTH_CLIENT_ID", required: true, description: "OIDC client ID" },
|
|
365
|
-
{ envVar: "OAUTH_CLIENT_SECRET", required: true, description: "OIDC client secret" },
|
|
364
|
+
{ envVar: "OAUTH_CLIENT_ID", required: true, description: "OAuth/OIDC client ID" },
|
|
365
|
+
{ envVar: "OAUTH_CLIENT_SECRET", required: true, description: "OAuth/OIDC client secret" },
|
|
366
366
|
{ envVar: "OAUTH_REDIRECT_URI", required: false, description: "OIDC redirect URI (default per-call param)" },
|
|
367
367
|
{ envVar: "OIDC_ISSUER_URL", required: false, description: "OIDC issuer URL (default https://accounts.google.com)" }
|
|
368
368
|
],
|
|
@@ -395,8 +395,7 @@ var serviceCredentials = {
|
|
|
395
395
|
{ envVar: "RIGGER_GENERATE_TIMEOUT_MS", required: false, description: "Timeout (ms) for the 'generate' action; a local z-image-turbo run takes ~60-90 s and a kontext edit at 1024px several minutes (default 600000)" }
|
|
396
396
|
]
|
|
397
397
|
};
|
|
398
|
-
|
|
399
|
-
// src/factory.ts
|
|
398
|
+
var callLog = createLogger("almadar:integrations:calls");
|
|
400
399
|
function instanceKey(name, principal) {
|
|
401
400
|
return principal ? `${name}\0${principal}` : name;
|
|
402
401
|
}
|
|
@@ -441,8 +440,16 @@ var IntegrationFactory = class {
|
|
|
441
440
|
* Execute an action on an integration
|
|
442
441
|
*/
|
|
443
442
|
async execute(integration, action, params, context) {
|
|
444
|
-
const
|
|
445
|
-
|
|
443
|
+
const start = performance.now();
|
|
444
|
+
const record = (ok, error) => callLog.call({ kind: "external", service: integration, op: action, durationMs: performance.now() - start, ok, ...error !== void 0 ? { error } : {} });
|
|
445
|
+
try {
|
|
446
|
+
const result = await this.get(integration, context?.principal).execute(action, params, context);
|
|
447
|
+
record(result.success, result.success ? void 0 : result.error?.message);
|
|
448
|
+
return result;
|
|
449
|
+
} catch (err) {
|
|
450
|
+
record(false, err instanceof Error ? err.message : String(err));
|
|
451
|
+
throw err;
|
|
452
|
+
}
|
|
446
453
|
}
|
|
447
454
|
/**
|
|
448
455
|
* Check if integration is configured
|