@longvansoftware/service-js-client 1.20.3 → 1.20.5

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.
@@ -23,3 +23,5 @@ export declare const REMOVE_S3_DOMAIN: (fields?: string[]) => DocumentNode;
23
23
  export declare const ADD_CORS_BUCKET: (fields?: string[]) => DocumentNode;
24
24
  export declare const UPDATE_CORS_BUCKET: (fields?: string[]) => DocumentNode;
25
25
  export declare const REMOVE_CORS_BUCKET: (fields?: string[]) => DocumentNode;
26
+ export declare const RESET_KEY: (fields?: string[]) => DocumentNode;
27
+ export declare const ACTION_SYNC_USER_FROM_S3: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REMOVE_CORS_BUCKET = exports.UPDATE_CORS_BUCKET = exports.ADD_CORS_BUCKET = exports.REMOVE_S3_DOMAIN = exports.ADD_S3_DOMAIN = exports.REMOVE_FILE_OTHER_VERSION = exports.RESTORE_FILE_OTHER_VERSION = exports.REMOVE_FILE_TRASH = exports.RESTORE_FILE_TRASH = exports.UPDATE_BUCKET_VERSIONING = exports.UPDATE_ACL_PERMISSION_BUCKET = exports.REMOVE_FILE = exports.MOVE_FILE = exports.COPY_FILE = exports.SHARE_LINK_FILE_BY_TIME = exports.SHARE_LINK_FILE_BY_TIME_DYNAMIC = exports.RENAME_FILE = exports.UPDATE_ACL_PERMISSION_FILE = exports.UPLOAD_FOLDER = exports.REMOVE_FOLDER = exports.CREATE_FOLDER = exports.DELETE_BUCKET = exports.RENAME_BUCKET = exports.CREATE_BUCKET = void 0;
3
+ exports.ACTION_SYNC_USER_FROM_S3 = exports.RESET_KEY = exports.REMOVE_CORS_BUCKET = exports.UPDATE_CORS_BUCKET = exports.ADD_CORS_BUCKET = exports.REMOVE_S3_DOMAIN = exports.ADD_S3_DOMAIN = exports.REMOVE_FILE_OTHER_VERSION = exports.RESTORE_FILE_OTHER_VERSION = exports.REMOVE_FILE_TRASH = exports.RESTORE_FILE_TRASH = exports.UPDATE_BUCKET_VERSIONING = exports.UPDATE_ACL_PERMISSION_BUCKET = exports.REMOVE_FILE = exports.MOVE_FILE = exports.COPY_FILE = exports.SHARE_LINK_FILE_BY_TIME = exports.SHARE_LINK_FILE_BY_TIME_DYNAMIC = exports.RENAME_FILE = exports.UPDATE_ACL_PERMISSION_FILE = exports.UPLOAD_FOLDER = exports.REMOVE_FOLDER = exports.CREATE_FOLDER = exports.DELETE_BUCKET = exports.RENAME_BUCKET = exports.CREATE_BUCKET = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  const CREATE_BUCKET = (fields = []) => {
6
6
  const fieldStr = fields.join('\n ');
@@ -519,3 +519,39 @@ const REMOVE_CORS_BUCKET = (fields = []) => {
519
519
  `;
520
520
  };
521
521
  exports.REMOVE_CORS_BUCKET = REMOVE_CORS_BUCKET;
522
+ const RESET_KEY = (fields = []) => {
523
+ const fieldStr = fields.join('\n ');
524
+ const hasFields = fields.length > 0;
525
+ return (0, graphql_tag_1.gql) `
526
+ mutation ResetKey(
527
+ $s3UserId: String!,
528
+ $updateBy: String!
529
+ ) {
530
+ resetKey(
531
+ s3UserId: $s3UserId,
532
+ updateBy: $updateBy,
533
+ ) {
534
+ ${hasFields ? `${fieldStr}` : ''}
535
+ }
536
+ }
537
+ `;
538
+ };
539
+ exports.RESET_KEY = RESET_KEY;
540
+ const ACTION_SYNC_USER_FROM_S3 = (fields = []) => {
541
+ const fieldStr = fields.join('\n ');
542
+ const hasFields = fields.length > 0;
543
+ return (0, graphql_tag_1.gql) `
544
+ mutation ActionSyncUserFromS3(
545
+ $s3UserId: String!,
546
+ $updateBy: String!
547
+ ) {
548
+ actionSyncUserFromS3(
549
+ s3UserId: $s3UserId,
550
+ updateBy: $updateBy,
551
+ ) {
552
+ ${hasFields ? `${fieldStr}` : ''}
553
+ }
554
+ }
555
+ `;
556
+ };
557
+ exports.ACTION_SYNC_USER_FROM_S3 = ACTION_SYNC_USER_FROM_S3;
@@ -33,5 +33,7 @@ export declare class StorageS3Service extends Service {
33
33
  getListFileOtherVersion(s3UserId: string, bucketId: string, key: string, fields: string[]): Promise<any>;
34
34
  restoreFileOtherVersion(s3UserId: string, bucketId: string, key: string, versionId: string, fields: string[]): Promise<any>;
35
35
  removeFileOtherVersion(s3UserId: string, bucketId: string, key: string, versionId: string, fields: string[]): Promise<any>;
36
+ resetKey(s3UserId: string, updateBy: string, fields: string[]): Promise<any>;
37
+ actionSyncUserFromS3(s3UserId: string, updateBy: string, fields: string[]): Promise<any>;
36
38
  chartInYear(s3UserId: string, year: number, month: number, fields: string[]): Promise<any>;
37
39
  }
@@ -594,6 +594,40 @@ class StorageS3Service extends serviceSDK_1.Service {
594
594
  }
595
595
  });
596
596
  }
597
+ resetKey(s3UserId, updateBy, fields) {
598
+ return __awaiter(this, void 0, void 0, function* () {
599
+ const mutation = (0, mutations_1.RESET_KEY)(fields);
600
+ const variables = {
601
+ s3UserId,
602
+ updateBy
603
+ };
604
+ try {
605
+ const response = yield this.graphqlMutationV2(mutation, variables);
606
+ return response.resetKey;
607
+ }
608
+ catch (error) {
609
+ console.log(`Error in resetKey: ${error}`);
610
+ throw error;
611
+ }
612
+ });
613
+ }
614
+ actionSyncUserFromS3(s3UserId, updateBy, fields) {
615
+ return __awaiter(this, void 0, void 0, function* () {
616
+ const mutation = (0, mutations_1.ACTION_SYNC_USER_FROM_S3)(fields);
617
+ const variables = {
618
+ s3UserId,
619
+ updateBy
620
+ };
621
+ try {
622
+ const response = yield this.graphqlMutationV2(mutation, variables);
623
+ return response.resetKey;
624
+ }
625
+ catch (error) {
626
+ console.log(`Error in resetKey: ${error}`);
627
+ throw error;
628
+ }
629
+ });
630
+ }
597
631
  chartInYear(s3UserId, year, month, fields) {
598
632
  return __awaiter(this, void 0, void 0, function* () {
599
633
  const query = (0, queries_1.CHART_IN_YEAR)(fields);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.20.3",
3
+ "version": "1.20.5",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [