@longvansoftware/storefront-js-client 3.9.8 → 4.0.0
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.
|
@@ -59,18 +59,48 @@ exports.CHECK_USERNAME_EXISTED = (0, graphql_tag_1.gql) `
|
|
|
59
59
|
}
|
|
60
60
|
`;
|
|
61
61
|
exports.LOGIN_GOOGLE = (0, graphql_tag_1.gql) `
|
|
62
|
-
query LoginGoogle(
|
|
63
|
-
|
|
62
|
+
query LoginGoogle(
|
|
63
|
+
$orgId: String!
|
|
64
|
+
$type: String!
|
|
65
|
+
$redirectUrl: String!
|
|
66
|
+
$redirectUrlError: String
|
|
67
|
+
) {
|
|
68
|
+
loginGoogle(
|
|
69
|
+
orgId: $orgId
|
|
70
|
+
type: $type
|
|
71
|
+
redirectUrl: $redirectUrl
|
|
72
|
+
redirectUrlError: $redirectUrlError
|
|
73
|
+
)
|
|
64
74
|
}
|
|
65
75
|
`;
|
|
66
76
|
exports.LOGIN_FACEBOOK = (0, graphql_tag_1.gql) `
|
|
67
|
-
query LoginFacebook(
|
|
68
|
-
|
|
77
|
+
query LoginFacebook(
|
|
78
|
+
$orgId: String!
|
|
79
|
+
$type: String!
|
|
80
|
+
$redirectUrl: String!
|
|
81
|
+
$redirectUrlError: String
|
|
82
|
+
) {
|
|
83
|
+
loginFacebook(
|
|
84
|
+
orgId: $orgId
|
|
85
|
+
type: $type
|
|
86
|
+
redirectUrl: $redirectUrl
|
|
87
|
+
redirectUrlError: $redirectUrlError
|
|
88
|
+
)
|
|
69
89
|
}
|
|
70
90
|
`;
|
|
71
91
|
exports.LOGIN_ZALO = (0, graphql_tag_1.gql) `
|
|
72
|
-
query LoginZalo(
|
|
73
|
-
|
|
92
|
+
query LoginZalo(
|
|
93
|
+
$orgId: String!
|
|
94
|
+
$type: String!
|
|
95
|
+
$redirectUrl: String!
|
|
96
|
+
$redirectUrlError: String
|
|
97
|
+
) {
|
|
98
|
+
loginZalo(
|
|
99
|
+
orgId: $orgId
|
|
100
|
+
type: $type
|
|
101
|
+
redirectUrl: $redirectUrl
|
|
102
|
+
redirectUrlError: $redirectUrlError
|
|
103
|
+
)
|
|
74
104
|
}
|
|
75
105
|
`;
|
|
76
106
|
exports.CHECK_USER_LOGIN = (0, graphql_tag_1.gql) `
|
|
@@ -42,8 +42,8 @@ export declare class AuthService extends Service {
|
|
|
42
42
|
sendSmsVerifyCode(username: string): Promise<any>;
|
|
43
43
|
verifyCode(username: string, code: string): Promise<any>;
|
|
44
44
|
resetPassword(username: string, newPassword: string, accessToken: string): Promise<any>;
|
|
45
|
-
loginGoogle(redirectUrl: string): Promise<any>;
|
|
46
|
-
loginFacebook(redirectUrl: string): Promise<any>;
|
|
45
|
+
loginGoogle(redirectUrl: string, redirectUrlError?: string): Promise<any>;
|
|
46
|
+
loginFacebook(redirectUrl: string, redirectUrlError?: string): Promise<any>;
|
|
47
47
|
/**
|
|
48
48
|
* Logs in a user via Zalo by executing a GraphQL query.
|
|
49
49
|
*
|
|
@@ -51,7 +51,7 @@ export declare class AuthService extends Service {
|
|
|
51
51
|
* @returns A promise that resolves to the result of the `loginZalo` GraphQL query.
|
|
52
52
|
* @throws Will throw an error if the GraphQL query fails.
|
|
53
53
|
*/
|
|
54
|
-
loginZalo(redirectUrl: string): Promise<any>;
|
|
54
|
+
loginZalo(redirectUrl: string, redirectUrlError?: string): Promise<any>;
|
|
55
55
|
/**
|
|
56
56
|
* Creates a new organization.
|
|
57
57
|
*
|
|
@@ -276,13 +276,14 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
loginGoogle(redirectUrl) {
|
|
279
|
+
loginGoogle(redirectUrl, redirectUrlError) {
|
|
280
280
|
return __awaiter(this, void 0, void 0, function* () {
|
|
281
281
|
const query = queries_1.LOGIN_GOOGLE;
|
|
282
282
|
const variables = {
|
|
283
283
|
orgId: this.orgId,
|
|
284
284
|
type: "login",
|
|
285
285
|
redirectUrl,
|
|
286
|
+
redirectUrlError,
|
|
286
287
|
};
|
|
287
288
|
try {
|
|
288
289
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -294,13 +295,14 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
294
295
|
}
|
|
295
296
|
});
|
|
296
297
|
}
|
|
297
|
-
loginFacebook(redirectUrl) {
|
|
298
|
+
loginFacebook(redirectUrl, redirectUrlError) {
|
|
298
299
|
return __awaiter(this, void 0, void 0, function* () {
|
|
299
300
|
const query = queries_1.LOGIN_FACEBOOK;
|
|
300
301
|
const variables = {
|
|
301
302
|
orgId: this.orgId,
|
|
302
303
|
type: "login",
|
|
303
304
|
redirectUrl,
|
|
305
|
+
redirectUrlError,
|
|
304
306
|
};
|
|
305
307
|
try {
|
|
306
308
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -319,13 +321,14 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
319
321
|
* @returns A promise that resolves to the result of the `loginZalo` GraphQL query.
|
|
320
322
|
* @throws Will throw an error if the GraphQL query fails.
|
|
321
323
|
*/
|
|
322
|
-
loginZalo(redirectUrl) {
|
|
324
|
+
loginZalo(redirectUrl, redirectUrlError) {
|
|
323
325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
324
326
|
const query = queries_1.LOGIN_ZALO;
|
|
325
327
|
const variables = {
|
|
326
328
|
orgId: this.orgId,
|
|
327
329
|
type: "login",
|
|
328
330
|
redirectUrl,
|
|
331
|
+
redirectUrlError,
|
|
329
332
|
};
|
|
330
333
|
try {
|
|
331
334
|
const response = yield this.graphqlQuery(query, variables);
|
|
@@ -1714,7 +1714,7 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1714
1714
|
const endpoint = `/front/orders/express/${this.orgId}/${this.storeId}/${orderId}/shipping-address`;
|
|
1715
1715
|
const method = "PUT";
|
|
1716
1716
|
try {
|
|
1717
|
-
const response = yield this.
|
|
1717
|
+
const response = yield this.restApiCallWithToken(endpoint, method, shippingData);
|
|
1718
1718
|
console.log("RESPONSE:", response);
|
|
1719
1719
|
return response;
|
|
1720
1720
|
}
|