@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.
- package/README.md +44 -8
- package/dist/.build-stamp +1 -1
- package/dist/_entries.cjs +8751 -4329
- package/dist/admin/index.d.cts +4 -4
- package/dist/admin/index.d.ts +4 -4
- package/dist/admin/index.js +12 -9
- package/dist/{admin-resources.module-DF5_Q7RD.d.ts → admin-resources.module-BENMc0Wh.d.ts} +1 -1
- package/dist/{admin-resources.module-CpvzcfCc.d.cts → admin-resources.module-aOJ_0rur.d.cts} +1 -1
- package/dist/{admin-stats.service-DfKupywR.d.cts → admin-stats.service-BJdzHCtJ.d.cts} +2 -2
- package/dist/{admin-stats.service-TYiSUwIR.d.ts → admin-stats.service-cwLMrkGl.d.ts} +2 -2
- package/dist/{aggregation-BFzW07DE.d.ts → aggregation-BHo7a_In.d.cts} +19 -2
- package/dist/{aggregation-B3CD0v_d.d.cts → aggregation-CtIjlWHT.d.ts} +19 -2
- package/dist/billing/index.d.cts +439 -106
- package/dist/billing/index.d.ts +439 -106
- package/dist/billing/index.js +101 -39
- package/dist/catalog/index.d.cts +60 -40
- package/dist/catalog/index.d.ts +60 -40
- package/dist/catalog/index.js +18 -12
- package/dist/{catalog.module-BTnMsE6u.d.ts → catalog.module-B5E8tsl7.d.ts} +6 -2
- package/dist/{catalog.module-BDDO6iwq.d.cts → catalog.module-DKVvsPsl.d.cts} +6 -2
- package/dist/checkout-offer/index.d.cts +16 -22
- package/dist/checkout-offer/index.d.ts +16 -22
- package/dist/checkout-offer/index.js +18 -5
- package/dist/checkout-offer.module-DFhGy6JO.d.cts +58 -0
- package/dist/checkout-offer.module-x7SP_dX4.d.ts +58 -0
- package/dist/checkout-offer.service-BP4CoZle.d.ts +199 -0
- package/dist/checkout-offer.service-Bk5mHEoR.d.cts +199 -0
- package/dist/{chunk-DQKCK7DX.js → chunk-323FB6TD.js} +11 -102
- package/dist/chunk-34XVPR6P.js +222 -0
- package/dist/chunk-3HT3REXB.js +110 -0
- package/dist/chunk-5BCYJ3QY.js +44 -0
- package/dist/chunk-5CKC7O52.js +140 -0
- package/dist/{chunk-6Z7JR4EW.js → chunk-6ISJMNW7.js} +1837 -590
- package/dist/chunk-CRCNY3U6.js +313 -0
- package/dist/{chunk-TXC3LHHB.js → chunk-DTIYUJH5.js} +6 -8
- package/dist/{chunk-VIJ5NJWC.js → chunk-FQS5FPH2.js} +74 -19
- package/dist/chunk-G7RQO2XO.js +0 -0
- package/dist/{chunk-N3L3AICU.js → chunk-GPQWGA6B.js} +5 -6
- package/dist/chunk-GZTL64QK.js +7 -0
- package/dist/{chunk-NHVDCYK5.js → chunk-IORLRWJZ.js} +71 -106
- package/dist/{chunk-SABTXESR.js → chunk-J7NJRK3K.js} +17 -1
- package/dist/{chunk-I7GTA3RX.js → chunk-JQRA724W.js} +1 -1
- package/dist/{chunk-WXYJHZCN.js → chunk-JVAEKTJ4.js} +2 -14
- package/dist/chunk-KPEMTBOP.js +26 -0
- package/dist/{chunk-WOVQPXV4.js → chunk-NCXGXNQK.js} +585 -710
- package/dist/{chunk-NA6O63B7.js → chunk-NEICZJE4.js} +5 -5
- package/dist/{chunk-LTT736P3.js → chunk-OAUN2FPJ.js} +183 -371
- package/dist/{chunk-O2J2HDXA.js → chunk-OOTEXP47.js} +3 -8
- package/dist/chunk-QBF7KLSA.js +96 -0
- package/dist/chunk-QSBMFY4I.js +33 -0
- package/dist/{chunk-RUNZ3X4C.js → chunk-RSAPMUGB.js} +1239 -164
- package/dist/{chunk-XBYAFEOR.js → chunk-S33SO5XX.js} +1 -1
- package/dist/chunk-SZ7RFPXA.js +10 -0
- package/dist/{chunk-KFT5AIIH.js → chunk-U465NU23.js} +197 -22
- package/dist/chunk-U4X2YRRO.js +214 -0
- package/dist/{chunk-AU3OOREM.js → chunk-WYXLTSUZ.js} +14 -3
- package/dist/chunk-X4PDUYBX.js +1142 -0
- package/dist/{chunk-SEPN52AD.js → chunk-XDRJ4FRG.js} +506 -311
- package/dist/{chunk-VXEYLNIB.js → chunk-XWAZNKAB.js} +9 -3
- package/dist/chunk-YFCTBLM5.js +525 -0
- package/dist/{chunk-7ZEGFL42.js → chunk-ZUOCCEWB.js} +5 -5
- package/dist/contract-line-item-money-BWWQhRul.d.cts +11 -0
- package/dist/contract-line-item-money-BWWQhRul.d.ts +11 -0
- package/dist/discovery/index.d.cts +2 -2
- package/dist/discovery/index.d.ts +2 -2
- package/dist/discovery/index.js +6 -6
- package/dist/{discovery.scanner-9cMqF95o.d.cts → discovery.scanner-DXKc6JkV.d.cts} +1 -1
- package/dist/{discovery.scanner-9cMqF95o.d.ts → discovery.scanner-DXKc6JkV.d.ts} +1 -1
- package/dist/{enforce-quota.interceptor-Df0e3OWe.d.cts → enforce-quota.interceptor-CLyCNVIm.d.cts} +2 -2
- package/dist/{enforce-quota.interceptor-DW3etVyI.d.ts → enforce-quota.interceptor-DQ_BN_jV.d.ts} +2 -2
- package/dist/entitlement/index.d.cts +26 -4
- package/dist/entitlement/index.d.ts +26 -4
- package/dist/entitlement/index.js +13 -7
- package/dist/index.d.cts +208 -28
- package/dist/index.d.ts +208 -28
- package/dist/index.js +267 -159
- package/dist/issuer-identity.check-B8Wzugbf.d.cts +197 -0
- package/dist/issuer-identity.check-q-Uha5XY.d.ts +197 -0
- package/dist/{module-options-COSEb0VW.d.ts → module-options-C5EBOxzm.d.ts} +123 -39
- package/dist/{module-options-BG3MzQva.d.cts → module-options-Cr5FkELF.d.cts} +123 -39
- package/dist/payment-callback.service-DPUfjp-F.d.cts +97 -0
- package/dist/payment-callback.service-DPUfjp-F.d.ts +97 -0
- package/dist/payments/index.cjs +4 -0
- package/dist/payments/index.d.cts +133 -0
- package/dist/payments/index.d.ts +133 -0
- package/dist/payments/index.js +135 -0
- package/dist/payments.module-C6r6dJdn.d.ts +54 -0
- package/dist/payments.module-Da26YttL.d.cts +54 -0
- package/dist/{plan-resolution-Cgo_TR1H.d.cts → plan-resolution-CwUy_OqC.d.cts} +14 -0
- package/dist/{plan-resolution-Cgo_TR1H.d.ts → plan-resolution-CwUy_OqC.d.ts} +14 -0
- package/dist/{plan-versions.service-TPEtbN0r.d.cts → plan-versions.service-BM7lKLr1.d.cts} +41 -21
- package/dist/{plan-versions.service-DChhbK6h.d.ts → plan-versions.service-BTlw-aEX.d.ts} +41 -21
- package/dist/platform/index.d.cts +51 -23
- package/dist/platform/index.d.ts +51 -23
- package/dist/platform/index.js +54 -34
- package/dist/promo/index.d.cts +18 -6
- package/dist/promo/index.d.ts +18 -6
- package/dist/promo/index.js +14 -7
- package/dist/{promo.module-Z8h1PNX-.d.ts → promo.module-KmIpp1Gb.d.ts} +2 -2
- package/dist/{promo.module-DtvIycpt.d.cts → promo.module-YfF6ADDf.d.cts} +2 -2
- package/dist/{promo.service-BJbKAmw3.d.cts → promo.service-CBMm9RU7.d.cts} +2 -1
- package/dist/{promo.service-BJbKAmw3.d.ts → promo.service-CBMm9RU7.d.ts} +2 -1
- package/dist/registration/index.d.cts +81 -49
- package/dist/registration/index.d.ts +81 -49
- package/dist/registration/index.js +8 -9
- package/dist/subscriber/index.cjs +4 -0
- package/dist/subscriber/index.d.cts +28 -0
- package/dist/subscriber/index.d.ts +28 -0
- package/dist/subscriber/index.js +15 -0
- package/dist/subscriber.service-BZsvHw1V.d.cts +57 -0
- package/dist/subscriber.service-BZsvHw1V.d.ts +57 -0
- package/dist/subscription-contract/index.d.cts +4 -2
- package/dist/subscription-contract/index.d.ts +4 -2
- package/dist/subscription-contract/index.js +11 -5
- package/dist/{subscription-contract.module-fDFdQ0jm.d.ts → subscription-contract.module-BfIRpc1o.d.ts} +8 -2
- package/dist/{subscription-contract.module-CEK8HS5-.d.cts → subscription-contract.module-DTMuUJYd.d.cts} +8 -2
- package/dist/{subscription-contract.service-hD87MKyg.d.ts → subscription-contract.service-D7Qb_Ns-.d.cts} +32 -3
- package/dist/{subscription-contract.service-hD87MKyg.d.cts → subscription-contract.service-Duv_Ns1W.d.ts} +32 -3
- package/dist/tenant-billing.controller-0HZ_2DQH.d.ts +811 -0
- package/dist/tenant-billing.controller-CN9DgasV.d.cts +811 -0
- package/dist/{tenant-billing.module-wUbsQSFG.d.ts → tenant-billing.module-C1sLBCW-.d.ts} +153 -96
- package/dist/{tenant-billing.module-BznC3XtW.d.cts → tenant-billing.module-CPybDf7c.d.cts} +153 -96
- package/dist/tenant-billing.tokens-G-1xOlMr.d.cts +129 -0
- package/dist/tenant-billing.tokens-G-1xOlMr.d.ts +129 -0
- package/dist/testing/index.d.cts +43 -17
- package/dist/testing/index.d.ts +43 -17
- package/dist/testing/index.js +188 -39
- package/package.json +24 -4
- package/dist/checkout-offer.module-CMtiQJTT.d.ts +0 -39
- package/dist/checkout-offer.module-CVpWrzbe.d.cts +0 -39
- package/dist/checkout-offer.service-BLOv2HOo.d.cts +0 -49
- package/dist/checkout-offer.service-BLOv2HOo.d.ts +0 -49
- package/dist/chunk-57V6ZTI6.js +0 -22
- package/dist/chunk-BSK6YBLI.js +0 -87
- package/dist/chunk-WUDYIPYH.js +0 -715
- package/dist/define-saasicat-DROBe-b1.d.ts +0 -69
- package/dist/define-saasicat-vGBCkFys.d.cts +0 -69
- package/dist/tenant-billing.controller-BQ67mlmI.d.ts +0 -438
- package/dist/tenant-billing.controller-DS8kB8a7.d.cts +0 -438
- /package/dist/{chunk-2FR6ZL7R.js → chunk-BHZOH2DY.js} +0 -0
- /package/dist/{chunk-2SLTRKXC.js → chunk-DFOW3JVO.js} +0 -0
- /package/dist/{chunk-DBZGV3HC.js → chunk-DU56UKEH.js} +0 -0
- /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
|
-
##
|
|
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
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
`./
|
|
18
|
-
`./
|
|
33
|
+
| Entry | What is in it | When you take it |
|
|
34
|
+
| ------------------------- | --------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
35
|
+
| `.` | `SaaSiCatModule`, `defineSaaSiCat` and the option types — the 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
|
-
|
|
1
|
+
88f7851acc889a5928376f888032eafa4960455aca4dd6c0d99ae171c43defb7
|