@longvansoftware/storefront-js-client 3.8.8 → 3.9.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.
@@ -29,6 +29,7 @@ export declare const environmentEndpoints: {
29
29
  cashbook: string;
30
30
  store: string;
31
31
  fileService: string;
32
+ orderCloud: string;
32
33
  };
33
34
  live: {
34
35
  product: string;
@@ -56,5 +57,6 @@ export declare const environmentEndpoints: {
56
57
  cashbook: string;
57
58
  store: string;
58
59
  fileService: string;
60
+ orderCloud: string;
59
61
  };
60
62
  };
@@ -29,9 +29,10 @@ exports.environmentEndpoints = {
29
29
  omnigateway: "https://omni-gateway.dev.longvan.vn/omni-gateway/v1",
30
30
  authorization: "https://id.dev.longvan.vn/authorization/public",
31
31
  zca: "https://zca.dev.longvan.vn",
32
- cashbook: 'https://api-gateway.dev.longvan.vn/cashbook-service/graphql',
32
+ cashbook: "https://api-gateway.dev.longvan.vn/cashbook-service/graphql",
33
33
  store: "https://storefront.dev.longvan.vn/v2",
34
- fileService: "https://fileservice.dev.longvan.vn/omnichannel"
34
+ fileService: "https://fileservice.dev.longvan.vn/omnichannel",
35
+ orderCloud: "https://api-gateway.dev.longvan.vn/order-cloud-service/graphql",
35
36
  },
36
37
  live: {
37
38
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -56,8 +57,9 @@ exports.environmentEndpoints = {
56
57
  omnigateway: "https://omni-gateway.longvan.vn/omni-gateway/v1",
57
58
  authorization: "https://id.longvan.vn/authorization/public",
58
59
  zca: "https://zca.longvan.vn",
59
- cashbook: 'https://api-gateway.longvan.vn/cashbook-service/graphql',
60
+ cashbook: "https://api-gateway.longvan.vn/cashbook-service/graphql",
60
61
  store: "https://storefront.longvan.vn/v2",
61
- fileService: "https://fileservice.longvan.vn/longvan"
62
+ fileService: "https://fileservice.longvan.vn/longvan",
63
+ orderCloud: "https://api-gateway.longvan.vn/order-cloud-service/graphql",
62
64
  },
63
65
  };
@@ -0,0 +1 @@
1
+ export declare const FIND_ORDER_BY_OWNER_PARTYID: import("graphql").DocumentNode;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FIND_ORDER_BY_OWNER_PARTYID = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.FIND_ORDER_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
6
+ mutation FindOrderByOwnerPartyId(
7
+ $partnerId: String!
8
+ $ownerPartyId: String!
9
+ ) {
10
+ findOrderByOwnerPartyId(partnerId: $partnerId, ownerPartyId: $ownerPartyId)
11
+ }
12
+ `;
@@ -0,0 +1 @@
1
+ export declare const FIND_ORDER_BY_OWNER_PARTYID: import("graphql").DocumentNode;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FIND_ORDER_BY_OWNER_PARTYID = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.FIND_ORDER_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
6
+ query FindOrderByOwnerPartyId(
7
+ $partnerId: String!
8
+ $ownerPartyId: String!
9
+ ) {
10
+ findOrderByOwnerPartyId(partnerId: $partnerId, ownerPartyId: $ownerPartyId)
11
+ }
12
+ `;
@@ -23,6 +23,7 @@ import { ZcaService } from "./zca";
23
23
  import { CashbookService } from "./cashbook";
24
24
  import { StoreService } from "./store";
25
25
  import { FileServiceSerVice } from "./fileService";
26
+ import { OrderCloudService } from "./orderCloud";
26
27
  export interface Endpoints {
27
28
  product: string;
28
29
  crm: string;
@@ -49,6 +50,7 @@ export interface Endpoints {
49
50
  cashbook: string;
50
51
  store: string;
51
52
  fileService: string;
53
+ orderCloud: string;
52
54
  }
53
55
  export declare class SDK {
54
56
  orgId: string;
@@ -80,6 +82,7 @@ export declare class SDK {
80
82
  store: StoreService;
81
83
  fileService: FileServiceSerVice;
82
84
  token: string | null;
85
+ orderCloud: OrderCloudService;
83
86
  constructor(orgId: string, storeId: string, environment: "dev" | "live");
84
87
  setToken(token: string): void;
85
88
  setStoreId(storeId: string): void;
@@ -28,6 +28,7 @@ const zca_1 = require("./zca");
28
28
  const cashbook_1 = require("./cashbook");
29
29
  const store_1 = require("./store");
30
30
  const fileService_1 = require("./fileService");
31
+ const orderCloud_1 = require("./orderCloud");
31
32
  class SDK {
32
33
  constructor(orgId, storeId, environment) {
33
34
  this.orgId = orgId;
@@ -60,6 +61,7 @@ class SDK {
60
61
  this.cashbook = new cashbook_1.CashbookService(endpoints.cashbook, orgId, storeId);
61
62
  this.store = new store_1.StoreService(endpoints.store, orgId, storeId); // Using product endpoint for now
62
63
  this.fileService = new fileService_1.FileServiceSerVice(endpoints.fileService, orgId, storeId);
64
+ this.orderCloud = new orderCloud_1.OrderCloudService(endpoints.orderCloud, orgId, storeId);
63
65
  // Initialize other services here
64
66
  }
65
67
  setToken(token) {
@@ -91,6 +93,7 @@ class SDK {
91
93
  this.cashbook.setToken(token);
92
94
  this.store.setToken(token);
93
95
  this.fileService.setToken(token);
96
+ this.orderCloud.setToken(token);
94
97
  }
95
98
  // các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
96
99
  // src/service.ts
@@ -119,6 +122,7 @@ class SDK {
119
122
  this.cashbook.setStoreId(storeId);
120
123
  this.store.setStoreId(storeId);
121
124
  this.fileService.setStoreId(storeId);
125
+ this.orderCloud.setStoreId(storeId);
122
126
  // Set storeId for other services here
123
127
  }
124
128
  setOrgId(orgId) {
@@ -146,6 +150,7 @@ class SDK {
146
150
  this.cashbook.setOrgId(orgId);
147
151
  this.store.setOrgId(orgId);
148
152
  this.fileService.setOrgId(orgId);
153
+ this.orderCloud.setStoreId(orgId);
149
154
  }
150
155
  }
151
156
  exports.SDK = SDK;
@@ -0,0 +1,5 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class OrderCloudService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ findOrderByOwnerPartyId(ownerPartyId: string): Promise<any>;
5
+ }
@@ -0,0 +1,37 @@
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.OrderCloudService = void 0;
13
+ const serviceSDK_1 = require("../serviceSDK");
14
+ const queries_1 = require("../../graphql/orderCloud/queries");
15
+ class OrderCloudService extends serviceSDK_1.Service {
16
+ constructor(endpoint, orgId, storeId) {
17
+ super(endpoint, orgId, storeId);
18
+ }
19
+ //
20
+ findOrderByOwnerPartyId(ownerPartyId) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const query = queries_1.FIND_ORDER_BY_OWNER_PARTYID;
23
+ const variables = {
24
+ partnerId: this.orgId,
25
+ ownerPartyId,
26
+ };
27
+ try {
28
+ const response = yield this.graphqlQuery(query, variables);
29
+ return response.findOrderByOwnerPartyId;
30
+ }
31
+ catch (error) {
32
+ throw error;
33
+ }
34
+ });
35
+ }
36
+ }
37
+ exports.OrderCloudService = OrderCloudService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "3.8.8",
3
+ "version": "3.9.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [