@zapier/zapier-sdk 0.17.0 → 0.18.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +92 -92
  3. package/dist/api/schemas.d.ts +1 -1
  4. package/dist/api/schemas.js +1 -1
  5. package/dist/index.cjs +81 -45
  6. package/dist/index.d.mts +58 -100
  7. package/dist/index.mjs +81 -45
  8. package/dist/plugins/apps/index.js +2 -2
  9. package/dist/plugins/apps/schemas.d.ts +4 -3
  10. package/dist/plugins/apps/schemas.d.ts.map +1 -1
  11. package/dist/plugins/apps/schemas.js +3 -2
  12. package/dist/plugins/fetch/index.d.ts +2 -2
  13. package/dist/plugins/fetch/index.d.ts.map +1 -1
  14. package/dist/plugins/fetch/schemas.d.ts +1 -1
  15. package/dist/plugins/fetch/schemas.d.ts.map +1 -1
  16. package/dist/plugins/fetch/schemas.js +2 -4
  17. package/dist/plugins/findFirstAuthentication/index.test.js +4 -4
  18. package/dist/plugins/findUniqueAuthentication/index.test.js +4 -4
  19. package/dist/plugins/getAuthentication/index.js +1 -1
  20. package/dist/plugins/getAuthentication/index.test.js +9 -4
  21. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +1 -1
  22. package/dist/plugins/getProfile/index.d.ts.map +1 -1
  23. package/dist/plugins/getProfile/index.js +7 -4
  24. package/dist/plugins/listAuthentications/index.test.js +9 -9
  25. package/dist/plugins/listInputFieldChoices/schemas.d.ts +1 -1
  26. package/dist/plugins/listInputFields/schemas.d.ts +1 -1
  27. package/dist/plugins/manifest/schemas.d.ts +2 -2
  28. package/dist/plugins/manifest/schemas.d.ts.map +1 -1
  29. package/dist/plugins/manifest/schemas.js +2 -5
  30. package/dist/plugins/request/index.d.ts.map +1 -1
  31. package/dist/plugins/request/index.js +2 -1
  32. package/dist/plugins/request/schemas.d.ts +2 -2
  33. package/dist/plugins/request/schemas.d.ts.map +1 -1
  34. package/dist/plugins/request/schemas.js +2 -5
  35. package/dist/plugins/runAction/schemas.d.ts +1 -1
  36. package/dist/resolvers/inputFieldKey.d.ts +1 -1
  37. package/dist/resolvers/inputFieldKey.d.ts.map +1 -1
  38. package/dist/resolvers/inputs.d.ts +1 -1
  39. package/dist/resolvers/inputs.d.ts.map +1 -1
  40. package/dist/schemas/Auth.d.ts +6 -6
  41. package/dist/schemas/Auth.d.ts.map +1 -1
  42. package/dist/schemas/Auth.js +3 -1
  43. package/dist/schemas/UserProfile.d.ts +2 -44
  44. package/dist/schemas/UserProfile.d.ts.map +1 -1
  45. package/dist/schemas/UserProfile.js +10 -21
  46. package/dist/services/implementations.d.ts +2 -2
  47. package/dist/services/implementations.d.ts.map +1 -1
  48. package/dist/services/implementations.js +3 -2
  49. package/dist/temporary-internal-core/handlers/getAuthentication.test.js +6 -6
  50. package/dist/temporary-internal-core/schemas/authentications/index.d.ts +7 -7
  51. package/dist/temporary-internal-core/schemas/authentications/index.d.ts.map +1 -1
  52. package/dist/temporary-internal-core/schemas/authentications/index.js +5 -4
  53. package/dist/temporary-internal-core/utils/transformations.d.ts.map +1 -1
  54. package/dist/temporary-internal-core/utils/transformations.js +4 -2
  55. package/dist/types/properties.d.ts +1 -1
  56. package/dist/types/properties.d.ts.map +1 -1
  57. package/dist/types/properties.js +1 -2
  58. package/dist/utils/domain-utils.d.ts.map +1 -1
  59. package/dist/utils/domain-utils.js +4 -2
  60. package/dist/utils/id-utils.d.ts +13 -0
  61. package/dist/utils/id-utils.d.ts.map +1 -0
  62. package/dist/utils/id-utils.js +22 -0
  63. package/dist/utils/id-utils.test.d.ts +2 -0
  64. package/dist/utils/id-utils.test.d.ts.map +1 -0
  65. package/dist/utils/id-utils.test.js +22 -0
  66. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -72,7 +72,7 @@ var ActionTypePropertySchema = zod.z.enum([
72
72
  "filter"
73
73
  ]).describe("Action type that matches the action's defined type");
74
74
  var ActionKeyPropertySchema = zod.z.string().min(1).describe("Action key to execute");
75
- var AuthenticationIdPropertySchema = zod.z.number().int().describe("Authentication ID to use for this action");
75
+ var AuthenticationIdPropertySchema = zod.z.union([zod.z.string(), zod.z.number().int().positive()]).describe("Authentication ID to use for this action");
76
76
  var InputsPropertySchema = zod.z.record(zod.z.string(), zod.z.unknown()).describe("Input parameters for the action");
77
77
  var LimitPropertySchema = zod.z.number().int().min(1).max(MAX_PAGE_LIMIT).default(50).describe("Maximum number of items to return");
78
78
  var OffsetPropertySchema = zod.z.number().int().min(0).default(0).describe("Number of items to skip for pagination");
@@ -216,12 +216,12 @@ HTTP Status: ${error.statusCode}`;
216
216
  }
217
217
  var ActionExecutionInputSchema = zod.z.object({
218
218
  inputs: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
219
- authenticationId: zod.z.number().optional()
219
+ authenticationId: AuthenticationIdPropertySchema.optional()
220
220
  }).describe(
221
221
  "Execute an action with the given inputs for the bound app, as an alternative to runAction"
222
222
  );
223
223
  var AppFactoryInputSchema = zod.z.object({
224
- authenticationId: zod.z.number()
224
+ authenticationId: AuthenticationIdPropertySchema
225
225
  }).describe("Bind an authentication ID to an app");
226
226
  function getStringProperty(obj, key) {
227
227
  if (typeof obj === "object" && obj !== null && key in obj) {
@@ -254,7 +254,7 @@ function createActionFunction(appKey, actionType, actionKey, options, pinnedAuth
254
254
  return (actionOptions = {}) => {
255
255
  const { sdk } = options;
256
256
  const { inputs, authenticationId: providedAuthenticationId } = actionOptions;
257
- const authenticationId = pinnedAuthId || providedAuthenticationId;
257
+ const authenticationId = pinnedAuthId ?? providedAuthenticationId;
258
258
  if (!authenticationId) {
259
259
  throw new ZapierValidationError(
260
260
  `Authentication ID is required. Either use the factory pattern: sdk.apps.${appKey}({ authenticationId }) or provide authenticationId in the action call.`
@@ -273,7 +273,7 @@ function createActionTypeProxy(appKey, actionType, options, pinnedAuthId) {
273
273
  if (actionType === "fetch") {
274
274
  return async (url, init) => {
275
275
  const { sdk } = options;
276
- const authenticationId = pinnedAuthId || init?.authenticationId;
276
+ const authenticationId = pinnedAuthId ?? init?.authenticationId;
277
277
  if (!authenticationId) {
278
278
  throw new ZapierValidationError(
279
279
  `Authentication ID is required for fetch. Either use the factory pattern: sdk.apps.${appKey}({ authenticationId }).fetch(...) or provide authenticationId in the fetch call.`
@@ -382,7 +382,7 @@ var FetchInitSchema = zod.z.object({
382
382
  zod.z.instanceof(FormData),
383
383
  zod.z.instanceof(URLSearchParams)
384
384
  ]).optional(),
385
- authenticationId: zod.z.number().optional().describe("Zapier authentication ID to use for the request"),
385
+ authenticationId: AuthenticationIdPropertySchema.optional(),
386
386
  callbackUrl: zod.z.string().optional().describe("URL to send async response to (makes request async)"),
387
387
  authenticationTemplate: zod.z.string().optional().describe(
388
388
  "Optional JSON string authentication template to bypass Notary lookup"
@@ -1052,7 +1052,7 @@ zod.z.object({
1052
1052
  previous: zod.z.string().nullable().optional(),
1053
1053
  results: zod.z.array(AuthenticationSchema)
1054
1054
  });
1055
- var UserProfileSchema = zod.z.object({
1055
+ zod.z.object({
1056
1056
  id: zod.z.number(),
1057
1057
  code: zod.z.string(),
1058
1058
  user_id: zod.z.number(),
@@ -1269,7 +1269,7 @@ zod.z.object({
1269
1269
  selected_api: zod.z.string().optional().describe(
1270
1270
  "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."
1271
1271
  ),
1272
- authentication_id: zod.z.number().optional().describe(
1272
+ authentication_id: zod.z.coerce.number().optional().describe(
1273
1273
  "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)."
1274
1274
  ),
1275
1275
  params: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe(
@@ -1459,11 +1459,17 @@ function normalizeAuthenticationItem(auth, options = {}) {
1459
1459
  const {
1460
1460
  selected_api: selectedApi,
1461
1461
  customuser_id: profileId,
1462
+ id,
1463
+ account_id: accountId,
1462
1464
  ...restOfAuth
1463
1465
  } = auth;
1464
1466
  return {
1465
1467
  ...restOfAuth,
1466
1468
  // Pass through all other API response fields except selected_api
1469
+ id: String(id),
1470
+ // Convert to string
1471
+ account_id: String(accountId),
1472
+ // Convert to string
1467
1473
  implementation_id: selectedApi,
1468
1474
  // Rename selected_api to implementation_id
1469
1475
  title: auth.title || auth.label || void 0,
@@ -1476,8 +1482,8 @@ function normalizeAuthenticationItem(auth, options = {}) {
1476
1482
  // App key from implementations endpoint or parsed from selected_api
1477
1483
  app_version: appVersion,
1478
1484
  // Version from selected_api or provided
1479
- profile_id: profileId
1480
- // Map customuser_id to profile_id
1485
+ profile_id: profileId != null ? String(profileId) : void 0
1486
+ // Map customuser_id to profile_id, convert to string
1481
1487
  };
1482
1488
  }
1483
1489
  function normalizeActionItem(action) {
@@ -1998,6 +2004,20 @@ var RootFieldItemSchema = zod.z.union([
1998
2004
  FieldsetItemSchema
1999
2005
  ]);
2000
2006
 
2007
+ // src/utils/id-utils.ts
2008
+ function coerceToNumericId(fieldName, value) {
2009
+ if (value === "") {
2010
+ throw new ZapierValidationError(`The ${fieldName} cannot be empty`);
2011
+ }
2012
+ const numericValue = typeof value === "number" ? value : Number(value);
2013
+ if (!Number.isFinite(numericValue)) {
2014
+ throw new ZapierValidationError(
2015
+ `The ${fieldName} "${value}" could not be converted to a number`
2016
+ );
2017
+ }
2018
+ return numericValue;
2019
+ }
2020
+
2001
2021
  // src/services/implementations.ts
2002
2022
  async function fetchImplementationNeeds({
2003
2023
  api,
@@ -2014,7 +2034,10 @@ async function fetchImplementationNeeds({
2014
2034
  params: inputs || {}
2015
2035
  };
2016
2036
  if (authenticationId !== null) {
2017
- request.authentication_id = authenticationId;
2037
+ request.authentication_id = coerceToNumericId(
2038
+ "authentication_id",
2039
+ authenticationId
2040
+ );
2018
2041
  }
2019
2042
  const response = await api.post(
2020
2043
  "/zapier/api/v4/implementations/needs/",
@@ -2042,7 +2065,10 @@ async function fetchImplementationChoices({
2042
2065
  params: inputs || {}
2043
2066
  };
2044
2067
  if (authenticationId !== null) {
2045
- request.authentication_id = authenticationId;
2068
+ request.authentication_id = coerceToNumericId(
2069
+ "authentication_id",
2070
+ authenticationId
2071
+ );
2046
2072
  }
2047
2073
  const response = await api.post(
2048
2074
  "/zapier/api/v4/implementations/choices/",
@@ -2239,6 +2265,10 @@ var ListAuthenticationsSchema = zod.z.object({
2239
2265
  var AuthenticationItemSchema = withFormatter(
2240
2266
  AuthenticationSchema.omit({ selected_api: true, customuser_id: true }).extend(
2241
2267
  {
2268
+ id: zod.z.string(),
2269
+ // Converted from number
2270
+ account_id: zod.z.string(),
2271
+ // Converted from number
2242
2272
  implementation_id: zod.z.string().optional(),
2243
2273
  // Renamed from selected_api
2244
2274
  is_expired: zod.z.string().optional(),
@@ -2249,8 +2279,8 @@ var AuthenticationItemSchema = withFormatter(
2249
2279
  // App key from implementations endpoint
2250
2280
  app_version: zod.z.string().optional(),
2251
2281
  // Version extracted from implementation_id
2252
- profile_id: zod.z.number().optional()
2253
- // Mapped from customuser_id
2282
+ profile_id: zod.z.string().optional()
2283
+ // Mapped from customuser_id, converted from number
2254
2284
  }
2255
2285
  ),
2256
2286
  {
@@ -2499,9 +2529,12 @@ var AuthenticationItemSchema2 = AuthenticationSchema2.omit({
2499
2529
  selected_api: true,
2500
2530
  customuser_id: true
2501
2531
  }).extend({
2532
+ // Override numeric IDs with string versions (converted by normalizeAuthenticationItem)
2533
+ id: zod.z.string(),
2534
+ account_id: zod.z.string(),
2502
2535
  // Renamed fields
2503
2536
  implementation_id: zod.z.string().optional(),
2504
- profile_id: zod.z.number().optional(),
2537
+ profile_id: zod.z.string().optional(),
2505
2538
  // Mapped fields (originals preserved in ...restOfAuth)
2506
2539
  is_expired: zod.z.string().optional(),
2507
2540
  expired_at: zod.z.string().nullable().optional(),
@@ -2510,7 +2543,7 @@ var AuthenticationItemSchema2 = AuthenticationSchema2.omit({
2510
2543
  app_version: zod.z.string().optional()
2511
2544
  });
2512
2545
  var GetAuthenticationOptionsSchema = zod.z.object({
2513
- authenticationId: zod.z.number().int().positive().describe("Authentication ID to retrieve")
2546
+ authenticationId: zod.z.union([zod.z.string(), zod.z.number().int().positive()]).describe("Authentication ID to retrieve")
2514
2547
  }).describe("Get a specific authentication by ID");
2515
2548
  var GetAuthenticationHandlerRequestSchema = zod.z.object({
2516
2549
  authenticationId: zod.z.union([zod.z.string(), zod.z.number()]).describe("Authentication ID - string from searchParams or number")
@@ -2526,7 +2559,7 @@ var getAuthenticationPlugin = ({ context }) => {
2526
2559
  async function getAuthentication(options) {
2527
2560
  const { api } = context;
2528
2561
  return await api.get(
2529
- `/api/v0/authentications/${options.authenticationId}`
2562
+ `/api/v0/authentications/${encodeURIComponent(options.authenticationId)}`
2530
2563
  );
2531
2564
  }
2532
2565
  const getAuthenticationDefinition = createFunction(
@@ -2800,7 +2833,7 @@ var RelayRequestSchema = zod.z.object({
2800
2833
  url: zod.z.string().url().describe("The URL to request (will be proxied through Relay)"),
2801
2834
  method: zod.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method"),
2802
2835
  body: zod.z.any().optional().describe("Request body as a string"),
2803
- authenticationId: zod.z.number().int().optional().describe("Zapier authentication ID to use for the request"),
2836
+ authenticationId: AuthenticationIdPropertySchema.optional(),
2804
2837
  callbackUrl: zod.z.string().url().optional().describe("URL to send async response to (makes request async)"),
2805
2838
  authenticationTemplate: zod.z.string().optional().describe(
2806
2839
  "Optional JSON string authentication template to bypass Notary lookup"
@@ -2852,7 +2885,10 @@ var requestPlugin = ({ context }) => {
2852
2885
  }
2853
2886
  }
2854
2887
  if (authenticationId) {
2855
- headers["X-Relay-Authentication-Id"] = authenticationId.toString();
2888
+ headers["X-Relay-Authentication-Id"] = coerceToNumericId(
2889
+ "authenticationId",
2890
+ authenticationId
2891
+ ).toString();
2856
2892
  }
2857
2893
  if (callbackUrl) {
2858
2894
  headers["X-Relay-Callback-Url"] = callbackUrl;
@@ -2952,7 +2988,7 @@ var ActionEntrySchema = zod.z.object({
2952
2988
  appKey: zod.z.string().describe("App key (slug or implementation name)"),
2953
2989
  actionKey: zod.z.string().describe("Action key identifier"),
2954
2990
  actionType: zod.z.string().describe("Action type (e.g., 'read', 'write', 'search')"),
2955
- authenticationId: zod.z.number().nullable().optional().describe("Authentication ID used"),
2991
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
2956
2992
  inputs: zod.z.record(zod.z.string(), zod.z.unknown()).optional().describe("Resolved input values"),
2957
2993
  schema: zod.z.record(zod.z.string(), zod.z.unknown()).describe(
2958
2994
  "Complete JSON Schema from getInputFieldsSchema (includes $schema, type, properties, required, etc.)"
@@ -3338,20 +3374,18 @@ var manifestPlugin = (params) => {
3338
3374
  };
3339
3375
  var GetProfileSchema = zod.z.object({}).optional().describe("Get current user's profile information");
3340
3376
  var UserProfileItemSchema = withFormatter(
3341
- UserProfileSchema.omit({ user_id: true }).extend({
3342
- full_name: zod.z.string()
3343
- // Computed field: first_name + " " + last_name
3377
+ zod.z.object({
3378
+ id: zod.z.string(),
3379
+ first_name: zod.z.string(),
3380
+ last_name: zod.z.string(),
3381
+ full_name: zod.z.string(),
3382
+ email: zod.z.string(),
3383
+ email_confirmed: zod.z.boolean(),
3384
+ timezone: zod.z.string()
3344
3385
  }),
3345
3386
  {
3346
3387
  format: (item) => {
3347
3388
  const details = [];
3348
- if (item == null || typeof item !== "object" || !("full_name" in item) || !("username" in item)) {
3349
- return {
3350
- title: "User Profile",
3351
- subtitle: "Malformatted result item",
3352
- details: []
3353
- };
3354
- }
3355
3389
  if ("email" in item) {
3356
3390
  details.push({ text: item.email, style: "dim" });
3357
3391
  }
@@ -3361,15 +3395,9 @@ var UserProfileItemSchema = withFormatter(
3361
3395
  style: "accent"
3362
3396
  });
3363
3397
  }
3364
- if ("since_signup" in item && item.since_signup) {
3365
- details.push({
3366
- text: `Member since: ${item.since_signup}`,
3367
- style: "dim"
3368
- });
3369
- }
3370
3398
  return {
3371
3399
  title: item.full_name,
3372
- id: item.id.toString(),
3400
+ id: item.id,
3373
3401
  details
3374
3402
  };
3375
3403
  }
@@ -3385,13 +3413,15 @@ var getProfilePlugin = ({ context }) => {
3385
3413
  authRequired: true
3386
3414
  }
3387
3415
  );
3388
- const { user_id: _unusedUserId, ...data } = profile;
3389
3416
  return {
3390
3417
  data: {
3391
- ...data,
3392
- // Pass through all API response fields
3393
- full_name: `${profile.first_name} ${profile.last_name}`
3394
- // Computed field
3418
+ id: String(profile.id),
3419
+ first_name: profile.first_name,
3420
+ last_name: profile.last_name,
3421
+ full_name: `${profile.first_name} ${profile.last_name}`,
3422
+ email: profile.email,
3423
+ email_confirmed: profile.email_confirmed,
3424
+ timezone: profile.timezone
3395
3425
  }
3396
3426
  };
3397
3427
  }
@@ -3863,11 +3893,17 @@ function normalizeAuthenticationItem2(auth, options = {}) {
3863
3893
  const {
3864
3894
  selected_api: selectedApi,
3865
3895
  customuser_id: profileId,
3896
+ id,
3897
+ account_id: accountId,
3866
3898
  ...restOfAuth
3867
3899
  } = auth;
3868
3900
  return {
3869
3901
  ...restOfAuth,
3870
3902
  // Pass through all other API response fields except selected_api
3903
+ id: String(id),
3904
+ // Convert to string
3905
+ account_id: String(accountId),
3906
+ // Convert to string
3871
3907
  implementation_id: selectedApi,
3872
3908
  // Rename selected_api to implementation_id
3873
3909
  title: auth.title || auth.label || void 0,
@@ -3880,8 +3916,8 @@ function normalizeAuthenticationItem2(auth, options = {}) {
3880
3916
  // App key from implementations endpoint or parsed from selected_api
3881
3917
  app_version: appVersion,
3882
3918
  // Version from selected_api or provided
3883
- profile_id: profileId
3884
- // Map customuser_id to profile_id
3919
+ profile_id: profileId != null ? String(profileId) : void 0
3920
+ // Map customuser_id to profile_id, convert to string
3885
3921
  };
3886
3922
  }
3887
3923
 
@@ -5033,7 +5069,7 @@ function getCpuTime() {
5033
5069
 
5034
5070
  // package.json
5035
5071
  var package_default = {
5036
- version: "0.17.0"};
5072
+ version: "0.18.0"};
5037
5073
 
5038
5074
  // src/plugins/eventEmission/builders.ts
5039
5075
  function createBaseEvent(context = {}) {
package/dist/index.d.mts CHANGED
@@ -765,7 +765,7 @@ declare const ActionEntrySchema: z.ZodObject<{
765
765
  appKey: z.ZodString;
766
766
  actionKey: z.ZodString;
767
767
  actionType: z.ZodString;
768
- authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
768
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
769
769
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
770
770
  schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
771
771
  createdAt: z.ZodString;
@@ -1050,7 +1050,7 @@ declare const ListInputFieldsSchema: z.ZodObject<{
1050
1050
  write: "write";
1051
1051
  }>;
1052
1052
  actionKey: z.ZodString;
1053
- authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1053
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
1054
1054
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1055
1055
  pageSize: z.ZodOptional<z.ZodNumber>;
1056
1056
  maxItems: z.ZodOptional<z.ZodNumber>;
@@ -1153,7 +1153,7 @@ type AppItem$1 = z.infer<typeof AppItemSchema$1>;
1153
1153
  * This is the user-facing schema that the SDK plugin accepts.
1154
1154
  */
1155
1155
  declare const GetAuthenticationOptionsSchema: z.ZodObject<{
1156
- authenticationId: z.ZodNumber;
1156
+ authenticationId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1157
1157
  }, z.core.$strip>;
1158
1158
  type GetAuthenticationOptions = z.infer<typeof GetAuthenticationOptionsSchema>;
1159
1159
  /**
@@ -1162,10 +1162,8 @@ type GetAuthenticationOptions = z.infer<typeof GetAuthenticationOptionsSchema>;
1162
1162
  declare const GetAuthenticationResponseSchema: z.ZodObject<{
1163
1163
  data: z.ZodLazy<z.ZodObject<{
1164
1164
  url: z.ZodOptional<z.ZodString>;
1165
- account_id: z.ZodNumber;
1166
1165
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1167
1166
  date: z.ZodString;
1168
- id: z.ZodNumber;
1169
1167
  lastchanged: z.ZodOptional<z.ZodString>;
1170
1168
  destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1171
1169
  is_invite_only: z.ZodBoolean;
@@ -1179,8 +1177,10 @@ declare const GetAuthenticationResponseSchema: z.ZodObject<{
1179
1177
  groups: z.ZodOptional<z.ZodString>;
1180
1178
  members: z.ZodOptional<z.ZodString>;
1181
1179
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
1180
+ id: z.ZodString;
1181
+ account_id: z.ZodString;
1182
1182
  implementation_id: z.ZodOptional<z.ZodString>;
1183
- profile_id: z.ZodOptional<z.ZodNumber>;
1183
+ profile_id: z.ZodOptional<z.ZodString>;
1184
1184
  is_expired: z.ZodOptional<z.ZodString>;
1185
1185
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1186
1186
  app_key: z.ZodOptional<z.ZodString>;
@@ -1223,7 +1223,7 @@ declare const RelayRequestSchema: z.ZodObject<{
1223
1223
  OPTIONS: "OPTIONS";
1224
1224
  }>>;
1225
1225
  body: z.ZodOptional<z.ZodAny>;
1226
- authenticationId: z.ZodOptional<z.ZodNumber>;
1226
+ authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
1227
1227
  callbackUrl: z.ZodOptional<z.ZodString>;
1228
1228
  authenticationTemplate: z.ZodOptional<z.ZodString>;
1229
1229
  headers: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodCustom<Headers, Headers>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>]>>;
@@ -1245,7 +1245,7 @@ declare const RelayFetchSchema: z.ZodObject<{
1245
1245
  OPTIONS: "OPTIONS";
1246
1246
  }>>;
1247
1247
  body: z.ZodOptional<z.ZodAny>;
1248
- authenticationId: z.ZodOptional<z.ZodNumber>;
1248
+ authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
1249
1249
  callbackUrl: z.ZodOptional<z.ZodString>;
1250
1250
  authenticationTemplate: z.ZodOptional<z.ZodString>;
1251
1251
  headers: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodCustom<Headers, Headers>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>]>>;
@@ -1303,13 +1303,45 @@ interface ApiPluginProvides {
1303
1303
  }
1304
1304
  declare const apiPlugin: Plugin<{}, {}, ApiPluginProvides>;
1305
1305
 
1306
+ declare const AppKeyPropertySchema: z.ZodString & {
1307
+ _def: z.core.$ZodStringDef & PositionalMetadata;
1308
+ };
1309
+ declare const ActionTypePropertySchema: z.ZodEnum<{
1310
+ search: "search";
1311
+ filter: "filter";
1312
+ read: "read";
1313
+ read_bulk: "read_bulk";
1314
+ run: "run";
1315
+ search_and_write: "search_and_write";
1316
+ search_or_write: "search_or_write";
1317
+ write: "write";
1318
+ }>;
1319
+ declare const ActionKeyPropertySchema: z.ZodString;
1320
+ declare const AuthenticationIdPropertySchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1321
+ declare const InputsPropertySchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1322
+ declare const LimitPropertySchema: z.ZodDefault<z.ZodNumber>;
1323
+ declare const OffsetPropertySchema: z.ZodDefault<z.ZodNumber>;
1324
+ declare const OutputPropertySchema: z.ZodString;
1325
+ declare const DebugPropertySchema: z.ZodDefault<z.ZodBoolean>;
1326
+ declare const ParamsPropertySchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1327
+ type AppKeyProperty = z.infer<typeof AppKeyPropertySchema>;
1328
+ type ActionTypeProperty = z.infer<typeof ActionTypePropertySchema>;
1329
+ type ActionKeyProperty = z.infer<typeof ActionKeyPropertySchema>;
1330
+ type AuthenticationIdProperty = z.infer<typeof AuthenticationIdPropertySchema>;
1331
+ type InputsProperty = z.infer<typeof InputsPropertySchema>;
1332
+ type LimitProperty = z.infer<typeof LimitPropertySchema>;
1333
+ type OffsetProperty = z.infer<typeof OffsetPropertySchema>;
1334
+ type OutputProperty = z.infer<typeof OutputPropertySchema>;
1335
+ type DebugProperty = z.infer<typeof DebugPropertySchema>;
1336
+ type ParamsProperty = z.infer<typeof ParamsPropertySchema>;
1337
+
1306
1338
  declare const ActionExecutionInputSchema: z.ZodObject<{
1307
1339
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1308
- authenticationId: z.ZodOptional<z.ZodNumber>;
1340
+ authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
1309
1341
  }, z.core.$strip>;
1310
1342
  type ActionExecutionOptions = z.infer<typeof ActionExecutionInputSchema>;
1311
1343
  declare const AppFactoryInputSchema: z.ZodObject<{
1312
- authenticationId: z.ZodNumber;
1344
+ authenticationId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
1313
1345
  }, z.core.$strip>;
1314
1346
  type AppFactoryInput = z.infer<typeof AppFactoryInputSchema>;
1315
1347
  interface BaseActionTypeProxy {
@@ -1325,7 +1357,7 @@ interface BaseActionTypeProxy {
1325
1357
  }
1326
1358
  interface FetchActionType {
1327
1359
  fetch: (url: string | URL, init?: RequestInit & {
1328
- authenticationId?: number;
1360
+ authenticationId?: AuthenticationIdProperty;
1329
1361
  callbackUrl?: string;
1330
1362
  authenticationTemplate?: string;
1331
1363
  }) => Promise<Response>;
@@ -1361,7 +1393,7 @@ RequestPluginProvides>;
1361
1393
 
1362
1394
  interface FetchPluginProvides {
1363
1395
  fetch: (url: string | URL, init?: RequestInit & {
1364
- authenticationId?: number;
1396
+ authenticationId?: string | number;
1365
1397
  callbackUrl?: string;
1366
1398
  authenticationTemplate?: string;
1367
1399
  }) => Promise<Response>;
@@ -1386,7 +1418,7 @@ declare const fetchPlugin: Plugin<GetSdkType<RequestPluginProvides>, // requires
1386
1418
  EventEmissionContext, // requires eventEmission context for telemetry
1387
1419
  FetchPluginProvides>;
1388
1420
  type ZapierFetchInitOptions = RequestInit & {
1389
- authenticationId?: number;
1421
+ authenticationId?: string | number;
1390
1422
  callbackUrl?: string;
1391
1423
  authenticationTemplate?: string;
1392
1424
  };
@@ -1406,7 +1438,7 @@ declare const RunActionSchema: z.ZodObject<{
1406
1438
  write: "write";
1407
1439
  }>;
1408
1440
  actionKey: z.ZodString;
1409
- authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1441
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
1410
1442
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1411
1443
  pageSize: z.ZodOptional<z.ZodNumber>;
1412
1444
  maxItems: z.ZodOptional<z.ZodNumber>;
@@ -1708,7 +1740,7 @@ declare const GetInputFieldsSchemaSchema: z.ZodObject<{
1708
1740
  write: "write";
1709
1741
  }>;
1710
1742
  actionKey: z.ZodString;
1711
- authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1743
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
1712
1744
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1713
1745
  }, z.core.$strip>;
1714
1746
  type GetInputFieldsSchemaOptions = z.infer<typeof GetInputFieldsSchemaSchema>;
@@ -1749,7 +1781,7 @@ declare const ListInputFieldChoicesSchema: z.ZodObject<{
1749
1781
  }>;
1750
1782
  actionKey: z.ZodString;
1751
1783
  inputFieldKey: z.ZodString;
1752
- authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1784
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
1753
1785
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1754
1786
  page: z.ZodOptional<z.ZodNumber>;
1755
1787
  pageSize: z.ZodOptional<z.ZodNumber>;
@@ -1968,10 +2000,8 @@ declare const AppItemSchema: z.ZodObject<{
1968
2000
 
1969
2001
  declare const AuthenticationItemSchema: z.ZodObject<{
1970
2002
  url: z.ZodOptional<z.ZodString>;
1971
- account_id: z.ZodNumber;
1972
2003
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1973
2004
  date: z.ZodString;
1974
- id: z.ZodNumber;
1975
2005
  lastchanged: z.ZodOptional<z.ZodString>;
1976
2006
  destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1977
2007
  is_invite_only: z.ZodBoolean;
@@ -1985,19 +2015,19 @@ declare const AuthenticationItemSchema: z.ZodObject<{
1985
2015
  groups: z.ZodOptional<z.ZodString>;
1986
2016
  members: z.ZodOptional<z.ZodString>;
1987
2017
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
2018
+ id: z.ZodString;
2019
+ account_id: z.ZodString;
1988
2020
  implementation_id: z.ZodOptional<z.ZodString>;
1989
2021
  is_expired: z.ZodOptional<z.ZodString>;
1990
2022
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1991
2023
  app_key: z.ZodOptional<z.ZodString>;
1992
2024
  app_version: z.ZodOptional<z.ZodString>;
1993
- profile_id: z.ZodOptional<z.ZodNumber>;
2025
+ profile_id: z.ZodOptional<z.ZodString>;
1994
2026
  }, z.core.$strip>;
1995
2027
  declare const AuthItemSchema: z.ZodObject<{
1996
2028
  url: z.ZodOptional<z.ZodString>;
1997
- account_id: z.ZodNumber;
1998
2029
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1999
2030
  date: z.ZodString;
2000
- id: z.ZodNumber;
2001
2031
  lastchanged: z.ZodOptional<z.ZodString>;
2002
2032
  destination_selected_api: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2003
2033
  is_invite_only: z.ZodBoolean;
@@ -2011,12 +2041,14 @@ declare const AuthItemSchema: z.ZodObject<{
2011
2041
  groups: z.ZodOptional<z.ZodString>;
2012
2042
  members: z.ZodOptional<z.ZodString>;
2013
2043
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
2044
+ id: z.ZodString;
2045
+ account_id: z.ZodString;
2014
2046
  implementation_id: z.ZodOptional<z.ZodString>;
2015
2047
  is_expired: z.ZodOptional<z.ZodString>;
2016
2048
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2017
2049
  app_key: z.ZodOptional<z.ZodString>;
2018
2050
  app_version: z.ZodOptional<z.ZodString>;
2019
- profile_id: z.ZodOptional<z.ZodNumber>;
2051
+ profile_id: z.ZodOptional<z.ZodString>;
2020
2052
  }, z.core.$strip>;
2021
2053
  type AuthItem = z.infer<typeof AuthItemSchema>;
2022
2054
 
@@ -2043,55 +2075,13 @@ declare const ActionItemSchema: z.ZodObject<{
2043
2075
  }, z.core.$strip>;
2044
2076
 
2045
2077
  declare const UserProfileItemSchema: z.ZodObject<{
2046
- code: z.ZodString;
2047
- id: z.ZodNumber;
2048
- auto_provisioned: z.ZodBoolean;
2078
+ id: z.ZodString;
2049
2079
  first_name: z.ZodString;
2050
2080
  last_name: z.ZodString;
2051
- username: z.ZodString;
2052
- personas: z.ZodString;
2053
- user_generated_personas: z.ZodString;
2054
- last_login: z.ZodString;
2081
+ full_name: z.ZodString;
2055
2082
  email: z.ZodString;
2056
- email_hash: z.ZodString;
2057
2083
  email_confirmed: z.ZodBoolean;
2058
2084
  timezone: z.ZodString;
2059
- photo_url: z.ZodString;
2060
- has_seen_notifications: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodBoolean>>;
2061
- signup: z.ZodString;
2062
- since_signup: z.ZodString;
2063
- has_activated: z.ZodBoolean;
2064
- enable_gz_creator: z.ZodBoolean;
2065
- should_see_nps_survey: z.ZodBoolean;
2066
- is_developer: z.ZodBoolean;
2067
- is_expert: z.ZodBoolean;
2068
- tos_agreement: z.ZodBoolean;
2069
- should_renew_tos: z.ZodBoolean;
2070
- is_gdpr_consented: z.ZodBoolean;
2071
- disable_ssl_check: z.ZodBoolean;
2072
- identity: z.ZodNumber;
2073
- summary_schedule: z.ZodString;
2074
- alert_triggers: z.ZodString;
2075
- alert_actions: z.ZodString;
2076
- is_staff: z.ZodBoolean;
2077
- is_zt_reviewer: z.ZodBoolean;
2078
- is_high_value: z.ZodBoolean;
2079
- is_temporary: z.ZodBoolean;
2080
- banner_message: z.ZodString;
2081
- enable_totp_2fa: z.ZodBoolean;
2082
- viewed_help: z.ZodRecord<z.ZodString, z.ZodBoolean>;
2083
- show_editor_migration_mesaging: z.ZodBoolean;
2084
- switches: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2085
- organizations: z.ZodArray<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
2086
- primary_organization: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2087
- has_active_zaps: z.ZodBoolean;
2088
- has_google_sso: z.ZodBoolean;
2089
- auth_realm: z.ZodString;
2090
- roles: z.ZodArray<z.ZodObject<{
2091
- account_id: z.ZodNumber;
2092
- role: z.ZodString;
2093
- }, z.core.$strip>>;
2094
- full_name: z.ZodString;
2095
2085
  }, z.core.$strip>;
2096
2086
 
2097
2087
  /**
@@ -2131,38 +2121,6 @@ type RootFieldItem = z.infer<typeof RootFieldItemSchema>;
2131
2121
  */
2132
2122
  type UserProfileItem = z.infer<typeof UserProfileItemSchema>;
2133
2123
 
2134
- declare const AppKeyPropertySchema: z.ZodString & {
2135
- _def: z.core.$ZodStringDef & PositionalMetadata;
2136
- };
2137
- declare const ActionTypePropertySchema: z.ZodEnum<{
2138
- search: "search";
2139
- filter: "filter";
2140
- read: "read";
2141
- read_bulk: "read_bulk";
2142
- run: "run";
2143
- search_and_write: "search_and_write";
2144
- search_or_write: "search_or_write";
2145
- write: "write";
2146
- }>;
2147
- declare const ActionKeyPropertySchema: z.ZodString;
2148
- declare const AuthenticationIdPropertySchema: z.ZodNumber;
2149
- declare const InputsPropertySchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2150
- declare const LimitPropertySchema: z.ZodDefault<z.ZodNumber>;
2151
- declare const OffsetPropertySchema: z.ZodDefault<z.ZodNumber>;
2152
- declare const OutputPropertySchema: z.ZodString;
2153
- declare const DebugPropertySchema: z.ZodDefault<z.ZodBoolean>;
2154
- declare const ParamsPropertySchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2155
- type AppKeyProperty = z.infer<typeof AppKeyPropertySchema>;
2156
- type ActionTypeProperty = z.infer<typeof ActionTypePropertySchema>;
2157
- type ActionKeyProperty = z.infer<typeof ActionKeyPropertySchema>;
2158
- type AuthenticationIdProperty = z.infer<typeof AuthenticationIdPropertySchema>;
2159
- type InputsProperty = z.infer<typeof InputsPropertySchema>;
2160
- type LimitProperty = z.infer<typeof LimitPropertySchema>;
2161
- type OffsetProperty = z.infer<typeof OffsetPropertySchema>;
2162
- type OutputProperty = z.infer<typeof OutputPropertySchema>;
2163
- type DebugProperty = z.infer<typeof DebugPropertySchema>;
2164
- type ParamsProperty = z.infer<typeof ParamsPropertySchema>;
2165
-
2166
2124
  /**
2167
2125
  * Generic utility functions for creating paginated SDK functions
2168
2126
  */
@@ -2318,7 +2276,7 @@ type InputsResolver = {
2318
2276
  appKey: string;
2319
2277
  actionKey: string;
2320
2278
  actionType: ActionTypeProperty;
2321
- authenticationId: number;
2279
+ authenticationId: string | number;
2322
2280
  inputs?: Record<string, unknown>;
2323
2281
  }) => Promise<RootFieldItem[]>;
2324
2282
  };
@@ -2329,7 +2287,7 @@ declare const inputFieldKeyResolver: DynamicResolver<InputFieldItem$1, {
2329
2287
  appKey: string;
2330
2288
  actionKey: string;
2331
2289
  actionType: ActionTypeProperty;
2332
- authenticationId: number;
2290
+ authenticationId: string | number;
2333
2291
  inputs?: Record<string, unknown>;
2334
2292
  }>;
2335
2293