@powerhousedao/switchboard 6.2.3-dev.54 → 6.2.3-dev.55
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/tsconfig.tsbuildinfo +1 -1
- package/CHANGELOG.md +21 -0
- package/dist/index.mjs +1 -1
- package/dist/{server-J9fpd42v.mjs → server-kc2kg0hU.mjs} +27 -12
- package/dist/server-kc2kg0hU.mjs.map +1 -0
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +3 -3
- package/package.json +15 -15
- package/test/attachments/index.test.ts +13 -1
- package/test/workflow-runtime.test.ts +37 -0
- package/dist/server-J9fpd42v.mjs.map +0 -1
package/dist/server.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.mts","names":[],"sources":["../src/pglite-version.ts","../src/privacy.mts","../src/workflow-runtime.mts","../src/types.ts","../src/builder-defaults.mts","../src/unsupported-stored-documents.mts","../src/server.mts"],"mappings":";;;;;;;;;;;;;;;cASa;KACD,2BAA2B;;;KCe3B;;EAEV;;EAEA;;EAEA,SAAS;;;;;;KCkCC;EACN;;EAEA;EACA;;;;;;;;;;YC/CM;;YAKA,wBAAwB;EAClC,eAAe;;YAGL;EACV;EACA;EACA;;YAGU;;EAEV;;;;;EAKA;;EAGA;;YAGU;;;;;;;;;;;;;;;;;;;;;EAqBV,UAAU;;;;;;;;EAQV;;;;;;;EAOA;EACA;EACA;;;;;;EAMA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;IAEM;IACA;;;;;;;EASN,WAAW;;EAEX;;;EAGA;;;EAGA;IACE;;;EAGF,UAAU;EACV,kBAAkB;EAClB;EACA;;;;;;EAMA;EACA,SAAS;;;;;;;;;;EAUT;;;;;;;;;;EAUA;;;;;;;;;EASA;IACE;IACA;IACA;;;;;;;;;;;EAWF;IACE;IACA;;;;;;;;;EASF,6BAA6B;;YAGnB;EACV;EACA,SAAS;;EAET,mBAAmB;;EAEnB,+BAA+B;;;EAG/B,mBAAmB;;EAEnB;;EAEA,iBAAiB;;EAEjB;IAAY,SAAS;;;EAErB;;EAEA,QAAQ;;;;;EAKR;;;;;;;;;;;;;EAaA,gBAAgB;;;;KC/MN;EAIV,iBAAiB;;EAEjB,mBAAmB;;EAEnB;;;;;;;EAOA,gBAAgB;;EAEhB;;EAEA;IACE;IACA,eAAe,QAAQ;;;EAGzB,sBAAsB;EACtB,SAAS;;;;;;EAMT,SAAS;;;;;EAKT,cAAc,KAAK;;EAEnB,wBAAwB;;wBAsBV,gCACd,gBAAgB,gBAChB,eAAe,sBACf,UAAS;;;;wBC5EK,kCACd,OAAO,wCACP,KAAK,OAAO,aACX;;qBAaU,oCAAoC;WACtC;IAAqB;IAAkB;;WACvC;EAET,YAAY,OAAO;SAcZ,QAAQ,iBAAiB,SAAS;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"server.d.mts","names":[],"sources":["../src/pglite-version.ts","../src/privacy.mts","../src/workflow-runtime.mts","../src/types.ts","../src/builder-defaults.mts","../src/unsupported-stored-documents.mts","../src/server.mts"],"mappings":";;;;;;;;;;;;;;;cASa;KACD,2BAA2B;;;KCe3B;;EAEV;;EAEA;;EAEA,SAAS;;;;;;KCkCC;EACN;;EAEA;EACA;;;;;;;;;;YC/CM;;YAKA,wBAAwB;EAClC,eAAe;;YAGL;EACV;EACA;EACA;;YAGU;;EAEV;;;;;EAKA;;EAGA;;YAGU;;;;;;;;;;;;;;;;;;;;;EAqBV,UAAU;;;;;;;;EAQV;;;;;;;EAOA;EACA;EACA;;;;;;EAMA;EACA;EACA;EACA,QAAQ;EACR;EACA;EACA;IAEM;IACA;;;;;;;EASN,WAAW;;EAEX;;;EAGA;;;EAGA;IACE;;;EAGF,UAAU;EACV,kBAAkB;EAClB;EACA;;;;;;EAMA;EACA,SAAS;;;;;;;;;;EAUT;;;;;;;;;;EAUA;;;;;;;;;EASA;IACE;IACA;IACA;;;;;;;;;;;EAWF;IACE;IACA;;;;;;;;;EASF,6BAA6B;;YAGnB;EACV;EACA,SAAS;;EAET,mBAAmB;;EAEnB,+BAA+B;;;EAG/B,mBAAmB;;EAEnB;;EAEA,iBAAiB;;EAEjB;IAAY,SAAS;;;EAErB;;EAEA,QAAQ;;;;;EAKR;;;;;;;;;;;;;EAaA,gBAAgB;;;;KC/MN;EAIV,iBAAiB;;EAEjB,mBAAmB;;EAEnB;;;;;;;EAOA,gBAAgB;;EAEhB;;EAEA;IACE;IACA,eAAe,QAAQ;;;EAGzB,sBAAsB;EACtB,SAAS;;;;;;EAMT,SAAS;;;;;EAKT,cAAc,KAAK;;EAEnB,wBAAwB;;wBAsBV,gCACd,gBAAgB,gBAChB,eAAe,sBACf,UAAS;;;;wBC5EK,kCACd,OAAO,wCACP,KAAK,OAAO,aACX;;qBAaU,oCAAoC;WACtC;IAAqB;IAAkB;;WACvC;EAET,YAAY,OAAO;SAcZ,QAAQ,iBAAiB,SAAS;;;;;;;;;wBCmL3B,gBAAgB,eAAe;;;;;;KA6D1C;EACH,QAAQ,OAAO;EACf,qBAAqB;EACrB,cAAc;;wBAGM,oBAAoB;EACxC;EACA;EACA,oBAAoB;EACpB;;;;;;;EAOA;EACA,QAAQ;IACN,QAAQ;;wBA4DI,8BACd,SAAS,KAAK,uDACd,oBACA,QAAQ;EACL;EAAmB,YAAY;;;;;;;;;;;;;;;;;;;qBA+/BvB,mBAAgB,UAClB,uBACR,QAAQ"}
|
package/dist/server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as StoredDocumentsRefusedError, i as startSwitchboard, n as deriveAttachmentServiceConfig, o as resolveUnsupportedStoredDocuments, r as isPortAvailable, s as applySwitchboardReactorDefaults, t as createReactorKysely } from "./server-
|
|
2
|
+
import { a as StoredDocumentsRefusedError, i as startSwitchboard, n as deriveAttachmentServiceConfig, o as resolveUnsupportedStoredDocuments, r as isPortAvailable, s as applySwitchboardReactorDefaults, t as createReactorKysely } from "./server-kc2kg0hU.mjs";
|
|
3
3
|
export { StoredDocumentsRefusedError, applySwitchboardReactorDefaults, createReactorKysely, deriveAttachmentServiceConfig, isPortAvailable, resolveUnsupportedStoredDocuments, startSwitchboard };
|
|
4
|
-
!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]="
|
|
5
|
-
//# debugId=
|
|
4
|
+
!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]="75a63455-320e-5b33-ba46-15fc33630ae6")}catch(e){}}();
|
|
5
|
+
//# debugId=75a63455-320e-5b33-ba46-15fc33630ae6
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/switchboard",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.3-dev.
|
|
4
|
+
"version": "6.2.3-dev.55",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@openfeature/core": "1.9.1",
|
|
42
42
|
"@openfeature/env-var-provider": "0.3.1",
|
|
43
43
|
"@openfeature/server-sdk": "1.19.0",
|
|
44
|
-
"@powerhousedao/config": "6.2.3-dev.
|
|
44
|
+
"@powerhousedao/config": "6.2.3-dev.55",
|
|
45
45
|
"@opentelemetry/api": "^1.9.0",
|
|
46
46
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
47
47
|
"@opentelemetry/exporter-trace-otlp-http": "^0.218.0",
|
|
@@ -55,22 +55,22 @@
|
|
|
55
55
|
"@opentelemetry/sdk-node": "^0.218.0",
|
|
56
56
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
57
57
|
"@opentelemetry/semantic-conventions": "^1.41.1",
|
|
58
|
-
"@powerhousedao/opentelemetry-instrumentation-reactor": "6.2.3-dev.
|
|
59
|
-
"@powerhousedao/reactor": "6.2.3-dev.
|
|
60
|
-
"@powerhousedao/shared": "6.2.3-dev.
|
|
61
|
-
"@powerhousedao/vetra": "6.2.3-dev.
|
|
62
|
-
"@powerhousedao/reactor-api": "6.2.3-dev.
|
|
63
|
-
"@powerhousedao/reactor-attachments": "6.2.3-dev.
|
|
64
|
-
"@powerhousedao/reactor-drive": "6.2.3-dev.
|
|
65
|
-
"@powerhousedao/reactor-group": "6.2.3-dev.
|
|
66
|
-
"@powerhousedao/reactor-privacy": "6.2.3-dev.
|
|
67
|
-
"@powerhousedao/reactor-workflow": "6.2.3-dev.
|
|
68
|
-
"@powerhousedao/workflow": "6.2.3-dev.
|
|
58
|
+
"@powerhousedao/opentelemetry-instrumentation-reactor": "6.2.3-dev.55",
|
|
59
|
+
"@powerhousedao/reactor": "6.2.3-dev.55",
|
|
60
|
+
"@powerhousedao/shared": "6.2.3-dev.55",
|
|
61
|
+
"@powerhousedao/vetra": "6.2.3-dev.55",
|
|
62
|
+
"@powerhousedao/reactor-api": "6.2.3-dev.55",
|
|
63
|
+
"@powerhousedao/reactor-attachments": "6.2.3-dev.55",
|
|
64
|
+
"@powerhousedao/reactor-drive": "6.2.3-dev.55",
|
|
65
|
+
"@powerhousedao/reactor-group": "6.2.3-dev.55",
|
|
66
|
+
"@powerhousedao/reactor-privacy": "6.2.3-dev.55",
|
|
67
|
+
"@powerhousedao/reactor-workflow": "6.2.3-dev.55",
|
|
68
|
+
"@powerhousedao/workflow": "6.2.3-dev.55",
|
|
69
69
|
"@pyroscope/nodejs": "^0.4.5",
|
|
70
|
-
"@renown/sdk": "6.2.3-dev.
|
|
70
|
+
"@renown/sdk": "6.2.3-dev.55",
|
|
71
71
|
"@sentry/node": "^10.53.1",
|
|
72
72
|
"@sentry/opentelemetry": "^10.53.1",
|
|
73
|
-
"document-model": "6.2.3-dev.
|
|
73
|
+
"document-model": "6.2.3-dev.55",
|
|
74
74
|
"dotenv": "^16.4.7",
|
|
75
75
|
"express": "^4.22.1",
|
|
76
76
|
"graphql": "^16",
|
|
@@ -11,6 +11,7 @@ type Captured = {
|
|
|
11
11
|
res: ServerResponse,
|
|
12
12
|
body?: unknown,
|
|
13
13
|
) => void | Promise<void>;
|
|
14
|
+
options?: unknown;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
type FakeApi = Pick<
|
|
@@ -32,8 +33,9 @@ function makeFakeApi(
|
|
|
32
33
|
method: string,
|
|
33
34
|
path: string,
|
|
34
35
|
handler: Captured["handler"],
|
|
36
|
+
options?: unknown,
|
|
35
37
|
) => {
|
|
36
|
-
captured.push({ method, path, handler });
|
|
38
|
+
captured.push({ method, path, handler, options });
|
|
37
39
|
},
|
|
38
40
|
},
|
|
39
41
|
authService,
|
|
@@ -186,4 +188,14 @@ describe("mountAuthenticatedNodeRoute", () => {
|
|
|
186
188
|
authEnabled: false,
|
|
187
189
|
});
|
|
188
190
|
});
|
|
191
|
+
|
|
192
|
+
it("forwards rawBody to the adapter and keeps it out of the auth options", () => {
|
|
193
|
+
const { api, captured } = makeFakeApi(undefined);
|
|
194
|
+
|
|
195
|
+
mountAuthenticatedNodeRoute(api, "PUT", "/x", vi.fn(), { rawBody: true });
|
|
196
|
+
mountAuthenticatedNodeRoute(api, "GET", "/y", vi.fn());
|
|
197
|
+
|
|
198
|
+
expect(captured[0].options).toEqual({ rawBody: true });
|
|
199
|
+
expect(captured[1].options).toEqual({ rawBody: false });
|
|
200
|
+
});
|
|
189
201
|
});
|
|
@@ -798,6 +798,43 @@ describe("composeWorkflowRuntime", () => {
|
|
|
798
798
|
expect(onComposed).not.toHaveBeenCalled();
|
|
799
799
|
});
|
|
800
800
|
|
|
801
|
+
it("claims again when starting the composed runtime fails", async () => {
|
|
802
|
+
const unhandled: unknown[] = [];
|
|
803
|
+
const capture = (reason: unknown) => {
|
|
804
|
+
unhandled.push(reason);
|
|
805
|
+
};
|
|
806
|
+
process.on("unhandledRejection", capture);
|
|
807
|
+
const runtimes = [
|
|
808
|
+
{ stop: vi.fn() } as unknown as ComposedWorkflowRuntime,
|
|
809
|
+
{ stop: vi.fn() } as unknown as ComposedWorkflowRuntime,
|
|
810
|
+
];
|
|
811
|
+
const compose = vi
|
|
812
|
+
.fn<() => Promise<ComposedWorkflowRuntime>>()
|
|
813
|
+
.mockResolvedValueOnce(runtimes[0]!)
|
|
814
|
+
.mockResolvedValueOnce(runtimes[1]!);
|
|
815
|
+
const onComposed = vi
|
|
816
|
+
.fn<(workflows: ComposedWorkflowRuntime) => Promise<void>>()
|
|
817
|
+
.mockRejectedValueOnce(new Error("start failed"))
|
|
818
|
+
.mockResolvedValueOnce(undefined);
|
|
819
|
+
const logger = stubLogger();
|
|
820
|
+
const retry = retryWorkflowSingleton({
|
|
821
|
+
compose,
|
|
822
|
+
onComposed,
|
|
823
|
+
logger,
|
|
824
|
+
intervalMs: 20,
|
|
825
|
+
});
|
|
826
|
+
try {
|
|
827
|
+
await vi.waitFor(() => expect(onComposed).toHaveBeenCalledTimes(2));
|
|
828
|
+
expect(onComposed).toHaveBeenLastCalledWith(runtimes[1]);
|
|
829
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
830
|
+
expect(unhandled).toEqual([]);
|
|
831
|
+
expect(logger.error).toHaveBeenCalled();
|
|
832
|
+
} finally {
|
|
833
|
+
await retry.stop();
|
|
834
|
+
process.off("unhandledRejection", capture);
|
|
835
|
+
}
|
|
836
|
+
});
|
|
837
|
+
|
|
801
838
|
it("composes without a claim only when the host opts out", async () => {
|
|
802
839
|
const clientModule = await buildReactorModule();
|
|
803
840
|
const relationalDb = createRelationalDb(pglite()) as IRelationalDb;
|