@diagonal-hq/cli 0.38.1 → 0.38.3

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.
@@ -0,0 +1,1429 @@
1
+ import { createRequire as __diagonalCreateRequire } from 'node:module';
2
+ const require = __diagonalCreateRequire(import.meta.url);
3
+ import "./cli-chunk-LRS5IEI3.mjs";
4
+
5
+ // scripts/lib/workflow-script/sdk-files.generated.mjs
6
+ var SDK_FILES = { "/sdk/console.ts": "// The sandbox provides console, and the ES2023 lib does not declare it. These declarations merge\n// with the DOM and Node declarations when the SDK is used outside the sandbox.\ndeclare global {\n interface Console {\n log(...values: unknown[]): void;\n info(...values: unknown[]): void;\n warn(...values: unknown[]): void;\n error(...values: unknown[]): void;\n }\n\n var console: Console;\n}\n\nexport {};\n", "/sdk/data.ts": "import {\n data as generatedData,\n type DataCountInput,\n type DataCreateInput,\n type DataCreateManyInput,\n type DataDeleteInput,\n type DataDeleteManyInput,\n type DataDeleteManyOutput,\n type DataFindInput,\n type DataFindOrCreateInput,\n type DataRestoreInput,\n type DataSearchInput,\n type DataSearchOutput,\n type DataUpdateInput,\n type DataUpdateOrCreateInput\n} from './generated/capabilities';\nimport type { WorkspaceResources } from './index';\nimport { invoke } from './transport';\n\ntype Entry = WorkspaceResources[keyof WorkspaceResources];\nexport type ResourceKey = [keyof WorkspaceResources] extends [never]\n ? string\n : Entry extends { id: infer I }\n ? I\n : never;\n/** The id of each entry of `E` that has every capability in `C`. */\ntype IdWithCapabilities<E, C extends string> = E extends {\n id: infer I;\n capabilities: infer Declared;\n}\n ? [C] extends [Declared]\n ? I\n : never\n : never;\n/**\n * The ids of the resources that have every capability in `C`. Any string while the workspace\n * declares no resources.\n */\nexport type ResourceKeyWith<C extends string> = [keyof WorkspaceResources] extends [never]\n ? string\n : IdWithCapabilities<Entry, C>;\ntype EntryFor<R> = Extract<Entry, { id: R }>;\nexport type InputOf<R> = [EntryFor<R>] extends [never]\n ? Record<string, unknown>\n : EntryFor<R> extends { input: infer I }\n ? I\n : never;\nexport type RecordOf<R> = [EntryFor<R>] extends [never]\n ? { id: string } & Record<string, unknown>\n : EntryFor<R> extends { record: infer T }\n ? T\n : never;\n\n/** The declared keys of `T`. `keyof` on a type with an index signature returns only `string | number`. */\ntype DeclaredKey<T> = keyof {\n [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];\n};\n\n/**\n * `DataSearchOutput` with `data` narrowed to the resource's record shape and `cursor` narrowed to\n * the cursor text. `pagination` stays as generated.\n */\ntype SearchOutput<R> = Pick<\n DataSearchOutput,\n Exclude<DeclaredKey<DataSearchOutput>, 'data' | 'cursor'>\n> & {\n data?: Array<RecordOf<R>>;\n /** With `paging: 'cursor'`, the `after` value for the next page. Null when no records are left. */\n cursor?: string | null;\n [key: string]: unknown;\n};\n\ntype EachInput<R> = Omit<DataSearchInput, 'resource' | 'page' | 'pageSize' | 'paging' | 'after'> & {\n resource: R;\n /** Stop after this many records. Leave it out to visit every match. */\n maxRecords?: number;\n};\n\n/** The page size of `data.each`. It is the largest page that `data.search` accepts. */\nconst EACH_PAGE_SIZE = 100;\n\n/**\n * Visit every record that the search matches, one record at a time. Use it in place of a loop\n * over `data.search` pages: it calls `data.search` with cursor paging and pages of 100 records. The\n * query is copied when `each` is called, so a change to the input object during the walk does\n * not change the pages.\n *\n * Each page continues after the last record of the page before it. A record that the loop body\n * updates so that it no longer matches, or deletes, does not move a later page. A body that\n * changes the value of a `sort` field can move a visited record after the cursor, and the walk\n * then visits it again. Sort on a field that the body does not change, or leave `sort` empty.\n */\nfunction each<R extends ResourceKey>(\n input: EachInput<R>\n): AsyncGenerator<RecordOf<R>, void, undefined> {\n const { maxRecords, ...search } = input;\n\n if (maxRecords !== undefined && (!Number.isInteger(maxRecords) || maxRecords < 1)) {\n throw new RangeError(`maxRecords must be a positive integer. Received ${maxRecords}.`);\n }\n\n const query: Omit<EachInput<R>, 'maxRecords'> = JSON.parse(JSON.stringify(search));\n\n return walk(query, maxRecords ?? Number.POSITIVE_INFINITY);\n}\n\nasync function* walk<R extends ResourceKey>(\n query: Omit<EachInput<R>, 'maxRecords'>,\n maxRecords: number\n): AsyncGenerator<RecordOf<R>, void, undefined> {\n let remaining = maxRecords;\n let after: string | null = null;\n\n while (remaining > 0) {\n const page: SearchOutput<R> = await invoke<SearchOutput<R>>('data.search', {\n ...query,\n paging: 'cursor',\n pageSize: Math.min(EACH_PAGE_SIZE, remaining),\n ...(after === null ? {} : { after })\n });\n\n for (const record of page.data ?? []) {\n yield record;\n remaining--;\n\n if (remaining === 0) {\n return;\n }\n }\n\n if (typeof page.cursor !== 'string') {\n return;\n }\n\n after = page.cursor;\n }\n}\n\n// Each call names its return type. Declaration emit otherwise writes the inferred type, and with\n// no workspace resources that resolves RecordOf<R> to the open record, so a workspace that\n// augments WorkspaceResources would still get untyped records from the published package.\nexport const data = {\n ...generatedData,\n create: <R extends ResourceKey>(\n input: Omit<DataCreateInput, 'resource' | 'data'> & { resource: R; data: InputOf<R> }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.create', input),\n find: <R extends ResourceKey>(\n input: Omit<DataFindInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.find', input),\n update: <R extends ResourceKey>(\n input: Omit<DataUpdateInput, 'resource' | 'data'> & { resource: R; data: InputOf<R> }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.update', input),\n /**\n * One page of the records that the search matches: 50 records by default, and at most 100 with\n * `pageSize`. To read every match, use `data.each`, which requests the pages for you.\n */\n search: <R extends ResourceKey>(\n input: Omit<DataSearchInput, 'resource'> & { resource: R }\n ): Promise<SearchOutput<R>> => invoke<SearchOutput<R>>('data.search', input),\n each,\n delete: <R extends ResourceKey>(\n input: Omit<DataDeleteInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.delete', input),\n restore: <R extends ResourceKey>(\n input: Omit<DataRestoreInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.restore', input),\n count: <R extends ResourceKey>(\n input: Omit<DataCountInput, 'resource'> & { resource: R }\n ): Promise<number> => invoke<number>('data.count', input),\n findOrCreate: <R extends ResourceKey>(\n input: Omit<DataFindOrCreateInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.find-or-create', input),\n updateOrCreate: <R extends ResourceKey>(\n input: Omit<DataUpdateOrCreateInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.update-or-create', input),\n /** Create all of `records` in one call. The call has no limit on the number of records. */\n createMany: <R extends ResourceKey>(\n input: Omit<DataCreateManyInput, 'resource' | 'records'> & {\n resource: R;\n records: Array<InputOf<R>>;\n }\n ): Promise<Array<RecordOf<R>>> => invoke<Array<RecordOf<R>>>('data.create-many', input),\n deleteMany: <R extends ResourceKey>(\n input: Omit<DataDeleteManyInput, 'resource'> & { resource: R }\n ): Promise<DataDeleteManyOutput> => invoke<DataDeleteManyOutput>('data.delete-many', input)\n};\n", "/sdk/errors.ts": "/**\n * The failure that a graph step records when its task throws, which the step's error edge reads.\n * A task failure has `type`, `message`, and `status_code`. An unexpected exception also has\n * `original_type`, a validation failure has `errors`, and a refused input has `invalid_input`.\n * A declared error is keyed by its type, and a failed child workflow gives its own failure.\n */\nexport type HostFailure = {\n type?: string;\n message?: string;\n original_type?: string;\n status_code?: number;\n errors?: Record<string, string[]>;\n invalid_input?: unknown;\n [key: string]: unknown;\n};\n\nexport class HostError extends Error {\n /**\n * @param failureId The host's ID for the failure of the call. When the error ends the run, the\n * host records that failure, so a run records the failure of the call that it rethrows.\n * @param failure The failure that a graph step records for the same error, or null for a\n * refusal that only a script call can receive, such as an unknown capability.\n * @param options `cause` is the error of a `transaction()` body that a `transaction_rollback`\n * error replaces.\n */\n constructor(\n message: string,\n readonly code: string,\n readonly status: number,\n readonly details: unknown,\n readonly failureId: number | null = null,\n readonly failure: HostFailure | null = null,\n options: ErrorOptions = {}\n ) {\n super(message, options);\n this.name = 'HostError';\n }\n}\n\nexport class WorkflowFailure extends Error {\n constructor(\n message: string,\n readonly status: number,\n readonly details: unknown = null\n ) {\n super(message);\n this.name = 'WorkflowFailure';\n }\n}\n\nexport function fail(message: string, options: { status?: number; details?: unknown } = {}): never {\n throw new WorkflowFailure(message, options.status ?? 400, options.details ?? null);\n}\n\nexport function validationError(\n errors: Record<string, string[]>,\n options: { message?: string } = {}\n): never {\n throw new WorkflowFailure(options.message ?? 'The given data was invalid.', 422, { errors });\n}\n", "/sdk/generated/capabilities.ts": `// AUTO-GENERATED by \`php artisan workflows:script-sdk:build\`. Do not edit by hand.
7
+ import type { ResourceKeyWith } from '../data';
8
+ import type { ContentDocument } from '../input';
9
+ import type { DeepReadonly, Liquid, StaticLiquid } from '../liquid';
10
+ import { invoke } from '../transport';
11
+
12
+ export const SDK_VERSION = 80;
13
+
14
+ export interface WorkspaceSystemFields {
15
+ "ai_custom_system_prompt": string | null;
16
+ "brand_kit": { "colors"?: { "light"?: { "--background"?: string; "--foreground"?: string; "--card"?: string; "--card-foreground"?: string; "--popover"?: string; "--popover-foreground"?: string; "--primary"?: string; "--primary-foreground"?: string; "--secondary"?: string; "--secondary-foreground"?: string; "--muted"?: string; "--muted-foreground"?: string; "--accent"?: string; "--accent-foreground"?: string; "--destructive"?: string; "--destructive-foreground"?: string; "--success"?: string; "--success-foreground"?: string; "--warning"?: string; "--warning-foreground"?: string; "--informative"?: string; "--informative-foreground"?: string; "--border"?: string; "--input"?: string; "--ring"?: string; "--chart-1"?: string; "--chart-2"?: string; "--chart-3"?: string; "--chart-4"?: string; "--chart-5"?: string; "--sidebar"?: string; "--sidebar-foreground"?: string; "--sidebar-primary"?: string; "--sidebar-primary-foreground"?: string; "--sidebar-accent"?: string; "--sidebar-accent-foreground"?: string; "--sidebar-border"?: string; "--sidebar-ring"?: string } | null; "dark"?: { "--background"?: string; "--foreground"?: string; "--card"?: string; "--card-foreground"?: string; "--popover"?: string; "--popover-foreground"?: string; "--primary"?: string; "--primary-foreground"?: string; "--secondary"?: string; "--secondary-foreground"?: string; "--muted"?: string; "--muted-foreground"?: string; "--accent"?: string; "--accent-foreground"?: string; "--destructive"?: string; "--destructive-foreground"?: string; "--success"?: string; "--success-foreground"?: string; "--warning"?: string; "--warning-foreground"?: string; "--informative"?: string; "--informative-foreground"?: string; "--border"?: string; "--input"?: string; "--ring"?: string; "--chart-1"?: string; "--chart-2"?: string; "--chart-3"?: string; "--chart-4"?: string; "--chart-5"?: string; "--sidebar"?: string; "--sidebar-foreground"?: string; "--sidebar-primary"?: string; "--sidebar-primary-foreground"?: string; "--sidebar-accent"?: string; "--sidebar-accent-foreground"?: string; "--sidebar-border"?: string; "--sidebar-ring"?: string } | null } | null; "typography"?: { "--font-sans"?: string | null; "--font-serif"?: string | null; "--font-mono"?: string | null; "--radius"?: "0rem" | "0.125rem" | "0.25rem" | "0.375rem" | "0.5rem" | "0.75rem" } | null; "shadows"?: { "light"?: { "--shadow-2xs"?: "none" | "0px 1px 1px 0px hsl(0 0% 0% \\/ 0.04)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)"; "--shadow-xs"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.05)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)" | "0px 2px 4px 0px hsl(0 0% 0% \\/ 0.18)"; "--shadow-sm"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 1px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 1px 3px 0px hsl(0 0% 0% \\/ 0.25), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.25)"; "--shadow"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)"; "--shadow-md"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)"; "--shadow-lg"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 10px 15px -3px hsl(0 0% 0% \\/ 0.25), 0px 4px 6px -4px hsl(0 0% 0% \\/ 0.25)"; "--shadow-xl"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 20px 25px -5px hsl(0 0% 0% \\/ 0.25), 0px 8px 10px -6px hsl(0 0% 0% \\/ 0.25)"; "--shadow-2xl"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.45)" | "0px 25px 50px -12px hsl(0 0% 0% \\/ 0.5)" } | null; "dark"?: { "--shadow-2xs"?: "none" | "0px 1px 1px 0px hsl(0 0% 0% \\/ 0.04)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)"; "--shadow-xs"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.05)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)" | "0px 2px 4px 0px hsl(0 0% 0% \\/ 0.18)"; "--shadow-sm"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 1px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 1px 3px 0px hsl(0 0% 0% \\/ 0.25), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.25)"; "--shadow"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)"; "--shadow-md"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)"; "--shadow-lg"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 10px 15px -3px hsl(0 0% 0% \\/ 0.25), 0px 4px 6px -4px hsl(0 0% 0% \\/ 0.25)"; "--shadow-xl"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.06)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.18)" | "0px 20px 25px -5px hsl(0 0% 0% \\/ 0.25), 0px 8px 10px -6px hsl(0 0% 0% \\/ 0.25)"; "--shadow-2xl"?: "none" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)" | "0px 1px 2px 0px hsl(0 0% 0% \\/ 0.45)" | "0px 25px 50px -12px hsl(0 0% 0% \\/ 0.5)" } | null } | null; "logos"?: { "horizontal"?: { "dark"?: string; "light"?: string } | null; "icon"?: { "dark"?: string; "light"?: string } | null; "wordmark"?: { "dark"?: string; "light"?: string } | null } | null; "favicon"?: { "dark"?: string; "light"?: string } | null; "seo"?: { "title"?: string | null; "description"?: string | null; "og_image"?: string } | null; "design_profile"?: string | null } | null;
17
+ "custom_401_error_page": string | { id: string; params?: Record<string, unknown> } | null;
18
+ "custom_403_error_page": string | { id: string; params?: Record<string, unknown> } | null;
19
+ "custom_404_error_page": string | { id: string; params?: Record<string, unknown> } | null;
20
+ "custom_422_error_page": string | { id: string; params?: Record<string, unknown> } | null;
21
+ "custom_500_error_page": string | { id: string; params?: Record<string, unknown> } | null;
22
+ "default_currency": "aed" | "ars" | "aud" | "brl" | "cad" | "chf" | "clp" | "cny" | "cop" | "czk" | "dkk" | "eur" | "gbp" | "hkd" | "idr" | "ils" | "inr" | "jpy" | "krw" | "mxn" | "myr" | "nok" | "nzd" | "pen" | "php" | "pln" | "sar" | "sek" | "sgd" | "thb" | "twd" | "usd" | "zar" | null;
23
+ "default_timezone": string | null;
24
+ "fathom_site_id": string | null;
25
+ "head_html": string | null;
26
+ "name": string | null;
27
+ "sidebar_icon": string | null;
28
+ "sidebar_icon_color": string | null;
29
+ "slug": string | null;
30
+ "website": string | null;
31
+ }
32
+
33
+ export interface AiDecideInput {
34
+ state: unknown;
35
+ questions: Array<{ key?: string; type?: "choice" | "noul" | "score"; instructions?: unknown; criteria?: Array<{ name?: string; description?: string; [key: string]: unknown; }>; [key: string]: unknown; }>;
36
+ }
37
+ export type AiDecideOutput = Record<string, unknown>;
38
+
39
+ export interface AiRunPromptInput {
40
+ prompt: unknown;
41
+ attachments?: Array<string> | null;
42
+ modelPreset?: "auto" | "fast" | "balanced" | "smart" | null;
43
+ outputSchema?: unknown;
44
+ strict?: boolean | null;
45
+ }
46
+ export type AiRunPromptOutput = string;
47
+
48
+ export interface AuthImpersonateInput {
49
+ resource: ResourceKeyWith<"authenticatable">;
50
+ record: string;
51
+ }
52
+ export type AuthImpersonateOutput = { success?: boolean; redirect_url?: unknown; error?: unknown; [key: string]: unknown; };
53
+
54
+ export interface AuthLoginInput {
55
+ resource: ResourceKeyWith<"authenticatable">;
56
+ record: string;
57
+ }
58
+ export type AuthLoginOutput = boolean;
59
+
60
+ export interface CalendarGenerateLinkInput {
61
+ type: "apple" | "google" | "outlook";
62
+ resource: ResourceKeyWith<"eventable">;
63
+ record: string;
64
+ }
65
+ export type CalendarGenerateLinkOutput = unknown;
66
+
67
+ export interface CalendarSearchEventsInput {
68
+ resource: ResourceKeyWith<"eventable">;
69
+ from: string;
70
+ to: string;
71
+ filters?: unknown;
72
+ relations?: Array<string>;
73
+ }
74
+ export type CalendarSearchEventsOutput = { data?: Array<Record<string, unknown>>; [key: string]: unknown; };
75
+
76
+ export interface CallbackGetInput {
77
+ key: string;
78
+ default?: unknown;
79
+ }
80
+ export type CallbackGetOutput = unknown;
81
+
82
+ export interface CallbackRemoveInput {
83
+ key: string;
84
+ }
85
+ export type CallbackRemoveOutput = string;
86
+
87
+ export interface CallbackSetInput {
88
+ key?: string;
89
+ value?: unknown;
90
+ }
91
+ export type CallbackSetOutput = unknown;
92
+
93
+ export interface ChartDistributionInput {
94
+ resource: string;
95
+ categoryField: string;
96
+ valueField?: string | null;
97
+ filters?: unknown;
98
+ /**
99
+ * Maximum number of categories to show.
100
+ * From 1 to 50.
101
+ * @minimum 1
102
+ * @maximum 50
103
+ */
104
+ limit?: number | null;
105
+ }
106
+ export type ChartDistributionOutput = Array<{ category?: string; count?: number; total?: number; [key: string]: unknown; }>;
107
+
108
+ export interface ChartKpiInput {
109
+ resource: string;
110
+ metrics?: Array<{ name?: string; operation?: "count" | "sum" | "avg" | "min" | "max" | "distinct"; field?: string; [key: string]: unknown; }>;
111
+ filters?: unknown;
112
+ }
113
+ export type ChartKpiOutput = Record<string, unknown>;
114
+
115
+ export interface ChartLeaderboardInput {
116
+ resource: string;
117
+ entityField: string;
118
+ operation: "count" | "sum" | "avg";
119
+ valueField?: string | null;
120
+ metricName: string;
121
+ filters?: unknown;
122
+ /**
123
+ * Number of top entries to return.
124
+ * From 1 to 100.
125
+ * @minimum 1
126
+ * @maximum 100
127
+ */
128
+ limit: number;
129
+ }
130
+ export type ChartLeaderboardOutput = Array<{ entity?: string; value?: number; count?: number; [key: string]: unknown; }>;
131
+
132
+ export interface ChartTimeSeriesInput {
133
+ resource: string;
134
+ dateField: string;
135
+ granularity: "hour" | "day" | "week" | "month" | "quarter" | "year";
136
+ metrics?: Array<{ name?: string; operation?: "count" | "sum" | "avg" | "min" | "max"; field?: string; [key: string]: unknown; }>;
137
+ filters?: unknown;
138
+ /**
139
+ * Maximum number of time periods to return.
140
+ * From 1 to 1000.
141
+ * @minimum 1
142
+ * @maximum 1000
143
+ */
144
+ limit?: number | null;
145
+ }
146
+ export type ChartTimeSeriesOutput = Array<Record<string, unknown>>;
147
+
148
+ export interface DataAggregateMetricsInput {
149
+ resource: string;
150
+ groupBy?: Array<string>;
151
+ dateGranularity?: "hour" | "day" | "week" | "month" | "quarter" | "year" | null;
152
+ metrics?: Array<{ name?: string; operation?: "count" | "sum" | "avg" | "min" | "max" | "distinct"; field?: string; [key: string]: unknown; }>;
153
+ filters?: unknown;
154
+ sort?: Array<{ field?: string; direction?: "asc" | "desc"; [key: string]: unknown; }>;
155
+ /**
156
+ * Maximum number of groups to return.
157
+ * From 1 to 1000.
158
+ * @minimum 1
159
+ * @maximum 1000
160
+ */
161
+ limit?: number | null;
162
+ }
163
+ export type DataAggregateMetricsOutput = Array<Record<string, unknown>>;
164
+
165
+ export interface DataCountInput {
166
+ resource: string;
167
+ search?: string | null;
168
+ filters?: unknown;
169
+ sort?: Array<{ field?: string; direction?: "asc" | "desc"; [key: string]: unknown; }>;
170
+ relations?: Array<string>;
171
+ recordScope?: "active" | "archived" | "activeOrArchived" | null;
172
+ /**
173
+ * The page number.
174
+ * At least 1.
175
+ * @minimum 1
176
+ */
177
+ page?: number | null;
178
+ /**
179
+ * The number of records per page.
180
+ * From 1 to 100.
181
+ * @minimum 1
182
+ * @maximum 100
183
+ */
184
+ pageSize?: number | null;
185
+ }
186
+ export type DataCountOutput = number;
187
+
188
+ export interface DataCreateInput {
189
+ resource: string;
190
+ data: Record<string, unknown>;
191
+ operation?: Record<string, unknown> | null;
192
+ }
193
+ export type DataCreateOutput = Record<string, unknown>;
194
+
195
+ export interface DataCreateManyInput {
196
+ resource: string;
197
+ records: Array<Record<string, unknown>>;
198
+ }
199
+ export type DataCreateManyOutput = Array<Record<string, unknown>>;
200
+
201
+ export interface DataDeleteInput {
202
+ resource: string;
203
+ record: string;
204
+ confirmSideEffects?: boolean | null;
205
+ operation?: Record<string, unknown> | null;
206
+ }
207
+ export type DataDeleteOutput = Record<string, unknown>;
208
+
209
+ export interface DataDeleteManyInput {
210
+ resource: string;
211
+ filters: unknown;
212
+ }
213
+ export type DataDeleteManyOutput = { deleted_count?: number; deleted_ids?: Array<string>; [key: string]: unknown; };
214
+
215
+ export interface DataFindInput {
216
+ resource: string;
217
+ mode?: "filters" | "record" | null;
218
+ record?: string | null;
219
+ filters?: unknown;
220
+ requiredFilters?: unknown;
221
+ recordScope?: "active" | "archived" | "activeOrArchived" | null;
222
+ relations?: Array<string>;
223
+ }
224
+ export type DataFindOutput = Record<string, unknown>;
225
+
226
+ export interface DataFindOrCreateInput {
227
+ resource: string;
228
+ attributes: Record<string, unknown>;
229
+ data: Record<string, unknown>;
230
+ operation?: Record<string, unknown> | null;
231
+ }
232
+ export type DataFindOrCreateOutput = Record<string, unknown>;
233
+
234
+ export interface DataRelationAttachInput {
235
+ resource: string;
236
+ record: string;
237
+ relation: string;
238
+ related: string;
239
+ }
240
+ export type DataRelationAttachOutput = Record<string, unknown>;
241
+
242
+ export interface DataRelationAttachManyInput {
243
+ resource: string;
244
+ record: string;
245
+ relation: string;
246
+ relatedIds?: Array<string> | null;
247
+ }
248
+ export type DataRelationAttachManyOutput = Record<string, unknown>;
249
+
250
+ export interface DataRelationDetachInput {
251
+ resource: string;
252
+ record: string;
253
+ relation: string;
254
+ related: string;
255
+ }
256
+ export type DataRelationDetachOutput = Record<string, unknown>;
257
+
258
+ export interface DataRelationDetachManyInput {
259
+ resource: string;
260
+ record: string;
261
+ relation: string;
262
+ relatedIds?: Array<string>;
263
+ }
264
+ export type DataRelationDetachManyOutput = Record<string, unknown>;
265
+
266
+ export interface DataRelationSyncInput {
267
+ resource: string;
268
+ record: string;
269
+ relation: string;
270
+ relatedIds?: Array<string>;
271
+ }
272
+ export type DataRelationSyncOutput = Record<string, unknown>;
273
+
274
+ export interface DataRestoreInput {
275
+ resource: string;
276
+ record: string;
277
+ }
278
+ export type DataRestoreOutput = Record<string, unknown>;
279
+
280
+ export interface DataSearchInput {
281
+ resource: string;
282
+ search?: string | null;
283
+ filters?: unknown;
284
+ requiredFilters?: unknown;
285
+ sort?: Array<{ field?: string; direction?: "asc" | "desc"; [key: string]: unknown; }>;
286
+ relations?: Array<string>;
287
+ recordScope?: "active" | "archived" | "activeOrArchived" | null;
288
+ /**
289
+ * The page number.
290
+ * At least 1.
291
+ * @minimum 1
292
+ */
293
+ page?: number | null;
294
+ /**
295
+ * The number of records per page.
296
+ * From 1 to 100.
297
+ * @minimum 1
298
+ * @maximum 100
299
+ */
300
+ pageSize?: number | null;
301
+ paging?: "cursor" | "page" | null;
302
+ after?: string | null;
303
+ }
304
+ export type DataSearchOutput = { data?: Array<Record<string, unknown>>; pagination?: { total?: unknown; per_page?: unknown; current_page?: unknown; last_page?: unknown; [key: string]: unknown; }; [key: string]: unknown; };
305
+
306
+ export interface DataSemanticSearchInput {
307
+ resource: string;
308
+ query: string;
309
+ filters?: unknown;
310
+ /**
311
+ * The maximum number of records to return.
312
+ * From 1 to 100.
313
+ * @minimum 1
314
+ * @maximum 100
315
+ */
316
+ topK?: number | null;
317
+ recordScope?: "active" | "archived" | "activeOrArchived" | null;
318
+ }
319
+ export type DataSemanticSearchOutput = { data?: Array<Record<string, unknown>>; scores?: Record<string, unknown>; [key: string]: unknown; };
320
+
321
+ export interface DataSumInput {
322
+ resource: string;
323
+ search?: string | null;
324
+ filters?: unknown;
325
+ sort?: Array<{ field?: string; direction?: "asc" | "desc"; [key: string]: unknown; }>;
326
+ relations?: Array<string>;
327
+ recordScope?: "active" | "archived" | "activeOrArchived" | null;
328
+ /**
329
+ * The page number.
330
+ * At least 1.
331
+ * @minimum 1
332
+ */
333
+ page?: number | null;
334
+ /**
335
+ * The number of records per page.
336
+ * From 1 to 100.
337
+ * @minimum 1
338
+ * @maximum 100
339
+ */
340
+ pageSize?: number | null;
341
+ field: string;
342
+ }
343
+ export type DataSumOutput = number;
344
+
345
+ export interface DataUpdateInput {
346
+ resource: string;
347
+ mode?: "filters" | "record" | null;
348
+ record?: string | null;
349
+ filters?: unknown;
350
+ data: Record<string, unknown>;
351
+ operation?: Record<string, unknown> | null;
352
+ }
353
+ export type DataUpdateOutput = Record<string, unknown>;
354
+
355
+ export interface DataUpdateOrCreateInput {
356
+ resource: string;
357
+ attributes: Record<string, unknown>;
358
+ data: Record<string, unknown>;
359
+ operation?: Record<string, unknown> | null;
360
+ }
361
+ export type DataUpdateOrCreateOutput = Record<string, unknown>;
362
+
363
+ export interface DataValidateInput {
364
+ resource: string;
365
+ data: Record<string, unknown>;
366
+ }
367
+ export type DataValidateOutput = unknown;
368
+
369
+ export interface DateAddInput {
370
+ date: string;
371
+ value: number;
372
+ unit: "days" | "months" | "weeks" | "years";
373
+ }
374
+ export type DateAddOutput = string;
375
+
376
+ export interface DateDiffInput {
377
+ start: string;
378
+ end: string;
379
+ unit: "days" | "months" | "weeks" | "years";
380
+ }
381
+ export type DateDiffOutput = number;
382
+
383
+ export interface DateEndOfInput {
384
+ date: string;
385
+ unit: "month" | "quarter" | "week" | "year";
386
+ }
387
+ export type DateEndOfOutput = string;
388
+
389
+ export interface DateFormatInput {
390
+ date: string;
391
+ format: string;
392
+ }
393
+ export type DateFormatOutput = string;
394
+
395
+ export interface DateStartOfInput {
396
+ date: string;
397
+ unit: "month" | "quarter" | "week" | "year";
398
+ }
399
+ export type DateStartOfOutput = string;
400
+
401
+ export interface DateSubtractInput {
402
+ date: string;
403
+ value: number;
404
+ unit: "days" | "months" | "weeks" | "years";
405
+ }
406
+ export type DateSubtractOutput = string;
407
+
408
+ export interface FileChangeVisibilityInput {
409
+ file: string;
410
+ visibility: "private" | "public";
411
+ }
412
+ export type FileChangeVisibilityOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };
413
+
414
+ export interface FileCreateFromUrlInput {
415
+ url: string;
416
+ }
417
+ export type FileCreateFromUrlOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };
418
+
419
+ export interface FileCreateMediaLibraryItemInput {
420
+ file: string;
421
+ folderId?: string | null;
422
+ displayName?: string | null;
423
+ }
424
+ export type FileCreateMediaLibraryItemOutput = { id?: string; workspace_id?: string; file_id?: string; folder_id?: unknown; display_name?: string; file?: { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; }; created_at?: unknown; updated_at?: unknown; [key: string]: unknown; };
425
+
426
+ export interface FileCreateQrCodeInput {
427
+ value: string;
428
+ size?: number | null;
429
+ errorCorrection?: "L" | "M" | "Q" | "H" | null;
430
+ }
431
+ export type FileCreateQrCodeOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };
432
+
433
+ export interface GuardValidateInput {
434
+ value?: unknown;
435
+ guard?: Array<string> | Record<string, unknown> | null;
436
+ haltOnFailure?: boolean;
437
+ }
438
+ export type GuardValidateOutput = boolean;
439
+
440
+ export interface HttpRequestInput {
441
+ url: string;
442
+ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "HEAD";
443
+ headers?: Array<{ key?: string; value?: string; [key: string]: unknown; }> | null;
444
+ body?: Record<string, unknown> | null;
445
+ query?: Array<{ key?: string; value?: string; [key: string]: unknown; }> | null;
446
+ }
447
+ export type HttpRequestOutput = { status?: unknown; headers?: Record<string, unknown>; response?: string; [key: string]: unknown; };
448
+
449
+ export interface LifecycleOutputInput {
450
+ record?: unknown;
451
+ }
452
+ export type LifecycleOutputOutput = Record<string, unknown>;
453
+
454
+ export interface MailSearchInput {
455
+ emails?: Array<string> | null;
456
+ resource?: string | null;
457
+ record?: string | null;
458
+ includeCurrentAddresses?: boolean | null;
459
+ emailField?: string | null;
460
+ subjectContains?: string | null;
461
+ fromAddress?: string | null;
462
+ statuses?: Array<"bounced" | "deferred" | "delivered" | "dropped" | "failed" | "sending" | "sent" | "spam_reported" | "suppressed"> | null;
463
+ dateFrom?: string | null;
464
+ dateBefore?: string | null;
465
+ /**
466
+ * Maximum number of emails to return, newest first. Total still counts every match.
467
+ * From 1 to 100.
468
+ * @minimum 1
469
+ * @maximum 100
470
+ */
471
+ limit?: number | null;
472
+ }
473
+ export type MailSearchOutput = { total?: number; messages?: Array<{ id?: string; subject?: unknown; status?: "bounced" | "deferred" | "delivered" | "dropped" | "failed" | "sending" | "sent" | "spam_reported" | "suppressed"; recorded_at?: unknown; recipients?: Array<{ address?: string; status?: "bounced" | "deferred" | "delivered" | "dropped" | "failed" | "sending" | "sent" | "spam_reported" | "suppressed"; bounce_type?: "hard" | "soft"; reason?: unknown; last_event_at?: unknown; [key: string]: unknown; }>; [key: string]: unknown; }>; [key: string]: unknown; };
474
+
475
+ export interface MailSendInput {
476
+ to: Array<string>;
477
+ cc?: Array<string> | null;
478
+ bcc?: Array<string> | null;
479
+ replyTo?: Array<string> | null;
480
+ subject: Liquid;
481
+ emailLayout?: string | null;
482
+ /**
483
+ * A value composed from other values fails the compile: the layout can render it as Liquid.
484
+ * @liquidSlots $references
485
+ */
486
+ layoutData?: { content?: Liquid; [key: string]: unknown; };
487
+ records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;
488
+ attachments?: Array<string> | null;
489
+ calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;
490
+ }
491
+ export type MailSendOutput = { success?: boolean; status_message?: string; recipients?: { to?: Array<string>; cc?: Array<string>; bcc?: Array<string>; reply_to?: Array<string>; [key: string]: unknown; }; subject?: string; content?: string; attachments?: Array<{ id?: string; name?: string; mime?: string; [key: string]: unknown; }>; [key: string]: unknown; };
492
+
493
+ export interface MailSendNotificationInput {
494
+ notificationType: string;
495
+ notificationTemplate?: string | null;
496
+ variables?: Record<string, unknown>;
497
+ to: Array<string>;
498
+ cc?: Array<string> | null;
499
+ bcc?: Array<string> | null;
500
+ replyTo?: Array<string> | null;
501
+ records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;
502
+ attachments?: Array<string> | null;
503
+ calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;
504
+ }
505
+ export type MailSendNotificationOutput = { success?: boolean; status_message?: string; recipients?: { to?: Array<string>; cc?: Array<string>; bcc?: Array<string>; reply_to?: Array<string>; [key: string]: unknown; }; subject?: string; content?: string; attachments?: Array<{ id?: string; name?: string; mime?: string; [key: string]: unknown; }>; [key: string]: unknown; };
506
+
507
+ export interface MarkdownFromContentInput {
508
+ value?: unknown;
509
+ }
510
+ export type MarkdownFromContentOutput = string;
511
+
512
+ export interface MarkdownToContentInput {
513
+ value: string;
514
+ }
515
+ export type MarkdownToContentOutput = ContentDocument;
516
+
517
+ export interface MediaLibraryCreateFolderInput {
518
+ name: string;
519
+ parentId?: string | null;
520
+ }
521
+ export type MediaLibraryCreateFolderOutput = string;
522
+
523
+ export interface MediaLibraryDeleteItemInput {
524
+ itemId: string;
525
+ }
526
+ export type MediaLibraryDeleteItemOutput = string;
527
+
528
+ export interface MediaLibraryMoveItemsInput {
529
+ itemIds: Array<string>;
530
+ folderId?: string | null;
531
+ }
532
+ export type MediaLibraryMoveItemsOutput = Array<string>;
533
+
534
+ export interface MediaLibraryUpdateItemInput {
535
+ mediaLibraryItemId: string;
536
+ displayName?: string | null;
537
+ folderId?: string | null;
538
+ }
539
+ export type MediaLibraryUpdateItemOutput = { id?: string; workspace_id?: string; file_id?: string; folder_id?: unknown; display_name?: string; file?: { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; }; created_at?: unknown; updated_at?: unknown; [key: string]: unknown; };
540
+
541
+ export interface MoneyFormatInput {
542
+ value?: { amount: number; currency: string; [key: string]: unknown; } | null;
543
+ }
544
+ export type MoneyFormatOutput = string;
545
+
546
+ export interface NotificationSendInput {
547
+ resource: ResourceKeyWith<"notifiable">;
548
+ relations?: Array<string>;
549
+ record: string;
550
+ subject: Liquid;
551
+ emailLayout?: string | null;
552
+ /**
553
+ * A value composed from other values fails the compile: the layout can render it as Liquid.
554
+ * @liquidSlots $references
555
+ */
556
+ layoutData?: { content?: Liquid; [key: string]: unknown; };
557
+ attachments?: Array<string> | null;
558
+ calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;
559
+ }
560
+ export type NotificationSendOutput = boolean;
561
+
562
+ export interface NotificationSendBulkNotificationsInput {
563
+ notificationType: string;
564
+ notificationTemplate?: string | null;
565
+ variables?: Record<string, unknown>;
566
+ resource: string;
567
+ filters?: unknown;
568
+ recipient: unknown;
569
+ attachments?: Array<string> | null;
570
+ idempotencyKey?: string | null;
571
+ }
572
+ export type NotificationSendBulkNotificationsOutput = { processed_count: number; queued_count: number; failed_count: number; duplicate_count: number; failures?: Array<{ record_id: string; errors?: Record<string, unknown>; [key: string]: unknown; }>; failures_truncated: boolean; [key: string]: unknown; };
573
+
574
+ export interface NotificationSendNotificationInput {
575
+ deliveryChannel?: "email" | "sms" | "email_and_sms";
576
+ notificationType: string;
577
+ notificationTemplate?: string | null;
578
+ variables?: Record<string, unknown>;
579
+ idempotencyKey?: string | null;
580
+ recipient: unknown;
581
+ records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;
582
+ attachments?: Array<string> | null;
583
+ calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;
584
+ }
585
+ export type NotificationSendNotificationOutput = boolean;
586
+
587
+ export interface NotificationSetConsentInput {
588
+ resource: ResourceKeyWith<"notifiable">;
589
+ record: string;
590
+ sms?: boolean | null;
591
+ email?: boolean | null;
592
+ }
593
+ export type NotificationSetConsentOutput = { email?: boolean; sms?: boolean; changed_at?: string; [key: string]: unknown; };
594
+
595
+ export interface NumberFormatInput {
596
+ value?: number | null;
597
+ decimals?: number;
598
+ }
599
+ export type NumberFormatOutput = string;
600
+
601
+ export interface PackageInstallInputInput {
602
+ package_id: string;
603
+ key: string;
604
+ }
605
+ export type PackageInstallInputOutput = unknown;
606
+
607
+ export interface PageUrlInput {
608
+ page: { id: string; params?: Record<string, unknown>; [key: string]: unknown; };
609
+ }
610
+ export type PageUrlOutput = unknown;
611
+
612
+ export interface PayablesVoidInput {
613
+ reason?: string | null;
614
+ effectiveDate?: string | null;
615
+ payableResource: ResourceKeyWith<"payable">;
616
+ payableRecord: string;
617
+ }
618
+ export type PayablesVoidOutput = { status?: string; [key: string]: unknown; };
619
+
620
+ export interface PayablesWriteOffInput {
621
+ lineAllocations?: unknown[] | null;
622
+ payableResource: ResourceKeyWith<"payable">;
623
+ payableRecord: string;
624
+ adjustmentResource: ResourceKeyWith<"payable_adjustment">;
625
+ amount?: { amount: number; currency: string; [key: string]: unknown; } | null;
626
+ effectiveAt?: string | null;
627
+ description?: string | null;
628
+ }
629
+ export type PayablesWriteOffOutput = Record<string, unknown>;
630
+
631
+ export interface PaymentCreateManualInput {
632
+ resource: ResourceKeyWith<"payment">;
633
+ payableRecord: string;
634
+ amount: { amount: number; currency: string; [key: string]: unknown; };
635
+ paidAt?: string | null;
636
+ payerRecord?: string | null;
637
+ notes?: string | null;
638
+ }
639
+ export type PaymentCreateManualOutput = Record<string, unknown>;
640
+
641
+ export interface PaymentsChargeInput {
642
+ payableResource: ResourceKeyWith<"payable">;
643
+ payableRecord: string;
644
+ amount?: { amount: number; currency: string; [key: string]: unknown; } | null;
645
+ description?: string | null;
646
+ payerRecord?: string | null;
647
+ paymentMethodId?: string | null;
648
+ }
649
+ export type PaymentsChargeOutput = Record<string, unknown>;
650
+
651
+ export interface PaymentsCheckoutInput {
652
+ payableResource: ResourceKeyWith<"payable">;
653
+ payableRecord: string;
654
+ successUrl: string;
655
+ cancelUrl?: string | null;
656
+ description?: string | null;
657
+ }
658
+ export type PaymentsCheckoutOutput = { checkout_url?: string; session_id?: string; [key: string]: unknown; };
659
+
660
+ export interface PaymentsConfirmInput {
661
+ payableResource: ResourceKeyWith<"payable">;
662
+ payableRecord: string;
663
+ confirmationTokenId?: string | null;
664
+ paymentMethodId?: string | null;
665
+ paymentAttemptId?: string | null;
666
+ expectedTotal: { amount: number; currency: string; [key: string]: unknown; };
667
+ amount?: { amount: number; currency: string; [key: string]: unknown; } | null;
668
+ savePaymentMethod?: boolean | null;
669
+ setPaymentMethodAsDefault?: boolean | null;
670
+ }
671
+ export type PaymentsConfirmOutput = { payment_intent_id: string; payment_record_id: string; status: string; client_secret?: unknown; [key: string]: unknown; };
672
+
673
+ export interface PaymentsRefundInput {
674
+ resource: ResourceKeyWith<"payment">;
675
+ record: string;
676
+ amount?: { amount: number; currency: string; [key: string]: unknown; } | null;
677
+ invoiceBalance?: "credit" | "reopen" | null;
678
+ reason?: string | null;
679
+ }
680
+ export type PaymentsRefundOutput = Record<string, unknown>;
681
+
682
+ export interface PaymentsVoidInput {
683
+ resource: ResourceKeyWith<"payment">;
684
+ record: string;
685
+ reason: string;
686
+ }
687
+ export type PaymentsVoidOutput = Record<string, unknown>;
688
+
689
+ export interface PhoneFormatInput {
690
+ phone?: string | null;
691
+ format?: "e164" | "international" | "national" | "rfc3966" | null;
692
+ }
693
+ export type PhoneFormatOutput = string;
694
+
695
+ export interface SchedulingBookSlotInput {
696
+ bookingResource: string;
697
+ start: string;
698
+ search: { bookingResource: string; groups: Array<{ mode?: "all" | "any"; strategy?: "first_available" | "least_booked" | "round_robin"; records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }>; [key: string]: unknown; }>; from: string; to: string; durationMinutes: number; stepMinutes?: number | null; noticeMinutes?: number | null; maxAdvanceDays?: number | null; quantity?: number | null; maxSlots?: number | null; timezone?: string | null; seed?: string | null; } | Record<string, unknown>;
699
+ relations: Array<string>;
700
+ data?: Record<string, unknown> | null;
701
+ }
702
+ export type SchedulingBookSlotOutput = Record<string, unknown>;
703
+
704
+ export interface SchedulingFindSlotsInput {
705
+ bookingResource: string;
706
+ groups: Array<{ mode?: "all" | "any"; strategy?: "first_available" | "least_booked" | "round_robin"; records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }>; [key: string]: unknown; }>;
707
+ from: string;
708
+ to: string;
709
+ durationMinutes: number;
710
+ stepMinutes?: number | null;
711
+ noticeMinutes?: number | null;
712
+ maxAdvanceDays?: number | null;
713
+ quantity?: number | null;
714
+ maxSlots?: number | null;
715
+ timezone?: string | null;
716
+ seed?: string | null;
717
+ }
718
+ export type SchedulingFindSlotsOutput = Record<string, unknown>;
719
+
720
+ export interface SchemaToJsonSchemaInput {
721
+ schema: unknown;
722
+ }
723
+ export type SchemaToJsonSchemaOutput = Record<string, unknown>;
724
+
725
+ export interface SecurityRandomPasswordInput {
726
+ passwordLength?: number | null;
727
+ }
728
+ export type SecurityRandomPasswordOutput = string;
729
+
730
+ export interface SmsSendNotificationInput {
731
+ notificationType: string;
732
+ notificationTemplate?: string | null;
733
+ variables?: Record<string, unknown>;
734
+ recipient: unknown;
735
+ }
736
+ export type SmsSendNotificationOutput = Record<string, unknown>;
737
+
738
+ export interface SubscriptionsActivateInput {
739
+ subscriptionResource: ResourceKeyWith<"subscription">;
740
+ subscriptionRecord: string;
741
+ }
742
+ export type SubscriptionsActivateOutput = { status?: string; [key: string]: unknown; };
743
+
744
+ export interface SubscriptionsCancelInput {
745
+ subscriptionResource: ResourceKeyWith<"subscription">;
746
+ subscriptionRecord: string;
747
+ atPeriodEnd?: boolean | null;
748
+ }
749
+ export type SubscriptionsCancelOutput = { status?: string; [key: string]: unknown; };
750
+
751
+ export interface SubscriptionsChangeItemsInput {
752
+ subscriptionResource: ResourceKeyWith<"subscription">;
753
+ subscriptionRecord: string;
754
+ items: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: "catalog" | "custom"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }>;
755
+ effective?: "now" | "next_renewal" | "period" | null;
756
+ periodStart?: string | null;
757
+ prorationBehavior?: "prorate" | "none" | null;
758
+ revisionScope?: "this_renewal" | "this_and_following" | null;
759
+ confirmedQuote?: string | null;
760
+ reason?: string | null;
761
+ }
762
+ export type SubscriptionsChangeItemsOutput = { changed?: boolean; invoice?: unknown; preview?: { mode?: string; effective?: string; proration_behavior?: string; changed?: boolean; currency?: string; timezone?: string; effective_date?: string; period_start?: unknown; period_end?: unknown; days_in_period?: unknown; days_remaining?: unknown; items?: Array<{ price_record_id?: string; quantity?: number; pricing?: string; catalog_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; current_unit_price?: unknown; effective_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; charges?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; credits?: Array<{ description?: string; quantity?: number; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; amount?: { amount: number; currency: string; [key: string]: unknown; }; gross_amount?: { amount: number; currency: string; [key: string]: unknown; }; source_invoice_record_id?: string; source_line_record_id?: string; covered_start?: string; covered_end?: string; [key: string]: unknown; }>; applied_to_invoices?: Array<{ invoice_record_id?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; renewal?: unknown; revision?: unknown; schedule?: unknown; replaces_upcoming_items?: boolean; quote?: string; charge_total?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_total?: { amount: number; currency: string; [key: string]: unknown; }; amount_due?: { amount: number; currency: string; [key: string]: unknown; }; net_credit?: { amount: number; currency: string; [key: string]: unknown; }; applied_to_invoices_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_to_balance?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_before?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_after?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; };
763
+
764
+ export interface SubscriptionsCreateInput {
765
+ subscriptionResource: ResourceKeyWith<"subscription">;
766
+ accountingEntity?: string | null;
767
+ payerRecord: string;
768
+ priceRecordIds?: Array<string> | null;
769
+ items?: Array<{ price_record_id?: string; quantity?: number; [key: string]: unknown; }> | null;
770
+ discounts?: Array<{ calculation_type?: "fixed_amount" | "percentage"; duration?: "every_invoice" | "first_invoice" | "specific_period"; percent?: number; fixed_amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: string; description?: string; [key: string]: unknown; }> | null;
771
+ confirmedQuote?: string | null;
772
+ requireConfirmedQuote?: boolean | null;
773
+ collectionMethod?: "charge_automatically" | "send_invoice" | null;
774
+ gracePeriodDays?: number | null;
775
+ billingCycleMode?: "anniversary" | "calendar_aligned" | null;
776
+ billingAnchorMonth?: number | null;
777
+ billingAnchorDay?: number | null;
778
+ activationPolicy?: "after_first_payment" | "immediate" | null;
779
+ initialTermAnchor?: "first_payment_at" | "subscription_created_at" | null;
780
+ initialPaymentWindowDays?: number | null;
781
+ startedAt?: string | null;
782
+ trialDays?: number | null;
783
+ trialEndsAt?: string | null;
784
+ trialPaymentMethodPolicy?: "optional" | "required" | null;
785
+ lapseBillingBehavior?: "continue_billing" | "suspend_renewals" | "cancel" | null;
786
+ generateInvoice?: boolean | null;
787
+ }
788
+ export type SubscriptionsCreateOutput = { record?: Record<string, unknown>; invoice?: unknown; invoices?: Array<Record<string, unknown>>; [key: string]: unknown; };
789
+
790
+ export interface SubscriptionsGenerateInvoiceInput {
791
+ subscriptionResource: ResourceKeyWith<"subscription">;
792
+ subscriptionRecord: string;
793
+ }
794
+ export type SubscriptionsGenerateInvoiceOutput = { record?: unknown; created?: boolean; period_start?: string; period_end?: string; renewal_outcome?: "canceled" | "not_due" | "processed" | "suspended"; [key: string]: unknown; };
795
+
796
+ export interface SubscriptionsPauseInput {
797
+ subscriptionResource: ResourceKeyWith<"subscription">;
798
+ subscriptionRecord: string;
799
+ }
800
+ export type SubscriptionsPauseOutput = { status?: string; [key: string]: unknown; };
801
+
802
+ export interface SubscriptionsPreviewInput {
803
+ subscriptionResource: ResourceKeyWith<"subscription">;
804
+ priceRecordIds?: Array<string> | null;
805
+ items?: Array<{ price_record_id?: string; quantity?: number; [key: string]: unknown; }> | null;
806
+ discounts?: Array<{ calculation_type?: "fixed_amount" | "percentage"; duration?: "every_invoice" | "first_invoice" | "specific_period"; percent?: number; fixed_amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: string; description?: string; [key: string]: unknown; }> | null;
807
+ collectionMethod?: "charge_automatically" | "send_invoice" | null;
808
+ gracePeriodDays?: number | null;
809
+ billingCycleMode?: "anniversary" | "calendar_aligned" | null;
810
+ billingAnchorMonth?: number | null;
811
+ billingAnchorDay?: number | null;
812
+ activationPolicy?: "after_first_payment" | "immediate" | null;
813
+ initialTermAnchor?: "first_payment_at" | "subscription_created_at" | null;
814
+ initialPaymentWindowDays?: number | null;
815
+ startedAt?: string | null;
816
+ trialDays?: number | null;
817
+ trialEndsAt?: string | null;
818
+ trialPaymentMethodPolicy?: "optional" | "required" | null;
819
+ lapseBillingBehavior?: "continue_billing" | "suspend_renewals" | "cancel" | null;
820
+ }
821
+ export type SubscriptionsPreviewOutput = { currency?: string; billing_cycle_mode?: string; interval?: string; timezone?: string; discounts?: unknown; initial?: { lines?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; total?: { amount: number; currency: string; [key: string]: unknown; }; covered_start?: string; covered_end?: string; reference_start?: string; reference_end?: string; days_charged?: number; days_in_period?: number; is_prorated?: boolean; [key: string]: unknown; }; additional_invoices?: Array<{ lines?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; total?: { amount: number; currency: string; [key: string]: unknown; }; covered_start?: string; covered_end?: string; reference_start?: string; reference_end?: string; days_charged?: number; days_in_period?: number; is_prorated?: boolean; [key: string]: unknown; }>; renewal?: { next_renewal_date?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }; trial_ends_at?: unknown; first_paid_invoice?: unknown; quote?: string; [key: string]: unknown; };
822
+
823
+ export interface SubscriptionsPreviewChangeInput {
824
+ subscriptionResource: ResourceKeyWith<"subscription">;
825
+ subscriptionRecord: string;
826
+ items: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: "catalog" | "custom"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }>;
827
+ effective?: "now" | "next_renewal" | "period" | null;
828
+ periodStart?: string | null;
829
+ prorationBehavior?: "prorate" | "none" | null;
830
+ revisionScope?: "this_renewal" | "this_and_following" | null;
831
+ }
832
+ export type SubscriptionsPreviewChangeOutput = { mode?: string; effective?: string; proration_behavior?: string; changed?: boolean; currency?: string; timezone?: string; effective_date?: string; period_start?: unknown; period_end?: unknown; days_in_period?: unknown; days_remaining?: unknown; items?: Array<{ price_record_id?: string; quantity?: number; pricing?: string; catalog_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; current_unit_price?: unknown; effective_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; charges?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; credits?: Array<{ description?: string; quantity?: number; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; amount?: { amount: number; currency: string; [key: string]: unknown; }; gross_amount?: { amount: number; currency: string; [key: string]: unknown; }; source_invoice_record_id?: string; source_line_record_id?: string; covered_start?: string; covered_end?: string; [key: string]: unknown; }>; applied_to_invoices?: Array<{ invoice_record_id?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; renewal?: unknown; revision?: unknown; schedule?: unknown; replaces_upcoming_items?: boolean; quote?: string; charge_total?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_total?: { amount: number; currency: string; [key: string]: unknown; }; amount_due?: { amount: number; currency: string; [key: string]: unknown; }; net_credit?: { amount: number; currency: string; [key: string]: unknown; }; applied_to_invoices_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_to_balance?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_before?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_after?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; };
833
+
834
+ export interface SubscriptionsResumeInput {
835
+ subscriptionResource: ResourceKeyWith<"subscription">;
836
+ subscriptionRecord: string;
837
+ }
838
+ export type SubscriptionsResumeOutput = { status?: string; [key: string]: unknown; };
839
+
840
+ export interface SubscriptionsSetUpcomingItemsInput {
841
+ subscriptionResource: ResourceKeyWith<"subscription">;
842
+ subscriptionRecord: string;
843
+ desiredPriceRecordIds?: Array<string> | null;
844
+ items?: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: "catalog" | "custom"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }> | null;
845
+ }
846
+ export type SubscriptionsSetUpcomingItemsOutput = { period_start?: string; items_added?: number; items_ended?: number; selection_locked?: boolean; [key: string]: unknown; };
847
+
848
+ export interface TextGenerateInput {
849
+ length: number;
850
+ includeNumbers?: boolean | null;
851
+ includeSpecial?: boolean | null;
852
+ }
853
+ export type TextGenerateOutput = string;
854
+
855
+ export interface TextHashInput {
856
+ value: string;
857
+ }
858
+ export type TextHashOutput = string;
859
+
860
+ export type TextRandomUuidInput = Record<string, never>;
861
+ export type TextRandomUuidOutput = string;
862
+
863
+ export interface TextToContentInput {
864
+ value: string;
865
+ }
866
+ export type TextToContentOutput = ContentDocument;
867
+
868
+ export interface TimeAddInput {
869
+ date: string;
870
+ value: number;
871
+ unit: "days" | "hours" | "minutes" | "months" | "seconds" | "weeks" | "years";
872
+ }
873
+ export type TimeAddOutput = string;
874
+
875
+ export interface TimeDiffInput {
876
+ start: string;
877
+ end: string;
878
+ unit: "days" | "hours" | "minutes" | "months" | "seconds" | "weeks" | "years";
879
+ }
880
+ export type TimeDiffOutput = number;
881
+
882
+ export interface TimeEndOfInput {
883
+ date: string;
884
+ unit: "day" | "hour" | "month" | "quarter" | "week" | "year";
885
+ }
886
+ export type TimeEndOfOutput = string;
887
+
888
+ export interface TimeFormatInput {
889
+ date: string;
890
+ format: string;
891
+ timezone?: string | null;
892
+ }
893
+ export type TimeFormatOutput = string;
894
+
895
+ export interface TimeStartOfInput {
896
+ date: string;
897
+ unit: "day" | "hour" | "month" | "quarter" | "week" | "year";
898
+ }
899
+ export type TimeStartOfOutput = string;
900
+
901
+ export interface TimeSubtractInput {
902
+ date: string;
903
+ value: number;
904
+ unit: "days" | "hours" | "minutes" | "months" | "seconds" | "weeks" | "years";
905
+ }
906
+ export type TimeSubtractOutput = string;
907
+
908
+ export interface TimezoneFormatInput {
909
+ timezone: string;
910
+ format: "abbreviation" | "city" | "full" | "offset";
911
+ }
912
+ export type TimezoneFormatOutput = string;
913
+
914
+ export interface TimezoneInterpretInput {
915
+ value: string;
916
+ timezone: string;
917
+ boundary: "exact" | "start_of_day" | "end_of_day";
918
+ }
919
+ export type TimezoneInterpretOutput = string;
920
+
921
+ export interface TiptapParseInput {
922
+ content?: unknown;
923
+ html?: boolean;
924
+ oneLine?: boolean;
925
+ placeholder?: string;
926
+ }
927
+ export type TiptapParseOutput = unknown;
928
+
929
+ export type TransactionBeginInput = Record<string, never>;
930
+ export type TransactionBeginOutput = null;
931
+
932
+ export type TransactionCommitInput = Record<string, never>;
933
+ export type TransactionCommitOutput = null;
934
+
935
+ export interface TransactionRollbackInput {
936
+ error?: { name?: string; message?: string; code?: string; status?: number; errors?: Record<string, unknown>; failure_id?: number; };
937
+ }
938
+ export type TransactionRollbackOutput = null | { message: string; code: string; status: number; details: Record<string, unknown>; failure: Record<string, unknown>; failure_id: number; };
939
+
940
+ export interface UserAuthorizeInput {
941
+ permission: string;
942
+ user?: Record<string, unknown>;
943
+ }
944
+ export type UserAuthorizeOutput = boolean;
945
+
946
+ export interface WebAgentInput {
947
+ url: string;
948
+ prompt: unknown;
949
+ schema: unknown;
950
+ strict: boolean;
951
+ }
952
+ export type WebAgentOutput = { url?: string; data?: unknown; [key: string]: unknown; };
953
+
954
+ export interface WebBatchScrapeInput {
955
+ urls: Array<string>;
956
+ }
957
+ export type WebBatchScrapeOutput = Array<{ url?: string; markdown?: unknown; html?: unknown; metadata?: { title?: unknown; description?: unknown; language?: unknown; status_code?: unknown; source_url?: unknown; content_type?: unknown; raw?: unknown; [key: string]: unknown; }; images?: unknown; branding?: unknown; [key: string]: unknown; }>;
958
+
959
+ export interface WebCrawlInput {
960
+ url: string;
961
+ limit?: number | null;
962
+ maxDepth?: number | null;
963
+ formats?: unknown[] | null;
964
+ includePaths?: Array<string> | null;
965
+ excludePaths?: Array<string> | null;
966
+ allowSubdomains?: boolean | null;
967
+ }
968
+ export type WebCrawlOutput = { url?: string; job_id?: string; status?: string; total?: unknown; pages?: unknown; [key: string]: unknown; };
969
+
970
+ export interface WebExtractInput {
971
+ urls: Array<string>;
972
+ prompt: unknown;
973
+ schema: unknown;
974
+ strict: boolean;
975
+ }
976
+ export type WebExtractOutput = { urls?: Array<string>; data?: unknown; [key: string]: unknown; };
977
+
978
+ export interface WebGoogleSearchInput {
979
+ query: unknown;
980
+ limit?: number | null;
981
+ }
982
+ export type WebGoogleSearchOutput = { query?: string; results?: unknown; [key: string]: unknown; };
983
+
984
+ export interface WebMapInput {
985
+ url: string;
986
+ search?: unknown;
987
+ limit?: number | null;
988
+ }
989
+ export type WebMapOutput = { url?: string; links?: unknown; [key: string]: unknown; };
990
+
991
+ export interface WebPdfInput {
992
+ url: string;
993
+ format?: "a3" | "a4" | "a5" | "legal" | "letter" | "tabloid" | null;
994
+ landscape?: boolean | null;
995
+ printBackground?: boolean | null;
996
+ scale?: number | null;
997
+ waitMs?: number | null;
998
+ }
999
+ export type WebPdfOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };
1000
+
1001
+ export interface WebScrapeInput {
1002
+ url: string;
1003
+ mode?: "content" | "json" | null;
1004
+ formats?: unknown[] | null;
1005
+ onlyMainContent?: boolean | null;
1006
+ prompt?: unknown;
1007
+ schema?: unknown;
1008
+ strict?: boolean | null;
1009
+ maxAgeMs?: number | null;
1010
+ }
1011
+ export type WebScrapeOutput = { url?: string; markdown?: unknown; html?: unknown; metadata?: { title?: unknown; description?: unknown; language?: unknown; status_code?: unknown; source_url?: unknown; content_type?: unknown; raw?: unknown; [key: string]: unknown; }; images?: unknown; branding?: unknown; [key: string]: unknown; };
1012
+
1013
+ export interface WebScreenshotInput {
1014
+ url: string;
1015
+ fullPage?: boolean | null;
1016
+ width?: number | null;
1017
+ height?: number | null;
1018
+ waitMs?: number | null;
1019
+ imageType?: "jpeg" | "png" | "webp" | null;
1020
+ }
1021
+ export type WebScreenshotOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };
1022
+
1023
+ export interface WebSearchRankedInput {
1024
+ query: unknown;
1025
+ limit?: number | null;
1026
+ }
1027
+ export type WebSearchRankedOutput = { query?: string; results?: unknown; [key: string]: unknown; };
1028
+
1029
+ export interface WorkflowRunInput {
1030
+ workflow: string | { id: string; params?: Record<string, unknown>; [key: string]: unknown; };
1031
+ input?: Record<string, unknown> | null;
1032
+ runAsResource?: ResourceKeyWith<"authenticatable"> | null;
1033
+ runAsRecord?: string | null;
1034
+ executionMode?: "async" | "sync" | null;
1035
+ }
1036
+ export type WorkflowRunOutput = unknown;
1037
+
1038
+ export interface WorkflowUrlInput {
1039
+ workflow: { id: string; params?: Record<string, unknown>; [key: string]: unknown; };
1040
+ }
1041
+ export type WorkflowUrlOutput = unknown;
1042
+
1043
+ export interface WorkspaceLoginUrlInput {
1044
+ resource: string;
1045
+ }
1046
+ export type WorkspaceLoginUrlOutput = string;
1047
+
1048
+ export interface WorkspaceSetValueInput {
1049
+ key: string;
1050
+ value?: unknown;
1051
+ }
1052
+ export type WorkspaceSetValueOutput = unknown;
1053
+
1054
+ export interface WorkspaceSetValuesInput {
1055
+ values?: Record<string, unknown>;
1056
+ }
1057
+ export type WorkspaceSetValuesOutput = Record<string, unknown>;
1058
+
1059
+ export interface WorkspaceValueInput {
1060
+ key: string;
1061
+ defaultValue?: unknown;
1062
+ }
1063
+ export type WorkspaceValueOutput = unknown;
1064
+
1065
+ export type WorkspaceValuesInput = Record<string, never>;
1066
+ export type WorkspaceValuesOutput = Record<string, unknown>;
1067
+
1068
+ export const ai = {
1069
+ /** Ask a decisions model typed questions about some content and get labelled answers with their probabilities */
1070
+ decide: (input: AiDecideInput): Promise<AiDecideOutput> => invoke('ai.decide', input),
1071
+ /** Hand a prompt to the AI assistant, which can look up data and take action in your workspace */
1072
+ runPrompt: (input: AiRunPromptInput): Promise<AiRunPromptOutput> => invoke('ai.run_prompt', input),
1073
+ };
1074
+
1075
+ export const auth = {
1076
+ /** Impersonate an authenticatable user, switching the current session to act as that user */
1077
+ impersonate: (input: AuthImpersonateInput): Promise<AuthImpersonateOutput> => invoke('auth.impersonate', input),
1078
+ /** Login an authenticatable record */
1079
+ login: (input: AuthLoginInput): Promise<AuthLoginOutput> => invoke('auth.login', input),
1080
+ };
1081
+
1082
+ export const calendar = {
1083
+ /** Generate a shareable calendar link (Google, Apple, Outlook) for an eventable record */
1084
+ generateLink: (input: CalendarGenerateLinkInput): Promise<CalendarGenerateLinkOutput> => invoke('calendar.generate_link', input),
1085
+ /** Find eventable records occurring in a date window no wider than 3 months, expanding recurring events into one row per occurrence and per calendar the record appears on. Returns every match, so narrow the window or filters on a busy resource */
1086
+ searchEvents: (input: CalendarSearchEventsInput): Promise<CalendarSearchEventsOutput> => invoke('calendar.search_events', input),
1087
+ };
1088
+
1089
+ export const callback = {
1090
+ /** Get a callback value */
1091
+ get: (input: CallbackGetInput): Promise<CallbackGetOutput> => invoke('callback.get', input),
1092
+ /** Remove a callback value */
1093
+ remove: (input: CallbackRemoveInput): Promise<CallbackRemoveOutput> => invoke('callback.remove', input),
1094
+ /** Set a callback value */
1095
+ set: (input: CallbackSetInput): Promise<CallbackSetOutput> => invoke('callback.set', input),
1096
+ };
1097
+
1098
+ export const chart = {
1099
+ /** Group data by category for pie or donut charts */
1100
+ distribution: (input: ChartDistributionInput): Promise<ChartDistributionOutput> => invoke('chart.distribution', input),
1101
+ /** Calculate a single metric value (total revenue, order count, etc.) */
1102
+ kpi: (input: ChartKpiInput): Promise<ChartKpiOutput> => invoke('chart.kpi', input),
1103
+ /** Rank entities by a metric (top customers, best sellers, etc.) */
1104
+ leaderboard: (input: ChartLeaderboardInput): Promise<ChartLeaderboardOutput> => invoke('chart.leaderboard', input),
1105
+ /** Aggregate data over time for line or area charts */
1106
+ timeSeries: (input: ChartTimeSeriesInput): Promise<ChartTimeSeriesOutput> => invoke('chart.time_series', input),
1107
+ };
1108
+
1109
+ export const data = {
1110
+ /** Compute grouped metrics (count, sum, avg, etc.) over records */
1111
+ aggregateMetrics: (input: DataAggregateMetricsInput): Promise<DataAggregateMetricsOutput> => invoke('data.aggregate_metrics', input),
1112
+ /** Count the number of records matching the filters */
1113
+ count: (input: DataCountInput): Promise<DataCountOutput> => invoke('data.count', input),
1114
+ /** Create a new record */
1115
+ create: (input: DataCreateInput): Promise<DataCreateOutput> => invoke('data.create', input),
1116
+ /** Create many records at once */
1117
+ createMany: (input: DataCreateManyInput): Promise<DataCreateManyOutput> => invoke('data.create-many', input),
1118
+ /** Delete a record */
1119
+ delete: (input: DataDeleteInput): Promise<DataDeleteOutput> => invoke('data.delete', input),
1120
+ /** Delete all records matching filter conditions */
1121
+ deleteMany: (input: DataDeleteManyInput): Promise<DataDeleteManyOutput> => invoke('data.delete-many', input),
1122
+ /** Find a single record by ID or by filters */
1123
+ find: (input: DataFindInput): Promise<DataFindOutput> => invoke('data.find', input),
1124
+ /** Find a record by attributes, or create a new one when no match exists */
1125
+ findOrCreate: (input: DataFindOrCreateInput): Promise<DataFindOrCreateOutput> => invoke('data.find-or-create', input),
1126
+ relation: {
1127
+ /** Attach a related record to a relation. Plural relations (BelongsToMany, HasMany) keep their existing records. */
1128
+ attach: (input: DataRelationAttachInput): Promise<DataRelationAttachOutput> => invoke('data.relation.attach', input),
1129
+ /** Attach related records to a plural relation (BelongsToMany, HasMany) */
1130
+ attachMany: (input: DataRelationAttachManyInput): Promise<DataRelationAttachManyOutput> => invoke('data.relation.attach-many', input),
1131
+ /** Detach a related record. */
1132
+ detach: (input: DataRelationDetachInput): Promise<DataRelationDetachOutput> => invoke('data.relation.detach', input),
1133
+ /** Detach related records from a plural relation (BelongsToMany, HasMany) */
1134
+ detachMany: (input: DataRelationDetachManyInput): Promise<DataRelationDetachManyOutput> => invoke('data.relation.detach-many', input),
1135
+ /** Sync related records for a relation (replaces all existing) */
1136
+ sync: (input: DataRelationSyncInput): Promise<DataRelationSyncOutput> => invoke('data.relation.sync', input),
1137
+ },
1138
+ /** Restore an archived record */
1139
+ restore: (input: DataRestoreInput): Promise<DataRestoreOutput> => invoke('data.restore', input),
1140
+ /** Search for records */
1141
+ search: (input: DataSearchInput): Promise<DataSearchOutput> => invoke('data.search', input),
1142
+ /** Search for records by semantic similarity */
1143
+ semanticSearch: (input: DataSemanticSearchInput): Promise<DataSemanticSearchOutput> => invoke('data.semantic_search', input),
1144
+ /** Sum a numeric field across records matching the filters */
1145
+ sum: (input: DataSumInput): Promise<DataSumOutput> => invoke('data.sum', input),
1146
+ /** Update an existing record found by ID or by filters */
1147
+ update: (input: DataUpdateInput): Promise<DataUpdateOutput> => invoke('data.update', input),
1148
+ /** Find a record by attributes and update it, or create a new one */
1149
+ updateOrCreate: (input: DataUpdateOrCreateInput): Promise<DataUpdateOrCreateOutput> => invoke('data.update-or-create', input),
1150
+ /** Validate a record */
1151
+ validate: (input: DataValidateInput): Promise<DataValidateOutput> => invoke('data.validate', input),
1152
+ };
1153
+
1154
+ export const date = {
1155
+ /** Add N days/weeks/months/years to a date */
1156
+ add: (input: DateAddInput): Promise<DateAddOutput> => invoke('date.add', input),
1157
+ /** Difference between two dates in a specified unit */
1158
+ diff: (input: DateDiffInput): Promise<DateDiffOutput> => invoke('date.diff', input),
1159
+ /** Snap a date to the end of a period (week, month, quarter, year) */
1160
+ endOf: (input: DateEndOfInput): Promise<DateEndOfOutput> => invoke('date.end_of', input),
1161
+ /** Format a date string using ICU date format syntax (e.g., "yyyy-MM-dd", "MMM d, yyyy"). */
1162
+ format: (input: DateFormatInput): Promise<DateFormatOutput> => invoke('date.format', input),
1163
+ /** Snap a date to the start of a period (week, month, quarter, year) */
1164
+ startOf: (input: DateStartOfInput): Promise<DateStartOfOutput> => invoke('date.start_of', input),
1165
+ /** Subtract N days/weeks/months/years from a date */
1166
+ subtract: (input: DateSubtractInput): Promise<DateSubtractOutput> => invoke('date.subtract', input),
1167
+ };
1168
+
1169
+ export const file = {
1170
+ /** Change a file's visibility by moving it between private and public storage */
1171
+ changeVisibility: (input: FileChangeVisibilityInput): Promise<FileChangeVisibilityOutput> => invoke('file.change_visibility', input),
1172
+ /** Download a file from a public http(s) URL and save it privately in the workspace */
1173
+ createFromUrl: (input: FileCreateFromUrlInput): Promise<FileCreateFromUrlOutput> => invoke('file.create_from_url', input),
1174
+ /** Create a public library master from an accessible workspace file, preserving external sources. Accepts images, video, audio and PDF by the type detected from bytes. Store other files in a record file field. Returns the library File ID */
1175
+ createMediaLibraryItem: (input: FileCreateMediaLibraryItemInput): Promise<FileCreateMediaLibraryItemOutput> => invoke('file.create_media_library_item', input),
1176
+ /** Generate a QR code PNG image that encodes a value and save it privately in the workspace */
1177
+ createQrCode: (input: FileCreateQrCodeInput): Promise<FileCreateQrCodeOutput> => invoke('file.create_qr_code', input),
1178
+ };
1179
+
1180
+ export const guard = {
1181
+ /** Perform a validation check */
1182
+ validate: (input: GuardValidateInput): Promise<GuardValidateOutput> => invoke('guard.validate', input),
1183
+ };
1184
+
1185
+ export const http = {
1186
+ /** Send an HTTP request */
1187
+ request: (input: HttpRequestInput): Promise<HttpRequestOutput> => invoke('http.request', input),
1188
+ };
1189
+
1190
+ export const lifecycle = {
1191
+ /** Return modified record fields from a record lifecycle workflow */
1192
+ output: (input: LifecycleOutputInput): Promise<LifecycleOutputOutput> => invoke('lifecycle.output', input),
1193
+ };
1194
+
1195
+ export const mail = {
1196
+ /** Find tracked emails by recipient, linked record, subject, sender, status, or date, newest first, with the delivery status of each recipient, including hard and soft bounces. Searches without a record, or that include the record's current addresses, require a Run As identity with the Manage Notifications permission */
1197
+ search: (input: MailSearchInput): Promise<MailSearchOutput> => invoke('mail.search', input),
1198
+ /** Send an email */
1199
+ send: <const I extends DeepReadonly<MailSendInput>>(input: StaticLiquid<I, MailSendInput>): Promise<MailSendOutput> => invoke('mail.send', input),
1200
+ /** Send an email using a notification type and template */
1201
+ sendNotification: (input: MailSendNotificationInput): Promise<MailSendNotificationOutput> => invoke('mail.send-notification', input),
1202
+ };
1203
+
1204
+ export const markdown = {
1205
+ /** Convert rich Content into a markdown string */
1206
+ fromContent: (input: MarkdownFromContentInput): Promise<MarkdownFromContentOutput> => invoke('markdown.from_content', input),
1207
+ /** Convert a markdown string into rich Content. Nodes a destination Content field disallows may be rejected by that field. */
1208
+ toContent: (input: MarkdownToContentInput): Promise<MarkdownToContentOutput> => invoke('markdown.to_content', input),
1209
+ };
1210
+
1211
+ export const mediaLibrary = {
1212
+ /** Create a media library folder */
1213
+ createFolder: (input: MediaLibraryCreateFolderInput): Promise<MediaLibraryCreateFolderOutput> => invoke('media_library.create_folder', input),
1214
+ /** Detach a file from the media library */
1215
+ deleteItem: (input: MediaLibraryDeleteItemInput): Promise<MediaLibraryDeleteItemOutput> => invoke('media_library.delete_item', input),
1216
+ /** Move media library items into a target folder */
1217
+ moveItems: (input: MediaLibraryMoveItemsInput): Promise<MediaLibraryMoveItemsOutput> => invoke('media_library.move_items', input),
1218
+ /** Rename a media library item and/or move it into a folder */
1219
+ updateItem: (input: MediaLibraryUpdateItemInput): Promise<MediaLibraryUpdateItemOutput> => invoke('media_library.update_item', input),
1220
+ };
1221
+
1222
+ export const money = {
1223
+ /** Format a money value as a currency string */
1224
+ format: (input: MoneyFormatInput): Promise<MoneyFormatOutput> => invoke('money.format', input),
1225
+ };
1226
+
1227
+ export const notification = {
1228
+ /** Send a notification email to a notifiable record */
1229
+ send: <const I extends DeepReadonly<NotificationSendInput>>(input: StaticLiquid<I, NotificationSendInput>): Promise<NotificationSendOutput> => invoke('notification.send', input),
1230
+ /** Find records with filters and send each record\u2019s notification to the type\u2019s configured recipient resource */
1231
+ sendBulkNotifications: (input: NotificationSendBulkNotificationsInput): Promise<NotificationSendBulkNotificationsOutput> => invoke('notification.send-bulk-notifications', input),
1232
+ /** Send a notification template to a full record of the type\u2019s recipient resource */
1233
+ sendNotification: (input: NotificationSendNotificationInput): Promise<NotificationSendNotificationOutput> => invoke('notification.send-notification', input),
1234
+ /** Record whether a notifiable record agreed to receive email or SMS */
1235
+ setConsent: (input: NotificationSetConsentInput): Promise<NotificationSetConsentOutput> => invoke('notification.set-consent', input),
1236
+ };
1237
+
1238
+ export const number = {
1239
+ /** Format a number with configurable decimal places */
1240
+ format: (input: NumberFormatInput): Promise<NumberFormatOutput> => invoke('number.format', input),
1241
+ };
1242
+
1243
+ const package_ = {
1244
+ /** Read an input value collected when this package was installed */
1245
+ installInput: (input: PackageInstallInputInput): Promise<PackageInstallInputOutput> => invoke('package.install-input', input),
1246
+ };
1247
+ export { package_ as package };
1248
+
1249
+ export const page = {
1250
+ /** Get the URL for a page with route parameters */
1251
+ url: (input: PageUrlInput): Promise<PageUrlOutput> => invoke('page.url', input),
1252
+ };
1253
+
1254
+ export const payables = {
1255
+ /** Void an unpaid draft or open invoice. Rejects collected payments and payments in progress. Does not refund payments or cancel subscriptions. */
1256
+ void: (input: PayablesVoidInput): Promise<PayablesVoidOutput> => invoke('payables.void', input),
1257
+ /** Write off all or part of an open invoice while preserving its original total. */
1258
+ writeOff: (input: PayablesWriteOffInput): Promise<PayablesWriteOffOutput> => invoke('payables.write-off', input),
1259
+ };
1260
+
1261
+ export const payment = {
1262
+ /** Record a manual payment against a payable record */
1263
+ createManual: (input: PaymentCreateManualInput): Promise<PaymentCreateManualOutput> => invoke('payment.create_manual', input),
1264
+ };
1265
+
1266
+ export const payments = {
1267
+ /** Charge a payable record using the payer default Stripe payment method */
1268
+ charge: (input: PaymentsChargeInput): Promise<PaymentsChargeOutput> => invoke('payments.charge', input),
1269
+ /** Create a Stripe Checkout session to collect payment against a payable record */
1270
+ checkout: (input: PaymentsCheckoutInput): Promise<PaymentsCheckoutOutput> => invoke('payments.checkout', input),
1271
+ /** Confirm new or saved payment details collected by PaymentForm. Return this output to the form for authentication. Run after committing checkout choices; Stripe charges cannot be rolled back. */
1272
+ confirm: (input: PaymentsConfirmInput): Promise<PaymentsConfirmOutput> => invoke('payments.confirm', input),
1273
+ /** Process a full or partial refund against a payment record */
1274
+ refund: (input: PaymentsRefundInput): Promise<PaymentsRefundOutput> => invoke('payments.refund', input),
1275
+ /** Void a mistaken manual payment without recording a refund. */
1276
+ void: (input: PaymentsVoidInput): Promise<PaymentsVoidOutput> => invoke('payments.void', input),
1277
+ };
1278
+
1279
+ export const phone = {
1280
+ /** Format a phone number into a human-readable string */
1281
+ format: (input: PhoneFormatInput): Promise<PhoneFormatOutput> => invoke('phone.format', input),
1282
+ };
1283
+
1284
+ export const scheduling = {
1285
+ /** Book a slot that Find Slots returned, as the run identity. Check the slot and return the booking with the caller's view. Return only the booking id if the caller cannot read the booking. Search accepts the Find Slots input with camelCase or snake_case keys. A pool tries its next free member when admission refuses the pick; a slot that is gone fails with the $capacity error */
1286
+ bookSlot: (input: SchedulingBookSlotInput): Promise<SchedulingBookSlotOutput> => invoke('scheduling.book_slot', input),
1287
+ /** Find the times a booking can start across groups of Schedulable records, inside their open hours and outside the time bookings take, without changing records. A Request workflow that runs as another identity searches with the view of the person who called it */
1288
+ findSlots: (input: SchedulingFindSlotsInput): Promise<SchedulingFindSlotsOutput> => invoke('scheduling.find_slots', input),
1289
+ };
1290
+
1291
+ export const schema = {
1292
+ /** Convert a schema definition into its JSON Schema document \u2014 the shape used to constrain AI and extraction output */
1293
+ toJsonSchema: (input: SchemaToJsonSchemaInput): Promise<SchemaToJsonSchemaOutput> => invoke('schema.to_json_schema', input),
1294
+ };
1295
+
1296
+ export const security = {
1297
+ /** Generate a secure random password */
1298
+ randomPassword: (input: SecurityRandomPasswordInput): Promise<SecurityRandomPasswordOutput> => invoke('security.random_password', input),
1299
+ };
1300
+
1301
+ export const sms = {
1302
+ /** Send a notification template by SMS to a full record of the type\u2019s recipient resource */
1303
+ sendNotification: (input: SmsSendNotificationInput): Promise<SmsSendNotificationOutput> => invoke('sms.send-notification', input),
1304
+ };
1305
+
1306
+ export const subscriptions = {
1307
+ /** Start a draft subscription using its snapshotted activation and trial policies */
1308
+ activate: (input: SubscriptionsActivateInput): Promise<SubscriptionsActivateOutput> => invoke('subscriptions.activate', input),
1309
+ /** Cancel a subscription immediately, or at the end of the current billing period */
1310
+ cancel: (input: SubscriptionsCancelInput): Promise<SubscriptionsCancelOutput> => invoke('subscriptions.cancel', input),
1311
+ /** Change subscription items now with optional proration, schedule the selection for the next renewal or a later billing period, or revise an eligible unpaid current or upcoming renewal invoice. An incomplete subscription can change now without a revision scope; this revises its first invoice in place. Renewal revisions use full-period prices without proration. Net prorated credits first reduce open current-period invoices of the subscription, then go to the payer balance. */
1312
+ changeItems: (input: SubscriptionsChangeItemsInput): Promise<SubscriptionsChangeItemsOutput> => invoke('subscriptions.change_items', input),
1313
+ /** Create and activate a subscription for a payer in one step: the record, an item per price, and optionally the first invoice */
1314
+ create: (input: SubscriptionsCreateInput): Promise<SubscriptionsCreateOutput> => invoke('subscriptions.create', input),
1315
+ /** Generate the payable invoice for the saved subscription schedule; partial calendar periods prorate recurring lines and full periods use the original prices */
1316
+ generateInvoice: (input: SubscriptionsGenerateInvoiceInput): Promise<SubscriptionsGenerateInvoiceOutput> => invoke('subscriptions.generate_invoice', input),
1317
+ /** Pause a billing subscription so no further invoices generate until it is resumed */
1318
+ pause: (input: SubscriptionsPauseInput): Promise<SubscriptionsPauseOutput> => invoke('subscriptions.pause', input),
1319
+ /** Preview initial subscription charges, covered dates, and renewal amounts without creating records or collecting payment */
1320
+ preview: (input: SubscriptionsPreviewInput): Promise<SubscriptionsPreviewOutput> => invoke('subscriptions.preview', input),
1321
+ /** Preview a complete subscription item selection effective now, at the next renewal, or at a later billing period, without changing records */
1322
+ previewChange: (input: SubscriptionsPreviewChangeInput): Promise<SubscriptionsPreviewChangeOutput> => invoke('subscriptions.preview_change', input),
1323
+ /** Resume a paused subscription; its status re-derives from the latest invoice */
1324
+ resume: (input: SubscriptionsResumeInput): Promise<SubscriptionsResumeOutput> => invoke('subscriptions.resume', input),
1325
+ /** Safely replace the complete price selection that takes effect in the next billing period */
1326
+ setUpcomingItems: (input: SubscriptionsSetUpcomingItemsInput): Promise<SubscriptionsSetUpcomingItemsOutput> => invoke('subscriptions.set_upcoming_items', input),
1327
+ };
1328
+
1329
+ export const text = {
1330
+ /** Generate a random string with configurable character sets */
1331
+ generate: (input: TextGenerateInput): Promise<TextGenerateOutput> => invoke('text.generate', input),
1332
+ /** Hash a text value */
1333
+ hash: (input: TextHashInput): Promise<TextHashOutput> => invoke('text.hash', input),
1334
+ /** Generate a random UUID v7 */
1335
+ randomUuid: (input: TextRandomUuidInput = {}): Promise<TextRandomUuidOutput> => invoke('text.random_uuid', input),
1336
+ /** Convert a plain text string into rich Content */
1337
+ toContent: (input: TextToContentInput): Promise<TextToContentOutput> => invoke('text.to_content', input),
1338
+ };
1339
+
1340
+ export const time = {
1341
+ /** Add N seconds/minutes/hours/days/weeks/months/years to a datetime */
1342
+ add: (input: TimeAddInput): Promise<TimeAddOutput> => invoke('time.add', input),
1343
+ /** Difference between two datetimes in a specified unit */
1344
+ diff: (input: TimeDiffInput): Promise<TimeDiffOutput> => invoke('time.diff', input),
1345
+ /** Snap a datetime to the end of a period (hour, day, week, month, quarter, year) */
1346
+ endOf: (input: TimeEndOfInput): Promise<TimeEndOfOutput> => invoke('time.end_of', input),
1347
+ /** Format a datetime string using ICU date format syntax (e.g., "yyyy-MM-dd HH:mm:ss", "MMM d, yyyy h:mm a"). */
1348
+ format: (input: TimeFormatInput): Promise<TimeFormatOutput> => invoke('time.format', input),
1349
+ /** Snap a datetime to the start of a period (hour, day, week, month, quarter, year) */
1350
+ startOf: (input: TimeStartOfInput): Promise<TimeStartOfOutput> => invoke('time.start_of', input),
1351
+ /** Subtract N seconds/minutes/hours/days/weeks/months/years from a datetime */
1352
+ subtract: (input: TimeSubtractInput): Promise<TimeSubtractOutput> => invoke('time.subtract', input),
1353
+ };
1354
+
1355
+ export const timezone = {
1356
+ /** Format a timezone identifier into a human-readable string. Supports formats: full (region/city with offset), offset (UTC offset), abbreviation (timezone abbreviation), and city (city name only). */
1357
+ format: (input: TimezoneFormatInput): Promise<TimezoneFormatOutput> => invoke('timezone.format', input),
1358
+ /** Interpret a local date or datetime in a timezone and return the canonical UTC datetime string. */
1359
+ interpret: (input: TimezoneInterpretInput): Promise<TimezoneInterpretOutput> => invoke('timezone.interpret', input),
1360
+ };
1361
+
1362
+ export const tiptap = {
1363
+ /** Parse Tiptap content to HTML or text */
1364
+ parse: (input: TiptapParseInput): Promise<TiptapParseOutput> => invoke('tiptap.parse', input),
1365
+ };
1366
+
1367
+ export const transaction = {
1368
+ /** Transaction control for transaction(). */
1369
+ begin: (input: TransactionBeginInput = {}): Promise<TransactionBeginOutput> => invoke('transaction.begin', input),
1370
+ /** Transaction control for transaction(). */
1371
+ commit: (input: TransactionCommitInput = {}): Promise<TransactionCommitOutput> => invoke('transaction.commit', input),
1372
+ /** Transaction control for transaction(). */
1373
+ rollback: (input: TransactionRollbackInput): Promise<TransactionRollbackOutput> => invoke('transaction.rollback', input),
1374
+ };
1375
+
1376
+ export const user = {
1377
+ /** Check user permissions for authorization */
1378
+ authorize: (input: UserAuthorizeInput): Promise<UserAuthorizeOutput> => invoke('user.authorize', input),
1379
+ };
1380
+
1381
+ export const web = {
1382
+ /** Extract structured data from a web page, guided by a natural-language prompt and a required shape */
1383
+ agent: (input: WebAgentInput): Promise<WebAgentOutput> => invoke('web.agent', input),
1384
+ /** Scrape multiple web pages in one batch and poll until every page is finished */
1385
+ batchScrape: (input: WebBatchScrapeInput): Promise<WebBatchScrapeOutput> => invoke('web.batch_scrape', input),
1386
+ /** Crawl a site and return multi-page content (polls to completion) */
1387
+ crawl: (input: WebCrawlInput): Promise<WebCrawlOutput> => invoke('web.crawl', input),
1388
+ /** Extract structured data from one or more web pages, guided by a required shape and a supporting prompt */
1389
+ extract: (input: WebExtractInput): Promise<WebExtractOutput> => invoke('web.extract', input),
1390
+ /** Search Google and return the organic results */
1391
+ googleSearch: (input: WebGoogleSearchInput): Promise<WebGoogleSearchOutput> => invoke('web.google_search', input),
1392
+ /** Map a site and return all of its discoverable URLs */
1393
+ map: (input: WebMapInput): Promise<WebMapOutput> => invoke('web.map', input),
1394
+ /** Render a web page to a PDF document */
1395
+ pdf: (input: WebPdfInput): Promise<WebPdfOutput> => invoke('web.pdf', input),
1396
+ /** Scrape a web page in content mode (markdown/HTML plus metadata) or JSON mode (structured data extracted against a schema) */
1397
+ scrape: (input: WebScrapeInput): Promise<WebScrapeOutput> => invoke('web.scrape', input),
1398
+ /** Render a web page to a screenshot (PNG, JPEG, or WebP) */
1399
+ screenshot: (input: WebScreenshotInput): Promise<WebScreenshotOutput> => invoke('web.screenshot', input),
1400
+ /** Search the web for a query and return ranked results */
1401
+ searchRanked: (input: WebSearchRankedInput): Promise<WebSearchRankedOutput> => invoke('web.search_ranked', input),
1402
+ };
1403
+
1404
+ export const workflow = {
1405
+ /** Runs a workflow using its published version */
1406
+ run: (input: WorkflowRunInput): Promise<WorkflowRunOutput> => invoke('workflow.run', input),
1407
+ /** Get the URL for a workflow with route parameters */
1408
+ url: (input: WorkflowUrlInput): Promise<WorkflowUrlOutput> => invoke('workflow.url', input),
1409
+ };
1410
+
1411
+ export const workspace = {
1412
+ /** Get the login URL for an authenticatable resource */
1413
+ loginUrl: (input: WorkspaceLoginUrlInput): Promise<WorkspaceLoginUrlOutput> => invoke('workspace.login_url', input),
1414
+ /** Set the value of a field in a workspace */
1415
+ setValue: (input: WorkspaceSetValueInput): Promise<WorkspaceSetValueOutput> => invoke('workspace.set_value', input),
1416
+ /** Set multiple workspace field values at once from a key => value map */
1417
+ setValues: (input: WorkspaceSetValuesInput): Promise<WorkspaceSetValuesOutput> => invoke('workspace.set_values', input),
1418
+ /** Get the value of a field in a workspace */
1419
+ value: (input: WorkspaceValueInput): Promise<WorkspaceValueOutput> => invoke('workspace.value', input),
1420
+ /** Get all workspace field values as a dictionary */
1421
+ values: (input: WorkspaceValuesInput = {}): Promise<WorkspaceValuesOutput> => invoke('workspace.values', input),
1422
+ };
1423
+
1424
+ `, "/sdk/generated/profiles/test.ts": "// AUTO-GENERATED by `php artisan workflows:script-sdk:build`. Do not edit by hand.\nimport { data as rootData } from '../../data';\nimport { workspace as rootWorkspace } from '../../workspace-values';\nimport { ai as rootAi, calendar as rootCalendar, callback as rootCallback, chart as rootChart, date as rootDate, file as rootFile, guard as rootGuard, http as rootHttp, lifecycle as rootLifecycle, mail as rootMail, markdown as rootMarkdown, mediaLibrary as rootMediaLibrary, money as rootMoney, notification as rootNotification, number as rootNumber, package as rootPackage, page as rootPage, payables as rootPayables, payment as rootPayment, payments as rootPayments, phone as rootPhone, scheduling as rootScheduling, schema as rootSchema, security as rootSecurity, sms as rootSms, subscriptions as rootSubscriptions, text as rootText, time as rootTime, timezone as rootTimezone, tiptap as rootTiptap, user as rootUser, web as rootWeb, workflow as rootWorkflow } from '../capabilities';\n\nexport const ai: {\n decide: typeof rootAi.decide;\n runPrompt: typeof rootAi.runPrompt;\n} = {\n decide: rootAi.decide,\n runPrompt: rootAi.runPrompt,\n};\n\nexport const calendar: {\n generateLink: typeof rootCalendar.generateLink;\n searchEvents: typeof rootCalendar.searchEvents;\n} = {\n generateLink: rootCalendar.generateLink,\n searchEvents: rootCalendar.searchEvents,\n};\n\nexport const callback: {\n get: typeof rootCallback.get;\n remove: typeof rootCallback.remove;\n set: typeof rootCallback.set;\n} = {\n get: rootCallback.get,\n remove: rootCallback.remove,\n set: rootCallback.set,\n};\n\nexport const chart: {\n distribution: typeof rootChart.distribution;\n kpi: typeof rootChart.kpi;\n leaderboard: typeof rootChart.leaderboard;\n timeSeries: typeof rootChart.timeSeries;\n} = {\n distribution: rootChart.distribution,\n kpi: rootChart.kpi,\n leaderboard: rootChart.leaderboard,\n timeSeries: rootChart.timeSeries,\n};\n\nexport const data: {\n aggregateMetrics: typeof rootData.aggregateMetrics;\n count: typeof rootData.count;\n create: typeof rootData.create;\n createMany: typeof rootData.createMany;\n delete: typeof rootData.delete;\n deleteMany: typeof rootData.deleteMany;\n find: typeof rootData.find;\n findOrCreate: typeof rootData.findOrCreate;\n relation: {\n attach: typeof rootData.relation.attach;\n attachMany: typeof rootData.relation.attachMany;\n detach: typeof rootData.relation.detach;\n detachMany: typeof rootData.relation.detachMany;\n sync: typeof rootData.relation.sync;\n };\n restore: typeof rootData.restore;\n search: typeof rootData.search;\n semanticSearch: typeof rootData.semanticSearch;\n sum: typeof rootData.sum;\n update: typeof rootData.update;\n updateOrCreate: typeof rootData.updateOrCreate;\n validate: typeof rootData.validate;\n} = {\n aggregateMetrics: rootData.aggregateMetrics,\n count: rootData.count,\n create: rootData.create,\n createMany: rootData.createMany,\n delete: rootData.delete,\n deleteMany: rootData.deleteMany,\n find: rootData.find,\n findOrCreate: rootData.findOrCreate,\n relation: {\n attach: rootData.relation.attach,\n attachMany: rootData.relation.attachMany,\n detach: rootData.relation.detach,\n detachMany: rootData.relation.detachMany,\n sync: rootData.relation.sync,\n },\n restore: rootData.restore,\n search: rootData.search,\n semanticSearch: rootData.semanticSearch,\n sum: rootData.sum,\n update: rootData.update,\n updateOrCreate: rootData.updateOrCreate,\n validate: rootData.validate,\n};\n\nexport const date: {\n add: typeof rootDate.add;\n diff: typeof rootDate.diff;\n endOf: typeof rootDate.endOf;\n format: typeof rootDate.format;\n startOf: typeof rootDate.startOf;\n subtract: typeof rootDate.subtract;\n} = {\n add: rootDate.add,\n diff: rootDate.diff,\n endOf: rootDate.endOf,\n format: rootDate.format,\n startOf: rootDate.startOf,\n subtract: rootDate.subtract,\n};\n\nexport const file: {\n changeVisibility: typeof rootFile.changeVisibility;\n createFromUrl: typeof rootFile.createFromUrl;\n createMediaLibraryItem: typeof rootFile.createMediaLibraryItem;\n createQrCode: typeof rootFile.createQrCode;\n} = {\n changeVisibility: rootFile.changeVisibility,\n createFromUrl: rootFile.createFromUrl,\n createMediaLibraryItem: rootFile.createMediaLibraryItem,\n createQrCode: rootFile.createQrCode,\n};\n\nexport const guard: {\n validate: typeof rootGuard.validate;\n} = {\n validate: rootGuard.validate,\n};\n\nexport const http: {\n request: typeof rootHttp.request;\n} = {\n request: rootHttp.request,\n};\n\nexport const lifecycle: {\n output: typeof rootLifecycle.output;\n} = {\n output: rootLifecycle.output,\n};\n\nexport const mail: {\n search: typeof rootMail.search;\n send: typeof rootMail.send;\n sendNotification: typeof rootMail.sendNotification;\n} = {\n search: rootMail.search,\n send: rootMail.send,\n sendNotification: rootMail.sendNotification,\n};\n\nexport const markdown: {\n fromContent: typeof rootMarkdown.fromContent;\n toContent: typeof rootMarkdown.toContent;\n} = {\n fromContent: rootMarkdown.fromContent,\n toContent: rootMarkdown.toContent,\n};\n\nexport const mediaLibrary: {\n createFolder: typeof rootMediaLibrary.createFolder;\n deleteItem: typeof rootMediaLibrary.deleteItem;\n moveItems: typeof rootMediaLibrary.moveItems;\n updateItem: typeof rootMediaLibrary.updateItem;\n} = {\n createFolder: rootMediaLibrary.createFolder,\n deleteItem: rootMediaLibrary.deleteItem,\n moveItems: rootMediaLibrary.moveItems,\n updateItem: rootMediaLibrary.updateItem,\n};\n\nexport const money: {\n format: typeof rootMoney.format;\n} = {\n format: rootMoney.format,\n};\n\nexport const notification: {\n send: typeof rootNotification.send;\n sendBulkNotifications: typeof rootNotification.sendBulkNotifications;\n sendNotification: typeof rootNotification.sendNotification;\n setConsent: typeof rootNotification.setConsent;\n} = {\n send: rootNotification.send,\n sendBulkNotifications: rootNotification.sendBulkNotifications,\n sendNotification: rootNotification.sendNotification,\n setConsent: rootNotification.setConsent,\n};\n\nexport const number: {\n format: typeof rootNumber.format;\n} = {\n format: rootNumber.format,\n};\n\nconst package_: {\n installInput: typeof rootPackage.installInput;\n} = {\n installInput: rootPackage.installInput,\n};\nexport { package_ as package };\n\nexport const page: {\n url: typeof rootPage.url;\n} = {\n url: rootPage.url,\n};\n\nexport const payables: {\n void: typeof rootPayables.void;\n writeOff: typeof rootPayables.writeOff;\n} = {\n void: rootPayables.void,\n writeOff: rootPayables.writeOff,\n};\n\nexport const payment: {\n createManual: typeof rootPayment.createManual;\n} = {\n createManual: rootPayment.createManual,\n};\n\nexport const payments: {\n charge: typeof rootPayments.charge;\n checkout: typeof rootPayments.checkout;\n confirm: typeof rootPayments.confirm;\n refund: typeof rootPayments.refund;\n void: typeof rootPayments.void;\n} = {\n charge: rootPayments.charge,\n checkout: rootPayments.checkout,\n confirm: rootPayments.confirm,\n refund: rootPayments.refund,\n void: rootPayments.void,\n};\n\nexport const phone: {\n format: typeof rootPhone.format;\n} = {\n format: rootPhone.format,\n};\n\nexport const scheduling: {\n bookSlot: typeof rootScheduling.bookSlot;\n findSlots: typeof rootScheduling.findSlots;\n} = {\n bookSlot: rootScheduling.bookSlot,\n findSlots: rootScheduling.findSlots,\n};\n\nexport const schema: {\n toJsonSchema: typeof rootSchema.toJsonSchema;\n} = {\n toJsonSchema: rootSchema.toJsonSchema,\n};\n\nexport const security: {\n randomPassword: typeof rootSecurity.randomPassword;\n} = {\n randomPassword: rootSecurity.randomPassword,\n};\n\nexport const sms: {\n sendNotification: typeof rootSms.sendNotification;\n} = {\n sendNotification: rootSms.sendNotification,\n};\n\nexport const subscriptions: {\n activate: typeof rootSubscriptions.activate;\n cancel: typeof rootSubscriptions.cancel;\n changeItems: typeof rootSubscriptions.changeItems;\n create: typeof rootSubscriptions.create;\n generateInvoice: typeof rootSubscriptions.generateInvoice;\n pause: typeof rootSubscriptions.pause;\n preview: typeof rootSubscriptions.preview;\n previewChange: typeof rootSubscriptions.previewChange;\n resume: typeof rootSubscriptions.resume;\n setUpcomingItems: typeof rootSubscriptions.setUpcomingItems;\n} = {\n activate: rootSubscriptions.activate,\n cancel: rootSubscriptions.cancel,\n changeItems: rootSubscriptions.changeItems,\n create: rootSubscriptions.create,\n generateInvoice: rootSubscriptions.generateInvoice,\n pause: rootSubscriptions.pause,\n preview: rootSubscriptions.preview,\n previewChange: rootSubscriptions.previewChange,\n resume: rootSubscriptions.resume,\n setUpcomingItems: rootSubscriptions.setUpcomingItems,\n};\n\nexport const text: {\n generate: typeof rootText.generate;\n hash: typeof rootText.hash;\n randomUuid: typeof rootText.randomUuid;\n toContent: typeof rootText.toContent;\n} = {\n generate: rootText.generate,\n hash: rootText.hash,\n randomUuid: rootText.randomUuid,\n toContent: rootText.toContent,\n};\n\nexport const time: {\n add: typeof rootTime.add;\n diff: typeof rootTime.diff;\n endOf: typeof rootTime.endOf;\n format: typeof rootTime.format;\n startOf: typeof rootTime.startOf;\n subtract: typeof rootTime.subtract;\n} = {\n add: rootTime.add,\n diff: rootTime.diff,\n endOf: rootTime.endOf,\n format: rootTime.format,\n startOf: rootTime.startOf,\n subtract: rootTime.subtract,\n};\n\nexport const timezone: {\n format: typeof rootTimezone.format;\n interpret: typeof rootTimezone.interpret;\n} = {\n format: rootTimezone.format,\n interpret: rootTimezone.interpret,\n};\n\nexport const tiptap: {\n parse: typeof rootTiptap.parse;\n} = {\n parse: rootTiptap.parse,\n};\n\nexport const user: {\n authorize: typeof rootUser.authorize;\n} = {\n authorize: rootUser.authorize,\n};\n\nexport const web: {\n agent: typeof rootWeb.agent;\n batchScrape: typeof rootWeb.batchScrape;\n crawl: typeof rootWeb.crawl;\n extract: typeof rootWeb.extract;\n googleSearch: typeof rootWeb.googleSearch;\n map: typeof rootWeb.map;\n pdf: typeof rootWeb.pdf;\n scrape: typeof rootWeb.scrape;\n screenshot: typeof rootWeb.screenshot;\n searchRanked: typeof rootWeb.searchRanked;\n} = {\n agent: rootWeb.agent,\n batchScrape: rootWeb.batchScrape,\n crawl: rootWeb.crawl,\n extract: rootWeb.extract,\n googleSearch: rootWeb.googleSearch,\n map: rootWeb.map,\n pdf: rootWeb.pdf,\n scrape: rootWeb.scrape,\n screenshot: rootWeb.screenshot,\n searchRanked: rootWeb.searchRanked,\n};\n\nexport const workflow: {\n run: typeof rootWorkflow.run;\n url: typeof rootWorkflow.url;\n} = {\n run: rootWorkflow.run,\n url: rootWorkflow.url,\n};\n\nexport const workspace: {\n loginUrl: typeof rootWorkspace.loginUrl;\n setValue: typeof rootWorkspace.setValue;\n setValues: typeof rootWorkspace.setValues;\n value: typeof rootWorkspace.value;\n values: typeof rootWorkspace.values;\n} = {\n loginUrl: rootWorkspace.loginUrl,\n setValue: rootWorkspace.setValue,\n setValues: rootWorkspace.setValues,\n value: rootWorkspace.value,\n values: rootWorkspace.values,\n};\n", "/sdk/index.ts": "import './console';\n\nexport { HostError, WorkflowFailure, fail, validationError } from './errors';\nexport type { HostFailure } from './errors';\nexport { invoke, setTransport, type HostTransport } from './transport';\nexport { transaction } from './transaction';\nexport type { Liquid, declaredInput } from './liquid';\nexport { data } from './data';\nexport { mail, notification, sms } from './notifications';\nexport { workspace } from './workspace-values';\nexport {\n InputField,\n InputSchema,\n v,\n type ContentDocument,\n type ContentNode,\n type ContentOptions,\n type FileVisibility,\n type Infer,\n type InferInput,\n type InputFieldKind,\n type InputFieldSpec,\n type InputShape,\n type Money,\n type RecordScope\n} from './input';\nexport {\n defineWorkflow,\n parseWorkflowInput,\n redirect,\n respond,\n validateWorkflowInput,\n type Identity,\n type InputErrors,\n type InputValidator,\n type RequestContext,\n type ScriptExecution,\n type WorkflowContext,\n type WorkflowDefinition,\n type WorkflowExecution\n} from './workflow';\nexport * from './generated/capabilities';\n\n/** The embedding host selects its execution context through its supplied declarations. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface ScriptHostContext {}\n\n/**\n * Declaration-merged by the generated workspace module with one entry per resource.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceResources {}\n\n/**\n * Declaration-merged by the workspace's field definitions with each key's value type.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceFieldCatalog {}\n\n/**\n * Declaration-merged by the generated workspace module with one entry per notification type:\n * its id, the unions of its template ids (all, email-enabled, and SMS-enabled), and the shape\n * of its variables.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceNotificationTypes {}\n", "/sdk/input.ts": "import type { InputOf, ResourceKey } from './data';\n\n/**\n * A declared input field, as data. The compiler reads a workflow's input schema from its source\n * and saves each field as a workflow input variable, so the platform validates a run's input\n * against these rules before the script starts. The same data travels with the workflow at run\n * time, where the SDK uses it to coerce string values to the declared types.\n */\nexport interface InputFieldSpec {\n readonly kind: InputFieldKind;\n readonly optional: boolean;\n readonly nullable: boolean;\n /** Validation rules in the platform's rule syntax, such as `min:1` or `regex:/^[a-z]+$/`. */\n readonly rules: readonly string[];\n readonly label?: string;\n readonly description?: string;\n /** `select`: the allowed values. */\n readonly options?: readonly (string | number)[];\n /** `list`: the item field. */\n readonly items?: InputFieldSpec;\n /** `object`: the nested fields. */\n readonly fields?: Readonly<Record<string, InputFieldSpec>>;\n /** `record` and `recordReference`: the resource whose definitions or records the value must match. */\n readonly resource?: string;\n /** `recordReference`: the records the ID can name. The platform default is `active`. */\n readonly scope?: RecordScope;\n /** `file`: the accepted MIME types. */\n readonly accept?: readonly string[];\n /** `file`: the visibility of the file. */\n readonly visibility?: FileVisibility;\n /** `content`: the formatting the document may use. */\n readonly content?: ContentOptions;\n}\n\n/**\n * A money value as the platform stores it. It is a type alias, not an interface, so that it is\n * assignable to the open money objects of capability inputs such as `money.format`.\n */\nexport type Money = {\n amount: number;\n currency: string;\n};\n\nexport type InputFieldKind =\n | 'text'\n | 'email'\n | 'url'\n | 'uuid'\n | 'phone'\n | 'date'\n | 'datetime'\n | 'time'\n | 'timezone'\n | 'color'\n | 'number'\n | 'integer'\n | 'money'\n | 'boolean'\n | 'select'\n | 'list'\n | 'object'\n | 'record'\n | 'recordReference'\n | 'roleReference'\n | 'file'\n | 'content';\n\n/** The records a record ID can name: `active`, `archived` (deleted), or `activeOrArchived` (all). */\nexport type RecordScope = 'active' | 'archived' | 'activeOrArchived';\n\nexport type FileVisibility = 'public' | 'private';\n\nexport interface ContentOptions {\n /** `false` allows one paragraph only. The default is `true`. */\n readonly multiLine?: boolean;\n /** The marks the text may use. Each mark is allowed unless it is `false`. */\n readonly extensions?: Readonly<\n Partial<Record<'bold' | 'italic' | 'strike' | 'underline' | 'link', boolean>>\n >;\n /** The block nodes the document may use. Each node is allowed unless it is `false`. */\n readonly allowedNodes?: Readonly<\n Partial<Record<'heading' | 'blockquote' | 'bulletList' | 'orderedList' | 'media', boolean>>\n >;\n}\n\n/** A rich text node in the platform's content format. */\nexport interface ContentNode {\n type: string;\n attrs?: Record<string, unknown>;\n content?: ContentNode[];\n marks?: { type: string; attrs?: Record<string, unknown> }[];\n text?: string;\n}\n\n/** A rich text document in the platform's content format. */\nexport interface ContentDocument extends ContentNode {\n type: 'doc';\n}\n\n/**\n * One field of a workflow's input schema. `T` is the value type the handler receives; `O` is\n * whether the key may be absent. Every modifier returns a new field, so a field can be shared.\n */\nexport class InputField<T, O extends boolean = false> {\n /** Phantom members that carry the static types; they hold no value at run time. */\n declare readonly $value: T;\n declare readonly $optional: O;\n\n constructor(readonly $spec: InputFieldSpec) {}\n\n /** The key may be absent. */\n optional(): InputField<T | undefined, true> {\n return new InputField({ ...this.$spec, optional: true });\n }\n\n /** The value may be `null`. */\n nullable(): InputField<T | null, O> {\n return new InputField({ ...this.$spec, nullable: true });\n }\n\n /** At least `value`: a number's value, a text's length, or a list's item count. */\n min(value: number): InputField<T, O> {\n return this.rule(`min:${value}`);\n }\n\n /** At most `value`: a number's value, a text's length, or a list's item count. */\n max(value: number): InputField<T, O> {\n return this.rule(`max:${value}`);\n }\n\n /** Between `min` and `max`, inclusive, measured as for `min` and `max`. */\n between(min: number, max: number): InputField<T, O> {\n return this.rule(`between:${min},${max}`);\n }\n\n /** Exactly `value`, measured as for `min` and `max`. */\n size(value: number): InputField<T, O> {\n return this.rule(`size:${value}`);\n }\n\n /** The text matches the pattern. */\n regex(pattern: RegExp): InputField<T, O> {\n return this.rule(`regex:/${pattern.source}/${pattern.flags}`);\n }\n\n /** Any other platform validation rule, such as `starts_with:INV-` or `after:today`. */\n rule(rule: string): InputField<T, O> {\n return new InputField({ ...this.$spec, rules: [...this.$spec.rules, rule] });\n }\n\n label(label: string): InputField<T, O> {\n return new InputField({ ...this.$spec, label });\n }\n\n description(description: string): InputField<T, O> {\n return new InputField({ ...this.$spec, description });\n }\n}\n\nexport type InputShape = Record<string, InputField<unknown, boolean>>;\n\ntype Simplify<T> = { [K in keyof T]: T[K] } & {};\n\n/** The value an input schema describes: optional fields become optional keys. */\nexport type InferInput<S extends InputShape> = Simplify<\n { [K in keyof S as S[K]['$optional'] extends true ? never : K]: S[K]['$value'] } & {\n [K in keyof S as S[K]['$optional'] extends true ? K : never]?: S[K]['$value'];\n }\n>;\n\n/** The value a field or schema describes: `Infer<typeof Input>`. */\nexport type Infer<F extends InputField<unknown, boolean>> = F['$value'];\n\n/** A workflow's input schema: the fields of an object. */\nexport class InputSchema<S extends InputShape> extends InputField<InferInput<S>> {\n constructor(readonly shape: S) {\n super(objectSpec(shape));\n }\n}\n\nfunction objectSpec(shape: InputShape): InputFieldSpec {\n return {\n kind: 'object',\n optional: false,\n nullable: false,\n rules: [],\n fields: Object.fromEntries(Object.entries(shape).map(([key, field]) => [key, field.$spec]))\n };\n}\n\nconst field = <T>(kind: InputFieldKind, extra: Partial<InputFieldSpec> = {}): InputField<T> =>\n new InputField<T>({ kind, optional: false, nullable: false, rules: [], ...extra });\n\n/** Builders for a workflow's input schema. */\nexport const v = {\n text: () => field<string>('text'),\n email: () => field<string>('email'),\n url: () => field<string>('url'),\n uuid: () => field<string>('uuid'),\n phone: () => field<string>('phone'),\n /** A calendar date, `YYYY-MM-DD`. */\n date: () => field<string>('date'),\n /** A date and time, ISO 8601. */\n datetime: () => field<string>('datetime'),\n /** A time of day, `HH:MM`. */\n time: () => field<string>('time'),\n timezone: () => field<string>('timezone'),\n color: () => field<string>('color'),\n number: () => field<number>('number'),\n integer: () => field<number>('integer'),\n /** An amount of money: `amount` in the currency's minor units, such as cents, and the lowercase ISO 4217 `currency`. */\n money: () => field<Money>('money'),\n boolean: () => field<boolean>('boolean'),\n /** One of `options`. */\n select: <const V extends readonly (string | number)[]>(options: V) =>\n field<V[number]>('select', { options }),\n /** A list whose items each satisfy `items`. */\n list: <T>(items: InputField<T, boolean>) =>\n field<Exclude<T, undefined>[]>('list', { items: items.$spec }),\n /** An object with the given fields. */\n object: <S extends InputShape>(shape: S) => new InputSchema(shape),\n /**\n * The field values of a record of `resource`, checked against that resource's field\n * definitions: types, required fields, and each field's own rules.\n */\n record: <R extends ResourceKey>(resource: R) => field<InputOf<R>>('record', { resource }),\n /** The ID of an existing record of `resource`, in `scope`. */\n recordReference: <R extends ResourceKey>(resource: R, options: { scope?: RecordScope } = {}) =>\n field<string>('recordReference', { resource, ...options }),\n /** The ID of an existing role. */\n roleReference: () => field<string>('roleReference'),\n /**\n * A file: the ID of an existing file, or the temporary path of an upload. A data call that\n * writes the value to a file field of a record finalizes the upload.\n */\n file: (options: { accept?: readonly string[]; visibility?: FileVisibility } = {}) =>\n field<string>('file', options),\n /** A rich text document with the formatting that `options` allows. */\n content: (options: ContentOptions = {}) =>\n field<ContentDocument>('content', Object.keys(options).length === 0 ? {} : { content: options })\n};\n\nconst NUMERIC = /^-?(\\d+\\.?\\d*|\\.\\d+)(e[-+]?\\d+)?$/i;\n\nfunction coerceNumber(value: unknown): unknown {\n return typeof value === 'string' && NUMERIC.test(value.trim()) ? Number(value) : value;\n}\n\n/**\n * Converts the string forms a request carries (`\"5\"`, `\"true\"`) to the declared types. It runs\n * after the platform validated the input against the same schema, so a value it cannot convert\n * is left as it is.\n */\nexport function coerceInput(spec: InputFieldSpec, value: unknown): unknown {\n if (value === null || value === undefined) {\n return value;\n }\n\n switch (spec.kind) {\n case 'number':\n case 'integer':\n return coerceNumber(value);\n case 'money':\n return typeof value === 'object' && !Array.isArray(value) && 'amount' in value\n ? { ...value, amount: coerceNumber(value.amount) }\n : value;\n case 'boolean':\n if (value === 'true' || value === '1' || value === 1) {\n return true;\n }\n\n return value === 'false' || value === '0' || value === 0 ? false : value;\n case 'select':\n return typeof value === 'string' &&\n !spec.options?.includes(value) &&\n spec.options?.includes(Number(value))\n ? Number(value)\n : value;\n case 'list':\n return Array.isArray(value) && spec.items\n ? value.map((item) => coerceInput(spec.items!, item))\n : value;\n case 'object': {\n if (typeof value !== 'object' || Array.isArray(value) || !spec.fields) {\n return value;\n }\n\n const result: Record<string, unknown> = { ...(value as Record<string, unknown>) };\n\n for (const [key, fieldSpec] of Object.entries(spec.fields)) {\n if (key in result) {\n result[key] = coerceInput(fieldSpec, result[key]);\n }\n }\n\n return result;\n }\n default:\n return value;\n }\n}\n", "/sdk/liquid.ts": "declare const liquidBrand: unique symbol;\n\n/**\n * The key under which a checked capability parameter carries its declared input type, so that a\n * tool such as the editor outline can read the fields that the capability declares.\n */\nexport declare const declaredInput: unique symbol;\n\n/**\n * Text that the task renders as a Liquid template, such as the body of an email. Write it as fixed\n * text, and pass each value as a reference: a value written into the text would be evaluated as\n * Liquid, so `{{ workspace.name }}` in submitted data would render.\n */\nexport type Liquid = string & { readonly [liquidBrand]?: true };\n\n/** The text that the type check shows for a Liquid field whose value is not fixed text. */\ntype FixedTextHint =\n 'Write fixed text here. Put each value in a reference and write {{ ref.<key> }}.';\n\ntype IsLiquid<T> = [T] extends [string]\n ? typeof liquidBrand extends keyof T\n ? true\n : false\n : false;\n\n/**\n * A string literal, or a union of string literals. A template literal type such as `Hi ${string}`\n * is not fixed: Record gives it an index signature. StaticFields passes a value without null and\n * undefined, so an optional value is fixed only when its string is. `never` is the value `undefined`\n * alone, which is fixed.\n */\ntype IsFixed<T> = [T] extends [never] ? true : false extends FixedMember<T> ? false : true;\n\n/**\n * Whether each member of `T` is fixed, member by member: a Record of the whole union would require\n * the key of each literal member, so one literal would hide a template literal beside it.\n */\ntype FixedMember<T> = T extends string\n ? string extends T\n ? false\n : {} extends Record<T, 1>\n ? false\n : true\n : true;\n\n/** The input of a capability call, deeply readonly, so a `const` type parameter can infer it. */\nexport type DeepReadonly<T> = T extends (...args: never[]) => unknown\n ? T\n : T extends readonly (infer E)[]\n ? readonly DeepReadonly<E>[]\n : T extends object\n ? { readonly [K in keyof T]: DeepReadonly<T[K]> }\n : T;\n\n/**\n * The input `I` of a capability call whose declared input is `D`, with each value of a Liquid field\n * that is not fixed text replaced by the hint, so the call fails the type check at that value.\n */\nexport type StaticLiquid<I, D> = StaticFields<I, D> & { readonly [declaredInput]?: D };\n\ntype StaticFields<I, D> = {\n [K in keyof I]: K extends keyof NonNullable<D>\n ? IsLiquid<NonNullable<NonNullable<D>[K]>> extends true\n ? IsFixed<NonNullable<I[K]>> extends true\n ? I[K]\n : FixedTextHint\n : I[K] extends readonly unknown[]\n ? I[K]\n : NonNullable<I[K]> extends object\n ? StaticFields<I[K], NonNullable<D>[K]>\n : I[K]\n : I[K];\n};\n", "/sdk/notifications.ts": "import type { ResourceKey } from './data';\nimport {\n mail as generatedMail,\n notification as generatedNotification,\n sms as generatedSms,\n type MailSendNotificationInput,\n type MailSendNotificationOutput,\n type NotificationSendBulkNotificationsInput,\n type NotificationSendBulkNotificationsOutput,\n type NotificationSendNotificationInput,\n type NotificationSendNotificationOutput,\n type NotificationSetConsentInput,\n type NotificationSetConsentOutput,\n type SmsSendNotificationInput,\n type SmsSendNotificationOutput\n} from './generated/capabilities';\nimport type { WorkspaceNotificationTypes } from './index';\nimport { invoke } from './transport';\n\ntype Entry = WorkspaceNotificationTypes[keyof WorkspaceNotificationTypes];\ntype Declared = [keyof WorkspaceNotificationTypes] extends [never] ? false : true;\nexport type NotificationTypeKey = Declared extends true\n ? Entry extends { id: infer I }\n ? I\n : never\n : string;\n// A type can declare more than one id, such as its uid and its slug, so an entry matches when `T`\n// is one of its ids.\ntype MatchingEntry<E, T> = E extends { id: infer I } ? (T extends I ? E : never) : never;\ntype EntryFor<T> = MatchingEntry<Entry, T>;\n/**\n * The template ids of one notification type under `Channel`: every template, or only the\n * templates with email or SMS on. Any string while the workspace declares no types.\n */\nexport type NotificationTemplateKey<\n T,\n Channel extends 'template' | 'emailTemplate' | 'smsTemplate' = 'template'\n> = Declared extends true ? (EntryFor<T> extends Record<Channel, infer K> ? K : never) : string;\n/** The variables one notification type declares; any dictionary while the workspace declares no types. */\nexport type NotificationVariables<T> = Declared extends true\n ? EntryFor<T> extends { variables: infer V }\n ? V\n : never\n : Record<string, unknown>;\n\ntype NotificationInput<\n I,\n T,\n Channel extends 'template' | 'emailTemplate' | 'smsTemplate' = 'template'\n> = Omit<I, 'notificationType' | 'notificationTemplate' | 'variables'> & {\n notificationType: T;\n notificationTemplate?: NotificationTemplateKey<T, Channel>;\n} & ({} extends NotificationVariables<T>\n ? { variables?: NotificationVariables<T> }\n : { variables: NotificationVariables<T> });\n\nexport const mail = {\n ...generatedMail,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<MailSendNotificationInput, T, 'emailTemplate'>\n ) => invoke<MailSendNotificationOutput>('mail.send-notification', input)\n};\n\nexport const notification = {\n ...generatedNotification,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<NotificationSendNotificationInput, T>\n ) => invoke<NotificationSendNotificationOutput>('notification.send-notification', input),\n sendBulkNotifications: <T extends NotificationTypeKey, R extends ResourceKey>(\n input: Omit<NotificationInput<NotificationSendBulkNotificationsInput, T>, 'resource'> & {\n resource: R;\n }\n ) =>\n invoke<NotificationSendBulkNotificationsOutput>('notification.send-bulk-notifications', input),\n setConsent: <R extends NotificationSetConsentInput['resource']>(\n input: Omit<NotificationSetConsentInput, 'resource'> & { resource: R }\n ) => invoke<NotificationSetConsentOutput>('notification.set-consent', input)\n};\n\nexport const sms = {\n ...generatedSms,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<SmsSendNotificationInput, T, 'smsTemplate'>\n ) => invoke<SmsSendNotificationOutput>('sms.send-notification', input)\n};\n", "/sdk/profiles/shared.ts": "// The root exports that call no host capability. Each profile entry point re-exports them.\nexport { HostError, WorkflowFailure, fail, validationError } from '../errors';\nexport {\n InputField,\n InputSchema,\n v,\n type ContentDocument,\n type ContentNode,\n type ContentOptions,\n type FileVisibility,\n type Infer,\n type InferInput,\n type InputFieldKind,\n type InputFieldSpec,\n type InputShape,\n type Money,\n type RecordScope\n} from '../input';\nexport {\n defineWorkflow,\n parseWorkflowInput,\n redirect,\n respond,\n validateWorkflowInput,\n type Identity,\n type InputErrors,\n type InputValidator,\n type RequestContext,\n type ScriptExecution,\n type WorkflowContext,\n type WorkflowDefinition,\n type WorkflowExecution\n} from '../workflow';\nexport type {\n ScriptHostContext,\n WorkspaceFieldCatalog,\n WorkspaceNotificationTypes,\n WorkspaceResources\n} from '../index';\n", "/sdk/profiles/test.ts": "// The `@diagonal-hq/workflows/test` entry point of E2E setup and assert scripts. It exports every\n// capability wrapper except the test profile's deny list (sign-in changes), the `transaction()`\n// helper, and the root exports that call no host capability. The script host refuses each\n// denied capability.\nimport '../console';\nimport { data as rootData } from '../data';\nimport { data as testData } from '../generated/profiles/test';\n\nexport * from './shared';\nexport * from '../generated/profiles/test';\nexport { transaction } from '../transaction';\n\nexport const data: typeof testData & { each: typeof rootData.each } = {\n ...testData,\n each: rootData.each\n};\n", "/sdk/runtime/quickjs.ts": "// The sandbox entry. scripts/build-workflow-code-runtime.mjs bundles this file and the SDK into\n// the QuickJS runtime. It must not import http-transport.ts or testing/, which need DOM types.\n//\n// The runner evaluates the bundle as the ES module `@diagonal/workflow` before the script, so a\n// script that imports the SDK gets this module and its transport, also at its top level.\n\nimport { HostError, type HostFailure } from '../errors';\n// oxlint-disable-next-line import/no-namespace -- `require('@diagonal/workflow')` of a CommonJS script returns the whole SDK module.\nimport * as sdk from '../index';\nimport { SerialTransactionTransport } from '../serial-transaction-transport';\nimport type { WorkflowContext, WorkflowDefinition } from '../workflow';\n\nexport * from '../index';\n\ntype HostBridge = (name: string, argsJson: string) => Promise<string>;\n\ntype HostReply = {\n ok: boolean;\n value: unknown;\n error: {\n message: string;\n code: string;\n status: number;\n details: unknown;\n failure?: HostFailure | null;\n failure_id?: number;\n } | null;\n};\n\nconst guest = globalThis as unknown as Record<string, unknown>;\n\n// Scripts reach the host only through the SDK, so the bridge leaves the global scope here.\nconst host = guest.__host as HostBridge;\ndelete guest.__host;\n\nclass QuickJsTransport implements sdk.HostTransport {\n async call(name: string, input: Record<string, unknown>): Promise<unknown> {\n const reply = JSON.parse(await host(name, JSON.stringify([input]))) as HostReply;\n\n if (!reply.ok) {\n const error = reply.error ?? {\n message: 'The call failed.',\n code: 'internal_error',\n status: 500,\n details: null\n };\n throw new HostError(\n error.message,\n error.code,\n error.status,\n error.details,\n error.failure_id ?? null,\n error.failure ?? null\n );\n }\n\n return reply.value;\n }\n}\n\nsdk.setTransport(new SerialTransactionTransport(new QuickJsTransport()));\n\ntype WorkspaceValues = {\n resources: Record<string, string>;\n notificationTypes: Record<string, string>;\n notificationTemplates: Record<string, Record<string, string>>;\n};\n\n/**\n * The exports of a script that an earlier compiler wrote as CommonJS, with a `require` that serves\n * the SDK and the workspace values.\n */\nguest.__commonJsExports = (code: string, workspaceJson: string): Record<string, unknown> => {\n const workspace = JSON.parse(workspaceJson) as WorkspaceValues;\n const module = { exports: {} as Record<string, unknown> };\n const require = (specifier: string): unknown => {\n if (specifier === '@diagonal/workflow') {\n return sdk;\n }\n\n if (specifier === '@diagonal/workflow/workspace') {\n return workspace;\n }\n\n throw new Error(`Cannot import ${specifier}.`);\n };\n\n // The compiled module is CommonJS text produced by the Diagonal compiler. It runs inside\n // QuickJS, which is the sandbox boundary.\n // oxlint-disable-next-line typescript/no-implied-eval\n new Function('exports', 'require', 'module', code)(module.exports, require, module);\n\n return module.exports;\n};\n\nguest.__runWorkflow = async (\n exports: Record<string, unknown>,\n inputJson: string,\n contextJson: string\n): Promise<unknown> => {\n const input = JSON.parse(inputJson) as unknown;\n const context = JSON.parse(contextJson) as WorkflowContext;\n const workflow = exports.default as WorkflowDefinition<unknown, unknown> | undefined;\n\n if (workflow?.$diagonal !== 'workflow') {\n throw new Error('The script has no default workflow export.');\n }\n\n const validateInput = exports.validateInput;\n const parsed = sdk.parseWorkflowInput(workflow, input);\n\n if (validateInput !== undefined && typeof validateInput !== 'function') {\n throw new TypeError('The validateInput export must be a function.');\n }\n\n if (workflow.validate !== undefined && validateInput !== undefined) {\n throw new TypeError(\n 'The workflow has a validate option and a validateInput export. Keep only the validate option.'\n );\n }\n\n const validator = workflow.validate ?? (validateInput as sdk.InputValidator<unknown> | undefined);\n\n if (validator !== undefined) {\n await sdk.validateWorkflowInput(validator, parsed, context);\n }\n\n return workflow.run(parsed, context);\n};\n", "/sdk/serial-transaction-transport.ts": "import { HostError } from './errors';\nimport type { HostTransport } from './transport';\n\nconst PromiseConstructor = Promise;\nconst objectKeys = Object.keys;\nconst isArray = Array.isArray;\n\nexport class SerialTransactionTransport implements HostTransport {\n private pending = 0;\n private settled: Promise<void> | null = null;\n private transactionOpen = false;\n private closing = false;\n\n constructor(private readonly transport: HostTransport) {}\n\n async call(name: string, input: Record<string, unknown>): Promise<unknown> {\n const begins = name === 'transaction.begin';\n const rollsBack = name === 'transaction.rollback';\n const ends = rollsBack || name === 'transaction.commit';\n\n if (begins || ends) {\n const keys =\n input !== null && typeof input === 'object' && !isArray(input) ? objectKeys(input) : null;\n // A rollback can also name the error of the transaction body. The input is not read here:\n // the transport serializes it only after the call is reserved below.\n const describesError = rollsBack && keys !== null && keys.length === 1 && keys[0] === 'error';\n\n if (keys === null || (keys.length > 0 && !describesError)) {\n throw new HostError(\n 'Transaction controls accept an empty object. A rollback also accepts the error of the body.',\n 'invalid_arguments',\n 422,\n null\n );\n }\n\n if (!describesError) {\n input = {};\n }\n }\n\n if (this.closing || ((this.transactionOpen || begins) && this.pending > 0 && !rollsBack)) {\n throw new HostError(\n 'Await each capability call before starting another call while a transaction is active.',\n 'transaction_concurrent',\n 409,\n null\n );\n }\n\n const opens = begins && !this.transactionOpen;\n const closes = ends && this.transactionOpen;\n\n if (opens) {\n this.transactionOpen = true;\n }\n\n if (closes) {\n this.closing = true;\n }\n\n const previous = this.settled;\n let complete: (() => void) | undefined;\n let closed = closes;\n\n try {\n // Promise.all can reject while an accepted call still waits on PHP. Rollback must follow\n // that call, and no new call may enter while cleanup waits.\n if (rollsBack && closes && previous !== null) {\n await previous;\n }\n\n this.pending++;\n this.settled = new PromiseConstructor<void>((resolve) => {\n complete = resolve;\n });\n\n return await this.transport.call(name, input);\n } catch (error) {\n if (\n closes &&\n error instanceof HostError &&\n (error.code === 'invalid_arguments' ||\n error.code === 'resolver_not_allowed' ||\n error.code === 'capability_denied' ||\n error.code === 'payload_too_large' ||\n error.code === 'validation' ||\n error.code === 'transaction_concurrent')\n ) {\n closed = false;\n }\n\n if (opens) {\n this.transactionOpen = false;\n }\n\n throw error;\n } finally {\n if (complete !== undefined) {\n this.pending--;\n complete();\n\n if (this.pending === 0) {\n this.settled = null;\n }\n }\n\n if (closes) {\n this.transactionOpen = !closed;\n this.closing = false;\n }\n }\n }\n}\n", "/sdk/transaction.ts": "import { HostError, type HostFailure } from './errors';\nimport type { TransactionRollbackInput } from './generated/capabilities';\nimport { invoke } from './transport';\n\ntype ThrownError = NonNullable<TransactionRollbackInput['error']>;\n\n/**\n * Runs `fn` in one database transaction. When a concurrent write aborts the transaction, the host\n * rolls it back and answers with `transaction_transient`, and `fn` runs again. The host limits the\n * attempts and waits between them, so `fn` can run more than once.\n */\nexport async function transaction<T>(fn: () => Promise<T>): Promise<T> {\n for (;;) {\n await invoke('transaction.begin', {});\n\n let result: T;\n\n try {\n result = await fn();\n } catch (error) {\n const rolledBack = await rollBack({ error: thrownError(error) });\n\n if (rolledBack.retry) {\n continue;\n }\n\n throw rollbackError(rolledBack.reply, error) ?? error;\n }\n\n // The host closes the transaction when a commit fails, so a rollback here would only hide the commit error.\n try {\n await invoke('transaction.commit', {});\n } catch (error) {\n if (isTransient(error)) {\n continue;\n }\n\n if (error instanceof HostError && error.code === 'transaction_concurrent') {\n await rollBack({});\n }\n\n throw error;\n }\n\n return result;\n }\n}\n\n/**\n * Rolls back the open transaction and says whether the host asks for another attempt. When the\n * input names the error of the body, the reply describes the error that `transaction()` throws in\n * its place.\n */\nasync function rollBack(\n input: TransactionRollbackInput\n): Promise<{ retry: true } | { retry: false; reply: unknown }> {\n try {\n return { retry: false, reply: await invoke<unknown>('transaction.rollback', input) };\n } catch (error) {\n if (isTransient(error)) {\n return { retry: true };\n }\n\n throw error;\n }\n}\n\nfunction isTransient(error: unknown): boolean {\n return error instanceof HostError && error.code === 'transaction_transient';\n}\n\n/**\n * The fields of a `done` error that the host needs to describe the failure of `error`. The host\n * keeps the failure of a host error that has a failure ID, so only that ID is sent. Of the\n * details, only the field errors are sent, because only they change the recorded failure.\n */\nfunction thrownError(error: unknown): ThrownError {\n if (typeof error !== 'object' || error === null) {\n // JSON.stringify throws for a BigInt, and the rollback must still be sent.\n const value = typeof error === 'bigint' ? String(error) : JSON.stringify(error);\n\n return { name: 'Error', message: `The workflow threw a non-error value: ${value}` };\n }\n\n const name: unknown = Reflect.get(error, 'name');\n const failureId: unknown = Reflect.get(error, 'failureId');\n\n if (name === 'HostError' && typeof failureId === 'number' && Number.isInteger(failureId)) {\n return { name, failure_id: failureId };\n }\n\n const message: unknown = Reflect.get(error, 'message');\n const code: unknown = Reflect.get(error, 'code');\n const status: unknown = Reflect.get(error, 'status');\n const details: unknown = Reflect.get(error, 'details');\n const errors: unknown =\n typeof details === 'object' && details !== null ? Reflect.get(details, 'errors') : undefined;\n\n const thrown: ThrownError = {\n name: typeof name === 'string' ? name : 'Error',\n message: String(message ?? 'The workflow threw an error.')\n };\n\n if (typeof code === 'string') {\n thrown.code = code;\n }\n\n if (typeof status === 'number' && Number.isInteger(status)) {\n thrown.status = status;\n }\n\n if (typeof errors === 'object' && errors !== null && !Array.isArray(errors)) {\n thrown.errors = { ...errors };\n }\n\n return thrown;\n}\n\n/**\n * The `transaction_rollback` error that the host described for the rollback, with the error of\n * the body as its cause. Its failure is the rollback payload that the error edge of a graph\n * Transaction step reads. A reply that describes no error, such as the null of a mock rollback,\n * gives null, and `transaction()` rethrows the error of the body.\n */\nfunction rollbackError(reply: unknown, cause: unknown): HostError | null {\n if (typeof reply !== 'object' || reply === null) {\n return null;\n }\n\n const message: unknown = Reflect.get(reply, 'message');\n const code: unknown = Reflect.get(reply, 'code');\n const status: unknown = Reflect.get(reply, 'status');\n const failureId: unknown = Reflect.get(reply, 'failure_id');\n const failure: unknown = Reflect.get(reply, 'failure');\n\n if (\n typeof message !== 'string' ||\n code !== 'transaction_rollback' ||\n typeof status !== 'number' ||\n typeof failureId !== 'number' ||\n !isFailure(failure)\n ) {\n return null;\n }\n\n return new HostError(message, code, status, Reflect.get(reply, 'details'), failureId, failure, {\n cause\n });\n}\n\nfunction isFailure(value: unknown): value is HostFailure {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n", "/sdk/transport.ts": "export interface HostTransport {\n call(name: string, input: Record<string, unknown>): Promise<unknown>;\n}\n\nlet active: HostTransport | null = null;\n\nexport function setTransport(transport: HostTransport | null): void {\n active = transport;\n}\n\nexport function invoke<T>(name: string, input: object): Promise<T> {\n if (active === null) {\n return Promise.reject(\n new Error(\n 'No Diagonal host transport is set. In tests, call setTransport(new MockTransport(...)).'\n )\n );\n }\n\n return active.call(name, input as Record<string, unknown>) as Promise<T>;\n}\n", "/sdk/workflow-config.ts": "/**\n * The options of `defineWorkflow(config, handler)` other than `input`, `output`, and `validate`.\n * The build reads them as static data, checks them, and removes them from the compiled script, so\n * the compiler sees only `input`, `output`, and `validate`. `@diagonal-hq/cli` replaces this\n * declaration with its `WorkflowConfig`, so the editor checks each option.\n */\nexport type WorkflowConfig = Record<never, never>;\n", "/sdk/workflow.ts": "import type { ResourceKeyWith } from './data';\nimport { validationError } from './errors';\nimport type { ScriptHostContext } from './index';\nimport {\n coerceInput,\n type Infer,\n type InputField,\n InputSchema,\n type InferInput,\n type InputFieldSpec,\n type InputShape\n} from './input';\nimport type { WorkflowConfig } from './workflow-config';\n\nexport interface Identity {\n id: string;\n /** The identity's resource has the Authenticatable capability. */\n resourceId: ResourceKeyWith<'authenticatable'>;\n email: string | null;\n name: string | null;\n permissions: string[];\n}\n\nexport interface RequestContext {\n method: string;\n url: string;\n params: Record<string, string>;\n query: Record<string, unknown>;\n /** The request input: the payload with the query string values added. */\n body: Record<string, unknown>;\n /** The payload as the caller sent it, without the query string. */\n payload: Record<string, unknown>;\n /** Header names are lowercase. A header with more than one value joins them with `, `. */\n headers: Record<string, string>;\n /**\n * The raw value of each field that the request contract of the trigger declares, under its\n * declared key, as a graph `request.input` reference reads it. A field that the request does\n * not carry is absent. A header has its first value only.\n */\n declared: {\n params: Record<string, unknown>;\n query: Record<string, unknown>;\n headers: Record<string, unknown>;\n body: Record<string, unknown>;\n };\n}\n\nexport interface ScriptExecution {\n id: string;\n kind: 'workflow' | 'embedded';\n owner: { type: string; id: string };\n}\n\nexport interface WorkflowExecution extends ScriptExecution {\n kind: 'workflow';\n workflowId: string;\n}\n\nexport interface WorkflowContext {\n user: Identity | null;\n callingUser: Identity | null;\n trigger: Record<string, unknown>;\n request: RequestContext | null;\n workspace: { id: string; timezone: string };\n execution: ScriptHostContext extends { embedded: true } ? ScriptExecution : WorkflowExecution;\n now: string;\n}\n\nexport interface WorkflowDefinition<I, O> {\n readonly $diagonal: 'workflow';\n /** The declared input schema, when the workflow has one. */\n readonly input?: InputFieldSpec;\n /**\n * The `validate` option of the config, which runs before the handler with the same input. A\n * method, like `run`, so a definition stays assignable to a narrower input type.\n */\n validate?(input: I, ctx: WorkflowContext): ReturnType<InputValidator<I>>;\n /** Runs the handler with input that {@link parseWorkflowInput} already converted. */\n run(input: I, ctx: WorkflowContext): Promise<O>;\n}\n\n/**\n * Converts a run's raw input to the declared types. A runner calls it once and passes the result\n * to both `validateInput` and `run`, so the validator and the handler receive the same input.\n */\nexport function parseWorkflowInput<I>(workflow: WorkflowDefinition<I, unknown>, input: unknown): I {\n return (workflow.input === undefined ? input : coerceInput(workflow.input, input)) as I;\n}\n\n/**\n * The errors an input validator reports, keyed by input field. A key outside the input's own fields\n * (a nested path such as `tags.0`) is allowed; an empty or absent message means the field is valid.\n */\nexport type InputErrors<I> = Partial<Record<keyof I & string, string | string[]>> &\n Record<string, string | string[] | undefined>;\n\n/**\n * The `validate` option of a workflow config, or the `validateInput` export a script may define\n * beside its workflow. It runs before the handler with the same input and context; when it\n * reports any error, the run ends with a 422 and those errors, and the handler does not run.\n */\nexport type InputValidator<I> = (\n input: I,\n ctx: WorkflowContext\n) => InputErrors<I> | void | Promise<InputErrors<I> | void>;\n\n/** Runs a script's input validator and ends the run with a validation error when it reports one. */\nexport async function validateWorkflowInput<I>(\n validator: InputValidator<I>,\n input: I,\n ctx: WorkflowContext\n): Promise<void> {\n const reported = await validator(input, ctx);\n\n if (reported === undefined || reported === null) {\n return;\n }\n\n if (typeof reported !== 'object' || Array.isArray(reported)) {\n throw new TypeError(\n 'validateInput must return an object of errors keyed by field, or nothing.'\n );\n }\n\n const errors: Record<string, string[]> = {};\n\n for (const [field, messages] of Object.entries(reported)) {\n const list = (Array.isArray(messages) ? messages : [messages]).filter(\n (message): message is string => typeof message === 'string' && message !== ''\n );\n\n if (list.length > 0) {\n errors[field] = list;\n }\n }\n\n if (Object.keys(errors).length > 0) {\n validationError(errors);\n }\n}\n\ntype Handler<I, O> = (input: I, ctx: WorkflowContext) => Promise<O> | O;\n\n/** A declared output: any `v` field, usually `v.object({ ... })`. */\ntype OutputField = InputField<unknown, boolean>;\n\n/** The handler input of a config: the type of its `input` schema, or `I` without one. */\ntype ConfigInput<C, I> = C extends InputSchema<infer S> ? InferInput<S> : I;\n\n/**\n * A value of a declared output type that a handler may return. A const context makes a returned\n * array a readonly tuple, so arrays and objects may be readonly at every level.\n */\ntype Returnable<T> = T extends readonly (infer E)[]\n ? readonly Returnable<E>[]\n : T extends object\n ? { readonly [K in keyof T]: Returnable<T[K]> }\n : T;\n\n/** The handler result of a config: the type of its `output` schema, or `O` without one. */\ntype ConfigOutput<F, O> = F extends OutputField ? Infer<F> : O;\n\n// `O` comes only from the declared output, so the return value cannot widen it. `const` makes the\n// return a const context: a returned literal, such as a `v.select` option, keeps its literal type\n// while `O` is still unfixed.\n/**\n * Declares a workflow. A file-based workflow passes its config first, as `definePage` does. The\n * build reads the config as static data. With an `input` schema in the config, or a schema first,\n * the platform validates every run's input against it before the script starts, and the handler's\n * `input` type comes from the schema. A `validate` function in the config runs after that check\n * and before the handler, with the same input type. With an `output` schema in the config of a\n * file-based workflow, the handler must return a value of that type: the platform documents it as\n * the response of a Request workflow and verifies each return value against it.\n */\nexport function defineWorkflow<\n const O,\n C extends InputSchema<InputShape> | undefined = undefined,\n I = Record<string, unknown>\n>(\n config: WorkflowConfig & {\n readonly input?: C;\n readonly output: InputField<O, boolean>;\n readonly validate?: InputValidator<ConfigInput<C, I>>;\n },\n handler: Handler<ConfigInput<C, I>, Returnable<NoInfer<O>>>\n): WorkflowDefinition<ConfigInput<C, I>, O>;\nexport function defineWorkflow<S extends InputShape, O = unknown>(\n input: InputSchema<S>,\n handler: Handler<InferInput<S>, O>\n): WorkflowDefinition<InferInput<S>, O>;\nexport function defineWorkflow<I = Record<string, unknown>, O = unknown>(\n handler: Handler<I, O>\n): WorkflowDefinition<I, O>;\n// The general config signature is the last one, so a compile error in a config or its handler\n// reports this signature instead of an unrelated one.\nexport function defineWorkflow<\n I = Record<string, unknown>,\n O = unknown,\n C extends InputSchema<InputShape> | undefined = undefined,\n F extends OutputField | undefined = undefined\n>(\n config: WorkflowConfig & {\n readonly input?: C;\n readonly output?: F;\n readonly validate?: InputValidator<ConfigInput<C, I>>;\n },\n handler: Handler<ConfigInput<C, I>, ConfigOutput<F, O>>\n): WorkflowDefinition<ConfigInput<C, I>, ConfigOutput<F, O>>;\nexport function defineWorkflow<I, O>(\n first:\n | InputSchema<InputShape>\n | {\n readonly input?: InputSchema<InputShape>;\n readonly output?: OutputField;\n readonly validate?: InputValidator<I>;\n }\n | Handler<I, O>,\n maybeHandler?: Handler<I, O>\n): WorkflowDefinition<I, O> {\n if (typeof first === 'function') {\n return { $diagonal: 'workflow', run: async (input, ctx) => first(input, ctx) };\n }\n\n const schema = first instanceof InputSchema ? first : first.input;\n const validate = first instanceof InputSchema ? undefined : first.validate;\n const handler = maybeHandler;\n\n if (handler === undefined) {\n throw new TypeError(\n schema === first\n ? 'defineWorkflow(input, handler) needs a handler after the input schema.'\n : 'defineWorkflow(config, handler) needs a handler after the config.'\n );\n }\n\n if (validate !== undefined && typeof validate !== 'function') {\n throw new TypeError(\n 'The validate option of defineWorkflow(config, handler) must be a function.'\n );\n }\n\n return {\n $diagonal: 'workflow',\n ...(schema === undefined ? {} : { input: schema.$spec }),\n ...(validate === undefined ? {} : { validate }),\n run: async (input, ctx) => handler(input, ctx)\n };\n}\n\nexport type ResponseOutput = {\n $response_status: number;\n $response_body: unknown;\n $response_content_type: string;\n};\nexport type RedirectType = 'internal' | 'external' | 'back';\nexport type RedirectOutput = {\n redirect_url: string;\n redirect_type: RedirectType;\n permanent: boolean;\n success?: string;\n};\n\nexport function respond(\n body: unknown,\n options: { status?: number; contentType?: string } = {}\n): ResponseOutput {\n return {\n $response_status: options.status ?? 200,\n $response_body: body,\n $response_content_type: options.contentType ?? 'application/json'\n };\n}\n\n/**\n * Builds the output of a graph `http.redirect` step, with the same `redirect_type` and\n * `permanent` keys. Without a `type`, a path such as `/done` redirects as `internal`. Any other\n * URL, including a protocol-relative `//host`, redirects as `external`, because an Inertia\n * request cannot follow a plain redirect to another origin. A `back` redirect is never permanent.\n */\nexport function redirect(\n url: string,\n options: { success?: string; type?: RedirectType; permanent?: boolean } = {}\n): RedirectOutput {\n const type = options.type ?? (/^\\/(?![/\\\\])/.test(url) ? 'internal' : 'external');\n const output: RedirectOutput = {\n redirect_url: url,\n redirect_type: type,\n permanent: type !== 'back' && options.permanent === true\n };\n\n if (options.success !== undefined) {\n output.success = options.success;\n }\n\n return output;\n}\n", "/sdk/workspace-values.ts": "import {\n workspace as generatedWorkspace,\n type WorkspaceSystemFields,\n type WorkspaceValuesInput\n} from './generated/capabilities';\nimport type { WorkspaceFieldCatalog } from './index';\nimport { invoke } from './transport';\n\ntype Fields = Omit<WorkspaceSystemFields, keyof WorkspaceFieldCatalog> & WorkspaceFieldCatalog;\ntype Property<T, K extends string> = T extends null | undefined\n ? never\n : T extends readonly (infer Item)[]\n ? K extends `${number}`\n ? K extends keyof T\n ? T[K]\n : Item\n : unknown\n : T extends object\n ? K extends keyof T\n ? T[K]\n : unknown\n : unknown;\ntype PathValue<T, P extends string> = P extends `${infer Head}.${infer Tail}`\n ? PathValue<Property<T, Head>, Tail>\n : Property<T, P>;\nexport type WorkspaceValue<K extends string> = K extends keyof Fields\n ? Fields[K]\n : K extends `${infer Key}.${infer Path}`\n ? Key extends keyof Fields\n ? PathValue<Fields[Key], Path>\n : unknown\n : unknown;\ntype DefaultValue<D> = Exclude<D, undefined> | (undefined extends D ? null : never);\ntype ReadValue<K extends string, D> =\n | Exclude<WorkspaceValue<K>, null | undefined>\n | DefaultValue<D>;\ntype WriteValue<K extends string> = K extends keyof Fields ? Fields[K] | null : unknown;\ntype WrittenValues<V> = { [K in keyof V]: K extends string ? WriteValue<K> : unknown };\nexport type WorkspaceValues = { [K in keyof Fields]: Fields[K] | null } & Record<string, unknown>;\n\nfunction value<K extends string, D>(input: { key: K; defaultValue: D }): Promise<ReadValue<K, D>>;\nfunction value<K extends string, D = never>(input: {\n key: K;\n defaultValue?: D;\n}): Promise<ReadValue<K, D | undefined>>;\nfunction value(input: { key: string; defaultValue?: unknown }): Promise<unknown> {\n return invoke('workspace.value', input);\n}\n\nexport const workspace = {\n ...generatedWorkspace,\n value,\n setValue: <K extends string>(input: { key: K; value?: WriteValue<NoInfer<K>> }) =>\n invoke<WriteValue<K>>('workspace.set_value', input),\n values: (input: WorkspaceValuesInput = {}) => invoke<WorkspaceValues>('workspace.values', input),\n setValues: <V extends Record<string, unknown> = Record<never, never>>(input: {\n values?: V & WrittenValues<NoInfer<V>>;\n }) => invoke<WrittenValues<V>>('workspace.set_values', input)\n};\n", "/sdk/workspace.ts": "// The editor's slot for `@diagonal/workflow/workspace`: it replaces this file with the workspace's\n// declarations. Local runs import the file `diagonal-workflow pull-types` writes instead.\nexport const resources: Record<string, string> = {};\nexport const notificationTypes: Record<string, string> = {};\nexport const notificationTemplates: Record<string, Record<string, string>> = {};\n" };
1425
+ var SDK_SURFACE = { "root": { "HostError": { "value": true, "callable": false, "members": { "prototype": { "callable": false, "members": { "code": { "callable": false }, "status": { "callable": false }, "details": { "callable": false }, "failureId": { "callable": false }, "failure": { "callable": false }, "name": { "callable": false }, "message": { "callable": false }, "stack": { "callable": false }, "cause": { "callable": false } } } } }, "WorkflowFailure": { "value": true, "callable": false, "members": { "prototype": { "callable": false, "members": { "status": { "callable": false }, "details": { "callable": false }, "name": { "callable": false }, "message": { "callable": false }, "stack": { "callable": false }, "cause": { "callable": false } } } } }, "fail": { "value": true, "callable": true, "tasks": [] }, "validationError": { "value": true, "callable": true, "tasks": [] }, "HostFailure": { "value": false }, "invoke": { "value": true, "callable": true, "tasks": [], "invoke": true }, "setTransport": { "value": true, "callable": true, "tasks": [] }, "HostTransport": { "value": false }, "transaction": { "value": true, "callable": true, "tasks": ["transaction.begin", "transaction.commit", "transaction.rollback"] }, "Liquid": { "value": false }, "declaredInput": { "value": true, "callable": false }, "data": { "value": true, "callable": false, "members": { "create": { "callable": true, "tasks": ["data.create"] }, "find": { "callable": true, "tasks": ["data.find"] }, "update": { "callable": true, "tasks": ["data.update"] }, "search": { "callable": true, "tasks": ["data.search"] }, "each": { "callable": true, "tasks": ["data.search"] }, "delete": { "callable": true, "tasks": ["data.delete"] }, "restore": { "callable": true, "tasks": ["data.restore"] }, "count": { "callable": true, "tasks": ["data.count"] }, "findOrCreate": { "callable": true, "tasks": ["data.find-or-create"] }, "updateOrCreate": { "callable": true, "tasks": ["data.update-or-create"] }, "createMany": { "callable": true, "tasks": ["data.create-many"] }, "deleteMany": { "callable": true, "tasks": ["data.delete-many"] }, "aggregateMetrics": { "callable": true, "tasks": ["data.aggregate_metrics"] }, "relation": { "callable": false, "members": { "attach": { "callable": true, "tasks": ["data.relation.attach"] }, "attachMany": { "callable": true, "tasks": ["data.relation.attach-many"] }, "detach": { "callable": true, "tasks": ["data.relation.detach"] }, "detachMany": { "callable": true, "tasks": ["data.relation.detach-many"] }, "sync": { "callable": true, "tasks": ["data.relation.sync"] } } }, "semanticSearch": { "callable": true, "tasks": ["data.semantic_search"] }, "sum": { "callable": true, "tasks": ["data.sum"] }, "validate": { "callable": true, "tasks": ["data.validate"] } } }, "mail": { "value": true, "callable": false, "members": { "sendNotification": { "callable": true, "tasks": ["mail.send-notification"] }, "search": { "callable": true, "tasks": ["mail.search"] }, "send": { "callable": true, "tasks": ["mail.send"] } } }, "notification": { "value": true, "callable": false, "members": { "sendNotification": { "callable": true, "tasks": ["notification.send-notification"] }, "sendBulkNotifications": { "callable": true, "tasks": ["notification.send-bulk-notifications"] }, "setConsent": { "callable": true, "tasks": ["notification.set-consent"] }, "send": { "callable": true, "tasks": ["notification.send"] } } }, "sms": { "value": true, "callable": false, "members": { "sendNotification": { "callable": true, "tasks": ["sms.send-notification"] } } }, "workspace": { "value": true, "callable": false, "members": { "value": { "callable": true, "tasks": ["workspace.value"] }, "setValue": { "callable": true, "tasks": ["workspace.set_value"] }, "values": { "callable": true, "tasks": ["workspace.values"] }, "setValues": { "callable": true, "tasks": ["workspace.set_values"] }, "loginUrl": { "callable": true, "tasks": ["workspace.login_url"] } } }, "InputField": { "value": true, "callable": false, "members": { "prototype": { "callable": false, "members": { "$value": { "callable": false }, "$optional": { "callable": false }, "$spec": { "callable": false, "members": { "kind": { "callable": false }, "optional": { "callable": false }, "nullable": { "callable": false }, "rules": { "callable": false, "members": { "length": { "callable": false }, "toString": { "callable": true, "tasks": [] }, "toLocaleString": { "callable": true, "tasks": [] }, "concat": { "callable": true, "tasks": [] }, "join": { "callable": true, "tasks": [] }, "slice": { "callable": true, "tasks": [] }, "indexOf": { "callable": true, "tasks": [] }, "lastIndexOf": { "callable": true, "tasks": [] }, "every": { "callable": true, "tasks": [] }, "some": { "callable": true, "tasks": [] }, "forEach": { "callable": true, "tasks": [] }, "map": { "callable": true, "tasks": [] }, "filter": { "callable": true, "tasks": [] }, "reduce": { "callable": true, "tasks": [] }, "reduceRight": { "callable": true, "tasks": [] }, "find": { "callable": true, "tasks": [] }, "findIndex": { "callable": true, "tasks": [] }, "entries": { "callable": true, "tasks": [] }, "keys": { "callable": true, "tasks": [] }, "values": { "callable": true, "tasks": [] }, "includes": { "callable": true, "tasks": [] }, "flatMap": { "callable": true, "tasks": [] }, "flat": { "callable": true, "tasks": [] }, "at": { "callable": true, "tasks": [] }, "findLast": { "callable": true, "tasks": [] }, "findLastIndex": { "callable": true, "tasks": [] }, "toReversed": { "callable": true, "tasks": [] }, "toSorted": { "callable": true, "tasks": [] }, "toSpliced": { "callable": true, "tasks": [] }, "with": { "callable": true, "tasks": [] }, "__@iterator@17": { "callable": true, "tasks": [] }, "__@unscopables@394": { "callable": false, "members": { "length": { "callable": false }, "toString": { "callable": false }, "toLocaleString": { "callable": false }, "concat": { "callable": false }, "join": { "callable": false }, "slice": { "callable": false }, "indexOf": { "callable": false }, "lastIndexOf": { "callable": false }, "every": { "callable": false }, "some": { "callable": false }, "forEach": { "callable": false }, "map": { "callable": false }, "filter": { "callable": false }, "reduce": { "callable": false }, "reduceRight": { "callable": false }, "find": { "callable": false }, "findIndex": { "callable": false }, "entries": { "callable": false }, "keys": { "callable": false }, "values": { "callable": false }, "includes": { "callable": false }, "flatMap": { "callable": false }, "flat": { "callable": false }, "at": { "callable": false }, "findLast": { "callable": false }, "findLastIndex": { "callable": false }, "toReversed": { "callable": false }, "toSorted": { "callable": false }, "toSpliced": { "callable": false }, "with": { "callable": false }, "__@iterator@17": { "callable": false }, "__@unscopables@394": { "callable": false } } } } }, "label": { "callable": false }, "description": { "callable": false }, "options": { "callable": false }, "items": { "callable": false }, "fields": { "callable": false }, "resource": { "callable": false }, "scope": { "callable": false }, "accept": { "callable": false }, "visibility": { "callable": false }, "content": { "callable": false } } }, "optional": { "callable": true, "tasks": [] }, "nullable": { "callable": true, "tasks": [] }, "min": { "callable": true, "tasks": [] }, "max": { "callable": true, "tasks": [] }, "between": { "callable": true, "tasks": [] }, "size": { "callable": true, "tasks": [] }, "regex": { "callable": true, "tasks": [] }, "rule": { "callable": true, "tasks": [] }, "label": { "callable": true, "tasks": [] }, "description": { "callable": true, "tasks": [] } } } } }, "InputSchema": { "value": true, "callable": false, "members": { "prototype": { "callable": false, "members": { "shape": { "callable": false }, "$value": { "callable": false, "members": {} }, "$optional": { "callable": false }, "$spec": { "callable": false, "members": { "kind": { "callable": false }, "optional": { "callable": false }, "nullable": { "callable": false }, "rules": { "callable": false, "members": { "length": { "callable": false }, "toString": { "callable": true, "tasks": [] }, "toLocaleString": { "callable": true, "tasks": [] }, "concat": { "callable": true, "tasks": [] }, "join": { "callable": true, "tasks": [] }, "slice": { "callable": true, "tasks": [] }, "indexOf": { "callable": true, "tasks": [] }, "lastIndexOf": { "callable": true, "tasks": [] }, "every": { "callable": true, "tasks": [] }, "some": { "callable": true, "tasks": [] }, "forEach": { "callable": true, "tasks": [] }, "map": { "callable": true, "tasks": [] }, "filter": { "callable": true, "tasks": [] }, "reduce": { "callable": true, "tasks": [] }, "reduceRight": { "callable": true, "tasks": [] }, "find": { "callable": true, "tasks": [] }, "findIndex": { "callable": true, "tasks": [] }, "entries": { "callable": true, "tasks": [] }, "keys": { "callable": true, "tasks": [] }, "values": { "callable": true, "tasks": [] }, "includes": { "callable": true, "tasks": [] }, "flatMap": { "callable": true, "tasks": [] }, "flat": { "callable": true, "tasks": [] }, "at": { "callable": true, "tasks": [] }, "findLast": { "callable": true, "tasks": [] }, "findLastIndex": { "callable": true, "tasks": [] }, "toReversed": { "callable": true, "tasks": [] }, "toSorted": { "callable": true, "tasks": [] }, "toSpliced": { "callable": true, "tasks": [] }, "with": { "callable": true, "tasks": [] }, "__@iterator@17": { "callable": true, "tasks": [] }, "__@unscopables@394": { "callable": false, "members": { "length": { "callable": false }, "toString": { "callable": false }, "toLocaleString": { "callable": false }, "concat": { "callable": false }, "join": { "callable": false }, "slice": { "callable": false }, "indexOf": { "callable": false }, "lastIndexOf": { "callable": false }, "every": { "callable": false }, "some": { "callable": false }, "forEach": { "callable": false }, "map": { "callable": false }, "filter": { "callable": false }, "reduce": { "callable": false }, "reduceRight": { "callable": false }, "find": { "callable": false }, "findIndex": { "callable": false }, "entries": { "callable": false }, "keys": { "callable": false }, "values": { "callable": false }, "includes": { "callable": false }, "flatMap": { "callable": false }, "flat": { "callable": false }, "at": { "callable": false }, "findLast": { "callable": false }, "findLastIndex": { "callable": false }, "toReversed": { "callable": false }, "toSorted": { "callable": false }, "toSpliced": { "callable": false }, "with": { "callable": false }, "__@iterator@17": { "callable": false }, "__@unscopables@394": { "callable": false } } } } }, "label": { "callable": false }, "description": { "callable": false }, "options": { "callable": false }, "items": { "callable": false }, "fields": { "callable": false }, "resource": { "callable": false }, "scope": { "callable": false }, "accept": { "callable": false }, "visibility": { "callable": false }, "content": { "callable": false } } }, "optional": { "callable": true, "tasks": [] }, "nullable": { "callable": true, "tasks": [] }, "min": { "callable": true, "tasks": [] }, "max": { "callable": true, "tasks": [] }, "between": { "callable": true, "tasks": [] }, "size": { "callable": true, "tasks": [] }, "regex": { "callable": true, "tasks": [] }, "rule": { "callable": true, "tasks": [] }, "label": { "callable": true, "tasks": [] }, "description": { "callable": true, "tasks": [] } } } } }, "v": { "value": true, "callable": false, "members": { "text": { "callable": true, "tasks": [] }, "email": { "callable": true, "tasks": [] }, "url": { "callable": true, "tasks": [] }, "uuid": { "callable": true, "tasks": [] }, "phone": { "callable": true, "tasks": [] }, "date": { "callable": true, "tasks": [] }, "datetime": { "callable": true, "tasks": [] }, "time": { "callable": true, "tasks": [] }, "timezone": { "callable": true, "tasks": [] }, "color": { "callable": true, "tasks": [] }, "number": { "callable": true, "tasks": [] }, "integer": { "callable": true, "tasks": [] }, "money": { "callable": true, "tasks": [] }, "boolean": { "callable": true, "tasks": [] }, "select": { "callable": true, "tasks": [] }, "list": { "callable": true, "tasks": [] }, "object": { "callable": true, "tasks": [] }, "record": { "callable": true, "tasks": [] }, "recordReference": { "callable": true, "tasks": [] }, "roleReference": { "callable": true, "tasks": [] }, "file": { "callable": true, "tasks": [] }, "content": { "callable": true, "tasks": [] } } }, "ContentDocument": { "value": false }, "ContentNode": { "value": false }, "ContentOptions": { "value": false }, "FileVisibility": { "value": false }, "Infer": { "value": false }, "InferInput": { "value": false }, "InputFieldKind": { "value": false }, "InputFieldSpec": { "value": false }, "InputShape": { "value": false }, "Money": { "value": false }, "RecordScope": { "value": false }, "defineWorkflow": { "value": true, "callable": true, "tasks": [] }, "parseWorkflowInput": { "value": true, "callable": true, "tasks": [] }, "redirect": { "value": true, "callable": true, "tasks": [] }, "respond": { "value": true, "callable": true, "tasks": [] }, "validateWorkflowInput": { "value": true, "callable": true, "tasks": [] }, "Identity": { "value": false }, "InputErrors": { "value": false }, "InputValidator": { "value": false }, "RequestContext": { "value": false }, "ScriptExecution": { "value": false }, "WorkflowContext": { "value": false }, "WorkflowDefinition": { "value": false }, "WorkflowExecution": { "value": false }, "ScriptHostContext": { "value": false }, "WorkspaceResources": { "value": false }, "WorkspaceFieldCatalog": { "value": false }, "WorkspaceNotificationTypes": { "value": false }, "SDK_VERSION": { "value": true, "callable": false }, "WorkspaceSystemFields": { "value": false }, "AiDecideInput": { "value": false }, "AiDecideOutput": { "value": false }, "AiRunPromptInput": { "value": false }, "AiRunPromptOutput": { "value": false }, "AuthImpersonateInput": { "value": false }, "AuthImpersonateOutput": { "value": false }, "AuthLoginInput": { "value": false }, "AuthLoginOutput": { "value": false }, "CalendarGenerateLinkInput": { "value": false }, "CalendarGenerateLinkOutput": { "value": false }, "CalendarSearchEventsInput": { "value": false }, "CalendarSearchEventsOutput": { "value": false }, "CallbackGetInput": { "value": false }, "CallbackGetOutput": { "value": false }, "CallbackRemoveInput": { "value": false }, "CallbackRemoveOutput": { "value": false }, "CallbackSetInput": { "value": false }, "CallbackSetOutput": { "value": false }, "ChartDistributionInput": { "value": false }, "ChartDistributionOutput": { "value": false }, "ChartKpiInput": { "value": false }, "ChartKpiOutput": { "value": false }, "ChartLeaderboardInput": { "value": false }, "ChartLeaderboardOutput": { "value": false }, "ChartTimeSeriesInput": { "value": false }, "ChartTimeSeriesOutput": { "value": false }, "DataAggregateMetricsInput": { "value": false }, "DataAggregateMetricsOutput": { "value": false }, "DataCountInput": { "value": false }, "DataCountOutput": { "value": false }, "DataCreateInput": { "value": false }, "DataCreateOutput": { "value": false }, "DataCreateManyInput": { "value": false }, "DataCreateManyOutput": { "value": false }, "DataDeleteInput": { "value": false }, "DataDeleteOutput": { "value": false }, "DataDeleteManyInput": { "value": false }, "DataDeleteManyOutput": { "value": false }, "DataFindInput": { "value": false }, "DataFindOutput": { "value": false }, "DataFindOrCreateInput": { "value": false }, "DataFindOrCreateOutput": { "value": false }, "DataRelationAttachInput": { "value": false }, "DataRelationAttachOutput": { "value": false }, "DataRelationAttachManyInput": { "value": false }, "DataRelationAttachManyOutput": { "value": false }, "DataRelationDetachInput": { "value": false }, "DataRelationDetachOutput": { "value": false }, "DataRelationDetachManyInput": { "value": false }, "DataRelationDetachManyOutput": { "value": false }, "DataRelationSyncInput": { "value": false }, "DataRelationSyncOutput": { "value": false }, "DataRestoreInput": { "value": false }, "DataRestoreOutput": { "value": false }, "DataSearchInput": { "value": false }, "DataSearchOutput": { "value": false }, "DataSemanticSearchInput": { "value": false }, "DataSemanticSearchOutput": { "value": false }, "DataSumInput": { "value": false }, "DataSumOutput": { "value": false }, "DataUpdateInput": { "value": false }, "DataUpdateOutput": { "value": false }, "DataUpdateOrCreateInput": { "value": false }, "DataUpdateOrCreateOutput": { "value": false }, "DataValidateInput": { "value": false }, "DataValidateOutput": { "value": false }, "DateAddInput": { "value": false }, "DateAddOutput": { "value": false }, "DateDiffInput": { "value": false }, "DateDiffOutput": { "value": false }, "DateEndOfInput": { "value": false }, "DateEndOfOutput": { "value": false }, "DateFormatInput": { "value": false }, "DateFormatOutput": { "value": false }, "DateStartOfInput": { "value": false }, "DateStartOfOutput": { "value": false }, "DateSubtractInput": { "value": false }, "DateSubtractOutput": { "value": false }, "FileChangeVisibilityInput": { "value": false }, "FileChangeVisibilityOutput": { "value": false }, "FileCreateFromUrlInput": { "value": false }, "FileCreateFromUrlOutput": { "value": false }, "FileCreateMediaLibraryItemInput": { "value": false }, "FileCreateMediaLibraryItemOutput": { "value": false }, "FileCreateQrCodeInput": { "value": false }, "FileCreateQrCodeOutput": { "value": false }, "GuardValidateInput": { "value": false }, "GuardValidateOutput": { "value": false }, "HttpRequestInput": { "value": false }, "HttpRequestOutput": { "value": false }, "LifecycleOutputInput": { "value": false }, "LifecycleOutputOutput": { "value": false }, "MailSearchInput": { "value": false }, "MailSearchOutput": { "value": false }, "MailSendInput": { "value": false }, "MailSendOutput": { "value": false }, "MailSendNotificationInput": { "value": false }, "MailSendNotificationOutput": { "value": false }, "MarkdownFromContentInput": { "value": false }, "MarkdownFromContentOutput": { "value": false }, "MarkdownToContentInput": { "value": false }, "MarkdownToContentOutput": { "value": false }, "MediaLibraryCreateFolderInput": { "value": false }, "MediaLibraryCreateFolderOutput": { "value": false }, "MediaLibraryDeleteItemInput": { "value": false }, "MediaLibraryDeleteItemOutput": { "value": false }, "MediaLibraryMoveItemsInput": { "value": false }, "MediaLibraryMoveItemsOutput": { "value": false }, "MediaLibraryUpdateItemInput": { "value": false }, "MediaLibraryUpdateItemOutput": { "value": false }, "MoneyFormatInput": { "value": false }, "MoneyFormatOutput": { "value": false }, "NotificationSendInput": { "value": false }, "NotificationSendOutput": { "value": false }, "NotificationSendBulkNotificationsInput": { "value": false }, "NotificationSendBulkNotificationsOutput": { "value": false }, "NotificationSendNotificationInput": { "value": false }, "NotificationSendNotificationOutput": { "value": false }, "NotificationSetConsentInput": { "value": false }, "NotificationSetConsentOutput": { "value": false }, "NumberFormatInput": { "value": false }, "NumberFormatOutput": { "value": false }, "PackageInstallInputInput": { "value": false }, "PackageInstallInputOutput": { "value": false }, "PageUrlInput": { "value": false }, "PageUrlOutput": { "value": false }, "PayablesVoidInput": { "value": false }, "PayablesVoidOutput": { "value": false }, "PayablesWriteOffInput": { "value": false }, "PayablesWriteOffOutput": { "value": false }, "PaymentCreateManualInput": { "value": false }, "PaymentCreateManualOutput": { "value": false }, "PaymentsChargeInput": { "value": false }, "PaymentsChargeOutput": { "value": false }, "PaymentsCheckoutInput": { "value": false }, "PaymentsCheckoutOutput": { "value": false }, "PaymentsConfirmInput": { "value": false }, "PaymentsConfirmOutput": { "value": false }, "PaymentsRefundInput": { "value": false }, "PaymentsRefundOutput": { "value": false }, "PaymentsVoidInput": { "value": false }, "PaymentsVoidOutput": { "value": false }, "PhoneFormatInput": { "value": false }, "PhoneFormatOutput": { "value": false }, "SchedulingBookSlotInput": { "value": false }, "SchedulingBookSlotOutput": { "value": false }, "SchedulingFindSlotsInput": { "value": false }, "SchedulingFindSlotsOutput": { "value": false }, "SchemaToJsonSchemaInput": { "value": false }, "SchemaToJsonSchemaOutput": { "value": false }, "SecurityRandomPasswordInput": { "value": false }, "SecurityRandomPasswordOutput": { "value": false }, "SmsSendNotificationInput": { "value": false }, "SmsSendNotificationOutput": { "value": false }, "SubscriptionsActivateInput": { "value": false }, "SubscriptionsActivateOutput": { "value": false }, "SubscriptionsCancelInput": { "value": false }, "SubscriptionsCancelOutput": { "value": false }, "SubscriptionsChangeItemsInput": { "value": false }, "SubscriptionsChangeItemsOutput": { "value": false }, "SubscriptionsCreateInput": { "value": false }, "SubscriptionsCreateOutput": { "value": false }, "SubscriptionsGenerateInvoiceInput": { "value": false }, "SubscriptionsGenerateInvoiceOutput": { "value": false }, "SubscriptionsPauseInput": { "value": false }, "SubscriptionsPauseOutput": { "value": false }, "SubscriptionsPreviewInput": { "value": false }, "SubscriptionsPreviewOutput": { "value": false }, "SubscriptionsPreviewChangeInput": { "value": false }, "SubscriptionsPreviewChangeOutput": { "value": false }, "SubscriptionsResumeInput": { "value": false }, "SubscriptionsResumeOutput": { "value": false }, "SubscriptionsSetUpcomingItemsInput": { "value": false }, "SubscriptionsSetUpcomingItemsOutput": { "value": false }, "TextGenerateInput": { "value": false }, "TextGenerateOutput": { "value": false }, "TextHashInput": { "value": false }, "TextHashOutput": { "value": false }, "TextRandomUuidInput": { "value": false }, "TextRandomUuidOutput": { "value": false }, "TextToContentInput": { "value": false }, "TextToContentOutput": { "value": false }, "TimeAddInput": { "value": false }, "TimeAddOutput": { "value": false }, "TimeDiffInput": { "value": false }, "TimeDiffOutput": { "value": false }, "TimeEndOfInput": { "value": false }, "TimeEndOfOutput": { "value": false }, "TimeFormatInput": { "value": false }, "TimeFormatOutput": { "value": false }, "TimeStartOfInput": { "value": false }, "TimeStartOfOutput": { "value": false }, "TimeSubtractInput": { "value": false }, "TimeSubtractOutput": { "value": false }, "TimezoneFormatInput": { "value": false }, "TimezoneFormatOutput": { "value": false }, "TimezoneInterpretInput": { "value": false }, "TimezoneInterpretOutput": { "value": false }, "TiptapParseInput": { "value": false }, "TiptapParseOutput": { "value": false }, "TransactionBeginInput": { "value": false }, "TransactionBeginOutput": { "value": false }, "TransactionCommitInput": { "value": false }, "TransactionCommitOutput": { "value": false }, "TransactionRollbackInput": { "value": false }, "TransactionRollbackOutput": { "value": false }, "UserAuthorizeInput": { "value": false }, "UserAuthorizeOutput": { "value": false }, "WebAgentInput": { "value": false }, "WebAgentOutput": { "value": false }, "WebBatchScrapeInput": { "value": false }, "WebBatchScrapeOutput": { "value": false }, "WebCrawlInput": { "value": false }, "WebCrawlOutput": { "value": false }, "WebExtractInput": { "value": false }, "WebExtractOutput": { "value": false }, "WebGoogleSearchInput": { "value": false }, "WebGoogleSearchOutput": { "value": false }, "WebMapInput": { "value": false }, "WebMapOutput": { "value": false }, "WebPdfInput": { "value": false }, "WebPdfOutput": { "value": false }, "WebScrapeInput": { "value": false }, "WebScrapeOutput": { "value": false }, "WebScreenshotInput": { "value": false }, "WebScreenshotOutput": { "value": false }, "WebSearchRankedInput": { "value": false }, "WebSearchRankedOutput": { "value": false }, "WorkflowRunInput": { "value": false }, "WorkflowRunOutput": { "value": false }, "WorkflowUrlInput": { "value": false }, "WorkflowUrlOutput": { "value": false }, "WorkspaceLoginUrlInput": { "value": false }, "WorkspaceLoginUrlOutput": { "value": false }, "WorkspaceSetValueInput": { "value": false }, "WorkspaceSetValueOutput": { "value": false }, "WorkspaceSetValuesInput": { "value": false }, "WorkspaceSetValuesOutput": { "value": false }, "WorkspaceValueInput": { "value": false }, "WorkspaceValueOutput": { "value": false }, "WorkspaceValuesInput": { "value": false }, "WorkspaceValuesOutput": { "value": false }, "ai": { "value": true, "callable": false, "members": { "decide": { "callable": true, "tasks": ["ai.decide"] }, "runPrompt": { "callable": true, "tasks": ["ai.run_prompt"] } } }, "auth": { "value": true, "callable": false, "members": { "impersonate": { "callable": true, "tasks": ["auth.impersonate"] }, "login": { "callable": true, "tasks": ["auth.login"] } } }, "calendar": { "value": true, "callable": false, "members": { "generateLink": { "callable": true, "tasks": ["calendar.generate_link"] }, "searchEvents": { "callable": true, "tasks": ["calendar.search_events"] } } }, "callback": { "value": true, "callable": false, "members": { "get": { "callable": true, "tasks": ["callback.get"] }, "remove": { "callable": true, "tasks": ["callback.remove"] }, "set": { "callable": true, "tasks": ["callback.set"] } } }, "chart": { "value": true, "callable": false, "members": { "distribution": { "callable": true, "tasks": ["chart.distribution"] }, "kpi": { "callable": true, "tasks": ["chart.kpi"] }, "leaderboard": { "callable": true, "tasks": ["chart.leaderboard"] }, "timeSeries": { "callable": true, "tasks": ["chart.time_series"] } } }, "date": { "value": true, "callable": false, "members": { "add": { "callable": true, "tasks": ["date.add"] }, "diff": { "callable": true, "tasks": ["date.diff"] }, "endOf": { "callable": true, "tasks": ["date.end_of"] }, "format": { "callable": true, "tasks": ["date.format"] }, "startOf": { "callable": true, "tasks": ["date.start_of"] }, "subtract": { "callable": true, "tasks": ["date.subtract"] } } }, "file": { "value": true, "callable": false, "members": { "changeVisibility": { "callable": true, "tasks": ["file.change_visibility"] }, "createFromUrl": { "callable": true, "tasks": ["file.create_from_url"] }, "createMediaLibraryItem": { "callable": true, "tasks": ["file.create_media_library_item"] }, "createQrCode": { "callable": true, "tasks": ["file.create_qr_code"] } } }, "guard": { "value": true, "callable": false, "members": { "validate": { "callable": true, "tasks": ["guard.validate"] } } }, "http": { "value": true, "callable": false, "members": { "request": { "callable": true, "tasks": ["http.request"] } } }, "lifecycle": { "value": true, "callable": false, "members": { "output": { "callable": true, "tasks": ["lifecycle.output"] } } }, "markdown": { "value": true, "callable": false, "members": { "fromContent": { "callable": true, "tasks": ["markdown.from_content"] }, "toContent": { "callable": true, "tasks": ["markdown.to_content"] } } }, "mediaLibrary": { "value": true, "callable": false, "members": { "createFolder": { "callable": true, "tasks": ["media_library.create_folder"] }, "deleteItem": { "callable": true, "tasks": ["media_library.delete_item"] }, "moveItems": { "callable": true, "tasks": ["media_library.move_items"] }, "updateItem": { "callable": true, "tasks": ["media_library.update_item"] } } }, "money": { "value": true, "callable": false, "members": { "format": { "callable": true, "tasks": ["money.format"] } } }, "number": { "value": true, "callable": false, "members": { "format": { "callable": true, "tasks": ["number.format"] } } }, "package": { "value": true, "callable": false, "members": { "installInput": { "callable": true, "tasks": ["package.install-input"] } } }, "page": { "value": true, "callable": false, "members": { "url": { "callable": true, "tasks": ["page.url"] } } }, "payables": { "value": true, "callable": false, "members": { "void": { "callable": true, "tasks": ["payables.void"] }, "writeOff": { "callable": true, "tasks": ["payables.write-off"] } } }, "payment": { "value": true, "callable": false, "members": { "createManual": { "callable": true, "tasks": ["payment.create_manual"] } } }, "payments": { "value": true, "callable": false, "members": { "charge": { "callable": true, "tasks": ["payments.charge"] }, "checkout": { "callable": true, "tasks": ["payments.checkout"] }, "confirm": { "callable": true, "tasks": ["payments.confirm"] }, "refund": { "callable": true, "tasks": ["payments.refund"] }, "void": { "callable": true, "tasks": ["payments.void"] } } }, "phone": { "value": true, "callable": false, "members": { "format": { "callable": true, "tasks": ["phone.format"] } } }, "scheduling": { "value": true, "callable": false, "members": { "bookSlot": { "callable": true, "tasks": ["scheduling.book_slot"] }, "findSlots": { "callable": true, "tasks": ["scheduling.find_slots"] } } }, "schema": { "value": true, "callable": false, "members": { "toJsonSchema": { "callable": true, "tasks": ["schema.to_json_schema"] } } }, "security": { "value": true, "callable": false, "members": { "randomPassword": { "callable": true, "tasks": ["security.random_password"] } } }, "subscriptions": { "value": true, "callable": false, "members": { "activate": { "callable": true, "tasks": ["subscriptions.activate"] }, "cancel": { "callable": true, "tasks": ["subscriptions.cancel"] }, "changeItems": { "callable": true, "tasks": ["subscriptions.change_items"] }, "create": { "callable": true, "tasks": ["subscriptions.create"] }, "generateInvoice": { "callable": true, "tasks": ["subscriptions.generate_invoice"] }, "pause": { "callable": true, "tasks": ["subscriptions.pause"] }, "preview": { "callable": true, "tasks": ["subscriptions.preview"] }, "previewChange": { "callable": true, "tasks": ["subscriptions.preview_change"] }, "resume": { "callable": true, "tasks": ["subscriptions.resume"] }, "setUpcomingItems": { "callable": true, "tasks": ["subscriptions.set_upcoming_items"] } } }, "text": { "value": true, "callable": false, "members": { "generate": { "callable": true, "tasks": ["text.generate"] }, "hash": { "callable": true, "tasks": ["text.hash"] }, "randomUuid": { "callable": true, "tasks": ["text.random_uuid"] }, "toContent": { "callable": true, "tasks": ["text.to_content"] } } }, "time": { "value": true, "callable": false, "members": { "add": { "callable": true, "tasks": ["time.add"] }, "diff": { "callable": true, "tasks": ["time.diff"] }, "endOf": { "callable": true, "tasks": ["time.end_of"] }, "format": { "callable": true, "tasks": ["time.format"] }, "startOf": { "callable": true, "tasks": ["time.start_of"] }, "subtract": { "callable": true, "tasks": ["time.subtract"] } } }, "timezone": { "value": true, "callable": false, "members": { "format": { "callable": true, "tasks": ["timezone.format"] }, "interpret": { "callable": true, "tasks": ["timezone.interpret"] } } }, "tiptap": { "value": true, "callable": false, "members": { "parse": { "callable": true, "tasks": ["tiptap.parse"] } } }, "user": { "value": true, "callable": false, "members": { "authorize": { "callable": true, "tasks": ["user.authorize"] } } }, "web": { "value": true, "callable": false, "members": { "agent": { "callable": true, "tasks": ["web.agent"] }, "batchScrape": { "callable": true, "tasks": ["web.batch_scrape"] }, "crawl": { "callable": true, "tasks": ["web.crawl"] }, "extract": { "callable": true, "tasks": ["web.extract"] }, "googleSearch": { "callable": true, "tasks": ["web.google_search"] }, "map": { "callable": true, "tasks": ["web.map"] }, "pdf": { "callable": true, "tasks": ["web.pdf"] }, "scrape": { "callable": true, "tasks": ["web.scrape"] }, "screenshot": { "callable": true, "tasks": ["web.screenshot"] }, "searchRanked": { "callable": true, "tasks": ["web.search_ranked"] } } }, "workflow": { "value": true, "callable": false, "members": { "run": { "callable": true, "tasks": ["workflow.run"] }, "url": { "callable": true, "tasks": ["workflow.url"] } } } }, "profiles": { "test": { "transaction": { "value": true, "callable": true, "tasks": ["transaction.begin", "transaction.commit", "transaction.rollback"] }, "data": { "value": true, "callable": false, "members": { "aggregateMetrics": { "callable": true, "tasks": ["data.aggregate_metrics"] }, "count": { "callable": true, "tasks": ["data.count"] }, "create": { "callable": true, "tasks": ["data.create"] }, "createMany": { "callable": true, "tasks": ["data.create-many"] }, "delete": { "callable": true, "tasks": ["data.delete"] }, "deleteMany": { "callable": true, "tasks": ["data.delete-many"] }, "find": { "callable": true, "tasks": ["data.find"] }, "findOrCreate": { "callable": true, "tasks": ["data.find-or-create"] }, "relation": { "callable": false, "members": { "attach": { "callable": true, "tasks": [] }, "attachMany": { "callable": true, "tasks": [] }, "detach": { "callable": true, "tasks": [] }, "detachMany": { "callable": true, "tasks": [] }, "sync": { "callable": true, "tasks": [] } } }, "restore": { "callable": true, "tasks": ["data.restore"] }, "search": { "callable": true, "tasks": ["data.search"] }, "semanticSearch": { "callable": true, "tasks": ["data.semantic_search"] }, "sum": { "callable": true, "tasks": ["data.sum"] }, "update": { "callable": true, "tasks": ["data.update"] }, "updateOrCreate": { "callable": true, "tasks": ["data.update-or-create"] }, "validate": { "callable": true, "tasks": ["data.validate"] }, "each": { "callable": true, "tasks": [] } } }, "HostError": { "value": true, "callable": false, "members": { "prototype": { "callable": false, "members": { "code": { "callable": false }, "status": { "callable": false }, "details": { "callable": false }, "failureId": { "callable": false }, "failure": { "callable": false }, "name": { "callable": false }, "message": { "callable": false }, "stack": { "callable": false }, "cause": { "callable": false } } } } }, "WorkflowFailure": { "value": true, "callable": false, "members": { "prototype": { "callable": false, "members": { "status": { "callable": false }, "details": { "callable": false }, "name": { "callable": false }, "message": { "callable": false }, "stack": { "callable": false }, "cause": { "callable": false } } } } }, "fail": { "value": true, "callable": true, "tasks": [] }, "validationError": { "value": true, "callable": true, "tasks": [] }, "InputField": { "value": true, "callable": false, "members": { "prototype": { "callable": false, "members": { "$value": { "callable": false }, "$optional": { "callable": false }, "$spec": { "callable": false, "members": { "kind": { "callable": false }, "optional": { "callable": false }, "nullable": { "callable": false }, "rules": { "callable": false, "members": { "length": { "callable": false }, "toString": { "callable": true, "tasks": [] }, "toLocaleString": { "callable": true, "tasks": [] }, "concat": { "callable": true, "tasks": [] }, "join": { "callable": true, "tasks": [] }, "slice": { "callable": true, "tasks": [] }, "indexOf": { "callable": true, "tasks": [] }, "lastIndexOf": { "callable": true, "tasks": [] }, "every": { "callable": true, "tasks": [] }, "some": { "callable": true, "tasks": [] }, "forEach": { "callable": true, "tasks": [] }, "map": { "callable": true, "tasks": [] }, "filter": { "callable": true, "tasks": [] }, "reduce": { "callable": true, "tasks": [] }, "reduceRight": { "callable": true, "tasks": [] }, "find": { "callable": true, "tasks": [] }, "findIndex": { "callable": true, "tasks": [] }, "entries": { "callable": true, "tasks": [] }, "keys": { "callable": true, "tasks": [] }, "values": { "callable": true, "tasks": [] }, "includes": { "callable": true, "tasks": [] }, "flatMap": { "callable": true, "tasks": [] }, "flat": { "callable": true, "tasks": [] }, "at": { "callable": true, "tasks": [] }, "findLast": { "callable": true, "tasks": [] }, "findLastIndex": { "callable": true, "tasks": [] }, "toReversed": { "callable": true, "tasks": [] }, "toSorted": { "callable": true, "tasks": [] }, "toSpliced": { "callable": true, "tasks": [] }, "with": { "callable": true, "tasks": [] }, "__@iterator@17": { "callable": true, "tasks": [] }, "__@unscopables@394": { "callable": false, "members": { "length": { "callable": false }, "toString": { "callable": false }, "toLocaleString": { "callable": false }, "concat": { "callable": false }, "join": { "callable": false }, "slice": { "callable": false }, "indexOf": { "callable": false }, "lastIndexOf": { "callable": false }, "every": { "callable": false }, "some": { "callable": false }, "forEach": { "callable": false }, "map": { "callable": false }, "filter": { "callable": false }, "reduce": { "callable": false }, "reduceRight": { "callable": false }, "find": { "callable": false }, "findIndex": { "callable": false }, "entries": { "callable": false }, "keys": { "callable": false }, "values": { "callable": false }, "includes": { "callable": false }, "flatMap": { "callable": false }, "flat": { "callable": false }, "at": { "callable": false }, "findLast": { "callable": false }, "findLastIndex": { "callable": false }, "toReversed": { "callable": false }, "toSorted": { "callable": false }, "toSpliced": { "callable": false }, "with": { "callable": false }, "__@iterator@17": { "callable": false }, "__@unscopables@394": { "callable": false } } } } }, "label": { "callable": false }, "description": { "callable": false }, "options": { "callable": false }, "items": { "callable": false }, "fields": { "callable": false }, "resource": { "callable": false }, "scope": { "callable": false }, "accept": { "callable": false }, "visibility": { "callable": false }, "content": { "callable": false } } }, "optional": { "callable": true, "tasks": [] }, "nullable": { "callable": true, "tasks": [] }, "min": { "callable": true, "tasks": [] }, "max": { "callable": true, "tasks": [] }, "between": { "callable": true, "tasks": [] }, "size": { "callable": true, "tasks": [] }, "regex": { "callable": true, "tasks": [] }, "rule": { "callable": true, "tasks": [] }, "label": { "callable": true, "tasks": [] }, "description": { "callable": true, "tasks": [] } } } } }, "InputSchema": { "value": true, "callable": false, "members": { "prototype": { "callable": false, "members": { "shape": { "callable": false }, "$value": { "callable": false, "members": {} }, "$optional": { "callable": false }, "$spec": { "callable": false, "members": { "kind": { "callable": false }, "optional": { "callable": false }, "nullable": { "callable": false }, "rules": { "callable": false, "members": { "length": { "callable": false }, "toString": { "callable": true, "tasks": [] }, "toLocaleString": { "callable": true, "tasks": [] }, "concat": { "callable": true, "tasks": [] }, "join": { "callable": true, "tasks": [] }, "slice": { "callable": true, "tasks": [] }, "indexOf": { "callable": true, "tasks": [] }, "lastIndexOf": { "callable": true, "tasks": [] }, "every": { "callable": true, "tasks": [] }, "some": { "callable": true, "tasks": [] }, "forEach": { "callable": true, "tasks": [] }, "map": { "callable": true, "tasks": [] }, "filter": { "callable": true, "tasks": [] }, "reduce": { "callable": true, "tasks": [] }, "reduceRight": { "callable": true, "tasks": [] }, "find": { "callable": true, "tasks": [] }, "findIndex": { "callable": true, "tasks": [] }, "entries": { "callable": true, "tasks": [] }, "keys": { "callable": true, "tasks": [] }, "values": { "callable": true, "tasks": [] }, "includes": { "callable": true, "tasks": [] }, "flatMap": { "callable": true, "tasks": [] }, "flat": { "callable": true, "tasks": [] }, "at": { "callable": true, "tasks": [] }, "findLast": { "callable": true, "tasks": [] }, "findLastIndex": { "callable": true, "tasks": [] }, "toReversed": { "callable": true, "tasks": [] }, "toSorted": { "callable": true, "tasks": [] }, "toSpliced": { "callable": true, "tasks": [] }, "with": { "callable": true, "tasks": [] }, "__@iterator@17": { "callable": true, "tasks": [] }, "__@unscopables@394": { "callable": false, "members": { "length": { "callable": false }, "toString": { "callable": false }, "toLocaleString": { "callable": false }, "concat": { "callable": false }, "join": { "callable": false }, "slice": { "callable": false }, "indexOf": { "callable": false }, "lastIndexOf": { "callable": false }, "every": { "callable": false }, "some": { "callable": false }, "forEach": { "callable": false }, "map": { "callable": false }, "filter": { "callable": false }, "reduce": { "callable": false }, "reduceRight": { "callable": false }, "find": { "callable": false }, "findIndex": { "callable": false }, "entries": { "callable": false }, "keys": { "callable": false }, "values": { "callable": false }, "includes": { "callable": false }, "flatMap": { "callable": false }, "flat": { "callable": false }, "at": { "callable": false }, "findLast": { "callable": false }, "findLastIndex": { "callable": false }, "toReversed": { "callable": false }, "toSorted": { "callable": false }, "toSpliced": { "callable": false }, "with": { "callable": false }, "__@iterator@17": { "callable": false }, "__@unscopables@394": { "callable": false } } } } }, "label": { "callable": false }, "description": { "callable": false }, "options": { "callable": false }, "items": { "callable": false }, "fields": { "callable": false }, "resource": { "callable": false }, "scope": { "callable": false }, "accept": { "callable": false }, "visibility": { "callable": false }, "content": { "callable": false } } }, "optional": { "callable": true, "tasks": [] }, "nullable": { "callable": true, "tasks": [] }, "min": { "callable": true, "tasks": [] }, "max": { "callable": true, "tasks": [] }, "between": { "callable": true, "tasks": [] }, "size": { "callable": true, "tasks": [] }, "regex": { "callable": true, "tasks": [] }, "rule": { "callable": true, "tasks": [] }, "label": { "callable": true, "tasks": [] }, "description": { "callable": true, "tasks": [] } } } } }, "v": { "value": true, "callable": false, "members": { "text": { "callable": true, "tasks": [] }, "email": { "callable": true, "tasks": [] }, "url": { "callable": true, "tasks": [] }, "uuid": { "callable": true, "tasks": [] }, "phone": { "callable": true, "tasks": [] }, "date": { "callable": true, "tasks": [] }, "datetime": { "callable": true, "tasks": [] }, "time": { "callable": true, "tasks": [] }, "timezone": { "callable": true, "tasks": [] }, "color": { "callable": true, "tasks": [] }, "number": { "callable": true, "tasks": [] }, "integer": { "callable": true, "tasks": [] }, "money": { "callable": true, "tasks": [] }, "boolean": { "callable": true, "tasks": [] }, "select": { "callable": true, "tasks": [] }, "list": { "callable": true, "tasks": [] }, "object": { "callable": true, "tasks": [] }, "record": { "callable": true, "tasks": [] }, "recordReference": { "callable": true, "tasks": [] }, "roleReference": { "callable": true, "tasks": [] }, "file": { "callable": true, "tasks": [] }, "content": { "callable": true, "tasks": [] } } }, "ContentDocument": { "value": false }, "ContentNode": { "value": false }, "ContentOptions": { "value": false }, "FileVisibility": { "value": false }, "Infer": { "value": false }, "InferInput": { "value": false }, "InputFieldKind": { "value": false }, "InputFieldSpec": { "value": false }, "InputShape": { "value": false }, "Money": { "value": false }, "RecordScope": { "value": false }, "defineWorkflow": { "value": true, "callable": true, "tasks": [] }, "parseWorkflowInput": { "value": true, "callable": true, "tasks": [] }, "redirect": { "value": true, "callable": true, "tasks": [] }, "respond": { "value": true, "callable": true, "tasks": [] }, "validateWorkflowInput": { "value": true, "callable": true, "tasks": [] }, "Identity": { "value": false }, "InputErrors": { "value": false }, "InputValidator": { "value": false }, "RequestContext": { "value": false }, "ScriptExecution": { "value": false }, "WorkflowContext": { "value": false }, "WorkflowDefinition": { "value": false }, "WorkflowExecution": { "value": false }, "ScriptHostContext": { "value": false }, "WorkspaceFieldCatalog": { "value": false }, "WorkspaceNotificationTypes": { "value": false }, "WorkspaceResources": { "value": false }, "ai": { "value": true, "callable": false, "members": { "decide": { "callable": true, "tasks": ["ai.decide"] }, "runPrompt": { "callable": true, "tasks": ["ai.run_prompt"] } } }, "calendar": { "value": true, "callable": false, "members": { "generateLink": { "callable": true, "tasks": ["calendar.generate_link"] }, "searchEvents": { "callable": true, "tasks": ["calendar.search_events"] } } }, "callback": { "value": true, "callable": false, "members": { "get": { "callable": true, "tasks": ["callback.get"] }, "remove": { "callable": true, "tasks": ["callback.remove"] }, "set": { "callable": true, "tasks": ["callback.set"] } } }, "chart": { "value": true, "callable": false, "members": { "distribution": { "callable": true, "tasks": ["chart.distribution"] }, "kpi": { "callable": true, "tasks": ["chart.kpi"] }, "leaderboard": { "callable": true, "tasks": ["chart.leaderboard"] }, "timeSeries": { "callable": true, "tasks": ["chart.time_series"] } } }, "date": { "value": true, "callable": false, "members": { "add": { "callable": true, "tasks": ["date.add"] }, "diff": { "callable": true, "tasks": ["date.diff"] }, "endOf": { "callable": true, "tasks": ["date.end_of"] }, "format": { "callable": true, "tasks": ["date.format"] }, "startOf": { "callable": true, "tasks": ["date.start_of"] }, "subtract": { "callable": true, "tasks": ["date.subtract"] } } }, "file": { "value": true, "callable": false, "members": { "changeVisibility": { "callable": true, "tasks": ["file.change_visibility"] }, "createFromUrl": { "callable": true, "tasks": ["file.create_from_url"] }, "createMediaLibraryItem": { "callable": true, "tasks": ["file.create_media_library_item"] }, "createQrCode": { "callable": true, "tasks": ["file.create_qr_code"] } } }, "guard": { "value": true, "callable": false, "members": { "validate": { "callable": true, "tasks": ["guard.validate"] } } }, "http": { "value": true, "callable": false, "members": { "request": { "callable": true, "tasks": ["http.request"] } } }, "lifecycle": { "value": true, "callable": false, "members": { "output": { "callable": true, "tasks": ["lifecycle.output"] } } }, "mail": { "value": true, "callable": false, "members": { "search": { "callable": true, "tasks": ["mail.search"] }, "send": { "callable": true, "tasks": ["mail.send"] }, "sendNotification": { "callable": true, "tasks": ["mail.send-notification"] } } }, "markdown": { "value": true, "callable": false, "members": { "fromContent": { "callable": true, "tasks": ["markdown.from_content"] }, "toContent": { "callable": true, "tasks": ["markdown.to_content"] } } }, "mediaLibrary": { "value": true, "callable": false, "members": { "createFolder": { "callable": true, "tasks": ["media_library.create_folder"] }, "deleteItem": { "callable": true, "tasks": ["media_library.delete_item"] }, "moveItems": { "callable": true, "tasks": ["media_library.move_items"] }, "updateItem": { "callable": true, "tasks": ["media_library.update_item"] } } }, "money": { "value": true, "callable": false, "members": { "format": { "callable": true, "tasks": ["money.format"] } } }, "notification": { "value": true, "callable": false, "members": { "send": { "callable": true, "tasks": ["notification.send"] }, "sendBulkNotifications": { "callable": true, "tasks": ["notification.send-bulk-notifications"] }, "sendNotification": { "callable": true, "tasks": ["notification.send-notification"] }, "setConsent": { "callable": true, "tasks": ["notification.set-consent"] } } }, "number": { "value": true, "callable": false, "members": { "format": { "callable": true, "tasks": ["number.format"] } } }, "package": { "value": true, "callable": false, "members": { "installInput": { "callable": true, "tasks": ["package.install-input"] } } }, "page": { "value": true, "callable": false, "members": { "url": { "callable": true, "tasks": ["page.url"] } } }, "payables": { "value": true, "callable": false, "members": { "void": { "callable": true, "tasks": ["payables.void"] }, "writeOff": { "callable": true, "tasks": ["payables.write-off"] } } }, "payment": { "value": true, "callable": false, "members": { "createManual": { "callable": true, "tasks": ["payment.create_manual"] } } }, "payments": { "value": true, "callable": false, "members": { "charge": { "callable": true, "tasks": ["payments.charge"] }, "checkout": { "callable": true, "tasks": ["payments.checkout"] }, "confirm": { "callable": true, "tasks": ["payments.confirm"] }, "refund": { "callable": true, "tasks": ["payments.refund"] }, "void": { "callable": true, "tasks": ["payments.void"] } } }, "phone": { "value": true, "callable": false, "members": { "format": { "callable": true, "tasks": ["phone.format"] } } }, "scheduling": { "value": true, "callable": false, "members": { "bookSlot": { "callable": true, "tasks": ["scheduling.book_slot"] }, "findSlots": { "callable": true, "tasks": ["scheduling.find_slots"] } } }, "schema": { "value": true, "callable": false, "members": { "toJsonSchema": { "callable": true, "tasks": ["schema.to_json_schema"] } } }, "security": { "value": true, "callable": false, "members": { "randomPassword": { "callable": true, "tasks": ["security.random_password"] } } }, "sms": { "value": true, "callable": false, "members": { "sendNotification": { "callable": true, "tasks": ["sms.send-notification"] } } }, "subscriptions": { "value": true, "callable": false, "members": { "activate": { "callable": true, "tasks": ["subscriptions.activate"] }, "cancel": { "callable": true, "tasks": ["subscriptions.cancel"] }, "changeItems": { "callable": true, "tasks": ["subscriptions.change_items"] }, "create": { "callable": true, "tasks": ["subscriptions.create"] }, "generateInvoice": { "callable": true, "tasks": ["subscriptions.generate_invoice"] }, "pause": { "callable": true, "tasks": ["subscriptions.pause"] }, "preview": { "callable": true, "tasks": ["subscriptions.preview"] }, "previewChange": { "callable": true, "tasks": ["subscriptions.preview_change"] }, "resume": { "callable": true, "tasks": ["subscriptions.resume"] }, "setUpcomingItems": { "callable": true, "tasks": ["subscriptions.set_upcoming_items"] } } }, "text": { "value": true, "callable": false, "members": { "generate": { "callable": true, "tasks": ["text.generate"] }, "hash": { "callable": true, "tasks": ["text.hash"] }, "randomUuid": { "callable": true, "tasks": ["text.random_uuid"] }, "toContent": { "callable": true, "tasks": ["text.to_content"] } } }, "time": { "value": true, "callable": false, "members": { "add": { "callable": true, "tasks": ["time.add"] }, "diff": { "callable": true, "tasks": ["time.diff"] }, "endOf": { "callable": true, "tasks": ["time.end_of"] }, "format": { "callable": true, "tasks": ["time.format"] }, "startOf": { "callable": true, "tasks": ["time.start_of"] }, "subtract": { "callable": true, "tasks": ["time.subtract"] } } }, "timezone": { "value": true, "callable": false, "members": { "format": { "callable": true, "tasks": ["timezone.format"] }, "interpret": { "callable": true, "tasks": ["timezone.interpret"] } } }, "tiptap": { "value": true, "callable": false, "members": { "parse": { "callable": true, "tasks": ["tiptap.parse"] } } }, "user": { "value": true, "callable": false, "members": { "authorize": { "callable": true, "tasks": ["user.authorize"] } } }, "web": { "value": true, "callable": false, "members": { "agent": { "callable": true, "tasks": ["web.agent"] }, "batchScrape": { "callable": true, "tasks": ["web.batch_scrape"] }, "crawl": { "callable": true, "tasks": ["web.crawl"] }, "extract": { "callable": true, "tasks": ["web.extract"] }, "googleSearch": { "callable": true, "tasks": ["web.google_search"] }, "map": { "callable": true, "tasks": ["web.map"] }, "pdf": { "callable": true, "tasks": ["web.pdf"] }, "scrape": { "callable": true, "tasks": ["web.scrape"] }, "screenshot": { "callable": true, "tasks": ["web.screenshot"] }, "searchRanked": { "callable": true, "tasks": ["web.search_ranked"] } } }, "workflow": { "value": true, "callable": false, "members": { "run": { "callable": true, "tasks": ["workflow.run"] }, "url": { "callable": true, "tasks": ["workflow.url"] } } }, "workspace": { "value": true, "callable": false, "members": { "loginUrl": { "callable": true, "tasks": ["workspace.login_url"] }, "setValue": { "callable": true, "tasks": ["workspace.set_value"] }, "setValues": { "callable": true, "tasks": ["workspace.set_values"] }, "value": { "callable": true, "tasks": ["workspace.value"] }, "values": { "callable": true, "tasks": ["workspace.values"] } } } } }, "ranges": { "data.search": { "page": { "minimum": 1 }, "pageSize": { "minimum": 1, "maximum": 100 } }, "data.count": { "page": { "minimum": 1 }, "pageSize": { "minimum": 1, "maximum": 100 } }, "data.aggregateMetrics": { "limit": { "minimum": 1, "maximum": 1e3 } }, "data.semanticSearch": { "topK": { "minimum": 1, "maximum": 100 } }, "data.sum": { "page": { "minimum": 1 }, "pageSize": { "minimum": 1, "maximum": 100 } }, "mail.search": { "limit": { "minimum": 1, "maximum": 100 } }, "chart.distribution": { "limit": { "minimum": 1, "maximum": 50 } }, "chart.leaderboard": { "limit": { "minimum": 1, "maximum": 100 } }, "chart.timeSeries": { "limit": { "minimum": 1, "maximum": 1e3 } } }, "rangesByType": { "ChartDistributionInput": { "limit": { "minimum": 1, "maximum": 50 } }, "ChartLeaderboardInput": { "limit": { "minimum": 1, "maximum": 100 } }, "ChartTimeSeriesInput": { "limit": { "minimum": 1, "maximum": 1e3 } }, "DataAggregateMetricsInput": { "limit": { "minimum": 1, "maximum": 1e3 } }, "DataCountInput": { "page": { "minimum": 1 }, "pageSize": { "minimum": 1, "maximum": 100 } }, "DataSearchInput": { "page": { "minimum": 1 }, "pageSize": { "minimum": 1, "maximum": 100 } }, "DataSemanticSearchInput": { "topK": { "minimum": 1, "maximum": 100 } }, "DataSumInput": { "page": { "minimum": 1 }, "pageSize": { "minimum": 1, "maximum": 100 } }, "MailSearchInput": { "limit": { "minimum": 1, "maximum": 100 } } }, "liquidSlots": { "mail.send": { "layoutData": ["$references", "content"] }, "notification.send": { "layoutData": ["$references", "content"] } }, "liquidSlotsByType": { "MailSendInput": { "layoutData": ["$references", "content"] }, "NotificationSendInput": { "layoutData": ["$references", "content"] } }, "augmentable": ["WorkspaceFieldCatalog", "WorkspaceNotificationTypes", "WorkspaceResources"] };
1426
+ export {
1427
+ SDK_FILES,
1428
+ SDK_SURFACE
1429
+ };