rtc4js 1.5.1 → 2.1.0
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/{.env.local → .env} +3 -3
- package/dist/http/http-error.d.ts +6 -0
- package/dist/http/http-error.js +33 -0
- package/dist/http/http-error.js.map +1 -0
- package/dist/http/http-method.d.ts +1 -0
- package/dist/http/http-method.js +15 -0
- package/dist/http/http-method.js.map +1 -0
- package/dist/http/http-request-type.d.ts +2 -0
- package/dist/http/http-request-type.js +31 -0
- package/dist/http/http-request-type.js.map +1 -0
- package/dist/http/http-response.d.ts +7 -0
- package/dist/http/http-response.js +50 -0
- package/dist/http/http-response.js.map +1 -0
- package/dist/rapid-table-connector copy.d.ts +0 -0
- package/dist/rapid-table-connector copy.js +392 -0
- package/dist/rapid-table-connector copy.js.map +1 -0
- package/dist/rapid-table-connector.d.ts +7 -1
- package/dist/rapid-table-connector.js +167 -232
- package/dist/rapid-table-connector.js.map +1 -1
- package/dist/resource/drive/drive-put-object-request.d.ts +0 -1
- package/dist/resource/drive/drive-put-object-request.js +2 -13
- package/dist/resource/drive/drive-put-object-request.js.map +1 -1
- package/dist/resource/get-object-response.d.ts +1 -0
- package/dist/resource/import-package-request.interface.d.ts +0 -1
- package/dist/resource/import-package-request.interface.js +12 -0
- package/dist/resource/import-package-request.interface.js.map +1 -1
- package/dist/resource/project/project-import-package-request.d.ts +0 -1
- package/dist/resource/project/project-import-package-request.js +2 -8
- package/dist/resource/project/project-import-package-request.js.map +1 -1
- package/dist/resource/project/project-put-cover-request.d.ts +0 -1
- package/dist/resource/project/project-put-cover-request.js +7 -10
- package/dist/resource/project/project-put-cover-request.js.map +1 -1
- package/dist/resource/put-object-request.interface.d.ts +0 -1
- package/dist/resource/put-object-request.interface.js +12 -0
- package/dist/resource/put-object-request.interface.js.map +1 -1
- package/dist/resource/report/report-bulk-count-request.d.ts +14 -5
- package/dist/resource/report/report-bulk-count-request.js +20 -5
- package/dist/resource/report/report-bulk-count-request.js.map +1 -1
- package/dist/resource/report/report-bulk-search-request.d.ts +14 -5
- package/dist/resource/report/report-bulk-search-request.js +20 -5
- package/dist/resource/report/report-bulk-search-request.js.map +1 -1
- package/dist/resource/report/report-count-request.d.ts +14 -5
- package/dist/resource/report/report-count-request.js +20 -5
- package/dist/resource/report/report-count-request.js.map +1 -1
- package/dist/resource/report/report-put-object-request.d.ts +0 -1
- package/dist/resource/report/report-put-object-request.js +9 -11
- package/dist/resource/report/report-put-object-request.js.map +1 -1
- package/dist/resource/report/report-search-request.d.ts +14 -5
- package/dist/resource/report/report-search-request.js +20 -5
- package/dist/resource/report/report-search-request.js.map +1 -1
- package/dist/utils/form-data-util.d.ts +1 -0
- package/dist/utils/form-data-util.js +59 -0
- package/dist/utils/form-data-util.js.map +1 -0
- package/package.json +2 -4
package/{.env.local → .env}
RENAMED
|
@@ -2,6 +2,6 @@ RTC4J_TEST_ACCESS_ID=eiji.hirakawa@rapid-table.com
|
|
|
2
2
|
RTC4J_TEST_ACCESS_KEY="Bq_.hg9LnaBArcGzbRIE#$8cZu"
|
|
3
3
|
RTC4J_TEST_ENDPOINT=localhost:8082
|
|
4
4
|
RTC4J_TEST_WORKSPACE_ID=EMJq7jEa2p6Ahhjg6VfG3
|
|
5
|
-
RTC4J_TEST_PROJECT_ID=
|
|
6
|
-
RTC4J_TEST_OBJECT_ID=
|
|
7
|
-
RTC4J_TEST_REPORT_ID=
|
|
5
|
+
RTC4J_TEST_PROJECT_ID=evn3MoQs0theV6tVDq4mS
|
|
6
|
+
RTC4J_TEST_OBJECT_ID=QU8_h8RVI8IVC7ydeMeVl
|
|
7
|
+
RTC4J_TEST_REPORT_ID="_-pSE1YuEu706TA-eue4h"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Rapid Table, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the 'License').
|
|
6
|
+
* You may not use this file except in compliance with the License. A copy of the License is located at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR
|
|
11
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
+
* and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.handleError = exports.HttpError = void 0;
|
|
16
|
+
class HttpError extends Error {
|
|
17
|
+
constructor(message, status, body) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.status = status;
|
|
20
|
+
this.body = body;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.HttpError = HttpError;
|
|
24
|
+
function handleError(invoker, error) {
|
|
25
|
+
if (error instanceof HttpError) {
|
|
26
|
+
return new Error(`${invoker} failed: ${error.status} (${error.body || error.message})`);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return new Error(`${invoker} failed`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.handleError = handleError;
|
|
33
|
+
//# sourceMappingURL=http-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-error.js","sourceRoot":"","sources":["../../src/http/http-error.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,MAAa,SAAU,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,MAAc,EACd,IAAU;QAEjB,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAM;IAGnB,CAAC;CACF;AARD,8BAQC;AAED,SAAgB,WAAW,CAAC,OAAe,EAAE,KAAc;IACzD,IAAI,KAAK,YAAY,SAAS,EAAE;QAC9B,OAAO,IAAI,KAAK,CACd,GAAG,OAAO,YAAY,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,GAAG,CACtE,CAAC;KACH;SAAM;QACL,OAAO,IAAI,KAAK,CAAC,GAAG,OAAO,SAAS,CAAC,CAAC;KACvC;AACH,CAAC;AARD,kCAQC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Rapid Table, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the 'License').
|
|
6
|
+
* You may not use this file except in compliance with the License. A copy of the License is located at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR
|
|
11
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
+
* and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
//# sourceMappingURL=http-method.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-method.js","sourceRoot":"","sources":["../../src/http/http-method.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Rapid Table, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the 'License').
|
|
6
|
+
* You may not use this file except in compliance with the License. A copy of the License is located at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR
|
|
11
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
+
* and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.resolveAccept = void 0;
|
|
16
|
+
function resolveAccept(type) {
|
|
17
|
+
switch (type) {
|
|
18
|
+
case 'json':
|
|
19
|
+
return 'application/json';
|
|
20
|
+
case 'text':
|
|
21
|
+
return 'text/plain';
|
|
22
|
+
case 'arraybuffer':
|
|
23
|
+
return 'application/octet-stream';
|
|
24
|
+
case 'blob':
|
|
25
|
+
return '*/*';
|
|
26
|
+
default:
|
|
27
|
+
return '*/*';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.resolveAccept = resolveAccept;
|
|
31
|
+
//# sourceMappingURL=http-request-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-request-type.js","sourceRoot":"","sources":["../../src/http/http-request-type.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAIH,SAAgB,aAAa,CAAC,IAAuB;IACnD,QAAQ,IAAI,EAAE;QACZ,KAAK,MAAM;YACT,OAAO,kBAAkB,CAAC;QAC5B,KAAK,MAAM;YACT,OAAO,YAAY,CAAC;QACtB,KAAK,aAAa;YAChB,OAAO,0BAA0B,CAAC;QACpC,KAAK,MAAM;YACT,OAAO,KAAK,CAAC;QACf;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;AAbD,sCAaC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpResponseType } from './http-request-type';
|
|
2
|
+
export type HttpResponse<T> = {
|
|
3
|
+
data: T;
|
|
4
|
+
status: number;
|
|
5
|
+
headers: Headers;
|
|
6
|
+
};
|
|
7
|
+
export declare function resolveHttpResponse<T>(response: Response, responseType: HttpResponseType): Promise<HttpResponse<T>>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Rapid Table, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the 'License').
|
|
6
|
+
* You may not use this file except in compliance with the License. A copy of the License is located at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR
|
|
11
|
+
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
+
* and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.resolveHttpResponse = void 0;
|
|
16
|
+
const http_error_1 = require("./http-error");
|
|
17
|
+
async function resolveHttpResponse(response, responseType) {
|
|
18
|
+
if (!response.ok) {
|
|
19
|
+
const body = await safeParse(response);
|
|
20
|
+
throw new http_error_1.HttpError(`HTTP error: ${response.status}`, response.status, body);
|
|
21
|
+
}
|
|
22
|
+
const data = await (async () => {
|
|
23
|
+
switch (responseType) {
|
|
24
|
+
case 'arraybuffer':
|
|
25
|
+
return await response.arrayBuffer();
|
|
26
|
+
case 'blob':
|
|
27
|
+
return await response.blob();
|
|
28
|
+
case 'text':
|
|
29
|
+
return await response.text();
|
|
30
|
+
case 'json':
|
|
31
|
+
default:
|
|
32
|
+
const text = await response.text();
|
|
33
|
+
return text ? JSON.parse(text) : null;
|
|
34
|
+
}
|
|
35
|
+
})();
|
|
36
|
+
return { data, status: response.status, headers: response.headers };
|
|
37
|
+
}
|
|
38
|
+
exports.resolveHttpResponse = resolveHttpResponse;
|
|
39
|
+
async function safeParse(res) {
|
|
40
|
+
const text = await res.text();
|
|
41
|
+
const contentType = res.headers.get('content-type') || '';
|
|
42
|
+
if (contentType.includes('application/json')) {
|
|
43
|
+
try {
|
|
44
|
+
return JSON.parse(text);
|
|
45
|
+
}
|
|
46
|
+
catch { }
|
|
47
|
+
}
|
|
48
|
+
return text;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=http-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-response.js","sourceRoot":"","sources":["../../src/http/http-response.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,6CAAyC;AASlC,KAAK,UAAU,mBAAmB,CACvC,QAAkB,EAClB,YAA8B;IAE9B,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;QAChB,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC;QACvC,MAAM,IAAI,sBAAS,CACjB,eAAe,QAAQ,CAAC,MAAM,EAAE,EAChC,QAAQ,CAAC,MAAM,EACf,IAAI,CACL,CAAC;KACH;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE;QAC7B,QAAQ,YAAY,EAAE;YACpB,KAAK,aAAa;gBAChB,OAAO,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;YACtC,KAAK,MAAM;gBACT,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC/B,KAAK,MAAM;gBACT,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC/B,KAAK,MAAM,CAAC;YACZ;gBACE,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;SACzC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;AACtE,CAAC;AA7BD,kDA6BC;AAED,KAAK,UAAU,SAAS,CAAC,GAAa;IACpC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC1D,IAAI,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;QAC5C,IAAI;YACF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACzB;QAAC,MAAM,GAAE;KACX;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// /*
|
|
3
|
+
// * Copyright Rapid Table, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// *
|
|
5
|
+
// * Licensed under the Apache License, Version 2.0 (the 'License').
|
|
6
|
+
// * You may not use this file except in compliance with the License. A copy of the License is located at
|
|
7
|
+
// *
|
|
8
|
+
// * https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
// *
|
|
10
|
+
// * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR
|
|
11
|
+
// * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
|
+
// * and limitations under the License.
|
|
13
|
+
// */
|
|
14
|
+
// import { handleError, HttpError } from './http/http-error';
|
|
15
|
+
// import { HttpMethod } from './http/http-method';
|
|
16
|
+
// import { HttpResponseType, resolveAccept } from './http/http-request-type';
|
|
17
|
+
// import { HttpResponse, resolveHttpResponse } from './http/http-response';
|
|
18
|
+
// import { IDeleteRequest } from './resource/delete-request.interface';
|
|
19
|
+
// import { IGenerateIdRequest } from './resource/generate-id-request.interface';
|
|
20
|
+
// import { GetObjectResponse } from './resource/get-object-response';
|
|
21
|
+
// import { IImportPackageRequest } from './resource/import-package-request.interface';
|
|
22
|
+
// import { PathConfig } from './resource/path-config';
|
|
23
|
+
// import { IPutObjectRequest } from './resource/put-object-request.interface';
|
|
24
|
+
// import { ImportFailedReport } from './resource/report/import-failed-report';
|
|
25
|
+
// import { IRequest } from './resource/request.interface';
|
|
26
|
+
// const AUTHORIZATION_HEADER = 'authorization';
|
|
27
|
+
// export class RapidTableConnector {
|
|
28
|
+
// private accessId: string;
|
|
29
|
+
// private accessKey: string;
|
|
30
|
+
// private credentials: Credentials;
|
|
31
|
+
// private baseURL: string;
|
|
32
|
+
// constructor(
|
|
33
|
+
// accessId: string,
|
|
34
|
+
// accessKey: string,
|
|
35
|
+
// host: string,
|
|
36
|
+
// secure: boolean,
|
|
37
|
+
// credentials?: Credentials,
|
|
38
|
+
// ) {
|
|
39
|
+
// this.accessId = accessId;
|
|
40
|
+
// this.accessKey = accessKey;
|
|
41
|
+
// const schema = secure ? 'https' : 'http';
|
|
42
|
+
// this.baseURL = `${schema}://${host}`;
|
|
43
|
+
// this.credentials = credentials || Credentials.empty();
|
|
44
|
+
// }
|
|
45
|
+
// public async search<T>(
|
|
46
|
+
// request: IRequest,
|
|
47
|
+
// instanceFn?: (arg: T) => T,
|
|
48
|
+
// ): Promise<T[]> {
|
|
49
|
+
// const postscript = (response: HttpResponse<T[]>) => {
|
|
50
|
+
// if (instanceFn) {
|
|
51
|
+
// return response.data.map((item) => instanceFn(item));
|
|
52
|
+
// }
|
|
53
|
+
// return response.data;
|
|
54
|
+
// };
|
|
55
|
+
// return await this.getRequest('search', postscript, request);
|
|
56
|
+
// // try {
|
|
57
|
+
// // await this.ensurePermission();
|
|
58
|
+
// // const res = await this.exchange<T[]>('GET', request);
|
|
59
|
+
// // if (instanceFn) {
|
|
60
|
+
// // return res.data.map((item) => instanceFn(item));
|
|
61
|
+
// // }
|
|
62
|
+
// // return res.data;
|
|
63
|
+
// // } catch (error) {
|
|
64
|
+
// // throw handleError('search', error);
|
|
65
|
+
// // }
|
|
66
|
+
// }
|
|
67
|
+
// public async count(request: IRequest): Promise<number> {
|
|
68
|
+
// try {
|
|
69
|
+
// await this.ensurePermission();
|
|
70
|
+
// const res = await this.exchange<number>('GET', request);
|
|
71
|
+
// return res.data;
|
|
72
|
+
// } catch (error) {
|
|
73
|
+
// throw handleError('count', error);
|
|
74
|
+
// }
|
|
75
|
+
// }
|
|
76
|
+
// public async get<T>(
|
|
77
|
+
// request: IRequest,
|
|
78
|
+
// instanceFn?: (arg: T) => T,
|
|
79
|
+
// ): Promise<T> {
|
|
80
|
+
// try {
|
|
81
|
+
// await this.ensurePermission();
|
|
82
|
+
// const res = await this.exchange<T>('GET', request);
|
|
83
|
+
// if (instanceFn) {
|
|
84
|
+
// return instanceFn(res.data);
|
|
85
|
+
// }
|
|
86
|
+
// return res.data as T;
|
|
87
|
+
// } catch (error) {
|
|
88
|
+
// throw handleError('get', error);
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
// public async bulkGet<T>(
|
|
92
|
+
// request: IRequest,
|
|
93
|
+
// instanceFn?: (arg: T) => T,
|
|
94
|
+
// ): Promise<T[]> {
|
|
95
|
+
// try {
|
|
96
|
+
// await this.ensurePermission();
|
|
97
|
+
// const res = await this.exchange<T[]>('GET', request);
|
|
98
|
+
// if (instanceFn) {
|
|
99
|
+
// return res.data.map((item) => instanceFn(item));
|
|
100
|
+
// }
|
|
101
|
+
// return res.data;
|
|
102
|
+
// } catch (error) {
|
|
103
|
+
// throw handleError('bulkGet', error);
|
|
104
|
+
// }
|
|
105
|
+
// }
|
|
106
|
+
// public async getObject(request: IRequest): Promise<GetObjectResponse> {
|
|
107
|
+
// try {
|
|
108
|
+
// await this.ensurePermission();
|
|
109
|
+
// const res = await this.exchange<ArrayBuffer>(
|
|
110
|
+
// 'GET',
|
|
111
|
+
// request,
|
|
112
|
+
// 'arraybuffer',
|
|
113
|
+
// );
|
|
114
|
+
// const fileName = decodeURIComponent(res.headers.get('etag') || '');
|
|
115
|
+
// const contentType = '' + res.headers.get('content-type') || '';
|
|
116
|
+
// const contentLength = +(res.headers.get('content-length') || NaN);
|
|
117
|
+
// const data = Buffer.from(res.data);
|
|
118
|
+
// return new GetObjectResponse(fileName, contentType, contentLength, data);
|
|
119
|
+
// } catch (error) {
|
|
120
|
+
// throw handleError('getObject', error);
|
|
121
|
+
// }
|
|
122
|
+
// }
|
|
123
|
+
// public async generateId(request: IGenerateIdRequest): Promise<string> {
|
|
124
|
+
// try {
|
|
125
|
+
// await this.ensurePermission();
|
|
126
|
+
// const res = await this.exchange<string>('GET', request, 'text');
|
|
127
|
+
// return res.data;
|
|
128
|
+
// } catch (error) {
|
|
129
|
+
// throw handleError('generateId', error);
|
|
130
|
+
// }
|
|
131
|
+
// }
|
|
132
|
+
// public async create<T>(
|
|
133
|
+
// request: IRequest,
|
|
134
|
+
// instanceFn?: (arg: T) => T,
|
|
135
|
+
// ): Promise<T> {
|
|
136
|
+
// try {
|
|
137
|
+
// await this.ensurePermission();
|
|
138
|
+
// const res = await this.exchange<T>('POST', request);
|
|
139
|
+
// if (instanceFn) {
|
|
140
|
+
// return instanceFn(res.data);
|
|
141
|
+
// }
|
|
142
|
+
// return res.data as T;
|
|
143
|
+
// } catch (error) {
|
|
144
|
+
// throw handleError('create', error);
|
|
145
|
+
// }
|
|
146
|
+
// }
|
|
147
|
+
// public async update<T>(
|
|
148
|
+
// request: IRequest,
|
|
149
|
+
// instanceFn?: (arg: T) => T,
|
|
150
|
+
// ): Promise<T> {
|
|
151
|
+
// try {
|
|
152
|
+
// await this.ensurePermission();
|
|
153
|
+
// const res = await this.exchange<T>('PUT', request);
|
|
154
|
+
// if (instanceFn) {
|
|
155
|
+
// return instanceFn(res.data);
|
|
156
|
+
// }
|
|
157
|
+
// return res.data as T;
|
|
158
|
+
// } catch (error) {
|
|
159
|
+
// throw handleError('update', error);
|
|
160
|
+
// }
|
|
161
|
+
// }
|
|
162
|
+
// public async delete(request: IDeleteRequest): Promise<void> {
|
|
163
|
+
// try {
|
|
164
|
+
// await this.ensurePermission();
|
|
165
|
+
// await this.exchange('DELETE', request);
|
|
166
|
+
// } catch (error) {
|
|
167
|
+
// throw handleError('delete', error);
|
|
168
|
+
// }
|
|
169
|
+
// }
|
|
170
|
+
// public async putObject(request: IPutObjectRequest): Promise<string> {
|
|
171
|
+
// try {
|
|
172
|
+
// await this.ensurePermission();
|
|
173
|
+
// const res = await this.exchange<string>('PUT', request, 'text');
|
|
174
|
+
// return res.data;
|
|
175
|
+
// } catch (error) {
|
|
176
|
+
// throw handleError('putObject', error);
|
|
177
|
+
// }
|
|
178
|
+
// }
|
|
179
|
+
// public async importPackage(
|
|
180
|
+
// request: IImportPackageRequest,
|
|
181
|
+
// ): Promise<ImportFailedReport[]> {
|
|
182
|
+
// try {
|
|
183
|
+
// await this.ensurePermission();
|
|
184
|
+
// const res = await this.exchange<ImportFailedReport[]>('POST', request);
|
|
185
|
+
// return res.data;
|
|
186
|
+
// } catch (error) {
|
|
187
|
+
// throw handleError('importPackage', error);
|
|
188
|
+
// }
|
|
189
|
+
// }
|
|
190
|
+
// public async permission(): Promise<Credentials> {
|
|
191
|
+
// if (!this.accessId || !this.accessKey) {
|
|
192
|
+
// throw new Error(`Permission failed: No access key or ID.`);
|
|
193
|
+
// }
|
|
194
|
+
// try {
|
|
195
|
+
// const request: IRequest = {
|
|
196
|
+
// getPath: () => PathConfig.ROOT + PathConfig.PERMISSIONS,
|
|
197
|
+
// getQuery: () => ({}),
|
|
198
|
+
// getBody: () =>
|
|
199
|
+
// JSON.stringify({
|
|
200
|
+
// email: this.accessId,
|
|
201
|
+
// key: this.accessKey,
|
|
202
|
+
// }),
|
|
203
|
+
// };
|
|
204
|
+
// const response = await this.exchange('POST', request);
|
|
205
|
+
// const token = response.headers.get(AUTHORIZATION_HEADER) || '';
|
|
206
|
+
// return Credentials.approve(token);
|
|
207
|
+
// } catch (error) {
|
|
208
|
+
// throw handleError('Permission', error);
|
|
209
|
+
// }
|
|
210
|
+
// }
|
|
211
|
+
// //#region Internal Http Client Method
|
|
212
|
+
// private async getRequest<T>(
|
|
213
|
+
// invokerName: string,
|
|
214
|
+
// postscript: (args: HttpResponse<T>) => T,
|
|
215
|
+
// request:
|
|
216
|
+
// | IRequest
|
|
217
|
+
// | IDeleteRequest
|
|
218
|
+
// | IGenerateIdRequest
|
|
219
|
+
// | IImportPackageRequest
|
|
220
|
+
// | IPutObjectRequest,
|
|
221
|
+
// responseType: HttpResponseType = 'json',
|
|
222
|
+
// ): Promise<T> {
|
|
223
|
+
// try {
|
|
224
|
+
// await this.ensurePermission();
|
|
225
|
+
// const res = await this.exchange<T>('GET', request);
|
|
226
|
+
// return postscript(res);
|
|
227
|
+
// } catch (error) {
|
|
228
|
+
// throw handleError(invokerName, error);
|
|
229
|
+
// }
|
|
230
|
+
// }
|
|
231
|
+
// private async exchange<T>(
|
|
232
|
+
// method: HttpMethod,
|
|
233
|
+
// request:
|
|
234
|
+
// | IRequest
|
|
235
|
+
// | IDeleteRequest
|
|
236
|
+
// | IGenerateIdRequest
|
|
237
|
+
// | IImportPackageRequest
|
|
238
|
+
// | IPutObjectRequest,
|
|
239
|
+
// responseType: HttpResponseType = 'json',
|
|
240
|
+
// ): Promise<HttpResponse<T>> {
|
|
241
|
+
// if (!request.getPath()) {
|
|
242
|
+
// throw new Error(`IllegalArgumentException`);
|
|
243
|
+
// }
|
|
244
|
+
// const url = new URL(request.getPath(), this.baseURL);
|
|
245
|
+
// // -------- Query param --------
|
|
246
|
+
// if ('getQuery' in request && request.getQuery()) {
|
|
247
|
+
// Object.entries(request.getQuery()).forEach(([k, v]) => {
|
|
248
|
+
// if (v != null) url.searchParams.append(k, String(v));
|
|
249
|
+
// });
|
|
250
|
+
// }
|
|
251
|
+
// // -------- Body --------
|
|
252
|
+
// const rawBody = (() => {
|
|
253
|
+
// if ('getFormData' in request) {
|
|
254
|
+
// return request.getFormData() || null;
|
|
255
|
+
// } else if ('getBody' in request) {
|
|
256
|
+
// return request.getBody() || null;
|
|
257
|
+
// }
|
|
258
|
+
// return null;
|
|
259
|
+
// })();
|
|
260
|
+
// const body: BodyInit | undefined = (() => {
|
|
261
|
+
// if (rawBody instanceof globalThis.FormData) {
|
|
262
|
+
// return rawBody;
|
|
263
|
+
// } else if (typeof rawBody === 'string') {
|
|
264
|
+
// return rawBody;
|
|
265
|
+
// } else if (
|
|
266
|
+
// rawBody instanceof Blob ||
|
|
267
|
+
// rawBody instanceof URLSearchParams ||
|
|
268
|
+
// rawBody instanceof ArrayBuffer
|
|
269
|
+
// ) {
|
|
270
|
+
// return rawBody;
|
|
271
|
+
// } else if (rawBody != null) {
|
|
272
|
+
// return JSON.stringify(rawBody);
|
|
273
|
+
// }
|
|
274
|
+
// return undefined;
|
|
275
|
+
// })();
|
|
276
|
+
// // -------- Headers --------
|
|
277
|
+
// const headers = new Headers();
|
|
278
|
+
// headers.set('Accept', resolveAccept(responseType));
|
|
279
|
+
// headers.set('X-Requested-With', 'XMLHttpRequest');
|
|
280
|
+
// if (typeof window === 'undefined') {
|
|
281
|
+
// headers.set('User-Agent', 'RapidTableClient/1.0');
|
|
282
|
+
// }
|
|
283
|
+
// if (this.credentials.token) {
|
|
284
|
+
// headers.set(AUTHORIZATION_HEADER, this.credentials.token);
|
|
285
|
+
// }
|
|
286
|
+
// if (typeof body === 'string') {
|
|
287
|
+
// headers.set('Content-Type', 'text/plain; charset=utf-8');
|
|
288
|
+
// } else if (!(body instanceof globalThis.FormData) && body !== undefined) {
|
|
289
|
+
// headers.set('Content-Type', 'application/json; charset=utf-8');
|
|
290
|
+
// }
|
|
291
|
+
// // -------- Timeout --------
|
|
292
|
+
// const controller = new AbortController();
|
|
293
|
+
// const timeout = 15000;
|
|
294
|
+
// const id = setTimeout(() => controller.abort(), timeout);
|
|
295
|
+
// try {
|
|
296
|
+
// const response = await fetch(url.toString(), {
|
|
297
|
+
// method,
|
|
298
|
+
// headers,
|
|
299
|
+
// body,
|
|
300
|
+
// signal: controller.signal,
|
|
301
|
+
// credentials: 'include',
|
|
302
|
+
// });
|
|
303
|
+
// return await resolveHttpResponse(response, responseType);
|
|
304
|
+
// } catch (err: any) {
|
|
305
|
+
// if (err.name === 'AbortError') {
|
|
306
|
+
// throw new Error(`Timeout (${timeout}ms)`);
|
|
307
|
+
// }
|
|
308
|
+
// if (err instanceof HttpError) {
|
|
309
|
+
// throw err;
|
|
310
|
+
// }
|
|
311
|
+
// throw new Error(`Network error: ${err.message}`);
|
|
312
|
+
// } finally {
|
|
313
|
+
// clearTimeout(id);
|
|
314
|
+
// }
|
|
315
|
+
// }
|
|
316
|
+
// private async ensurePermission() {
|
|
317
|
+
// if (!this.credentials.isPermitted()) {
|
|
318
|
+
// this.credentials = await this.permission();
|
|
319
|
+
// }
|
|
320
|
+
// }
|
|
321
|
+
// //#endregion
|
|
322
|
+
// public static builder(): RapidTableConnectorBuilder {
|
|
323
|
+
// return new RapidTableConnectorBuilder();
|
|
324
|
+
// }
|
|
325
|
+
// }
|
|
326
|
+
// class RapidTableConnectorBuilder {
|
|
327
|
+
// private _accessId: string | null = null;
|
|
328
|
+
// private _accessKey: string | null = null;
|
|
329
|
+
// private _endpoint: string | null = null;
|
|
330
|
+
// private _secure: boolean = true;
|
|
331
|
+
// private _credentials?: Credentials;
|
|
332
|
+
// public accessId(accessId: string): RapidTableConnectorBuilder {
|
|
333
|
+
// this._accessId = accessId;
|
|
334
|
+
// return this;
|
|
335
|
+
// }
|
|
336
|
+
// public accessKey(accessKey: string): RapidTableConnectorBuilder {
|
|
337
|
+
// this._accessKey = accessKey;
|
|
338
|
+
// return this;
|
|
339
|
+
// }
|
|
340
|
+
// public endpoint(endpoint: string): RapidTableConnectorBuilder {
|
|
341
|
+
// this._endpoint = endpoint;
|
|
342
|
+
// return this;
|
|
343
|
+
// }
|
|
344
|
+
// public secure(secure: boolean): RapidTableConnectorBuilder {
|
|
345
|
+
// this._secure = secure;
|
|
346
|
+
// return this;
|
|
347
|
+
// }
|
|
348
|
+
// public credentials(credentials: Credentials): RapidTableConnectorBuilder {
|
|
349
|
+
// this._credentials = credentials;
|
|
350
|
+
// return this;
|
|
351
|
+
// }
|
|
352
|
+
// public build(): RapidTableConnector {
|
|
353
|
+
// if (!this._credentials) {
|
|
354
|
+
// if (!this._accessId) {
|
|
355
|
+
// throw new Error('accessId is required');
|
|
356
|
+
// }
|
|
357
|
+
// if (!this._accessKey) {
|
|
358
|
+
// throw new Error('accessKey is required');
|
|
359
|
+
// }
|
|
360
|
+
// }
|
|
361
|
+
// if (!this._endpoint) {
|
|
362
|
+
// throw new Error('endpoint is required');
|
|
363
|
+
// }
|
|
364
|
+
// return new RapidTableConnector(
|
|
365
|
+
// this._accessId || '',
|
|
366
|
+
// this._accessKey || '',
|
|
367
|
+
// this._endpoint,
|
|
368
|
+
// this._secure,
|
|
369
|
+
// this._credentials,
|
|
370
|
+
// );
|
|
371
|
+
// }
|
|
372
|
+
// }
|
|
373
|
+
// export class Credentials {
|
|
374
|
+
// constructor(
|
|
375
|
+
// public token: string | null,
|
|
376
|
+
// public approvedAt: number,
|
|
377
|
+
// ) {}
|
|
378
|
+
// isPermitted(): boolean {
|
|
379
|
+
// if (!this.token) {
|
|
380
|
+
// return false;
|
|
381
|
+
// }
|
|
382
|
+
// const diff = (Date.now() - this.approvedAt) / (1000 * 60);
|
|
383
|
+
// return diff <= 50;
|
|
384
|
+
// }
|
|
385
|
+
// static empty(): Credentials {
|
|
386
|
+
// return new Credentials(null, 0);
|
|
387
|
+
// }
|
|
388
|
+
// static approve(token: string): Credentials {
|
|
389
|
+
// return new Credentials(token, Date.now());
|
|
390
|
+
// }
|
|
391
|
+
// }
|
|
392
|
+
//# sourceMappingURL=rapid-table-connector%20copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rapid-table-connector copy.js","sourceRoot":"","sources":["../src/rapid-table-connector copy.ts"],"names":[],"mappings":";AAAA,KAAK;AACL,yEAAyE;AACzE,KAAK;AACL,qEAAqE;AACrE,0GAA0G;AAC1G,KAAK;AACL,iDAAiD;AACjD,KAAK;AACL,0HAA0H;AAC1H,wHAAwH;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,UAAU;AACV,QAAQ;AACR,6BAA6B;AAC7B,iDAAiD;AACjD,QAAQ;AACR,sCAAsC;AACtC,8BAA8B;AAC9B,+BAA+B;AAC/B,wBAAwB;AACxB,sBAAsB;AACtB,2BAA2B;AAC3B,SAAS;AACT,MAAM;AACN,IAAI;AAEJ,6BAA6B;AAC7B,iBAAiB;AACjB,mCAAmC;AACnC,iCAAiC;AACjC,SAAS;AAET,6BAA6B;AAC7B,yBAAyB;AACzB,sBAAsB;AACtB,QAAQ;AACR,iEAAiE;AACjE,yBAAyB;AACzB,MAAM;AAEN,kCAAkC;AAClC,uCAAuC;AACvC,MAAM;AAEN,iDAAiD;AACjD,iDAAiD;AACjD,MAAM;AACN,IAAI"}
|
|
@@ -8,8 +8,8 @@ import { IRequest } from './resource/request.interface';
|
|
|
8
8
|
export declare class RapidTableConnector {
|
|
9
9
|
private accessId;
|
|
10
10
|
private accessKey;
|
|
11
|
-
private client;
|
|
12
11
|
private credentials;
|
|
12
|
+
private baseURL;
|
|
13
13
|
constructor(accessId: string, accessKey: string, host: string, secure: boolean, credentials?: Credentials);
|
|
14
14
|
search<T>(request: IRequest, instanceFn?: (arg: T) => T): Promise<T[]>;
|
|
15
15
|
count(request: IRequest): Promise<number>;
|
|
@@ -23,6 +23,12 @@ export declare class RapidTableConnector {
|
|
|
23
23
|
putObject(request: IPutObjectRequest): Promise<string>;
|
|
24
24
|
importPackage(request: IImportPackageRequest): Promise<ImportFailedReport[]>;
|
|
25
25
|
permission(): Promise<Credentials>;
|
|
26
|
+
private getRequest;
|
|
27
|
+
private postRequest;
|
|
28
|
+
private putRequest;
|
|
29
|
+
private deleteRequest;
|
|
30
|
+
private exchange;
|
|
31
|
+
private ensurePermission;
|
|
26
32
|
static builder(): RapidTableConnectorBuilder;
|
|
27
33
|
}
|
|
28
34
|
declare class RapidTableConnectorBuilder {
|