@open-tender/cloud 0.1.10 → 0.1.12
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/cjs/services/api.d.ts +2 -2
- package/dist/cjs/slices/order.d.ts +2 -2
- package/dist/cjs/slices/signUp.d.ts +3 -3
- package/dist/cjs/slices/signUp.js +5 -5
- package/dist/esm/services/api.d.ts +2 -2
- package/dist/esm/slices/order.d.ts +2 -2
- package/dist/esm/slices/signUp.d.ts +3 -3
- package/dist/esm/slices/signUp.js +5 -5
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigApp, GroupOrder, GroupOrders, OrderType, RevenueCenterType, ServiceType, Weekday } from '@open-tender/types';
|
|
1
|
+
import { ConfigApp, Customer, CustomerCreate, GroupOrder, GroupOrders, OrderType, RevenueCenterType, ServiceType, Weekday } from '@open-tender/types';
|
|
2
2
|
declare class OpenTenderAPI {
|
|
3
3
|
brandId?: string;
|
|
4
4
|
clientId?: string;
|
|
@@ -101,7 +101,7 @@ declare class OpenTenderAPI {
|
|
|
101
101
|
getGuest(email: string): Promise<unknown>;
|
|
102
102
|
getSubscriber(email: string): Promise<unknown>;
|
|
103
103
|
postSubscriber(email: string): Promise<unknown>;
|
|
104
|
-
postSignUp(data:
|
|
104
|
+
postSignUp(data: CustomerCreate): Promise<Customer | null | undefined>;
|
|
105
105
|
postLevelUp(data: any): Promise<unknown>;
|
|
106
106
|
postThanxLogin(email: string): Promise<unknown>;
|
|
107
107
|
postThanxAuth(code: string, path: string): Promise<unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppState } from '../app';
|
|
2
|
-
import { Address, Cart, CartCounts, CartItem, DeviceType, MenuCategory, MenuRevenueCenter, Messages, Modal, Order, OrderType, PrepType, RequestedAt, RequestError, RequestStatus, RevenueCenter, ServiceType, SimpleCart } from '@open-tender/types';
|
|
2
|
+
import { Address, Cart, CartCounts, CartItem, DeviceType, MenuCategory, MenuRevenueCenter, Messages, Modal, Order, OrderType, PrepType, RequestedAt, RequestError, RequestStatus, RevenueCenter, ServiceType, SimpleCart, Timezone } from '@open-tender/types';
|
|
3
3
|
export interface OrderState {
|
|
4
4
|
address: Address | null;
|
|
5
5
|
alert: Modal | null;
|
|
@@ -112,7 +112,7 @@ export declare const resetOrder: import("@reduxjs/toolkit").ActionCreatorWithout
|
|
|
112
112
|
isOutpost?: boolean | undefined;
|
|
113
113
|
}, "order/setOrderServiceType">, setOrderType: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setOrderType">, setPrepType: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setPrepType">, setRequestedAt: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setRequestedAt">, setRevenueCenter: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setRevenueCenter">, setServiceType: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setServiceType">, setTable: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setTable">, checkout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"order/checkout">, setCurrentVendor: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setCurrentVendor">, updateOrder: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/updateOrder">;
|
|
114
114
|
export declare const selectAlert: (state: AppState) => Modal | null;
|
|
115
|
-
export declare const selectTimezone: (state: AppState) =>
|
|
115
|
+
export declare const selectTimezone: (state: AppState) => Timezone;
|
|
116
116
|
export declare const selectOrder: (state: AppState) => OrderState;
|
|
117
117
|
export declare const selectCartQuantity: (state: AppState) => number;
|
|
118
118
|
export declare const selectCartTotal: (state: AppState) => number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppState } from '../app';
|
|
2
|
-
import {
|
|
2
|
+
import { Customer, CustomerCreate, RequestError, RequestStatus } from '@open-tender/types';
|
|
3
3
|
export interface SignUpState {
|
|
4
4
|
loading: RequestStatus;
|
|
5
5
|
error: RequestError;
|
|
@@ -8,8 +8,8 @@ export declare enum SignUpActionType {
|
|
|
8
8
|
SignUpCustomer = "signUp/signUpCustomer"
|
|
9
9
|
}
|
|
10
10
|
export declare const signUpCustomer: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
11
|
-
data:
|
|
12
|
-
callback?: ((data:
|
|
11
|
+
data: CustomerCreate;
|
|
12
|
+
callback?: ((data: Customer) => void) | undefined;
|
|
13
13
|
}, {
|
|
14
14
|
state: AppState;
|
|
15
15
|
rejectValue: RequestError;
|
|
@@ -13,17 +13,17 @@ var SignUpActionType;
|
|
|
13
13
|
(function (SignUpActionType) {
|
|
14
14
|
SignUpActionType["SignUpCustomer"] = "signUp/signUpCustomer";
|
|
15
15
|
})(SignUpActionType = exports.SignUpActionType || (exports.SignUpActionType = {}));
|
|
16
|
-
exports.signUpCustomer = (0, toolkit_1.createAsyncThunk)(SignUpActionType.SignUpCustomer, (data, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
exports.signUpCustomer = (0, toolkit_1.createAsyncThunk)(SignUpActionType.SignUpCustomer, ({ data, callback }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
var _a, _b;
|
|
18
18
|
try {
|
|
19
19
|
const api = getState().config.api;
|
|
20
20
|
const response = yield api.postSignUp(data);
|
|
21
21
|
dispatch((0, customer_1.loginCustomer)({
|
|
22
|
-
email: (_a = data.
|
|
23
|
-
password: (_b = data.
|
|
22
|
+
email: (_a = data.email) !== null && _a !== void 0 ? _a : '',
|
|
23
|
+
password: (_b = data.password) !== null && _b !== void 0 ? _b : ''
|
|
24
24
|
}));
|
|
25
|
-
if (
|
|
26
|
-
|
|
25
|
+
if (callback)
|
|
26
|
+
callback(response);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
catch (err) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigApp, GroupOrder, GroupOrders, OrderType, RevenueCenterType, ServiceType, Weekday } from '@open-tender/types';
|
|
1
|
+
import { ConfigApp, Customer, CustomerCreate, GroupOrder, GroupOrders, OrderType, RevenueCenterType, ServiceType, Weekday } from '@open-tender/types';
|
|
2
2
|
declare class OpenTenderAPI {
|
|
3
3
|
brandId?: string;
|
|
4
4
|
clientId?: string;
|
|
@@ -101,7 +101,7 @@ declare class OpenTenderAPI {
|
|
|
101
101
|
getGuest(email: string): Promise<unknown>;
|
|
102
102
|
getSubscriber(email: string): Promise<unknown>;
|
|
103
103
|
postSubscriber(email: string): Promise<unknown>;
|
|
104
|
-
postSignUp(data:
|
|
104
|
+
postSignUp(data: CustomerCreate): Promise<Customer | null | undefined>;
|
|
105
105
|
postLevelUp(data: any): Promise<unknown>;
|
|
106
106
|
postThanxLogin(email: string): Promise<unknown>;
|
|
107
107
|
postThanxAuth(code: string, path: string): Promise<unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppState } from '../app';
|
|
2
|
-
import { Address, Cart, CartCounts, CartItem, DeviceType, MenuCategory, MenuRevenueCenter, Messages, Modal, Order, OrderType, PrepType, RequestedAt, RequestError, RequestStatus, RevenueCenter, ServiceType, SimpleCart } from '@open-tender/types';
|
|
2
|
+
import { Address, Cart, CartCounts, CartItem, DeviceType, MenuCategory, MenuRevenueCenter, Messages, Modal, Order, OrderType, PrepType, RequestedAt, RequestError, RequestStatus, RevenueCenter, ServiceType, SimpleCart, Timezone } from '@open-tender/types';
|
|
3
3
|
export interface OrderState {
|
|
4
4
|
address: Address | null;
|
|
5
5
|
alert: Modal | null;
|
|
@@ -112,7 +112,7 @@ export declare const resetOrder: import("@reduxjs/toolkit").ActionCreatorWithout
|
|
|
112
112
|
isOutpost?: boolean | undefined;
|
|
113
113
|
}, "order/setOrderServiceType">, setOrderType: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setOrderType">, setPrepType: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setPrepType">, setRequestedAt: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setRequestedAt">, setRevenueCenter: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setRevenueCenter">, setServiceType: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setServiceType">, setTable: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setTable">, checkout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"order/checkout">, setCurrentVendor: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/setCurrentVendor">, updateOrder: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "order/updateOrder">;
|
|
114
114
|
export declare const selectAlert: (state: AppState) => Modal | null;
|
|
115
|
-
export declare const selectTimezone: (state: AppState) =>
|
|
115
|
+
export declare const selectTimezone: (state: AppState) => Timezone;
|
|
116
116
|
export declare const selectOrder: (state: AppState) => OrderState;
|
|
117
117
|
export declare const selectCartQuantity: (state: AppState) => number;
|
|
118
118
|
export declare const selectCartTotal: (state: AppState) => number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppState } from '../app';
|
|
2
|
-
import {
|
|
2
|
+
import { Customer, CustomerCreate, RequestError, RequestStatus } from '@open-tender/types';
|
|
3
3
|
export interface SignUpState {
|
|
4
4
|
loading: RequestStatus;
|
|
5
5
|
error: RequestError;
|
|
@@ -8,8 +8,8 @@ export declare enum SignUpActionType {
|
|
|
8
8
|
SignUpCustomer = "signUp/signUpCustomer"
|
|
9
9
|
}
|
|
10
10
|
export declare const signUpCustomer: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
11
|
-
data:
|
|
12
|
-
callback?: ((data:
|
|
11
|
+
data: CustomerCreate;
|
|
12
|
+
callback?: ((data: Customer) => void) | undefined;
|
|
13
13
|
}, {
|
|
14
14
|
state: AppState;
|
|
15
15
|
rejectValue: RequestError;
|
|
@@ -10,17 +10,17 @@ export var SignUpActionType;
|
|
|
10
10
|
(function (SignUpActionType) {
|
|
11
11
|
SignUpActionType["SignUpCustomer"] = "signUp/signUpCustomer";
|
|
12
12
|
})(SignUpActionType || (SignUpActionType = {}));
|
|
13
|
-
export const signUpCustomer = createAsyncThunk(SignUpActionType.SignUpCustomer, (data, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
13
|
+
export const signUpCustomer = createAsyncThunk(SignUpActionType.SignUpCustomer, ({ data, callback }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
14
|
var _a, _b;
|
|
15
15
|
try {
|
|
16
16
|
const api = getState().config.api;
|
|
17
17
|
const response = yield api.postSignUp(data);
|
|
18
18
|
dispatch(loginCustomer({
|
|
19
|
-
email: (_a = data.
|
|
20
|
-
password: (_b = data.
|
|
19
|
+
email: (_a = data.email) !== null && _a !== void 0 ? _a : '',
|
|
20
|
+
password: (_b = data.password) !== null && _b !== void 0 ? _b : ''
|
|
21
21
|
}));
|
|
22
|
-
if (
|
|
23
|
-
|
|
22
|
+
if (callback)
|
|
23
|
+
callback(response);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"typescript": "^4.8.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@open-tender/types": "^0.2.
|
|
53
|
-
"@open-tender/utils": "^0.1.
|
|
52
|
+
"@open-tender/types": "^0.2.9",
|
|
53
|
+
"@open-tender/utils": "^0.1.37",
|
|
54
54
|
"@reduxjs/toolkit": "^1.8.5",
|
|
55
55
|
"react": "^18.2.0"
|
|
56
56
|
},
|