@rebuy/rebuy 3.66.1 → 3.68.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 +816 -784
- package/dist/index.mjs +816 -784
- package/dist/schema/cabShopConfig.d.ts +5 -5
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/postPurchaseDecisionTrace.d.ts +90 -0
- package/dist/schema/postPurchaseFinish.d.ts +3 -0
- package/dist/schema/postPurchaseFollowups.d.ts +6 -0
- package/dist/schema/postPurchaseHealth.d.ts +19 -1
- package/dist/schema/postPurchaseHealthProgress.d.ts +28 -0
- package/dist/schema/postPurchaseShadow.d.ts +33 -7
- package/dist/schema/smartCart.d.ts +18 -18
- package/dist/schema/userConfig.d.ts +5 -5
- package/dist/server/index.cjs +7 -1
- package/dist/server/index.mjs +7 -1
- package/package.json +7 -1
|
@@ -115,7 +115,7 @@ export declare const CabUserConfig: z.ZodObject<{
|
|
|
115
115
|
freeShippingReached: z.ZodOptional<z.ZodString>;
|
|
116
116
|
freeShippingRemaining: z.ZodOptional<z.ZodString>;
|
|
117
117
|
giftAreaTitle: z.ZodOptional<z.ZodString>;
|
|
118
|
-
}, z.core.$loose
|
|
118
|
+
}, z.core.$loose>>, unknown>;
|
|
119
119
|
name: z.ZodOptional<z.ZodString>;
|
|
120
120
|
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
121
121
|
allProducts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -149,10 +149,10 @@ export declare const CabUserConfig: z.ZodObject<{
|
|
|
149
149
|
exclusionsEnabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
150
150
|
filterOosVariants: z.ZodOptional<z.ZodBoolean>;
|
|
151
151
|
id: z.ZodOptional<z.ZodString>;
|
|
152
|
-
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown
|
|
152
|
+
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>, unknown>;
|
|
153
153
|
presentmentCurrencies: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
154
154
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
-
}, z.core.$loose
|
|
155
|
+
}, z.core.$loose>>, unknown>;
|
|
156
156
|
productAmountReachedLabel: z.ZodOptional<z.ZodBoolean>;
|
|
157
157
|
productAmountReachedLabelText: z.ZodOptional<z.ZodString>;
|
|
158
158
|
productAmountRemainingLabel: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -170,9 +170,9 @@ export declare const CabUserConfig: z.ZodObject<{
|
|
|
170
170
|
unlockConditionType: z.ZodOptional<z.ZodString>;
|
|
171
171
|
}, z.core.$loose>>>;
|
|
172
172
|
}, z.core.$loose>>>;
|
|
173
|
-
}, z.core.$loose
|
|
173
|
+
}, z.core.$loose>>, unknown>>;
|
|
174
174
|
type: z.ZodOptional<z.ZodString>;
|
|
175
175
|
}, z.core.$loose>>>;
|
|
176
|
-
}, z.core.$loose
|
|
176
|
+
}, z.core.$loose>>>, unknown>>;
|
|
177
177
|
}, z.core.$strip>;
|
|
178
178
|
export type CabUserConfig = z.infer<typeof CabUserConfig>;
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './postPurchaseAdmission';
|
|
|
7
7
|
export * from './postPurchaseAnalytics';
|
|
8
8
|
export * from './postPurchaseChoice';
|
|
9
9
|
export * from './postPurchaseClassification';
|
|
10
|
+
export * from './postPurchaseDecisionTrace';
|
|
10
11
|
export * from './postPurchaseDecline';
|
|
11
12
|
export * from './postPurchaseDeclineDelivery';
|
|
12
13
|
export * from './postPurchaseDiscount';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Where a live Decision spent its time, in whole ms. `decisionMs` is the Decider's own time, from the request's
|
|
4
|
+
* verified input to the Decision the response carries. The prelude reads exist only once eligibility allowed a
|
|
5
|
+
* Decision, and each read's ms only once that read settled: a `prelude-timeout` row carries `preludeMs` with
|
|
6
|
+
* neither read, or only the one that finished in budget. Per-Flow evaluation ms ride on each Flow's outcome.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PostPurchaseDecisionTimingSchema: z.ZodObject<{
|
|
9
|
+
activeFlowsMs: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
decisionMs: z.ZodNumber;
|
|
11
|
+
preludeMs: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
targetingMs: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type PostPurchaseDecisionTiming = z.infer<typeof PostPurchaseDecisionTimingSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* The `decision.trace` ledger row's payload (REB-25426): rebuy-api's live `/decide` Decision with its completed
|
|
17
|
+
* per-Flow evidence, written server-side after the response. Ids, outcomes and ms only: never customer data,
|
|
18
|
+
* tokens or product payloads. Logging only; nothing reads it back into a Decision.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PostPurchaseDecisionTraceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
entry: z.ZodObject<{
|
|
22
|
+
blockId: z.ZodNumber;
|
|
23
|
+
blockIndex: z.ZodString;
|
|
24
|
+
blockParentIndex: z.ZodString;
|
|
25
|
+
flowId: z.ZodNumber;
|
|
26
|
+
sectionId: z.ZodNumber;
|
|
27
|
+
widgetId: z.ZodNumber;
|
|
28
|
+
widgetTraffic: z.ZodNumber;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
verdict: z.ZodLiteral<"render">;
|
|
31
|
+
flowCount: z.ZodNumber;
|
|
32
|
+
sampleRate: z.ZodNumber;
|
|
33
|
+
serverFlowOutcomes: z.ZodArray<z.ZodObject<{
|
|
34
|
+
flowId: z.ZodNumber;
|
|
35
|
+
incomplete: z.ZodOptional<z.ZodLiteral<true>>;
|
|
36
|
+
ms: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
outcome: z.ZodEnum<{
|
|
38
|
+
empty: "empty";
|
|
39
|
+
unsupported: "unsupported";
|
|
40
|
+
eligible: "eligible";
|
|
41
|
+
failed: "failed";
|
|
42
|
+
}>;
|
|
43
|
+
unpreparableCause: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
offer: "offer";
|
|
45
|
+
contract: "contract";
|
|
46
|
+
members: "members";
|
|
47
|
+
}>>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
timing: z.ZodObject<{
|
|
50
|
+
activeFlowsMs: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
decisionMs: z.ZodNumber;
|
|
52
|
+
preludeMs: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
targetingMs: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
+
serverSkipReason: z.ZodEnum<{
|
|
57
|
+
"destination-missing": "destination-missing";
|
|
58
|
+
"merchant-destination": "merchant-destination";
|
|
59
|
+
"merchant-time": "merchant-time";
|
|
60
|
+
"no-active-flows": "no-active-flows";
|
|
61
|
+
"no-eligible-flow": "no-eligible-flow";
|
|
62
|
+
"prelude-timeout": "prelude-timeout";
|
|
63
|
+
}>;
|
|
64
|
+
verdict: z.ZodLiteral<"skip">;
|
|
65
|
+
flowCount: z.ZodNumber;
|
|
66
|
+
sampleRate: z.ZodNumber;
|
|
67
|
+
serverFlowOutcomes: z.ZodArray<z.ZodObject<{
|
|
68
|
+
flowId: z.ZodNumber;
|
|
69
|
+
incomplete: z.ZodOptional<z.ZodLiteral<true>>;
|
|
70
|
+
ms: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
outcome: z.ZodEnum<{
|
|
72
|
+
empty: "empty";
|
|
73
|
+
unsupported: "unsupported";
|
|
74
|
+
eligible: "eligible";
|
|
75
|
+
failed: "failed";
|
|
76
|
+
}>;
|
|
77
|
+
unpreparableCause: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
offer: "offer";
|
|
79
|
+
contract: "contract";
|
|
80
|
+
members: "members";
|
|
81
|
+
}>>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
timing: z.ZodObject<{
|
|
84
|
+
activeFlowsMs: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
decisionMs: z.ZodNumber;
|
|
86
|
+
preludeMs: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
targetingMs: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
}, z.core.$strip>], "verdict">;
|
|
90
|
+
export type PostPurchaseDecisionTrace = z.infer<typeof PostPurchaseDecisionTraceSchema>;
|
|
@@ -95,6 +95,9 @@ export declare const SessionFinishResponseSchema: z.ZodObject<{
|
|
|
95
95
|
attempted: "attempted";
|
|
96
96
|
pending: "pending";
|
|
97
97
|
returned: "returned";
|
|
98
|
+
removed: "removed";
|
|
99
|
+
unresolved: "unresolved";
|
|
100
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
98
101
|
}>;
|
|
99
102
|
facts: z.ZodObject<{
|
|
100
103
|
checkoutToken: z.ZodString;
|
|
@@ -5,6 +5,9 @@ export declare const RequiredHealthSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
5
5
|
attempted: "attempted";
|
|
6
6
|
pending: "pending";
|
|
7
7
|
returned: "returned";
|
|
8
|
+
removed: "removed";
|
|
9
|
+
unresolved: "unresolved";
|
|
10
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
8
11
|
}>;
|
|
9
12
|
facts: z.ZodObject<{
|
|
10
13
|
checkoutToken: z.ZodString;
|
|
@@ -71,6 +74,9 @@ export declare const AcceptedFollowupsResponseSchema: z.ZodObject<{
|
|
|
71
74
|
attempted: "attempted";
|
|
72
75
|
pending: "pending";
|
|
73
76
|
returned: "returned";
|
|
77
|
+
removed: "removed";
|
|
78
|
+
unresolved: "unresolved";
|
|
79
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
74
80
|
}>;
|
|
75
81
|
facts: z.ZodObject<{
|
|
76
82
|
checkoutToken: z.ZodString;
|
|
@@ -24,7 +24,10 @@ export declare const HealthAttemptSchema: z.ZodObject<{
|
|
|
24
24
|
attemptId: z.ZodUUID;
|
|
25
25
|
status: z.ZodLiteral<"attempted">;
|
|
26
26
|
}, z.core.$strict>;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A reported check (see `HealthResultStatusSchema`). `unknown` (like a stranded `attempted`) is never retried; it is
|
|
29
|
+
* manual follow-up.
|
|
30
|
+
*/
|
|
28
31
|
export declare const HealthResultSchema: z.ZodObject<{
|
|
29
32
|
removePartialOrder: z.ZodBoolean;
|
|
30
33
|
operationId: z.ZodUUID;
|
|
@@ -40,6 +43,9 @@ export declare const HealthResultSchema: z.ZodObject<{
|
|
|
40
43
|
status: z.ZodEnum<{
|
|
41
44
|
unknown: "unknown";
|
|
42
45
|
returned: "returned";
|
|
46
|
+
removed: "removed";
|
|
47
|
+
unresolved: "unresolved";
|
|
48
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
43
49
|
}>;
|
|
44
50
|
}, z.core.$strict>;
|
|
45
51
|
/** `post_purchase_session.health`: NULL (no health required yet) or one of these states. */
|
|
@@ -80,6 +86,9 @@ export declare const HealthStateSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
80
86
|
status: z.ZodEnum<{
|
|
81
87
|
unknown: "unknown";
|
|
82
88
|
returned: "returned";
|
|
89
|
+
removed: "removed";
|
|
90
|
+
unresolved: "unresolved";
|
|
91
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
83
92
|
}>;
|
|
84
93
|
}, z.core.$strict>]>;
|
|
85
94
|
/**
|
|
@@ -130,6 +139,9 @@ export declare const HealthClaimResponseSchema: z.ZodObject<{
|
|
|
130
139
|
attempted: "attempted";
|
|
131
140
|
pending: "pending";
|
|
132
141
|
returned: "returned";
|
|
142
|
+
removed: "removed";
|
|
143
|
+
unresolved: "unresolved";
|
|
144
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
133
145
|
}>;
|
|
134
146
|
}, z.core.$strict>, z.ZodObject<{
|
|
135
147
|
orderId: z.ZodString;
|
|
@@ -150,6 +162,9 @@ export declare const HealthResultRequestSchema: z.ZodObject<{
|
|
|
150
162
|
outcome: z.ZodEnum<{
|
|
151
163
|
unknown: "unknown";
|
|
152
164
|
returned: "returned";
|
|
165
|
+
removed: "removed";
|
|
166
|
+
unresolved: "unresolved";
|
|
167
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
153
168
|
}>;
|
|
154
169
|
}, z.core.$strict>;
|
|
155
170
|
export declare const HealthResultResponseSchema: z.ZodObject<{
|
|
@@ -162,6 +177,9 @@ export declare const HealthResultResponseSchema: z.ZodObject<{
|
|
|
162
177
|
status: z.ZodEnum<{
|
|
163
178
|
unknown: "unknown";
|
|
164
179
|
returned: "returned";
|
|
180
|
+
removed: "removed";
|
|
181
|
+
unresolved: "unresolved";
|
|
182
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
165
183
|
}>;
|
|
166
184
|
}, z.core.$strict>;
|
|
167
185
|
successful: z.ZodLiteral<true>;
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A claimed check's reported outcome (apiv2's `Classification::healthStatus`, REB-25640). A resolver that returned
|
|
4
|
+
* is reported by what it did: `removed` (Shopify accepted the edit removing the unpaid Rebuy lines), `unresolved`
|
|
5
|
+
* (a Rebuy line or charge may be unpaid and was left on the order; the resolver alerted), `nonRebuyResidual` (the
|
|
6
|
+
* outstanding balance is not from a Rebuy edit), or `returned` (nothing to do, or cleanup off). One that threw is
|
|
7
|
+
* `unknown`. Every value is final: `unknown` (like a stranded `attempted`) is manual follow-up, never retried.
|
|
8
|
+
*/
|
|
9
|
+
export declare const HealthResultStatusSchema: z.ZodEnum<{
|
|
10
|
+
unknown: "unknown";
|
|
11
|
+
returned: "returned";
|
|
12
|
+
removed: "removed";
|
|
13
|
+
unresolved: "unresolved";
|
|
14
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
15
|
+
}>;
|
|
16
|
+
/** Every stored `HealthState` status (no `claimed`/`missing`): what a repeated claim or the progress read answers. */
|
|
17
|
+
export declare const HealthStandingStatusSchema: z.ZodEnum<{
|
|
18
|
+
unknown: "unknown";
|
|
19
|
+
attempted: "attempted";
|
|
20
|
+
pending: "pending";
|
|
21
|
+
returned: "returned";
|
|
22
|
+
removed: "removed";
|
|
23
|
+
unresolved: "unresolved";
|
|
24
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
25
|
+
}>;
|
|
2
26
|
/**
|
|
3
27
|
* The body of apiv2's `session-health-schedule` (`SessionHealthSchedule.json`). apiv2 takes a lowercase
|
|
4
28
|
* `operationId` only, so an uppercase UUID is refused here rather than as apiv2's 400.
|
|
@@ -19,6 +43,9 @@ export declare const HealthSchedulingResponseSchema: z.ZodObject<{
|
|
|
19
43
|
attempted: "attempted";
|
|
20
44
|
pending: "pending";
|
|
21
45
|
returned: "returned";
|
|
46
|
+
removed: "removed";
|
|
47
|
+
unresolved: "unresolved";
|
|
48
|
+
nonRebuyResidual: "nonRebuyResidual";
|
|
22
49
|
}>;
|
|
23
50
|
facts: z.ZodObject<{
|
|
24
51
|
checkoutToken: z.ZodString;
|
|
@@ -41,5 +68,6 @@ export declare const HealthSchedulingResponseSchema: z.ZodObject<{
|
|
|
41
68
|
}, z.core.$strip>;
|
|
42
69
|
successful: z.ZodLiteral<true>;
|
|
43
70
|
}, z.core.$strip>;
|
|
71
|
+
export type HealthResultStatus = z.infer<typeof HealthResultStatusSchema>;
|
|
44
72
|
export type HealthSchedule = z.infer<typeof HealthScheduleSchema>;
|
|
45
73
|
export type HealthSchedulingResponse = z.infer<typeof HealthSchedulingResponseSchema>;
|
|
@@ -34,17 +34,29 @@ export type PostPurchaseShadowSkipReason = z.infer<typeof PostPurchaseShadowSkip
|
|
|
34
34
|
* Each evaluated Flow's outcome from the Decider's completed trace, in evaluation order. Capped at
|
|
35
35
|
* `POST_PURCHASE_SKIP_LIMIT` like the skip trace, since a shop can have more Flows than a ledger row should carry.
|
|
36
36
|
* The cap rejects rather than clips, so a sender slices to the limit before parsing. A shadow sample holds at most
|
|
37
|
-
* rebuy-api's `SHADOW_MAX_FLOWS` (10) Flows, so the list is complete there;
|
|
38
|
-
*
|
|
37
|
+
* rebuy-api's `SHADOW_MAX_FLOWS` (10) Flows, so the list is complete there; the live `decision.trace` row
|
|
38
|
+
* (REB-25426) shares this shape and carries `flowCount`, its truncation marker, beside it.
|
|
39
|
+
*
|
|
40
|
+
* The REB-25426 fields are optional so a row from a sender without them stays valid: `ms` is the Flow's entry
|
|
41
|
+
* evaluation time, `incomplete` an `empty` the ranking worker answered 503 for (not a verified empty), and
|
|
42
|
+
* `unpreparableCause` an `empty` whose products Render's preparation could not show (`contract`, `members` or
|
|
43
|
+
* `offer`; rebuy-api's `DecisionTraceSchema` names each).
|
|
39
44
|
*/
|
|
40
45
|
export declare const PostPurchaseShadowFlowOutcomesSchema: z.ZodArray<z.ZodObject<{
|
|
41
46
|
flowId: z.ZodNumber;
|
|
47
|
+
incomplete: z.ZodOptional<z.ZodLiteral<true>>;
|
|
48
|
+
ms: z.ZodOptional<z.ZodNumber>;
|
|
42
49
|
outcome: z.ZodEnum<{
|
|
43
50
|
empty: "empty";
|
|
44
51
|
unsupported: "unsupported";
|
|
45
|
-
failed: "failed";
|
|
46
52
|
eligible: "eligible";
|
|
53
|
+
failed: "failed";
|
|
47
54
|
}>;
|
|
55
|
+
unpreparableCause: z.ZodOptional<z.ZodEnum<{
|
|
56
|
+
offer: "offer";
|
|
57
|
+
contract: "contract";
|
|
58
|
+
members: "members";
|
|
59
|
+
}>>;
|
|
48
60
|
}, z.core.$strip>>;
|
|
49
61
|
export type PostPurchaseShadowFlowOutcomes = z.infer<typeof PostPurchaseShadowFlowOutcomesSchema>;
|
|
50
62
|
/**
|
|
@@ -82,12 +94,19 @@ export declare const PostPurchaseShadowReportFields: z.ZodObject<{
|
|
|
82
94
|
sampleId: z.ZodString;
|
|
83
95
|
serverFlowOutcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
84
96
|
flowId: z.ZodNumber;
|
|
97
|
+
incomplete: z.ZodOptional<z.ZodLiteral<true>>;
|
|
98
|
+
ms: z.ZodOptional<z.ZodNumber>;
|
|
85
99
|
outcome: z.ZodEnum<{
|
|
86
100
|
empty: "empty";
|
|
87
101
|
unsupported: "unsupported";
|
|
88
|
-
failed: "failed";
|
|
89
102
|
eligible: "eligible";
|
|
103
|
+
failed: "failed";
|
|
90
104
|
}>;
|
|
105
|
+
unpreparableCause: z.ZodOptional<z.ZodEnum<{
|
|
106
|
+
offer: "offer";
|
|
107
|
+
contract: "contract";
|
|
108
|
+
members: "members";
|
|
109
|
+
}>>;
|
|
91
110
|
}, z.core.$strip>>>;
|
|
92
111
|
serverSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
93
112
|
entry: z.ZodObject<{
|
|
@@ -113,8 +132,8 @@ export declare const PostPurchaseShadowReportFields: z.ZodObject<{
|
|
|
113
132
|
}>>;
|
|
114
133
|
status: z.ZodEnum<{
|
|
115
134
|
match: "match";
|
|
116
|
-
diverged: "diverged";
|
|
117
135
|
incomplete: "incomplete";
|
|
136
|
+
diverged: "diverged";
|
|
118
137
|
}>;
|
|
119
138
|
targetingFlowIds: z.ZodArray<z.ZodNumber>;
|
|
120
139
|
workflowPhase: z.ZodLiteral<"decide">;
|
|
@@ -150,12 +169,19 @@ export declare const PostPurchaseShadowReportSchema: z.ZodObject<{
|
|
|
150
169
|
sampleId: z.ZodString;
|
|
151
170
|
serverFlowOutcomes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
152
171
|
flowId: z.ZodNumber;
|
|
172
|
+
incomplete: z.ZodOptional<z.ZodLiteral<true>>;
|
|
173
|
+
ms: z.ZodOptional<z.ZodNumber>;
|
|
153
174
|
outcome: z.ZodEnum<{
|
|
154
175
|
empty: "empty";
|
|
155
176
|
unsupported: "unsupported";
|
|
156
|
-
failed: "failed";
|
|
157
177
|
eligible: "eligible";
|
|
178
|
+
failed: "failed";
|
|
158
179
|
}>;
|
|
180
|
+
unpreparableCause: z.ZodOptional<z.ZodEnum<{
|
|
181
|
+
offer: "offer";
|
|
182
|
+
contract: "contract";
|
|
183
|
+
members: "members";
|
|
184
|
+
}>>;
|
|
159
185
|
}, z.core.$strip>>>;
|
|
160
186
|
serverSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
161
187
|
entry: z.ZodObject<{
|
|
@@ -181,8 +207,8 @@ export declare const PostPurchaseShadowReportSchema: z.ZodObject<{
|
|
|
181
207
|
}>>;
|
|
182
208
|
status: z.ZodEnum<{
|
|
183
209
|
match: "match";
|
|
184
|
-
diverged: "diverged";
|
|
185
210
|
incomplete: "incomplete";
|
|
211
|
+
diverged: "diverged";
|
|
186
212
|
}>;
|
|
187
213
|
targetingFlowIds: z.ZodArray<z.ZodNumber>;
|
|
188
214
|
workflowPhase: z.ZodLiteral<"decide">;
|
|
@@ -74,10 +74,10 @@ export declare const SmartCartTier: z.ZodObject<{
|
|
|
74
74
|
exclusionsEnabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
75
75
|
filterOosVariants: z.ZodOptional<z.ZodBoolean>;
|
|
76
76
|
id: z.ZodOptional<z.ZodString>;
|
|
77
|
-
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown
|
|
77
|
+
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>, unknown>;
|
|
78
78
|
presentmentCurrencies: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
79
79
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
-
}, z.core.$loose
|
|
80
|
+
}, z.core.$loose>>, unknown>;
|
|
81
81
|
productAmountReachedLabel: z.ZodOptional<z.ZodBoolean>;
|
|
82
82
|
productAmountReachedLabelText: z.ZodOptional<z.ZodString>;
|
|
83
83
|
productAmountRemainingLabel: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -112,7 +112,7 @@ export declare const SmartCartBar: z.ZodObject<{
|
|
|
112
112
|
freeShippingReached: z.ZodOptional<z.ZodString>;
|
|
113
113
|
freeShippingRemaining: z.ZodOptional<z.ZodString>;
|
|
114
114
|
giftAreaTitle: z.ZodOptional<z.ZodString>;
|
|
115
|
-
}, z.core.$loose
|
|
115
|
+
}, z.core.$loose>>, unknown>;
|
|
116
116
|
name: z.ZodOptional<z.ZodString>;
|
|
117
117
|
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
118
118
|
allProducts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -146,10 +146,10 @@ export declare const SmartCartBar: z.ZodObject<{
|
|
|
146
146
|
exclusionsEnabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
147
147
|
filterOosVariants: z.ZodOptional<z.ZodBoolean>;
|
|
148
148
|
id: z.ZodOptional<z.ZodString>;
|
|
149
|
-
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown
|
|
149
|
+
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>, unknown>;
|
|
150
150
|
presentmentCurrencies: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
151
151
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
-
}, z.core.$loose
|
|
152
|
+
}, z.core.$loose>>, unknown>;
|
|
153
153
|
productAmountReachedLabel: z.ZodOptional<z.ZodBoolean>;
|
|
154
154
|
productAmountReachedLabelText: z.ZodOptional<z.ZodString>;
|
|
155
155
|
productAmountRemainingLabel: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -183,7 +183,7 @@ export declare const SmartCartComponent: z.ZodObject<{
|
|
|
183
183
|
freeShippingReached: z.ZodOptional<z.ZodString>;
|
|
184
184
|
freeShippingRemaining: z.ZodOptional<z.ZodString>;
|
|
185
185
|
giftAreaTitle: z.ZodOptional<z.ZodString>;
|
|
186
|
-
}, z.core.$loose
|
|
186
|
+
}, z.core.$loose>>, unknown>;
|
|
187
187
|
name: z.ZodOptional<z.ZodString>;
|
|
188
188
|
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
189
189
|
allProducts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -217,10 +217,10 @@ export declare const SmartCartComponent: z.ZodObject<{
|
|
|
217
217
|
exclusionsEnabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
218
218
|
filterOosVariants: z.ZodOptional<z.ZodBoolean>;
|
|
219
219
|
id: z.ZodOptional<z.ZodString>;
|
|
220
|
-
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown
|
|
220
|
+
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>, unknown>;
|
|
221
221
|
presentmentCurrencies: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
222
222
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
223
|
-
}, z.core.$loose
|
|
223
|
+
}, z.core.$loose>>, unknown>;
|
|
224
224
|
productAmountReachedLabel: z.ZodOptional<z.ZodBoolean>;
|
|
225
225
|
productAmountReachedLabelText: z.ZodOptional<z.ZodString>;
|
|
226
226
|
productAmountRemainingLabel: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -238,7 +238,7 @@ export declare const SmartCartComponent: z.ZodObject<{
|
|
|
238
238
|
unlockConditionType: z.ZodOptional<z.ZodString>;
|
|
239
239
|
}, z.core.$loose>>>;
|
|
240
240
|
}, z.core.$loose>>>;
|
|
241
|
-
}, z.core.$loose
|
|
241
|
+
}, z.core.$loose>>, unknown>>;
|
|
242
242
|
type: z.ZodOptional<z.ZodString>;
|
|
243
243
|
}, z.core.$loose>;
|
|
244
244
|
/**
|
|
@@ -265,7 +265,7 @@ export declare const SmartCartConfig: z.ZodObject<{
|
|
|
265
265
|
freeShippingReached: z.ZodOptional<z.ZodString>;
|
|
266
266
|
freeShippingRemaining: z.ZodOptional<z.ZodString>;
|
|
267
267
|
giftAreaTitle: z.ZodOptional<z.ZodString>;
|
|
268
|
-
}, z.core.$loose
|
|
268
|
+
}, z.core.$loose>>, unknown>;
|
|
269
269
|
name: z.ZodOptional<z.ZodString>;
|
|
270
270
|
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
271
271
|
allProducts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -299,10 +299,10 @@ export declare const SmartCartConfig: z.ZodObject<{
|
|
|
299
299
|
exclusionsEnabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
300
300
|
filterOosVariants: z.ZodOptional<z.ZodBoolean>;
|
|
301
301
|
id: z.ZodOptional<z.ZodString>;
|
|
302
|
-
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown
|
|
302
|
+
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>, unknown>;
|
|
303
303
|
presentmentCurrencies: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
304
304
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
305
|
-
}, z.core.$loose
|
|
305
|
+
}, z.core.$loose>>, unknown>;
|
|
306
306
|
productAmountReachedLabel: z.ZodOptional<z.ZodBoolean>;
|
|
307
307
|
productAmountReachedLabelText: z.ZodOptional<z.ZodString>;
|
|
308
308
|
productAmountRemainingLabel: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -320,7 +320,7 @@ export declare const SmartCartConfig: z.ZodObject<{
|
|
|
320
320
|
unlockConditionType: z.ZodOptional<z.ZodString>;
|
|
321
321
|
}, z.core.$loose>>>;
|
|
322
322
|
}, z.core.$loose>>>;
|
|
323
|
-
}, z.core.$loose
|
|
323
|
+
}, z.core.$loose>>, unknown>>;
|
|
324
324
|
type: z.ZodOptional<z.ZodString>;
|
|
325
325
|
}, z.core.$loose>>>;
|
|
326
326
|
}, z.core.$loose>;
|
|
@@ -347,7 +347,7 @@ export declare const EngineSmartCart: z.ZodPreprocess<z.ZodOptional<z.ZodNullabl
|
|
|
347
347
|
freeShippingReached: z.ZodOptional<z.ZodString>;
|
|
348
348
|
freeShippingRemaining: z.ZodOptional<z.ZodString>;
|
|
349
349
|
giftAreaTitle: z.ZodOptional<z.ZodString>;
|
|
350
|
-
}, z.core.$loose
|
|
350
|
+
}, z.core.$loose>>, unknown>;
|
|
351
351
|
name: z.ZodOptional<z.ZodString>;
|
|
352
352
|
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
353
353
|
allProducts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -381,10 +381,10 @@ export declare const EngineSmartCart: z.ZodPreprocess<z.ZodOptional<z.ZodNullabl
|
|
|
381
381
|
exclusionsEnabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
382
382
|
filterOosVariants: z.ZodOptional<z.ZodBoolean>;
|
|
383
383
|
id: z.ZodOptional<z.ZodString>;
|
|
384
|
-
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown
|
|
384
|
+
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>, unknown>;
|
|
385
385
|
presentmentCurrencies: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
386
386
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
387
|
-
}, z.core.$loose
|
|
387
|
+
}, z.core.$loose>>, unknown>;
|
|
388
388
|
productAmountReachedLabel: z.ZodOptional<z.ZodBoolean>;
|
|
389
389
|
productAmountReachedLabelText: z.ZodOptional<z.ZodString>;
|
|
390
390
|
productAmountRemainingLabel: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -402,10 +402,10 @@ export declare const EngineSmartCart: z.ZodPreprocess<z.ZodOptional<z.ZodNullabl
|
|
|
402
402
|
unlockConditionType: z.ZodOptional<z.ZodString>;
|
|
403
403
|
}, z.core.$loose>>>;
|
|
404
404
|
}, z.core.$loose>>>;
|
|
405
|
-
}, z.core.$loose
|
|
405
|
+
}, z.core.$loose>>, unknown>>;
|
|
406
406
|
type: z.ZodOptional<z.ZodString>;
|
|
407
407
|
}, z.core.$loose>>>;
|
|
408
|
-
}, z.core.$loose
|
|
408
|
+
}, z.core.$loose>>>, unknown>;
|
|
409
409
|
export type SmartCartBar = z.infer<typeof SmartCartBar>;
|
|
410
410
|
export type SmartCartConfig = z.infer<typeof SmartCartConfig>;
|
|
411
411
|
export type SmartCartTier = z.infer<typeof SmartCartTier>;
|
|
@@ -94,7 +94,7 @@ export declare const UserConfig: z.ZodObject<{
|
|
|
94
94
|
freeShippingReached: z.ZodOptional<z.ZodString>;
|
|
95
95
|
freeShippingRemaining: z.ZodOptional<z.ZodString>;
|
|
96
96
|
giftAreaTitle: z.ZodOptional<z.ZodString>;
|
|
97
|
-
}, z.core.$loose
|
|
97
|
+
}, z.core.$loose>>, unknown>;
|
|
98
98
|
name: z.ZodOptional<z.ZodString>;
|
|
99
99
|
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
100
100
|
allProducts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -128,10 +128,10 @@ export declare const UserConfig: z.ZodObject<{
|
|
|
128
128
|
exclusionsEnabled: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
129
129
|
filterOosVariants: z.ZodOptional<z.ZodBoolean>;
|
|
130
130
|
id: z.ZodOptional<z.ZodString>;
|
|
131
|
-
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown
|
|
131
|
+
minimum: z.ZodPreprocess<z.ZodOptional<z.ZodCoercedNumber<unknown>>, unknown>;
|
|
132
132
|
presentmentCurrencies: z.ZodPreprocess<z.ZodOptional<z.ZodObject<{
|
|
133
133
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
-
}, z.core.$loose
|
|
134
|
+
}, z.core.$loose>>, unknown>;
|
|
135
135
|
productAmountReachedLabel: z.ZodOptional<z.ZodBoolean>;
|
|
136
136
|
productAmountReachedLabelText: z.ZodOptional<z.ZodString>;
|
|
137
137
|
productAmountRemainingLabel: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -149,10 +149,10 @@ export declare const UserConfig: z.ZodObject<{
|
|
|
149
149
|
unlockConditionType: z.ZodOptional<z.ZodString>;
|
|
150
150
|
}, z.core.$loose>>>;
|
|
151
151
|
}, z.core.$loose>>>;
|
|
152
|
-
}, z.core.$loose
|
|
152
|
+
}, z.core.$loose>>, unknown>>;
|
|
153
153
|
type: z.ZodOptional<z.ZodString>;
|
|
154
154
|
}, z.core.$loose>>>;
|
|
155
|
-
}, z.core.$loose
|
|
155
|
+
}, z.core.$loose>>>, unknown>>;
|
|
156
156
|
smartFlows: z.ZodArray<z.ZodUnknown>;
|
|
157
157
|
}, z.core.$strip>;
|
|
158
158
|
export type UserConfig = z.infer<typeof UserConfig>;
|
package/dist/server/index.cjs
CHANGED
|
@@ -5661,6 +5661,12 @@ function serialize(obj) {
|
|
|
5661
5661
|
|
|
5662
5662
|
// src/server/dataSourceResults.ts
|
|
5663
5663
|
var encodeAttributes = (pairs = []) => JSON.stringify(Object.fromEntries(pairs.map(({ key, value }) => [key, value ?? ""])));
|
|
5664
|
+
var MISSING_CUSTOM_ENDPOINT = "Unable to find a custom_endpoint object";
|
|
5665
|
+
var isMissingCustomEndpoint = (err) => {
|
|
5666
|
+
if (err.status !== 400 || !err.body || typeof err.body !== "object") return false;
|
|
5667
|
+
const message = err.body.error;
|
|
5668
|
+
return typeof message === "string" && message.startsWith(MISSING_CUSTOM_ENDPOINT);
|
|
5669
|
+
};
|
|
5664
5670
|
var buildEngineParams = (input, key) => {
|
|
5665
5671
|
const { cart, customerId, filterInputs, integrations, limit, productType, shop, visitorId } = input;
|
|
5666
5672
|
const items = cart.items.map(({ productId: productId2, properties, quantity: quantity3, subscriptionId, variantId }) => ({
|
|
@@ -5748,7 +5754,7 @@ var fetchDataSourceResults = async (input, ctx) => {
|
|
|
5748
5754
|
try {
|
|
5749
5755
|
upstream = await ctx.fetchUpstream(path, {}, { host: ctx.host, ...transport });
|
|
5750
5756
|
} catch (err) {
|
|
5751
|
-
if (err instanceof UpstreamError && (err.status === 404 || err.status === 410)) {
|
|
5757
|
+
if (err instanceof UpstreamError && (err.status === 404 || err.status === 410 || isMissingCustomEndpoint(err))) {
|
|
5752
5758
|
throw new NotFoundError(`Data source not found: ${input.dataSourcePath}`);
|
|
5753
5759
|
}
|
|
5754
5760
|
throw err;
|
package/dist/server/index.mjs
CHANGED
|
@@ -5588,6 +5588,12 @@ function serialize(obj) {
|
|
|
5588
5588
|
|
|
5589
5589
|
// src/server/dataSourceResults.ts
|
|
5590
5590
|
var encodeAttributes = (pairs = []) => JSON.stringify(Object.fromEntries(pairs.map(({ key, value }) => [key, value ?? ""])));
|
|
5591
|
+
var MISSING_CUSTOM_ENDPOINT = "Unable to find a custom_endpoint object";
|
|
5592
|
+
var isMissingCustomEndpoint = (err) => {
|
|
5593
|
+
if (err.status !== 400 || !err.body || typeof err.body !== "object") return false;
|
|
5594
|
+
const message = err.body.error;
|
|
5595
|
+
return typeof message === "string" && message.startsWith(MISSING_CUSTOM_ENDPOINT);
|
|
5596
|
+
};
|
|
5591
5597
|
var buildEngineParams = (input, key) => {
|
|
5592
5598
|
const { cart, customerId, filterInputs, integrations, limit, productType, shop, visitorId } = input;
|
|
5593
5599
|
const items = cart.items.map(({ productId: productId2, properties, quantity: quantity3, subscriptionId, variantId }) => ({
|
|
@@ -5675,7 +5681,7 @@ var fetchDataSourceResults = async (input, ctx) => {
|
|
|
5675
5681
|
try {
|
|
5676
5682
|
upstream = await ctx.fetchUpstream(path, {}, { host: ctx.host, ...transport });
|
|
5677
5683
|
} catch (err) {
|
|
5678
|
-
if (err instanceof UpstreamError && (err.status === 404 || err.status === 410)) {
|
|
5684
|
+
if (err instanceof UpstreamError && (err.status === 404 || err.status === 410 || isMissingCustomEndpoint(err))) {
|
|
5679
5685
|
throw new NotFoundError(`Data source not found: ${input.dataSourcePath}`);
|
|
5680
5686
|
}
|
|
5681
5687
|
throw err;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebuy/rebuy",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.68.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.",
|
|
@@ -217,5 +217,11 @@
|
|
|
217
217
|
},
|
|
218
218
|
"publishConfig": {
|
|
219
219
|
"access": "public"
|
|
220
|
+
},
|
|
221
|
+
"overrides": {
|
|
222
|
+
"external-editor": {
|
|
223
|
+
"tmp": "^0.2.6"
|
|
224
|
+
},
|
|
225
|
+
"brace-expansion@^1": "^1.1.21"
|
|
220
226
|
}
|
|
221
227
|
}
|