@powerhousedao/switchboard 6.2.3-dev.83 → 6.2.3-dev.84
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/.tsbuild/test/workflow/oauth-apps-config.test.d.ts +2 -0
- package/.tsbuild/test/workflow/oauth-apps-config.test.d.ts.map +1 -0
- package/.tsbuild/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +11 -0
- package/dist/index.mjs +1 -1
- package/dist/plugins/attachments.mjs +3 -3
- package/dist/plugins/workflows.mjs +3 -3
- package/dist/{server-ChIFIbah.mjs → server-B3qhPKNn.mjs} +39 -22
- package/dist/server-B3qhPKNn.mjs.map +1 -0
- package/dist/server.d.mts +9 -1
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +3 -3
- package/dist/workflow-runtime-7GaJ13c9.d.mts.map +1 -1
- package/dist/{workflows-COM3MKfD.mjs → workflows-B1VsL5Lo.mjs} +33 -3
- package/dist/workflows-B1VsL5Lo.mjs.map +1 -0
- package/package.json +16 -16
- package/test/goldens/resolvers.json +1 -0
- package/test/goldens/supergraph.graphql +21 -0
- package/test/goldens/workflow-runtime.graphql +21 -0
- package/test/workflow/oauth-apps-config.test.ts +66 -0
- package/test/workflow/oauth.test.ts +81 -0
- package/dist/server-ChIFIbah.mjs.map +0 -1
- package/dist/workflows-COM3MKfD.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 6.2.3-dev.84 (2026-10-30)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **switchboard:** oauthSignIn tells how a sign-in with a publisher app would go ([d3e2c84321](https://github.com/powerhouse-inc/powerhouse/commit/d3e2c84321))
|
|
6
|
+
- **switchboard:** read an OAuth2 app's relay from workflows.oauthApps ([f29bc5b5fa](https://github.com/powerhouse-inc/powerhouse/commit/f29bc5b5fa))
|
|
7
|
+
|
|
8
|
+
### ❤️ Thank You
|
|
9
|
+
|
|
10
|
+
- Frank Pfeift
|
|
11
|
+
|
|
1
12
|
## 6.2.3-dev.83 (2026-10-30)
|
|
2
13
|
|
|
3
14
|
### 🩹 Fixes
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="18b13585-6e92-5bcd-97f9-428fc2caa7ad")}catch(e){}}();
|
|
4
4
|
import { n as StoredDocumentsRefusedError, t as switchboardConfigFromEnv } from "./from-env-BO0n9R02.mjs";
|
|
5
5
|
import { a as callerOverEnv, o as mergeSwitchboardConfig } from "./schema-0g_QdOWn.mjs";
|
|
6
|
-
import { o as startSwitchboard, r as initSwitchboardProcess, u as initProfilerFromEnv } from "./server-
|
|
6
|
+
import { o as startSwitchboard, r as initSwitchboardProcess, u as initProfilerFromEnv } from "./server-B3qhPKNn.mjs";
|
|
7
7
|
import { metrics } from "@opentelemetry/api";
|
|
8
8
|
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
9
9
|
import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as attachmentsPluginConfigSchema, s as attachmentsPlugin } from "../server-
|
|
1
|
+
import { c as attachmentsPluginConfigSchema, s as attachmentsPlugin } from "../server-B3qhPKNn.mjs";
|
|
2
2
|
export { attachmentsPlugin, attachmentsPlugin as default, attachmentsPluginConfigSchema };
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
4
|
-
//# debugId=
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c0455083-05a5-5ca2-9574-f2c6e26f8b79")}catch(e){}}();
|
|
4
|
+
//# debugId=c0455083-05a5-5ca2-9574-f2c6e26f8b79
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as workflowsPlugin, i as workflowsDriveDeclaration, n as WORKFLOW_STUDIO_EDITOR_ID, o as workflowsPluginConfigSchema, r as createWorkflowsPlugin, t as DEFAULT_WORKFLOWS_DRIVE } from "../workflows-
|
|
1
|
+
import { a as workflowsPlugin, i as workflowsDriveDeclaration, n as WORKFLOW_STUDIO_EDITOR_ID, o as workflowsPluginConfigSchema, r as createWorkflowsPlugin, t as DEFAULT_WORKFLOWS_DRIVE } from "../workflows-B1VsL5Lo.mjs";
|
|
2
2
|
export { DEFAULT_WORKFLOWS_DRIVE, WORKFLOW_STUDIO_EDITOR_ID, createWorkflowsPlugin, createWorkflowsPlugin as default, workflowsDriveDeclaration, workflowsPlugin, workflowsPluginConfigSchema };
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
4
|
-
//# debugId=
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="01552745-f61c-52e0-8f12-91424a3a9481")}catch(e){}}();
|
|
4
|
+
//# debugId=01552745-f61c-52e0-8f12-91424a3a9481
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0777face-6d01-5a81-b830-e0b3978a74e5")}catch(e){}}();
|
|
3
3
|
import { a as loadNodeFsClass, c as openForVerify, d as ATTACHMENT_URL_SIGNING_SECRET_ENV, f as resolveAttachmentUrlSigning, i as isSupportedMajor, l as pgliteModuleSpec, n as StoredDocumentsRefusedError, o as loadPGliteModule, r as resolveUnsupportedStoredDocuments, s as loadPgDump, t as switchboardConfigFromEnv, u as readPgVersionFile } from "./from-env-BO0n9R02.mjs";
|
|
4
4
|
import { a as resolveWorkerModelSources, l as resolveProjectionWorkerOptions, n as keepImportableSources, o as resolveWorkerPoolOptions, p as workerPoolIssues, s as assertProjectionWorkerSupported, t as buildWorkerDbConfig } from "./worker-pool-BWHBLBJd.mjs";
|
|
5
5
|
import { t as isPostgresUrl } from "./postgres-url-DTDhBjXX.mjs";
|
|
6
6
|
import { n as resolvePrivacy, r as startPrivacy } from "./privacy-DxIJGH4P.mjs";
|
|
7
7
|
import { i as switchboardConfigSchema, o as mergeSwitchboardConfig } from "./schema-0g_QdOWn.mjs";
|
|
8
|
-
import { a as workflowsPlugin, c as WORKFLOW_TELEMETRY_SCOPE, d as isWorkflowSingletonConflict, f as modelManifestSource, g as triggerFatalShutdown, h as installFatalErrorShutdown, l as assertWorkflowPackageLoadable, m as workflowSingletonLossHandler, p as retryWorkflowSingleton, s as WORKFLOW_PACKAGE_NAME, u as composeWorkflowRuntime } from "./workflows-
|
|
8
|
+
import { a as workflowsPlugin, c as WORKFLOW_TELEMETRY_SCOPE, d as isWorkflowSingletonConflict, f as modelManifestSource, g as triggerFatalShutdown, h as installFatalErrorShutdown, l as assertWorkflowPackageLoadable, m as workflowSingletonLossHandler, p as retryWorkflowSingleton, s as WORKFLOW_PACKAGE_NAME, u as composeWorkflowRuntime } from "./workflows-B1VsL5Lo.mjs";
|
|
9
9
|
import { t as privacyPlugin } from "./privacy-BO8Q25xI.mjs";
|
|
10
10
|
import { t as mcpPlugin } from "./mcp-SsBK14Jm.mjs";
|
|
11
11
|
import { n as reactorFeatureFlagsOf, t as renownLayers } from "./renown-layers-COZsrGQT.mjs";
|
|
@@ -864,6 +864,38 @@ function signerFromEnvironment(backend, env) {
|
|
|
864
864
|
return signing.signer;
|
|
865
865
|
}
|
|
866
866
|
//#endregion
|
|
867
|
+
//#region src/workflow/oauth-apps-config.ts
|
|
868
|
+
/**
|
|
869
|
+
* The config file's `workflows.oauthApps`, client file paths made absolute
|
|
870
|
+
* from `dir`, the config file's folder. A malformed entry is left out; a
|
|
871
|
+
* relay that is not an object is dropped and reported, the app kept without
|
|
872
|
+
* it. The relay's fields are checked by the runtime, as for apps a host
|
|
873
|
+
* passes itself.
|
|
874
|
+
*/
|
|
875
|
+
function parseOAuthApps(raw, dir, onDroppedRelay) {
|
|
876
|
+
if (!Array.isArray(raw)) return [];
|
|
877
|
+
const at = (p) => typeof p === "string" && p ? path.resolve(dir, p) : void 0;
|
|
878
|
+
return raw.flatMap((entry) => {
|
|
879
|
+
const app = entry ?? {};
|
|
880
|
+
if (typeof app.id !== "string" || !app.id) return [];
|
|
881
|
+
const desktop = at(app.clients?.desktop);
|
|
882
|
+
const web = at(app.clients?.web);
|
|
883
|
+
let relay;
|
|
884
|
+
if (app.relay !== void 0) {
|
|
885
|
+
if (typeof app.relay === "object" && app.relay !== null && !Array.isArray(app.relay)) relay = app.relay;
|
|
886
|
+
else onDroppedRelay?.(app.id, app.relay);
|
|
887
|
+
}
|
|
888
|
+
return [{
|
|
889
|
+
id: app.id,
|
|
890
|
+
clients: {
|
|
891
|
+
...desktop ? { desktop } : {},
|
|
892
|
+
...web ? { web } : {}
|
|
893
|
+
},
|
|
894
|
+
...relay ? { relay } : {}
|
|
895
|
+
}];
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
//#endregion
|
|
867
899
|
//#region src/attachment-reference-read-model.mts
|
|
868
900
|
const attachmentSchemaCompiler = new AttachmentSchemaCompiler();
|
|
869
901
|
function createAttachmentReferenceReadModel(baseKysely, dependencies, attachmentReferenceWriter) {
|
|
@@ -1608,29 +1640,14 @@ function resolveConfigPath(configFile) {
|
|
|
1608
1640
|
* from the config file's folder. An unreadable file or a malformed entry
|
|
1609
1641
|
* means none: a missing app is reported when a sign-in asks for it.
|
|
1610
1642
|
*/
|
|
1611
|
-
function readConfigOAuthApps(configPath) {
|
|
1643
|
+
function readConfigOAuthApps(configPath, logger) {
|
|
1612
1644
|
let raw;
|
|
1613
1645
|
try {
|
|
1614
1646
|
raw = getConfig(configPath).workflows?.oauthApps;
|
|
1615
1647
|
} catch {
|
|
1616
1648
|
return [];
|
|
1617
1649
|
}
|
|
1618
|
-
|
|
1619
|
-
const dir = path$1.dirname(path$1.resolve(configPath));
|
|
1620
|
-
const at = (p) => typeof p === "string" && p ? path$1.resolve(dir, p) : void 0;
|
|
1621
|
-
return raw.flatMap((entry) => {
|
|
1622
|
-
const app = entry ?? {};
|
|
1623
|
-
if (typeof app.id !== "string" || !app.id) return [];
|
|
1624
|
-
const desktop = at(app.clients?.desktop);
|
|
1625
|
-
const web = at(app.clients?.web);
|
|
1626
|
-
return [{
|
|
1627
|
-
id: app.id,
|
|
1628
|
-
clients: {
|
|
1629
|
-
...desktop ? { desktop } : {},
|
|
1630
|
-
...web ? { web } : {}
|
|
1631
|
-
}
|
|
1632
|
-
}];
|
|
1633
|
-
});
|
|
1650
|
+
return parseOAuthApps(raw, path$1.dirname(path$1.resolve(configPath)), (id, relay) => logger.warn(`workflows.oauthApps "${id}": relay ${JSON.stringify(relay)} is not an object with clientId, redirectUri and tokenUrl; ignored`));
|
|
1634
1651
|
}
|
|
1635
1652
|
function readConfigWorkflowsEnabled(configPath) {
|
|
1636
1653
|
try {
|
|
@@ -2125,7 +2142,7 @@ async function initServer(requestedPort, options, config, renown, renownConfig,
|
|
|
2125
2142
|
attachmentAccess: api.attachmentAccess,
|
|
2126
2143
|
webhooks: api.httpRoutes.scopeFor(WORKFLOW_PACKAGE_NAME).webhooks,
|
|
2127
2144
|
http: api.httpRoutes.scopeFor(WORKFLOW_PACKAGE_NAME),
|
|
2128
|
-
oauthApps: options.workflows?.oauthApps ?? readConfigOAuthApps(resolveConfigPath(options.configFile)),
|
|
2145
|
+
oauthApps: options.workflows?.oauthApps ?? readConfigOAuthApps(resolveConfigPath(options.configFile), logger),
|
|
2129
2146
|
authorizationService: api.authorizationService,
|
|
2130
2147
|
indexQueries: api.graphqlManager,
|
|
2131
2148
|
pieces: api.packageManager,
|
|
@@ -2521,5 +2538,5 @@ function feedCatchUpPriority(priority, server) {
|
|
|
2521
2538
|
//#endregion
|
|
2522
2539
|
export { resolvePgliteStorageDirs as a, attachmentsPluginConfigSchema as c, isPortAvailable as i, applySwitchboardReactorDefaults as l, deriveAttachmentServiceConfig as n, startSwitchboard as o, initSwitchboardProcess as r, attachmentsPlugin as s, createReactorKysely as t, initProfilerFromEnv as u };
|
|
2523
2540
|
|
|
2524
|
-
//# sourceMappingURL=server-
|
|
2525
|
-
//# debugId=
|
|
2541
|
+
//# sourceMappingURL=server-B3qhPKNn.mjs.map
|
|
2542
|
+
//# debugId=0777face-6d01-5a81-b830-e0b3978a74e5
|