@zapier/zapier-sdk 0.22.0 → 0.23.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/dist/index.mjs CHANGED
@@ -2264,7 +2264,8 @@ var listClientCredentialsPlugin = ({ context }) => {
2264
2264
  }
2265
2265
  return void 0;
2266
2266
  },
2267
- authRequired: true
2267
+ authRequired: true,
2268
+ requiredScopes: ["credentials"]
2268
2269
  }
2269
2270
  );
2270
2271
  return response;
@@ -2321,7 +2322,8 @@ var createClientCredentialsPlugin = ({ context }) => {
2321
2322
  }
2322
2323
  return void 0;
2323
2324
  },
2324
- authRequired: true
2325
+ authRequired: true,
2326
+ requiredScopes: ["credentials"]
2325
2327
  }
2326
2328
  );
2327
2329
  return {
@@ -2379,7 +2381,8 @@ var deleteClientCredentialsPlugin = ({ context }) => {
2379
2381
  }
2380
2382
  return void 0;
2381
2383
  },
2382
- authRequired: true
2384
+ authRequired: true,
2385
+ requiredScopes: ["credentials"]
2383
2386
  });
2384
2387
  return {
2385
2388
  success: true
@@ -3795,21 +3798,27 @@ function deriveAuthBaseUrl(sdkBaseUrl) {
3795
3798
  return getZapierBaseUrl(sdkBaseUrl);
3796
3799
  }
3797
3800
  function normalizeCredentialsObject(obj, sdkBaseUrl) {
3798
- const resolvedBaseUrl = obj.baseUrl || deriveAuthBaseUrl(sdkBaseUrl);
3799
- if (obj.type === "client_credentials" || "clientSecret" in obj && obj.clientSecret) {
3801
+ const merged = {
3802
+ clientSecret: ZAPIER_CREDENTIALS_CLIENT_SECRET,
3803
+ baseUrl: ZAPIER_CREDENTIALS_BASE_URL,
3804
+ scope: ZAPIER_CREDENTIALS_SCOPE,
3805
+ ...obj
3806
+ };
3807
+ const resolvedBaseUrl = merged.baseUrl || deriveAuthBaseUrl(sdkBaseUrl);
3808
+ if (obj.type === "client_credentials" || "clientSecret" in merged && merged.clientSecret) {
3800
3809
  return {
3801
3810
  type: "client_credentials",
3802
3811
  clientId: obj.clientId,
3803
- clientSecret: obj.clientSecret,
3812
+ clientSecret: merged.clientSecret,
3804
3813
  baseUrl: resolvedBaseUrl,
3805
- scope: obj.scope
3814
+ scope: merged.scope
3806
3815
  };
3807
3816
  }
3808
3817
  return {
3809
3818
  type: "pkce",
3810
3819
  clientId: obj.clientId,
3811
3820
  baseUrl: resolvedBaseUrl,
3812
- scope: obj.scope
3821
+ scope: merged.scope
3813
3822
  };
3814
3823
  }
3815
3824
  function resolveCredentialsFromEnv(sdkBaseUrl) {
@@ -3907,37 +3916,65 @@ function getClientIdFromCredentials(credentials) {
3907
3916
  // src/auth.ts
3908
3917
  var tokenCache = /* @__PURE__ */ new Map();
3909
3918
  var pendingExchanges = /* @__PURE__ */ new Map();
3919
+ function buildCacheKey(clientId, scopes) {
3920
+ const sortedScopes = [...scopes].sort().join(",");
3921
+ return `${clientId}:${sortedScopes}`;
3922
+ }
3910
3923
  function clearTokenCache() {
3911
3924
  tokenCache.clear();
3912
3925
  pendingExchanges.clear();
3913
3926
  }
3914
3927
  var TOKEN_EXPIRATION_BUFFER = 5 * 60 * 1e3;
3915
- function getCachedToken(clientId) {
3916
- const cached = tokenCache.get(clientId);
3928
+ function getCachedToken(clientId, scopes) {
3929
+ const cacheKey = buildCacheKey(clientId, scopes);
3930
+ const cached = tokenCache.get(cacheKey);
3917
3931
  if (!cached) return void 0;
3918
3932
  if (cached.expiresAt > Date.now() + TOKEN_EXPIRATION_BUFFER) {
3919
3933
  return cached.accessToken;
3920
3934
  }
3921
- tokenCache.delete(clientId);
3935
+ tokenCache.delete(cacheKey);
3922
3936
  return void 0;
3923
3937
  }
3924
- function cacheToken(clientId, accessToken, expiresIn) {
3925
- tokenCache.set(clientId, {
3938
+ function cacheToken(clientId, scopes, accessToken, expiresIn) {
3939
+ const cacheKey = buildCacheKey(clientId, scopes);
3940
+ tokenCache.set(cacheKey, {
3926
3941
  accessToken,
3927
3942
  expiresAt: Date.now() + expiresIn * 1e3
3928
3943
  });
3929
3944
  }
3930
- function invalidateCachedToken(clientId) {
3931
- tokenCache.delete(clientId);
3945
+ function invalidateCachedToken(clientId, scopes) {
3946
+ const cacheKey = buildCacheKey(clientId, scopes);
3947
+ tokenCache.delete(cacheKey);
3948
+ pendingExchanges.delete(cacheKey);
3932
3949
  }
3933
3950
  function getTokenEndpointUrl(baseUrl) {
3934
3951
  const base = baseUrl || ZAPIER_BASE_URL;
3935
3952
  return `${base}/oauth/token/`;
3936
3953
  }
3954
+ function mergeScopes(credentialsScope, requiredScopes) {
3955
+ const scopeSet = /* @__PURE__ */ new Set();
3956
+ if (credentialsScope) {
3957
+ for (const s of credentialsScope.split(" ")) {
3958
+ if (s.trim()) {
3959
+ scopeSet.add(s.trim());
3960
+ }
3961
+ }
3962
+ } else {
3963
+ scopeSet.add("external");
3964
+ }
3965
+ if (requiredScopes) {
3966
+ for (const s of requiredScopes) {
3967
+ scopeSet.add(s);
3968
+ }
3969
+ }
3970
+ return [...scopeSet].sort();
3971
+ }
3937
3972
  async function exchangeClientCredentials(options) {
3938
- const { clientId, clientSecret, baseUrl, scope, onEvent } = options;
3973
+ const { clientId, clientSecret, baseUrl, scope, requiredScopes, onEvent } = options;
3939
3974
  const fetchFn = options.fetch || globalThis.fetch;
3940
3975
  const tokenUrl = getTokenEndpointUrl(baseUrl);
3976
+ const mergedScopes = mergeScopes(scope, requiredScopes);
3977
+ const scopeString = mergedScopes.join(" ");
3941
3978
  onEvent?.({
3942
3979
  type: "auth_exchanging",
3943
3980
  payload: {
@@ -3955,7 +3992,7 @@ async function exchangeClientCredentials(options) {
3955
3992
  grant_type: "client_credentials",
3956
3993
  client_id: clientId,
3957
3994
  client_secret: clientSecret,
3958
- scope: scope || "external",
3995
+ scope: scopeString,
3959
3996
  audience: "zapier.com"
3960
3997
  })
3961
3998
  });
@@ -3979,7 +4016,7 @@ async function exchangeClientCredentials(options) {
3979
4016
  throw new Error("Client credentials response missing access_token");
3980
4017
  }
3981
4018
  const expiresIn = data.expires_in || 3600;
3982
- cacheToken(clientId, data.access_token, expiresIn);
4019
+ cacheToken(clientId, mergedScopes, data.access_token, expiresIn);
3983
4020
  onEvent?.({
3984
4021
  type: "auth_success",
3985
4022
  payload: {
@@ -4009,7 +4046,8 @@ async function resolveAuthToken(options = {}) {
4009
4046
  }
4010
4047
  return getTokenFromCliLogin({
4011
4048
  onEvent: options.onEvent,
4012
- fetch: options.fetch
4049
+ fetch: options.fetch,
4050
+ debug: options.debug
4013
4051
  });
4014
4052
  }
4015
4053
  async function resolveAuthTokenFromCredentials(credentials, options) {
@@ -4018,11 +4056,13 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
4018
4056
  }
4019
4057
  if (isClientCredentials(credentials)) {
4020
4058
  const { clientId } = credentials;
4021
- const cached = getCachedToken(clientId);
4059
+ const mergedScopes = mergeScopes(credentials.scope, options.requiredScopes);
4060
+ const cacheKey = buildCacheKey(clientId, mergedScopes);
4061
+ const cached = getCachedToken(clientId, mergedScopes);
4022
4062
  if (cached) {
4023
4063
  return cached;
4024
4064
  }
4025
- const pending = pendingExchanges.get(clientId);
4065
+ const pending = pendingExchanges.get(cacheKey);
4026
4066
  if (pending) {
4027
4067
  return pending;
4028
4068
  }
@@ -4031,19 +4071,21 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
4031
4071
  clientSecret: credentials.clientSecret,
4032
4072
  baseUrl: credentials.baseUrl || options.baseUrl,
4033
4073
  scope: credentials.scope,
4074
+ requiredScopes: options.requiredScopes,
4034
4075
  fetch: options.fetch,
4035
4076
  onEvent: options.onEvent
4036
4077
  }).finally(() => {
4037
- pendingExchanges.delete(clientId);
4078
+ pendingExchanges.delete(cacheKey);
4038
4079
  });
4039
- pendingExchanges.set(clientId, exchangePromise);
4080
+ pendingExchanges.set(cacheKey, exchangePromise);
4040
4081
  return exchangePromise;
4041
4082
  }
4042
4083
  if (isPkceCredentials(credentials)) {
4043
4084
  const storedToken = await getTokenFromCliLogin({
4044
4085
  onEvent: options.onEvent,
4045
4086
  fetch: options.fetch,
4046
- credentials
4087
+ credentials,
4088
+ debug: options.debug
4047
4089
  });
4048
4090
  if (storedToken) {
4049
4091
  return storedToken;
@@ -4056,9 +4098,11 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
4056
4098
  }
4057
4099
  async function invalidateCredentialsToken(options) {
4058
4100
  const resolved = await resolveCredentials(options);
4101
+ if (!resolved) return;
4059
4102
  const clientId = getClientIdFromCredentials(resolved);
4060
- if (clientId) {
4061
- invalidateCachedToken(clientId);
4103
+ if (clientId && isClientCredentials(resolved)) {
4104
+ const scopes = mergeScopes(resolved.scope, options.requiredScopes);
4105
+ invalidateCachedToken(clientId, scopes);
4062
4106
  }
4063
4107
  }
4064
4108
 
@@ -4118,18 +4162,25 @@ var ZapierApiClient = class {
4118
4162
  }
4119
4163
  }
4120
4164
  // Helper to get a token from the different places it could be gotten
4121
- async getAuthToken() {
4165
+ async getAuthToken(options) {
4122
4166
  return resolveAuthToken({
4123
4167
  credentials: this.options.credentials,
4124
4168
  token: this.options.token,
4125
4169
  onEvent: this.options.onEvent,
4126
4170
  fetch: this.options.fetch,
4127
- baseUrl: this.options.baseUrl
4171
+ baseUrl: this.options.baseUrl,
4172
+ requiredScopes: options?.requiredScopes,
4173
+ debug: this.options.debug
4128
4174
  });
4129
4175
  }
4130
4176
  // Helper to handle responses
4131
4177
  async handleResponse(params) {
4132
- const { response, customErrorHandler, wasMissingAuthToken } = params;
4178
+ const {
4179
+ response,
4180
+ customErrorHandler,
4181
+ wasMissingAuthToken,
4182
+ requiredScopes
4183
+ } = params;
4133
4184
  const { data: responseData } = await this.parseResult(response);
4134
4185
  if (response.ok) {
4135
4186
  return responseData;
@@ -4169,7 +4220,8 @@ var ZapierApiClient = class {
4169
4220
  if (response.status === 401) {
4170
4221
  await invalidateCredentialsToken({
4171
4222
  credentials: this.options.credentials,
4172
- token: this.options.token
4223
+ token: this.options.token,
4224
+ requiredScopes
4173
4225
  });
4174
4226
  }
4175
4227
  throw new ZapierAuthenticationError(message, errorOptions);
@@ -4265,24 +4317,24 @@ var ZapierApiClient = class {
4265
4317
  (configPath) => path === configPath || path.startsWith(configPath + "/")
4266
4318
  );
4267
4319
  const config = matchingPathKey ? pathConfig[matchingPathKey] : void 0;
4320
+ let finalPath = path;
4321
+ if (config && "pathPrefix" in config && config.pathPrefix && matchingPathKey) {
4322
+ const pathWithoutPrefix = path.slice(matchingPathKey.length) || "/";
4323
+ finalPath = `${config.pathPrefix}${pathWithoutPrefix}`;
4324
+ }
4268
4325
  const zapierBaseUrl = getZapierBaseUrl(this.options.baseUrl);
4269
4326
  if (zapierBaseUrl === this.options.baseUrl) {
4270
4327
  const originalBaseUrl = new URL(this.options.baseUrl);
4271
4328
  const finalBaseUrl = `https://sdkapi.${originalBaseUrl.hostname}`;
4272
- let finalPath = path;
4273
- if (config && "pathPrefix" in config && config.pathPrefix && matchingPathKey) {
4274
- const pathWithoutPrefix = path.slice(matchingPathKey.length) || "/";
4275
- finalPath = `${config.pathPrefix}${pathWithoutPrefix}`;
4276
- }
4277
4329
  return {
4278
4330
  url: new URL(finalPath, finalBaseUrl),
4279
4331
  pathConfig: config
4280
4332
  };
4281
4333
  }
4282
4334
  const baseUrl = new URL(this.options.baseUrl);
4283
- const fullPath = baseUrl.pathname.replace(/\/$/, "") + path;
4335
+ const basePath = baseUrl.pathname.replace(/\/$/, "");
4284
4336
  return {
4285
- url: new URL(fullPath, baseUrl.origin),
4337
+ url: new URL(basePath + finalPath, baseUrl.origin),
4286
4338
  pathConfig: config
4287
4339
  };
4288
4340
  }
@@ -4299,7 +4351,9 @@ var ZapierApiClient = class {
4299
4351
  // Helper to build headers
4300
4352
  async buildHeaders(options = {}, pathConfig2) {
4301
4353
  const headers = new Headers(options.headers ?? {});
4302
- const authToken = await this.getAuthToken();
4354
+ const authToken = await this.getAuthToken({
4355
+ requiredScopes: options.requiredScopes
4356
+ });
4303
4357
  if (authToken) {
4304
4358
  const authHeaderName = pathConfig2 && pathConfig2.authHeader ? pathConfig2.authHeader : "Authorization";
4305
4359
  headers.set(authHeaderName, getAuthorizationHeader(authToken));
@@ -4319,7 +4373,7 @@ var ZapierApiClient = class {
4319
4373
  if (data && typeof data === "object") {
4320
4374
  headers["Content-Type"] = "application/json";
4321
4375
  }
4322
- const wasMissingAuthToken = options.authRequired && await this.getAuthToken() == null;
4376
+ const wasMissingAuthToken = options.authRequired && await this.getAuthToken({ requiredScopes: options.requiredScopes }) == null;
4323
4377
  const response = await this.plainFetch(path, {
4324
4378
  ...options,
4325
4379
  method,
@@ -4329,7 +4383,8 @@ var ZapierApiClient = class {
4329
4383
  const result = await this.handleResponse({
4330
4384
  response,
4331
4385
  customErrorHandler: options.customErrorHandler,
4332
- wasMissingAuthToken
4386
+ wasMissingAuthToken,
4387
+ requiredScopes: options.requiredScopes
4333
4388
  });
4334
4389
  if (typeof result === "string") {
4335
4390
  if (result === "" && (method === "DELETE" || response.status === 204)) {
@@ -5007,7 +5062,7 @@ function getCpuTime() {
5007
5062
 
5008
5063
  // package.json
5009
5064
  var package_default = {
5010
- version: "0.22.0"};
5065
+ version: "0.23.0"};
5011
5066
 
5012
5067
  // src/plugins/eventEmission/builders.ts
5013
5068
  function createBaseEvent(context = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/createClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EACnC,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7D,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,EAAE,8BAA8B,KACpC,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC5C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,uBAAuB,EAAE;gBACvB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAChD,EAAE,EACF;IACE,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,oBAAoB,EACxB,qCAAqC,CAiEtC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/createClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EACnC,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7D,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,EAAE,8BAA8B,KACpC,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC5C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,uBAAuB,EAAE;gBACvB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAChD,EAAE,EACF;IACE,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,oBAAoB,EACxB,qCAAqC,CAkEtC,CAAC"}
@@ -21,6 +21,7 @@ export const createClientCredentialsPlugin = ({ context }) => {
21
21
  return undefined;
22
22
  },
23
23
  authRequired: true,
24
+ requiredScopes: ["credentials"],
24
25
  });
25
26
  return {
26
27
  data: response.data,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/deleteClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EACnC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7D,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,EAAE,8BAA8B,KACpC,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC5C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,uBAAuB,EAAE;gBACvB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAChD,EAAE,EACF;IACE,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,oBAAoB,EACxB,qCAAqC,CAwDtC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/deleteClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EACnC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7D,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,EAAE,8BAA8B,KACpC,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAC5C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,uBAAuB,EAAE;gBACvB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAChD,EAAE,EACF;IACE,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,oBAAoB,EACxB,qCAAqC,CAyDtC,CAAC"}
@@ -17,6 +17,7 @@ export const deleteClientCredentialsPlugin = ({ context }) => {
17
17
  return undefined;
18
18
  },
19
19
  authRequired: true,
20
+ requiredScopes: ["credentials"],
20
21
  });
21
22
  return {
22
23
  success: true,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,EACL,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC/B,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7D,MAAM,WAAW,mCAAmC;IAClD,qBAAqB,EAAE,CACrB,OAAO,CAAC,EAAE,4BAA4B,KACnC,OAAO,CAAC,yBAAyB,CAAC,GACrC,aAAa,CAAC,yBAAyB,CAAC,GAAG;QACzC,KAAK,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAAC;KAC/C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,qBAAqB,EAAE;gBACrB,WAAW,EAAE,OAAO,gCAAgC,CAAC;aACtD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C,EAAE,EACF;IACE,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,oBAAoB,EACxB,mCAAmC,CAkEpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,EACL,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC/B,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7D,MAAM,WAAW,mCAAmC;IAClD,qBAAqB,EAAE,CACrB,OAAO,CAAC,EAAE,4BAA4B,KACnC,OAAO,CAAC,yBAAyB,CAAC,GACrC,aAAa,CAAC,yBAAyB,CAAC,GAAG;QACzC,KAAK,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAAC;KAC/C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,qBAAqB,EAAE;gBACrB,WAAW,EAAE,OAAO,gCAAgC,CAAC;aACtD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C,EAAE,EACF;IACE,GAAG,EAAE,SAAS,CAAC;CAChB,GAAG,oBAAoB,EACxB,mCAAmC,CAmEpC,CAAC"}
@@ -25,6 +25,7 @@ export const listClientCredentialsPlugin = ({ context }) => {
25
25
  return undefined;
26
26
  },
27
27
  authRequired: true,
28
+ requiredScopes: ["credentials"],
28
29
  });
29
30
  return response;
30
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Complete Zapier SDK - combines all Zapier SDK packages",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -36,7 +36,7 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@zapier/zapier-sdk-core": "^0.7.0",
39
+ "@zapier/zapier-sdk-core": "^0.7.2",
40
40
  "zod": "4.2.1"
41
41
  },
42
42
  "devDependencies": {
@@ -44,7 +44,7 @@
44
44
  "tsup": "^8.5.0",
45
45
  "typescript": "^5.8.3",
46
46
  "vitest": "^3.2.3",
47
- "@zapier/zapier-sdk-cli-login": "0.6.0"
47
+ "@zapier/zapier-sdk-cli-login": "0.7.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsup",