@longvansoftware/storefront-js-client 1.6.0 → 1.6.2

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.
@@ -318,18 +318,20 @@ exports.CREATE_WORK_EFFORT = (0, graphql_tag_1.gql) `
318
318
  mutation CreateWorkEffort(
319
319
  $partnerId: String!
320
320
  $createdBy: String!
321
- $name: String!
321
+ $name: String
322
322
  $workEffortTypeId: String!
323
323
  $source: String!
324
324
  $attributes: JSON
325
+ $addAttachmentRequest: [AddAttachmentRequest]
325
326
  ) {
326
327
  createWorkEffort(
327
328
  partnerId: $partnerId
328
329
  createdBy: $createdBy
329
- name: $name
330
+ name:$name
330
331
  workEffortTypeId: $workEffortTypeId
331
332
  source: $source
332
333
  attributes: $attributes
334
+ addAttachmentRequest: $addAttachmentRequest
333
335
  ) {
334
336
  workEffortTypeId
335
337
  id
@@ -6,3 +6,4 @@ export declare const GET_TICKET_BY_ID: import("graphql").DocumentNode;
6
6
  export declare const GET_ATTACHMENT_BY_WORK_EFFORT_ID: import("graphql").DocumentNode;
7
7
  export declare const GET_LIST_COMMENT: import("graphql").DocumentNode;
8
8
  export declare const GET_WORK_EFFORTS: import("graphql").DocumentNode;
9
+ export declare const GET_WORK_EFFORT_BY_ID: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_WORK_EFFORTS = exports.GET_LIST_COMMENT = exports.GET_ATTACHMENT_BY_WORK_EFFORT_ID = exports.GET_TICKET_BY_ID = exports.GET_LIST_TICKET = exports.GET_LIST_WORK_EFFORT_TYPE = exports.GET_LIST_TODO = exports.GET_LIST_OPPORTUNITY_QUERY = void 0;
3
+ exports.GET_WORK_EFFORT_BY_ID = exports.GET_WORK_EFFORTS = exports.GET_LIST_COMMENT = exports.GET_ATTACHMENT_BY_WORK_EFFORT_ID = exports.GET_TICKET_BY_ID = exports.GET_LIST_TICKET = exports.GET_LIST_WORK_EFFORT_TYPE = exports.GET_LIST_TODO = exports.GET_LIST_OPPORTUNITY_QUERY = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_LIST_OPPORTUNITY_QUERY = (0, graphql_tag_1.gql) `
6
6
  query GetListOpportunity(
@@ -257,7 +257,10 @@ exports.GET_ATTACHMENT_BY_WORK_EFFORT_ID = (0, graphql_tag_1.gql) `
257
257
  }
258
258
  `;
259
259
  exports.GET_LIST_COMMENT = (0, graphql_tag_1.gql) `
260
- query GetListComment($partyId: String!, $getCommentRequest: GetCommentRequest!) {
260
+ query GetListComment(
261
+ $partyId: String!
262
+ $getCommentRequest: GetCommentRequest!
263
+ ) {
261
264
  getListComment(partyId: $partyId, getCommentRequest: $getCommentRequest) {
262
265
  total
263
266
  data {
@@ -265,7 +268,7 @@ exports.GET_LIST_COMMENT = (0, graphql_tag_1.gql) `
265
268
  createdStamp
266
269
  updatedStamp
267
270
  updatedBy
268
- createdBy{
271
+ createdBy {
269
272
  id
270
273
  fullName
271
274
  }
@@ -284,41 +287,116 @@ exports.GET_WORK_EFFORTS = (0, graphql_tag_1.gql) `
284
287
  $partnerId: String!
285
288
  $performerId: String!
286
289
  $source: String!
287
- $workEffortTypeId: String!
288
- ){
290
+ $pageNumber: Int!
291
+ $pageSize: Int!
292
+ $sorts: [BaseSort]
293
+ ) {
289
294
  getWorkEfforts(
290
- partnerId:$partnerId
291
- performerId:$performerId
292
- source: $source
293
- workEffortTypeId: $workEffortTypeId
294
- ){
295
- total
296
- data{
297
- id
298
- createdStamp
299
- updatedStamp
300
- createdBy
301
- updatedBy
302
- name
303
- partyId
304
- targetId
305
- targetType
306
- targetUrl
307
- description
308
- status
309
- parentId
310
- workEffortTypeId
311
- stmId
312
- workflowId
313
- endDateExpect
314
- endDateActual
315
- startDateActual
316
- startDateExpect
317
- source
318
- ownerId
319
- priorityName
320
- priorityValue
321
- extSource
295
+ partnerId: $partnerId
296
+ performerId: $performerId
297
+ source: $source
298
+ pageNumber: $pageNumber
299
+ pageSize: $pageSize
300
+ sorts: $sorts
301
+ ) {
302
+ total
303
+ data {
304
+ id
305
+ createdStamp
306
+ updatedStamp
307
+ createdBy
308
+ updatedBy
309
+ name
310
+ partyId
311
+ targetId
312
+ targetType
313
+ targetUrl
314
+ description
315
+ status
316
+ parentId
317
+ workEffortTypeId
318
+ stmId
319
+ workflowId
320
+ endDateExpect
321
+ endDateActual
322
+ startDateActual
323
+ startDateExpect
324
+ source
325
+ ownerId
326
+ priorityName
327
+ priorityValue
328
+ extSource
329
+ extSourceTopicId
330
+ extSourceSocialAppId
331
+ extSourceSupportChannelType
332
+ extSourceSocialChannelType
333
+ extSourceSocialAppName
334
+ extSourceTopicUrl
335
+ connectorId
336
+ mode
337
+ partyGroupIds
338
+ tagIds
339
+ processResult
340
+ }
341
+ }
342
+ }
343
+ `;
344
+ exports.GET_WORK_EFFORT_BY_ID = (0, graphql_tag_1.gql) `
345
+ query GetWorkEffortById($id: String!) {
346
+ getWorkEffortById(id: $id) {
347
+ id
348
+ createdStamp
349
+ updatedStamp
350
+ createdBy
351
+ updatedBy
352
+ name
353
+ partyId
354
+ targetId
355
+ targetType
356
+ targetUrl
357
+ description
358
+ status
359
+ parentId
360
+ workEffortTypeId
361
+ stmId
362
+ workflowId
363
+ endDateExpect
364
+ endDateActual
365
+ startDateActual
366
+ startDateExpect
367
+ source
368
+ ownerId
369
+ priorityName
370
+ priorityValue
371
+ extSource
372
+ extSourceTopicId
373
+ extSourceSocialAppId
374
+ extSourceSupportChannelType
375
+ extSourceSocialChannelType
376
+ extSourceSocialAppName
377
+ extSourceTopicUrl
378
+ connectorId
379
+ mode
380
+ partyGroupIds
381
+ tagIds
382
+ processResult
383
+ attachments {
384
+ id
385
+ createdStamp
386
+ updatedStamp
387
+ updatedBy
388
+ createdBy
389
+ partyId
390
+ path
391
+ srcId
392
+ srcName
393
+ srcPath
394
+ srcConfigPathId
395
+ name
396
+ fileType
397
+ type
398
+ status
399
+ referId
322
400
  }
323
401
  }
324
402
  }
@@ -1,4 +1,4 @@
1
- import { AddAttachmentRequest, AddOpportunityRequest, AddTicketRequest, GetCommentRequest, GetOpportunityRequest, getTicketRequest } from "../../types/crm";
1
+ import { AddAttachmentRequest, AddOpportunityRequest, AddTicketRequest, GetCommentRequest, GetOpportunityRequest, getTicketRequest, BaseSort } 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);
@@ -18,6 +18,7 @@ export declare class CrmService extends Service {
18
18
  getAttachmentByWorkEffortId(workEffortIds: [string]): Promise<any>;
19
19
  getListComment(getCommentRequest: GetCommentRequest): Promise<any>;
20
20
  addComment(params: any): Promise<any>;
21
- createWorkEffort(createdBy: string, name: string, workEffortTypeId: string, source: string, attributes: object): Promise<any>;
22
- getWorkEfforts(performerId: string, source: string, workEffortTypeId: string): Promise<any>;
21
+ createWorkEffort(createdBy: string, name: String, workEffortTypeId: string, source: string, attributes: object, addAttachmentRequest: AddAttachmentRequest): Promise<any>;
22
+ getWorkEfforts(performerId: string, source: string, pageNumber: number, pageSize: number, sorts: BaseSort): Promise<any>;
23
+ getWorkEffortById(id: string): Promise<any>;
23
24
  }
@@ -292,7 +292,7 @@ class CrmService extends serviceSDK_1.Service {
292
292
  }
293
293
  });
294
294
  }
295
- createWorkEffort(createdBy, name, workEffortTypeId, source, attributes) {
295
+ createWorkEffort(createdBy, name, workEffortTypeId, source, attributes, addAttachmentRequest) {
296
296
  return __awaiter(this, void 0, void 0, function* () {
297
297
  const query = mutations_1.CREATE_WORK_EFFORT;
298
298
  const variables = {
@@ -302,6 +302,7 @@ class CrmService extends serviceSDK_1.Service {
302
302
  workEffortTypeId,
303
303
  source,
304
304
  attributes,
305
+ addAttachmentRequest,
305
306
  };
306
307
  try {
307
308
  const response = yield this.graphqlMutationV2(query, variables);
@@ -312,14 +313,16 @@ class CrmService extends serviceSDK_1.Service {
312
313
  }
313
314
  });
314
315
  }
315
- getWorkEfforts(performerId, source, workEffortTypeId) {
316
+ getWorkEfforts(performerId, source, pageNumber, pageSize, sorts) {
316
317
  return __awaiter(this, void 0, void 0, function* () {
317
318
  const query = queries_1.GET_WORK_EFFORTS;
318
319
  const variables = {
319
320
  partnerId: this.orgId,
320
321
  performerId,
321
322
  source,
322
- workEffortTypeId,
323
+ pageNumber,
324
+ pageSize,
325
+ sorts,
323
326
  };
324
327
  try {
325
328
  const response = yield this.graphqlQueryV2(query, variables);
@@ -330,5 +333,20 @@ class CrmService extends serviceSDK_1.Service {
330
333
  }
331
334
  });
332
335
  }
336
+ getWorkEffortById(id) {
337
+ return __awaiter(this, void 0, void 0, function* () {
338
+ const query = queries_1.GET_WORK_EFFORT_BY_ID;
339
+ const variables = {
340
+ id,
341
+ };
342
+ try {
343
+ const response = yield this.graphqlMutationV2(query, variables);
344
+ return response.getWorkEffortById;
345
+ }
346
+ catch (error) {
347
+ throw error;
348
+ }
349
+ });
350
+ }
333
351
  }
334
352
  exports.CrmService = CrmService;
@@ -276,10 +276,10 @@ export interface AddAttachmentRequest {
276
276
  srcId: string;
277
277
  srcName: string;
278
278
  srcPath: string;
279
- srcConfigPathId: string;
280
- name: string;
281
- type: string;
282
- fileType: string;
279
+ srcConfigPathId?: string;
280
+ name?: string;
281
+ type?: string;
282
+ fileType?: string;
283
283
  }
284
284
  export interface GetCommentRequest {
285
285
  referId: string;
@@ -289,5 +289,7 @@ export interface CommentType {
289
289
  GLOBAL: "GLOBAL";
290
290
  INTERNAL: "INTERNAL";
291
291
  }
292
- export interface AttachmentStatus {
292
+ export interface BaseSort {
293
+ key: string;
294
+ asc: boolean;
293
295
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [