@powerhousedao/reactor-workflow 6.2.3-dev.24 → 6.2.3-dev.26

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/README.md CHANGED
@@ -215,7 +215,9 @@ releases what an earlier enable registered. The reason reads
215
215
  **Auth**
216
216
 
217
217
  - CustomAuth `refresh`: rejected, as `CustomAuth refresh` (#3091).
218
- - `auth` as an array: rejected, as `Multi-auth (auth as an array)` (#3091).
218
+ - `auth` as an array runs through the method whose type matches the
219
+ connection's. The piece is refused only when none of its methods can run,
220
+ with the first method's reason.
219
221
  - OAuth2 and OIDC: rejected, as `OAuth2 auth` and `OIDC auth` (#3091). Their
220
222
  connections are refused at check and run too.
221
223
  - `server` in `validate` and `getConnectionIdentifier` is a throwing stub.
@@ -1,4 +1,4 @@
1
- import { R as unsupportedAuth, U as getActions, W as getTriggers, z as unsupportedTrigger } from "./redact-C2y8tU--.js";
1
+ import { B as unsupportedTrigger, G as getTriggers, W as getActions, z as unsupportedAuth } from "./redact-DM3JhxdF.js";
2
2
  import { createRequire } from "node:module";
3
3
  import { readFileSync, realpathSync } from "node:fs";
4
4
  import path from "node:path";
@@ -133,6 +133,19 @@ function isPropertyObject(value) {
133
133
  function withUnsupported(feature) {
134
134
  return feature ? { unsupported: feature } : {};
135
135
  }
136
+ function describeAuthMethod(auth) {
137
+ if (!auth || typeof auth !== "object") return void 0;
138
+ const method = auth;
139
+ const props = method.props && typeof method.props === "object" ? describeProperties(method.props) : [];
140
+ return {
141
+ type: method.type ?? "UNKNOWN",
142
+ displayName: method.displayName,
143
+ description: method.description,
144
+ required: method.required,
145
+ ...props.length > 0 ? { props } : {},
146
+ ...withUnsupported(unsupportedAuth(method))
147
+ };
148
+ }
136
149
  function buildDescriptor(piece, source) {
137
150
  const actions = Object.entries(getActions(piece)).map(([actionName, action]) => ({
138
151
  name: action.name ?? actionName,
@@ -170,20 +183,16 @@ function buildDescriptor(piece, source) {
170
183
  triggers,
171
184
  ...withUnsupported(unsupportedAuth(piece.auth))
172
185
  };
173
- if (Array.isArray(piece.auth)) return descriptor;
174
- if (piece.auth && typeof piece.auth === "object") {
175
- const authProps = piece.auth.props && typeof piece.auth.props === "object" ? describeProperties(piece.auth.props) : [];
176
- descriptor.auth = {
177
- type: piece.auth.type ?? "UNKNOWN",
178
- displayName: piece.auth.displayName,
179
- description: piece.auth.description,
180
- required: piece.auth.required,
181
- ...authProps.length > 0 ? { props: authProps } : {}
182
- };
186
+ if (Array.isArray(piece.auth)) {
187
+ const methods = piece.auth.map(describeAuthMethod).filter((method) => method !== void 0);
188
+ if (methods.length > 0) descriptor.auth = methods;
189
+ } else {
190
+ const method = describeAuthMethod(piece.auth);
191
+ if (method) descriptor.auth = method;
183
192
  }
184
193
  return descriptor;
185
194
  }
186
195
  //#endregion
187
196
  export { loadPieceFromDir as i, describeProperties as n, loadPiece as r, buildDescriptor as t };
188
197
 
189
- //# sourceMappingURL=descriptor-E4swpRpd.js.map
198
+ //# sourceMappingURL=descriptor-CtMB-wPx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor-CtMB-wPx.js","names":[],"sources":["../src/pieces/activepieces/loader.ts","../src/pieces/activepieces/descriptor.ts"],"sourcesContent":["import { readFileSync, realpathSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { ApPiece } from \"./types.js\";\n\nexport interface LoadedPiece {\n piece: ApPiece;\n entryPath: string;\n // Which duck-type check identified the export.\n check: \"constructor-name\" | \"structural\";\n}\n\n// Resolves a bundle's entry file. Published bundles typically carry only\n// `main` (no `exports`, no `type` — they are CJS).\nexport function resolveEntry(pieceDir: string): string {\n const raw = readFileSync(path.join(pieceDir, \"package.json\"), \"utf8\");\n const pkg = JSON.parse(raw) as {\n main?: string;\n module?: string;\n exports?: Record<string, unknown>;\n };\n const dotExport = pkg.exports?.[\".\"];\n const candidates: (string | undefined)[] = [];\n if (typeof dotExport === \"string\") candidates.push(dotExport);\n if (dotExport && typeof dotExport === \"object\") {\n const cond = dotExport as Record<string, unknown>;\n for (const key of [\"import\", \"require\", \"default\"]) {\n const value = cond[key];\n if (typeof value === \"string\") candidates.push(value);\n }\n }\n candidates.push(pkg.main, pkg.module, \"src/index.js\", \"index.js\", \"main.js\");\n // A bundle's manifest (or a symlink inside it) must not point the entry\n // outside pieceDir; realpath so a symlink can't launder the escape.\n const root = realpathSync(pieceDir);\n const rootWithSep = root + path.sep;\n for (const candidate of candidates) {\n if (!candidate) continue;\n const abs = path.resolve(pieceDir, candidate);\n let real: string;\n try {\n real = realpathSync(abs);\n } catch {\n continue; // candidate doesn't exist; try the next one\n }\n if (real !== root && !real.startsWith(rootWithSep)) continue;\n return abs;\n }\n throw new Error(`No entry file found for piece bundle at ${pieceDir}`);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\n// Identify the piece by constructor name (their own loader's check), falling\n// back to structure for bundles minified without keepNames. No `instanceof`.\nfunction findPiece(\n mod: Record<string, unknown>,\n): Pick<LoadedPiece, \"piece\" | \"check\"> | undefined {\n const candidates: unknown[] = [\n ...Object.values(mod),\n ...(isRecord(mod.default) ? Object.values(mod.default) : []),\n mod.default,\n ];\n for (const candidate of candidates) {\n // `constructor?.name`: a bundle may export an Object.create(null), and the\n // real piece is usually beside it in the same module.\n if (isRecord(candidate) && candidate.constructor?.name === \"Piece\") {\n return {\n piece: candidate as unknown as ApPiece,\n check: \"constructor-name\",\n };\n }\n }\n for (const candidate of candidates) {\n if (\n isRecord(candidate) &&\n typeof candidate.displayName === \"string\" &&\n (isRecord(candidate.actions) ||\n typeof candidate.actions === \"function\" ||\n typeof candidate.getAction === \"function\")\n ) {\n return { piece: candidate as unknown as ApPiece, check: \"structural\" };\n }\n }\n return undefined;\n}\n\n// A module the piece names and node cannot find. Dependencies are installed\n// with scripts disabled, so a native or downloaded one looks like this.\nfunction missingModule(entryPath: string, error: unknown): Error | undefined {\n const code = (error as { code?: unknown } | null)?.code;\n if (code !== \"ERR_MODULE_NOT_FOUND\" && code !== \"MODULE_NOT_FOUND\") {\n return undefined;\n }\n const detail = error instanceof Error ? error.message : String(error);\n return new Error(\n `Piece at ${entryPath} could not be loaded: it imports a module that is ` +\n `not there. Its dependencies are installed with lifecycle scripts ` +\n `disabled, so one that compiles or downloads on install -- a native ` +\n `addon, a browser download -- cannot be prepared here. ${detail}`,\n );\n}\n\n// ESM-first `import()` — Node's CJS interop handles the typical CJS bundle —\n// with a `require` fallback.\nexport async function loadPiece(entryPath: string): Promise<LoadedPiece> {\n let mod: Record<string, unknown>;\n try {\n mod = (await import(\n /* @vite-ignore */ pathToFileURL(entryPath).href\n )) as Record<string, unknown>;\n } catch (imported) {\n try {\n const require = createRequire(import.meta.url);\n mod = require(entryPath) as Record<string, unknown>;\n } catch (required) {\n // The import's error names the missing module; require's often names\n // only the entry it was handed.\n throw (\n missingModule(entryPath, imported) ??\n missingModule(entryPath, required) ??\n required\n );\n }\n }\n const found = findPiece(mod);\n if (!found) {\n throw new Error(\n `No Piece export found in ${entryPath}. Export keys: ${Object.keys(mod).join(\", \")}`,\n );\n }\n return { ...found, entryPath };\n}\n\nexport async function loadPieceFromDir(pieceDir: string): Promise<LoadedPiece> {\n return loadPiece(resolveEntry(pieceDir));\n}\n","import {\n getActions,\n getTriggers,\n type ApPiece,\n type ApProperty,\n type ApPropertyType,\n type ApDropdownOption,\n type ApTrigger,\n type ApTriggerStrategy,\n} from \"./types.js\";\nimport {\n unsupportedAuth,\n unsupportedTrigger,\n type UnsupportedFeature,\n} from \"./unsupported.js\";\n\nexport interface PiecePropDescriptor {\n name: string;\n displayName: string;\n description?: string;\n placeholder?: string;\n type: ApPropertyType;\n required: boolean;\n defaultValue?: unknown;\n // STATIC_DROPDOWN choices, extracted so the editor needs no runtime call.\n staticOptions?: ApDropdownOption[];\n // True when the prop carries a design-time resolver (DROPDOWN options() / DYNAMIC props()).\n hasDynamicResolver: boolean;\n // Synthesised domain-provider id: activepieces:<pkg>#<action>.<prop> (doc 08 §6.3).\n // Only top-level props get one; nested resolvers are not addressable yet.\n dynamicResolverId?: string;\n // Sibling prop names whose values feed the resolver; the editor re-runs\n // it when any of them changes.\n refreshers?: string[];\n // Nested shape: an ARRAY item's fields, or the props a DYNAMIC resolver\n // produced (see describeProperties). OBJECT props are free-form and carry none.\n properties?: PiecePropDescriptor[];\n}\n\nexport interface PieceActionDescriptor {\n name: string;\n displayName: string;\n description?: string;\n // UI metadata only — not a credential contract (spike finding).\n requireAuth: boolean;\n props: PiecePropDescriptor[];\n // Carried verbatim: it is what the expression picker builds a later step's\n // field list from, and a package piece has no published listing to read.\n outputSchema?: unknown;\n // Orders the action picker, so a package piece that declares it must be\n // ordered by it too rather than counting as unset.\n audience?: string;\n}\n\nexport interface PieceTriggerDescriptor {\n name: string;\n displayName: string;\n description?: string;\n strategy: ApTriggerStrategy;\n testStrategy?: string;\n requireAuth: boolean;\n props: PiecePropDescriptor[];\n outputSchema?: unknown;\n hasSampleData: boolean;\n // The sample itself, not just whether there is one: a trigger that declares\n // no outputSchema is read for its shape instead.\n sampleData?: unknown;\n // How the sender proves the endpoint exists before it will register it.\n // Absent when the trigger declares no handshake, or declares NONE.\n handshake?: { strategy: string; paramName?: string };\n // A trigger feature the engine cannot run; the piece's own is on the piece.\n unsupported?: UnsupportedFeature;\n}\n\nexport interface PieceAuthDescriptor {\n type: ApPropertyType;\n displayName?: string;\n description?: string;\n required?: boolean;\n // CUSTOM_AUTH's own fields. Without them a connection form has nothing to\n // ask for, which is what a piece read from a package rather than a published\n // listing would otherwise leave the editor with.\n props?: PiecePropDescriptor[];\n // Set when this engine can't sign in this way (OAuth2, for one).\n unsupported?: UnsupportedFeature;\n}\n\n// NONE is how the framework spells \"no handshake\", so it is not carried:\n// a caller checking the field would otherwise have to know that too.\nfunction describeHandshake(\n trigger: ApTrigger,\n): { strategy: string; paramName?: string } | undefined {\n const strategy = trigger.handshakeConfiguration?.strategy;\n if (!strategy || strategy === \"NONE\") return undefined;\n return { strategy, paramName: trigger.handshakeConfiguration?.paramName };\n}\n\nexport interface PieceSource {\n packageName: string;\n version: string;\n}\n\n// Serializable descriptor of an adapted piece; the engine never learns\n// Activepieces exists (doc 08 §6.2).\nexport interface PieceDescriptor {\n id: string;\n source: PieceSource;\n displayName: string;\n description?: string;\n logoUrl?: string;\n categories?: string[];\n // A list when the piece offers several sign-in methods.\n auth?: PieceAuthDescriptor | PieceAuthDescriptor[];\n minimumSupportedRelease?: string;\n maximumSupportedRelease?: string;\n actions: PieceActionDescriptor[];\n triggers: PieceTriggerDescriptor[];\n // Set when no block of the piece can run here, e.g. an OAuth2 piece.\n unsupported?: UnsupportedFeature;\n}\n\nfunction hasResolver(prop: ApProperty): boolean {\n return typeof prop.options === \"function\" || typeof prop.props === \"function\";\n}\n\nfunction toPropDescriptor(\n name: string,\n prop: ApProperty,\n resolverId?: string,\n): PiecePropDescriptor {\n const dynamic = hasResolver(prop);\n const descriptor: PiecePropDescriptor = {\n name,\n displayName: prop.displayName ?? name,\n type: prop.type ?? \"UNKNOWN\",\n required: prop.required ?? false,\n hasDynamicResolver: dynamic,\n };\n if (typeof prop.description === \"string\" && prop.description !== \"\") {\n descriptor.description = prop.description;\n }\n if (typeof prop.placeholder === \"string\" && prop.placeholder !== \"\") {\n descriptor.placeholder = prop.placeholder;\n }\n if (prop.defaultValue !== undefined) {\n descriptor.defaultValue = prop.defaultValue;\n }\n if (dynamic && resolverId) {\n descriptor.dynamicResolverId = resolverId;\n }\n if (dynamic && Array.isArray(prop.refreshers)) {\n descriptor.refreshers = prop.refreshers.filter(\n (entry): entry is string => typeof entry === \"string\",\n );\n }\n if (typeof prop.options === \"object\" && Array.isArray(prop.options.options)) {\n descriptor.staticOptions = prop.options.options.map((o) => ({\n label: o.label,\n value: o.value,\n }));\n }\n if (prop.properties && typeof prop.properties === \"object\") {\n const nested = describeProperties(prop.properties);\n if (nested.length > 0) descriptor.properties = nested;\n }\n return descriptor;\n}\n\n// Descriptor list for a props map: nested ARRAY items and what a DYNAMIC\n// resolver returns, so the editor never sees raw piece properties.\nexport function describeProperties(\n props: Record<string, ApProperty> | null | undefined,\n resolverIdFor?: (propName: string) => string,\n): PiecePropDescriptor[] {\n if (!props || typeof props !== \"object\") return [];\n return Object.entries(props)\n .filter((entry): entry is [string, ApProperty] =>\n isPropertyObject(entry[1]),\n )\n .map(([propName, prop]) =>\n toPropDescriptor(propName, prop, resolverIdFor?.(propName)),\n );\n}\n\n// Bundles are duck-typed; a props map may carry non-object junk.\nfunction isPropertyObject(value: unknown): value is ApProperty {\n return value !== null && typeof value === \"object\";\n}\n\nfunction withUnsupported(feature: UnsupportedFeature | undefined): {\n unsupported?: UnsupportedFeature;\n} {\n return feature ? { unsupported: feature } : {};\n}\n\n// Pure translation over a loaded piece; performs no I/O and never executes\n// piece code beyond the actions()/triggers() accessors.\nfunction describeAuthMethod(auth: unknown): PieceAuthDescriptor | undefined {\n if (!auth || typeof auth !== \"object\") return undefined;\n const method = auth as ApProperty;\n // CUSTOM_AUTH carries a record here; a DYNAMIC prop would carry a\n // resolver function, which is not an auth shape at all.\n const props =\n method.props && typeof method.props === \"object\"\n ? describeProperties(method.props)\n : [];\n return {\n type: method.type ?? \"UNKNOWN\",\n displayName: method.displayName,\n description: method.description,\n required: method.required,\n ...(props.length > 0 ? { props } : {}),\n ...withUnsupported(unsupportedAuth(method)),\n };\n}\n\nexport function buildDescriptor(\n piece: ApPiece,\n source: PieceSource,\n): PieceDescriptor {\n const actions = Object.entries(getActions(piece)).map(\n ([actionName, action]): PieceActionDescriptor => ({\n name: action.name ?? actionName,\n displayName: action.displayName ?? actionName,\n description: action.description,\n requireAuth: action.requireAuth ?? false,\n props: describeProperties(\n action.props,\n (propName) =>\n `activepieces:${source.packageName}#${actionName}.${propName}`,\n ),\n ...(action.outputSchema !== undefined\n ? { outputSchema: action.outputSchema }\n : {}),\n ...(action.audience !== undefined ? { audience: action.audience } : {}),\n }),\n );\n\n const triggers = Object.entries(getTriggers(piece)).map(\n ([triggerName, trigger]): PieceTriggerDescriptor => ({\n name: trigger.name ?? triggerName,\n displayName: trigger.displayName ?? triggerName,\n description: trigger.description,\n strategy: trigger.type ?? \"UNKNOWN\",\n testStrategy: trigger.testStrategy,\n requireAuth: trigger.requireAuth ?? false,\n props: describeProperties(\n trigger.props,\n (propName) =>\n `activepieces:${source.packageName}#${triggerName}.${propName}`,\n ),\n ...(trigger.outputSchema !== undefined\n ? { outputSchema: trigger.outputSchema }\n : {}),\n hasSampleData:\n trigger.sampleData !== undefined && trigger.sampleData !== null,\n ...(trigger.sampleData !== undefined && trigger.sampleData !== null\n ? { sampleData: trigger.sampleData }\n : {}),\n handshake: describeHandshake(trigger),\n ...withUnsupported(unsupportedTrigger(trigger)),\n }),\n );\n\n const descriptor: PieceDescriptor = {\n id: `activepieces:${source.packageName}`,\n source,\n displayName: piece.displayName,\n description: piece.description,\n logoUrl: piece.logoUrl,\n categories: piece.categories,\n minimumSupportedRelease: piece.minimumSupportedRelease,\n maximumSupportedRelease: piece.maximumSupportedRelease,\n actions,\n triggers,\n ...withUnsupported(unsupportedAuth(piece.auth)),\n };\n // Several methods stay a list, in the piece's order; each says whether this\n // engine can run it.\n if (Array.isArray(piece.auth)) {\n const methods = piece.auth\n .map(describeAuthMethod)\n .filter((method) => method !== undefined);\n if (methods.length > 0) descriptor.auth = methods;\n } else {\n const method = describeAuthMethod(piece.auth);\n if (method) descriptor.auth = method;\n }\n return descriptor;\n}\n"],"mappings":";;;;;;AAeA,SAAgB,aAAa,UAA0B;CACrD,MAAM,MAAM,aAAa,KAAK,KAAK,UAAU,cAAc,GAAG,MAAM;CACpE,MAAM,MAAM,KAAK,MAAM,GAAG;CAK1B,MAAM,YAAY,IAAI,UAAU;CAChC,MAAM,aAAqC,CAAC;CAC5C,IAAI,OAAO,cAAc,UAAU,WAAW,KAAK,SAAS;CAC5D,IAAI,aAAa,OAAO,cAAc,UAAU;E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;EACf,YAAY,MAAM;EAClB,yBAAyB,MAAM;EAC/B,yBAAyB,MAAM;EAC/B;EACA;EACA,GAAG,gBAAgB,gBAAgB,MAAM,IAAI,CAAC;CAChD;CAGA,IAAI,MAAM,QAAQ,MAAM,IAAI,GAAG;EAC7B,MAAM,UAAU,MAAM,KACnB,IAAI,kBAAkB,CAAC,CACvB,QAAQ,WAAW,WAAW,KAAA,CAAS;EAC1C,IAAI,QAAQ,SAAS,GAAG,WAAW,OAAO;CAC5C,OAAO;EACL,MAAM,SAAS,mBAAmB,MAAM,IAAI;EAC5C,IAAI,QAAQ,WAAW,OAAO;CAChC;CACA,OAAO;AACT"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { C as EgressPolicy, _ as PieceWorker, a as AttachmentPort, c as ConnectionRequest, d as SecretStore, m as WorkflowRunResult, n as packagePieces, p as StepExecutionRecord, t as PieceRegistry, v as PieceWorkerResult, x as PieceResolver } from "./piece-registry-q4bgYbXa.js";
1
+ import { S as PieceResolver, h as WorkflowRunResult, i as AttachmentPort, n as packagePieces, p as StepExecutionRecord, s as ConnectionRequest, t as PieceRegistry, u as SecretStore, v as PieceWorker, w as EgressPolicy, y as PieceWorkerResult } from "./piece-registry-D6dvy2OD.js";
2
2
  import { ActionBase, TriggerBase } from "@powerhousedao/pieces-framework";
3
3
  import { ILogger, OperationWithContext } from "document-model";
4
4
  import { BaseReadModel, DocumentViewDatabase, IConsistencyTracker, IOperationIndex, IReactorClient, IWriteCache, ReadModelRegistrationStage } from "@powerhousedao/reactor";
5
+ import { AuthSubject } from "@powerhousedao/shared/document-model";
5
6
  import { IRelationalDb, IWebhookScope, WebhookField, WebhookHashAlgorithm, WebhookPolicy, WebhookReply, WebhookRequest, WebhookSignatureEncoding } from "@powerhousedao/shared/processors";
6
-
7
7
  //#region src/reactor/attachment-port.d.ts
8
8
  interface AttachmentClientLike {
9
9
  upload(input: {
@@ -25,13 +25,13 @@ interface AttachmentClientLike {
25
25
  body: ReadableStream<Uint8Array>;
26
26
  }>;
27
27
  }
28
- declare function createAttachmentPort(client: AttachmentClientLike, documentIdFor: () => string | undefined, canReadRef: (documentId: string, ref: string) => Promise<boolean>): AttachmentPort;
28
+ export declare function createAttachmentPort(client: AttachmentClientLike, documentIdFor: () => string | undefined, canReadRef: (documentId: string, ref: string) => Promise<boolean>): AttachmentPort;
29
29
  //#endregion
30
30
  //#region src/reactor/package-name.d.ts
31
- declare const WORKFLOW_PACKAGE_NAME = "@powerhousedao/workflow";
31
+ export declare const WORKFLOW_PACKAGE_NAME = "@powerhousedao/workflow";
32
32
  //#endregion
33
33
  //#region src/pieces/activepieces/registry-source.d.ts
34
- declare function setPieceRegistryUrl(url: string | undefined): void;
34
+ export declare function setPieceRegistryUrl(url: string | undefined): void;
35
35
  //#endregion
36
36
  //#region src/reactor/host.d.ts
37
37
  type WorkflowCaller = object;
@@ -40,6 +40,7 @@ interface WorkflowRuntimeHostDeps {
40
40
  reactorClient: IReactorClient;
41
41
  assertCanRead(identifier: string, caller: WorkflowCaller): Promise<unknown>;
42
42
  assertCanWrite(identifier: string, caller: WorkflowCaller): Promise<unknown>;
43
+ subjectOf?(caller: WorkflowCaller): AuthSubject;
43
44
  webhooks?: IWebhookScope;
44
45
  attachments?: AttachmentClientLike;
45
46
  canReadAttachmentRef?(documentId: string, ref: string): Promise<boolean>;
@@ -150,6 +151,12 @@ interface StepExecutionRow {
150
151
  output: string | null;
151
152
  port: string | null;
152
153
  error: string | null;
154
+ started_at: string | null;
155
+ ended_at: string | null;
156
+ }
157
+ interface RunDocumentRow {
158
+ run_id: string;
159
+ document_id: string;
153
160
  }
154
161
  interface TriggerStateRow {
155
162
  workflow_id: string;
@@ -182,6 +189,7 @@ interface PieceStoreRow {
182
189
  interface WorkflowRuntimeDB {
183
190
  run: RunRow;
184
191
  step_execution: StepExecutionRow;
192
+ run_document: RunDocumentRow;
185
193
  trigger_state: TriggerStateRow;
186
194
  trigger_dedupe: TriggerDedupeRow;
187
195
  piece_store: PieceStoreRow;
@@ -222,6 +230,8 @@ declare class WorkflowRunStore {
222
230
  listRuns(workflowId?: string | string[], limit?: number): Promise<RunRow[]>;
223
231
  getRun(id: string): Promise<RunRow | undefined>;
224
232
  getSteps(runId: string): Promise<StepExecutionRow[]>;
233
+ recordRunDocuments(runId: string, documentIds: string[]): Promise<void>;
234
+ getRunDocuments(runId: string): Promise<string[]>;
225
235
  getTriggerState(workflowId: string): Promise<TriggerStateRow | undefined>;
226
236
  upsertTriggerState(row: TriggerStateRow): Promise<void>;
227
237
  setTriggerStatus(workflowId: string, status: string, error?: string): Promise<void>;
@@ -353,7 +363,7 @@ interface WebhookEndpointRecord {
353
363
  armed: boolean;
354
364
  createdAt: string;
355
365
  }
356
- declare class WorkflowRuntimeService {
366
+ export declare class WorkflowRuntimeService {
357
367
  private readonly host;
358
368
  private readonly logger;
359
369
  private readonly attachments?;
@@ -465,6 +475,9 @@ declare class WorkflowRuntimeService {
465
475
  private readableDocuments;
466
476
  private readableRows;
467
477
  private canReadDocument;
478
+ private servedRuns;
479
+ private servesDocuments;
480
+ private servesRunDocument;
468
481
  private assertCanReadDocument;
469
482
  private assertCanWriteDocument;
470
483
  blockOptions(blockType: string, propName: string, input?: unknown, connectionId?: string, ctx?: WorkflowCaller): Promise<unknown>;
@@ -483,7 +496,7 @@ declare class WorkflowRuntimeService {
483
496
  rerun(runId: string, ctx?: WorkflowCaller): Promise<PersistedRunResult>;
484
497
  }
485
498
  /** The runtime a host composes: one instance, its lifetime the host's. */
486
- declare function createWorkflowRuntime(deps: WorkflowRuntimeHostDeps): WorkflowRuntimeService;
499
+ export declare function createWorkflowRuntime(deps: WorkflowRuntimeHostDeps): WorkflowRuntimeService;
487
500
  //#endregion
488
501
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/operation-node/operation-node.d.ts
489
502
  type OperationNodeKind = 'IdentifierNode' | 'SchemableIdentifierNode' | 'RawNode' | 'SelectQueryNode' | 'SelectionNode' | 'ReferenceNode' | 'ColumnNode' | 'TableNode' | 'AliasNode' | 'FromNode' | 'SelectAllNode' | 'AndNode' | 'OrNode' | 'ParensNode' | 'ValueNode' | 'ValueListNode' | 'PrimitiveValueListNode' | 'JoinNode' | 'OperatorNode' | 'WhereNode' | 'InsertQueryNode' | 'DeleteQueryNode' | 'ReturningNode' | 'CreateTableNode' | 'ColumnDefinitionNode' | 'AddColumnNode' | 'DropTableNode' | 'DataTypeNode' | 'OrderByNode' | 'OrderByItemNode' | 'GroupByNode' | 'GroupByItemNode' | 'UpdateQueryNode' | 'ColumnUpdateNode' | 'LimitNode' | 'OffsetNode' | 'OnConflictNode' | 'OnDuplicateKeyNode' | 'CreateIndexNode' | 'DropIndexNode' | 'ListNode' | 'ReferencesNode' | 'PrimaryKeyConstraintNode' | 'UniqueConstraintNode' | 'CheckConstraintNode' | 'ForeignKeyConstraintNode' | 'WithNode' | 'CommonTableExpressionNode' | 'HavingNode' | 'CreateSchemaNode' | 'DropSchemaNode' | 'AlterTableNode' | 'ModifyColumnNode' | 'DropColumnNode' | 'RenameColumnNode' | 'AlterColumnNode' | 'AddConstraintNode' | 'DropConstraintNode' | 'CreateViewNode' | 'RefreshMaterializedViewNode' | 'DropViewNode' | 'GeneratedNode' | 'DefaultValueNode' | 'OnNode' | 'ValuesNode' | 'CommonTableExpressionNameNode' | 'SelectModifierNode' | 'CreateTypeNode' | 'DropTypeNode' | 'ExplainNode' | 'DefaultInsertValueNode' | 'AggregateFunctionNode' | 'OverNode' | 'PartitionByNode' | 'PartitionByItemNode' | 'SetOperationNode' | 'BinaryOperationNode' | 'UnaryOperationNode' | 'UsingNode' | 'FunctionNode' | 'CaseNode' | 'WhenNode' | 'JSONReferenceNode' | 'JSONPathNode' | 'JSONPathLegNode' | 'JSONOperatorChainNode' | 'TupleNode' | 'MergeQueryNode' | 'MatchedNode' | 'AddIndexNode' | 'CastNode' | 'FetchNode' | 'TopNode' | 'OutputNode' | 'OrActionNode' | 'CollateNode' | 'RenameConstraintNode';
@@ -713,11 +726,11 @@ declare class MergeResult {
713
726
  * // Columns == 'id' | 'name' | 'species'
714
727
  * ```
715
728
  */
716
- type AnyColumn<DB, TB extends keyof DB> = { [T in TB]: keyof DB[T] }[TB] & string;
729
+ type AnyColumn<DB, TB extends keyof DB> = { [T in TB]: keyof DB[T]; }[TB] & string;
717
730
  /**
718
731
  * Extracts a column type.
719
732
  */
720
- type ExtractColumnType<DB, TB extends keyof DB, C> = { [T in TB]: C extends keyof DB[T] ? DB[T][C] : never }[TB];
733
+ type ExtractColumnType<DB, TB extends keyof DB, C> = { [T in TB]: C extends keyof DB[T] ? DB[T][C] : never; }[TB];
721
734
  /**
722
735
  * Given a database type and a union of table names in that db, returns
723
736
  * a union type with all possible `table`.`column` combinations.
@@ -749,7 +762,7 @@ type ExtractColumnType<DB, TB extends keyof DB, C> = { [T in TB]: C extends keyo
749
762
  * // Columns == 'person.id' | 'pet.name' | 'pet.species'
750
763
  * ```
751
764
  */
752
- type AnyColumnWithTable<DB, TB extends keyof DB> = { [T in TB]: `${T & string}.${keyof DB[T] & string}` }[TB];
765
+ type AnyColumnWithTable<DB, TB extends keyof DB> = { [T in TB]: `${T & string}.${keyof DB[T] & string}`; }[TB];
753
766
  /**
754
767
  * Just like {@link AnyColumn} but with a ` as <string>` suffix.
755
768
  */
@@ -764,7 +777,7 @@ type AnyAliasedColumnWithTable<DB, TB extends keyof DB> = `${AnyColumnWithTable<
764
777
  type ArrayItemType<T> = T extends ReadonlyArray<infer I> ? I : never;
765
778
  type SimplifySingleResult<O> = O extends InsertResult ? O : O extends DeleteResult ? O : O extends UpdateResult ? O : O extends MergeResult ? O : Simplify<O> | undefined;
766
779
  type SimplifyResult<O> = O extends InsertResult ? O : O extends DeleteResult ? O : O extends UpdateResult ? O : O extends MergeResult ? O : Simplify<O>;
767
- type Simplify<T> = DrainOuterGeneric<{ [K in keyof T]: T[K] } & {}>;
780
+ type Simplify<T> = DrainOuterGeneric<{ [K in keyof T]: T[K]; } & {}>;
768
781
  /**
769
782
  * Represents a database row whose column names and their types are unknown.
770
783
  */
@@ -772,12 +785,12 @@ type UnknownRow = Record<string, unknown>;
772
785
  /**
773
786
  * Makes all properties of object type `T` nullable.
774
787
  */
775
- type Nullable<T> = { [P in keyof T]: T[P] | null };
788
+ type Nullable<T> = { [P in keyof T]: T[P] | null; };
776
789
  /**
777
790
  * Evaluates to `true` if `T` is `never`.
778
791
  */
779
792
  type IsNever<T> = [T] extends [never] ? true : false;
780
- type NarrowPartial<O, T> = DrainOuterGeneric<T extends object ? { [K in keyof O & string]: K extends keyof T ? T[K] extends NotNull$1 ? Exclude<O[K], null> : T[K] extends O[K] ? T[K] : KyselyTypeError<`$narrowType() call failed: passed type does not exist in '${K}'s type union`> : O[K] } : never>;
793
+ type NarrowPartial<O, T> = DrainOuterGeneric<T extends object ? { [K in keyof O & string]: K extends keyof T ? T[K] extends NotNull$1 ? Exclude<O[K], null> : T[K] extends O[K] ? T[K] : KyselyTypeError<`$narrowType() call failed: passed type does not exist in '${K}'s type union`> : O[K]; } : never>;
781
794
  /**
782
795
  * A type constant for marking a column as not null. Can be used with `$narrowPartial`.
783
796
  *
@@ -825,13 +838,13 @@ type SqlBool = boolean | 0 | 1;
825
838
  * ```
826
839
  */
827
840
  type DrainOuterGeneric<T> = [T] extends [unknown] ? T : never;
828
- type ShallowRecord<K extends keyof any, T> = DrainOuterGeneric<{ [P in K]: T }>;
841
+ type ShallowRecord<K extends keyof any, T> = DrainOuterGeneric<{ [P in K]: T; }>;
829
842
  /**
830
843
  * Dehydrates any root properties of an object that are not valid JSON types.
831
844
  *
832
845
  * For now, we catch anything in {@link StringsWhenDataTypeNotAvailable} and convert it to `string`.
833
846
  */
834
- type ShallowDehydrateObject<O> = { [K in keyof O]: ShallowDehydrateValue<O[K]> };
847
+ type ShallowDehydrateObject<O> = { [K in keyof O]: ShallowDehydrateValue<O[K]>; };
835
848
  /**
836
849
  * Dehydrates a value when it is not a valid JSON type.
837
850
  *
@@ -2813,7 +2826,6 @@ interface QueryExecutor extends ConnectionProvider {
2813
2826
  * How many rows should be pulled from the database at once. Supported
2814
2827
  * only by the postgres driver.
2815
2828
  */
2816
-
2817
2829
  chunkSize: number): AsyncIterableIterator<QueryResult<R>>;
2818
2830
  /**
2819
2831
  * Returns a copy of this executor with a new connection provider.
@@ -3624,19 +3636,19 @@ type UpdateType<T> = T extends ColumnType<any, any, infer U> ? U : T;
3624
3636
  /**
3625
3637
  * Keys of `R` whose `InsertType` values can be `null` or `undefined`.
3626
3638
  */
3627
- type NullableInsertKeys<R> = { [K in keyof R]: IfNullable<InsertType<R[K]>, K> }[keyof R];
3639
+ type NullableInsertKeys<R> = { [K in keyof R]: IfNullable<InsertType<R[K]>, K>; }[keyof R];
3628
3640
  /**
3629
3641
  * Keys of `R` whose `InsertType` values can't be `null` or `undefined`.
3630
3642
  */
3631
- type NonNullableInsertKeys<R> = { [K in keyof R]: IfNotNullable<InsertType<R[K]>, K> }[keyof R];
3643
+ type NonNullableInsertKeys<R> = { [K in keyof R]: IfNotNullable<InsertType<R[K]>, K>; }[keyof R];
3632
3644
  /**
3633
3645
  * Keys of `R` whose `SelectType` values are not `never`
3634
3646
  */
3635
- type NonNeverSelectKeys<R> = { [K in keyof R]: IfNotNever<SelectType<R[K]>, K> }[keyof R];
3647
+ type NonNeverSelectKeys<R> = { [K in keyof R]: IfNotNever<SelectType<R[K]>, K>; }[keyof R];
3636
3648
  /**
3637
3649
  * Keys of `R` whose `UpdateType` values are not `never`
3638
3650
  */
3639
- type UpdateKeys<R> = { [K in keyof R]: IfNotNever<UpdateType<R[K]>, K> }[keyof R];
3651
+ type UpdateKeys<R> = { [K in keyof R]: IfNotNever<UpdateType<R[K]>, K>; }[keyof R];
3640
3652
  /**
3641
3653
  * Given a table interface, extracts the select type from all
3642
3654
  * {@link ColumnType} types.
@@ -3658,7 +3670,7 @@ type UpdateKeys<R> = { [K in keyof R]: IfNotNever<UpdateType<R[K]>, K> }[keyof R
3658
3670
  * // }
3659
3671
  * ```
3660
3672
  */
3661
- type Selectable<R> = DrainOuterGeneric<{ [K in NonNeverSelectKeys<R>]: SelectType<R[K]> }>;
3673
+ type Selectable<R> = DrainOuterGeneric<{ [K in NonNeverSelectKeys<R>]: SelectType<R[K]>; }>;
3662
3674
  /**
3663
3675
  * Given a table interface, extracts the update type from all
3664
3676
  * {@link ColumnType} types.
@@ -3679,14 +3691,14 @@ type Selectable<R> = DrainOuterGeneric<{ [K in NonNeverSelectKeys<R>]: SelectTyp
3679
3691
  * // }
3680
3692
  * ```
3681
3693
  */
3682
- type Updateable<R> = DrainOuterGeneric<{ [K in UpdateKeys<R>]?: UpdateType<R[K]> }>;
3694
+ type Updateable<R> = DrainOuterGeneric<{ [K in UpdateKeys<R>]?: UpdateType<R[K]>; }>;
3683
3695
  //#endregion
3684
3696
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/parser/binary-operation-parser.d.ts
3685
3697
  type OperandValueExpression<DB, TB extends keyof DB, RE> = ValueExpression<DB, TB, ExtractTypeFromReferenceExpression<DB, TB, RE>>;
3686
3698
  type OperandValueExpressionOrList<DB, TB extends keyof DB, RE> = ValueExpressionOrList<DB, TB, ExtractTypeFromReferenceExpression<DB, TB, RE> | null>;
3687
3699
  type BinaryOperatorExpression = BinaryOperator | Expression<unknown>;
3688
3700
  type ComparisonOperatorExpression = ComparisonOperator | Expression<unknown>;
3689
- type FilterObject<DB, TB extends keyof DB> = IsNever<TB> extends true ? KyselyTypeError<'there are no tables in query context, so a filter object cannot be defined. try passing an array instead.'> : { [R in StringReference<DB, TB>]?: ValueExpressionOrList<DB, TB, SelectType<ExtractTypeFromStringReference<DB, TB, R>>> };
3701
+ type FilterObject<DB, TB extends keyof DB> = IsNever<TB> extends true ? KyselyTypeError<'there are no tables in query context, so a filter object cannot be defined. try passing an array instead.'> : { [R in StringReference<DB, TB>]?: ValueExpressionOrList<DB, TB, SelectType<ExtractTypeFromStringReference<DB, TB, R>>>; };
3690
3702
  //#endregion
3691
3703
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/query-builder/join-builder.d.ts
3692
3704
  declare class JoinBuilder<DB, TB extends keyof DB> implements OperationNodeSource {
@@ -3743,7 +3755,7 @@ type TableExpressionOrList<DB, TB extends keyof DB> = TableExpression<DB, TB> |
3743
3755
  type SimpleTableReference<DB> = AnyAliasedTable<DB> | AnyTable<DB>;
3744
3756
  type AnyAliasedTable<DB> = `${AnyTable<DB>} as ${string}`;
3745
3757
  type AnyTable<DB> = keyof DB & string;
3746
- type From<DB, TE> = DrainOuterGeneric<{ [C in keyof DB | ExtractAliasFromTableExpression<DB, TE>]: C extends ExtractAliasFromTableExpression<DB, TE> ? ExtractRowTypeFromTableExpression<DB, TE, C> : C extends keyof DB ? DB[C] : never }>;
3758
+ type From<DB, TE> = DrainOuterGeneric<{ [C in keyof DB | ExtractAliasFromTableExpression<DB, TE>]: C extends ExtractAliasFromTableExpression<DB, TE> ? ExtractRowTypeFromTableExpression<DB, TE, C> : C extends keyof DB ? DB[C] : never; }>;
3747
3759
  type FromTables<DB, TB extends keyof DB, TE> = DrainOuterGeneric<TB | ExtractAliasFromTableExpression<DB, TE>>;
3748
3760
  type ExtractTableAlias<DB, TE> = TE extends `${string} as ${infer TA}` ? TA extends keyof DB ? TA : never : TE extends keyof DB ? TE : never;
3749
3761
  type ExtractAliasFromTableExpression<DB, TE> = TE extends string ? TE extends `${string} as ${infer TA}` ? TA : TE extends keyof DB ? TE : never : TE extends AliasedExpression<any, infer QA> ? QA : TE extends ((qb: any) => AliasedExpression<any, infer QA>) ? QA : TE extends AliasedDynamicTableBuilder<any, infer DA> ? DA : never;
@@ -3778,17 +3790,17 @@ type SelectCallback<DB, TB extends keyof DB> = (eb: ExpressionBuilder<DB, TB>) =
3778
3790
  /**
3779
3791
  * Turns a SelectExpression or a union of them into a selection object.
3780
3792
  */
3781
- type Selection<DB, TB extends keyof DB, SE> = [DB] extends [unknown] ? { [E in FlattenSelectExpression<SE> as ExtractAliasFromSelectExpression<E>]: SelectType<ExtractTypeFromSelectExpression<DB, TB, E>> } : {};
3793
+ type Selection<DB, TB extends keyof DB, SE> = [DB] extends [unknown] ? { [E in FlattenSelectExpression<SE> as ExtractAliasFromSelectExpression<E>]: SelectType<ExtractTypeFromSelectExpression<DB, TB, E>>; } : {};
3782
3794
  /**
3783
3795
  * Turns a SelectCallback into a selection object.
3784
3796
  */
3785
3797
  type CallbackSelection<DB, TB extends keyof DB, CB> = CB extends ((eb: any) => ReadonlyArray<infer SE>) ? Selection<DB, TB, SE> : never;
3786
- type FlattenSelectExpression<SE> = SE extends DynamicReferenceBuilder<infer RA> ? { [R in RA]: DynamicReferenceBuilder<R> }[RA] : SE;
3798
+ type FlattenSelectExpression<SE> = SE extends DynamicReferenceBuilder<infer RA> ? { [R in RA]: DynamicReferenceBuilder<R>; }[RA] : SE;
3787
3799
  type ExtractAliasFromSelectExpression<SE> = SE extends string ? ExtractAliasFromStringSelectExpression<SE> : SE extends AliasedExpression<any, infer EA> ? EA : SE extends ((qb: any) => AliasedExpression<any, infer EA>) ? EA : SE extends DynamicReferenceBuilder<infer RA> ? ExtractAliasFromStringSelectExpression<RA> : never;
3788
3800
  type ExtractAliasFromStringSelectExpression<SE extends string> = SE extends `${string}.${string}.${string} as ${infer A}` ? A : SE extends `${string}.${string} as ${infer A}` ? A : SE extends `${string} as ${infer A}` ? A : SE extends `${string}.${string}.${infer C}` ? C : SE extends `${string}.${infer C}` ? C : SE;
3789
3801
  type ExtractTypeFromSelectExpression<DB, TB extends keyof DB, SE> = SE extends string ? ExtractTypeFromStringSelectExpression<DB, TB, SE> : SE extends AliasedSelectQueryBuilder<infer O, any> ? O[keyof O] | null : SE extends ((eb: any) => AliasedSelectQueryBuilder<infer O, any>) ? O[keyof O] | null : SE extends AliasedExpression<infer O, any> ? O : SE extends ((eb: any) => AliasedExpression<infer O, any>) ? O : SE extends DynamicReferenceBuilder<infer RA> ? ExtractTypeFromStringSelectExpression<DB, TB, RA> | undefined : never;
3790
3802
  type ExtractTypeFromStringSelectExpression<DB, TB extends keyof DB, SE extends string> = SE extends `${infer SC}.${infer T}.${infer C} as ${string}` ? `${SC}.${T}` extends TB ? C extends keyof DB[`${SC}.${T}`] ? DB[`${SC}.${T}`][C] : never : never : SE extends `${infer T}.${infer C} as ${string}` ? T extends TB ? C extends keyof DB[T] ? DB[T][C] : never : never : SE extends `${infer C} as ${string}` ? C extends AnyColumn<DB, TB> ? ExtractColumnType<DB, TB, C> : never : SE extends `${infer SC}.${infer T}.${infer C}` ? `${SC}.${T}` extends TB ? C extends keyof DB[`${SC}.${T}`] ? DB[`${SC}.${T}`][C] : never : never : SE extends `${infer T}.${infer C}` ? T extends TB ? C extends keyof DB[T] ? DB[T][C] : never : never : SE extends AnyColumn<DB, TB> ? ExtractColumnType<DB, TB, SE> : never;
3791
- type AllSelection<DB, TB extends keyof DB> = DrainOuterGeneric<{ [C in AnyColumn<DB, TB>]: { [T in TB]: SelectType<C extends keyof DB[T] ? DB[T][C] : never> }[TB] }>;
3803
+ type AllSelection<DB, TB extends keyof DB> = DrainOuterGeneric<{ [C in AnyColumn<DB, TB>]: { [T in TB]: SelectType<C extends keyof DB[T] ? DB[T][C] : never>; }[TB]; }>;
3792
3804
  //#endregion
3793
3805
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/parser/collate-parser.d.ts
3794
3806
  type Collation = 'nocase' | 'binary' | 'rtrim' | (string & {});
@@ -7422,16 +7434,16 @@ interface AliasedSelectQueryBuilder<O = undefined, A extends string = never> ext
7422
7434
  }
7423
7435
  type SelectQueryBuilderWithInnerJoin<DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? InnerJoinedBuilder$2<DB, TB, O, A, DB[T]> : never : TE extends keyof DB ? SelectQueryBuilder<DB, TB | TE, O> : TE extends AliasedExpression<infer QO, infer QA> ? InnerJoinedBuilder$2<DB, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? InnerJoinedBuilder$2<DB, TB, O, QA, QO> : never;
7424
7436
  type InnerJoinedBuilder$2<DB, TB extends keyof DB, O, A extends string, R> = A extends keyof DB ? SelectQueryBuilder<InnerJoinedDB$2<DB, A, R>, TB | A, O> : SelectQueryBuilder<DB & ShallowRecord<A, R>, TB | A, O>;
7425
- type InnerJoinedDB$2<DB, A extends string, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends keyof DB ? DB[C] : never }>;
7437
+ type InnerJoinedDB$2<DB, A extends string, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends keyof DB ? DB[C] : never; }>;
7426
7438
  type SelectQueryBuilderWithLeftJoin<DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? LeftJoinedBuilder$2<DB, TB, O, A, DB[T]> : never : TE extends keyof DB ? LeftJoinedBuilder$2<DB, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? LeftJoinedBuilder$2<DB, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? LeftJoinedBuilder$2<DB, TB, O, QA, QO> : never;
7427
7439
  type LeftJoinedBuilder$2<DB, TB extends keyof DB, O, A extends keyof any, R> = A extends keyof DB ? SelectQueryBuilder<LeftJoinedDB$2<DB, A, R>, TB | A, O> : SelectQueryBuilder<DB & ShallowRecord<A, Nullable<R>>, TB | A, O>;
7428
- type LeftJoinedDB$2<DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends keyof DB ? DB[C] : never }>;
7440
+ type LeftJoinedDB$2<DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends keyof DB ? DB[C] : never; }>;
7429
7441
  type SelectQueryBuilderWithRightJoin<DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? RightJoinedBuilder$2<DB, TB, O, A, DB[T]> : never : TE extends keyof DB ? RightJoinedBuilder$2<DB, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? RightJoinedBuilder$2<DB, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? RightJoinedBuilder$2<DB, TB, O, QA, QO> : never;
7430
7442
  type RightJoinedBuilder$2<DB, TB extends keyof DB, O, A extends keyof any, R> = SelectQueryBuilder<RightJoinedDB$2<DB, TB, A, R>, TB | A, O>;
7431
- type RightJoinedDB$2<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never }>;
7443
+ type RightJoinedDB$2<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never; }>;
7432
7444
  type SelectQueryBuilderWithFullJoin<DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? OuterJoinedBuilder$2<DB, TB, O, A, DB[T]> : never : TE extends keyof DB ? OuterJoinedBuilder$2<DB, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? OuterJoinedBuilder$2<DB, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? OuterJoinedBuilder$2<DB, TB, O, QA, QO> : never;
7433
7445
  type OuterJoinedBuilder$2<DB, TB extends keyof DB, O, A extends keyof any, R> = SelectQueryBuilder<OuterJoinedBuilderDB$2<DB, TB, A, R>, TB | A, O>;
7434
- type OuterJoinedBuilderDB$2<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never }>;
7446
+ type OuterJoinedBuilderDB$2<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never; }>;
7435
7447
  type TableOrList<TB extends keyof any> = (TB & string) | ReadonlyArray<TB & string>;
7436
7448
  //#endregion
7437
7449
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/parser/coalesce-parser.d.ts
@@ -8849,7 +8861,7 @@ declare class JSONPathBuilder<S, O = S> {
8849
8861
  * select "nicknames"->>'$[#-1]' as `last_nickname` from `person`
8850
8862
  * ```
8851
8863
  */
8852
- at<I extends (any[] extends O ? number | 'last' | `#-${number}` : never), O2 = null | NonNullable<NonNullable<O>[keyof NonNullable<O> & number]>>(index: `${I}` extends `${any}.${any}` | `#--${any}` ? never : I): TraversedJSONPathBuilder<S, O2>;
8864
+ at<I extends any[] extends O ? number | 'last' | `#-${number}` : never, O2 = null | NonNullable<NonNullable<O>[keyof NonNullable<O> & number]>>(index: `${I}` extends `${any}.${any}` | `#--${any}` ? never : I): TraversedJSONPathBuilder<S, O2>;
8853
8865
  /**
8854
8866
  * Access a property of a JSON object.
8855
8867
  *
@@ -8899,7 +8911,7 @@ declare class JSONPathBuilder<S, O = S> {
8899
8911
  * select "profile"->'addresses'->0->'city' as "city" from "person"
8900
8912
  * ```
8901
8913
  */
8902
- key<K extends (any[] extends O ? never : O extends object ? keyof NonNullable<O> & string : never), O2 = (undefined extends O ? null | NonNullable<NonNullable<O>[K]> : null extends O ? null | NonNullable<NonNullable<O>[K]> : string extends keyof NonNullable<O> ? null | NonNullable<NonNullable<O>[K]> : NonNullable<O>[K])>(key: K): TraversedJSONPathBuilder<S, O2>;
8914
+ key<K extends any[] extends O ? never : O extends object ? keyof NonNullable<O> & string : never, O2 = undefined extends O ? null | NonNullable<NonNullable<O>[K]> : null extends O ? null | NonNullable<NonNullable<O>[K]> : string extends keyof NonNullable<O> ? null | NonNullable<NonNullable<O>[K]> : NonNullable<O>[K]>(key: K): TraversedJSONPathBuilder<S, O2>;
8903
8915
  }
8904
8916
  declare class TraversedJSONPathBuilder<S, O> extends JSONPathBuilder<S, O> implements AliasableExpression<O> {
8905
8917
  #private;
@@ -11588,13 +11600,13 @@ declare class DynamicModule<DB> {
11588
11600
  }
11589
11601
  //#endregion
11590
11602
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/parser/insert-values-parser.d.ts
11591
- type InsertObject<DB, TB extends keyof DB> = { [C in NonNullableInsertKeys<DB[TB]>]: ValueExpression<DB, TB, InsertType<DB[TB][C]>> } & { [C in NullableInsertKeys<DB[TB]>]?: ValueExpression<DB, TB, InsertType<DB[TB][C]>> | undefined };
11603
+ type InsertObject<DB, TB extends keyof DB> = { [C in NonNullableInsertKeys<DB[TB]>]: ValueExpression<DB, TB, InsertType<DB[TB][C]>>; } & { [C in NullableInsertKeys<DB[TB]>]?: ValueExpression<DB, TB, InsertType<DB[TB][C]>> | undefined; };
11592
11604
  type InsertObjectOrList<DB, TB extends keyof DB> = InsertObject<DB, TB> | ReadonlyArray<InsertObject<DB, TB>>;
11593
11605
  type InsertObjectOrListFactory<DB, TB extends keyof DB, UT extends keyof DB = never> = (eb: ExpressionBuilder<DB, TB | UT>) => InsertObjectOrList<DB, TB>;
11594
11606
  type InsertExpression<DB, TB extends keyof DB, UT extends keyof DB = never> = InsertObjectOrList<DB, TB> | InsertObjectOrListFactory<DB, TB, UT>;
11595
11607
  //#endregion
11596
11608
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/parser/update-set-parser.d.ts
11597
- type UpdateObject<DB, TB extends keyof DB, UT extends keyof DB = TB> = DrainOuterGeneric<{ [C in AnyColumn<DB, UT>]?: { [T in UT]: C extends keyof DB[T] ? ValueExpression<DB, TB, UpdateType<DB[T][C]>> | undefined : never }[UT] }>;
11609
+ type UpdateObject<DB, TB extends keyof DB, UT extends keyof DB = TB> = DrainOuterGeneric<{ [C in AnyColumn<DB, UT>]?: { [T in UT]: C extends keyof DB[T] ? ValueExpression<DB, TB, UpdateType<DB[T][C]>> | undefined : never; }[UT]; }>;
11598
11610
  type UpdateObjectFactory<DB, TB extends keyof DB, UT extends keyof DB> = (eb: ExpressionBuilder<DB, TB>) => UpdateObject<DB, TB, UT>;
11599
11611
  type UpdateObjectExpression<DB, TB extends keyof DB, UT extends keyof DB = TB> = UpdateObject<DB, TB, UT> | UpdateObjectFactory<DB, TB, UT>;
11600
11612
  type ExtractUpdateTypeFromReferenceExpression<DB, TB extends keyof DB, RE, DV = unknown> = UpdateType<ExtractRawTypeFromReferenceExpression<DB, TB, RE, DV>>;
@@ -12203,7 +12215,7 @@ declare class OnConflictBuilder<DB, TB extends keyof DB> implements WhereInterfa
12203
12215
  interface OnConflictBuilderProps {
12204
12216
  readonly onConflictNode: OnConflictNode;
12205
12217
  }
12206
- type OnConflictDatabase<DB, TB extends keyof DB> = { [K in keyof DB | 'excluded']: Updateable<K extends keyof DB ? DB[K] : DB[TB]> };
12218
+ type OnConflictDatabase<DB, TB extends keyof DB> = { [K in keyof DB | 'excluded']: Updateable<K extends keyof DB ? DB[K] : DB[TB]>; };
12207
12219
  type OnConflictTables<TB> = TB | 'excluded';
12208
12220
  declare class OnConflictDoNothingBuilder<DB, TB extends keyof DB> implements OperationNodeSource {
12209
12221
  #private;
@@ -12684,7 +12696,7 @@ interface OutputInterface<DB, TB extends keyof DB, O, OP extends OutputPrefix =
12684
12696
  outputAll(table: OP): OutputInterface<DB, TB, ReturningAllRow<DB, TB, O>, OP>;
12685
12697
  }
12686
12698
  type OutputPrefix = 'deleted' | 'inserted';
12687
- type OutputDatabase<DB, TB extends keyof DB, OP extends OutputPrefix = OutputPrefix> = { [K in OP]: DB[TB] };
12699
+ type OutputDatabase<DB, TB extends keyof DB, OP extends OutputPrefix = OutputPrefix> = { [K in OP]: DB[TB]; };
12688
12700
  type OutputExpression<DB, TB extends keyof DB, OP extends OutputPrefix = OutputPrefix, ODB = OutputDatabase<DB, TB, OP>, OTB extends keyof ODB = keyof ODB> = AnyAliasedColumnWithTable<ODB, OTB> | AnyColumnWithTable<ODB, OTB> | AliasedExpressionOrFactory<ODB, OTB>;
12689
12701
  type OutputCallback<DB, TB extends keyof DB, OP extends OutputPrefix = OutputPrefix> = (eb: ExpressionBuilder<OutputDatabase<DB, TB, OP>, OP>) => ReadonlyArray<OutputExpression<DB, TB, OP>>;
12690
12702
  type SelectExpressionFromOutputExpression<OE> = OE extends `${OutputPrefix}.${infer C}` ? C : OE;
@@ -13691,7 +13703,7 @@ declare class InsertQueryBuilder<DB, TB extends keyof DB, O> implements Returnin
13691
13703
  * }>
13692
13704
  * ```
13693
13705
  */
13694
- $if<O2>(condition: boolean, func: (qb: this) => InsertQueryBuilder<any, any, O2>): O2 extends InsertResult ? InsertQueryBuilder<DB, TB, InsertResult> : O2 extends O & infer E ? InsertQueryBuilder<DB, TB, O & Partial<E>> : InsertQueryBuilder<DB, TB, Partial<O2>>;
13706
+ $if<O2>(condition: boolean, func: (qb: this) => InsertQueryBuilder<any, any, O2>): O2 extends InsertResult ? InsertQueryBuilder<DB, TB, InsertResult> : O2 extends O & (infer E) ? InsertQueryBuilder<DB, TB, O & Partial<E>> : InsertQueryBuilder<DB, TB, Partial<O2>>;
13695
13707
  /**
13696
13708
  * Change the output type of the query.
13697
13709
  *
@@ -15029,7 +15041,7 @@ declare class UpdateQueryBuilder<DB, UT extends keyof DB, TB extends keyof DB, O
15029
15041
  * }>
15030
15042
  * ```
15031
15043
  */
15032
- $if<O2>(condition: boolean, func: (qb: this) => UpdateQueryBuilder<any, any, any, O2>): O2 extends UpdateResult ? UpdateQueryBuilder<DB, UT, TB, UpdateResult> : O2 extends O & infer E ? UpdateQueryBuilder<DB, UT, TB, O & Partial<E>> : UpdateQueryBuilder<DB, UT, TB, Partial<O2>>;
15044
+ $if<O2>(condition: boolean, func: (qb: this) => UpdateQueryBuilder<any, any, any, O2>): O2 extends UpdateResult ? UpdateQueryBuilder<DB, UT, TB, UpdateResult> : O2 extends O & (infer E) ? UpdateQueryBuilder<DB, UT, TB, O & Partial<E>> : UpdateQueryBuilder<DB, UT, TB, Partial<O2>>;
15033
15045
  /**
15034
15046
  * Change the output type of the query.
15035
15047
  *
@@ -15248,16 +15260,16 @@ interface UpdateQueryBuilderProps {
15248
15260
  }
15249
15261
  type UpdateQueryBuilderWithInnerJoin<DB, UT extends keyof DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? InnerJoinedBuilder$1<DB, UT, TB, O, A, DB[T]> : never : TE extends keyof DB ? UpdateQueryBuilder<DB, UT, TB | TE, O> : TE extends AliasedExpression<infer QO, infer QA> ? InnerJoinedBuilder$1<DB, UT, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? InnerJoinedBuilder$1<DB, UT, TB, O, QA, QO> : never;
15250
15262
  type InnerJoinedBuilder$1<DB, UT extends keyof DB, TB extends keyof DB, O, A extends string, R> = A extends keyof DB ? UpdateQueryBuilder<InnerJoinedDB$1<DB, A, R>, UT, TB | A, O> : UpdateQueryBuilder<DB & ShallowRecord<A, R>, UT, TB | A, O>;
15251
- type InnerJoinedDB$1<DB, A extends string, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends keyof DB ? DB[C] : never }>;
15263
+ type InnerJoinedDB$1<DB, A extends string, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends keyof DB ? DB[C] : never; }>;
15252
15264
  type UpdateQueryBuilderWithLeftJoin<DB, UT extends keyof DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? LeftJoinedBuilder$1<DB, UT, TB, O, A, DB[T]> : never : TE extends keyof DB ? LeftJoinedBuilder$1<DB, UT, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? LeftJoinedBuilder$1<DB, UT, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? LeftJoinedBuilder$1<DB, UT, TB, O, QA, QO> : never;
15253
15265
  type LeftJoinedBuilder$1<DB, UT extends keyof DB, TB extends keyof DB, O, A extends keyof any, R> = A extends keyof DB ? UpdateQueryBuilder<LeftJoinedDB$1<DB, A, R>, UT, TB | A, O> : UpdateQueryBuilder<DB & ShallowRecord<A, Nullable<R>>, UT, TB | A, O>;
15254
- type LeftJoinedDB$1<DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends keyof DB ? DB[C] : never }>;
15266
+ type LeftJoinedDB$1<DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends keyof DB ? DB[C] : never; }>;
15255
15267
  type UpdateQueryBuilderWithRightJoin<DB, UT extends keyof DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? RightJoinedBuilder$1<DB, UT, TB, O, A, DB[T]> : never : TE extends keyof DB ? RightJoinedBuilder$1<DB, UT, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? RightJoinedBuilder$1<DB, UT, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? RightJoinedBuilder$1<DB, UT, TB, O, QA, QO> : never;
15256
15268
  type RightJoinedBuilder$1<DB, UT extends keyof DB, TB extends keyof DB, O, A extends keyof any, R> = UpdateQueryBuilder<RightJoinedDB$1<DB, TB, A, R>, UT, TB | A, O>;
15257
- type RightJoinedDB$1<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never }>;
15269
+ type RightJoinedDB$1<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never; }>;
15258
15270
  type UpdateQueryBuilderWithFullJoin<DB, UT extends keyof DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? OuterJoinedBuilder$1<DB, UT, TB, O, A, DB[T]> : never : TE extends keyof DB ? OuterJoinedBuilder$1<DB, UT, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? OuterJoinedBuilder$1<DB, UT, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? OuterJoinedBuilder$1<DB, UT, TB, O, QA, QO> : never;
15259
15271
  type OuterJoinedBuilder$1<DB, UT extends keyof DB, TB extends keyof DB, O, A extends keyof any, R> = UpdateQueryBuilder<OuterJoinedBuilderDB$1<DB, TB, A, R>, UT, TB | A, O>;
15260
- type OuterJoinedBuilderDB$1<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never }>;
15272
+ type OuterJoinedBuilderDB$1<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never; }>;
15261
15273
  //#endregion
15262
15274
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/query-builder/delete-query-builder.d.ts
15263
15275
  declare class DeleteQueryBuilder<DB, TB extends keyof DB, O> implements WhereInterface<DB, TB>, MultiTableReturningInterface<DB, TB, O>, OutputInterface<DB, TB, O, 'deleted'>, OrderByInterface<DB, TB, {}>, OperationNodeSource, Compilable<O>, Explainable, Streamable<O> {
@@ -16360,7 +16372,7 @@ declare class DeleteQueryBuilder<DB, TB extends keyof DB, O> implements WhereInt
16360
16372
  * }>
16361
16373
  * ```
16362
16374
  */
16363
- $if<O2>(condition: boolean, func: (qb: this) => DeleteQueryBuilder<any, any, O2>): O2 extends DeleteResult ? DeleteQueryBuilder<DB, TB, DeleteResult> : O2 extends O & infer E ? DeleteQueryBuilder<DB, TB, O & Partial<E>> : DeleteQueryBuilder<DB, TB, Partial<O2>>;
16375
+ $if<O2>(condition: boolean, func: (qb: this) => DeleteQueryBuilder<any, any, O2>): O2 extends DeleteResult ? DeleteQueryBuilder<DB, TB, DeleteResult> : O2 extends O & (infer E) ? DeleteQueryBuilder<DB, TB, O & Partial<E>> : DeleteQueryBuilder<DB, TB, Partial<O2>>;
16364
16376
  /**
16365
16377
  * Change the output type of the query.
16366
16378
  *
@@ -16561,16 +16573,16 @@ interface DeleteQueryBuilderProps {
16561
16573
  }
16562
16574
  type DeleteQueryBuilderWithInnerJoin<DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? InnerJoinedBuilder<DB, TB, O, A, DB[T]> : never : TE extends keyof DB ? DeleteQueryBuilder<DB, TB | TE, O> : TE extends AliasedExpression<infer QO, infer QA> ? InnerJoinedBuilder<DB, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? InnerJoinedBuilder<DB, TB, O, QA, QO> : never;
16563
16575
  type InnerJoinedBuilder<DB, TB extends keyof DB, O, A extends string, R> = A extends keyof DB ? DeleteQueryBuilder<InnerJoinedDB<DB, A, R>, TB | A, O> : DeleteQueryBuilder<DB & ShallowRecord<A, R>, TB | A, O>;
16564
- type InnerJoinedDB<DB, A extends string, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends keyof DB ? DB[C] : never }>;
16576
+ type InnerJoinedDB<DB, A extends string, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends keyof DB ? DB[C] : never; }>;
16565
16577
  type DeleteQueryBuilderWithLeftJoin<DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? LeftJoinedBuilder<DB, TB, O, A, DB[T]> : never : TE extends keyof DB ? LeftJoinedBuilder<DB, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? LeftJoinedBuilder<DB, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? LeftJoinedBuilder<DB, TB, O, QA, QO> : never;
16566
16578
  type LeftJoinedBuilder<DB, TB extends keyof DB, O, A extends keyof any, R> = A extends keyof DB ? DeleteQueryBuilder<LeftJoinedDB<DB, A, R>, TB | A, O> : DeleteQueryBuilder<DB & ShallowRecord<A, Nullable<R>>, TB | A, O>;
16567
- type LeftJoinedDB<DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends keyof DB ? DB[C] : never }>;
16579
+ type LeftJoinedDB<DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends keyof DB ? DB[C] : never; }>;
16568
16580
  type DeleteQueryBuilderWithRightJoin<DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? RightJoinedBuilder<DB, TB, O, A, DB[T]> : never : TE extends keyof DB ? RightJoinedBuilder<DB, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? RightJoinedBuilder<DB, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? RightJoinedBuilder<DB, TB, O, QA, QO> : never;
16569
16581
  type RightJoinedBuilder<DB, TB extends keyof DB, O, A extends keyof any, R> = DeleteQueryBuilder<RightJoinedDB<DB, TB, A, R>, TB | A, O>;
16570
- type RightJoinedDB<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never }>;
16582
+ type RightJoinedDB<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? R : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never; }>;
16571
16583
  type DeleteQueryBuilderWithFullJoin<DB, TB extends keyof DB, O, TE extends TableExpression<DB, TB>> = TE extends `${infer T} as ${infer A}` ? T extends keyof DB ? OuterJoinedBuilder<DB, TB, O, A, DB[T]> : never : TE extends keyof DB ? OuterJoinedBuilder<DB, TB, O, TE, DB[TE]> : TE extends AliasedExpression<infer QO, infer QA> ? OuterJoinedBuilder<DB, TB, O, QA, QO> : TE extends ((qb: any) => AliasedExpression<infer QO, infer QA>) ? OuterJoinedBuilder<DB, TB, O, QA, QO> : never;
16572
16584
  type OuterJoinedBuilder<DB, TB extends keyof DB, O, A extends keyof any, R> = DeleteQueryBuilder<OuterJoinedBuilderDB<DB, TB, A, R>, TB | A, O>;
16573
- type OuterJoinedBuilderDB<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never }>;
16585
+ type OuterJoinedBuilderDB<DB, TB extends keyof DB, A extends keyof any, R> = DrainOuterGeneric<{ [C in keyof DB | A]: C extends A ? Nullable<R> : C extends TB ? Nullable<DB[C]> : C extends keyof DB ? DB[C] : never; }>;
16574
16586
  //#endregion
16575
16587
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/query-builder/cte-builder.d.ts
16576
16588
  declare class CTEBuilder<N extends string> implements OperationNodeSource {
@@ -16593,8 +16605,8 @@ type CTEBuilderCallback<N extends string> = (cte: <N2 extends string>(name: N2)
16593
16605
  //#endregion
16594
16606
  //#region ../../node_modules/.pnpm/kysely@0.28.16/node_modules/kysely/dist/esm/parser/with-parser.d.ts
16595
16607
  type CommonTableExpression<DB, CN extends string> = (creator: QueryCreator<DB>) => CommonTableExpressionOutput<DB, CN>;
16596
- type RecursiveCommonTableExpression<DB, CN extends string> = (creator: QueryCreator<DB & { [K in ExtractTableFromCommonTableExpressionName<CN>]: ExtractRowFromCommonTableExpressionName<CN> }>) => CommonTableExpressionOutput<DB, CN>;
16597
- type QueryCreatorWithCommonTableExpression<DB, CN extends string, CTE> = QueryCreator<DB & { [K in ExtractTableFromCommonTableExpressionName<CN>]: ExtractRowFromCommonTableExpression<CTE> }>;
16608
+ type RecursiveCommonTableExpression<DB, CN extends string> = (creator: QueryCreator<DB & { [K in ExtractTableFromCommonTableExpressionName<CN>]: ExtractRowFromCommonTableExpressionName<CN>; }>) => CommonTableExpressionOutput<DB, CN>;
16609
+ type QueryCreatorWithCommonTableExpression<DB, CN extends string, CTE> = QueryCreator<DB & { [K in ExtractTableFromCommonTableExpressionName<CN>]: ExtractRowFromCommonTableExpression<CTE>; }>;
16598
16610
  type CommonTableExpressionOutput<DB, CN extends string> = Expression<ExtractRowFromCommonTableExpressionName<CN>> | InsertQueryBuilder<DB, any, ExtractRowFromCommonTableExpressionName<CN>> | UpdateQueryBuilder<DB, any, any, ExtractRowFromCommonTableExpressionName<CN>> | DeleteQueryBuilder<DB, any, ExtractRowFromCommonTableExpressionName<CN>>;
16599
16611
  /**
16600
16612
  * Given a common CommonTableExpression CTE extracts the row type from it.
@@ -16616,7 +16628,7 @@ type ExtractTableFromCommonTableExpressionName<CN extends string> = CN extends `
16616
16628
  * }
16617
16629
  *
16618
16630
  */
16619
- type ExtractRowFromCommonTableExpressionName<CN extends string> = CN extends `${string}(${infer CL})` ? { [C in ExtractColumnNamesFromColumnList<CL>]: any } : ShallowRecord<string, any>;
16631
+ type ExtractRowFromCommonTableExpressionName<CN extends string> = CN extends `${string}(${infer CL})` ? { [C in ExtractColumnNamesFromColumnList<CL>]: any; } : ShallowRecord<string, any>;
16620
16632
  /**
16621
16633
  * Parses a string like 'id, first_name' into a type 'id' | 'first_name'
16622
16634
  */
@@ -17386,7 +17398,7 @@ declare class WheneableMergeQueryBuilder<DB, TT extends keyof DB, ST extends key
17386
17398
  * }>
17387
17399
  * ```
17388
17400
  */
17389
- $if<O2>(condition: boolean, func: (qb: this) => WheneableMergeQueryBuilder<any, any, any, O2>): O2 extends MergeResult ? WheneableMergeQueryBuilder<DB, TT, ST, MergeResult> : O2 extends O & infer E ? WheneableMergeQueryBuilder<DB, TT, ST, O & Partial<E>> : WheneableMergeQueryBuilder<DB, TT, ST, Partial<O2>>;
17401
+ $if<O2>(condition: boolean, func: (qb: this) => WheneableMergeQueryBuilder<any, any, any, O2>): O2 extends MergeResult ? WheneableMergeQueryBuilder<DB, TT, ST, MergeResult> : O2 extends O & (infer E) ? WheneableMergeQueryBuilder<DB, TT, ST, O & Partial<E>> : WheneableMergeQueryBuilder<DB, TT, ST, Partial<O2>>;
17390
17402
  toOperationNode(): MergeQueryNode;
17391
17403
  compile(): CompiledQuery<O>;
17392
17404
  /**
@@ -19046,9 +19058,9 @@ declare class Command<T> {
19046
19058
  }
19047
19059
  //#endregion
19048
19060
  //#region src/reactor/workflow-triggers-read-model.d.ts
19049
- declare const WORKFLOW_TRIGGERS_READ_MODEL = "workflow-triggers";
19050
- declare const WORKFLOW_TRIGGERS_READ_MODEL_STAGE: ReadModelRegistrationStage;
19051
- declare class WorkflowTriggersReadModel extends BaseReadModel {
19061
+ export declare const WORKFLOW_TRIGGERS_READ_MODEL = "workflow-triggers";
19062
+ export declare const WORKFLOW_TRIGGERS_READ_MODEL_STAGE: ReadModelRegistrationStage;
19063
+ export declare class WorkflowTriggersReadModel extends BaseReadModel {
19052
19064
  private readonly runtime;
19053
19065
  private freshRegistration;
19054
19066
  constructor(db: Kysely<DocumentViewDatabase>, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker, runtime: WorkflowRuntimeService);
@@ -19085,5 +19097,6 @@ interface WebhookPayload {
19085
19097
  body: unknown;
19086
19098
  }
19087
19099
  //#endregion
19088
- export { type AttachmentClientLike, type ConnectionCheckResult, type ConnectionSummary, type PersistedRunResult, PieceRegistry, type PieceStoreRow, type PieceTriggerBinding, type RunRow, type ScheduleTriggerBinding, type StepExecutionRow, type TriggerBinding, type TriggerDedupeRow, type TriggerStateRow, WORKFLOW_PACKAGE_NAME, WORKFLOW_TRIGGERS_READ_MODEL, WORKFLOW_TRIGGERS_READ_MODEL_STAGE, type WebhookConfig, type WebhookPayload, type WorkflowCaller, type WorkflowRuntimeDB, type WorkflowRuntimeHostDeps, WorkflowRuntimeService, WorkflowTriggersReadModel, createAttachmentPort, createWorkflowRuntime, packagePieces, setPieceRegistryUrl };
19100
+ export { type AttachmentClientLike, type ConnectionCheckResult, type ConnectionSummary, type PersistedRunResult, PieceRegistry, type PieceStoreRow, type PieceTriggerBinding, type RunRow, type ScheduleTriggerBinding, type StepExecutionRow, type TriggerBinding, type TriggerDedupeRow, type TriggerStateRow, type WebhookConfig, type WebhookPayload, type WorkflowCaller, type WorkflowRuntimeDB, type WorkflowRuntimeHostDeps, packagePieces };
19101
+ export {};
19089
19102
  //# sourceMappingURL=index.d.ts.map