@open-tender/cloud 0.1.58 → 0.1.59

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/.DS_Store CHANGED
Binary file
@@ -104,8 +104,8 @@ declare class OpenTenderAPI {
104
104
  postSubscriber(email: string): Promise<unknown>;
105
105
  postSignUp(data: CustomerCreate): Promise<Customer | null | undefined>;
106
106
  postLevelUp(data: any): Promise<unknown>;
107
- postThanxLogin(email: string): Promise<unknown>;
108
- postThanxAuth(code: string, path: string): Promise<unknown>;
107
+ postThanxLogin(email: string, origin?: string): Promise<unknown>;
108
+ postThanxAuth(code: string, path: string, origin?: string): Promise<unknown>;
109
109
  postLogin(email: string, password: string): Promise<unknown>;
110
110
  postLogout(token: string): Promise<unknown>;
111
111
  postSendPasswordResetEmail(email: string, link_url: string): Promise<unknown>;
@@ -504,12 +504,14 @@ class OpenTenderAPI {
504
504
  postLevelUp(data) {
505
505
  return this.request(`/levelup`, 'POST', data);
506
506
  }
507
- postThanxLogin(email) {
508
- return this.request('/thanx-login', 'POST', { email });
507
+ postThanxLogin(email, origin) {
508
+ const data = origin ? { email, origin } : { email };
509
+ return this.request('/thanx-login', 'POST', data);
509
510
  }
510
- postThanxAuth(code, path) {
511
+ postThanxAuth(code, path, origin) {
511
512
  const data = path ? { code, path } : { code };
512
- return this.request('/thanx-auth', 'POST', data);
513
+ const withOrigin = origin ? Object.assign(Object.assign({}, data), { origin }) : data;
514
+ return this.request('/thanx-auth', 'POST', withOrigin);
513
515
  }
514
516
  postLogin(email, password) {
515
517
  const data = {
@@ -82,6 +82,7 @@ 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?: string | undefined;
85
86
  }, {
86
87
  state: AppState;
87
88
  rejectValue: RequestError;
@@ -171,10 +171,10 @@ exports.sendCustomerVerificationEmail = (0, toolkit_1.createAsyncThunk)(AccountA
171
171
  return rejectWithValue(err);
172
172
  }
173
173
  }));
174
- exports.loginCustomerThanx = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, ({ email }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
174
+ exports.loginCustomerThanx = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, ({ email, origin }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
175
175
  try {
176
176
  const api = getState().config.api;
177
- yield api.postThanxLogin(email);
177
+ yield api.postThanxLogin(email, origin);
178
178
  dispatch((0, order_2.setAlert)({ type: 'close' }));
179
179
  dispatch((0, order_2.addMessage)('Thanks! Please check your email on this device.'));
180
180
  return null;
@@ -32,6 +32,7 @@ export declare const fetchGuestThanx: import("@reduxjs/toolkit").AsyncThunk<void
32
32
  }, {
33
33
  email: string;
34
34
  callback?: (() => void) | null | undefined;
35
+ origin?: string | undefined;
35
36
  }, {
36
37
  state: AppState;
37
38
  rejectValue: {
@@ -37,7 +37,7 @@ exports.fetchGuestThanx = (0, toolkit_1.createAsyncThunk)(GuestActionType.FetchG
37
37
  if (!api)
38
38
  return;
39
39
  try {
40
- yield api.postThanxLogin(email);
40
+ yield api.postThanxLogin(email, origin);
41
41
  if (callback)
42
42
  callback();
43
43
  return { email: email };
@@ -104,8 +104,8 @@ declare class OpenTenderAPI {
104
104
  postSubscriber(email: string): Promise<unknown>;
105
105
  postSignUp(data: CustomerCreate): Promise<Customer | null | undefined>;
106
106
  postLevelUp(data: any): Promise<unknown>;
107
- postThanxLogin(email: string): Promise<unknown>;
108
- postThanxAuth(code: string, path: string): Promise<unknown>;
107
+ postThanxLogin(email: string, origin?: string): Promise<unknown>;
108
+ postThanxAuth(code: string, path: string, origin?: string): Promise<unknown>;
109
109
  postLogin(email: string, password: string): Promise<unknown>;
110
110
  postLogout(token: string): Promise<unknown>;
111
111
  postSendPasswordResetEmail(email: string, link_url: string): Promise<unknown>;
@@ -502,12 +502,14 @@ class OpenTenderAPI {
502
502
  postLevelUp(data) {
503
503
  return this.request(`/levelup`, 'POST', data);
504
504
  }
505
- postThanxLogin(email) {
506
- return this.request('/thanx-login', 'POST', { email });
505
+ postThanxLogin(email, origin) {
506
+ const data = origin ? { email, origin } : { email };
507
+ return this.request('/thanx-login', 'POST', data);
507
508
  }
508
- postThanxAuth(code, path) {
509
+ postThanxAuth(code, path, origin) {
509
510
  const data = path ? { code, path } : { code };
510
- return this.request('/thanx-auth', 'POST', data);
511
+ const withOrigin = origin ? Object.assign(Object.assign({}, data), { origin }) : data;
512
+ return this.request('/thanx-auth', 'POST', withOrigin);
511
513
  }
512
514
  postLogin(email, password) {
513
515
  const data = {
@@ -82,6 +82,7 @@ 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?: string | undefined;
85
86
  }, {
86
87
  state: AppState;
87
88
  rejectValue: RequestError;
@@ -166,10 +166,10 @@ export const sendCustomerVerificationEmail = createAsyncThunk(AccountActionType.
166
166
  return rejectWithValue(err);
167
167
  }
168
168
  }));
169
- export const loginCustomerThanx = createAsyncThunk(AccountActionType.LoginCustomer, ({ email }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
169
+ export const loginCustomerThanx = createAsyncThunk(AccountActionType.LoginCustomer, ({ email, origin }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
170
170
  try {
171
171
  const api = getState().config.api;
172
- yield api.postThanxLogin(email);
172
+ yield api.postThanxLogin(email, origin);
173
173
  dispatch(setAlert({ type: 'close' }));
174
174
  dispatch(addMessage('Thanks! Please check your email on this device.'));
175
175
  return null;
@@ -32,6 +32,7 @@ export declare const fetchGuestThanx: import("@reduxjs/toolkit").AsyncThunk<void
32
32
  }, {
33
33
  email: string;
34
34
  callback?: (() => void) | null | undefined;
35
+ origin?: string | undefined;
35
36
  }, {
36
37
  state: AppState;
37
38
  rejectValue: {
@@ -33,7 +33,7 @@ export const fetchGuestThanx = createAsyncThunk(GuestActionType.FetchGuestThanx,
33
33
  if (!api)
34
34
  return;
35
35
  try {
36
- yield api.postThanxLogin(email);
36
+ yield api.postThanxLogin(email, origin);
37
37
  if (callback)
38
38
  callback();
39
39
  return { email: email };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
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",