@zapier/zapier-sdk 0.16.2 → 0.17.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 79b47f7: Renaming user_id to profile_id in authentications.
8
+
9
+ ## 0.16.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 870f2aa: Fix CLI process hanging after login and on signal handling
14
+ - Clear login timeout timer after successful authentication to allow process exit
15
+ - Use timer.unref() on telemetry timeouts so they don't block process exit
16
+ - Add explicit process.exit() in signal handlers with correct exit codes
17
+
3
18
  ## 0.16.2
4
19
 
5
20
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1458,7 +1458,7 @@ function normalizeAuthenticationItem(auth, options = {}) {
1458
1458
  }
1459
1459
  const {
1460
1460
  selected_api: selectedApi,
1461
- customuser_id: userId,
1461
+ customuser_id: profileId,
1462
1462
  ...restOfAuth
1463
1463
  } = auth;
1464
1464
  return {
@@ -1476,8 +1476,8 @@ function normalizeAuthenticationItem(auth, options = {}) {
1476
1476
  // App key from implementations endpoint or parsed from selected_api
1477
1477
  app_version: appVersion,
1478
1478
  // Version from selected_api or provided
1479
- user_id: userId
1480
- // Map customuser_id to user_id
1479
+ profile_id: profileId
1480
+ // Map customuser_id to profile_id
1481
1481
  };
1482
1482
  }
1483
1483
  function normalizeActionItem(action) {
@@ -2249,7 +2249,8 @@ var AuthenticationItemSchema = withFormatter(
2249
2249
  // App key from implementations endpoint
2250
2250
  app_version: zod.z.string().optional(),
2251
2251
  // Version extracted from implementation_id
2252
- user_id: zod.z.number().optional()
2252
+ profile_id: zod.z.number().optional()
2253
+ // Mapped from customuser_id
2253
2254
  }
2254
2255
  ),
2255
2256
  {
@@ -2500,7 +2501,7 @@ var AuthenticationItemSchema2 = AuthenticationSchema2.omit({
2500
2501
  }).extend({
2501
2502
  // Renamed fields
2502
2503
  implementation_id: zod.z.string().optional(),
2503
- user_id: zod.z.number().optional(),
2504
+ profile_id: zod.z.number().optional(),
2504
2505
  // Mapped fields (originals preserved in ...restOfAuth)
2505
2506
  is_expired: zod.z.string().optional(),
2506
2507
  expired_at: zod.z.string().nullable().optional(),
@@ -3861,7 +3862,7 @@ function normalizeAuthenticationItem2(auth, options = {}) {
3861
3862
  }
3862
3863
  const {
3863
3864
  selected_api: selectedApi,
3864
- customuser_id: userId,
3865
+ customuser_id: profileId,
3865
3866
  ...restOfAuth
3866
3867
  } = auth;
3867
3868
  return {
@@ -3879,8 +3880,8 @@ function normalizeAuthenticationItem2(auth, options = {}) {
3879
3880
  // App key from implementations endpoint or parsed from selected_api
3880
3881
  app_version: appVersion,
3881
3882
  // Version from selected_api or provided
3882
- user_id: userId
3883
- // Map customuser_id to user_id
3883
+ profile_id: profileId
3884
+ // Map customuser_id to profile_id
3884
3885
  };
3885
3886
  }
3886
3887
 
@@ -4920,7 +4921,12 @@ var HttpTransport = class {
4920
4921
  }
4921
4922
  }
4922
4923
  async delay(ms) {
4923
- return new Promise((resolve2) => setTimeout(resolve2, ms));
4924
+ return new Promise((resolve2) => {
4925
+ const timer = setTimeout(resolve2, ms);
4926
+ if (typeof timer.unref === "function") {
4927
+ timer.unref();
4928
+ }
4929
+ });
4924
4930
  }
4925
4931
  };
4926
4932
  var ConsoleTransport = class {
@@ -5027,7 +5033,7 @@ function getCpuTime() {
5027
5033
 
5028
5034
  // package.json
5029
5035
  var package_default = {
5030
- version: "0.16.2"};
5036
+ version: "0.17.0"};
5031
5037
 
5032
5038
  // src/plugins/eventEmission/builders.ts
5033
5039
  function createBaseEvent(context = {}) {
@@ -5311,9 +5317,12 @@ var eventEmissionPlugin = ({ context }) => {
5311
5317
  try {
5312
5318
  await Promise.race([
5313
5319
  transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
5314
- new Promise(
5315
- (resolve2) => setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS)
5316
- )
5320
+ new Promise((resolve2) => {
5321
+ const timer = setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS);
5322
+ if (typeof timer.unref === "function") {
5323
+ timer.unref();
5324
+ }
5325
+ })
5317
5326
  ]);
5318
5327
  } catch {
5319
5328
  }
@@ -5343,9 +5352,12 @@ var eventEmissionPlugin = ({ context }) => {
5343
5352
  try {
5344
5353
  await Promise.race([
5345
5354
  transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
5346
- new Promise(
5347
- (resolve2) => setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS)
5348
- )
5355
+ new Promise((resolve2) => {
5356
+ const timer = setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS);
5357
+ if (typeof timer.unref === "function") {
5358
+ timer.unref();
5359
+ }
5360
+ })
5349
5361
  ]);
5350
5362
  } catch {
5351
5363
  }
@@ -5368,12 +5380,17 @@ var eventEmissionPlugin = ({ context }) => {
5368
5380
  try {
5369
5381
  await Promise.race([
5370
5382
  transport.emit(APPLICATION_LIFECYCLE_EVENT_SUBJECT, signalEvent),
5371
- new Promise(
5372
- (resolve2) => setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS)
5373
- )
5383
+ new Promise((resolve2) => {
5384
+ const timer = setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS);
5385
+ if (typeof timer.unref === "function") {
5386
+ timer.unref();
5387
+ }
5388
+ })
5374
5389
  ]);
5375
5390
  } catch {
5376
5391
  }
5392
+ const exitCode = signal === "SIGINT" ? 130 : 143;
5393
+ process.exit(exitCode);
5377
5394
  };
5378
5395
  ["SIGINT", "SIGTERM"].forEach((signal) => {
5379
5396
  process.on(signal, () => handleSignal(signal));
package/dist/index.d.mts CHANGED
@@ -1180,7 +1180,7 @@ declare const GetAuthenticationResponseSchema: z.ZodObject<{
1180
1180
  members: z.ZodOptional<z.ZodString>;
1181
1181
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
1182
1182
  implementation_id: z.ZodOptional<z.ZodString>;
1183
- user_id: z.ZodOptional<z.ZodNumber>;
1183
+ profile_id: z.ZodOptional<z.ZodNumber>;
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>;
@@ -1990,7 +1990,7 @@ declare const AuthenticationItemSchema: z.ZodObject<{
1990
1990
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1991
1991
  app_key: z.ZodOptional<z.ZodString>;
1992
1992
  app_version: z.ZodOptional<z.ZodString>;
1993
- user_id: z.ZodOptional<z.ZodNumber>;
1993
+ profile_id: z.ZodOptional<z.ZodNumber>;
1994
1994
  }, z.core.$strip>;
1995
1995
  declare const AuthItemSchema: z.ZodObject<{
1996
1996
  url: z.ZodOptional<z.ZodString>;
@@ -2016,7 +2016,7 @@ declare const AuthItemSchema: z.ZodObject<{
2016
2016
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2017
2017
  app_key: z.ZodOptional<z.ZodString>;
2018
2018
  app_version: z.ZodOptional<z.ZodString>;
2019
- user_id: z.ZodOptional<z.ZodNumber>;
2019
+ profile_id: z.ZodOptional<z.ZodNumber>;
2020
2020
  }, z.core.$strip>;
2021
2021
  type AuthItem = z.infer<typeof AuthItemSchema>;
2022
2022
 
package/dist/index.mjs CHANGED
@@ -1436,7 +1436,7 @@ function normalizeAuthenticationItem(auth, options = {}) {
1436
1436
  }
1437
1437
  const {
1438
1438
  selected_api: selectedApi,
1439
- customuser_id: userId,
1439
+ customuser_id: profileId,
1440
1440
  ...restOfAuth
1441
1441
  } = auth;
1442
1442
  return {
@@ -1454,8 +1454,8 @@ function normalizeAuthenticationItem(auth, options = {}) {
1454
1454
  // App key from implementations endpoint or parsed from selected_api
1455
1455
  app_version: appVersion,
1456
1456
  // Version from selected_api or provided
1457
- user_id: userId
1458
- // Map customuser_id to user_id
1457
+ profile_id: profileId
1458
+ // Map customuser_id to profile_id
1459
1459
  };
1460
1460
  }
1461
1461
  function normalizeActionItem(action) {
@@ -2227,7 +2227,8 @@ var AuthenticationItemSchema = withFormatter(
2227
2227
  // App key from implementations endpoint
2228
2228
  app_version: z.string().optional(),
2229
2229
  // Version extracted from implementation_id
2230
- user_id: z.number().optional()
2230
+ profile_id: z.number().optional()
2231
+ // Mapped from customuser_id
2231
2232
  }
2232
2233
  ),
2233
2234
  {
@@ -2478,7 +2479,7 @@ var AuthenticationItemSchema2 = AuthenticationSchema2.omit({
2478
2479
  }).extend({
2479
2480
  // Renamed fields
2480
2481
  implementation_id: z.string().optional(),
2481
- user_id: z.number().optional(),
2482
+ profile_id: z.number().optional(),
2482
2483
  // Mapped fields (originals preserved in ...restOfAuth)
2483
2484
  is_expired: z.string().optional(),
2484
2485
  expired_at: z.string().nullable().optional(),
@@ -3839,7 +3840,7 @@ function normalizeAuthenticationItem2(auth, options = {}) {
3839
3840
  }
3840
3841
  const {
3841
3842
  selected_api: selectedApi,
3842
- customuser_id: userId,
3843
+ customuser_id: profileId,
3843
3844
  ...restOfAuth
3844
3845
  } = auth;
3845
3846
  return {
@@ -3857,8 +3858,8 @@ function normalizeAuthenticationItem2(auth, options = {}) {
3857
3858
  // App key from implementations endpoint or parsed from selected_api
3858
3859
  app_version: appVersion,
3859
3860
  // Version from selected_api or provided
3860
- user_id: userId
3861
- // Map customuser_id to user_id
3861
+ profile_id: profileId
3862
+ // Map customuser_id to profile_id
3862
3863
  };
3863
3864
  }
3864
3865
 
@@ -4898,7 +4899,12 @@ var HttpTransport = class {
4898
4899
  }
4899
4900
  }
4900
4901
  async delay(ms) {
4901
- return new Promise((resolve2) => setTimeout(resolve2, ms));
4902
+ return new Promise((resolve2) => {
4903
+ const timer = setTimeout(resolve2, ms);
4904
+ if (typeof timer.unref === "function") {
4905
+ timer.unref();
4906
+ }
4907
+ });
4902
4908
  }
4903
4909
  };
4904
4910
  var ConsoleTransport = class {
@@ -5005,7 +5011,7 @@ function getCpuTime() {
5005
5011
 
5006
5012
  // package.json
5007
5013
  var package_default = {
5008
- version: "0.16.2"};
5014
+ version: "0.17.0"};
5009
5015
 
5010
5016
  // src/plugins/eventEmission/builders.ts
5011
5017
  function createBaseEvent(context = {}) {
@@ -5289,9 +5295,12 @@ var eventEmissionPlugin = ({ context }) => {
5289
5295
  try {
5290
5296
  await Promise.race([
5291
5297
  transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
5292
- new Promise(
5293
- (resolve2) => setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS)
5294
- )
5298
+ new Promise((resolve2) => {
5299
+ const timer = setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS);
5300
+ if (typeof timer.unref === "function") {
5301
+ timer.unref();
5302
+ }
5303
+ })
5295
5304
  ]);
5296
5305
  } catch {
5297
5306
  }
@@ -5321,9 +5330,12 @@ var eventEmissionPlugin = ({ context }) => {
5321
5330
  try {
5322
5331
  await Promise.race([
5323
5332
  transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
5324
- new Promise(
5325
- (resolve2) => setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS)
5326
- )
5333
+ new Promise((resolve2) => {
5334
+ const timer = setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS);
5335
+ if (typeof timer.unref === "function") {
5336
+ timer.unref();
5337
+ }
5338
+ })
5327
5339
  ]);
5328
5340
  } catch {
5329
5341
  }
@@ -5346,12 +5358,17 @@ var eventEmissionPlugin = ({ context }) => {
5346
5358
  try {
5347
5359
  await Promise.race([
5348
5360
  transport.emit(APPLICATION_LIFECYCLE_EVENT_SUBJECT, signalEvent),
5349
- new Promise(
5350
- (resolve2) => setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS)
5351
- )
5361
+ new Promise((resolve2) => {
5362
+ const timer = setTimeout(resolve2, TELEMETRY_EMIT_TIMEOUT_MS);
5363
+ if (typeof timer.unref === "function") {
5364
+ timer.unref();
5365
+ }
5366
+ })
5352
5367
  ]);
5353
5368
  } catch {
5354
5369
  }
5370
+ const exitCode = signal === "SIGINT" ? 130 : 143;
5371
+ process.exit(exitCode);
5355
5372
  };
5356
5373
  ["SIGINT", "SIGTERM"].forEach((signal) => {
5357
5374
  process.on(signal, () => handleSignal(signal));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAWnE,OAAO,KAAK,EAAgB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAMnE,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAGD,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE;QACb,SAAS,EAAE,cAAc,CAAC;QAC1B,MAAM,EAAE,mBAAmB,CAAC;QAE5B,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;QAErD,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;QAEtC,gBAAgB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;KACrD,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AA6FD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,EAAE,EACF;IACE,OAAO,EAAE;QACP,aAAa,CAAC,EAAE,mBAAmB,CAAC;QACpC,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,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,EAAE,EACF;IACE,OAAO,EAAE;QACP,aAAa,CAAC,EAAE,mBAAmB,CAAC;QACpC,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,EACD,qBAAqB,CAkStB,CAAC;AAGF,YAAY,EACV,YAAY,EACZ,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,cAAc,SAAS,CAAC"}
@@ -216,13 +216,17 @@ export const eventEmissionPlugin = ({ context }) => {
216
216
  try {
217
217
  await Promise.race([
218
218
  transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
219
- new Promise((resolve) => setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS)),
219
+ new Promise((resolve) => {
220
+ const timer = setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS);
221
+ if (typeof timer.unref === "function") {
222
+ timer.unref();
223
+ }
224
+ }),
220
225
  ]);
221
226
  }
222
227
  catch {
223
228
  // Silently ignore telemetry failures
224
229
  }
225
- // Let Node.js exit naturally after all handlers complete
226
230
  });
227
231
  // Handle unhandled promise rejections
228
232
  process.on("unhandledRejection", async (reason, promise) => {
@@ -256,7 +260,12 @@ export const eventEmissionPlugin = ({ context }) => {
256
260
  try {
257
261
  await Promise.race([
258
262
  transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
259
- new Promise((resolve) => setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS)),
263
+ new Promise((resolve) => {
264
+ const timer = setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS);
265
+ if (typeof timer.unref === "function") {
266
+ timer.unref();
267
+ }
268
+ }),
260
269
  ]);
261
270
  }
262
271
  catch {
@@ -285,13 +294,20 @@ export const eventEmissionPlugin = ({ context }) => {
285
294
  try {
286
295
  await Promise.race([
287
296
  transport.emit(APPLICATION_LIFECYCLE_EVENT_SUBJECT, signalEvent),
288
- new Promise((resolve) => setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS)),
297
+ new Promise((resolve) => {
298
+ const timer = setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS);
299
+ if (typeof timer.unref === "function") {
300
+ timer.unref();
301
+ }
302
+ }),
289
303
  ]);
290
304
  }
291
305
  catch {
292
306
  // Silently ignore telemetry failures
293
307
  }
294
- // Let other signal handlers run and decide when to exit
308
+ // Exit with appropriate code (128 + signal number)
309
+ const exitCode = signal === "SIGINT" ? 130 : 143;
310
+ process.exit(exitCode);
295
311
  };
296
312
  // Register signal handlers
297
313
  ["SIGINT", "SIGTERM"].forEach((signal) => {
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAGD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,qBAAa,aAAc,YAAW,cAAc;IAEhD,OAAO,CAAC,MAAM;g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MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,qBAAa,aAAc,YAAW,cAAc;IAEhD,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;IAGG,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;YAYrD,aAAa;YAiCb,KAAK;CAQpB;AAGD,qBAAa,gBAAiB,YAAW,cAAc;IAC/C,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAUpE;AAGD,qBAAa,aAAc,YAAW,cAAc;IAC5C,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtE;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,CAyBvE"}
@@ -48,7 +48,12 @@ export class HttpTransport {
48
48
  }
49
49
  }
50
50
  async delay(ms) {
51
- return new Promise((resolve) => setTimeout(resolve, ms));
51
+ return new Promise((resolve) => {
52
+ const timer = setTimeout(resolve, ms);
53
+ if (typeof timer.unref === "function") {
54
+ timer.unref();
55
+ }
56
+ });
52
57
  }
53
58
  }
54
59
  // Console Transport - logs events to console (for development)
@@ -582,7 +582,7 @@ describe("listAuthentications plugin", () => {
582
582
  expect(auth.date).toBe("2021-01-01");
583
583
  expect(auth.lastchanged).toBe("2021-01-02");
584
584
  expect(auth.account_id).toBe(456);
585
- expect(auth.user_id).toBe(789);
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);
@@ -23,7 +23,7 @@ export declare const AuthenticationItemSchema: z.ZodObject<{
23
23
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
24
  app_key: z.ZodOptional<z.ZodString>;
25
25
  app_version: z.ZodOptional<z.ZodString>;
26
- user_id: z.ZodOptional<z.ZodNumber>;
26
+ profile_id: z.ZodOptional<z.ZodNumber>;
27
27
  }, z.core.$strip>;
28
28
  export declare const AuthItemSchema: z.ZodObject<{
29
29
  url: z.ZodOptional<z.ZodString>;
@@ -49,7 +49,7 @@ export declare const AuthItemSchema: z.ZodObject<{
49
49
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
50
  app_key: z.ZodOptional<z.ZodString>;
51
51
  app_version: z.ZodOptional<z.ZodString>;
52
- user_id: z.ZodOptional<z.ZodNumber>;
52
+ profile_id: z.ZodOptional<z.ZodNumber>;
53
53
  }, z.core.$strip>;
54
54
  export type AuthItem = z.infer<typeof AuthItemSchema>;
55
55
  //# sourceMappingURL=Auth.d.ts.map
@@ -10,7 +10,7 @@ export const AuthenticationItemSchema = withFormatter(AuthenticationSchema.omit(
10
10
  expired_at: z.string().nullable().optional(), // Mapped from marked_stale_at
11
11
  app_key: z.string().optional(), // App key from implementations endpoint
12
12
  app_version: z.string().optional(), // Version extracted from implementation_id
13
- user_id: z.number().optional(),
13
+ profile_id: z.number().optional(), // Mapped from customuser_id
14
14
  }), {
15
15
  format: (item) => {
16
16
  const details = [];
@@ -100,7 +100,7 @@ describe("handleGetAuthentication", () => {
100
100
  title: "My Slack Workspace",
101
101
  app_key: "SlackCLIAPI",
102
102
  app_version: "1.21.1",
103
- user_id: undefined, // customuser_id wasn't in mock data
103
+ profile_id: undefined, // customuser_id wasn't in mock data
104
104
  is_stale: "false", // Original field preserved
105
105
  marked_stale_at: null, // Original field preserved
106
106
  });
@@ -226,7 +226,7 @@ describe("handleGetAuthentication", () => {
226
226
  expect(auth.date).toBe("2021-01-01");
227
227
  expect(auth.lastchanged).toBe("2021-01-02");
228
228
  expect(auth.account_id).toBe(456);
229
- expect(auth.user_id).toBe(789);
229
+ expect(auth.profile_id).toBe(789);
230
230
  expect(auth.implementation_id).toBe("SlackCLIAPI@1.21.1");
231
231
  expect(auth.destination_selected_api).toBe("SlackDestAPI@1.0.0");
232
232
  expect(auth.is_invite_only).toBe(true);
@@ -57,7 +57,7 @@ export type Authentication = z.infer<typeof AuthenticationSchema>;
57
57
  *
58
58
  * Transforms API response fields:
59
59
  * - selected_api → implementation_id
60
- * - customuser_id → user_id
60
+ * - customuser_id → profile_id
61
61
  * - is_stale → is_expired (preserved as is_stale too)
62
62
  * - marked_stale_at → expired_at (preserved as marked_stale_at too)
63
63
  *
@@ -85,7 +85,7 @@ export declare const AuthenticationItemSchema: z.ZodObject<{
85
85
  groups: z.ZodOptional<z.ZodString>;
86
86
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
87
87
  implementation_id: z.ZodOptional<z.ZodString>;
88
- user_id: z.ZodOptional<z.ZodNumber>;
88
+ profile_id: z.ZodOptional<z.ZodNumber>;
89
89
  is_expired: z.ZodOptional<z.ZodString>;
90
90
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
91
  app_key: z.ZodOptional<z.ZodString>;
@@ -139,7 +139,7 @@ export declare const GetAuthenticationResponseSchema: z.ZodObject<{
139
139
  groups: z.ZodOptional<z.ZodString>;
140
140
  permissions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
141
141
  implementation_id: z.ZodOptional<z.ZodString>;
142
- user_id: z.ZodOptional<z.ZodNumber>;
142
+ profile_id: z.ZodOptional<z.ZodNumber>;
143
143
  is_expired: z.ZodOptional<z.ZodString>;
144
144
  expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
145
145
  app_key: z.ZodOptional<z.ZodString>;
@@ -35,7 +35,7 @@ export const AuthenticationsResponseSchema = z.object({
35
35
  *
36
36
  * Transforms API response fields:
37
37
  * - selected_api → implementation_id
38
- * - customuser_id → user_id
38
+ * - customuser_id → profile_id
39
39
  * - is_stale → is_expired (preserved as is_stale too)
40
40
  * - marked_stale_at → expired_at (preserved as marked_stale_at too)
41
41
  *
@@ -49,7 +49,7 @@ export const AuthenticationItemSchema = AuthenticationSchema.omit({
49
49
  }).extend({
50
50
  // Renamed fields
51
51
  implementation_id: z.string().optional(),
52
- user_id: z.number().optional(),
52
+ profile_id: z.number().optional(),
53
53
  // Mapped fields (originals preserved in ...restOfAuth)
54
54
  is_expired: z.string().optional(),
55
55
  expired_at: z.string().nullable().optional(),
@@ -58,7 +58,7 @@ export function normalizeAuthenticationItem(auth, options = {}) {
58
58
  appVersion = extractedVersion;
59
59
  }
60
60
  }
61
- const { selected_api: selectedApi, customuser_id: userId, ...restOfAuth } = auth;
61
+ const { selected_api: selectedApi, customuser_id: profileId, ...restOfAuth } = auth;
62
62
  return {
63
63
  ...restOfAuth, // Pass through all other API response fields except selected_api
64
64
  implementation_id: selectedApi, // Rename selected_api to implementation_id
@@ -67,6 +67,6 @@ export function normalizeAuthenticationItem(auth, options = {}) {
67
67
  expired_at: auth.marked_stale_at, // Map marked_stale_at to expired_at
68
68
  app_key: appKey, // App key from implementations endpoint or parsed from selected_api
69
69
  app_version: appVersion, // Version from selected_api or provided
70
- user_id: userId, // Map customuser_id to user_id
70
+ profile_id: profileId, // Map customuser_id to profile_id
71
71
  };
72
72
  }
@@ -61,7 +61,7 @@ export function normalizeAuthenticationItem(auth, options = {}) {
61
61
  appVersion = extractedVersion;
62
62
  }
63
63
  }
64
- const { selected_api: selectedApi, customuser_id: userId, ...restOfAuth } = auth;
64
+ const { selected_api: selectedApi, customuser_id: profileId, ...restOfAuth } = auth;
65
65
  return {
66
66
  ...restOfAuth, // Pass through all other API response fields except selected_api
67
67
  implementation_id: selectedApi, // Rename selected_api to implementation_id
@@ -70,7 +70,7 @@ export function normalizeAuthenticationItem(auth, options = {}) {
70
70
  expired_at: auth.marked_stale_at, // Map marked_stale_at to expired_at
71
71
  app_key: appKey, // App key from implementations endpoint or parsed from selected_api
72
72
  app_version: appVersion, // Version from selected_api or provided
73
- user_id: userId, // Map customuser_id to user_id
73
+ profile_id: profileId, // Map customuser_id to profile_id
74
74
  };
75
75
  }
76
76
  export function normalizeActionItem(action) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -51,7 +51,7 @@
51
51
  "tsup": "^8.5.0",
52
52
  "typescript": "^5.8.3",
53
53
  "vitest": "^3.2.3",
54
- "@zapier/zapier-sdk-cli-login": "0.3.6"
54
+ "@zapier/zapier-sdk-cli-login": "0.3.7"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsup",