@compassdigital/sdk.typescript 4.698.0 → 4.700.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/lib/index.d.ts +8 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -1
- package/lib/interface/announcement.d.ts +7 -1
- package/lib/interface/announcement.d.ts.map +1 -1
- package/lib/interface/announcement.js +7 -0
- package/lib/interface/announcement.js.map +1 -1
- package/lib/interface/calendar.d.ts +6 -1
- package/lib/interface/calendar.d.ts.map +1 -1
- package/lib/interface/calendar.js +6 -0
- package/lib/interface/calendar.js.map +1 -1
- package/lib/interface/delivery.d.ts +18 -0
- package/lib/interface/delivery.d.ts.map +1 -1
- package/lib/interface/location.d.ts +22 -3
- package/lib/interface/location.d.ts.map +1 -1
- package/lib/interface/location.js +20 -0
- package/lib/interface/location.js.map +1 -1
- package/lib/interface/menu.d.ts +6 -1
- package/lib/interface/menu.d.ts.map +1 -1
- package/lib/interface/menu.js +6 -0
- package/lib/interface/menu.js.map +1 -1
- package/lib/interface/promo.d.ts +13 -2
- package/lib/interface/promo.d.ts.map +1 -1
- package/lib/interface/promo.js +12 -0
- package/lib/interface/promo.js.map +1 -1
- package/lib/interface/shoppingcart.d.ts +5 -1
- package/lib/interface/shoppingcart.d.ts.map +1 -1
- package/lib/interface/shoppingcart.js +5 -0
- package/lib/interface/shoppingcart.js.map +1 -1
- package/lib/interface/task.d.ts +11 -1
- package/lib/interface/task.d.ts.map +1 -1
- package/lib/interface/task.js +11 -0
- package/lib/interface/task.js.map +1 -1
- package/lib/interface/tax.d.ts +5 -1
- package/lib/interface/tax.d.ts.map +1 -1
- package/lib/interface/tax.js +5 -0
- package/lib/interface/tax.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +21 -0
- package/src/interface/announcement.ts +7 -1
- package/src/interface/calendar.ts +6 -1
- package/src/interface/delivery.ts +32 -0
- package/src/interface/location.ts +22 -10
- package/src/interface/menu.ts +7 -1
- package/src/interface/promo.ts +13 -2
- package/src/interface/shoppingcart.ts +5 -1
- package/src/interface/task.ts +11 -9
- package/src/interface/tax.ts +5 -1
- package/test/client.test.ts +6 -2
|
@@ -572,7 +572,11 @@ export interface FPValidationData {
|
|
|
572
572
|
[index: string]: any;
|
|
573
573
|
}
|
|
574
574
|
|
|
575
|
-
export
|
|
575
|
+
export const AmountOffExclusion = {
|
|
576
|
+
DISCOUNT: 'discount',
|
|
577
|
+
PROMO: 'promo',
|
|
578
|
+
} as const;
|
|
579
|
+
export type AmountOffExclusion = (typeof AmountOffExclusion)[keyof typeof AmountOffExclusion];
|
|
576
580
|
|
|
577
581
|
export interface PromoOrder {
|
|
578
582
|
items_applied_discount_amount?: number;
|
package/src/interface/task.ts
CHANGED
|
@@ -143,15 +143,17 @@ export interface OrderIssue {
|
|
|
143
143
|
[index: string]: any;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
export
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
export const TaskStatus = {
|
|
147
|
+
NEW: 'new',
|
|
148
|
+
IN_PROGRESS: 'in_progress',
|
|
149
|
+
READY: 'ready',
|
|
150
|
+
OUT_FOR_DELIVERY: 'out_for_delivery',
|
|
151
|
+
DELIVERED: 'delivered',
|
|
152
|
+
ORDER_IS_READY: 'order_is_ready',
|
|
153
|
+
ACCEPTED: 'accepted',
|
|
154
|
+
CANCELLED: 'cancelled',
|
|
155
|
+
} as const;
|
|
156
|
+
export type TaskStatus = (typeof TaskStatus)[keyof typeof TaskStatus];
|
|
155
157
|
|
|
156
158
|
// POST /task - Create new Task
|
|
157
159
|
|
package/src/interface/tax.ts
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
import { RequestQuery, BaseRequest } from './util';
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export const TransactionType = {
|
|
7
|
+
PICKUP: 'pickup',
|
|
8
|
+
DELIVERY: 'delivery',
|
|
9
|
+
} as const;
|
|
10
|
+
export type TransactionType = (typeof TransactionType)[keyof typeof TransactionType];
|
|
7
11
|
|
|
8
12
|
export interface TaxLocationData {
|
|
9
13
|
// unique location identifier
|
package/test/client.test.ts
CHANGED
|
@@ -152,10 +152,14 @@ describe('ServiceClient', () => {
|
|
|
152
152
|
});
|
|
153
153
|
|
|
154
154
|
test('client gives up after retry limit', async () => {
|
|
155
|
+
jest.useFakeTimers();
|
|
155
156
|
const intercept = jest.fn(interceptor(500));
|
|
156
157
|
const api = new ServiceClient({ stage: 'dev', intercept });
|
|
157
|
-
const
|
|
158
|
-
|
|
158
|
+
const assertion = expect(api.get_task('', { retry: 5 })).rejects.toBeInstanceOf(
|
|
159
|
+
ServiceError,
|
|
160
|
+
);
|
|
161
|
+
await jest.runAllTimersAsync();
|
|
162
|
+
await assertion;
|
|
159
163
|
expect(intercept.mock.calls.length).toEqual(6);
|
|
160
164
|
});
|
|
161
165
|
|