@open-tender/cloud 0.5.12 → 0.5.13
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 +2 -2
- package/dist/cjs/services/api.js +7 -4
- package/dist/cjs/slices/customer/account.d.ts +1 -0
- package/dist/cjs/slices/customer/account.js +4 -4
- package/dist/esm/services/api.d.ts +2 -2
- package/dist/esm/services/api.js +7 -4
- package/dist/esm/slices/customer/account.d.ts +1 -0
- package/dist/esm/slices/customer/account.js +4 -4
- package/package.json +2 -2
|
@@ -107,9 +107,9 @@ declare class OpenTenderAPI {
|
|
|
107
107
|
postUnsubscribeByKey(key: string): Promise<unknown>;
|
|
108
108
|
postSignUp(data: CustomerCreate): Promise<Customer | null | undefined>;
|
|
109
109
|
postCustomerSignIn(data: CustomerSignIn): Promise<void | Auth | null | undefined>;
|
|
110
|
-
postThanxLogin(email: string, origin?: string): Promise<unknown>;
|
|
110
|
+
postThanxLogin(email: string, origin?: string, recaptcha_token?: string): Promise<unknown>;
|
|
111
111
|
postThanxAuth(code: string, path: string, origin?: string): Promise<unknown>;
|
|
112
|
-
postLogin(email: string, password: string): Promise<unknown>;
|
|
112
|
+
postLogin(email: string, password: string, recaptcha_token?: string): Promise<unknown>;
|
|
113
113
|
postLogout(token: string): Promise<unknown>;
|
|
114
114
|
postSendPasswordResetEmail(email: string, link_url: string): Promise<unknown>;
|
|
115
115
|
postResetPassword(new_password: string, token: string): Promise<unknown>;
|
package/dist/cjs/services/api.js
CHANGED
|
@@ -527,8 +527,10 @@ class OpenTenderAPI {
|
|
|
527
527
|
postCustomerSignIn(data) {
|
|
528
528
|
return this.request(`/customer/sign-in`, 'POST', data);
|
|
529
529
|
}
|
|
530
|
-
postThanxLogin(email, origin) {
|
|
531
|
-
const data = origin
|
|
530
|
+
postThanxLogin(email, origin, recaptcha_token) {
|
|
531
|
+
const data = origin
|
|
532
|
+
? { email, origin, recaptcha_token }
|
|
533
|
+
: { email, recaptcha_token };
|
|
532
534
|
return this.request('/thanx-login', 'POST', data);
|
|
533
535
|
}
|
|
534
536
|
postThanxAuth(code, path, origin) {
|
|
@@ -536,11 +538,12 @@ class OpenTenderAPI {
|
|
|
536
538
|
const withOrigin = origin ? Object.assign(Object.assign({}, data), { origin }) : data;
|
|
537
539
|
return this.request('/thanx-auth', 'POST', withOrigin);
|
|
538
540
|
}
|
|
539
|
-
postLogin(email, password) {
|
|
541
|
+
postLogin(email, password, recaptcha_token) {
|
|
540
542
|
const data = {
|
|
541
543
|
grant_type: 'password',
|
|
542
544
|
username: email,
|
|
543
|
-
password: password
|
|
545
|
+
password: password,
|
|
546
|
+
recaptcha_token
|
|
544
547
|
};
|
|
545
548
|
return this.authRequest('/token', data);
|
|
546
549
|
}
|
|
@@ -85,6 +85,7 @@ export declare const sendCustomerVerificationEmail: import("@reduxjs/toolkit").A
|
|
|
85
85
|
export declare const loginCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
86
86
|
email: string;
|
|
87
87
|
origin?: string | undefined;
|
|
88
|
+
recaptcha_token?: string | undefined;
|
|
88
89
|
}, {
|
|
89
90
|
state: AppState;
|
|
90
91
|
rejectValue: RequestError;
|
|
@@ -78,10 +78,10 @@ exports.fetchCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.FetchC
|
|
|
78
78
|
return (0, exports.checkAuth)(error, dispatch, () => rejectWithValue(error));
|
|
79
79
|
}
|
|
80
80
|
}));
|
|
81
|
-
exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, ({ email, password }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
+
exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, ({ email, password, recaptcha_token }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
82
82
|
try {
|
|
83
83
|
const api = getState().config.api;
|
|
84
|
-
const auth = yield api.postLogin(email, password);
|
|
84
|
+
const auth = yield api.postLogin(email, password, recaptcha_token);
|
|
85
85
|
dispatch((0, exports.setCustomerAuth)(auth));
|
|
86
86
|
yield dispatch((0, exports.fetchCustomer)());
|
|
87
87
|
return;
|
|
@@ -175,10 +175,10 @@ exports.sendCustomerVerificationEmail = (0, toolkit_1.createAsyncThunk)(AccountA
|
|
|
175
175
|
return rejectWithValue(err);
|
|
176
176
|
}
|
|
177
177
|
}));
|
|
178
|
-
exports.loginCustomerThanx = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomerThanx, ({ email, origin }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
178
|
+
exports.loginCustomerThanx = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomerThanx, ({ email, origin, recaptcha_token }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
179
179
|
try {
|
|
180
180
|
const api = getState().config.api;
|
|
181
|
-
yield api.postThanxLogin(email, origin);
|
|
181
|
+
yield api.postThanxLogin(email, origin, recaptcha_token);
|
|
182
182
|
dispatch((0, order_2.setAlert)({ type: 'close' }));
|
|
183
183
|
dispatch((0, order_2.addMessage)('Thanks! Please check your email on this device.'));
|
|
184
184
|
return;
|
|
@@ -107,9 +107,9 @@ declare class OpenTenderAPI {
|
|
|
107
107
|
postUnsubscribeByKey(key: string): Promise<unknown>;
|
|
108
108
|
postSignUp(data: CustomerCreate): Promise<Customer | null | undefined>;
|
|
109
109
|
postCustomerSignIn(data: CustomerSignIn): Promise<void | Auth | null | undefined>;
|
|
110
|
-
postThanxLogin(email: string, origin?: string): Promise<unknown>;
|
|
110
|
+
postThanxLogin(email: string, origin?: string, recaptcha_token?: string): Promise<unknown>;
|
|
111
111
|
postThanxAuth(code: string, path: string, origin?: string): Promise<unknown>;
|
|
112
|
-
postLogin(email: string, password: string): Promise<unknown>;
|
|
112
|
+
postLogin(email: string, password: string, recaptcha_token?: string): Promise<unknown>;
|
|
113
113
|
postLogout(token: string): Promise<unknown>;
|
|
114
114
|
postSendPasswordResetEmail(email: string, link_url: string): Promise<unknown>;
|
|
115
115
|
postResetPassword(new_password: string, token: string): Promise<unknown>;
|
package/dist/esm/services/api.js
CHANGED
|
@@ -525,8 +525,10 @@ class OpenTenderAPI {
|
|
|
525
525
|
postCustomerSignIn(data) {
|
|
526
526
|
return this.request(`/customer/sign-in`, 'POST', data);
|
|
527
527
|
}
|
|
528
|
-
postThanxLogin(email, origin) {
|
|
529
|
-
const data = origin
|
|
528
|
+
postThanxLogin(email, origin, recaptcha_token) {
|
|
529
|
+
const data = origin
|
|
530
|
+
? { email, origin, recaptcha_token }
|
|
531
|
+
: { email, recaptcha_token };
|
|
530
532
|
return this.request('/thanx-login', 'POST', data);
|
|
531
533
|
}
|
|
532
534
|
postThanxAuth(code, path, origin) {
|
|
@@ -534,11 +536,12 @@ class OpenTenderAPI {
|
|
|
534
536
|
const withOrigin = origin ? Object.assign(Object.assign({}, data), { origin }) : data;
|
|
535
537
|
return this.request('/thanx-auth', 'POST', withOrigin);
|
|
536
538
|
}
|
|
537
|
-
postLogin(email, password) {
|
|
539
|
+
postLogin(email, password, recaptcha_token) {
|
|
538
540
|
const data = {
|
|
539
541
|
grant_type: 'password',
|
|
540
542
|
username: email,
|
|
541
|
-
password: password
|
|
543
|
+
password: password,
|
|
544
|
+
recaptcha_token
|
|
542
545
|
};
|
|
543
546
|
return this.authRequest('/token', data);
|
|
544
547
|
}
|
|
@@ -85,6 +85,7 @@ export declare const sendCustomerVerificationEmail: import("@reduxjs/toolkit").A
|
|
|
85
85
|
export declare const loginCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<void, {
|
|
86
86
|
email: string;
|
|
87
87
|
origin?: string | undefined;
|
|
88
|
+
recaptcha_token?: string | undefined;
|
|
88
89
|
}, {
|
|
89
90
|
state: AppState;
|
|
90
91
|
rejectValue: RequestError;
|
|
@@ -73,10 +73,10 @@ export const fetchCustomer = createAsyncThunk(AccountActionType.FetchCustomer,
|
|
|
73
73
|
return checkAuth(error, dispatch, () => rejectWithValue(error));
|
|
74
74
|
}
|
|
75
75
|
}));
|
|
76
|
-
export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, ({ email, password }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
|
+
export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, ({ email, password, recaptcha_token }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
77
77
|
try {
|
|
78
78
|
const api = getState().config.api;
|
|
79
|
-
const auth = yield api.postLogin(email, password);
|
|
79
|
+
const auth = yield api.postLogin(email, password, recaptcha_token);
|
|
80
80
|
dispatch(setCustomerAuth(auth));
|
|
81
81
|
yield dispatch(fetchCustomer());
|
|
82
82
|
return;
|
|
@@ -170,10 +170,10 @@ export const sendCustomerVerificationEmail = createAsyncThunk(AccountActionType.
|
|
|
170
170
|
return rejectWithValue(err);
|
|
171
171
|
}
|
|
172
172
|
}));
|
|
173
|
-
export const loginCustomerThanx = createAsyncThunk(AccountActionType.LoginCustomerThanx, ({ email, origin }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
173
|
+
export const loginCustomerThanx = createAsyncThunk(AccountActionType.LoginCustomerThanx, ({ email, origin, recaptcha_token }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
174
174
|
try {
|
|
175
175
|
const api = getState().config.api;
|
|
176
|
-
yield api.postThanxLogin(email, origin);
|
|
176
|
+
yield api.postThanxLogin(email, origin, recaptcha_token);
|
|
177
177
|
dispatch(setAlert({ type: 'close' }));
|
|
178
178
|
dispatch(addMessage('Thanks! Please check your email on this device.'));
|
|
179
179
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"private": false,
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.19.1",
|
|
37
|
-
"@open-tender/types": "^0.4.
|
|
37
|
+
"@open-tender/types": "^0.4.134",
|
|
38
38
|
"@open-tender/utils": "^0.4.99",
|
|
39
39
|
"@reduxjs/toolkit": "^1.8.5",
|
|
40
40
|
"@types/react": "^18.0.18",
|