@powerhousedao/switchboard 6.2.3-dev.6 → 6.2.3-dev.60
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/attachments/byte-grants.test.d.ts +2 -0
- package/.tsbuild/test/attachments/byte-grants.test.d.ts.map +1 -0
- package/.tsbuild/test/attachments/byte-routes-read-gate.integration.test.d.ts +2 -0
- package/.tsbuild/test/attachments/byte-routes-read-gate.integration.test.d.ts.map +1 -0
- package/.tsbuild/test/attachments/reserve-metadata-parity.test.d.ts +2 -0
- package/.tsbuild/test/attachments/reserve-metadata-parity.test.d.ts.map +1 -0
- package/.tsbuild/test/attachments/url-signer.test.d.ts +2 -0
- package/.tsbuild/test/attachments/url-signer.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-create-signature-policy.test.d.ts +2 -0
- package/.tsbuild/test/boot-create-signature-policy.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-inspection-enabled.test.d.ts +2 -0
- package/.tsbuild/test/boot-inspection-enabled.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-mcp-enabled.test.d.ts +2 -0
- package/.tsbuild/test/boot-mcp-enabled.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-privacy.test.d.ts +2 -0
- package/.tsbuild/test/boot-privacy.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-unsupported-stored-documents.test.d.ts +2 -0
- package/.tsbuild/test/boot-unsupported-stored-documents.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-without-renown.test.d.ts +2 -0
- package/.tsbuild/test/boot-without-renown.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-without-require-signatures.test.d.ts +2 -0
- package/.tsbuild/test/boot-without-require-signatures.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-worker-trust-policy.test.d.ts +2 -0
- package/.tsbuild/test/boot-worker-trust-policy.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-workflow-singleton-conflict.test.d.ts +2 -0
- package/.tsbuild/test/boot-workflow-singleton-conflict.test.d.ts.map +1 -0
- package/.tsbuild/test/boot-workflow-singleton-retry.test.d.ts +2 -0
- package/.tsbuild/test/boot-workflow-singleton-retry.test.d.ts.map +1 -0
- package/.tsbuild/test/builder-defaults.test.d.ts +2 -0
- package/.tsbuild/test/builder-defaults.test.d.ts.map +1 -0
- package/.tsbuild/test/create-signature-policy.test.d.ts +2 -0
- package/.tsbuild/test/create-signature-policy.test.d.ts.map +1 -0
- package/.tsbuild/test/durable-node-fs-pg16.test.d.ts +2 -0
- package/.tsbuild/test/durable-node-fs-pg16.test.d.ts.map +1 -0
- package/.tsbuild/test/fatal-shutdown.test.d.ts +2 -0
- package/.tsbuild/test/fatal-shutdown.test.d.ts.map +1 -0
- package/.tsbuild/test/inspection-flag.test.d.ts +2 -0
- package/.tsbuild/test/inspection-flag.test.d.ts.map +1 -0
- package/.tsbuild/test/inspection-throttle.test.d.ts +2 -0
- package/.tsbuild/test/inspection-throttle.test.d.ts.map +1 -0
- package/.tsbuild/test/mcp-flag.test.d.ts +2 -0
- package/.tsbuild/test/mcp-flag.test.d.ts.map +1 -0
- package/.tsbuild/test/observability-signals.test.d.ts +2 -0
- package/.tsbuild/test/observability-signals.test.d.ts.map +1 -0
- package/.tsbuild/test/pglite-preflight.test.d.ts +2 -0
- package/.tsbuild/test/pglite-preflight.test.d.ts.map +1 -0
- package/.tsbuild/test/plugin-presence.test.d.ts +2 -0
- package/.tsbuild/test/plugin-presence.test.d.ts.map +1 -0
- package/.tsbuild/test/renown-trust-policy.test.d.ts +2 -0
- package/.tsbuild/test/renown-trust-policy.test.d.ts.map +1 -0
- package/.tsbuild/test/snapshot-writer.d.ts +18 -0
- package/.tsbuild/test/snapshot-writer.d.ts.map +1 -0
- package/.tsbuild/test/unsupported-stored-documents.test.d.ts +2 -0
- package/.tsbuild/test/unsupported-stored-documents.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/harness.d.ts +56 -0
- package/.tsbuild/test/workflow/harness.d.ts.map +1 -0
- package/.tsbuild/test/workflow/oauth.test.d.ts +2 -0
- package/.tsbuild/test/workflow/oauth.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/resolvers.test.d.ts +2 -0
- package/.tsbuild/test/workflow/resolvers.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-dedupe.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-dedupe.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-signed.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-signed.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-trigger-test.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-trigger-test.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow/webhook-unsigned.test.d.ts +2 -0
- package/.tsbuild/test/workflow/webhook-unsigned.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow-reactor-access.test.d.ts +2 -0
- package/.tsbuild/test/workflow-reactor-access.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow-reactor-enforcement.test.d.ts +2 -0
- package/.tsbuild/test/workflow-reactor-enforcement.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow-read-gate.test.d.ts +2 -0
- package/.tsbuild/test/workflow-read-gate.test.d.ts.map +1 -0
- package/.tsbuild/test/workflow-runtime.test.d.ts +2 -0
- package/.tsbuild/test/workflow-runtime.test.d.ts.map +1 -0
- package/.tsbuild/tsconfig.tsbuildinfo +1 -1
- package/.tsbuild/tsdown.config.d.ts.map +1 -1
- package/.tsbuild/vitest.config.d.ts.map +1 -1
- package/Auth.md +144 -2
- package/CHANGELOG.md +736 -0
- package/README.md +47 -10
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +50 -50
- package/dist/index.mjs.map +1 -1
- package/dist/install-packages.d.mts +2 -1
- package/dist/install-packages.mjs +2 -2
- package/dist/install-packages.mjs.map +1 -1
- package/dist/mcp-cNWW82NH.mjs +27 -0
- package/dist/mcp-cNWW82NH.mjs.map +1 -0
- package/dist/migrate.d.mts +2 -1
- package/dist/migrate.mjs +4 -3
- package/dist/migrate.mjs.map +1 -1
- package/dist/plugin-host-CGO4XZzK.d.mts +38 -0
- package/dist/plugin-host-CGO4XZzK.d.mts.map +1 -0
- package/dist/plugins/attachments.d.mts +23 -0
- package/dist/plugins/attachments.d.mts.map +1 -0
- package/dist/plugins/attachments.mjs +4 -0
- package/dist/plugins/mcp.d.mts +21 -0
- package/dist/plugins/mcp.d.mts.map +1 -0
- package/dist/plugins/mcp.mjs +4 -0
- package/dist/plugins/privacy.d.mts +12 -0
- package/dist/plugins/privacy.d.mts.map +1 -0
- package/dist/plugins/privacy.mjs +4 -0
- package/dist/plugins/workflows.d.mts +36 -0
- package/dist/plugins/workflows.d.mts.map +1 -0
- package/dist/plugins/workflows.mjs +4 -0
- package/dist/privacy-C8KVimKF.mjs +113 -0
- package/dist/privacy-C8KVimKF.mjs.map +1 -0
- package/dist/{server-CiKkVE6g.mjs → server-C9RQTWTA.mjs} +1132 -222
- package/dist/server-C9RQTWTA.mjs.map +1 -0
- package/dist/server.d.mts +158 -30
- package/dist/server.d.mts.map +1 -1
- package/dist/server.mjs +4 -5
- package/dist/{utils-Baw7rThP.mjs → utils-uaBlzyjS.mjs} +15 -9
- package/dist/utils-uaBlzyjS.mjs.map +1 -0
- package/dist/utils.d.mts +4 -5
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs +3 -3
- package/dist/workflow-runtime-7GaJ13c9.d.mts +30 -0
- package/dist/workflow-runtime-7GaJ13c9.d.mts.map +1 -0
- package/dist/workflows-qKtqZhn3.mjs +1338 -0
- package/dist/workflows-qKtqZhn3.mjs.map +1 -0
- package/package.json +49 -20
- package/scripts/install-packages.sh +0 -0
- package/test/attachment-reference-read-model.test.ts +6 -1
- package/test/attachments/auth.test.ts +85 -0
- package/test/attachments/byte-grants.test.ts +290 -0
- package/test/attachments/byte-routes-read-gate.integration.test.ts +314 -0
- package/test/attachments/download-target.test.ts +201 -32
- package/test/attachments/index.test.ts +47 -4
- package/test/attachments/reserve-metadata-parity.test.ts +96 -0
- package/test/attachments/routes-integration.test.ts +60 -4
- package/test/attachments/routes.test.ts +271 -24
- package/test/attachments/service-config.test.ts +13 -3
- package/test/attachments/url-signer.test.ts +105 -0
- package/test/boot-create-signature-policy.test.ts +108 -0
- package/test/boot-inspection-enabled.test.ts +150 -0
- package/test/boot-mcp-enabled.test.ts +130 -0
- package/test/boot-privacy.test.ts +243 -0
- package/test/boot-unsupported-stored-documents.test.ts +213 -0
- package/test/boot-without-renown.test.ts +81 -0
- package/test/boot-without-require-signatures.test.ts +74 -0
- package/test/boot-worker-trust-policy.test.ts +90 -0
- package/test/boot-workflow-singleton-conflict.test.ts +107 -0
- package/test/boot-workflow-singleton-retry.test.ts +133 -0
- package/test/builder-defaults.test.ts +80 -0
- package/test/create-signature-policy.test.ts +69 -0
- package/test/durable-node-fs-pg16.test.ts +80 -0
- package/test/fatal-shutdown.test.ts +165 -0
- package/test/inspection-flag.test.ts +62 -0
- package/test/inspection-throttle.test.ts +23 -0
- package/test/mcp-flag.test.ts +56 -0
- package/test/observability-signals.test.ts +131 -0
- package/test/pglite-dialect.test.ts +217 -2
- package/test/pglite-preflight.test.ts +313 -0
- package/test/pglite-version.test.ts +9 -1
- package/test/plugin-presence.test.ts +269 -0
- package/test/renown-trust-policy.test.ts +315 -0
- package/test/snapshot-writer.ts +94 -0
- package/test/unsupported-stored-documents.test.ts +72 -0
- package/test/worker-pool.test.ts +27 -1
- package/test/workflow/harness.ts +289 -0
- package/test/workflow/oauth.test.ts +214 -0
- package/test/workflow/resolvers.test.ts +357 -0
- package/test/workflow/webhook-dedupe.test.ts +295 -0
- package/test/workflow/webhook-signed.test.ts +509 -0
- package/test/workflow/webhook-trigger-test.test.ts +82 -0
- package/test/workflow/webhook-unsigned.test.ts +345 -0
- package/test/workflow-reactor-access.test.ts +384 -0
- package/test/workflow-reactor-enforcement.test.ts +808 -0
- package/test/workflow-read-gate.test.ts +213 -0
- package/test/workflow-runtime.test.ts +1122 -0
- package/tsconfig.json +11 -2
- package/tsdown.config.ts +9 -1
- package/dist/server-CiKkVE6g.mjs.map +0 -1
- package/dist/utils-Baw7rThP.mjs.map +0 -1
package/dist/server.d.mts
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
|
+
import { n as WorkflowTriggersCapability } from "./workflow-runtime-7GaJ13c9.mjs";
|
|
1
2
|
import { ILogger } from "document-model";
|
|
2
|
-
import
|
|
3
|
+
import "@powerhousedao/reactor-api/pglite-node";
|
|
4
|
+
import { ChannelScheme, Database, IDocumentModelLoader, IReactorClient, InProcessReactorClientModule, JwtHandler, ModelManifestEntry, PoolInstrumentation, ReactorBuilder, ReactorClientBuilder, ReactorFeatureFlags, ReactorStorageFacts, SignerConfig, UnsupportedStoredDocuments, UnsupportedStoredProtocolError } from "@powerhousedao/reactor";
|
|
3
5
|
import { AttachmentReferenceProjectionCapability } from "@powerhousedao/reactor-api";
|
|
4
6
|
import { IAttachmentService } from "@powerhousedao/reactor-attachments";
|
|
5
7
|
import { IRenown } from "@renown/sdk/node";
|
|
8
|
+
import { Kysely } from "kysely";
|
|
9
|
+
import { IErasureService } from "@powerhousedao/reactor-privacy";
|
|
10
|
+
import { ResolvedPlugin } from "@powerhousedao/host-core";
|
|
6
11
|
import { DriveInput } from "@powerhousedao/shared/document-drive";
|
|
12
|
+
import { DocumentModelModule, ISigner, SignaturePolicy, UpgradeManifest } from "@powerhousedao/shared/document-model";
|
|
13
|
+
import "@electric-sql/pglite";
|
|
7
14
|
import { IRenown as IRenown$1 } from "@renown/sdk";
|
|
8
|
-
|
|
9
|
-
|
|
15
|
+
//#region src/pglite-version.d.ts
|
|
16
|
+
declare const SUPPORTED_PG_MAJORS: readonly [16, 17];
|
|
17
|
+
type SupportedPgMajor = (typeof SUPPORTED_PG_MAJORS)[number];
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/privacy.d.mts
|
|
20
|
+
type PrivacyOptions = {
|
|
21
|
+
/** Wins over PH_PRIVACY_ENABLED. */
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
/** Wins over PH_PRIVACY_DEPLOYMENT_SECRET. */
|
|
24
|
+
deploymentSecret?: string;
|
|
25
|
+
/** The reactor's signer, for a caller-provided reactor. */
|
|
26
|
+
signer?: ISigner;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
10
29
|
//#region src/types.d.ts
|
|
11
30
|
/**
|
|
12
31
|
* Drive container document type chosen for the boot-time default drive. The
|
|
@@ -14,27 +33,28 @@ import { DocumentModelModule, UpgradeManifest } from "@powerhousedao/shared/docu
|
|
|
14
33
|
* `powerhouse/reactor-drive` is wired through `addDefaultReactorDrive` and
|
|
15
34
|
* uses the relationship-based child graph.
|
|
16
35
|
*/
|
|
17
|
-
type SwitchboardDriveDocumentType = "powerhouse/document-drive" | "powerhouse/reactor-drive";
|
|
36
|
+
export type SwitchboardDriveDocumentType = "powerhouse/document-drive" | "powerhouse/reactor-drive";
|
|
18
37
|
/** A {@link DriveInput} extended with the optional drive-container type. */
|
|
19
|
-
type SwitchboardDriveInput = DriveInput & {
|
|
38
|
+
export type SwitchboardDriveInput = DriveInput & {
|
|
20
39
|
documentType?: SwitchboardDriveDocumentType;
|
|
21
40
|
};
|
|
22
|
-
type StorageOptions = {
|
|
41
|
+
export type StorageOptions = {
|
|
23
42
|
type: "filesystem" | "memory" | "postgres" | "browser";
|
|
24
43
|
filesystemPath?: string;
|
|
25
44
|
postgresUrl?: string;
|
|
26
45
|
};
|
|
27
|
-
type IdentityOptions = {
|
|
28
|
-
/** Path to the keypair file. Defaults to ~/.ph/keypair.json */
|
|
46
|
+
export type IdentityOptions = {
|
|
47
|
+
/** Path to the keypair file. Defaults to ~/.ph/keypair.json */
|
|
48
|
+
keypairPath?: string;
|
|
29
49
|
/**
|
|
30
50
|
* If true, won't start without an existing keypair.
|
|
31
51
|
* Use this to ensure the switchboard only runs with an authenticated identity.
|
|
32
52
|
*/
|
|
33
|
-
requireExisting?: boolean;
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
requireExisting?: boolean;
|
|
54
|
+
/** Base url of the Renown instance to use */
|
|
55
|
+
baseUrl?: string;
|
|
36
56
|
};
|
|
37
|
-
type StartServerOptions = {
|
|
57
|
+
export type StartServerOptions = {
|
|
38
58
|
/**
|
|
39
59
|
* Pre-built ReactorClientModule (typically from
|
|
40
60
|
* `@powerhousedao/reactor#ReactorClientBuilder.buildModule`). When set, the
|
|
@@ -56,6 +76,14 @@ type StartServerOptions = {
|
|
|
56
76
|
* pieces as needed.
|
|
57
77
|
*/
|
|
58
78
|
reactor?: InProcessReactorClientModule;
|
|
79
|
+
/**
|
|
80
|
+
* Route uncaught exceptions, and unhandled rejections nothing else listens
|
|
81
|
+
* for, through the reactor's SIGTERM shutdown, so PGlite stores are flushed
|
|
82
|
+
* before the process exits with code 1. Installed once the switchboard's own reactor is built;
|
|
83
|
+
* ignored when `reactor` is passed. For process entry points only, since
|
|
84
|
+
* it adds process-wide listeners.
|
|
85
|
+
*/
|
|
86
|
+
fatalErrorShutdown?: boolean;
|
|
59
87
|
/**
|
|
60
88
|
* Registry URL for the HttpPackageLoader. Enables `PackagesSubgraph`
|
|
61
89
|
* (install/uninstall mutations) plus dynamic package resolution.
|
|
@@ -85,9 +113,28 @@ type StartServerOptions = {
|
|
|
85
113
|
* When configured, the switchboard will load the keypair from `ph login`
|
|
86
114
|
* and can authenticate with remote services on behalf of the user.
|
|
87
115
|
*/
|
|
88
|
-
identity?: IdentityOptions;
|
|
116
|
+
identity?: IdentityOptions;
|
|
117
|
+
/** Base URL for the attachment service; defaults to `PH_SWITCHBOARD_PUBLIC_URL` then `http(s)://localhost:${port}`. */
|
|
89
118
|
attachmentServiceUrl?: string;
|
|
119
|
+
/** Mount the MCP server at `/mcp`. On by default; `false` wins over
|
|
120
|
+
* MCP_ENABLED, which can turn it off but never on. */
|
|
90
121
|
mcp?: boolean;
|
|
122
|
+
/** The plugin composition to boot with (FEATURE_PLUGIN_HOST_ENABLED): the
|
|
123
|
+
* resolved host.js runner.plugins entries, supplied by the uniform-runners
|
|
124
|
+
* switchboard runner (R2 step 2) or a test. Omitted = the built-in default
|
|
125
|
+
* composition. Resolved plugins, not specifiers — resolution happens at the
|
|
126
|
+
* runner against the PROJECT dependency tree. */
|
|
127
|
+
pluginComposition?: ResolvedPlugin[];
|
|
128
|
+
/** Mount the read-only inspection subgraph at `/graphql/inspection`. On by
|
|
129
|
+
* default; `false` wins over INSPECTION_ENABLED, which can turn it off. */
|
|
130
|
+
inspection?: boolean;
|
|
131
|
+
/** Powerhouse workflows: the runtime, its subgraph, its webhooks and its
|
|
132
|
+
* document models. Wins over PH_WORKFLOWS_ENABLED and the config file. */
|
|
133
|
+
workflows?: {
|
|
134
|
+
enabled?: boolean;
|
|
135
|
+
};
|
|
136
|
+
/** The GDPR add-on; off unless this or PH_PRIVACY_ENABLED turns it on. */
|
|
137
|
+
privacy?: PrivacyOptions;
|
|
91
138
|
processorConfig?: Map<string, unknown>;
|
|
92
139
|
disableLocalPackages?: boolean;
|
|
93
140
|
enableDocumentModelSubgraphs?: boolean;
|
|
@@ -144,12 +191,40 @@ type StartServerOptions = {
|
|
|
144
191
|
enabled?: boolean;
|
|
145
192
|
dbPoolSize?: number;
|
|
146
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* Stored documents at protocol versions this build does not run: "refuse"
|
|
196
|
+
* (the default) fails the boot with a StoredDocumentsRefusedError;
|
|
197
|
+
* "read-only" starts with a warning and keeps those documents read-only.
|
|
198
|
+
* Unset falls back to the REACTOR_UNSUPPORTED_STORED_DOCUMENTS env var.
|
|
199
|
+
* Ignored when `reactor` is passed.
|
|
200
|
+
*/
|
|
201
|
+
unsupportedStoredDocuments?: UnsupportedStoredDocuments;
|
|
147
202
|
};
|
|
148
|
-
type SwitchboardReactor = {
|
|
203
|
+
export type SwitchboardReactor = {
|
|
149
204
|
defaultDriveUrl: string | undefined;
|
|
150
|
-
reactor: IReactorClient;
|
|
151
|
-
|
|
152
|
-
|
|
205
|
+
reactor: IReactorClient;
|
|
206
|
+
/** Switchboard-backed remote attachment service over its own `/attachments/*` API, for downstream consumers.
|
|
207
|
+
* Undefined when the attachments plugin is absent from the composition
|
|
208
|
+
* (FEATURE_PLUGIN_HOST_ENABLED — presence is activation, rewire R2.3). */
|
|
209
|
+
attachmentService: IAttachmentService | undefined;
|
|
210
|
+
/** Whether the authoritative attachment-reference projection is active. */
|
|
211
|
+
attachmentReferenceProjection: AttachmentReferenceProjectionCapability;
|
|
212
|
+
/** Whether the workflow runtime's operation intake is indexing. Undefined
|
|
213
|
+
* when workflows are off; unavailable means no document trigger fires. */
|
|
214
|
+
workflowTriggers?: WorkflowTriggersCapability;
|
|
215
|
+
/** Whether workflows are on, after the option, PH_WORKFLOWS_ENABLED and the config file. */
|
|
216
|
+
workflowsEnabled: boolean;
|
|
217
|
+
/** The boot list of importable models workers and workflow pieces load; empty when none are resolved. */
|
|
218
|
+
modelManifest(): ModelManifestEntry[];
|
|
219
|
+
/** Present when the privacy add-on runs: its erasure service. */
|
|
220
|
+
privacy?: {
|
|
221
|
+
erasure: IErasureService;
|
|
222
|
+
};
|
|
223
|
+
/** Whether `/mcp` is mounted, after the option and MCP_ENABLED. */
|
|
224
|
+
mcpEnabled: boolean;
|
|
225
|
+
/** Whether `/graphql/inspection` is mounted, after the option and INSPECTION_ENABLED. */
|
|
226
|
+
inspectionEnabled: boolean;
|
|
227
|
+
/** The Renown instance if identity was initialized */
|
|
153
228
|
renown: IRenown$1 | null;
|
|
154
229
|
/**
|
|
155
230
|
* Port the HTTP server actually bound to. May differ from the requested
|
|
@@ -173,29 +248,57 @@ type SwitchboardReactor = {
|
|
|
173
248
|
//#endregion
|
|
174
249
|
//#region src/builder-defaults.d.mts
|
|
175
250
|
type SwitchboardReactorDefaultsOptions = {
|
|
176
|
-
documentModels?: DocumentModelModule[];
|
|
177
|
-
|
|
251
|
+
documentModels?: DocumentModelModule[];
|
|
252
|
+
/** Upgrade manifests for versioned models, one per document type. */
|
|
253
|
+
upgradeManifests?: UpgradeManifest<readonly number[]>[];
|
|
254
|
+
/** Default true. */
|
|
178
255
|
includeBaseModels?: boolean;
|
|
179
256
|
/**
|
|
180
257
|
* Channel scheme. Defaults to `ChannelScheme.SWITCHBOARD`, which populates
|
|
181
258
|
* `reactorModule.syncModule.syncManager` — required by reactor-api. Set
|
|
182
|
-
* to `false`
|
|
259
|
+
* to `false` if the caller configures sync itself (`withChannelScheme` or
|
|
260
|
+
* `withSync`); the builder refuses both together.
|
|
183
261
|
*/
|
|
184
|
-
channelScheme?: ChannelScheme | false;
|
|
185
|
-
|
|
262
|
+
channelScheme?: ChannelScheme | false;
|
|
263
|
+
/** Defaults to true. Set false when the caller owns SIGINT handling. */
|
|
264
|
+
signalHandlers?: boolean;
|
|
265
|
+
/** Executor tuning. Omit to use the reactor's own defaults. */
|
|
186
266
|
executorConfig?: {
|
|
187
267
|
maxSkipThreshold?: number;
|
|
188
268
|
featureFlags?: Partial<ReactorFeatureFlags>;
|
|
189
|
-
};
|
|
269
|
+
};
|
|
270
|
+
/** Wire dynamic document-model loading via HTTP. */
|
|
190
271
|
documentModelLoader?: IDocumentModelLoader;
|
|
191
272
|
logger?: ILogger;
|
|
192
273
|
/**
|
|
193
|
-
* Identity signer (typically from `getRenownSignerConfig`).
|
|
194
|
-
*
|
|
274
|
+
* Identity signer (typically from `getRenownSignerConfig`). Signs client
|
|
275
|
+
* writes and the operations the executor synthesizes, in pooled workers
|
|
276
|
+
* through `workerSigner`; omit for unsigned operation.
|
|
195
277
|
*/
|
|
196
278
|
signer?: SignerConfig;
|
|
279
|
+
/**
|
|
280
|
+
* Which keys may sign as which users (typically from
|
|
281
|
+
* `getRenownTrustPolicyConfig`); wins over one carried by `signer`.
|
|
282
|
+
*/
|
|
283
|
+
trustPolicy?: Pick<SignerConfig, "trustPolicy" | "workerTrustPolicy">;
|
|
284
|
+
/** What the client creates new documents as; see `resolveCreateSignaturePolicy`. */
|
|
285
|
+
createSignaturePolicy?: SignaturePolicy;
|
|
197
286
|
};
|
|
198
|
-
declare function applySwitchboardReactorDefaults(reactorBuilder: ReactorBuilder, clientBuilder: ReactorClientBuilder, options?: SwitchboardReactorDefaultsOptions): void;
|
|
287
|
+
export declare function applySwitchboardReactorDefaults(reactorBuilder: ReactorBuilder, clientBuilder: ReactorClientBuilder, options?: SwitchboardReactorDefaultsOptions): void;
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/unsupported-stored-documents.d.mts
|
|
290
|
+
/** From REACTOR_UNSUPPORTED_STORED_DOCUMENTS; `input` wins when defined. */
|
|
291
|
+
export declare function resolveUnsupportedStoredDocuments(input: UnsupportedStoredDocuments | undefined, env: NodeJS.ProcessEnv): UnsupportedStoredDocuments;
|
|
292
|
+
/** The reactor refused to start over documents this build does not run. */
|
|
293
|
+
export declare class StoredDocumentsRefusedError extends Error {
|
|
294
|
+
readonly versions: readonly {
|
|
295
|
+
protocol: string;
|
|
296
|
+
version: number;
|
|
297
|
+
}[];
|
|
298
|
+
readonly documents: number;
|
|
299
|
+
constructor(cause: UnsupportedStoredProtocolError);
|
|
300
|
+
static isError(error: unknown): error is StoredDocumentsRefusedError;
|
|
301
|
+
}
|
|
199
302
|
//#endregion
|
|
200
303
|
//#region src/server.d.mts
|
|
201
304
|
/**
|
|
@@ -203,9 +306,33 @@ declare function applySwitchboardReactorDefaults(reactorBuilder: ReactorBuilder,
|
|
|
203
306
|
* the port is free, false if the OS reports it in use. Any other error is
|
|
204
307
|
* surfaced so we don't silently mask real issues (permissions, bad host, …).
|
|
205
308
|
*/
|
|
206
|
-
declare function isPortAvailable(port: number): Promise<boolean>;
|
|
309
|
+
export declare function isPortAvailable(port: number): Promise<boolean>;
|
|
310
|
+
/**
|
|
311
|
+
* The reactor's storage handle, plus the pool instrumentation when that
|
|
312
|
+
* storage is Postgres. The PGlite branch has no `pg.Pool` at all, so the
|
|
313
|
+
* instrumentation is absent rather than optional-by-convention.
|
|
314
|
+
*/
|
|
315
|
+
type ReactorStorage = {
|
|
316
|
+
kysely: Kysely<Database>;
|
|
317
|
+
poolInstrumentation: PoolInstrumentation | undefined;
|
|
318
|
+
storageFacts: ReactorStorageFacts;
|
|
319
|
+
};
|
|
320
|
+
export declare function createReactorKysely(opts: {
|
|
321
|
+
reactorDbUrl: string | undefined;
|
|
322
|
+
reactorPgliteDir: string | null;
|
|
323
|
+
reactorPgliteMajor: SupportedPgMajor | null;
|
|
324
|
+
inMemory: boolean;
|
|
325
|
+
/**
|
|
326
|
+
* Resolved lazily: only the Postgres branch has a host pool, and
|
|
327
|
+
* {@link resolveHostPoolSize} throws on a bad REACTOR_DB_POOL_SIZE_HOST.
|
|
328
|
+
* Called eagerly it would fail a PGlite-backed server over a value that
|
|
329
|
+
* path never reads.
|
|
330
|
+
*/
|
|
331
|
+
hostPoolSize: () => number;
|
|
332
|
+
logger: ILogger;
|
|
333
|
+
}): Promise<ReactorStorage>;
|
|
207
334
|
/** Derive the remote attachment service config for switchboard's own `/attachments/*` API. */
|
|
208
|
-
declare function deriveAttachmentServiceConfig(options: Pick<StartServerOptions, "attachmentServiceUrl" | "https">, serverPort: number, renown: IRenown | null): {
|
|
335
|
+
export declare function deriveAttachmentServiceConfig(options: Pick<StartServerOptions, "attachmentServiceUrl" | "https">, serverPort: number, renown: IRenown | null): {
|
|
209
336
|
remoteUrl: string;
|
|
210
337
|
jwtHandler: JwtHandler | undefined;
|
|
211
338
|
};
|
|
@@ -226,7 +353,8 @@ declare function deriveAttachmentServiceConfig(options: Pick<StartServerOptions,
|
|
|
226
353
|
* trigger the `withShutdownHook` chain that disposes the api. Programmatic
|
|
227
354
|
* full teardown isn't currently exposed — wire it via SIGINT/SIGTERM.
|
|
228
355
|
*/
|
|
229
|
-
declare const startSwitchboard: (options?: StartServerOptions) => Promise<SwitchboardReactor>;
|
|
356
|
+
export declare const startSwitchboard: (options?: StartServerOptions) => Promise<SwitchboardReactor>;
|
|
230
357
|
//#endregion
|
|
231
|
-
export {
|
|
358
|
+
export type { SwitchboardReactorDefaultsOptions, WorkflowTriggersCapability };
|
|
359
|
+
export {};
|
|
232
360
|
//# sourceMappingURL=server.d.mts.map
|
package/dist/server.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.mts","names":[],"sources":["../src/types.ts","../src/builder-defaults.mts","../src/server.mts"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"server.d.mts","names":[],"sources":["../src/pglite-version.ts","../src/privacy.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;;;;;;;;;;YCRC;;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;;;;;;EAMA,oBAAoB;;;EAGpB;;;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;;;;EAIT,mBAAmB;;EAEnB,+BAA+B;;;EAG/B,mBAAmB;;EAEnB;;EAEA,iBAAiB;;EAEjB;IAAY,SAAS;;;EAErB;;EAEA;;EAEA,QAAQ;;;;;EAKR;;;;;;;;;;;;;EAaA,gBAAgB;;;;KC7NN;EAIV,iBAAiB;;EAEjB,mBAAmB;;EAEnB;;;;;;;EAOA,gBAAgB;;EAEhB;;EAEA;IACE;IACA,eAAe,QAAQ;;;EAGzB,sBAAsB;EACtB,SAAS;;;;;;EAMT,SAAS;;;;;EAKT,cAAc,KAAK;;EAEnB,wBAAwB;;wBAiBV,gCACd,gBAAgB,gBAChB,eAAe,sBACf,UAAS;;;;wBCvEK,kCACd,OAAO,wCACP,KAAK,OAAO,aACX;;qBAaU,oCAAoC;WACtC;IAAqB;IAAkB;;WACvC;EAET,YAAY,OAAO;SAcZ,QAAQ,iBAAiB,SAAS;;;;;;;;;wBC6L3B,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;;;;;;;;;;;;;;;;;;;qBAmnCvB,mBAAgB,UAClB,uBACR,QAAQ"}
|
package/dist/server.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
//# debugId=43d97572-0a08-5683-83a3-d8477151600e
|
|
2
|
+
import { a as StoredDocumentsRefusedError, c as applySwitchboardReactorDefaults, i as startSwitchboard, n as deriveAttachmentServiceConfig, o as resolveUnsupportedStoredDocuments, r as isPortAvailable, t as createReactorKysely } from "./server-C9RQTWTA.mjs";
|
|
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]="21bbbc15-c131-5f91-94c1-5b4d5dd195f4")}catch(e){}}();
|
|
5
|
+
//# debugId=21bbbc15-c131-5f91-94c1-5b4d5dd195f4
|
|
@@ -1,8 +1,16 @@
|
|
|
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]="5ece528d-aafb-5305-a04d-e0c45c8c30a3")}catch(e){}}();
|
|
3
3
|
import { reactorDriveCreateDocument, reactorDriveCreateState } from "@powerhousedao/reactor-drive";
|
|
4
4
|
import { driveCreateDocument, driveCreateState } from "@powerhousedao/shared/document-drive";
|
|
5
|
+
import { withSignaturePolicy } from "@powerhousedao/shared/document-model";
|
|
5
6
|
//#region src/utils.mts
|
|
7
|
+
/**
|
|
8
|
+
* A configured id pins the drive, and only a legacy drive can take a chosen
|
|
9
|
+
* id; otherwise the client's creation default applies.
|
|
10
|
+
*/
|
|
11
|
+
async function underCreatePolicy(client, document, id) {
|
|
12
|
+
return id ? withSignaturePolicy(document, "legacy", { id }) : withSignaturePolicy(document, await client.getCreateSignaturePolicy());
|
|
13
|
+
}
|
|
6
14
|
async function addDefaultDrive(client, drive, serverPort) {
|
|
7
15
|
let driveId = drive.id;
|
|
8
16
|
if (!driveId || driveId.length === 0) driveId = drive.slug;
|
|
@@ -13,7 +21,7 @@ async function addDefaultDrive(client, drive, serverPort) {
|
|
|
13
21
|
} catch {}
|
|
14
22
|
if (existingDrive) return `http://localhost:${serverPort}/d/${driveId}`;
|
|
15
23
|
const { global } = driveCreateState();
|
|
16
|
-
const document = driveCreateDocument({
|
|
24
|
+
const document = await underCreatePolicy(client, driveCreateDocument({
|
|
17
25
|
global: {
|
|
18
26
|
...global,
|
|
19
27
|
name: drive.global.name,
|
|
@@ -25,8 +33,7 @@ async function addDefaultDrive(client, drive, serverPort) {
|
|
|
25
33
|
listeners: drive.local?.listeners ?? [],
|
|
26
34
|
triggers: drive.local?.triggers ?? []
|
|
27
35
|
}
|
|
28
|
-
});
|
|
29
|
-
if (drive.id && drive.id.length > 0) document.header.id = drive.id;
|
|
36
|
+
}), drive.id);
|
|
30
37
|
if (drive.slug && drive.slug.length > 0) document.header.slug = drive.slug;
|
|
31
38
|
if (drive.global.name) document.header.name = drive.global.name;
|
|
32
39
|
if (drive.preferredEditor) document.header.meta = { preferredEditor: drive.preferredEditor };
|
|
@@ -47,7 +54,7 @@ async function addDefaultReactorDrive(client, drive, serverPort) {
|
|
|
47
54
|
} catch {}
|
|
48
55
|
if (existingDrive) return `http://localhost:${serverPort}/d/${driveId}`;
|
|
49
56
|
const { global, local } = reactorDriveCreateState();
|
|
50
|
-
const document = reactorDriveCreateDocument({
|
|
57
|
+
const document = await underCreatePolicy(client, reactorDriveCreateDocument({
|
|
51
58
|
global: {
|
|
52
59
|
...global,
|
|
53
60
|
name: drive.global.name,
|
|
@@ -58,8 +65,7 @@ async function addDefaultReactorDrive(client, drive, serverPort) {
|
|
|
58
65
|
availableOffline: drive.local?.availableOffline ?? local.availableOffline,
|
|
59
66
|
sharingType: drive.local?.sharingType ?? local.sharingType
|
|
60
67
|
}
|
|
61
|
-
});
|
|
62
|
-
if (drive.id && drive.id.length > 0) document.header.id = drive.id;
|
|
68
|
+
}), drive.id);
|
|
63
69
|
if (drive.slug && drive.slug.length > 0) document.header.slug = drive.slug;
|
|
64
70
|
if (drive.global.name) document.header.name = drive.global.name;
|
|
65
71
|
if (drive.preferredEditor) document.header.meta = { preferredEditor: drive.preferredEditor };
|
|
@@ -76,5 +82,5 @@ function isPostgresUrl(url) {
|
|
|
76
82
|
//#endregion
|
|
77
83
|
export { addDefaultReactorDrive as n, isPostgresUrl as r, addDefaultDrive as t };
|
|
78
84
|
|
|
79
|
-
//# sourceMappingURL=utils-
|
|
80
|
-
//# debugId=
|
|
85
|
+
//# sourceMappingURL=utils-uaBlzyjS.mjs.map
|
|
86
|
+
//# debugId=5ece528d-aafb-5305-a04d-e0c45c8c30a3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-uaBlzyjS.mjs","sources":["../src/utils.mts"],"sourcesContent":["import type { IReactorClient } from \"@powerhousedao/reactor\";\nimport {\n reactorDriveCreateDocument,\n reactorDriveCreateState,\n} from \"@powerhousedao/reactor-drive\";\nimport {\n driveCreateDocument,\n driveCreateState,\n} from \"@powerhousedao/shared/document-drive\";\nimport type { DriveInput } from \"@powerhousedao/shared/document-drive\";\nimport {\n withSignaturePolicy,\n type PHDocument,\n} from \"@powerhousedao/shared/document-model\";\n\n/**\n * A configured id pins the drive, and only a legacy drive can take a chosen\n * id; otherwise the client's creation default applies.\n */\nasync function underCreatePolicy<TDocument extends PHDocument>(\n client: IReactorClient,\n document: TDocument,\n id: string | undefined,\n): Promise<TDocument> {\n return id\n ? withSignaturePolicy(document, \"legacy\", { id })\n : withSignaturePolicy(document, await client.getCreateSignaturePolicy());\n}\n\nexport async function addDefaultDrive(\n client: IReactorClient,\n drive: DriveInput,\n serverPort: number,\n) {\n let driveId = drive.id;\n if (!driveId || driveId.length === 0) {\n driveId = drive.slug;\n }\n\n if (!driveId || driveId.length === 0) {\n throw new Error(\"Invalid Drive Id\");\n }\n\n // check if the drive already exists\n let existingDrive;\n try {\n existingDrive = await client.get(driveId);\n } catch {\n //\n }\n\n // already exists, return the existing drive url\n if (existingDrive) {\n return `http://localhost:${serverPort}/d/${driveId}`;\n }\n\n const { global } = driveCreateState();\n const created = driveCreateDocument({\n global: {\n ...global,\n name: drive.global.name,\n icon: drive.global.icon ?? global.icon,\n },\n local: {\n availableOffline: drive.local?.availableOffline ?? false,\n sharingType: drive.local?.sharingType ?? \"public\",\n listeners: drive.local?.listeners ?? [],\n triggers: drive.local?.triggers ?? [],\n },\n });\n\n const document = await underCreatePolicy(client, created, drive.id);\n if (drive.slug && drive.slug.length > 0) {\n document.header.slug = drive.slug;\n }\n if (drive.global.name) {\n document.header.name = drive.global.name;\n }\n if (drive.preferredEditor) {\n document.header.meta = { preferredEditor: drive.preferredEditor };\n }\n\n try {\n await client.create(document);\n } catch (e) {\n const errorMessage = e instanceof Error ? e.message : String(e);\n if (!errorMessage.includes(\"already exists\")) {\n throw e;\n }\n }\n\n return `http://localhost:${serverPort}/d/${driveId}`;\n}\n\nexport async function addDefaultReactorDrive(\n client: IReactorClient,\n drive: DriveInput,\n serverPort: number,\n) {\n let driveId = drive.id;\n if (!driveId || driveId.length === 0) {\n driveId = drive.slug;\n }\n\n if (!driveId || driveId.length === 0) {\n throw new Error(\"Invalid Drive Id\");\n }\n\n let existingDrive;\n try {\n existingDrive = await client.get(driveId);\n } catch {\n //\n }\n\n if (existingDrive) {\n return `http://localhost:${serverPort}/d/${driveId}`;\n }\n\n const { global, local } = reactorDriveCreateState();\n const created = reactorDriveCreateDocument({\n global: {\n ...global,\n name: drive.global.name,\n icon: drive.global.icon ?? global.icon,\n },\n local: {\n ...local,\n availableOffline: drive.local?.availableOffline ?? local.availableOffline,\n sharingType: drive.local?.sharingType ?? local.sharingType,\n },\n });\n\n const document = await underCreatePolicy(client, created, drive.id);\n if (drive.slug && drive.slug.length > 0) {\n document.header.slug = drive.slug;\n }\n if (drive.global.name) {\n document.header.name = drive.global.name;\n }\n if (drive.preferredEditor) {\n document.header.meta = { preferredEditor: drive.preferredEditor };\n }\n\n try {\n await client.create(document);\n } catch (e) {\n const errorMessage = e instanceof Error ? e.message : String(e);\n if (!errorMessage.includes(\"already exists\")) {\n throw e;\n }\n }\n\n return `http://localhost:${serverPort}/d/${driveId}`;\n}\n\nexport function isPostgresUrl(url: string) {\n return url.startsWith(\"postgresql\") || url.startsWith(\"postgres\");\n}\n"],"names":[],"mappings":"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","debug_id":"5ece528d-aafb-5305-a04d-e0c45c8c30a3"}
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { IReactorClient } from "@powerhousedao/reactor";
|
|
2
2
|
import { DriveInput } from "@powerhousedao/shared/document-drive";
|
|
3
|
-
|
|
4
3
|
//#region src/utils.d.mts
|
|
5
|
-
declare function addDefaultDrive(client: IReactorClient, drive: DriveInput, serverPort: number): Promise<string>;
|
|
6
|
-
declare function addDefaultReactorDrive(client: IReactorClient, drive: DriveInput, serverPort: number): Promise<string>;
|
|
7
|
-
declare function isPostgresUrl(url: string): boolean;
|
|
4
|
+
export declare function addDefaultDrive(client: IReactorClient, drive: DriveInput, serverPort: number): Promise<string>;
|
|
5
|
+
export declare function addDefaultReactorDrive(client: IReactorClient, drive: DriveInput, serverPort: number): Promise<string>;
|
|
6
|
+
export declare function isPostgresUrl(url: string): boolean;
|
|
8
7
|
//#endregion
|
|
9
|
-
export {
|
|
8
|
+
export {};
|
|
10
9
|
//# sourceMappingURL=utils.d.mts.map
|
package/dist/utils.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/utils.mts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/utils.mts"],"mappings":";;;wBA6BsB,gBACpB,QAAQ,gBACR,OAAO,YACP,qBAAkB;wBA8DE,uBACpB,QAAQ,gBACR,OAAO,YACP,qBAAkB;wBA2DJ,cAAc"}
|
package/dist/utils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as addDefaultReactorDrive, r as isPostgresUrl, t as addDefaultDrive } from "./utils-
|
|
1
|
+
import { n as addDefaultReactorDrive, r as isPostgresUrl, t as addDefaultDrive } from "./utils-uaBlzyjS.mjs";
|
|
2
2
|
export { addDefaultDrive, addDefaultReactorDrive, isPostgresUrl };
|
|
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]="e030fa72-327e-52e2-9ac0-68feb4ef300a")}catch(e){}}();
|
|
4
|
+
//# debugId=e030fa72-327e-52e2-9ac0-68feb4ef300a
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ILogger } from "document-model";
|
|
2
|
+
import { IReactorClient, InProcessReactorClientModule, ModelManifestEntry, ReactorBuilder } from "@powerhousedao/reactor";
|
|
3
|
+
import { SubgraphClass } from "@powerhousedao/reactor-api";
|
|
4
|
+
import "@powerhousedao/shared/document-model";
|
|
5
|
+
import "@powerhousedao/reactor-workflow";
|
|
6
|
+
import "@powerhousedao/shared/processors";
|
|
7
|
+
//#region src/workflow-runtime.d.mts
|
|
8
|
+
/** Whether the operation intake is indexing. Same shape as the attachment
|
|
9
|
+
* reference projection, because it is the same limitation. */
|
|
10
|
+
type WorkflowTriggersCapability = {
|
|
11
|
+
status: "available";
|
|
12
|
+
} | {
|
|
13
|
+
status: "unavailable";
|
|
14
|
+
reason: "in-process-reactor-module-unavailable" | "live-read-model-registration-unsupported" | "workflow-singleton-lost";
|
|
15
|
+
};
|
|
16
|
+
interface ComposedWorkflowRuntime {
|
|
17
|
+
subgraph: SubgraphClass;
|
|
18
|
+
/** Whether document operations reach the runtime at all; unavailable once
|
|
19
|
+
* the singleton is lost. */
|
|
20
|
+
readonly triggers: WorkflowTriggersCapability;
|
|
21
|
+
/** The owner name this host holds the workflow singleton under; undefined
|
|
22
|
+
* when the lease was not taken (a suite that opted out). */
|
|
23
|
+
singletonOwner?: string;
|
|
24
|
+
start(): Promise<void>;
|
|
25
|
+
stop(): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { WorkflowTriggersCapability as n, ComposedWorkflowRuntime as t };
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=workflow-runtime-7GaJ13c9.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-runtime-7GaJ13c9.d.mts","names":[],"sources":["../src/workflow-runtime.mts"],"mappings":";;;;;;;;;KAiEY;EACN;;EAEA;EACA;;UAuRW;EACf,UAAU;;;WAGD,UAAU;;;EAGnB;EACA,SAAS;EACT,QAAQ"}
|