@open-tender/cloud 0.4.6 → 0.4.7
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 +1 -0
- package/dist/cjs/services/api.js +3 -0
- package/dist/cjs/slices/customer/tpls.d.ts +10 -0
- package/dist/cjs/slices/customer/tpls.js +21 -1
- package/dist/esm/services/api.d.ts +1 -0
- package/dist/esm/services/api.js +3 -0
- package/dist/esm/slices/customer/tpls.d.ts +10 -0
- package/dist/esm/slices/customer/tpls.js +20 -0
- package/package.json +1 -1
|
@@ -160,6 +160,7 @@ declare class OpenTenderAPI {
|
|
|
160
160
|
getCustomerLoyaltyV2(token: string): Promise<unknown>;
|
|
161
161
|
getCustomerThanx(token: string): Promise<unknown>;
|
|
162
162
|
getThanxCardSignature(token: string, acct: string): Promise<unknown>;
|
|
163
|
+
postCustomerTplsVerify(): Promise<unknown>;
|
|
163
164
|
getCustomerTpls(token: string): Promise<unknown>;
|
|
164
165
|
getCustomerTplsHistory(token: string): Promise<unknown>;
|
|
165
166
|
getCustomerHouseAccounts(token: string): Promise<unknown>;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -696,6 +696,9 @@ class OpenTenderAPI {
|
|
|
696
696
|
getThanxCardSignature(token, acct) {
|
|
697
697
|
return this.request(`/customer/thanx-card-signature?acct=${acct}`, 'GET', null, null, token);
|
|
698
698
|
}
|
|
699
|
+
postCustomerTplsVerify() {
|
|
700
|
+
return this.request(`/customer/tpls/email-verify`, 'POST', {});
|
|
701
|
+
}
|
|
699
702
|
getCustomerTpls(token) {
|
|
700
703
|
return this.request(`/customer/tpls`, 'GET', null, null, token);
|
|
701
704
|
}
|
|
@@ -18,6 +18,16 @@ export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TP
|
|
|
18
18
|
fulfilledMeta?: unknown;
|
|
19
19
|
rejectedMeta?: unknown;
|
|
20
20
|
}>;
|
|
21
|
+
export declare const verifyCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
22
|
+
state: AppState;
|
|
23
|
+
rejectValue: RequestError;
|
|
24
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
25
|
+
extra?: unknown;
|
|
26
|
+
serializedErrorType?: unknown;
|
|
27
|
+
pendingMeta?: unknown;
|
|
28
|
+
fulfilledMeta?: unknown;
|
|
29
|
+
rejectedMeta?: unknown;
|
|
30
|
+
}>;
|
|
21
31
|
export declare const resetCustomerTpls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tpls/resetCustomerTpls">;
|
|
22
32
|
export declare const selectCustomerTpls: (state: AppState) => CustomerTplsState;
|
|
23
33
|
export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObject & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.customerTplsReducer = exports.selectCustomerTplsProgress = exports.selectCustomerTplsRewards = exports.selectCustomerTplsPoints = exports.selectCustomerTpls = exports.resetCustomerTpls = exports.fetchCustomerTpls = exports.CustomerTplsActionType = void 0;
|
|
3
|
+
exports.customerTplsReducer = exports.selectCustomerTplsProgress = exports.selectCustomerTplsRewards = exports.selectCustomerTplsPoints = exports.selectCustomerTpls = exports.resetCustomerTpls = exports.verifyCustomerTpls = exports.fetchCustomerTpls = exports.CustomerTplsActionType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const types_1 = require("../types");
|
|
@@ -29,6 +29,15 @@ exports.fetchCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionTy
|
|
|
29
29
|
return (0, account_1.checkAuth)(error, dispatch, () => rejectWithValue(error));
|
|
30
30
|
}
|
|
31
31
|
}));
|
|
32
|
+
exports.verifyCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionType.FetchCustomerTpls, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
try {
|
|
34
|
+
const api = getState().config.api;
|
|
35
|
+
return yield api.postCustomerTplsVerify();
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
return rejectWithValue(err);
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
32
41
|
const customerTplsSlice = (0, toolkit_1.createSlice)({
|
|
33
42
|
name: types_1.ReducerType.Tpls,
|
|
34
43
|
initialState,
|
|
@@ -48,6 +57,17 @@ const customerTplsSlice = (0, toolkit_1.createSlice)({
|
|
|
48
57
|
.addCase(exports.fetchCustomerTpls.rejected, (state, action) => {
|
|
49
58
|
state.error = action.payload;
|
|
50
59
|
state.loading = 'idle';
|
|
60
|
+
})
|
|
61
|
+
.addCase(exports.verifyCustomerTpls.fulfilled, state => {
|
|
62
|
+
state.loading = 'idle';
|
|
63
|
+
state.error = null;
|
|
64
|
+
})
|
|
65
|
+
.addCase(exports.verifyCustomerTpls.pending, state => {
|
|
66
|
+
state.loading = 'pending';
|
|
67
|
+
})
|
|
68
|
+
.addCase(exports.verifyCustomerTpls.rejected, (state, action) => {
|
|
69
|
+
state.error = action.payload;
|
|
70
|
+
state.loading = 'idle';
|
|
51
71
|
});
|
|
52
72
|
}
|
|
53
73
|
});
|
|
@@ -160,6 +160,7 @@ declare class OpenTenderAPI {
|
|
|
160
160
|
getCustomerLoyaltyV2(token: string): Promise<unknown>;
|
|
161
161
|
getCustomerThanx(token: string): Promise<unknown>;
|
|
162
162
|
getThanxCardSignature(token: string, acct: string): Promise<unknown>;
|
|
163
|
+
postCustomerTplsVerify(): Promise<unknown>;
|
|
163
164
|
getCustomerTpls(token: string): Promise<unknown>;
|
|
164
165
|
getCustomerTplsHistory(token: string): Promise<unknown>;
|
|
165
166
|
getCustomerHouseAccounts(token: string): Promise<unknown>;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -694,6 +694,9 @@ class OpenTenderAPI {
|
|
|
694
694
|
getThanxCardSignature(token, acct) {
|
|
695
695
|
return this.request(`/customer/thanx-card-signature?acct=${acct}`, 'GET', null, null, token);
|
|
696
696
|
}
|
|
697
|
+
postCustomerTplsVerify() {
|
|
698
|
+
return this.request(`/customer/tpls/email-verify`, 'POST', {});
|
|
699
|
+
}
|
|
697
700
|
getCustomerTpls(token) {
|
|
698
701
|
return this.request(`/customer/tpls`, 'GET', null, null, token);
|
|
699
702
|
}
|
|
@@ -18,6 +18,16 @@ export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TP
|
|
|
18
18
|
fulfilledMeta?: unknown;
|
|
19
19
|
rejectedMeta?: unknown;
|
|
20
20
|
}>;
|
|
21
|
+
export declare const verifyCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
22
|
+
state: AppState;
|
|
23
|
+
rejectValue: RequestError;
|
|
24
|
+
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
25
|
+
extra?: unknown;
|
|
26
|
+
serializedErrorType?: unknown;
|
|
27
|
+
pendingMeta?: unknown;
|
|
28
|
+
fulfilledMeta?: unknown;
|
|
29
|
+
rejectedMeta?: unknown;
|
|
30
|
+
}>;
|
|
21
31
|
export declare const resetCustomerTpls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tpls/resetCustomerTpls">;
|
|
22
32
|
export declare const selectCustomerTpls: (state: AppState) => CustomerTplsState;
|
|
23
33
|
export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObject & {
|
|
@@ -26,6 +26,15 @@ export const fetchCustomerTpls = createAsyncThunk(CustomerTplsActionType.FetchCu
|
|
|
26
26
|
return checkAuth(error, dispatch, () => rejectWithValue(error));
|
|
27
27
|
}
|
|
28
28
|
}));
|
|
29
|
+
export const verifyCustomerTpls = createAsyncThunk(CustomerTplsActionType.FetchCustomerTpls, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
try {
|
|
31
|
+
const api = getState().config.api;
|
|
32
|
+
return yield api.postCustomerTplsVerify();
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
return rejectWithValue(err);
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
29
38
|
const customerTplsSlice = createSlice({
|
|
30
39
|
name: ReducerType.Tpls,
|
|
31
40
|
initialState,
|
|
@@ -45,6 +54,17 @@ const customerTplsSlice = createSlice({
|
|
|
45
54
|
.addCase(fetchCustomerTpls.rejected, (state, action) => {
|
|
46
55
|
state.error = action.payload;
|
|
47
56
|
state.loading = 'idle';
|
|
57
|
+
})
|
|
58
|
+
.addCase(verifyCustomerTpls.fulfilled, state => {
|
|
59
|
+
state.loading = 'idle';
|
|
60
|
+
state.error = null;
|
|
61
|
+
})
|
|
62
|
+
.addCase(verifyCustomerTpls.pending, state => {
|
|
63
|
+
state.loading = 'pending';
|
|
64
|
+
})
|
|
65
|
+
.addCase(verifyCustomerTpls.rejected, (state, action) => {
|
|
66
|
+
state.error = action.payload;
|
|
67
|
+
state.loading = 'idle';
|
|
48
68
|
});
|
|
49
69
|
}
|
|
50
70
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
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",
|