@dvina/sdk 4.1.59 → 4.1.66

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.
Files changed (89) hide show
  1. package/dist/_generated_documents-VM6RSSXR.js +1 -0
  2. package/dist/adapters/angular/index.d.ts +2 -2
  3. package/dist/adapters/angular/index.js +1 -159
  4. package/dist/adapters/react/index.js +1 -49
  5. package/dist/billing/index.js +1 -5
  6. package/dist/chunk-5E7LX4YQ.js +1 -0
  7. package/dist/chunk-D2L26FRK.js +5 -0
  8. package/dist/chunk-EK7ODJWE.js +1 -0
  9. package/dist/chunk-G34ETQUN.js +1 -0
  10. package/dist/chunk-H3TI6B7T.js +1 -0
  11. package/dist/chunk-IIQ3WGOJ.js +1 -0
  12. package/dist/chunk-IO56LXKJ.js +1 -0
  13. package/dist/chunk-SJ6Q5IDB.js +31 -0
  14. package/dist/{client-D309vpHA.d.ts → client-CEoJfTM9.d.ts} +2 -257
  15. package/dist/{index-fFR5so7x.d.ts → index-BzmzBgTh.d.ts} +1 -1
  16. package/dist/index.d.ts +7 -134
  17. package/dist/index.js +1 -10
  18. package/dist/inference/index.js +1 -5
  19. package/dist/package.json +12 -48
  20. package/dist/pagination/index.d.ts +2 -2
  21. package/dist/pagination/index.js +1 -5
  22. package/dist/{sync-engine-BIaOIpU3.d.ts → sync-engine-Bh0UcTVd.d.ts} +13 -0
  23. package/package.json +13 -49
  24. package/dist/_generated_documents-GHGFCEAV.js +0 -4
  25. package/dist/_generated_documents-GHGFCEAV.js.map +0 -1
  26. package/dist/_generated_documents-Z5MUI5BE.cjs +0 -2777
  27. package/dist/_generated_documents-Z5MUI5BE.cjs.map +0 -1
  28. package/dist/adapters/angular/index.cjs +0 -163
  29. package/dist/adapters/angular/index.cjs.map +0 -1
  30. package/dist/adapters/angular/index.d.cts +0 -254
  31. package/dist/adapters/angular/index.js.map +0 -1
  32. package/dist/adapters/react/index.cjs +0 -51
  33. package/dist/adapters/react/index.cjs.map +0 -1
  34. package/dist/adapters/react/index.d.cts +0 -62
  35. package/dist/adapters/react/index.js.map +0 -1
  36. package/dist/billing/index.cjs +0 -26
  37. package/dist/billing/index.cjs.map +0 -1
  38. package/dist/billing/index.d.cts +0 -328
  39. package/dist/billing/index.js.map +0 -1
  40. package/dist/chunk-2J5WONKO.cjs +0 -1608
  41. package/dist/chunk-2J5WONKO.cjs.map +0 -1
  42. package/dist/chunk-342BFYZZ.cjs +0 -98
  43. package/dist/chunk-342BFYZZ.cjs.map +0 -1
  44. package/dist/chunk-5WRI5ZAA.js +0 -29
  45. package/dist/chunk-5WRI5ZAA.js.map +0 -1
  46. package/dist/chunk-7XBJ77RJ.js +0 -103
  47. package/dist/chunk-7XBJ77RJ.js.map +0 -1
  48. package/dist/chunk-AE5KAIKK.js +0 -24
  49. package/dist/chunk-AE5KAIKK.js.map +0 -1
  50. package/dist/chunk-COFT5ZYL.js +0 -23777
  51. package/dist/chunk-COFT5ZYL.js.map +0 -1
  52. package/dist/chunk-DZUJEN5N.cjs +0 -32
  53. package/dist/chunk-DZUJEN5N.cjs.map +0 -1
  54. package/dist/chunk-FOKGSMXS.cjs +0 -27
  55. package/dist/chunk-FOKGSMXS.cjs.map +0 -1
  56. package/dist/chunk-HHBDJ65K.cjs +0 -24198
  57. package/dist/chunk-HHBDJ65K.cjs.map +0 -1
  58. package/dist/chunk-KEM6SUTS.js +0 -92
  59. package/dist/chunk-KEM6SUTS.js.map +0 -1
  60. package/dist/chunk-KSVHC4YE.cjs +0 -1841
  61. package/dist/chunk-KSVHC4YE.cjs.map +0 -1
  62. package/dist/chunk-KV5SP7RP.cjs +0 -114
  63. package/dist/chunk-KV5SP7RP.cjs.map +0 -1
  64. package/dist/chunk-NH4SMZCW.js +0 -1148
  65. package/dist/chunk-NH4SMZCW.js.map +0 -1
  66. package/dist/chunk-PDM2KR7T.js +0 -392
  67. package/dist/chunk-PDM2KR7T.js.map +0 -1
  68. package/dist/chunk-UELAE75E.cjs +0 -408
  69. package/dist/chunk-UELAE75E.cjs.map +0 -1
  70. package/dist/chunk-WX7EFPHT.js +0 -1600
  71. package/dist/chunk-WX7EFPHT.js.map +0 -1
  72. package/dist/client-BRIS6DdR.d.cts +0 -8159
  73. package/dist/client-Bb2gD6Iz.d.cts +0 -488
  74. package/dist/error-CsVoUTY8.d.cts +0 -95
  75. package/dist/index-D_Z25Pa1.d.cts +0 -79
  76. package/dist/index.cjs +0 -2039
  77. package/dist/index.cjs.map +0 -1
  78. package/dist/index.d.cts +0 -3823
  79. package/dist/index.js.map +0 -1
  80. package/dist/inference/index.cjs +0 -70
  81. package/dist/inference/index.cjs.map +0 -1
  82. package/dist/inference/index.d.cts +0 -80
  83. package/dist/inference/index.js.map +0 -1
  84. package/dist/pagination/index.cjs +0 -34
  85. package/dist/pagination/index.cjs.map +0 -1
  86. package/dist/pagination/index.d.cts +0 -6
  87. package/dist/pagination/index.js.map +0 -1
  88. package/dist/sync-engine-gpxyhQBl.d.cts +0 -478
  89. package/dist/types-Chg8ASmf.d.cts +0 -116
@@ -1,1608 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkKV5SP7RP_cjs = require('./chunk-KV5SP7RP.cjs');
4
-
5
- // src/billing/_generated.ts
6
- var EntitlementTier = /* @__PURE__ */ ((EntitlementTier2) => {
7
- EntitlementTier2["Enterprise"] = "enterprise";
8
- EntitlementTier2["Free"] = "free";
9
- EntitlementTier2["Max"] = "max";
10
- EntitlementTier2["Plus"] = "plus";
11
- EntitlementTier2["Pro"] = "pro";
12
- return EntitlementTier2;
13
- })(EntitlementTier || {});
14
- var SubscriptionCycle = /* @__PURE__ */ ((SubscriptionCycle2) => {
15
- SubscriptionCycle2["Daily"] = "DAILY";
16
- SubscriptionCycle2["Monthly"] = "MONTHLY";
17
- SubscriptionCycle2["Weekly"] = "WEEKLY";
18
- SubscriptionCycle2["Yearly"] = "YEARLY";
19
- return SubscriptionCycle2;
20
- })(SubscriptionCycle || {});
21
- var SubscriptionProvider = /* @__PURE__ */ ((SubscriptionProvider2) => {
22
- SubscriptionProvider2["Revcat"] = "REVCAT";
23
- SubscriptionProvider2["Stripe"] = "STRIPE";
24
- return SubscriptionProvider2;
25
- })(SubscriptionProvider || {});
26
- var PlansDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "Plans" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "plans" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "PlanFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "PlanFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Plan" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tier" } }, { "kind": "Field", "name": { "kind": "Name", "value": "prices" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "currency" } }, { "kind": "Field", "name": { "kind": "Name", "value": "amount" } }, { "kind": "Field", "name": { "kind": "Name", "value": "interval" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "entitlements" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "canAddUser" } }, { "kind": "Field", "name": { "kind": "Name", "value": "minUsers" } }, { "kind": "Field", "name": { "kind": "Name", "value": "team" } }, { "kind": "Field", "name": { "kind": "Name", "value": "capacity" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceTypes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "softTokenUsageLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hardTokenUsageLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "canAddReport" } }, { "kind": "Field", "name": { "kind": "Name", "value": "canUseApi" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxStructuredSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxUnstructuredSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "deepAnalysisTokenLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "deepAnalysisCharacterLimit" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "features" } }] } }] };
27
- var PlanDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "Plan" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "plan" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "FragmentSpread", "name": { "kind": "Name", "value": "PlanFragment" } }] } }] } }, { "kind": "FragmentDefinition", "name": { "kind": "Name", "value": "PlanFragment" }, "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Plan" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "tier" } }, { "kind": "Field", "name": { "kind": "Name", "value": "prices" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "currency" } }, { "kind": "Field", "name": { "kind": "Name", "value": "amount" } }, { "kind": "Field", "name": { "kind": "Name", "value": "interval" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "entitlements" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "canAddUser" } }, { "kind": "Field", "name": { "kind": "Name", "value": "minUsers" } }, { "kind": "Field", "name": { "kind": "Name", "value": "team" } }, { "kind": "Field", "name": { "kind": "Name", "value": "capacity" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceTypes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "softTokenUsageLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hardTokenUsageLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "canAddReport" } }, { "kind": "Field", "name": { "kind": "Name", "value": "canUseApi" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxStructuredSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxUnstructuredSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "deepAnalysisTokenLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "deepAnalysisCharacterLimit" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "features" } }] } }] };
28
- var TierOrdersDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "TierOrders" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tierOrders" } }] } }] };
29
- var EntitlementsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "Entitlements" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "entitlements" } }] } }] };
30
- var SubscriptionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "Subscription" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "subscription" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tier" } }, { "kind": "Field", "name": { "kind": "Name", "value": "provider" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cycle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "seats" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cancelAtPeriodEnd" } }, { "kind": "Field", "name": { "kind": "Name", "value": "currentPeriodStart" } }, { "kind": "Field", "name": { "kind": "Name", "value": "currentPeriodEnd" } }, { "kind": "Field", "name": { "kind": "Name", "value": "scheduledChange" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "effectiveDate" } }, { "kind": "Field", "name": { "kind": "Name", "value": "newTier" } }, { "kind": "Field", "name": { "kind": "Name", "value": "newSeats" } }, { "kind": "Field", "name": { "kind": "Name", "value": "newCycle" } }] } }] } }] } }] };
31
- var SubscriptionForManagerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "SubscriptionForManager" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "subscriptionForManager" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "workspaceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "tier" } }, { "kind": "Field", "name": { "kind": "Name", "value": "provider" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cycle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "seats" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cancelAtPeriodEnd" } }, { "kind": "Field", "name": { "kind": "Name", "value": "currentPeriodStart" } }, { "kind": "Field", "name": { "kind": "Name", "value": "currentPeriodEnd" } }, { "kind": "Field", "name": { "kind": "Name", "value": "scheduledChange" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "effectiveDate" } }, { "kind": "Field", "name": { "kind": "Name", "value": "newTier" } }, { "kind": "Field", "name": { "kind": "Name", "value": "newSeats" } }, { "kind": "Field", "name": { "kind": "Name", "value": "newCycle" } }] } }] } }] } }] };
32
- var SubscriptionEntitlementsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "SubscriptionEntitlements" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "subscriptionEntitlements" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "canAddUser" } }, { "kind": "Field", "name": { "kind": "Name", "value": "minUsers" } }, { "kind": "Field", "name": { "kind": "Name", "value": "team" } }, { "kind": "Field", "name": { "kind": "Name", "value": "capacity" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceTypes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "softTokenUsageLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hardTokenUsageLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "canAddReport" } }, { "kind": "Field", "name": { "kind": "Name", "value": "canUseApi" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxStructuredSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxUnstructuredSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "deepAnalysisTokenLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "deepAnalysisCharacterLimit" } }] } }] } }] };
33
- var SubscriptionEntitlementsForManagerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "SubscriptionEntitlementsForManager" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "subscriptionEntitlementsForManager" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "workspaceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "canAddUser" } }, { "kind": "Field", "name": { "kind": "Name", "value": "minUsers" } }, { "kind": "Field", "name": { "kind": "Name", "value": "team" } }, { "kind": "Field", "name": { "kind": "Name", "value": "capacity" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceTypes" } }, { "kind": "Field", "name": { "kind": "Name", "value": "softTokenUsageLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "hardTokenUsageLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "canAddReport" } }, { "kind": "Field", "name": { "kind": "Name", "value": "canUseApi" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxStructuredSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "maxUnstructuredSize" } }, { "kind": "Field", "name": { "kind": "Name", "value": "deepAnalysisTokenLimit" } }, { "kind": "Field", "name": { "kind": "Name", "value": "deepAnalysisCharacterLimit" } }] } }] } }] };
34
- var ProrationAmountDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ProrationAmount" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "targetPriceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "prorationAmount" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "targetPriceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "targetPriceId" } } }] }] } }] };
35
- var UpgradePlanDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpgradePlan" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "targetPriceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "upgradePlan" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "targetPriceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "targetPriceId" } } }] }] } }] };
36
- var DowngradePlanDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DowngradePlan" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "targetPriceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "downgradePlan" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "targetPriceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "targetPriceId" } } }] }] } }] };
37
- var AddSeatsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "AddSeats" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "additionalSeats" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "addSeats" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "additionalSeats" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "additionalSeats" } } }] }] } }] };
38
- var ChangeBillingCycleDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "ChangeBillingCycle" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "targetPriceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "changeBillingCycle" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "targetPriceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "targetPriceId" } } }] }] } }] };
39
- var RemoveSeatsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "RemoveSeats" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "seatsToRemove" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "removeSeats" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "seatsToRemove" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "seatsToRemove" } } }] }] } }] };
40
- var CancelSubscriptionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CancelSubscription" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "cancelSubscription" } }] } }] };
41
- var ReactivateSubscriptionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "ReactivateSubscription" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "reactivateSubscription" } }] } }] };
42
- var CancelSubscriptionForManagerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CancelSubscriptionForManager" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "cancelSubscriptionForManager" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "workspaceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } } }] }] } }] };
43
- var ReactivateSubscriptionForManagerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "ReactivateSubscriptionForManager" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "reactivateSubscriptionForManager" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "workspaceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } } }] }] } }] };
44
- var CreateCustomerDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateCustomer" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "name" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "email" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createCustomer" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "name" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "name" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "email" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "email" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "workspaceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "workspaceId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "userId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "userId" } } }] }] } }] };
45
- var ReleaseScheduleDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "ReleaseSchedule" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "releaseSchedule" } }] } }] };
46
- var CreateCheckoutSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateCheckoutSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "priceId" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "successUrl" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "cancelUrl" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createCheckoutSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "priceId" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "priceId" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "successUrl" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "successUrl" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "cancelUrl" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "cancelUrl" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "url" } }] } }] } }] };
47
- var CreateCustomerPortalSessionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateCustomerPortalSession" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "returnUrl" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createCustomerPortalSession" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "returnUrl" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "returnUrl" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "url" } }] } }] } }] };
48
-
49
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/devAssert.mjs
50
- function devAssert(condition, message) {
51
- const booleanCondition = Boolean(condition);
52
- if (!booleanCondition) {
53
- throw new Error(message);
54
- }
55
- }
56
-
57
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/ast.mjs
58
- var QueryDocumentKeys = {
59
- Name: [],
60
- Document: ["definitions"],
61
- OperationDefinition: [
62
- "name",
63
- "variableDefinitions",
64
- "directives",
65
- "selectionSet"
66
- ],
67
- VariableDefinition: ["variable", "type", "defaultValue", "directives"],
68
- Variable: ["name"],
69
- SelectionSet: ["selections"],
70
- Field: ["alias", "name", "arguments", "directives", "selectionSet"],
71
- Argument: ["name", "value"],
72
- FragmentSpread: ["name", "directives"],
73
- InlineFragment: ["typeCondition", "directives", "selectionSet"],
74
- FragmentDefinition: [
75
- "name",
76
- // Note: fragment variable definitions are deprecated and will removed in v17.0.0
77
- "variableDefinitions",
78
- "typeCondition",
79
- "directives",
80
- "selectionSet"
81
- ],
82
- IntValue: [],
83
- FloatValue: [],
84
- StringValue: [],
85
- BooleanValue: [],
86
- NullValue: [],
87
- EnumValue: [],
88
- ListValue: ["values"],
89
- ObjectValue: ["fields"],
90
- ObjectField: ["name", "value"],
91
- Directive: ["name", "arguments"],
92
- NamedType: ["name"],
93
- ListType: ["type"],
94
- NonNullType: ["type"],
95
- SchemaDefinition: ["description", "directives", "operationTypes"],
96
- OperationTypeDefinition: ["type"],
97
- ScalarTypeDefinition: ["description", "name", "directives"],
98
- ObjectTypeDefinition: [
99
- "description",
100
- "name",
101
- "interfaces",
102
- "directives",
103
- "fields"
104
- ],
105
- FieldDefinition: ["description", "name", "arguments", "type", "directives"],
106
- InputValueDefinition: [
107
- "description",
108
- "name",
109
- "type",
110
- "defaultValue",
111
- "directives"
112
- ],
113
- InterfaceTypeDefinition: [
114
- "description",
115
- "name",
116
- "interfaces",
117
- "directives",
118
- "fields"
119
- ],
120
- UnionTypeDefinition: ["description", "name", "directives", "types"],
121
- EnumTypeDefinition: ["description", "name", "directives", "values"],
122
- EnumValueDefinition: ["description", "name", "directives"],
123
- InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
124
- DirectiveDefinition: ["description", "name", "arguments", "locations"],
125
- SchemaExtension: ["directives", "operationTypes"],
126
- ScalarTypeExtension: ["name", "directives"],
127
- ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
128
- InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
129
- UnionTypeExtension: ["name", "directives", "types"],
130
- EnumTypeExtension: ["name", "directives", "values"],
131
- InputObjectTypeExtension: ["name", "directives", "fields"]
132
- };
133
- var kindValues = new Set(Object.keys(QueryDocumentKeys));
134
- function isNode(maybeNode) {
135
- const maybeKind = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind;
136
- return typeof maybeKind === "string" && kindValues.has(maybeKind);
137
- }
138
- var OperationTypeNode;
139
- (function(OperationTypeNode2) {
140
- OperationTypeNode2["QUERY"] = "query";
141
- OperationTypeNode2["MUTATION"] = "mutation";
142
- OperationTypeNode2["SUBSCRIPTION"] = "subscription";
143
- })(OperationTypeNode || (OperationTypeNode = {}));
144
-
145
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/kinds.mjs
146
- exports.Kind = void 0;
147
- (function(Kind2) {
148
- Kind2["NAME"] = "Name";
149
- Kind2["DOCUMENT"] = "Document";
150
- Kind2["OPERATION_DEFINITION"] = "OperationDefinition";
151
- Kind2["VARIABLE_DEFINITION"] = "VariableDefinition";
152
- Kind2["SELECTION_SET"] = "SelectionSet";
153
- Kind2["FIELD"] = "Field";
154
- Kind2["ARGUMENT"] = "Argument";
155
- Kind2["FRAGMENT_SPREAD"] = "FragmentSpread";
156
- Kind2["INLINE_FRAGMENT"] = "InlineFragment";
157
- Kind2["FRAGMENT_DEFINITION"] = "FragmentDefinition";
158
- Kind2["VARIABLE"] = "Variable";
159
- Kind2["INT"] = "IntValue";
160
- Kind2["FLOAT"] = "FloatValue";
161
- Kind2["STRING"] = "StringValue";
162
- Kind2["BOOLEAN"] = "BooleanValue";
163
- Kind2["NULL"] = "NullValue";
164
- Kind2["ENUM"] = "EnumValue";
165
- Kind2["LIST"] = "ListValue";
166
- Kind2["OBJECT"] = "ObjectValue";
167
- Kind2["OBJECT_FIELD"] = "ObjectField";
168
- Kind2["DIRECTIVE"] = "Directive";
169
- Kind2["NAMED_TYPE"] = "NamedType";
170
- Kind2["LIST_TYPE"] = "ListType";
171
- Kind2["NON_NULL_TYPE"] = "NonNullType";
172
- Kind2["SCHEMA_DEFINITION"] = "SchemaDefinition";
173
- Kind2["OPERATION_TYPE_DEFINITION"] = "OperationTypeDefinition";
174
- Kind2["SCALAR_TYPE_DEFINITION"] = "ScalarTypeDefinition";
175
- Kind2["OBJECT_TYPE_DEFINITION"] = "ObjectTypeDefinition";
176
- Kind2["FIELD_DEFINITION"] = "FieldDefinition";
177
- Kind2["INPUT_VALUE_DEFINITION"] = "InputValueDefinition";
178
- Kind2["INTERFACE_TYPE_DEFINITION"] = "InterfaceTypeDefinition";
179
- Kind2["UNION_TYPE_DEFINITION"] = "UnionTypeDefinition";
180
- Kind2["ENUM_TYPE_DEFINITION"] = "EnumTypeDefinition";
181
- Kind2["ENUM_VALUE_DEFINITION"] = "EnumValueDefinition";
182
- Kind2["INPUT_OBJECT_TYPE_DEFINITION"] = "InputObjectTypeDefinition";
183
- Kind2["DIRECTIVE_DEFINITION"] = "DirectiveDefinition";
184
- Kind2["SCHEMA_EXTENSION"] = "SchemaExtension";
185
- Kind2["SCALAR_TYPE_EXTENSION"] = "ScalarTypeExtension";
186
- Kind2["OBJECT_TYPE_EXTENSION"] = "ObjectTypeExtension";
187
- Kind2["INTERFACE_TYPE_EXTENSION"] = "InterfaceTypeExtension";
188
- Kind2["UNION_TYPE_EXTENSION"] = "UnionTypeExtension";
189
- Kind2["ENUM_TYPE_EXTENSION"] = "EnumTypeExtension";
190
- Kind2["INPUT_OBJECT_TYPE_EXTENSION"] = "InputObjectTypeExtension";
191
- })(exports.Kind || (exports.Kind = {}));
192
-
193
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/characterClasses.mjs
194
- function isWhiteSpace(code) {
195
- return code === 9 || code === 32;
196
- }
197
-
198
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/blockString.mjs
199
- function printBlockString(value, options) {
200
- const escapedValue = value.replace(/"""/g, '\\"""');
201
- const lines = escapedValue.split(/\r\n|[\n\r]/g);
202
- const isSingleLine = lines.length === 1;
203
- const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0)));
204
- const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""');
205
- const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes;
206
- const hasTrailingSlash = value.endsWith("\\");
207
- const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;
208
- const printAsMultipleLines = // add leading and trailing new lines only if it improves readability
209
- (!isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes);
210
- let result = "";
211
- const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));
212
- if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) {
213
- result += "\n";
214
- }
215
- result += escapedValue;
216
- if (printAsMultipleLines || forceTrailingNewline) {
217
- result += "\n";
218
- }
219
- return '"""' + result + '"""';
220
- }
221
-
222
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/inspect.mjs
223
- var MAX_ARRAY_LENGTH = 10;
224
- var MAX_RECURSIVE_DEPTH = 2;
225
- function inspect(value) {
226
- return formatValue(value, []);
227
- }
228
- function formatValue(value, seenValues) {
229
- switch (typeof value) {
230
- case "string":
231
- return JSON.stringify(value);
232
- case "function":
233
- return value.name ? `[function ${value.name}]` : "[function]";
234
- case "object":
235
- return formatObjectValue(value, seenValues);
236
- default:
237
- return String(value);
238
- }
239
- }
240
- function formatObjectValue(value, previouslySeenValues) {
241
- if (value === null) {
242
- return "null";
243
- }
244
- if (previouslySeenValues.includes(value)) {
245
- return "[Circular]";
246
- }
247
- const seenValues = [...previouslySeenValues, value];
248
- if (isJSONable(value)) {
249
- const jsonValue = value.toJSON();
250
- if (jsonValue !== value) {
251
- return typeof jsonValue === "string" ? jsonValue : formatValue(jsonValue, seenValues);
252
- }
253
- } else if (Array.isArray(value)) {
254
- return formatArray(value, seenValues);
255
- }
256
- return formatObject(value, seenValues);
257
- }
258
- function isJSONable(value) {
259
- return typeof value.toJSON === "function";
260
- }
261
- function formatObject(object, seenValues) {
262
- const entries = Object.entries(object);
263
- if (entries.length === 0) {
264
- return "{}";
265
- }
266
- if (seenValues.length > MAX_RECURSIVE_DEPTH) {
267
- return "[" + getObjectTag(object) + "]";
268
- }
269
- const properties = entries.map(
270
- ([key, value]) => key + ": " + formatValue(value, seenValues)
271
- );
272
- return "{ " + properties.join(", ") + " }";
273
- }
274
- function formatArray(array, seenValues) {
275
- if (array.length === 0) {
276
- return "[]";
277
- }
278
- if (seenValues.length > MAX_RECURSIVE_DEPTH) {
279
- return "[Array]";
280
- }
281
- const len = Math.min(MAX_ARRAY_LENGTH, array.length);
282
- const remaining = array.length - len;
283
- const items = [];
284
- for (let i = 0; i < len; ++i) {
285
- items.push(formatValue(array[i], seenValues));
286
- }
287
- if (remaining === 1) {
288
- items.push("... 1 more item");
289
- } else if (remaining > 1) {
290
- items.push(`... ${remaining} more items`);
291
- }
292
- return "[" + items.join(", ") + "]";
293
- }
294
- function getObjectTag(object) {
295
- const tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
296
- if (tag === "Object" && typeof object.constructor === "function") {
297
- const name = object.constructor.name;
298
- if (typeof name === "string" && name !== "") {
299
- return name;
300
- }
301
- }
302
- return tag;
303
- }
304
-
305
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printString.mjs
306
- function printString(str) {
307
- return `"${str.replace(escapedRegExp, escapedReplacer)}"`;
308
- }
309
- var escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
310
- function escapedReplacer(str) {
311
- return escapeSequences[str.charCodeAt(0)];
312
- }
313
- var escapeSequences = [
314
- "\\u0000",
315
- "\\u0001",
316
- "\\u0002",
317
- "\\u0003",
318
- "\\u0004",
319
- "\\u0005",
320
- "\\u0006",
321
- "\\u0007",
322
- "\\b",
323
- "\\t",
324
- "\\n",
325
- "\\u000B",
326
- "\\f",
327
- "\\r",
328
- "\\u000E",
329
- "\\u000F",
330
- "\\u0010",
331
- "\\u0011",
332
- "\\u0012",
333
- "\\u0013",
334
- "\\u0014",
335
- "\\u0015",
336
- "\\u0016",
337
- "\\u0017",
338
- "\\u0018",
339
- "\\u0019",
340
- "\\u001A",
341
- "\\u001B",
342
- "\\u001C",
343
- "\\u001D",
344
- "\\u001E",
345
- "\\u001F",
346
- "",
347
- "",
348
- '\\"',
349
- "",
350
- "",
351
- "",
352
- "",
353
- "",
354
- "",
355
- "",
356
- "",
357
- "",
358
- "",
359
- "",
360
- "",
361
- "",
362
- // 2F
363
- "",
364
- "",
365
- "",
366
- "",
367
- "",
368
- "",
369
- "",
370
- "",
371
- "",
372
- "",
373
- "",
374
- "",
375
- "",
376
- "",
377
- "",
378
- "",
379
- // 3F
380
- "",
381
- "",
382
- "",
383
- "",
384
- "",
385
- "",
386
- "",
387
- "",
388
- "",
389
- "",
390
- "",
391
- "",
392
- "",
393
- "",
394
- "",
395
- "",
396
- // 4F
397
- "",
398
- "",
399
- "",
400
- "",
401
- "",
402
- "",
403
- "",
404
- "",
405
- "",
406
- "",
407
- "",
408
- "",
409
- "\\\\",
410
- "",
411
- "",
412
- "",
413
- // 5F
414
- "",
415
- "",
416
- "",
417
- "",
418
- "",
419
- "",
420
- "",
421
- "",
422
- "",
423
- "",
424
- "",
425
- "",
426
- "",
427
- "",
428
- "",
429
- "",
430
- // 6F
431
- "",
432
- "",
433
- "",
434
- "",
435
- "",
436
- "",
437
- "",
438
- "",
439
- "",
440
- "",
441
- "",
442
- "",
443
- "",
444
- "",
445
- "",
446
- "\\u007F",
447
- "\\u0080",
448
- "\\u0081",
449
- "\\u0082",
450
- "\\u0083",
451
- "\\u0084",
452
- "\\u0085",
453
- "\\u0086",
454
- "\\u0087",
455
- "\\u0088",
456
- "\\u0089",
457
- "\\u008A",
458
- "\\u008B",
459
- "\\u008C",
460
- "\\u008D",
461
- "\\u008E",
462
- "\\u008F",
463
- "\\u0090",
464
- "\\u0091",
465
- "\\u0092",
466
- "\\u0093",
467
- "\\u0094",
468
- "\\u0095",
469
- "\\u0096",
470
- "\\u0097",
471
- "\\u0098",
472
- "\\u0099",
473
- "\\u009A",
474
- "\\u009B",
475
- "\\u009C",
476
- "\\u009D",
477
- "\\u009E",
478
- "\\u009F"
479
- ];
480
-
481
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/visitor.mjs
482
- var BREAK = Object.freeze({});
483
- function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
484
- const enterLeaveMap = /* @__PURE__ */ new Map();
485
- for (const kind of Object.values(exports.Kind)) {
486
- enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));
487
- }
488
- let stack = void 0;
489
- let inArray = Array.isArray(root);
490
- let keys = [root];
491
- let index = -1;
492
- let edits = [];
493
- let node = root;
494
- let key = void 0;
495
- let parent = void 0;
496
- const path = [];
497
- const ancestors = [];
498
- do {
499
- index++;
500
- const isLeaving = index === keys.length;
501
- const isEdited = isLeaving && edits.length !== 0;
502
- if (isLeaving) {
503
- key = ancestors.length === 0 ? void 0 : path[path.length - 1];
504
- node = parent;
505
- parent = ancestors.pop();
506
- if (isEdited) {
507
- if (inArray) {
508
- node = node.slice();
509
- let editOffset = 0;
510
- for (const [editKey, editValue] of edits) {
511
- const arrayKey = editKey - editOffset;
512
- if (editValue === null) {
513
- node.splice(arrayKey, 1);
514
- editOffset++;
515
- } else {
516
- node[arrayKey] = editValue;
517
- }
518
- }
519
- } else {
520
- node = Object.defineProperties(
521
- {},
522
- Object.getOwnPropertyDescriptors(node)
523
- );
524
- for (const [editKey, editValue] of edits) {
525
- node[editKey] = editValue;
526
- }
527
- }
528
- }
529
- index = stack.index;
530
- keys = stack.keys;
531
- edits = stack.edits;
532
- inArray = stack.inArray;
533
- stack = stack.prev;
534
- } else if (parent) {
535
- key = inArray ? index : keys[index];
536
- node = parent[key];
537
- if (node === null || node === void 0) {
538
- continue;
539
- }
540
- path.push(key);
541
- }
542
- let result;
543
- if (!Array.isArray(node)) {
544
- var _enterLeaveMap$get, _enterLeaveMap$get2;
545
- isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);
546
- const visitFn = isLeaving ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get === void 0 ? void 0 : _enterLeaveMap$get.leave : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null || _enterLeaveMap$get2 === void 0 ? void 0 : _enterLeaveMap$get2.enter;
547
- result = visitFn === null || visitFn === void 0 ? void 0 : visitFn.call(visitor, node, key, parent, path, ancestors);
548
- if (result === BREAK) {
549
- break;
550
- }
551
- if (result === false) {
552
- if (!isLeaving) {
553
- path.pop();
554
- continue;
555
- }
556
- } else if (result !== void 0) {
557
- edits.push([key, result]);
558
- if (!isLeaving) {
559
- if (isNode(result)) {
560
- node = result;
561
- } else {
562
- path.pop();
563
- continue;
564
- }
565
- }
566
- }
567
- }
568
- if (result === void 0 && isEdited) {
569
- edits.push([key, node]);
570
- }
571
- if (isLeaving) {
572
- path.pop();
573
- } else {
574
- var _node$kind;
575
- stack = {
576
- inArray,
577
- index,
578
- keys,
579
- edits,
580
- prev: stack
581
- };
582
- inArray = Array.isArray(node);
583
- keys = inArray ? node : (_node$kind = visitorKeys[node.kind]) !== null && _node$kind !== void 0 ? _node$kind : [];
584
- index = -1;
585
- edits = [];
586
- if (parent) {
587
- ancestors.push(parent);
588
- }
589
- parent = node;
590
- }
591
- } while (stack !== void 0);
592
- if (edits.length !== 0) {
593
- return edits[edits.length - 1][1];
594
- }
595
- return root;
596
- }
597
- function getEnterLeaveForKind(visitor, kind) {
598
- const kindVisitor = visitor[kind];
599
- if (typeof kindVisitor === "object") {
600
- return kindVisitor;
601
- } else if (typeof kindVisitor === "function") {
602
- return {
603
- enter: kindVisitor,
604
- leave: void 0
605
- };
606
- }
607
- return {
608
- enter: visitor.enter,
609
- leave: visitor.leave
610
- };
611
- }
612
-
613
- // ../../node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/language/printer.mjs
614
- function print(ast) {
615
- return visit(ast, printDocASTReducer);
616
- }
617
- var MAX_LINE_LENGTH = 80;
618
- var printDocASTReducer = {
619
- Name: {
620
- leave: (node) => node.value
621
- },
622
- Variable: {
623
- leave: (node) => "$" + node.name
624
- },
625
- // Document
626
- Document: {
627
- leave: (node) => join(node.definitions, "\n\n")
628
- },
629
- OperationDefinition: {
630
- leave(node) {
631
- const varDefs = wrap("(", join(node.variableDefinitions, ", "), ")");
632
- const prefix = join(
633
- [
634
- node.operation,
635
- join([node.name, varDefs]),
636
- join(node.directives, " ")
637
- ],
638
- " "
639
- );
640
- return (prefix === "query" ? "" : prefix + " ") + node.selectionSet;
641
- }
642
- },
643
- VariableDefinition: {
644
- leave: ({ variable, type, defaultValue, directives }) => variable + ": " + type + wrap(" = ", defaultValue) + wrap(" ", join(directives, " "))
645
- },
646
- SelectionSet: {
647
- leave: ({ selections }) => block(selections)
648
- },
649
- Field: {
650
- leave({ alias, name, arguments: args, directives, selectionSet }) {
651
- const prefix = wrap("", alias, ": ") + name;
652
- let argsLine = prefix + wrap("(", join(args, ", "), ")");
653
- if (argsLine.length > MAX_LINE_LENGTH) {
654
- argsLine = prefix + wrap("(\n", indent(join(args, "\n")), "\n)");
655
- }
656
- return join([argsLine, join(directives, " "), selectionSet], " ");
657
- }
658
- },
659
- Argument: {
660
- leave: ({ name, value }) => name + ": " + value
661
- },
662
- // Fragments
663
- FragmentSpread: {
664
- leave: ({ name, directives }) => "..." + name + wrap(" ", join(directives, " "))
665
- },
666
- InlineFragment: {
667
- leave: ({ typeCondition, directives, selectionSet }) => join(
668
- [
669
- "...",
670
- wrap("on ", typeCondition),
671
- join(directives, " "),
672
- selectionSet
673
- ],
674
- " "
675
- )
676
- },
677
- FragmentDefinition: {
678
- leave: ({ name, typeCondition, variableDefinitions, directives, selectionSet }) => (
679
- // or removed in the future.
680
- `fragment ${name}${wrap("(", join(variableDefinitions, ", "), ")")} on ${typeCondition} ${wrap("", join(directives, " "), " ")}` + selectionSet
681
- )
682
- },
683
- // Value
684
- IntValue: {
685
- leave: ({ value }) => value
686
- },
687
- FloatValue: {
688
- leave: ({ value }) => value
689
- },
690
- StringValue: {
691
- leave: ({ value, block: isBlockString }) => isBlockString ? printBlockString(value) : printString(value)
692
- },
693
- BooleanValue: {
694
- leave: ({ value }) => value ? "true" : "false"
695
- },
696
- NullValue: {
697
- leave: () => "null"
698
- },
699
- EnumValue: {
700
- leave: ({ value }) => value
701
- },
702
- ListValue: {
703
- leave: ({ values }) => "[" + join(values, ", ") + "]"
704
- },
705
- ObjectValue: {
706
- leave: ({ fields }) => "{" + join(fields, ", ") + "}"
707
- },
708
- ObjectField: {
709
- leave: ({ name, value }) => name + ": " + value
710
- },
711
- // Directive
712
- Directive: {
713
- leave: ({ name, arguments: args }) => "@" + name + wrap("(", join(args, ", "), ")")
714
- },
715
- // Type
716
- NamedType: {
717
- leave: ({ name }) => name
718
- },
719
- ListType: {
720
- leave: ({ type }) => "[" + type + "]"
721
- },
722
- NonNullType: {
723
- leave: ({ type }) => type + "!"
724
- },
725
- // Type System Definitions
726
- SchemaDefinition: {
727
- leave: ({ description, directives, operationTypes }) => wrap("", description, "\n") + join(["schema", join(directives, " "), block(operationTypes)], " ")
728
- },
729
- OperationTypeDefinition: {
730
- leave: ({ operation, type }) => operation + ": " + type
731
- },
732
- ScalarTypeDefinition: {
733
- leave: ({ description, name, directives }) => wrap("", description, "\n") + join(["scalar", name, join(directives, " ")], " ")
734
- },
735
- ObjectTypeDefinition: {
736
- leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join(
737
- [
738
- "type",
739
- name,
740
- wrap("implements ", join(interfaces, " & ")),
741
- join(directives, " "),
742
- block(fields)
743
- ],
744
- " "
745
- )
746
- },
747
- FieldDefinition: {
748
- leave: ({ description, name, arguments: args, type, directives }) => wrap("", description, "\n") + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + ": " + type + wrap(" ", join(directives, " "))
749
- },
750
- InputValueDefinition: {
751
- leave: ({ description, name, type, defaultValue, directives }) => wrap("", description, "\n") + join(
752
- [name + ": " + type, wrap("= ", defaultValue), join(directives, " ")],
753
- " "
754
- )
755
- },
756
- InterfaceTypeDefinition: {
757
- leave: ({ description, name, interfaces, directives, fields }) => wrap("", description, "\n") + join(
758
- [
759
- "interface",
760
- name,
761
- wrap("implements ", join(interfaces, " & ")),
762
- join(directives, " "),
763
- block(fields)
764
- ],
765
- " "
766
- )
767
- },
768
- UnionTypeDefinition: {
769
- leave: ({ description, name, directives, types }) => wrap("", description, "\n") + join(
770
- ["union", name, join(directives, " "), wrap("= ", join(types, " | "))],
771
- " "
772
- )
773
- },
774
- EnumTypeDefinition: {
775
- leave: ({ description, name, directives, values }) => wrap("", description, "\n") + join(["enum", name, join(directives, " "), block(values)], " ")
776
- },
777
- EnumValueDefinition: {
778
- leave: ({ description, name, directives }) => wrap("", description, "\n") + join([name, join(directives, " ")], " ")
779
- },
780
- InputObjectTypeDefinition: {
781
- leave: ({ description, name, directives, fields }) => wrap("", description, "\n") + join(["input", name, join(directives, " "), block(fields)], " ")
782
- },
783
- DirectiveDefinition: {
784
- leave: ({ description, name, arguments: args, repeatable, locations }) => wrap("", description, "\n") + "directive @" + name + (hasMultilineItems(args) ? wrap("(\n", indent(join(args, "\n")), "\n)") : wrap("(", join(args, ", "), ")")) + (repeatable ? " repeatable" : "") + " on " + join(locations, " | ")
785
- },
786
- SchemaExtension: {
787
- leave: ({ directives, operationTypes }) => join(
788
- ["extend schema", join(directives, " "), block(operationTypes)],
789
- " "
790
- )
791
- },
792
- ScalarTypeExtension: {
793
- leave: ({ name, directives }) => join(["extend scalar", name, join(directives, " ")], " ")
794
- },
795
- ObjectTypeExtension: {
796
- leave: ({ name, interfaces, directives, fields }) => join(
797
- [
798
- "extend type",
799
- name,
800
- wrap("implements ", join(interfaces, " & ")),
801
- join(directives, " "),
802
- block(fields)
803
- ],
804
- " "
805
- )
806
- },
807
- InterfaceTypeExtension: {
808
- leave: ({ name, interfaces, directives, fields }) => join(
809
- [
810
- "extend interface",
811
- name,
812
- wrap("implements ", join(interfaces, " & ")),
813
- join(directives, " "),
814
- block(fields)
815
- ],
816
- " "
817
- )
818
- },
819
- UnionTypeExtension: {
820
- leave: ({ name, directives, types }) => join(
821
- [
822
- "extend union",
823
- name,
824
- join(directives, " "),
825
- wrap("= ", join(types, " | "))
826
- ],
827
- " "
828
- )
829
- },
830
- EnumTypeExtension: {
831
- leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
832
- },
833
- InputObjectTypeExtension: {
834
- leave: ({ name, directives, fields }) => join(["extend input", name, join(directives, " "), block(fields)], " ")
835
- }
836
- };
837
- function join(maybeArray, separator = "") {
838
- var _maybeArray$filter$jo;
839
- return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter((x) => x).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : "";
840
- }
841
- function block(array) {
842
- return wrap("{\n", indent(join(array, "\n")), "\n}");
843
- }
844
- function wrap(start, maybeString, end = "") {
845
- return maybeString != null && maybeString !== "" ? start + maybeString + end : "";
846
- }
847
- function indent(str) {
848
- return wrap(" ", str.replace(/\n/g, "\n "));
849
- }
850
- function hasMultilineItems(maybeArray) {
851
- var _maybeArray$some;
852
- return (_maybeArray$some = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.some((str) => str.includes("\n"))) !== null && _maybeArray$some !== void 0 ? _maybeArray$some : false;
853
- }
854
-
855
- // src/transport/core/token-refresh.ts
856
- var inFlightRefreshes = /* @__PURE__ */ new WeakMap();
857
- async function refreshTokenSingleFlight(getToken, failedToken) {
858
- let inFlight = inFlightRefreshes.get(getToken);
859
- if (!inFlight) {
860
- const refreshPromise = getToken({ forceRefresh: true }).finally(() => {
861
- if (inFlightRefreshes.get(getToken) === refreshPromise) {
862
- inFlightRefreshes.delete(getToken);
863
- }
864
- });
865
- inFlightRefreshes.set(getToken, refreshPromise);
866
- inFlight = refreshPromise;
867
- }
868
- const refreshedToken = await inFlight;
869
- if (failedToken && refreshedToken === failedToken) {
870
- throw new chunkKV5SP7RP_cjs.DvinaAuthenticationError("Token refresh did not produce a new token", failedToken);
871
- }
872
- return refreshedToken;
873
- }
874
-
875
- // src/transport/http.ts
876
- var printCache = /* @__PURE__ */ new WeakMap();
877
- function printDocument(document) {
878
- let cached = printCache.get(document);
879
- if (!cached) {
880
- cached = print(document);
881
- printCache.set(document, cached);
882
- }
883
- return cached;
884
- }
885
- var NON_AUTH_CODES = /* @__PURE__ */ new Set([
886
- chunkKV5SP7RP_cjs.GRAPHQL_ERROR_CODES.SESSION_TOKEN_LIMIT_REACHED,
887
- chunkKV5SP7RP_cjs.GRAPHQL_ERROR_CODES.STORAGE_LIMIT_REACHED,
888
- chunkKV5SP7RP_cjs.GRAPHQL_ERROR_CODES.DEEP_ANALYSIS_LIMIT_EXCEEDED,
889
- chunkKV5SP7RP_cjs.GRAPHQL_ERROR_CODES.PLAN_DETAIL_RESTRICTION,
890
- chunkKV5SP7RP_cjs.GRAPHQL_ERROR_CODES.RESOURCE_NOT_FOUND
891
- ]);
892
- function isAuthError(errors, status) {
893
- if (errors) {
894
- for (const err of errors) {
895
- const rawCode = err.extensions?.["code"];
896
- if (rawCode === void 0 || rawCode === null) continue;
897
- if (rawCode === 4401 || rawCode === "4401") return true;
898
- const code = String(rawCode).toUpperCase();
899
- if (NON_AUTH_CODES.has(code)) return false;
900
- if (code === "UNAUTHORIZED" || code === "UNAUTHENTICATED" || err.message === "Unauthorized") {
901
- return true;
902
- }
903
- }
904
- }
905
- return false;
906
- }
907
- async function doFetch(options, document, variables) {
908
- const token = await options.getToken();
909
- const lang = options.getLanguage();
910
- const platform = options.getPlatform?.();
911
- const userTimezone = options.getUserTimezone?.();
912
- const headers = {
913
- "Content-Type": "application/json",
914
- Authorization: `Bearer ${token}`
915
- };
916
- if (lang) {
917
- headers["x-preferred-language"] = lang;
918
- }
919
- if (platform) {
920
- headers["x-platform"] = platform;
921
- }
922
- if (userTimezone) {
923
- headers["x-user-timezone"] = userTimezone;
924
- }
925
- const body = JSON.stringify({
926
- query: printDocument(document),
927
- variables
928
- });
929
- let response;
930
- try {
931
- response = await fetch(options.url, {
932
- method: "POST",
933
- headers,
934
- body
935
- });
936
- } catch (error) {
937
- if (error instanceof Error && error.name === "AbortError") {
938
- throw error;
939
- }
940
- throw new chunkKV5SP7RP_cjs.DvinaNetworkError(
941
- error instanceof Error ? error.message : "Network request failed before reaching the server",
942
- 0
943
- );
944
- }
945
- if (!response.ok) {
946
- if (response.status === 401 || response.status === 403) {
947
- throw new chunkKV5SP7RP_cjs.DvinaAuthenticationError(`Authentication failed with status ${response.status}`, token);
948
- }
949
- throw new chunkKV5SP7RP_cjs.DvinaNetworkError(`HTTP ${response.status}: ${response.statusText}`, response.status);
950
- }
951
- return { response: await response.json(), usedToken: token };
952
- }
953
- var MAX_RETRIES = 4;
954
- var RETRY_DELAY_MS = 1e3;
955
- function createHttpTransport(options) {
956
- async function requestWithRetry(document, variables, attempt = 0) {
957
- let fetchResult;
958
- try {
959
- fetchResult = await doFetch(options, document, variables);
960
- } catch (error) {
961
- if (error instanceof chunkKV5SP7RP_cjs.DvinaAuthenticationError) {
962
- return handleAuthRefresh(document, variables, options, error.failedToken);
963
- }
964
- if (error instanceof chunkKV5SP7RP_cjs.DvinaNetworkError && error.status === 0 && attempt < MAX_RETRIES) {
965
- await sleep(RETRY_DELAY_MS * (attempt + 1));
966
- return requestWithRetry(document, variables, attempt + 1);
967
- }
968
- if (error instanceof chunkKV5SP7RP_cjs.DvinaError) options.onError?.(error);
969
- throw error;
970
- }
971
- const { response: result, usedToken } = fetchResult;
972
- if (isAuthError(result.errors)) {
973
- return handleAuthRefresh(document, variables, options, usedToken);
974
- }
975
- if (result.errors?.length && !result.data) {
976
- const error = chunkKV5SP7RP_cjs.createGraphQLError(result.errors, printDocument(document), variables);
977
- options.onError?.(error);
978
- throw error;
979
- }
980
- if (!result.data) {
981
- const error = chunkKV5SP7RP_cjs.createGraphQLError(
982
- [{ message: "No data returned from server" }],
983
- printDocument(document),
984
- variables
985
- );
986
- options.onError?.(error);
987
- throw error;
988
- }
989
- return result.data;
990
- }
991
- return {
992
- request: (document, variables) => requestWithRetry(document, variables)
993
- };
994
- }
995
- async function handleAuthRefresh(document, variables, options, failedToken) {
996
- try {
997
- await refreshTokenSingleFlight(options.getToken, failedToken);
998
- } catch {
999
- const error = new chunkKV5SP7RP_cjs.DvinaAuthenticationError("Token refresh failed");
1000
- options.onError?.(error);
1001
- throw error;
1002
- }
1003
- return retryAfterRefresh(options, document, variables);
1004
- }
1005
- async function retryAfterRefresh(options, document, variables) {
1006
- const { response: result } = await doFetch(options, document, variables);
1007
- if (isAuthError(result.errors)) {
1008
- const error = new chunkKV5SP7RP_cjs.DvinaAuthenticationError("Authentication failed after token refresh");
1009
- options.onError?.(error);
1010
- throw error;
1011
- }
1012
- if (result.errors?.length && !result.data) {
1013
- const error = chunkKV5SP7RP_cjs.createGraphQLError(result.errors, printDocument(document), variables);
1014
- options.onError?.(error);
1015
- throw error;
1016
- }
1017
- return result.data;
1018
- }
1019
- function sleep(ms) {
1020
- return new Promise((resolve) => setTimeout(resolve, ms));
1021
- }
1022
-
1023
- // src/transport/core/connection-supervisor.ts
1024
- var DEFAULT_AUTH_RETRY_DELAY_MS = 1e3;
1025
- var DEFAULT_BASE_RECONNECT_DELAY_MS = 1e3;
1026
- var DEFAULT_MAX_CONSECUTIVE_AUTH_FAILURES = 3;
1027
- var DEFAULT_MAX_RECONNECT_DELAY_MS = 3e4;
1028
- function isAbortError(error) {
1029
- return error instanceof Error && error.name === "AbortError";
1030
- }
1031
- function now() {
1032
- return Date.now();
1033
- }
1034
- var ConnectionSupervisor = class {
1035
- constructor(options) {
1036
- this.options = options;
1037
- }
1038
- abortController;
1039
- abortReason;
1040
- attemptPromise;
1041
- closed = false;
1042
- consecutiveAuthFailures = 0;
1043
- forceRefreshNext = false;
1044
- lastActivityAt = null;
1045
- lastConnectedAt = null;
1046
- lastError;
1047
- reconnectAttempt = 0;
1048
- reconnectTimer;
1049
- restartAfterCurrentAttempt = false;
1050
- state = "idle";
1051
- staleTimer;
1052
- shouldRun = false;
1053
- get snapshot() {
1054
- return {
1055
- consecutiveAuthFailures: this.consecutiveAuthFailures,
1056
- id: this.options.id,
1057
- kind: this.options.kind,
1058
- lastActivityAt: this.lastActivityAt,
1059
- lastConnectedAt: this.lastConnectedAt,
1060
- lastError: this.lastError,
1061
- reconnectAttempt: this.reconnectAttempt,
1062
- state: this.state
1063
- };
1064
- }
1065
- async start() {
1066
- if (this.closed) {
1067
- throw new Error(`Connection '${this.options.kind}:${this.options.id}' is closed`);
1068
- }
1069
- this.shouldRun = true;
1070
- this.clearReconnectTimer();
1071
- if (this.attemptPromise && this.abortReason) {
1072
- this.restartAfterCurrentAttempt = true;
1073
- }
1074
- return this.ensureAttempt();
1075
- }
1076
- stop() {
1077
- this.shouldRun = false;
1078
- this.restartAfterCurrentAttempt = false;
1079
- this.clearReconnectTimer();
1080
- this.clearStaleTimer();
1081
- this.abort("manual");
1082
- this.setState("idle");
1083
- }
1084
- close() {
1085
- this.closed = true;
1086
- this.shouldRun = false;
1087
- this.restartAfterCurrentAttempt = false;
1088
- this.clearReconnectTimer();
1089
- this.clearStaleTimer();
1090
- this.abort("manual");
1091
- this.setState("closed");
1092
- }
1093
- reconnect() {
1094
- if (this.closed) {
1095
- return;
1096
- }
1097
- this.shouldRun = true;
1098
- this.clearReconnectTimer();
1099
- this.clearStaleTimer();
1100
- if (this.abortController) {
1101
- this.restartAfterCurrentAttempt = true;
1102
- this.abort("restart");
1103
- return;
1104
- }
1105
- void this.ensureAttempt();
1106
- }
1107
- ensureAttempt() {
1108
- if (!this.shouldRun || this.closed) {
1109
- return Promise.resolve();
1110
- }
1111
- if (!this.attemptPromise) {
1112
- const attemptPromise = this.runAttempt().finally(() => {
1113
- if (this.attemptPromise === attemptPromise) {
1114
- this.attemptPromise = void 0;
1115
- }
1116
- });
1117
- this.attemptPromise = attemptPromise;
1118
- }
1119
- return this.attemptPromise;
1120
- }
1121
- async runAttempt() {
1122
- if (!this.shouldRun || this.closed) {
1123
- return;
1124
- }
1125
- const isReconnect = this.lastConnectedAt !== null || this.reconnectAttempt > 0;
1126
- this.setState("connecting");
1127
- this.lastError = void 0;
1128
- this.abortReason = void 0;
1129
- const abortController = new AbortController();
1130
- this.abortController = abortController;
1131
- try {
1132
- const token = this.forceRefreshNext ? await refreshTokenSingleFlight(this.options.getToken) : await this.options.getToken(void 0);
1133
- this.forceRefreshNext = false;
1134
- await this.options.dial({
1135
- isReconnect,
1136
- markActivity: () => this.markActivity(),
1137
- markConnected: () => this.markConnected(),
1138
- requestTokenRefresh: () => {
1139
- this.forceRefreshNext = true;
1140
- },
1141
- signal: abortController.signal,
1142
- token
1143
- });
1144
- if (!this.shouldRun || this.closed) {
1145
- return;
1146
- }
1147
- this.scheduleReconnect("end");
1148
- } catch (error) {
1149
- if (isAbortError(error)) {
1150
- if (this.abortReason === "stale" && this.shouldRun && !this.closed) {
1151
- this.scheduleReconnect("end");
1152
- }
1153
- return;
1154
- }
1155
- if (!this.shouldRun || this.closed) {
1156
- return;
1157
- }
1158
- this.handleFailure(error);
1159
- } finally {
1160
- if (this.abortController === abortController) {
1161
- this.abortController = void 0;
1162
- }
1163
- this.abortReason = void 0;
1164
- if (this.restartAfterCurrentAttempt && this.shouldRun && !this.closed) {
1165
- this.restartAfterCurrentAttempt = false;
1166
- queueMicrotask(() => {
1167
- if (!this.closed && this.shouldRun) {
1168
- void this.ensureAttempt();
1169
- }
1170
- });
1171
- }
1172
- }
1173
- }
1174
- handleFailure(error) {
1175
- this.lastError = error;
1176
- if (error instanceof chunkKV5SP7RP_cjs.DvinaAuthenticationError) {
1177
- this.shouldRun = false;
1178
- this.clearReconnectTimer();
1179
- this.clearStaleTimer();
1180
- this.setState("failed");
1181
- this.options.onFatalError?.(error);
1182
- return;
1183
- }
1184
- const isAuthError2 = this.options.isAuthError?.(error) ?? false;
1185
- if (isAuthError2) {
1186
- this.consecutiveAuthFailures += 1;
1187
- this.forceRefreshNext = true;
1188
- this.setState("reconnecting");
1189
- if (this.consecutiveAuthFailures >= (this.options.maxConsecutiveAuthFailures ?? DEFAULT_MAX_CONSECUTIVE_AUTH_FAILURES)) {
1190
- this.shouldRun = false;
1191
- this.clearReconnectTimer();
1192
- this.clearStaleTimer();
1193
- this.setState("failed");
1194
- this.options.onFatalError?.(error);
1195
- return;
1196
- }
1197
- this.scheduleReconnect("auth");
1198
- return;
1199
- }
1200
- this.consecutiveAuthFailures = 0;
1201
- if (typeof navigator !== "undefined" && "onLine" in navigator && navigator.onLine === false) {
1202
- this.setState("offline");
1203
- } else {
1204
- this.setState("reconnecting");
1205
- }
1206
- this.scheduleReconnect("failure");
1207
- }
1208
- scheduleReconnect(reason) {
1209
- if (!this.shouldRun || this.closed) {
1210
- return;
1211
- }
1212
- this.clearReconnectTimer();
1213
- this.clearStaleTimer();
1214
- const delay = reason === "auth" ? this.options.authRetryDelayMs ?? DEFAULT_AUTH_RETRY_DELAY_MS : reason === "failure" ? this.nextReconnectDelay() : this.options.baseReconnectDelayMs ?? DEFAULT_BASE_RECONNECT_DELAY_MS;
1215
- this.reconnectTimer = setTimeout(() => {
1216
- this.reconnectTimer = void 0;
1217
- void this.ensureAttempt();
1218
- }, delay);
1219
- }
1220
- nextReconnectDelay() {
1221
- const baseDelay = this.options.baseReconnectDelayMs ?? DEFAULT_BASE_RECONNECT_DELAY_MS;
1222
- const maxDelay = this.options.maxReconnectDelayMs ?? DEFAULT_MAX_RECONNECT_DELAY_MS;
1223
- const cappedDelay = Math.min(baseDelay * Math.pow(2, this.reconnectAttempt), maxDelay);
1224
- this.reconnectAttempt += 1;
1225
- if (this.options.jitter === "full") {
1226
- return Math.floor(Math.random() * cappedDelay);
1227
- }
1228
- return cappedDelay;
1229
- }
1230
- markConnected() {
1231
- this.consecutiveAuthFailures = 0;
1232
- this.reconnectAttempt = 0;
1233
- this.lastConnectedAt = now();
1234
- this.setState("connected");
1235
- this.markActivity();
1236
- }
1237
- markActivity() {
1238
- this.lastActivityAt = now();
1239
- this.armStaleTimer();
1240
- }
1241
- armStaleTimer() {
1242
- this.clearStaleTimer();
1243
- const staleTimeoutMs = this.options.staleTimeoutMs;
1244
- if (!staleTimeoutMs || staleTimeoutMs <= 0 || this.state !== "connected") {
1245
- return;
1246
- }
1247
- this.staleTimer = setTimeout(() => {
1248
- if (!this.shouldRun || this.closed || !this.abortController) {
1249
- return;
1250
- }
1251
- this.setState("stale");
1252
- this.abort("stale");
1253
- }, staleTimeoutMs);
1254
- }
1255
- clearReconnectTimer() {
1256
- if (!this.reconnectTimer) {
1257
- return;
1258
- }
1259
- clearTimeout(this.reconnectTimer);
1260
- this.reconnectTimer = void 0;
1261
- }
1262
- clearStaleTimer() {
1263
- if (!this.staleTimer) {
1264
- return;
1265
- }
1266
- clearTimeout(this.staleTimer);
1267
- this.staleTimer = void 0;
1268
- }
1269
- abort(reason) {
1270
- if (!this.abortController) {
1271
- return;
1272
- }
1273
- this.abortReason = reason;
1274
- this.abortController.abort();
1275
- this.abortController = void 0;
1276
- }
1277
- setState(nextState) {
1278
- if (this.state === nextState) {
1279
- return;
1280
- }
1281
- this.state = nextState;
1282
- this.options.onStateChange?.(this.snapshot);
1283
- }
1284
- };
1285
-
1286
- // src/transport/core/sse-stream.ts
1287
- async function consumeSseStream(body, signal, handlers) {
1288
- const reader = body.getReader();
1289
- const decoder = new TextDecoder();
1290
- let buffer = "";
1291
- try {
1292
- while (!signal.aborted) {
1293
- const { done, value } = await reader.read();
1294
- if (done) {
1295
- break;
1296
- }
1297
- handlers.onChunk?.();
1298
- buffer += decoder.decode(value, { stream: true });
1299
- const parts = buffer.split(/(?:\r\n|\r|\n){2}/);
1300
- buffer = parts.pop() ?? "";
1301
- for (const part of parts) {
1302
- handlers.onEventBlock(part.trim());
1303
- }
1304
- }
1305
- } finally {
1306
- reader.releaseLock();
1307
- }
1308
- }
1309
-
1310
- // src/billing/client.ts
1311
- var INITIAL_RECONNECT_DELAY_MS = 1e3;
1312
- var MAX_RECONNECT_DELAY_MS = 3e4;
1313
- var MAX_CONSECUTIVE_AUTH_FAILURES = 3;
1314
- var STALE_CONNECTION_TIMEOUT_MS = 35e3;
1315
- var BillingAuthStreamError = class extends Error {
1316
- constructor(status) {
1317
- super(`Billing SSE auth failed: ${status}`);
1318
- this.status = status;
1319
- this.name = "BillingAuthStreamError";
1320
- }
1321
- };
1322
- var BillingSubscriptionStream = class {
1323
- constructor(options, onClose) {
1324
- this.options = options;
1325
- this.onClose = onClose;
1326
- this.supervisor = new ConnectionSupervisor({
1327
- authRetryDelayMs: INITIAL_RECONNECT_DELAY_MS,
1328
- baseReconnectDelayMs: INITIAL_RECONNECT_DELAY_MS,
1329
- getToken: options.getToken,
1330
- id: `billing-${Math.random().toString(36).slice(2)}`,
1331
- isAuthError: (error) => error instanceof BillingAuthStreamError,
1332
- kind: "billing-sse",
1333
- maxConsecutiveAuthFailures: MAX_CONSECUTIVE_AUTH_FAILURES,
1334
- maxReconnectDelayMs: MAX_RECONNECT_DELAY_MS,
1335
- onFatalError: () => {
1336
- this.options.onError?.(
1337
- new chunkKV5SP7RP_cjs.DvinaAuthenticationError("Billing SSE stream authentication failed permanently")
1338
- );
1339
- this.close();
1340
- },
1341
- staleTimeoutMs: STALE_CONNECTION_TIMEOUT_MS,
1342
- dial: async (context) => {
1343
- const response = await fetch(this.options.billingSseUrl, {
1344
- method: "GET",
1345
- headers: {
1346
- Authorization: `Bearer ${context.token}`,
1347
- Accept: "text/event-stream",
1348
- "Cache-Control": "no-cache"
1349
- },
1350
- signal: context.signal
1351
- });
1352
- if (!response.ok) {
1353
- if (response.status === 401 || response.status === 403) {
1354
- throw new BillingAuthStreamError(response.status);
1355
- }
1356
- throw new Error(`Billing SSE failed: ${response.status} ${response.statusText}`);
1357
- }
1358
- if (!response.body) {
1359
- throw new Error("Billing SSE response has no body");
1360
- }
1361
- context.markConnected();
1362
- await consumeSseStream(response.body, context.signal, {
1363
- onChunk: () => context.markActivity(),
1364
- onEventBlock: (block2) => this.processEventBlock(block2, context.requestTokenRefresh)
1365
- });
1366
- }
1367
- });
1368
- }
1369
- abortFinished = false;
1370
- queue = [];
1371
- pendingResolve = null;
1372
- supervisor;
1373
- start() {
1374
- void this.supervisor.start();
1375
- }
1376
- reconnect() {
1377
- if (this.abortFinished) {
1378
- return;
1379
- }
1380
- this.supervisor.reconnect();
1381
- }
1382
- next() {
1383
- if (this.queue.length > 0) {
1384
- return Promise.resolve({ value: this.queue.shift(), done: false });
1385
- }
1386
- if (this.abortFinished) {
1387
- return Promise.resolve({ value: void 0, done: true });
1388
- }
1389
- return new Promise((resolve) => {
1390
- this.pendingResolve = resolve;
1391
- });
1392
- }
1393
- return() {
1394
- this.close();
1395
- return Promise.resolve({ value: void 0, done: true });
1396
- }
1397
- [Symbol.asyncIterator]() {
1398
- return this;
1399
- }
1400
- close() {
1401
- if (this.abortFinished) {
1402
- return;
1403
- }
1404
- this.abortFinished = true;
1405
- this.supervisor.close();
1406
- if (this.pendingResolve) {
1407
- this.pendingResolve({ value: void 0, done: true });
1408
- this.pendingResolve = null;
1409
- }
1410
- this.onClose(this);
1411
- }
1412
- push(value) {
1413
- if (this.abortFinished) {
1414
- return;
1415
- }
1416
- if (this.pendingResolve) {
1417
- this.pendingResolve({ value, done: false });
1418
- this.pendingResolve = null;
1419
- return;
1420
- }
1421
- this.queue.length = 0;
1422
- this.queue.push(value);
1423
- }
1424
- processEventBlock(block2, requestTokenRefresh) {
1425
- if (!block2 || block2.startsWith(":")) {
1426
- return;
1427
- }
1428
- let eventType;
1429
- const dataLines = [];
1430
- for (const line of block2.split(/\r\n|\r|\n/)) {
1431
- if (line.startsWith("event: ")) {
1432
- eventType = line.slice(7).trim();
1433
- } else if (line.startsWith("data: ")) {
1434
- dataLines.push(line.slice(6));
1435
- }
1436
- }
1437
- if (eventType === "token-expired") {
1438
- requestTokenRefresh();
1439
- throw new BillingAuthStreamError(401);
1440
- }
1441
- if (eventType !== "subscription" || dataLines.length === 0) {
1442
- return;
1443
- }
1444
- try {
1445
- const parsed = JSON.parse(dataLines.join("\n"));
1446
- this.push(parsed);
1447
- } catch {
1448
- }
1449
- }
1450
- };
1451
- var BillingClient = class {
1452
- http;
1453
- options;
1454
- activeUpdateStreams = /* @__PURE__ */ new Set();
1455
- constructor(options) {
1456
- this.options = options;
1457
- this.http = createHttpTransport({
1458
- url: options.billingHttpUrl,
1459
- getToken: options.getToken,
1460
- getLanguage: () => void 0,
1461
- onError: options.onError
1462
- });
1463
- }
1464
- /**
1465
- * Terminate all active SSE streams.
1466
- * Call this on logout or SDK teardown to prevent lingering connections.
1467
- */
1468
- destroy() {
1469
- for (const stream of Array.from(this.activeUpdateStreams)) {
1470
- stream.close();
1471
- }
1472
- this.activeUpdateStreams.clear();
1473
- }
1474
- reconnectAll() {
1475
- for (const stream of this.activeUpdateStreams) {
1476
- stream.reconnect();
1477
- }
1478
- }
1479
- get plans() {
1480
- return {
1481
- list: async () => {
1482
- const result = await this.request(PlansDocument);
1483
- return result.plans;
1484
- },
1485
- get: async (variables) => {
1486
- const result = await this.request(PlanDocument, variables);
1487
- return result.plan;
1488
- },
1489
- entitlements: async () => {
1490
- const result = await this.request(EntitlementsDocument);
1491
- return result.entitlements;
1492
- },
1493
- tierOrders: async () => {
1494
- const result = await this.request(TierOrdersDocument);
1495
- return result.tierOrders;
1496
- }
1497
- };
1498
- }
1499
- get subscription() {
1500
- return {
1501
- get: async () => {
1502
- const result = await this.request(SubscriptionDocument);
1503
- return result.subscription;
1504
- },
1505
- entitlements: async () => {
1506
- const result = await this.request(SubscriptionEntitlementsDocument);
1507
- return result.subscriptionEntitlements;
1508
- },
1509
- upgrade: async (variables) => {
1510
- const result = await this.request(UpgradePlanDocument, variables);
1511
- return result.upgradePlan;
1512
- },
1513
- prorationAmount: async (variables) => {
1514
- const result = await this.request(ProrationAmountDocument, variables);
1515
- return result.prorationAmount;
1516
- },
1517
- downgrade: async (variables) => {
1518
- const result = await this.request(DowngradePlanDocument, variables);
1519
- return result.downgradePlan;
1520
- },
1521
- changeBillingCycle: async (variables) => {
1522
- const result = await this.request(ChangeBillingCycleDocument, variables);
1523
- return result.changeBillingCycle;
1524
- },
1525
- cancel: async () => {
1526
- const result = await this.request(CancelSubscriptionDocument);
1527
- return result.cancelSubscription;
1528
- },
1529
- reactivate: async () => {
1530
- const result = await this.request(ReactivateSubscriptionDocument);
1531
- return result.reactivateSubscription;
1532
- },
1533
- releaseSchedule: async () => {
1534
- const result = await this.request(ReleaseScheduleDocument);
1535
- return result.releaseSchedule;
1536
- },
1537
- updates: () => {
1538
- const stream = new BillingSubscriptionStream(this.options, (closedStream) => {
1539
- this.activeUpdateStreams.delete(closedStream);
1540
- });
1541
- this.activeUpdateStreams.add(stream);
1542
- stream.start();
1543
- return stream;
1544
- }
1545
- };
1546
- }
1547
- get seats() {
1548
- return {
1549
- add: async (variables) => {
1550
- const result = await this.request(AddSeatsDocument, variables);
1551
- return result.addSeats;
1552
- },
1553
- remove: async (variables) => {
1554
- const result = await this.request(RemoveSeatsDocument, variables);
1555
- return result.removeSeats;
1556
- }
1557
- };
1558
- }
1559
- get session() {
1560
- return {
1561
- createSession: async (variables) => {
1562
- const result = await this.request(CreateCheckoutSessionDocument, variables);
1563
- return result.createCheckoutSession;
1564
- },
1565
- createCustomerPortalSession: async (variables) => {
1566
- const result = await this.request(CreateCustomerPortalSessionDocument, variables);
1567
- return result.createCustomerPortalSession;
1568
- }
1569
- };
1570
- }
1571
- get management() {
1572
- return {
1573
- subscription: async (variables) => {
1574
- const result = await this.request(SubscriptionForManagerDocument, variables);
1575
- return result.subscriptionForManager;
1576
- },
1577
- entitlements: async (variables) => {
1578
- const result = await this.request(SubscriptionEntitlementsForManagerDocument, variables);
1579
- return result.subscriptionEntitlementsForManager;
1580
- },
1581
- cancel: async (variables) => {
1582
- const result = await this.request(CancelSubscriptionForManagerDocument, variables);
1583
- return result.cancelSubscriptionForManager;
1584
- },
1585
- reactivate: async (variables) => {
1586
- const result = await this.request(ReactivateSubscriptionForManagerDocument, variables);
1587
- return result.reactivateSubscriptionForManager;
1588
- },
1589
- createCustomer: async (variables) => {
1590
- const result = await this.request(CreateCustomerDocument, variables);
1591
- return result.createCustomer;
1592
- }
1593
- };
1594
- }
1595
- request(document, variables) {
1596
- return this.http.request(document, variables);
1597
- }
1598
- };
1599
-
1600
- exports.BillingClient = BillingClient;
1601
- exports.EntitlementTier = EntitlementTier;
1602
- exports.SubscriptionCycle = SubscriptionCycle;
1603
- exports.SubscriptionProvider = SubscriptionProvider;
1604
- exports.createHttpTransport = createHttpTransport;
1605
- exports.print = print;
1606
- exports.refreshTokenSingleFlight = refreshTokenSingleFlight;
1607
- //# sourceMappingURL=chunk-2J5WONKO.cjs.map
1608
- //# sourceMappingURL=chunk-2J5WONKO.cjs.map