@longvansoftware/storefront-js-client 3.0.6 → 3.0.8
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/src/graphql/auth/mutations.d.ts +1 -0
- package/dist/src/graphql/auth/mutations.js +13 -26
- package/dist/src/graphql/auth/queries.d.ts +0 -1
- package/dist/src/graphql/auth/queries.js +1 -6
- package/dist/src/lib/auth/index.d.ts +8 -37
- package/dist/src/lib/auth/index.js +6 -69
- package/dist/src/lib/order/index.d.ts +2 -0
- package/dist/src/lib/order/index.js +37 -0
- package/dist/src/types/auth.d.ts +0 -123
- package/package.json +1 -1
|
@@ -13,3 +13,4 @@ export declare const ADD_ROLE_USER_MUTATION: import("graphql").DocumentNode;
|
|
|
13
13
|
export declare const CREATE_USER_LOGIN_MUTATION: import("graphql").DocumentNode;
|
|
14
14
|
export declare const SEND_OTP_MUTATION: import("graphql").DocumentNode;
|
|
15
15
|
export declare const VALIDATE_OTP_MUTATION: import("graphql").DocumentNode;
|
|
16
|
+
export declare const GET_ACCESS_TOKEN_BY_OTP_MUTATION: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VALIDATE_OTP_MUTATION = exports.SEND_OTP_MUTATION = exports.CREATE_USER_LOGIN_MUTATION = exports.ADD_ROLE_USER_MUTATION = exports.CREATE_ORG_MUTATION = exports.CREATE_USER_DETAIL_MUTATION = exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = exports.UPDATE_PROFILE_MUTATION = exports.UPDATE_PASSWORD_MUTATION = exports.UPDATE_INFO_MUTATION = exports.RESET_PASSWORD_MUTATION = exports.VERIFY_CODE_MUTATION = exports.SEND_SMS_VERIFY_CODE_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = void 0;
|
|
3
|
+
exports.GET_ACCESS_TOKEN_BY_OTP_MUTATION = exports.VALIDATE_OTP_MUTATION = exports.SEND_OTP_MUTATION = exports.CREATE_USER_LOGIN_MUTATION = exports.ADD_ROLE_USER_MUTATION = exports.CREATE_ORG_MUTATION = exports.CREATE_USER_DETAIL_MUTATION = exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = exports.UPDATE_PROFILE_MUTATION = exports.UPDATE_PASSWORD_MUTATION = exports.UPDATE_INFO_MUTATION = exports.RESET_PASSWORD_MUTATION = exports.VERIFY_CODE_MUTATION = exports.SEND_SMS_VERIFY_CODE_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.LOGIN_MUTATION = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation Login($loginRequest: LoginRequest!) {
|
|
@@ -67,8 +67,8 @@ exports.RESET_PASSWORD_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
67
67
|
`;
|
|
68
68
|
exports.UPDATE_INFO_MUTATION = (0, graphql_tag_1.gql) `
|
|
69
69
|
mutation UpdateInfo(
|
|
70
|
-
$orgId: String
|
|
71
|
-
$accessToken: String
|
|
70
|
+
$orgId: String
|
|
71
|
+
$accessToken: String
|
|
72
72
|
$updateUserRequest: UpdateUserRequest
|
|
73
73
|
$type: String
|
|
74
74
|
$password: String
|
|
@@ -114,15 +114,15 @@ exports.UPDATE_PROFILE_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
114
114
|
`;
|
|
115
115
|
exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = (0, graphql_tag_1.gql) `
|
|
116
116
|
mutation LinkingUserLoginAndUserDetail(
|
|
117
|
-
$userLoginId: String
|
|
118
|
-
$partyId: String
|
|
117
|
+
$userLoginId: String
|
|
118
|
+
$partyId: String
|
|
119
119
|
) {
|
|
120
120
|
linkingUserLoginAndUserDetail(userLoginId: $userLoginId, partyId: $partyId)
|
|
121
121
|
}
|
|
122
122
|
`;
|
|
123
123
|
exports.CREATE_USER_DETAIL_MUTATION = (0, graphql_tag_1.gql) `
|
|
124
|
-
mutation CreateUserDetail($userLoginId: String!, $
|
|
125
|
-
createUserDetail(userLoginId: $userLoginId,
|
|
124
|
+
mutation CreateUserDetail($userLoginId: String!, $partnerId: String!) {
|
|
125
|
+
createUserDetail(userLoginId: $userLoginId, partnerId: $partnerId) {
|
|
126
126
|
partyId
|
|
127
127
|
orgId
|
|
128
128
|
fullName
|
|
@@ -144,25 +144,7 @@ exports.CREATE_USER_DETAIL_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
144
144
|
`;
|
|
145
145
|
exports.CREATE_ORG_MUTATION = (0, graphql_tag_1.gql) `
|
|
146
146
|
mutation CreateOrg($orgName: String!) {
|
|
147
|
-
createOrg(orgName: $orgName)
|
|
148
|
-
id
|
|
149
|
-
partyId
|
|
150
|
-
codeId
|
|
151
|
-
groupName
|
|
152
|
-
groupType
|
|
153
|
-
shortName
|
|
154
|
-
groupNameLocal
|
|
155
|
-
officeSiteName
|
|
156
|
-
comments
|
|
157
|
-
logoImageUrl
|
|
158
|
-
isIncorporated
|
|
159
|
-
federalTaxId
|
|
160
|
-
description
|
|
161
|
-
deleted
|
|
162
|
-
status
|
|
163
|
-
positionIndexId
|
|
164
|
-
prefix
|
|
165
|
-
}
|
|
147
|
+
createOrg(orgName: $orgName)
|
|
166
148
|
}
|
|
167
149
|
`;
|
|
168
150
|
exports.ADD_ROLE_USER_MUTATION = (0, graphql_tag_1.gql) `
|
|
@@ -207,3 +189,8 @@ exports.VALIDATE_OTP_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
207
189
|
validateOTP(otpCode: $otpCode, phone: $phone, channelType: $channelType)
|
|
208
190
|
}
|
|
209
191
|
`;
|
|
192
|
+
exports.GET_ACCESS_TOKEN_BY_OTP_MUTATION = (0, graphql_tag_1.gql) `
|
|
193
|
+
mutation GetAccessTokenByOTP($otpCode: String!, $phone: String!, $channelType: String) {
|
|
194
|
+
getAccessTokenByOTP(otpCode: $otpCode, phone: $phone, channelType: $channelType)
|
|
195
|
+
}
|
|
196
|
+
`;
|
|
@@ -6,4 +6,3 @@ export declare const LOGIN_GOOGLE: import("graphql").DocumentNode;
|
|
|
6
6
|
export declare const LOGIN_FACEBOOK: import("graphql").DocumentNode;
|
|
7
7
|
export declare const LOGIN_ZALO: import("graphql").DocumentNode;
|
|
8
8
|
export declare const CHECK_USER_LOGIN: import("graphql").DocumentNode;
|
|
9
|
-
export declare const GET_ACCESS_TOKEN_BY_OTP: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CHECK_USER_LOGIN = exports.LOGIN_ZALO = exports.LOGIN_FACEBOOK = exports.LOGIN_GOOGLE = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_USER_DETAIL = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetUserDetail($orgId: String!, $accessToken: String!) {
|
|
@@ -78,8 +78,3 @@ exports.CHECK_USER_LOGIN = (0, graphql_tag_1.gql) `
|
|
|
78
78
|
checkUserLogin(userLoginId: $userLoginId)
|
|
79
79
|
}
|
|
80
80
|
`;
|
|
81
|
-
exports.GET_ACCESS_TOKEN_BY_OTP = (0, graphql_tag_1.gql) `
|
|
82
|
-
query GetAccessTokenByOTP($otpCode: String!, $phone: String!, $channelType: String) {
|
|
83
|
-
getAccessTokenByOTP(otpCode: $otpCode, phone: $phone, channelType: $channelType)
|
|
84
|
-
}
|
|
85
|
-
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Service } from "../serviceSDK";
|
|
2
|
-
import { LoginRequest, LoginResponse, RegisterRequest, SendOTPResponse, ValidateOTPResponse, CreateUserLoginResponse, GetAccessTokenByOTPResponse
|
|
2
|
+
import { LoginRequest, LoginResponse, RegisterRequest, SendOTPResponse, ValidateOTPResponse, CreateUserLoginResponse, GetAccessTokenByOTPResponse } from "../../types/auth";
|
|
3
3
|
/**
|
|
4
4
|
* Represents the authentication service.
|
|
5
5
|
*/
|
|
@@ -35,16 +35,8 @@ export declare class AuthService extends Service {
|
|
|
35
35
|
updateProfile(userLoginId: string, name: string, phone: string, email: string): Promise<any>;
|
|
36
36
|
getUserLoginByUserLoginId(userLoginId: string): Promise<any>;
|
|
37
37
|
checkUsernameExisted(username: string): Promise<any>;
|
|
38
|
-
linkingUserLoginAndUserDetail(userLoginId: string, partyId: string): Promise<any>;
|
|
39
|
-
|
|
40
|
-
* Creates user detail for the specified user login ID.
|
|
41
|
-
* Uses the SDK's configured orgId automatically.
|
|
42
|
-
*
|
|
43
|
-
* @param userLoginId - The user login ID to create detail for.
|
|
44
|
-
* @returns A promise that resolves to the created user detail with full profile information.
|
|
45
|
-
* @throws Will throw an error if the GraphQL mutation fails.
|
|
46
|
-
*/
|
|
47
|
-
createUserDetail(userLoginId: string): Promise<CreateUserDetailResponse>;
|
|
38
|
+
linkingUserLoginAndUserDetail(userLoginId: string | null, partyId: string | null): Promise<any>;
|
|
39
|
+
createUserDetail(userLoginId: string): Promise<any>;
|
|
48
40
|
sendSmsVerifyCode(username: string): Promise<any>;
|
|
49
41
|
verifyCode(username: string, code: string): Promise<any>;
|
|
50
42
|
resetPassword(username: string, newPassword: string, accessToken: string): Promise<any>;
|
|
@@ -62,10 +54,10 @@ export declare class AuthService extends Service {
|
|
|
62
54
|
* Creates a new organization.
|
|
63
55
|
*
|
|
64
56
|
* @param orgName - The name of the organization to create.
|
|
65
|
-
* @returns A promise that resolves to the
|
|
57
|
+
* @returns A promise that resolves to the result of the createOrg mutation.
|
|
66
58
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
67
59
|
*/
|
|
68
|
-
createOrg(orgName: string): Promise<
|
|
60
|
+
createOrg(orgName: string): Promise<any>;
|
|
69
61
|
/**
|
|
70
62
|
* Adds a role to a user in an organization.
|
|
71
63
|
*
|
|
@@ -100,7 +92,7 @@ export declare class AuthService extends Service {
|
|
|
100
92
|
* @returns A promise that resolves to the result of the sendOTP mutation.
|
|
101
93
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
102
94
|
*/
|
|
103
|
-
sendOTP(phone: string, type?:
|
|
95
|
+
sendOTP(phone: string, type?: 'SMS' | 'ZALO'): Promise<SendOTPResponse>;
|
|
104
96
|
/**
|
|
105
97
|
* Validates OTP code for the specified phone number.
|
|
106
98
|
*
|
|
@@ -110,7 +102,7 @@ export declare class AuthService extends Service {
|
|
|
110
102
|
* @returns A promise that resolves to the result of the validateOTP mutation.
|
|
111
103
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
112
104
|
*/
|
|
113
|
-
validateOTP(otpCode: string, phone: string, type?:
|
|
105
|
+
validateOTP(otpCode: string, phone: string, type?: 'SMS' | 'ZALO'): Promise<ValidateOTPResponse>;
|
|
114
106
|
/**
|
|
115
107
|
* Gets access token by validating OTP code for the specified phone number.
|
|
116
108
|
* This function validates the OTP and returns an access token if successful.
|
|
@@ -121,26 +113,5 @@ export declare class AuthService extends Service {
|
|
|
121
113
|
* @returns A promise that resolves to an object containing the access token.
|
|
122
114
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
123
115
|
*/
|
|
124
|
-
getAccessTokenByOTP(otpCode: string, phone: string, type?:
|
|
125
|
-
/**
|
|
126
|
-
* Updates user information.
|
|
127
|
-
* Uses the SDK's configured orgId and access token automatically.
|
|
128
|
-
*
|
|
129
|
-
* @param updateUserRequest - The user information to update.
|
|
130
|
-
* @param type - Optional type parameter.
|
|
131
|
-
* @param password - Optional password for verification.
|
|
132
|
-
* @returns A promise that resolves to the updated user information.
|
|
133
|
-
* @throws Will throw an error if the GraphQL mutation fails.
|
|
134
|
-
*/
|
|
135
|
-
updateInfo(updateUserRequest: UpdateInfoRequest, type?: string, password?: string): Promise<UpdateInfoResponse>;
|
|
136
|
-
/**
|
|
137
|
-
* Creates/updates user password.
|
|
138
|
-
* Uses the SDK's configured orgId and access token automatically.
|
|
139
|
-
* This is a simplified version of updateInfo specifically for password creation.
|
|
140
|
-
*
|
|
141
|
-
* @param password - The new password to set.
|
|
142
|
-
* @returns A promise that resolves to the updated user information.
|
|
143
|
-
* @throws Will throw an error if the GraphQL mutation fails.
|
|
144
|
-
*/
|
|
145
|
-
createPassword(password: string): Promise<UpdateInfoResponse>;
|
|
116
|
+
getAccessTokenByOTP(otpCode: string, phone: string, type?: 'SMS' | 'ZALO'): Promise<GetAccessTokenByOTPResponse>;
|
|
146
117
|
}
|
|
@@ -158,19 +158,11 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
-
/**
|
|
162
|
-
* Creates user detail for the specified user login ID.
|
|
163
|
-
* Uses the SDK's configured orgId automatically.
|
|
164
|
-
*
|
|
165
|
-
* @param userLoginId - The user login ID to create detail for.
|
|
166
|
-
* @returns A promise that resolves to the created user detail with full profile information.
|
|
167
|
-
* @throws Will throw an error if the GraphQL mutation fails.
|
|
168
|
-
*/
|
|
169
161
|
createUserDetail(userLoginId) {
|
|
170
162
|
return __awaiter(this, void 0, void 0, function* () {
|
|
171
163
|
const variables = {
|
|
172
164
|
userLoginId,
|
|
173
|
-
|
|
165
|
+
partnerId: this.orgId,
|
|
174
166
|
};
|
|
175
167
|
try {
|
|
176
168
|
const response = yield this.graphqlMutation(mutations_1.CREATE_USER_DETAIL_MUTATION, variables);
|
|
@@ -314,7 +306,7 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
314
306
|
* Creates a new organization.
|
|
315
307
|
*
|
|
316
308
|
* @param orgName - The name of the organization to create.
|
|
317
|
-
* @returns A promise that resolves to the
|
|
309
|
+
* @returns A promise that resolves to the result of the createOrg mutation.
|
|
318
310
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
319
311
|
*/
|
|
320
312
|
createOrg(orgName) {
|
|
@@ -416,7 +408,7 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
416
408
|
const variables = {
|
|
417
409
|
orgId: this.orgId,
|
|
418
410
|
phone,
|
|
419
|
-
channelType: type ||
|
|
411
|
+
channelType: type || 'SMS', // Default to SMS if not specified
|
|
420
412
|
};
|
|
421
413
|
try {
|
|
422
414
|
const response = yield this.graphqlMutation(mutations_1.SEND_OTP_MUTATION, variables);
|
|
@@ -442,7 +434,7 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
442
434
|
const variables = {
|
|
443
435
|
otpCode,
|
|
444
436
|
phone,
|
|
445
|
-
channelType: type ||
|
|
437
|
+
channelType: type || 'SMS',
|
|
446
438
|
};
|
|
447
439
|
try {
|
|
448
440
|
const response = yield this.graphqlMutation(mutations_1.VALIDATE_OTP_MUTATION, variables);
|
|
@@ -469,10 +461,10 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
469
461
|
const variables = {
|
|
470
462
|
otpCode,
|
|
471
463
|
phone,
|
|
472
|
-
channelType: type ||
|
|
464
|
+
channelType: type || 'SMS',
|
|
473
465
|
};
|
|
474
466
|
try {
|
|
475
|
-
const response = yield this.
|
|
467
|
+
const response = yield this.graphqlMutation(mutations_1.GET_ACCESS_TOKEN_BY_OTP_MUTATION, variables);
|
|
476
468
|
return { accessToken: response.getAccessTokenByOTP };
|
|
477
469
|
}
|
|
478
470
|
catch (error) {
|
|
@@ -481,60 +473,5 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
481
473
|
}
|
|
482
474
|
});
|
|
483
475
|
}
|
|
484
|
-
/**
|
|
485
|
-
* Updates user information.
|
|
486
|
-
* Uses the SDK's configured orgId and access token automatically.
|
|
487
|
-
*
|
|
488
|
-
* @param updateUserRequest - The user information to update.
|
|
489
|
-
* @param type - Optional type parameter.
|
|
490
|
-
* @param password - Optional password for verification.
|
|
491
|
-
* @returns A promise that resolves to the updated user information.
|
|
492
|
-
* @throws Will throw an error if the GraphQL mutation fails.
|
|
493
|
-
*/
|
|
494
|
-
updateInfo(updateUserRequest, type, password) {
|
|
495
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
496
|
-
const variables = {
|
|
497
|
-
orgId: this.orgId,
|
|
498
|
-
accessToken: this.token,
|
|
499
|
-
updateUserRequest,
|
|
500
|
-
type,
|
|
501
|
-
password,
|
|
502
|
-
};
|
|
503
|
-
try {
|
|
504
|
-
const response = yield this.graphqlMutation(mutations_1.UPDATE_INFO_MUTATION, variables);
|
|
505
|
-
return response.updateInfo;
|
|
506
|
-
}
|
|
507
|
-
catch (error) {
|
|
508
|
-
console.log(`Error in updateInfo: ${error}`);
|
|
509
|
-
throw error;
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
/**
|
|
514
|
-
* Creates/updates user password.
|
|
515
|
-
* Uses the SDK's configured orgId and access token automatically.
|
|
516
|
-
* This is a simplified version of updateInfo specifically for password creation.
|
|
517
|
-
*
|
|
518
|
-
* @param password - The new password to set.
|
|
519
|
-
* @returns A promise that resolves to the updated user information.
|
|
520
|
-
* @throws Will throw an error if the GraphQL mutation fails.
|
|
521
|
-
*/
|
|
522
|
-
createPassword(password) {
|
|
523
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
524
|
-
const variables = {
|
|
525
|
-
orgId: this.orgId,
|
|
526
|
-
accessToken: this.token,
|
|
527
|
-
password,
|
|
528
|
-
};
|
|
529
|
-
try {
|
|
530
|
-
const response = yield this.graphqlMutation(mutations_1.UPDATE_INFO_MUTATION, variables);
|
|
531
|
-
return response.updateInfo;
|
|
532
|
-
}
|
|
533
|
-
catch (error) {
|
|
534
|
-
console.log(`Error in createPassword: ${error}`);
|
|
535
|
-
throw error;
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
476
|
}
|
|
540
477
|
exports.AuthService = AuthService;
|
|
@@ -304,6 +304,7 @@ export declare class OrderService extends Service {
|
|
|
304
304
|
* @throws If an error occurs while updating the customer and shipping address.
|
|
305
305
|
*/
|
|
306
306
|
getListSellOrder(requestData: OrderQuery): Promise<any>;
|
|
307
|
+
getListSellOrderV2(requestData: OrderQuery, storeId: string): Promise<any>;
|
|
307
308
|
getListSellOrderAll(requestData: OrderQuery): Promise<any>;
|
|
308
309
|
getDiaries(requestData: OrderQuery): Promise<any>;
|
|
309
310
|
/**
|
|
@@ -320,6 +321,7 @@ export declare class OrderService extends Service {
|
|
|
320
321
|
* @throws If an error occurs while updating the customer and shipping address.
|
|
321
322
|
*/
|
|
322
323
|
getListReturnOrder(requestData: OrderQuery): Promise<any>;
|
|
324
|
+
getListReturnOrderV2(requestData: OrderQuery, storeId: string): Promise<any>;
|
|
323
325
|
/**
|
|
324
326
|
* Get list return order status
|
|
325
327
|
* @returns A promise that resolves when the customer and shipping address are updated.
|
|
@@ -787,6 +787,25 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
787
787
|
}
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
|
+
getListSellOrderV2(requestData, storeId) {
|
|
791
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
792
|
+
// Convert requestData to a format suitable for URLSearchParams
|
|
793
|
+
const params = new URLSearchParams(Object.entries(requestData).reduce((acc, [key, value]) => {
|
|
794
|
+
acc[key] = Array.isArray(value) ? value.join(",") : value.toString();
|
|
795
|
+
return acc;
|
|
796
|
+
}, {})).toString();
|
|
797
|
+
const endpoint = `/orders/${this.orgId}/${storeId}/sell_order?${params}`;
|
|
798
|
+
const method = "GET";
|
|
799
|
+
try {
|
|
800
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
801
|
+
return response;
|
|
802
|
+
}
|
|
803
|
+
catch (error) {
|
|
804
|
+
console.error(`Error in getListSellOrder: ${error}`);
|
|
805
|
+
throw error;
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
}
|
|
790
809
|
// get list all store
|
|
791
810
|
getListSellOrderAll(requestData) {
|
|
792
811
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -870,6 +889,24 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
870
889
|
}
|
|
871
890
|
});
|
|
872
891
|
}
|
|
892
|
+
getListReturnOrderV2(requestData, storeId) {
|
|
893
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
894
|
+
const params = new URLSearchParams(Object.entries(requestData).reduce((acc, [key, value]) => {
|
|
895
|
+
acc[key] = Array.isArray(value) ? value.join(",") : value.toString();
|
|
896
|
+
return acc;
|
|
897
|
+
}, {})).toString();
|
|
898
|
+
const endpoint = `/orders/${this.orgId}/${storeId}/return_order?${params}`;
|
|
899
|
+
const method = "GET";
|
|
900
|
+
try {
|
|
901
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
902
|
+
return response;
|
|
903
|
+
}
|
|
904
|
+
catch (error) {
|
|
905
|
+
console.log(`Error in getListReturnOrder: ${error}`);
|
|
906
|
+
throw error;
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
}
|
|
873
910
|
/**
|
|
874
911
|
* Get list return order status
|
|
875
912
|
* @returns A promise that resolves when the customer and shipping address are updated.
|
package/dist/src/types/auth.d.ts
CHANGED
|
@@ -157,126 +157,3 @@ export interface GetAccessTokenByOTPResponse {
|
|
|
157
157
|
/** The access token string */
|
|
158
158
|
accessToken: string;
|
|
159
159
|
}
|
|
160
|
-
/**
|
|
161
|
-
* Response interface for creating organization
|
|
162
|
-
* Returns the created PartyGroup object
|
|
163
|
-
*/
|
|
164
|
-
export interface CreateOrgResponse {
|
|
165
|
-
/** Organization ID */
|
|
166
|
-
id: string;
|
|
167
|
-
/** Party ID */
|
|
168
|
-
partyId: string;
|
|
169
|
-
/** Code ID */
|
|
170
|
-
codeId: string;
|
|
171
|
-
/** Group name */
|
|
172
|
-
groupName: string;
|
|
173
|
-
/** Group type */
|
|
174
|
-
groupType: string;
|
|
175
|
-
/** Short name */
|
|
176
|
-
shortName: string;
|
|
177
|
-
/** Group name local */
|
|
178
|
-
groupNameLocal: string;
|
|
179
|
-
/** Office site name */
|
|
180
|
-
officeSiteName: string;
|
|
181
|
-
/** Comments */
|
|
182
|
-
comments: string;
|
|
183
|
-
/** Logo image URL */
|
|
184
|
-
logoImageUrl: string;
|
|
185
|
-
/** Is incorporated */
|
|
186
|
-
isIncorporated: boolean;
|
|
187
|
-
/** Federal tax ID */
|
|
188
|
-
federalTaxId: string;
|
|
189
|
-
/** Description */
|
|
190
|
-
description: string;
|
|
191
|
-
/** Deleted flag */
|
|
192
|
-
deleted: boolean;
|
|
193
|
-
/** Status */
|
|
194
|
-
status: string;
|
|
195
|
-
/** Position index ID */
|
|
196
|
-
positionIndexId: string;
|
|
197
|
-
/** Prefix */
|
|
198
|
-
prefix: string;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Response interface for creating user detail
|
|
202
|
-
* Returns the created user detail with full profile information
|
|
203
|
-
*/
|
|
204
|
-
export interface CreateUserDetailResponse {
|
|
205
|
-
/** Party ID */
|
|
206
|
-
partyId: string;
|
|
207
|
-
/** Organization ID */
|
|
208
|
-
orgId: string;
|
|
209
|
-
/** Full name */
|
|
210
|
-
fullName: string;
|
|
211
|
-
/** Email address */
|
|
212
|
-
email: string;
|
|
213
|
-
/** Phone number */
|
|
214
|
-
phone: string;
|
|
215
|
-
/** Address */
|
|
216
|
-
address: string;
|
|
217
|
-
/** Identity number */
|
|
218
|
-
identityNumber: string;
|
|
219
|
-
/** Gender */
|
|
220
|
-
gender: string;
|
|
221
|
-
/** Birth date */
|
|
222
|
-
birthDate: string;
|
|
223
|
-
/** Avatar URL */
|
|
224
|
-
avatarUrl: string;
|
|
225
|
-
/** Access token */
|
|
226
|
-
accessToken: string;
|
|
227
|
-
/** Username */
|
|
228
|
-
username: string;
|
|
229
|
-
/** Ready V2 flag */
|
|
230
|
-
readyV2: boolean;
|
|
231
|
-
/** Organization permissions map */
|
|
232
|
-
orgPermissionsMap: Record<string, any>;
|
|
233
|
-
/** Organization positions map */
|
|
234
|
-
orgPositionsMap: Record<string, any>;
|
|
235
|
-
/** Organization roles map */
|
|
236
|
-
orgRolesMap: Record<string, any>;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Request interface for updating user information
|
|
240
|
-
*/
|
|
241
|
-
export interface UpdateInfoRequest {
|
|
242
|
-
/** Full name */
|
|
243
|
-
fullName?: string;
|
|
244
|
-
/** Email address */
|
|
245
|
-
email?: string;
|
|
246
|
-
/** Phone number */
|
|
247
|
-
phone?: string;
|
|
248
|
-
/** Address */
|
|
249
|
-
address?: string;
|
|
250
|
-
/** Identity number */
|
|
251
|
-
identityNumber?: string;
|
|
252
|
-
/** Gender */
|
|
253
|
-
gender?: string;
|
|
254
|
-
/** Birth date */
|
|
255
|
-
birthDate?: string;
|
|
256
|
-
/** Avatar URL */
|
|
257
|
-
avatarUrl?: string;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Response interface for updating user information
|
|
261
|
-
* Returns the updated user profile with full information
|
|
262
|
-
*/
|
|
263
|
-
export interface UpdateInfoResponse {
|
|
264
|
-
/** Party ID */
|
|
265
|
-
partyId: string;
|
|
266
|
-
/** Full name */
|
|
267
|
-
fullName: string;
|
|
268
|
-
/** Email address */
|
|
269
|
-
email: string;
|
|
270
|
-
/** Phone number */
|
|
271
|
-
phone: string;
|
|
272
|
-
/** Address */
|
|
273
|
-
address: string;
|
|
274
|
-
/** Identity number */
|
|
275
|
-
identityNumber: string;
|
|
276
|
-
/** Gender */
|
|
277
|
-
gender: string;
|
|
278
|
-
/** Birth date */
|
|
279
|
-
birthDate: string;
|
|
280
|
-
/** Avatar URL */
|
|
281
|
-
avatarUrl: string;
|
|
282
|
-
}
|