@voltro/plugin-economy 0.87.0 → 0.88.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/CHANGELOG.md +169 -6
  2. package/THIRD-PARTY-NOTICES.md +741 -89
  3. package/dist/amount.js +1 -2
  4. package/dist/appleIap.server.js +1 -2
  5. package/dist/appleIapNotifications.server.js +1 -2
  6. package/dist/appleIapTrust.server.js +1 -2
  7. package/dist/bundleValue.server.js +1 -2
  8. package/dist/canonicalDataJson.js +1 -2
  9. package/dist/capture.js +1 -2
  10. package/dist/codePort.fixture.js +1 -2
  11. package/dist/codeStore.server.js +1 -2
  12. package/dist/codeTables.entity.js +1 -2
  13. package/dist/codes.js +1 -2
  14. package/dist/components.js +1 -2
  15. package/dist/consistency.server.js +1 -2
  16. package/dist/containerStore.server.js +1 -2
  17. package/dist/containerStore.testFixtures.js +1 -2
  18. package/dist/containerTables.entity.js +1 -2
  19. package/dist/containers.fixture.js +1 -2
  20. package/dist/containers.js +1 -2
  21. package/dist/containers.server.js +1 -2
  22. package/dist/containersPort.fixture.js +1 -2
  23. package/dist/currency.js +1 -2
  24. package/dist/declarationFixtures.js +1 -2
  25. package/dist/economyPort.fixture.js +1 -2
  26. package/dist/errors.js +1 -2
  27. package/dist/googleIap.server.js +1 -2
  28. package/dist/googleIapNotifications.server.js +1 -2
  29. package/dist/googleIapSubscription.server.js +1 -2
  30. package/dist/iap.js +1 -2
  31. package/dist/iap.testFixtures.js +1 -2
  32. package/dist/iapAccountTables.entity.js +1 -2
  33. package/dist/iapAccounts.server.js +1 -2
  34. package/dist/iapBinding.server.js +1 -2
  35. package/dist/iapCheckout.server.js +1 -2
  36. package/dist/iapCompletion.server.js +1 -2
  37. package/dist/iapCurrentState.server.js +1 -2
  38. package/dist/iapCurrentState.testFixtures.js +1 -2
  39. package/dist/iapCurrentStatePort.fixture.js +1 -2
  40. package/dist/iapEntitlements.js +1 -2
  41. package/dist/iapEntitlements.server.js +1 -2
  42. package/dist/iapEntitlementsBinding.server.js +1 -2
  43. package/dist/iapEntitlementsPort.fixture.js +1 -2
  44. package/dist/iapInstalledEntitlements.testFixtures.js +1 -2
  45. package/dist/iapInstalledNotifications.testFixtures.js +1 -2
  46. package/dist/iapInventoryRefunds.server.js +1 -2
  47. package/dist/iapNotificationCustodyPort.fixture.js +1 -2
  48. package/dist/iapNotificationPort.fixture.js +1 -2
  49. package/dist/iapNotificationProcessor.server.js +1 -2
  50. package/dist/iapNotificationProcessor.testFixtures.js +1 -2
  51. package/dist/iapNotificationProcessorPort.fixture.js +1 -2
  52. package/dist/iapNotificationSchedule.server.js +1 -2
  53. package/dist/iapNotificationStore.server.js +1 -2
  54. package/dist/iapNotificationStore.testFixtures.js +1 -2
  55. package/dist/iapNotificationTables.entity.js +1 -2
  56. package/dist/iapNotificationTarget.server.js +1 -2
  57. package/dist/iapNotificationTarget.testFixtures.js +1 -2
  58. package/dist/iapNotifications.server.js +1 -2
  59. package/dist/iapNotificationsBinding.server.js +1 -2
  60. package/dist/iapNotificationsSystemPort.fixture.js +1 -2
  61. package/dist/iapPlugin.testFixtures.js +1 -2
  62. package/dist/iapPort.fixture.js +1 -2
  63. package/dist/iapProviderCapture.server.js +1 -2
  64. package/dist/iapRecovery.js +1 -2
  65. package/dist/iapRefundEventDelivery.server.js +1 -2
  66. package/dist/iapRefundEvents.js +1 -2
  67. package/dist/iapRefundEventsPort.fixture.js +1 -2
  68. package/dist/iapRefundPort.fixture.js +1 -2
  69. package/dist/iapRefundTables.entity.js +1 -2
  70. package/dist/iapRefunds.server.js +1 -2
  71. package/dist/iapRefunds.testFixtures.js +1 -2
  72. package/dist/iapSpendAdmission.server.js +1 -2
  73. package/dist/iapStore.server.js +1 -2
  74. package/dist/iapStore.testFixtures.js +1 -2
  75. package/dist/iapTables.entity.js +1 -2
  76. package/dist/iapVerification.server.js +1 -2
  77. package/dist/intentionRecovery.js +1 -2
  78. package/dist/ledger.js +1 -2
  79. package/dist/loyalty.fixture.js +1 -2
  80. package/dist/loyalty.js +1 -2
  81. package/dist/loyaltyBinding.server.js +1 -2
  82. package/dist/loyaltyPort.fixture.js +1 -2
  83. package/dist/loyaltyShopSource.server.js +1 -2
  84. package/dist/loyaltyStore.server.js +1 -2
  85. package/dist/loyaltyStore.testFixtures.js +1 -2
  86. package/dist/loyaltyTables.entity.js +1 -2
  87. package/dist/offerMerchandising.fixture.js +1 -2
  88. package/dist/offerMerchandising.js +1 -2
  89. package/dist/offerPolicies.fixture.js +1 -2
  90. package/dist/offerPolicies.js +1 -2
  91. package/dist/piggyBanks.fixture.js +1 -2
  92. package/dist/piggyBanks.js +1 -2
  93. package/dist/piggyBinding.server.js +1 -2
  94. package/dist/piggyPort.fixture.js +1 -2
  95. package/dist/piggyStore.server.js +1 -2
  96. package/dist/piggyStore.testFixtures.js +1 -2
  97. package/dist/piggyTables.entity.js +1 -2
  98. package/dist/plugin.js +1 -2
  99. package/dist/port.js +1 -2
  100. package/dist/price.js +1 -2
  101. package/dist/purchaseRecovery.js +1 -2
  102. package/dist/reports.server.js +1 -2
  103. package/dist/rpc.js +1 -2
  104. package/dist/sanctionsTradeAuthority.server.js +1 -2
  105. package/dist/shop.js +1 -2
  106. package/dist/shop.testFixtures.js +1 -2
  107. package/dist/shopPort.fixture.js +1 -2
  108. package/dist/shopPresentation.js +1 -2
  109. package/dist/shopStore.server.js +1 -2
  110. package/dist/shopTables.entity.js +1 -2
  111. package/dist/shopUiCopy.js +1 -2
  112. package/dist/spendLimits.fixture.js +1 -2
  113. package/dist/spendLimits.js +1 -2
  114. package/dist/spendLimitsPort.fixture.js +1 -2
  115. package/dist/subscriptionBinding.server.js +1 -2
  116. package/dist/subscriptionStore.server.js +1 -2
  117. package/dist/subscriptionStore.testFixtures.js +1 -2
  118. package/dist/subscriptionTables.entity.js +1 -2
  119. package/dist/subscriptions.fixture.js +1 -2
  120. package/dist/subscriptions.js +1 -2
  121. package/dist/subscriptionsPort.fixture.js +1 -2
  122. package/dist/systemFixtures.js +1 -2
  123. package/dist/tables.entity.js +1 -2
  124. package/dist/tradeAuthority.server.js +1 -2
  125. package/dist/tradeBinding.server.js +1 -2
  126. package/dist/tradeComponents.js +1 -2
  127. package/dist/tradeEscrow.server.js +1 -2
  128. package/dist/tradeEscrow.testFixtures.js +1 -2
  129. package/dist/tradeExpiry.server.js +1 -2
  130. package/dist/tradeRecovery.js +1 -2
  131. package/dist/tradeStore.server.js +1 -2
  132. package/dist/tradeStore.testFixtures.js +1 -2
  133. package/dist/tradeTables.entity.js +1 -2
  134. package/dist/tradeUiCopy.js +1 -2
  135. package/dist/trades.fixture.js +1 -2
  136. package/dist/trades.js +1 -2
  137. package/dist/tradesPort.fixture.js +1 -2
  138. package/dist/walletEscrow.js +1 -2
  139. package/dist/walletEscrow.server.js +1 -2
  140. package/dist/walletKeys.server.js +1 -2
  141. package/dist/walletStore.js +1 -2
  142. package/dist/web.js +1 -2
  143. package/package.json +10 -10
package/dist/amount.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { economyError as e } from "./errors.js";
2
- //#region src/amount.ts
2
+ // src/amount.ts
3
3
  var t = -(1n << 63n), n = (1n << 63n) - 1n, r = (r) => {
4
4
  let i;
5
5
  if (typeof r == "bigint") i = r;
@@ -17,5 +17,4 @@ var t = -(1n << 63n), n = (1n << 63n) - 1n, r = (r) => {
17
17
  if (n <= 0n) throw e("invalid_amount");
18
18
  return n;
19
19
  };
20
- //#endregion
21
20
  export { r as economyAmount, i as economyAmountString, a as nonNegativeAmount, o as positiveAmount };
@@ -10,7 +10,7 @@ import { captureAppleIapTrust as f } from "./appleIapTrust.server.js";
10
10
  import { appleIapDeliveryPort as p, appleIapNotificationPort as m } from "./appleIapNotifications.server.js";
11
11
  import { Effect as h } from "effect";
12
12
  import { createPrivateKey as g } from "node:crypto";
13
- //#region src/appleIap.server.ts
13
+ // src/appleIap.server.ts
14
14
  var _ = (e) => {
15
15
  if (typeof e != "string" || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)) throw t("invalid_record");
16
16
  return e.toLowerCase();
@@ -259,5 +259,4 @@ var _ = (e) => {
259
259
  })))
260
260
  });
261
261
  };
262
- //#endregion
263
262
  export { T as appleIapCurrentStatePort, C as appleIapProvider, S as appleIapVerificationPort, w as projectAppleIapCurrentState, y as projectAppleIapTransaction };
@@ -6,7 +6,7 @@ import { captureNotificationInput as o, issueVerifiedIapNotification as s, notif
6
6
  import { iapProviderRecord as l, iapProviderText as u } from "./iapProviderCapture.server.js";
7
7
  import { captureAppleIapTrust as d } from "./appleIapTrust.server.js";
8
8
  import { Effect as f } from "effect";
9
- //#region src/appleIapNotifications.server.ts
9
+ // src/appleIapNotifications.server.ts
10
10
  var p = (e) => {
11
11
  let n = u(e, 128);
12
12
  if (!/^[1-9][0-9]*$/.test(n)) throw t("invalid_record");
@@ -159,5 +159,4 @@ var p = (e) => {
159
159
  }
160
160
  });
161
161
  };
162
- //#endregion
163
162
  export { _ as appleIapDeliveryPort, g as appleIapNotificationPort, h as projectAppleIapNotification };
@@ -3,7 +3,7 @@ import { dataList as t, dataObject as n, identifier as r } from "./capture.js";
3
3
  import { shopInteger as i } from "./shop.js";
4
4
  import { iapEnvironment as a } from "./iap.js";
5
5
  import { Buffer as o } from "node:buffer";
6
- //#region src/appleIapTrust.server.ts
6
+ // src/appleIapTrust.server.ts
7
7
  var s = (s) => {
8
8
  let c = n(s, [
9
9
  "realMoney",
@@ -27,5 +27,4 @@ var s = (s) => {
27
27
  applicationId: u
28
28
  });
29
29
  };
30
- //#endregion
31
30
  export { s as captureAppleIapTrust };
@@ -6,7 +6,7 @@ import { captureShopOrderReceipt as c, shopBuyIntent as l, shopInteger as u } fr
6
6
  import { shopOfferDigest as d } from "./shopStore.server.js";
7
7
  import { defineBundle as f, projectBundleValue as p } from "./offerMerchandising.js";
8
8
  import { Effect as m } from "effect";
9
- //#region src/bundleValue.server.ts
9
+ // src/bundleValue.server.ts
10
10
  var h = (h) => {
11
11
  let g = i(h, [
12
12
  "shop",
@@ -109,5 +109,4 @@ var h = (h) => {
109
109
  }
110
110
  } });
111
111
  };
112
- //#endregion
113
112
  export { h as bundleValueFromShopReceipts };
@@ -1,5 +1,5 @@
1
1
  import { economyError as e } from "./errors.js";
2
- //#region src/canonicalDataJson.ts
2
+ // src/canonicalDataJson.ts
3
3
  var t = (n) => {
4
4
  if (Array.isArray(n)) return "[" + n.map(t).join(",") + "]";
5
5
  if (typeof n == "object" && n) return "{" + Object.keys(n).sort().map((e) => JSON.stringify(e) + ":" + t(n[e])).join(",") + "}";
@@ -7,5 +7,4 @@ var t = (n) => {
7
7
  if (r === void 0) throw e("invalid_record");
8
8
  return r;
9
9
  };
10
- //#endregion
11
10
  export { t as canonicalDataJson };
package/dist/capture.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { economyError as e } from "./errors.js";
2
- //#region src/capture.ts
2
+ // src/capture.ts
3
3
  var t = (t, n, r = "invalid_input") => {
4
4
  if (typeof t != "object" || !t || Array.isArray(t)) throw e(r);
5
5
  let i = Object.getPrototypeOf(t);
@@ -50,5 +50,4 @@ var t = (t, n, r = "invalid_input") => {
50
50
  if (n.length === 0 || new Set(n).size !== n.length) throw e("invalid_input");
51
51
  return Object.freeze(n);
52
52
  }, o = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e;
53
- //#endregion
54
53
  export { i as captureBoundMethods, a as captureQueryTables, r as dataList, t as dataObject, o as declaredSources, n as identifier };
@@ -8,7 +8,7 @@ import { systemSubject as u } from "@voltro/protocol";
8
8
  import { randomBytes as d } from "node:crypto";
9
9
  import { ensureTableRegistered as f } from "@voltro/database";
10
10
  import { InMemoryDataStore as p } from "@voltro/runtime";
11
- //#region src/codePort.fixture.ts
11
+ // src/codePort.fixture.ts
12
12
  var m = () => {
13
13
  let e = [{
14
14
  id: "test.gold",
@@ -120,5 +120,4 @@ var m = () => {
120
120
  }
121
121
  }
122
122
  });
123
- //#endregion
124
123
  export { m as codeEligibilityFixture, g as codeEligibilitySystemFixture, v as codePortFixture, b as codePortSystemFixture, y as codesFakeLayer };
@@ -11,7 +11,7 @@ import { createHash as x } from "node:crypto";
11
11
  import { and as S, eq as C, queryFor as w } from "@voltro/database";
12
12
  import { executeSqlMutations as ee, prepareSqlMutation as te, prepareSqlMutationGroup as ne } from "@voltro/database/sql";
13
13
  import { InventoryError as T } from "@voltro/plugin-inventory/errors";
14
- //#region src/codeStore.server.ts
14
+ // src/codeStore.server.ts
15
15
  var E = (e) => x("sha256").update(JSON.stringify(e)).digest("hex"), D = (e, ...t) => e + E(t).slice(0, 56), O = (n) => n instanceof e ? n : n instanceof T && [
16
16
  "invalid_input",
17
17
  "invalid_record",
@@ -436,5 +436,4 @@ var E = (e) => x("sha256").update(JSON.stringify(e)).digest("hex"), D = (e, ...t
436
436
  })
437
437
  });
438
438
  };
439
- //#endregion
440
439
  export { F as dataStoreCodes, P as resolveCodeStoreOptions };
@@ -1,5 +1,5 @@
1
1
  import { boolean as e, id as t, integer as n, json as r, table as i, text as a, timestamp as o } from "@voltro/database";
2
- //#region src/codeTables.entity.ts
2
+ // src/codeTables.entity.ts
3
3
  var s = () => a().maxLength(120).externalId().sensitive("pii"), c = i("_voltro_eco_code_tenants", {
4
4
  id: t({ prefix: "ect" }),
5
5
  tenantId: s(),
@@ -40,5 +40,4 @@ var s = () => a().maxLength(120).externalId().sensitive("pii"), c = i("_voltro_e
40
40
  u,
41
41
  d
42
42
  ];
43
- //#endregion
44
43
  export { d as codeClaimsTable, u as codeSubjectsTable, f as codeTables, c as codeTenantsTable, l as codesTable };
package/dist/codes.js CHANGED
@@ -4,7 +4,7 @@ import { positiveAmount as a } from "./amount.js";
4
4
  import { captureCurrencies as o } from "./currency.js";
5
5
  import { shopInteger as s } from "./shop.js";
6
6
  import { Context as c } from "effect";
7
- //#region src/codes.ts
7
+ // src/codes.ts
8
8
  var l = (t, c) => {
9
9
  let l = r(t, [
10
10
  "id",
@@ -79,5 +79,4 @@ var l = (t, c) => {
79
79
  requestId: i(t.requestId)
80
80
  });
81
81
  };
82
- //#endregion
83
82
  export { u as CodePort, h as captureCodeIntent, d as captureCodeService, m as captureCodeValue, f as defaultCodeEligibility, l as defineCode, p as resolveCodeEligibility };
@@ -7,7 +7,7 @@ import { TradeAcceptDialog as s, TradeIntentionRecovery as c, TradeList as l, Tr
7
7
  import { useEffect as d, useId as f, useRef as p } from "react";
8
8
  import { Button as m, Dialog as h, DialogDescription as g, DialogFooter as _, DialogHeader as v, DialogTitle as y } from "@voltro/ui-shadcn";
9
9
  import { jsx as b, jsxs as x } from "react/jsx-runtime";
10
- //#region src/components.tsx
10
+ // src/components.tsx
11
11
  var S = (e) => e.copy ?? a[e.locale ?? "en"], C = (e, t, n) => e.kind === "free" ? t.free : `${e.amount} ${n?.(e.currency) ?? e.currency}`, w = (e) => {
12
12
  let t = S(e), a, o;
13
13
  try {
@@ -280,5 +280,4 @@ var S = (e) => e.copy ?? a[e.locale ?? "en"], C = (e, t, n) => e.kind === "free"
280
280
  ]
281
281
  });
282
282
  };
283
- //#endregion
284
283
  export { w as OfferCard, D as PurchaseDialog, E as PurchaseRecovery, T as ShopGrid, s as TradeAcceptDialog, c as TradeIntentionRecovery, l as TradeList, u as TradeTerms, n as captureShopOfferView, r as shopOfferAvailable, i as shopPurchaseTerms, a as shopUiCopy, o as tradeUiCopy };
@@ -8,7 +8,7 @@ import { Effect as p } from "effect";
8
8
  import { systemSubject as m } from "@voltro/protocol";
9
9
  import { eq as h, queryFor as g } from "@voltro/database";
10
10
  import { defineSchedule as _ } from "@voltro/runtime";
11
- //#region src/consistency.server.ts
11
+ // src/consistency.server.ts
12
12
  var v = (e) => {
13
13
  let n = i(e, [
14
14
  "tenantId",
@@ -112,5 +112,4 @@ var v = (e) => {
112
112
  })
113
113
  });
114
114
  };
115
- //#endregion
116
115
  export { v as captureEconomyConsistencyInput, y as checkSqlEconomyConsistency, b as economyConsistencySchedule };
@@ -12,7 +12,7 @@ import { createHash as A } from "node:crypto";
12
12
  import { and as ee, eq as j, queryFor as M } from "@voltro/database";
13
13
  import { executeSqlMutations as te, prepareSqlMutation as ne, prepareSqlMutationGroup as re } from "@voltro/database/sql";
14
14
  import { InventoryError as N } from "@voltro/plugin-inventory/errors";
15
- //#region src/containerStore.server.ts
15
+ // src/containerStore.server.ts
16
16
  var P = (e) => A("sha256").update(JSON.stringify(e)).digest("hex"), F = (e, ...t) => e + P(t).slice(0, 56), I = (e, t) => P([e, a(t)]), L = (n) => n instanceof e ? n : n instanceof N && [
17
17
  "conflict",
18
18
  "erased",
@@ -684,5 +684,4 @@ var P = (e) => A("sha256").update(JSON.stringify(e)).digest("hex"), F = (e, ...t
684
684
  })
685
685
  });
686
686
  };
687
- //#endregion
688
687
  export { I as containerDefinitionDigest, U as dataStoreContainers, ie as resolveContainersStoreOptions };
@@ -4,7 +4,7 @@ import { dataStoreContainers as n } from "./containerStore.server.js";
4
4
  import { shopAt as r, shopFixture as i } from "./shop.testFixtures.js";
5
5
  import { Effect as a } from "effect";
6
6
  import { ensureTableRegistered as o } from "@voltro/database";
7
- //#region src/containerStore.testFixtures.ts
7
+ // src/containerStore.testFixtures.ts
8
8
  var s = async (s, c = "tenant", l = {}, u = 4096) => {
9
9
  t.forEach(o);
10
10
  let d = await i(s, c, {}, u), f = d.options.currencies, p = {
@@ -72,5 +72,4 @@ var s = async (s, c = "tenant", l = {}, u = 4096) => {
72
72
  requestId: t,
73
73
  ...e.container.price.kind === "virtual" ? { currency: e.container.price.options[0].currency } : e.container.price.kind === "mixed" ? { currency: e.container.price.virtual[0].currency } : {}
74
74
  });
75
- //#endregion
76
75
  export { c as containerOpenIntent, s as containerStoreFixture };
@@ -1,5 +1,5 @@
1
1
  import { boolean as e, id as t, integer as n, json as r, table as i, text as a, timestamp as o } from "@voltro/database";
2
- //#region src/containerTables.entity.ts
2
+ // src/containerTables.entity.ts
3
3
  var s = () => a().maxLength(120).externalId().sensitive("pii"), c = i("_voltro_eco_container_tenants", {
4
4
  id: t({ prefix: "eut" }),
5
5
  tenantId: s(),
@@ -42,5 +42,4 @@ var s = () => a().maxLength(120).externalId().sensitive("pii"), c = i("_voltro_e
42
42
  u,
43
43
  d
44
44
  ];
45
- //#endregion
46
45
  export { l as containerDefinitionsTable, d as containerOpeningsTable, u as containerSubjectsTable, f as containerTables, c as containerTenantsTable };
@@ -1,7 +1,7 @@
1
1
  import { economyError as e } from "./errors.js";
2
2
  import { ContainerRandomPort as t, defaultContainerEligibility as n, defaultContainerProbability as r, defaultContainerRoll as i, defineContainer as a, resolveContainerDistribution as o, resolveContainerEligibility as s, resolveContainerRoll as c } from "./containers.js";
3
3
  import { Effect as l, Layer as u } from "effect";
4
- //#region src/containers.fixture.ts
4
+ // src/containers.fixture.ts
5
5
  var d = () => {
6
6
  let e = [{
7
7
  id: "test.gold",
@@ -125,5 +125,4 @@ var d = () => {
125
125
  expected: !1
126
126
  }
127
127
  });
128
- //#endregion
129
128
  export { y as containerEligibilitySystemFixture, d as containerFixture, h as containerProbabilitySystemFixture, f as containerRandomFakeLayer, _ as containerRandomPortSystemFixture, g as containerRollSystemFixture };
@@ -5,7 +5,7 @@ import { captureCurrencies as o } from "./currency.js";
5
5
  import { definePrice as s } from "./price.js";
6
6
  import { shopInteger as c } from "./shop.js";
7
7
  import { Context as l } from "effect";
8
- //#region src/containers.ts
8
+ // src/containers.ts
9
9
  var u = (t, l, u = !1) => {
10
10
  let d = r(t, [
11
11
  "id",
@@ -211,5 +211,4 @@ var u = (t, l, u = !1) => {
211
211
  "exportSubject",
212
212
  "eraseSubject"
213
213
  ]);
214
- //#endregion
215
214
  export { v as ContainerRandomPort, S as ContainersPort, y as captureContainerIntent, C as captureContainersService, f as containerProbabilityContext, b as defaultContainerEligibility, p as defaultContainerProbability, g as defaultContainerRoll, u as defineContainer, h as discloseContainer, m as resolveContainerDistribution, x as resolveContainerEligibility, _ as resolveContainerRoll };
@@ -2,7 +2,7 @@ import { EconomyError as e, economyError as t } from "./errors.js";
2
2
  import { ContainerRandomPort as n, containerProbabilityContext as r, defaultContainerProbability as i, defaultContainerRoll as a, resolveContainerDistribution as o, resolveContainerRoll as s } from "./containers.js";
3
3
  import { Effect as c, Layer as l } from "effect";
4
4
  import { randomBytes as u } from "node:crypto";
5
- //#region src/containers.server.ts
5
+ // src/containers.server.ts
6
6
  var d = Object.freeze({ draw: (n) => {
7
7
  let r;
8
8
  try {
@@ -36,5 +36,4 @@ var d = Object.freeze({ draw: (n) => {
36
36
  });
37
37
  });
38
38
  };
39
- //#endregion
40
39
  export { d as cryptoContainerRandom, f as cryptoContainerRandomLayer, p as sampleContainer };
@@ -4,7 +4,7 @@ import { economyPlugin as n } from "./plugin.js";
4
4
  import { containerOpenIntent as r, containerStoreFixture as i } from "./containerStore.testFixtures.js";
5
5
  import { Effect as a, Layer as o } from "effect";
6
6
  import { InMemoryDataStore as s } from "@voltro/runtime";
7
- //#region src/containersPort.fixture.ts
7
+ // src/containersPort.fixture.ts
8
8
  var c = {
9
9
  app: {
10
10
  name: "containers-fixture",
@@ -71,5 +71,4 @@ var c = {
71
71
  }
72
72
  }
73
73
  });
74
- //#endregion
75
74
  export { u as containersFakeLayer, l as containersPortFixture, d as containersPortSystemFixture };
package/dist/currency.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { economyError as e } from "./errors.js";
2
2
  import { dataList as t, dataObject as n, identifier as r } from "./capture.js";
3
3
  import { economyAmountString as i, positiveAmount as a } from "./amount.js";
4
- //#region src/currency.ts
4
+ // src/currency.ts
5
5
  var o = (t) => {
6
6
  let o = n(t, [
7
7
  "id",
@@ -29,5 +29,4 @@ var o = (t) => {
29
29
  if (new Set(r.map((e) => e.id)).size !== r.length) throw e("invalid_currency");
30
30
  return Object.freeze(r);
31
31
  };
32
- //#endregion
33
32
  export { s as captureCurrencies, o as defineCurrency };
@@ -1,7 +1,7 @@
1
1
  import { defaultPriceResolver as e, priceResolverContext as t } from "./price.js";
2
2
  import { defineShopOffer as n } from "./shop.js";
3
3
  import { planLedgerTransfer as r } from "./ledger.js";
4
- //#region src/declarationFixtures.ts
4
+ // src/declarationFixtures.ts
5
5
  var i = () => Object.freeze({
6
6
  resolver: e,
7
7
  context: t({
@@ -58,5 +58,4 @@ var i = () => Object.freeze({
58
58
  id: "test.gold",
59
59
  kind: "soft"
60
60
  }]);
61
- //#endregion
62
61
  export { a as ledgerTransferFixture, i as priceResolverFixture, o as shopOfferFixture };
@@ -4,7 +4,7 @@ import { captureCurrencies as a } from "./currency.js";
4
4
  import { applyWalletPosting as o, captureAccount as s, economyAccountKey as c, planLedgerTransfer as l } from "./ledger.js";
5
5
  import { EconomyPort as u } from "./port.js";
6
6
  import { Effect as d, Layer as f } from "effect";
7
- //#region src/economyPort.fixture.ts
7
+ // src/economyPort.fixture.ts
8
8
  var p = (p) => {
9
9
  let m = r(p, [
10
10
  "currencies",
@@ -121,5 +121,4 @@ var p = (p) => {
121
121
  close: j
122
122
  });
123
123
  };
124
- //#endregion
125
124
  export { p as economyPortFixture };
package/dist/errors.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Schema as e } from "effect";
2
- //#region src/errors.ts
2
+ // src/errors.ts
3
3
  var t = class extends e.TaggedError()("EconomyError", { code: e.Literals([
4
4
  "invalid_currency",
5
5
  "invalid_amount",
@@ -18,5 +18,4 @@ var t = class extends e.TaggedError()("EconomyError", { code: e.Literals([
18
18
  "limit_exceeded",
19
19
  "already_redeemed"
20
20
  ]) }) {}, n = (e) => new t({ code: e });
21
- //#endregion
22
21
  export { t as EconomyError, n as economyError };
@@ -13,7 +13,7 @@ import { captureGoogleSubscription as y, captureGoogleSubscriptionOrder as b, ca
13
13
  import { googleIapNotificationPort as w } from "./googleIapNotifications.server.js";
14
14
  import { Effect as T } from "effect";
15
15
  import { createHash as E } from "node:crypto";
16
- //#region src/googleIap.server.ts
16
+ // src/googleIap.server.ts
17
17
  var D = (e) => {
18
18
  if (e.length > 4096 || !/^[A-Za-z0-9._~+\/-]+={0,2}$/.test(e)) throw t("invalid_input");
19
19
  return e;
@@ -388,5 +388,4 @@ var D = (e) => {
388
388
  }), T.catchDefect(() => T.fail(t("unavailable"))))
389
389
  });
390
390
  };
391
- //#endregion
392
391
  export { H as googleIapCompletionPort, G as googleIapCurrentStatePort, K as googleIapDeliveryPort, U as googleIapProvider, z as googleIapVerificationPort, W as projectGoogleIapCurrentState, A as projectGoogleIapProduct };
@@ -8,7 +8,7 @@ import { Effect as d } from "effect";
8
8
  import { Buffer as f } from "node:buffer";
9
9
  import { createHash as p } from "node:crypto";
10
10
  import { JwtVerifyError as m, verifyJwt as h } from "@voltro/protocol/jwt";
11
- //#region src/googleIapNotifications.server.ts
11
+ // src/googleIapNotifications.server.ts
12
12
  var g = (e, n, a, o) => {
13
13
  let s = l(e), d = l(s.message);
14
14
  if (s.subscription !== a) throw t("forbidden");
@@ -127,5 +127,4 @@ var g = (e, n, a, o) => {
127
127
  }
128
128
  });
129
129
  };
130
- //#endregion
131
130
  export { _ as googleIapNotificationPort, g as projectGoogleIapNotification };
@@ -5,7 +5,7 @@ import { canonicalDataJson as o } from "./canonicalDataJson.js";
5
5
  import { captureIapTransactionFacts as s } from "./iapVerification.server.js";
6
6
  import { iapProviderRecord as c, iapProviderText as l, iapProviderTimestamp as u } from "./iapProviderCapture.server.js";
7
7
  import { createHash as d } from "node:crypto";
8
- //#region src/googleIapSubscription.server.ts
8
+ // src/googleIapSubscription.server.ts
9
9
  var f = (i) => {
10
10
  let a = t(i === void 0 ? [] : i, 4096).map((e) => {
11
11
  let t = n(e, [
@@ -180,5 +180,4 @@ var f = (i) => {
180
180
  revokedAt: E
181
181
  });
182
182
  };
183
- //#endregion
184
183
  export { _ as captureGoogleSubscription, v as captureGoogleSubscriptionOrder, f as captureGoogleSubscriptionPlans, y as projectGoogleIapSubscription, x as projectGoogleIapSubscriptionCurrentState };
package/dist/iap.js CHANGED
@@ -3,7 +3,7 @@ import { captureBoundMethods as t, dataList as n, dataObject as r, identifier as
3
3
  import { nonNegativeAmount as a, positiveAmount as o } from "./amount.js";
4
4
  import { defineShopOffer as s, shopInteger as c } from "./shop.js";
5
5
  import { Context as l } from "effect";
6
- //#region src/iap.ts
6
+ // src/iap.ts
7
7
  var u = (t, a, o = !1) => {
8
8
  if (typeof o != "boolean") throw e("invalid_input");
9
9
  let c = n(t, 4096);
@@ -300,5 +300,4 @@ var u = (t, a, o = !1) => {
300
300
  i(n.titleKey)
301
301
  ];
302
302
  }).sort((e, t) => e.join("\0") < t.join("\0") ? -1 : +(e.join("\0") > t.join("\0")))].map((e) => e.map((e) => `"${e.replaceAll("\"", "\"\"")}"`).join(",")).join("\r\n") + "\r\n";
303
- //#endregion
304
303
  export { w as IapPort, b as captureIapCompletionReceipt, S as captureIapObservation, y as captureIapOrderReceipt, v as captureIapPaidAmount, x as captureIapRefundDisposition, _ as captureIapScope, T as captureIapService, C as captureIapSubscriptionPeriod, g as createIapReceiptReference, u as defineIapCatalog, d as iapChannel, p as iapEnvironment, f as iapProductKind, D as iapProductsCsv, m as iapReceiptIntent, h as iapReceiptReference, E as iapTimestamp };
@@ -3,7 +3,7 @@ import { defineCurrency as t } from "./currency.js";
3
3
  import { defineIapCatalog as n } from "./iap.js";
4
4
  import { Effect as r } from "effect";
5
5
  import { randomBytes as i, randomUUID as a } from "node:crypto";
6
- //#region src/iap.testFixtures.ts
6
+ // src/iap.testFixtures.ts
7
7
  var o = () => {
8
8
  let o = Date.UTC(2026, 0, 1), s = a(), c = i(32).toString("base64url"), l = [t({
9
9
  id: "test.gems",
@@ -141,5 +141,4 @@ var o = () => {
141
141
  }
142
142
  };
143
143
  };
144
- //#endregion
145
144
  export { o as iapTestFixture };
@@ -1,5 +1,5 @@
1
1
  import { boolean as e, id as t, integer as n, table as r, text as i } from "@voltro/database";
2
- //#region src/iapAccountTables.entity.ts
2
+ // src/iapAccountTables.entity.ts
3
3
  var a = () => i().maxLength(120).serverOnly(), o = () => i().maxLength(16).oneOf([
4
4
  "ios",
5
5
  "android",
@@ -36,5 +36,4 @@ var a = () => i().maxLength(120).serverOnly(), o = () => i().maxLength(16).oneOf
36
36
  "environment",
37
37
  "tenantId"
38
38
  ]), u = [c, l];
39
- //#endregion
40
39
  export { u as iapAccountTables, l as iapAccountTokensTable, c as iapAccountsTable };
@@ -6,7 +6,7 @@ import { Context as u, Effect as d } from "effect";
6
6
  import { createHash as f, randomUUID as p } from "node:crypto";
7
7
  import { eq as m, queryFor as h } from "@voltro/database";
8
8
  import { prepareSqlMutation as g } from "@voltro/database/sql";
9
- //#region src/iapAccounts.server.ts
9
+ // src/iapAccounts.server.ts
10
10
  var _ = class extends u.Service()("@voltro/IapAccountsPort") {}, v = (e) => n(e, [
11
11
  "read",
12
12
  "observe",
@@ -197,5 +197,4 @@ var _ = class extends u.Service()("@voltro/IapAccountsPort") {}, v = (e) => n(e,
197
197
  });
198
198
  }) });
199
199
  };
200
- //#endregion
201
200
  export { _ as IapAccountsPort, v as captureIapAccountBindingService, w as dataStoreIapAccountOwners, C as dataStoreIapAccounts };
@@ -14,7 +14,7 @@ import { dataStoreIap as fe, resolveIapStoreOptions as pe } from "./iapStore.ser
14
14
  import { captureIapCheckoutOrigins as me, captureIapCheckoutReturnUrl as h, captureIapCheckoutService as he, captureIapDelivery as ge, captureIapDeliveryService as _e, captureIapManagementService as ve, captureIapManagementUrl as ye, iapCheckoutIntent as be, iapCheckoutStart as xe } from "./iapCheckout.server.js";
15
15
  import { iapAccountDescriptor as Se, iapCheckEntitlementDescriptor as Ce, iapCheckoutDescriptor as we, iapCheckoutRpcClientImports as Te, iapCompleteDescriptor as Ee, iapCompletionRpcClientImports as De, iapEntitledDescriptor as Oe, iapEntitlementRpcClientImports as ke, iapManageDescriptor as Ae, iapManageRpcClientImports as je, iapReceiptDescriptor as g, iapRedeemDescriptor as Me, iapRefundReceiptSources as Ne, iapRpcClientImports as Pe } from "./rpc.js";
16
16
  import { Context as _, Effect as v, Layer as y } from "effect";
17
- //#region src/iapBinding.server.ts
17
+ // src/iapBinding.server.ts
18
18
  var b = class extends _.Service()("@voltro/IapSystemPort") {}, x = (e) => n(e, [
19
19
  "initialize",
20
20
  "account",
@@ -520,5 +520,4 @@ var b = class extends _.Service()("@voltro/IapSystemPort") {}, x = (e) => n(e, [
520
520
  }
521
521
  });
522
522
  };
523
- //#endregion
524
523
  export { b as IapSystemPort, T as bindIapSystem, x as captureIapSystemService, C as unavailableIap };
@@ -2,7 +2,7 @@ import { EconomyError as e, economyError as t } from "./errors.js";
2
2
  import { captureBoundMethods as n, dataList as r, dataObject as i, identifier as a } from "./capture.js";
3
3
  import { iapTimestamp as o } from "./iap.js";
4
4
  import { Effect as s } from "effect";
5
- //#region src/iapCheckout.server.ts
5
+ // src/iapCheckout.server.ts
6
6
  var c = (e) => n(e, ["initialize", "start"]), l = (e) => {
7
7
  let n = r(e, 16).map((e) => {
8
8
  if (typeof e != "string") throw t("invalid_input");
@@ -94,5 +94,4 @@ var c = (e) => n(e, ["initialize", "start"]), l = (e) => {
94
94
  if (r.protocol !== "https:") throw t("invalid_record");
95
95
  return Object.freeze({ url: r.toString() });
96
96
  };
97
- //#endregion
98
97
  export { l as captureIapCheckoutOrigins, u as captureIapCheckoutReturnUrl, c as captureIapCheckoutService, d as captureIapCheckoutSession, g as captureIapDelivery, h as captureIapDeliveryService, _ as captureIapManagementService, v as captureIapManagementUrl, p as iapCheckoutFailure, f as iapCheckoutIntent, m as iapCheckoutStart };
@@ -4,7 +4,7 @@ import { captureCurrencies as a } from "./currency.js";
4
4
  import { captureIapCompletionReceipt as o, defineIapCatalog as s, iapChannel as c, iapEnvironment as l, iapTimestamp as u } from "./iap.js";
5
5
  import { canonicalDataJson as d } from "./canonicalDataJson.js";
6
6
  import { Context as f, Effect as p } from "effect";
7
- //#region src/iapCompletion.server.ts
7
+ // src/iapCompletion.server.ts
8
8
  var m = class extends f.Service()("@voltro/IapCompletionPort") {}, h = /* @__PURE__ */ new WeakMap(), g = (e, t) => {
9
9
  let n = Object.freeze({ orderId: i(e) });
10
10
  return h.set(n, t), n;
@@ -52,5 +52,4 @@ var m = class extends f.Service()("@voltro/IapCompletionPort") {}, h = /* @__PUR
52
52
  })))), p.catchDefect(() => p.fail(t("unavailable"))))
53
53
  });
54
54
  };
55
- //#endregion
56
55
  export { m as IapCompletionPort, y as captureIapCompletionService, b as iapCompletionPort, g as issueAcceptedIapCompletion };
@@ -5,7 +5,7 @@ import { iapTimestamp as o } from "./iap.js";
5
5
  import { canonicalDataJson as s } from "./canonicalDataJson.js";
6
6
  import { captureIapNotificationTargetOptions as c, readAcceptedIapNotificationTarget as l } from "./iapNotificationTarget.server.js";
7
7
  import { Context as u, Effect as d } from "effect";
8
- //#region src/iapCurrentState.server.ts
8
+ // src/iapCurrentState.server.ts
9
9
  var f = class extends u.Service()("@voltro/IapCurrentStatePort") {}, p = /* @__PURE__ */ new WeakMap(), m = (n) => n instanceof e ? n : t("unavailable"), h = (e, n) => {
10
10
  let s = r(e, [
11
11
  "orderId",
@@ -104,5 +104,4 @@ var f = class extends u.Service()("@voltro/IapCurrentStatePort") {}, p = /* @__P
104
104
  }))), d.catchDefect(() => d.fail(t("unavailable"))))
105
105
  });
106
106
  };
107
- //#endregion
108
107
  export { f as IapCurrentStatePort, v as captureIapCurrentStateService, _ as iapCurrentPurchaseState, y as iapCurrentStatePort, g as readVerifiedIapCurrentState };
@@ -3,7 +3,7 @@ import { iapSqlNoticeFixture as t } from "./iapNotificationTarget.testFixtures.j
3
3
  import { Effect as n } from "effect";
4
4
  import "node:crypto";
5
5
  import { InMemoryDataStore as r } from "@voltro/runtime";
6
- //#region src/iapCurrentState.testFixtures.ts
6
+ // src/iapCurrentState.testFixtures.ts
7
7
  var i = async () => {
8
8
  let i = new r(), a = await e(i), o = await n.runPromise(a.iap.redeem(a.user(), a.intent)), s = t(a);
9
9
  return {
@@ -19,5 +19,4 @@ var i = async () => {
19
19
  }
20
20
  };
21
21
  };
22
- //#endregion
23
22
  export { i as currentStateSqlFixture };
@@ -2,7 +2,7 @@ import { economyError as e } from "./errors.js";
2
2
  import { IapCurrentStatePort as t, iapCurrentPurchaseState as n, iapCurrentStatePort as r } from "./iapCurrentState.server.js";
3
3
  import { currentStateSqlFixture as i } from "./iapCurrentState.testFixtures.js";
4
4
  import { Effect as a, Layer as o, Result as s } from "effect";
5
- //#region src/iapCurrentStatePort.fixture.ts
5
+ // src/iapCurrentStatePort.fixture.ts
6
6
  var c = /* @__PURE__ */ new WeakMap(), l = a.tryPromise({
7
7
  try: i,
8
8
  catch: () => e("unavailable")
@@ -60,5 +60,4 @@ var c = /* @__PURE__ */ new WeakMap(), l = a.tryPromise({
60
60
  }
61
61
  }
62
62
  });
63
- //#endregion
64
63
  export { u as iapCurrentStateFakeLayer, l as iapCurrentStatePortFixture, d as iapCurrentStatePortSystemFixture };
@@ -2,7 +2,7 @@ import { economyError as e } from "./errors.js";
2
2
  import { captureBoundMethods as t, dataList as n, dataObject as r, identifier as i } from "./capture.js";
3
3
  import { captureIapSubscriptionPeriod as a, iapTimestamp as o } from "./iap.js";
4
4
  import { Context as s } from "effect";
5
- //#region src/iapEntitlements.ts
5
+ // src/iapEntitlements.ts
6
6
  var c = (t) => {
7
7
  let n = r(t, [
8
8
  "offerId",
@@ -54,5 +54,4 @@ var c = (t) => {
54
54
  "exportSubject",
55
55
  "eraseSubject"
56
56
  ]);
57
- //#endregion
58
57
  export { d as IapEntitlementsPort, c as captureIapEntitlementObservation, f as captureIapEntitlementsService, l as defaultIapEntitlementPolicy, u as resolveIapEntitlement };
@@ -3,7 +3,7 @@ import { captureBoundMethods as n, dataObject as r, identifier as i } from "./ca
3
3
  import { iapTimestamp as a } from "./iap.js";
4
4
  import { defaultIapEntitlementPolicy as o, resolveIapEntitlement as s } from "./iapEntitlements.js";
5
5
  import { Effect as c } from "effect";
6
- //#region src/iapEntitlements.server.ts
6
+ // src/iapEntitlements.server.ts
7
7
  var l = (n) => n instanceof e ? n : t("unavailable"), u = (e) => {
8
8
  let u = r(e, [
9
9
  "realMoney",
@@ -45,5 +45,4 @@ var l = (n) => n instanceof e ? n : t("unavailable"), u = (e) => {
45
45
  eraseSubject: (e) => c.suspend(() => m.eraseSubject(structuredClone(e))).pipe(c.catchDefect(() => c.fail(t("unavailable"))))
46
46
  });
47
47
  };
48
- //#endregion
49
48
  export { u as iapEntitlementsPort };
@@ -3,7 +3,7 @@ import { captureQueryTables as n, dataObject as r, identifier as i } from "./cap
3
3
  import { IapEntitlementsPort as a, captureIapEntitlementObservation as o, captureIapEntitlementsService as s, defaultIapEntitlementPolicy as c } from "./iapEntitlements.js";
4
4
  import { iapEntitlementsPort as l } from "./iapEntitlements.server.js";
5
5
  import { Effect as u, Layer as d } from "effect";
6
- //#region src/iapEntitlementsBinding.server.ts
6
+ // src/iapEntitlementsBinding.server.ts
7
7
  var f = () => u.fail(t("unavailable")), p = Object.freeze({
8
8
  initialize: f,
9
9
  entitled: f,
@@ -102,5 +102,4 @@ var f = () => u.fail(t("unavailable")), p = Object.freeze({
102
102
  }
103
103
  });
104
104
  };
105
- //#endregion
106
105
  export { m as bindIapEntitlementsSystem, p as unavailableIapEntitlements };
@@ -4,7 +4,7 @@ import { IapEntitlementsPort as n, defaultIapEntitlementPolicy as r, resolveIapE
4
4
  import { iapInstalledEntitlementsFixture as a } from "./iapInstalledEntitlements.testFixtures.js";
5
5
  import { Effect as o, Layer as s } from "effect";
6
6
  import { InMemoryDataStore as c } from "@voltro/runtime";
7
- //#region src/iapEntitlementsPort.fixture.ts
7
+ // src/iapEntitlementsPort.fixture.ts
8
8
  var l = /* @__PURE__ */ new WeakMap(), u = o.tryPromise({
9
9
  try: () => a(new c(), "fixture.iap.entitlements"),
10
10
  catch: () => e("unavailable")
@@ -77,5 +77,4 @@ var l = /* @__PURE__ */ new WeakMap(), u = o.tryPromise({
77
77
  }
78
78
  }
79
79
  });
80
- //#endregion
81
80
  export { p as iapEntitlementPolicyFixture, m as iapEntitlementPolicySystemFixture, d as iapEntitlementsFakeLayer, u as iapEntitlementsPortFixture, f as iapEntitlementsPortSystemFixture };