@longvansoftware/storefront-js-client 1.5.4 → 1.5.6

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.
Files changed (38) hide show
  1. package/dist/config/config.d.ts +2 -0
  2. package/dist/config/config.js +9 -7
  3. package/dist/src/graphql/cloud/mutations.d.ts +8 -0
  4. package/dist/src/graphql/cloud/mutations.js +115 -0
  5. package/dist/src/graphql/cloud/queries.d.ts +5 -0
  6. package/dist/src/graphql/cloud/queries.js +121 -0
  7. package/dist/src/graphql/computing/mutations.d.ts +10 -0
  8. package/dist/src/graphql/computing/mutations.js +110 -0
  9. package/dist/src/graphql/computing/queries.d.ts +1 -0
  10. package/dist/src/graphql/computing/queries.js +27 -14
  11. package/dist/src/graphql/crm/mutations.d.ts +2 -0
  12. package/dist/src/graphql/crm/mutations.js +54 -1
  13. package/dist/src/graphql/crm/queries.d.ts +4 -0
  14. package/dist/src/graphql/crm/queries.js +187 -61
  15. package/dist/src/graphql/payment/queries.d.ts +1 -0
  16. package/dist/src/graphql/payment/queries.js +25 -3
  17. package/dist/src/graphql/product/queries.d.ts +2 -0
  18. package/dist/src/graphql/product/queries.js +57 -1
  19. package/dist/src/lib/SDK.d.ts +5 -1
  20. package/dist/src/lib/SDK.js +9 -3
  21. package/dist/src/lib/cloud/index.d.ts +25 -0
  22. package/dist/src/lib/cloud/index.js +248 -0
  23. package/dist/src/lib/computing/index.d.ts +12 -0
  24. package/dist/src/lib/computing/index.js +195 -2
  25. package/dist/src/lib/crm/index.d.ts +8 -2
  26. package/dist/src/lib/crm/index.js +123 -15
  27. package/dist/src/lib/order/index.js +3 -3
  28. package/dist/src/lib/payment/index.d.ts +1 -0
  29. package/dist/src/lib/payment/index.js +16 -0
  30. package/dist/src/lib/product/index.d.ts +2 -0
  31. package/dist/src/lib/product/index.js +33 -0
  32. package/dist/src/lib/serviceSDK.js +7 -0
  33. package/dist/src/types/cloud.d.ts +40 -0
  34. package/dist/src/types/cloud.js +2 -0
  35. package/dist/src/types/computing.d.ts +16 -0
  36. package/dist/src/types/computing.js +2 -0
  37. package/dist/src/types/crm.d.ts +71 -0
  38. package/package.json +1 -1
@@ -29,7 +29,7 @@ class CrmService extends serviceSDK_1.Service {
29
29
  performerId,
30
30
  };
31
31
  try {
32
- const response = yield this.graphqlMutation(mutation, variables);
32
+ const response = yield this.graphqlMutationV2(mutation, variables);
33
33
  return response.addOpportunity;
34
34
  }
35
35
  catch (error) {
@@ -47,7 +47,7 @@ class CrmService extends serviceSDK_1.Service {
47
47
  getOpportunityRequest,
48
48
  };
49
49
  try {
50
- const response = yield this.graphqlQuery(query, variables);
50
+ const response = yield this.graphqlQueryV2(query, variables);
51
51
  return response.getListOpportunity;
52
52
  }
53
53
  catch (error) {
@@ -61,10 +61,10 @@ class CrmService extends serviceSDK_1.Service {
61
61
  const query = queries_1.GET_LIST_TODO;
62
62
  const variables = {
63
63
  partyId: this.orgId,
64
- workEffortId
64
+ workEffortId,
65
65
  };
66
66
  try {
67
- const response = yield this.graphqlQuery(query, variables);
67
+ const response = yield this.graphqlQueryV2(query, variables);
68
68
  return response.getListTodo;
69
69
  }
70
70
  catch (error) {
@@ -78,10 +78,10 @@ class CrmService extends serviceSDK_1.Service {
78
78
  const query = queries_1.GET_LIST_WORK_EFFORT_TYPE;
79
79
  const variables = {
80
80
  partyId: this.orgId,
81
- id
81
+ id,
82
82
  };
83
83
  try {
84
- const response = yield this.graphqlQuery(query, variables);
84
+ const response = yield this.graphqlQueryV2(query, variables);
85
85
  return response.getListWorkEffortType;
86
86
  }
87
87
  catch (error) {
@@ -96,10 +96,10 @@ class CrmService extends serviceSDK_1.Service {
96
96
  const variables = {
97
97
  performerId,
98
98
  attachmentId,
99
- status
99
+ status,
100
100
  };
101
101
  try {
102
- const response = yield this.graphqlMutation(mutation, variables);
102
+ const response = yield this.graphqlMutationV2(mutation, variables);
103
103
  return response.updateStatusAttachmentById;
104
104
  }
105
105
  catch (error) {
@@ -114,10 +114,10 @@ class CrmService extends serviceSDK_1.Service {
114
114
  const variables = {
115
115
  performerId,
116
116
  workEffortId,
117
- description
117
+ description,
118
118
  };
119
119
  try {
120
- const response = yield this.graphqlMutation(mutation, variables);
120
+ const response = yield this.graphqlMutationV2(mutation, variables);
121
121
  return response.updateWorkEffortDescription;
122
122
  }
123
123
  catch (error) {
@@ -133,10 +133,10 @@ class CrmService extends serviceSDK_1.Service {
133
133
  partyId: this.orgId,
134
134
  performerId,
135
135
  workEffortId,
136
- newName: name
136
+ newName: name,
137
137
  };
138
138
  try {
139
- const response = yield this.graphqlMutation(mutation, variables);
139
+ const response = yield this.graphqlMutationV2(mutation, variables);
140
140
  return response.updateWorkEffortName;
141
141
  }
142
142
  catch (error) {
@@ -153,10 +153,10 @@ class CrmService extends serviceSDK_1.Service {
153
153
  performerId,
154
154
  workEffortId,
155
155
  source,
156
- status
156
+ status,
157
157
  };
158
158
  try {
159
- const response = yield this.graphqlMutation(mutation, variables);
159
+ const response = yield this.graphqlMutationV2(mutation, variables);
160
160
  return response.updateWorkEffortStatus;
161
161
  }
162
162
  catch (error) {
@@ -175,7 +175,7 @@ class CrmService extends serviceSDK_1.Service {
175
175
  attachments,
176
176
  };
177
177
  try {
178
- const response = yield this.graphqlMutation(mutation, variables);
178
+ const response = yield this.graphqlMutationV2(mutation, variables);
179
179
  return response.addAttachmentForWorkEffort;
180
180
  }
181
181
  catch (error) {
@@ -184,5 +184,113 @@ class CrmService extends serviceSDK_1.Service {
184
184
  }
185
185
  });
186
186
  }
187
+ getListTicket(performerId, getTicketRequest) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ const query = queries_1.GET_LIST_TICKET;
190
+ const variables = {
191
+ partyId: this.orgId,
192
+ performerId,
193
+ getTicketRequest,
194
+ };
195
+ try {
196
+ const response = yield this.graphqlQueryV2(query, variables);
197
+ return response.getListTicket;
198
+ }
199
+ catch (error) {
200
+ console.log(`Error in getListTicket: ${error}`);
201
+ throw error;
202
+ }
203
+ });
204
+ }
205
+ addTicket(performerId, addTicketRequest, addAttachmentRequest) {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ const mutation = mutations_1.ADD_TICKED;
208
+ const variables = {
209
+ partyId: this.orgId,
210
+ performerId,
211
+ addTicketRequest,
212
+ addAttachmentRequest,
213
+ };
214
+ try {
215
+ const response = yield this.graphqlMutationV2(mutation, variables);
216
+ return response.addTicket;
217
+ }
218
+ catch (error) {
219
+ console.log(`Error in addTicket: ${error}`);
220
+ throw error;
221
+ }
222
+ });
223
+ }
224
+ getTicketById(ticketId) {
225
+ return __awaiter(this, void 0, void 0, function* () {
226
+ const query = queries_1.GET_TICKET_BY_ID;
227
+ const variables = {
228
+ ticketId,
229
+ };
230
+ try {
231
+ const response = yield this.graphqlQueryV2(query, variables);
232
+ return response.getTicketById;
233
+ }
234
+ catch (error) {
235
+ console.log(`Error in getTicketById: ${error}`);
236
+ throw error;
237
+ }
238
+ });
239
+ }
240
+ getAttachmentByWorkEffortId(workEffortIds) {
241
+ return __awaiter(this, void 0, void 0, function* () {
242
+ const query = queries_1.GET_ATTACHMENT_BY_WORK_EFFORT_ID;
243
+ const variables = {
244
+ partyId: this.orgId,
245
+ workEffortIds,
246
+ };
247
+ try {
248
+ const response = yield this.graphqlQueryV2(query, variables);
249
+ return response.getAttachmentByWorkEffortId;
250
+ }
251
+ catch (error) {
252
+ console.log(`Error in getAttachmentByWorkEffortId: ${error}`);
253
+ throw error;
254
+ }
255
+ });
256
+ }
257
+ getListComment(getCommentRequest) {
258
+ return __awaiter(this, void 0, void 0, function* () {
259
+ const query = queries_1.GET_LIST_COMMENT;
260
+ const variables = {
261
+ partyId: this.orgId,
262
+ getCommentRequest,
263
+ };
264
+ try {
265
+ const response = yield this.graphqlQueryV2(query, variables);
266
+ return response.getListComment;
267
+ }
268
+ catch (error) {
269
+ console.log(`Error in getListComment: ${error}`);
270
+ throw error;
271
+ }
272
+ });
273
+ }
274
+ addComment(params) {
275
+ return __awaiter(this, void 0, void 0, function* () {
276
+ const mutation = mutations_1.ADD_COMMENT;
277
+ const variables = {
278
+ partyId: this.orgId,
279
+ performerId: params.performerId,
280
+ format: params.addAttachmentRequest ? "ATTACHMENT" : "TEXT",
281
+ content: params.content,
282
+ referId: params.referId,
283
+ addAttachmentRequest: params.addAttachmentRequest,
284
+ };
285
+ try {
286
+ const response = yield this.graphqlMutationV2(mutation, variables);
287
+ return response.addComment;
288
+ }
289
+ catch (error) {
290
+ console.log(`Error in addComment: ${error}`);
291
+ throw error;
292
+ }
293
+ });
294
+ }
187
295
  }
188
296
  exports.CrmService = CrmService;
@@ -165,7 +165,7 @@ class OrderService extends serviceSDK_1.Service {
165
165
  */
166
166
  updateCustomerAndShippingAddress(orderId, customerId, shippingAddress) {
167
167
  return __awaiter(this, void 0, void 0, function* () {
168
- const endpoint = `/orders/FOX/${orderId}/customer`;
168
+ const endpoint = `/orders/${this.orgId}/${orderId}/customer`;
169
169
  const method = "PUT";
170
170
  const requestData = {
171
171
  customerId: customerId,
@@ -1203,7 +1203,7 @@ class OrderService extends serviceSDK_1.Service {
1203
1203
  const method = "PUT";
1204
1204
  try {
1205
1205
  const response = yield this.restApiCallWithToken(endpoint, method, description, {
1206
- 'Content-Type': 'text/plain'
1206
+ "Content-Type": "text/plain",
1207
1207
  });
1208
1208
  return response;
1209
1209
  }
@@ -1215,7 +1215,7 @@ class OrderService extends serviceSDK_1.Service {
1215
1215
  }
1216
1216
  getOrderDetail(orderId) {
1217
1217
  return __awaiter(this, void 0, void 0, function* () {
1218
- return this.restApiCallWithToken(`/orders/${this.orgId}/${this.storeId}/${orderId}/sale_order`, 'GET');
1218
+ return this.restApiCallWithToken(`/orders/${this.orgId}/${this.storeId}/${orderId}/sale_order`, "GET");
1219
1219
  });
1220
1220
  }
1221
1221
  }
@@ -4,4 +4,5 @@ export declare class PaymentService extends Service {
4
4
  getPaymentMethod(): Promise<any>;
5
5
  createPaymentOrder(paymentOrderData: any): Promise<any>;
6
6
  genQRPayment(orderId: any, totalAmount: any): Promise<any>;
7
+ getPaymentMethodOfStoreChannel(): Promise<any>;
7
8
  }
@@ -65,5 +65,21 @@ class PaymentService extends serviceSDK_1.Service {
65
65
  }
66
66
  });
67
67
  }
68
+ getPaymentMethodOfStoreChannel() {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const query = queries_1.GET_PAYMENT_METHOD_OF_STORE_CHANNEL;
71
+ const variables = {
72
+ orgId: this.orgId,
73
+ storeChannelId: this.storeId,
74
+ };
75
+ try {
76
+ const response = yield this.graphqlQuery(query, variables);
77
+ return response.getPaymentMethodOfStoreChannel;
78
+ }
79
+ catch (error) {
80
+ throw error;
81
+ }
82
+ });
83
+ }
68
84
  }
69
85
  exports.PaymentService = PaymentService;
@@ -34,4 +34,6 @@ export declare class ProductService extends Service {
34
34
  getSimpleProducts(variables: any): Promise<Product[] | null>;
35
35
  getProductOption(productId: string): Promise<any>;
36
36
  getPolicy(groupId: string): Promise<any>;
37
+ getStores(): Promise<any>;
38
+ getDetailStores(): Promise<any>;
37
39
  }
@@ -128,5 +128,38 @@ class ProductService extends serviceSDK_1.Service {
128
128
  }
129
129
  });
130
130
  }
131
+ // ...
132
+ getStores() {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ const query = queries_1.GET_STORES;
135
+ const variablesHandle = {
136
+ partnerId: this.orgId,
137
+ };
138
+ try {
139
+ const response = yield this.graphqlQuery(query, variablesHandle);
140
+ return response.getStores;
141
+ }
142
+ catch (error) {
143
+ console.log("error in getStores");
144
+ throw error;
145
+ }
146
+ });
147
+ }
148
+ getDetailStores() {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ const query = queries_1.GET_DETAIL_STORES;
151
+ const variablesHandle = {
152
+ partnerId: this.orgId,
153
+ storeId: this.storeId,
154
+ };
155
+ try {
156
+ const response = yield this.graphqlQuery(query, variablesHandle);
157
+ return response.getDetailStores;
158
+ }
159
+ catch (error) {
160
+ throw error;
161
+ }
162
+ });
163
+ }
131
164
  }
132
165
  exports.ProductService = ProductService;
@@ -75,6 +75,13 @@ class Service {
75
75
  ${mutation}
76
76
  `,
77
77
  variables,
78
+ context: {
79
+ method: "POST",
80
+ headers: {
81
+ "Content-Type": "application/json",
82
+ partnerId: this.orgId,
83
+ },
84
+ },
78
85
  });
79
86
  if (errors) {
80
87
  throw new Error(`GraphQL error! errors: ${errors}`);
@@ -0,0 +1,40 @@
1
+ export interface CreateUserMailHosting {
2
+ serviceId: string;
3
+ username: string;
4
+ password: string;
5
+ fullName: string;
6
+ }
7
+ export interface UpdateUserPassword {
8
+ serviceId: string;
9
+ username: string;
10
+ password: string;
11
+ }
12
+ export interface DeleteUserPassword {
13
+ serviceId: string;
14
+ username: string;
15
+ }
16
+ export interface UpdateInforMationService {
17
+ serviceId: string;
18
+ useUpdate: string;
19
+ valueUpdate: string;
20
+ }
21
+ export interface Filter {
22
+ serviceId: string;
23
+ type: string;
24
+ status: ServiceStatus;
25
+ salePartyId: string;
26
+ offset: number;
27
+ maxResult: number;
28
+ ownerId: string;
29
+ commonSearch: string;
30
+ }
31
+ export interface ServiceStatus {
32
+ CREATED: "CREATED";
33
+ UPGRADED: "UPGRADED";
34
+ PROCESSING: "PROCESSING";
35
+ COMPLETED: "COMPLETED";
36
+ ERROR: "ERROR";
37
+ SUSPEND: "SUSPEND";
38
+ CANCELLED: "CANCELLED";
39
+ CLOSED: "CLOSED";
40
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ export interface UpdateDescriptionPortNat {
2
+ portNatId: string;
3
+ description: string;
4
+ }
5
+ export interface CreatePortNat {
6
+ portNatId: string;
7
+ translatedPort: string;
8
+ }
9
+ export interface CreateSnapShot {
10
+ computingId: string;
11
+ snapshotName: string;
12
+ }
13
+ export interface RollBackSnapShot {
14
+ computingId: string;
15
+ snapshotId: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -218,3 +218,74 @@ export interface updateWorkEffortDescription {
218
218
  tagIds: [string];
219
219
  processResult: number;
220
220
  }
221
+ export interface getTicketRequest {
222
+ estimateTime: string;
223
+ keyword: string;
224
+ id: string;
225
+ ids: [string];
226
+ ignoreIds: string;
227
+ partyGroupId: string;
228
+ name: string;
229
+ workEffortTypeId: string;
230
+ createdBy: string;
231
+ partyId: string;
232
+ accountableId: string;
233
+ parentId: string;
234
+ status: number;
235
+ statuses: [number];
236
+ processResult: number;
237
+ ownerId: string;
238
+ priorityName: Priority;
239
+ targetId: string;
240
+ targetType: string;
241
+ fromDate: Date;
242
+ toDate: Date;
243
+ isPagination: boolean;
244
+ sort: sort;
245
+ pageNumber: number;
246
+ pageSize: number;
247
+ extSource: string;
248
+ connectorId: string;
249
+ }
250
+ export interface sort {
251
+ key: string;
252
+ asc: boolean;
253
+ }
254
+ export interface Priority {
255
+ HIGH: "HIGH";
256
+ MEDIUM: "MEDIUM";
257
+ LOW: "LOW";
258
+ }
259
+ export interface AddTicketRequest {
260
+ name: string;
261
+ description: string;
262
+ workEffortTypeId: string;
263
+ workEffortTypeAction: string;
264
+ ownerId: string;
265
+ parentId: string;
266
+ priorityName: Priority;
267
+ accountableId: string;
268
+ targetId: string;
269
+ targetType: string;
270
+ targetUrl: string;
271
+ extSource: string;
272
+ connectorId: string;
273
+ startDateExpect: string;
274
+ }
275
+ export interface AddAttachmentRequest {
276
+ srcId: string;
277
+ srcName: string;
278
+ srcPath: string;
279
+ srcConfigPathId: string;
280
+ name: string;
281
+ type: string;
282
+ fileType: string;
283
+ }
284
+ export interface GetCommentRequest {
285
+ referId: string;
286
+ type: CommentType;
287
+ }
288
+ export interface CommentType {
289
+ GLOBAL: "GLOBAL";
290
+ INTERNAL: "INTERNAL";
291
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [