@zapier/zapier-sdk 0.92.1 → 0.94.0

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