@rebuy/rebuy 3.55.0 → 3.56.1
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/index.cjs +317 -273
- package/dist/index.mjs +317 -273
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/postPurchaseAdmission.d.ts +5 -5
- package/dist/schema/postPurchaseLedger.d.ts +56 -0
- package/dist/schema/postPurchaseProduct.d.ts +2 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +3 -0
- package/dist/schema/postPurchaseProductView.d.ts +5 -1
- package/dist/schema/postPurchaseSession.d.ts +14 -0
- package/dist/schema/postPurchaseSubscription.d.ts +1 -0
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +2 -0
- package/dist/server/index.cjs +71 -24
- package/dist/server/index.mjs +71 -24
- package/dist/server/normalizePostPurchaseCollection.d.ts +1 -0
- package/dist/server/normalizePostPurchaseProduct.d.ts +21 -2
- package/dist/server/postPurchaseCardSections.d.ts +2 -2
- package/dist/server/postPurchasePlanCatalog.d.ts +2 -1
- package/dist/server/postPurchaseSts.d.ts +6 -0
- package/dist/server/prepareNormalizedSubscription.d.ts +2 -1
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +3 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +3 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +3 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +3 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +3 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +3 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +14 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +3 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +3 -0
- package/dist/server/preparePostPurchaseStsMember.d.ts +4 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +1 -0
- package/dist/transforms/index.cjs +17 -11
- package/dist/transforms/index.mjs +17 -11
- package/package.json +1 -1
package/dist/server/index.mjs
CHANGED
|
@@ -4571,9 +4571,11 @@ var HAS_RECURRING_TOTAL = "hasRecurringTotal";
|
|
|
4571
4571
|
var HAS_RECURRING_SHIPPING = "hasRecurringShipping";
|
|
4572
4572
|
var small = { color: "subdued", fontSize: "small" };
|
|
4573
4573
|
var FOOTNOTES = ["Doesn't include tax, duties, or any applicable discounts.", "Auto-renews, skip or cancel anytime"];
|
|
4574
|
+
var countsRecurringShipping = ({ productType, upgradeToSubscription }) => productType === "subscription" && upgradeToSubscription.allow;
|
|
4574
4575
|
var recurringSummary = (settings) => {
|
|
4575
4576
|
if (!sellsSubscription(settings)) return [];
|
|
4576
4577
|
const { global: global2 } = settings.language;
|
|
4578
|
+
const shipping = countsRecurringShipping(settings);
|
|
4577
4579
|
return [
|
|
4578
4580
|
{
|
|
4579
4581
|
direction: "rows",
|
|
@@ -4584,18 +4586,20 @@ var recurringSummary = (settings) => {
|
|
|
4584
4586
|
columns: ["fill", "auto", "auto"],
|
|
4585
4587
|
label: merchantLabel(global2.recurringSubtotal, "Recurring subtotal"),
|
|
4586
4588
|
spacing: "extraTight",
|
|
4587
|
-
token: "{{recurringTotal}}",
|
|
4589
|
+
token: shipping ? "{{recurringTotal}}" : "{{recurringSubtotal}}",
|
|
4588
4590
|
variable: HAS_RECURRING_TOTAL
|
|
4589
4591
|
}),
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4592
|
+
...shipping ? [
|
|
4593
|
+
earnedRow({
|
|
4594
|
+
after: "(included)",
|
|
4595
|
+
columns: ["auto", "auto", "auto"],
|
|
4596
|
+
label: { en: `${merchantLabel(global2.recurringShipping, "Recurring shipping").en}:` },
|
|
4597
|
+
look: small,
|
|
4598
|
+
spacing: "extraTight",
|
|
4599
|
+
token: "{{recurringShipping}}",
|
|
4600
|
+
variable: HAS_RECURRING_SHIPPING
|
|
4601
|
+
})
|
|
4602
|
+
] : [],
|
|
4599
4603
|
...FOOTNOTES.map((text2) => ({
|
|
4600
4604
|
content: { en: styledCopy(text2, small) },
|
|
4601
4605
|
sectionType: "text",
|
|
@@ -4604,7 +4608,9 @@ var recurringSummary = (settings) => {
|
|
|
4604
4608
|
],
|
|
4605
4609
|
sectionType: "layout",
|
|
4606
4610
|
spacing: "tight",
|
|
4607
|
-
variables: earnedVariables(
|
|
4611
|
+
variables: earnedVariables(
|
|
4612
|
+
shipping ? [HAS_RECURRING_TOTAL, HAS_RECURRING_SHIPPING] : [HAS_RECURRING_TOTAL]
|
|
4613
|
+
)
|
|
4608
4614
|
}
|
|
4609
4615
|
];
|
|
4610
4616
|
};
|
|
@@ -6134,9 +6140,15 @@ var normalizePostPurchaseSource = (settings, response, report) => {
|
|
|
6134
6140
|
}
|
|
6135
6141
|
const effective = PostPurchaseProductSettings.parse(merge({}, original, overrides));
|
|
6136
6142
|
const data = products.map(({ product }) => product);
|
|
6137
|
-
|
|
6143
|
+
const emptiedByDrop = !data.length && dropped.length > 0;
|
|
6144
|
+
return { dropped, normalized: { data, effective, emptiedByDrop, metadata, original }, products };
|
|
6145
|
+
};
|
|
6146
|
+
var underPostPurchaseCap = (entries, cap) => entries.filter(({ productIndex }) => productIndex < cap);
|
|
6147
|
+
var normalizePostPurchaseProduct = (settings, response, report) => {
|
|
6148
|
+
const { normalized, products } = normalizePostPurchaseSource(settings, response, report);
|
|
6149
|
+
const capped = normalized.effective.productLimit === 1 && products.length > 0 && !underPostPurchaseCap(products, 1).length;
|
|
6150
|
+
return capped ? { ...normalized, data: [], emptiedByDrop: true } : normalized;
|
|
6138
6151
|
};
|
|
6139
|
-
var normalizePostPurchaseProduct = (settings, response, report) => normalizePostPurchaseSource(settings, response, report).normalized;
|
|
6140
6152
|
|
|
6141
6153
|
// src/pricing/amountToCents.ts
|
|
6142
6154
|
var round = (value, precision = 0) => {
|
|
@@ -6291,6 +6303,7 @@ var readPostPurchaseModernPlans = (raw, allocations) => {
|
|
|
6291
6303
|
var projectPostPurchasePlanCatalog = (normalized, report) => {
|
|
6292
6304
|
const { data } = normalized;
|
|
6293
6305
|
if (data.length === 1 && data[0].variants.length > 1) return null;
|
|
6306
|
+
if (normalized.emptiedByDrop && !data.length) return null;
|
|
6294
6307
|
try {
|
|
6295
6308
|
if (data.length !== 1 || data[0].variants.length !== 1) throw new Error("Ambiguous product");
|
|
6296
6309
|
const product = data[0];
|
|
@@ -6409,7 +6422,9 @@ var PostPurchaseSubscriptionTerms = z56.object({
|
|
|
6409
6422
|
intervalLabel: z56.string().min(1),
|
|
6410
6423
|
name: z56.string().min(1),
|
|
6411
6424
|
recurringShippingPrice: z56.number().nonnegative(),
|
|
6412
|
-
shippingOption: z56.object({ presentmentTitle: z56.string(), title: z56.string() })
|
|
6425
|
+
shippingOption: z56.object({ presentmentTitle: z56.string(), title: z56.string() }),
|
|
6426
|
+
/** A switch to subscription (STS): the one subscription that charges no initial shipping (L122). */
|
|
6427
|
+
sts: z56.literal(true).optional()
|
|
6413
6428
|
});
|
|
6414
6429
|
|
|
6415
6430
|
// src/schema/postPurchaseProduct.ts
|
|
@@ -6468,7 +6483,8 @@ var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
|
6468
6483
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
6469
6484
|
subscription: PostPurchaseSubscriptionTerms
|
|
6470
6485
|
}).refine(
|
|
6471
|
-
({ discount, shipping, subscription: subscription2 }) => (discount.type !== "none" || discount.amount === 0) &&
|
|
6486
|
+
({ discount, shipping, subscription: subscription2 }) => (discount.type !== "none" || discount.amount === 0) && // A switch to subscription charges no initial shipping (L122); any other subscription charges it.
|
|
6487
|
+
subscription2.initialShippingPrice === (subscription2.sts ? 0 : shipping.amount) && shipping.amount === subscription2.recurringShippingPrice && (shipping.type !== "free" || shipping.amount === 0)
|
|
6472
6488
|
)
|
|
6473
6489
|
});
|
|
6474
6490
|
|
|
@@ -6816,6 +6832,7 @@ var prepareNormalizedSubscription = (normalized, report, plan, quantity3, allowC
|
|
|
6816
6832
|
const projected = projectPostPurchaseProduct(normalized, report, quantity3);
|
|
6817
6833
|
const { discount, shipping } = PostPurchaseSubscriptionSettings.parse(effective.subscription);
|
|
6818
6834
|
const shippingPrice = shipping.type === "free" ? 0 : shipping.amount;
|
|
6835
|
+
const sts = quantity3?.sts === true;
|
|
6819
6836
|
return PreparedPostPurchaseSubscription.parse({
|
|
6820
6837
|
...projected,
|
|
6821
6838
|
display: { ...projected.display, shouldShowSavingText: discount.shouldShowSavingText },
|
|
@@ -6830,11 +6847,12 @@ var prepareNormalizedSubscription = (normalized, report, plan, quantity3, allowC
|
|
|
6830
6847
|
shipping: { amount: shippingPrice, title: "Subscription shipping line", type: shipping.type },
|
|
6831
6848
|
subscription: {
|
|
6832
6849
|
...plan.adjustment ? { adjustment: plan.adjustment } : {},
|
|
6833
|
-
initialShippingPrice: shippingPrice,
|
|
6850
|
+
initialShippingPrice: sts ? 0 : shippingPrice,
|
|
6834
6851
|
intervalLabel: plan.intervalLabel,
|
|
6835
6852
|
name: plan.name,
|
|
6836
6853
|
recurringShippingPrice: shippingPrice,
|
|
6837
|
-
shippingOption: { presentmentTitle: "Subscription shipping line", title: "Subscription shipping line" }
|
|
6854
|
+
shippingOption: { presentmentTitle: "Subscription shipping line", title: "Subscription shipping line" },
|
|
6855
|
+
...sts ? { sts } : {}
|
|
6838
6856
|
}
|
|
6839
6857
|
}
|
|
6840
6858
|
});
|
|
@@ -7044,6 +7062,7 @@ var PostPurchaseProductChangeset = z72.object({
|
|
|
7044
7062
|
});
|
|
7045
7063
|
|
|
7046
7064
|
// src/schema/postPurchaseProductView.ts
|
|
7065
|
+
var StsMarker = z73.literal(true).optional();
|
|
7047
7066
|
var PostPurchaseProductView = z73.union([
|
|
7048
7067
|
z73.object({
|
|
7049
7068
|
changeset: PostPurchaseProductChangeset.optional(),
|
|
@@ -7059,6 +7078,7 @@ var PostPurchaseProductView = z73.union([
|
|
|
7059
7078
|
}),
|
|
7060
7079
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
7061
7080
|
sections: CABRootSection,
|
|
7081
|
+
sts: StsMarker,
|
|
7062
7082
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
7063
7083
|
}),
|
|
7064
7084
|
z73.object({
|
|
@@ -7071,6 +7091,7 @@ var PostPurchaseProductView = z73.union([
|
|
|
7071
7091
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
7072
7092
|
/** A choice-level unavailable product keeps its card (values resolve blank); configuration failures send null. */
|
|
7073
7093
|
sections: CABRootSection.nullable(),
|
|
7094
|
+
sts: StsMarker,
|
|
7074
7095
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
7075
7096
|
})
|
|
7076
7097
|
]);
|
|
@@ -7102,7 +7123,22 @@ var postPurchaseOfferCopy = (blocks, metadata) => {
|
|
|
7102
7123
|
};
|
|
7103
7124
|
|
|
7104
7125
|
// src/server/postPurchaseCardSections.ts
|
|
7105
|
-
var
|
|
7126
|
+
var stsCardSettings = ({ language: language3, productOptions, ...effective }) => ({
|
|
7127
|
+
...effective,
|
|
7128
|
+
language: {
|
|
7129
|
+
...language3,
|
|
7130
|
+
global: {
|
|
7131
|
+
...language3.global,
|
|
7132
|
+
payNow: language3.global.payNowUpgradeToSubscription || "Upgrade to Subscription"
|
|
7133
|
+
}
|
|
7134
|
+
},
|
|
7135
|
+
productOptions: { ...productOptions, showShipping: false }
|
|
7136
|
+
});
|
|
7137
|
+
var postPurchaseCardSections = (widgetId, {
|
|
7138
|
+
effective: configured,
|
|
7139
|
+
metadata
|
|
7140
|
+
}, report, sts = false) => {
|
|
7141
|
+
const effective = sts ? stsCardSettings(configured) : configured;
|
|
7106
7142
|
if (!effective.blocks?.length) return null;
|
|
7107
7143
|
const sections = convertMessagePreview(
|
|
7108
7144
|
widgetId,
|
|
@@ -7161,21 +7197,32 @@ var prepareNormalizedPostPurchaseView = (widgetId, normalized, report, choice, q
|
|
|
7161
7197
|
const selected = selectPostPurchaseChoice(normalized, planCatalog, choice, allowCollection, quantity3);
|
|
7162
7198
|
const purchaseOptions = selected.options;
|
|
7163
7199
|
const labels = { notAvailable: normalized.effective.language.global.notAvailable };
|
|
7200
|
+
const sts = quantity3?.sts === true;
|
|
7201
|
+
const marker = sts ? { sts: true } : {};
|
|
7164
7202
|
const preparation = !selected.choice ? { reason: selected.reason, status: "unsupported" } : selected.choice.mode === "subscription" ? prepareNormalizedSubscription(normalized, report, selected.plan, quantity3, allowCollection) : prepareNormalizedProduct(normalized, report, quantity3, allowCollection);
|
|
7165
7203
|
if (preparation.status === "unsupported") {
|
|
7166
|
-
const sections2 = isChoiceUnavailable(preparation.reason) ? postPurchaseCardSections(widgetId, normalized, report) : null;
|
|
7167
|
-
return PostPurchaseProductView.parse({
|
|
7204
|
+
const sections2 = isChoiceUnavailable(preparation.reason) ? postPurchaseCardSections(widgetId, normalized, report, sts) : null;
|
|
7205
|
+
return PostPurchaseProductView.parse({
|
|
7206
|
+
labels,
|
|
7207
|
+
planCatalog,
|
|
7208
|
+
preparation,
|
|
7209
|
+
purchaseOptions,
|
|
7210
|
+
sections: sections2,
|
|
7211
|
+
...marker
|
|
7212
|
+
});
|
|
7168
7213
|
}
|
|
7169
|
-
const sections = postPurchaseCardSections(widgetId, normalized, report);
|
|
7214
|
+
const sections = postPurchaseCardSections(widgetId, normalized, report, sts);
|
|
7170
7215
|
if (!sections)
|
|
7171
7216
|
return {
|
|
7172
7217
|
labels,
|
|
7173
7218
|
planCatalog,
|
|
7174
7219
|
preparation: { reason: "One fixed product information block is required", status: "unsupported" },
|
|
7175
7220
|
purchaseOptions,
|
|
7176
|
-
sections: null
|
|
7221
|
+
sections: null,
|
|
7222
|
+
...marker
|
|
7177
7223
|
};
|
|
7178
7224
|
return PostPurchaseProductView.parse({
|
|
7225
|
+
...marker,
|
|
7179
7226
|
planCatalog,
|
|
7180
7227
|
preparation: {
|
|
7181
7228
|
...preparation,
|
|
@@ -7376,8 +7423,8 @@ var normalizePostPurchaseCollection = (settings, response, excludedProductIds, r
|
|
|
7376
7423
|
const limit = z82.number().int().positive();
|
|
7377
7424
|
limit.parse(normalized.original.productLimit);
|
|
7378
7425
|
const cap = limit.parse(normalized.effective.productLimit);
|
|
7379
|
-
const prefix = products
|
|
7380
|
-
const unread = dropped
|
|
7426
|
+
const prefix = underPostPurchaseCap(products, cap);
|
|
7427
|
+
const unread = underPostPurchaseCap(dropped, cap);
|
|
7381
7428
|
if (unread.length && !prefix.length) throw new ZodError(unread.flatMap(({ issues }) => issues));
|
|
7382
7429
|
if (new Set(prefix.map(({ product }) => product.id)).size !== prefix.length)
|
|
7383
7430
|
throw new Error("Ambiguous post-purchase collection");
|
|
@@ -175,6 +175,7 @@ export declare const normalizePostPurchaseCollection: (settings: unknown, respon
|
|
|
175
175
|
subscriptionIsDefault?: boolean | undefined;
|
|
176
176
|
blocks?: unknown[] | undefined;
|
|
177
177
|
};
|
|
178
|
+
emptiedByDrop: boolean;
|
|
178
179
|
metadata: {
|
|
179
180
|
widget: Record<string, unknown>;
|
|
180
181
|
};
|
|
@@ -3,7 +3,8 @@ import type { Reporter } from '../server/shared';
|
|
|
3
3
|
/**
|
|
4
4
|
* The normalized read plus each surviving product's raw `productIndex`, which a collection publishes as member
|
|
5
5
|
* identity. `data` holds only the products the shared schema accepts; `report` hears each dropped one as drift.
|
|
6
|
-
* `dropped` is each rejected product's raw `productIndex` and zod issues.
|
|
6
|
+
* `dropped` is each rejected product's raw `productIndex` and zod issues. `emptiedByDrop` marks a `data` left
|
|
7
|
+
* empty only because its products were dropped (and so already reported), not because the source had none.
|
|
7
8
|
*/
|
|
8
9
|
export declare const normalizePostPurchaseSource: (settings: unknown, response: unknown, report?: Reporter) => {
|
|
9
10
|
dropped: {
|
|
@@ -130,6 +131,7 @@ export declare const normalizePostPurchaseSource: (settings: unknown, response:
|
|
|
130
131
|
subscriptionIsDefault?: boolean | undefined;
|
|
131
132
|
blocks?: unknown[] | undefined;
|
|
132
133
|
};
|
|
134
|
+
emptiedByDrop: boolean;
|
|
133
135
|
metadata: {
|
|
134
136
|
widget: Record<string, unknown>;
|
|
135
137
|
};
|
|
@@ -257,7 +259,23 @@ export declare const normalizePostPurchaseSource: (settings: unknown, response:
|
|
|
257
259
|
productIndex: number;
|
|
258
260
|
}[];
|
|
259
261
|
};
|
|
260
|
-
/**
|
|
262
|
+
/**
|
|
263
|
+
* `productLimit` caps raw positions: keep only the entries whose raw `productIndex` sits under the cap, so a
|
|
264
|
+
* product the schema dropped leaves its slot empty rather than promoting a survivor past the cap.
|
|
265
|
+
*/
|
|
266
|
+
export declare const underPostPurchaseCap: <T extends {
|
|
267
|
+
productIndex: number;
|
|
268
|
+
}>(entries: T[], cap: number) => T[];
|
|
269
|
+
/**
|
|
270
|
+
* Both prepared purchase terms and display structure consume this one effective configuration. A product past
|
|
271
|
+
* the effective `productLimit` is never the one prepared: when no product under the cap survived salvage, `data`
|
|
272
|
+
* is empty (as the collection keeps no member), so `[bad, good]` with a limit of 1 prepares nothing. Otherwise
|
|
273
|
+
* `data` keeps every survivor, so a source with more than one readable product still reads as ambiguous rather
|
|
274
|
+
* than having products discarded. Each dropped product, past the cap or not, was already reported as drift.
|
|
275
|
+
* Only a limit of exactly 1 caps: any other limit (0, negative, fractional, or above 1) is a configuration
|
|
276
|
+
* the standalone path refuses anyway, so `data` stays whole and eligibility rejects it with the configuration
|
|
277
|
+
* reason instead of the catalog reporting drift for a readable product.
|
|
278
|
+
*/
|
|
261
279
|
export declare const normalizePostPurchaseProduct: (settings: unknown, response: unknown, report?: Reporter) => {
|
|
262
280
|
data: {
|
|
263
281
|
title: string;
|
|
@@ -378,6 +396,7 @@ export declare const normalizePostPurchaseProduct: (settings: unknown, response:
|
|
|
378
396
|
subscriptionIsDefault?: boolean | undefined;
|
|
379
397
|
blocks?: unknown[] | undefined;
|
|
380
398
|
};
|
|
399
|
+
emptiedByDrop: boolean;
|
|
381
400
|
metadata: {
|
|
382
401
|
widget: Record<string, unknown>;
|
|
383
402
|
};
|
|
@@ -2,9 +2,9 @@ import { normalizePostPurchaseProduct } from '../server/normalizePostPurchasePro
|
|
|
2
2
|
import type { Reporter } from '../server/shared';
|
|
3
3
|
/**
|
|
4
4
|
* The product's section tree from the effective settings snapshot, or `null` unless it holds exactly one product
|
|
5
|
-
* card. No product values enter the tree; the client resolves its tokens.
|
|
5
|
+
* card. No product values enter the tree; the client resolves its tokens. An STS card (`sts`) gets STS copy.
|
|
6
6
|
*/
|
|
7
|
-
export declare const postPurchaseCardSections: (widgetId: number, { effective, metadata }: Pick<ReturnType<typeof normalizePostPurchaseProduct>, "effective" | "metadata">, report?: Reporter) => import("..").CABRootSection | null;
|
|
7
|
+
export declare const postPurchaseCardSections: (widgetId: number, { effective: configured, metadata, }: Pick<ReturnType<typeof normalizePostPurchaseProduct>, "effective" | "metadata">, report?: Reporter, sts?: boolean) => import("..").CABRootSection | null;
|
|
8
8
|
/**
|
|
9
9
|
* The same tree from the raw settings and data-source response, for a caller's own choice-level fallback — rebuy-api's
|
|
10
10
|
* group default that resolves no available merchandise.
|
|
@@ -8,6 +8,7 @@ import type { Reporter } from '../server/shared';
|
|
|
8
8
|
* A catalog binds to exactly one variant, so callers that need plans narrow the product to the chosen variant first.
|
|
9
9
|
* A single product with several variants is a normal unnarrowed shape: it answers null without a drift report. Only
|
|
10
10
|
* genuinely malformed merchandise (no products, several products, no variants, a foreign variant) or unreadable plan
|
|
11
|
-
* data reports `Unreadable post-purchase plan catalog`.
|
|
11
|
+
* data reports `Unreadable post-purchase plan catalog`. No products because every one under the cap was dropped is
|
|
12
|
+
* not a second fault: each drop was already reported, so it answers null without another report.
|
|
12
13
|
*/
|
|
13
14
|
export declare const projectPostPurchasePlanCatalog: (normalized: ReturnType<typeof normalizePostPurchaseProduct>, report?: Reporter) => PostPurchasePlanCatalog | null;
|
|
@@ -143,6 +143,7 @@ export declare const preparePostPurchaseStsView: (widgetId: number, normalized:
|
|
|
143
143
|
amount: number;
|
|
144
144
|
type: "price" | "fixed_amount" | "percentage";
|
|
145
145
|
} | undefined;
|
|
146
|
+
sts?: true | undefined;
|
|
146
147
|
} | undefined;
|
|
147
148
|
};
|
|
148
149
|
display: {
|
|
@@ -452,6 +453,7 @@ export declare const preparePostPurchaseStsView: (widgetId: number, normalized:
|
|
|
452
453
|
modes: ("one-time" | "subscription")[];
|
|
453
454
|
selector: "radio" | "dropdown";
|
|
454
455
|
} | undefined;
|
|
456
|
+
sts?: true | undefined;
|
|
455
457
|
variantCatalog?: {
|
|
456
458
|
displayMode: "single" | "separate";
|
|
457
459
|
options: {
|
|
@@ -660,6 +662,7 @@ export declare const preparePostPurchaseStsView: (widgetId: number, normalized:
|
|
|
660
662
|
modes: ("one-time" | "subscription")[];
|
|
661
663
|
selector: "radio" | "dropdown";
|
|
662
664
|
} | undefined;
|
|
665
|
+
sts?: true | undefined;
|
|
663
666
|
variantCatalog?: {
|
|
664
667
|
displayMode: "single" | "separate";
|
|
665
668
|
options: {
|
|
@@ -751,6 +754,7 @@ export declare const prepareStsCollectionMember: (widgetId: number, normalized:
|
|
|
751
754
|
amount: number;
|
|
752
755
|
type: "price" | "fixed_amount" | "percentage";
|
|
753
756
|
} | undefined;
|
|
757
|
+
sts?: true | undefined;
|
|
754
758
|
} | undefined;
|
|
755
759
|
};
|
|
756
760
|
display: {
|
|
@@ -1060,6 +1064,7 @@ export declare const prepareStsCollectionMember: (widgetId: number, normalized:
|
|
|
1060
1064
|
modes: ("one-time" | "subscription")[];
|
|
1061
1065
|
selector: "radio" | "dropdown";
|
|
1062
1066
|
} | undefined;
|
|
1067
|
+
sts?: true | undefined;
|
|
1063
1068
|
variantCatalog?: {
|
|
1064
1069
|
displayMode: "single" | "separate";
|
|
1065
1070
|
options: {
|
|
@@ -1268,6 +1273,7 @@ export declare const prepareStsCollectionMember: (widgetId: number, normalized:
|
|
|
1268
1273
|
modes: ("one-time" | "subscription")[];
|
|
1269
1274
|
selector: "radio" | "dropdown";
|
|
1270
1275
|
} | undefined;
|
|
1276
|
+
sts?: true | undefined;
|
|
1271
1277
|
variantCatalog?: {
|
|
1272
1278
|
displayMode: "single" | "separate";
|
|
1273
1279
|
options: {
|
|
@@ -5,6 +5,7 @@ import type { PostPurchaseQuantity } from '../server/readPostPurchaseQuantity';
|
|
|
5
5
|
import type { Reporter } from '../server/shared';
|
|
6
6
|
/**
|
|
7
7
|
* Preparation for one allocated plan with validated configured shipping and discount; `report` receives
|
|
8
|
-
* unreadable-review drift.
|
|
8
|
+
* unreadable-review drift. A switch to subscription (STS) charges no initial shipping, only the recurring
|
|
9
|
+
* shipping (legacy `useSubscriptionPurchaseOptions`, L112/L122).
|
|
9
10
|
*/
|
|
10
11
|
export declare const prepareNormalizedSubscription: (normalized: ReturnType<typeof normalizePostPurchaseProduct>, report: Reporter | undefined, plan: PostPurchasePlanOption | undefined, quantity?: PostPurchaseQuantity, allowCollection?: boolean) => PostPurchasePreparation;
|
|
@@ -64,6 +64,7 @@ export declare const preparePostPurchaseAdmissionView: (widgetId: number, settin
|
|
|
64
64
|
amount: number;
|
|
65
65
|
type: "price" | "fixed_amount" | "percentage";
|
|
66
66
|
} | undefined;
|
|
67
|
+
sts?: true | undefined;
|
|
67
68
|
} | undefined;
|
|
68
69
|
};
|
|
69
70
|
display: {
|
|
@@ -373,6 +374,7 @@ export declare const preparePostPurchaseAdmissionView: (widgetId: number, settin
|
|
|
373
374
|
modes: ("one-time" | "subscription")[];
|
|
374
375
|
selector: "radio" | "dropdown";
|
|
375
376
|
} | undefined;
|
|
377
|
+
sts?: true | undefined;
|
|
376
378
|
variantCatalog?: {
|
|
377
379
|
displayMode: "single" | "separate";
|
|
378
380
|
options: {
|
|
@@ -581,6 +583,7 @@ export declare const preparePostPurchaseAdmissionView: (widgetId: number, settin
|
|
|
581
583
|
modes: ("one-time" | "subscription")[];
|
|
582
584
|
selector: "radio" | "dropdown";
|
|
583
585
|
} | undefined;
|
|
586
|
+
sts?: true | undefined;
|
|
584
587
|
variantCatalog?: {
|
|
585
588
|
displayMode: "single" | "separate";
|
|
586
589
|
options: {
|
|
@@ -104,6 +104,7 @@ export declare const preparePostPurchaseCollectionGroup: (widgetId: number, sett
|
|
|
104
104
|
amount: number;
|
|
105
105
|
type: "price" | "fixed_amount" | "percentage";
|
|
106
106
|
} | undefined;
|
|
107
|
+
sts?: true | undefined;
|
|
107
108
|
} | undefined;
|
|
108
109
|
};
|
|
109
110
|
display: {
|
|
@@ -383,6 +384,7 @@ export declare const preparePostPurchaseCollectionGroup: (widgetId: number, sett
|
|
|
383
384
|
modes: ("one-time" | "subscription")[];
|
|
384
385
|
selector: "radio" | "dropdown";
|
|
385
386
|
} | undefined;
|
|
387
|
+
sts?: true | undefined;
|
|
386
388
|
variantCatalog?: {
|
|
387
389
|
displayMode: "single" | "separate";
|
|
388
390
|
options: {
|
|
@@ -592,6 +594,7 @@ export declare const preparePostPurchaseCollectionGroup: (widgetId: number, sett
|
|
|
592
594
|
modes: ("one-time" | "subscription")[];
|
|
593
595
|
selector: "radio" | "dropdown";
|
|
594
596
|
} | undefined;
|
|
597
|
+
sts?: true | undefined;
|
|
595
598
|
variantCatalog?: {
|
|
596
599
|
displayMode: "single" | "separate";
|
|
597
600
|
options: {
|
|
@@ -89,6 +89,7 @@ sts?: PostPurchaseStsContext) => {
|
|
|
89
89
|
amount: number;
|
|
90
90
|
type: "price" | "fixed_amount" | "percentage";
|
|
91
91
|
} | undefined;
|
|
92
|
+
sts?: true | undefined;
|
|
92
93
|
} | undefined;
|
|
93
94
|
};
|
|
94
95
|
display: {
|
|
@@ -398,6 +399,7 @@ sts?: PostPurchaseStsContext) => {
|
|
|
398
399
|
modes: ("one-time" | "subscription")[];
|
|
399
400
|
selector: "radio" | "dropdown";
|
|
400
401
|
} | undefined;
|
|
402
|
+
sts?: true | undefined;
|
|
401
403
|
variantCatalog?: {
|
|
402
404
|
displayMode: "single" | "separate";
|
|
403
405
|
options: {
|
|
@@ -606,6 +608,7 @@ sts?: PostPurchaseStsContext) => {
|
|
|
606
608
|
modes: ("one-time" | "subscription")[];
|
|
607
609
|
selector: "radio" | "dropdown";
|
|
608
610
|
} | undefined;
|
|
611
|
+
sts?: true | undefined;
|
|
609
612
|
variantCatalog?: {
|
|
610
613
|
displayMode: "single" | "separate";
|
|
611
614
|
options: {
|
|
@@ -112,6 +112,7 @@ export declare const preparePostPurchaseGroupAdmissionView: (widgetId: number, s
|
|
|
112
112
|
amount: number;
|
|
113
113
|
type: "price" | "fixed_amount" | "percentage";
|
|
114
114
|
} | undefined;
|
|
115
|
+
sts?: true | undefined;
|
|
115
116
|
} | undefined;
|
|
116
117
|
};
|
|
117
118
|
display: {
|
|
@@ -421,6 +422,7 @@ export declare const preparePostPurchaseGroupAdmissionView: (widgetId: number, s
|
|
|
421
422
|
modes: ("one-time" | "subscription")[];
|
|
422
423
|
selector: "radio" | "dropdown";
|
|
423
424
|
} | undefined;
|
|
425
|
+
sts?: true | undefined;
|
|
424
426
|
variantCatalog?: {
|
|
425
427
|
displayMode: "single" | "separate";
|
|
426
428
|
options: {
|
|
@@ -629,6 +631,7 @@ export declare const preparePostPurchaseGroupAdmissionView: (widgetId: number, s
|
|
|
629
631
|
modes: ("one-time" | "subscription")[];
|
|
630
632
|
selector: "radio" | "dropdown";
|
|
631
633
|
} | undefined;
|
|
634
|
+
sts?: true | undefined;
|
|
632
635
|
variantCatalog?: {
|
|
633
636
|
displayMode: "single" | "separate";
|
|
634
637
|
options: {
|
|
@@ -68,6 +68,7 @@ export declare const preparePostPurchaseGroupDefault: (widgetId: number, setting
|
|
|
68
68
|
amount: number;
|
|
69
69
|
type: "price" | "fixed_amount" | "percentage";
|
|
70
70
|
} | undefined;
|
|
71
|
+
sts?: true | undefined;
|
|
71
72
|
} | undefined;
|
|
72
73
|
};
|
|
73
74
|
display: {
|
|
@@ -374,6 +375,7 @@ export declare const preparePostPurchaseGroupDefault: (widgetId: number, setting
|
|
|
374
375
|
modes: ("one-time" | "subscription")[];
|
|
375
376
|
selector: "radio" | "dropdown";
|
|
376
377
|
} | undefined;
|
|
378
|
+
sts?: true | undefined;
|
|
377
379
|
variantCatalog?: {
|
|
378
380
|
displayMode: "single" | "separate";
|
|
379
381
|
options: {
|
|
@@ -582,6 +584,7 @@ export declare const preparePostPurchaseGroupDefault: (widgetId: number, setting
|
|
|
582
584
|
modes: ("one-time" | "subscription")[];
|
|
583
585
|
selector: "radio" | "dropdown";
|
|
584
586
|
} | undefined;
|
|
587
|
+
sts?: true | undefined;
|
|
585
588
|
variantCatalog?: {
|
|
586
589
|
displayMode: "single" | "separate";
|
|
587
590
|
options: {
|
|
@@ -111,6 +111,7 @@ export declare const preparePostPurchaseGroupView: (widgetId: number, settings:
|
|
|
111
111
|
amount: number;
|
|
112
112
|
type: "price" | "fixed_amount" | "percentage";
|
|
113
113
|
} | undefined;
|
|
114
|
+
sts?: true | undefined;
|
|
114
115
|
} | undefined;
|
|
115
116
|
};
|
|
116
117
|
display: {
|
|
@@ -420,6 +421,7 @@ export declare const preparePostPurchaseGroupView: (widgetId: number, settings:
|
|
|
420
421
|
modes: ("one-time" | "subscription")[];
|
|
421
422
|
selector: "radio" | "dropdown";
|
|
422
423
|
} | undefined;
|
|
424
|
+
sts?: true | undefined;
|
|
423
425
|
variantCatalog?: {
|
|
424
426
|
displayMode: "single" | "separate";
|
|
425
427
|
options: {
|
|
@@ -628,6 +630,7 @@ export declare const preparePostPurchaseGroupView: (widgetId: number, settings:
|
|
|
628
630
|
modes: ("one-time" | "subscription")[];
|
|
629
631
|
selector: "radio" | "dropdown";
|
|
630
632
|
} | undefined;
|
|
633
|
+
sts?: true | undefined;
|
|
631
634
|
variantCatalog?: {
|
|
632
635
|
displayMode: "single" | "separate";
|
|
633
636
|
options: {
|
|
@@ -68,6 +68,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
|
|
|
68
68
|
amount: number;
|
|
69
69
|
type: "price" | "fixed_amount" | "percentage";
|
|
70
70
|
} | undefined;
|
|
71
|
+
sts?: true | undefined;
|
|
71
72
|
} | undefined;
|
|
72
73
|
};
|
|
73
74
|
display: {
|
|
@@ -377,6 +378,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
|
|
|
377
378
|
modes: ("one-time" | "subscription")[];
|
|
378
379
|
selector: "radio" | "dropdown";
|
|
379
380
|
} | undefined;
|
|
381
|
+
sts?: true | undefined;
|
|
380
382
|
variantCatalog?: {
|
|
381
383
|
displayMode: "single" | "separate";
|
|
382
384
|
options: {
|
|
@@ -585,6 +587,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
|
|
|
585
587
|
modes: ("one-time" | "subscription")[];
|
|
586
588
|
selector: "radio" | "dropdown";
|
|
587
589
|
} | undefined;
|
|
590
|
+
sts?: true | undefined;
|
|
588
591
|
variantCatalog?: {
|
|
589
592
|
displayMode: "single" | "separate";
|
|
590
593
|
options: {
|
|
@@ -727,6 +730,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
|
|
|
727
730
|
subscriptionIsDefault?: boolean | undefined;
|
|
728
731
|
blocks?: unknown[] | undefined;
|
|
729
732
|
};
|
|
733
|
+
emptiedByDrop: boolean;
|
|
730
734
|
metadata: {
|
|
731
735
|
widget: Record<string, unknown>;
|
|
732
736
|
};
|
|
@@ -881,6 +885,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
|
|
|
881
885
|
amount: number;
|
|
882
886
|
type: "price" | "fixed_amount" | "percentage";
|
|
883
887
|
} | undefined;
|
|
888
|
+
sts?: true | undefined;
|
|
884
889
|
} | undefined;
|
|
885
890
|
};
|
|
886
891
|
display: {
|
|
@@ -1190,6 +1195,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
|
|
|
1190
1195
|
modes: ("one-time" | "subscription")[];
|
|
1191
1196
|
selector: "radio" | "dropdown";
|
|
1192
1197
|
} | undefined;
|
|
1198
|
+
sts?: true | undefined;
|
|
1193
1199
|
variantCatalog?: {
|
|
1194
1200
|
displayMode: "single" | "separate";
|
|
1195
1201
|
options: {
|
|
@@ -1398,6 +1404,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
|
|
|
1398
1404
|
modes: ("one-time" | "subscription")[];
|
|
1399
1405
|
selector: "radio" | "dropdown";
|
|
1400
1406
|
} | undefined;
|
|
1407
|
+
sts?: true | undefined;
|
|
1401
1408
|
variantCatalog?: {
|
|
1402
1409
|
displayMode: "single" | "separate";
|
|
1403
1410
|
options: {
|
|
@@ -1540,6 +1547,7 @@ export declare const prepareMember: (widgetId: number, settings: unknown, respon
|
|
|
1540
1547
|
subscriptionIsDefault?: boolean | undefined;
|
|
1541
1548
|
blocks?: unknown[] | undefined;
|
|
1542
1549
|
};
|
|
1550
|
+
emptiedByDrop: boolean;
|
|
1543
1551
|
metadata: {
|
|
1544
1552
|
widget: Record<string, unknown>;
|
|
1545
1553
|
};
|
|
@@ -1695,6 +1703,7 @@ export declare const preparePostPurchaseMemberView: (widgetId: number, settings:
|
|
|
1695
1703
|
amount: number;
|
|
1696
1704
|
type: "price" | "fixed_amount" | "percentage";
|
|
1697
1705
|
} | undefined;
|
|
1706
|
+
sts?: true | undefined;
|
|
1698
1707
|
} | undefined;
|
|
1699
1708
|
};
|
|
1700
1709
|
display: {
|
|
@@ -2004,6 +2013,7 @@ export declare const preparePostPurchaseMemberView: (widgetId: number, settings:
|
|
|
2004
2013
|
modes: ("one-time" | "subscription")[];
|
|
2005
2014
|
selector: "radio" | "dropdown";
|
|
2006
2015
|
} | undefined;
|
|
2016
|
+
sts?: true | undefined;
|
|
2007
2017
|
variantCatalog?: {
|
|
2008
2018
|
displayMode: "single" | "separate";
|
|
2009
2019
|
options: {
|
|
@@ -2212,6 +2222,7 @@ export declare const preparePostPurchaseMemberView: (widgetId: number, settings:
|
|
|
2212
2222
|
modes: ("one-time" | "subscription")[];
|
|
2213
2223
|
selector: "radio" | "dropdown";
|
|
2214
2224
|
} | undefined;
|
|
2225
|
+
sts?: true | undefined;
|
|
2215
2226
|
variantCatalog?: {
|
|
2216
2227
|
displayMode: "single" | "separate";
|
|
2217
2228
|
options: {
|
|
@@ -2300,6 +2311,7 @@ export declare const preparePostPurchaseMemberAdmissionView: (widgetId: number,
|
|
|
2300
2311
|
amount: number;
|
|
2301
2312
|
type: "price" | "fixed_amount" | "percentage";
|
|
2302
2313
|
} | undefined;
|
|
2314
|
+
sts?: true | undefined;
|
|
2303
2315
|
} | undefined;
|
|
2304
2316
|
};
|
|
2305
2317
|
display: {
|
|
@@ -2609,6 +2621,7 @@ export declare const preparePostPurchaseMemberAdmissionView: (widgetId: number,
|
|
|
2609
2621
|
modes: ("one-time" | "subscription")[];
|
|
2610
2622
|
selector: "radio" | "dropdown";
|
|
2611
2623
|
} | undefined;
|
|
2624
|
+
sts?: true | undefined;
|
|
2612
2625
|
variantCatalog?: {
|
|
2613
2626
|
displayMode: "single" | "separate";
|
|
2614
2627
|
options: {
|
|
@@ -2817,6 +2830,7 @@ export declare const preparePostPurchaseMemberAdmissionView: (widgetId: number,
|
|
|
2817
2830
|
modes: ("one-time" | "subscription")[];
|
|
2818
2831
|
selector: "radio" | "dropdown";
|
|
2819
2832
|
} | undefined;
|
|
2833
|
+
sts?: true | undefined;
|
|
2820
2834
|
variantCatalog?: {
|
|
2821
2835
|
displayMode: "single" | "separate";
|
|
2822
2836
|
options: {
|
|
@@ -95,6 +95,7 @@ sts?: PostPurchaseStsContext) => {
|
|
|
95
95
|
amount: number;
|
|
96
96
|
type: "price" | "fixed_amount" | "percentage";
|
|
97
97
|
} | undefined;
|
|
98
|
+
sts?: true | undefined;
|
|
98
99
|
} | undefined;
|
|
99
100
|
};
|
|
100
101
|
display: {
|
|
@@ -404,6 +405,7 @@ sts?: PostPurchaseStsContext) => {
|
|
|
404
405
|
modes: ("one-time" | "subscription")[];
|
|
405
406
|
selector: "radio" | "dropdown";
|
|
406
407
|
} | undefined;
|
|
408
|
+
sts?: true | undefined;
|
|
407
409
|
variantCatalog?: {
|
|
408
410
|
displayMode: "single" | "separate";
|
|
409
411
|
options: {
|
|
@@ -612,6 +614,7 @@ sts?: PostPurchaseStsContext) => {
|
|
|
612
614
|
modes: ("one-time" | "subscription")[];
|
|
613
615
|
selector: "radio" | "dropdown";
|
|
614
616
|
} | undefined;
|
|
617
|
+
sts?: true | undefined;
|
|
615
618
|
variantCatalog?: {
|
|
616
619
|
displayMode: "single" | "separate";
|
|
617
620
|
options: {
|