@vm0/cli 9.129.0 → 9.129.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.
@@ -73642,7 +73642,7 @@ if (DSN) {
73642
73642
  init2({
73643
73643
  dsn: DSN,
73644
73644
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
73645
- release: "9.129.0",
73645
+ release: "9.129.1",
73646
73646
  sendDefaultPii: false,
73647
73647
  tracesSampleRate: 0,
73648
73648
  shutdownTimeout: 500,
@@ -73661,7 +73661,7 @@ if (DSN) {
73661
73661
  }
73662
73662
  });
73663
73663
  setContext("cli", {
73664
- version: "9.129.0",
73664
+ version: "9.129.1",
73665
73665
  command: process.argv.slice(2).join(" ")
73666
73666
  });
73667
73667
  setContext("runtime", {
@@ -113464,55 +113464,7 @@ function matchFirewallPath(path3, pattern) {
113464
113464
  if (pi !== pathSegs.length) return null;
113465
113465
  return params;
113466
113466
  }
113467
- function parseGraphQLRule(rest) {
113468
- const gqlIdx = rest.indexOf(" GraphQL");
113469
- if (gqlIdx === -1) return null;
113470
- const path3 = gqlIdx > 0 ? rest.slice(0, gqlIdx) : "/";
113471
- const suffixParts = rest.slice(gqlIdx + 1).split(/\s+/);
113472
- let typeFilter = null;
113473
- let opFilter = null;
113474
- let fieldFilters = null;
113475
- for (let i = 1; i < suffixParts.length; i++) {
113476
- const part = suffixParts[i];
113477
- if (part.startsWith("type:")) {
113478
- typeFilter = part.slice(5);
113479
- } else if (part.startsWith("operationName:")) {
113480
- opFilter = part.slice(14);
113481
- } else if (part.startsWith("field:")) {
113482
- fieldFilters = part.slice(6).split(",");
113483
- }
113484
- }
113485
- return { path: path3, typeFilter, opFilter, fieldFilters };
113486
- }
113487
- function matchWildcard(value, pattern) {
113488
- if (pattern.endsWith("*")) {
113489
- return value.startsWith(pattern.slice(0, -1));
113490
- }
113491
- return value === pattern;
113492
- }
113493
- function matchGraphQLBody(body, typeFilter, opFilter, fieldFilters) {
113494
- if (!body) return false;
113495
- if (typeFilter !== null && body.type !== typeFilter) {
113496
- return false;
113497
- }
113498
- if (opFilter !== null) {
113499
- const opName = body.operationName;
113500
- if (!opName) return false;
113501
- if (!matchWildcard(opName, opFilter)) return false;
113502
- }
113503
- if (fieldFilters !== null) {
113504
- const fields = body.fields;
113505
- if (!fields || fields.length === 0) return false;
113506
- if (!fieldFilters.some((pattern) => {
113507
- return fields.some((f) => {
113508
- return matchWildcard(f, pattern);
113509
- });
113510
- }))
113511
- return false;
113512
- }
113513
- return true;
113514
- }
113515
- function findMatchingPermissions(method, path3, config4, graphqlBody) {
113467
+ function findMatchingPermissions(method, path3, config4) {
113516
113468
  const upperMethod = method.toUpperCase();
113517
113469
  const matched = /* @__PURE__ */ new Set();
113518
113470
  for (const api of config4.apis) {
@@ -113525,17 +113477,7 @@ function findMatchingPermissions(method, path3, config4, graphqlBody) {
113525
113477
  const ruleMethod = rule.slice(0, spaceIdx).toUpperCase();
113526
113478
  const rest = rule.slice(spaceIdx + 1);
113527
113479
  if (ruleMethod !== "ANY" && ruleMethod !== upperMethod) continue;
113528
- const gql = parseGraphQLRule(rest);
113529
- const rulePath = gql ? gql.path : rest;
113530
- if (matchFirewallPath(path3, rulePath) !== null) {
113531
- if (gql && (gql.typeFilter !== null || gql.opFilter !== null || gql.fieldFilters !== null) && !matchGraphQLBody(
113532
- graphqlBody,
113533
- gql.typeFilter,
113534
- gql.opFilter,
113535
- gql.fieldFilters
113536
- )) {
113537
- continue;
113538
- }
113480
+ if (matchFirewallPath(path3, rest) !== null) {
113539
113481
  matched.add(perm.name);
113540
113482
  break;
113541
113483
  }
@@ -115599,6 +115541,26 @@ var checkoutResponseSchema = external_exports.object({
115599
115541
  var portalResponseSchema = external_exports.object({
115600
115542
  url: external_exports.string()
115601
115543
  });
115544
+ var redeemResponseSchema = external_exports.discriminatedUnion("status", [
115545
+ external_exports.object({
115546
+ status: external_exports.literal("ready"),
115547
+ checkoutUrl: external_exports.string().url()
115548
+ }),
115549
+ external_exports.object({
115550
+ status: external_exports.literal("already_granted")
115551
+ }),
115552
+ external_exports.object({
115553
+ status: external_exports.literal("processing")
115554
+ }),
115555
+ external_exports.object({
115556
+ status: external_exports.literal("error"),
115557
+ reason: external_exports.enum([
115558
+ "campaign_misconfigured",
115559
+ "admin_required",
115560
+ "billing_unavailable"
115561
+ ])
115562
+ })
115563
+ ]);
115602
115564
  var checkoutRequestSchema = external_exports.object({
115603
115565
  tier: external_exports.enum(["pro", "team"]),
115604
115566
  successUrl: external_exports.string().url(),
@@ -115612,6 +115574,10 @@ var autoRechargeUpdateRequestSchema = external_exports.object({
115612
115574
  threshold: external_exports.number().int().positive().optional(),
115613
115575
  amount: external_exports.number().int().min(1e3).optional()
115614
115576
  });
115577
+ var redeemRequestSchema = external_exports.object({
115578
+ successUrl: external_exports.string().url(),
115579
+ cancelUrl: external_exports.string().url()
115580
+ });
115615
115581
  var zeroBillingStatusContract = c34.router({
115616
115582
  get: {
115617
115583
  method: "GET",
@@ -115733,6 +115699,24 @@ var zeroBillingDowngradeContract = c34.router({
115733
115699
  summary: "Downgrade subscription to a lower tier"
115734
115700
  }
115735
115701
  });
115702
+ var zeroBillingRedeemContract = c34.router({
115703
+ create: {
115704
+ method: "POST",
115705
+ path: "/api/zero/billing/redeem/:campaign",
115706
+ pathParams: external_exports.object({
115707
+ campaign: external_exports.string()
115708
+ }),
115709
+ headers: authHeadersSchema,
115710
+ body: redeemRequestSchema,
115711
+ responses: {
115712
+ 200: redeemResponseSchema,
115713
+ 400: apiErrorSchema,
115714
+ 401: apiErrorSchema,
115715
+ 500: apiErrorSchema
115716
+ },
115717
+ summary: "Redeem a one-time campaign"
115718
+ }
115719
+ });
115736
115720
 
115737
115721
  // ../../packages/core/src/contracts/zero-usage.ts
115738
115722
  init_esm_shims();
@@ -120100,4 +120084,4 @@ undici/lib/web/fetch/body.js:
120100
120084
  undici/lib/web/websocket/frame.js:
120101
120085
  (*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
120102
120086
  */
120103
- //# sourceMappingURL=chunk-X7AZTK2E.js.map
120087
+ //# sourceMappingURL=chunk-TO65SA2M.js.map