@longvansoftware/storefront-js-client 2.3.5 → 2.3.7
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/config/config.d.ts +2 -0
- package/dist/config/config.js +2 -0
- package/dist/src/graphql/crm/queries.js +1 -0
- package/dist/src/lib/SDK.d.ts +3 -0
- package/dist/src/lib/SDK.js +5 -0
- package/dist/src/lib/crm/index.d.ts +1 -1
- package/dist/src/lib/crm/index.js +2 -2
- package/dist/src/lib/token/index.d.ts +5 -0
- package/dist/src/lib/token/index.js +32 -0
- package/package.json +1 -1
package/dist/config/config.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const environmentEndpoints: {
|
|
|
20
20
|
getImage: string;
|
|
21
21
|
accounting: string;
|
|
22
22
|
omnigateway: string;
|
|
23
|
+
authorization: string;
|
|
23
24
|
};
|
|
24
25
|
live: {
|
|
25
26
|
product: string;
|
|
@@ -42,5 +43,6 @@ export declare const environmentEndpoints: {
|
|
|
42
43
|
getImage: string;
|
|
43
44
|
accounting: string;
|
|
44
45
|
omnigateway: string;
|
|
46
|
+
authorization: string;
|
|
45
47
|
};
|
|
46
48
|
};
|
package/dist/config/config.js
CHANGED
|
@@ -23,6 +23,7 @@ exports.environmentEndpoints = {
|
|
|
23
23
|
getImage: "https://s3-img-gw.longvan.net/img/omnichannel",
|
|
24
24
|
accounting: "https://api-gateway.dev.longvan.vn/accounting-service",
|
|
25
25
|
omnigateway: "https://omni-gateway.dev.longvan.vn/omni-gateway/v1",
|
|
26
|
+
authorization: "https://id.dev.longvan.vn/authorization/public"
|
|
26
27
|
},
|
|
27
28
|
live: {
|
|
28
29
|
product: "https://product-service.longvan.vn/product-service/graphql",
|
|
@@ -45,5 +46,6 @@ exports.environmentEndpoints = {
|
|
|
45
46
|
getImage: "https://s3-img-gw.longvan.net/img/omnichannel",
|
|
46
47
|
accounting: "https://api-gateway.dev.longvan.vn/accounting-service",
|
|
47
48
|
omnigateway: "https://omni-gateway.longvan.vn/omni-gateway/v1",
|
|
49
|
+
authorization: "https://id.longvan.vn/authorization/public"
|
|
48
50
|
},
|
|
49
51
|
};
|
package/dist/src/lib/SDK.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { UploadService } from "./upload";
|
|
|
18
18
|
import { GetImageService } from "./getImage";
|
|
19
19
|
import { AccountingService } from "./accounting";
|
|
20
20
|
import { OmnigatewayService } from './omnigateway';
|
|
21
|
+
import { AuthorizationService } from "./token";
|
|
21
22
|
export interface Endpoints {
|
|
22
23
|
product: string;
|
|
23
24
|
crm: string;
|
|
@@ -39,6 +40,7 @@ export interface Endpoints {
|
|
|
39
40
|
getImage: string;
|
|
40
41
|
accounting: string;
|
|
41
42
|
omnigateway: string;
|
|
43
|
+
authorization: string;
|
|
42
44
|
}
|
|
43
45
|
export declare class SDK {
|
|
44
46
|
orgId: string;
|
|
@@ -64,6 +66,7 @@ export declare class SDK {
|
|
|
64
66
|
getImage: GetImageService;
|
|
65
67
|
accounting: AccountingService;
|
|
66
68
|
omnigateway: OmnigatewayService;
|
|
69
|
+
authorization: AuthorizationService;
|
|
67
70
|
token: string | null;
|
|
68
71
|
constructor(orgId: string, storeId: string, environment: "dev" | "live");
|
|
69
72
|
setToken(token: string): void;
|
package/dist/src/lib/SDK.js
CHANGED
|
@@ -23,6 +23,7 @@ const upload_1 = require("./upload");
|
|
|
23
23
|
const getImage_1 = require("./getImage");
|
|
24
24
|
const accounting_1 = require("./accounting");
|
|
25
25
|
const omnigateway_1 = require("./omnigateway");
|
|
26
|
+
const token_1 = require("./token");
|
|
26
27
|
class SDK {
|
|
27
28
|
constructor(orgId, storeId, environment) {
|
|
28
29
|
this.orgId = orgId;
|
|
@@ -50,6 +51,7 @@ class SDK {
|
|
|
50
51
|
this.getImage = new getImage_1.GetImageService(endpoints.getImage, orgId, storeId);
|
|
51
52
|
this.accounting = new accounting_1.AccountingService(endpoints.accounting, orgId, storeId);
|
|
52
53
|
this.omnigateway = new omnigateway_1.OmnigatewayService(endpoints.omnigateway, orgId, storeId);
|
|
54
|
+
this.authorization = new token_1.AuthorizationService(endpoints.authorization, orgId, storeId);
|
|
53
55
|
// Initialize other services here
|
|
54
56
|
}
|
|
55
57
|
setToken(token) {
|
|
@@ -76,6 +78,7 @@ class SDK {
|
|
|
76
78
|
// Set token for other services here
|
|
77
79
|
this.accounting.setToken(token);
|
|
78
80
|
this.omnigateway.setToken(token);
|
|
81
|
+
this.authorization.setToken(token);
|
|
79
82
|
}
|
|
80
83
|
// các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
|
|
81
84
|
// src/service.ts
|
|
@@ -99,6 +102,7 @@ class SDK {
|
|
|
99
102
|
this.getImage.setStoreId(storeId);
|
|
100
103
|
this.accounting.setStoreId(storeId);
|
|
101
104
|
this.omnigateway.setStoreId(storeId);
|
|
105
|
+
this.auth.setStoreId(storeId);
|
|
102
106
|
// Set storeId for other services here
|
|
103
107
|
}
|
|
104
108
|
setOrgId(orgId) {
|
|
@@ -121,6 +125,7 @@ class SDK {
|
|
|
121
125
|
this.getImage.setOrgId(orgId);
|
|
122
126
|
this.accounting.setOrgId(orgId);
|
|
123
127
|
this.omnigateway.setOrgId(orgId);
|
|
128
|
+
this.auth.setOrgId(orgId);
|
|
124
129
|
}
|
|
125
130
|
}
|
|
126
131
|
exports.SDK = SDK;
|
|
@@ -28,7 +28,7 @@ export declare class CrmService extends Service {
|
|
|
28
28
|
updateConnectorDescription(connectorId: string, description: string, updatedBy: string): Promise<any>;
|
|
29
29
|
getTags(connectorId: string): Promise<any>;
|
|
30
30
|
removeTag(connectorId: string, tagId: string, removedBy: string): Promise<any>;
|
|
31
|
-
searchTopic(
|
|
31
|
+
searchTopic(filterTopicRequest: any, pageSize: number, currentPage: number): Promise<any>;
|
|
32
32
|
closeTopic(id: string, updatedBy: string): Promise<any>;
|
|
33
33
|
createTopic(socialAppId: String, customerId: string, message: string): Promise<any>;
|
|
34
34
|
getTopicByCustomerId(filterTopicRequest: any, pageSize: number, currentPage: number): Promise<any>;
|
|
@@ -473,11 +473,11 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
473
473
|
}
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
|
-
searchTopic(
|
|
476
|
+
searchTopic(filterTopicRequest, pageSize, currentPage) {
|
|
477
477
|
return __awaiter(this, void 0, void 0, function* () {
|
|
478
478
|
const query = queries_1.SEARCH_TOPIC;
|
|
479
479
|
const variables = {
|
|
480
|
-
filterTopicRequest:
|
|
480
|
+
filterTopicRequest: filterTopicRequest,
|
|
481
481
|
partnerId: this.orgId,
|
|
482
482
|
pageSize,
|
|
483
483
|
currentPage,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuthorizationService = void 0;
|
|
13
|
+
const serviceSDK_1 = require("../serviceSDK");
|
|
14
|
+
class AuthorizationService extends serviceSDK_1.Service {
|
|
15
|
+
constructor(endpoint, orgId, storeId) {
|
|
16
|
+
super(endpoint, orgId, storeId);
|
|
17
|
+
}
|
|
18
|
+
checkToken(token) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const endpoint = `/${this.orgId}/oauth2/api/v1/token/${token}`;
|
|
21
|
+
const method = "GET";
|
|
22
|
+
try {
|
|
23
|
+
const response = yield this.restApiCallWithNoHeader(endpoint, method);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.AuthorizationService = AuthorizationService;
|