@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/index.cjs
CHANGED
|
@@ -93,6 +93,8 @@ __export(src_exports, {
|
|
|
93
93
|
CABVariantLabels: () => CABVariantLabels,
|
|
94
94
|
CABVariantsSection: () => CABVariantsSection,
|
|
95
95
|
CABVisibility: () => CABVisibility,
|
|
96
|
+
CLIENT_LEDGER_MAX_EVENTS: () => CLIENT_LEDGER_MAX_EVENTS,
|
|
97
|
+
CLIENT_LEDGER_TYPES: () => CLIENT_LEDGER_TYPES,
|
|
96
98
|
COMBINED_ENDPOINTS: () => COMBINED_ENDPOINTS,
|
|
97
99
|
CabActiveExperiment: () => CabActiveExperiment,
|
|
98
100
|
CabShopConfig: () => CabShopConfig,
|
|
@@ -103,6 +105,8 @@ __export(src_exports, {
|
|
|
103
105
|
ClassificationAttemptProgressSchema: () => ClassificationAttemptProgressSchema,
|
|
104
106
|
ClassificationProgressSchema: () => ClassificationProgressSchema,
|
|
105
107
|
ClassificationResultProgressSchema: () => ClassificationResultProgressSchema,
|
|
108
|
+
ClientLedgerEventSchema: () => ClientLedgerEventSchema,
|
|
109
|
+
ClientLedgerRequestSchema: () => ClientLedgerRequestSchema,
|
|
106
110
|
ContentBlock: () => ContentBlock,
|
|
107
111
|
ContentBlockV1: () => ContentBlockV1,
|
|
108
112
|
ContentOperator: () => ContentOperator,
|
|
@@ -205,6 +209,7 @@ __export(src_exports, {
|
|
|
205
209
|
PostPurchaseOptions: () => PostPurchaseOptions,
|
|
206
210
|
PostPurchaseOrderAttributes: () => PostPurchaseOrderAttributes,
|
|
207
211
|
PostPurchaseOrderIdSchema: () => PostPurchaseOrderIdSchema,
|
|
212
|
+
PostPurchaseOrderPendingSchema: () => PostPurchaseOrderPendingSchema,
|
|
208
213
|
PostPurchaseOriginalVariants: () => PostPurchaseOriginalVariants,
|
|
209
214
|
PostPurchasePlanAdjustment: () => PostPurchasePlanAdjustment,
|
|
210
215
|
PostPurchasePlanCatalog: () => PostPurchasePlanCatalog,
|
|
@@ -2798,7 +2803,9 @@ var PostPurchaseSubscriptionTerms = import_zod21.z.object({
|
|
|
2798
2803
|
intervalLabel: import_zod21.z.string().min(1),
|
|
2799
2804
|
name: import_zod21.z.string().min(1),
|
|
2800
2805
|
recurringShippingPrice: import_zod21.z.number().nonnegative(),
|
|
2801
|
-
shippingOption: import_zod21.z.object({ presentmentTitle: import_zod21.z.string(), title: import_zod21.z.string() })
|
|
2806
|
+
shippingOption: import_zod21.z.object({ presentmentTitle: import_zod21.z.string(), title: import_zod21.z.string() }),
|
|
2807
|
+
/** A switch to subscription (STS): the one subscription that charges no initial shipping (L122). */
|
|
2808
|
+
sts: import_zod21.z.literal(true).optional()
|
|
2802
2809
|
});
|
|
2803
2810
|
|
|
2804
2811
|
// src/schema/postPurchaseProduct.ts
|
|
@@ -4542,6 +4549,7 @@ var CABRootSection = CABLayoutSection.extend({
|
|
|
4542
4549
|
});
|
|
4543
4550
|
|
|
4544
4551
|
// src/schema/postPurchaseProductView.ts
|
|
4552
|
+
var StsMarker = import_zod69.z.literal(true).optional();
|
|
4545
4553
|
var PostPurchaseProductView = import_zod69.z.union([
|
|
4546
4554
|
import_zod69.z.object({
|
|
4547
4555
|
changeset: PostPurchaseProductChangeset.optional(),
|
|
@@ -4557,6 +4565,7 @@ var PostPurchaseProductView = import_zod69.z.union([
|
|
|
4557
4565
|
}),
|
|
4558
4566
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
4559
4567
|
sections: CABRootSection,
|
|
4568
|
+
sts: StsMarker,
|
|
4560
4569
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4561
4570
|
}),
|
|
4562
4571
|
import_zod69.z.object({
|
|
@@ -4569,6 +4578,7 @@ var PostPurchaseProductView = import_zod69.z.union([
|
|
|
4569
4578
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
4570
4579
|
/** A choice-level unavailable product keeps its card (values resolve blank); configuration failures send null. */
|
|
4571
4580
|
sections: CABRootSection.nullable(),
|
|
4581
|
+
sts: StsMarker,
|
|
4572
4582
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4573
4583
|
})
|
|
4574
4584
|
]);
|
|
@@ -4716,102 +4726,129 @@ var HealthResultResponseSchema = import_zod74.z.object({
|
|
|
4716
4726
|
successful: import_zod74.z.literal(true)
|
|
4717
4727
|
});
|
|
4718
4728
|
|
|
4719
|
-
// src/schema/
|
|
4729
|
+
// src/schema/postPurchaseLedger.ts
|
|
4720
4730
|
var import_zod75 = require("zod");
|
|
4721
|
-
var
|
|
4731
|
+
var CLIENT_LEDGER_MAX_EVENTS = 16;
|
|
4732
|
+
var CLIENT_LEDGER_TYPES = [
|
|
4733
|
+
"decision.verdict",
|
|
4734
|
+
"error.flow",
|
|
4735
|
+
"error.schema",
|
|
4736
|
+
"offer.decline",
|
|
4737
|
+
"render.gate",
|
|
4738
|
+
"shouldRender.selectedFlow"
|
|
4739
|
+
];
|
|
4740
|
+
var ClientLedgerPayloadValueSchema = import_zod75.z.union([import_zod75.z.string().max(256), import_zod75.z.number().finite(), import_zod75.z.boolean()]);
|
|
4741
|
+
var ClientLedgerEventSchema = import_zod75.z.strictObject({
|
|
4742
|
+
/** The client's diagnostic id for one Shopify context; `(instance, seq)` names a row. */
|
|
4743
|
+
instance: import_zod75.z.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
|
|
4744
|
+
payload: import_zod75.z.record(import_zod75.z.string().regex(/^[A-Za-z][A-Za-z0-9_.()]{0,63}$/), ClientLedgerPayloadValueSchema).refine((payload) => Object.keys(payload).length <= 24, "At most 24 payload members"),
|
|
4745
|
+
phase: import_zod75.z.enum(["render", "shouldRender"]),
|
|
4746
|
+
/** `-1` is the dev-store runtime probe's row (cab-post-purchase `dev-store/runtimeProbe.ts`). */
|
|
4747
|
+
seq: import_zod75.z.number().int().min(-1).max(1e5),
|
|
4748
|
+
/** The client's clock when it observed the row, as the legacy client rows carry it. */
|
|
4749
|
+
ts: import_zod75.z.iso.datetime(),
|
|
4750
|
+
type: import_zod75.z.enum(CLIENT_LEDGER_TYPES)
|
|
4751
|
+
});
|
|
4752
|
+
var ClientLedgerRequestSchema = import_zod75.z.object({
|
|
4753
|
+
events: import_zod75.z.array(ClientLedgerEventSchema).min(1).max(CLIENT_LEDGER_MAX_EVENTS)
|
|
4754
|
+
});
|
|
4755
|
+
|
|
4756
|
+
// src/schema/postPurchaseLifecycle.ts
|
|
4757
|
+
var import_zod76 = require("zod");
|
|
4758
|
+
var Presentation = import_zod76.z.strictObject({
|
|
4722
4759
|
member: PostPurchaseMemberIdentity,
|
|
4723
4760
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4724
4761
|
variant: PostPurchaseVariantSelector
|
|
4725
4762
|
});
|
|
4726
4763
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4727
4764
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4728
|
-
eventType:
|
|
4765
|
+
eventType: import_zod76.z.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4729
4766
|
presentation: Presentation.nullable(),
|
|
4730
4767
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4731
|
-
requestId:
|
|
4768
|
+
requestId: import_zod76.z.uuid()
|
|
4732
4769
|
}).strict().refine(
|
|
4733
4770
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4734
4771
|
"Viewed observations require a presented product"
|
|
4735
4772
|
);
|
|
4736
|
-
var LifecycleObservationResponseSchema =
|
|
4737
|
-
data:
|
|
4773
|
+
var LifecycleObservationResponseSchema = import_zod76.z.object({
|
|
4774
|
+
data: import_zod76.z.strictObject({
|
|
4738
4775
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4739
|
-
status:
|
|
4776
|
+
status: import_zod76.z.union([AcceptedEventOutcomeSchema, import_zod76.z.literal("unavailable")])
|
|
4740
4777
|
}),
|
|
4741
|
-
successful:
|
|
4778
|
+
successful: import_zod76.z.literal(true)
|
|
4742
4779
|
});
|
|
4743
4780
|
|
|
4744
4781
|
// src/schema/postPurchaseOffer.ts
|
|
4745
|
-
var
|
|
4782
|
+
var import_zod77 = require("zod");
|
|
4746
4783
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4747
|
-
var OfferPreparationResponseSchema =
|
|
4748
|
-
data:
|
|
4749
|
-
successful:
|
|
4784
|
+
var OfferPreparationResponseSchema = import_zod77.z.object({
|
|
4785
|
+
data: import_zod77.z.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4786
|
+
successful: import_zod77.z.literal(true)
|
|
4750
4787
|
});
|
|
4751
4788
|
|
|
4752
4789
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4753
|
-
var
|
|
4790
|
+
var import_zod78 = require("zod");
|
|
4754
4791
|
var selection2 = PreparedPostPurchaseProduct.shape.selection;
|
|
4755
|
-
var PostPurchaseOfferSkipReason =
|
|
4756
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4792
|
+
var PostPurchaseOfferSkipReason = import_zod78.z.enum(["empty", "no-eligible-subscription"]);
|
|
4793
|
+
var PostPurchaseOfferEligibilityContext = import_zod78.z.object({
|
|
4757
4794
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4758
|
-
originalLineItems:
|
|
4795
|
+
originalLineItems: import_zod78.z.array(selection2.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4759
4796
|
});
|
|
4760
|
-
var PostPurchaseStsOptions =
|
|
4761
|
-
var PostPurchaseStsContext =
|
|
4762
|
-
originalLineItems:
|
|
4797
|
+
var PostPurchaseStsOptions = import_zod78.z.object({ sts: import_zod78.z.boolean().optional() }).strict();
|
|
4798
|
+
var PostPurchaseStsContext = import_zod78.z.object({
|
|
4799
|
+
originalLineItems: import_zod78.z.array(
|
|
4763
4800
|
selection2.pick({ productId: true, quantity: true, sellingPlanId: true, variantId: true })
|
|
4764
4801
|
)
|
|
4765
4802
|
});
|
|
4766
|
-
var PostPurchaseOfferEligibility =
|
|
4767
|
-
|
|
4768
|
-
members:
|
|
4769
|
-
|
|
4803
|
+
var PostPurchaseOfferEligibility = import_zod78.z.discriminatedUnion("status", [
|
|
4804
|
+
import_zod78.z.object({
|
|
4805
|
+
members: import_zod78.z.array(
|
|
4806
|
+
import_zod78.z.object({ productId: selection2.shape.productId, productIndex: import_zod78.z.number().int().nonnegative() })
|
|
4770
4807
|
),
|
|
4771
4808
|
/** Present only with STS on: each member switches one original one-time line to subscription. */
|
|
4772
|
-
mode:
|
|
4773
|
-
status:
|
|
4809
|
+
mode: import_zod78.z.literal("sts").optional(),
|
|
4810
|
+
status: import_zod78.z.literal("retain")
|
|
4774
4811
|
}),
|
|
4775
|
-
|
|
4776
|
-
|
|
4812
|
+
import_zod78.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod78.z.literal("skip") }),
|
|
4813
|
+
import_zod78.z.object({ reason: import_zod78.z.literal("eligible-sts").optional(), status: import_zod78.z.literal("unavailable") })
|
|
4777
4814
|
]);
|
|
4778
4815
|
|
|
4779
4816
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4780
|
-
var
|
|
4817
|
+
var import_zod79 = require("zod");
|
|
4781
4818
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4782
|
-
var PostPurchaseOfferPresentation =
|
|
4819
|
+
var PostPurchaseOfferPresentation = import_zod79.z.strictObject({
|
|
4783
4820
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4784
4821
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4785
4822
|
sections: CABRootSection.nullable(),
|
|
4786
4823
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4787
4824
|
});
|
|
4788
4825
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4789
|
-
var OfferPresentationResponseSchema =
|
|
4790
|
-
data:
|
|
4826
|
+
var OfferPresentationResponseSchema = import_zod79.z.object({
|
|
4827
|
+
data: import_zod79.z.strictObject({
|
|
4791
4828
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4792
4829
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4793
4830
|
serverNow: PostPurchaseTimestampSchema
|
|
4794
4831
|
}),
|
|
4795
|
-
successful:
|
|
4832
|
+
successful: import_zod79.z.literal(true)
|
|
4796
4833
|
});
|
|
4797
4834
|
|
|
4798
4835
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4799
|
-
var
|
|
4800
|
-
var OrderDecisionSchema =
|
|
4801
|
-
|
|
4802
|
-
|
|
4836
|
+
var import_zod80 = require("zod");
|
|
4837
|
+
var OrderDecisionSchema = import_zod80.z.discriminatedUnion("owner", [
|
|
4838
|
+
import_zod80.z.object({ owner: import_zod80.z.literal("session"), sessionId: PostPurchaseSessionIdSchema }),
|
|
4839
|
+
import_zod80.z.object({ owner: import_zod80.z.literal("release"), sessionId: import_zod80.z.null() })
|
|
4803
4840
|
]);
|
|
4804
4841
|
|
|
4805
4842
|
// src/schema/postPurchasePolicy.ts
|
|
4806
|
-
var
|
|
4807
|
-
var HoldSettingSchema =
|
|
4808
|
-
|
|
4809
|
-
|
|
4843
|
+
var import_zod81 = require("zod");
|
|
4844
|
+
var HoldSettingSchema = import_zod81.z.discriminatedUnion("enabled", [
|
|
4845
|
+
import_zod81.z.object({ durationMinutes: import_zod81.z.number().int().min(1).max(60), enabled: import_zod81.z.literal(true) }),
|
|
4846
|
+
import_zod81.z.object({ durationMinutes: import_zod81.z.null(), enabled: import_zod81.z.literal(false) })
|
|
4810
4847
|
]);
|
|
4811
|
-
var TimingSettingsSchema =
|
|
4848
|
+
var TimingSettingsSchema = import_zod81.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4812
4849
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4813
|
-
durationMinutes:
|
|
4814
|
-
source:
|
|
4850
|
+
durationMinutes: import_zod81.z.number().int().min(1).max(60).nullable(),
|
|
4851
|
+
source: import_zod81.z.enum(["shop", "flow", "native"])
|
|
4815
4852
|
}).refine(
|
|
4816
4853
|
(policy) => {
|
|
4817
4854
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4825,8 +4862,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4825
4862
|
);
|
|
4826
4863
|
|
|
4827
4864
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4828
|
-
var
|
|
4829
|
-
var PostPurchasePreparationOptions =
|
|
4865
|
+
var import_zod82 = require("zod");
|
|
4866
|
+
var PostPurchasePreparationOptions = import_zod82.z.object({
|
|
4830
4867
|
choice: PostPurchaseChoice.optional(),
|
|
4831
4868
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4832
4869
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4838,8 +4875,8 @@ var PostPurchasePreparationOptions = import_zod81.z.object({
|
|
|
4838
4875
|
);
|
|
4839
4876
|
|
|
4840
4877
|
// src/schema/postPurchaseProductSettings.ts
|
|
4841
|
-
var
|
|
4842
|
-
var amount =
|
|
4878
|
+
var import_zod83 = require("zod");
|
|
4879
|
+
var amount = import_zod83.z.union([import_zod83.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4843
4880
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4844
4881
|
discountedFrom: true,
|
|
4845
4882
|
language: true,
|
|
@@ -4851,30 +4888,30 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4851
4888
|
subscriptionIsDefault: true,
|
|
4852
4889
|
upgradeToSubscription: true
|
|
4853
4890
|
}).extend({
|
|
4854
|
-
advance:
|
|
4855
|
-
blocks:
|
|
4891
|
+
advance: import_zod83.z.unknown().default({}),
|
|
4892
|
+
blocks: import_zod83.z.array(import_zod83.z.unknown()).optional(),
|
|
4856
4893
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4857
|
-
integrations:
|
|
4894
|
+
integrations: import_zod83.z.unknown().default({}),
|
|
4858
4895
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4859
|
-
styles:
|
|
4896
|
+
styles: import_zod83.z.unknown().default({}),
|
|
4860
4897
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4861
|
-
subscription:
|
|
4898
|
+
subscription: import_zod83.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4862
4899
|
});
|
|
4863
4900
|
|
|
4864
4901
|
// src/schema/postPurchaseRecovery.ts
|
|
4865
|
-
var
|
|
4866
|
-
var RecoveredFollowupsSchema =
|
|
4867
|
-
acceptedEvent:
|
|
4868
|
-
acceptedMetafield:
|
|
4902
|
+
var import_zod84 = require("zod");
|
|
4903
|
+
var RecoveredFollowupsSchema = import_zod84.z.strictObject({
|
|
4904
|
+
acceptedEvent: import_zod84.z.union([AcceptedEventAttemptProgressSchema, AcceptedEventResultProgressSchema]).nullable(),
|
|
4905
|
+
acceptedMetafield: import_zod84.z.union([AcceptedMetafieldOutcomeSchema, import_zod84.z.literal("attempted")]).nullable()
|
|
4869
4906
|
});
|
|
4870
4907
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4871
|
-
var PurchaseRecoveryResponseSchema =
|
|
4872
|
-
data:
|
|
4908
|
+
var PurchaseRecoveryResponseSchema = import_zod84.z.object({
|
|
4909
|
+
data: import_zod84.z.object({
|
|
4873
4910
|
/**
|
|
4874
4911
|
* Strict, so a client pinned before a new optional field rejects a reply that carries it rather than
|
|
4875
4912
|
* stripping it. Release the client before rebuy-api starts emitting a field added here.
|
|
4876
4913
|
*/
|
|
4877
|
-
operation:
|
|
4914
|
+
operation: import_zod84.z.object({
|
|
4878
4915
|
/** Absent from a rebuy-api that predates it. */
|
|
4879
4916
|
followups: RecoveredFollowupsSchema.optional(),
|
|
4880
4917
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
@@ -4897,41 +4934,41 @@ var PurchaseRecoveryResponseSchema = import_zod83.z.object({
|
|
|
4897
4934
|
).nullable(),
|
|
4898
4935
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4899
4936
|
}),
|
|
4900
|
-
successful:
|
|
4937
|
+
successful: import_zod84.z.literal(true)
|
|
4901
4938
|
});
|
|
4902
4939
|
|
|
4903
4940
|
// src/schema/postPurchaseReleaseClaim.ts
|
|
4904
|
-
var
|
|
4941
|
+
var import_zod85 = require("zod");
|
|
4905
4942
|
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
4906
|
-
var ReleaseClaimResponseSchema =
|
|
4907
|
-
data:
|
|
4908
|
-
|
|
4943
|
+
var ReleaseClaimResponseSchema = import_zod85.z.object({
|
|
4944
|
+
data: import_zod85.z.discriminatedUnion("status", [
|
|
4945
|
+
import_zod85.z.object({ status: import_zod85.z.literal("release-permitted") }),
|
|
4909
4946
|
PendingReleaseAuthoritySchema,
|
|
4910
4947
|
ReadyReleaseAuthoritySchema
|
|
4911
4948
|
]),
|
|
4912
|
-
successful:
|
|
4949
|
+
successful: import_zod85.z.literal(true)
|
|
4913
4950
|
});
|
|
4914
4951
|
|
|
4915
4952
|
// src/schema/postPurchaseSelection.ts
|
|
4916
|
-
var
|
|
4953
|
+
var import_zod86 = require("zod");
|
|
4917
4954
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4918
4955
|
appId: PostPurchaseAppIdSchema,
|
|
4919
4956
|
entry: DecisionEntrySchema,
|
|
4920
|
-
iss:
|
|
4921
|
-
purpose:
|
|
4957
|
+
iss: import_zod86.z.literal("rebuy-api"),
|
|
4958
|
+
purpose: import_zod86.z.literal("post-purchase-selection")
|
|
4922
4959
|
});
|
|
4923
4960
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4924
|
-
selectionToken:
|
|
4961
|
+
selectionToken: import_zod86.z.string().min(1).max(8192).optional()
|
|
4925
4962
|
}).strict();
|
|
4926
4963
|
|
|
4927
4964
|
// src/schema/postPurchaseSession.ts
|
|
4928
|
-
var
|
|
4965
|
+
var import_zod87 = require("zod");
|
|
4929
4966
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4930
|
-
var SessionOrderTimingSchema =
|
|
4967
|
+
var SessionOrderTimingSchema = import_zod87.z.object({
|
|
4931
4968
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4932
4969
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4933
4970
|
orderId: PostPurchaseOrderIdSchema,
|
|
4934
|
-
timingSource:
|
|
4971
|
+
timingSource: import_zod87.z.literal("shopify-order-created-at")
|
|
4935
4972
|
});
|
|
4936
4973
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4937
4974
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4948,33 +4985,39 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4948
4985
|
message: "deadline must not exceed nativeDeadline",
|
|
4949
4986
|
path: ["deadline"]
|
|
4950
4987
|
});
|
|
4951
|
-
var SessionStartResponseSchema =
|
|
4952
|
-
data:
|
|
4953
|
-
phase:
|
|
4988
|
+
var SessionStartResponseSchema = import_zod87.z.object({
|
|
4989
|
+
data: import_zod87.z.object({
|
|
4990
|
+
phase: import_zod87.z.literal("render"),
|
|
4954
4991
|
serverNow: PostPurchaseTimestampSchema,
|
|
4955
4992
|
session: ReadySessionTimingSchema,
|
|
4956
|
-
workflowPhase:
|
|
4993
|
+
workflowPhase: import_zod87.z.literal("start")
|
|
4957
4994
|
}),
|
|
4958
|
-
successful:
|
|
4995
|
+
successful: import_zod87.z.literal(true)
|
|
4996
|
+
});
|
|
4997
|
+
var PostPurchaseOrderPendingSchema = import_zod87.z.object({
|
|
4998
|
+
errors: import_zod87.z.array(import_zod87.z.object({ message: import_zod87.z.string() })),
|
|
4999
|
+
message: import_zod87.z.string(),
|
|
5000
|
+
reason: import_zod87.z.literal("order-pending"),
|
|
5001
|
+
successful: import_zod87.z.literal(false)
|
|
4959
5002
|
});
|
|
4960
5003
|
|
|
4961
5004
|
// src/schema/postPurchaseShadow.ts
|
|
4962
|
-
var
|
|
4963
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4964
|
-
|
|
4965
|
-
|
|
5005
|
+
var import_zod88 = require("zod");
|
|
5006
|
+
var PostPurchaseShadowSelectionSchema = import_zod88.z.discriminatedUnion("verdict", [
|
|
5007
|
+
import_zod88.z.object({ entry: DecisionEntrySchema, verdict: import_zod88.z.literal("render") }),
|
|
5008
|
+
import_zod88.z.object({ verdict: import_zod88.z.literal("skip") })
|
|
4966
5009
|
]);
|
|
4967
|
-
var PostPurchaseShadowReportFields =
|
|
4968
|
-
differences:
|
|
5010
|
+
var PostPurchaseShadowReportFields = import_zod88.z.object({
|
|
5011
|
+
differences: import_zod88.z.array(import_zod88.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4969
5012
|
message: "differences must not contain duplicate entries"
|
|
4970
5013
|
}),
|
|
4971
5014
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4972
|
-
phase:
|
|
4973
|
-
sampleId:
|
|
5015
|
+
phase: import_zod88.z.literal("shouldRender"),
|
|
5016
|
+
sampleId: import_zod88.z.string(),
|
|
4974
5017
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4975
|
-
status:
|
|
4976
|
-
targetingFlowIds:
|
|
4977
|
-
workflowPhase:
|
|
5018
|
+
status: import_zod88.z.enum(["match", "diverged", "incomplete"]),
|
|
5019
|
+
targetingFlowIds: import_zod88.z.array(import_zod88.z.number().int().positive()),
|
|
5020
|
+
workflowPhase: import_zod88.z.literal("decide")
|
|
4978
5021
|
});
|
|
4979
5022
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4980
5023
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4988,13 +5031,14 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4988
5031
|
});
|
|
4989
5032
|
|
|
4990
5033
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4991
|
-
var
|
|
5034
|
+
var import_zod89 = require("zod");
|
|
4992
5035
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4993
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
5036
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod89.z.number().int().positive() }),
|
|
4994
5037
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4995
5038
|
subscription: PostPurchaseSubscriptionTerms
|
|
4996
5039
|
}).refine(
|
|
4997
|
-
({ discount, shipping, subscription }) => (discount.type !== "none" || discount.amount === 0) &&
|
|
5040
|
+
({ discount, shipping, subscription }) => (discount.type !== "none" || discount.amount === 0) && // A switch to subscription charges no initial shipping (L122); any other subscription charges it.
|
|
5041
|
+
subscription.initialShippingPrice === (subscription.sts ? 0 : shipping.amount) && shipping.amount === subscription.recurringShippingPrice && (shipping.type !== "free" || shipping.amount === 0)
|
|
4998
5042
|
)
|
|
4999
5043
|
});
|
|
5000
5044
|
var readPostPurchaseSubscription = (prepared) => {
|
|
@@ -5003,93 +5047,93 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
5003
5047
|
};
|
|
5004
5048
|
|
|
5005
5049
|
// src/schema/postPurchaseVariantDefault.ts
|
|
5006
|
-
var
|
|
5050
|
+
var import_zod90 = require("zod");
|
|
5007
5051
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
5008
5052
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
5009
5053
|
});
|
|
5010
5054
|
var variant = values.extend({
|
|
5011
5055
|
id: PostPurchaseVariantId,
|
|
5012
|
-
inventoryManagement:
|
|
5013
|
-
inventoryPolicy:
|
|
5014
|
-
inventoryQuantity:
|
|
5056
|
+
inventoryManagement: import_zod90.z.string().nullable(),
|
|
5057
|
+
inventoryPolicy: import_zod90.z.string(),
|
|
5058
|
+
inventoryQuantity: import_zod90.z.number()
|
|
5015
5059
|
});
|
|
5016
|
-
var options =
|
|
5017
|
-
var PostPurchaseVariantDefaultProduct =
|
|
5060
|
+
var options = import_zod90.z.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
5061
|
+
var PostPurchaseVariantDefaultProduct = import_zod90.z.object({
|
|
5018
5062
|
id: PostPurchaseProductId,
|
|
5019
5063
|
options,
|
|
5020
5064
|
selectedVariant: variant.optional(),
|
|
5021
|
-
variants:
|
|
5065
|
+
variants: import_zod90.z.array(variant)
|
|
5022
5066
|
});
|
|
5023
5067
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
5024
5068
|
hideOutOfStockVariants: true,
|
|
5025
5069
|
matchVariant: true
|
|
5026
5070
|
});
|
|
5027
|
-
var PostPurchaseOrderAttributes =
|
|
5028
|
-
var PostPurchaseOriginalVariants =
|
|
5029
|
-
|
|
5071
|
+
var PostPurchaseOrderAttributes = import_zod90.z.record(import_zod90.z.string(), import_zod90.z.array(import_zod90.z.string())).default({});
|
|
5072
|
+
var PostPurchaseOriginalVariants = import_zod90.z.array(
|
|
5073
|
+
import_zod90.z.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
5030
5074
|
);
|
|
5031
|
-
var PostPurchaseAttributeProducts =
|
|
5032
|
-
|
|
5075
|
+
var PostPurchaseAttributeProducts = import_zod90.z.array(
|
|
5076
|
+
import_zod90.z.object({ id: PostPurchaseProductId, options, variants: import_zod90.z.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
5033
5077
|
);
|
|
5034
5078
|
|
|
5035
5079
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
5036
|
-
var
|
|
5037
|
-
var PostPurchaseVariantDefaultContext =
|
|
5038
|
-
enrichedLineItems:
|
|
5080
|
+
var import_zod91 = require("zod");
|
|
5081
|
+
var PostPurchaseVariantDefaultContext = import_zod91.z.object({
|
|
5082
|
+
enrichedLineItems: import_zod91.z.unknown().optional(),
|
|
5039
5083
|
originalVariants: PostPurchaseOriginalVariants
|
|
5040
5084
|
});
|
|
5041
5085
|
|
|
5042
5086
|
// src/schema/shopConfig.ts
|
|
5043
|
-
var
|
|
5044
|
-
var ShopConfig =
|
|
5045
|
-
activeExperiments:
|
|
5046
|
-
|
|
5047
|
-
data:
|
|
5048
|
-
|
|
5049
|
-
aliasName:
|
|
5050
|
-
cssInput:
|
|
5051
|
-
elementId:
|
|
5052
|
-
id:
|
|
5053
|
-
javascriptInput:
|
|
5054
|
-
traffic:
|
|
5087
|
+
var import_zod92 = require("zod");
|
|
5088
|
+
var ShopConfig = import_zod92.z.object({
|
|
5089
|
+
activeExperiments: import_zod92.z.array(
|
|
5090
|
+
import_zod92.z.object({
|
|
5091
|
+
data: import_zod92.z.array(
|
|
5092
|
+
import_zod92.z.object({
|
|
5093
|
+
aliasName: import_zod92.z.string(),
|
|
5094
|
+
cssInput: import_zod92.z.string().nullish(),
|
|
5095
|
+
elementId: import_zod92.z.coerce.number(),
|
|
5096
|
+
id: import_zod92.z.coerce.number(),
|
|
5097
|
+
javascriptInput: import_zod92.z.string().nullish(),
|
|
5098
|
+
traffic: import_zod92.z.coerce.number()
|
|
5055
5099
|
})
|
|
5056
5100
|
),
|
|
5057
|
-
id:
|
|
5058
|
-
name:
|
|
5059
|
-
pageTarget:
|
|
5060
|
-
pageTargetUrl:
|
|
5061
|
-
placeholderId:
|
|
5062
|
-
type:
|
|
5101
|
+
id: import_zod92.z.coerce.number(),
|
|
5102
|
+
name: import_zod92.z.string(),
|
|
5103
|
+
pageTarget: import_zod92.z.string().nullable(),
|
|
5104
|
+
pageTargetUrl: import_zod92.z.string().nullable(),
|
|
5105
|
+
placeholderId: import_zod92.z.coerce.number().nullable(),
|
|
5106
|
+
type: import_zod92.z.string()
|
|
5063
5107
|
})
|
|
5064
5108
|
),
|
|
5065
|
-
activePackages:
|
|
5066
|
-
|
|
5067
|
-
cancelledAt:
|
|
5068
|
-
id:
|
|
5069
|
-
installedAt:
|
|
5070
|
-
isActive:
|
|
5071
|
-
isBillable:
|
|
5072
|
-
packageId:
|
|
5073
|
-
packageName:
|
|
5074
|
-
shortName:
|
|
5075
|
-
trialDays:
|
|
5076
|
-
uninstalledAt:
|
|
5109
|
+
activePackages: import_zod92.z.array(
|
|
5110
|
+
import_zod92.z.object({
|
|
5111
|
+
cancelledAt: import_zod92.z.string().nullable(),
|
|
5112
|
+
id: import_zod92.z.number(),
|
|
5113
|
+
installedAt: import_zod92.z.string().nullable(),
|
|
5114
|
+
isActive: import_zod92.z.boolean(),
|
|
5115
|
+
isBillable: import_zod92.z.boolean(),
|
|
5116
|
+
packageId: import_zod92.z.number(),
|
|
5117
|
+
packageName: import_zod92.z.string(),
|
|
5118
|
+
shortName: import_zod92.z.string(),
|
|
5119
|
+
trialDays: import_zod92.z.number(),
|
|
5120
|
+
uninstalledAt: import_zod92.z.string().nullable()
|
|
5077
5121
|
})
|
|
5078
5122
|
),
|
|
5079
|
-
apiKey:
|
|
5080
|
-
billingVersion:
|
|
5081
|
-
cacheKey:
|
|
5082
|
-
carousel:
|
|
5083
|
-
currency:
|
|
5084
|
-
currencySymbol:
|
|
5085
|
-
domain:
|
|
5086
|
-
enabledJquery:
|
|
5087
|
-
enabledPresentmentCurrencies:
|
|
5088
|
-
hasSmartCollectionsEnabled:
|
|
5089
|
-
hasSmartSearchEnabled:
|
|
5090
|
-
id:
|
|
5091
|
-
integrations:
|
|
5092
|
-
|
|
5123
|
+
apiKey: import_zod92.z.string(),
|
|
5124
|
+
billingVersion: import_zod92.z.string().nullable(),
|
|
5125
|
+
cacheKey: import_zod92.z.coerce.number(),
|
|
5126
|
+
carousel: import_zod92.z.enum(["flickity", "splide"]),
|
|
5127
|
+
currency: import_zod92.z.string(),
|
|
5128
|
+
currencySymbol: import_zod92.z.string(),
|
|
5129
|
+
domain: import_zod92.z.string(),
|
|
5130
|
+
enabledJquery: import_zod92.z.boolean(),
|
|
5131
|
+
enabledPresentmentCurrencies: import_zod92.z.array(import_zod92.z.string()),
|
|
5132
|
+
hasSmartCollectionsEnabled: import_zod92.z.boolean(),
|
|
5133
|
+
hasSmartSearchEnabled: import_zod92.z.boolean(),
|
|
5134
|
+
id: import_zod92.z.coerce.number(),
|
|
5135
|
+
integrations: import_zod92.z.record(
|
|
5136
|
+
import_zod92.z.enum([
|
|
5093
5137
|
"attentive",
|
|
5094
5138
|
"judgeme",
|
|
5095
5139
|
"junip",
|
|
@@ -5102,170 +5146,170 @@ var ShopConfig = import_zod91.z.object({
|
|
|
5102
5146
|
"stamped",
|
|
5103
5147
|
"yotpo"
|
|
5104
5148
|
]),
|
|
5105
|
-
|
|
5149
|
+
import_zod92.z.union([import_zod92.z.boolean(), import_zod92.z.unknown()])
|
|
5106
5150
|
),
|
|
5107
|
-
markets:
|
|
5108
|
-
enabled:
|
|
5151
|
+
markets: import_zod92.z.object({
|
|
5152
|
+
enabled: import_zod92.z.boolean()
|
|
5109
5153
|
}),
|
|
5110
|
-
monetize:
|
|
5111
|
-
publisherKey:
|
|
5154
|
+
monetize: import_zod92.z.object({
|
|
5155
|
+
publisherKey: import_zod92.z.string().nullable()
|
|
5112
5156
|
}).nullish(),
|
|
5113
|
-
moneyFormat:
|
|
5114
|
-
myshopifyDomain:
|
|
5115
|
-
primaryLocale:
|
|
5116
|
-
productGroupsEnabled:
|
|
5117
|
-
rechargeCustomDomain:
|
|
5118
|
-
sellingPlansEnabled:
|
|
5119
|
-
shopId:
|
|
5120
|
-
shopifySellingPlansEnabled:
|
|
5121
|
-
shopName:
|
|
5122
|
-
storefrontAccessToken:
|
|
5123
|
-
useRebuyIcons:
|
|
5157
|
+
moneyFormat: import_zod92.z.string(),
|
|
5158
|
+
myshopifyDomain: import_zod92.z.string(),
|
|
5159
|
+
primaryLocale: import_zod92.z.string(),
|
|
5160
|
+
productGroupsEnabled: import_zod92.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
5161
|
+
rechargeCustomDomain: import_zod92.z.string().nullable(),
|
|
5162
|
+
sellingPlansEnabled: import_zod92.z.boolean(),
|
|
5163
|
+
shopId: import_zod92.z.number(),
|
|
5164
|
+
shopifySellingPlansEnabled: import_zod92.z.boolean(),
|
|
5165
|
+
shopName: import_zod92.z.string(),
|
|
5166
|
+
storefrontAccessToken: import_zod92.z.string().nullable(),
|
|
5167
|
+
useRebuyIcons: import_zod92.z.boolean()
|
|
5124
5168
|
});
|
|
5125
5169
|
|
|
5126
5170
|
// src/schema/userConfig.ts
|
|
5127
|
-
var
|
|
5128
|
-
var UserConfig =
|
|
5171
|
+
var import_zod93 = require("zod");
|
|
5172
|
+
var UserConfig = import_zod93.z.object({
|
|
5129
5173
|
shop: ShopConfig,
|
|
5130
5174
|
/**
|
|
5131
5175
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
5132
5176
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
5133
5177
|
*/
|
|
5134
5178
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
5135
|
-
smartFlows:
|
|
5179
|
+
smartFlows: import_zod93.z.array(import_zod93.z.unknown())
|
|
5136
5180
|
});
|
|
5137
5181
|
|
|
5138
5182
|
// src/schema/widgetData.ts
|
|
5139
|
-
var
|
|
5183
|
+
var import_zod102 = require("zod");
|
|
5140
5184
|
|
|
5141
5185
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
5142
|
-
var
|
|
5143
|
-
var ABTestingPlaceholder =
|
|
5144
|
-
type:
|
|
5186
|
+
var import_zod94 = require("zod");
|
|
5187
|
+
var ABTestingPlaceholder = import_zod94.z.looseObject({
|
|
5188
|
+
type: import_zod94.z.literal("placeholder")
|
|
5145
5189
|
});
|
|
5146
5190
|
|
|
5147
5191
|
// src/schema/widgets/checkoutExtension.ts
|
|
5148
|
-
var
|
|
5149
|
-
var CheckoutExtension =
|
|
5150
|
-
type:
|
|
5192
|
+
var import_zod95 = require("zod");
|
|
5193
|
+
var CheckoutExtension = import_zod95.z.looseObject({
|
|
5194
|
+
type: import_zod95.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
5151
5195
|
});
|
|
5152
5196
|
|
|
5153
5197
|
// src/schema/widgets/contentBlock.ts
|
|
5154
|
-
var
|
|
5155
|
-
var ContentBlockV1 =
|
|
5156
|
-
blockSpacing:
|
|
5157
|
-
imageBlocks:
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
altText:
|
|
5161
|
-
description:
|
|
5162
|
-
id:
|
|
5163
|
-
imagePlacement:
|
|
5164
|
-
imageSize:
|
|
5165
|
-
imageUrl:
|
|
5166
|
-
textAlignment:
|
|
5198
|
+
var import_zod96 = require("zod");
|
|
5199
|
+
var ContentBlockV1 = import_zod96.z.object({
|
|
5200
|
+
blockSpacing: import_zod96.z.enum(spacings).optional(),
|
|
5201
|
+
imageBlocks: import_zod96.z.union([
|
|
5202
|
+
import_zod96.z.array(
|
|
5203
|
+
import_zod96.z.object({
|
|
5204
|
+
altText: import_zod96.z.string().nullable(),
|
|
5205
|
+
description: import_zod96.z.string().nullable(),
|
|
5206
|
+
id: import_zod96.z.uuid(),
|
|
5207
|
+
imagePlacement: import_zod96.z.enum(["top", "right", "bottom", "left"]),
|
|
5208
|
+
imageSize: import_zod96.z.number(),
|
|
5209
|
+
imageUrl: import_zod96.z.url(),
|
|
5210
|
+
textAlignment: import_zod96.z.enum(["left", "center", "right"]),
|
|
5167
5211
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
5168
|
-
textSize:
|
|
5212
|
+
textSize: import_zod96.z.enum(inlineTextSizeNames)
|
|
5169
5213
|
})
|
|
5170
5214
|
),
|
|
5171
|
-
|
|
5215
|
+
import_zod96.z.strictObject({}).transform(() => [])
|
|
5172
5216
|
]).optional(),
|
|
5173
|
-
imageLayout:
|
|
5174
|
-
language:
|
|
5175
|
-
description:
|
|
5176
|
-
superTitle:
|
|
5177
|
-
title:
|
|
5217
|
+
imageLayout: import_zod96.z.enum(["row", "column"]).optional(),
|
|
5218
|
+
language: import_zod96.z.object({
|
|
5219
|
+
description: import_zod96.z.string(),
|
|
5220
|
+
superTitle: import_zod96.z.string(),
|
|
5221
|
+
title: import_zod96.z.string()
|
|
5178
5222
|
}),
|
|
5179
|
-
previewMode:
|
|
5180
|
-
type:
|
|
5181
|
-
version:
|
|
5223
|
+
previewMode: import_zod96.z.boolean(),
|
|
5224
|
+
type: import_zod96.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
5225
|
+
version: import_zod96.z.literal(1)
|
|
5182
5226
|
});
|
|
5183
|
-
var ContentBlock =
|
|
5227
|
+
var ContentBlock = import_zod96.z.discriminatedUnion("version", [
|
|
5184
5228
|
ContentBlockV1,
|
|
5185
5229
|
CABRootSection.extend({
|
|
5186
|
-
type:
|
|
5230
|
+
type: import_zod96.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
5187
5231
|
})
|
|
5188
5232
|
]);
|
|
5189
5233
|
|
|
5190
5234
|
// src/schema/widgets/giftWithPurchase.ts
|
|
5191
|
-
var
|
|
5192
|
-
var GiftWithPurchase =
|
|
5193
|
-
type:
|
|
5235
|
+
var import_zod97 = require("zod");
|
|
5236
|
+
var GiftWithPurchase = import_zod97.z.looseObject({
|
|
5237
|
+
type: import_zod97.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
5194
5238
|
});
|
|
5195
5239
|
|
|
5196
5240
|
// src/schema/widgets/lineItemEditor.ts
|
|
5197
|
-
var
|
|
5198
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
5199
|
-
downgradeToOneTimeLabel:
|
|
5241
|
+
var import_zod98 = require("zod");
|
|
5242
|
+
var LineItemEditorSwitchLanguageV1 = import_zod98.z.object({
|
|
5243
|
+
downgradeToOneTimeLabel: import_zod98.z.string().optional(),
|
|
5200
5244
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
5201
|
-
subscriptionOptionLabel:
|
|
5202
|
-
upgradeToSubscriptionLabel:
|
|
5203
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
5245
|
+
subscriptionOptionLabel: import_zod98.z.string().optional(),
|
|
5246
|
+
upgradeToSubscriptionLabel: import_zod98.z.string().optional(),
|
|
5247
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod98.z.string().optional()
|
|
5204
5248
|
});
|
|
5205
|
-
var LineItemEditorV1 =
|
|
5249
|
+
var LineItemEditorV1 = import_zod98.z.object({
|
|
5206
5250
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
5207
|
-
button:
|
|
5208
|
-
previewMode:
|
|
5209
|
-
switchToSubscription:
|
|
5210
|
-
disableDowngrade:
|
|
5251
|
+
button: import_zod98.z.object({ kind: import_zod98.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
5252
|
+
previewMode: import_zod98.z.boolean().optional(),
|
|
5253
|
+
switchToSubscription: import_zod98.z.object({
|
|
5254
|
+
disableDowngrade: import_zod98.z.boolean().optional(),
|
|
5211
5255
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
5212
5256
|
}).optional(),
|
|
5213
|
-
switchToSubscriptionEnabled:
|
|
5214
|
-
tracking:
|
|
5215
|
-
enableAttribution:
|
|
5216
|
-
enableSource:
|
|
5217
|
-
enableWidget:
|
|
5257
|
+
switchToSubscriptionEnabled: import_zod98.z.boolean().optional(),
|
|
5258
|
+
tracking: import_zod98.z.object({
|
|
5259
|
+
enableAttribution: import_zod98.z.boolean().optional(),
|
|
5260
|
+
enableSource: import_zod98.z.boolean().optional(),
|
|
5261
|
+
enableWidget: import_zod98.z.boolean().optional()
|
|
5218
5262
|
}).optional(),
|
|
5219
|
-
type:
|
|
5220
|
-
version:
|
|
5263
|
+
type: import_zod98.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
5264
|
+
version: import_zod98.z.literal(1)
|
|
5221
5265
|
});
|
|
5222
|
-
var LineItemEditor =
|
|
5266
|
+
var LineItemEditor = import_zod98.z.discriminatedUnion("version", [
|
|
5223
5267
|
LineItemEditorV1,
|
|
5224
5268
|
CABRootSection.extend({
|
|
5225
|
-
type:
|
|
5269
|
+
type: import_zod98.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
5226
5270
|
})
|
|
5227
5271
|
]);
|
|
5228
5272
|
|
|
5229
5273
|
// src/schema/widgets/progressBar.ts
|
|
5230
|
-
var
|
|
5231
|
-
var ProgressBar =
|
|
5232
|
-
type:
|
|
5274
|
+
var import_zod99 = require("zod");
|
|
5275
|
+
var ProgressBar = import_zod99.z.looseObject({
|
|
5276
|
+
type: import_zod99.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
5233
5277
|
});
|
|
5234
5278
|
|
|
5235
5279
|
// src/schema/widgets/rebuyButton.ts
|
|
5236
|
-
var
|
|
5237
|
-
var RebuyButtonV1 =
|
|
5238
|
-
type:
|
|
5239
|
-
version:
|
|
5280
|
+
var import_zod100 = require("zod");
|
|
5281
|
+
var RebuyButtonV1 = import_zod100.z.looseObject({
|
|
5282
|
+
type: import_zod100.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
5283
|
+
version: import_zod100.z.literal(1)
|
|
5240
5284
|
});
|
|
5241
|
-
var RebuyButton =
|
|
5285
|
+
var RebuyButton = import_zod100.z.discriminatedUnion("version", [
|
|
5242
5286
|
RebuyButtonV1,
|
|
5243
5287
|
CABRootSection.extend({
|
|
5244
|
-
type:
|
|
5288
|
+
type: import_zod100.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
5245
5289
|
})
|
|
5246
5290
|
]);
|
|
5247
5291
|
|
|
5248
5292
|
// src/schema/widgets/rebuyMonetize.ts
|
|
5249
|
-
var
|
|
5250
|
-
var RebuyMonetize =
|
|
5251
|
-
type:
|
|
5293
|
+
var import_zod101 = require("zod");
|
|
5294
|
+
var RebuyMonetize = import_zod101.z.looseObject({
|
|
5295
|
+
type: import_zod101.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
5252
5296
|
});
|
|
5253
|
-
var RebuyMonetizeV1 =
|
|
5254
|
-
name:
|
|
5255
|
-
previewMode:
|
|
5297
|
+
var RebuyMonetizeV1 = import_zod101.z.object({
|
|
5298
|
+
name: import_zod101.z.string().nullable().optional(),
|
|
5299
|
+
previewMode: import_zod101.z.boolean().optional(),
|
|
5256
5300
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
5257
|
-
privacyPolicyUrl:
|
|
5301
|
+
privacyPolicyUrl: import_zod101.z.string().nullable().optional(),
|
|
5258
5302
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
5259
|
-
subVertical:
|
|
5260
|
-
tracking:
|
|
5261
|
-
enableAttribution:
|
|
5262
|
-
enableSource:
|
|
5263
|
-
enableWidget:
|
|
5303
|
+
subVertical: import_zod101.z.string().nullable().optional(),
|
|
5304
|
+
tracking: import_zod101.z.object({
|
|
5305
|
+
enableAttribution: import_zod101.z.boolean().optional(),
|
|
5306
|
+
enableSource: import_zod101.z.boolean().optional(),
|
|
5307
|
+
enableWidget: import_zod101.z.boolean().optional()
|
|
5264
5308
|
}).optional(),
|
|
5265
|
-
type:
|
|
5266
|
-
version:
|
|
5309
|
+
type: import_zod101.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
5310
|
+
version: import_zod101.z.literal(1),
|
|
5267
5311
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
5268
|
-
vertical:
|
|
5312
|
+
vertical: import_zod101.z.string().nullable().optional()
|
|
5269
5313
|
});
|
|
5270
5314
|
|
|
5271
5315
|
// src/schema/widgetData.ts
|
|
@@ -5279,7 +5323,7 @@ var extensionWidgetTypes = [
|
|
|
5279
5323
|
WidgetType.ui_extension_line_item_editor,
|
|
5280
5324
|
WidgetType.ui_extension_progress_bar
|
|
5281
5325
|
];
|
|
5282
|
-
var WidgetData =
|
|
5326
|
+
var WidgetData = import_zod102.z.discriminatedUnion("type", [
|
|
5283
5327
|
ABTestingPlaceholder,
|
|
5284
5328
|
CheckoutExtension,
|
|
5285
5329
|
ContentBlock,
|
|
@@ -5639,36 +5683,36 @@ var SWITCH_LABELS = {
|
|
|
5639
5683
|
};
|
|
5640
5684
|
|
|
5641
5685
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5642
|
-
var
|
|
5686
|
+
var import_zod104 = require("zod");
|
|
5643
5687
|
|
|
5644
5688
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
5645
|
-
var
|
|
5646
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
5647
|
-
id:
|
|
5648
|
-
name:
|
|
5649
|
-
});
|
|
5650
|
-
var PostPurchaseWidget =
|
|
5651
|
-
classification:
|
|
5652
|
-
createdAtTime:
|
|
5653
|
-
customEndpointName:
|
|
5654
|
-
id:
|
|
5655
|
-
lastViewed:
|
|
5656
|
-
linkedCustomEndpointId:
|
|
5657
|
-
linkedFlows:
|
|
5658
|
-
name:
|
|
5659
|
-
owner:
|
|
5689
|
+
var import_zod103 = require("zod");
|
|
5690
|
+
var PostPurchaseWidgetLinkedFlow = import_zod103.z.object({
|
|
5691
|
+
id: import_zod103.z.number(),
|
|
5692
|
+
name: import_zod103.z.string()
|
|
5693
|
+
});
|
|
5694
|
+
var PostPurchaseWidget = import_zod103.z.object({
|
|
5695
|
+
classification: import_zod103.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
5696
|
+
createdAtTime: import_zod103.z.iso.datetime({ offset: true }).optional(),
|
|
5697
|
+
customEndpointName: import_zod103.z.string().nullish(),
|
|
5698
|
+
id: import_zod103.z.number().default(0),
|
|
5699
|
+
lastViewed: import_zod103.z.iso.datetime({ offset: true }).nullish(),
|
|
5700
|
+
linkedCustomEndpointId: import_zod103.z.number().nullish(),
|
|
5701
|
+
linkedFlows: import_zod103.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
5702
|
+
name: import_zod103.z.string().default(""),
|
|
5703
|
+
owner: import_zod103.z.number().nullish(),
|
|
5660
5704
|
settings: PostPurchaseSettings
|
|
5661
5705
|
});
|
|
5662
5706
|
|
|
5663
5707
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5664
|
-
var PostPurchaseOffer =
|
|
5665
|
-
|
|
5666
|
-
errors:
|
|
5667
|
-
message:
|
|
5668
|
-
successful:
|
|
5708
|
+
var PostPurchaseOffer = import_zod104.z.discriminatedUnion("successful", [
|
|
5709
|
+
import_zod104.z.strictObject({
|
|
5710
|
+
errors: import_zod104.z.array(import_zod104.z.object({ message: import_zod104.z.string() })),
|
|
5711
|
+
message: import_zod104.z.string(),
|
|
5712
|
+
successful: import_zod104.z.literal(false)
|
|
5669
5713
|
}),
|
|
5670
|
-
|
|
5671
|
-
successful:
|
|
5714
|
+
import_zod104.z.strictObject({
|
|
5715
|
+
successful: import_zod104.z.literal(true),
|
|
5672
5716
|
widget: PostPurchaseWidget
|
|
5673
5717
|
})
|
|
5674
5718
|
]);
|