@longvansoftware/service-js-client 2.2.4 → 2.2.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.
@@ -16,3 +16,4 @@ export declare const GET_COLLEGES_BY_PROVINCE_ID: DocumentNode;
16
16
  export declare const GET_RELATED_RESOURCE_BY_RESOURCE_TYPE: DocumentNode;
17
17
  export declare const GET_RESUME_INFO_BY_CUSTOMER_ID: DocumentNode;
18
18
  export declare const GET_RESUME_INFO_BY_CUSTOMER_ID_DYNAMIC: (fields?: string[]) => DocumentNode;
19
+ export declare const GET_LIST_TICKET_BY_OWNER_DYNAMIC: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_RESUME_INFO_BY_CUSTOMER_ID_DYNAMIC = exports.GET_RESUME_INFO_BY_CUSTOMER_ID = exports.GET_RELATED_RESOURCE_BY_RESOURCE_TYPE = exports.GET_COLLEGES_BY_PROVINCE_ID = exports.GET_RESUME_DOMAIN_BY_SERVICE_ID = exports.GET_REUSME_BY_CUSTOMER_ID = exports.GET_RESUME_CONTACT = exports.GET_RESUME_ID_BY_RESOURCE = exports.GET_LIST_COMMENT = exports.GET_ATTACHMENT_BY_WORK_EFFORT_ID = exports.GET_LIST_TICKET_BY_ID_DYNAMIC = exports.GET_TICKET_BY_ID = exports.GET_LIST_TICKET_DYNAMIC = exports.GET_LIST_TICKET = exports.GET_LIST_WORK_EFFORT_TYPE = exports.GET_LIST_TODO = exports.GET_LIST_OPPORTUNITY_QUERY = void 0;
3
+ exports.GET_LIST_TICKET_BY_OWNER_DYNAMIC = exports.GET_RESUME_INFO_BY_CUSTOMER_ID_DYNAMIC = exports.GET_RESUME_INFO_BY_CUSTOMER_ID = exports.GET_RELATED_RESOURCE_BY_RESOURCE_TYPE = exports.GET_COLLEGES_BY_PROVINCE_ID = exports.GET_RESUME_DOMAIN_BY_SERVICE_ID = exports.GET_REUSME_BY_CUSTOMER_ID = exports.GET_RESUME_CONTACT = exports.GET_RESUME_ID_BY_RESOURCE = exports.GET_LIST_COMMENT = exports.GET_ATTACHMENT_BY_WORK_EFFORT_ID = exports.GET_LIST_TICKET_BY_ID_DYNAMIC = exports.GET_TICKET_BY_ID = exports.GET_LIST_TICKET_DYNAMIC = 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(
@@ -455,3 +455,27 @@ const GET_RESUME_INFO_BY_CUSTOMER_ID_DYNAMIC = (fields = []) => {
455
455
  `;
456
456
  };
457
457
  exports.GET_RESUME_INFO_BY_CUSTOMER_ID_DYNAMIC = GET_RESUME_INFO_BY_CUSTOMER_ID_DYNAMIC;
458
+ const GET_LIST_TICKET_BY_OWNER_DYNAMIC = (fields = []) => {
459
+ const fieldStr = fields.join("\n ");
460
+ const hasFields = fields.length > 0;
461
+ return (0, graphql_tag_1.gql) `
462
+ query getListTicketByOwner(
463
+ $partyId: String!
464
+ $ownerId: String!
465
+ $getTicketRequest: GetTicketRequest!
466
+ ) {
467
+ getListTicketByOwner(
468
+ partyId: $partyId
469
+ ownerId: $ownerId
470
+ getTicketRequest: $getTicketRequest
471
+ )
472
+ {
473
+ total
474
+ data {
475
+ ${hasFields ? `${fieldStr}` : ""}
476
+ }
477
+ }
478
+ }
479
+ `;
480
+ };
481
+ exports.GET_LIST_TICKET_BY_OWNER_DYNAMIC = GET_LIST_TICKET_BY_OWNER_DYNAMIC;
@@ -37,4 +37,5 @@ export declare class CrmService extends Service {
37
37
  getResumeInfoByCustomerIdDynamic(customerId: string, fields: string[]): Promise<any>;
38
38
  createResumeInfo(data: any): Promise<any>;
39
39
  updateFieldResume(resumeId: string, fieldName: string, value: string, resourceType: string, updatedBy: string): Promise<any>;
40
+ getListTicketByOwnerDynamic(ownerId: string, getTicketRequest: getTicketRequest, fields: string[]): Promise<any>;
40
41
  }
@@ -616,5 +616,23 @@ class CrmService extends serviceSDK_1.Service {
616
616
  }
617
617
  });
618
618
  }
619
+ getListTicketByOwnerDynamic(ownerId, getTicketRequest, fields) {
620
+ return __awaiter(this, void 0, void 0, function* () {
621
+ const query = (0, queries_1.GET_LIST_TICKET_BY_OWNER_DYNAMIC)(fields);
622
+ const variables = {
623
+ partyId: this.orgId,
624
+ ownerId,
625
+ getTicketRequest,
626
+ };
627
+ try {
628
+ const response = yield this.graphqlQueryV2(query, variables);
629
+ return response.getListTicketByOwner;
630
+ }
631
+ catch (error) {
632
+ console.log(`Error fetching get getListTicketByOwnerDynamic method: ${error}`);
633
+ throw error;
634
+ }
635
+ });
636
+ }
619
637
  }
620
638
  exports.CrmService = CrmService;
@@ -491,7 +491,7 @@ class StorageS3Service extends serviceSDK_1.Service {
491
491
  }
492
492
  addCorsBucket(s3UserId, bucketId, allowedMethods, allowedOrigins, allowedHeaders, exposeHeaders, maxAgeSeconds, updateBy, fields) {
493
493
  return __awaiter(this, void 0, void 0, function* () {
494
- const query = (0, mutations_1.ADD_CORS_BUCKET)(fields);
494
+ const mutation = (0, mutations_1.ADD_CORS_BUCKET)(fields);
495
495
  const variables = {
496
496
  s3UserId,
497
497
  bucketId,
@@ -503,7 +503,7 @@ class StorageS3Service extends serviceSDK_1.Service {
503
503
  updateBy,
504
504
  };
505
505
  try {
506
- const response = yield this.graphqlQueryV2(query, variables);
506
+ const response = yield this.graphqlMutationV2(mutation, variables);
507
507
  return response.addCorsBucket;
508
508
  }
509
509
  catch (error) {
@@ -514,7 +514,7 @@ class StorageS3Service extends serviceSDK_1.Service {
514
514
  }
515
515
  updateCorsBucket(s3UserId, bucketId, corsId, allowedMethods, allowedOrigins, allowedHeaders, exposeHeaders, maxAgeSeconds, updateBy, fields) {
516
516
  return __awaiter(this, void 0, void 0, function* () {
517
- const query = (0, mutations_1.UPDATE_CORS_BUCKET)(fields);
517
+ const mutation = (0, mutations_1.UPDATE_CORS_BUCKET)(fields);
518
518
  const variables = {
519
519
  s3UserId,
520
520
  bucketId,
@@ -527,7 +527,7 @@ class StorageS3Service extends serviceSDK_1.Service {
527
527
  updateBy,
528
528
  };
529
529
  try {
530
- const response = yield this.graphqlQueryV2(query, variables);
530
+ const response = yield this.graphqlMutationV2(mutation, variables);
531
531
  return response.updateCorsBucket;
532
532
  }
533
533
  catch (error) {
@@ -538,14 +538,14 @@ class StorageS3Service extends serviceSDK_1.Service {
538
538
  }
539
539
  removeCorsBucket(bucketId, corsId, updateBy, fields) {
540
540
  return __awaiter(this, void 0, void 0, function* () {
541
- const query = (0, mutations_1.REMOVE_CORS_BUCKET)(fields);
541
+ const mutation = (0, mutations_1.REMOVE_CORS_BUCKET)(fields);
542
542
  const variables = {
543
543
  bucketId,
544
544
  corsId,
545
545
  updateBy,
546
546
  };
547
547
  try {
548
- const response = yield this.graphqlQueryV2(query, variables);
548
+ const response = yield this.graphqlMutationV2(mutation, variables);
549
549
  return response.removeCorsBucket;
550
550
  }
551
551
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [