@open-tender/cloud 0.1.18 → 0.1.20

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.
@@ -82,7 +82,6 @@ export declare const sendCustomerVerificationEmail: import("@reduxjs/toolkit").A
82
82
  }>;
83
83
  export declare const loginCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<null, {
84
84
  email: string;
85
- origin: any;
86
85
  }, {
87
86
  state: AppState;
88
87
  rejectValue: RequestError;
@@ -77,12 +77,10 @@ exports.fetchCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.FetchC
77
77
  return (0, exports.checkAuth)(error, dispatch, () => rejectWithValue(error));
78
78
  }
79
79
  }));
80
- exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, (data, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
80
+ exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, ({ email, password }, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
81
81
  try {
82
- const { email, password } = data;
83
82
  const api = getState().config.api;
84
- const auth = yield api.postLogin(email, password);
85
- return auth;
83
+ return yield api.postLogin(email, password);
86
84
  }
87
85
  catch (err) {
88
86
  return rejectWithValue(err);
@@ -173,10 +171,10 @@ exports.sendCustomerVerificationEmail = (0, toolkit_1.createAsyncThunk)(AccountA
173
171
  return rejectWithValue(err);
174
172
  }
175
173
  }));
176
- exports.loginCustomerThanx = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, (requestData, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
174
+ exports.loginCustomerThanx = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, ({ email }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
177
175
  try {
178
176
  const api = getState().config.api;
179
- yield api.postThanxLogin(requestData.email, requestData.origin);
177
+ yield api.postThanxLogin(email);
180
178
  dispatch((0, order_2.setAlert)({ type: 'close' }));
181
179
  dispatch((0, order_2.addMessage)('Thanks! Please check your email on this device.'));
182
180
  return null;
@@ -1,7 +1,7 @@
1
1
  import { AppState } from '../app';
2
2
  import { OrderFulfillment, RequestError, RequestStatus } from '@open-tender/types';
3
3
  export interface OrderFulfillmentState {
4
- orderFulfillment: Partial<OrderFulfillment> | null;
4
+ orderFulfillment: OrderFulfillment | null;
5
5
  error: RequestError;
6
6
  loading: RequestStatus;
7
7
  }
@@ -19,9 +19,9 @@ export declare const fetchOrderFulfillment: import("@reduxjs/toolkit").AsyncThun
19
19
  fulfilledMeta?: unknown;
20
20
  rejectedMeta?: unknown;
21
21
  }>;
22
- export declare const updateOrderFulfillment: import("@reduxjs/toolkit").AsyncThunk<Partial<OrderFulfillment>, {
22
+ export declare const updateOrderFulfillment: import("@reduxjs/toolkit").AsyncThunk<OrderFulfillment, {
23
23
  orderId: number;
24
- data: Partial<OrderFulfillment>;
24
+ data: OrderFulfillment;
25
25
  }, {
26
26
  state: AppState;
27
27
  rejectValue: RequestError;
@@ -34,7 +34,7 @@ export declare const updateOrderFulfillment: import("@reduxjs/toolkit").AsyncThu
34
34
  }>;
35
35
  export declare const resetOrderFulfillment: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"orderFulfillment/resetOrderFulfillment">;
36
36
  export declare const selectOrderFulfillment: (state: AppState) => {
37
- orderFulfillment: Partial<OrderFulfillment> | null;
37
+ orderFulfillment: OrderFulfillment | null;
38
38
  loading: RequestStatus;
39
39
  error: RequestError;
40
40
  };
@@ -26,13 +26,12 @@ exports.fetchOrderFulfillment = (0, toolkit_1.createAsyncThunk)(OrderFulfillment
26
26
  return rejectWithValue(err);
27
27
  }
28
28
  }));
29
- exports.updateOrderFulfillment = (0, toolkit_1.createAsyncThunk)(OrderFulfillmentActionType.UpdateOrderFulfillment, (requestData, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
29
+ exports.updateOrderFulfillment = (0, toolkit_1.createAsyncThunk)(OrderFulfillmentActionType.UpdateOrderFulfillment, ({ orderId, data }, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
30
30
  const { api } = getState().config;
31
31
  if (!api)
32
32
  return;
33
33
  try {
34
- const response = yield api.putOrderFulfillment(requestData.orderId, requestData.data);
35
- return response;
34
+ return yield api.putOrderFulfillment(orderId, data);
36
35
  }
37
36
  catch (err) {
38
37
  return rejectWithValue(err);
@@ -82,7 +82,6 @@ export declare const sendCustomerVerificationEmail: import("@reduxjs/toolkit").A
82
82
  }>;
83
83
  export declare const loginCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<null, {
84
84
  email: string;
85
- origin: any;
86
85
  }, {
87
86
  state: AppState;
88
87
  rejectValue: RequestError;
@@ -72,12 +72,10 @@ export const fetchCustomer = createAsyncThunk(AccountActionType.FetchCustomer,
72
72
  return checkAuth(error, dispatch, () => rejectWithValue(error));
73
73
  }
74
74
  }));
75
- export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (data, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
75
+ export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, ({ email, password }, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
76
76
  try {
77
- const { email, password } = data;
78
77
  const api = getState().config.api;
79
- const auth = yield api.postLogin(email, password);
80
- return auth;
78
+ return yield api.postLogin(email, password);
81
79
  }
82
80
  catch (err) {
83
81
  return rejectWithValue(err);
@@ -168,10 +166,10 @@ export const sendCustomerVerificationEmail = createAsyncThunk(AccountActionType.
168
166
  return rejectWithValue(err);
169
167
  }
170
168
  }));
171
- export const loginCustomerThanx = createAsyncThunk(AccountActionType.LoginCustomer, (requestData, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
169
+ export const loginCustomerThanx = createAsyncThunk(AccountActionType.LoginCustomer, ({ email }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
172
170
  try {
173
171
  const api = getState().config.api;
174
- yield api.postThanxLogin(requestData.email, requestData.origin);
172
+ yield api.postThanxLogin(email);
175
173
  dispatch(setAlert({ type: 'close' }));
176
174
  dispatch(addMessage('Thanks! Please check your email on this device.'));
177
175
  return null;
@@ -1,7 +1,7 @@
1
1
  import { AppState } from '../app';
2
2
  import { OrderFulfillment, RequestError, RequestStatus } from '@open-tender/types';
3
3
  export interface OrderFulfillmentState {
4
- orderFulfillment: Partial<OrderFulfillment> | null;
4
+ orderFulfillment: OrderFulfillment | null;
5
5
  error: RequestError;
6
6
  loading: RequestStatus;
7
7
  }
@@ -19,9 +19,9 @@ export declare const fetchOrderFulfillment: import("@reduxjs/toolkit").AsyncThun
19
19
  fulfilledMeta?: unknown;
20
20
  rejectedMeta?: unknown;
21
21
  }>;
22
- export declare const updateOrderFulfillment: import("@reduxjs/toolkit").AsyncThunk<Partial<OrderFulfillment>, {
22
+ export declare const updateOrderFulfillment: import("@reduxjs/toolkit").AsyncThunk<OrderFulfillment, {
23
23
  orderId: number;
24
- data: Partial<OrderFulfillment>;
24
+ data: OrderFulfillment;
25
25
  }, {
26
26
  state: AppState;
27
27
  rejectValue: RequestError;
@@ -34,7 +34,7 @@ export declare const updateOrderFulfillment: import("@reduxjs/toolkit").AsyncThu
34
34
  }>;
35
35
  export declare const resetOrderFulfillment: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"orderFulfillment/resetOrderFulfillment">;
36
36
  export declare const selectOrderFulfillment: (state: AppState) => {
37
- orderFulfillment: Partial<OrderFulfillment> | null;
37
+ orderFulfillment: OrderFulfillment | null;
38
38
  loading: RequestStatus;
39
39
  error: RequestError;
40
40
  };
@@ -23,13 +23,12 @@ export const fetchOrderFulfillment = createAsyncThunk(OrderFulfillmentActionType
23
23
  return rejectWithValue(err);
24
24
  }
25
25
  }));
26
- export const updateOrderFulfillment = createAsyncThunk(OrderFulfillmentActionType.UpdateOrderFulfillment, (requestData, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
26
+ export const updateOrderFulfillment = createAsyncThunk(OrderFulfillmentActionType.UpdateOrderFulfillment, ({ orderId, data }, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
27
27
  const { api } = getState().config;
28
28
  if (!api)
29
29
  return;
30
30
  try {
31
- const response = yield api.putOrderFulfillment(requestData.orderId, requestData.data);
32
- return response;
31
+ return yield api.putOrderFulfillment(orderId, data);
33
32
  }
34
33
  catch (err) {
35
34
  return rejectWithValue(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
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",