@rebuy/rebuy 3.48.1 → 3.49.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 +29 -2
- package/dist/index.mjs +29 -2
- package/dist/schema/postPurchaseAcceptedEvent.d.ts +0 -5
- package/dist/schema/postPurchaseAdmission.d.ts +14 -0
- package/dist/schema/postPurchaseRecovery.d.ts +71 -0
- package/dist/server/index.cjs +6 -1
- package/dist/server/index.mjs +6 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -283,6 +283,7 @@ __export(src_exports, {
|
|
|
283
283
|
RebuyMonetizeV1: () => RebuyMonetizeV1,
|
|
284
284
|
RecordedOfferDeclineSchema: () => RecordedOfferDeclineSchema,
|
|
285
285
|
RecordedPurchaseObservationSchema: () => RecordedPurchaseObservationSchema,
|
|
286
|
+
RecoveredFollowupsSchema: () => RecoveredFollowupsSchema,
|
|
286
287
|
ReleaseAuthorityRequestSchema: () => ReleaseAuthorityRequestSchema,
|
|
287
288
|
ReleaseAuthorityResponseSchema: () => ReleaseAuthorityResponseSchema,
|
|
288
289
|
ReleaseClaimRequestSchema: () => ReleaseClaimRequestSchema,
|
|
@@ -2903,6 +2904,7 @@ var PostPurchaseProductChangeset = import_zod23.z.object({
|
|
|
2903
2904
|
// src/schema/postPurchaseAdmission.ts
|
|
2904
2905
|
var PurchaseAdmissionModeSchema = import_zod24.z.enum(["purchase", "upgrade"]);
|
|
2905
2906
|
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
2907
|
+
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
2906
2908
|
var PurchaseExpectedSchema = import_zod24.z.object({
|
|
2907
2909
|
buyerConsentToSubscriptions: import_zod24.z.boolean().optional(),
|
|
2908
2910
|
changeset: PostPurchaseProductChangeset.extend({
|
|
@@ -2912,6 +2914,11 @@ var PurchaseExpectedSchema = import_zod24.z.object({
|
|
|
2912
2914
|
member: PostPurchaseMemberIdentity.optional(),
|
|
2913
2915
|
mode: PurchaseAdmissionModeSchema.optional(),
|
|
2914
2916
|
progressRevision: import_zod24.z.number().int().nonnegative().optional(),
|
|
2917
|
+
/**
|
|
2918
|
+
* The total the buyer affirmed, stored with the admitted operation so a reloaded client can still
|
|
2919
|
+
* send its follow-ups with it. Optional: a client from before it was added admits without one.
|
|
2920
|
+
*/
|
|
2921
|
+
reportedCalculation: EventCalculationSchema.optional(),
|
|
2915
2922
|
selection
|
|
2916
2923
|
}).refine(
|
|
2917
2924
|
({ member, progressRevision }) => !member || progressRevision !== void 0,
|
|
@@ -2948,7 +2955,6 @@ var PurchaseReceiptSchema = import_zod24.z.object({
|
|
|
2948
2955
|
var PurchaseResponseSchema = import_zod24.z.object({ data: PurchaseReceiptSchema, successful: import_zod24.z.literal(true) });
|
|
2949
2956
|
|
|
2950
2957
|
// src/schema/postPurchaseAcceptedEvent.ts
|
|
2951
|
-
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
2952
2958
|
var AcceptedEventOutcomeSchema = import_zod25.z.enum(["acknowledged", "rejected", "skipped", "unknown"]);
|
|
2953
2959
|
var AttemptProgressSchema = import_zod25.z.strictObject({
|
|
2954
2960
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
@@ -4835,17 +4841,38 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4835
4841
|
|
|
4836
4842
|
// src/schema/postPurchaseRecovery.ts
|
|
4837
4843
|
var import_zod83 = require("zod");
|
|
4844
|
+
var RecoveredFollowupsSchema = import_zod83.z.strictObject({
|
|
4845
|
+
acceptedEvent: import_zod83.z.union([AcceptedEventAttemptProgressSchema, AcceptedEventResultProgressSchema]).nullable(),
|
|
4846
|
+
acceptedMetafield: import_zod83.z.union([AcceptedMetafieldOutcomeSchema, import_zod83.z.literal("attempted")]).nullable()
|
|
4847
|
+
});
|
|
4838
4848
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4839
4849
|
var PurchaseRecoveryResponseSchema = import_zod83.z.object({
|
|
4840
4850
|
data: import_zod83.z.object({
|
|
4851
|
+
/**
|
|
4852
|
+
* Strict, so a client pinned before a new optional field rejects a reply that carries it rather than
|
|
4853
|
+
* stripping it. Release the client before rebuy-api starts emitting a field added here.
|
|
4854
|
+
*/
|
|
4841
4855
|
operation: import_zod83.z.object({
|
|
4856
|
+
/** Absent from a rebuy-api that predates it. */
|
|
4857
|
+
followups: RecoveredFollowupsSchema.optional(),
|
|
4842
4858
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4843
4859
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
4860
|
+
/** The total the buyer affirmed at admission; absent for an operation admitted without one. */
|
|
4861
|
+
reportedCalculation: EventCalculationSchema.optional(),
|
|
4844
4862
|
upgrade: UpgradeProgressSchema.optional()
|
|
4845
4863
|
}).strict().refine(({ operationId, upgrade }) => !upgrade || upgrade.operationId === operationId, {
|
|
4846
4864
|
message: "Upgrade progress belongs to its operation",
|
|
4847
4865
|
path: ["upgrade", "operationId"]
|
|
4848
|
-
}).
|
|
4866
|
+
}).refine(
|
|
4867
|
+
({ followups, operationId }) => !followups?.acceptedEvent || followups.acceptedEvent.operationId === operationId,
|
|
4868
|
+
{ message: "Follow-up progress belongs to its operation", path: ["followups", "acceptedEvent"] }
|
|
4869
|
+
).refine(
|
|
4870
|
+
({ followups, reportedCalculation }) => !followups?.acceptedEvent || !reportedCalculation || followups.acceptedEvent.reportedCalculation.currencyCode === reportedCalculation.currencyCode && followups.acceptedEvent.reportedCalculation.totalMinor === reportedCalculation.totalMinor,
|
|
4871
|
+
{
|
|
4872
|
+
message: "Follow-up progress carries the admitted calculation",
|
|
4873
|
+
path: ["followups", "acceptedEvent", "reportedCalculation"]
|
|
4874
|
+
}
|
|
4875
|
+
).nullable(),
|
|
4849
4876
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4850
4877
|
}),
|
|
4851
4878
|
successful: import_zod83.z.literal(true)
|
package/dist/index.mjs
CHANGED
|
@@ -2432,6 +2432,7 @@ var PostPurchaseProductChangeset = z23.object({
|
|
|
2432
2432
|
// src/schema/postPurchaseAdmission.ts
|
|
2433
2433
|
var PurchaseAdmissionModeSchema = z24.enum(["purchase", "upgrade"]);
|
|
2434
2434
|
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
2435
|
+
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
2435
2436
|
var PurchaseExpectedSchema = z24.object({
|
|
2436
2437
|
buyerConsentToSubscriptions: z24.boolean().optional(),
|
|
2437
2438
|
changeset: PostPurchaseProductChangeset.extend({
|
|
@@ -2441,6 +2442,11 @@ var PurchaseExpectedSchema = z24.object({
|
|
|
2441
2442
|
member: PostPurchaseMemberIdentity.optional(),
|
|
2442
2443
|
mode: PurchaseAdmissionModeSchema.optional(),
|
|
2443
2444
|
progressRevision: z24.number().int().nonnegative().optional(),
|
|
2445
|
+
/**
|
|
2446
|
+
* The total the buyer affirmed, stored with the admitted operation so a reloaded client can still
|
|
2447
|
+
* send its follow-ups with it. Optional: a client from before it was added admits without one.
|
|
2448
|
+
*/
|
|
2449
|
+
reportedCalculation: EventCalculationSchema.optional(),
|
|
2444
2450
|
selection
|
|
2445
2451
|
}).refine(
|
|
2446
2452
|
({ member, progressRevision }) => !member || progressRevision !== void 0,
|
|
@@ -2477,7 +2483,6 @@ var PurchaseReceiptSchema = z24.object({
|
|
|
2477
2483
|
var PurchaseResponseSchema = z24.object({ data: PurchaseReceiptSchema, successful: z24.literal(true) });
|
|
2478
2484
|
|
|
2479
2485
|
// src/schema/postPurchaseAcceptedEvent.ts
|
|
2480
|
-
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
2481
2486
|
var AcceptedEventOutcomeSchema = z25.enum(["acknowledged", "rejected", "skipped", "unknown"]);
|
|
2482
2487
|
var AttemptProgressSchema = z25.strictObject({
|
|
2483
2488
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
@@ -4364,17 +4369,38 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4364
4369
|
|
|
4365
4370
|
// src/schema/postPurchaseRecovery.ts
|
|
4366
4371
|
import { z as z83 } from "zod";
|
|
4372
|
+
var RecoveredFollowupsSchema = z83.strictObject({
|
|
4373
|
+
acceptedEvent: z83.union([AcceptedEventAttemptProgressSchema, AcceptedEventResultProgressSchema]).nullable(),
|
|
4374
|
+
acceptedMetafield: z83.union([AcceptedMetafieldOutcomeSchema, z83.literal("attempted")]).nullable()
|
|
4375
|
+
});
|
|
4367
4376
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4368
4377
|
var PurchaseRecoveryResponseSchema = z83.object({
|
|
4369
4378
|
data: z83.object({
|
|
4379
|
+
/**
|
|
4380
|
+
* Strict, so a client pinned before a new optional field rejects a reply that carries it rather than
|
|
4381
|
+
* stripping it. Release the client before rebuy-api starts emitting a field added here.
|
|
4382
|
+
*/
|
|
4370
4383
|
operation: z83.object({
|
|
4384
|
+
/** Absent from a rebuy-api that predates it. */
|
|
4385
|
+
followups: RecoveredFollowupsSchema.optional(),
|
|
4371
4386
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4372
4387
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
4388
|
+
/** The total the buyer affirmed at admission; absent for an operation admitted without one. */
|
|
4389
|
+
reportedCalculation: EventCalculationSchema.optional(),
|
|
4373
4390
|
upgrade: UpgradeProgressSchema.optional()
|
|
4374
4391
|
}).strict().refine(({ operationId, upgrade }) => !upgrade || upgrade.operationId === operationId, {
|
|
4375
4392
|
message: "Upgrade progress belongs to its operation",
|
|
4376
4393
|
path: ["upgrade", "operationId"]
|
|
4377
|
-
}).
|
|
4394
|
+
}).refine(
|
|
4395
|
+
({ followups, operationId }) => !followups?.acceptedEvent || followups.acceptedEvent.operationId === operationId,
|
|
4396
|
+
{ message: "Follow-up progress belongs to its operation", path: ["followups", "acceptedEvent"] }
|
|
4397
|
+
).refine(
|
|
4398
|
+
({ followups, reportedCalculation }) => !followups?.acceptedEvent || !reportedCalculation || followups.acceptedEvent.reportedCalculation.currencyCode === reportedCalculation.currencyCode && followups.acceptedEvent.reportedCalculation.totalMinor === reportedCalculation.totalMinor,
|
|
4399
|
+
{
|
|
4400
|
+
message: "Follow-up progress carries the admitted calculation",
|
|
4401
|
+
path: ["followups", "acceptedEvent", "reportedCalculation"]
|
|
4402
|
+
}
|
|
4403
|
+
).nullable(),
|
|
4378
4404
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4379
4405
|
}),
|
|
4380
4406
|
successful: z83.literal(true)
|
|
@@ -6762,6 +6788,7 @@ export {
|
|
|
6762
6788
|
RebuyMonetizeV1,
|
|
6763
6789
|
RecordedOfferDeclineSchema,
|
|
6764
6790
|
RecordedPurchaseObservationSchema,
|
|
6791
|
+
RecoveredFollowupsSchema,
|
|
6765
6792
|
ReleaseAuthorityRequestSchema,
|
|
6766
6793
|
ReleaseAuthorityResponseSchema,
|
|
6767
6794
|
ReleaseClaimRequestSchema,
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const EventCalculationSchema: z.ZodObject<{
|
|
3
|
-
currencyCode: z.ZodString;
|
|
4
|
-
totalMinor: z.ZodNumber;
|
|
5
|
-
}, z.core.$strict>;
|
|
6
2
|
/**
|
|
7
3
|
* apiv2's Flow-trigger bridge outcome, shared by every Flow event (accepted, declined, lifecycle, classification).
|
|
8
4
|
* `skipped` is terminal and intended: apiv2 skips guest orders, whose null customer Flow would refuse.
|
|
@@ -72,5 +68,4 @@ export declare const AcceptedEventResponseSchema: z.ZodObject<{
|
|
|
72
68
|
}, z.core.$strict>]>;
|
|
73
69
|
successful: z.ZodLiteral<true>;
|
|
74
70
|
}, z.core.$strip>;
|
|
75
|
-
export type EventCalculation = z.infer<typeof EventCalculationSchema>;
|
|
76
71
|
export type AcceptedEventOutcome = z.infer<typeof AcceptedEventOutcomeSchema>;
|
|
@@ -7,6 +7,11 @@ export declare const PurchaseAdmissionModeSchema: z.ZodEnum<{
|
|
|
7
7
|
purchase: "purchase";
|
|
8
8
|
upgrade: "upgrade";
|
|
9
9
|
}>;
|
|
10
|
+
/** The buyer's SDK-calculated total for the affirmed terms (`calculateChangeset`), never proof of payment. */
|
|
11
|
+
export declare const EventCalculationSchema: z.ZodObject<{
|
|
12
|
+
currencyCode: z.ZodString;
|
|
13
|
+
totalMinor: z.ZodNumber;
|
|
14
|
+
}, z.core.$strict>;
|
|
10
15
|
export declare const PurchaseExpectedSchema: z.ZodObject<{
|
|
11
16
|
buyerConsentToSubscriptions: z.ZodOptional<z.ZodBoolean>;
|
|
12
17
|
changeset: z.ZodObject<{
|
|
@@ -65,6 +70,10 @@ export declare const PurchaseExpectedSchema: z.ZodObject<{
|
|
|
65
70
|
upgrade: "upgrade";
|
|
66
71
|
}>>;
|
|
67
72
|
progressRevision: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
reportedCalculation: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
currencyCode: z.ZodString;
|
|
75
|
+
totalMinor: z.ZodNumber;
|
|
76
|
+
}, z.core.$strict>>;
|
|
68
77
|
selection: z.ZodObject<{
|
|
69
78
|
productId: z.ZodNumber;
|
|
70
79
|
quantity: z.ZodNumber;
|
|
@@ -133,6 +142,10 @@ export declare const PurchaseRequestSchema: z.ZodObject<{
|
|
|
133
142
|
upgrade: "upgrade";
|
|
134
143
|
}>>;
|
|
135
144
|
progressRevision: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
reportedCalculation: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
currencyCode: z.ZodString;
|
|
147
|
+
totalMinor: z.ZodNumber;
|
|
148
|
+
}, z.core.$strict>>;
|
|
136
149
|
selection: z.ZodObject<{
|
|
137
150
|
productId: z.ZodNumber;
|
|
138
151
|
quantity: z.ZodNumber;
|
|
@@ -185,6 +198,7 @@ export declare const PurchaseResponseSchema: z.ZodObject<{
|
|
|
185
198
|
}, z.core.$strip>;
|
|
186
199
|
successful: z.ZodLiteral<true>;
|
|
187
200
|
}, z.core.$strip>;
|
|
201
|
+
export type EventCalculation = z.infer<typeof EventCalculationSchema>;
|
|
188
202
|
export type PurchaseReceipt = z.infer<typeof PurchaseReceiptSchema>;
|
|
189
203
|
export type PurchaseExpected = z.infer<typeof PurchaseExpectedSchema>;
|
|
190
204
|
export type PurchaseRequest = z.infer<typeof PurchaseRequestSchema>;
|
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* How far the latest operation's follow-ups got: its accepted Flow event (`null` until one is attempted) and
|
|
4
|
+
* the status of the saved accepted-metafield write that covers it (`null` until one does). Progress only: a
|
|
5
|
+
* reloaded client re-runs `/purchases/accepted`, which is idempotent per operation, whatever this says.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RecoveredFollowupsSchema: z.ZodObject<{
|
|
8
|
+
acceptedEvent: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
9
|
+
attemptedAt: z.ZodNumber;
|
|
10
|
+
reportedCalculation: z.ZodObject<{
|
|
11
|
+
currencyCode: z.ZodString;
|
|
12
|
+
totalMinor: z.ZodNumber;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
status: z.ZodLiteral<"attempted">;
|
|
15
|
+
operationId: z.ZodUUID;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
attemptedAt: z.ZodNumber;
|
|
18
|
+
reportedCalculation: z.ZodObject<{
|
|
19
|
+
currencyCode: z.ZodString;
|
|
20
|
+
totalMinor: z.ZodNumber;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
finishedAt: z.ZodNumber;
|
|
23
|
+
status: z.ZodEnum<{
|
|
24
|
+
unknown: "unknown";
|
|
25
|
+
acknowledged: "acknowledged";
|
|
26
|
+
rejected: "rejected";
|
|
27
|
+
skipped: "skipped";
|
|
28
|
+
}>;
|
|
29
|
+
operationId: z.ZodUUID;
|
|
30
|
+
}, z.core.$strict>]>>;
|
|
31
|
+
acceptedMetafield: z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
32
|
+
unknown: "unknown";
|
|
33
|
+
acknowledged: "acknowledged";
|
|
34
|
+
rejected: "rejected";
|
|
35
|
+
}>, z.ZodLiteral<"attempted">]>>;
|
|
36
|
+
}, z.core.$strict>;
|
|
2
37
|
/** A saved observation or its absence, never permission to apply a changeset. */
|
|
3
38
|
export declare const PurchaseRecoveryRequestSchema: z.ZodObject<{
|
|
4
39
|
checkoutToken: z.ZodString;
|
|
@@ -7,6 +42,36 @@ export declare const PurchaseRecoveryRequestSchema: z.ZodObject<{
|
|
|
7
42
|
export declare const PurchaseRecoveryResponseSchema: z.ZodObject<{
|
|
8
43
|
data: z.ZodObject<{
|
|
9
44
|
operation: z.ZodNullable<z.ZodObject<{
|
|
45
|
+
followups: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
acceptedEvent: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
47
|
+
attemptedAt: z.ZodNumber;
|
|
48
|
+
reportedCalculation: z.ZodObject<{
|
|
49
|
+
currencyCode: z.ZodString;
|
|
50
|
+
totalMinor: z.ZodNumber;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
status: z.ZodLiteral<"attempted">;
|
|
53
|
+
operationId: z.ZodUUID;
|
|
54
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
55
|
+
attemptedAt: z.ZodNumber;
|
|
56
|
+
reportedCalculation: z.ZodObject<{
|
|
57
|
+
currencyCode: z.ZodString;
|
|
58
|
+
totalMinor: z.ZodNumber;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
finishedAt: z.ZodNumber;
|
|
61
|
+
status: z.ZodEnum<{
|
|
62
|
+
unknown: "unknown";
|
|
63
|
+
acknowledged: "acknowledged";
|
|
64
|
+
rejected: "rejected";
|
|
65
|
+
skipped: "skipped";
|
|
66
|
+
}>;
|
|
67
|
+
operationId: z.ZodUUID;
|
|
68
|
+
}, z.core.$strict>]>>;
|
|
69
|
+
acceptedMetafield: z.ZodNullable<z.ZodUnion<readonly [z.ZodEnum<{
|
|
70
|
+
unknown: "unknown";
|
|
71
|
+
acknowledged: "acknowledged";
|
|
72
|
+
rejected: "rejected";
|
|
73
|
+
}>, z.ZodLiteral<"attempted">]>>;
|
|
74
|
+
}, z.core.$strict>>;
|
|
10
75
|
observation: z.ZodNullable<z.ZodObject<{
|
|
11
76
|
observation: z.ZodUnion<readonly [z.ZodObject<{
|
|
12
77
|
changesetApplicationsRemaining: z.ZodNumber;
|
|
@@ -39,6 +104,10 @@ export declare const PurchaseRecoveryResponseSchema: z.ZodObject<{
|
|
|
39
104
|
recordedAt: z.ZodNumber;
|
|
40
105
|
}, z.core.$strict>>;
|
|
41
106
|
operationId: z.ZodUUID;
|
|
107
|
+
reportedCalculation: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
currencyCode: z.ZodString;
|
|
109
|
+
totalMinor: z.ZodNumber;
|
|
110
|
+
}, z.core.$strict>>;
|
|
42
111
|
upgrade: z.ZodOptional<z.ZodObject<{
|
|
43
112
|
compensation: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
44
113
|
attemptedAt: z.ZodNumber;
|
|
@@ -130,3 +199,5 @@ export declare const PurchaseRecoveryResponseSchema: z.ZodObject<{
|
|
|
130
199
|
}, z.core.$strip>;
|
|
131
200
|
successful: z.ZodLiteral<true>;
|
|
132
201
|
}, z.core.$strip>;
|
|
202
|
+
export type RecoveredFollowups = z.infer<typeof RecoveredFollowupsSchema>;
|
|
203
|
+
export type PurchaseRecoveryResponse = z.infer<typeof PurchaseRecoveryResponseSchema>;
|
package/dist/server/index.cjs
CHANGED
|
@@ -7225,6 +7225,7 @@ var PostPurchaseMemberIdentity = import_zod75.z.object({
|
|
|
7225
7225
|
// src/schema/postPurchaseAdmission.ts
|
|
7226
7226
|
var PurchaseAdmissionModeSchema = import_zod76.z.enum(["purchase", "upgrade"]);
|
|
7227
7227
|
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
7228
|
+
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
7228
7229
|
var PurchaseExpectedSchema = import_zod76.z.object({
|
|
7229
7230
|
buyerConsentToSubscriptions: import_zod76.z.boolean().optional(),
|
|
7230
7231
|
changeset: PostPurchaseProductChangeset.extend({
|
|
@@ -7234,6 +7235,11 @@ var PurchaseExpectedSchema = import_zod76.z.object({
|
|
|
7234
7235
|
member: PostPurchaseMemberIdentity.optional(),
|
|
7235
7236
|
mode: PurchaseAdmissionModeSchema.optional(),
|
|
7236
7237
|
progressRevision: import_zod76.z.number().int().nonnegative().optional(),
|
|
7238
|
+
/**
|
|
7239
|
+
* The total the buyer affirmed, stored with the admitted operation so a reloaded client can still
|
|
7240
|
+
* send its follow-ups with it. Optional: a client from before it was added admits without one.
|
|
7241
|
+
*/
|
|
7242
|
+
reportedCalculation: EventCalculationSchema.optional(),
|
|
7237
7243
|
selection
|
|
7238
7244
|
}).refine(
|
|
7239
7245
|
({ member, progressRevision }) => !member || progressRevision !== void 0,
|
|
@@ -7270,7 +7276,6 @@ var PurchaseReceiptSchema = import_zod76.z.object({
|
|
|
7270
7276
|
var PurchaseResponseSchema = import_zod76.z.object({ data: PurchaseReceiptSchema, successful: import_zod76.z.literal(true) });
|
|
7271
7277
|
|
|
7272
7278
|
// src/schema/postPurchaseAcceptedEvent.ts
|
|
7273
|
-
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
7274
7279
|
var AcceptedEventOutcomeSchema = import_zod77.z.enum(["acknowledged", "rejected", "skipped", "unknown"]);
|
|
7275
7280
|
var AttemptProgressSchema = import_zod77.z.strictObject({
|
|
7276
7281
|
attemptedAt: PostPurchaseTimestampSchema,
|
package/dist/server/index.mjs
CHANGED
|
@@ -7153,6 +7153,7 @@ var PostPurchaseMemberIdentity = z75.object({
|
|
|
7153
7153
|
// src/schema/postPurchaseAdmission.ts
|
|
7154
7154
|
var PurchaseAdmissionModeSchema = z76.enum(["purchase", "upgrade"]);
|
|
7155
7155
|
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
7156
|
+
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
7156
7157
|
var PurchaseExpectedSchema = z76.object({
|
|
7157
7158
|
buyerConsentToSubscriptions: z76.boolean().optional(),
|
|
7158
7159
|
changeset: PostPurchaseProductChangeset.extend({
|
|
@@ -7162,6 +7163,11 @@ var PurchaseExpectedSchema = z76.object({
|
|
|
7162
7163
|
member: PostPurchaseMemberIdentity.optional(),
|
|
7163
7164
|
mode: PurchaseAdmissionModeSchema.optional(),
|
|
7164
7165
|
progressRevision: z76.number().int().nonnegative().optional(),
|
|
7166
|
+
/**
|
|
7167
|
+
* The total the buyer affirmed, stored with the admitted operation so a reloaded client can still
|
|
7168
|
+
* send its follow-ups with it. Optional: a client from before it was added admits without one.
|
|
7169
|
+
*/
|
|
7170
|
+
reportedCalculation: EventCalculationSchema.optional(),
|
|
7165
7171
|
selection
|
|
7166
7172
|
}).refine(
|
|
7167
7173
|
({ member, progressRevision }) => !member || progressRevision !== void 0,
|
|
@@ -7198,7 +7204,6 @@ var PurchaseReceiptSchema = z76.object({
|
|
|
7198
7204
|
var PurchaseResponseSchema = z76.object({ data: PurchaseReceiptSchema, successful: z76.literal(true) });
|
|
7199
7205
|
|
|
7200
7206
|
// src/schema/postPurchaseAcceptedEvent.ts
|
|
7201
|
-
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
7202
7207
|
var AcceptedEventOutcomeSchema = z77.enum(["acknowledged", "rejected", "skipped", "unknown"]);
|
|
7203
7208
|
var AttemptProgressSchema = z77.strictObject({
|
|
7204
7209
|
attemptedAt: PostPurchaseTimestampSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebuy/rebuy",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.49.0",
|
|
4
4
|
"description": "Shared zod schemas, legacy-to-CAB widget transforms, and server orchestrators for Rebuy's Shopify consumers (rebuy-api, admin-nextjs, rebuy-shopify-extensions)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Rebuy, Inc.",
|