@zapier/zapier-sdk 0.90.0 → 0.91.1
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 +21 -0
- package/README.md +156 -96
- package/dist/{chunk-J7Z7UHXP.mjs → chunk-22USOWAR.mjs} +11 -5
- package/dist/{chunk-LQEV6ICY.cjs → chunk-6HEA7RSA.cjs} +11 -5
- package/dist/experimental.cjs +474 -401
- package/dist/experimental.d.mts +124 -1
- package/dist/experimental.d.ts +124 -1
- package/dist/experimental.mjs +111 -38
- package/dist/index.cjs +272 -272
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/experimental.d.mts
CHANGED
|
@@ -3265,6 +3265,68 @@ declare const zapierExperimentalSdkPlugin: AggregatePlugin<"experimental-sdk", {
|
|
|
3265
3265
|
}> | null;
|
|
3266
3266
|
};
|
|
3267
3267
|
}>, readonly []> & LeafSummary<"", "discardWorkflowDraft", readonly [PropertyPlugin<"api", ApiClient> & PluginSummary<"zapier/api", never>]>;
|
|
3268
|
+
} & {
|
|
3269
|
+
publishWorkflowDraft: MethodPlugin<"publishWorkflowDraft", {
|
|
3270
|
+
workflow: string;
|
|
3271
|
+
draft: string;
|
|
3272
|
+
enabled?: boolean | undefined;
|
|
3273
|
+
draftRevision?: number | undefined;
|
|
3274
|
+
}, Promise<{
|
|
3275
|
+
data: {
|
|
3276
|
+
draft: {
|
|
3277
|
+
id: string;
|
|
3278
|
+
workflow_id: string;
|
|
3279
|
+
slug: string;
|
|
3280
|
+
base_version_id: string | null;
|
|
3281
|
+
source_files: Record<string, string>;
|
|
3282
|
+
zapier_durable_version: string;
|
|
3283
|
+
dependencies: Record<string, string> | null;
|
|
3284
|
+
draft_revision: number;
|
|
3285
|
+
status: "open" | "discarded";
|
|
3286
|
+
created_by_user_id: string;
|
|
3287
|
+
last_edited_by_user_id: string | null;
|
|
3288
|
+
last_edited_at: string | null;
|
|
3289
|
+
discarded_at: string | null;
|
|
3290
|
+
created_at: string;
|
|
3291
|
+
updated_at: string;
|
|
3292
|
+
trigger: {
|
|
3293
|
+
selected_api: string;
|
|
3294
|
+
action: string;
|
|
3295
|
+
authentication_id?: string | null | undefined;
|
|
3296
|
+
params?: Record<string, unknown> | undefined;
|
|
3297
|
+
} | null;
|
|
3298
|
+
connections: Record<string, {
|
|
3299
|
+
connection_id: string | number;
|
|
3300
|
+
}> | null;
|
|
3301
|
+
app_versions: Record<string, {
|
|
3302
|
+
implementation_name: string;
|
|
3303
|
+
version?: string | undefined;
|
|
3304
|
+
}> | null;
|
|
3305
|
+
};
|
|
3306
|
+
version: {
|
|
3307
|
+
id: string;
|
|
3308
|
+
workflow_id: string;
|
|
3309
|
+
source_files: Record<string, string>;
|
|
3310
|
+
zapier_durable_version: string;
|
|
3311
|
+
dependencies: Record<string, string> | null;
|
|
3312
|
+
created_by_user_id: string;
|
|
3313
|
+
created_at: string;
|
|
3314
|
+
trigger: {
|
|
3315
|
+
selected_api: string;
|
|
3316
|
+
action: string;
|
|
3317
|
+
authentication_id?: string | null | undefined;
|
|
3318
|
+
params?: Record<string, unknown> | undefined;
|
|
3319
|
+
} | null;
|
|
3320
|
+
connections: Record<string, {
|
|
3321
|
+
connection_id: string | number;
|
|
3322
|
+
}> | null;
|
|
3323
|
+
app_versions: Record<string, {
|
|
3324
|
+
implementation_name: string;
|
|
3325
|
+
version?: string | undefined;
|
|
3326
|
+
}> | null;
|
|
3327
|
+
};
|
|
3328
|
+
};
|
|
3329
|
+
}>, readonly []> & LeafSummary<"", "publishWorkflowDraft", readonly [PropertyPlugin<"api", ApiClient> & PluginSummary<"zapier/api", never>]>;
|
|
3268
3330
|
} & {
|
|
3269
3331
|
listWorkflowRuns: MethodPlugin<"listWorkflowRuns", {
|
|
3270
3332
|
workflow: string;
|
|
@@ -3487,7 +3549,7 @@ declare const zapierExperimentalSdkPlugin: AggregatePlugin<"experimental-sdk", {
|
|
|
3487
3549
|
updated_at: string;
|
|
3488
3550
|
};
|
|
3489
3551
|
}>, readonly []> & LeafSummary<"", "getTriggerRun", readonly [PropertyPlugin<"api", ApiClient> & PluginSummary<"zapier/api", never>]>;
|
|
3490
|
-
}> & PluginSummary<never, "fetch" | "zapier/api" | "zapier/manifest" | "zapier/eventEmission" | "zapier/resolveCredentials" | "zapier/connections" | "zapier/capabilities" | "getProfile" | "listApps" | "apps" | "getApp" | "listActions" | "getAction" | "listConnections" | "getConnection" | "findFirstConnection" | "findUniqueConnection" | "listAuthentications" | "getAuthentication" | "findFirstAuthentication" | "findUniqueAuthentication" | "listClientCredentials" | "createClientCredentials" | "deleteClientCredentials" | "getConnectionStartUrl" | "waitForNewConnection" | "createConnection" | "listActionInputFields" | "getActionInputFieldsSchema" | "listActionInputFieldChoices" | "listInputFields" | "getInputFieldsSchema" | "listInputFieldChoices" | "runAction" | "request" | "listTriggerInboxes" | "createTriggerInbox" | "ensureTriggerInbox" | "getTriggerInbox" | "updateTriggerInbox" | "deleteTriggerInbox" | "pauseTriggerInbox" | "resumeTriggerInbox" | "listTriggerInboxMessages" | "leaseTriggerInboxMessages" | "ackTriggerInboxMessages" | "releaseTriggerInboxMessages" | "drainTriggerInbox" | "watchTriggerInbox" | "listTriggers" | "listTriggerInputFields" | "listTriggerInputFieldChoices" | "getTriggerInputFieldsSchema" | "listTables" | "listTablesInternal" | "getTable" | "deleteTable" | "createTable" | "listTableFields" | "createTableFields" | "deleteTableFields" | "listTableRecords" | "getTableRecord" | "createTableRecords" | "deleteTableRecords" | "updateTableRecords" | "kitcore/getRegistry" | "listWorkflows" | "getWorkflow" | "createWorkflow" | "updateWorkflow" | "enableWorkflow" | "disableWorkflow" | "deleteWorkflow" | "listWorkflowVersions" | "getWorkflowVersion" | "publishWorkflowVersion" | "listWorkflowDrafts" | "getWorkflowDraft" | "createWorkflowDraft" | "updateWorkflowDraft" | "discardWorkflowDraft" | "listWorkflowRuns" | "getWorkflowRun" | "listDurableRuns" | "getDurableRun" | "runDurable" | "cancelDurableRun" | "triggerWorkflow" | "getTriggerRun" | "zapier/sdk" | "zapier/experimental-sdk">;
|
|
3552
|
+
}> & PluginSummary<never, "fetch" | "zapier/api" | "zapier/manifest" | "zapier/eventEmission" | "zapier/resolveCredentials" | "zapier/connections" | "zapier/capabilities" | "getProfile" | "listApps" | "apps" | "getApp" | "listActions" | "getAction" | "listConnections" | "getConnection" | "findFirstConnection" | "findUniqueConnection" | "listAuthentications" | "getAuthentication" | "findFirstAuthentication" | "findUniqueAuthentication" | "listClientCredentials" | "createClientCredentials" | "deleteClientCredentials" | "getConnectionStartUrl" | "waitForNewConnection" | "createConnection" | "listActionInputFields" | "getActionInputFieldsSchema" | "listActionInputFieldChoices" | "listInputFields" | "getInputFieldsSchema" | "listInputFieldChoices" | "runAction" | "request" | "listTriggerInboxes" | "createTriggerInbox" | "ensureTriggerInbox" | "getTriggerInbox" | "updateTriggerInbox" | "deleteTriggerInbox" | "pauseTriggerInbox" | "resumeTriggerInbox" | "listTriggerInboxMessages" | "leaseTriggerInboxMessages" | "ackTriggerInboxMessages" | "releaseTriggerInboxMessages" | "drainTriggerInbox" | "watchTriggerInbox" | "listTriggers" | "listTriggerInputFields" | "listTriggerInputFieldChoices" | "getTriggerInputFieldsSchema" | "listTables" | "listTablesInternal" | "getTable" | "deleteTable" | "createTable" | "listTableFields" | "createTableFields" | "deleteTableFields" | "listTableRecords" | "getTableRecord" | "createTableRecords" | "deleteTableRecords" | "updateTableRecords" | "kitcore/getRegistry" | "listWorkflows" | "getWorkflow" | "createWorkflow" | "updateWorkflow" | "enableWorkflow" | "disableWorkflow" | "deleteWorkflow" | "listWorkflowVersions" | "getWorkflowVersion" | "publishWorkflowVersion" | "listWorkflowDrafts" | "getWorkflowDraft" | "createWorkflowDraft" | "updateWorkflowDraft" | "discardWorkflowDraft" | "publishWorkflowDraft" | "listWorkflowRuns" | "getWorkflowRun" | "listDurableRuns" | "getDurableRun" | "runDurable" | "cancelDurableRun" | "triggerWorkflow" | "getTriggerRun" | "zapier/sdk" | "zapier/experimental-sdk">;
|
|
3491
3553
|
declare function createZapierSdk(options?: ZapierSdkOptions): {
|
|
3492
3554
|
getRegistry: (input?: {
|
|
3493
3555
|
package?: string | undefined;
|
|
@@ -5391,6 +5453,67 @@ declare function createZapierSdk(options?: ZapierSdkOptions): {
|
|
|
5391
5453
|
}> | null;
|
|
5392
5454
|
};
|
|
5393
5455
|
}>;
|
|
5456
|
+
publishWorkflowDraft: (input: {
|
|
5457
|
+
workflow: string;
|
|
5458
|
+
draft: string;
|
|
5459
|
+
enabled?: boolean | undefined;
|
|
5460
|
+
draftRevision?: number | undefined;
|
|
5461
|
+
}) => Promise<{
|
|
5462
|
+
data: {
|
|
5463
|
+
draft: {
|
|
5464
|
+
id: string;
|
|
5465
|
+
workflow_id: string;
|
|
5466
|
+
slug: string;
|
|
5467
|
+
base_version_id: string | null;
|
|
5468
|
+
source_files: Record<string, string>;
|
|
5469
|
+
zapier_durable_version: string;
|
|
5470
|
+
dependencies: Record<string, string> | null;
|
|
5471
|
+
draft_revision: number;
|
|
5472
|
+
status: "open" | "discarded";
|
|
5473
|
+
created_by_user_id: string;
|
|
5474
|
+
last_edited_by_user_id: string | null;
|
|
5475
|
+
last_edited_at: string | null;
|
|
5476
|
+
discarded_at: string | null;
|
|
5477
|
+
created_at: string;
|
|
5478
|
+
updated_at: string;
|
|
5479
|
+
trigger: {
|
|
5480
|
+
selected_api: string;
|
|
5481
|
+
action: string;
|
|
5482
|
+
authentication_id?: string | null | undefined;
|
|
5483
|
+
params?: Record<string, unknown> | undefined;
|
|
5484
|
+
} | null;
|
|
5485
|
+
connections: Record<string, {
|
|
5486
|
+
connection_id: string | number;
|
|
5487
|
+
}> | null;
|
|
5488
|
+
app_versions: Record<string, {
|
|
5489
|
+
implementation_name: string;
|
|
5490
|
+
version?: string | undefined;
|
|
5491
|
+
}> | null;
|
|
5492
|
+
};
|
|
5493
|
+
version: {
|
|
5494
|
+
id: string;
|
|
5495
|
+
workflow_id: string;
|
|
5496
|
+
source_files: Record<string, string>;
|
|
5497
|
+
zapier_durable_version: string;
|
|
5498
|
+
dependencies: Record<string, string> | null;
|
|
5499
|
+
created_by_user_id: string;
|
|
5500
|
+
created_at: string;
|
|
5501
|
+
trigger: {
|
|
5502
|
+
selected_api: string;
|
|
5503
|
+
action: string;
|
|
5504
|
+
authentication_id?: string | null | undefined;
|
|
5505
|
+
params?: Record<string, unknown> | undefined;
|
|
5506
|
+
} | null;
|
|
5507
|
+
connections: Record<string, {
|
|
5508
|
+
connection_id: string | number;
|
|
5509
|
+
}> | null;
|
|
5510
|
+
app_versions: Record<string, {
|
|
5511
|
+
implementation_name: string;
|
|
5512
|
+
version?: string | undefined;
|
|
5513
|
+
}> | null;
|
|
5514
|
+
};
|
|
5515
|
+
};
|
|
5516
|
+
}>;
|
|
5394
5517
|
listWorkflowRuns: (input: {
|
|
5395
5518
|
workflow: string;
|
|
5396
5519
|
pageSize?: number | undefined;
|
package/dist/experimental.d.ts
CHANGED
|
@@ -3265,6 +3265,68 @@ declare const zapierExperimentalSdkPlugin: AggregatePlugin<"experimental-sdk", {
|
|
|
3265
3265
|
}> | null;
|
|
3266
3266
|
};
|
|
3267
3267
|
}>, readonly []> & LeafSummary<"", "discardWorkflowDraft", readonly [PropertyPlugin<"api", ApiClient> & PluginSummary<"zapier/api", never>]>;
|
|
3268
|
+
} & {
|
|
3269
|
+
publishWorkflowDraft: MethodPlugin<"publishWorkflowDraft", {
|
|
3270
|
+
workflow: string;
|
|
3271
|
+
draft: string;
|
|
3272
|
+
enabled?: boolean | undefined;
|
|
3273
|
+
draftRevision?: number | undefined;
|
|
3274
|
+
}, Promise<{
|
|
3275
|
+
data: {
|
|
3276
|
+
draft: {
|
|
3277
|
+
id: string;
|
|
3278
|
+
workflow_id: string;
|
|
3279
|
+
slug: string;
|
|
3280
|
+
base_version_id: string | null;
|
|
3281
|
+
source_files: Record<string, string>;
|
|
3282
|
+
zapier_durable_version: string;
|
|
3283
|
+
dependencies: Record<string, string> | null;
|
|
3284
|
+
draft_revision: number;
|
|
3285
|
+
status: "open" | "discarded";
|
|
3286
|
+
created_by_user_id: string;
|
|
3287
|
+
last_edited_by_user_id: string | null;
|
|
3288
|
+
last_edited_at: string | null;
|
|
3289
|
+
discarded_at: string | null;
|
|
3290
|
+
created_at: string;
|
|
3291
|
+
updated_at: string;
|
|
3292
|
+
trigger: {
|
|
3293
|
+
selected_api: string;
|
|
3294
|
+
action: string;
|
|
3295
|
+
authentication_id?: string | null | undefined;
|
|
3296
|
+
params?: Record<string, unknown> | undefined;
|
|
3297
|
+
} | null;
|
|
3298
|
+
connections: Record<string, {
|
|
3299
|
+
connection_id: string | number;
|
|
3300
|
+
}> | null;
|
|
3301
|
+
app_versions: Record<string, {
|
|
3302
|
+
implementation_name: string;
|
|
3303
|
+
version?: string | undefined;
|
|
3304
|
+
}> | null;
|
|
3305
|
+
};
|
|
3306
|
+
version: {
|
|
3307
|
+
id: string;
|
|
3308
|
+
workflow_id: string;
|
|
3309
|
+
source_files: Record<string, string>;
|
|
3310
|
+
zapier_durable_version: string;
|
|
3311
|
+
dependencies: Record<string, string> | null;
|
|
3312
|
+
created_by_user_id: string;
|
|
3313
|
+
created_at: string;
|
|
3314
|
+
trigger: {
|
|
3315
|
+
selected_api: string;
|
|
3316
|
+
action: string;
|
|
3317
|
+
authentication_id?: string | null | undefined;
|
|
3318
|
+
params?: Record<string, unknown> | undefined;
|
|
3319
|
+
} | null;
|
|
3320
|
+
connections: Record<string, {
|
|
3321
|
+
connection_id: string | number;
|
|
3322
|
+
}> | null;
|
|
3323
|
+
app_versions: Record<string, {
|
|
3324
|
+
implementation_name: string;
|
|
3325
|
+
version?: string | undefined;
|
|
3326
|
+
}> | null;
|
|
3327
|
+
};
|
|
3328
|
+
};
|
|
3329
|
+
}>, readonly []> & LeafSummary<"", "publishWorkflowDraft", readonly [PropertyPlugin<"api", ApiClient> & PluginSummary<"zapier/api", never>]>;
|
|
3268
3330
|
} & {
|
|
3269
3331
|
listWorkflowRuns: MethodPlugin<"listWorkflowRuns", {
|
|
3270
3332
|
workflow: string;
|
|
@@ -3487,7 +3549,7 @@ declare const zapierExperimentalSdkPlugin: AggregatePlugin<"experimental-sdk", {
|
|
|
3487
3549
|
updated_at: string;
|
|
3488
3550
|
};
|
|
3489
3551
|
}>, readonly []> & LeafSummary<"", "getTriggerRun", readonly [PropertyPlugin<"api", ApiClient> & PluginSummary<"zapier/api", never>]>;
|
|
3490
|
-
}> & PluginSummary<never, "fetch" | "zapier/api" | "zapier/manifest" | "zapier/eventEmission" | "zapier/resolveCredentials" | "zapier/connections" | "zapier/capabilities" | "getProfile" | "listApps" | "apps" | "getApp" | "listActions" | "getAction" | "listConnections" | "getConnection" | "findFirstConnection" | "findUniqueConnection" | "listAuthentications" | "getAuthentication" | "findFirstAuthentication" | "findUniqueAuthentication" | "listClientCredentials" | "createClientCredentials" | "deleteClientCredentials" | "getConnectionStartUrl" | "waitForNewConnection" | "createConnection" | "listActionInputFields" | "getActionInputFieldsSchema" | "listActionInputFieldChoices" | "listInputFields" | "getInputFieldsSchema" | "listInputFieldChoices" | "runAction" | "request" | "listTriggerInboxes" | "createTriggerInbox" | "ensureTriggerInbox" | "getTriggerInbox" | "updateTriggerInbox" | "deleteTriggerInbox" | "pauseTriggerInbox" | "resumeTriggerInbox" | "listTriggerInboxMessages" | "leaseTriggerInboxMessages" | "ackTriggerInboxMessages" | "releaseTriggerInboxMessages" | "drainTriggerInbox" | "watchTriggerInbox" | "listTriggers" | "listTriggerInputFields" | "listTriggerInputFieldChoices" | "getTriggerInputFieldsSchema" | "listTables" | "listTablesInternal" | "getTable" | "deleteTable" | "createTable" | "listTableFields" | "createTableFields" | "deleteTableFields" | "listTableRecords" | "getTableRecord" | "createTableRecords" | "deleteTableRecords" | "updateTableRecords" | "kitcore/getRegistry" | "listWorkflows" | "getWorkflow" | "createWorkflow" | "updateWorkflow" | "enableWorkflow" | "disableWorkflow" | "deleteWorkflow" | "listWorkflowVersions" | "getWorkflowVersion" | "publishWorkflowVersion" | "listWorkflowDrafts" | "getWorkflowDraft" | "createWorkflowDraft" | "updateWorkflowDraft" | "discardWorkflowDraft" | "listWorkflowRuns" | "getWorkflowRun" | "listDurableRuns" | "getDurableRun" | "runDurable" | "cancelDurableRun" | "triggerWorkflow" | "getTriggerRun" | "zapier/sdk" | "zapier/experimental-sdk">;
|
|
3552
|
+
}> & PluginSummary<never, "fetch" | "zapier/api" | "zapier/manifest" | "zapier/eventEmission" | "zapier/resolveCredentials" | "zapier/connections" | "zapier/capabilities" | "getProfile" | "listApps" | "apps" | "getApp" | "listActions" | "getAction" | "listConnections" | "getConnection" | "findFirstConnection" | "findUniqueConnection" | "listAuthentications" | "getAuthentication" | "findFirstAuthentication" | "findUniqueAuthentication" | "listClientCredentials" | "createClientCredentials" | "deleteClientCredentials" | "getConnectionStartUrl" | "waitForNewConnection" | "createConnection" | "listActionInputFields" | "getActionInputFieldsSchema" | "listActionInputFieldChoices" | "listInputFields" | "getInputFieldsSchema" | "listInputFieldChoices" | "runAction" | "request" | "listTriggerInboxes" | "createTriggerInbox" | "ensureTriggerInbox" | "getTriggerInbox" | "updateTriggerInbox" | "deleteTriggerInbox" | "pauseTriggerInbox" | "resumeTriggerInbox" | "listTriggerInboxMessages" | "leaseTriggerInboxMessages" | "ackTriggerInboxMessages" | "releaseTriggerInboxMessages" | "drainTriggerInbox" | "watchTriggerInbox" | "listTriggers" | "listTriggerInputFields" | "listTriggerInputFieldChoices" | "getTriggerInputFieldsSchema" | "listTables" | "listTablesInternal" | "getTable" | "deleteTable" | "createTable" | "listTableFields" | "createTableFields" | "deleteTableFields" | "listTableRecords" | "getTableRecord" | "createTableRecords" | "deleteTableRecords" | "updateTableRecords" | "kitcore/getRegistry" | "listWorkflows" | "getWorkflow" | "createWorkflow" | "updateWorkflow" | "enableWorkflow" | "disableWorkflow" | "deleteWorkflow" | "listWorkflowVersions" | "getWorkflowVersion" | "publishWorkflowVersion" | "listWorkflowDrafts" | "getWorkflowDraft" | "createWorkflowDraft" | "updateWorkflowDraft" | "discardWorkflowDraft" | "publishWorkflowDraft" | "listWorkflowRuns" | "getWorkflowRun" | "listDurableRuns" | "getDurableRun" | "runDurable" | "cancelDurableRun" | "triggerWorkflow" | "getTriggerRun" | "zapier/sdk" | "zapier/experimental-sdk">;
|
|
3491
3553
|
declare function createZapierSdk(options?: ZapierSdkOptions): {
|
|
3492
3554
|
getRegistry: (input?: {
|
|
3493
3555
|
package?: string | undefined;
|
|
@@ -5391,6 +5453,67 @@ declare function createZapierSdk(options?: ZapierSdkOptions): {
|
|
|
5391
5453
|
}> | null;
|
|
5392
5454
|
};
|
|
5393
5455
|
}>;
|
|
5456
|
+
publishWorkflowDraft: (input: {
|
|
5457
|
+
workflow: string;
|
|
5458
|
+
draft: string;
|
|
5459
|
+
enabled?: boolean | undefined;
|
|
5460
|
+
draftRevision?: number | undefined;
|
|
5461
|
+
}) => Promise<{
|
|
5462
|
+
data: {
|
|
5463
|
+
draft: {
|
|
5464
|
+
id: string;
|
|
5465
|
+
workflow_id: string;
|
|
5466
|
+
slug: string;
|
|
5467
|
+
base_version_id: string | null;
|
|
5468
|
+
source_files: Record<string, string>;
|
|
5469
|
+
zapier_durable_version: string;
|
|
5470
|
+
dependencies: Record<string, string> | null;
|
|
5471
|
+
draft_revision: number;
|
|
5472
|
+
status: "open" | "discarded";
|
|
5473
|
+
created_by_user_id: string;
|
|
5474
|
+
last_edited_by_user_id: string | null;
|
|
5475
|
+
last_edited_at: string | null;
|
|
5476
|
+
discarded_at: string | null;
|
|
5477
|
+
created_at: string;
|
|
5478
|
+
updated_at: string;
|
|
5479
|
+
trigger: {
|
|
5480
|
+
selected_api: string;
|
|
5481
|
+
action: string;
|
|
5482
|
+
authentication_id?: string | null | undefined;
|
|
5483
|
+
params?: Record<string, unknown> | undefined;
|
|
5484
|
+
} | null;
|
|
5485
|
+
connections: Record<string, {
|
|
5486
|
+
connection_id: string | number;
|
|
5487
|
+
}> | null;
|
|
5488
|
+
app_versions: Record<string, {
|
|
5489
|
+
implementation_name: string;
|
|
5490
|
+
version?: string | undefined;
|
|
5491
|
+
}> | null;
|
|
5492
|
+
};
|
|
5493
|
+
version: {
|
|
5494
|
+
id: string;
|
|
5495
|
+
workflow_id: string;
|
|
5496
|
+
source_files: Record<string, string>;
|
|
5497
|
+
zapier_durable_version: string;
|
|
5498
|
+
dependencies: Record<string, string> | null;
|
|
5499
|
+
created_by_user_id: string;
|
|
5500
|
+
created_at: string;
|
|
5501
|
+
trigger: {
|
|
5502
|
+
selected_api: string;
|
|
5503
|
+
action: string;
|
|
5504
|
+
authentication_id?: string | null | undefined;
|
|
5505
|
+
params?: Record<string, unknown> | undefined;
|
|
5506
|
+
} | null;
|
|
5507
|
+
connections: Record<string, {
|
|
5508
|
+
connection_id: string | number;
|
|
5509
|
+
}> | null;
|
|
5510
|
+
app_versions: Record<string, {
|
|
5511
|
+
implementation_name: string;
|
|
5512
|
+
version?: string | undefined;
|
|
5513
|
+
}> | null;
|
|
5514
|
+
};
|
|
5515
|
+
};
|
|
5516
|
+
}>;
|
|
5394
5517
|
listWorkflowRuns: (input: {
|
|
5395
5518
|
workflow: string;
|
|
5396
5519
|
pageSize?: number | undefined;
|
package/dist/experimental.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineMethod, DEFAULT_PAGE_SIZE, apiPluginRef, workflowIdResolver, openEnum, durableRunIdResolver, defineResolver, workflowVersionIdResolver, workflowDraftIdResolver, extractErrorDetail, ZapierConflictError,
|
|
2
|
-
export { API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, manifestPluginRef, omitExports, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin } from './chunk-
|
|
1
|
+
import { defineMethod, DEFAULT_PAGE_SIZE, apiPluginRef, workflowIdResolver, openEnum, durableRunIdResolver, defineResolver, workflowVersionIdResolver, workflowDraftIdResolver, extractErrorDetail, ZapierConflictError, ZapierApiError, workflowRunIdResolver, definePlugin, zapierSdkPlugin, ZapierValidationError, createSdk, zapierCoreOptions, CORE_OPTIONS_ID, SDK_OPTIONS_ID } from './chunk-22USOWAR.mjs';
|
|
2
|
+
export { API_ID, ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMillisecondsPropertySchema, ActionTimeoutSecondsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthMechanism, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONNECTIONS_ID, CONTEXT, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MILLISECONDS, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CoreCancelledSignal, CoreDisposeError, CoreErrorCode, CoreSignal, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MILLISECONDS, DEFAULT_APPROVAL_TIMEOUT_MILLISECONDS, DEFAULT_CONFIG_PATH, DEFAULT_MAX_APPROVAL_RETRIES, DEFAULT_PAGE_SIZE, DEPRECATION_NOTICE_EVENT, DebugPropertySchema, DrainTriggerInboxSchema, EVENT_EMISSION_ID, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LeaseLimitPropertySchema, LeasePropertySchema, LeaseSecondsPropertySchema, LimitPropertySchema, MANIFEST_ID, MAX_CONCURRENCY_LIMIT, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RESOLVE_CREDENTIALS_ID, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, SDK_OPTIONS_ID, TablePropertySchema, TablesPropertySchema, TriggerInboxKeyPropertySchema, TriggerInboxNamePropertySchema, TriggerInboxPropertySchema, WatchTriggerInboxSchema, ZAPIER_BASE_URL, ZAPIER_MAX_CONCURRENT_REQUESTS, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MILLISECONDS, ZapierAbortDrainSignal, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierApprovalError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierConflictError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierReleaseTriggerMessageSignal, ZapierResourceNotFoundError, ZapierSignal, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, addPlugin, apiPlugin, apiPluginRef, appKeyResolver, appsPlugin, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, cleanupEventListeners, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, composePlugins, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, connectionsPluginRef, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOrCreateApiClient, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getRegistryPlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, getTtyContext, getZapierApprovalMode, getZapierDefaultApprovalMode, getZapierOpenAutoModeApprovalsInBrowser, getZapierSdkService, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCoreCancelledSignal, isCoreError, isCoreSignal, isCredentialsFunction, isCredentialsObject, isPermanentHttpError, isPkceCredentials, isPositional, isZapierAbortDrainSignal, isZapierActionError, isZapierAppNotFoundError, isZapierApprovalError, isZapierAuthenticationError, isZapierBundleError, isZapierConflictError, isZapierError, isZapierNotFoundError, isZapierRateLimitError, isZapierReleaseTriggerMessageSignal, isZapierResourceNotFoundError, isZapierSignal, isZapierTimeoutError, isZapierValidationError, listActionInputFieldChoicesPlugin, listActionInputFieldsPlugin, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, manifestPluginRef, omitExports, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuth, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, resolveCredentialsPlugin, resolveCredentialsPluginRef, resolvePlugin, runActionPlugin, runInMethodScope, runWithCallerContext, runWithTelemetryContext, sdkOptionsPluginRef, selectExports, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, triggerInboxResolver, triggerMessagesResolver, updateTableRecordsPlugin, workflowDraftIdResolver, workflowIdResolver, workflowRunIdResolver, workflowVersionIdResolver, zapierAdaptError, zapierCoreOptions, zapierSdkPlugin } from './chunk-22USOWAR.mjs';
|
|
3
3
|
import './chunk-Y6FXYEAI.mjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
@@ -142,7 +142,7 @@ var WorkflowDraftSchema = z.object({
|
|
|
142
142
|
"Human-friendly identifier for URL routing; unique among open drafts per workflow"
|
|
143
143
|
),
|
|
144
144
|
base_version_id: z.string().nullable().describe(
|
|
145
|
-
"
|
|
145
|
+
"The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet"
|
|
146
146
|
),
|
|
147
147
|
source_files: z.record(z.string(), z.string()).describe("Source files keyed by filename \u2192 contents"),
|
|
148
148
|
zapier_durable_version: z.string().describe("Pinned semver of @zapier/zapier-durable used by this draft"),
|
|
@@ -163,6 +163,22 @@ var WorkflowDraftSchema = z.object({
|
|
|
163
163
|
connections: z.record(z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this draft (or null)."),
|
|
164
164
|
app_versions: z.record(z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this draft (or null).")
|
|
165
165
|
});
|
|
166
|
+
var WorkflowVersionSchema = z.object({
|
|
167
|
+
id: z.string().describe("Workflow version ID (UUID)"),
|
|
168
|
+
workflow_id: z.string().describe("Parent workflow ID (UUID)"),
|
|
169
|
+
source_files: z.record(z.string(), z.string()).describe("Source files keyed by filename \u2192 contents"),
|
|
170
|
+
zapier_durable_version: z.string().describe(
|
|
171
|
+
"Pinned semver of @zapier/zapier-durable used by this version's runs"
|
|
172
|
+
),
|
|
173
|
+
dependencies: z.record(z.string(), z.string()).nullable().describe("Additional npm dependencies pinned for this version (or null)"),
|
|
174
|
+
created_by_user_id: z.string().describe("ID of the user who published this version"),
|
|
175
|
+
created_at: z.string().describe("When the version was published (ISO-8601)"),
|
|
176
|
+
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
177
|
+
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
178
|
+
),
|
|
179
|
+
connections: z.record(z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
180
|
+
app_versions: z.record(z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
181
|
+
});
|
|
166
182
|
var WorkflowTriggerStatusSchema = z.enum([
|
|
167
183
|
"unclaimed",
|
|
168
184
|
"pending",
|
|
@@ -276,7 +292,7 @@ var listWorkflowsPlugin = defineMethod({
|
|
|
276
292
|
};
|
|
277
293
|
}
|
|
278
294
|
});
|
|
279
|
-
var
|
|
295
|
+
var WorkflowVersionSchema2 = z.object({
|
|
280
296
|
id: z.string().describe("Workflow version ID (UUID)"),
|
|
281
297
|
workflow_id: z.string().describe("Parent workflow ID"),
|
|
282
298
|
source_files: z.record(z.string(), z.string()).describe("Source files keyed by filename \u2192 contents"),
|
|
@@ -315,7 +331,7 @@ var GetWorkflowResponseSchema = z.object({
|
|
|
315
331
|
"Whether the workflow is private to the creating user. False means account-visible."
|
|
316
332
|
),
|
|
317
333
|
created_by_user_id: z.string().nullable().describe("User ID of the workflow creator (null in legacy data)"),
|
|
318
|
-
current_version:
|
|
334
|
+
current_version: WorkflowVersionSchema2.optional().describe(
|
|
319
335
|
"The currently published version, if any. Absent for workflows with no version published yet."
|
|
320
336
|
),
|
|
321
337
|
triggers: z.array(WorkflowTriggerSchema).describe(
|
|
@@ -942,22 +958,7 @@ var PublishWorkflowVersionSchemaDeprecated = z.object({
|
|
|
942
958
|
source_files: SourceFilesSchema
|
|
943
959
|
}).merge(PublishWorkflowVersionBaseSchema);
|
|
944
960
|
var PublishWorkflowVersionOptionsSchema = z.union([PublishWorkflowVersionSchema, PublishWorkflowVersionSchemaDeprecated]).describe(PublishWorkflowVersionDescription);
|
|
945
|
-
var PublishWorkflowVersionResponseSchema =
|
|
946
|
-
id: z.string().describe("Workflow version ID (UUID)"),
|
|
947
|
-
workflow_id: z.string().describe("Parent workflow ID (UUID)"),
|
|
948
|
-
source_files: z.record(z.string(), z.string()).describe("Source files keyed by filename \u2192 contents"),
|
|
949
|
-
zapier_durable_version: z.string().describe(
|
|
950
|
-
"Pinned semver of @zapier/zapier-durable used by this version's runs"
|
|
951
|
-
),
|
|
952
|
-
dependencies: z.record(z.string(), z.string()).nullable().describe("Additional npm dependencies pinned for this version (or null)"),
|
|
953
|
-
created_by_user_id: z.string().describe("ID of the user who published this version"),
|
|
954
|
-
created_at: z.string().describe("When the version was published (ISO-8601)"),
|
|
955
|
-
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
956
|
-
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
957
|
-
),
|
|
958
|
-
connections: z.record(z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
959
|
-
app_versions: z.record(z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
960
|
-
});
|
|
961
|
+
var PublishWorkflowVersionResponseSchema = WorkflowVersionSchema;
|
|
961
962
|
|
|
962
963
|
// src/plugins/codeSubstrate/publishWorkflowVersion/index.ts
|
|
963
964
|
var publishWorkflowVersionPlugin = defineMethod({
|
|
@@ -1083,22 +1084,7 @@ var GetWorkflowVersionOptionsSchema = z.object({
|
|
|
1083
1084
|
workflow: z.string().uuid().describe("Durable workflow ID"),
|
|
1084
1085
|
version: z.string().uuid().describe("Workflow version ID")
|
|
1085
1086
|
}).describe("Get full details of a workflow version including source files");
|
|
1086
|
-
var GetWorkflowVersionResponseSchema =
|
|
1087
|
-
id: z.string().describe("Workflow version ID (UUID)"),
|
|
1088
|
-
workflow_id: z.string().describe("Parent workflow ID (UUID)"),
|
|
1089
|
-
source_files: z.record(z.string(), z.string()).describe("Source files keyed by filename \u2192 contents"),
|
|
1090
|
-
zapier_durable_version: z.string().describe(
|
|
1091
|
-
"Pinned semver of @zapier/zapier-durable used by this version's runs"
|
|
1092
|
-
),
|
|
1093
|
-
dependencies: z.record(z.string(), z.string()).nullable().describe("Additional npm dependencies pinned for this version (or null)"),
|
|
1094
|
-
created_by_user_id: z.string().describe("ID of the user who published this version"),
|
|
1095
|
-
created_at: z.string().describe("When the version was published (ISO-8601)"),
|
|
1096
|
-
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
1097
|
-
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
1098
|
-
),
|
|
1099
|
-
connections: z.record(z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
1100
|
-
app_versions: z.record(z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
1101
|
-
});
|
|
1087
|
+
var GetWorkflowVersionResponseSchema = WorkflowVersionSchema;
|
|
1102
1088
|
|
|
1103
1089
|
// src/plugins/codeSubstrate/getWorkflowVersion/index.ts
|
|
1104
1090
|
var getWorkflowVersionPlugin = defineMethod({
|
|
@@ -1132,7 +1118,7 @@ var WorkflowDraftSummarySchema = z.object({
|
|
|
1132
1118
|
"Human-friendly identifier for URL routing; unique among open drafts per workflow"
|
|
1133
1119
|
),
|
|
1134
1120
|
base_version_id: z.string().nullable().describe(
|
|
1135
|
-
"
|
|
1121
|
+
"The version this draft was forked from (the live version at draft creation), or null when the workflow had no published version yet"
|
|
1136
1122
|
),
|
|
1137
1123
|
status: WorkflowDraftStatusSchema,
|
|
1138
1124
|
last_edited_by_user_id: z.string().nullable().describe("ID of the user who last saved this draft (or null)"),
|
|
@@ -1406,6 +1392,92 @@ var discardWorkflowDraftPlugin = defineMethod({
|
|
|
1406
1392
|
return { data: DiscardWorkflowDraftResponseSchema.parse(raw) };
|
|
1407
1393
|
}
|
|
1408
1394
|
});
|
|
1395
|
+
var PublishWorkflowDraftOptionsSchema = z.object({
|
|
1396
|
+
workflow: z.string().uuid().describe("Durable workflow ID"),
|
|
1397
|
+
draft: z.string().uuid().describe("Workflow draft ID"),
|
|
1398
|
+
enabled: z.boolean().optional().describe(
|
|
1399
|
+
"Set the workflow's enabled state as part of the publish. If omitted, the current enabled state is preserved."
|
|
1400
|
+
),
|
|
1401
|
+
draftRevision: z.number().int().min(0).optional().describe(
|
|
1402
|
+
"Expected draft revision for optimistic concurrency. Pass the revision from the last read; the server rejects the publish with a conflict if the draft has changed since. Omit to skip the check."
|
|
1403
|
+
)
|
|
1404
|
+
}).describe(
|
|
1405
|
+
"Publish an open draft as a new immutable workflow version. Advances the workflow's live pointer and discards the draft \u2014 publish consumes it, so an open draft always means unpublished work. Continue editing by creating a new draft, which forks from the just-published version."
|
|
1406
|
+
);
|
|
1407
|
+
var PublishWorkflowDraftResponseSchema = z.object({
|
|
1408
|
+
draft: WorkflowDraftSchema.describe(
|
|
1409
|
+
"The consumed draft: status is 'discarded' and discarded_at is set. base_version_id still records the version the draft was forked from."
|
|
1410
|
+
),
|
|
1411
|
+
version: WorkflowVersionSchema.describe(
|
|
1412
|
+
"The newly published immutable workflow version, now live."
|
|
1413
|
+
)
|
|
1414
|
+
});
|
|
1415
|
+
|
|
1416
|
+
// src/plugins/codeSubstrate/publishWorkflowDraft/index.ts
|
|
1417
|
+
var publishWorkflowDraftPlugin = defineMethod({
|
|
1418
|
+
...codeSubstrateDefaults,
|
|
1419
|
+
name: "publishWorkflowDraft",
|
|
1420
|
+
imports: [apiPluginRef],
|
|
1421
|
+
type: "create",
|
|
1422
|
+
itemType: "WorkflowVersion",
|
|
1423
|
+
// The response is the composite `{ draft, version }`, not the bare
|
|
1424
|
+
// `WorkflowVersionItem` the docs generator derives from itemType.
|
|
1425
|
+
returnType: "PublishWorkflowDraftResponse",
|
|
1426
|
+
inputSchema: PublishWorkflowDraftOptionsSchema,
|
|
1427
|
+
outputSchema: PublishWorkflowDraftResponseSchema,
|
|
1428
|
+
output: "item",
|
|
1429
|
+
resolvers: {
|
|
1430
|
+
workflow: workflowIdResolver,
|
|
1431
|
+
draft: workflowDraftIdResolver
|
|
1432
|
+
},
|
|
1433
|
+
run: async ({ imports, input }) => {
|
|
1434
|
+
const api = imports.api;
|
|
1435
|
+
const body = {};
|
|
1436
|
+
if (input.enabled !== void 0) {
|
|
1437
|
+
body.enabled = input.enabled;
|
|
1438
|
+
}
|
|
1439
|
+
if (input.draftRevision !== void 0) {
|
|
1440
|
+
body.draft_revision = input.draftRevision;
|
|
1441
|
+
}
|
|
1442
|
+
const raw = await api.post(
|
|
1443
|
+
`${CODE_SUBSTRATE_WORKFLOWS_API}/workflows/${encodeURIComponent(input.workflow)}/drafts/${encodeURIComponent(input.draft)}/publish`,
|
|
1444
|
+
body,
|
|
1445
|
+
{
|
|
1446
|
+
authRequired: true,
|
|
1447
|
+
resource: { type: "workflow-draft", id: input.draft },
|
|
1448
|
+
// Preserve the endpoint's distinct failure modes instead of letting
|
|
1449
|
+
// them flatten into a generic API error:
|
|
1450
|
+
// 409 — the draft was edited concurrently (draft_revision moved past
|
|
1451
|
+
// the caller's), or a trigger subscription switchover is
|
|
1452
|
+
// already in progress. Retryable after re-reading the draft.
|
|
1453
|
+
// 503 — the trigger config could not be validated against the
|
|
1454
|
+
// platform catalog; validation is fail-closed so the publish
|
|
1455
|
+
// is rejected rather than committing unvalidated config.
|
|
1456
|
+
// Retryable as-is.
|
|
1457
|
+
// 400 (invalid zapier_durable_version / trigger config) already maps
|
|
1458
|
+
// to ZapierValidationError via the client's default handling.
|
|
1459
|
+
customErrorHandler: ({ status, data }) => {
|
|
1460
|
+
if (status === 409) {
|
|
1461
|
+
const detail = extractErrorDetail(data);
|
|
1462
|
+
return new ZapierConflictError(
|
|
1463
|
+
`${detail ?? "Draft publish conflict"} \u2014 the draft changed since it was last read, or a trigger switchover is already in progress. Re-read the draft to get the current draft_revision, then retry the publish.`,
|
|
1464
|
+
{ statusCode: status, resourceType: "workflow-draft" }
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1467
|
+
if (status === 503) {
|
|
1468
|
+
const detail = extractErrorDetail(data);
|
|
1469
|
+
return new ZapierApiError(
|
|
1470
|
+
detail !== void 0 ? `${detail} \u2014 the trigger config could not be validated against the platform catalog, so the publish was rejected (fail-closed). This is transient; retry the publish.` : "Draft publish temporarily unavailable \u2014 trigger validation is fail-closed, or the service is briefly unavailable. This is transient; retry the publish.",
|
|
1471
|
+
{ statusCode: status }
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
return void 0;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
);
|
|
1478
|
+
return { data: PublishWorkflowDraftResponseSchema.parse(raw) };
|
|
1479
|
+
}
|
|
1480
|
+
});
|
|
1409
1481
|
var WorkflowRunStatusSchema = z.union([
|
|
1410
1482
|
z.enum(["initialized", "started", "finished", "failed", "cancelled"]),
|
|
1411
1483
|
z.string()
|
|
@@ -1666,6 +1738,7 @@ var zapierExperimentalSdkPlugin = definePlugin({
|
|
|
1666
1738
|
createWorkflowDraftPlugin,
|
|
1667
1739
|
updateWorkflowDraftPlugin,
|
|
1668
1740
|
discardWorkflowDraftPlugin,
|
|
1741
|
+
publishWorkflowDraftPlugin,
|
|
1669
1742
|
listWorkflowRunsPlugin,
|
|
1670
1743
|
getWorkflowRunPlugin,
|
|
1671
1744
|
listDurableRunsPlugin,
|