@zapier/zapier-sdk 0.72.0 → 0.73.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 +12 -0
- package/README.md +32 -32
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +9 -0
- package/dist/api/types.d.ts +5 -4
- package/dist/api/types.d.ts.map +1 -1
- package/dist/experimental.cjs +175 -65
- package/dist/experimental.d.mts +160 -12
- package/dist/experimental.d.ts +158 -10
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.mjs +175 -65
- package/dist/{index-B43uST61.d.mts → index-D1O7Pcex.d.mts} +5 -4
- package/dist/{index-B43uST61.d.ts → index-D1O7Pcex.d.ts} +5 -4
- package/dist/index.cjs +10 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +10 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts +42 -3
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.js +49 -11
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts +117 -5
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/schemas.js +77 -14
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts +37 -2
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/runDurable/index.js +10 -9
- package/dist/plugins/codeSubstrate/runDurable/schemas.d.ts +117 -4
- package/dist/plugins/codeSubstrate/runDurable/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/runDurable/schemas.js +38 -37
- package/dist/plugins/codeSubstrate/shared.d.ts +56 -0
- package/dist/plugins/codeSubstrate/shared.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/shared.js +100 -0
- package/package.json +1 -1
package/dist/experimental.mjs
CHANGED
|
@@ -3285,7 +3285,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
|
|
|
3285
3285
|
}
|
|
3286
3286
|
|
|
3287
3287
|
// src/sdk-version.ts
|
|
3288
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
3288
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.73.1" : void 0) || "unknown";
|
|
3289
3289
|
|
|
3290
3290
|
// src/utils/open-url.ts
|
|
3291
3291
|
var nodePrefix = "node:";
|
|
@@ -3990,15 +3990,24 @@ var ZapierApiClient = class {
|
|
|
3990
3990
|
// Applied at the outbound layer (after caller-supplied header merging) so
|
|
3991
3991
|
// they always reflect the SDK's actual identity and can't be spoofed via
|
|
3992
3992
|
// options.headers.
|
|
3993
|
+
//
|
|
3994
|
+
// We emit both the standard `zapier-*` names (per the API header guidance the
|
|
3995
|
+
// gateway now expects) and the legacy `x-zapier-*` names. The legacy names are
|
|
3996
|
+
// kept for backward compatibility with consumers that haven't migrated yet;
|
|
3997
|
+
// they can be removed once nothing reads them.
|
|
3993
3998
|
applyTelemetryHeaders(headers) {
|
|
3999
|
+
headers.set("zapier-sdk-version", SDK_VERSION);
|
|
3994
4000
|
headers.set("x-zapier-sdk-version", SDK_VERSION);
|
|
3995
4001
|
const sdkService = getZapierSdkService();
|
|
3996
4002
|
if (sdkService) {
|
|
4003
|
+
headers.set("zapier-service", sdkService);
|
|
3997
4004
|
headers.set("x-zapier-service", sdkService);
|
|
3998
4005
|
}
|
|
3999
4006
|
const callerPackage = this.options.callerPackage;
|
|
4000
4007
|
if (callerPackage) {
|
|
4008
|
+
headers.set("zapier-sdk-package", callerPackage.name);
|
|
4001
4009
|
headers.set("x-zapier-sdk-package", callerPackage.name);
|
|
4010
|
+
headers.set("zapier-sdk-package-version", callerPackage.version);
|
|
4002
4011
|
headers.set("x-zapier-sdk-package-version", callerPackage.version);
|
|
4003
4012
|
}
|
|
4004
4013
|
}
|
|
@@ -11745,13 +11754,62 @@ var getTriggerInputFieldsSchemaPlugin = definePlugin(
|
|
|
11745
11754
|
}
|
|
11746
11755
|
})
|
|
11747
11756
|
);
|
|
11748
|
-
|
|
11749
|
-
// src/plugins/codeSubstrate/shared.ts
|
|
11750
11757
|
var codeSubstrateDefaults = {
|
|
11751
11758
|
categories: ["code-workflow"],
|
|
11752
11759
|
experimental: true
|
|
11753
11760
|
};
|
|
11761
|
+
var SourceFilesSchema = z.record(z.string(), z.string()).refine((files) => Object.keys(files).length > 0, {
|
|
11762
|
+
message: "sourceFiles must contain at least one file"
|
|
11763
|
+
}).describe("Source files keyed by filename \u2192 contents");
|
|
11764
|
+
var UUID_PATTERN = /^[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}$/;
|
|
11765
|
+
var ConnectionIdValueSchema = z.union([
|
|
11766
|
+
z.string().regex(/^[1-9][0-9]*$/, "must be a positive integer string"),
|
|
11767
|
+
z.string().regex(UUID_PATTERN, "must be a UUID"),
|
|
11768
|
+
z.number().int().positive()
|
|
11769
|
+
]).describe(
|
|
11770
|
+
"Zapier connection ID. Accepts a positive integer (legacy) or a UUID string (newer connections)."
|
|
11771
|
+
);
|
|
11754
11772
|
var ConnectionBindingSchema = z.object({
|
|
11773
|
+
connectionId: ConnectionIdValueSchema.optional(),
|
|
11774
|
+
/** @deprecated Use `connectionId` instead. */
|
|
11775
|
+
connection_id: ConnectionIdValueSchema.optional().meta({ deprecated: true })
|
|
11776
|
+
});
|
|
11777
|
+
var AppVersionBindingSchema = z.object({
|
|
11778
|
+
implementationName: z.string().min(1).optional().describe("Zapier app implementation name (e.g. `SlackCLIAPI`)"),
|
|
11779
|
+
/** @deprecated Use `implementationName` instead. */
|
|
11780
|
+
implementation_name: z.string().min(1).optional().meta({ deprecated: true }),
|
|
11781
|
+
version: z.string().optional().describe("Pinned app version (e.g. `1.27.1`). Latest if omitted.")
|
|
11782
|
+
});
|
|
11783
|
+
function toWireConnections(connections) {
|
|
11784
|
+
const wire = {};
|
|
11785
|
+
for (const [alias, entry] of Object.entries(connections)) {
|
|
11786
|
+
const connectionId = entry.connectionId ?? entry.connection_id;
|
|
11787
|
+
if (connectionId === void 0) {
|
|
11788
|
+
throw new ZapierValidationError(
|
|
11789
|
+
`connections["${alias}"] is missing connectionId`
|
|
11790
|
+
);
|
|
11791
|
+
}
|
|
11792
|
+
wire[alias] = { connection_id: connectionId };
|
|
11793
|
+
}
|
|
11794
|
+
return wire;
|
|
11795
|
+
}
|
|
11796
|
+
function toWireAppVersions(appVersions) {
|
|
11797
|
+
const wire = {};
|
|
11798
|
+
for (const [key, entry] of Object.entries(appVersions)) {
|
|
11799
|
+
const implementationName = entry.implementationName ?? entry.implementation_name;
|
|
11800
|
+
if (implementationName === void 0) {
|
|
11801
|
+
throw new ZapierValidationError(
|
|
11802
|
+
`appVersions["${key}"] is missing implementationName`
|
|
11803
|
+
);
|
|
11804
|
+
}
|
|
11805
|
+
wire[key] = {
|
|
11806
|
+
implementation_name: implementationName,
|
|
11807
|
+
...entry.version !== void 0 ? { version: entry.version } : {}
|
|
11808
|
+
};
|
|
11809
|
+
}
|
|
11810
|
+
return wire;
|
|
11811
|
+
}
|
|
11812
|
+
var ConnectionBindingSchema2 = z.object({
|
|
11755
11813
|
connection_id: z.union([
|
|
11756
11814
|
z.number().int().positive(),
|
|
11757
11815
|
z.string().regex(/^[1-9][0-9]*$/, "must be a positive integer string"),
|
|
@@ -11762,7 +11820,7 @@ var ConnectionBindingSchema = z.object({
|
|
|
11762
11820
|
}).describe(
|
|
11763
11821
|
"Connection binding: maps a single alias to a concrete connection."
|
|
11764
11822
|
);
|
|
11765
|
-
var
|
|
11823
|
+
var AppVersionBindingSchema2 = z.object({
|
|
11766
11824
|
implementation_name: z.string().describe("App implementation identifier (e.g. 'SlackCLIAPI')"),
|
|
11767
11825
|
version: z.string().optional().describe("App implementation version (e.g. '1.27.1')")
|
|
11768
11826
|
}).describe("App-version binding: maps a single alias to an app version.");
|
|
@@ -11880,8 +11938,8 @@ var WorkflowVersionSchema = z.object({
|
|
|
11880
11938
|
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
11881
11939
|
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
11882
11940
|
),
|
|
11883
|
-
connections: z.record(z.string(),
|
|
11884
|
-
app_versions: z.record(z.string(),
|
|
11941
|
+
connections: z.record(z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
11942
|
+
app_versions: z.record(z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
11885
11943
|
});
|
|
11886
11944
|
var GetWorkflowOptionsSchema = z.object({
|
|
11887
11945
|
workflow: z.string().uuid().describe("Durable workflow ID")
|
|
@@ -12332,19 +12390,6 @@ var getDurableRunPlugin = definePlugin(
|
|
|
12332
12390
|
}
|
|
12333
12391
|
})
|
|
12334
12392
|
);
|
|
12335
|
-
var ConnectionMapEntrySchema = z.object({
|
|
12336
|
-
connection_id: z.union([
|
|
12337
|
-
z.string().regex(/^[1-9][0-9]*$/, "must be a positive integer string"),
|
|
12338
|
-
z.string().uuid("must be a UUID"),
|
|
12339
|
-
z.number().int().positive()
|
|
12340
|
-
]).describe(
|
|
12341
|
-
"Zapier connection ID. Accepts a positive integer (legacy) or a UUID string (newer connections)."
|
|
12342
|
-
)
|
|
12343
|
-
});
|
|
12344
|
-
var AppVersionMapEntrySchema = z.object({
|
|
12345
|
-
implementation_name: z.string().min(1).describe("Zapier app implementation name (e.g. `SlackCLIAPI`)"),
|
|
12346
|
-
version: z.string().optional().describe("Pinned app version (e.g. `1.27.1`). Latest if omitted.")
|
|
12347
|
-
});
|
|
12348
12393
|
var RunNotificationEventSchema = z.enum(["started", "progress", "completed", "error", "cancelled"]).describe("Run lifecycle event this notification subscribes to");
|
|
12349
12394
|
var RunNotificationSchema = z.object({
|
|
12350
12395
|
type: z.literal("webhook").optional().describe("Notification transport. Webhook is the only supported type."),
|
|
@@ -12358,28 +12403,37 @@ var RunNotificationSchema = z.object({
|
|
|
12358
12403
|
}).describe(
|
|
12359
12404
|
"Webhook subscriber for run lifecycle events. Server POSTs `{run_id, event}` on each subscribed transition."
|
|
12360
12405
|
);
|
|
12361
|
-
var
|
|
12362
|
-
source_files: z.record(z.string(), z.string()).refine((files) => Object.keys(files).length > 0, {
|
|
12363
|
-
message: "source_files must contain at least one file"
|
|
12364
|
-
}).describe("Source files keyed by filename \u2192 contents"),
|
|
12406
|
+
var RunDurableBaseSchema = z.object({
|
|
12365
12407
|
input: z.unknown().optional().describe("Input data passed to the run"),
|
|
12366
12408
|
dependencies: z.record(z.string(), z.string()).optional().describe("Optional npm package dependencies"),
|
|
12367
|
-
|
|
12409
|
+
zapierDurableVersion: z.string().optional().describe(
|
|
12368
12410
|
'Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted.'
|
|
12369
12411
|
),
|
|
12370
|
-
|
|
12371
|
-
|
|
12412
|
+
/** @deprecated Use `zapierDurableVersion` instead. */
|
|
12413
|
+
zapier_durable_version: z.string().optional().meta({ deprecated: true }),
|
|
12414
|
+
connections: z.record(z.string(), ConnectionBindingSchema).optional().describe(
|
|
12415
|
+
'Named connection aliases. Maps each alias to an object holding its Zapier connection ID, e.g. `{ "slack": { "connectionId": "123" } }`.'
|
|
12372
12416
|
),
|
|
12373
|
-
|
|
12417
|
+
appVersions: z.record(z.string(), AppVersionBindingSchema).optional().describe(
|
|
12374
12418
|
"Pinned app versions. Maps app keys (slugs) to implementation names and versions."
|
|
12375
12419
|
),
|
|
12420
|
+
/** @deprecated Use `appVersions` instead. */
|
|
12421
|
+
app_versions: z.record(z.string(), AppVersionBindingSchema).optional().meta({ deprecated: true }),
|
|
12376
12422
|
private: z.boolean().optional().describe("Only the creating user can see the run (default false)"),
|
|
12377
12423
|
notifications: z.array(RunNotificationSchema).optional().describe(
|
|
12378
12424
|
"Webhook subscribers for run lifecycle events. Each entry specifies a URL and the events it subscribes to."
|
|
12379
12425
|
)
|
|
12380
|
-
})
|
|
12381
|
-
|
|
12382
|
-
)
|
|
12426
|
+
});
|
|
12427
|
+
var RunDurableDescription = "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.";
|
|
12428
|
+
var RunDurableSchema = z.object({ sourceFiles: SourceFilesSchema }).merge(RunDurableBaseSchema).describe(RunDurableDescription).meta({
|
|
12429
|
+
aliases: {
|
|
12430
|
+
source_files: "sourceFiles",
|
|
12431
|
+
zapier_durable_version: "zapierDurableVersion",
|
|
12432
|
+
app_versions: "appVersions"
|
|
12433
|
+
}
|
|
12434
|
+
});
|
|
12435
|
+
var RunDurableSchemaDeprecated = z.object({ source_files: SourceFilesSchema }).merge(RunDurableBaseSchema);
|
|
12436
|
+
var RunDurableOptionsSchema = z.union([RunDurableSchema, RunDurableSchemaDeprecated]).describe(RunDurableDescription);
|
|
12383
12437
|
var RunDurableResponseSchema = z.object({
|
|
12384
12438
|
id: z.string().describe("Run ID (UUID) \u2014 server-generated, time-sortable"),
|
|
12385
12439
|
status: z.literal("initialized").describe(
|
|
@@ -12401,23 +12455,24 @@ var runDurablePlugin = definePlugin(
|
|
|
12401
12455
|
inputSchema: RunDurableOptionsSchema,
|
|
12402
12456
|
outputSchema: RunDurableResponseSchema,
|
|
12403
12457
|
handler: async ({ sdk: sdk2, options }) => {
|
|
12404
|
-
const
|
|
12405
|
-
|
|
12406
|
-
|
|
12458
|
+
const sourceFiles = "sourceFiles" in options ? options.sourceFiles : options.source_files;
|
|
12459
|
+
const zapierDurableVersion = options.zapierDurableVersion ?? options.zapier_durable_version;
|
|
12460
|
+
const appVersions = options.appVersions ?? options.app_versions;
|
|
12461
|
+
const body = { source_files: sourceFiles };
|
|
12407
12462
|
if (options.input !== void 0) {
|
|
12408
12463
|
body.input = options.input;
|
|
12409
12464
|
}
|
|
12410
12465
|
if (options.dependencies !== void 0) {
|
|
12411
12466
|
body.dependencies = options.dependencies;
|
|
12412
12467
|
}
|
|
12413
|
-
if (
|
|
12414
|
-
body.zapier_durable_version =
|
|
12468
|
+
if (zapierDurableVersion !== void 0) {
|
|
12469
|
+
body.zapier_durable_version = zapierDurableVersion;
|
|
12415
12470
|
}
|
|
12416
12471
|
if (options.connections !== void 0) {
|
|
12417
|
-
body.connections = options.connections;
|
|
12472
|
+
body.connections = toWireConnections(options.connections);
|
|
12418
12473
|
}
|
|
12419
|
-
if (
|
|
12420
|
-
body.app_versions =
|
|
12474
|
+
if (appVersions !== void 0) {
|
|
12475
|
+
body.app_versions = toWireAppVersions(appVersions);
|
|
12421
12476
|
}
|
|
12422
12477
|
if (options.private !== void 0) {
|
|
12423
12478
|
body.is_private = options.private;
|
|
@@ -12472,30 +12527,61 @@ var cancelDurableRunPlugin = definePlugin(
|
|
|
12472
12527
|
}
|
|
12473
12528
|
})
|
|
12474
12529
|
);
|
|
12475
|
-
var
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12530
|
+
var TriggerConfigSchema = z.object({
|
|
12531
|
+
selectedApi: z.string().optional().describe(
|
|
12532
|
+
"Zapier app/API identifier (e.g. 'GoogleSheetsAPI'). Required when a trigger is configured."
|
|
12533
|
+
),
|
|
12534
|
+
/** @deprecated Use `selectedApi` instead. */
|
|
12535
|
+
selected_api: z.string().optional().meta({ deprecated: true }),
|
|
12536
|
+
action: z.string().describe("Trigger action key (e.g. 'new_row')"),
|
|
12537
|
+
authenticationId: z.string().nullish().describe(
|
|
12538
|
+
"Connection ID for the trigger source. Omit or pass null for no-auth triggers (e.g. Schedule by Zapier)."
|
|
12539
|
+
),
|
|
12540
|
+
/** @deprecated Use `authenticationId` instead. */
|
|
12541
|
+
authentication_id: z.string().nullish().meta({ deprecated: true }),
|
|
12542
|
+
params: z.record(z.string(), z.unknown()).optional().describe("Trigger parameters as a JSON object")
|
|
12543
|
+
}).describe(
|
|
12544
|
+
"Zapier trigger configuration. When set, the workflow subscribes to trigger events."
|
|
12545
|
+
);
|
|
12546
|
+
var PublishWorkflowVersionDescription = "Publish a new version of a durable workflow. Enables the workflow by default.";
|
|
12547
|
+
var PublishWorkflowVersionBaseSchema = z.object({
|
|
12480
12548
|
dependencies: z.record(z.string(), z.string()).optional().describe("Optional npm package dependencies"),
|
|
12481
|
-
|
|
12549
|
+
zapierDurableVersion: z.string().optional().describe(
|
|
12482
12550
|
'Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted.'
|
|
12483
12551
|
),
|
|
12552
|
+
/** @deprecated Use `zapierDurableVersion` instead. */
|
|
12553
|
+
zapier_durable_version: z.string().optional().meta({ deprecated: true }),
|
|
12484
12554
|
enabled: z.boolean().optional().describe(
|
|
12485
12555
|
"Enable the workflow after publishing. Defaults to true; pass false to publish without enabling."
|
|
12486
12556
|
),
|
|
12487
12557
|
connections: z.record(z.string(), ConnectionBindingSchema).nullish().describe(
|
|
12488
12558
|
"Map of connection aliases to Zapier connections used by the workflow. Pass `null` to clear an existing binding."
|
|
12489
12559
|
),
|
|
12490
|
-
|
|
12560
|
+
appVersions: z.record(z.string(), AppVersionBindingSchema).nullish().describe(
|
|
12491
12561
|
"Map of app keys to pinned app implementation/version used by the workflow. Pass `null` to clear an existing binding."
|
|
12492
12562
|
),
|
|
12493
|
-
|
|
12563
|
+
/** @deprecated Use `appVersions` instead. */
|
|
12564
|
+
app_versions: z.record(z.string(), AppVersionBindingSchema).nullish().meta({ deprecated: true }),
|
|
12565
|
+
trigger: TriggerConfigSchema.optional().describe(
|
|
12494
12566
|
"Trigger configuration. When provided, the workflow subscribes to a Zapier trigger; omit for webhook-only workflows."
|
|
12495
12567
|
)
|
|
12496
|
-
})
|
|
12497
|
-
|
|
12498
|
-
|
|
12568
|
+
});
|
|
12569
|
+
var WorkflowPropertySchema = z.string().uuid().describe("Durable workflow ID");
|
|
12570
|
+
var PublishWorkflowVersionSchema = z.object({
|
|
12571
|
+
workflow: WorkflowPropertySchema,
|
|
12572
|
+
sourceFiles: SourceFilesSchema
|
|
12573
|
+
}).merge(PublishWorkflowVersionBaseSchema).describe(PublishWorkflowVersionDescription).meta({
|
|
12574
|
+
aliases: {
|
|
12575
|
+
source_files: "sourceFiles",
|
|
12576
|
+
zapier_durable_version: "zapierDurableVersion",
|
|
12577
|
+
app_versions: "appVersions"
|
|
12578
|
+
}
|
|
12579
|
+
});
|
|
12580
|
+
var PublishWorkflowVersionSchemaDeprecated = z.object({
|
|
12581
|
+
workflow: WorkflowPropertySchema,
|
|
12582
|
+
source_files: SourceFilesSchema
|
|
12583
|
+
}).merge(PublishWorkflowVersionBaseSchema);
|
|
12584
|
+
var PublishWorkflowVersionOptionsSchema = z.union([PublishWorkflowVersionSchema, PublishWorkflowVersionSchemaDeprecated]).describe(PublishWorkflowVersionDescription);
|
|
12499
12585
|
var PublishWorkflowVersionResponseSchema = z.object({
|
|
12500
12586
|
id: z.string().describe("Workflow version ID (UUID)"),
|
|
12501
12587
|
workflow_id: z.string().describe("Parent workflow ID (UUID)"),
|
|
@@ -12509,11 +12595,30 @@ var PublishWorkflowVersionResponseSchema = z.object({
|
|
|
12509
12595
|
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
12510
12596
|
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
12511
12597
|
),
|
|
12512
|
-
connections: z.record(z.string(),
|
|
12513
|
-
app_versions: z.record(z.string(),
|
|
12598
|
+
connections: z.record(z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
12599
|
+
app_versions: z.record(z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
12514
12600
|
});
|
|
12515
12601
|
|
|
12516
12602
|
// src/plugins/codeSubstrate/publishWorkflowVersion/index.ts
|
|
12603
|
+
function toWireTrigger(trigger) {
|
|
12604
|
+
const selectedApi = trigger.selectedApi ?? trigger.selected_api;
|
|
12605
|
+
if (selectedApi === void 0) {
|
|
12606
|
+
throw new ZapierValidationError("trigger is missing selectedApi");
|
|
12607
|
+
}
|
|
12608
|
+
const wire = {
|
|
12609
|
+
selected_api: selectedApi,
|
|
12610
|
+
action: trigger.action
|
|
12611
|
+
};
|
|
12612
|
+
if ("authenticationId" in trigger) {
|
|
12613
|
+
wire.authentication_id = trigger.authenticationId;
|
|
12614
|
+
} else if ("authentication_id" in trigger) {
|
|
12615
|
+
wire.authentication_id = trigger.authentication_id;
|
|
12616
|
+
}
|
|
12617
|
+
if (trigger.params !== void 0) {
|
|
12618
|
+
wire.params = trigger.params;
|
|
12619
|
+
}
|
|
12620
|
+
return wire;
|
|
12621
|
+
}
|
|
12517
12622
|
var publishWorkflowVersionPlugin = definePlugin(
|
|
12518
12623
|
(sdk) => createPluginMethod(sdk, {
|
|
12519
12624
|
...codeSubstrateDefaults,
|
|
@@ -12524,26 +12629,31 @@ var publishWorkflowVersionPlugin = definePlugin(
|
|
|
12524
12629
|
outputSchema: PublishWorkflowVersionResponseSchema,
|
|
12525
12630
|
resolvers: { workflow: workflowIdResolver },
|
|
12526
12631
|
handler: async ({ sdk: sdk2, options }) => {
|
|
12527
|
-
const
|
|
12528
|
-
|
|
12529
|
-
|
|
12632
|
+
const sourceFiles = "sourceFiles" in options ? options.sourceFiles : options.source_files;
|
|
12633
|
+
const zapierDurableVersion = options.zapierDurableVersion ?? options.zapier_durable_version;
|
|
12634
|
+
const appVersions = "appVersions" in options ? options.appVersions : options.app_versions;
|
|
12635
|
+
const body = { source_files: sourceFiles };
|
|
12530
12636
|
if (options.dependencies !== void 0) {
|
|
12531
12637
|
body.dependencies = options.dependencies;
|
|
12532
12638
|
}
|
|
12533
|
-
if (
|
|
12534
|
-
body.zapier_durable_version =
|
|
12639
|
+
if (zapierDurableVersion !== void 0) {
|
|
12640
|
+
body.zapier_durable_version = zapierDurableVersion;
|
|
12535
12641
|
}
|
|
12536
12642
|
if (options.enabled !== void 0) {
|
|
12537
12643
|
body.enabled = options.enabled;
|
|
12538
12644
|
}
|
|
12539
|
-
if (options.connections
|
|
12540
|
-
body.connections =
|
|
12645
|
+
if (options.connections === null) {
|
|
12646
|
+
body.connections = null;
|
|
12647
|
+
} else if (options.connections !== void 0) {
|
|
12648
|
+
body.connections = toWireConnections(options.connections);
|
|
12541
12649
|
}
|
|
12542
|
-
if (
|
|
12543
|
-
body.app_versions =
|
|
12650
|
+
if (appVersions === null) {
|
|
12651
|
+
body.app_versions = null;
|
|
12652
|
+
} else if (appVersions !== void 0) {
|
|
12653
|
+
body.app_versions = toWireAppVersions(appVersions);
|
|
12544
12654
|
}
|
|
12545
12655
|
if (options.trigger !== void 0) {
|
|
12546
|
-
body.trigger = options.trigger;
|
|
12656
|
+
body.trigger = toWireTrigger(options.trigger);
|
|
12547
12657
|
}
|
|
12548
12658
|
const raw = await sdk2.context.api.post(
|
|
12549
12659
|
`/durableworkflowzaps/api/v0/workflows/${encodeURIComponent(options.workflow)}/versions`,
|
|
@@ -12570,8 +12680,8 @@ var WorkflowVersionListItemSchema = z.object({
|
|
|
12570
12680
|
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
12571
12681
|
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
12572
12682
|
),
|
|
12573
|
-
connections: z.record(z.string(),
|
|
12574
|
-
app_versions: z.record(z.string(),
|
|
12683
|
+
connections: z.record(z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
12684
|
+
app_versions: z.record(z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
12575
12685
|
});
|
|
12576
12686
|
var ListWorkflowVersionsOptionsSchema = z.object({
|
|
12577
12687
|
workflow: z.string().uuid().describe("Durable workflow ID"),
|
|
@@ -12643,8 +12753,8 @@ var GetWorkflowVersionResponseSchema = z.object({
|
|
|
12643
12753
|
trigger: WorkflowVersionTriggerConfigSchema.nullable().describe(
|
|
12644
12754
|
"Trigger configuration persisted on this version, or null for webhook-only workflows."
|
|
12645
12755
|
),
|
|
12646
|
-
connections: z.record(z.string(),
|
|
12647
|
-
app_versions: z.record(z.string(),
|
|
12756
|
+
connections: z.record(z.string(), ConnectionBindingSchema2).nullable().describe("Connection aliases bound on this version (or null)."),
|
|
12757
|
+
app_versions: z.record(z.string(), AppVersionBindingSchema2).nullable().describe("App-version pins bound on this version (or null).")
|
|
12648
12758
|
});
|
|
12649
12759
|
|
|
12650
12760
|
// src/plugins/codeSubstrate/getWorkflowVersion/index.ts
|
|
@@ -2432,10 +2432,11 @@ interface ApiClientOptions {
|
|
|
2432
2432
|
maxApprovalRetries?: number;
|
|
2433
2433
|
/**
|
|
2434
2434
|
* Identifies the wrapping package that built this client (e.g., the CLI or
|
|
2435
|
-
* MCP server). When set, emitted as `
|
|
2436
|
-
* `
|
|
2437
|
-
* `
|
|
2438
|
-
* `
|
|
2435
|
+
* MCP server). When set, emitted as `zapier-sdk-package` /
|
|
2436
|
+
* `zapier-sdk-package-version` telemetry headers (plus the legacy
|
|
2437
|
+
* `x-zapier-sdk-package` / `x-zapier-sdk-package-version` for backward
|
|
2438
|
+
* compatibility). Omitted by direct `createZapierSdk` callers — their
|
|
2439
|
+
* identity is captured by `zapier-sdk-version` alone.
|
|
2439
2440
|
*/
|
|
2440
2441
|
callerPackage?: {
|
|
2441
2442
|
name: string;
|
|
@@ -2432,10 +2432,11 @@ interface ApiClientOptions {
|
|
|
2432
2432
|
maxApprovalRetries?: number;
|
|
2433
2433
|
/**
|
|
2434
2434
|
* Identifies the wrapping package that built this client (e.g., the CLI or
|
|
2435
|
-
* MCP server). When set, emitted as `
|
|
2436
|
-
* `
|
|
2437
|
-
* `
|
|
2438
|
-
* `
|
|
2435
|
+
* MCP server). When set, emitted as `zapier-sdk-package` /
|
|
2436
|
+
* `zapier-sdk-package-version` telemetry headers (plus the legacy
|
|
2437
|
+
* `x-zapier-sdk-package` / `x-zapier-sdk-package-version` for backward
|
|
2438
|
+
* compatibility). Omitted by direct `createZapierSdk` callers — their
|
|
2439
|
+
* identity is captured by `zapier-sdk-version` alone.
|
|
2439
2440
|
*/
|
|
2440
2441
|
callerPackage?: {
|
|
2441
2442
|
name: string;
|
package/dist/index.cjs
CHANGED
|
@@ -6880,7 +6880,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
|
|
|
6880
6880
|
}
|
|
6881
6881
|
|
|
6882
6882
|
// src/sdk-version.ts
|
|
6883
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6883
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.73.1" : void 0) || "unknown";
|
|
6884
6884
|
|
|
6885
6885
|
// src/utils/open-url.ts
|
|
6886
6886
|
var nodePrefix = "node:";
|
|
@@ -7585,15 +7585,24 @@ var ZapierApiClient = class {
|
|
|
7585
7585
|
// Applied at the outbound layer (after caller-supplied header merging) so
|
|
7586
7586
|
// they always reflect the SDK's actual identity and can't be spoofed via
|
|
7587
7587
|
// options.headers.
|
|
7588
|
+
//
|
|
7589
|
+
// We emit both the standard `zapier-*` names (per the API header guidance the
|
|
7590
|
+
// gateway now expects) and the legacy `x-zapier-*` names. The legacy names are
|
|
7591
|
+
// kept for backward compatibility with consumers that haven't migrated yet;
|
|
7592
|
+
// they can be removed once nothing reads them.
|
|
7588
7593
|
applyTelemetryHeaders(headers) {
|
|
7594
|
+
headers.set("zapier-sdk-version", SDK_VERSION);
|
|
7589
7595
|
headers.set("x-zapier-sdk-version", SDK_VERSION);
|
|
7590
7596
|
const sdkService = getZapierSdkService();
|
|
7591
7597
|
if (sdkService) {
|
|
7598
|
+
headers.set("zapier-service", sdkService);
|
|
7592
7599
|
headers.set("x-zapier-service", sdkService);
|
|
7593
7600
|
}
|
|
7594
7601
|
const callerPackage = this.options.callerPackage;
|
|
7595
7602
|
if (callerPackage) {
|
|
7603
|
+
headers.set("zapier-sdk-package", callerPackage.name);
|
|
7596
7604
|
headers.set("x-zapier-sdk-package", callerPackage.name);
|
|
7605
|
+
headers.set("zapier-sdk-package-version", callerPackage.version);
|
|
7597
7606
|
headers.set("x-zapier-sdk-package-version", callerPackage.version);
|
|
7598
7607
|
}
|
|
7599
7608
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { H as Action, f as ActionEntry, cf as ActionExecutionOptions, Q as ActionExecutionResult, S as ActionField, V as ActionFieldChoice, aT as ActionItem, bt as ActionKeyProperty, b1 as ActionKeyPropertySchema, bu as ActionProperty, b2 as ActionPropertySchema, aH as ActionResolverItem, bF as ActionTimeoutMsProperty, bd as ActionTimeoutMsPropertySchema, aI as ActionTypeItem, bs as ActionTypeProperty, b0 as ActionTypePropertySchema, d as AddActionEntryOptions, e as AddActionEntryResult, A as ApiClient, cb as ApiError, dF as ApiEvent, cZ as ApiPluginOptions, c$ as ApiPluginProvides, I as App, cg as AppFactoryInput, aR as AppItem, bq as AppKeyProperty, a_ as AppKeyPropertySchema, br as AppProperty, a$ as AppPropertySchema, eP as ApplicationLifecycleEventData, c7 as ApprovalStatus, ce as AppsPluginProvides, bK as AppsProperty, bi as AppsPropertySchema, a8 as ArrayResolver, dE as AuthEvent, by as AuthenticationIdProperty, b5 as AuthenticationIdPropertySchema, eX as BaseEvent, av as BaseSdkOptionsSchema, aj as BatchOptions, cM as CONTEXT_CACHE_MAX_SIZE, cL as CONTEXT_CACHE_TTL_MS, az as CORE_ERROR_SYMBOL, K as Choice, dL as ClientCredentialsObject, dW as ClientCredentialsObjectSchema, _ as Connection, e2 as ConnectionEntry, e1 as ConnectionEntrySchema, bw as ConnectionIdProperty, b4 as ConnectionIdPropertySchema, aS as ConnectionItem, bx as ConnectionProperty, b6 as ConnectionPropertySchema, e4 as ConnectionsMap, e3 as ConnectionsMapSchema, e6 as ConnectionsPluginProvides, bM as ConnectionsProperty, bk as ConnectionsPropertySchema, $ as ConnectionsResponse, aA as CoreErrorCode, cy as CreateClientCredentialsPluginProvides, ex as CreateTableFieldsPluginProvides, er as CreateTablePluginProvides, eF as CreateTableRecordsPluginProvides, dI as Credentials, d$ as CredentialsFunction, d_ as CredentialsFunctionSchema, dK as CredentialsObject, dY as CredentialsObjectSchema, e0 as CredentialsSchema, eb as DEFAULT_ACTION_TIMEOUT_MS, ek as DEFAULT_APPROVAL_TIMEOUT_MS, cV as DEFAULT_CONFIG_PATH, el as DEFAULT_MAX_APPROVAL_RETRIES, ea as DEFAULT_PAGE_SIZE, bD as DebugProperty, bb as DebugPropertySchema, cA as DeleteClientCredentialsPluginProvides, ez as DeleteTableFieldsPluginProvides, et as DeleteTablePluginProvides, eH as DeleteTableRecordsPluginProvides, u as DrainTriggerInboxCallback, v as DrainTriggerInboxErrorObserver, D as DrainTriggerInboxOptions, ab as DynamicListResolver, m as DynamicResolver, ac as DynamicSearchResolver, eQ as EnhancedErrorEventData, bS as ErrorOptions, dH as EventCallback, eO as EventContext, eL as EventEmissionConfig, E as EventEmissionContext, eN as EventEmissionProvides, ci as FetchPluginProvides, J as Field, bJ as FieldsProperty, bh as FieldsPropertySchema, ad as FieldsResolver, F as FieldsetItem, y as FindFirstAuthenticationPluginProvides, cI as FindFirstConnectionPluginProvides, z as FindUniqueAuthenticationPluginProvides, cK as FindUniqueConnectionPluginProvides, a6 as FormattedItem, au as FunctionDeprecation, at as FunctionRegistryEntry, cs as GetActionInputFieldsSchemaPluginProvides, cE as GetActionPluginProvides, cC as GetAppPluginProvides, x as GetAuthenticationPluginProvides, cG as GetConnectionPluginProvides, cY as GetProfilePluginProvides, ep as GetTablePluginProvides, eB as GetTableRecordPluginProvides, aV as InfoFieldItem, aU as InputFieldItem, bv as InputFieldProperty, b3 as InputFieldPropertySchema, bz as InputsProperty, b7 as InputsPropertySchema, aQ as JsonSseMessage, bR as LeaseLimitProperty, bp as LeaseLimitPropertySchema, bP as LeaseProperty, bn as LeasePropertySchema, bQ as LeaseSecondsProperty, bo as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bA as LimitProperty, b8 as LimitPropertySchema, cq as ListActionInputFieldChoicesPluginProvides, co as ListActionInputFieldsPluginProvides, cm as ListActionsPluginProvides, ck as ListAppsPluginProvides, w as ListAuthenticationsPluginProvides, cw as ListClientCredentialsPluginProvides, cu as ListConnectionsPluginProvides, ev as ListTableFieldsPluginProvides, eD as ListTableRecordsPluginProvides, en as ListTablesPluginProvides, dG as LoadingEvent, ee as MAX_CONCURRENCY_LIMIT, e9 as MAX_PAGE_LIMIT, b as Manifest, cW as ManifestEntry, cR as ManifestPluginOptions, cU as ManifestPluginProvides, eY as MethodCalledEvent, eR as MethodCalledEventData, N as Need, X as NeedsRequest, Y as NeedsResponse, bB as OffsetProperty, b9 as OffsetPropertySchema, O as OutputFormatter, bC as OutputProperty, ba as OutputPropertySchema, aZ as PaginatedSdkFunction, i as PaginatedSdkResult, bE as ParamsProperty, bc as ParamsPropertySchema, dM as PkceCredentialsObject, dX as PkceCredentialsObjectSchema, aB as Plugin, a as PluginMeta, aC as PluginProvides, aL as PollOptions, k as PositionalMetadata, c5 as RateLimitInfo, bH as RecordProperty, bf as RecordPropertySchema, bI as RecordsProperty, bg as RecordsPropertySchema, ao as RelayFetchSchema, an as RelayRequestSchema, aK as RequestOptions, cQ as RequestPluginProvides, dr as ResolveAuthTokenOptions, dR as ResolveCredentialsOptions, R as ResolvedAppLocator, dJ as ResolvedCredentials, dZ as ResolvedCredentialsSchema, a7 as Resolver, a9 as ResolverMetadata, aW as RootFieldItem, cO as RunActionPluginProvides, dD as SdkEvent, aY as SdkPage, aP as SseMessage, aa as StaticResolver, bG as TableProperty, be as TablePropertySchema, bL as TablesProperty, bj as TablesPropertySchema, bO as TriggerInboxNameProperty, bm as TriggerInboxNamePropertySchema, bN as TriggerInboxProperty, bl as TriggerInboxPropertySchema, T as TriggerMessageStatus, U as UpdateManifestEntryOptions, c as UpdateManifestEntryResult, eJ as UpdateTableRecordsPluginProvides, a0 as UserProfile, aX as UserProfileItem, n as WatchTriggerInboxOptions, q as WithAddPlugin, e7 as ZAPIER_BASE_URL, eg as ZAPIER_MAX_CONCURRENT_REQUESTS, ec as ZAPIER_MAX_NETWORK_RETRIES, ed as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, s as ZapierAbortDrainSignal, c3 as ZapierActionError, bY as ZapierApiError, bZ as ZapierAppNotFoundError, c8 as ZapierApprovalError, bW as ZapierAuthenticationError, c1 as ZapierBundleError, dz as ZapierCache, dA as ZapierCacheEntry, dB as ZapierCacheSetOptions, c0 as ZapierConfigurationError, c4 as ZapierConflictError, bT as ZapierError, l as ZapierFetchInitOptions, b_ as ZapierNotFoundError, c6 as ZapierRateLimitError, c9 as ZapierRelayError, t as ZapierReleaseTriggerMessageSignal, b$ as ZapierResourceNotFoundError, fa as ZapierSdk, p as ZapierSdkApps, Z as ZapierSdkOptions, cc as ZapierSignal, c2 as ZapierTimeoutError, bV as ZapierUnknownError, bU as ZapierValidationError, d2 as actionKeyResolver, d1 as actionTypeResolver, a5 as addPlugin, c_ as apiPlugin, d0 as appKeyResolver, cd as appsPlugin, d4 as authenticationIdGenericResolver, d3 as authenticationIdResolver, ai as batch, eS as buildApplicationLifecycleEvent, ak as buildCapabilityMessage, eU as buildErrorEvent, eT as buildErrorEventWithContext, eW as buildMethodCalledEvent, eK as cleanupEventListeners, ds as clearTokenCache, d8 as clientCredentialsNameResolver, d9 as clientIdResolver, aG as composePlugins, d4 as connectionIdGenericResolver, d3 as connectionIdResolver, e5 as connectionsPlugin, eV as createBaseEvent, cx as createClientCredentialsPlugin, a4 as createCorePlugin, a2 as createFunction, dC as createMemoryCache, ar as createOptionsPlugin, aF as createPaginatedPluginMethod, aE as createPluginMethod, a3 as createPluginStack, aq as createSdk, ew as createTableFieldsPlugin, eq as createTablePlugin, eE as createTableRecordsPlugin, aM as createZapierApi, as as createZapierCoreStack, f8 as createZapierSdk, f9 as createZapierSdkStack, ap as createZapierSdkWithoutRegistry, aD as definePlugin, cz as deleteClientCredentialsPlugin, ey as deleteTableFieldsPlugin, es as deleteTablePlugin, eG as deleteTableRecordsPlugin, dd as durableRunIdResolver, eM as eventEmissionPlugin, ch as fetchPlugin, cH as findFirstConnectionPlugin, g as findManifestEntry, cJ as findUniqueConnectionPlugin, ca as formatErrorMessage, eZ as generateEventId, cr as getActionInputFieldsSchemaPlugin, cD as getActionPlugin, f7 as getAgent, cB as getAppPlugin, dU as getBaseUrlFromCredentials, f3 as getCiPlatform, dV as getClientIdFromCredentials, cF as getConnectionPlugin, ay as getCoreErrorCause, ax as getCoreErrorCode, f5 as getCpuTime, e_ as getCurrentTimestamp, f4 as getMemoryUsage, aN as getOrCreateApiClient, f0 as getOsInfo, f1 as getPlatformVersions, cS as getPreferredManifestEntryKey, cX as getProfilePlugin, e$ as getReleaseId, eo as getTablePlugin, eA as getTableRecordPlugin, dw as getTokenFromCliLogin, f6 as getTtyContext, eh as getZapierApprovalMode, ej as getZapierDefaultApprovalMode, ei as getZapierOpenAutoModeApprovalsInBrowser, e8 as getZapierSdkService, du as injectCliLogin, d7 as inputFieldKeyResolver, d6 as inputsAllOptionalResolver, d5 as inputsResolver, dt as invalidateCachedToken, dy as invalidateCredentialsToken, f2 as isCi, dv as isCliLoginAvailable, dN as isClientCredentials, aw as isCoreError, dQ as isCredentialsFunction, dP as isCredentialsObject, aO as isPermanentHttpError, dO as isPkceCredentials, a1 as isPositional, cp as listActionInputFieldChoicesPlugin, cn as listActionInputFieldsPlugin, cl as listActionsPlugin, cj as listAppsPlugin, cv as listClientCredentialsPlugin, ct as listConnectionsPlugin, eu as listTableFieldsPlugin, eC as listTableRecordsPlugin, em as listTablesPlugin, al as logDeprecation, cT as manifestPlugin, ef as parseConcurrencyEnvVar, r as readManifestFromFile, aJ as registryPlugin, cP as requestPlugin, am as resetDeprecationWarnings, dx as resolveAuthToken, dT as resolveCredentials, dS as resolveCredentialsFromEnv, cN as runActionPlugin, ae as runInMethodScope, af as runWithTelemetryContext, dj as tableFieldIdsResolver, dl as tableFieldsResolver, dp as tableFiltersResolver, da as tableIdResolver, dk as tableNameResolver, dh as tableRecordIdResolver, di as tableRecordIdsResolver, dm as tableRecordsResolver, dq as tableSortResolver, dn as tableUpdateRecordsResolver, ag as toSnakeCase, ah as toTitleCase, db as triggerInboxResolver, dg as triggerMessagesResolver, eI as updateTableRecordsPlugin, dc as workflowIdResolver, df as workflowRunIdResolver, de as workflowVersionIdResolver, bX as zapierAdaptError } from './index-B43uST61.mjs';
|
|
1
|
+
export { H as Action, f as ActionEntry, cf as ActionExecutionOptions, Q as ActionExecutionResult, S as ActionField, V as ActionFieldChoice, aT as ActionItem, bt as ActionKeyProperty, b1 as ActionKeyPropertySchema, bu as ActionProperty, b2 as ActionPropertySchema, aH as ActionResolverItem, bF as ActionTimeoutMsProperty, bd as ActionTimeoutMsPropertySchema, aI as ActionTypeItem, bs as ActionTypeProperty, b0 as ActionTypePropertySchema, d as AddActionEntryOptions, e as AddActionEntryResult, A as ApiClient, cb as ApiError, dF as ApiEvent, cZ as ApiPluginOptions, c$ as ApiPluginProvides, I as App, cg as AppFactoryInput, aR as AppItem, bq as AppKeyProperty, a_ as AppKeyPropertySchema, br as AppProperty, a$ as AppPropertySchema, eP as ApplicationLifecycleEventData, c7 as ApprovalStatus, ce as AppsPluginProvides, bK as AppsProperty, bi as AppsPropertySchema, a8 as ArrayResolver, dE as AuthEvent, by as AuthenticationIdProperty, b5 as AuthenticationIdPropertySchema, eX as BaseEvent, av as BaseSdkOptionsSchema, aj as BatchOptions, cM as CONTEXT_CACHE_MAX_SIZE, cL as CONTEXT_CACHE_TTL_MS, az as CORE_ERROR_SYMBOL, K as Choice, dL as ClientCredentialsObject, dW as ClientCredentialsObjectSchema, _ as Connection, e2 as ConnectionEntry, e1 as ConnectionEntrySchema, bw as ConnectionIdProperty, b4 as ConnectionIdPropertySchema, aS as ConnectionItem, bx as ConnectionProperty, b6 as ConnectionPropertySchema, e4 as ConnectionsMap, e3 as ConnectionsMapSchema, e6 as ConnectionsPluginProvides, bM as ConnectionsProperty, bk as ConnectionsPropertySchema, $ as ConnectionsResponse, aA as CoreErrorCode, cy as CreateClientCredentialsPluginProvides, ex as CreateTableFieldsPluginProvides, er as CreateTablePluginProvides, eF as CreateTableRecordsPluginProvides, dI as Credentials, d$ as CredentialsFunction, d_ as CredentialsFunctionSchema, dK as CredentialsObject, dY as CredentialsObjectSchema, e0 as CredentialsSchema, eb as DEFAULT_ACTION_TIMEOUT_MS, ek as DEFAULT_APPROVAL_TIMEOUT_MS, cV as DEFAULT_CONFIG_PATH, el as DEFAULT_MAX_APPROVAL_RETRIES, ea as DEFAULT_PAGE_SIZE, bD as DebugProperty, bb as DebugPropertySchema, cA as DeleteClientCredentialsPluginProvides, ez as DeleteTableFieldsPluginProvides, et as DeleteTablePluginProvides, eH as DeleteTableRecordsPluginProvides, u as DrainTriggerInboxCallback, v as DrainTriggerInboxErrorObserver, D as DrainTriggerInboxOptions, ab as DynamicListResolver, m as DynamicResolver, ac as DynamicSearchResolver, eQ as EnhancedErrorEventData, bS as ErrorOptions, dH as EventCallback, eO as EventContext, eL as EventEmissionConfig, E as EventEmissionContext, eN as EventEmissionProvides, ci as FetchPluginProvides, J as Field, bJ as FieldsProperty, bh as FieldsPropertySchema, ad as FieldsResolver, F as FieldsetItem, y as FindFirstAuthenticationPluginProvides, cI as FindFirstConnectionPluginProvides, z as FindUniqueAuthenticationPluginProvides, cK as FindUniqueConnectionPluginProvides, a6 as FormattedItem, au as FunctionDeprecation, at as FunctionRegistryEntry, cs as GetActionInputFieldsSchemaPluginProvides, cE as GetActionPluginProvides, cC as GetAppPluginProvides, x as GetAuthenticationPluginProvides, cG as GetConnectionPluginProvides, cY as GetProfilePluginProvides, ep as GetTablePluginProvides, eB as GetTableRecordPluginProvides, aV as InfoFieldItem, aU as InputFieldItem, bv as InputFieldProperty, b3 as InputFieldPropertySchema, bz as InputsProperty, b7 as InputsPropertySchema, aQ as JsonSseMessage, bR as LeaseLimitProperty, bp as LeaseLimitPropertySchema, bP as LeaseProperty, bn as LeasePropertySchema, bQ as LeaseSecondsProperty, bo as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bA as LimitProperty, b8 as LimitPropertySchema, cq as ListActionInputFieldChoicesPluginProvides, co as ListActionInputFieldsPluginProvides, cm as ListActionsPluginProvides, ck as ListAppsPluginProvides, w as ListAuthenticationsPluginProvides, cw as ListClientCredentialsPluginProvides, cu as ListConnectionsPluginProvides, ev as ListTableFieldsPluginProvides, eD as ListTableRecordsPluginProvides, en as ListTablesPluginProvides, dG as LoadingEvent, ee as MAX_CONCURRENCY_LIMIT, e9 as MAX_PAGE_LIMIT, b as Manifest, cW as ManifestEntry, cR as ManifestPluginOptions, cU as ManifestPluginProvides, eY as MethodCalledEvent, eR as MethodCalledEventData, N as Need, X as NeedsRequest, Y as NeedsResponse, bB as OffsetProperty, b9 as OffsetPropertySchema, O as OutputFormatter, bC as OutputProperty, ba as OutputPropertySchema, aZ as PaginatedSdkFunction, i as PaginatedSdkResult, bE as ParamsProperty, bc as ParamsPropertySchema, dM as PkceCredentialsObject, dX as PkceCredentialsObjectSchema, aB as Plugin, a as PluginMeta, aC as PluginProvides, aL as PollOptions, k as PositionalMetadata, c5 as RateLimitInfo, bH as RecordProperty, bf as RecordPropertySchema, bI as RecordsProperty, bg as RecordsPropertySchema, ao as RelayFetchSchema, an as RelayRequestSchema, aK as RequestOptions, cQ as RequestPluginProvides, dr as ResolveAuthTokenOptions, dR as ResolveCredentialsOptions, R as ResolvedAppLocator, dJ as ResolvedCredentials, dZ as ResolvedCredentialsSchema, a7 as Resolver, a9 as ResolverMetadata, aW as RootFieldItem, cO as RunActionPluginProvides, dD as SdkEvent, aY as SdkPage, aP as SseMessage, aa as StaticResolver, bG as TableProperty, be as TablePropertySchema, bL as TablesProperty, bj as TablesPropertySchema, bO as TriggerInboxNameProperty, bm as TriggerInboxNamePropertySchema, bN as TriggerInboxProperty, bl as TriggerInboxPropertySchema, T as TriggerMessageStatus, U as UpdateManifestEntryOptions, c as UpdateManifestEntryResult, eJ as UpdateTableRecordsPluginProvides, a0 as UserProfile, aX as UserProfileItem, n as WatchTriggerInboxOptions, q as WithAddPlugin, e7 as ZAPIER_BASE_URL, eg as ZAPIER_MAX_CONCURRENT_REQUESTS, ec as ZAPIER_MAX_NETWORK_RETRIES, ed as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, s as ZapierAbortDrainSignal, c3 as ZapierActionError, bY as ZapierApiError, bZ as ZapierAppNotFoundError, c8 as ZapierApprovalError, bW as ZapierAuthenticationError, c1 as ZapierBundleError, dz as ZapierCache, dA as ZapierCacheEntry, dB as ZapierCacheSetOptions, c0 as ZapierConfigurationError, c4 as ZapierConflictError, bT as ZapierError, l as ZapierFetchInitOptions, b_ as ZapierNotFoundError, c6 as ZapierRateLimitError, c9 as ZapierRelayError, t as ZapierReleaseTriggerMessageSignal, b$ as ZapierResourceNotFoundError, fa as ZapierSdk, p as ZapierSdkApps, Z as ZapierSdkOptions, cc as ZapierSignal, c2 as ZapierTimeoutError, bV as ZapierUnknownError, bU as ZapierValidationError, d2 as actionKeyResolver, d1 as actionTypeResolver, a5 as addPlugin, c_ as apiPlugin, d0 as appKeyResolver, cd as appsPlugin, d4 as authenticationIdGenericResolver, d3 as authenticationIdResolver, ai as batch, eS as buildApplicationLifecycleEvent, ak as buildCapabilityMessage, eU as buildErrorEvent, eT as buildErrorEventWithContext, eW as buildMethodCalledEvent, eK as cleanupEventListeners, ds as clearTokenCache, d8 as clientCredentialsNameResolver, d9 as clientIdResolver, aG as composePlugins, d4 as connectionIdGenericResolver, d3 as connectionIdResolver, e5 as connectionsPlugin, eV as createBaseEvent, cx as createClientCredentialsPlugin, a4 as createCorePlugin, a2 as createFunction, dC as createMemoryCache, ar as createOptionsPlugin, aF as createPaginatedPluginMethod, aE as createPluginMethod, a3 as createPluginStack, aq as createSdk, ew as createTableFieldsPlugin, eq as createTablePlugin, eE as createTableRecordsPlugin, aM as createZapierApi, as as createZapierCoreStack, f8 as createZapierSdk, f9 as createZapierSdkStack, ap as createZapierSdkWithoutRegistry, aD as definePlugin, cz as deleteClientCredentialsPlugin, ey as deleteTableFieldsPlugin, es as deleteTablePlugin, eG as deleteTableRecordsPlugin, dd as durableRunIdResolver, eM as eventEmissionPlugin, ch as fetchPlugin, cH as findFirstConnectionPlugin, g as findManifestEntry, cJ as findUniqueConnectionPlugin, ca as formatErrorMessage, eZ as generateEventId, cr as getActionInputFieldsSchemaPlugin, cD as getActionPlugin, f7 as getAgent, cB as getAppPlugin, dU as getBaseUrlFromCredentials, f3 as getCiPlatform, dV as getClientIdFromCredentials, cF as getConnectionPlugin, ay as getCoreErrorCause, ax as getCoreErrorCode, f5 as getCpuTime, e_ as getCurrentTimestamp, f4 as getMemoryUsage, aN as getOrCreateApiClient, f0 as getOsInfo, f1 as getPlatformVersions, cS as getPreferredManifestEntryKey, cX as getProfilePlugin, e$ as getReleaseId, eo as getTablePlugin, eA as getTableRecordPlugin, dw as getTokenFromCliLogin, f6 as getTtyContext, eh as getZapierApprovalMode, ej as getZapierDefaultApprovalMode, ei as getZapierOpenAutoModeApprovalsInBrowser, e8 as getZapierSdkService, du as injectCliLogin, d7 as inputFieldKeyResolver, d6 as inputsAllOptionalResolver, d5 as inputsResolver, dt as invalidateCachedToken, dy as invalidateCredentialsToken, f2 as isCi, dv as isCliLoginAvailable, dN as isClientCredentials, aw as isCoreError, dQ as isCredentialsFunction, dP as isCredentialsObject, aO as isPermanentHttpError, dO as isPkceCredentials, a1 as isPositional, cp as listActionInputFieldChoicesPlugin, cn as listActionInputFieldsPlugin, cl as listActionsPlugin, cj as listAppsPlugin, cv as listClientCredentialsPlugin, ct as listConnectionsPlugin, eu as listTableFieldsPlugin, eC as listTableRecordsPlugin, em as listTablesPlugin, al as logDeprecation, cT as manifestPlugin, ef as parseConcurrencyEnvVar, r as readManifestFromFile, aJ as registryPlugin, cP as requestPlugin, am as resetDeprecationWarnings, dx as resolveAuthToken, dT as resolveCredentials, dS as resolveCredentialsFromEnv, cN as runActionPlugin, ae as runInMethodScope, af as runWithTelemetryContext, dj as tableFieldIdsResolver, dl as tableFieldsResolver, dp as tableFiltersResolver, da as tableIdResolver, dk as tableNameResolver, dh as tableRecordIdResolver, di as tableRecordIdsResolver, dm as tableRecordsResolver, dq as tableSortResolver, dn as tableUpdateRecordsResolver, ag as toSnakeCase, ah as toTitleCase, db as triggerInboxResolver, dg as triggerMessagesResolver, eI as updateTableRecordsPlugin, dc as workflowIdResolver, df as workflowRunIdResolver, de as workflowVersionIdResolver, bX as zapierAdaptError } from './index-D1O7Pcex.mjs';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'zod/v4/core';
|
|
4
4
|
import '@zapier/zapier-sdk-core/v0/schemas/connections';
|
package/dist/index.mjs
CHANGED
|
@@ -6878,7 +6878,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
|
|
|
6878
6878
|
}
|
|
6879
6879
|
|
|
6880
6880
|
// src/sdk-version.ts
|
|
6881
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6881
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.73.1" : void 0) || "unknown";
|
|
6882
6882
|
|
|
6883
6883
|
// src/utils/open-url.ts
|
|
6884
6884
|
var nodePrefix = "node:";
|
|
@@ -7583,15 +7583,24 @@ var ZapierApiClient = class {
|
|
|
7583
7583
|
// Applied at the outbound layer (after caller-supplied header merging) so
|
|
7584
7584
|
// they always reflect the SDK's actual identity and can't be spoofed via
|
|
7585
7585
|
// options.headers.
|
|
7586
|
+
//
|
|
7587
|
+
// We emit both the standard `zapier-*` names (per the API header guidance the
|
|
7588
|
+
// gateway now expects) and the legacy `x-zapier-*` names. The legacy names are
|
|
7589
|
+
// kept for backward compatibility with consumers that haven't migrated yet;
|
|
7590
|
+
// they can be removed once nothing reads them.
|
|
7586
7591
|
applyTelemetryHeaders(headers) {
|
|
7592
|
+
headers.set("zapier-sdk-version", SDK_VERSION);
|
|
7587
7593
|
headers.set("x-zapier-sdk-version", SDK_VERSION);
|
|
7588
7594
|
const sdkService = getZapierSdkService();
|
|
7589
7595
|
if (sdkService) {
|
|
7596
|
+
headers.set("zapier-service", sdkService);
|
|
7590
7597
|
headers.set("x-zapier-service", sdkService);
|
|
7591
7598
|
}
|
|
7592
7599
|
const callerPackage = this.options.callerPackage;
|
|
7593
7600
|
if (callerPackage) {
|
|
7601
|
+
headers.set("zapier-sdk-package", callerPackage.name);
|
|
7594
7602
|
headers.set("x-zapier-sdk-package", callerPackage.name);
|
|
7603
|
+
headers.set("zapier-sdk-package-version", callerPackage.version);
|
|
7595
7604
|
headers.set("x-zapier-sdk-package-version", callerPackage.version);
|
|
7596
7605
|
}
|
|
7597
7606
|
}
|
|
@@ -56,21 +56,60 @@ export declare const publishWorkflowVersionPlugin: (sdk: {
|
|
|
56
56
|
};
|
|
57
57
|
}) => {
|
|
58
58
|
publishWorkflowVersion: (options?: {
|
|
59
|
+
workflow: string;
|
|
60
|
+
sourceFiles: Record<string, string>;
|
|
61
|
+
dependencies?: Record<string, string> | undefined;
|
|
62
|
+
zapierDurableVersion?: string | undefined;
|
|
63
|
+
zapier_durable_version?: string | undefined;
|
|
64
|
+
enabled?: boolean | undefined;
|
|
65
|
+
connections?: Record<string, {
|
|
66
|
+
connectionId?: string | number | undefined;
|
|
67
|
+
connection_id?: string | number | undefined;
|
|
68
|
+
}> | null | undefined;
|
|
69
|
+
appVersions?: Record<string, {
|
|
70
|
+
implementationName?: string | undefined;
|
|
71
|
+
implementation_name?: string | undefined;
|
|
72
|
+
version?: string | undefined;
|
|
73
|
+
}> | null | undefined;
|
|
74
|
+
app_versions?: Record<string, {
|
|
75
|
+
implementationName?: string | undefined;
|
|
76
|
+
implementation_name?: string | undefined;
|
|
77
|
+
version?: string | undefined;
|
|
78
|
+
}> | null | undefined;
|
|
79
|
+
trigger?: {
|
|
80
|
+
action: string;
|
|
81
|
+
selectedApi?: string | undefined;
|
|
82
|
+
selected_api?: string | undefined;
|
|
83
|
+
authenticationId?: string | null | undefined;
|
|
84
|
+
authentication_id?: string | null | undefined;
|
|
85
|
+
params?: Record<string, unknown> | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
} | {
|
|
59
88
|
workflow: string;
|
|
60
89
|
source_files: Record<string, string>;
|
|
61
90
|
dependencies?: Record<string, string> | undefined;
|
|
91
|
+
zapierDurableVersion?: string | undefined;
|
|
62
92
|
zapier_durable_version?: string | undefined;
|
|
63
93
|
enabled?: boolean | undefined;
|
|
64
94
|
connections?: Record<string, {
|
|
65
|
-
|
|
95
|
+
connectionId?: string | number | undefined;
|
|
96
|
+
connection_id?: string | number | undefined;
|
|
97
|
+
}> | null | undefined;
|
|
98
|
+
appVersions?: Record<string, {
|
|
99
|
+
implementationName?: string | undefined;
|
|
100
|
+
implementation_name?: string | undefined;
|
|
101
|
+
version?: string | undefined;
|
|
66
102
|
}> | null | undefined;
|
|
67
103
|
app_versions?: Record<string, {
|
|
68
|
-
|
|
104
|
+
implementationName?: string | undefined;
|
|
105
|
+
implementation_name?: string | undefined;
|
|
69
106
|
version?: string | undefined;
|
|
70
107
|
}> | null | undefined;
|
|
71
108
|
trigger?: {
|
|
72
|
-
selected_api: string;
|
|
73
109
|
action: string;
|
|
110
|
+
selectedApi?: string | undefined;
|
|
111
|
+
selected_api?: string | undefined;
|
|
112
|
+
authenticationId?: string | null | undefined;
|
|
74
113
|
authentication_id?: string | null | undefined;
|
|
75
114
|
params?: Record<string, unknown> | undefined;
|
|
76
115
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/publishWorkflowVersion/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/codeSubstrate/publishWorkflowVersion/index.ts"],"names":[],"mappings":"AA6CA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DxC,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG,UAAU,CAC3D,OAAO,4BAA4B,CACpC,CAAC"}
|