@rebuy/rebuy 3.54.0 → 3.56.0
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/postPurchaseProductSource.d.ts +4 -1
- 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 +540 -448
- package/dist/server/index.d.ts +3 -2
- package/dist/server/index.mjs +540 -448
- package/dist/server/normalizePostPurchaseCollection.d.ts +11 -2
- package/dist/server/normalizePostPurchaseProduct.d.ts +276 -2
- package/dist/server/postPurchaseCardSections.d.ts +2 -2
- package/dist/server/postPurchasePlanCatalog.d.ts +5 -0
- 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 +12 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +3 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +3 -0
- package/dist/server/preparePostPurchaseStsMember.d.ts +3 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +1 -0
- package/dist/server/readPostPurchaseProductSource.d.ts +70 -0
- package/dist/server/shared.d.ts +2 -1
- package/dist/transforms/index.cjs +17 -11
- package/dist/transforms/index.mjs +17 -11
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2324,7 +2324,9 @@ var PostPurchaseSubscriptionTerms = z21.object({
|
|
|
2324
2324
|
intervalLabel: z21.string().min(1),
|
|
2325
2325
|
name: z21.string().min(1),
|
|
2326
2326
|
recurringShippingPrice: z21.number().nonnegative(),
|
|
2327
|
-
shippingOption: z21.object({ presentmentTitle: z21.string(), title: z21.string() })
|
|
2327
|
+
shippingOption: z21.object({ presentmentTitle: z21.string(), title: z21.string() }),
|
|
2328
|
+
/** A switch to subscription (STS): the one subscription that charges no initial shipping (L122). */
|
|
2329
|
+
sts: z21.literal(true).optional()
|
|
2328
2330
|
});
|
|
2329
2331
|
|
|
2330
2332
|
// src/schema/postPurchaseProduct.ts
|
|
@@ -4068,6 +4070,7 @@ var CABRootSection = CABLayoutSection.extend({
|
|
|
4068
4070
|
});
|
|
4069
4071
|
|
|
4070
4072
|
// src/schema/postPurchaseProductView.ts
|
|
4073
|
+
var StsMarker = z69.literal(true).optional();
|
|
4071
4074
|
var PostPurchaseProductView = z69.union([
|
|
4072
4075
|
z69.object({
|
|
4073
4076
|
changeset: PostPurchaseProductChangeset.optional(),
|
|
@@ -4083,6 +4086,7 @@ var PostPurchaseProductView = z69.union([
|
|
|
4083
4086
|
}),
|
|
4084
4087
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
4085
4088
|
sections: CABRootSection,
|
|
4089
|
+
sts: StsMarker,
|
|
4086
4090
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4087
4091
|
}),
|
|
4088
4092
|
z69.object({
|
|
@@ -4095,6 +4099,7 @@ var PostPurchaseProductView = z69.union([
|
|
|
4095
4099
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
4096
4100
|
/** A choice-level unavailable product keeps its card (values resolve blank); configuration failures send null. */
|
|
4097
4101
|
sections: CABRootSection.nullable(),
|
|
4102
|
+
sts: StsMarker,
|
|
4098
4103
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4099
4104
|
})
|
|
4100
4105
|
]);
|
|
@@ -4242,102 +4247,129 @@ var HealthResultResponseSchema = z74.object({
|
|
|
4242
4247
|
successful: z74.literal(true)
|
|
4243
4248
|
});
|
|
4244
4249
|
|
|
4245
|
-
// src/schema/
|
|
4250
|
+
// src/schema/postPurchaseLedger.ts
|
|
4246
4251
|
import { z as z75 } from "zod";
|
|
4247
|
-
var
|
|
4252
|
+
var CLIENT_LEDGER_MAX_EVENTS = 16;
|
|
4253
|
+
var CLIENT_LEDGER_TYPES = [
|
|
4254
|
+
"decision.verdict",
|
|
4255
|
+
"error.flow",
|
|
4256
|
+
"error.schema",
|
|
4257
|
+
"offer.decline",
|
|
4258
|
+
"render.gate",
|
|
4259
|
+
"shouldRender.selectedFlow"
|
|
4260
|
+
];
|
|
4261
|
+
var ClientLedgerPayloadValueSchema = z75.union([z75.string().max(256), z75.number().finite(), z75.boolean()]);
|
|
4262
|
+
var ClientLedgerEventSchema = z75.strictObject({
|
|
4263
|
+
/** The client's diagnostic id for one Shopify context; `(instance, seq)` names a row. */
|
|
4264
|
+
instance: z75.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
|
|
4265
|
+
payload: z75.record(z75.string().regex(/^[A-Za-z][A-Za-z0-9_.()]{0,63}$/), ClientLedgerPayloadValueSchema).refine((payload) => Object.keys(payload).length <= 24, "At most 24 payload members"),
|
|
4266
|
+
phase: z75.enum(["render", "shouldRender"]),
|
|
4267
|
+
/** `-1` is the dev-store runtime probe's row (cab-post-purchase `dev-store/runtimeProbe.ts`). */
|
|
4268
|
+
seq: z75.number().int().min(-1).max(1e5),
|
|
4269
|
+
/** The client's clock when it observed the row, as the legacy client rows carry it. */
|
|
4270
|
+
ts: z75.iso.datetime(),
|
|
4271
|
+
type: z75.enum(CLIENT_LEDGER_TYPES)
|
|
4272
|
+
});
|
|
4273
|
+
var ClientLedgerRequestSchema = z75.object({
|
|
4274
|
+
events: z75.array(ClientLedgerEventSchema).min(1).max(CLIENT_LEDGER_MAX_EVENTS)
|
|
4275
|
+
});
|
|
4276
|
+
|
|
4277
|
+
// src/schema/postPurchaseLifecycle.ts
|
|
4278
|
+
import { z as z76 } from "zod";
|
|
4279
|
+
var Presentation = z76.strictObject({
|
|
4248
4280
|
member: PostPurchaseMemberIdentity,
|
|
4249
4281
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4250
4282
|
variant: PostPurchaseVariantSelector
|
|
4251
4283
|
});
|
|
4252
4284
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4253
4285
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4254
|
-
eventType:
|
|
4286
|
+
eventType: z76.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4255
4287
|
presentation: Presentation.nullable(),
|
|
4256
4288
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4257
|
-
requestId:
|
|
4289
|
+
requestId: z76.uuid()
|
|
4258
4290
|
}).strict().refine(
|
|
4259
4291
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4260
4292
|
"Viewed observations require a presented product"
|
|
4261
4293
|
);
|
|
4262
|
-
var LifecycleObservationResponseSchema =
|
|
4263
|
-
data:
|
|
4294
|
+
var LifecycleObservationResponseSchema = z76.object({
|
|
4295
|
+
data: z76.strictObject({
|
|
4264
4296
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4265
|
-
status:
|
|
4297
|
+
status: z76.union([AcceptedEventOutcomeSchema, z76.literal("unavailable")])
|
|
4266
4298
|
}),
|
|
4267
|
-
successful:
|
|
4299
|
+
successful: z76.literal(true)
|
|
4268
4300
|
});
|
|
4269
4301
|
|
|
4270
4302
|
// src/schema/postPurchaseOffer.ts
|
|
4271
|
-
import { z as
|
|
4303
|
+
import { z as z77 } from "zod";
|
|
4272
4304
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4273
|
-
var OfferPreparationResponseSchema =
|
|
4274
|
-
data:
|
|
4275
|
-
successful:
|
|
4305
|
+
var OfferPreparationResponseSchema = z77.object({
|
|
4306
|
+
data: z77.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4307
|
+
successful: z77.literal(true)
|
|
4276
4308
|
});
|
|
4277
4309
|
|
|
4278
4310
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4279
|
-
import { z as
|
|
4311
|
+
import { z as z78 } from "zod";
|
|
4280
4312
|
var selection2 = PreparedPostPurchaseProduct.shape.selection;
|
|
4281
|
-
var PostPurchaseOfferSkipReason =
|
|
4282
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4313
|
+
var PostPurchaseOfferSkipReason = z78.enum(["empty", "no-eligible-subscription"]);
|
|
4314
|
+
var PostPurchaseOfferEligibilityContext = z78.object({
|
|
4283
4315
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4284
|
-
originalLineItems:
|
|
4316
|
+
originalLineItems: z78.array(selection2.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4285
4317
|
});
|
|
4286
|
-
var PostPurchaseStsOptions =
|
|
4287
|
-
var PostPurchaseStsContext =
|
|
4288
|
-
originalLineItems:
|
|
4318
|
+
var PostPurchaseStsOptions = z78.object({ sts: z78.boolean().optional() }).strict();
|
|
4319
|
+
var PostPurchaseStsContext = z78.object({
|
|
4320
|
+
originalLineItems: z78.array(
|
|
4289
4321
|
selection2.pick({ productId: true, quantity: true, sellingPlanId: true, variantId: true })
|
|
4290
4322
|
)
|
|
4291
4323
|
});
|
|
4292
|
-
var PostPurchaseOfferEligibility =
|
|
4293
|
-
|
|
4294
|
-
members:
|
|
4295
|
-
|
|
4324
|
+
var PostPurchaseOfferEligibility = z78.discriminatedUnion("status", [
|
|
4325
|
+
z78.object({
|
|
4326
|
+
members: z78.array(
|
|
4327
|
+
z78.object({ productId: selection2.shape.productId, productIndex: z78.number().int().nonnegative() })
|
|
4296
4328
|
),
|
|
4297
4329
|
/** Present only with STS on: each member switches one original one-time line to subscription. */
|
|
4298
|
-
mode:
|
|
4299
|
-
status:
|
|
4330
|
+
mode: z78.literal("sts").optional(),
|
|
4331
|
+
status: z78.literal("retain")
|
|
4300
4332
|
}),
|
|
4301
|
-
|
|
4302
|
-
|
|
4333
|
+
z78.object({ reason: PostPurchaseOfferSkipReason, status: z78.literal("skip") }),
|
|
4334
|
+
z78.object({ reason: z78.literal("eligible-sts").optional(), status: z78.literal("unavailable") })
|
|
4303
4335
|
]);
|
|
4304
4336
|
|
|
4305
4337
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4306
|
-
import { z as
|
|
4338
|
+
import { z as z79 } from "zod";
|
|
4307
4339
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4308
|
-
var PostPurchaseOfferPresentation =
|
|
4340
|
+
var PostPurchaseOfferPresentation = z79.strictObject({
|
|
4309
4341
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4310
4342
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4311
4343
|
sections: CABRootSection.nullable(),
|
|
4312
4344
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4313
4345
|
});
|
|
4314
4346
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4315
|
-
var OfferPresentationResponseSchema =
|
|
4316
|
-
data:
|
|
4347
|
+
var OfferPresentationResponseSchema = z79.object({
|
|
4348
|
+
data: z79.strictObject({
|
|
4317
4349
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4318
4350
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4319
4351
|
serverNow: PostPurchaseTimestampSchema
|
|
4320
4352
|
}),
|
|
4321
|
-
successful:
|
|
4353
|
+
successful: z79.literal(true)
|
|
4322
4354
|
});
|
|
4323
4355
|
|
|
4324
4356
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4325
|
-
import { z as
|
|
4326
|
-
var OrderDecisionSchema =
|
|
4327
|
-
|
|
4328
|
-
|
|
4357
|
+
import { z as z80 } from "zod";
|
|
4358
|
+
var OrderDecisionSchema = z80.discriminatedUnion("owner", [
|
|
4359
|
+
z80.object({ owner: z80.literal("session"), sessionId: PostPurchaseSessionIdSchema }),
|
|
4360
|
+
z80.object({ owner: z80.literal("release"), sessionId: z80.null() })
|
|
4329
4361
|
]);
|
|
4330
4362
|
|
|
4331
4363
|
// src/schema/postPurchasePolicy.ts
|
|
4332
|
-
import { z as
|
|
4333
|
-
var HoldSettingSchema =
|
|
4334
|
-
|
|
4335
|
-
|
|
4364
|
+
import { z as z81 } from "zod";
|
|
4365
|
+
var HoldSettingSchema = z81.discriminatedUnion("enabled", [
|
|
4366
|
+
z81.object({ durationMinutes: z81.number().int().min(1).max(60), enabled: z81.literal(true) }),
|
|
4367
|
+
z81.object({ durationMinutes: z81.null(), enabled: z81.literal(false) })
|
|
4336
4368
|
]);
|
|
4337
|
-
var TimingSettingsSchema =
|
|
4369
|
+
var TimingSettingsSchema = z81.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4338
4370
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4339
|
-
durationMinutes:
|
|
4340
|
-
source:
|
|
4371
|
+
durationMinutes: z81.number().int().min(1).max(60).nullable(),
|
|
4372
|
+
source: z81.enum(["shop", "flow", "native"])
|
|
4341
4373
|
}).refine(
|
|
4342
4374
|
(policy) => {
|
|
4343
4375
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4351,8 +4383,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4351
4383
|
);
|
|
4352
4384
|
|
|
4353
4385
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4354
|
-
import { z as
|
|
4355
|
-
var PostPurchasePreparationOptions =
|
|
4386
|
+
import { z as z82 } from "zod";
|
|
4387
|
+
var PostPurchasePreparationOptions = z82.object({
|
|
4356
4388
|
choice: PostPurchaseChoice.optional(),
|
|
4357
4389
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4358
4390
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4364,8 +4396,8 @@ var PostPurchasePreparationOptions = z81.object({
|
|
|
4364
4396
|
);
|
|
4365
4397
|
|
|
4366
4398
|
// src/schema/postPurchaseProductSettings.ts
|
|
4367
|
-
import { z as
|
|
4368
|
-
var amount =
|
|
4399
|
+
import { z as z83 } from "zod";
|
|
4400
|
+
var amount = z83.union([z83.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4369
4401
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4370
4402
|
discountedFrom: true,
|
|
4371
4403
|
language: true,
|
|
@@ -4377,30 +4409,30 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4377
4409
|
subscriptionIsDefault: true,
|
|
4378
4410
|
upgradeToSubscription: true
|
|
4379
4411
|
}).extend({
|
|
4380
|
-
advance:
|
|
4381
|
-
blocks:
|
|
4412
|
+
advance: z83.unknown().default({}),
|
|
4413
|
+
blocks: z83.array(z83.unknown()).optional(),
|
|
4382
4414
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4383
|
-
integrations:
|
|
4415
|
+
integrations: z83.unknown().default({}),
|
|
4384
4416
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4385
|
-
styles:
|
|
4417
|
+
styles: z83.unknown().default({}),
|
|
4386
4418
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4387
|
-
subscription:
|
|
4419
|
+
subscription: z83.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4388
4420
|
});
|
|
4389
4421
|
|
|
4390
4422
|
// src/schema/postPurchaseRecovery.ts
|
|
4391
|
-
import { z as
|
|
4392
|
-
var RecoveredFollowupsSchema =
|
|
4393
|
-
acceptedEvent:
|
|
4394
|
-
acceptedMetafield:
|
|
4423
|
+
import { z as z84 } from "zod";
|
|
4424
|
+
var RecoveredFollowupsSchema = z84.strictObject({
|
|
4425
|
+
acceptedEvent: z84.union([AcceptedEventAttemptProgressSchema, AcceptedEventResultProgressSchema]).nullable(),
|
|
4426
|
+
acceptedMetafield: z84.union([AcceptedMetafieldOutcomeSchema, z84.literal("attempted")]).nullable()
|
|
4395
4427
|
});
|
|
4396
4428
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4397
|
-
var PurchaseRecoveryResponseSchema =
|
|
4398
|
-
data:
|
|
4429
|
+
var PurchaseRecoveryResponseSchema = z84.object({
|
|
4430
|
+
data: z84.object({
|
|
4399
4431
|
/**
|
|
4400
4432
|
* Strict, so a client pinned before a new optional field rejects a reply that carries it rather than
|
|
4401
4433
|
* stripping it. Release the client before rebuy-api starts emitting a field added here.
|
|
4402
4434
|
*/
|
|
4403
|
-
operation:
|
|
4435
|
+
operation: z84.object({
|
|
4404
4436
|
/** Absent from a rebuy-api that predates it. */
|
|
4405
4437
|
followups: RecoveredFollowupsSchema.optional(),
|
|
4406
4438
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
@@ -4423,41 +4455,41 @@ var PurchaseRecoveryResponseSchema = z83.object({
|
|
|
4423
4455
|
).nullable(),
|
|
4424
4456
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4425
4457
|
}),
|
|
4426
|
-
successful:
|
|
4458
|
+
successful: z84.literal(true)
|
|
4427
4459
|
});
|
|
4428
4460
|
|
|
4429
4461
|
// src/schema/postPurchaseReleaseClaim.ts
|
|
4430
|
-
import { z as
|
|
4462
|
+
import { z as z85 } from "zod";
|
|
4431
4463
|
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
4432
|
-
var ReleaseClaimResponseSchema =
|
|
4433
|
-
data:
|
|
4434
|
-
|
|
4464
|
+
var ReleaseClaimResponseSchema = z85.object({
|
|
4465
|
+
data: z85.discriminatedUnion("status", [
|
|
4466
|
+
z85.object({ status: z85.literal("release-permitted") }),
|
|
4435
4467
|
PendingReleaseAuthoritySchema,
|
|
4436
4468
|
ReadyReleaseAuthoritySchema
|
|
4437
4469
|
]),
|
|
4438
|
-
successful:
|
|
4470
|
+
successful: z85.literal(true)
|
|
4439
4471
|
});
|
|
4440
4472
|
|
|
4441
4473
|
// src/schema/postPurchaseSelection.ts
|
|
4442
|
-
import { z as
|
|
4474
|
+
import { z as z86 } from "zod";
|
|
4443
4475
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4444
4476
|
appId: PostPurchaseAppIdSchema,
|
|
4445
4477
|
entry: DecisionEntrySchema,
|
|
4446
|
-
iss:
|
|
4447
|
-
purpose:
|
|
4478
|
+
iss: z86.literal("rebuy-api"),
|
|
4479
|
+
purpose: z86.literal("post-purchase-selection")
|
|
4448
4480
|
});
|
|
4449
4481
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4450
|
-
selectionToken:
|
|
4482
|
+
selectionToken: z86.string().min(1).max(8192).optional()
|
|
4451
4483
|
}).strict();
|
|
4452
4484
|
|
|
4453
4485
|
// src/schema/postPurchaseSession.ts
|
|
4454
|
-
import { z as
|
|
4486
|
+
import { z as z87 } from "zod";
|
|
4455
4487
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4456
|
-
var SessionOrderTimingSchema =
|
|
4488
|
+
var SessionOrderTimingSchema = z87.object({
|
|
4457
4489
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4458
4490
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4459
4491
|
orderId: PostPurchaseOrderIdSchema,
|
|
4460
|
-
timingSource:
|
|
4492
|
+
timingSource: z87.literal("shopify-order-created-at")
|
|
4461
4493
|
});
|
|
4462
4494
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4463
4495
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4474,33 +4506,39 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4474
4506
|
message: "deadline must not exceed nativeDeadline",
|
|
4475
4507
|
path: ["deadline"]
|
|
4476
4508
|
});
|
|
4477
|
-
var SessionStartResponseSchema =
|
|
4478
|
-
data:
|
|
4479
|
-
phase:
|
|
4509
|
+
var SessionStartResponseSchema = z87.object({
|
|
4510
|
+
data: z87.object({
|
|
4511
|
+
phase: z87.literal("render"),
|
|
4480
4512
|
serverNow: PostPurchaseTimestampSchema,
|
|
4481
4513
|
session: ReadySessionTimingSchema,
|
|
4482
|
-
workflowPhase:
|
|
4514
|
+
workflowPhase: z87.literal("start")
|
|
4483
4515
|
}),
|
|
4484
|
-
successful:
|
|
4516
|
+
successful: z87.literal(true)
|
|
4517
|
+
});
|
|
4518
|
+
var PostPurchaseOrderPendingSchema = z87.object({
|
|
4519
|
+
errors: z87.array(z87.object({ message: z87.string() })),
|
|
4520
|
+
message: z87.string(),
|
|
4521
|
+
reason: z87.literal("order-pending"),
|
|
4522
|
+
successful: z87.literal(false)
|
|
4485
4523
|
});
|
|
4486
4524
|
|
|
4487
4525
|
// src/schema/postPurchaseShadow.ts
|
|
4488
|
-
import { z as
|
|
4489
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4490
|
-
|
|
4491
|
-
|
|
4526
|
+
import { z as z88 } from "zod";
|
|
4527
|
+
var PostPurchaseShadowSelectionSchema = z88.discriminatedUnion("verdict", [
|
|
4528
|
+
z88.object({ entry: DecisionEntrySchema, verdict: z88.literal("render") }),
|
|
4529
|
+
z88.object({ verdict: z88.literal("skip") })
|
|
4492
4530
|
]);
|
|
4493
|
-
var PostPurchaseShadowReportFields =
|
|
4494
|
-
differences:
|
|
4531
|
+
var PostPurchaseShadowReportFields = z88.object({
|
|
4532
|
+
differences: z88.array(z88.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4495
4533
|
message: "differences must not contain duplicate entries"
|
|
4496
4534
|
}),
|
|
4497
4535
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4498
|
-
phase:
|
|
4499
|
-
sampleId:
|
|
4536
|
+
phase: z88.literal("shouldRender"),
|
|
4537
|
+
sampleId: z88.string(),
|
|
4500
4538
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4501
|
-
status:
|
|
4502
|
-
targetingFlowIds:
|
|
4503
|
-
workflowPhase:
|
|
4539
|
+
status: z88.enum(["match", "diverged", "incomplete"]),
|
|
4540
|
+
targetingFlowIds: z88.array(z88.number().int().positive()),
|
|
4541
|
+
workflowPhase: z88.literal("decide")
|
|
4504
4542
|
});
|
|
4505
4543
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4506
4544
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4514,13 +4552,14 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4514
4552
|
});
|
|
4515
4553
|
|
|
4516
4554
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4517
|
-
import { z as
|
|
4555
|
+
import { z as z89 } from "zod";
|
|
4518
4556
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4519
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4557
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: z89.number().int().positive() }),
|
|
4520
4558
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4521
4559
|
subscription: PostPurchaseSubscriptionTerms
|
|
4522
4560
|
}).refine(
|
|
4523
|
-
({ discount, shipping, subscription }) => (discount.type !== "none" || discount.amount === 0) &&
|
|
4561
|
+
({ discount, shipping, subscription }) => (discount.type !== "none" || discount.amount === 0) && // A switch to subscription charges no initial shipping (L122); any other subscription charges it.
|
|
4562
|
+
subscription.initialShippingPrice === (subscription.sts ? 0 : shipping.amount) && shipping.amount === subscription.recurringShippingPrice && (shipping.type !== "free" || shipping.amount === 0)
|
|
4524
4563
|
)
|
|
4525
4564
|
});
|
|
4526
4565
|
var readPostPurchaseSubscription = (prepared) => {
|
|
@@ -4529,93 +4568,93 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4529
4568
|
};
|
|
4530
4569
|
|
|
4531
4570
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4532
|
-
import { z as
|
|
4571
|
+
import { z as z90 } from "zod";
|
|
4533
4572
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
4534
4573
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
4535
4574
|
});
|
|
4536
4575
|
var variant = values.extend({
|
|
4537
4576
|
id: PostPurchaseVariantId,
|
|
4538
|
-
inventoryManagement:
|
|
4539
|
-
inventoryPolicy:
|
|
4540
|
-
inventoryQuantity:
|
|
4577
|
+
inventoryManagement: z90.string().nullable(),
|
|
4578
|
+
inventoryPolicy: z90.string(),
|
|
4579
|
+
inventoryQuantity: z90.number()
|
|
4541
4580
|
});
|
|
4542
|
-
var options =
|
|
4543
|
-
var PostPurchaseVariantDefaultProduct =
|
|
4581
|
+
var options = z90.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
4582
|
+
var PostPurchaseVariantDefaultProduct = z90.object({
|
|
4544
4583
|
id: PostPurchaseProductId,
|
|
4545
4584
|
options,
|
|
4546
4585
|
selectedVariant: variant.optional(),
|
|
4547
|
-
variants:
|
|
4586
|
+
variants: z90.array(variant)
|
|
4548
4587
|
});
|
|
4549
4588
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
4550
4589
|
hideOutOfStockVariants: true,
|
|
4551
4590
|
matchVariant: true
|
|
4552
4591
|
});
|
|
4553
|
-
var PostPurchaseOrderAttributes =
|
|
4554
|
-
var PostPurchaseOriginalVariants =
|
|
4555
|
-
|
|
4592
|
+
var PostPurchaseOrderAttributes = z90.record(z90.string(), z90.array(z90.string())).default({});
|
|
4593
|
+
var PostPurchaseOriginalVariants = z90.array(
|
|
4594
|
+
z90.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
4556
4595
|
);
|
|
4557
|
-
var PostPurchaseAttributeProducts =
|
|
4558
|
-
|
|
4596
|
+
var PostPurchaseAttributeProducts = z90.array(
|
|
4597
|
+
z90.object({ id: PostPurchaseProductId, options, variants: z90.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
4559
4598
|
);
|
|
4560
4599
|
|
|
4561
4600
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
4562
|
-
import { z as
|
|
4563
|
-
var PostPurchaseVariantDefaultContext =
|
|
4564
|
-
enrichedLineItems:
|
|
4601
|
+
import { z as z91 } from "zod";
|
|
4602
|
+
var PostPurchaseVariantDefaultContext = z91.object({
|
|
4603
|
+
enrichedLineItems: z91.unknown().optional(),
|
|
4565
4604
|
originalVariants: PostPurchaseOriginalVariants
|
|
4566
4605
|
});
|
|
4567
4606
|
|
|
4568
4607
|
// src/schema/shopConfig.ts
|
|
4569
|
-
import { z as
|
|
4570
|
-
var ShopConfig =
|
|
4571
|
-
activeExperiments:
|
|
4572
|
-
|
|
4573
|
-
data:
|
|
4574
|
-
|
|
4575
|
-
aliasName:
|
|
4576
|
-
cssInput:
|
|
4577
|
-
elementId:
|
|
4578
|
-
id:
|
|
4579
|
-
javascriptInput:
|
|
4580
|
-
traffic:
|
|
4608
|
+
import { z as z92 } from "zod";
|
|
4609
|
+
var ShopConfig = z92.object({
|
|
4610
|
+
activeExperiments: z92.array(
|
|
4611
|
+
z92.object({
|
|
4612
|
+
data: z92.array(
|
|
4613
|
+
z92.object({
|
|
4614
|
+
aliasName: z92.string(),
|
|
4615
|
+
cssInput: z92.string().nullish(),
|
|
4616
|
+
elementId: z92.coerce.number(),
|
|
4617
|
+
id: z92.coerce.number(),
|
|
4618
|
+
javascriptInput: z92.string().nullish(),
|
|
4619
|
+
traffic: z92.coerce.number()
|
|
4581
4620
|
})
|
|
4582
4621
|
),
|
|
4583
|
-
id:
|
|
4584
|
-
name:
|
|
4585
|
-
pageTarget:
|
|
4586
|
-
pageTargetUrl:
|
|
4587
|
-
placeholderId:
|
|
4588
|
-
type:
|
|
4622
|
+
id: z92.coerce.number(),
|
|
4623
|
+
name: z92.string(),
|
|
4624
|
+
pageTarget: z92.string().nullable(),
|
|
4625
|
+
pageTargetUrl: z92.string().nullable(),
|
|
4626
|
+
placeholderId: z92.coerce.number().nullable(),
|
|
4627
|
+
type: z92.string()
|
|
4589
4628
|
})
|
|
4590
4629
|
),
|
|
4591
|
-
activePackages:
|
|
4592
|
-
|
|
4593
|
-
cancelledAt:
|
|
4594
|
-
id:
|
|
4595
|
-
installedAt:
|
|
4596
|
-
isActive:
|
|
4597
|
-
isBillable:
|
|
4598
|
-
packageId:
|
|
4599
|
-
packageName:
|
|
4600
|
-
shortName:
|
|
4601
|
-
trialDays:
|
|
4602
|
-
uninstalledAt:
|
|
4630
|
+
activePackages: z92.array(
|
|
4631
|
+
z92.object({
|
|
4632
|
+
cancelledAt: z92.string().nullable(),
|
|
4633
|
+
id: z92.number(),
|
|
4634
|
+
installedAt: z92.string().nullable(),
|
|
4635
|
+
isActive: z92.boolean(),
|
|
4636
|
+
isBillable: z92.boolean(),
|
|
4637
|
+
packageId: z92.number(),
|
|
4638
|
+
packageName: z92.string(),
|
|
4639
|
+
shortName: z92.string(),
|
|
4640
|
+
trialDays: z92.number(),
|
|
4641
|
+
uninstalledAt: z92.string().nullable()
|
|
4603
4642
|
})
|
|
4604
4643
|
),
|
|
4605
|
-
apiKey:
|
|
4606
|
-
billingVersion:
|
|
4607
|
-
cacheKey:
|
|
4608
|
-
carousel:
|
|
4609
|
-
currency:
|
|
4610
|
-
currencySymbol:
|
|
4611
|
-
domain:
|
|
4612
|
-
enabledJquery:
|
|
4613
|
-
enabledPresentmentCurrencies:
|
|
4614
|
-
hasSmartCollectionsEnabled:
|
|
4615
|
-
hasSmartSearchEnabled:
|
|
4616
|
-
id:
|
|
4617
|
-
integrations:
|
|
4618
|
-
|
|
4644
|
+
apiKey: z92.string(),
|
|
4645
|
+
billingVersion: z92.string().nullable(),
|
|
4646
|
+
cacheKey: z92.coerce.number(),
|
|
4647
|
+
carousel: z92.enum(["flickity", "splide"]),
|
|
4648
|
+
currency: z92.string(),
|
|
4649
|
+
currencySymbol: z92.string(),
|
|
4650
|
+
domain: z92.string(),
|
|
4651
|
+
enabledJquery: z92.boolean(),
|
|
4652
|
+
enabledPresentmentCurrencies: z92.array(z92.string()),
|
|
4653
|
+
hasSmartCollectionsEnabled: z92.boolean(),
|
|
4654
|
+
hasSmartSearchEnabled: z92.boolean(),
|
|
4655
|
+
id: z92.coerce.number(),
|
|
4656
|
+
integrations: z92.record(
|
|
4657
|
+
z92.enum([
|
|
4619
4658
|
"attentive",
|
|
4620
4659
|
"judgeme",
|
|
4621
4660
|
"junip",
|
|
@@ -4628,170 +4667,170 @@ var ShopConfig = z91.object({
|
|
|
4628
4667
|
"stamped",
|
|
4629
4668
|
"yotpo"
|
|
4630
4669
|
]),
|
|
4631
|
-
|
|
4670
|
+
z92.union([z92.boolean(), z92.unknown()])
|
|
4632
4671
|
),
|
|
4633
|
-
markets:
|
|
4634
|
-
enabled:
|
|
4672
|
+
markets: z92.object({
|
|
4673
|
+
enabled: z92.boolean()
|
|
4635
4674
|
}),
|
|
4636
|
-
monetize:
|
|
4637
|
-
publisherKey:
|
|
4675
|
+
monetize: z92.object({
|
|
4676
|
+
publisherKey: z92.string().nullable()
|
|
4638
4677
|
}).nullish(),
|
|
4639
|
-
moneyFormat:
|
|
4640
|
-
myshopifyDomain:
|
|
4641
|
-
primaryLocale:
|
|
4642
|
-
productGroupsEnabled:
|
|
4643
|
-
rechargeCustomDomain:
|
|
4644
|
-
sellingPlansEnabled:
|
|
4645
|
-
shopId:
|
|
4646
|
-
shopifySellingPlansEnabled:
|
|
4647
|
-
shopName:
|
|
4648
|
-
storefrontAccessToken:
|
|
4649
|
-
useRebuyIcons:
|
|
4678
|
+
moneyFormat: z92.string(),
|
|
4679
|
+
myshopifyDomain: z92.string(),
|
|
4680
|
+
primaryLocale: z92.string(),
|
|
4681
|
+
productGroupsEnabled: z92.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
4682
|
+
rechargeCustomDomain: z92.string().nullable(),
|
|
4683
|
+
sellingPlansEnabled: z92.boolean(),
|
|
4684
|
+
shopId: z92.number(),
|
|
4685
|
+
shopifySellingPlansEnabled: z92.boolean(),
|
|
4686
|
+
shopName: z92.string(),
|
|
4687
|
+
storefrontAccessToken: z92.string().nullable(),
|
|
4688
|
+
useRebuyIcons: z92.boolean()
|
|
4650
4689
|
});
|
|
4651
4690
|
|
|
4652
4691
|
// src/schema/userConfig.ts
|
|
4653
|
-
import { z as
|
|
4654
|
-
var UserConfig =
|
|
4692
|
+
import { z as z93 } from "zod";
|
|
4693
|
+
var UserConfig = z93.object({
|
|
4655
4694
|
shop: ShopConfig,
|
|
4656
4695
|
/**
|
|
4657
4696
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
4658
4697
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
4659
4698
|
*/
|
|
4660
4699
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
4661
|
-
smartFlows:
|
|
4700
|
+
smartFlows: z93.array(z93.unknown())
|
|
4662
4701
|
});
|
|
4663
4702
|
|
|
4664
4703
|
// src/schema/widgetData.ts
|
|
4665
|
-
import { z as
|
|
4704
|
+
import { z as z102 } from "zod";
|
|
4666
4705
|
|
|
4667
4706
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
4668
|
-
import { z as
|
|
4669
|
-
var ABTestingPlaceholder =
|
|
4670
|
-
type:
|
|
4707
|
+
import { z as z94 } from "zod";
|
|
4708
|
+
var ABTestingPlaceholder = z94.looseObject({
|
|
4709
|
+
type: z94.literal("placeholder")
|
|
4671
4710
|
});
|
|
4672
4711
|
|
|
4673
4712
|
// src/schema/widgets/checkoutExtension.ts
|
|
4674
|
-
import { z as
|
|
4675
|
-
var CheckoutExtension =
|
|
4676
|
-
type:
|
|
4713
|
+
import { z as z95 } from "zod";
|
|
4714
|
+
var CheckoutExtension = z95.looseObject({
|
|
4715
|
+
type: z95.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
4677
4716
|
});
|
|
4678
4717
|
|
|
4679
4718
|
// src/schema/widgets/contentBlock.ts
|
|
4680
|
-
import { z as
|
|
4681
|
-
var ContentBlockV1 =
|
|
4682
|
-
blockSpacing:
|
|
4683
|
-
imageBlocks:
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
altText:
|
|
4687
|
-
description:
|
|
4688
|
-
id:
|
|
4689
|
-
imagePlacement:
|
|
4690
|
-
imageSize:
|
|
4691
|
-
imageUrl:
|
|
4692
|
-
textAlignment:
|
|
4719
|
+
import { z as z96 } from "zod";
|
|
4720
|
+
var ContentBlockV1 = z96.object({
|
|
4721
|
+
blockSpacing: z96.enum(spacings).optional(),
|
|
4722
|
+
imageBlocks: z96.union([
|
|
4723
|
+
z96.array(
|
|
4724
|
+
z96.object({
|
|
4725
|
+
altText: z96.string().nullable(),
|
|
4726
|
+
description: z96.string().nullable(),
|
|
4727
|
+
id: z96.uuid(),
|
|
4728
|
+
imagePlacement: z96.enum(["top", "right", "bottom", "left"]),
|
|
4729
|
+
imageSize: z96.number(),
|
|
4730
|
+
imageUrl: z96.url(),
|
|
4731
|
+
textAlignment: z96.enum(["left", "center", "right"]),
|
|
4693
4732
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
4694
|
-
textSize:
|
|
4733
|
+
textSize: z96.enum(inlineTextSizeNames)
|
|
4695
4734
|
})
|
|
4696
4735
|
),
|
|
4697
|
-
|
|
4736
|
+
z96.strictObject({}).transform(() => [])
|
|
4698
4737
|
]).optional(),
|
|
4699
|
-
imageLayout:
|
|
4700
|
-
language:
|
|
4701
|
-
description:
|
|
4702
|
-
superTitle:
|
|
4703
|
-
title:
|
|
4738
|
+
imageLayout: z96.enum(["row", "column"]).optional(),
|
|
4739
|
+
language: z96.object({
|
|
4740
|
+
description: z96.string(),
|
|
4741
|
+
superTitle: z96.string(),
|
|
4742
|
+
title: z96.string()
|
|
4704
4743
|
}),
|
|
4705
|
-
previewMode:
|
|
4706
|
-
type:
|
|
4707
|
-
version:
|
|
4744
|
+
previewMode: z96.boolean(),
|
|
4745
|
+
type: z96.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
4746
|
+
version: z96.literal(1)
|
|
4708
4747
|
});
|
|
4709
|
-
var ContentBlock =
|
|
4748
|
+
var ContentBlock = z96.discriminatedUnion("version", [
|
|
4710
4749
|
ContentBlockV1,
|
|
4711
4750
|
CABRootSection.extend({
|
|
4712
|
-
type:
|
|
4751
|
+
type: z96.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
4713
4752
|
})
|
|
4714
4753
|
]);
|
|
4715
4754
|
|
|
4716
4755
|
// src/schema/widgets/giftWithPurchase.ts
|
|
4717
|
-
import { z as
|
|
4718
|
-
var GiftWithPurchase =
|
|
4719
|
-
type:
|
|
4756
|
+
import { z as z97 } from "zod";
|
|
4757
|
+
var GiftWithPurchase = z97.looseObject({
|
|
4758
|
+
type: z97.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
4720
4759
|
});
|
|
4721
4760
|
|
|
4722
4761
|
// src/schema/widgets/lineItemEditor.ts
|
|
4723
|
-
import { z as
|
|
4724
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
4725
|
-
downgradeToOneTimeLabel:
|
|
4762
|
+
import { z as z98 } from "zod";
|
|
4763
|
+
var LineItemEditorSwitchLanguageV1 = z98.object({
|
|
4764
|
+
downgradeToOneTimeLabel: z98.string().optional(),
|
|
4726
4765
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
4727
|
-
subscriptionOptionLabel:
|
|
4728
|
-
upgradeToSubscriptionLabel:
|
|
4729
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
4766
|
+
subscriptionOptionLabel: z98.string().optional(),
|
|
4767
|
+
upgradeToSubscriptionLabel: z98.string().optional(),
|
|
4768
|
+
upgradeToSubscriptionWithoutDiscountLabel: z98.string().optional()
|
|
4730
4769
|
});
|
|
4731
|
-
var LineItemEditorV1 =
|
|
4770
|
+
var LineItemEditorV1 = z98.object({
|
|
4732
4771
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
4733
|
-
button:
|
|
4734
|
-
previewMode:
|
|
4735
|
-
switchToSubscription:
|
|
4736
|
-
disableDowngrade:
|
|
4772
|
+
button: z98.object({ kind: z98.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
4773
|
+
previewMode: z98.boolean().optional(),
|
|
4774
|
+
switchToSubscription: z98.object({
|
|
4775
|
+
disableDowngrade: z98.boolean().optional(),
|
|
4737
4776
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
4738
4777
|
}).optional(),
|
|
4739
|
-
switchToSubscriptionEnabled:
|
|
4740
|
-
tracking:
|
|
4741
|
-
enableAttribution:
|
|
4742
|
-
enableSource:
|
|
4743
|
-
enableWidget:
|
|
4778
|
+
switchToSubscriptionEnabled: z98.boolean().optional(),
|
|
4779
|
+
tracking: z98.object({
|
|
4780
|
+
enableAttribution: z98.boolean().optional(),
|
|
4781
|
+
enableSource: z98.boolean().optional(),
|
|
4782
|
+
enableWidget: z98.boolean().optional()
|
|
4744
4783
|
}).optional(),
|
|
4745
|
-
type:
|
|
4746
|
-
version:
|
|
4784
|
+
type: z98.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
4785
|
+
version: z98.literal(1)
|
|
4747
4786
|
});
|
|
4748
|
-
var LineItemEditor =
|
|
4787
|
+
var LineItemEditor = z98.discriminatedUnion("version", [
|
|
4749
4788
|
LineItemEditorV1,
|
|
4750
4789
|
CABRootSection.extend({
|
|
4751
|
-
type:
|
|
4790
|
+
type: z98.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
4752
4791
|
})
|
|
4753
4792
|
]);
|
|
4754
4793
|
|
|
4755
4794
|
// src/schema/widgets/progressBar.ts
|
|
4756
|
-
import { z as
|
|
4757
|
-
var ProgressBar =
|
|
4758
|
-
type:
|
|
4795
|
+
import { z as z99 } from "zod";
|
|
4796
|
+
var ProgressBar = z99.looseObject({
|
|
4797
|
+
type: z99.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
4759
4798
|
});
|
|
4760
4799
|
|
|
4761
4800
|
// src/schema/widgets/rebuyButton.ts
|
|
4762
|
-
import { z as
|
|
4763
|
-
var RebuyButtonV1 =
|
|
4764
|
-
type:
|
|
4765
|
-
version:
|
|
4801
|
+
import { z as z100 } from "zod";
|
|
4802
|
+
var RebuyButtonV1 = z100.looseObject({
|
|
4803
|
+
type: z100.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
4804
|
+
version: z100.literal(1)
|
|
4766
4805
|
});
|
|
4767
|
-
var RebuyButton =
|
|
4806
|
+
var RebuyButton = z100.discriminatedUnion("version", [
|
|
4768
4807
|
RebuyButtonV1,
|
|
4769
4808
|
CABRootSection.extend({
|
|
4770
|
-
type:
|
|
4809
|
+
type: z100.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
4771
4810
|
})
|
|
4772
4811
|
]);
|
|
4773
4812
|
|
|
4774
4813
|
// src/schema/widgets/rebuyMonetize.ts
|
|
4775
|
-
import { z as
|
|
4776
|
-
var RebuyMonetize =
|
|
4777
|
-
type:
|
|
4814
|
+
import { z as z101 } from "zod";
|
|
4815
|
+
var RebuyMonetize = z101.looseObject({
|
|
4816
|
+
type: z101.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
4778
4817
|
});
|
|
4779
|
-
var RebuyMonetizeV1 =
|
|
4780
|
-
name:
|
|
4781
|
-
previewMode:
|
|
4818
|
+
var RebuyMonetizeV1 = z101.object({
|
|
4819
|
+
name: z101.string().nullable().optional(),
|
|
4820
|
+
previewMode: z101.boolean().optional(),
|
|
4782
4821
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
4783
|
-
privacyPolicyUrl:
|
|
4822
|
+
privacyPolicyUrl: z101.string().nullable().optional(),
|
|
4784
4823
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
4785
|
-
subVertical:
|
|
4786
|
-
tracking:
|
|
4787
|
-
enableAttribution:
|
|
4788
|
-
enableSource:
|
|
4789
|
-
enableWidget:
|
|
4824
|
+
subVertical: z101.string().nullable().optional(),
|
|
4825
|
+
tracking: z101.object({
|
|
4826
|
+
enableAttribution: z101.boolean().optional(),
|
|
4827
|
+
enableSource: z101.boolean().optional(),
|
|
4828
|
+
enableWidget: z101.boolean().optional()
|
|
4790
4829
|
}).optional(),
|
|
4791
|
-
type:
|
|
4792
|
-
version:
|
|
4830
|
+
type: z101.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
4831
|
+
version: z101.literal(1),
|
|
4793
4832
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
4794
|
-
vertical:
|
|
4833
|
+
vertical: z101.string().nullable().optional()
|
|
4795
4834
|
});
|
|
4796
4835
|
|
|
4797
4836
|
// src/schema/widgetData.ts
|
|
@@ -4805,7 +4844,7 @@ var extensionWidgetTypes = [
|
|
|
4805
4844
|
WidgetType.ui_extension_line_item_editor,
|
|
4806
4845
|
WidgetType.ui_extension_progress_bar
|
|
4807
4846
|
];
|
|
4808
|
-
var WidgetData =
|
|
4847
|
+
var WidgetData = z102.discriminatedUnion("type", [
|
|
4809
4848
|
ABTestingPlaceholder,
|
|
4810
4849
|
CheckoutExtension,
|
|
4811
4850
|
ContentBlock,
|
|
@@ -5165,36 +5204,36 @@ var SWITCH_LABELS = {
|
|
|
5165
5204
|
};
|
|
5166
5205
|
|
|
5167
5206
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5168
|
-
import { z as
|
|
5207
|
+
import { z as z104 } from "zod";
|
|
5169
5208
|
|
|
5170
5209
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
5171
|
-
import { z as
|
|
5172
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
5173
|
-
id:
|
|
5174
|
-
name:
|
|
5175
|
-
});
|
|
5176
|
-
var PostPurchaseWidget =
|
|
5177
|
-
classification:
|
|
5178
|
-
createdAtTime:
|
|
5179
|
-
customEndpointName:
|
|
5180
|
-
id:
|
|
5181
|
-
lastViewed:
|
|
5182
|
-
linkedCustomEndpointId:
|
|
5183
|
-
linkedFlows:
|
|
5184
|
-
name:
|
|
5185
|
-
owner:
|
|
5210
|
+
import { z as z103 } from "zod";
|
|
5211
|
+
var PostPurchaseWidgetLinkedFlow = z103.object({
|
|
5212
|
+
id: z103.number(),
|
|
5213
|
+
name: z103.string()
|
|
5214
|
+
});
|
|
5215
|
+
var PostPurchaseWidget = z103.object({
|
|
5216
|
+
classification: z103.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
5217
|
+
createdAtTime: z103.iso.datetime({ offset: true }).optional(),
|
|
5218
|
+
customEndpointName: z103.string().nullish(),
|
|
5219
|
+
id: z103.number().default(0),
|
|
5220
|
+
lastViewed: z103.iso.datetime({ offset: true }).nullish(),
|
|
5221
|
+
linkedCustomEndpointId: z103.number().nullish(),
|
|
5222
|
+
linkedFlows: z103.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
5223
|
+
name: z103.string().default(""),
|
|
5224
|
+
owner: z103.number().nullish(),
|
|
5186
5225
|
settings: PostPurchaseSettings
|
|
5187
5226
|
});
|
|
5188
5227
|
|
|
5189
5228
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5190
|
-
var PostPurchaseOffer =
|
|
5191
|
-
|
|
5192
|
-
errors:
|
|
5193
|
-
message:
|
|
5194
|
-
successful:
|
|
5229
|
+
var PostPurchaseOffer = z104.discriminatedUnion("successful", [
|
|
5230
|
+
z104.strictObject({
|
|
5231
|
+
errors: z104.array(z104.object({ message: z104.string() })),
|
|
5232
|
+
message: z104.string(),
|
|
5233
|
+
successful: z104.literal(false)
|
|
5195
5234
|
}),
|
|
5196
|
-
|
|
5197
|
-
successful:
|
|
5235
|
+
z104.strictObject({
|
|
5236
|
+
successful: z104.literal(true),
|
|
5198
5237
|
widget: PostPurchaseWidget
|
|
5199
5238
|
})
|
|
5200
5239
|
]);
|
|
@@ -6618,6 +6657,8 @@ export {
|
|
|
6618
6657
|
CABVariantLabels,
|
|
6619
6658
|
CABVariantsSection,
|
|
6620
6659
|
CABVisibility,
|
|
6660
|
+
CLIENT_LEDGER_MAX_EVENTS,
|
|
6661
|
+
CLIENT_LEDGER_TYPES,
|
|
6621
6662
|
COMBINED_ENDPOINTS,
|
|
6622
6663
|
CabActiveExperiment,
|
|
6623
6664
|
CabShopConfig,
|
|
@@ -6628,6 +6669,8 @@ export {
|
|
|
6628
6669
|
ClassificationAttemptProgressSchema,
|
|
6629
6670
|
ClassificationProgressSchema,
|
|
6630
6671
|
ClassificationResultProgressSchema,
|
|
6672
|
+
ClientLedgerEventSchema,
|
|
6673
|
+
ClientLedgerRequestSchema,
|
|
6631
6674
|
ContentBlock,
|
|
6632
6675
|
ContentBlockV1,
|
|
6633
6676
|
ContentOperator,
|
|
@@ -6730,6 +6773,7 @@ export {
|
|
|
6730
6773
|
PostPurchaseOptions,
|
|
6731
6774
|
PostPurchaseOrderAttributes,
|
|
6732
6775
|
PostPurchaseOrderIdSchema,
|
|
6776
|
+
PostPurchaseOrderPendingSchema,
|
|
6733
6777
|
PostPurchaseOriginalVariants,
|
|
6734
6778
|
PostPurchasePlanAdjustment,
|
|
6735
6779
|
PostPurchasePlanCatalog,
|