@vm0/cli 9.176.0 → 9.176.3

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.
@@ -74083,7 +74083,7 @@ if (DSN) {
74083
74083
  init2({
74084
74084
  dsn: DSN,
74085
74085
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
74086
- release: "9.176.0",
74086
+ release: "9.176.3",
74087
74087
  sendDefaultPii: false,
74088
74088
  tracesSampleRate: 0,
74089
74089
  shutdownTimeout: 500,
@@ -74102,7 +74102,7 @@ if (DSN) {
74102
74102
  }
74103
74103
  });
74104
74104
  setContext("cli", {
74105
- version: "9.176.0",
74105
+ version: "9.176.3",
74106
74106
  command: process.argv.slice(2).join(" ")
74107
74107
  });
74108
74108
  setContext("runtime", {
@@ -95302,6 +95302,7 @@ var zeroBillingStatusContract = c8.router({
95302
95302
  responses: {
95303
95303
  200: billingStatusResponseSchema,
95304
95304
  401: apiErrorSchema,
95305
+ 403: apiErrorSchema,
95305
95306
  500: apiErrorSchema
95306
95307
  },
95307
95308
  summary: "Get billing status for current org"
@@ -106669,7 +106670,7 @@ var zeroConnectorSessionsContract = c13.router({
106669
106670
  401: apiErrorSchema,
106670
106671
  403: apiErrorSchema
106671
106672
  },
106672
- summary: "Create connector session for device flow (zero proxy)"
106673
+ summary: "Create connector session for auth-code handoff"
106673
106674
  }
106674
106675
  });
106675
106676
  var zeroConnectorSessionByIdContract = c13.router({
@@ -115322,6 +115323,16 @@ var GOOGLE_OAUTH_CONNECTOR_TYPES = [
115322
115323
  var GOOGLE_OAUTH_CONNECTOR_TYPE_SET = new Set(GOOGLE_OAUTH_CONNECTOR_TYPES);
115323
115324
 
115324
115325
  // ../../packages/connectors/src/connector-utils.ts
115326
+ function getConnectorAuthMethod(type, authMethod) {
115327
+ for (const [methodId, method] of Object.entries(
115328
+ CONNECTOR_TYPES[type].authMethods
115329
+ )) {
115330
+ if (methodId === authMethod) {
115331
+ return method;
115332
+ }
115333
+ }
115334
+ return void 0;
115335
+ }
115325
115336
  function connectorAuthMethodValues(type) {
115326
115337
  return Object.values(CONNECTOR_TYPES[type].authMethods);
115327
115338
  }
@@ -115350,23 +115361,21 @@ function authMethodAccessPriority(method) {
115350
115361
  return 1;
115351
115362
  }
115352
115363
  }
115353
- function isConnectorOAuthGrantConfig(method) {
115354
- switch (method.grant.kind) {
115364
+ function connectorGrantScopes(grant) {
115365
+ switch (grant?.kind) {
115355
115366
  case "auth-code":
115356
115367
  case "device-auth":
115357
- return true;
115368
+ return grant.scopes;
115358
115369
  case "manual":
115359
115370
  case "managed":
115360
- return false;
115371
+ case void 0:
115372
+ return [];
115361
115373
  }
115362
115374
  }
115363
- function getConnectorOAuthGrantConfig(type) {
115364
- for (const method of connectorAuthMethodValues(type)) {
115365
- if (isConnectorOAuthGrantConfig(method)) {
115366
- return method.grant;
115367
- }
115368
- }
115369
- return void 0;
115375
+ function getConnectorAuthMethodGrantScopes(type, authMethod) {
115376
+ return [
115377
+ ...connectorGrantScopes(getConnectorAuthMethod(type, authMethod)?.grant)
115378
+ ];
115370
115379
  }
115371
115380
  function getConnectorGenerationTypes(type) {
115372
115381
  const config4 = CONNECTOR_TYPES[type];
@@ -115428,20 +115437,15 @@ function getConnectorEnvNamesForSecret(secretName) {
115428
115437
  }
115429
115438
  return null;
115430
115439
  }
115431
- function hasRequiredScopes(connectorType, storedScopes) {
115432
- const scopes = getConnectorOAuthGrantConfig(connectorType)?.scopes;
115433
- if (!scopes) return true;
115434
- if (scopes.length === 0) return true;
115440
+ function hasRequiredGrantScopes(requiredScopes, storedScopes) {
115441
+ if (requiredScopes.length === 0) return true;
115435
115442
  if (!storedScopes) return false;
115436
115443
  const storedSet = new Set(storedScopes);
115437
- return scopes.every((s) => {
115444
+ return requiredScopes.every((s) => {
115438
115445
  return storedSet.has(s);
115439
115446
  });
115440
115447
  }
115441
- function getScopeDiff(connectorType, storedScopes) {
115442
- const currentScopes = [
115443
- ...getConnectorOAuthGrantConfig(connectorType)?.scopes ?? []
115444
- ];
115448
+ function scopeDiff(currentScopes, storedScopes) {
115445
115449
  const stored = storedScopes ?? [];
115446
115450
  const storedSet = new Set(stored);
115447
115451
  const currentSet = new Set(currentScopes);
@@ -115452,10 +115456,22 @@ function getScopeDiff(connectorType, storedScopes) {
115452
115456
  removedScopes: stored.filter((s) => {
115453
115457
  return !currentSet.has(s);
115454
115458
  }),
115455
- currentScopes,
115459
+ currentScopes: [...currentScopes],
115456
115460
  storedScopes: stored
115457
115461
  };
115458
115462
  }
115463
+ function hasRequiredConnectorAuthMethodScopes(connectorType, authMethod, storedScopes) {
115464
+ return hasRequiredGrantScopes(
115465
+ getConnectorAuthMethodGrantScopes(connectorType, authMethod),
115466
+ storedScopes
115467
+ );
115468
+ }
115469
+ function getConnectorAuthMethodScopeDiff(connectorType, authMethod, storedScopes) {
115470
+ return scopeDiff(
115471
+ getConnectorAuthMethodGrantScopes(connectorType, authMethod),
115472
+ storedScopes
115473
+ );
115474
+ }
115459
115475
  function getConnectorTypeForSecretName(name) {
115460
115476
  const allTypes = CONNECTOR_TYPE_KEYS;
115461
115477
  for (const type of allTypes) {
@@ -132683,8 +132699,8 @@ export {
132683
132699
  getConnectorGenerationTypes,
132684
132700
  getConnectorEnvBindings,
132685
132701
  getConnectorEnvNamesForSecret,
132686
- hasRequiredScopes,
132687
- getScopeDiff,
132702
+ hasRequiredConnectorAuthMethodScopes,
132703
+ getConnectorAuthMethodScopeDiff,
132688
132704
  getConnectorTypeForSecretName,
132689
132705
  isFirewallConnectorType,
132690
132706
  getConnectorFirewall,
@@ -132717,4 +132733,4 @@ undici/lib/web/fetch/body.js:
132717
132733
  undici/lib/web/websocket/frame.js:
132718
132734
  (*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
132719
132735
  */
132720
- //# sourceMappingURL=chunk-3WAS5ORK.js.map
132736
+ //# sourceMappingURL=chunk-PK542UZ7.js.map