@longvansoftware/service-js-client 2.2.3 → 2.2.4
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DocumentNode } from 'graphql';
|
|
2
2
|
export declare const GET_LIST_S3_USER_BY_SERVICE_ID: (fields?: string[]) => DocumentNode;
|
|
3
|
+
export declare const GET_LIST_S3_USER_ACTIVE_BY_SERVICE_ID: (fields?: string[]) => DocumentNode;
|
|
3
4
|
export declare const GET_LIST_BUCKET_BY_S3_USER_ID: (fields?: string[]) => DocumentNode;
|
|
4
5
|
export declare const GET_LIST_OBJECT: (fields?: string[]) => DocumentNode;
|
|
5
6
|
export declare const GET_LIST_FILE_TRASH: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FILTER_LIST_OBJECT = exports.GET_IP_CONSUL = exports.CHART_IN_YEAR = exports.GET_LIST_FILE_OTHER_VERSION = exports.GET_LIST_CORS_BY_S3_USER_ID = exports.GET_LIST_S3_DOMAIN_BY_S3_USER_ID = exports.GET_LIST_FILE_TRASH = exports.GET_LIST_OBJECT = exports.GET_LIST_BUCKET_BY_S3_USER_ID = exports.GET_LIST_S3_USER_BY_SERVICE_ID = void 0;
|
|
3
|
+
exports.FILTER_LIST_OBJECT = exports.GET_IP_CONSUL = exports.CHART_IN_YEAR = exports.GET_LIST_FILE_OTHER_VERSION = exports.GET_LIST_CORS_BY_S3_USER_ID = exports.GET_LIST_S3_DOMAIN_BY_S3_USER_ID = exports.GET_LIST_FILE_TRASH = exports.GET_LIST_OBJECT = exports.GET_LIST_BUCKET_BY_S3_USER_ID = exports.GET_LIST_S3_USER_ACTIVE_BY_SERVICE_ID = exports.GET_LIST_S3_USER_BY_SERVICE_ID = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
const GET_LIST_S3_USER_BY_SERVICE_ID = (fields = []) => {
|
|
6
6
|
const fieldStr = fields.join('\n ');
|
|
@@ -14,6 +14,18 @@ const GET_LIST_S3_USER_BY_SERVICE_ID = (fields = []) => {
|
|
|
14
14
|
`;
|
|
15
15
|
};
|
|
16
16
|
exports.GET_LIST_S3_USER_BY_SERVICE_ID = GET_LIST_S3_USER_BY_SERVICE_ID;
|
|
17
|
+
const GET_LIST_S3_USER_ACTIVE_BY_SERVICE_ID = (fields = []) => {
|
|
18
|
+
const fieldStr = fields.join('\n ');
|
|
19
|
+
const hasFields = fields.length > 0;
|
|
20
|
+
return (0, graphql_tag_1.gql) `
|
|
21
|
+
query GetListS3UserActiveByServiceId($serviceId: String!) {
|
|
22
|
+
getListS3UserActiveByServiceId(serviceId: $serviceId) {
|
|
23
|
+
${hasFields ? `${fieldStr}` : ''}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
};
|
|
28
|
+
exports.GET_LIST_S3_USER_ACTIVE_BY_SERVICE_ID = GET_LIST_S3_USER_ACTIVE_BY_SERVICE_ID;
|
|
17
29
|
const GET_LIST_BUCKET_BY_S3_USER_ID = (fields = []) => {
|
|
18
30
|
const fieldStr = fields.join('\n ');
|
|
19
31
|
const hasFields = fields.length > 0;
|
|
@@ -3,6 +3,7 @@ import { Service } from '../serviceSDK';
|
|
|
3
3
|
export declare class StorageS3Service extends Service {
|
|
4
4
|
constructor(endpoint: string, orgId: string, storeId: string);
|
|
5
5
|
getListS3UserByServiceId(serviceId: string, fields: string[]): Promise<any>;
|
|
6
|
+
getListS3UserActiveByServiceId(serviceId: string, fields: string[]): Promise<any>;
|
|
6
7
|
getListBucketByS3UserId(s3UserId: string, fields: string[]): Promise<any>;
|
|
7
8
|
getListObject(s3UserId: string, bucketId: string, key: string, fields: string[]): Promise<any>;
|
|
8
9
|
uploadFolder(userId: string, bucketId: string, fileInfo: [FileInfoInput], basePrefix: string, fields: string[]): Promise<any>;
|
|
@@ -33,6 +33,22 @@ class StorageS3Service extends serviceSDK_1.Service {
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
getListS3UserActiveByServiceId(serviceId, fields) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const query = (0, queries_1.GET_LIST_S3_USER_ACTIVE_BY_SERVICE_ID)(fields);
|
|
39
|
+
const variables = {
|
|
40
|
+
serviceId,
|
|
41
|
+
};
|
|
42
|
+
try {
|
|
43
|
+
const response = yield this.graphqlQueryV2(query, variables);
|
|
44
|
+
return response.getListS3UserActiveByServiceId;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.log(`Error in getListS3UserActiveByServiceId: ${error}`);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
36
52
|
getListBucketByS3UserId(s3UserId, fields) {
|
|
37
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
54
|
const query = (0, queries_1.GET_LIST_BUCKET_BY_S3_USER_ID)(fields);
|