@open-tender/cloud 0.4.9 → 0.4.11
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.
|
@@ -160,7 +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
|
+
postCustomerTplsVerify(token: string): Promise<unknown>;
|
|
164
164
|
getCustomerTpls(token: string): Promise<unknown>;
|
|
165
165
|
getCustomerTplsHistory(token: string): Promise<unknown>;
|
|
166
166
|
getCustomerHouseAccounts(token: string): Promise<unknown>;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -696,8 +696,8 @@ 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',
|
|
699
|
+
postCustomerTplsVerify(token) {
|
|
700
|
+
return this.request(`/customer/tpls/email-verify`, 'POST', null, null, token);
|
|
701
701
|
}
|
|
702
702
|
getCustomerTpls(token) {
|
|
703
703
|
return this.request(`/customer/tpls`, 'GET', null, null, token);
|
|
@@ -30,10 +30,13 @@ exports.fetchCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionTy
|
|
|
30
30
|
return (0, account_1.checkAuth)(error, dispatch, () => rejectWithValue(error));
|
|
31
31
|
}
|
|
32
32
|
}));
|
|
33
|
-
exports.verifyCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionType.
|
|
33
|
+
exports.verifyCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionType.VerifyCustomerTpls, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
34
34
|
try {
|
|
35
35
|
const api = getState().config.api;
|
|
36
|
-
|
|
36
|
+
const token = (0, account_1.selectToken)(getState());
|
|
37
|
+
if (!token)
|
|
38
|
+
throw new Error(types_2.MISSING_CUSTOMER);
|
|
39
|
+
return yield api.postCustomerTplsVerify(token);
|
|
37
40
|
}
|
|
38
41
|
catch (err) {
|
|
39
42
|
return rejectWithValue(err);
|
|
@@ -160,7 +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
|
+
postCustomerTplsVerify(token: string): Promise<unknown>;
|
|
164
164
|
getCustomerTpls(token: string): Promise<unknown>;
|
|
165
165
|
getCustomerTplsHistory(token: string): Promise<unknown>;
|
|
166
166
|
getCustomerHouseAccounts(token: string): Promise<unknown>;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -694,8 +694,8 @@ 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',
|
|
697
|
+
postCustomerTplsVerify(token) {
|
|
698
|
+
return this.request(`/customer/tpls/email-verify`, 'POST', null, null, token);
|
|
699
699
|
}
|
|
700
700
|
getCustomerTpls(token) {
|
|
701
701
|
return this.request(`/customer/tpls`, 'GET', null, null, token);
|
|
@@ -27,10 +27,13 @@ export const fetchCustomerTpls = createAsyncThunk(CustomerTplsActionType.FetchCu
|
|
|
27
27
|
return checkAuth(error, dispatch, () => rejectWithValue(error));
|
|
28
28
|
}
|
|
29
29
|
}));
|
|
30
|
-
export const verifyCustomerTpls = createAsyncThunk(CustomerTplsActionType.
|
|
30
|
+
export const verifyCustomerTpls = createAsyncThunk(CustomerTplsActionType.VerifyCustomerTpls, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
31
|
try {
|
|
32
32
|
const api = getState().config.api;
|
|
33
|
-
|
|
33
|
+
const token = selectToken(getState());
|
|
34
|
+
if (!token)
|
|
35
|
+
throw new Error(MISSING_CUSTOMER);
|
|
36
|
+
return yield api.postCustomerTplsVerify(token);
|
|
34
37
|
}
|
|
35
38
|
catch (err) {
|
|
36
39
|
return rejectWithValue(err);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
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",
|