@zapier/zapier-sdk 0.76.0 → 0.76.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/auth.d.ts +17 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +81 -25
- package/dist/experimental.cjs +101 -31
- package/dist/experimental.d.mts +2 -2
- package/dist/experimental.mjs +100 -32
- package/dist/{index-Cq9YBV9i.d.mts → index-Dlf9DlnJ.d.mts} +22 -3
- package/dist/{index-Cq9YBV9i.d.ts → index-Dlf9DlnJ.d.ts} +22 -3
- package/dist/index.cjs +101 -31
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +100 -32
- package/dist/plugins/eventEmission/builders.d.ts.map +1 -1
- package/dist/plugins/eventEmission/builders.js +2 -0
- package/dist/plugins/eventEmission/index.d.ts.map +1 -1
- package/dist/plugins/eventEmission/index.js +23 -8
- package/dist/plugins/eventEmission/types.d.ts +2 -0
- package/dist/plugins/eventEmission/types.d.ts.map +1 -1
- package/dist/types/telemetry-events.d.ts +2 -0
- package/dist/types/telemetry-events.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/auth.d.ts
CHANGED
|
@@ -42,6 +42,18 @@ export interface ResolveAuthTokenOptions {
|
|
|
42
42
|
*/
|
|
43
43
|
cache?: ZapierCache;
|
|
44
44
|
}
|
|
45
|
+
export declare enum AuthMechanism {
|
|
46
|
+
ClientCredentials = "client_credentials",
|
|
47
|
+
Jwt = "jwt",
|
|
48
|
+
Token = "token",
|
|
49
|
+
Pkce = "pkce",
|
|
50
|
+
None = "none"
|
|
51
|
+
}
|
|
52
|
+
export interface ResolvedAuth {
|
|
53
|
+
token?: string;
|
|
54
|
+
mechanism: AuthMechanism;
|
|
55
|
+
clientId: string | null;
|
|
56
|
+
}
|
|
45
57
|
/**
|
|
46
58
|
* Clear in-process caches. Useful for testing or to force the next
|
|
47
59
|
* resolve to re-import the default cache adapter. Does not touch
|
|
@@ -104,7 +116,8 @@ export declare function isCliLoginAvailable(): boolean | undefined;
|
|
|
104
116
|
*/
|
|
105
117
|
export declare function getTokenFromCliLogin(options: CliLoginOptions): Promise<string | undefined>;
|
|
106
118
|
/**
|
|
107
|
-
* Resolves
|
|
119
|
+
* Resolves auth from wherever it can be found, returning the token plus
|
|
120
|
+
* metadata about how it was resolved.
|
|
108
121
|
*
|
|
109
122
|
* Resolution order:
|
|
110
123
|
* 1. Explicit credentials option (or deprecated token option)
|
|
@@ -116,8 +129,10 @@ export declare function getTokenFromCliLogin(options: CliLoginOptions): Promise<
|
|
|
116
129
|
* - Client credentials: Exchanged for an access token (with caching)
|
|
117
130
|
* - PKCE: Delegates to CLI login (throws if not available)
|
|
118
131
|
*
|
|
119
|
-
*
|
|
132
|
+
* When no auth can be resolved, returns a ResolvedAuth with
|
|
133
|
+
* mechanism: None and no token.
|
|
120
134
|
*/
|
|
135
|
+
export declare function resolveAuth(options?: ResolveAuthTokenOptions): Promise<ResolvedAuth>;
|
|
121
136
|
export declare function resolveAuthToken(options?: ResolveAuthTokenOptions): Promise<string | undefined>;
|
|
122
137
|
/**
|
|
123
138
|
* Invalidate the cached token for the given credentials, if applicable.
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EAEX,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAG9D,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,YAAY,E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AAW,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAehB"}
|
package/dist/auth.js
CHANGED
|
@@ -16,6 +16,14 @@ import { createMemoryCache } from "./cache";
|
|
|
16
16
|
const DEFAULT_AUTH_BASE_URL = "https://zapier.com";
|
|
17
17
|
export { createMemoryCache } from "./cache";
|
|
18
18
|
export { isClientCredentials, isPkceCredentials, isCredentialsObject, isCredentialsFunction, } from "./types/credentials";
|
|
19
|
+
export var AuthMechanism;
|
|
20
|
+
(function (AuthMechanism) {
|
|
21
|
+
AuthMechanism["ClientCredentials"] = "client_credentials";
|
|
22
|
+
AuthMechanism["Jwt"] = "jwt";
|
|
23
|
+
AuthMechanism["Token"] = "token";
|
|
24
|
+
AuthMechanism["Pkce"] = "pkce";
|
|
25
|
+
AuthMechanism["None"] = "none";
|
|
26
|
+
})(AuthMechanism || (AuthMechanism = {}));
|
|
19
27
|
/**
|
|
20
28
|
* In-flight token exchange promises to prevent duplicate exchanges
|
|
21
29
|
* inside the same process. When an exchange is in progress, subsequent
|
|
@@ -266,7 +274,7 @@ export async function getTokenFromCliLogin(options) {
|
|
|
266
274
|
return undefined;
|
|
267
275
|
return await cliLogin.getToken(options);
|
|
268
276
|
}
|
|
269
|
-
async function
|
|
277
|
+
async function tryStoredClientCredentialAuth(options) {
|
|
270
278
|
const activeCredential = await getActiveCredentialsFromCli(options.baseUrl);
|
|
271
279
|
if (!activeCredential)
|
|
272
280
|
return undefined;
|
|
@@ -279,8 +287,13 @@ async function tryStoredClientCredentialToken(options) {
|
|
|
279
287
|
});
|
|
280
288
|
const cache = await resolveCache(options);
|
|
281
289
|
const pending = pendingExchanges.get(cacheKey);
|
|
282
|
-
if (pending)
|
|
283
|
-
return
|
|
290
|
+
if (pending) {
|
|
291
|
+
return {
|
|
292
|
+
token: await pending,
|
|
293
|
+
mechanism: AuthMechanism.ClientCredentials,
|
|
294
|
+
clientId: activeCredential.clientId,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
284
297
|
const cached = await readCachedToken(cacheKey, cache);
|
|
285
298
|
if (cached !== undefined) {
|
|
286
299
|
if (options.debug)
|
|
@@ -288,8 +301,12 @@ async function tryStoredClientCredentialToken(options) {
|
|
|
288
301
|
// (smoke tests, scripts) pipe `zapier-sdk --debug ... --json` into a
|
|
289
302
|
// JSON parser.
|
|
290
303
|
console.error(`[auth] Using cached token (clientId: ${activeCredential.clientId})`);
|
|
291
|
-
emitAuthResolved(options.onEvent,
|
|
292
|
-
return
|
|
304
|
+
emitAuthResolved(options.onEvent, AuthMechanism.ClientCredentials);
|
|
305
|
+
return {
|
|
306
|
+
token: cached,
|
|
307
|
+
mechanism: AuthMechanism.ClientCredentials,
|
|
308
|
+
clientId: activeCredential.clientId,
|
|
309
|
+
};
|
|
293
310
|
}
|
|
294
311
|
const storedCredential = await getStoredClientCredentialsFromCli(resolvedBaseUrl);
|
|
295
312
|
if (!storedCredential) {
|
|
@@ -306,12 +323,17 @@ async function tryStoredClientCredentialToken(options) {
|
|
|
306
323
|
}
|
|
307
324
|
if (options.debug)
|
|
308
325
|
console.error(`[auth] Using stored client credential (clientId: ${storedCredential.clientId})`);
|
|
309
|
-
const
|
|
310
|
-
emitAuthResolved(options.onEvent,
|
|
311
|
-
return
|
|
326
|
+
const auth = await resolveAuthFromCredentials(storedCredential, options);
|
|
327
|
+
emitAuthResolved(options.onEvent, AuthMechanism.ClientCredentials);
|
|
328
|
+
return {
|
|
329
|
+
token: auth.token,
|
|
330
|
+
mechanism: AuthMechanism.ClientCredentials,
|
|
331
|
+
clientId: activeCredential.clientId,
|
|
332
|
+
};
|
|
312
333
|
}
|
|
313
334
|
/**
|
|
314
|
-
* Resolves
|
|
335
|
+
* Resolves auth from wherever it can be found, returning the token plus
|
|
336
|
+
* metadata about how it was resolved.
|
|
315
337
|
*
|
|
316
338
|
* Resolution order:
|
|
317
339
|
* 1. Explicit credentials option (or deprecated token option)
|
|
@@ -323,9 +345,10 @@ async function tryStoredClientCredentialToken(options) {
|
|
|
323
345
|
* - Client credentials: Exchanged for an access token (with caching)
|
|
324
346
|
* - PKCE: Delegates to CLI login (throws if not available)
|
|
325
347
|
*
|
|
326
|
-
*
|
|
348
|
+
* When no auth can be resolved, returns a ResolvedAuth with
|
|
349
|
+
* mechanism: None and no token.
|
|
327
350
|
*/
|
|
328
|
-
export async function
|
|
351
|
+
export async function resolveAuth(options = {}) {
|
|
329
352
|
// Resolve credentials from options and env vars
|
|
330
353
|
const credentials = await resolveCredentials({
|
|
331
354
|
credentials: options.credentials,
|
|
@@ -334,11 +357,11 @@ export async function resolveAuthToken(options = {}) {
|
|
|
334
357
|
});
|
|
335
358
|
// If we got credentials, process them based on type
|
|
336
359
|
if (credentials !== undefined) {
|
|
337
|
-
return
|
|
360
|
+
return resolveAuthFromCredentials(credentials, options);
|
|
338
361
|
}
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
341
|
-
return
|
|
362
|
+
const storedAuth = await tryStoredClientCredentialAuth(options);
|
|
363
|
+
if (storedAuth !== undefined)
|
|
364
|
+
return storedAuth;
|
|
342
365
|
if (options.debug) {
|
|
343
366
|
console.error("[auth] Using JWT (no stored client credential found)");
|
|
344
367
|
}
|
|
@@ -348,17 +371,33 @@ export async function resolveAuthToken(options = {}) {
|
|
|
348
371
|
debug: options.debug,
|
|
349
372
|
});
|
|
350
373
|
if (jwtToken !== undefined) {
|
|
351
|
-
emitAuthResolved(options.onEvent,
|
|
374
|
+
emitAuthResolved(options.onEvent, AuthMechanism.Jwt);
|
|
375
|
+
return {
|
|
376
|
+
token: jwtToken,
|
|
377
|
+
mechanism: AuthMechanism.Jwt,
|
|
378
|
+
clientId: null,
|
|
379
|
+
};
|
|
352
380
|
}
|
|
353
|
-
return
|
|
381
|
+
return {
|
|
382
|
+
token: undefined,
|
|
383
|
+
mechanism: AuthMechanism.None,
|
|
384
|
+
clientId: null,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
export async function resolveAuthToken(options = {}) {
|
|
388
|
+
return (await resolveAuth(options)).token;
|
|
354
389
|
}
|
|
355
390
|
/**
|
|
356
391
|
* Resolve an auth token from resolved credentials.
|
|
357
392
|
*/
|
|
358
|
-
async function
|
|
393
|
+
async function resolveAuthFromCredentials(credentials, options) {
|
|
359
394
|
if (typeof credentials === "string") {
|
|
360
|
-
emitAuthResolved(options.onEvent,
|
|
361
|
-
return
|
|
395
|
+
emitAuthResolved(options.onEvent, AuthMechanism.Token);
|
|
396
|
+
return {
|
|
397
|
+
token: credentials,
|
|
398
|
+
mechanism: AuthMechanism.Token,
|
|
399
|
+
clientId: null,
|
|
400
|
+
};
|
|
362
401
|
}
|
|
363
402
|
// Client credentials: exchange + cache through a pluggable cache
|
|
364
403
|
// adapter. Resolution order:
|
|
@@ -384,12 +423,21 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
|
|
|
384
423
|
if (options.debug) {
|
|
385
424
|
console.error(`[auth] Using cached token (clientId: ${clientId})`);
|
|
386
425
|
}
|
|
387
|
-
return
|
|
426
|
+
return {
|
|
427
|
+
token: cached,
|
|
428
|
+
mechanism: AuthMechanism.ClientCredentials,
|
|
429
|
+
clientId: credentials.clientId,
|
|
430
|
+
};
|
|
388
431
|
}
|
|
389
432
|
// In-process dedup
|
|
390
433
|
const pending = pendingExchanges.get(cacheKey);
|
|
391
|
-
if (pending)
|
|
392
|
-
return
|
|
434
|
+
if (pending) {
|
|
435
|
+
return {
|
|
436
|
+
token: await pending,
|
|
437
|
+
mechanism: AuthMechanism.ClientCredentials,
|
|
438
|
+
clientId: credentials.clientId,
|
|
439
|
+
};
|
|
440
|
+
}
|
|
393
441
|
// Serialize exchange + persist inside the lock (when the adapter
|
|
394
442
|
// supports cross-process locking). The second acquirer re-reads the
|
|
395
443
|
// cache under the lock and uses the first's token instead of firing
|
|
@@ -426,7 +474,11 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
|
|
|
426
474
|
pendingExchanges.delete(cacheKey);
|
|
427
475
|
});
|
|
428
476
|
pendingExchanges.set(cacheKey, exchangePromise);
|
|
429
|
-
return
|
|
477
|
+
return {
|
|
478
|
+
token: await exchangePromise,
|
|
479
|
+
mechanism: AuthMechanism.ClientCredentials,
|
|
480
|
+
clientId: credentials.clientId,
|
|
481
|
+
};
|
|
430
482
|
}
|
|
431
483
|
// PKCE credentials: delegate to CLI login
|
|
432
484
|
if (isPkceCredentials(credentials)) {
|
|
@@ -438,7 +490,11 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
|
|
|
438
490
|
debug: options.debug,
|
|
439
491
|
});
|
|
440
492
|
if (storedToken) {
|
|
441
|
-
return
|
|
493
|
+
return {
|
|
494
|
+
token: storedToken,
|
|
495
|
+
mechanism: AuthMechanism.Pkce,
|
|
496
|
+
clientId: null,
|
|
497
|
+
};
|
|
442
498
|
}
|
|
443
499
|
// No stored token - user needs to run login
|
|
444
500
|
throw new Error("PKCE credentials require interactive login. " +
|
package/dist/experimental.cjs
CHANGED
|
@@ -2809,6 +2809,14 @@ function createMemoryCache() {
|
|
|
2809
2809
|
|
|
2810
2810
|
// src/auth.ts
|
|
2811
2811
|
var DEFAULT_AUTH_BASE_URL = "https://zapier.com";
|
|
2812
|
+
var AuthMechanism = /* @__PURE__ */ ((AuthMechanism2) => {
|
|
2813
|
+
AuthMechanism2["ClientCredentials"] = "client_credentials";
|
|
2814
|
+
AuthMechanism2["Jwt"] = "jwt";
|
|
2815
|
+
AuthMechanism2["Token"] = "token";
|
|
2816
|
+
AuthMechanism2["Pkce"] = "pkce";
|
|
2817
|
+
AuthMechanism2["None"] = "none";
|
|
2818
|
+
return AuthMechanism2;
|
|
2819
|
+
})(AuthMechanism || {});
|
|
2812
2820
|
var pendingExchanges = /* @__PURE__ */ new Map();
|
|
2813
2821
|
var cachedDefaultCache;
|
|
2814
2822
|
function buildCacheKey(options) {
|
|
@@ -2986,7 +2994,7 @@ async function getTokenFromCliLogin(options) {
|
|
|
2986
2994
|
if (!cliLogin) return void 0;
|
|
2987
2995
|
return await cliLogin.getToken(options);
|
|
2988
2996
|
}
|
|
2989
|
-
async function
|
|
2997
|
+
async function tryStoredClientCredentialAuth(options) {
|
|
2990
2998
|
const activeCredential = await getActiveCredentialsFromCli(options.baseUrl);
|
|
2991
2999
|
if (!activeCredential) return void 0;
|
|
2992
3000
|
const resolvedBaseUrl = activeCredential.baseUrl || options.baseUrl || DEFAULT_AUTH_BASE_URL;
|
|
@@ -3001,15 +3009,25 @@ async function tryStoredClientCredentialToken(options) {
|
|
|
3001
3009
|
});
|
|
3002
3010
|
const cache = await resolveCache(options);
|
|
3003
3011
|
const pending = pendingExchanges.get(cacheKey);
|
|
3004
|
-
if (pending)
|
|
3012
|
+
if (pending) {
|
|
3013
|
+
return {
|
|
3014
|
+
token: await pending,
|
|
3015
|
+
mechanism: "client_credentials" /* ClientCredentials */,
|
|
3016
|
+
clientId: activeCredential.clientId
|
|
3017
|
+
};
|
|
3018
|
+
}
|
|
3005
3019
|
const cached = await readCachedToken(cacheKey, cache);
|
|
3006
3020
|
if (cached !== void 0) {
|
|
3007
3021
|
if (options.debug)
|
|
3008
3022
|
console.error(
|
|
3009
3023
|
`[auth] Using cached token (clientId: ${activeCredential.clientId})`
|
|
3010
3024
|
);
|
|
3011
|
-
emitAuthResolved(options.onEvent, "client_credentials");
|
|
3012
|
-
return
|
|
3025
|
+
emitAuthResolved(options.onEvent, "client_credentials" /* ClientCredentials */);
|
|
3026
|
+
return {
|
|
3027
|
+
token: cached,
|
|
3028
|
+
mechanism: "client_credentials" /* ClientCredentials */,
|
|
3029
|
+
clientId: activeCredential.clientId
|
|
3030
|
+
};
|
|
3013
3031
|
}
|
|
3014
3032
|
const storedCredential = await getStoredClientCredentialsFromCli(resolvedBaseUrl);
|
|
3015
3033
|
if (!storedCredential) {
|
|
@@ -3027,24 +3045,25 @@ async function tryStoredClientCredentialToken(options) {
|
|
|
3027
3045
|
console.error(
|
|
3028
3046
|
`[auth] Using stored client credential (clientId: ${storedCredential.clientId})`
|
|
3029
3047
|
);
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3048
|
+
const auth = await resolveAuthFromCredentials(storedCredential, options);
|
|
3049
|
+
emitAuthResolved(options.onEvent, "client_credentials" /* ClientCredentials */);
|
|
3050
|
+
return {
|
|
3051
|
+
token: auth.token,
|
|
3052
|
+
mechanism: "client_credentials" /* ClientCredentials */,
|
|
3053
|
+
clientId: activeCredential.clientId
|
|
3054
|
+
};
|
|
3036
3055
|
}
|
|
3037
|
-
async function
|
|
3056
|
+
async function resolveAuth(options = {}) {
|
|
3038
3057
|
const credentials = await resolveCredentials({
|
|
3039
3058
|
credentials: options.credentials,
|
|
3040
3059
|
token: options.token,
|
|
3041
3060
|
baseUrl: options.baseUrl
|
|
3042
3061
|
});
|
|
3043
3062
|
if (credentials !== void 0) {
|
|
3044
|
-
return
|
|
3063
|
+
return resolveAuthFromCredentials(credentials, options);
|
|
3045
3064
|
}
|
|
3046
|
-
const
|
|
3047
|
-
if (
|
|
3065
|
+
const storedAuth = await tryStoredClientCredentialAuth(options);
|
|
3066
|
+
if (storedAuth !== void 0) return storedAuth;
|
|
3048
3067
|
if (options.debug) {
|
|
3049
3068
|
console.error("[auth] Using JWT (no stored client credential found)");
|
|
3050
3069
|
}
|
|
@@ -3054,14 +3073,30 @@ async function resolveAuthToken(options = {}) {
|
|
|
3054
3073
|
debug: options.debug
|
|
3055
3074
|
});
|
|
3056
3075
|
if (jwtToken !== void 0) {
|
|
3057
|
-
emitAuthResolved(options.onEvent, "jwt");
|
|
3076
|
+
emitAuthResolved(options.onEvent, "jwt" /* Jwt */);
|
|
3077
|
+
return {
|
|
3078
|
+
token: jwtToken,
|
|
3079
|
+
mechanism: "jwt" /* Jwt */,
|
|
3080
|
+
clientId: null
|
|
3081
|
+
};
|
|
3058
3082
|
}
|
|
3059
|
-
return
|
|
3083
|
+
return {
|
|
3084
|
+
token: void 0,
|
|
3085
|
+
mechanism: "none" /* None */,
|
|
3086
|
+
clientId: null
|
|
3087
|
+
};
|
|
3088
|
+
}
|
|
3089
|
+
async function resolveAuthToken(options = {}) {
|
|
3090
|
+
return (await resolveAuth(options)).token;
|
|
3060
3091
|
}
|
|
3061
|
-
async function
|
|
3092
|
+
async function resolveAuthFromCredentials(credentials, options) {
|
|
3062
3093
|
if (typeof credentials === "string") {
|
|
3063
|
-
emitAuthResolved(options.onEvent, "token");
|
|
3064
|
-
return
|
|
3094
|
+
emitAuthResolved(options.onEvent, "token" /* Token */);
|
|
3095
|
+
return {
|
|
3096
|
+
token: credentials,
|
|
3097
|
+
mechanism: "token" /* Token */,
|
|
3098
|
+
clientId: null
|
|
3099
|
+
};
|
|
3065
3100
|
}
|
|
3066
3101
|
if (isClientCredentials(credentials)) {
|
|
3067
3102
|
const { clientId } = credentials;
|
|
@@ -3078,10 +3113,20 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
|
|
|
3078
3113
|
if (options.debug) {
|
|
3079
3114
|
console.error(`[auth] Using cached token (clientId: ${clientId})`);
|
|
3080
3115
|
}
|
|
3081
|
-
return
|
|
3116
|
+
return {
|
|
3117
|
+
token: cached,
|
|
3118
|
+
mechanism: "client_credentials" /* ClientCredentials */,
|
|
3119
|
+
clientId: credentials.clientId
|
|
3120
|
+
};
|
|
3082
3121
|
}
|
|
3083
3122
|
const pending = pendingExchanges.get(cacheKey);
|
|
3084
|
-
if (pending)
|
|
3123
|
+
if (pending) {
|
|
3124
|
+
return {
|
|
3125
|
+
token: await pending,
|
|
3126
|
+
mechanism: "client_credentials" /* ClientCredentials */,
|
|
3127
|
+
clientId: credentials.clientId
|
|
3128
|
+
};
|
|
3129
|
+
}
|
|
3085
3130
|
const runLocked = async () => {
|
|
3086
3131
|
const recheck = await readCachedToken(cacheKey, cache);
|
|
3087
3132
|
if (recheck !== void 0) {
|
|
@@ -3114,7 +3159,11 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
|
|
|
3114
3159
|
pendingExchanges.delete(cacheKey);
|
|
3115
3160
|
});
|
|
3116
3161
|
pendingExchanges.set(cacheKey, exchangePromise);
|
|
3117
|
-
return
|
|
3162
|
+
return {
|
|
3163
|
+
token: await exchangePromise,
|
|
3164
|
+
mechanism: "client_credentials" /* ClientCredentials */,
|
|
3165
|
+
clientId: credentials.clientId
|
|
3166
|
+
};
|
|
3118
3167
|
}
|
|
3119
3168
|
if (isPkceCredentials(credentials)) {
|
|
3120
3169
|
const storedToken = await getTokenFromCliLogin({
|
|
@@ -3124,7 +3173,11 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
|
|
|
3124
3173
|
debug: options.debug
|
|
3125
3174
|
});
|
|
3126
3175
|
if (storedToken) {
|
|
3127
|
-
return
|
|
3176
|
+
return {
|
|
3177
|
+
token: storedToken,
|
|
3178
|
+
mechanism: "pkce" /* Pkce */,
|
|
3179
|
+
clientId: null
|
|
3180
|
+
};
|
|
3128
3181
|
}
|
|
3129
3182
|
throw new Error(
|
|
3130
3183
|
"PKCE credentials require interactive login. Please run the 'login' command with the CLI first, or use client_credentials flow."
|
|
@@ -3318,7 +3371,7 @@ function parseApprovalReviewStreamPayload(parsed, toolNames) {
|
|
|
3318
3371
|
}
|
|
3319
3372
|
|
|
3320
3373
|
// src/sdk-version.ts
|
|
3321
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.76.
|
|
3374
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.76.1" : void 0) || "unknown";
|
|
3322
3375
|
|
|
3323
3376
|
// src/utils/open-url.ts
|
|
3324
3377
|
var nodePrefix = "node:";
|
|
@@ -9588,6 +9641,8 @@ function createBaseEvent(context = {}) {
|
|
|
9588
9641
|
release_id: getReleaseId(),
|
|
9589
9642
|
customuser_id: context.customuser_id,
|
|
9590
9643
|
account_id: context.account_id,
|
|
9644
|
+
client_id: context.client_id ?? null,
|
|
9645
|
+
auth_mechanism: context.auth_mechanism ?? null,
|
|
9591
9646
|
identity_id: context.identity_id,
|
|
9592
9647
|
visitor_id: context.visitor_id,
|
|
9593
9648
|
correlation_id: context.correlation_id
|
|
@@ -9741,6 +9796,20 @@ function cleanupEventListeners() {
|
|
|
9741
9796
|
var APPLICATION_LIFECYCLE_EVENT_SUBJECT = "platform.sdk.ApplicationLifecycleEvent";
|
|
9742
9797
|
var ERROR_OCCURRED_EVENT_SUBJECT = "platform.sdk.ErrorOccurredEvent";
|
|
9743
9798
|
var METHOD_CALLED_EVENT_SUBJECT = "platform.sdk.MethodCalledEvent";
|
|
9799
|
+
var NULL_EVENT_CONTEXT = Object.freeze({
|
|
9800
|
+
customuser_id: null,
|
|
9801
|
+
account_id: null,
|
|
9802
|
+
client_id: null,
|
|
9803
|
+
auth_mechanism: null
|
|
9804
|
+
});
|
|
9805
|
+
function buildEventAuthContext(auth) {
|
|
9806
|
+
const userIds = auth.token ? extractUserIdsFromJwt(auth.token) : { customuser_id: null, account_id: null };
|
|
9807
|
+
return {
|
|
9808
|
+
...userIds,
|
|
9809
|
+
client_id: auth.clientId,
|
|
9810
|
+
auth_mechanism: auth.mechanism
|
|
9811
|
+
};
|
|
9812
|
+
}
|
|
9744
9813
|
async function emitWithTimeout(transport, subject, event) {
|
|
9745
9814
|
try {
|
|
9746
9815
|
await Promise.race([
|
|
@@ -9816,16 +9885,11 @@ var eventEmissionPlugin = definePlugin(
|
|
|
9816
9885
|
const getUserContext = (async () => {
|
|
9817
9886
|
if (config.enabled) {
|
|
9818
9887
|
try {
|
|
9819
|
-
|
|
9820
|
-
...options
|
|
9821
|
-
});
|
|
9822
|
-
if (token) {
|
|
9823
|
-
return extractUserIdsFromJwt(token);
|
|
9824
|
-
}
|
|
9888
|
+
return buildEventAuthContext(await resolveAuth({ ...options }));
|
|
9825
9889
|
} catch {
|
|
9826
9890
|
}
|
|
9827
9891
|
}
|
|
9828
|
-
return
|
|
9892
|
+
return NULL_EVENT_CONTEXT;
|
|
9829
9893
|
})();
|
|
9830
9894
|
const startupTime = Date.now();
|
|
9831
9895
|
let shutdownStartTime = null;
|
|
@@ -9858,6 +9922,8 @@ var eventEmissionPlugin = definePlugin(
|
|
|
9858
9922
|
release_id: getReleaseId(),
|
|
9859
9923
|
customuser_id: null,
|
|
9860
9924
|
account_id: null,
|
|
9925
|
+
client_id: null,
|
|
9926
|
+
auth_mechanism: null,
|
|
9861
9927
|
identity_id: null,
|
|
9862
9928
|
visitor_id: null,
|
|
9863
9929
|
correlation_id: null
|
|
@@ -9886,6 +9952,8 @@ var eventEmissionPlugin = definePlugin(
|
|
|
9886
9952
|
release_id: getReleaseId(),
|
|
9887
9953
|
customuser_id: null,
|
|
9888
9954
|
account_id: null,
|
|
9955
|
+
client_id: null,
|
|
9956
|
+
auth_mechanism: null,
|
|
9889
9957
|
identity_id: null,
|
|
9890
9958
|
visitor_id: null,
|
|
9891
9959
|
correlation_id: null
|
|
@@ -13259,6 +13327,7 @@ exports.ActionTypePropertySchema = ActionTypePropertySchema;
|
|
|
13259
13327
|
exports.AppKeyPropertySchema = AppKeyPropertySchema;
|
|
13260
13328
|
exports.AppPropertySchema = AppPropertySchema;
|
|
13261
13329
|
exports.AppsPropertySchema = AppsPropertySchema;
|
|
13330
|
+
exports.AuthMechanism = AuthMechanism;
|
|
13262
13331
|
exports.AuthenticationIdPropertySchema = AuthenticationIdPropertySchema;
|
|
13263
13332
|
exports.BaseSdkOptionsSchema = BaseSdkOptionsSchema;
|
|
13264
13333
|
exports.CONTEXT_CACHE_MAX_SIZE = CONTEXT_CACHE_MAX_SIZE;
|
|
@@ -13437,6 +13506,7 @@ exports.readManifestFromFile = readManifestFromFile;
|
|
|
13437
13506
|
exports.registryPlugin = registryPlugin;
|
|
13438
13507
|
exports.requestPlugin = requestPlugin;
|
|
13439
13508
|
exports.resetDeprecationWarnings = resetDeprecationWarnings2;
|
|
13509
|
+
exports.resolveAuth = resolveAuth;
|
|
13440
13510
|
exports.resolveAuthToken = resolveAuthToken;
|
|
13441
13511
|
exports.resolveCredentials = resolveCredentials;
|
|
13442
13512
|
exports.resolveCredentialsFromEnv = resolveCredentialsFromEnv;
|
package/dist/experimental.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BaseSdkOptions, P as PluginStack, a as PluginMeta, M as MethodHooks, C as CoreOptions, Z as ZapierSdkOptions$1, E as EventEmissionContext, A as ApiClient, b as Manifest, R as ResolvedAppLocator, U as UpdateManifestEntryOptions, c as UpdateManifestEntryResult, d as AddActionEntryOptions, e as AddActionEntryResult, f as ActionEntry, g as findManifestEntry, r as readManifestFromFile, h as CapabilitiesContext, i as PaginatedSdkResult, G as GetConnectionStartUrlItem, W as WaitForNewConnectionItem, j as CreateConnectionItem, F as FieldsetItem, k as PositionalMetadata, O as OutputFormatter, l as ZapierFetchInitOptions, D as DrainTriggerInboxOptions, m as DynamicResolver, n as WatchTriggerInboxOptions, o as ActionProxy, p as ZapierSdkApps, q as WithAddPlugin } from './index-
|
|
2
|
-
export { H as Action, ci as ActionExecutionOptions, Q as ActionExecutionResult, S as ActionField, V as ActionFieldChoice, aW as ActionItem, bw as ActionKeyProperty, b4 as ActionKeyPropertySchema, bx as ActionProperty, b5 as ActionPropertySchema, aK as ActionResolverItem, bI as ActionTimeoutMsProperty, bg as ActionTimeoutMsPropertySchema, aL as ActionTypeItem, bv as ActionTypeProperty, b3 as ActionTypePropertySchema, ce as ApiError,
|
|
1
|
+
import { B as BaseSdkOptions, P as PluginStack, a as PluginMeta, M as MethodHooks, C as CoreOptions, Z as ZapierSdkOptions$1, E as EventEmissionContext, A as ApiClient, b as Manifest, R as ResolvedAppLocator, U as UpdateManifestEntryOptions, c as UpdateManifestEntryResult, d as AddActionEntryOptions, e as AddActionEntryResult, f as ActionEntry, g as findManifestEntry, r as readManifestFromFile, h as CapabilitiesContext, i as PaginatedSdkResult, G as GetConnectionStartUrlItem, W as WaitForNewConnectionItem, j as CreateConnectionItem, F as FieldsetItem, k as PositionalMetadata, O as OutputFormatter, l as ZapierFetchInitOptions, D as DrainTriggerInboxOptions, m as DynamicResolver, n as WatchTriggerInboxOptions, o as ActionProxy, p as ZapierSdkApps, q as WithAddPlugin } from './index-Dlf9DlnJ.mjs';
|
|
2
|
+
export { H as Action, ci as ActionExecutionOptions, Q as ActionExecutionResult, S as ActionField, V as ActionFieldChoice, aW as ActionItem, bw as ActionKeyProperty, b4 as ActionKeyPropertySchema, bx as ActionProperty, b5 as ActionPropertySchema, aK as ActionResolverItem, bI as ActionTimeoutMsProperty, bg as ActionTimeoutMsPropertySchema, aL as ActionTypeItem, bv as ActionTypeProperty, b3 as ActionTypePropertySchema, ce as ApiError, dL as ApiEvent, d0 as ApiPluginOptions, d2 as ApiPluginProvides, I as App, cj as AppFactoryInput, aU as AppItem, bt as AppKeyProperty, b1 as AppKeyPropertySchema, bu as AppProperty, b2 as AppPropertySchema, eV as ApplicationLifecycleEventData, ca as ApprovalStatus, ch as AppsPluginProvides, bN as AppsProperty, bl as AppsPropertySchema, a8 as ArrayResolver, dK as AuthEvent, dv as AuthMechanism, bB as AuthenticationIdProperty, b8 as AuthenticationIdPropertySchema, f1 as BaseEvent, ay as BaseSdkOptionsSchema, am as BatchOptions, cP as CONTEXT_CACHE_MAX_SIZE, cO as CONTEXT_CACHE_TTL_MS, aC as CORE_ERROR_SYMBOL, ai as CallerContext, K as Choice, dR as ClientCredentialsObject, e0 as ClientCredentialsObjectSchema, _ as Connection, e8 as ConnectionEntry, e7 as ConnectionEntrySchema, bz as ConnectionIdProperty, b7 as ConnectionIdPropertySchema, aV as ConnectionItem, bA as ConnectionProperty, b9 as ConnectionPropertySchema, ea as ConnectionsMap, e9 as ConnectionsMapSchema, ec as ConnectionsPluginProvides, bP as ConnectionsProperty, bn as ConnectionsPropertySchema, $ as ConnectionsResponse, aD as CoreErrorCode, cB as CreateClientCredentialsPluginProvides, eD as CreateTableFieldsPluginProvides, ex as CreateTablePluginProvides, eL as CreateTableRecordsPluginProvides, dO as Credentials, e5 as CredentialsFunction, e4 as CredentialsFunctionSchema, dQ as CredentialsObject, e2 as CredentialsObjectSchema, e6 as CredentialsSchema, eh as DEFAULT_ACTION_TIMEOUT_MS, eq as DEFAULT_APPROVAL_TIMEOUT_MS, cY as DEFAULT_CONFIG_PATH, er as DEFAULT_MAX_APPROVAL_RETRIES, eg as DEFAULT_PAGE_SIZE, bG as DebugProperty, be as DebugPropertySchema, cD as DeleteClientCredentialsPluginProvides, eF as DeleteTableFieldsPluginProvides, ez as DeleteTablePluginProvides, eN as DeleteTableRecordsPluginProvides, u as DrainTriggerInboxCallback, v as DrainTriggerInboxErrorObserver, ab as DynamicListResolver, ac as DynamicSearchResolver, eW as EnhancedErrorEventData, bV as ErrorOptions, dN as EventCallback, eU as EventContext, eR as EventEmissionConfig, eT as EventEmissionProvides, cl as FetchPluginProvides, J as Field, bM as FieldsProperty, bk as FieldsPropertySchema, ad as FieldsResolver, y as FindFirstAuthenticationPluginProvides, cL as FindFirstConnectionPluginProvides, z as FindUniqueAuthenticationPluginProvides, cN as FindUniqueConnectionPluginProvides, a6 as FormattedItem, ax as FunctionDeprecation, aw as FunctionRegistryEntry, cv as GetActionInputFieldsSchemaPluginProvides, cH as GetActionPluginProvides, cF as GetAppPluginProvides, x as GetAuthenticationPluginProvides, cJ as GetConnectionPluginProvides, c$ as GetProfilePluginProvides, ev as GetTablePluginProvides, eH as GetTableRecordPluginProvides, aY as InfoFieldItem, aX as InputFieldItem, by as InputFieldProperty, b6 as InputFieldPropertySchema, bC as InputsProperty, ba as InputsPropertySchema, aT as JsonSseMessage, bU as LeaseLimitProperty, bs as LeaseLimitPropertySchema, bS as LeaseProperty, bq as LeasePropertySchema, bT as LeaseSecondsProperty, br as LeaseSecondsPropertySchema, L as LeasedTriggerMessageItem, bD as LimitProperty, bb as LimitPropertySchema, ct as ListActionInputFieldChoicesPluginProvides, cr as ListActionInputFieldsPluginProvides, cp as ListActionsPluginProvides, cn as ListAppsPluginProvides, w as ListAuthenticationsPluginProvides, cz as ListClientCredentialsPluginProvides, cx as ListConnectionsPluginProvides, eB as ListTableFieldsPluginProvides, eJ as ListTableRecordsPluginProvides, et as ListTablesPluginProvides, dM as LoadingEvent, ek as MAX_CONCURRENCY_LIMIT, ef as MAX_PAGE_LIMIT, cZ as ManifestEntry, cU as ManifestPluginOptions, cX as ManifestPluginProvides, f2 as MethodCalledEvent, eX as MethodCalledEventData, N as Need, X as NeedsRequest, Y as NeedsResponse, bE as OffsetProperty, bc as OffsetPropertySchema, bF as OutputProperty, bd as OutputPropertySchema, b0 as PaginatedSdkFunction, bH as ParamsProperty, bf as ParamsPropertySchema, dS as PkceCredentialsObject, e1 as PkceCredentialsObjectSchema, aE as Plugin, aF as PluginProvides, aO as PollOptions, c8 as RateLimitInfo, bK as RecordProperty, bi as RecordPropertySchema, bL as RecordsProperty, bj as RecordsPropertySchema, ar as RelayFetchSchema, aq as RelayRequestSchema, aN as RequestOptions, cT as RequestPluginProvides, du as ResolveAuthTokenOptions, dX as ResolveCredentialsOptions, dw as ResolvedAuth, dP as ResolvedCredentials, e3 as ResolvedCredentialsSchema, a7 as Resolver, a9 as ResolverMetadata, aZ as RootFieldItem, cR as RunActionPluginProvides, dJ as SdkEvent, a$ as SdkPage, aS as SseMessage, aa as StaticResolver, bJ as TableProperty, bh as TablePropertySchema, bO as TablesProperty, bm as TablesPropertySchema, bR as TriggerInboxNameProperty, bp as TriggerInboxNamePropertySchema, bQ as TriggerInboxProperty, bo as TriggerInboxPropertySchema, T as TriggerMessageStatus, eP as UpdateTableRecordsPluginProvides, a0 as UserProfile, a_ as UserProfileItem, ed as ZAPIER_BASE_URL, em as ZAPIER_MAX_CONCURRENT_REQUESTS, ei as ZAPIER_MAX_NETWORK_RETRIES, ej as ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, s as ZapierAbortDrainSignal, c6 as ZapierActionError, b$ as ZapierApiError, c0 as ZapierAppNotFoundError, cb as ZapierApprovalError, bZ as ZapierAuthenticationError, c4 as ZapierBundleError, dF as ZapierCache, dG as ZapierCacheEntry, dH as ZapierCacheSetOptions, c3 as ZapierConfigurationError, c7 as ZapierConflictError, bW as ZapierError, c1 as ZapierNotFoundError, c9 as ZapierRateLimitError, cc as ZapierRelayError, t as ZapierReleaseTriggerMessageSignal, c2 as ZapierResourceNotFoundError, cf as ZapierSignal, c5 as ZapierTimeoutError, bY as ZapierUnknownError, bX as ZapierValidationError, d5 as actionKeyResolver, d4 as actionTypeResolver, a5 as addPlugin, d1 as apiPlugin, d3 as appKeyResolver, cg as appsPlugin, d7 as authenticationIdGenericResolver, d6 as authenticationIdResolver, al as batch, eY as buildApplicationLifecycleEvent, an as buildCapabilityMessage, e_ as buildErrorEvent, eZ as buildErrorEventWithContext, f0 as buildMethodCalledEvent, eQ as cleanupEventListeners, dx as clearTokenCache, db as clientCredentialsNameResolver, dc as clientIdResolver, aJ as composePlugins, d7 as connectionIdGenericResolver, d6 as connectionIdResolver, eb as connectionsPlugin, e$ as createBaseEvent, cA as createClientCredentialsPlugin, a4 as createCorePlugin, a2 as createFunction, dI as createMemoryCache, au as createOptionsPlugin, aI as createPaginatedPluginMethod, aH as createPluginMethod, a3 as createPluginStack, at as createSdk, eC as createTableFieldsPlugin, ew as createTablePlugin, eK as createTableRecordsPlugin, aP as createZapierApi, av as createZapierCoreStack, as as createZapierSdkWithoutRegistry, aG as definePlugin, cC as deleteClientCredentialsPlugin, eE as deleteTableFieldsPlugin, ey as deleteTablePlugin, eM as deleteTableRecordsPlugin, dg as durableRunIdResolver, eS as eventEmissionPlugin, ck as fetchPlugin, cK as findFirstConnectionPlugin, cM as findUniqueConnectionPlugin, cd as formatErrorMessage, f3 as generateEventId, cu as getActionInputFieldsSchemaPlugin, cG as getActionPlugin, fd as getAgent, cE as getAppPlugin, d_ as getBaseUrlFromCredentials, ag as getCallerContext, f9 as getCiPlatform, d$ as getClientIdFromCredentials, cI as getConnectionPlugin, aB as getCoreErrorCause, aA as getCoreErrorCode, fb as getCpuTime, f4 as getCurrentTimestamp, fa as getMemoryUsage, aQ as getOrCreateApiClient, f6 as getOsInfo, f7 as getPlatformVersions, cV as getPreferredManifestEntryKey, c_ as getProfilePlugin, f5 as getReleaseId, eu as getTablePlugin, eG as getTableRecordPlugin, dB as getTokenFromCliLogin, fc as getTtyContext, en as getZapierApprovalMode, ep as getZapierDefaultApprovalMode, eo as getZapierOpenAutoModeApprovalsInBrowser, ee as getZapierSdkService, dz as injectCliLogin, da as inputFieldKeyResolver, d9 as inputsAllOptionalResolver, d8 as inputsResolver, dy as invalidateCachedToken, dE as invalidateCredentialsToken, f8 as isCi, dA as isCliLoginAvailable, dT as isClientCredentials, az as isCoreError, dW as isCredentialsFunction, dV as isCredentialsObject, aR as isPermanentHttpError, dU as isPkceCredentials, a1 as isPositional, cs as listActionInputFieldChoicesPlugin, cq as listActionInputFieldsPlugin, co as listActionsPlugin, cm as listAppsPlugin, cy as listClientCredentialsPlugin, cw as listConnectionsPlugin, eA as listTableFieldsPlugin, eI as listTableRecordsPlugin, es as listTablesPlugin, ao as logDeprecation, cW as manifestPlugin, el as parseConcurrencyEnvVar, aM as registryPlugin, cS as requestPlugin, ap as resetDeprecationWarnings, dC as resolveAuth, dD as resolveAuthToken, dZ as resolveCredentials, dY as resolveCredentialsFromEnv, cQ as runActionPlugin, ae as runInMethodScope, ah as runWithCallerContext, af as runWithTelemetryContext, dm as tableFieldIdsResolver, dp as tableFieldsResolver, ds as tableFiltersResolver, dd as tableIdResolver, dn as tableNameResolver, dk as tableRecordIdResolver, dl as tableRecordIdsResolver, dq as tableRecordsResolver, dt as tableSortResolver, dr as tableUpdateRecordsResolver, aj as toSnakeCase, ak as toTitleCase, de as triggerInboxResolver, dj as triggerMessagesResolver, eO as updateTableRecordsPlugin, df as workflowIdResolver, di as workflowRunIdResolver, dh as workflowVersionIdResolver, b_ as zapierAdaptError } from './index-Dlf9DlnJ.mjs';
|
|
3
3
|
import * as zod_v4_core from 'zod/v4/core';
|
|
4
4
|
import * as zod from 'zod';
|
|
5
5
|
import '@zapier/zapier-sdk-core/v0/schemas/connections';
|