@zapier/zapier-sdk 0.93.0 → 0.94.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 +20 -0
- package/README.md +70 -0
- package/dist/{chunk-S2WSKNCP.cjs → chunk-7NCOFRA6.cjs} +1152 -1006
- package/dist/{chunk-DSWOSGEW.mjs → chunk-XETAS26U.mjs} +1150 -1007
- package/dist/experimental.cjs +389 -377
- package/dist/experimental.d.mts +149 -7
- package/dist/experimental.d.ts +149 -7
- package/dist/experimental.mjs +2 -2
- package/dist/{index-BUPBfgvQ.d.mts → index-DsMsmowr.d.mts} +304 -11
- package/dist/{index-BUPBfgvQ.d.ts → index-DsMsmowr.d.ts} +304 -11
- package/dist/index.cjs +285 -273
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -4217,6 +4217,7 @@ function getZapierSdkService() {
|
|
|
4217
4217
|
var MAX_PAGE_LIMIT = 1e4;
|
|
4218
4218
|
var DEFAULT_PAGE_SIZE = 100;
|
|
4219
4219
|
var DEFAULT_ACTION_TIMEOUT_MILLISECONDS = 18e4;
|
|
4220
|
+
var ACTION_RUNS_PATH = "/zapier/api/actions/v1/runs";
|
|
4220
4221
|
function parseIntEnvVar(name) {
|
|
4221
4222
|
const value = globalThis.process?.env?.[name];
|
|
4222
4223
|
if (value === void 0) return void 0;
|
|
@@ -4510,6 +4511,7 @@ var ZapierRelayError = class extends ZapierError {
|
|
|
4510
4511
|
super(message, options);
|
|
4511
4512
|
this.name = "ZapierRelayError";
|
|
4512
4513
|
this.code = "ZAPIER_RELAY_ERROR";
|
|
4514
|
+
if (options.retryable !== void 0) this.retryable = options.retryable;
|
|
4513
4515
|
}
|
|
4514
4516
|
};
|
|
4515
4517
|
function hasZapierErrorCode(value, code) {
|
|
@@ -6190,7 +6192,7 @@ function parseDeprecationDate(value) {
|
|
|
6190
6192
|
}
|
|
6191
6193
|
|
|
6192
6194
|
// src/sdk-version.ts
|
|
6193
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6195
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.94.1" : void 0) || "unknown";
|
|
6194
6196
|
|
|
6195
6197
|
// src/utils/open-url.ts
|
|
6196
6198
|
var nodePrefix = "node:";
|
|
@@ -7062,7 +7064,7 @@ var ZapierApiClient = class {
|
|
|
7062
7064
|
requiredScopes: options.requiredScopes
|
|
7063
7065
|
});
|
|
7064
7066
|
if (typeof result === "string") {
|
|
7065
|
-
if (result === "" && (method === "DELETE" || response.status === 204)) {
|
|
7067
|
+
if (result === "" && (method === "DELETE" || response.status === 204 || response.status === 202)) {
|
|
7066
7068
|
return void 0;
|
|
7067
7069
|
}
|
|
7068
7070
|
throw new ZapierValidationError(
|
|
@@ -8458,8 +8460,20 @@ var fetchPlugin = defineMethod({
|
|
|
8458
8460
|
});
|
|
8459
8461
|
const relayError = result.headers.get("x-relay-error");
|
|
8460
8462
|
if (relayError) {
|
|
8463
|
+
const relayErrorCode = result.headers.get("x-relay-error-code");
|
|
8464
|
+
const retryableHeader = result.headers.get("x-relay-error-retryable");
|
|
8465
|
+
const retryable = retryableHeader === "true" ? true : retryableHeader === "false" ? false : void 0;
|
|
8461
8466
|
throw new ZapierRelayError(relayError, {
|
|
8462
|
-
statusCode: result.status
|
|
8467
|
+
statusCode: result.status,
|
|
8468
|
+
retryable,
|
|
8469
|
+
errors: relayErrorCode ? [
|
|
8470
|
+
{
|
|
8471
|
+
status: result.status,
|
|
8472
|
+
code: relayErrorCode,
|
|
8473
|
+
title: "API Proxy Error",
|
|
8474
|
+
detail: relayError
|
|
8475
|
+
}
|
|
8476
|
+
] : void 0
|
|
8463
8477
|
});
|
|
8464
8478
|
}
|
|
8465
8479
|
return result;
|
|
@@ -8536,538 +8550,166 @@ var actionResultItemFormatter = defineFormatter({
|
|
|
8536
8550
|
};
|
|
8537
8551
|
}
|
|
8538
8552
|
});
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
}
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
)
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8553
|
+
|
|
8554
|
+
// src/resolvers/appKey.ts
|
|
8555
|
+
var getAppRef = declareMethod({ id: "getApp" });
|
|
8556
|
+
var listAppsRef = declareMethod({ id: "listApps" });
|
|
8557
|
+
var appKeyResolver = defineResolver({
|
|
8558
|
+
imports: [getAppRef, listAppsRef],
|
|
8559
|
+
inputType: "search",
|
|
8560
|
+
placeholder: "e.g., 'slack' or 'SlackCLIAPI' or 'mail'",
|
|
8561
|
+
// Try the typed string as an exact app locator (getApp accepts slug, key, or
|
|
8562
|
+
// implementation id). On a hit, resolve with the input as-is and skip the
|
|
8563
|
+
// picker — every variant the user could type is already a valid value
|
|
8564
|
+
// wherever `app` is required, so no canonicalization is needed. A 404 falls
|
|
8565
|
+
// through to the search list; any other error (auth, network, rate-limit)
|
|
8566
|
+
// propagates. ZapierAppNotFoundError and ZapierNotFoundError are independent
|
|
8567
|
+
// siblings, so both are checked.
|
|
8568
|
+
tryResolveFromSearch: async ({ imports, search }) => {
|
|
8569
|
+
if (!search) return null;
|
|
8570
|
+
try {
|
|
8571
|
+
await imports.getApp({ app: search });
|
|
8572
|
+
return { resolvedValue: search };
|
|
8573
|
+
} catch (err) {
|
|
8574
|
+
if (!isZapierAppNotFoundError(err) && !isZapierNotFoundError(err)) {
|
|
8575
|
+
throw err;
|
|
8576
|
+
}
|
|
8577
|
+
return null;
|
|
8578
|
+
}
|
|
8579
|
+
},
|
|
8580
|
+
listItems: ({
|
|
8581
|
+
imports,
|
|
8582
|
+
search,
|
|
8583
|
+
cursor
|
|
8584
|
+
}) => imports.listApps({ search, cursor }),
|
|
8585
|
+
prompt: ({ items }) => ({
|
|
8586
|
+
type: "list",
|
|
8587
|
+
message: "Select app:",
|
|
8588
|
+
choices: items.map((app) => ({
|
|
8589
|
+
label: app.title || app.key,
|
|
8590
|
+
hint: app.title ? getAppKeyList(app) : void 0,
|
|
8591
|
+
value: app.key
|
|
8592
|
+
}))
|
|
8593
|
+
})
|
|
8579
8594
|
});
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
|
|
8589
|
-
|
|
8590
|
-
|
|
8591
|
-
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
searchfill: z.string().optional(),
|
|
8602
|
-
send_in_json: z.boolean().optional(),
|
|
8603
|
-
regex: z.string().optional(),
|
|
8604
|
-
type: z.enum([
|
|
8605
|
-
"integer",
|
|
8606
|
-
"string",
|
|
8607
|
-
"text",
|
|
8608
|
-
"datetime",
|
|
8609
|
-
"boolean",
|
|
8610
|
-
"file",
|
|
8611
|
-
"decimal",
|
|
8612
|
-
"copy",
|
|
8613
|
-
"password",
|
|
8614
|
-
"dict",
|
|
8615
|
-
"code",
|
|
8616
|
-
"filter",
|
|
8617
|
-
"json"
|
|
8618
|
-
]).optional(),
|
|
8619
|
-
list: z.boolean().optional()
|
|
8595
|
+
|
|
8596
|
+
// src/resolvers/actionType.ts
|
|
8597
|
+
var listActionsRef = declareMethod({ id: "listActions" });
|
|
8598
|
+
var actionTypeResolver = defineResolver({
|
|
8599
|
+
imports: [listActionsRef],
|
|
8600
|
+
requireParameters: ["app"],
|
|
8601
|
+
listItems: async ({
|
|
8602
|
+
imports,
|
|
8603
|
+
input
|
|
8604
|
+
}) => {
|
|
8605
|
+
const types = /* @__PURE__ */ new Set();
|
|
8606
|
+
for await (const action of imports.listActions({ app: input.app }).items()) {
|
|
8607
|
+
types.add(action.action_type);
|
|
8608
|
+
}
|
|
8609
|
+
return { data: [...types].map((type) => ({ key: type, name: type })) };
|
|
8610
|
+
},
|
|
8611
|
+
prompt: ({ items }) => ({
|
|
8612
|
+
type: "list",
|
|
8613
|
+
message: "Select action type:",
|
|
8614
|
+
choices: items.map((type) => ({ label: type.name, value: type.key }))
|
|
8615
|
+
})
|
|
8620
8616
|
});
|
|
8621
|
-
|
|
8622
|
-
|
|
8617
|
+
|
|
8618
|
+
// src/resolvers/actionKey.ts
|
|
8619
|
+
var listActionsRef2 = declareMethod({ id: "listActions" });
|
|
8620
|
+
var actionKeyResolver = defineResolver({
|
|
8621
|
+
imports: [listActionsRef2],
|
|
8622
|
+
requireParameters: ["app", "actionType"],
|
|
8623
|
+
listItems: async ({
|
|
8624
|
+
imports,
|
|
8625
|
+
input,
|
|
8626
|
+
cursor
|
|
8627
|
+
}) => {
|
|
8628
|
+
const page = await imports.listActions({ app: input.app, cursor });
|
|
8629
|
+
return {
|
|
8630
|
+
data: page.data.filter(
|
|
8631
|
+
(action) => action.action_type === input.actionType && !action.is_hidden
|
|
8632
|
+
),
|
|
8633
|
+
nextCursor: page.nextCursor
|
|
8634
|
+
};
|
|
8635
|
+
},
|
|
8636
|
+
prompt: ({ items }) => ({
|
|
8637
|
+
type: "list",
|
|
8638
|
+
message: "Select action:",
|
|
8639
|
+
choices: items.map((action) => ({
|
|
8640
|
+
label: action.title || action.name || action.key,
|
|
8641
|
+
hint: action.description || void 0,
|
|
8642
|
+
value: action.key
|
|
8643
|
+
}))
|
|
8644
|
+
})
|
|
8623
8645
|
});
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
}
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
}
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
public_id: z.string().optional(),
|
|
8692
|
-
code: z.string(),
|
|
8693
|
-
user_id: z.number(),
|
|
8694
|
-
auto_provisioned: z.boolean(),
|
|
8695
|
-
first_name: z.string(),
|
|
8696
|
-
last_name: z.string(),
|
|
8697
|
-
username: z.string(),
|
|
8698
|
-
personas: z.string(),
|
|
8699
|
-
user_generated_personas: z.string(),
|
|
8700
|
-
last_login: z.string(),
|
|
8701
|
-
email: z.string(),
|
|
8702
|
-
email_hash: z.string(),
|
|
8703
|
-
email_confirmed: z.boolean(),
|
|
8704
|
-
timezone: z.string(),
|
|
8705
|
-
photo_url: z.string(),
|
|
8706
|
-
has_seen_notifications: z.record(z.string(), z.boolean().nullable()),
|
|
8707
|
-
signup: z.string(),
|
|
8708
|
-
since_signup: z.string(),
|
|
8709
|
-
has_activated: z.boolean(),
|
|
8710
|
-
enable_gz_creator: z.boolean(),
|
|
8711
|
-
should_see_nps_survey: z.boolean(),
|
|
8712
|
-
is_developer: z.boolean(),
|
|
8713
|
-
is_expert: z.boolean(),
|
|
8714
|
-
tos_agreement: z.boolean(),
|
|
8715
|
-
should_renew_tos: z.boolean(),
|
|
8716
|
-
is_gdpr_consented: z.boolean(),
|
|
8717
|
-
disable_ssl_check: z.boolean(),
|
|
8718
|
-
identity: z.number(),
|
|
8719
|
-
summary_schedule: z.string(),
|
|
8720
|
-
alert_triggers: z.string(),
|
|
8721
|
-
alert_actions: z.string(),
|
|
8722
|
-
is_staff: z.boolean(),
|
|
8723
|
-
is_zt_reviewer: z.boolean(),
|
|
8724
|
-
is_high_value: z.boolean(),
|
|
8725
|
-
is_temporary: z.boolean(),
|
|
8726
|
-
banner_message: z.string(),
|
|
8727
|
-
enable_totp_2fa: z.boolean(),
|
|
8728
|
-
viewed_help: z.record(z.string(), z.boolean()),
|
|
8729
|
-
show_editor_migration_mesaging: z.boolean(),
|
|
8730
|
-
switches: z.record(z.string(), z.unknown()),
|
|
8731
|
-
organizations: z.array(z.record(z.string(), z.unknown()).nullable()),
|
|
8732
|
-
primary_organization: z.record(z.string(), z.unknown()).nullable(),
|
|
8733
|
-
has_active_zaps: z.boolean(),
|
|
8734
|
-
has_google_sso: z.boolean(),
|
|
8735
|
-
auth_realm: z.string(),
|
|
8736
|
-
roles: z.array(
|
|
8737
|
-
z.object({
|
|
8738
|
-
account_id: z.number(),
|
|
8739
|
-
role: z.string()
|
|
8740
|
-
})
|
|
8741
|
-
)
|
|
8742
|
-
});
|
|
8743
|
-
z.object({
|
|
8744
|
-
age_in_days: z.string().optional(),
|
|
8745
|
-
api_docs_url: z.string().nullable().optional(),
|
|
8746
|
-
app_profile_url: z.string(),
|
|
8747
|
-
banner: z.string().optional(),
|
|
8748
|
-
categories: z.array(z.string()).optional(),
|
|
8749
|
-
// Service category names
|
|
8750
|
-
canonical_id: z.string().optional(),
|
|
8751
|
-
current_implementation_id: z.string(),
|
|
8752
|
-
days_since_last_update: z.string().optional(),
|
|
8753
|
-
description: z.string(),
|
|
8754
|
-
external_url: z.string(),
|
|
8755
|
-
hashtag: z.string().optional(),
|
|
8756
|
-
id: z.number().optional(),
|
|
8757
|
-
image: z.string().optional(),
|
|
8758
|
-
images: z.string().optional(),
|
|
8759
|
-
integration_overview_html: z.string().nullable().optional(),
|
|
8760
|
-
internal_id: z.string(),
|
|
8761
|
-
invite_url: z.string().nullable().optional(),
|
|
8762
|
-
is_beta: z.string().optional(),
|
|
8763
|
-
is_built_in: z.string().optional(),
|
|
8764
|
-
is_featured: z.string().optional(),
|
|
8765
|
-
is_premium: z.boolean().optional(),
|
|
8766
|
-
is_public: z.string().optional(),
|
|
8767
|
-
is_upcoming: z.string().optional(),
|
|
8768
|
-
learn_more_url: z.string(),
|
|
8769
|
-
name: z.string(),
|
|
8770
|
-
popularity: z.number(),
|
|
8771
|
-
primary_color: z.string(),
|
|
8772
|
-
request_count: z.string().optional(),
|
|
8773
|
-
slug: z.string(),
|
|
8774
|
-
zap_usage_count: z.number().nullable().optional()
|
|
8775
|
-
});
|
|
8776
|
-
var ServiceSchema = z.object({
|
|
8777
|
-
id: z.number().optional(),
|
|
8778
|
-
canonical_id: z.string().optional(),
|
|
8779
|
-
current_implementation_id: z.string(),
|
|
8780
|
-
name: z.string(),
|
|
8781
|
-
slug: z.string(),
|
|
8782
|
-
app_url: z.string().optional(),
|
|
8783
|
-
learn_more_url: z.string().optional(),
|
|
8784
|
-
description: z.string(),
|
|
8785
|
-
primary_color: z.string(),
|
|
8786
|
-
popularity: z.number(),
|
|
8787
|
-
image: z.string().optional(),
|
|
8788
|
-
images: z.string().optional()
|
|
8789
|
-
});
|
|
8790
|
-
z.object({
|
|
8791
|
-
results: z.array(ServiceSchema),
|
|
8792
|
-
next: z.string().nullable().optional(),
|
|
8793
|
-
previous: z.string().nullable().optional()
|
|
8794
|
-
});
|
|
8795
|
-
z.object({
|
|
8796
|
-
selected_api: z.string(),
|
|
8797
|
-
action: z.string(),
|
|
8798
|
-
type_of: z.string(),
|
|
8799
|
-
authentication_id: z.union([z.string(), z.number()]).optional(),
|
|
8800
|
-
params: z.record(z.string(), z.unknown()).optional()
|
|
8801
|
-
});
|
|
8802
|
-
z.object({
|
|
8803
|
-
success: z.boolean(),
|
|
8804
|
-
needs: z.array(NeedSchema).optional(),
|
|
8805
|
-
errors: z.array(z.string()).optional(),
|
|
8806
|
-
last_fetched_at: z.string().optional(),
|
|
8807
|
-
schema: z.record(z.string(), z.unknown()).optional()
|
|
8808
|
-
});
|
|
8809
|
-
var ImplementationSchema = z.object({
|
|
8810
|
-
selected_api: z.string(),
|
|
8811
|
-
app_id: z.number().optional(),
|
|
8812
|
-
auth_type: z.string().optional(),
|
|
8813
|
-
auth_fields: z.string().optional(),
|
|
8814
|
-
actions: z.array(ActionSchema).optional(),
|
|
8815
|
-
is_deprecated: z.boolean().optional(),
|
|
8816
|
-
is_private_only: z.boolean().optional(),
|
|
8817
|
-
is_invite_only: z.boolean().optional(),
|
|
8818
|
-
is_beta: z.boolean().optional().default(false),
|
|
8819
|
-
is_premium: z.boolean().optional().default(false),
|
|
8820
|
-
is_hidden: z.string().optional(),
|
|
8821
|
-
name: z.string().optional(),
|
|
8822
|
-
slug: z.string().optional(),
|
|
8823
|
-
images: z.record(z.string(), z.string().nullable()).optional(),
|
|
8824
|
-
primary_color: z.string().optional(),
|
|
8825
|
-
secondary_color: z.string().optional(),
|
|
8826
|
-
current_implementation: z.string().optional(),
|
|
8827
|
-
other_implementations: z.string().optional()
|
|
8828
|
-
});
|
|
8829
|
-
z.object({
|
|
8830
|
-
count: z.number(),
|
|
8831
|
-
next: z.string().nullable().optional(),
|
|
8832
|
-
previous: z.string().nullable().optional(),
|
|
8833
|
-
results: z.array(ImplementationSchema)
|
|
8834
|
-
});
|
|
8835
|
-
var NeedChoicesResponseMetaSchema = z.object({
|
|
8836
|
-
page: z.string().nullable().optional()
|
|
8837
|
-
});
|
|
8838
|
-
var NeedChoicesResponseLinksSchema = z.object({
|
|
8839
|
-
next: z.string().nullable().optional(),
|
|
8840
|
-
prev: z.string().nullable().optional()
|
|
8841
|
-
});
|
|
8842
|
-
z.object({
|
|
8843
|
-
selected_api: z.string().optional().describe(
|
|
8844
|
-
"Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."
|
|
8845
|
-
),
|
|
8846
|
-
authentication_id: z.union([z.string(), z.number()]).optional().describe(
|
|
8847
|
-
"If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."
|
|
8848
|
-
),
|
|
8849
|
-
params: z.record(z.string(), z.unknown()).optional().describe(
|
|
8850
|
-
"Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
|
|
8851
|
-
),
|
|
8852
|
-
page: z.number().optional().default(0),
|
|
8853
|
-
prefill: z.string().optional().describe(
|
|
8854
|
-
"The prefill string to indicate what we're fetching choices for. Likely something like `spreadsheet.id.title`. Must be provided alongside `selected_api` if both `action_id` and `input_field_id` are not."
|
|
8855
|
-
),
|
|
8856
|
-
action_id: z.string().optional().describe(
|
|
8857
|
-
"The id that will be used to lookup the Action for prefill lookup. If provided, `input_field_id` is required, else `prefill` must be provided."
|
|
8858
|
-
),
|
|
8859
|
-
input_field_id: z.string().optional().describe(
|
|
8860
|
-
"The id (key) of the input field (Need) that dynamic choices are being retrieved for. If provided, `action_id` is required, else `prefill` must be provided."
|
|
8861
|
-
)
|
|
8862
|
-
});
|
|
8863
|
-
z.object({
|
|
8864
|
-
success: z.boolean(),
|
|
8865
|
-
choices: z.array(NeedChoicesSchema).optional(),
|
|
8866
|
-
next_page: z.number().optional(),
|
|
8867
|
-
errors: z.array(z.string()).optional(),
|
|
8868
|
-
meta: NeedChoicesResponseMetaSchema.optional(),
|
|
8869
|
-
links: NeedChoicesResponseLinksSchema.optional()
|
|
8870
|
-
});
|
|
8871
|
-
|
|
8872
|
-
// src/schemas/Action.ts
|
|
8873
|
-
var ActionItemSchema = ActionSchema.omit({
|
|
8874
|
-
type: true,
|
|
8875
|
-
name: true,
|
|
8876
|
-
selected_api: true
|
|
8877
|
-
}).extend({
|
|
8878
|
-
app_key: z.string(),
|
|
8879
|
-
// App key without version (extracted from selected_api)
|
|
8880
|
-
app_version: z.string().optional(),
|
|
8881
|
-
// Version extracted from selected_api
|
|
8882
|
-
action_type: ActionSchema.shape.type,
|
|
8883
|
-
// Mapped from original 'type' field
|
|
8884
|
-
title: z.string(),
|
|
8885
|
-
// Mapped from original 'name' field
|
|
8886
|
-
type: z.literal("action")
|
|
8887
|
-
// Fixed type identifier
|
|
8888
|
-
});
|
|
8889
|
-
|
|
8890
|
-
// src/formatters/action.ts
|
|
8891
|
-
function formatActionItem(item) {
|
|
8892
|
-
const details = [{ text: `Type: ${item.action_type}`, style: "accent" }];
|
|
8893
|
-
if (item.app_key) {
|
|
8894
|
-
details.push({ text: `App: ${item.app_key}`, style: "normal" });
|
|
8895
|
-
}
|
|
8896
|
-
if (item.description) {
|
|
8897
|
-
details.push({ text: item.description, style: "dim" });
|
|
8898
|
-
}
|
|
8899
|
-
return {
|
|
8900
|
-
title: item.title || item.key,
|
|
8901
|
-
// `hint` is the dumb secondary string shown after the title (the action key
|
|
8902
|
-
// and, when present, its id). Replaces the deprecated `key`/`id` fields.
|
|
8903
|
-
hint: [item.key, item.id].filter((v) => Boolean(v)),
|
|
8904
|
-
description: item.description,
|
|
8905
|
-
details
|
|
8906
|
-
};
|
|
8907
|
-
}
|
|
8908
|
-
var actionItemFormatter = defineFormatter({
|
|
8909
|
-
format: ({ item }) => formatActionItem(item)
|
|
8910
|
-
});
|
|
8911
|
-
|
|
8912
|
-
// src/resolvers/appKey.ts
|
|
8913
|
-
var getAppRef = declareMethod({ id: "getApp" });
|
|
8914
|
-
var listAppsRef = declareMethod({ id: "listApps" });
|
|
8915
|
-
var appKeyResolver = defineResolver({
|
|
8916
|
-
imports: [getAppRef, listAppsRef],
|
|
8917
|
-
inputType: "search",
|
|
8918
|
-
placeholder: "e.g., 'slack' or 'SlackCLIAPI' or 'mail'",
|
|
8919
|
-
// Try the typed string as an exact app locator (getApp accepts slug, key, or
|
|
8920
|
-
// implementation id). On a hit, resolve with the input as-is and skip the
|
|
8921
|
-
// picker — every variant the user could type is already a valid value
|
|
8922
|
-
// wherever `app` is required, so no canonicalization is needed. A 404 falls
|
|
8923
|
-
// through to the search list; any other error (auth, network, rate-limit)
|
|
8924
|
-
// propagates. ZapierAppNotFoundError and ZapierNotFoundError are independent
|
|
8925
|
-
// siblings, so both are checked.
|
|
8926
|
-
tryResolveFromSearch: async ({ imports, search }) => {
|
|
8927
|
-
if (!search) return null;
|
|
8928
|
-
try {
|
|
8929
|
-
await imports.getApp({ app: search });
|
|
8930
|
-
return { resolvedValue: search };
|
|
8931
|
-
} catch (err) {
|
|
8932
|
-
if (!isZapierAppNotFoundError(err) && !isZapierNotFoundError(err)) {
|
|
8933
|
-
throw err;
|
|
8934
|
-
}
|
|
8935
|
-
return null;
|
|
8936
|
-
}
|
|
8937
|
-
},
|
|
8938
|
-
listItems: ({
|
|
8939
|
-
imports,
|
|
8940
|
-
search,
|
|
8941
|
-
cursor
|
|
8942
|
-
}) => imports.listApps({ search, cursor }),
|
|
8943
|
-
prompt: ({ items }) => ({
|
|
8944
|
-
type: "list",
|
|
8945
|
-
message: "Select app:",
|
|
8946
|
-
choices: items.map((app) => ({
|
|
8947
|
-
label: app.title || app.key,
|
|
8948
|
-
hint: app.title ? getAppKeyList(app) : void 0,
|
|
8949
|
-
value: app.key
|
|
8950
|
-
}))
|
|
8951
|
-
})
|
|
8952
|
-
});
|
|
8953
|
-
|
|
8954
|
-
// src/resolvers/actionType.ts
|
|
8955
|
-
var listActionsRef = declareMethod({ id: "listActions" });
|
|
8956
|
-
var actionTypeResolver = defineResolver({
|
|
8957
|
-
imports: [listActionsRef],
|
|
8958
|
-
requireParameters: ["app"],
|
|
8959
|
-
listItems: async ({
|
|
8960
|
-
imports,
|
|
8961
|
-
input
|
|
8962
|
-
}) => {
|
|
8963
|
-
const types = /* @__PURE__ */ new Set();
|
|
8964
|
-
for await (const action of imports.listActions({ app: input.app }).items()) {
|
|
8965
|
-
types.add(action.action_type);
|
|
8966
|
-
}
|
|
8967
|
-
return { data: [...types].map((type) => ({ key: type, name: type })) };
|
|
8968
|
-
},
|
|
8969
|
-
prompt: ({ items }) => ({
|
|
8970
|
-
type: "list",
|
|
8971
|
-
message: "Select action type:",
|
|
8972
|
-
choices: items.map((type) => ({ label: type.name, value: type.key }))
|
|
8973
|
-
})
|
|
8974
|
-
});
|
|
8975
|
-
|
|
8976
|
-
// src/resolvers/actionKey.ts
|
|
8977
|
-
var listActionsRef2 = declareMethod({ id: "listActions" });
|
|
8978
|
-
var actionKeyResolver = defineResolver({
|
|
8979
|
-
imports: [listActionsRef2],
|
|
8980
|
-
requireParameters: ["app", "actionType"],
|
|
8981
|
-
listItems: async ({
|
|
8982
|
-
imports,
|
|
8983
|
-
input,
|
|
8984
|
-
cursor
|
|
8985
|
-
}) => {
|
|
8986
|
-
const page = await imports.listActions({ app: input.app, cursor });
|
|
8987
|
-
return {
|
|
8988
|
-
data: page.data.filter(
|
|
8989
|
-
(action) => action.action_type === input.actionType && !action.is_hidden
|
|
8990
|
-
),
|
|
8991
|
-
nextCursor: page.nextCursor
|
|
8992
|
-
};
|
|
8993
|
-
},
|
|
8994
|
-
prompt: ({ items }) => ({
|
|
8995
|
-
type: "list",
|
|
8996
|
-
message: "Select action:",
|
|
8997
|
-
choices: items.map((action) => ({
|
|
8998
|
-
label: action.title || action.name || action.key,
|
|
8999
|
-
hint: action.description || void 0,
|
|
9000
|
-
value: action.key
|
|
9001
|
-
}))
|
|
9002
|
-
})
|
|
9003
|
-
});
|
|
9004
|
-
|
|
9005
|
-
// src/plugins/capabilities/index.ts
|
|
9006
|
-
function toDescription(key) {
|
|
9007
|
-
const words = key.replace(/^can/, "").replace(/([A-Z])/g, " $1").trim().toLowerCase();
|
|
9008
|
-
return `To ${words}`;
|
|
9009
|
-
}
|
|
9010
|
-
function toEnvVar(key) {
|
|
9011
|
-
return "ZAPIER_" + key.replace(/([A-Z])/g, "_$1").toUpperCase();
|
|
9012
|
-
}
|
|
9013
|
-
function toCliFlag(key) {
|
|
9014
|
-
return "--" + key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
9015
|
-
}
|
|
9016
|
-
function buildCapabilityMessage(key) {
|
|
9017
|
-
return [
|
|
9018
|
-
`${toDescription(key)}, use ${toCliFlag(key)} in the CLI,`,
|
|
9019
|
-
`set ${key}: true in SDK options or .zapierrc,`,
|
|
9020
|
-
`or set ${toEnvVar(key)}=true.`
|
|
9021
|
-
].join(" ");
|
|
9022
|
-
}
|
|
9023
|
-
var GATED_FLAGS = [
|
|
9024
|
-
"canIncludeSharedConnections",
|
|
9025
|
-
"canIncludeSharedTables",
|
|
9026
|
-
"canDeleteTables"
|
|
9027
|
-
];
|
|
9028
|
-
function isEnabledByEnv(key) {
|
|
9029
|
-
const value = globalThis.process?.env?.[toEnvVar(key)];
|
|
9030
|
-
if (value === void 0) return void 0;
|
|
9031
|
-
if (value === "true" || value === "1") return true;
|
|
9032
|
-
if (value === "false" || value === "0") return false;
|
|
9033
|
-
return void 0;
|
|
9034
|
-
}
|
|
9035
|
-
var CAPABILITIES_ID = "zapier/capabilities";
|
|
9036
|
-
var capabilitiesPluginRef = declareProperty({ id: CAPABILITIES_ID });
|
|
9037
|
-
var capabilitiesPlugin = defineProperty({
|
|
9038
|
-
namespace: "zapier",
|
|
9039
|
-
name: "capabilities",
|
|
9040
|
-
imports: [sdkOptionsPluginRef, manifestPluginRef],
|
|
9041
|
-
setup: ({ imports }) => {
|
|
9042
|
-
const options = imports.sdkOptions ?? {};
|
|
9043
|
-
let cached;
|
|
9044
|
-
async function resolveFlags() {
|
|
9045
|
-
if (cached) return cached;
|
|
9046
|
-
const manifest = await imports.manifest.getResolvedManifest();
|
|
9047
|
-
cached = {};
|
|
9048
|
-
for (const flag of GATED_FLAGS) {
|
|
9049
|
-
cached[flag] = Boolean(
|
|
9050
|
-
options[flag] ?? isEnabledByEnv(flag) ?? manifest?.[flag]
|
|
9051
|
-
);
|
|
9052
|
-
}
|
|
9053
|
-
return cached;
|
|
9054
|
-
}
|
|
9055
|
-
return {
|
|
9056
|
-
checkCapability: async (key) => {
|
|
9057
|
-
const flags = await resolveFlags();
|
|
9058
|
-
if (flags[key]) return;
|
|
9059
|
-
throw new ZapierConfigurationError(
|
|
9060
|
-
buildCapabilityMessage(key) + " (If you are an AI agent, you MUST NOT retry. Ask the user if they want to enable this.)",
|
|
9061
|
-
{ configType: key }
|
|
9062
|
-
);
|
|
9063
|
-
},
|
|
9064
|
-
hasCapability: async (key) => {
|
|
9065
|
-
const flags = await resolveFlags();
|
|
9066
|
-
return flags[key];
|
|
9067
|
-
}
|
|
9068
|
-
};
|
|
9069
|
-
},
|
|
9070
|
-
get: ({ state }) => state
|
|
8646
|
+
|
|
8647
|
+
// src/plugins/capabilities/index.ts
|
|
8648
|
+
function toDescription(key) {
|
|
8649
|
+
const words = key.replace(/^can/, "").replace(/([A-Z])/g, " $1").trim().toLowerCase();
|
|
8650
|
+
return `To ${words}`;
|
|
8651
|
+
}
|
|
8652
|
+
function toEnvVar(key) {
|
|
8653
|
+
return "ZAPIER_" + key.replace(/([A-Z])/g, "_$1").toUpperCase();
|
|
8654
|
+
}
|
|
8655
|
+
function toCliFlag(key) {
|
|
8656
|
+
return "--" + key.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
8657
|
+
}
|
|
8658
|
+
function buildCapabilityMessage(key) {
|
|
8659
|
+
return [
|
|
8660
|
+
`${toDescription(key)}, use ${toCliFlag(key)} in the CLI,`,
|
|
8661
|
+
`set ${key}: true in SDK options or .zapierrc,`,
|
|
8662
|
+
`or set ${toEnvVar(key)}=true.`
|
|
8663
|
+
].join(" ");
|
|
8664
|
+
}
|
|
8665
|
+
var GATED_FLAGS = [
|
|
8666
|
+
"canIncludeSharedConnections",
|
|
8667
|
+
"canIncludeSharedTables",
|
|
8668
|
+
"canDeleteTables"
|
|
8669
|
+
];
|
|
8670
|
+
function isEnabledByEnv(key) {
|
|
8671
|
+
const value = globalThis.process?.env?.[toEnvVar(key)];
|
|
8672
|
+
if (value === void 0) return void 0;
|
|
8673
|
+
if (value === "true" || value === "1") return true;
|
|
8674
|
+
if (value === "false" || value === "0") return false;
|
|
8675
|
+
return void 0;
|
|
8676
|
+
}
|
|
8677
|
+
var CAPABILITIES_ID = "zapier/capabilities";
|
|
8678
|
+
var capabilitiesPluginRef = declareProperty({ id: CAPABILITIES_ID });
|
|
8679
|
+
var capabilitiesPlugin = defineProperty({
|
|
8680
|
+
namespace: "zapier",
|
|
8681
|
+
name: "capabilities",
|
|
8682
|
+
imports: [sdkOptionsPluginRef, manifestPluginRef],
|
|
8683
|
+
setup: ({ imports }) => {
|
|
8684
|
+
const options = imports.sdkOptions ?? {};
|
|
8685
|
+
let cached;
|
|
8686
|
+
async function resolveFlags() {
|
|
8687
|
+
if (cached) return cached;
|
|
8688
|
+
const manifest = await imports.manifest.getResolvedManifest();
|
|
8689
|
+
cached = {};
|
|
8690
|
+
for (const flag of GATED_FLAGS) {
|
|
8691
|
+
cached[flag] = Boolean(
|
|
8692
|
+
options[flag] ?? isEnabledByEnv(flag) ?? manifest?.[flag]
|
|
8693
|
+
);
|
|
8694
|
+
}
|
|
8695
|
+
return cached;
|
|
8696
|
+
}
|
|
8697
|
+
return {
|
|
8698
|
+
checkCapability: async (key) => {
|
|
8699
|
+
const flags = await resolveFlags();
|
|
8700
|
+
if (flags[key]) return;
|
|
8701
|
+
throw new ZapierConfigurationError(
|
|
8702
|
+
buildCapabilityMessage(key) + " (If you are an AI agent, you MUST NOT retry. Ask the user if they want to enable this.)",
|
|
8703
|
+
{ configType: key }
|
|
8704
|
+
);
|
|
8705
|
+
},
|
|
8706
|
+
hasCapability: async (key) => {
|
|
8707
|
+
const flags = await resolveFlags();
|
|
8708
|
+
return flags[key];
|
|
8709
|
+
}
|
|
8710
|
+
};
|
|
8711
|
+
},
|
|
8712
|
+
get: ({ state }) => state
|
|
9071
8713
|
});
|
|
9072
8714
|
|
|
9073
8715
|
// src/resolvers/connectionId.ts
|
|
@@ -9751,396 +9393,768 @@ async function createFieldKeyTranslator({
|
|
|
9751
9393
|
}
|
|
9752
9394
|
}
|
|
9753
9395
|
}
|
|
9754
|
-
return key;
|
|
9396
|
+
return key;
|
|
9397
|
+
}
|
|
9398
|
+
};
|
|
9399
|
+
}
|
|
9400
|
+
|
|
9401
|
+
// src/resolvers/tableRecordId.ts
|
|
9402
|
+
var listTableRecordsRef = declareMethod({ id: "listTableRecords" });
|
|
9403
|
+
function summarizeRecord(record) {
|
|
9404
|
+
const values = Object.values(record.data);
|
|
9405
|
+
const preview = values.slice(0, 3).map((v) => formatFieldValue(v).replace(/\s+/g, " ").trim()).filter((s) => s.length > 0).join(", ");
|
|
9406
|
+
if (!preview) return void 0;
|
|
9407
|
+
return preview.length > 60 ? preview.slice(0, 57) + "..." : preview;
|
|
9408
|
+
}
|
|
9409
|
+
function recordChoices(records) {
|
|
9410
|
+
return records.map((record) => ({
|
|
9411
|
+
label: summarizeRecord(record) || record.id,
|
|
9412
|
+
value: record.id
|
|
9413
|
+
}));
|
|
9414
|
+
}
|
|
9415
|
+
var tableRecordIdResolver = defineResolver({
|
|
9416
|
+
imports: [listTableRecordsRef],
|
|
9417
|
+
requireParameters: ["table"],
|
|
9418
|
+
listItems: ({ imports, input, cursor }) => imports.listTableRecords({
|
|
9419
|
+
table: input.table,
|
|
9420
|
+
keyMode: "names",
|
|
9421
|
+
cursor
|
|
9422
|
+
}),
|
|
9423
|
+
prompt: ({ items }) => ({
|
|
9424
|
+
type: "list",
|
|
9425
|
+
message: "Select a record:",
|
|
9426
|
+
choices: recordChoices(items)
|
|
9427
|
+
})
|
|
9428
|
+
});
|
|
9429
|
+
var tableRecordIdsResolver = defineResolver({
|
|
9430
|
+
imports: [listTableRecordsRef],
|
|
9431
|
+
requireParameters: ["table"],
|
|
9432
|
+
listItems: ({ imports, input, cursor }) => imports.listTableRecords({
|
|
9433
|
+
table: input.table,
|
|
9434
|
+
keyMode: "names",
|
|
9435
|
+
cursor
|
|
9436
|
+
}),
|
|
9437
|
+
prompt: ({ items }) => ({
|
|
9438
|
+
type: "checkbox",
|
|
9439
|
+
message: "Select records to delete:",
|
|
9440
|
+
choices: recordChoices(items)
|
|
9441
|
+
}),
|
|
9442
|
+
validate: ({ value }) => Array.isArray(value) && value.length > 0 ? true : "Select at least one record"
|
|
9443
|
+
});
|
|
9444
|
+
|
|
9445
|
+
// src/resolvers/tableFieldIds.ts
|
|
9446
|
+
var listTableFieldsRef = declareMethod({ id: "listTableFields" });
|
|
9447
|
+
var tableFieldIdsResolver = defineResolver({
|
|
9448
|
+
imports: [listTableFieldsRef],
|
|
9449
|
+
requireParameters: ["table"],
|
|
9450
|
+
// No cursor forwarding: the fields API is unpaginated (no cursor on the
|
|
9451
|
+
// response), so the listing is always exhausted after one page.
|
|
9452
|
+
listItems: ({ imports, input }) => imports.listTableFields({ table: input.table }),
|
|
9453
|
+
prompt: ({ items }) => ({
|
|
9454
|
+
type: "checkbox",
|
|
9455
|
+
message: "Select fields:",
|
|
9456
|
+
choices: items.map((field) => ({
|
|
9457
|
+
label: field.name,
|
|
9458
|
+
hint: [field.id, field.type],
|
|
9459
|
+
value: field.id
|
|
9460
|
+
}))
|
|
9461
|
+
}),
|
|
9462
|
+
validate: ({ value }) => Array.isArray(value) && value.length > 0 ? true : "Select at least one field"
|
|
9463
|
+
});
|
|
9464
|
+
|
|
9465
|
+
// src/resolvers/tableName.ts
|
|
9466
|
+
var tableNameResolver = defineResolver({
|
|
9467
|
+
type: "static",
|
|
9468
|
+
inputType: "text",
|
|
9469
|
+
placeholder: "Enter a name for the table"
|
|
9470
|
+
});
|
|
9471
|
+
var FieldTypeSchema = z.enum([
|
|
9472
|
+
"string",
|
|
9473
|
+
"multiple_string",
|
|
9474
|
+
"labeled_string",
|
|
9475
|
+
"multiple_labeled_string",
|
|
9476
|
+
"text",
|
|
9477
|
+
"multiple_text",
|
|
9478
|
+
"boolean",
|
|
9479
|
+
"multiple_boolean",
|
|
9480
|
+
"number",
|
|
9481
|
+
"multiple_number",
|
|
9482
|
+
"decimal",
|
|
9483
|
+
"multiple_decimal",
|
|
9484
|
+
"datetime",
|
|
9485
|
+
"multiple_datetime",
|
|
9486
|
+
"uuid",
|
|
9487
|
+
"multiple_uuid",
|
|
9488
|
+
"json",
|
|
9489
|
+
"multiple_json",
|
|
9490
|
+
"formula",
|
|
9491
|
+
"button_trigger_zap",
|
|
9492
|
+
"button_continue_zap",
|
|
9493
|
+
"email",
|
|
9494
|
+
"multiple_email",
|
|
9495
|
+
"link",
|
|
9496
|
+
"multiple_link",
|
|
9497
|
+
"currency",
|
|
9498
|
+
"phone_number",
|
|
9499
|
+
"ai_formula",
|
|
9500
|
+
"linked_record",
|
|
9501
|
+
"multiple_linked_record"
|
|
9502
|
+
]);
|
|
9503
|
+
var FieldApiItemSchema = z.object({
|
|
9504
|
+
id: z.number(),
|
|
9505
|
+
type: FieldTypeSchema,
|
|
9506
|
+
name: z.string(),
|
|
9507
|
+
created_at: z.string().optional(),
|
|
9508
|
+
edited_at: z.string().optional(),
|
|
9509
|
+
options: z.record(z.string(), z.unknown()).optional(),
|
|
9510
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
9511
|
+
is_order_field: z.boolean().optional(),
|
|
9512
|
+
is_filter_field: z.boolean().optional(),
|
|
9513
|
+
is_selected_field: z.boolean().optional(),
|
|
9514
|
+
deleted_at: z.string().nullable().optional()
|
|
9515
|
+
});
|
|
9516
|
+
var ListTableFieldsApiResponseSchema = z.object({
|
|
9517
|
+
data: z.array(FieldApiItemSchema)
|
|
9518
|
+
});
|
|
9519
|
+
var FieldItemSchema = z.object({
|
|
9520
|
+
id: z.string(),
|
|
9521
|
+
type: FieldTypeSchema,
|
|
9522
|
+
name: z.string(),
|
|
9523
|
+
created_at: z.string().optional(),
|
|
9524
|
+
edited_at: z.string().optional(),
|
|
9525
|
+
options: z.record(z.string(), z.unknown()).optional(),
|
|
9526
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
9527
|
+
deleted_at: z.string().nullable().optional()
|
|
9528
|
+
});
|
|
9529
|
+
var ListTableFieldsDescription = "List fields for a table";
|
|
9530
|
+
var ListTableFieldsOptionsBaseSchema = z.object({
|
|
9531
|
+
fields: FieldsPropertySchema.optional(),
|
|
9532
|
+
fieldKeys: z.array(z.union([z.string(), z.number()])).optional().describe(
|
|
9533
|
+
'Filter by specific fields. Accepts field names (e.g., "Email") or IDs (e.g., "f6", "6", or 6).'
|
|
9534
|
+
).meta({ deprecated: true }),
|
|
9535
|
+
trash: TrashSchema
|
|
9536
|
+
});
|
|
9537
|
+
var ListTableFieldsOptionsSchema = z.object({
|
|
9538
|
+
table: TablePropertySchema
|
|
9539
|
+
}).merge(ListTableFieldsOptionsBaseSchema).describe(ListTableFieldsDescription).meta({ aliases: { tableId: "table", fieldKeys: "fields" } });
|
|
9540
|
+
var ListTableFieldsOptionsSchemaDeprecated = z.object({
|
|
9541
|
+
tableId: z.string().regex(/^[A-Z0-9]{26}$/, "Table ID must be a valid ULID").describe("The unique identifier of the table")
|
|
9542
|
+
}).merge(ListTableFieldsOptionsBaseSchema);
|
|
9543
|
+
var ListTableFieldsOptionsInputSchema = z.union([ListTableFieldsOptionsSchema, ListTableFieldsOptionsSchemaDeprecated]).describe(ListTableFieldsDescription);
|
|
9544
|
+
|
|
9545
|
+
// src/resolvers/tableFields.ts
|
|
9546
|
+
var fieldTypeChoices = FieldTypeSchema.options.map((type) => ({
|
|
9547
|
+
label: type,
|
|
9548
|
+
value: type
|
|
9549
|
+
}));
|
|
9550
|
+
var singleFieldResolver = defineResolver({
|
|
9551
|
+
type: "object",
|
|
9552
|
+
properties: {
|
|
9553
|
+
type: {
|
|
9554
|
+
label: "Field type",
|
|
9555
|
+
required: true,
|
|
9556
|
+
resolver: defineResolver({
|
|
9557
|
+
listItems: () => ({ data: fieldTypeChoices }),
|
|
9558
|
+
prompt: ({ items }) => ({
|
|
9559
|
+
type: "list",
|
|
9560
|
+
message: "Select field type:",
|
|
9561
|
+
choices: items
|
|
9562
|
+
})
|
|
9563
|
+
})
|
|
9564
|
+
},
|
|
9565
|
+
name: {
|
|
9566
|
+
label: "Field name",
|
|
9567
|
+
required: true,
|
|
9568
|
+
resolver: defineResolver({ type: "static", inputType: "text" })
|
|
9569
|
+
}
|
|
9570
|
+
}
|
|
9571
|
+
});
|
|
9572
|
+
var tableFieldsResolver = defineResolver({
|
|
9573
|
+
type: "array",
|
|
9574
|
+
items: singleFieldResolver,
|
|
9575
|
+
minItems: 1
|
|
9576
|
+
});
|
|
9577
|
+
|
|
9578
|
+
// src/resolvers/tableRecords.ts
|
|
9579
|
+
var listTableFieldsRef2 = declareMethod({ id: "listTableFields" });
|
|
9580
|
+
function tableFieldValueType(fieldType) {
|
|
9581
|
+
if (fieldType.startsWith("multiple_")) return "array";
|
|
9582
|
+
switch (fieldType) {
|
|
9583
|
+
case "number":
|
|
9584
|
+
case "decimal":
|
|
9585
|
+
case "currency":
|
|
9586
|
+
return "number";
|
|
9587
|
+
case "boolean":
|
|
9588
|
+
return "boolean";
|
|
9589
|
+
default:
|
|
9590
|
+
return void 0;
|
|
9591
|
+
}
|
|
9592
|
+
}
|
|
9593
|
+
function buildDataFields(fields) {
|
|
9594
|
+
const props = {};
|
|
9595
|
+
for (const field of fields) {
|
|
9596
|
+
const valueType = tableFieldValueType(field.type);
|
|
9597
|
+
props[field.id] = {
|
|
9598
|
+
label: field.name,
|
|
9599
|
+
required: false,
|
|
9600
|
+
...valueType ? { valueType } : {},
|
|
9601
|
+
resolver: { type: "static", inputType: "text" }
|
|
9602
|
+
};
|
|
9603
|
+
}
|
|
9604
|
+
return props;
|
|
9605
|
+
}
|
|
9606
|
+
function makeRecordsResolver(includeRecordId) {
|
|
9607
|
+
const singleRecordResolver = defineResolver({
|
|
9608
|
+
type: "object",
|
|
9609
|
+
imports: [listTableFieldsRef2],
|
|
9610
|
+
requireParameters: ["table"],
|
|
9611
|
+
// The record-id resolver is import-bearing, so it lives in `definitions` and
|
|
9612
|
+
// is reached by `{ ref }` from the built `id` field (updates only).
|
|
9613
|
+
definitions: includeRecordId ? { recordId: tableRecordIdResolver } : {},
|
|
9614
|
+
getProperties: async ({ imports, input }) => {
|
|
9615
|
+
const { data: fields } = await imports.listTableFields({
|
|
9616
|
+
table: input.table
|
|
9617
|
+
});
|
|
9618
|
+
const props = {
|
|
9619
|
+
data: {
|
|
9620
|
+
label: "Field values",
|
|
9621
|
+
resolver: { type: "object", properties: buildDataFields(fields) }
|
|
9622
|
+
}
|
|
9623
|
+
};
|
|
9624
|
+
if (includeRecordId) {
|
|
9625
|
+
props.id = {
|
|
9626
|
+
label: "Record",
|
|
9627
|
+
required: true,
|
|
9628
|
+
resolver: { ref: "recordId" }
|
|
9629
|
+
};
|
|
9630
|
+
}
|
|
9631
|
+
return props;
|
|
9755
9632
|
}
|
|
9756
|
-
};
|
|
9633
|
+
});
|
|
9634
|
+
return defineResolver({
|
|
9635
|
+
type: "array",
|
|
9636
|
+
requireParameters: ["table"],
|
|
9637
|
+
minItems: 1,
|
|
9638
|
+
items: singleRecordResolver
|
|
9639
|
+
});
|
|
9757
9640
|
}
|
|
9641
|
+
var tableRecordsResolver = makeRecordsResolver(false);
|
|
9642
|
+
var tableUpdateRecordsResolver = makeRecordsResolver(true);
|
|
9758
9643
|
|
|
9759
|
-
// src/resolvers/
|
|
9760
|
-
var
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9644
|
+
// src/resolvers/tableFilters.ts
|
|
9645
|
+
var listTableFieldsRef3 = declareMethod({ id: "listTableFields" });
|
|
9646
|
+
var FILTER_OPERATORS = [
|
|
9647
|
+
{ label: "equals", value: "exact" },
|
|
9648
|
+
{ label: "not equals", value: "different" },
|
|
9649
|
+
{ label: "contains", value: "contains" },
|
|
9650
|
+
{ label: "contains (case-insensitive)", value: "icontains" },
|
|
9651
|
+
{ label: "starts with", value: "startswith" },
|
|
9652
|
+
{ label: "search", value: "search" },
|
|
9653
|
+
{ label: "greater than", value: "gt" },
|
|
9654
|
+
{ label: "greater than or equal", value: "gte" },
|
|
9655
|
+
{ label: "less than", value: "lt" },
|
|
9656
|
+
{ label: "less than or equal", value: "lte" },
|
|
9657
|
+
{ label: "in range", value: "range" },
|
|
9658
|
+
{ label: "in list", value: "in" },
|
|
9659
|
+
{ label: "is empty", value: "isnull" },
|
|
9660
|
+
{ label: "is within (date)", value: "is_within" }
|
|
9661
|
+
];
|
|
9662
|
+
function fieldKeyChoices(fields) {
|
|
9663
|
+
return fields.flatMap((field) => {
|
|
9664
|
+
const components = NESTED_COMPONENTS[field.type];
|
|
9665
|
+
if (components && components.size > 1) {
|
|
9666
|
+
return [...components].map((component) => ({
|
|
9667
|
+
label: `${field.name}__${component} (${field.id}, ${field.type})`,
|
|
9668
|
+
value: `${field.name}__${component}`
|
|
9669
|
+
}));
|
|
9670
|
+
}
|
|
9671
|
+
return {
|
|
9672
|
+
label: `${field.name} (${field.id}${components ? `, ${field.type}` : ""})`,
|
|
9673
|
+
value: components ? `${field.name}__${[...components][0]}` : field.name
|
|
9674
|
+
};
|
|
9675
|
+
});
|
|
9766
9676
|
}
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
})
|
|
9677
|
+
var singleFilterResolver = defineResolver({
|
|
9678
|
+
type: "object",
|
|
9679
|
+
imports: [listTableFieldsRef3],
|
|
9680
|
+
requireParameters: ["table"],
|
|
9681
|
+
getProperties: async ({ imports, input }) => {
|
|
9682
|
+
const { data: fields } = await imports.listTableFields({
|
|
9683
|
+
table: input.table
|
|
9684
|
+
});
|
|
9685
|
+
const choices = fieldKeyChoices(fields);
|
|
9686
|
+
const props = {
|
|
9687
|
+
fieldKey: {
|
|
9688
|
+
label: "Field",
|
|
9689
|
+
required: true,
|
|
9690
|
+
resolver: {
|
|
9691
|
+
type: "dynamic",
|
|
9692
|
+
listItems: () => ({ data: choices }),
|
|
9693
|
+
prompt: () => ({
|
|
9694
|
+
type: "list",
|
|
9695
|
+
message: "Select field:",
|
|
9696
|
+
choices
|
|
9697
|
+
})
|
|
9698
|
+
}
|
|
9699
|
+
},
|
|
9700
|
+
operator: {
|
|
9701
|
+
label: "Operator",
|
|
9702
|
+
required: true,
|
|
9703
|
+
resolver: {
|
|
9704
|
+
type: "dynamic",
|
|
9705
|
+
listItems: () => ({ data: FILTER_OPERATORS }),
|
|
9706
|
+
prompt: () => ({
|
|
9707
|
+
type: "list",
|
|
9708
|
+
message: "Select operator:",
|
|
9709
|
+
choices: FILTER_OPERATORS
|
|
9710
|
+
})
|
|
9711
|
+
}
|
|
9712
|
+
},
|
|
9713
|
+
value: {
|
|
9714
|
+
label: "Value",
|
|
9715
|
+
required: false,
|
|
9716
|
+
resolver: { type: "static", inputType: "text" }
|
|
9717
|
+
}
|
|
9718
|
+
};
|
|
9719
|
+
return props;
|
|
9720
|
+
}
|
|
9721
|
+
});
|
|
9722
|
+
var tableFiltersResolver = defineResolver({
|
|
9723
|
+
type: "array",
|
|
9724
|
+
requireParameters: ["table"],
|
|
9725
|
+
minItems: 0,
|
|
9726
|
+
items: singleFilterResolver
|
|
9727
|
+
});
|
|
9728
|
+
|
|
9729
|
+
// src/resolvers/tableSort.ts
|
|
9730
|
+
var listTableFieldsRef4 = declareMethod({ id: "listTableFields" });
|
|
9731
|
+
function fieldKeyChoices2(fields) {
|
|
9732
|
+
return fields.flatMap((field) => {
|
|
9733
|
+
const components = NESTED_COMPONENTS[field.type];
|
|
9734
|
+
if (components) {
|
|
9735
|
+
return [...components].map((component) => ({
|
|
9736
|
+
label: `${field.name}__${component} (${field.id}, ${field.type})`,
|
|
9737
|
+
value: `${field.name}__${component}`
|
|
9738
|
+
}));
|
|
9739
|
+
}
|
|
9740
|
+
return { label: `${field.name} (${field.id})`, value: field.name };
|
|
9741
|
+
});
|
|
9772
9742
|
}
|
|
9773
|
-
var
|
|
9774
|
-
|
|
9743
|
+
var DIRECTION_CHOICES = [
|
|
9744
|
+
{ label: "Ascending", value: "asc" },
|
|
9745
|
+
{ label: "Descending", value: "desc" }
|
|
9746
|
+
];
|
|
9747
|
+
var tableSortResolver = defineResolver({
|
|
9748
|
+
type: "object",
|
|
9749
|
+
imports: [listTableFieldsRef4],
|
|
9775
9750
|
requireParameters: ["table"],
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9751
|
+
getProperties: async ({ imports, input }) => {
|
|
9752
|
+
const { data: fields } = await imports.listTableFields({
|
|
9753
|
+
table: input.table
|
|
9754
|
+
});
|
|
9755
|
+
const choices = fieldKeyChoices2(fields);
|
|
9756
|
+
const props = {
|
|
9757
|
+
fieldKey: {
|
|
9758
|
+
label: "Field",
|
|
9759
|
+
required: true,
|
|
9760
|
+
resolver: {
|
|
9761
|
+
type: "dynamic",
|
|
9762
|
+
listItems: () => ({ data: choices }),
|
|
9763
|
+
prompt: () => ({
|
|
9764
|
+
type: "list",
|
|
9765
|
+
message: "Select field:",
|
|
9766
|
+
choices
|
|
9767
|
+
})
|
|
9768
|
+
}
|
|
9769
|
+
},
|
|
9770
|
+
direction: {
|
|
9771
|
+
label: "Direction",
|
|
9772
|
+
required: true,
|
|
9773
|
+
resolver: {
|
|
9774
|
+
type: "dynamic",
|
|
9775
|
+
listItems: () => ({ data: DIRECTION_CHOICES }),
|
|
9776
|
+
prompt: () => ({
|
|
9777
|
+
type: "list",
|
|
9778
|
+
message: "Select direction:",
|
|
9779
|
+
choices: DIRECTION_CHOICES
|
|
9780
|
+
})
|
|
9781
|
+
}
|
|
9782
|
+
}
|
|
9783
|
+
};
|
|
9784
|
+
return props;
|
|
9785
|
+
}
|
|
9786
|
+
});
|
|
9787
|
+
var GetActionDescription = "Get detailed information about a specific action";
|
|
9788
|
+
var GetActionSchema = z.object({
|
|
9789
|
+
app: AppPropertySchema,
|
|
9790
|
+
actionType: ActionTypePropertySchema,
|
|
9791
|
+
action: ActionPropertySchema
|
|
9792
|
+
}).describe(GetActionDescription).meta({ aliases: { appKey: "app", actionKey: "action" } });
|
|
9793
|
+
var GetActionSchemaDeprecated = z.object({
|
|
9794
|
+
appKey: AppKeyPropertySchema,
|
|
9795
|
+
actionType: ActionTypePropertySchema,
|
|
9796
|
+
actionKey: ActionKeyPropertySchema
|
|
9797
|
+
});
|
|
9798
|
+
var GetActionInputSchema = z.union([GetActionSchema, GetActionSchemaDeprecated]).describe(GetActionDescription);
|
|
9799
|
+
var ListActionsDescription = "List all actions for a specific app";
|
|
9800
|
+
var ListActionsBaseSchema = z.object({
|
|
9801
|
+
pageSize: z.number().min(1).optional().describe("Number of actions per page"),
|
|
9802
|
+
maxItems: z.number().min(1).optional().describe("Maximum total items to return across all pages"),
|
|
9803
|
+
cursor: z.string().optional().describe("Cursor to start from")
|
|
9804
|
+
});
|
|
9805
|
+
var ListActionsSchema = z.object({
|
|
9806
|
+
app: AppPropertySchema.describe(
|
|
9807
|
+
"App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
|
|
9808
|
+
),
|
|
9809
|
+
actionType: ActionTypePropertySchema.optional().describe(
|
|
9810
|
+
"Filter actions by type"
|
|
9811
|
+
)
|
|
9812
|
+
}).merge(ListActionsBaseSchema).describe(ListActionsDescription).meta({ aliases: { appKey: "app" } });
|
|
9813
|
+
var ListActionsSchemaDeprecated = z.object({
|
|
9814
|
+
appKey: AppKeyPropertySchema.describe(
|
|
9815
|
+
"App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"
|
|
9816
|
+
),
|
|
9817
|
+
actionType: ActionTypePropertySchema.optional().describe(
|
|
9818
|
+
"Filter actions by type"
|
|
9819
|
+
)
|
|
9820
|
+
}).merge(ListActionsBaseSchema);
|
|
9821
|
+
var ListActionsInputSchema = z.union([ListActionsSchema, ListActionsSchemaDeprecated]).describe(ListActionsDescription);
|
|
9822
|
+
var NeedChoicesSchema = z.object({
|
|
9823
|
+
key: z.string().optional(),
|
|
9824
|
+
label: z.string().optional(),
|
|
9825
|
+
sample: z.string().optional(),
|
|
9826
|
+
value: z.string().optional()
|
|
9827
|
+
});
|
|
9828
|
+
var NeedSchema = z.object({
|
|
9829
|
+
key: z.string(),
|
|
9830
|
+
alters_custom_fields: z.boolean().nullable().optional(),
|
|
9831
|
+
capabilities: z.array(z.string()).optional(),
|
|
9832
|
+
choices: z.array(NeedChoicesSchema).optional(),
|
|
9833
|
+
computed: z.boolean().nullable().optional(),
|
|
9834
|
+
custom_field: z.boolean().optional(),
|
|
9835
|
+
default: z.string().optional(),
|
|
9836
|
+
depends_on: z.array(z.string()).optional(),
|
|
9837
|
+
format: z.literal("SELECT").optional(),
|
|
9838
|
+
from_search: z.boolean().optional(),
|
|
9839
|
+
from_write: z.boolean().optional(),
|
|
9840
|
+
help_text: z.string().optional(),
|
|
9841
|
+
help_text_html: z.string().optional(),
|
|
9842
|
+
input_format: z.array(z.string()).optional(),
|
|
9843
|
+
label: z.string().optional(),
|
|
9844
|
+
language: z.string().optional(),
|
|
9845
|
+
parent_key: z.string().optional(),
|
|
9846
|
+
placeholder: z.string().optional(),
|
|
9847
|
+
prefill: z.string().optional(),
|
|
9848
|
+
required: z.boolean().optional(),
|
|
9849
|
+
searchfill: z.string().optional(),
|
|
9850
|
+
send_in_json: z.boolean().optional(),
|
|
9851
|
+
regex: z.string().optional(),
|
|
9852
|
+
type: z.enum([
|
|
9853
|
+
"integer",
|
|
9854
|
+
"string",
|
|
9855
|
+
"text",
|
|
9856
|
+
"datetime",
|
|
9857
|
+
"boolean",
|
|
9858
|
+
"file",
|
|
9859
|
+
"decimal",
|
|
9860
|
+
"copy",
|
|
9861
|
+
"password",
|
|
9862
|
+
"dict",
|
|
9863
|
+
"code",
|
|
9864
|
+
"filter",
|
|
9865
|
+
"json"
|
|
9866
|
+
]).optional(),
|
|
9867
|
+
list: z.boolean().optional()
|
|
9786
9868
|
});
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
requireParameters: ["table"],
|
|
9790
|
-
listItems: ({ imports, input, cursor }) => imports.listTableRecords({
|
|
9791
|
-
table: input.table,
|
|
9792
|
-
keyMode: "names",
|
|
9793
|
-
cursor
|
|
9794
|
-
}),
|
|
9795
|
-
prompt: ({ items }) => ({
|
|
9796
|
-
type: "checkbox",
|
|
9797
|
-
message: "Select records to delete:",
|
|
9798
|
-
choices: recordChoices(items)
|
|
9799
|
-
}),
|
|
9800
|
-
validate: ({ value }) => Array.isArray(value) && value.length > 0 ? true : "Select at least one record"
|
|
9869
|
+
z.object({
|
|
9870
|
+
action_url: z.string().optional()
|
|
9801
9871
|
});
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
var listTableFieldsRef = declareMethod({ id: "listTableFields" });
|
|
9805
|
-
var tableFieldIdsResolver = defineResolver({
|
|
9806
|
-
imports: [listTableFieldsRef],
|
|
9807
|
-
requireParameters: ["table"],
|
|
9808
|
-
// No cursor forwarding: the fields API is unpaginated (no cursor on the
|
|
9809
|
-
// response), so the listing is always exhausted after one page.
|
|
9810
|
-
listItems: ({ imports, input }) => imports.listTableFields({ table: input.table }),
|
|
9811
|
-
prompt: ({ items }) => ({
|
|
9812
|
-
type: "checkbox",
|
|
9813
|
-
message: "Select fields:",
|
|
9814
|
-
choices: items.map((field) => ({
|
|
9815
|
-
label: field.name,
|
|
9816
|
-
hint: [field.id, field.type],
|
|
9817
|
-
value: field.id
|
|
9818
|
-
}))
|
|
9819
|
-
}),
|
|
9820
|
-
validate: ({ value }) => Array.isArray(value) && value.length > 0 ? true : "Select at least one field"
|
|
9872
|
+
z.object({
|
|
9873
|
+
can_use: z.boolean().optional()
|
|
9821
9874
|
});
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9875
|
+
var ActionSchema = z.object({
|
|
9876
|
+
id: z.string().optional(),
|
|
9877
|
+
type: z.enum([
|
|
9878
|
+
"filter",
|
|
9879
|
+
"read",
|
|
9880
|
+
"read_bulk",
|
|
9881
|
+
"run",
|
|
9882
|
+
"search",
|
|
9883
|
+
"search_and_write",
|
|
9884
|
+
"search_or_write",
|
|
9885
|
+
"write"
|
|
9886
|
+
]),
|
|
9887
|
+
key: z.string(),
|
|
9888
|
+
name: z.string(),
|
|
9889
|
+
description: z.string(),
|
|
9890
|
+
is_important: z.boolean().optional(),
|
|
9891
|
+
is_hidden: z.boolean().optional(),
|
|
9892
|
+
selected_api: z.string().optional()
|
|
9828
9893
|
});
|
|
9829
|
-
var
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9894
|
+
var ChoiceSchema = z.object({
|
|
9895
|
+
value: z.union([z.string(), z.number()]),
|
|
9896
|
+
label: z.string()
|
|
9897
|
+
});
|
|
9898
|
+
z.object({
|
|
9899
|
+
key: z.string(),
|
|
9900
|
+
label: z.string(),
|
|
9901
|
+
type: z.enum([
|
|
9902
|
+
"string",
|
|
9903
|
+
"number",
|
|
9904
|
+
"boolean",
|
|
9905
|
+
"datetime",
|
|
9906
|
+
"file",
|
|
9907
|
+
"object",
|
|
9908
|
+
"array"
|
|
9909
|
+
]),
|
|
9910
|
+
required: z.boolean(),
|
|
9911
|
+
description: z.string().optional(),
|
|
9912
|
+
choices: z.array(ChoiceSchema).optional()
|
|
9913
|
+
});
|
|
9914
|
+
z.object({
|
|
9915
|
+
data: z.array(z.unknown())
|
|
9916
|
+
});
|
|
9917
|
+
var ActionFieldChoiceSchema = z.object({
|
|
9918
|
+
value: z.union([z.string(), z.number()]),
|
|
9919
|
+
label: z.string()
|
|
9920
|
+
});
|
|
9921
|
+
z.object({
|
|
9922
|
+
key: z.string(),
|
|
9923
|
+
label: z.string().optional(),
|
|
9924
|
+
required: z.boolean(),
|
|
9925
|
+
type: z.string().optional(),
|
|
9926
|
+
helpText: z.string().optional(),
|
|
9927
|
+
helpTextHtml: z.string().optional(),
|
|
9928
|
+
choices: z.array(ActionFieldChoiceSchema).optional(),
|
|
9929
|
+
default: z.string().optional(),
|
|
9930
|
+
placeholder: z.string().optional(),
|
|
9931
|
+
computed: z.boolean().optional(),
|
|
9932
|
+
customField: z.boolean().optional(),
|
|
9933
|
+
dependsOn: z.array(z.string()).optional(),
|
|
9934
|
+
format: z.string().optional(),
|
|
9935
|
+
inputFormat: z.array(z.string()).optional()
|
|
9936
|
+
});
|
|
9937
|
+
z.object({
|
|
9862
9938
|
id: z.number(),
|
|
9863
|
-
|
|
9939
|
+
public_id: z.string().optional(),
|
|
9940
|
+
code: z.string(),
|
|
9941
|
+
user_id: z.number(),
|
|
9942
|
+
auto_provisioned: z.boolean(),
|
|
9943
|
+
first_name: z.string(),
|
|
9944
|
+
last_name: z.string(),
|
|
9945
|
+
username: z.string(),
|
|
9946
|
+
personas: z.string(),
|
|
9947
|
+
user_generated_personas: z.string(),
|
|
9948
|
+
last_login: z.string(),
|
|
9949
|
+
email: z.string(),
|
|
9950
|
+
email_hash: z.string(),
|
|
9951
|
+
email_confirmed: z.boolean(),
|
|
9952
|
+
timezone: z.string(),
|
|
9953
|
+
photo_url: z.string(),
|
|
9954
|
+
has_seen_notifications: z.record(z.string(), z.boolean().nullable()),
|
|
9955
|
+
signup: z.string(),
|
|
9956
|
+
since_signup: z.string(),
|
|
9957
|
+
has_activated: z.boolean(),
|
|
9958
|
+
enable_gz_creator: z.boolean(),
|
|
9959
|
+
should_see_nps_survey: z.boolean(),
|
|
9960
|
+
is_developer: z.boolean(),
|
|
9961
|
+
is_expert: z.boolean(),
|
|
9962
|
+
tos_agreement: z.boolean(),
|
|
9963
|
+
should_renew_tos: z.boolean(),
|
|
9964
|
+
is_gdpr_consented: z.boolean(),
|
|
9965
|
+
disable_ssl_check: z.boolean(),
|
|
9966
|
+
identity: z.number(),
|
|
9967
|
+
summary_schedule: z.string(),
|
|
9968
|
+
alert_triggers: z.string(),
|
|
9969
|
+
alert_actions: z.string(),
|
|
9970
|
+
is_staff: z.boolean(),
|
|
9971
|
+
is_zt_reviewer: z.boolean(),
|
|
9972
|
+
is_high_value: z.boolean(),
|
|
9973
|
+
is_temporary: z.boolean(),
|
|
9974
|
+
banner_message: z.string(),
|
|
9975
|
+
enable_totp_2fa: z.boolean(),
|
|
9976
|
+
viewed_help: z.record(z.string(), z.boolean()),
|
|
9977
|
+
show_editor_migration_mesaging: z.boolean(),
|
|
9978
|
+
switches: z.record(z.string(), z.unknown()),
|
|
9979
|
+
organizations: z.array(z.record(z.string(), z.unknown()).nullable()),
|
|
9980
|
+
primary_organization: z.record(z.string(), z.unknown()).nullable(),
|
|
9981
|
+
has_active_zaps: z.boolean(),
|
|
9982
|
+
has_google_sso: z.boolean(),
|
|
9983
|
+
auth_realm: z.string(),
|
|
9984
|
+
roles: z.array(
|
|
9985
|
+
z.object({
|
|
9986
|
+
account_id: z.number(),
|
|
9987
|
+
role: z.string()
|
|
9988
|
+
})
|
|
9989
|
+
)
|
|
9990
|
+
});
|
|
9991
|
+
z.object({
|
|
9992
|
+
age_in_days: z.string().optional(),
|
|
9993
|
+
api_docs_url: z.string().nullable().optional(),
|
|
9994
|
+
app_profile_url: z.string(),
|
|
9995
|
+
banner: z.string().optional(),
|
|
9996
|
+
categories: z.array(z.string()).optional(),
|
|
9997
|
+
// Service category names
|
|
9998
|
+
canonical_id: z.string().optional(),
|
|
9999
|
+
current_implementation_id: z.string(),
|
|
10000
|
+
days_since_last_update: z.string().optional(),
|
|
10001
|
+
description: z.string(),
|
|
10002
|
+
external_url: z.string(),
|
|
10003
|
+
hashtag: z.string().optional(),
|
|
10004
|
+
id: z.number().optional(),
|
|
10005
|
+
image: z.string().optional(),
|
|
10006
|
+
images: z.string().optional(),
|
|
10007
|
+
integration_overview_html: z.string().nullable().optional(),
|
|
10008
|
+
internal_id: z.string(),
|
|
10009
|
+
invite_url: z.string().nullable().optional(),
|
|
10010
|
+
is_beta: z.string().optional(),
|
|
10011
|
+
is_built_in: z.string().optional(),
|
|
10012
|
+
is_featured: z.string().optional(),
|
|
10013
|
+
is_premium: z.boolean().optional(),
|
|
10014
|
+
is_public: z.string().optional(),
|
|
10015
|
+
is_upcoming: z.string().optional(),
|
|
10016
|
+
learn_more_url: z.string(),
|
|
9864
10017
|
name: z.string(),
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
10018
|
+
popularity: z.number(),
|
|
10019
|
+
primary_color: z.string(),
|
|
10020
|
+
request_count: z.string().optional(),
|
|
10021
|
+
slug: z.string(),
|
|
10022
|
+
zap_usage_count: z.number().nullable().optional()
|
|
10023
|
+
});
|
|
10024
|
+
var ServiceSchema = z.object({
|
|
10025
|
+
id: z.number().optional(),
|
|
10026
|
+
canonical_id: z.string().optional(),
|
|
10027
|
+
current_implementation_id: z.string(),
|
|
10028
|
+
name: z.string(),
|
|
10029
|
+
slug: z.string(),
|
|
10030
|
+
app_url: z.string().optional(),
|
|
10031
|
+
learn_more_url: z.string().optional(),
|
|
10032
|
+
description: z.string(),
|
|
10033
|
+
primary_color: z.string(),
|
|
10034
|
+
popularity: z.number(),
|
|
10035
|
+
image: z.string().optional(),
|
|
10036
|
+
images: z.string().optional()
|
|
9873
10037
|
});
|
|
9874
|
-
|
|
9875
|
-
|
|
10038
|
+
z.object({
|
|
10039
|
+
results: z.array(ServiceSchema),
|
|
10040
|
+
next: z.string().nullable().optional(),
|
|
10041
|
+
previous: z.string().nullable().optional()
|
|
9876
10042
|
});
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
options: z.record(z.string(), z.unknown()).optional(),
|
|
9884
|
-
config: z.record(z.string(), z.unknown()).optional(),
|
|
9885
|
-
deleted_at: z.string().nullable().optional()
|
|
10043
|
+
z.object({
|
|
10044
|
+
selected_api: z.string(),
|
|
10045
|
+
action: z.string(),
|
|
10046
|
+
type_of: z.string(),
|
|
10047
|
+
authentication_id: z.union([z.string(), z.number()]).optional(),
|
|
10048
|
+
params: z.record(z.string(), z.unknown()).optional()
|
|
9886
10049
|
});
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
).
|
|
9893
|
-
trash: TrashSchema
|
|
10050
|
+
z.object({
|
|
10051
|
+
success: z.boolean(),
|
|
10052
|
+
needs: z.array(NeedSchema).optional(),
|
|
10053
|
+
errors: z.array(z.string()).optional(),
|
|
10054
|
+
last_fetched_at: z.string().optional(),
|
|
10055
|
+
schema: z.record(z.string(), z.unknown()).optional()
|
|
9894
10056
|
});
|
|
9895
|
-
var
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
resolver: defineResolver({
|
|
9915
|
-
listItems: () => ({ data: fieldTypeChoices }),
|
|
9916
|
-
prompt: ({ items }) => ({
|
|
9917
|
-
type: "list",
|
|
9918
|
-
message: "Select field type:",
|
|
9919
|
-
choices: items
|
|
9920
|
-
})
|
|
9921
|
-
})
|
|
9922
|
-
},
|
|
9923
|
-
name: {
|
|
9924
|
-
label: "Field name",
|
|
9925
|
-
required: true,
|
|
9926
|
-
resolver: defineResolver({ type: "static", inputType: "text" })
|
|
9927
|
-
}
|
|
9928
|
-
}
|
|
10057
|
+
var ImplementationSchema = z.object({
|
|
10058
|
+
selected_api: z.string(),
|
|
10059
|
+
app_id: z.number().optional(),
|
|
10060
|
+
auth_type: z.string().optional(),
|
|
10061
|
+
auth_fields: z.string().optional(),
|
|
10062
|
+
actions: z.array(ActionSchema).optional(),
|
|
10063
|
+
is_deprecated: z.boolean().optional(),
|
|
10064
|
+
is_private_only: z.boolean().optional(),
|
|
10065
|
+
is_invite_only: z.boolean().optional(),
|
|
10066
|
+
is_beta: z.boolean().optional().default(false),
|
|
10067
|
+
is_premium: z.boolean().optional().default(false),
|
|
10068
|
+
is_hidden: z.string().optional(),
|
|
10069
|
+
name: z.string().optional(),
|
|
10070
|
+
slug: z.string().optional(),
|
|
10071
|
+
images: z.record(z.string(), z.string().nullable()).optional(),
|
|
10072
|
+
primary_color: z.string().optional(),
|
|
10073
|
+
secondary_color: z.string().optional(),
|
|
10074
|
+
current_implementation: z.string().optional(),
|
|
10075
|
+
other_implementations: z.string().optional()
|
|
9929
10076
|
});
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
10077
|
+
z.object({
|
|
10078
|
+
count: z.number(),
|
|
10079
|
+
next: z.string().nullable().optional(),
|
|
10080
|
+
previous: z.string().nullable().optional(),
|
|
10081
|
+
results: z.array(ImplementationSchema)
|
|
9934
10082
|
});
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
return props;
|
|
9963
|
-
}
|
|
9964
|
-
function makeRecordsResolver(includeRecordId) {
|
|
9965
|
-
const singleRecordResolver = defineResolver({
|
|
9966
|
-
type: "object",
|
|
9967
|
-
imports: [listTableFieldsRef2],
|
|
9968
|
-
requireParameters: ["table"],
|
|
9969
|
-
// The record-id resolver is import-bearing, so it lives in `definitions` and
|
|
9970
|
-
// is reached by `{ ref }` from the built `id` field (updates only).
|
|
9971
|
-
definitions: includeRecordId ? { recordId: tableRecordIdResolver } : {},
|
|
9972
|
-
getProperties: async ({ imports, input }) => {
|
|
9973
|
-
const { data: fields } = await imports.listTableFields({
|
|
9974
|
-
table: input.table
|
|
9975
|
-
});
|
|
9976
|
-
const props = {
|
|
9977
|
-
data: {
|
|
9978
|
-
label: "Field values",
|
|
9979
|
-
resolver: { type: "object", properties: buildDataFields(fields) }
|
|
9980
|
-
}
|
|
9981
|
-
};
|
|
9982
|
-
if (includeRecordId) {
|
|
9983
|
-
props.id = {
|
|
9984
|
-
label: "Record",
|
|
9985
|
-
required: true,
|
|
9986
|
-
resolver: { ref: "recordId" }
|
|
9987
|
-
};
|
|
9988
|
-
}
|
|
9989
|
-
return props;
|
|
9990
|
-
}
|
|
9991
|
-
});
|
|
9992
|
-
return defineResolver({
|
|
9993
|
-
type: "array",
|
|
9994
|
-
requireParameters: ["table"],
|
|
9995
|
-
minItems: 1,
|
|
9996
|
-
items: singleRecordResolver
|
|
9997
|
-
});
|
|
9998
|
-
}
|
|
9999
|
-
var tableRecordsResolver = makeRecordsResolver(false);
|
|
10000
|
-
var tableUpdateRecordsResolver = makeRecordsResolver(true);
|
|
10001
|
-
|
|
10002
|
-
// src/resolvers/tableFilters.ts
|
|
10003
|
-
var listTableFieldsRef3 = declareMethod({ id: "listTableFields" });
|
|
10004
|
-
var FILTER_OPERATORS = [
|
|
10005
|
-
{ label: "equals", value: "exact" },
|
|
10006
|
-
{ label: "not equals", value: "different" },
|
|
10007
|
-
{ label: "contains", value: "contains" },
|
|
10008
|
-
{ label: "contains (case-insensitive)", value: "icontains" },
|
|
10009
|
-
{ label: "starts with", value: "startswith" },
|
|
10010
|
-
{ label: "search", value: "search" },
|
|
10011
|
-
{ label: "greater than", value: "gt" },
|
|
10012
|
-
{ label: "greater than or equal", value: "gte" },
|
|
10013
|
-
{ label: "less than", value: "lt" },
|
|
10014
|
-
{ label: "less than or equal", value: "lte" },
|
|
10015
|
-
{ label: "in range", value: "range" },
|
|
10016
|
-
{ label: "in list", value: "in" },
|
|
10017
|
-
{ label: "is empty", value: "isnull" },
|
|
10018
|
-
{ label: "is within (date)", value: "is_within" }
|
|
10019
|
-
];
|
|
10020
|
-
function fieldKeyChoices(fields) {
|
|
10021
|
-
return fields.flatMap((field) => {
|
|
10022
|
-
const components = NESTED_COMPONENTS[field.type];
|
|
10023
|
-
if (components && components.size > 1) {
|
|
10024
|
-
return [...components].map((component) => ({
|
|
10025
|
-
label: `${field.name}__${component} (${field.id}, ${field.type})`,
|
|
10026
|
-
value: `${field.name}__${component}`
|
|
10027
|
-
}));
|
|
10028
|
-
}
|
|
10029
|
-
return {
|
|
10030
|
-
label: `${field.name} (${field.id}${components ? `, ${field.type}` : ""})`,
|
|
10031
|
-
value: components ? `${field.name}__${[...components][0]}` : field.name
|
|
10032
|
-
};
|
|
10033
|
-
});
|
|
10034
|
-
}
|
|
10035
|
-
var singleFilterResolver = defineResolver({
|
|
10036
|
-
type: "object",
|
|
10037
|
-
imports: [listTableFieldsRef3],
|
|
10038
|
-
requireParameters: ["table"],
|
|
10039
|
-
getProperties: async ({ imports, input }) => {
|
|
10040
|
-
const { data: fields } = await imports.listTableFields({
|
|
10041
|
-
table: input.table
|
|
10042
|
-
});
|
|
10043
|
-
const choices = fieldKeyChoices(fields);
|
|
10044
|
-
const props = {
|
|
10045
|
-
fieldKey: {
|
|
10046
|
-
label: "Field",
|
|
10047
|
-
required: true,
|
|
10048
|
-
resolver: {
|
|
10049
|
-
type: "dynamic",
|
|
10050
|
-
listItems: () => ({ data: choices }),
|
|
10051
|
-
prompt: () => ({
|
|
10052
|
-
type: "list",
|
|
10053
|
-
message: "Select field:",
|
|
10054
|
-
choices
|
|
10055
|
-
})
|
|
10056
|
-
}
|
|
10057
|
-
},
|
|
10058
|
-
operator: {
|
|
10059
|
-
label: "Operator",
|
|
10060
|
-
required: true,
|
|
10061
|
-
resolver: {
|
|
10062
|
-
type: "dynamic",
|
|
10063
|
-
listItems: () => ({ data: FILTER_OPERATORS }),
|
|
10064
|
-
prompt: () => ({
|
|
10065
|
-
type: "list",
|
|
10066
|
-
message: "Select operator:",
|
|
10067
|
-
choices: FILTER_OPERATORS
|
|
10068
|
-
})
|
|
10069
|
-
}
|
|
10070
|
-
},
|
|
10071
|
-
value: {
|
|
10072
|
-
label: "Value",
|
|
10073
|
-
required: false,
|
|
10074
|
-
resolver: { type: "static", inputType: "text" }
|
|
10075
|
-
}
|
|
10076
|
-
};
|
|
10077
|
-
return props;
|
|
10078
|
-
}
|
|
10083
|
+
var NeedChoicesResponseMetaSchema = z.object({
|
|
10084
|
+
page: z.string().nullable().optional()
|
|
10085
|
+
});
|
|
10086
|
+
var NeedChoicesResponseLinksSchema = z.object({
|
|
10087
|
+
next: z.string().nullable().optional(),
|
|
10088
|
+
prev: z.string().nullable().optional()
|
|
10089
|
+
});
|
|
10090
|
+
z.object({
|
|
10091
|
+
selected_api: z.string().optional().describe(
|
|
10092
|
+
"Something like `SlackAPI` (for Python apps) or `SplitwiseCLIAPI@1.0.0` (for CLI apps). Non-public apps are fine as long as the authed user can access them."
|
|
10093
|
+
),
|
|
10094
|
+
authentication_id: z.union([z.string(), z.number()]).optional().describe(
|
|
10095
|
+
"If the app needs auth, provide an `authentication_id` that has the `selected_api` of the app you want to run. Can be any auth visible to the user (including shared)."
|
|
10096
|
+
),
|
|
10097
|
+
params: z.record(z.string(), z.unknown()).optional().describe(
|
|
10098
|
+
"Object that matches the input the node would normally get. Has all the same keys/types as the `needs` of the action."
|
|
10099
|
+
),
|
|
10100
|
+
page: z.number().optional().default(0),
|
|
10101
|
+
prefill: z.string().optional().describe(
|
|
10102
|
+
"The prefill string to indicate what we're fetching choices for. Likely something like `spreadsheet.id.title`. Must be provided alongside `selected_api` if both `action_id` and `input_field_id` are not."
|
|
10103
|
+
),
|
|
10104
|
+
action_id: z.string().optional().describe(
|
|
10105
|
+
"The id that will be used to lookup the Action for prefill lookup. If provided, `input_field_id` is required, else `prefill` must be provided."
|
|
10106
|
+
),
|
|
10107
|
+
input_field_id: z.string().optional().describe(
|
|
10108
|
+
"The id (key) of the input field (Need) that dynamic choices are being retrieved for. If provided, `action_id` is required, else `prefill` must be provided."
|
|
10109
|
+
)
|
|
10079
10110
|
});
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10111
|
+
z.object({
|
|
10112
|
+
success: z.boolean(),
|
|
10113
|
+
choices: z.array(NeedChoicesSchema).optional(),
|
|
10114
|
+
next_page: z.number().optional(),
|
|
10115
|
+
errors: z.array(z.string()).optional(),
|
|
10116
|
+
meta: NeedChoicesResponseMetaSchema.optional(),
|
|
10117
|
+
links: NeedChoicesResponseLinksSchema.optional()
|
|
10085
10118
|
});
|
|
10086
10119
|
|
|
10087
|
-
// src/
|
|
10088
|
-
var
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
});
|
|
10113
|
-
const choices = fieldKeyChoices2(fields);
|
|
10114
|
-
const props = {
|
|
10115
|
-
fieldKey: {
|
|
10116
|
-
label: "Field",
|
|
10117
|
-
required: true,
|
|
10118
|
-
resolver: {
|
|
10119
|
-
type: "dynamic",
|
|
10120
|
-
listItems: () => ({ data: choices }),
|
|
10121
|
-
prompt: () => ({
|
|
10122
|
-
type: "list",
|
|
10123
|
-
message: "Select field:",
|
|
10124
|
-
choices
|
|
10125
|
-
})
|
|
10126
|
-
}
|
|
10127
|
-
},
|
|
10128
|
-
direction: {
|
|
10129
|
-
label: "Direction",
|
|
10130
|
-
required: true,
|
|
10131
|
-
resolver: {
|
|
10132
|
-
type: "dynamic",
|
|
10133
|
-
listItems: () => ({ data: DIRECTION_CHOICES }),
|
|
10134
|
-
prompt: () => ({
|
|
10135
|
-
type: "list",
|
|
10136
|
-
message: "Select direction:",
|
|
10137
|
-
choices: DIRECTION_CHOICES
|
|
10138
|
-
})
|
|
10139
|
-
}
|
|
10140
|
-
}
|
|
10141
|
-
};
|
|
10142
|
-
return props;
|
|
10120
|
+
// src/schemas/Action.ts
|
|
10121
|
+
var ActionItemSchema = ActionSchema.omit({
|
|
10122
|
+
type: true,
|
|
10123
|
+
name: true,
|
|
10124
|
+
selected_api: true
|
|
10125
|
+
}).extend({
|
|
10126
|
+
app_key: z.string(),
|
|
10127
|
+
// App key without version (extracted from selected_api)
|
|
10128
|
+
app_version: z.string().optional(),
|
|
10129
|
+
// Version extracted from selected_api
|
|
10130
|
+
action_type: ActionSchema.shape.type,
|
|
10131
|
+
// Mapped from original 'type' field
|
|
10132
|
+
title: z.string(),
|
|
10133
|
+
// Mapped from original 'name' field
|
|
10134
|
+
type: z.literal("action")
|
|
10135
|
+
// Fixed type identifier
|
|
10136
|
+
});
|
|
10137
|
+
|
|
10138
|
+
// src/formatters/action.ts
|
|
10139
|
+
function formatActionItem(item) {
|
|
10140
|
+
const details = [{ text: `Type: ${item.action_type}`, style: "accent" }];
|
|
10141
|
+
if (item.app_key) {
|
|
10142
|
+
details.push({ text: `App: ${item.app_key}`, style: "normal" });
|
|
10143
|
+
}
|
|
10144
|
+
if (item.description) {
|
|
10145
|
+
details.push({ text: item.description, style: "dim" });
|
|
10143
10146
|
}
|
|
10147
|
+
return {
|
|
10148
|
+
title: item.title || item.key,
|
|
10149
|
+
// `hint` is the dumb secondary string shown after the title (the action key
|
|
10150
|
+
// and, when present, its id). Replaces the deprecated `key`/`id` fields.
|
|
10151
|
+
hint: [item.key, item.id].filter((v) => Boolean(v)),
|
|
10152
|
+
description: item.description,
|
|
10153
|
+
details
|
|
10154
|
+
};
|
|
10155
|
+
}
|
|
10156
|
+
var actionItemFormatter = defineFormatter({
|
|
10157
|
+
format: ({ item }) => formatActionItem(item)
|
|
10144
10158
|
});
|
|
10145
10159
|
|
|
10146
10160
|
// src/plugins/listActions/index.ts
|
|
@@ -10239,65 +10253,37 @@ var getActionPlugin = defineMethod({
|
|
|
10239
10253
|
);
|
|
10240
10254
|
}
|
|
10241
10255
|
});
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
"/zapier/api/actions/v1/runs",
|
|
10270
|
-
runRequest,
|
|
10271
|
-
{
|
|
10272
|
-
approvalContext: () => buildActionRunContext({
|
|
10273
|
-
selected_api: selectedApi,
|
|
10274
|
-
action_type: actionType,
|
|
10275
|
-
action_key: actionKey,
|
|
10276
|
-
connection_id: connectionId != null ? String(connectionId) : void 0,
|
|
10277
|
-
// Cast: inputs is Record<string, unknown> at the SDK surface;
|
|
10278
|
-
// buildActionRunContext validates it as JSON at runtime via zod
|
|
10279
|
-
// (non-JSON values like Date/undefined are rejected there).
|
|
10280
|
-
inputs: executionOptions.inputs ?? {}
|
|
10281
|
-
})
|
|
10282
|
-
}
|
|
10283
|
-
);
|
|
10284
|
-
const runId = runData.data.id;
|
|
10285
|
-
return await api.poll(`/zapier/api/actions/v1/runs/${runId}`, {
|
|
10286
|
-
successStatus: 200,
|
|
10287
|
-
pendingStatus: 202,
|
|
10288
|
-
timeoutMilliseconds: timeoutMilliseconds ?? DEFAULT_ACTION_TIMEOUT_MILLISECONDS,
|
|
10289
|
-
resource: { type: "run", id: runId },
|
|
10290
|
-
isPending: (result) => {
|
|
10291
|
-
const data = result?.data;
|
|
10292
|
-
return data?.status === "waiting";
|
|
10293
|
-
},
|
|
10294
|
-
resultExtractor: (result) => result.data
|
|
10295
|
-
});
|
|
10296
|
-
}
|
|
10256
|
+
var CreateActionRunSchema = z.object({
|
|
10257
|
+
app: AppPropertySchema,
|
|
10258
|
+
actionType: ActionTypePropertySchema,
|
|
10259
|
+
action: ActionPropertySchema,
|
|
10260
|
+
connection: ConnectionPropertySchema.optional().describe(
|
|
10261
|
+
"Connection alias or connection ID (UUID or positive integer). Required if the action needs a connection to authenticate and interact with the service. Strings that match a key in the connections map are resolved against it; otherwise the value is used as a connection ID directly."
|
|
10262
|
+
),
|
|
10263
|
+
inputs: InputsPropertySchema.optional().describe(
|
|
10264
|
+
"Input parameters for the action"
|
|
10265
|
+
),
|
|
10266
|
+
page: z.string().optional().describe(
|
|
10267
|
+
"Page to fetch for bulk read actions. Pass the `next_page` a previous run returned to fetch the following page."
|
|
10268
|
+
),
|
|
10269
|
+
callbackUrl: z.string().url().optional().describe(
|
|
10270
|
+
"URL Zapier posts the finished run to, so you do not have to poll for it. Must use HTTPS and resolve to a public host, so a local receiver needs a tunnel. The body matches what `getActionRun` returns. Verify the `Zapier-Callback-Signature` header, and expect the same run to arrive more than once."
|
|
10271
|
+
).meta({ valueHint: "url" })
|
|
10272
|
+
}).describe(
|
|
10273
|
+
"Start an action run and return its ID without waiting for the result. Running an action is asynchronous: this hands back a run ID immediately, and `getActionRun` fetches the outcome. Reach for this pair when you want to start work and collect it later (fan out many runs, hand the ID to another process, survive a restart). `runAction` is the one-call form that starts a run and waits for its result."
|
|
10274
|
+
);
|
|
10275
|
+
var ActionRunStartedItemSchema = z.object({
|
|
10276
|
+
id: z.string().describe(
|
|
10277
|
+
"Action run ID. Pass it as the `run` for `getActionRun` to fetch the run's result."
|
|
10278
|
+
),
|
|
10279
|
+
implementation_id: z.string().describe(
|
|
10280
|
+
"Versioned implementation ID the run was started against (e.g. 'SlackCLIAPI@1.21.1'). The versionless app key is the part before the `@`."
|
|
10281
|
+
)
|
|
10282
|
+
});
|
|
10297
10283
|
var CONTEXT_CACHE_TTL_MILLISECONDS = 6e4;
|
|
10298
10284
|
var CONTEXT_CACHE_MAX_SIZE = 500;
|
|
10299
|
-
var
|
|
10300
|
-
name: "
|
|
10285
|
+
var createActionRunPlugin = defineMethod({
|
|
10286
|
+
name: "createActionRun",
|
|
10301
10287
|
imports: [
|
|
10302
10288
|
connectionsPluginRef,
|
|
10303
10289
|
manifestPluginRef,
|
|
@@ -10305,14 +10291,11 @@ var runActionPlugin = defineMethod({
|
|
|
10305
10291
|
getActionPlugin
|
|
10306
10292
|
],
|
|
10307
10293
|
categories: ["action"],
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
// No defaultPageSize — leave the default to the Actions API rather than
|
|
10314
|
-
// eagerly running more actions than the user intends (avoids app rate limits).
|
|
10315
|
-
output: "list",
|
|
10294
|
+
type: "create",
|
|
10295
|
+
itemType: "StartedActionRun",
|
|
10296
|
+
inputSchema: CreateActionRunSchema,
|
|
10297
|
+
outputSchema: ActionRunStartedItemSchema,
|
|
10298
|
+
output: "item",
|
|
10316
10299
|
resolvers: {
|
|
10317
10300
|
app: appKeyResolver,
|
|
10318
10301
|
actionType: actionTypeResolver,
|
|
@@ -10320,14 +10303,12 @@ var runActionPlugin = defineMethod({
|
|
|
10320
10303
|
connection: connectionIdResolver,
|
|
10321
10304
|
inputs: inputsResolver
|
|
10322
10305
|
},
|
|
10323
|
-
// A per-SDK-instance TTL cache of resolved (selectedApi, actionId), built once
|
|
10324
|
-
// in setup so it persists across calls. The imports it resolves through
|
|
10325
|
-
// (`manifest.getVersionedImplementationId`, `getAction`) are threaded in per
|
|
10326
|
-
// call from `run`, not captured here.
|
|
10327
10306
|
setup: () => {
|
|
10328
10307
|
const cache = /* @__PURE__ */ new Map();
|
|
10329
10308
|
function evictIfNeeded() {
|
|
10330
|
-
if (cache.size < CONTEXT_CACHE_MAX_SIZE)
|
|
10309
|
+
if (cache.size < CONTEXT_CACHE_MAX_SIZE) {
|
|
10310
|
+
return;
|
|
10311
|
+
}
|
|
10331
10312
|
const now = Date.now();
|
|
10332
10313
|
let oldestKey;
|
|
10333
10314
|
let oldestExpiry = Infinity;
|
|
@@ -10341,13 +10322,15 @@ var runActionPlugin = defineMethod({
|
|
|
10341
10322
|
oldestKey = key;
|
|
10342
10323
|
}
|
|
10343
10324
|
}
|
|
10344
|
-
if (!evictedAny && oldestKey)
|
|
10325
|
+
if (!evictedAny && oldestKey) {
|
|
10326
|
+
cache.delete(oldestKey);
|
|
10327
|
+
}
|
|
10345
10328
|
}
|
|
10346
|
-
async function
|
|
10329
|
+
async function resolveActionRunContext(options) {
|
|
10347
10330
|
const { imports, appKey, actionKey, actionType } = options;
|
|
10348
10331
|
const getVersionedImplementationId = imports.manifest.getVersionedImplementationId;
|
|
10349
|
-
const
|
|
10350
|
-
if (!
|
|
10332
|
+
const implementationId = await getVersionedImplementationId(appKey);
|
|
10333
|
+
if (!implementationId) {
|
|
10351
10334
|
throw new ZapierConfigurationError(
|
|
10352
10335
|
"No current_implementation_id found for app",
|
|
10353
10336
|
{ configType: "current_implementation_id" }
|
|
@@ -10363,15 +10346,19 @@ var runActionPlugin = defineMethod({
|
|
|
10363
10346
|
`Action type mismatch: expected ${actionType}, got ${actionData.data.action_type}`
|
|
10364
10347
|
);
|
|
10365
10348
|
}
|
|
10366
|
-
return {
|
|
10349
|
+
return { implementationId, actionId: actionData.data.id };
|
|
10367
10350
|
}
|
|
10368
|
-
function
|
|
10351
|
+
function getActionRunContext(options) {
|
|
10369
10352
|
const contextKey = `${options.appKey}:${options.actionKey}:${options.actionType}`;
|
|
10370
10353
|
const cached = cache.get(contextKey);
|
|
10371
|
-
if (cached && Date.now() < cached.expiresAt)
|
|
10372
|
-
|
|
10354
|
+
if (cached && Date.now() < cached.expiresAt) {
|
|
10355
|
+
return cached.promise;
|
|
10356
|
+
}
|
|
10357
|
+
const pending = resolveActionRunContext(options).catch((error) => {
|
|
10373
10358
|
const current = cache.get(contextKey);
|
|
10374
|
-
if (current?.promise === pending)
|
|
10359
|
+
if (current?.promise === pending) {
|
|
10360
|
+
cache.delete(contextKey);
|
|
10361
|
+
}
|
|
10375
10362
|
throw error;
|
|
10376
10363
|
});
|
|
10377
10364
|
evictIfNeeded();
|
|
@@ -10381,11 +10368,105 @@ var runActionPlugin = defineMethod({
|
|
|
10381
10368
|
});
|
|
10382
10369
|
return pending;
|
|
10383
10370
|
}
|
|
10384
|
-
return {
|
|
10371
|
+
return { getActionRunContext };
|
|
10385
10372
|
},
|
|
10386
10373
|
run: async ({ imports, input, state, annotate }) => {
|
|
10387
10374
|
const api = imports.api;
|
|
10388
|
-
const
|
|
10375
|
+
const {
|
|
10376
|
+
app: appKey,
|
|
10377
|
+
action: actionKey,
|
|
10378
|
+
actionType,
|
|
10379
|
+
connection,
|
|
10380
|
+
inputs = {},
|
|
10381
|
+
page,
|
|
10382
|
+
callbackUrl
|
|
10383
|
+
} = input;
|
|
10384
|
+
const connectionId = await resolveConnectionId({
|
|
10385
|
+
connection,
|
|
10386
|
+
resolveConnection: imports.connections.resolveConnection
|
|
10387
|
+
});
|
|
10388
|
+
const { implementationId, actionId } = await state.getActionRunContext({
|
|
10389
|
+
imports,
|
|
10390
|
+
appKey,
|
|
10391
|
+
actionKey,
|
|
10392
|
+
actionType
|
|
10393
|
+
});
|
|
10394
|
+
annotate({ selectedApi: implementationId });
|
|
10395
|
+
const runRequestData = {
|
|
10396
|
+
selected_api: implementationId,
|
|
10397
|
+
// Some actions require the action ID, but it's not guaranteed available
|
|
10398
|
+
// at retrieval time (legacy), so pass everything through.
|
|
10399
|
+
action_id: actionId,
|
|
10400
|
+
action_key: actionKey,
|
|
10401
|
+
action_type: actionType,
|
|
10402
|
+
inputs
|
|
10403
|
+
};
|
|
10404
|
+
if (connectionId != null) {
|
|
10405
|
+
runRequestData.authentication_id = connectionId;
|
|
10406
|
+
}
|
|
10407
|
+
if (page) {
|
|
10408
|
+
runRequestData.page = page;
|
|
10409
|
+
}
|
|
10410
|
+
if (callbackUrl) {
|
|
10411
|
+
runRequestData.callback_url = callbackUrl;
|
|
10412
|
+
}
|
|
10413
|
+
const runData = await api.post(
|
|
10414
|
+
ACTION_RUNS_PATH,
|
|
10415
|
+
{ data: runRequestData },
|
|
10416
|
+
{
|
|
10417
|
+
approvalContext: () => buildActionRunContext({
|
|
10418
|
+
selected_api: implementationId,
|
|
10419
|
+
action_type: actionType,
|
|
10420
|
+
action_key: actionKey,
|
|
10421
|
+
connection_id: connectionId != null ? String(connectionId) : void 0,
|
|
10422
|
+
// `inputs` is `Record<string, unknown>` at the SDK surface;
|
|
10423
|
+
// buildActionRunContext validates it as JSON at runtime via zod
|
|
10424
|
+
// (non-JSON values like Date/undefined are rejected there).
|
|
10425
|
+
inputs
|
|
10426
|
+
})
|
|
10427
|
+
}
|
|
10428
|
+
);
|
|
10429
|
+
return {
|
|
10430
|
+
data: {
|
|
10431
|
+
id: runData.data.id,
|
|
10432
|
+
implementation_id: implementationId
|
|
10433
|
+
}
|
|
10434
|
+
};
|
|
10435
|
+
}
|
|
10436
|
+
});
|
|
10437
|
+
|
|
10438
|
+
// src/utils/action-run-wire.ts
|
|
10439
|
+
function actionRunPath(run) {
|
|
10440
|
+
return `${ACTION_RUNS_PATH}/${encodeURIComponent(run)}`;
|
|
10441
|
+
}
|
|
10442
|
+
function actionRunPayload(body) {
|
|
10443
|
+
return body?.data;
|
|
10444
|
+
}
|
|
10445
|
+
function isActionRunPending(body) {
|
|
10446
|
+
return actionRunPayload(body)?.status === "waiting";
|
|
10447
|
+
}
|
|
10448
|
+
|
|
10449
|
+
// src/plugins/runAction/index.ts
|
|
10450
|
+
var runActionPlugin = defineMethod({
|
|
10451
|
+
name: "runAction",
|
|
10452
|
+
imports: [apiPluginRef, connectionsPluginRef, createActionRunPlugin],
|
|
10453
|
+
categories: ["action"],
|
|
10454
|
+
itemType: "ActionResult",
|
|
10455
|
+
inputSchema: RunActionInputSchema,
|
|
10456
|
+
outputSchema: ActionResultItemSchema,
|
|
10457
|
+
skipOutputValidation: true,
|
|
10458
|
+
formatter: actionResultItemFormatter,
|
|
10459
|
+
// No defaultPageSize — leave the default to the Actions API rather than
|
|
10460
|
+
// eagerly running more actions than the user intends (avoids app rate limits).
|
|
10461
|
+
output: "list",
|
|
10462
|
+
resolvers: {
|
|
10463
|
+
app: appKeyResolver,
|
|
10464
|
+
actionType: actionTypeResolver,
|
|
10465
|
+
action: actionKeyResolver,
|
|
10466
|
+
connection: connectionIdResolver,
|
|
10467
|
+
inputs: inputsResolver
|
|
10468
|
+
},
|
|
10469
|
+
run: async ({ imports, input, annotate }) => {
|
|
10389
10470
|
const appKey = "app" in input ? input.app : input.appKey;
|
|
10390
10471
|
const actionKey = "action" in input ? input.action : input.actionKey;
|
|
10391
10472
|
const {
|
|
@@ -10396,39 +10477,40 @@ var runActionPlugin = defineMethod({
|
|
|
10396
10477
|
inputs = {},
|
|
10397
10478
|
cursor
|
|
10398
10479
|
} = input;
|
|
10399
|
-
const timeoutMilliseconds = input.timeoutSeconds != null ? input.timeoutSeconds * 1e3 : input.timeoutMs;
|
|
10480
|
+
const timeoutMilliseconds = (input.timeoutSeconds != null ? input.timeoutSeconds * 1e3 : input.timeoutMs) ?? DEFAULT_ACTION_TIMEOUT_MILLISECONDS;
|
|
10400
10481
|
const resolvedConnectionId = await resolveConnectionId({
|
|
10401
10482
|
connectionId,
|
|
10402
10483
|
connection,
|
|
10403
10484
|
authenticationId,
|
|
10404
|
-
resolveConnection
|
|
10405
|
-
});
|
|
10406
|
-
const { selectedApi, actionId } = await state.getRunActionContext({
|
|
10407
|
-
imports,
|
|
10408
|
-
appKey,
|
|
10409
|
-
actionKey,
|
|
10410
|
-
actionType
|
|
10485
|
+
resolveConnection: imports.connections.resolveConnection
|
|
10411
10486
|
});
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
api,
|
|
10415
|
-
selectedApi,
|
|
10416
|
-
// Some actions require the action ID, but it's not guaranteed available at
|
|
10417
|
-
// retrieval time (legacy), so pass everything through.
|
|
10418
|
-
actionId,
|
|
10419
|
-
actionKey,
|
|
10487
|
+
const { data: started } = await imports.createActionRun({
|
|
10488
|
+
app: appKey,
|
|
10420
10489
|
actionType,
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10490
|
+
action: actionKey,
|
|
10491
|
+
connection: resolvedConnectionId,
|
|
10492
|
+
inputs,
|
|
10493
|
+
page: cursor
|
|
10425
10494
|
});
|
|
10426
|
-
|
|
10427
|
-
|
|
10495
|
+
annotate({ selectedApi: started.implementation_id });
|
|
10496
|
+
const run = await imports.api.poll(
|
|
10497
|
+
actionRunPath(started.id),
|
|
10498
|
+
{
|
|
10499
|
+
resource: { type: "run", id: started.id },
|
|
10500
|
+
successStatus: 200,
|
|
10501
|
+
pendingStatus: 202,
|
|
10502
|
+
timeoutMilliseconds,
|
|
10503
|
+
isPending: isActionRunPending,
|
|
10504
|
+
resultExtractor: (body) => actionRunPayload(body) ?? {}
|
|
10505
|
+
}
|
|
10506
|
+
);
|
|
10507
|
+
const errors = run.errors ?? [];
|
|
10508
|
+
if (errors.length > 0) {
|
|
10509
|
+
const errorMessage2 = errors.map((error) => error.detail || error.title || "Unknown error").join("; ");
|
|
10428
10510
|
throw new ZapierActionError(`Action execution failed: ${errorMessage2}`, {
|
|
10429
10511
|
appKey,
|
|
10430
10512
|
actionKey,
|
|
10431
|
-
errors:
|
|
10513
|
+
errors: errors.map(
|
|
10432
10514
|
(error) => ({
|
|
10433
10515
|
status: 200,
|
|
10434
10516
|
code: error.code ?? "unknown",
|
|
@@ -10439,10 +10521,10 @@ var runActionPlugin = defineMethod({
|
|
|
10439
10521
|
});
|
|
10440
10522
|
}
|
|
10441
10523
|
return {
|
|
10442
|
-
data:
|
|
10524
|
+
data: run.results ?? [],
|
|
10443
10525
|
// Coerce to a string: the API returns a numeric page index, but
|
|
10444
10526
|
// `SdkPage.nextCursor` is a string (and the page guard enforces it).
|
|
10445
|
-
nextCursor:
|
|
10527
|
+
nextCursor: run.next_page != null ? String(run.next_page) : void 0
|
|
10446
10528
|
};
|
|
10447
10529
|
}
|
|
10448
10530
|
});
|
|
@@ -11873,6 +11955,65 @@ var findUniqueConnectionPlugin = defineMethod({
|
|
|
11873
11955
|
return { data: connectionsResponse.data[0] };
|
|
11874
11956
|
}
|
|
11875
11957
|
});
|
|
11958
|
+
var GetActionRunSchema = z.object({
|
|
11959
|
+
run: z.string().min(1).describe("Action run ID returned by `createActionRun`")
|
|
11960
|
+
}).describe(
|
|
11961
|
+
"Fetch the current state of an action run started by `createActionRun`. This is a point-in-time read that returns immediately: a run Zapier has not finished executing comes back with status `waiting`, so call again to check for a result. `runAction` starts a run and waits for its result in one call. Results are stored for seven days after the run was created."
|
|
11962
|
+
);
|
|
11963
|
+
var ActionRunStatusSchema = openEnum(
|
|
11964
|
+
["waiting", "success", "error", "unknown"],
|
|
11965
|
+
"Where the run is in its lifecycle. `waiting` means Zapier is still executing it; `error` means the app returned a failure (details in `errors`). `unknown` means the response carried no status, so the outcome could not be determined \u2014 treat it as inconclusive rather than as success."
|
|
11966
|
+
);
|
|
11967
|
+
var ActionRunErrorSchema = z.object({
|
|
11968
|
+
code: z.string().optional().describe("Machine-readable error category"),
|
|
11969
|
+
title: z.string().nullable().optional().describe("Short error label"),
|
|
11970
|
+
detail: z.string().optional().describe("Human-readable error detail")
|
|
11971
|
+
});
|
|
11972
|
+
var ActionRunItemSchema = z.object({
|
|
11973
|
+
id: z.string().describe("Action run ID"),
|
|
11974
|
+
status: ActionRunStatusSchema,
|
|
11975
|
+
results: z.array(z.unknown()).describe(
|
|
11976
|
+
"Records the action produced. Can be empty even on a successful run."
|
|
11977
|
+
),
|
|
11978
|
+
next_page: z.string().optional().describe(
|
|
11979
|
+
"For bulk read actions, the following page. Pass it back as the `page` for `createActionRun` to fetch that page."
|
|
11980
|
+
),
|
|
11981
|
+
errors: z.array(ActionRunErrorSchema).describe("Errors the app returned while running the action")
|
|
11982
|
+
});
|
|
11983
|
+
|
|
11984
|
+
// src/plugins/getActionRun/index.ts
|
|
11985
|
+
function toActionRun(runId, payload) {
|
|
11986
|
+
if (!payload) {
|
|
11987
|
+
return { id: runId, status: "waiting", results: [], errors: [] };
|
|
11988
|
+
}
|
|
11989
|
+
return {
|
|
11990
|
+
id: payload.id ?? runId,
|
|
11991
|
+
// Never infer success from an absent status.
|
|
11992
|
+
status: payload.status ?? "unknown",
|
|
11993
|
+
results: payload.results ?? [],
|
|
11994
|
+
// The API answers with either a page token or a numeric page index, but
|
|
11995
|
+
// `createActionRun` takes `page` as a string, so normalize to one type the
|
|
11996
|
+
// caller can hand straight back.
|
|
11997
|
+
...payload.next_page != null ? { next_page: String(payload.next_page) } : {},
|
|
11998
|
+
errors: payload.errors ?? []
|
|
11999
|
+
};
|
|
12000
|
+
}
|
|
12001
|
+
var getActionRunPlugin = defineMethod({
|
|
12002
|
+
name: "getActionRun",
|
|
12003
|
+
imports: [apiPluginRef],
|
|
12004
|
+
categories: ["action"],
|
|
12005
|
+
itemType: "ActionRun",
|
|
12006
|
+
inputSchema: GetActionRunSchema,
|
|
12007
|
+
outputSchema: ActionRunItemSchema,
|
|
12008
|
+
output: "item",
|
|
12009
|
+
run: async ({ imports, input }) => {
|
|
12010
|
+
const body = await imports.api.get(
|
|
12011
|
+
actionRunPath(input.run),
|
|
12012
|
+
{ resource: { type: "run", id: input.run } }
|
|
12013
|
+
);
|
|
12014
|
+
return { data: toActionRun(input.run, actionRunPayload(body)) };
|
|
12015
|
+
}
|
|
12016
|
+
});
|
|
11876
12017
|
var RelayRequestSchema = z.object({
|
|
11877
12018
|
url: z.string().url().describe("The URL to request (will be proxied through Relay)"),
|
|
11878
12019
|
method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method"),
|
|
@@ -15699,6 +15840,8 @@ var zapierSdkPlugin = definePlugin({
|
|
|
15699
15840
|
listInputFieldsDeprecatedPlugin,
|
|
15700
15841
|
getInputFieldsSchemaDeprecatedPlugin,
|
|
15701
15842
|
listInputFieldChoicesDeprecatedPlugin,
|
|
15843
|
+
createActionRunPlugin,
|
|
15844
|
+
getActionRunPlugin,
|
|
15702
15845
|
runActionPlugin,
|
|
15703
15846
|
fetchPlugin,
|
|
15704
15847
|
requestPlugin,
|
|
@@ -15913,4 +16056,4 @@ var registryPlugin = (_sdk) => {
|
|
|
15913
16056
|
return {};
|
|
15914
16057
|
};
|
|
15915
16058
|
|
|
15916
|
-
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, createZapierSdk, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, extractErrorDetail, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getNegatable, 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, logDeprecation2 as logDeprecation, manifestPlugin, manifestPluginRef, omitExports, openEnum, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as 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 };
|
|
16059
|
+
export { ACTION_RUNS_PATH, 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, createActionRunPlugin, createBaseEvent, createClientCredentialsPlugin, createController, createCorePlugin, createFunction, createMemoryCache, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierApi, createZapierSdk, createZapierSdkWithoutRegistry, declareMethod, declareOptionalProperty, declarePlugin, declareProperty, defineFormatter, defineLegacyMerge, defineMethod, defineMethodOverride, definePlugin, defineProperty, defineResolver, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, disposeSdk, durableRunIdResolver, eventEmissionHookPlugin, eventEmissionPlugin, eventEmissionPluginRef, extractErrorDetail, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, fromFunctionPlugin, generateEventId, getActionInputFieldsSchemaPlugin, getActionPlugin, getActionRunPlugin, getAgent, getAppPlugin, getBaseUrlFromCredentials, getCallerContext, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCpuTime, getCurrentTimestamp, getMemoryUsage, getNegatable, 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, logDeprecation2 as logDeprecation, manifestPlugin, manifestPluginRef, omitExports, openEnum, operationAnnotatorPlugin, parseConcurrencyEnvVar, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings2 as 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 };
|