@saasicat/nest 1.0.0-rc.20 → 1.0.0-rc.21
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/dist/.build-stamp +1 -1
- package/dist/_entries.cjs +3570 -2574
- package/dist/admin/index.d.cts +5 -4
- package/dist/admin/index.d.ts +5 -4
- package/dist/admin/index.js +2 -1
- package/dist/{admin-resources.module-aOJ_0rur.d.cts → admin-resources.module-B4XNvdH-.d.cts} +0 -1
- package/dist/{admin-resources.module-BENMc0Wh.d.ts → admin-resources.module-CWqdI9BV.d.ts} +0 -1
- package/dist/{admin-stats.service-cwLMrkGl.d.ts → admin-stats.service-CsLNt19Z.d.ts} +10 -6
- package/dist/{admin-stats.service-BJdzHCtJ.d.cts → admin-stats.service-DrZrU8IJ.d.cts} +10 -6
- package/dist/{aggregation-CtIjlWHT.d.ts → aggregation-ChpZDh0g.d.ts} +20 -4
- package/dist/{aggregation-BHo7a_In.d.cts → aggregation-OpnhwzF5.d.cts} +20 -4
- package/dist/billing/index.d.cts +23 -16
- package/dist/billing/index.d.ts +23 -16
- package/dist/billing/index.js +20 -15
- package/dist/catalog/index.d.cts +17 -8
- package/dist/catalog/index.d.ts +17 -8
- package/dist/catalog/index.js +5 -3
- package/dist/{catalog.module-B5E8tsl7.d.ts → catalog.module-C9O7BxRq.d.ts} +80 -7
- package/dist/{catalog.module-DKVvsPsl.d.cts → catalog.module-T-I5Ricz.d.cts} +80 -7
- package/dist/checkout-offer/index.d.cts +5 -4
- package/dist/checkout-offer/index.d.ts +5 -4
- package/dist/checkout-offer/index.js +15 -14
- package/dist/{checkout-offer.service-BP4CoZle.d.ts → checkout-offer.service-BeHgYikI.d.ts} +51 -8
- package/dist/{checkout-offer.service-Bk5mHEoR.d.cts → checkout-offer.service-CCVxG9b2.d.cts} +51 -8
- package/dist/{chunk-AOQJEYOL.js → chunk-3QVGA6JX.js} +3 -1
- package/dist/chunk-3RLWML2S.js +896 -0
- package/dist/{chunk-DTIYUJH5.js → chunk-4SDSYV4A.js} +16 -6
- package/dist/{chunk-X4PDUYBX.js → chunk-55QEDAMX.js} +106 -302
- package/dist/chunk-6PJE7EWO.js +185 -0
- package/dist/{chunk-CRCNY3U6.js → chunk-7NJKVC5X.js} +54 -14
- package/dist/{chunk-RSAPMUGB.js → chunk-AOS2JPDD.js} +67 -64
- package/dist/{chunk-NCXGXNQK.js → chunk-CQ2ZZMTD.js} +174 -72
- package/dist/{chunk-NEICZJE4.js → chunk-F5X66HF5.js} +1 -1
- package/dist/{chunk-323FB6TD.js → chunk-FEQZCWUL.js} +67 -19
- package/dist/{chunk-FQS5FPH2.js → chunk-G6EZWECL.js} +42 -21
- package/dist/{chunk-XDRJ4FRG.js → chunk-JBCC6C3M.js} +84 -20
- package/dist/chunk-LF6J4YYN.js +301 -0
- package/dist/{chunk-OAUN2FPJ.js → chunk-LLYVYRGJ.js} +50 -21
- package/dist/{chunk-6ISJMNW7.js → chunk-M47BNEY2.js} +125 -108
- package/dist/{chunk-U465NU23.js → chunk-NDLC5GYK.js} +40 -33
- package/dist/{chunk-YFCTBLM5.js → chunk-QPVDCKYS.js} +237 -60
- package/dist/{chunk-IORLRWJZ.js → chunk-R5YCJBHY.js} +2 -2
- package/dist/{chunk-QBF7KLSA.js → chunk-TBBZWZQT.js} +8 -6
- package/dist/chunk-TOEFN7DN.js +295 -0
- package/dist/{chunk-ZUOCCEWB.js → chunk-WHJSYKNC.js} +2 -2
- package/dist/chunk-WOEJ6K7M.js +55 -0
- package/dist/{chunk-WYXLTSUZ.js → chunk-XSSWYPP5.js} +6 -4
- package/dist/contract-line-item-money-B0Z3Ogur.d.cts +43 -0
- package/dist/contract-line-item-money-B0Z3Ogur.d.ts +43 -0
- package/dist/{enforce-quota.interceptor-CLyCNVIm.d.cts → enforce-quota.interceptor-BFyVdWe8.d.cts} +6 -6
- package/dist/{enforce-quota.interceptor-DQ_BN_jV.d.ts → enforce-quota.interceptor-GaBXboGx.d.ts} +6 -6
- package/dist/entitlement/index.d.cts +2 -1
- package/dist/entitlement/index.d.ts +2 -1
- package/dist/entitlement/index.js +6 -7
- package/dist/index.d.cts +27 -26
- package/dist/index.d.ts +27 -26
- package/dist/index.js +47 -33
- package/dist/{issuer-identity.check-B8Wzugbf.d.cts → issuer-identity.check-CBO0vcsq.d.cts} +5 -5
- package/dist/{issuer-identity.check-q-Uha5XY.d.ts → issuer-identity.check-Cz9CEMkZ.d.ts} +5 -5
- package/dist/{module-options-C5EBOxzm.d.ts → module-options-DmQ3G4sZ.d.ts} +17 -7
- package/dist/{module-options-Cr5FkELF.d.cts → module-options-qAOwinHR.d.cts} +17 -7
- package/dist/{payment-callback.service-DPUfjp-F.d.cts → payment-callback.service-CR84Xw1Z.d.cts} +31 -3
- package/dist/{payment-callback.service-DPUfjp-F.d.ts → payment-callback.service-CR84Xw1Z.d.ts} +31 -3
- package/dist/payments/index.d.cts +59 -5
- package/dist/payments/index.d.ts +59 -5
- package/dist/payments/index.js +11 -5
- package/dist/{payments.module-Da26YttL.d.cts → payments.module-BdUq9ot_.d.cts} +5 -2
- package/dist/{payments.module-C6r6dJdn.d.ts → payments.module-CQGv_VG7.d.ts} +5 -2
- package/dist/plan-catalog-source-DWe-BGY1.d.cts +21 -0
- package/dist/plan-catalog-source-DWe-BGY1.d.ts +21 -0
- package/dist/{plan-versions.service-BTlw-aEX.d.ts → plan-versions.service-C0N-Em2W.d.ts} +2 -48
- package/dist/{plan-versions.service-BM7lKLr1.d.cts → plan-versions.service-DARLh-qI.d.cts} +2 -48
- package/dist/platform/index.d.cts +20 -19
- package/dist/platform/index.d.ts +20 -19
- package/dist/platform/index.js +22 -21
- package/dist/promo/index.d.cts +9 -6
- package/dist/promo/index.d.ts +9 -6
- package/dist/promo/index.js +7 -6
- package/dist/{promo.module-YfF6ADDf.d.cts → promo.module-CKkECmU8.d.cts} +8 -2
- package/dist/{promo.module-KmIpp1Gb.d.ts → promo.module-DuIJdK3U.d.ts} +8 -2
- package/dist/promo.service-BYBu6dy3.d.cts +215 -0
- package/dist/promo.service-CFjfF0Xm.d.ts +215 -0
- package/dist/registration/index.d.cts +29 -4
- package/dist/registration/index.d.ts +29 -4
- package/dist/registration/index.js +12 -5
- package/dist/subscriber/index.d.cts +2 -2
- package/dist/subscriber/index.d.ts +2 -2
- package/dist/subscriber/index.js +5 -4
- package/dist/{subscriber.service-BZsvHw1V.d.cts → subscriber.service-5W6Gi-1B.d.cts} +14 -3
- package/dist/{subscriber.service-BZsvHw1V.d.ts → subscriber.service-5W6Gi-1B.d.ts} +14 -3
- package/dist/subscription-contract/index.d.cts +3 -3
- package/dist/subscription-contract/index.d.ts +3 -3
- package/dist/subscription-contract/index.js +11 -9
- package/dist/{subscription-contract.service-Duv_Ns1W.d.ts → subscription-contract.service-CPZrTM9C.d.ts} +1 -1
- package/dist/{subscription-contract.service-D7Qb_Ns-.d.cts → subscription-contract.service-CfNApLuP.d.cts} +1 -1
- package/dist/{tenant-billing.controller-0HZ_2DQH.d.ts → tenant-billing.controller-BLqbsONe.d.ts} +7 -6
- package/dist/{tenant-billing.controller-CN9DgasV.d.cts → tenant-billing.controller-DKbAqTbM.d.cts} +7 -6
- package/dist/{tenant-billing.module-CPybDf7c.d.cts → tenant-billing.module-ClbjzocC.d.cts} +24 -16
- package/dist/{tenant-billing.module-C1sLBCW-.d.ts → tenant-billing.module-DohgJJ2m.d.ts} +24 -16
- package/dist/testing/index.d.cts +11 -10
- package/dist/testing/index.d.ts +11 -10
- package/dist/testing/index.js +20 -20
- package/package.json +3 -3
- package/dist/chunk-3HT3REXB.js +0 -110
- package/dist/chunk-5BCYJ3QY.js +0 -44
- package/dist/chunk-QSBMFY4I.js +0 -33
- package/dist/chunk-U4X2YRRO.js +0 -214
- package/dist/chunk-XWAZNKAB.js +0 -638
- package/dist/contract-line-item-money-BWWQhRul.d.cts +0 -11
- package/dist/contract-line-item-money-BWWQhRul.d.ts +0 -11
- package/dist/promo.service-CBMm9RU7.d.cts +0 -113
- package/dist/promo.service-CBMm9RU7.d.ts +0 -113
package/dist/{checkout-offer.service-Bk5mHEoR.d.cts → checkout-offer.service-CCVxG9b2.d.cts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as SubscriptionContractService, C as CreateContractFromOfferOptions } from './subscription-contract.service-
|
|
3
|
-
import { S as SubscriberService } from './subscriber.service-
|
|
4
|
-
import { a as PromoCodesService } from './promo.service-
|
|
1
|
+
import { PlanCatalogSettings, PlanRepository, BundleRepository, PromotionRepository, CheckoutOfferPriceBreakdown, CheckoutOfferLineItem, CheckoutOfferPromotionSnapshot, CheckoutOfferPromoCodeSnapshot, CheckoutOfferRow, CheckoutOfferRepository, CatalogEntryRepository, TransactionRunner, CheckoutOfferFilter, CheckoutOfferSelection, CheckoutOfferSelectionUpdate, NewSubscriberDetails, TransactionContext, SubscriptionContractRecord } from '@saasicat/core';
|
|
2
|
+
import { S as SubscriptionContractService, C as CreateContractFromOfferOptions } from './subscription-contract.service-CfNApLuP.cjs';
|
|
3
|
+
import { S as SubscriberService } from './subscriber.service-5W6Gi-1B.cjs';
|
|
4
|
+
import { a as PromoCodesService } from './promo.service-BYBu6dy3.cjs';
|
|
5
5
|
|
|
6
6
|
type Cycle = 'monthly' | 'yearly';
|
|
7
7
|
/** What pricing needs to know about a selection. */
|
|
@@ -11,6 +11,16 @@ interface CheckoutOfferPricingInput {
|
|
|
11
11
|
bundleVersionIds: readonly string[];
|
|
12
12
|
promoCode: string | null;
|
|
13
13
|
locale: string;
|
|
14
|
+
/**
|
|
15
|
+
* The offer when it is priced again. A slot of its promo code held for its
|
|
16
|
+
* checkout is its own, not counted against it.
|
|
17
|
+
*/
|
|
18
|
+
checkoutOfferId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Priced as the offer is concluded: its held slot also keeps the code as it
|
|
21
|
+
* stood when the slot was taken.
|
|
22
|
+
*/
|
|
23
|
+
concluding?: boolean;
|
|
14
24
|
}
|
|
15
25
|
/** The part of a stored offer the server computes. */
|
|
16
26
|
interface PricedCheckoutOffer {
|
|
@@ -25,12 +35,12 @@ interface PricedCheckoutOffer {
|
|
|
25
35
|
promoCodeSnapshot: CheckoutOfferPromoCodeSnapshot | null;
|
|
26
36
|
}
|
|
27
37
|
declare class CheckoutOfferPricing {
|
|
28
|
-
private readonly
|
|
38
|
+
private readonly settings;
|
|
29
39
|
private readonly plans;
|
|
30
40
|
private readonly bundles;
|
|
31
41
|
private readonly promotions;
|
|
32
42
|
private readonly promoCodes;
|
|
33
|
-
constructor(
|
|
43
|
+
constructor(settings: PlanCatalogSettings, plans: PlanRepository, bundles?: BundleRepository | null, promotions?: PromotionRepository | null, promoCodes?: PromoCodesService | null);
|
|
34
44
|
/** Prices a selection against the plan version on sale now. */
|
|
35
45
|
price(input: CheckoutOfferPricingInput, asOf?: Date): Promise<PricedCheckoutOffer>;
|
|
36
46
|
/**
|
|
@@ -98,16 +108,43 @@ declare class CheckoutOfferService {
|
|
|
98
108
|
private readonly contracts;
|
|
99
109
|
private readonly transactions;
|
|
100
110
|
private readonly subscribers;
|
|
101
|
-
|
|
111
|
+
private readonly promoCodes;
|
|
112
|
+
constructor(repo: CheckoutOfferRepository, pricing: CheckoutOfferPricing, bundles?: BundleRepository | null, plans?: PlanRepository | null, catalogEntries?: CatalogEntryRepository | null, contracts?: SubscriptionContractService | null, transactions?: TransactionRunner | null, subscribers?: SubscriberService | null, promoCodes?: PromoCodesService | null);
|
|
102
113
|
list(filter: CheckoutOfferFilter): Promise<CheckoutOfferRow[]>;
|
|
103
114
|
getById(id: string): Promise<CheckoutOfferRow>;
|
|
104
115
|
/** Prices what the caller chose and stores it as an open offer. */
|
|
105
116
|
create(selection: CheckoutOfferSelection): Promise<CheckoutOfferRow>;
|
|
106
117
|
/**
|
|
107
118
|
* Customization in onboarding — only while the offer is `open`. The plan
|
|
108
|
-
* stays; whatever else changes, the whole offer is priced again.
|
|
119
|
+
* stays; whatever else changes, the whole offer is priced again. A slot of
|
|
120
|
+
* its promo code held for its checkout stays with it while the code does,
|
|
121
|
+
* and is given back when the code is changed or removed.
|
|
109
122
|
*/
|
|
110
123
|
update(id: string, change: CheckoutOfferSelectionUpdate): Promise<CheckoutOfferRow>;
|
|
124
|
+
/**
|
|
125
|
+
* Holds a slot of the offer's promo code for its checkout until `until` —
|
|
126
|
+
* what a sign-up does as its checkout starts, until a confirmation of its
|
|
127
|
+
* payment form can no longer arrive — so that the code cannot run out
|
|
128
|
+
* before the payment is confirmed and the offer concluded. A live slot the
|
|
129
|
+
* offer holds of that code already moves to `until`, never earlier. The
|
|
130
|
+
* conclusion turns the slot into the redemption; the slot goes back when
|
|
131
|
+
* the offer's code changes or `until` passes.
|
|
132
|
+
*
|
|
133
|
+
* Refused, and nothing held, when the offer is no longer open or its code
|
|
134
|
+
* cannot be held: `PROMO_CODE_NOT_REDEEMABLE` with the reason a preview
|
|
135
|
+
* gives, `EXHAUSTED` when every slot is redeemed or held. An offer without
|
|
136
|
+
* a code holds nothing.
|
|
137
|
+
*/
|
|
138
|
+
holdPromoCode(id: string, hold: {
|
|
139
|
+
email?: string;
|
|
140
|
+
until: Date;
|
|
141
|
+
}): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Gives back the slot held for the offer's checkout while it is still held
|
|
144
|
+
* until `heldUntil`, as the caller wrote it. A slot another start of the
|
|
145
|
+
* checkout moved later stays with the form that start opened.
|
|
146
|
+
*/
|
|
147
|
+
releasePromoCodeHold(id: string, heldUntil: Date): Promise<void>;
|
|
111
148
|
/**
|
|
112
149
|
* Freezes the offer (`status = 'consumed'`). Returns the final
|
|
113
150
|
* snapshot — the caller (registration/billing) writes it
|
|
@@ -158,6 +195,12 @@ declare class CheckoutOfferService {
|
|
|
158
195
|
* where a refusal still undoes everything. Nothing checks the code again
|
|
159
196
|
* after `within`, so a redemption that takes its last slot does not refuse
|
|
160
197
|
* the offer it was redeemed for.
|
|
198
|
+
*
|
|
199
|
+
* A slot held for the offer's checkout (`holdPromoCode`) is the offer's own
|
|
200
|
+
* throughout: the checks before the transaction do not count it against
|
|
201
|
+
* the code and accept the code as it stood when the slot was held, and the
|
|
202
|
+
* redemption in `within` takes that slot rather than a free one. A slot
|
|
203
|
+
* `within` did not redeem is given back before the conclusion commits.
|
|
161
204
|
*/
|
|
162
205
|
conclude(id: string, options: ConcludeCheckoutOfferOptions, within?: ConcludeCheckoutOfferWithin): Promise<ConcludedCheckoutOffer>;
|
|
163
206
|
private assertConsumable;
|
|
@@ -7,6 +7,7 @@ var PROMOTION_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/Promo
|
|
|
7
7
|
var MARKETING_SETTINGS_REPOSITORY_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/MarketingSettingsRepository");
|
|
8
8
|
var CATALOG_SERVICE_CONFIG_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/CatalogServiceConfig");
|
|
9
9
|
var CATALOG_FEATURE_UI_REGISTRY_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/CatalogFeatureUiRegistry");
|
|
10
|
+
var NEW_PAYMENT_METHODS_SOURCE_TOKEN = /* @__PURE__ */ Symbol.for("saasicat/nest/NewPaymentMethodsSource");
|
|
10
11
|
|
|
11
12
|
export {
|
|
12
13
|
PLAN_REPOSITORY_TOKEN,
|
|
@@ -16,5 +17,6 @@ export {
|
|
|
16
17
|
PROMOTION_REPOSITORY_TOKEN,
|
|
17
18
|
MARKETING_SETTINGS_REPOSITORY_TOKEN,
|
|
18
19
|
CATALOG_SERVICE_CONFIG_TOKEN,
|
|
19
|
-
CATALOG_FEATURE_UI_REGISTRY_TOKEN
|
|
20
|
+
CATALOG_FEATURE_UI_REGISTRY_TOKEN,
|
|
21
|
+
NEW_PAYMENT_METHODS_SOURCE_TOKEN
|
|
20
22
|
};
|