@longvansoftware/storefront-js-client 1.6.5 → 1.6.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.
- package/dist/src/graphql/crm/mutations.js +72 -18
- package/dist/src/graphql/crm/queries.js +74 -14
- package/dist/src/graphql/user/queries.d.ts +1 -0
- package/dist/src/graphql/user/queries.js +51 -6
- package/dist/src/lib/crm/index.d.ts +3 -3
- package/dist/src/lib/crm/index.js +4 -4
- package/dist/src/lib/order/index.d.ts +5 -1
- package/dist/src/lib/order/index.js +52 -0
- package/dist/src/lib/user/index.d.ts +1 -0
- package/dist/src/lib/user/index.js +15 -0
- package/dist/src/types/crm.d.ts +15 -2
- package/dist/src/types/order.d.ts +9 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ const graphql_tag_1 = require("graphql-tag");
|
|
|
5
5
|
exports.ADD_OPPORTUNITY_MUTATION = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation AddOpportunity(
|
|
7
7
|
$partyId: String!
|
|
8
|
-
$addOpportunityRequest: AddOpportunityRequest
|
|
8
|
+
$addOpportunityRequest: AddOpportunityRequest
|
|
9
9
|
$performerId: String!
|
|
10
10
|
) {
|
|
11
11
|
addOpportunity(
|
|
@@ -109,13 +109,6 @@ exports.UPDATE_WORK_EFFORT_DESCRIPTION = (0, graphql_tag_1.gql) `
|
|
|
109
109
|
ownerId
|
|
110
110
|
priorityName
|
|
111
111
|
priorityValue
|
|
112
|
-
extSource
|
|
113
|
-
extSourceTopicId
|
|
114
|
-
extSourceSocialAppId
|
|
115
|
-
extSourceSupportChannelType
|
|
116
|
-
extSourceSocialChannelType
|
|
117
|
-
extSourceSocialAppName
|
|
118
|
-
extSourceTopicUrl
|
|
119
112
|
connectorId
|
|
120
113
|
mode
|
|
121
114
|
partyGroupIds
|
|
@@ -161,18 +154,79 @@ exports.UPDATE_WORK_EFFORT_NAME = (0, graphql_tag_1.gql) `
|
|
|
161
154
|
ownerId
|
|
162
155
|
priorityName
|
|
163
156
|
priorityValue
|
|
164
|
-
extSource
|
|
165
|
-
extSourceTopicId
|
|
166
|
-
extSourceSocialAppId
|
|
167
|
-
extSourceSupportChannelType
|
|
168
|
-
extSourceSocialChannelType
|
|
169
|
-
extSourceSocialAppName
|
|
170
|
-
extSourceTopicUrl
|
|
171
157
|
connectorId
|
|
172
158
|
mode
|
|
173
159
|
partyGroupIds
|
|
174
160
|
tagIds
|
|
175
161
|
processResult
|
|
162
|
+
processPipeline {
|
|
163
|
+
id
|
|
164
|
+
name
|
|
165
|
+
}
|
|
166
|
+
attachments {
|
|
167
|
+
id
|
|
168
|
+
createdStamp
|
|
169
|
+
updatedStamp
|
|
170
|
+
updatedBy
|
|
171
|
+
createdBy
|
|
172
|
+
partyId
|
|
173
|
+
path
|
|
174
|
+
srcId
|
|
175
|
+
srcName
|
|
176
|
+
srcPath
|
|
177
|
+
srcConfigPathId
|
|
178
|
+
name
|
|
179
|
+
fileType
|
|
180
|
+
type
|
|
181
|
+
status
|
|
182
|
+
referId
|
|
183
|
+
}
|
|
184
|
+
subTasks {
|
|
185
|
+
id
|
|
186
|
+
createdStamp
|
|
187
|
+
updatedStamp
|
|
188
|
+
createdBy
|
|
189
|
+
updatedBy
|
|
190
|
+
name
|
|
191
|
+
partyId
|
|
192
|
+
targetId
|
|
193
|
+
targetType
|
|
194
|
+
targetUrl
|
|
195
|
+
description
|
|
196
|
+
status
|
|
197
|
+
parentId
|
|
198
|
+
workEffortTypeId
|
|
199
|
+
stmId
|
|
200
|
+
workflowId
|
|
201
|
+
endDateExpect
|
|
202
|
+
endDateActual
|
|
203
|
+
startDateActual
|
|
204
|
+
startDateExpect
|
|
205
|
+
source
|
|
206
|
+
ownerId
|
|
207
|
+
priorityName
|
|
208
|
+
priorityValue
|
|
209
|
+
connectorId
|
|
210
|
+
mode
|
|
211
|
+
partyGroupIds
|
|
212
|
+
tagIds
|
|
213
|
+
processResult
|
|
214
|
+
}
|
|
215
|
+
actionLink {
|
|
216
|
+
name
|
|
217
|
+
uri
|
|
218
|
+
type
|
|
219
|
+
partyId
|
|
220
|
+
fromCollection
|
|
221
|
+
toCollection
|
|
222
|
+
group
|
|
223
|
+
params
|
|
224
|
+
id
|
|
225
|
+
createdStamp
|
|
226
|
+
updatedStamp
|
|
227
|
+
updatedBy
|
|
228
|
+
createdBy
|
|
229
|
+
}
|
|
176
230
|
}
|
|
177
231
|
}
|
|
178
232
|
`;
|
|
@@ -235,13 +289,13 @@ exports.ADD_ATTACHMENT_FOR_WORK_EFFORT = (0, graphql_tag_1.gql) `
|
|
|
235
289
|
$partyId: String!
|
|
236
290
|
$performerId: String!
|
|
237
291
|
$workEffortId: String!
|
|
238
|
-
$
|
|
292
|
+
$addAttachmentRequest: [AddAttachmentRequestFull]
|
|
239
293
|
) {
|
|
240
294
|
addAttachmentForWorkEffort(
|
|
241
295
|
partyId: $partyId
|
|
242
296
|
performerId: $performerId
|
|
243
297
|
workEffortId: $workEffortId
|
|
244
|
-
addAttachmentRequest: $
|
|
298
|
+
addAttachmentRequest: $addAttachmentRequest
|
|
245
299
|
) {
|
|
246
300
|
id
|
|
247
301
|
createdStamp
|
|
@@ -327,7 +381,7 @@ exports.CREATE_WORK_EFFORT = (0, graphql_tag_1.gql) `
|
|
|
327
381
|
createWorkEffort(
|
|
328
382
|
partnerId: $partnerId
|
|
329
383
|
createdBy: $createdBy
|
|
330
|
-
name
|
|
384
|
+
name: $name
|
|
331
385
|
workEffortTypeId: $workEffortTypeId
|
|
332
386
|
source: $source
|
|
333
387
|
attributes: $attributes
|
|
@@ -43,6 +43,10 @@ exports.GET_LIST_OPPORTUNITY_QUERY = (0, graphql_tag_1.gql) `
|
|
|
43
43
|
extSource
|
|
44
44
|
connectorId
|
|
45
45
|
processResult
|
|
46
|
+
processPipeline {
|
|
47
|
+
id
|
|
48
|
+
name
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
}
|
|
@@ -286,6 +290,7 @@ exports.GET_WORK_EFFORTS = (0, graphql_tag_1.gql) `
|
|
|
286
290
|
query GetWorkEfforts(
|
|
287
291
|
$partnerId: String!
|
|
288
292
|
$performerId: String!
|
|
293
|
+
$workEffortTypeId: String
|
|
289
294
|
$source: String!
|
|
290
295
|
$pageNumber: Int!
|
|
291
296
|
$pageSize: Int!
|
|
@@ -294,6 +299,7 @@ exports.GET_WORK_EFFORTS = (0, graphql_tag_1.gql) `
|
|
|
294
299
|
getWorkEfforts(
|
|
295
300
|
partnerId: $partnerId
|
|
296
301
|
performerId: $performerId
|
|
302
|
+
workEffortTypeId: $workEffortTypeId
|
|
297
303
|
source: $source
|
|
298
304
|
pageNumber: $pageNumber
|
|
299
305
|
pageSize: $pageSize
|
|
@@ -325,13 +331,6 @@ exports.GET_WORK_EFFORTS = (0, graphql_tag_1.gql) `
|
|
|
325
331
|
ownerId
|
|
326
332
|
priorityName
|
|
327
333
|
priorityValue
|
|
328
|
-
extSource
|
|
329
|
-
extSourceTopicId
|
|
330
|
-
extSourceSocialAppId
|
|
331
|
-
extSourceSupportChannelType
|
|
332
|
-
extSourceSocialChannelType
|
|
333
|
-
extSourceSocialAppName
|
|
334
|
-
extSourceTopicUrl
|
|
335
334
|
connectorId
|
|
336
335
|
mode
|
|
337
336
|
partyGroupIds
|
|
@@ -368,18 +367,15 @@ exports.GET_WORK_EFFORT_BY_ID = (0, graphql_tag_1.gql) `
|
|
|
368
367
|
ownerId
|
|
369
368
|
priorityName
|
|
370
369
|
priorityValue
|
|
371
|
-
extSource
|
|
372
|
-
extSourceTopicId
|
|
373
|
-
extSourceSocialAppId
|
|
374
|
-
extSourceSupportChannelType
|
|
375
|
-
extSourceSocialChannelType
|
|
376
|
-
extSourceSocialAppName
|
|
377
|
-
extSourceTopicUrl
|
|
378
370
|
connectorId
|
|
379
371
|
mode
|
|
380
372
|
partyGroupIds
|
|
381
373
|
tagIds
|
|
382
374
|
processResult
|
|
375
|
+
processPipeline {
|
|
376
|
+
id
|
|
377
|
+
name
|
|
378
|
+
}
|
|
383
379
|
attachments {
|
|
384
380
|
id
|
|
385
381
|
createdStamp
|
|
@@ -398,6 +394,70 @@ exports.GET_WORK_EFFORT_BY_ID = (0, graphql_tag_1.gql) `
|
|
|
398
394
|
status
|
|
399
395
|
referId
|
|
400
396
|
}
|
|
397
|
+
subTasks {
|
|
398
|
+
id
|
|
399
|
+
createdStamp
|
|
400
|
+
updatedStamp
|
|
401
|
+
createdBy
|
|
402
|
+
updatedBy
|
|
403
|
+
name
|
|
404
|
+
partyId
|
|
405
|
+
targetId
|
|
406
|
+
targetType
|
|
407
|
+
targetUrl
|
|
408
|
+
description
|
|
409
|
+
status
|
|
410
|
+
parentId
|
|
411
|
+
workEffortTypeId
|
|
412
|
+
stmId
|
|
413
|
+
workflowId
|
|
414
|
+
endDateExpect
|
|
415
|
+
endDateActual
|
|
416
|
+
startDateActual
|
|
417
|
+
startDateExpect
|
|
418
|
+
source
|
|
419
|
+
ownerId
|
|
420
|
+
priorityName
|
|
421
|
+
priorityValue
|
|
422
|
+
connectorId
|
|
423
|
+
mode
|
|
424
|
+
partyGroupIds
|
|
425
|
+
tagIds
|
|
426
|
+
processResult
|
|
427
|
+
attachments {
|
|
428
|
+
id
|
|
429
|
+
createdStamp
|
|
430
|
+
updatedStamp
|
|
431
|
+
updatedBy
|
|
432
|
+
createdBy
|
|
433
|
+
partyId
|
|
434
|
+
path
|
|
435
|
+
srcId
|
|
436
|
+
srcName
|
|
437
|
+
srcPath
|
|
438
|
+
srcConfigPathId
|
|
439
|
+
name
|
|
440
|
+
fileType
|
|
441
|
+
type
|
|
442
|
+
status
|
|
443
|
+
referId
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
actionLink {
|
|
447
|
+
name
|
|
448
|
+
uri
|
|
449
|
+
type
|
|
450
|
+
partyId
|
|
451
|
+
fromCollection
|
|
452
|
+
toCollection
|
|
453
|
+
group
|
|
454
|
+
params
|
|
455
|
+
id
|
|
456
|
+
createdStamp
|
|
457
|
+
updatedStamp
|
|
458
|
+
updatedBy
|
|
459
|
+
createdBy
|
|
460
|
+
}
|
|
401
461
|
}
|
|
402
462
|
}
|
|
403
463
|
`;
|
|
@@ -11,3 +11,4 @@ export declare const GET_CONTACT_INFOS_BY_COMPANY_ID: import("graphql").Document
|
|
|
11
11
|
export declare const GET_PROVINCES: import("graphql").DocumentNode;
|
|
12
12
|
export declare const GET_DISTRICTS: import("graphql").DocumentNode;
|
|
13
13
|
export declare const GET_WARDS: import("graphql").DocumentNode;
|
|
14
|
+
export declare const GET_PERSON_BY_PARTY_ID: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
3
|
+
exports.GET_PERSON_BY_PARTY_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetPersonByIds($partyIds: [String!]!) {
|
|
@@ -106,7 +106,11 @@ exports.SEARCH_CUSTOMER = (0, graphql_tag_1.gql) `
|
|
|
106
106
|
}
|
|
107
107
|
`;
|
|
108
108
|
exports.SEARCH_EMPLOYEES = (0, graphql_tag_1.gql) `
|
|
109
|
-
query SearchEmployees(
|
|
109
|
+
query SearchEmployees(
|
|
110
|
+
$keyword: String
|
|
111
|
+
$positionShortName: String
|
|
112
|
+
$partnerId: String
|
|
113
|
+
) {
|
|
110
114
|
searchEmployees(
|
|
111
115
|
keyword: $keyword
|
|
112
116
|
positionShortName: $positionShortName
|
|
@@ -132,13 +136,25 @@ exports.GET_POSTIONS_BY_EMPLOYEES_ID = (0, graphql_tag_1.gql) `
|
|
|
132
136
|
}
|
|
133
137
|
`;
|
|
134
138
|
exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = (0, graphql_tag_1.gql) `
|
|
135
|
-
query GetStoreChannelIdsByEmployeeId(
|
|
136
|
-
|
|
139
|
+
query GetStoreChannelIdsByEmployeeId(
|
|
140
|
+
$employeeId: String!
|
|
141
|
+
$partnerId: String!
|
|
142
|
+
) {
|
|
143
|
+
getStoreChannelIdsByEmployeeId(
|
|
144
|
+
employeeId: $employeeId
|
|
145
|
+
partnerId: $partnerId
|
|
146
|
+
)
|
|
137
147
|
}
|
|
138
148
|
`;
|
|
139
149
|
exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = (0, graphql_tag_1.gql) `
|
|
140
|
-
query GetEmployeesByStoreChannelId(
|
|
141
|
-
|
|
150
|
+
query GetEmployeesByStoreChannelId(
|
|
151
|
+
$storeChannelId: String!
|
|
152
|
+
$partnerId: String!
|
|
153
|
+
) {
|
|
154
|
+
getEmployeesByStoreChannelId(
|
|
155
|
+
storeChannelId: $storeChannelId
|
|
156
|
+
partnerId: $partnerId
|
|
157
|
+
) {
|
|
142
158
|
id
|
|
143
159
|
name
|
|
144
160
|
address
|
|
@@ -250,3 +266,32 @@ exports.GET_WARDS = (0, graphql_tag_1.gql) `
|
|
|
250
266
|
}
|
|
251
267
|
}
|
|
252
268
|
`;
|
|
269
|
+
exports.GET_PERSON_BY_PARTY_ID = (0, graphql_tag_1.gql) `
|
|
270
|
+
query GetPersonByPartyId($partyId: String!) {
|
|
271
|
+
getPersonByPartyId(partyId: $partyId) {
|
|
272
|
+
status
|
|
273
|
+
partyId
|
|
274
|
+
fullName
|
|
275
|
+
phone
|
|
276
|
+
address
|
|
277
|
+
gender
|
|
278
|
+
birthDate
|
|
279
|
+
email
|
|
280
|
+
personalTitle
|
|
281
|
+
imageUrl
|
|
282
|
+
identityNumber
|
|
283
|
+
id
|
|
284
|
+
addressModel {
|
|
285
|
+
id
|
|
286
|
+
addressInfo
|
|
287
|
+
provinceGeoId
|
|
288
|
+
districtGeoId
|
|
289
|
+
wardGeoId
|
|
290
|
+
provinceName
|
|
291
|
+
districtName
|
|
292
|
+
wardName
|
|
293
|
+
isDefault
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AddAttachmentRequest, AddOpportunityRequest, AddTicketRequest, GetCommentRequest, GetOpportunityRequest, getTicketRequest, BaseSort } from "../../types/crm";
|
|
1
|
+
import { AddAttachmentRequest, AddOpportunityRequest, AddTicketRequest, GetCommentRequest, GetOpportunityRequest, getTicketRequest, BaseSort, AddAttachmentRequestFull } from "../../types/crm";
|
|
2
2
|
import { Service } from "../serviceSDK";
|
|
3
3
|
export declare class CrmService extends Service {
|
|
4
4
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
5
5
|
setToken(token: string): void;
|
|
6
|
-
addOpportunity(
|
|
6
|
+
addOpportunity(performerId: string, addOpportunityRequest?: AddOpportunityRequest): Promise<any>;
|
|
7
7
|
getListOpportunity(performerId: string, getOpportunityRequest: GetOpportunityRequest): Promise<any>;
|
|
8
8
|
getListTodo(workEffortId: string[]): Promise<any>;
|
|
9
9
|
getListWorkEffortType(id: string): Promise<any>;
|
|
@@ -11,7 +11,7 @@ export declare class CrmService extends Service {
|
|
|
11
11
|
updateWorkEffortDescription(performerId: string, workEffortId: string, description: string): Promise<any>;
|
|
12
12
|
updateWorkEffortName(performerId: string, workEffortId: string, name: string): Promise<any>;
|
|
13
13
|
updateWorkEffortStatus(performerId: string, workEffortId: string, source: string, status: string): Promise<any>;
|
|
14
|
-
addAttachmentForWorkEffort(performerId: string, workEffortId: string,
|
|
14
|
+
addAttachmentForWorkEffort(performerId: string, workEffortId: string, addAttachmentRequest: AddAttachmentRequestFull): Promise<any>;
|
|
15
15
|
getListTicket(performerId: string, getTicketRequest: getTicketRequest): Promise<any>;
|
|
16
16
|
addTicket(performerId: string, addTicketRequest: AddTicketRequest, addAttachmentRequest: [AddAttachmentRequest]): Promise<any>;
|
|
17
17
|
getTicketById(ticketId: string): Promise<any>;
|
|
@@ -20,13 +20,13 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
20
20
|
setToken(token) {
|
|
21
21
|
this.token = token;
|
|
22
22
|
}
|
|
23
|
-
addOpportunity(
|
|
23
|
+
addOpportunity(performerId, addOpportunityRequest) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
const mutation = mutations_1.ADD_OPPORTUNITY_MUTATION;
|
|
26
26
|
const variables = {
|
|
27
27
|
partyId: this.orgId,
|
|
28
|
-
addOpportunityRequest,
|
|
29
28
|
performerId,
|
|
29
|
+
addOpportunityRequest,
|
|
30
30
|
};
|
|
31
31
|
try {
|
|
32
32
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
@@ -165,14 +165,14 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
addAttachmentForWorkEffort(performerId, workEffortId,
|
|
168
|
+
addAttachmentForWorkEffort(performerId, workEffortId, addAttachmentRequest) {
|
|
169
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
170
|
const mutation = mutations_1.ADD_ATTACHMENT_FOR_WORK_EFFORT;
|
|
171
171
|
const variables = {
|
|
172
172
|
partyId: this.orgId,
|
|
173
173
|
performerId,
|
|
174
174
|
workEffortId,
|
|
175
|
-
|
|
175
|
+
addAttachmentRequest,
|
|
176
176
|
};
|
|
177
177
|
try {
|
|
178
178
|
const response = yield this.graphqlMutationV2(mutation, variables);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LineItem, DiscountCampaign, CancelOrder, MemberDiscount, CampaignPromotion, OrderQuery } from "../../types/order";
|
|
1
|
+
import { LineItem, DiscountCampaign, CancelOrder, MemberDiscount, CampaignPromotion, OrderQuery, ShippingAddress } from "../../types/order";
|
|
2
2
|
import { Service } from "../serviceSDK";
|
|
3
3
|
/**
|
|
4
4
|
* Represents a service for managing orders.
|
|
@@ -450,4 +450,8 @@ export declare class OrderService extends Service {
|
|
|
450
450
|
deleteNoteWithoutLogin(orderId: string, noteId: string, deletedBy: string): Promise<any>;
|
|
451
451
|
updateOrderDescription(orderId: string, description: string): Promise<any>;
|
|
452
452
|
getOrderDetail(orderId: string): Promise<any>;
|
|
453
|
+
createInfoReceiver(ownerId: string, dataRequest: ShippingAddress): Promise<any>;
|
|
454
|
+
getInfoReceiver(ownerId: string): Promise<any>;
|
|
455
|
+
updateInfoReceiver(ownerId: string, receiverId: string, updatedBy: string, dataRequest: ShippingAddress): Promise<any>;
|
|
456
|
+
deleteInfoReceiver(ownerId: string, receiverId: string, deletedBy: string): Promise<any>;
|
|
453
457
|
}
|
|
@@ -1218,5 +1218,57 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1218
1218
|
return this.restApiCallWithToken(`/orders/${this.orgId}/${this.storeId}/${orderId}/sale_order`, "GET");
|
|
1219
1219
|
});
|
|
1220
1220
|
}
|
|
1221
|
+
createInfoReceiver(ownerId, dataRequest) {
|
|
1222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1223
|
+
const endpoint = `/receiver-infos/${this.orgId}/owner/${ownerId}`;
|
|
1224
|
+
const method = "POST";
|
|
1225
|
+
try {
|
|
1226
|
+
const response = yield this.restApiCallWithToken(endpoint, method, dataRequest);
|
|
1227
|
+
return response;
|
|
1228
|
+
}
|
|
1229
|
+
catch (error) {
|
|
1230
|
+
throw error;
|
|
1231
|
+
}
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
getInfoReceiver(ownerId) {
|
|
1235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1236
|
+
const endpoint = `/receiver-infos/${this.orgId}/owner/${ownerId}`;
|
|
1237
|
+
const method = "GET";
|
|
1238
|
+
try {
|
|
1239
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1240
|
+
return response;
|
|
1241
|
+
}
|
|
1242
|
+
catch (error) {
|
|
1243
|
+
throw error;
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
updateInfoReceiver(ownerId, receiverId, updatedBy, dataRequest) {
|
|
1248
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1249
|
+
const endpoint = `/receiver-infos/${this.orgId}/owner/${ownerId}/${receiverId}?updated_by=${updatedBy}`;
|
|
1250
|
+
const method = "PUT";
|
|
1251
|
+
try {
|
|
1252
|
+
const response = yield this.restApiCallWithToken(endpoint, method, dataRequest);
|
|
1253
|
+
return response;
|
|
1254
|
+
}
|
|
1255
|
+
catch (error) {
|
|
1256
|
+
throw error;
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
deleteInfoReceiver(ownerId, receiverId, deletedBy) {
|
|
1261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1262
|
+
const endpoint = `/receiver-infos/${this.orgId}/owner/${ownerId}/${receiverId}?deleted_by=${deletedBy}`;
|
|
1263
|
+
const method = "DELETE";
|
|
1264
|
+
try {
|
|
1265
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1266
|
+
return response;
|
|
1267
|
+
}
|
|
1268
|
+
catch (error) {
|
|
1269
|
+
throw error;
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1221
1273
|
}
|
|
1222
1274
|
exports.OrderService = OrderService;
|
|
@@ -341,5 +341,20 @@ class UserService extends serviceSDK_1.Service {
|
|
|
341
341
|
}
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
|
+
getPersonByPartyId(partyId) {
|
|
345
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
346
|
+
const query = queries_1.GET_PERSON_BY_PARTY_ID;
|
|
347
|
+
const variables = {
|
|
348
|
+
partyId,
|
|
349
|
+
};
|
|
350
|
+
try {
|
|
351
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
352
|
+
return response.getPersonByPartyId;
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
throw error;
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}
|
|
344
359
|
}
|
|
345
360
|
exports.UserService = UserService;
|
package/dist/src/types/crm.d.ts
CHANGED
|
@@ -8,7 +8,19 @@ export interface AddOpportunityRequest {
|
|
|
8
8
|
referEmail: string;
|
|
9
9
|
targetId: string;
|
|
10
10
|
extSource: string;
|
|
11
|
-
ownerId
|
|
11
|
+
ownerId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AddAttachmentRequestFull {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
parentId?: string | null;
|
|
17
|
+
priorityName: string;
|
|
18
|
+
referName: string;
|
|
19
|
+
referPhone: string;
|
|
20
|
+
referEmail: string;
|
|
21
|
+
targetId: string;
|
|
22
|
+
extSource: string;
|
|
23
|
+
ownerId?: string;
|
|
12
24
|
}
|
|
13
25
|
export interface Opportunity {
|
|
14
26
|
goal: string;
|
|
@@ -41,10 +53,11 @@ export interface Opportunity {
|
|
|
41
53
|
processResult?: string | null;
|
|
42
54
|
}
|
|
43
55
|
export interface GetOpportunityRequest {
|
|
44
|
-
id
|
|
56
|
+
id?: string;
|
|
45
57
|
pageSize: number;
|
|
46
58
|
pageNumber: number;
|
|
47
59
|
isPagination: boolean;
|
|
60
|
+
workEffortTypeId: string;
|
|
48
61
|
sort: {
|
|
49
62
|
key: string;
|
|
50
63
|
asc: boolean;
|
|
@@ -52,3 +52,12 @@ export interface OrderQuery {
|
|
|
52
52
|
maxResult?: number;
|
|
53
53
|
source?: string;
|
|
54
54
|
}
|
|
55
|
+
export interface ShippingAddress {
|
|
56
|
+
name: string;
|
|
57
|
+
phone: string;
|
|
58
|
+
address: string;
|
|
59
|
+
province_code: string;
|
|
60
|
+
district_code: string;
|
|
61
|
+
ward_code: string;
|
|
62
|
+
address_default?: boolean;
|
|
63
|
+
}
|