@zappie/sdk 0.16.0 → 0.18.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/CHANGELOG.md +26 -0
- package/README.md +25 -0
- package/dist/config/index.d.ts +23 -1
- package/dist/config/index.js.map +1 -1
- package/dist/customer/client.js +27 -0
- package/dist/customer/client.js.map +1 -1
- package/dist/customer/index.d.ts +181 -10
- package/dist/customer/reorder.d.ts +40 -0
- package/dist/customer/reorder.js +61 -0
- package/dist/customer/reorder.js.map +6 -0
- package/dist/debug.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server/index.d.ts +22 -0
- package/dist/site-config/sections.js +31 -28
- package/dist/site-config/sections.js.map +2 -2
- package/dist/site-config/validate.js +1 -1
- package/dist/site-config/validate.js.map +1 -1
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @zappie/sdk
|
|
2
2
|
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b2d1af9: A page's first load carries only the CSS it draws.
|
|
8
|
+
|
|
9
|
+
`zappie check` warns with `css/root-route-css` when a stylesheet `app/root` loads holds classes that only one route or an overlay writes, and names the modules that write them. Its budgets step reports each route's first-load CSS as `budgets/css-route`.
|
|
10
|
+
|
|
11
|
+
`zappie verify` records the CSS the home page and the menu load first, `homeCssFirstLoadKbGz` and `menuCssFirstLoadKbGz`, and the share of it left unused, `homeCssUnusedPercent` and `menuCssUnusedPercent`. V14 warns with `css_unused` above 50% unused. `findRegressions` flags first-load CSS that grows past 5% or 0.5 KiB.
|
|
12
|
+
|
|
13
|
+
Two new budgets in `zappie.config.ts`, with no default, turn those warnings into failures for a site that opts in. `budgets.routeCssKbGz` sets a CSS limit per page, keyed by React Router route id, such as `{ "routes/menu": 4, "routes/order": 3 }`, or one number for every route. `zappie check` fails a route over its limit, a route the record leaves out and a key that names no route, and prints a record to paste in, each value the route's measured figure plus 10 percent, rounded up to the next half KiB. V14 fails the home page or the menu over the limit of the route it renders, and warns with `route_css_unbudgeted` when it can't find one. Set in either form, `routeCssKbGz` replaces `budgets.cssKbGz`, which `zappie check` then only reports. `budgets.unusedCssPercent` fails V14 above that unused share.
|
|
14
|
+
|
|
15
|
+
The kit's order status stylesheet keeps only the layout the order parts need, about 0.36 KiB gzipped instead of 0.82 KiB, and draws the Removed label in the body text colour, which every theme keeps at 4.5:1 or more (order-status 2.0.1). Every kit component imports its own stylesheet.
|
|
16
|
+
|
|
17
|
+
The starter splits its stylesheet into a shared base, each route's styles and each overlay's styles, and loads an overlay's styles with its deferred chunk, so the menu's first load no longer carries the branch picker, the bag, the order list or the account pages. It sets each route's CSS limit from its measured size.
|
|
18
|
+
|
|
19
|
+
## 0.17.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- d9f3c7d: Order details on storefronts. `CustomerOrder` gains `reference`, the order number such as `#1042` to show instead of the id, and the status type gains `delivery_failed`. Each timeline step has a `step`, `title` and `description`, and `next_step` names the step to come. The order also carries `ready_at`, `delivery_instructions`, `charges`, `discounts`, `payments`, `voided_lines` and `amount_due`. Each line has `voided`, `texts` and its share of each charge, and each choice its `group_name`. `watchOrder` passes every field through. `customer.payBalance(orderId, { useWalletBalance, idempotencyKey })` raises a payment for what is left and returns the payment page's `url`. `customer.reorder(orderId)` rebuilds the order as bag lines at today's prices, and `customer.receiptUrl(orderId)` gives the receipt's address for a download link. New `@zappie/sdk/customer/reorder` entry: `addReorderToCart(zappie, reorder)` puts those lines in the bag and returns the lines it added and every line it left out, with the issues that say why.
|
|
24
|
+
|
|
25
|
+
New `@zappie/foundations/order` entry with the order details parts, without styles: `Order.Root`, `Order.Reference`, `Order.Status`, `Order.Timeline`, `Order.Fulfilment`, `Order.Lines`, `Order.Totals`, `Order.Payments` and `Order.Actions` with `Order.Receipt`, `Order.PayBalance` and `Order.OrderAgain`, plus `OrderDetails`, which puts them in one default layout, `useCustomerOrder` and `orderTotals`.
|
|
26
|
+
|
|
27
|
+
The kit's order status shows the order number and every part of the order details through the foundations parts (order-status 2.0.0, order-page 1.1.0). The orders page names each order by its number (orders-page 1.0.1).
|
|
28
|
+
|
|
3
29
|
## 0.16.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -234,6 +234,31 @@ address, such as a table bill's `inVenue.receiptUrl(orderId)`. Hand the file to
|
|
|
234
234
|
`navigator.share` where `canShareReceipt()` says the device can share it, or link
|
|
235
235
|
to the address with `download`.
|
|
236
236
|
|
|
237
|
+
### Orders
|
|
238
|
+
|
|
239
|
+
`customer.order(orderId)` reads an order, and `customer.watchOrder(orderId, {
|
|
240
|
+
onOrder })` follows it live. Show `order.reference`, such as `#1042`, as the
|
|
241
|
+
order number. The timeline's steps come with a `title` and a `description`
|
|
242
|
+
ready to show, and `next_step` names the step that comes next. `charges`,
|
|
243
|
+
`discounts`, `payments` and `voided_lines` itemise the money, and
|
|
244
|
+
`amount_due` says what is left to pay.
|
|
245
|
+
|
|
246
|
+
`customer.payBalance(orderId)` raises a payment for `amount_due` and returns
|
|
247
|
+
the payment page's `url`. Send the customer there. `customer.reorder(orderId)`
|
|
248
|
+
rebuilds the order as bag lines priced at today's menu, and
|
|
249
|
+
`addReorderToCart(zappie, reorder)` from `@zappie/sdk/customer/reorder` puts
|
|
250
|
+
them in the bag. It returns the lines
|
|
251
|
+
it added and every line it left out, with the issues that say why.
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
import { addReorderToCart } from "@zappie/sdk/customer/reorder";
|
|
255
|
+
|
|
256
|
+
const { dropped } = await addReorderToCart(
|
|
257
|
+
zappie,
|
|
258
|
+
await customer.reorder(orderId),
|
|
259
|
+
);
|
|
260
|
+
```
|
|
261
|
+
|
|
237
262
|
Pass any redirect target read from a query parameter through `safeRedirect`.
|
|
238
263
|
It keeps same-origin relative paths and returns your trusted fallback for an
|
|
239
264
|
external, malformed or unsupported target.
|
package/dist/config/index.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ declare const DEFAULT_BUDGETS: {
|
|
|
11
11
|
* Package names and patterns allowed globally without a site-specific allowlist entry.
|
|
12
12
|
*/
|
|
13
13
|
declare const GLOBAL_PACKAGE_ALLOWLIST: readonly ["react", "react-dom", "react-router", "@react-router/*", "@zappie/*", "tailwindcss", "@tailwindcss/*", "clsx", "tailwind-merge", "class-variance-authority", "lucide-react", "date-fns", "embla-carousel-react", "framer-motion/motion", "zod", "@radix-ui/*", "sonner", "vaul"];
|
|
14
|
+
/** `budgets.routeCssKbGz`: one limit in KiB for every route, or a limit for each route keyed by its route id. */
|
|
15
|
+
type RouteCssBudget = number | Record<string, number>;
|
|
14
16
|
/**
|
|
15
17
|
* The store, theme and optional build policies you export from zappie.config.ts.
|
|
16
18
|
*/
|
|
@@ -55,10 +57,30 @@ type ZappieSiteConfig = {
|
|
|
55
57
|
/** Each budget left out uses DEFAULT_BUDGETS. */
|
|
56
58
|
budgets?: {
|
|
57
59
|
jsKbGz?: number;
|
|
60
|
+
/** Every client stylesheet together, gzipped, in KiB. `zappie check` enforces it only while `routeCssKbGz` is unset. */
|
|
58
61
|
cssKbGz?: number;
|
|
59
62
|
lcpMs?: number;
|
|
60
63
|
/** V15's limit for the first product card to become tappable. Values below 3000 use 3000. */
|
|
61
64
|
tappableMs?: number;
|
|
65
|
+
/**
|
|
66
|
+
* The gzipped CSS, in KiB, a route may load on its first load: the shared base plus that route's own stylesheets.
|
|
67
|
+
* Unset, `zappie check` and `zappie verify` report each route's figure without failing.
|
|
68
|
+
*
|
|
69
|
+
* A number is one limit for every route. A record sets each route's own limit, keyed by its React Router route id,
|
|
70
|
+
* the route file's path under `app/` without its extension, such as `routes/menu` or `routes/order`. With a record,
|
|
71
|
+
* every route the build makes needs an entry, and `zappie check` fails a route with none or a key that names no
|
|
72
|
+
* route. It prints a record to paste in, each value the route's measured figure with 10 percent headroom.
|
|
73
|
+
*
|
|
74
|
+
* Either form fails `zappie check` for a route over its limit and `zappie verify` for a home or menu page over the
|
|
75
|
+
* limit of the route it renders. Set in either form, it replaces `cssKbGz`, which `zappie check` then reports
|
|
76
|
+
* without enforcing.
|
|
77
|
+
*/
|
|
78
|
+
routeCssKbGz?: RouteCssBudget;
|
|
79
|
+
/**
|
|
80
|
+
* The share of its first-load CSS, from 1 to 100 percent, that the home or menu page may leave unused before
|
|
81
|
+
* `zappie verify` fails. Unset, verify warns above 50 percent and never fails.
|
|
82
|
+
*/
|
|
83
|
+
unusedCssPercent?: number;
|
|
62
84
|
override?: {
|
|
63
85
|
reason: string;
|
|
64
86
|
};
|
|
@@ -133,4 +155,4 @@ declare function validateConfig(input: unknown): ConfigValidation;
|
|
|
133
155
|
declare function defineConfig(config: ZappieSiteConfig): ZappieSiteConfig;
|
|
134
156
|
|
|
135
157
|
export { DEFAULT_BUDGETS, GLOBAL_PACKAGE_ALLOWLIST, defineConfig, validateConfig };
|
|
136
|
-
export type { ConfigIssue, ConfigValidation, ZappieSiteConfig };
|
|
158
|
+
export type { ConfigIssue, ConfigValidation, RouteCssBudget, ZappieSiteConfig };
|
package/dist/config/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/site-config/index.ts"],
|
|
4
|
-
"mappings": ";AAeA,SAAS,iBAAiB,gCAAgC;
|
|
4
|
+
"mappings": ";AAeA,SAAS,iBAAiB,gCAAgC;AAO1D,SAAS,sBAAsB;AAXxB,SAAS,aAAa,QAA4C;AACvE,SAAO;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/customer/client.js
CHANGED
|
@@ -141,8 +141,35 @@ function createCustomer(options = {}) {
|
|
|
141
141
|
return request(`/me/orders${query.size ? `?${query}` : ""}`);
|
|
142
142
|
},
|
|
143
143
|
order: readOrder,
|
|
144
|
+
/**
|
|
145
|
+
* Raise a payment for what is left on the order, its `amount_due`, and return the payment page
|
|
146
|
+
* to send the customer to. An order paid in full answers `nothing_to_pay`, and one that ended
|
|
147
|
+
* answers `order_closed`. Each call makes its own Idempotency-Key unless you pass one.
|
|
148
|
+
*/
|
|
149
|
+
payBalance: (id, pay = {}) => request(
|
|
150
|
+
`/me/orders/${encodeURIComponent(id)}/payments`,
|
|
151
|
+
{
|
|
152
|
+
method: "POST",
|
|
153
|
+
headers: {
|
|
154
|
+
"Content-Type": "application/json",
|
|
155
|
+
"Idempotency-Key": pay.idempotencyKey ?? crypto.randomUUID()
|
|
156
|
+
},
|
|
157
|
+
// JSON leaves out use_wallet_balance when it is undefined.
|
|
158
|
+
body: JSON.stringify({ use_wallet_balance: pay.useWalletBalance })
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/**
|
|
162
|
+
* Rebuild the order as bag lines at the same branch, priced at today's menu. It creates
|
|
163
|
+
* nothing. Lines the branch no longer sells as ordered come back in `dropped`. Put the lines in
|
|
164
|
+
* the bag with `addReorderToCart` from `@zappie/sdk/customer/reorder`.
|
|
165
|
+
*/
|
|
166
|
+
reorder: (id) => request(`/me/orders/${encodeURIComponent(id)}/reorder`, {
|
|
167
|
+
method: "POST"
|
|
168
|
+
}),
|
|
144
169
|
/** The order's receipt as a PDF File, named as the API names it. Needs the orders:read scope. */
|
|
145
170
|
receipt: (id) => orderReceipt(base, id, fetcher),
|
|
171
|
+
/** The receipt's same-origin address, for a download link. */
|
|
172
|
+
receiptUrl: (id) => `${base}/me/orders/${encodeURIComponent(id)}/receipt`,
|
|
146
173
|
watchOrder(id, watchOptions) {
|
|
147
174
|
return watchOrder(base, id, readOrder, watchOptions);
|
|
148
175
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/customer/client.ts"],
|
|
4
|
-
"mappings": ";AAEA,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AAGjC,SAAS,oBAAoB;AAC7B;AAAA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AAA,QAEA,MAAM,KAAK,UAAU,EAAE,oBAAoB,IAAI,iBAAiB,CAAC;AAAA,MACnE;AAAA,IACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMF,SAAS,CAAC,OACR,QAAiB,cAAc,mBAAmB,EAAE,CAAC,YAAY;AAAA,MAC/D,QAAQ;AAAA,IACV,CAAC;AAAA;AAAA,IAEH,SAAS,CAAC,OAAe,aAAa,MAAM,IAAI,OAAO;AAAA;AAAA,IAEvD,YAAY,CAAC,OACX,GAAG,IAAI,cAAc,mBAAmB,EAAE,CAAC;AAAA,IAC7C,WAAW,IAAY,cAAiC;AACtD,aAAO,WAAW,MAAM,IAAI,WAAW,YAAY;AAAA,IACrD;AAAA,EACF;AACF;",
|
|
5
5
|
"names": ["options"]
|
|
6
6
|
}
|
package/dist/customer/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ZappieError } from '@zappie/sdk';
|
|
1
|
+
import { WireIssue, ZappieError } from '@zappie/sdk';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Whether the customer session is unchecked, anonymous or authenticated.
|
|
@@ -43,17 +43,67 @@ type Money = {
|
|
|
43
43
|
currency: string;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
|
-
* A selected option recorded on an order line, including its name, quantity and price.
|
|
46
|
+
* A selected option recorded on an order line, including its group, name, quantity and price.
|
|
47
47
|
*/
|
|
48
48
|
type OrderChoice = {
|
|
49
49
|
group_id: string;
|
|
50
|
+
/** The option group's name, such as "Spread". */
|
|
51
|
+
group_name: string;
|
|
50
52
|
choice_id: string;
|
|
51
53
|
name: string;
|
|
52
54
|
price: Money;
|
|
53
55
|
quantity: number;
|
|
54
56
|
};
|
|
55
57
|
/**
|
|
56
|
-
*
|
|
58
|
+
* What the customer typed for one text group on an order line.
|
|
59
|
+
*/
|
|
60
|
+
type OrderText = {
|
|
61
|
+
group_id: string;
|
|
62
|
+
group_name: string;
|
|
63
|
+
value: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The kind of a charge on an order.
|
|
67
|
+
*/
|
|
68
|
+
type OrderChargeCode = "service_charge" | "delivery" | "packaging" | "vat" | "small_order" | "platform_fee" | "other";
|
|
69
|
+
/**
|
|
70
|
+
* A line's share of a charge on the order. An included share is already in the line's price.
|
|
71
|
+
*/
|
|
72
|
+
type OrderLineCharge = {
|
|
73
|
+
code: OrderChargeCode;
|
|
74
|
+
label: string;
|
|
75
|
+
amount: Money;
|
|
76
|
+
included: boolean;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* A charge on the order. An included charge is already in the menu prices and adds nothing to the
|
|
80
|
+
* total. A waived charge shows at zero.
|
|
81
|
+
*/
|
|
82
|
+
type OrderCharge = OrderLineCharge & {
|
|
83
|
+
waived: boolean;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* A discount on the order. The amount is positive, like the order's discount.
|
|
87
|
+
*/
|
|
88
|
+
type OrderDiscount = {
|
|
89
|
+
label: string;
|
|
90
|
+
/** The code the customer entered, when the discount came with one. */
|
|
91
|
+
promo_code?: string;
|
|
92
|
+
amount: Money;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* A successful or refunded payment toward the order. It never carries a card number or a payment
|
|
96
|
+
* reference.
|
|
97
|
+
*/
|
|
98
|
+
type OrderPayment = {
|
|
99
|
+
method: string;
|
|
100
|
+
amount: Money;
|
|
101
|
+
status: "successful" | "refunded";
|
|
102
|
+
paid_at: string;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* An ordered item with its recorded prices, selected options, typed text and its share of each
|
|
106
|
+
* charge. `voided` is true only on a line in `voided_lines`.
|
|
57
107
|
*/
|
|
58
108
|
type OrderLine = {
|
|
59
109
|
item_id: string;
|
|
@@ -63,14 +113,48 @@ type OrderLine = {
|
|
|
63
113
|
unit_price: Money;
|
|
64
114
|
total: Money;
|
|
65
115
|
notes?: string;
|
|
116
|
+
voided: boolean;
|
|
66
117
|
choices: OrderChoice[];
|
|
118
|
+
texts: OrderText[];
|
|
119
|
+
charges: OrderLineCharge[];
|
|
67
120
|
};
|
|
68
121
|
/**
|
|
69
|
-
*
|
|
122
|
+
* Where an order stands.
|
|
123
|
+
*/
|
|
124
|
+
type OrderStatus = "pending" | "accepted" | "ready" | "out_for_delivery" | "arrived" | "delivery_failed" | "completed" | "cancelled" | "rejected";
|
|
125
|
+
/**
|
|
126
|
+
* A detailed step. `ready_for_pickup`, `ready_for_rider_pickup`, `searching_for_rider`,
|
|
127
|
+
* `rider_assigned` and `waiting_for_pickup` read as the `ready` status, `picked_up` and
|
|
128
|
+
* `on_the_way` as `out_for_delivery`. The rest match the status of the same name.
|
|
129
|
+
*/
|
|
130
|
+
type OrderStepCode = "pending" | "accepted" | "ready_for_pickup" | "ready_for_rider_pickup" | "searching_for_rider" | "rider_assigned" | "waiting_for_pickup" | "picked_up" | "on_the_way" | "arrived" | "completed" | "cancelled" | "rejected" | "delivery_failed";
|
|
131
|
+
/**
|
|
132
|
+
* A step the order took, with its name and one sentence on what it means, ready to show.
|
|
133
|
+
*/
|
|
134
|
+
type OrderTimelineStep = {
|
|
135
|
+
/** The public status the step reads as. Several steps can share one. */
|
|
136
|
+
status: string;
|
|
137
|
+
step: OrderStepCode;
|
|
138
|
+
title: string;
|
|
139
|
+
description: string;
|
|
140
|
+
at: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* The step the business moves the order to next.
|
|
144
|
+
*/
|
|
145
|
+
type OrderNextStep = {
|
|
146
|
+
step: OrderStepCode;
|
|
147
|
+
title: string;
|
|
148
|
+
description: string;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* A customer order with its number, fulfilment, charges, discounts, payments, lines and timeline.
|
|
70
152
|
*/
|
|
71
153
|
type CustomerOrder = {
|
|
72
154
|
id: string;
|
|
73
|
-
|
|
155
|
+
/** The order number the business and the customer know the order by, such as "#1042". Show it instead of the id. */
|
|
156
|
+
reference: string;
|
|
157
|
+
status: OrderStatus;
|
|
74
158
|
fulfilment: "delivery" | "pickup";
|
|
75
159
|
branch_id?: string;
|
|
76
160
|
currency: string;
|
|
@@ -80,16 +164,29 @@ type CustomerOrder = {
|
|
|
80
164
|
total: Money;
|
|
81
165
|
paid: boolean;
|
|
82
166
|
amount_paid: Money;
|
|
167
|
+
/** What the customer can still pay with `payBalance`. Zero once the order is paid or has ended. */
|
|
168
|
+
amount_due: Money;
|
|
83
169
|
lines: OrderLine[];
|
|
170
|
+
/** Lines the business took off the order after it was placed. No total counts them. */
|
|
171
|
+
voided_lines: OrderLine[];
|
|
172
|
+
/** Each charge in the order it was added, the delivery fee among them. */
|
|
173
|
+
charges: OrderCharge[];
|
|
174
|
+
discounts: OrderDiscount[];
|
|
175
|
+
/** Successful and refunded payments, oldest first. */
|
|
176
|
+
payments: OrderPayment[];
|
|
84
177
|
placed_at: string;
|
|
85
178
|
updated_at: string;
|
|
86
179
|
scheduled_at?: string;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
180
|
+
/** When the business expects the order to be ready. It stays after that time passes. */
|
|
181
|
+
ready_at?: string;
|
|
182
|
+
/** Every step the order has taken, oldest first. */
|
|
183
|
+
timeline: OrderTimelineStep[];
|
|
184
|
+
/** The step that comes next. Null once the order has ended and during the rider's steps. */
|
|
185
|
+
next_step: OrderNextStep | null;
|
|
91
186
|
eta_minutes?: number;
|
|
92
187
|
contact_phone?: string;
|
|
188
|
+
/** The customer's note for whoever brings the order. */
|
|
189
|
+
delivery_instructions?: string;
|
|
93
190
|
dropoff_address?: {
|
|
94
191
|
line1?: string;
|
|
95
192
|
lat?: number;
|
|
@@ -100,6 +197,66 @@ type CustomerOrder = {
|
|
|
100
197
|
method?: string;
|
|
101
198
|
};
|
|
102
199
|
};
|
|
200
|
+
/**
|
|
201
|
+
* The payment `payBalance` raised. Send the customer to `url` to finish it.
|
|
202
|
+
*/
|
|
203
|
+
type OrderBalancePayment = {
|
|
204
|
+
payment_request_id: string;
|
|
205
|
+
amount: Money;
|
|
206
|
+
url: string;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Options for paying what is left on an order.
|
|
210
|
+
*/
|
|
211
|
+
type PayBalanceOptions = {
|
|
212
|
+
/** Take what the customer's wallet holds first. Needs the wallet scope. */
|
|
213
|
+
useWalletBalance?: boolean;
|
|
214
|
+
/** Retry a failed attempt with the same key. Each call makes its own by default. */
|
|
215
|
+
idempotencyKey?: string;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* An order line rebuilt for the bag at today's prices, as POST /quote takes it.
|
|
219
|
+
*/
|
|
220
|
+
type ReorderLine = {
|
|
221
|
+
line_id: string;
|
|
222
|
+
item_id: string;
|
|
223
|
+
menu_id?: string;
|
|
224
|
+
variant_id?: string;
|
|
225
|
+
quantity: number;
|
|
226
|
+
options?: {
|
|
227
|
+
group_id: string;
|
|
228
|
+
choice_id: string;
|
|
229
|
+
quantity?: number;
|
|
230
|
+
}[];
|
|
231
|
+
inputs?: Record<string, string>;
|
|
232
|
+
note?: string;
|
|
233
|
+
name: string;
|
|
234
|
+
unit_price: Money;
|
|
235
|
+
options_total: Money;
|
|
236
|
+
line_total: Money;
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* An order line the branch no longer sells as it was ordered, with the issues that say why.
|
|
240
|
+
*/
|
|
241
|
+
type ReorderDroppedLine = {
|
|
242
|
+
line_id: string;
|
|
243
|
+
/** The name on the original order. */
|
|
244
|
+
name: string;
|
|
245
|
+
quantity: number;
|
|
246
|
+
/** Each issue as the quote words it. */
|
|
247
|
+
issues: WireIssue[];
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* An order rebuilt as bag lines at the same branch, for the same fulfilment, priced at today's menu.
|
|
251
|
+
*/
|
|
252
|
+
type Reorder = {
|
|
253
|
+
order_id: string;
|
|
254
|
+
branch_id: string;
|
|
255
|
+
fulfilment: "delivery" | "pickup";
|
|
256
|
+
menu_version: string;
|
|
257
|
+
lines: ReorderLine[];
|
|
258
|
+
dropped: ReorderDroppedLine[];
|
|
259
|
+
};
|
|
103
260
|
/**
|
|
104
261
|
* A page of customer orders and the cursor for the next page, or null at the end.
|
|
105
262
|
*/
|
|
@@ -159,8 +316,22 @@ declare function createCustomer(options?: CustomerClientOptions): {
|
|
|
159
316
|
limit?: number;
|
|
160
317
|
}): Promise<OrdersPage>;
|
|
161
318
|
order: (id: string, signal?: AbortSignal) => Promise<CustomerOrder>;
|
|
319
|
+
/**
|
|
320
|
+
* Raise a payment for what is left on the order, its `amount_due`, and return the payment page
|
|
321
|
+
* to send the customer to. An order paid in full answers `nothing_to_pay`, and one that ended
|
|
322
|
+
* answers `order_closed`. Each call makes its own Idempotency-Key unless you pass one.
|
|
323
|
+
*/
|
|
324
|
+
payBalance: (id: string, pay?: PayBalanceOptions) => Promise<OrderBalancePayment>;
|
|
325
|
+
/**
|
|
326
|
+
* Rebuild the order as bag lines at the same branch, priced at today's menu. It creates
|
|
327
|
+
* nothing. Lines the branch no longer sells as ordered come back in `dropped`. Put the lines in
|
|
328
|
+
* the bag with `addReorderToCart` from `@zappie/sdk/customer/reorder`.
|
|
329
|
+
*/
|
|
330
|
+
reorder: (id: string) => Promise<Reorder>;
|
|
162
331
|
/** The order's receipt as a PDF File, named as the API names it. Needs the orders:read scope. */
|
|
163
332
|
receipt: (id: string) => Promise<File>;
|
|
333
|
+
/** The receipt's same-origin address, for a download link. */
|
|
334
|
+
receiptUrl: (id: string) => string;
|
|
164
335
|
watchOrder(id: string, watchOptions: WatchOrderOptions): () => void;
|
|
165
336
|
};
|
|
166
337
|
/**
|
|
@@ -179,4 +350,4 @@ declare class CustomerError extends ZappieError {
|
|
|
179
350
|
}
|
|
180
351
|
|
|
181
352
|
export { CustomerError, createCustomer };
|
|
182
|
-
export type { AuthState, CreateAddress, CustomerClient, CustomerClientOptions, CustomerListener, CustomerOrder, CustomerProfile, Money, OrderChoice, OrderLine, OrdersPage, SavedAddress, SessionCustomer, WatchOrderOptions };
|
|
353
|
+
export type { AuthState, CreateAddress, CustomerClient, CustomerClientOptions, CustomerListener, CustomerOrder, CustomerProfile, Money, OrderBalancePayment, OrderCharge, OrderChargeCode, OrderChoice, OrderDiscount, OrderLine, OrderLineCharge, OrderNextStep, OrderPayment, OrderStatus, OrderStepCode, OrderText, OrderTimelineStep, OrdersPage, PayBalanceOptions, Reorder, ReorderDroppedLine, ReorderLine, SavedAddress, SessionCustomer, WatchOrderOptions };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CartLine, Zappie } from '@zappie/sdk';
|
|
2
|
+
import { Reorder } from '@zappie/sdk/customer';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* An order line that didn't make it into the bag, with the issues that say why.
|
|
6
|
+
*/
|
|
7
|
+
type DroppedReorderLine = {
|
|
8
|
+
lineId: string;
|
|
9
|
+
/** The name on the original order. */
|
|
10
|
+
name: string;
|
|
11
|
+
quantity: number;
|
|
12
|
+
issues: {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* What `addReorderToCart` put in the bag and what it left out.
|
|
19
|
+
*/
|
|
20
|
+
type ReorderResult = {
|
|
21
|
+
added: CartLine[];
|
|
22
|
+
/** The lines the API dropped, then the lines the bag refused. Show them so the customer knows. */
|
|
23
|
+
dropped: DroppedReorderLine[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Put a reorder's lines in the bag, next to what it already holds. A bag at another branch moves to
|
|
27
|
+
* the order's branch first, which keeps the lines that branch sells. A pickup order sets pickup
|
|
28
|
+
* when the bag has no fulfilment yet. A delivery order leaves the address to checkout.
|
|
29
|
+
*
|
|
30
|
+
* @param zappie - The storefront client, whose cart and menu take the lines.
|
|
31
|
+
* @param reorder - What `customer.reorder(orderId)` returned.
|
|
32
|
+
* @param options - A signal that stops it between lines.
|
|
33
|
+
* @returns The lines added, and every line left out with the issues that say why.
|
|
34
|
+
*/
|
|
35
|
+
declare function addReorderToCart(zappie: Pick<Zappie, "cart" | "menu">, reorder: Reorder, options?: {
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
}): Promise<ReorderResult>;
|
|
38
|
+
|
|
39
|
+
export { addReorderToCart };
|
|
40
|
+
export type { DroppedReorderLine, ReorderResult };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// src/customer/reorder.ts
|
|
2
|
+
async function addReorderToCart(zappie, reorder, options = {}) {
|
|
3
|
+
const { cart } = zappie;
|
|
4
|
+
const branch = reorder.branch_id;
|
|
5
|
+
await cart.hydrate();
|
|
6
|
+
if (cart.getSnapshot().branchId !== branch) {
|
|
7
|
+
await cart.moveTo(branch);
|
|
8
|
+
}
|
|
9
|
+
const added = [];
|
|
10
|
+
const dropped = reorder.dropped.map((line) => ({
|
|
11
|
+
lineId: line.line_id,
|
|
12
|
+
name: line.name,
|
|
13
|
+
quantity: line.quantity,
|
|
14
|
+
issues: line.issues.map(({ code, message }) => ({ code, message }))
|
|
15
|
+
}));
|
|
16
|
+
for (const line of reorder.lines) {
|
|
17
|
+
options.signal?.throwIfAborted();
|
|
18
|
+
try {
|
|
19
|
+
const item = await zappie.menu.item(line.item_id, {
|
|
20
|
+
branch,
|
|
21
|
+
...options.signal ? { signal: options.signal } : {}
|
|
22
|
+
});
|
|
23
|
+
added.push(
|
|
24
|
+
cart.add(item, {
|
|
25
|
+
quantity: line.quantity,
|
|
26
|
+
choices: (line.options ?? []).map((option) => ({
|
|
27
|
+
groupId: option.group_id,
|
|
28
|
+
choiceId: option.choice_id,
|
|
29
|
+
quantity: option.quantity ?? 1
|
|
30
|
+
})),
|
|
31
|
+
...line.menu_id ? { menuId: line.menu_id } : {},
|
|
32
|
+
...line.variant_id ? { variantId: line.variant_id } : {},
|
|
33
|
+
...line.inputs ? { inputs: line.inputs } : {},
|
|
34
|
+
...line.note ? { note: line.note } : {}
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
options.signal?.throwIfAborted();
|
|
39
|
+
const reasons = error.issues;
|
|
40
|
+
dropped.push({
|
|
41
|
+
lineId: line.line_id,
|
|
42
|
+
name: line.name,
|
|
43
|
+
quantity: line.quantity,
|
|
44
|
+
issues: reasons?.length ? reasons.map(({ code, message }) => ({ code, message })) : [
|
|
45
|
+
{
|
|
46
|
+
code: error.code ?? "item_unavailable",
|
|
47
|
+
message: `${line.name} isn't available right now.`
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (reorder.fulfilment === "pickup" && !cart.getSnapshot().fulfilment) {
|
|
54
|
+
cart.setFulfilment({ type: "pickup", branchId: branch });
|
|
55
|
+
}
|
|
56
|
+
return { added, dropped };
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
addReorderToCart
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=reorder.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/customer/reorder.ts"],
|
|
4
|
+
"mappings": ";AAoCA,eAAsB,iBACpB,QACA,SACA,UAAoC,CAAC,GACb;AACxB,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,SAAS,QAAQ;AACvB,QAAM,KAAK,QAAQ;AACnB,MAAI,KAAK,YAAY,EAAE,aAAa,QAAQ;AAC1C,UAAM,KAAK,OAAO,MAAM;AAAA,EAC1B;AACA,QAAM,QAAoB,CAAC;AAC3B,QAAM,UAAgC,QAAQ,QAAQ,IAAI,CAAC,UAAU;AAAA,IACnE,QAAQ,KAAK;AAAA,IACb,MAAM,KAAK;AAAA,IACX,UAAU,KAAK;AAAA,IACf,QAAQ,KAAK,OAAO,IAAI,CAAC,EAAE,MAAM,QAAQ,OAAO,EAAE,MAAM,QAAQ,EAAE;AAAA,EACpE,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EAAE,MAAM,UAAU,UAAU,OAAO,CAAC;AAAA,EACzD;AACA,SAAO,EAAE,OAAO,QAAQ;AAC1B;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/debug.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { ZappieError, isZappieError } from "./errors.js";
|
|
|
11
11
|
export * from "./models.js";
|
|
12
12
|
import { format, money } from "./money.js";
|
|
13
13
|
import { RestTransport } from "./transport/rest.js";
|
|
14
|
-
var VERSION = true ? "0.
|
|
14
|
+
var VERSION = true ? "0.18.0" : "0.0.0-development";
|
|
15
15
|
export {
|
|
16
16
|
API_VERSION,
|
|
17
17
|
RestTransport,
|
package/dist/server/index.d.ts
CHANGED
|
@@ -709,6 +709,8 @@ declare function applyAvailability(snapshot: MenuSnapshot, patch: AvailabilityPa
|
|
|
709
709
|
/** Check that a value read from the edge is a MenuSnapshot this SDK can use. */
|
|
710
710
|
declare function isMenuSnapshot(value: unknown): value is MenuSnapshot;
|
|
711
711
|
|
|
712
|
+
/** `budgets.routeCssKbGz`: one limit in KiB for every route, or a limit for each route keyed by its route id. */
|
|
713
|
+
type RouteCssBudget = number | Record<string, number>;
|
|
712
714
|
/**
|
|
713
715
|
* The store, theme and optional build policies you export from zappie.config.ts.
|
|
714
716
|
*/
|
|
@@ -753,10 +755,30 @@ type ZappieSiteConfig = {
|
|
|
753
755
|
/** Each budget left out uses DEFAULT_BUDGETS. */
|
|
754
756
|
budgets?: {
|
|
755
757
|
jsKbGz?: number;
|
|
758
|
+
/** Every client stylesheet together, gzipped, in KiB. `zappie check` enforces it only while `routeCssKbGz` is unset. */
|
|
756
759
|
cssKbGz?: number;
|
|
757
760
|
lcpMs?: number;
|
|
758
761
|
/** V15's limit for the first product card to become tappable. Values below 3000 use 3000. */
|
|
759
762
|
tappableMs?: number;
|
|
763
|
+
/**
|
|
764
|
+
* The gzipped CSS, in KiB, a route may load on its first load: the shared base plus that route's own stylesheets.
|
|
765
|
+
* Unset, `zappie check` and `zappie verify` report each route's figure without failing.
|
|
766
|
+
*
|
|
767
|
+
* A number is one limit for every route. A record sets each route's own limit, keyed by its React Router route id,
|
|
768
|
+
* the route file's path under `app/` without its extension, such as `routes/menu` or `routes/order`. With a record,
|
|
769
|
+
* every route the build makes needs an entry, and `zappie check` fails a route with none or a key that names no
|
|
770
|
+
* route. It prints a record to paste in, each value the route's measured figure with 10 percent headroom.
|
|
771
|
+
*
|
|
772
|
+
* Either form fails `zappie check` for a route over its limit and `zappie verify` for a home or menu page over the
|
|
773
|
+
* limit of the route it renders. Set in either form, it replaces `cssKbGz`, which `zappie check` then reports
|
|
774
|
+
* without enforcing.
|
|
775
|
+
*/
|
|
776
|
+
routeCssKbGz?: RouteCssBudget;
|
|
777
|
+
/**
|
|
778
|
+
* The share of its first-load CSS, from 1 to 100 percent, that the home or menu page may leave unused before
|
|
779
|
+
* `zappie verify` fails. Unset, verify warns above 50 percent and never fails.
|
|
780
|
+
*/
|
|
781
|
+
unusedCssPercent?: number;
|
|
760
782
|
override?: {
|
|
761
783
|
reason: string;
|
|
762
784
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
// src/site-config/sections.ts
|
|
2
|
-
import { record, unknownKeys } from "./helpers.js";
|
|
2
|
+
import { nonblank, record, unknownKeys } from "./helpers.js";
|
|
3
3
|
import { DEFAULT_BUDGETS } from "./types.js";
|
|
4
|
+
var budgetKeys = [
|
|
5
|
+
...Object.keys(DEFAULT_BUDGETS),
|
|
6
|
+
"routeCssKbGz",
|
|
7
|
+
"unusedCssPercent"
|
|
8
|
+
];
|
|
4
9
|
function nested(value, path, keys, issue, validate) {
|
|
5
10
|
if (value === void 0) {
|
|
6
11
|
return;
|
|
@@ -18,34 +23,32 @@ function nested(value, path, keys, issue, validate) {
|
|
|
18
23
|
validate(value);
|
|
19
24
|
}
|
|
20
25
|
function budgets(value, issue, error) {
|
|
21
|
-
nested(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
error(
|
|
35
|
-
"budgets.override.reason",
|
|
36
|
-
"invalid_format",
|
|
37
|
-
"Expected a non-blank reason. Explain why the default budget must be raised."
|
|
38
|
-
);
|
|
39
|
-
}
|
|
26
|
+
nested(value, "budgets", [...budgetKeys, "override"], issue, (budget) => {
|
|
27
|
+
nested(
|
|
28
|
+
budget.override,
|
|
29
|
+
"budgets.override",
|
|
30
|
+
["reason"],
|
|
31
|
+
issue,
|
|
32
|
+
(override) => {
|
|
33
|
+
if (!nonblank(override.reason)) {
|
|
34
|
+
error(
|
|
35
|
+
"budgets.override.reason",
|
|
36
|
+
"invalid_format",
|
|
37
|
+
"Expected a non-blank reason. Explain why the default budget must be raised."
|
|
38
|
+
);
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
for (const key of budgetKeys) {
|
|
43
|
+
const value2 = budget[key];
|
|
44
|
+
for (const [route, amount] of Object.entries(
|
|
45
|
+
key === "routeCssKbGz" && record(value2) ? value2 : { "": value2 }
|
|
46
|
+
)) {
|
|
47
|
+
const path = `budgets.${key}${route && `.${route}`}`;
|
|
45
48
|
if (amount === void 0) {
|
|
46
49
|
continue;
|
|
47
50
|
}
|
|
48
|
-
if (
|
|
51
|
+
if (!Number.isFinite(amount) || amount <= 0) {
|
|
49
52
|
error(
|
|
50
53
|
path,
|
|
51
54
|
"invalid_type",
|
|
@@ -55,11 +58,11 @@ function budgets(value, issue, error) {
|
|
|
55
58
|
error(
|
|
56
59
|
path,
|
|
57
60
|
"invalid_format",
|
|
58
|
-
|
|
61
|
+
`The ${key} budget cannot exceed 5000. Set ${path} to 5000 or less.`
|
|
59
62
|
);
|
|
60
63
|
} else if (amount > DEFAULT_BUDGETS[key]) {
|
|
61
64
|
const message = `The ${key} budget exceeds the ${DEFAULT_BUDGETS[key]} default.`;
|
|
62
|
-
if (budget.override
|
|
65
|
+
if (!budget.override) {
|
|
63
66
|
error(
|
|
64
67
|
path,
|
|
65
68
|
"budget_override",
|
|
@@ -76,7 +79,7 @@ function budgets(value, issue, error) {
|
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
|
-
);
|
|
82
|
+
});
|
|
80
83
|
}
|
|
81
84
|
function analytics(value, issue, error) {
|
|
82
85
|
nested(value, "analytics", ["forward"], issue, (analyticsValue) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/site-config/sections.ts"],
|
|
4
|
-
"mappings": ";AAAA,SAAS,QAAQ,mBAAmB;
|
|
5
|
-
"names": []
|
|
4
|
+
"mappings": ";AAAA,SAAS,UAAU,QAAQ,mBAAmB;AAC9C,SAAS,uBAAyC;AAGlD,IAAM,aAAa;AAAA,EACjB,GAAG,OAAO,KAAK,eAAe;AAAA,EAC9B;AAAA,EACA;AACF;AASO,SAAS,OACd,OACA,MACA,MACA,OACA,UACA;AACA,MAAI,UAAU,QAAW;AACvB;AAAA,EACF;AACA,MAAI,CAAC,OAAO,KAAK,GAAG;AAClB,UAAM;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,MACN,SAAS,2BAA2B,IAAI;AAAA,MACxC,UAAU;AAAA,IACZ,CAAC;AACD;AAAA,EACF;AACA,cAAY,OAAO,MAAM,MAAM,KAAK;AACpC,WAAS,KAAK;AAChB;AAEO,SAAS,QAAQ,OAAgB,OAAiB,OAAiB;AACxE,SAAO,OAAO,WAAW,CAAC,GAAG,YAAY,UAAU,GAAG,OAAO,CAAC,WAAW;AACvE;AAAA,MACE,OAAO;AAAA,MACP;AAAA,MACA,CAAC,QAAQ;AAAA,MACT;AAAA,MACA,CAAC,aAAa;AACZ,YAAI,CAAC,SAAS,SAAS,MAAM,GAAG;AAC9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,QAAQ,QAAQ,YACtB,CAAC,gBAAgB,KAAK,QAAQ,GAAG,IACnC;AACA;AAAA,YACE;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AACA,YACE,QAAQ,cAAc,WACrB,OAAO,QAAQ,cAAc,YAC5B,CAAC,QAAQ,KAAK,QAAQ,SAAS,IACjC;AACA;AAAA,YACE;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
5
|
+
"names": ["value"]
|
|
6
6
|
}
|
|
@@ -120,7 +120,7 @@ function validateConfig(input) {
|
|
|
120
120
|
["reason"],
|
|
121
121
|
issue,
|
|
122
122
|
(optOut) => {
|
|
123
|
-
if (
|
|
123
|
+
if (!nonblank(optOut.reason)) {
|
|
124
124
|
error(
|
|
125
125
|
"readiness.routeDiscovery.optOut.reason",
|
|
126
126
|
"invalid_format",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/site-config/validate.ts"],
|
|
4
|
-
"mappings": ";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,SAAS,cAAc;AAG3C,IAAM,WAAW;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AASO,SAAS,eAAe,OAAkC;AAC/D,QAAM,SAAwB,CAAC;AAC/B,QAAM,QAAQ,CAAC,UAAuB,OAAO,KAAK,KAAK;AACvD,QAAM,QAAQ,CAAC,MAAc,MAA2B,YACtD,MAAM,EAAE,MAAM,MAAM,SAAS,UAAU,QAAQ,CAAC;AAClD,MAAI,CAAC,OAAO,KAAK,GAAG;AAClB,WAAO;AAAA,MACL,OAA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CAAC,SAAS,IAAI,GAAG;AACnB;AAAA,QACE,GAAG,IAAI,IAAI,KAAK;AAAA,QAChB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zappie/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Typed, framework-agnostic client for Zappie menus, carts, checkout, auth and events.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
"types": "./dist/customer/react.d.ts",
|
|
84
84
|
"import": "./dist/customer/react.js"
|
|
85
85
|
},
|
|
86
|
+
"./customer/reorder": {
|
|
87
|
+
"types": "./dist/customer/reorder.d.ts",
|
|
88
|
+
"import": "./dist/customer/reorder.js"
|
|
89
|
+
},
|
|
86
90
|
"./loyalty": {
|
|
87
91
|
"types": "./dist/loyalty/index.d.ts",
|
|
88
92
|
"import": "./dist/loyalty/index.js"
|