@zapier/zapier-sdk 0.70.2 → 0.70.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +115 -80
- package/dist/experimental.cjs +163 -37
- package/dist/experimental.d.mts +160 -4
- package/dist/experimental.d.ts +158 -2
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.mjs +162 -38
- package/dist/{index-DjLMJ3w8.d.mts → index-BNaiNmM-.d.mts} +133 -3
- package/dist/{index-DjLMJ3w8.d.ts → index-BNaiNmM-.d.ts} +133 -3
- package/dist/index.cjs +51 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +50 -3
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts +9 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts +9 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts +9 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getDurableRun/index.d.ts +1 -1
- package/dist/plugins/codeSubstrate/getDurableRun/schemas.d.ts +5 -5
- package/dist/plugins/codeSubstrate/getDurableRun/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getDurableRun/schemas.js +2 -1
- package/dist/plugins/codeSubstrate/getTriggerRun/schemas.d.ts +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts +31 -0
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts +42 -0
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.js +20 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts +9 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowRun/schemas.d.ts +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts +35 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.d.ts +13 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowVersion/schemas.js +10 -0
- package/dist/plugins/codeSubstrate/listDurableRuns/schemas.d.ts +3 -3
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts +9 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowRuns/schemas.d.ts +3 -3
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts +22 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.d.ts +26 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowVersions/schemas.js +10 -0
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts +9 -0
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts +32 -0
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.js +11 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts +22 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts +14 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.js +11 -44
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts +6 -0
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/runDurable/index.js +3 -0
- package/dist/plugins/codeSubstrate/runDurable/schemas.d.ts +12 -0
- package/dist/plugins/codeSubstrate/runDurable/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/runDurable/schemas.js +33 -0
- package/dist/plugins/codeSubstrate/shared-schemas.d.ts +37 -0
- package/dist/plugins/codeSubstrate/shared-schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/shared-schemas.js +69 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.d.ts +9 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts +11 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.d.ts +2 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/updateWorkflow/schemas.js +7 -0
- package/dist/plugins/eventEmission/builders.d.ts.map +1 -1
- package/dist/plugins/eventEmission/builders.js +7 -2
- package/dist/plugins/eventEmission/utils.d.ts +54 -0
- package/dist/plugins/eventEmission/utils.d.ts.map +1 -1
- package/dist/plugins/eventEmission/utils.js +97 -0
- package/dist/types/telemetry-events.d.ts +7 -0
- package/dist/types/telemetry-events.d.ts.map +1 -1
- package/dist/types/telemetry-events.js +2 -0
- package/package.json +1 -1
package/dist/experimental.cjs
CHANGED
|
@@ -3188,7 +3188,7 @@ function createSseParserStream() {
|
|
|
3188
3188
|
}
|
|
3189
3189
|
|
|
3190
3190
|
// src/sdk-version.ts
|
|
3191
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.70.
|
|
3191
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.70.4" : void 0) || "unknown";
|
|
3192
3192
|
|
|
3193
3193
|
// src/utils/open-url.ts
|
|
3194
3194
|
var nodePrefix = "node:";
|
|
@@ -8937,6 +8937,48 @@ function getCpuTime() {
|
|
|
8937
8937
|
}
|
|
8938
8938
|
return null;
|
|
8939
8939
|
}
|
|
8940
|
+
function getTtyContext() {
|
|
8941
|
+
try {
|
|
8942
|
+
const proc = globalThis.process;
|
|
8943
|
+
if (!proc) return { stdin_is_tty: null, stdout_is_tty: null };
|
|
8944
|
+
return {
|
|
8945
|
+
stdin_is_tty: proc.stdin?.isTTY === true,
|
|
8946
|
+
stdout_is_tty: proc.stdout?.isTTY === true
|
|
8947
|
+
};
|
|
8948
|
+
} catch {
|
|
8949
|
+
return { stdin_is_tty: null, stdout_is_tty: null };
|
|
8950
|
+
}
|
|
8951
|
+
}
|
|
8952
|
+
var isTruthy = (value) => {
|
|
8953
|
+
const lower = value.toLowerCase();
|
|
8954
|
+
return lower === "1" || lower === "true";
|
|
8955
|
+
};
|
|
8956
|
+
var isNonEmpty = (value) => value !== "";
|
|
8957
|
+
var agentDetectors = [
|
|
8958
|
+
{ name: "claude-code", key: "CLAUDECODE", predicate: isTruthy },
|
|
8959
|
+
{ name: "github-copilot", key: "COPILOT_AGENT", predicate: isTruthy },
|
|
8960
|
+
{ name: "cursor", key: "CURSOR_AGENT", predicate: isTruthy },
|
|
8961
|
+
{ name: "codex", key: "CODEX_SANDBOX", predicate: isNonEmpty },
|
|
8962
|
+
{ name: "gemini-cli", key: "GEMINI_CLI", predicate: isTruthy },
|
|
8963
|
+
{ name: "augment", key: "AUGMENT_AGENT", predicate: isTruthy },
|
|
8964
|
+
{ name: "cline", key: "CLINE_ACTIVE", predicate: isTruthy },
|
|
8965
|
+
{ name: "opencode", key: "OPENCODE_CLIENT", predicate: isNonEmpty }
|
|
8966
|
+
];
|
|
8967
|
+
function getAgent() {
|
|
8968
|
+
try {
|
|
8969
|
+
const env = globalThis.process?.env;
|
|
8970
|
+
if (!env) return null;
|
|
8971
|
+
for (const detector of agentDetectors) {
|
|
8972
|
+
const value = env[detector.key];
|
|
8973
|
+
if (value !== void 0 && detector.predicate(value)) {
|
|
8974
|
+
return detector.name;
|
|
8975
|
+
}
|
|
8976
|
+
}
|
|
8977
|
+
return null;
|
|
8978
|
+
} catch {
|
|
8979
|
+
return null;
|
|
8980
|
+
}
|
|
8981
|
+
}
|
|
8940
8982
|
|
|
8941
8983
|
// src/plugins/eventEmission/builders.ts
|
|
8942
8984
|
function createBaseEvent(context = {}) {
|
|
@@ -8961,6 +9003,7 @@ function buildErrorEvent(data, context = {}) {
|
|
|
8961
9003
|
app_version_id: context.app_version_id,
|
|
8962
9004
|
environment: context.environment,
|
|
8963
9005
|
...data,
|
|
9006
|
+
agent: getAgent(),
|
|
8964
9007
|
sdk_version: SDK_VERSION
|
|
8965
9008
|
};
|
|
8966
9009
|
}
|
|
@@ -8982,6 +9025,8 @@ function buildApplicationLifecycleEvent(data, context = {}) {
|
|
|
8982
9025
|
environment: context.environment ?? (globalThis.process?.env?.NODE_ENV || null),
|
|
8983
9026
|
is_ci_environment: isCi(),
|
|
8984
9027
|
ci_platform: getCiPlatform(),
|
|
9028
|
+
...getTtyContext(),
|
|
9029
|
+
agent: getAgent(),
|
|
8985
9030
|
session_id: null,
|
|
8986
9031
|
metadata: null,
|
|
8987
9032
|
process_argv: globalThis.process?.argv || null,
|
|
@@ -9001,6 +9046,7 @@ function buildErrorEventWithContext(data, context = {}) {
|
|
|
9001
9046
|
environment: context.environment ?? (globalThis.process?.env?.NODE_ENV || null),
|
|
9002
9047
|
execution_time_before_error_ms: executionTime,
|
|
9003
9048
|
...data,
|
|
9049
|
+
agent: getAgent(),
|
|
9004
9050
|
sdk_version: SDK_VERSION
|
|
9005
9051
|
};
|
|
9006
9052
|
}
|
|
@@ -9015,7 +9061,7 @@ function buildMethodCalledEvent(data, context = {}) {
|
|
|
9015
9061
|
error_type: data.error_type ?? null,
|
|
9016
9062
|
argument_count: data.argument_count,
|
|
9017
9063
|
is_paginated: data.is_paginated ?? false,
|
|
9018
|
-
environment: context.environment ?? (process?.env?.NODE_ENV || null),
|
|
9064
|
+
environment: context.environment ?? (globalThis.process?.env?.NODE_ENV || null),
|
|
9019
9065
|
selected_api: data.selected_api ?? context.selected_api ?? null,
|
|
9020
9066
|
app_id: context.app_id ?? null,
|
|
9021
9067
|
app_version_id: context.app_version_id ?? null,
|
|
@@ -9033,6 +9079,7 @@ function buildMethodCalledEvent(data, context = {}) {
|
|
|
9033
9079
|
is_synchronous: false,
|
|
9034
9080
|
cpu_time_ms: null,
|
|
9035
9081
|
memory_usage_bytes: null,
|
|
9082
|
+
agent: getAgent(),
|
|
9036
9083
|
sdk_version: SDK_VERSION
|
|
9037
9084
|
};
|
|
9038
9085
|
}
|
|
@@ -11150,6 +11197,52 @@ var codeSubstrateDefaults = {
|
|
|
11150
11197
|
categories: ["code-workflow"],
|
|
11151
11198
|
experimental: true
|
|
11152
11199
|
};
|
|
11200
|
+
var ConnectionBindingSchema = zod.z.object({
|
|
11201
|
+
connection_id: zod.z.union([
|
|
11202
|
+
zod.z.number().int().positive(),
|
|
11203
|
+
zod.z.string().regex(/^[1-9][0-9]*$/, "must be a positive integer string"),
|
|
11204
|
+
zod.z.string().uuid("must be a UUID")
|
|
11205
|
+
]).describe(
|
|
11206
|
+
"Zapier connection ID. Positive integer (legacy) or UUID string (newer)."
|
|
11207
|
+
)
|
|
11208
|
+
}).describe(
|
|
11209
|
+
"Connection binding: maps a single alias to a concrete connection."
|
|
11210
|
+
);
|
|
11211
|
+
var AppVersionBindingSchema = zod.z.object({
|
|
11212
|
+
implementation_name: zod.z.string().describe("App implementation identifier (e.g. 'SlackCLIAPI')"),
|
|
11213
|
+
version: zod.z.string().optional().describe("App implementation version (e.g. '1.27.1')")
|
|
11214
|
+
}).describe("App-version binding: maps a single alias to an app version.");
|
|
11215
|
+
var WorkflowVersionTriggerConfigSchema = zod.z.object({
|
|
11216
|
+
selected_api: zod.z.string().describe("Zapier app/API identifier (e.g. 'GoogleSheetsAPI')"),
|
|
11217
|
+
action: zod.z.string().describe("Trigger action key (e.g. 'new_row')"),
|
|
11218
|
+
authentication_id: zod.z.string().nullish().describe(
|
|
11219
|
+
"Connection ID for the trigger source. Omit or pass null for no-auth triggers (e.g. Schedule by Zapier)."
|
|
11220
|
+
),
|
|
11221
|
+
params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Trigger parameters as a JSON object")
|
|
11222
|
+
}).describe("Trigger configuration persisted on a workflow version.");
|
|
11223
|
+
var WorkflowTriggerStatusSchema = zod.z.enum([
|
|
11224
|
+
"unclaimed",
|
|
11225
|
+
"pending",
|
|
11226
|
+
"active",
|
|
11227
|
+
"releasing",
|
|
11228
|
+
"released",
|
|
11229
|
+
"failed"
|
|
11230
|
+
]);
|
|
11231
|
+
var WorkflowTriggerSchema = zod.z.object({
|
|
11232
|
+
selected_api: zod.z.string().describe("Zapier app/API identifier (e.g. 'GoogleSheetsAPI')"),
|
|
11233
|
+
action: zod.z.string().describe("Trigger action key (e.g. 'new_row')"),
|
|
11234
|
+
authentication_id: zod.z.string().nullish().describe(
|
|
11235
|
+
"Connection ID for the trigger source. Null for no-auth triggers."
|
|
11236
|
+
),
|
|
11237
|
+
params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Trigger parameters as a JSON object"),
|
|
11238
|
+
status: WorkflowTriggerStatusSchema.describe(
|
|
11239
|
+
"Live trigger claim status \u2014 whether the trigger is currently subscribed to its source."
|
|
11240
|
+
)
|
|
11241
|
+
}).describe(
|
|
11242
|
+
"Trigger from a workflow's current version, combined with the live claim status."
|
|
11243
|
+
);
|
|
11244
|
+
|
|
11245
|
+
// src/plugins/codeSubstrate/listWorkflows/schemas.ts
|
|
11153
11246
|
var WorkflowItemSchema = zod.z.object({
|
|
11154
11247
|
id: zod.z.string().describe("Workflow ID (UUID)"),
|
|
11155
11248
|
name: zod.z.string().describe("Workflow name"),
|
|
@@ -11158,9 +11251,16 @@ var WorkflowItemSchema = zod.z.object({
|
|
|
11158
11251
|
"Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path \u2014 treat as sensitive."
|
|
11159
11252
|
),
|
|
11160
11253
|
enabled: zod.z.boolean().describe("Whether the workflow currently accepts triggers"),
|
|
11254
|
+
is_private: zod.z.boolean().describe(
|
|
11255
|
+
"Whether the workflow is private to the creating user. False means account-visible."
|
|
11256
|
+
),
|
|
11257
|
+
created_by_user_id: zod.z.string().nullable().describe("User ID of the workflow creator (null in legacy data)"),
|
|
11161
11258
|
current_version_id: zod.z.string().nullable().describe(
|
|
11162
11259
|
"ID of the workflow version that runs handle. Null until a version is published."
|
|
11163
11260
|
),
|
|
11261
|
+
triggers: zod.z.array(WorkflowTriggerSchema).describe(
|
|
11262
|
+
"Trigger configurations from the current version, with live claim status. Empty array when the workflow has no triggers."
|
|
11263
|
+
),
|
|
11164
11264
|
created_at: zod.z.string().describe("When the workflow was created (ISO-8601)"),
|
|
11165
11265
|
updated_at: zod.z.string().describe("When the workflow was last modified (ISO-8601)")
|
|
11166
11266
|
});
|
|
@@ -11219,7 +11319,12 @@ var WorkflowVersionSchema = zod.z.object({
|
|
|
11219
11319
|
// Backend column is NOT NULL (see durableworkflowzaps prisma schema:
|
|
11220
11320
|
// workflow_versions.created_by_user_id), so this is always emitted.
|
|
11221
11321
|
created_by_user_id: zod.z.string().describe("ID of the user who published this version"),
|
|
11222
|
-
created_at: zod.z.string().describe("When the version was published (ISO-8601)")
|
|
11322
|
+
created_at: zod.z.string().describe("When the version was published (ISO-8601)"),
|
|
11323
|
+
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
11324
|
+
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
11325
|
+
),
|
|
11326
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
11327
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema).nullable().describe("App-version pins bound on this version (or null).")
|
|
11223
11328
|
});
|
|
11224
11329
|
var GetWorkflowOptionsSchema = zod.z.object({
|
|
11225
11330
|
workflow: zod.z.string().uuid().describe("Durable workflow ID")
|
|
@@ -11234,9 +11339,16 @@ var GetWorkflowResponseSchema = zod.z.object({
|
|
|
11234
11339
|
"Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path \u2014 treat as sensitive."
|
|
11235
11340
|
),
|
|
11236
11341
|
enabled: zod.z.boolean().describe("Whether the workflow currently accepts triggers"),
|
|
11342
|
+
is_private: zod.z.boolean().describe(
|
|
11343
|
+
"Whether the workflow is private to the creating user. False means account-visible."
|
|
11344
|
+
),
|
|
11345
|
+
created_by_user_id: zod.z.string().nullable().describe("User ID of the workflow creator (null in legacy data)"),
|
|
11237
11346
|
current_version: WorkflowVersionSchema.optional().describe(
|
|
11238
11347
|
"The currently published version, if any. Absent for workflows with no version published yet."
|
|
11239
11348
|
),
|
|
11349
|
+
triggers: zod.z.array(WorkflowTriggerSchema).describe(
|
|
11350
|
+
"Trigger configurations from the current version, with live claim status. Empty array when the workflow has no triggers."
|
|
11351
|
+
),
|
|
11240
11352
|
created_at: zod.z.string().describe("When the workflow was created (ISO-8601)"),
|
|
11241
11353
|
updated_at: zod.z.string().describe("When the workflow was last modified (ISO-8601)")
|
|
11242
11354
|
});
|
|
@@ -11332,6 +11444,10 @@ var UpdateWorkflowResponseSchema = zod.z.object({
|
|
|
11332
11444
|
"Public webhook URL that fires this workflow when POSTed to. Embeds a secret trigger token in the path \u2014 treat as sensitive."
|
|
11333
11445
|
),
|
|
11334
11446
|
enabled: zod.z.boolean().describe("Whether the workflow currently accepts triggers"),
|
|
11447
|
+
is_private: zod.z.boolean().describe(
|
|
11448
|
+
"Whether the workflow is private to the creating user. False means account-visible."
|
|
11449
|
+
),
|
|
11450
|
+
created_by_user_id: zod.z.string().nullable().describe("User ID of the workflow creator (null in legacy data)"),
|
|
11335
11451
|
created_at: zod.z.string().describe("When the workflow was created (ISO-8601)"),
|
|
11336
11452
|
updated_at: zod.z.string().describe("When this update was applied (ISO-8601)")
|
|
11337
11453
|
});
|
|
@@ -11598,7 +11714,9 @@ var ExecutionSummarySchema = zod.z.object({
|
|
|
11598
11714
|
code: zod.z.string().describe("Machine-readable error category"),
|
|
11599
11715
|
title: zod.z.string().describe("Short error label"),
|
|
11600
11716
|
detail: zod.z.string().nullable().optional().describe("Longer-form error detail, when provided")
|
|
11601
|
-
}).passthrough().optional().describe(
|
|
11717
|
+
}).passthrough().nullable().optional().describe(
|
|
11718
|
+
"The most recent error; null when the execution has not errored."
|
|
11719
|
+
)
|
|
11602
11720
|
}).passthrough().nullable().optional().describe(
|
|
11603
11721
|
"Aggregate health summary. Null when no attempts have been recorded yet."
|
|
11604
11722
|
),
|
|
@@ -11665,6 +11783,19 @@ var AppVersionMapEntrySchema = zod.z.object({
|
|
|
11665
11783
|
implementation_name: zod.z.string().min(1).describe("Zapier app implementation name (e.g. `SlackCLIAPI`)"),
|
|
11666
11784
|
version: zod.z.string().optional().describe("Pinned app version (e.g. `1.27.1`). Latest if omitted.")
|
|
11667
11785
|
});
|
|
11786
|
+
var RunNotificationEventSchema = zod.z.enum(["started", "progress", "completed", "error", "cancelled"]).describe("Run lifecycle event this notification subscribes to");
|
|
11787
|
+
var RunNotificationSchema = zod.z.object({
|
|
11788
|
+
type: zod.z.literal("webhook").optional().describe("Notification transport. Webhook is the only supported type."),
|
|
11789
|
+
url: zod.z.string().url().describe(
|
|
11790
|
+
"URL to POST event notifications to. Payload is `{run_id, event}`."
|
|
11791
|
+
),
|
|
11792
|
+
max_retries: zod.z.number().int().min(0).max(10).optional().describe(
|
|
11793
|
+
"Max delivery attempts with exponential backoff. Defaults to 3 server-side."
|
|
11794
|
+
),
|
|
11795
|
+
events: zod.z.array(RunNotificationEventSchema).min(1).describe("One or more lifecycle events to subscribe this URL to.")
|
|
11796
|
+
}).describe(
|
|
11797
|
+
"Webhook subscriber for run lifecycle events. Server POSTs `{run_id, event}` on each subscribed transition."
|
|
11798
|
+
);
|
|
11668
11799
|
var RunDurableOptionsSchema = zod.z.object({
|
|
11669
11800
|
source_files: zod.z.record(zod.z.string(), zod.z.string()).refine((files) => Object.keys(files).length > 0, {
|
|
11670
11801
|
message: "source_files must contain at least one file"
|
|
@@ -11680,7 +11811,10 @@ var RunDurableOptionsSchema = zod.z.object({
|
|
|
11680
11811
|
app_versions: zod.z.record(zod.z.string(), AppVersionMapEntrySchema).optional().describe(
|
|
11681
11812
|
"Pinned app versions. Maps app keys (slugs) to implementation names and versions."
|
|
11682
11813
|
),
|
|
11683
|
-
private: zod.z.boolean().optional().describe("Only the creating user can see the run (default false)")
|
|
11814
|
+
private: zod.z.boolean().optional().describe("Only the creating user can see the run (default false)"),
|
|
11815
|
+
notifications: zod.z.array(RunNotificationSchema).optional().describe(
|
|
11816
|
+
"Webhook subscribers for run lifecycle events. Each entry specifies a URL and the events it subscribes to."
|
|
11817
|
+
)
|
|
11684
11818
|
}).describe(
|
|
11685
11819
|
"Run a workflow source file as a run-once durable run on sdkdurableapi (no deployed workflow required). Returns the run ID immediately; poll via getDurableRun for terminal status."
|
|
11686
11820
|
);
|
|
@@ -11726,6 +11860,9 @@ var runDurablePlugin = definePlugin(
|
|
|
11726
11860
|
if (options.private !== void 0) {
|
|
11727
11861
|
body.is_private = options.private;
|
|
11728
11862
|
}
|
|
11863
|
+
if (options.notifications !== void 0) {
|
|
11864
|
+
body.notifications = options.notifications;
|
|
11865
|
+
}
|
|
11729
11866
|
const raw = await sdk2.context.api.post(
|
|
11730
11867
|
"/sdkdurableapi/api/v0/runs",
|
|
11731
11868
|
body,
|
|
@@ -11773,34 +11910,6 @@ var cancelDurableRunPlugin = definePlugin(
|
|
|
11773
11910
|
}
|
|
11774
11911
|
})
|
|
11775
11912
|
);
|
|
11776
|
-
var CONNECTION_ID_PATTERN = /^([1-9][0-9]*|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
11777
|
-
var ConnectionBindingSchema = zod.z.object({
|
|
11778
|
-
connection_id: zod.z.union([
|
|
11779
|
-
zod.z.number().int().positive(),
|
|
11780
|
-
zod.z.string().regex(
|
|
11781
|
-
CONNECTION_ID_PATTERN,
|
|
11782
|
-
"connection_id must be a positive integer string or UUID"
|
|
11783
|
-
)
|
|
11784
|
-
]).describe(
|
|
11785
|
-
"Zapier connection ID. Positive integer (legacy) or UUID string (newer)."
|
|
11786
|
-
)
|
|
11787
|
-
}).describe(
|
|
11788
|
-
"Connection binding: maps a single alias to a concrete connection."
|
|
11789
|
-
);
|
|
11790
|
-
var AppVersionBindingSchema = zod.z.object({
|
|
11791
|
-
implementation_name: zod.z.string().describe("App implementation identifier (e.g. 'SlackCLIAPI')"),
|
|
11792
|
-
version: zod.z.string().optional().describe("App implementation version (e.g. '1.27.1')")
|
|
11793
|
-
}).describe("App-version binding: maps a single alias to an app version.");
|
|
11794
|
-
var TriggerConfigSchema = zod.z.object({
|
|
11795
|
-
selected_api: zod.z.string().describe("Zapier app/API identifier (e.g. 'GoogleSheetsAPI')"),
|
|
11796
|
-
action: zod.z.string().describe("Trigger action key (e.g. 'new_row')"),
|
|
11797
|
-
authentication_id: zod.z.string().nullish().describe(
|
|
11798
|
-
"Connection ID for the trigger source. Omit or pass null for no-auth triggers (e.g. Schedule by Zapier)."
|
|
11799
|
-
),
|
|
11800
|
-
params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Trigger parameters as a JSON object")
|
|
11801
|
-
}).describe(
|
|
11802
|
-
"Zapier trigger configuration. When set, the workflow subscribes to trigger events."
|
|
11803
|
-
);
|
|
11804
11913
|
var PublishWorkflowVersionOptionsSchema = zod.z.object({
|
|
11805
11914
|
workflow: zod.z.string().uuid().describe("Durable workflow ID"),
|
|
11806
11915
|
source_files: zod.z.record(zod.z.string(), zod.z.string()).refine((files) => Object.keys(files).length > 0, {
|
|
@@ -11819,7 +11928,7 @@ var PublishWorkflowVersionOptionsSchema = zod.z.object({
|
|
|
11819
11928
|
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema).nullish().describe(
|
|
11820
11929
|
"Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding."
|
|
11821
11930
|
),
|
|
11822
|
-
trigger:
|
|
11931
|
+
trigger: WorkflowVersionTriggerConfigSchema.optional().describe(
|
|
11823
11932
|
"Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; omit for webhook-only workflows."
|
|
11824
11933
|
)
|
|
11825
11934
|
}).describe(
|
|
@@ -11834,7 +11943,12 @@ var PublishWorkflowVersionResponseSchema = zod.z.object({
|
|
|
11834
11943
|
),
|
|
11835
11944
|
dependencies: zod.z.record(zod.z.string(), zod.z.string()).nullable().describe("Additional npm dependencies pinned for this version (or null)"),
|
|
11836
11945
|
created_by_user_id: zod.z.string().describe("ID of the user who published this version"),
|
|
11837
|
-
created_at: zod.z.string().describe("When the version was published (ISO-8601)")
|
|
11946
|
+
created_at: zod.z.string().describe("When the version was published (ISO-8601)"),
|
|
11947
|
+
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
11948
|
+
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
11949
|
+
),
|
|
11950
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
11951
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema).nullable().describe("App-version pins bound on this version (or null).")
|
|
11838
11952
|
});
|
|
11839
11953
|
|
|
11840
11954
|
// src/plugins/codeSubstrate/publishWorkflowVersion/index.ts
|
|
@@ -11890,7 +12004,12 @@ var WorkflowVersionListItemSchema = zod.z.object({
|
|
|
11890
12004
|
),
|
|
11891
12005
|
dependencies: zod.z.record(zod.z.string(), zod.z.string()).nullable().describe("Additional npm dependencies pinned for this version (or null)"),
|
|
11892
12006
|
created_by_user_id: zod.z.string().describe("ID of the user who published this version"),
|
|
11893
|
-
created_at: zod.z.string().describe("When the version was published (ISO-8601)")
|
|
12007
|
+
created_at: zod.z.string().describe("When the version was published (ISO-8601)"),
|
|
12008
|
+
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
12009
|
+
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
12010
|
+
),
|
|
12011
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
12012
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema).nullable().describe("App-version pins bound on this version (or null).")
|
|
11894
12013
|
});
|
|
11895
12014
|
var ListWorkflowVersionsOptionsSchema = zod.z.object({
|
|
11896
12015
|
workflow: zod.z.string().uuid().describe("Durable workflow ID"),
|
|
@@ -11958,7 +12077,12 @@ var GetWorkflowVersionResponseSchema = zod.z.object({
|
|
|
11958
12077
|
),
|
|
11959
12078
|
dependencies: zod.z.record(zod.z.string(), zod.z.string()).nullable().describe("Additional npm dependencies pinned for this version (or null)"),
|
|
11960
12079
|
created_by_user_id: zod.z.string().describe("ID of the user who published this version"),
|
|
11961
|
-
created_at: zod.z.string().describe("When the version was published (ISO-8601)")
|
|
12080
|
+
created_at: zod.z.string().describe("When the version was published (ISO-8601)"),
|
|
12081
|
+
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
12082
|
+
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
12083
|
+
),
|
|
12084
|
+
connections: zod.z.record(zod.z.string(), ConnectionBindingSchema).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
12085
|
+
app_versions: zod.z.record(zod.z.string(), AppVersionBindingSchema).nullable().describe("App-version pins bound on this version (or null).")
|
|
11962
12086
|
});
|
|
11963
12087
|
|
|
11964
12088
|
// src/plugins/codeSubstrate/getWorkflowVersion/index.ts
|
|
@@ -12523,6 +12647,7 @@ exports.formatErrorMessage = formatErrorMessage;
|
|
|
12523
12647
|
exports.generateEventId = generateEventId;
|
|
12524
12648
|
exports.getActionInputFieldsSchemaPlugin = getActionInputFieldsSchemaPlugin;
|
|
12525
12649
|
exports.getActionPlugin = getActionPlugin;
|
|
12650
|
+
exports.getAgent = getAgent;
|
|
12526
12651
|
exports.getAppPlugin = getAppPlugin;
|
|
12527
12652
|
exports.getBaseUrlFromCredentials = getBaseUrlFromCredentials;
|
|
12528
12653
|
exports.getCiPlatform = getCiPlatform;
|
|
@@ -12542,6 +12667,7 @@ exports.getReleaseId = getReleaseId;
|
|
|
12542
12667
|
exports.getTablePlugin = getTablePlugin;
|
|
12543
12668
|
exports.getTableRecordPlugin = getTableRecordPlugin;
|
|
12544
12669
|
exports.getTokenFromCliLogin = getTokenFromCliLogin;
|
|
12670
|
+
exports.getTtyContext = getTtyContext;
|
|
12545
12671
|
exports.getZapierApprovalMode = getZapierApprovalMode;
|
|
12546
12672
|
exports.getZapierDefaultApprovalMode = getZapierDefaultApprovalMode;
|
|
12547
12673
|
exports.getZapierSdkService = getZapierSdkService;
|