@saasicat/nest 1.0.0-rc.2 → 1.0.0-rc.20

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/README.md +44 -8
  2. package/dist/.build-stamp +1 -1
  3. package/dist/_entries.cjs +8751 -4329
  4. package/dist/admin/index.d.cts +4 -4
  5. package/dist/admin/index.d.ts +4 -4
  6. package/dist/admin/index.js +12 -9
  7. package/dist/{admin-resources.module-DF5_Q7RD.d.ts → admin-resources.module-BENMc0Wh.d.ts} +1 -1
  8. package/dist/{admin-resources.module-CpvzcfCc.d.cts → admin-resources.module-aOJ_0rur.d.cts} +1 -1
  9. package/dist/{admin-stats.service-DfKupywR.d.cts → admin-stats.service-BJdzHCtJ.d.cts} +2 -2
  10. package/dist/{admin-stats.service-TYiSUwIR.d.ts → admin-stats.service-cwLMrkGl.d.ts} +2 -2
  11. package/dist/{aggregation-BFzW07DE.d.ts → aggregation-BHo7a_In.d.cts} +19 -2
  12. package/dist/{aggregation-B3CD0v_d.d.cts → aggregation-CtIjlWHT.d.ts} +19 -2
  13. package/dist/billing/index.d.cts +439 -106
  14. package/dist/billing/index.d.ts +439 -106
  15. package/dist/billing/index.js +101 -39
  16. package/dist/catalog/index.d.cts +60 -40
  17. package/dist/catalog/index.d.ts +60 -40
  18. package/dist/catalog/index.js +18 -12
  19. package/dist/{catalog.module-BTnMsE6u.d.ts → catalog.module-B5E8tsl7.d.ts} +6 -2
  20. package/dist/{catalog.module-BDDO6iwq.d.cts → catalog.module-DKVvsPsl.d.cts} +6 -2
  21. package/dist/checkout-offer/index.d.cts +16 -22
  22. package/dist/checkout-offer/index.d.ts +16 -22
  23. package/dist/checkout-offer/index.js +18 -5
  24. package/dist/checkout-offer.module-DFhGy6JO.d.cts +58 -0
  25. package/dist/checkout-offer.module-x7SP_dX4.d.ts +58 -0
  26. package/dist/checkout-offer.service-BP4CoZle.d.ts +199 -0
  27. package/dist/checkout-offer.service-Bk5mHEoR.d.cts +199 -0
  28. package/dist/{chunk-DQKCK7DX.js → chunk-323FB6TD.js} +11 -102
  29. package/dist/chunk-34XVPR6P.js +222 -0
  30. package/dist/chunk-3HT3REXB.js +110 -0
  31. package/dist/chunk-5BCYJ3QY.js +44 -0
  32. package/dist/chunk-5CKC7O52.js +140 -0
  33. package/dist/{chunk-6Z7JR4EW.js → chunk-6ISJMNW7.js} +1837 -590
  34. package/dist/chunk-CRCNY3U6.js +313 -0
  35. package/dist/{chunk-TXC3LHHB.js → chunk-DTIYUJH5.js} +6 -8
  36. package/dist/{chunk-VIJ5NJWC.js → chunk-FQS5FPH2.js} +74 -19
  37. package/dist/chunk-G7RQO2XO.js +0 -0
  38. package/dist/{chunk-N3L3AICU.js → chunk-GPQWGA6B.js} +5 -6
  39. package/dist/chunk-GZTL64QK.js +7 -0
  40. package/dist/{chunk-NHVDCYK5.js → chunk-IORLRWJZ.js} +71 -106
  41. package/dist/{chunk-SABTXESR.js → chunk-J7NJRK3K.js} +17 -1
  42. package/dist/{chunk-I7GTA3RX.js → chunk-JQRA724W.js} +1 -1
  43. package/dist/{chunk-WXYJHZCN.js → chunk-JVAEKTJ4.js} +2 -14
  44. package/dist/chunk-KPEMTBOP.js +26 -0
  45. package/dist/{chunk-WOVQPXV4.js → chunk-NCXGXNQK.js} +585 -710
  46. package/dist/{chunk-NA6O63B7.js → chunk-NEICZJE4.js} +5 -5
  47. package/dist/{chunk-LTT736P3.js → chunk-OAUN2FPJ.js} +183 -371
  48. package/dist/{chunk-O2J2HDXA.js → chunk-OOTEXP47.js} +3 -8
  49. package/dist/chunk-QBF7KLSA.js +96 -0
  50. package/dist/chunk-QSBMFY4I.js +33 -0
  51. package/dist/{chunk-RUNZ3X4C.js → chunk-RSAPMUGB.js} +1239 -164
  52. package/dist/{chunk-XBYAFEOR.js → chunk-S33SO5XX.js} +1 -1
  53. package/dist/chunk-SZ7RFPXA.js +10 -0
  54. package/dist/{chunk-KFT5AIIH.js → chunk-U465NU23.js} +197 -22
  55. package/dist/chunk-U4X2YRRO.js +214 -0
  56. package/dist/{chunk-AU3OOREM.js → chunk-WYXLTSUZ.js} +14 -3
  57. package/dist/chunk-X4PDUYBX.js +1142 -0
  58. package/dist/{chunk-SEPN52AD.js → chunk-XDRJ4FRG.js} +506 -311
  59. package/dist/{chunk-VXEYLNIB.js → chunk-XWAZNKAB.js} +9 -3
  60. package/dist/chunk-YFCTBLM5.js +525 -0
  61. package/dist/{chunk-7ZEGFL42.js → chunk-ZUOCCEWB.js} +5 -5
  62. package/dist/contract-line-item-money-BWWQhRul.d.cts +11 -0
  63. package/dist/contract-line-item-money-BWWQhRul.d.ts +11 -0
  64. package/dist/discovery/index.d.cts +2 -2
  65. package/dist/discovery/index.d.ts +2 -2
  66. package/dist/discovery/index.js +6 -6
  67. package/dist/{discovery.scanner-9cMqF95o.d.cts → discovery.scanner-DXKc6JkV.d.cts} +1 -1
  68. package/dist/{discovery.scanner-9cMqF95o.d.ts → discovery.scanner-DXKc6JkV.d.ts} +1 -1
  69. package/dist/{enforce-quota.interceptor-Df0e3OWe.d.cts → enforce-quota.interceptor-CLyCNVIm.d.cts} +2 -2
  70. package/dist/{enforce-quota.interceptor-DW3etVyI.d.ts → enforce-quota.interceptor-DQ_BN_jV.d.ts} +2 -2
  71. package/dist/entitlement/index.d.cts +26 -4
  72. package/dist/entitlement/index.d.ts +26 -4
  73. package/dist/entitlement/index.js +13 -7
  74. package/dist/index.d.cts +208 -28
  75. package/dist/index.d.ts +208 -28
  76. package/dist/index.js +267 -159
  77. package/dist/issuer-identity.check-B8Wzugbf.d.cts +197 -0
  78. package/dist/issuer-identity.check-q-Uha5XY.d.ts +197 -0
  79. package/dist/{module-options-COSEb0VW.d.ts → module-options-C5EBOxzm.d.ts} +123 -39
  80. package/dist/{module-options-BG3MzQva.d.cts → module-options-Cr5FkELF.d.cts} +123 -39
  81. package/dist/payment-callback.service-DPUfjp-F.d.cts +97 -0
  82. package/dist/payment-callback.service-DPUfjp-F.d.ts +97 -0
  83. package/dist/payments/index.cjs +4 -0
  84. package/dist/payments/index.d.cts +133 -0
  85. package/dist/payments/index.d.ts +133 -0
  86. package/dist/payments/index.js +135 -0
  87. package/dist/payments.module-C6r6dJdn.d.ts +54 -0
  88. package/dist/payments.module-Da26YttL.d.cts +54 -0
  89. package/dist/{plan-resolution-Cgo_TR1H.d.cts → plan-resolution-CwUy_OqC.d.cts} +14 -0
  90. package/dist/{plan-resolution-Cgo_TR1H.d.ts → plan-resolution-CwUy_OqC.d.ts} +14 -0
  91. package/dist/{plan-versions.service-TPEtbN0r.d.cts → plan-versions.service-BM7lKLr1.d.cts} +41 -21
  92. package/dist/{plan-versions.service-DChhbK6h.d.ts → plan-versions.service-BTlw-aEX.d.ts} +41 -21
  93. package/dist/platform/index.d.cts +51 -23
  94. package/dist/platform/index.d.ts +51 -23
  95. package/dist/platform/index.js +54 -34
  96. package/dist/promo/index.d.cts +18 -6
  97. package/dist/promo/index.d.ts +18 -6
  98. package/dist/promo/index.js +14 -7
  99. package/dist/{promo.module-Z8h1PNX-.d.ts → promo.module-KmIpp1Gb.d.ts} +2 -2
  100. package/dist/{promo.module-DtvIycpt.d.cts → promo.module-YfF6ADDf.d.cts} +2 -2
  101. package/dist/{promo.service-BJbKAmw3.d.cts → promo.service-CBMm9RU7.d.cts} +2 -1
  102. package/dist/{promo.service-BJbKAmw3.d.ts → promo.service-CBMm9RU7.d.ts} +2 -1
  103. package/dist/registration/index.d.cts +81 -49
  104. package/dist/registration/index.d.ts +81 -49
  105. package/dist/registration/index.js +8 -9
  106. package/dist/subscriber/index.cjs +4 -0
  107. package/dist/subscriber/index.d.cts +28 -0
  108. package/dist/subscriber/index.d.ts +28 -0
  109. package/dist/subscriber/index.js +15 -0
  110. package/dist/subscriber.service-BZsvHw1V.d.cts +57 -0
  111. package/dist/subscriber.service-BZsvHw1V.d.ts +57 -0
  112. package/dist/subscription-contract/index.d.cts +4 -2
  113. package/dist/subscription-contract/index.d.ts +4 -2
  114. package/dist/subscription-contract/index.js +11 -5
  115. package/dist/{subscription-contract.module-fDFdQ0jm.d.ts → subscription-contract.module-BfIRpc1o.d.ts} +8 -2
  116. package/dist/{subscription-contract.module-CEK8HS5-.d.cts → subscription-contract.module-DTMuUJYd.d.cts} +8 -2
  117. package/dist/{subscription-contract.service-hD87MKyg.d.ts → subscription-contract.service-D7Qb_Ns-.d.cts} +32 -3
  118. package/dist/{subscription-contract.service-hD87MKyg.d.cts → subscription-contract.service-Duv_Ns1W.d.ts} +32 -3
  119. package/dist/tenant-billing.controller-0HZ_2DQH.d.ts +811 -0
  120. package/dist/tenant-billing.controller-CN9DgasV.d.cts +811 -0
  121. package/dist/{tenant-billing.module-wUbsQSFG.d.ts → tenant-billing.module-C1sLBCW-.d.ts} +153 -96
  122. package/dist/{tenant-billing.module-BznC3XtW.d.cts → tenant-billing.module-CPybDf7c.d.cts} +153 -96
  123. package/dist/tenant-billing.tokens-G-1xOlMr.d.cts +129 -0
  124. package/dist/tenant-billing.tokens-G-1xOlMr.d.ts +129 -0
  125. package/dist/testing/index.d.cts +43 -17
  126. package/dist/testing/index.d.ts +43 -17
  127. package/dist/testing/index.js +188 -39
  128. package/package.json +24 -4
  129. package/dist/checkout-offer.module-CMtiQJTT.d.ts +0 -39
  130. package/dist/checkout-offer.module-CVpWrzbe.d.cts +0 -39
  131. package/dist/checkout-offer.service-BLOv2HOo.d.cts +0 -49
  132. package/dist/checkout-offer.service-BLOv2HOo.d.ts +0 -49
  133. package/dist/chunk-57V6ZTI6.js +0 -22
  134. package/dist/chunk-BSK6YBLI.js +0 -87
  135. package/dist/chunk-WUDYIPYH.js +0 -715
  136. package/dist/define-saasicat-DROBe-b1.d.ts +0 -69
  137. package/dist/define-saasicat-vGBCkFys.d.cts +0 -69
  138. package/dist/tenant-billing.controller-BQ67mlmI.d.ts +0 -438
  139. package/dist/tenant-billing.controller-DS8kB8a7.d.cts +0 -438
  140. /package/dist/{chunk-2FR6ZL7R.js → chunk-BHZOH2DY.js} +0 -0
  141. /package/dist/{chunk-2SLTRKXC.js → chunk-DFOW3JVO.js} +0 -0
  142. /package/dist/{chunk-DBZGV3HC.js → chunk-DU56UKEH.js} +0 -0
  143. /package/dist/{chunk-OYNHOY45.js → chunk-GAUEVIAE.js} +0 -0
package/README.md CHANGED
@@ -1,21 +1,51 @@
1
1
  # @saasicat/nest
2
2
 
3
+ ## What this is
4
+
3
5
  NestJS implementation of the SaaS platform — billing, promo codes, admin
4
6
  backend, audit, MFA, adapter ports.
5
7
 
6
- ## Sub-entries
8
+ ## What this is not
9
+
10
+ Not a standalone server. It is a set of Nest modules for an application that
11
+ already has its own HTTP stack, authentication and database — the platform
12
+ brings the product loop, not the runtime.
13
+
14
+ Not a persistence layer. Every store access goes through a port, and a port
15
+ needs an adapter: `@saasicat/adapter-prisma` or `@saasicat/adapter-drizzle`,
16
+ or your own.
17
+
18
+ Not a place to import from the root by habit. Each sub-entry is a bundle of
19
+ its own; the root additionally re-exports the platform composition, and the
20
+ reason that is safe is worth knowing before you rely on it.
21
+
22
+ ## Entry points
23
+
24
+ Each sub-entry is a bundle of its own: importing from `./promo` costs you the
25
+ promo slice, not the package. The root additionally re-exports the platform
26
+ composition — see [ADR 0003](../../docs/explanation/adr/0003-one-bundle-many-entries.md)
27
+ for why that is safe and what it costs.
7
28
 
8
29
  ```ts
9
30
  import { computeDiscountGross, buildLabel, round2 } from '@saasicat/nest/promo';
10
31
  ```
11
32
 
12
- | Entry | Contents |
13
- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
14
- | `@saasicat/nest/promo` | `computeDiscountGross`, `computeDiscountedGross`, `computeRegularStartsAt`, `addCycles`, `buildLabel`, `round2`, `grossFromNet`, `computeIncludedVat` all pure functions |
15
-
16
- Further entries: `./billing`, `./entitlement`, `./admin`, `./registration`,
17
- `./discovery`, `./catalog`, `./checkout-offer`, `./subscription-contract`,
18
- `./platform`, `./testing`.
33
+ | Entry | What is in it | When you take it |
34
+ | ------------------------- | --------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
35
+ | `.` | `SaaSiCatModule`, `defineSaaSiCat` and the option typesthe whole composition. | The standard integration, and existing consumers. |
36
+ | `./platform` | The same composition, without the rest of the root surface. | A new application. Prefer this over `.`. |
37
+ | `./discovery` | `DiscoveryModule` and the four decorators that declare capabilities and quotas. | You are annotating your controllers. |
38
+ | `./entitlement` | `EntitlementModule`, `EntitlementService`, `LimitExceededError`, aggregation. | You enforce limits yourself instead of by decorator. |
39
+ | `./catalog` | `CatalogModule` — plans, bundles, marketing projections, promotions. | You touch the catalogue outside the admin pages. |
40
+ | `./billing` | Billing periods, plan-catalog loading and import. | You compute periods or load a catalogue yourself. |
41
+ | `./promo` | Pure promo arithmetic: discounts, cycles, labels, VAT. | You price something outside a checkout. |
42
+ | `./checkout-offer` | `CheckoutOfferModule` — the frozen offer between catalogue and contract. | Your own checkout writes offers. |
43
+ | `./subscription-contract` | `SubscriptionContractModule` and the invoice-shaped projections of a contract. | You bill from contracts. |
44
+ | `./subscriber` | `SubscriberService` — the party a contract is concluded with, and its corrections. | Your application creates tenants. |
45
+ | `./payments` | `PaymentsModule`, the webhook route, `DevPaymentGateway` — payment methods through a gateway. | You take payment methods, or write a gateway adapter. |
46
+ | `./admin` | `AdminModule`, the SuperAdmin guards, the port tokens, the manifest surface. | You extend or replace part of the admin backend. |
47
+ | `./registration` | `RegistrationModule` — the only entry `SaaSiCatModule` does not compose. | You offer self-registration. |
48
+ | `./testing` | Fake adapters for every repository port, plus a `TransactionRunner`. | You unit-test code that depends on the platform. |
19
49
 
20
50
  ## Usage
21
51
 
@@ -51,3 +81,9 @@ pnpm --filter @saasicat/nest build
51
81
 
52
82
  Produces `dist/index.{js,cjs,d.ts}` plus `dist/promo/index.{js,cjs,d.ts}`
53
83
  via tsup with multiple entries.
84
+
85
+ ## Next
86
+
87
+ - [Wire the backend](../../docs/guides/wire-the-backend.md) — every option, in the order you need them
88
+ - [Module options](../../docs/reference/options.md) — the generated lookup
89
+ - [Architecture](../../docs/explanation/architecture.md) — which module does what
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- a28abfbcf4bf929f9e39c7a90142778963051c310b7cf8c8f6c9ab454e4222ee
1
+ 88f7851acc889a5928376f888032eafa4960455aca4dd6c0d99ae171c43defb7