@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.mjs CHANGED
@@ -50,7 +50,7 @@ var ActionTypePropertySchema = z.enum([
50
50
  "filter"
51
51
  ]).describe("Action type that matches the action's defined type");
52
52
  var ActionKeyPropertySchema = z.string().min(1).describe("Action key to execute");
53
- var AuthenticationIdPropertySchema = z.number().int().describe("Authentication ID to use for this action");
53
+ var AuthenticationIdPropertySchema = z.union([z.string(), z.number().int().positive()]).describe("Authentication ID to use for this action");
54
54
  var InputsPropertySchema = z.record(z.string(), z.unknown()).describe("Input parameters for the action");
55
55
  var LimitPropertySchema = z.number().int().min(1).max(MAX_PAGE_LIMIT).default(50).describe("Maximum number of items to return");
56
56
  var OffsetPropertySchema = z.number().int().min(0).default(0).describe("Number of items to skip for pagination");
@@ -194,12 +194,12 @@ HTTP Status: ${error.statusCode}`;
194
194
  }
195
195
  var ActionExecutionInputSchema = z.object({
196
196
  inputs: z.record(z.string(), z.unknown()).optional(),
197
- authenticationId: z.number().optional()
197
+ authenticationId: AuthenticationIdPropertySchema.optional()
198
198
  }).describe(
199
199
  "Execute an action with the given inputs for the bound app, as an alternative to runAction"
200
200
  );
201
201
  var AppFactoryInputSchema = z.object({
202
- authenticationId: z.number()
202
+ authenticationId: AuthenticationIdPropertySchema
203
203
  }).describe("Bind an authentication ID to an app");
204
204
  function getStringProperty(obj, key) {
205
205
  if (typeof obj === "object" && obj !== null && key in obj) {
@@ -232,7 +232,7 @@ function createActionFunction(appKey, actionType, actionKey, options, pinnedAuth
232
232
  return (actionOptions = {}) => {
233
233
  const { sdk } = options;
234
234
  const { inputs, authenticationId: providedAuthenticationId } = actionOptions;
235
- const authenticationId = pinnedAuthId || providedAuthenticationId;
235
+ const authenticationId = pinnedAuthId ?? providedAuthenticationId;
236
236
  if (!authenticationId) {
237
237
  throw new ZapierValidationError(
238
238
  `Authentication ID is required. Either use the factory pattern: sdk.apps.${appKey}({ authenticationId }) or provide authenticationId in the action call.`
@@ -251,7 +251,7 @@ function createActionTypeProxy(appKey, actionType, options, pinnedAuthId) {
251
251
  if (actionType === "fetch") {
252
252
  return async (url, init) => {
253
253
  const { sdk } = options;
254
- const authenticationId = pinnedAuthId || init?.authenticationId;
254
+ const authenticationId = pinnedAuthId ?? init?.authenticationId;
255
255
  if (!authenticationId) {
256
256
  throw new ZapierValidationError(
257
257
  `Authentication ID is required for fetch. Either use the factory pattern: sdk.apps.${appKey}({ authenticationId }).fetch(...) or provide authenticationId in the fetch call.`
@@ -360,7 +360,7 @@ var FetchInitSchema = z.object({
360
360
  z.instanceof(FormData),
361
361
  z.instanceof(URLSearchParams)
362
362
  ]).optional(),
363
- authenticationId: z.number().optional().describe("Zapier authentication ID to use for the request"),
363
+ authenticationId: AuthenticationIdPropertySchema.optional(),
364
364
  callbackUrl: z.string().optional().describe("URL to send async response to (makes request async)"),
365
365
  authenticationTemplate: z.string().optional().describe(
366
366
  "Optional JSON string authentication template to bypass Notary lookup"
@@ -1030,7 +1030,7 @@ z.object({
1030
1030
  previous: z.string().nullable().optional(),
1031
1031
  results: z.array(AuthenticationSchema)
1032
1032
  });
1033
- var UserProfileSchema = z.object({
1033
+ z.object({
1034
1034
  id: z.number(),
1035
1035
  code: z.string(),
1036
1036
  user_id: z.number(),
@@ -1247,7 +1247,7 @@ z.object({
1247
1247
  selected_api: z.string().optional().describe(
1248
1248
  "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."
1249
1249
  ),
1250
- authentication_id: z.number().optional().describe(
1250
+ authentication_id: z.coerce.number().optional().describe(
1251
1251
  "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)."
1252
1252
  ),
1253
1253
  params: z.record(z.string(), z.unknown()).optional().describe(
@@ -1437,11 +1437,17 @@ function normalizeAuthenticationItem(auth, options = {}) {
1437
1437
  const {
1438
1438
  selected_api: selectedApi,
1439
1439
  customuser_id: profileId,
1440
+ id,
1441
+ account_id: accountId,
1440
1442
  ...restOfAuth
1441
1443
  } = auth;
1442
1444
  return {
1443
1445
  ...restOfAuth,
1444
1446
  // Pass through all other API response fields except selected_api
1447
+ id: String(id),
1448
+ // Convert to string
1449
+ account_id: String(accountId),
1450
+ // Convert to string
1445
1451
  implementation_id: selectedApi,
1446
1452
  // Rename selected_api to implementation_id
1447
1453
  title: auth.title || auth.label || void 0,
@@ -1454,8 +1460,8 @@ function normalizeAuthenticationItem(auth, options = {}) {
1454
1460
  // App key from implementations endpoint or parsed from selected_api
1455
1461
  app_version: appVersion,
1456
1462
  // Version from selected_api or provided
1457
- profile_id: profileId
1458
- // Map customuser_id to profile_id
1463
+ profile_id: profileId != null ? String(profileId) : void 0
1464
+ // Map customuser_id to profile_id, convert to string
1459
1465
  };
1460
1466
  }
1461
1467
  function normalizeActionItem(action) {
@@ -1976,6 +1982,20 @@ var RootFieldItemSchema = z.union([
1976
1982
  FieldsetItemSchema
1977
1983
  ]);
1978
1984
 
1985
+ // src/utils/id-utils.ts
1986
+ function coerceToNumericId(fieldName, value) {
1987
+ if (value === "") {
1988
+ throw new ZapierValidationError(`The ${fieldName} cannot be empty`);
1989
+ }
1990
+ const numericValue = typeof value === "number" ? value : Number(value);
1991
+ if (!Number.isFinite(numericValue)) {
1992
+ throw new ZapierValidationError(
1993
+ `The ${fieldName} "${value}" could not be converted to a number`
1994
+ );
1995
+ }
1996
+ return numericValue;
1997
+ }
1998
+
1979
1999
  // src/services/implementations.ts
1980
2000
  async function fetchImplementationNeeds({
1981
2001
  api,
@@ -1992,7 +2012,10 @@ async function fetchImplementationNeeds({
1992
2012
  params: inputs || {}
1993
2013
  };
1994
2014
  if (authenticationId !== null) {
1995
- request.authentication_id = authenticationId;
2015
+ request.authentication_id = coerceToNumericId(
2016
+ "authentication_id",
2017
+ authenticationId
2018
+ );
1996
2019
  }
1997
2020
  const response = await api.post(
1998
2021
  "/zapier/api/v4/implementations/needs/",
@@ -2020,7 +2043,10 @@ async function fetchImplementationChoices({
2020
2043
  params: inputs || {}
2021
2044
  };
2022
2045
  if (authenticationId !== null) {
2023
- request.authentication_id = authenticationId;
2046
+ request.authentication_id = coerceToNumericId(
2047
+ "authentication_id",
2048
+ authenticationId
2049
+ );
2024
2050
  }
2025
2051
  const response = await api.post(
2026
2052
  "/zapier/api/v4/implementations/choices/",
@@ -2217,6 +2243,10 @@ var ListAuthenticationsSchema = z.object({
2217
2243
  var AuthenticationItemSchema = withFormatter(
2218
2244
  AuthenticationSchema.omit({ selected_api: true, customuser_id: true }).extend(
2219
2245
  {
2246
+ id: z.string(),
2247
+ // Converted from number
2248
+ account_id: z.string(),
2249
+ // Converted from number
2220
2250
  implementation_id: z.string().optional(),
2221
2251
  // Renamed from selected_api
2222
2252
  is_expired: z.string().optional(),
@@ -2227,8 +2257,8 @@ var AuthenticationItemSchema = withFormatter(
2227
2257
  // App key from implementations endpoint
2228
2258
  app_version: z.string().optional(),
2229
2259
  // Version extracted from implementation_id
2230
- profile_id: z.number().optional()
2231
- // Mapped from customuser_id
2260
+ profile_id: z.string().optional()
2261
+ // Mapped from customuser_id, converted from number
2232
2262
  }
2233
2263
  ),
2234
2264
  {
@@ -2477,9 +2507,12 @@ var AuthenticationItemSchema2 = AuthenticationSchema2.omit({
2477
2507
  selected_api: true,
2478
2508
  customuser_id: true
2479
2509
  }).extend({
2510
+ // Override numeric IDs with string versions (converted by normalizeAuthenticationItem)
2511
+ id: z.string(),
2512
+ account_id: z.string(),
2480
2513
  // Renamed fields
2481
2514
  implementation_id: z.string().optional(),
2482
- profile_id: z.number().optional(),
2515
+ profile_id: z.string().optional(),
2483
2516
  // Mapped fields (originals preserved in ...restOfAuth)
2484
2517
  is_expired: z.string().optional(),
2485
2518
  expired_at: z.string().nullable().optional(),
@@ -2488,7 +2521,7 @@ var AuthenticationItemSchema2 = AuthenticationSchema2.omit({
2488
2521
  app_version: z.string().optional()
2489
2522
  });
2490
2523
  var GetAuthenticationOptionsSchema = z.object({
2491
- authenticationId: z.number().int().positive().describe("Authentication ID to retrieve")
2524
+ authenticationId: z.union([z.string(), z.number().int().positive()]).describe("Authentication ID to retrieve")
2492
2525
  }).describe("Get a specific authentication by ID");
2493
2526
  var GetAuthenticationHandlerRequestSchema = z.object({
2494
2527
  authenticationId: z.union([z.string(), z.number()]).describe("Authentication ID - string from searchParams or number")
@@ -2504,7 +2537,7 @@ var getAuthenticationPlugin = ({ context }) => {
2504
2537
  async function getAuthentication(options) {
2505
2538
  const { api } = context;
2506
2539
  return await api.get(
2507
- `/api/v0/authentications/${options.authenticationId}`
2540
+ `/api/v0/authentications/${encodeURIComponent(options.authenticationId)}`
2508
2541
  );
2509
2542
  }
2510
2543
  const getAuthenticationDefinition = createFunction(
@@ -2778,7 +2811,7 @@ var RelayRequestSchema = z.object({
2778
2811
  url: z.string().url().describe("The URL to request (will be proxied through Relay)"),
2779
2812
  method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method"),
2780
2813
  body: z.any().optional().describe("Request body as a string"),
2781
- authenticationId: z.number().int().optional().describe("Zapier authentication ID to use for the request"),
2814
+ authenticationId: AuthenticationIdPropertySchema.optional(),
2782
2815
  callbackUrl: z.string().url().optional().describe("URL to send async response to (makes request async)"),
2783
2816
  authenticationTemplate: z.string().optional().describe(
2784
2817
  "Optional JSON string authentication template to bypass Notary lookup"
@@ -2830,7 +2863,10 @@ var requestPlugin = ({ context }) => {
2830
2863
  }
2831
2864
  }
2832
2865
  if (authenticationId) {
2833
- headers["X-Relay-Authentication-Id"] = authenticationId.toString();
2866
+ headers["X-Relay-Authentication-Id"] = coerceToNumericId(
2867
+ "authenticationId",
2868
+ authenticationId
2869
+ ).toString();
2834
2870
  }
2835
2871
  if (callbackUrl) {
2836
2872
  headers["X-Relay-Callback-Url"] = callbackUrl;
@@ -2930,7 +2966,7 @@ var ActionEntrySchema = z.object({
2930
2966
  appKey: z.string().describe("App key (slug or implementation name)"),
2931
2967
  actionKey: z.string().describe("Action key identifier"),
2932
2968
  actionType: z.string().describe("Action type (e.g., 'read', 'write', 'search')"),
2933
- authenticationId: z.number().nullable().optional().describe("Authentication ID used"),
2969
+ authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
2934
2970
  inputs: z.record(z.string(), z.unknown()).optional().describe("Resolved input values"),
2935
2971
  schema: z.record(z.string(), z.unknown()).describe(
2936
2972
  "Complete JSON Schema from getInputFieldsSchema (includes $schema, type, properties, required, etc.)"
@@ -3316,20 +3352,18 @@ var manifestPlugin = (params) => {
3316
3352
  };
3317
3353
  var GetProfileSchema = z.object({}).optional().describe("Get current user's profile information");
3318
3354
  var UserProfileItemSchema = withFormatter(
3319
- UserProfileSchema.omit({ user_id: true }).extend({
3320
- full_name: z.string()
3321
- // Computed field: first_name + " " + last_name
3355
+ z.object({
3356
+ id: z.string(),
3357
+ first_name: z.string(),
3358
+ last_name: z.string(),
3359
+ full_name: z.string(),
3360
+ email: z.string(),
3361
+ email_confirmed: z.boolean(),
3362
+ timezone: z.string()
3322
3363
  }),
3323
3364
  {
3324
3365
  format: (item) => {
3325
3366
  const details = [];
3326
- if (item == null || typeof item !== "object" || !("full_name" in item) || !("username" in item)) {
3327
- return {
3328
- title: "User Profile",
3329
- subtitle: "Malformatted result item",
3330
- details: []
3331
- };
3332
- }
3333
3367
  if ("email" in item) {
3334
3368
  details.push({ text: item.email, style: "dim" });
3335
3369
  }
@@ -3339,15 +3373,9 @@ var UserProfileItemSchema = withFormatter(
3339
3373
  style: "accent"
3340
3374
  });
3341
3375
  }
3342
- if ("since_signup" in item && item.since_signup) {
3343
- details.push({
3344
- text: `Member since: ${item.since_signup}`,
3345
- style: "dim"
3346
- });
3347
- }
3348
3376
  return {
3349
3377
  title: item.full_name,
3350
- id: item.id.toString(),
3378
+ id: item.id,
3351
3379
  details
3352
3380
  };
3353
3381
  }
@@ -3363,13 +3391,15 @@ var getProfilePlugin = ({ context }) => {
3363
3391
  authRequired: true
3364
3392
  }
3365
3393
  );
3366
- const { user_id: _unusedUserId, ...data } = profile;
3367
3394
  return {
3368
3395
  data: {
3369
- ...data,
3370
- // Pass through all API response fields
3371
- full_name: `${profile.first_name} ${profile.last_name}`
3372
- // Computed field
3396
+ id: String(profile.id),
3397
+ first_name: profile.first_name,
3398
+ last_name: profile.last_name,
3399
+ full_name: `${profile.first_name} ${profile.last_name}`,
3400
+ email: profile.email,
3401
+ email_confirmed: profile.email_confirmed,
3402
+ timezone: profile.timezone
3373
3403
  }
3374
3404
  };
3375
3405
  }
@@ -3841,11 +3871,17 @@ function normalizeAuthenticationItem2(auth, options = {}) {
3841
3871
  const {
3842
3872
  selected_api: selectedApi,
3843
3873
  customuser_id: profileId,
3874
+ id,
3875
+ account_id: accountId,
3844
3876
  ...restOfAuth
3845
3877
  } = auth;
3846
3878
  return {
3847
3879
  ...restOfAuth,
3848
3880
  // Pass through all other API response fields except selected_api
3881
+ id: String(id),
3882
+ // Convert to string
3883
+ account_id: String(accountId),
3884
+ // Convert to string
3849
3885
  implementation_id: selectedApi,
3850
3886
  // Rename selected_api to implementation_id
3851
3887
  title: auth.title || auth.label || void 0,
@@ -3858,8 +3894,8 @@ function normalizeAuthenticationItem2(auth, options = {}) {
3858
3894
  // App key from implementations endpoint or parsed from selected_api
3859
3895
  app_version: appVersion,
3860
3896
  // Version from selected_api or provided
3861
- profile_id: profileId
3862
- // Map customuser_id to profile_id
3897
+ profile_id: profileId != null ? String(profileId) : void 0
3898
+ // Map customuser_id to profile_id, convert to string
3863
3899
  };
3864
3900
  }
3865
3901
 
@@ -5011,7 +5047,7 @@ function getCpuTime() {
5011
5047
 
5012
5048
  // package.json
5013
5049
  var package_default = {
5014
- version: "0.17.0"};
5050
+ version: "0.18.0"};
5015
5051
 
5016
5052
  // src/plugins/eventEmission/builders.ts
5017
5053
  function createBaseEvent(context = {}) {
@@ -6,7 +6,7 @@ function createActionFunction(appKey, actionType, actionKey, options, pinnedAuth
6
6
  const { sdk } = options;
7
7
  const { inputs, authenticationId: providedAuthenticationId } = actionOptions;
8
8
  // Use pinned auth ID first, then provided auth ID
9
- const authenticationId = pinnedAuthId || providedAuthenticationId;
9
+ const authenticationId = pinnedAuthId ?? providedAuthenticationId;
10
10
  if (!authenticationId) {
11
11
  throw new ZapierValidationError(`Authentication ID is required. Either use the factory pattern: sdk.apps.${appKey}({ authenticationId }) or provide authenticationId in the action call.`);
12
12
  }
@@ -26,7 +26,7 @@ function createActionTypeProxy(appKey, actionType, options, pinnedAuthId) {
26
26
  return async (url, init) => {
27
27
  const { sdk } = options;
28
28
  // Use pinned auth ID first, then provided auth ID
29
- const authenticationId = pinnedAuthId || init?.authenticationId;
29
+ const authenticationId = pinnedAuthId ?? init?.authenticationId;
30
30
  if (!authenticationId) {
31
31
  throw new ZapierValidationError(`Authentication ID is required for fetch. Either use the factory pattern: sdk.apps.${appKey}({ authenticationId }).fetch(...) or provide authenticationId in the fetch call.`);
32
32
  }
@@ -1,11 +1,12 @@
1
1
  import { z } from "zod";
2
+ import { type AuthenticationIdProperty } from "../../types/properties";
2
3
  export declare const ActionExecutionInputSchema: z.ZodObject<{
3
4
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4
- authenticationId: z.ZodOptional<z.ZodNumber>;
5
+ authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
5
6
  }, z.core.$strip>;
6
7
  export type ActionExecutionOptions = z.infer<typeof ActionExecutionInputSchema>;
7
8
  export declare const AppFactoryInputSchema: z.ZodObject<{
8
- authenticationId: z.ZodNumber;
9
+ authenticationId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
9
10
  }, z.core.$strip>;
10
11
  export type AppFactoryInput = z.infer<typeof AppFactoryInputSchema>;
11
12
  interface BaseActionTypeProxy {
@@ -21,7 +22,7 @@ interface BaseActionTypeProxy {
21
22
  }
22
23
  interface FetchActionType {
23
24
  fetch: (url: string | URL, init?: RequestInit & {
24
- authenticationId?: number;
25
+ authenticationId?: AuthenticationIdProperty;
25
26
  callbackUrl?: string;
26
27
  authenticationTemplate?: string;
27
28
  }) => Promise<Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/apps/schemas.ts"],"names":[],"mappings":"AAAA,O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AC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;CACjC;AAED,UAAU,UAAU;IAClB,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC;CACtC;AAGD,KAAK,mBAAmB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpC"}
@@ -1,13 +1,14 @@
1
1
  import { z } from "zod";
2
+ import { AuthenticationIdPropertySchema, } from "../../types/properties";
2
3
  export const ActionExecutionInputSchema = z
3
4
  .object({
4
5
  inputs: z.record(z.string(), z.unknown()).optional(),
5
- authenticationId: z.number().optional(),
6
+ authenticationId: AuthenticationIdPropertySchema.optional(),
6
7
  })
7
8
  .describe("Execute an action with the given inputs for the bound app, as an alternative to runAction");
8
9
  export const AppFactoryInputSchema = z
9
10
  .object({
10
- authenticationId: z.number(),
11
+ authenticationId: AuthenticationIdPropertySchema,
11
12
  })
12
13
  .describe("Bind an authentication ID to an app");
13
14
  // Note: AppsPluginSdkExtension removed - now using AppsPluginProvides in index.ts
@@ -4,7 +4,7 @@ import type { z } from "zod";
4
4
  import type { EventEmissionContext } from "../eventEmission";
5
5
  export interface FetchPluginProvides {
6
6
  fetch: (url: string | URL, init?: RequestInit & {
7
- authenticationId?: number;
7
+ authenticationId?: string | number;
8
8
  callbackUrl?: string;
9
9
  authenticationTemplate?: string;
10
10
  }) => Promise<Response>;
@@ -29,7 +29,7 @@ export declare const fetchPlugin: Plugin<GetSdkType<RequestPluginProvides>, // r
29
29
  EventEmissionContext, // requires eventEmission context for telemetry
30
30
  FetchPluginProvides>;
31
31
  export type ZapierFetchInitOptions = RequestInit & {
32
- authenticationId?: number;
32
+ authenticationId?: string | number;
33
33
  callbackUrl?: string;
34
34
  authenticationTemplate?: string;
35
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/index.ts"],"names":[],"mappings":"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ZodOptional<z.ZodObject<{
12
12
  }>>;
13
13
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14
14
  body: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<FormData, FormData>, z.ZodCustom<URLSearchParams, URLSearchParams>]>>;
15
- authenticationId: z.ZodOptional<z.ZodNumber>;
15
+ authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
16
16
  callbackUrl: z.ZodOptional<z.ZodString>;
17
17
  authenticationTemplate: z.ZodOptional<z.ZodString>;
18
18
  }, z.core.$strip>>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc,2DAEI,CAAC;AAEhC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;kBA6ByB,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,cAAc,2DAEI,CAAC;AAEhC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;kBA0ByB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { AuthenticationIdPropertySchema } from "../../types/properties";
2
3
  // Schemas for fetch function parameters
3
4
  export const FetchUrlSchema = z
4
5
  .union([z.string(), z.instanceof(URL)])
@@ -16,10 +17,7 @@ export const FetchInitSchema = z
16
17
  z.instanceof(URLSearchParams),
17
18
  ])
18
19
  .optional(),
19
- authenticationId: z
20
- .number()
21
- .optional()
22
- .describe("Zapier authentication ID to use for the request"),
20
+ authenticationId: AuthenticationIdPropertySchema.optional(),
23
21
  callbackUrl: z
24
22
  .string()
25
23
  .optional()
@@ -6,10 +6,10 @@ import { ListAuthenticationsSchema } from "../listAuthentications/schemas";
6
6
  import { eventEmissionPlugin } from "../eventEmission";
7
7
  const mockAuthentications = [
8
8
  {
9
- id: 123,
9
+ id: "123",
10
10
  title: "My Slack",
11
11
  date: "2021-01-01",
12
- account_id: 123,
12
+ account_id: "123",
13
13
  implementation_id: "api_123",
14
14
  is_expired: "false",
15
15
  expired_at: null,
@@ -18,12 +18,12 @@ const mockAuthentications = [
18
18
  shared_with_all: false,
19
19
  },
20
20
  {
21
- id: 456,
21
+ id: "456",
22
22
  title: "Slack Workspace 2",
23
23
  is_expired: "false",
24
24
  expired_at: null,
25
25
  date: "2021-01-01",
26
- account_id: 123,
26
+ account_id: "123",
27
27
  implementation_id: "api_123",
28
28
  is_invite_only: false,
29
29
  is_private: false,
@@ -5,10 +5,10 @@ import { createSdk } from "../../sdk";
5
5
  import { ListAuthenticationsSchema } from "../listAuthentications/schemas";
6
6
  import { eventEmissionPlugin } from "../eventEmission";
7
7
  const mockAuthentication = {
8
- id: 123,
8
+ id: "123",
9
9
  title: "My Slack",
10
10
  date: "2021-01-01",
11
- account_id: 123,
11
+ account_id: "123",
12
12
  implementation_id: "api_123",
13
13
  is_expired: "false",
14
14
  expired_at: null,
@@ -19,12 +19,12 @@ const mockAuthentication = {
19
19
  const mockAuthentications = [
20
20
  mockAuthentication,
21
21
  {
22
- id: 456,
22
+ id: "456",
23
23
  title: "Slack Workspace 2",
24
24
  is_expired: "false",
25
25
  expired_at: null,
26
26
  date: "2021-01-01",
27
- account_id: 123,
27
+ account_id: "123",
28
28
  implementation_id: "api_123",
29
29
  is_invite_only: false,
30
30
  is_private: false,
@@ -8,7 +8,7 @@ export const getAuthenticationPlugin = ({ context }) => {
8
8
  const { api } = context;
9
9
  // Call the SDK API endpoint, which will be routed to the handler via handlerOverride in pathConfig.
10
10
  // When the handler is migrated to SDK API, this same API call will go over the network.
11
- return await api.get(`/api/v0/authentications/${options.authenticationId}`);
11
+ return await api.get(`/api/v0/authentications/${encodeURIComponent(options.authenticationId)}`);
12
12
  }
13
13
  const getAuthenticationDefinition = createFunction(getAuthentication, GetAuthenticationSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getAuthentication.name));
14
14
  return {
@@ -4,9 +4,9 @@ import { getAuthenticationPlugin } from "./index";
4
4
  import { createSdk } from "../../sdk";
5
5
  import { eventEmissionPlugin } from "../eventEmission";
6
6
  const mockAuthenticationItem = {
7
- id: 123,
7
+ id: "123",
8
8
  date: "2021-01-01",
9
- account_id: 456,
9
+ account_id: "456",
10
10
  implementation_id: "SlackCLIAPI@1.21.1",
11
11
  is_invite_only: false,
12
12
  is_private: false,
@@ -50,7 +50,7 @@ describe("getAuthentication plugin", () => {
50
50
  it("should throw validation error for invalid authenticationId type", async () => {
51
51
  const sdk = createTestSdk();
52
52
  await expect(sdk.getAuthentication({
53
- authenticationId: "invalid",
53
+ authenticationId: true,
54
54
  })).rejects.toThrow(ZapierValidationError);
55
55
  });
56
56
  it("should throw validation error for negative authenticationId", async () => {
@@ -71,7 +71,7 @@ describe("getAuthentication plugin", () => {
71
71
  authenticationId: 123,
72
72
  });
73
73
  expect(result.data).toBeDefined();
74
- expect(result.data.id).toBe(123);
74
+ expect(result.data.id).toBe("123");
75
75
  });
76
76
  });
77
77
  describe("SDK API endpoint routing", () => {
@@ -80,6 +80,11 @@ describe("getAuthentication plugin", () => {
80
80
  await sdk.getAuthentication({ authenticationId: 123 });
81
81
  expect(mockApiClient.get).toHaveBeenCalledWith("/api/v0/authentications/123");
82
82
  });
83
+ it("should URI encode string authenticationId in path", async () => {
84
+ const sdk = createTestSdk();
85
+ await sdk.getAuthentication({ authenticationId: "auth/with spaces" });
86
+ expect(mockApiClient.get).toHaveBeenCalledWith("/api/v0/authentications/auth%2Fwith%20spaces");
87
+ });
83
88
  it("should return data from API response", async () => {
84
89
  const sdk = createTestSdk();
85
90
  const result = await sdk.getAuthentication({ authenticationId: 123 });
@@ -15,7 +15,7 @@ export declare const GetInputFieldsSchemaSchema: z.ZodObject<{
15
15
  write: "write";
16
16
  }>;
17
17
  actionKey: z.ZodString;
18
- authenticationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
18
+ authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
19
19
  inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
20
20
  }, z.core.$strip>;
21
21
  export type GetInputFieldsSchemaOptions = z.infer<typeof GetInputFieldsSchemaSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,gBAAgB,CAAC;aACtC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,EAAE,EAAE,sBAAsB;AAC1B,AADI,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,oBAAoB,EAAE,4CAA4C;AACvF,wBAAwB,CA6CzB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,gBAAgB,CAAC;aACtC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,EAAE,EAAE,sBAAsB;AAC1B,AADI,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,oBAAoB,EAAE,4CAA4C;AACvF,wBAAwB,CA+CzB,CAAC"}
@@ -8,12 +8,15 @@ export const getProfilePlugin = ({ context }) => {
8
8
  const profile = await context.api.get("/zapier/api/v4/profile/", {
9
9
  authRequired: true,
10
10
  });
11
- // Remove user_id since that's our internal user ID which could confuse things!
12
- const { user_id: _unusedUserId, ...data } = profile;
13
11
  return {
14
12
  data: {
15
- ...data, // Pass through all API response fields
16
- full_name: `${profile.first_name} ${profile.last_name}`, // Computed field
13
+ id: String(profile.id),
14
+ first_name: profile.first_name,
15
+ last_name: profile.last_name,
16
+ full_name: `${profile.first_name} ${profile.last_name}`,
17
+ email: profile.email,
18
+ email_confirmed: profile.email_confirmed,
19
+ timezone: profile.timezone,
17
20
  },
18
21
  };
19
22
  }
@@ -107,7 +107,7 @@ describe("listAuthentications plugin", () => {
107
107
  const result = await sdk.listAuthentications();
108
108
  expect(result.data).toHaveLength(2);
109
109
  expect(result.data[0]).toMatchObject({
110
- id: 123,
110
+ id: "123",
111
111
  });
112
112
  });
113
113
  it("should throw validation error for invalid appKey type", () => {
@@ -403,8 +403,8 @@ describe("listAuthentications plugin", () => {
403
403
  expect(pages).toHaveLength(2);
404
404
  expect(pages[0].data).toHaveLength(1);
405
405
  expect(pages[1].data).toHaveLength(1);
406
- expect(pages[0].data[0].id).toBe(123);
407
- expect(pages[1].data[0].id).toBe(789);
406
+ expect(pages[0].data[0].id).toBe("123");
407
+ expect(pages[1].data[0].id).toBe("789");
408
408
  });
409
409
  it("should support async iteration over individual items", async () => {
410
410
  const sdk = createTestSdk();
@@ -415,8 +415,8 @@ describe("listAuthentications plugin", () => {
415
415
  items.push(item);
416
416
  }
417
417
  expect(items).toHaveLength(2);
418
- expect(items[0].id).toBe(123);
419
- expect(items[1].id).toBe(789);
418
+ expect(items[0].id).toBe("123");
419
+ expect(items[1].id).toBe("789");
420
420
  });
421
421
  it("should set appropriate pageSize for API calls", async () => {
422
422
  const sdk = createTestSdk();
@@ -577,12 +577,12 @@ describe("listAuthentications plugin", () => {
577
577
  const sdk = createTestSdk();
578
578
  const result = await sdk.listAuthentications({});
579
579
  const auth = result.data[0];
580
- // Verify original fields are preserved
581
- expect(auth.id).toBe(123);
580
+ // Verify original fields are preserved (IDs are converted to strings)
581
+ expect(auth.id).toBe("123");
582
582
  expect(auth.date).toBe("2021-01-01");
583
583
  expect(auth.lastchanged).toBe("2021-01-02");
584
- expect(auth.account_id).toBe(456);
585
- expect(auth.profile_id).toBe(789);
584
+ expect(auth.account_id).toBe("456");
585
+ expect(auth.profile_id).toBe("789");
586
586
  expect(auth.implementation_id).toBe("SlackCLIAPI@1.21.1");
587
587
  expect(auth.destination_selected_api).toBe("SlackDestAPI@1.0.0");
588
588
  expect(auth.is_invite_only).toBe(true);