@open-tender/cloud 0.4.6 → 0.4.9

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,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>;
@@ -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
  }
@@ -6,7 +6,8 @@ export interface CustomerTplsState {
6
6
  loading: RequestStatus;
7
7
  }
8
8
  export declare enum CustomerTplsActionType {
9
- FetchCustomerTpls = "customer/fetchCustomerTpls"
9
+ FetchCustomerTpls = "customer/fetchCustomerTpls",
10
+ VerifyCustomerTpls = "customer/verifyCustomerTpls"
10
11
  }
11
12
  export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TPLS, void, {
12
13
  state: AppState;
@@ -18,6 +19,16 @@ export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TP
18
19
  fulfilledMeta?: unknown;
19
20
  rejectedMeta?: unknown;
20
21
  }>;
22
+ export declare const verifyCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<void, void, {
23
+ state: AppState;
24
+ rejectValue: RequestError;
25
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
26
+ extra?: unknown;
27
+ serializedErrorType?: unknown;
28
+ pendingMeta?: unknown;
29
+ fulfilledMeta?: unknown;
30
+ rejectedMeta?: unknown;
31
+ }>;
21
32
  export declare const resetCustomerTpls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tpls/resetCustomerTpls">;
22
33
  export declare const selectCustomerTpls: (state: AppState) => CustomerTplsState;
23
34
  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");
@@ -14,6 +14,7 @@ const initialState = {
14
14
  var CustomerTplsActionType;
15
15
  (function (CustomerTplsActionType) {
16
16
  CustomerTplsActionType["FetchCustomerTpls"] = "customer/fetchCustomerTpls";
17
+ CustomerTplsActionType["VerifyCustomerTpls"] = "customer/verifyCustomerTpls";
17
18
  })(CustomerTplsActionType = exports.CustomerTplsActionType || (exports.CustomerTplsActionType = {}));
18
19
  exports.fetchCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionType.FetchCustomerTpls, (_, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
19
20
  try {
@@ -29,6 +30,15 @@ exports.fetchCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionTy
29
30
  return (0, account_1.checkAuth)(error, dispatch, () => rejectWithValue(error));
30
31
  }
31
32
  }));
33
+ exports.verifyCustomerTpls = (0, toolkit_1.createAsyncThunk)(CustomerTplsActionType.FetchCustomerTpls, (_, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
34
+ try {
35
+ const api = getState().config.api;
36
+ return yield api.postCustomerTplsVerify();
37
+ }
38
+ catch (err) {
39
+ return rejectWithValue(err);
40
+ }
41
+ }));
32
42
  const customerTplsSlice = (0, toolkit_1.createSlice)({
33
43
  name: types_1.ReducerType.Tpls,
34
44
  initialState,
@@ -48,6 +58,17 @@ const customerTplsSlice = (0, toolkit_1.createSlice)({
48
58
  .addCase(exports.fetchCustomerTpls.rejected, (state, action) => {
49
59
  state.error = action.payload;
50
60
  state.loading = 'idle';
61
+ })
62
+ .addCase(exports.verifyCustomerTpls.fulfilled, state => {
63
+ state.loading = 'idle';
64
+ state.error = null;
65
+ })
66
+ .addCase(exports.verifyCustomerTpls.pending, state => {
67
+ state.loading = 'pending';
68
+ })
69
+ .addCase(exports.verifyCustomerTpls.rejected, (state, action) => {
70
+ state.error = action.payload;
71
+ state.loading = 'idle';
51
72
  });
52
73
  }
53
74
  });
@@ -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>;
@@ -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
  }
@@ -6,7 +6,8 @@ export interface CustomerTplsState {
6
6
  loading: RequestStatus;
7
7
  }
8
8
  export declare enum CustomerTplsActionType {
9
- FetchCustomerTpls = "customer/fetchCustomerTpls"
9
+ FetchCustomerTpls = "customer/fetchCustomerTpls",
10
+ VerifyCustomerTpls = "customer/verifyCustomerTpls"
10
11
  }
11
12
  export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TPLS, void, {
12
13
  state: AppState;
@@ -18,6 +19,16 @@ export declare const fetchCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<TP
18
19
  fulfilledMeta?: unknown;
19
20
  rejectedMeta?: unknown;
20
21
  }>;
22
+ export declare const verifyCustomerTpls: import("@reduxjs/toolkit").AsyncThunk<void, void, {
23
+ state: AppState;
24
+ rejectValue: RequestError;
25
+ dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
26
+ extra?: unknown;
27
+ serializedErrorType?: unknown;
28
+ pendingMeta?: unknown;
29
+ fulfilledMeta?: unknown;
30
+ rejectedMeta?: unknown;
31
+ }>;
21
32
  export declare const resetCustomerTpls: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"tpls/resetCustomerTpls">;
22
33
  export declare const selectCustomerTpls: (state: AppState) => CustomerTplsState;
23
34
  export declare const selectCustomerTplsPoints: ((state: import("redux").EmptyObject & {
@@ -11,6 +11,7 @@ const initialState = {
11
11
  export var CustomerTplsActionType;
12
12
  (function (CustomerTplsActionType) {
13
13
  CustomerTplsActionType["FetchCustomerTpls"] = "customer/fetchCustomerTpls";
14
+ CustomerTplsActionType["VerifyCustomerTpls"] = "customer/verifyCustomerTpls";
14
15
  })(CustomerTplsActionType || (CustomerTplsActionType = {}));
15
16
  export const fetchCustomerTpls = createAsyncThunk(CustomerTplsActionType.FetchCustomerTpls, (_, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
16
17
  try {
@@ -26,6 +27,15 @@ export const fetchCustomerTpls = createAsyncThunk(CustomerTplsActionType.FetchCu
26
27
  return checkAuth(error, dispatch, () => rejectWithValue(error));
27
28
  }
28
29
  }));
30
+ export const verifyCustomerTpls = createAsyncThunk(CustomerTplsActionType.FetchCustomerTpls, (_, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
31
+ try {
32
+ const api = getState().config.api;
33
+ return yield api.postCustomerTplsVerify();
34
+ }
35
+ catch (err) {
36
+ return rejectWithValue(err);
37
+ }
38
+ }));
29
39
  const customerTplsSlice = createSlice({
30
40
  name: ReducerType.Tpls,
31
41
  initialState,
@@ -45,6 +55,17 @@ const customerTplsSlice = createSlice({
45
55
  .addCase(fetchCustomerTpls.rejected, (state, action) => {
46
56
  state.error = action.payload;
47
57
  state.loading = 'idle';
58
+ })
59
+ .addCase(verifyCustomerTpls.fulfilled, state => {
60
+ state.loading = 'idle';
61
+ state.error = null;
62
+ })
63
+ .addCase(verifyCustomerTpls.pending, state => {
64
+ state.loading = 'pending';
65
+ })
66
+ .addCase(verifyCustomerTpls.rejected, (state, action) => {
67
+ state.error = action.payload;
68
+ state.loading = 'idle';
48
69
  });
49
70
  }
50
71
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.4.6",
3
+ "version": "0.4.9",
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",