rtc4js 1.5.1 → 2.0.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-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/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
|
@@ -11,13 +11,10 @@
|
|
|
11
11
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
12
|
* and limitations under the License.
|
|
13
13
|
*/
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
15
|
exports.ProjectPutCoverRequest = void 0;
|
|
16
|
+
const form_data_util_1 = require("../../utils/form-data-util");
|
|
19
17
|
const path_config_1 = require("../path-config");
|
|
20
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
21
18
|
class ProjectPutCoverRequest {
|
|
22
19
|
constructor(path, formData) {
|
|
23
20
|
this.path = path;
|
|
@@ -41,8 +38,11 @@ class Builder {
|
|
|
41
38
|
this._formData = null;
|
|
42
39
|
}
|
|
43
40
|
build() {
|
|
44
|
-
const path = path_config_1.PathConfig.ROOT +
|
|
45
|
-
path_config_1.PathConfig.
|
|
41
|
+
const path = path_config_1.PathConfig.ROOT +
|
|
42
|
+
path_config_1.PathConfig.WORKSPACE +
|
|
43
|
+
`/${this._workspaceId}` +
|
|
44
|
+
path_config_1.PathConfig.PROJECTS +
|
|
45
|
+
`/${this._projectId}` +
|
|
46
46
|
path_config_1.PathConfig.OBJECTS;
|
|
47
47
|
if (!this._formData) {
|
|
48
48
|
throw new Error('IllegalArgumentException');
|
|
@@ -58,10 +58,7 @@ class Builder {
|
|
|
58
58
|
return this;
|
|
59
59
|
}
|
|
60
60
|
append(buffer, fileName) {
|
|
61
|
-
|
|
62
|
-
this._formData = new form_data_1.default();
|
|
63
|
-
}
|
|
64
|
-
this._formData.append('file', buffer, fileName);
|
|
61
|
+
this._formData = (0, form_data_util_1.prepareFormData)(this._formData, buffer, fileName);
|
|
65
62
|
return this;
|
|
66
63
|
}
|
|
67
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-put-cover-request.js","sourceRoot":"","sources":["../../../src/resource/project/project-put-cover-request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG
|
|
1
|
+
{"version":3,"file":"project-put-cover-request.js","sourceRoot":"","sources":["../../../src/resource/project/project-put-cover-request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,+DAA6D;AAC7D,gDAA4C;AAG5C,MAAa,sBAAsB;IACjC,YACS,IAAY,EACZ,QAAkB;QADlB,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAU;IACxB,CAAC;IAEG,OAAO;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,OAAO;QACnB,OAAO,IAAI,OAAO,EAAE,CAAC;IACvB,CAAC;CACF;AAjBD,wDAiBC;AAED,MAAM,OAAO;IAAb;QACU,iBAAY,GAAkB,IAAI,CAAC;QACnC,eAAU,GAAkB,IAAI,CAAC;QACjC,cAAS,GAAoB,IAAI,CAAC;IAgC5C,CAAC;IA9BQ,KAAK;QACV,MAAM,IAAI,GACR,wBAAU,CAAC,IAAI;YACf,wBAAU,CAAC,SAAS;YACpB,IAAI,IAAI,CAAC,YAAY,EAAE;YACvB,wBAAU,CAAC,QAAQ;YACnB,IAAI,IAAI,CAAC,UAAU,EAAE;YACrB,wBAAU,CAAC,OAAO,CAAC;QAErB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC7C;QAED,OAAO,IAAI,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1D,CAAC;IAEM,WAAW,CAAC,WAAmB;QACpC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,SAAS,CAAC,SAAiB;QAChC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM,CAAC,MAAW,EAAE,QAAgB;QACzC,IAAI,CAAC,SAAS,GAAG,IAAA,gCAAe,EAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
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
|
+
*/
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
//# sourceMappingURL=put-object-request.interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"put-object-request.interface.js","sourceRoot":"","sources":["../../src/resource/put-object-request.interface.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"put-object-request.interface.js","sourceRoot":"","sources":["../../src/resource/put-object-request.interface.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -11,13 +11,10 @@
|
|
|
11
11
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
12
12
|
* and limitations under the License.
|
|
13
13
|
*/
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
15
|
exports.ReportPutObjectRequest = void 0;
|
|
16
|
+
const form_data_util_1 = require("../../utils/form-data-util");
|
|
19
17
|
const path_config_1 = require("../path-config");
|
|
20
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
21
18
|
class ReportPutObjectRequest {
|
|
22
19
|
constructor(path, formData) {
|
|
23
20
|
this.path = path;
|
|
@@ -42,9 +39,13 @@ class Builder {
|
|
|
42
39
|
this._formData = null;
|
|
43
40
|
}
|
|
44
41
|
build() {
|
|
45
|
-
const path = path_config_1.PathConfig.ROOT +
|
|
46
|
-
path_config_1.PathConfig.
|
|
47
|
-
|
|
42
|
+
const path = path_config_1.PathConfig.ROOT +
|
|
43
|
+
path_config_1.PathConfig.WORKSPACE +
|
|
44
|
+
`/${this._workspaceId}` +
|
|
45
|
+
path_config_1.PathConfig.PROJECTS +
|
|
46
|
+
`/${this._projectId}` +
|
|
47
|
+
path_config_1.PathConfig.REPORTS +
|
|
48
|
+
`/${this._reportId}` +
|
|
48
49
|
path_config_1.PathConfig.OBJECTS;
|
|
49
50
|
if (!this._formData) {
|
|
50
51
|
throw new Error('IllegalArgumentException');
|
|
@@ -64,10 +65,7 @@ class Builder {
|
|
|
64
65
|
return this;
|
|
65
66
|
}
|
|
66
67
|
append(buffer, fileName) {
|
|
67
|
-
|
|
68
|
-
this._formData = new form_data_1.default();
|
|
69
|
-
}
|
|
70
|
-
this._formData.append('file', buffer, fileName);
|
|
68
|
+
this._formData = (0, form_data_util_1.prepareFormData)(this._formData, buffer, fileName);
|
|
71
69
|
return this;
|
|
72
70
|
}
|
|
73
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-put-object-request.js","sourceRoot":"","sources":["../../../src/resource/report/report-put-object-request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG
|
|
1
|
+
{"version":3,"file":"report-put-object-request.js","sourceRoot":"","sources":["../../../src/resource/report/report-put-object-request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,+DAA6D;AAC7D,gDAA4C;AAG5C,MAAa,sBAAsB;IACjC,YACS,IAAY,EACZ,QAAkB;QADlB,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAU;IACxB,CAAC;IAEG,OAAO;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,MAAM,CAAC,OAAO;QACnB,OAAO,IAAI,OAAO,EAAE,CAAC;IACvB,CAAC;CACF;AAjBD,wDAiBC;AAED,MAAM,OAAO;IAAb;QACU,iBAAY,GAAkB,IAAI,CAAC;QACnC,eAAU,GAAkB,IAAI,CAAC;QACjC,cAAS,GAAkB,IAAI,CAAC;QAChC,cAAS,GAAoB,IAAI,CAAC;IAuC5C,CAAC;IArCQ,KAAK;QACV,MAAM,IAAI,GACR,wBAAU,CAAC,IAAI;YACf,wBAAU,CAAC,SAAS;YACpB,IAAI,IAAI,CAAC,YAAY,EAAE;YACvB,wBAAU,CAAC,QAAQ;YACnB,IAAI,IAAI,CAAC,UAAU,EAAE;YACrB,wBAAU,CAAC,OAAO;YAClB,IAAI,IAAI,CAAC,SAAS,EAAE;YACpB,wBAAU,CAAC,OAAO,CAAC;QAErB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC7C;QAED,OAAO,IAAI,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1D,CAAC;IAEM,WAAW,CAAC,WAAmB;QACpC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,SAAS,CAAC,SAAiB;QAChC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,QAAQ,CAAC,QAAgB;QAC9B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,MAAM,CAAC,MAAW,EAAE,QAAgB;QACzC,IAAI,CAAC,SAAS,GAAG,IAAA,gCAAe,EAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function prepareFormData(formData: FormData | null, buffer: any, fileName: string): FormData;
|
|
@@ -0,0 +1,59 @@
|
|
|
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.prepareFormData = void 0;
|
|
16
|
+
function prepareFormData(formData, buffer, fileName) {
|
|
17
|
+
if (!formData) {
|
|
18
|
+
formData = new FormData();
|
|
19
|
+
}
|
|
20
|
+
if (Buffer.isBuffer(buffer)) {
|
|
21
|
+
const type = resolveMimeType(fileName);
|
|
22
|
+
const blob = new Blob([new Uint8Array(buffer)], { type });
|
|
23
|
+
formData.append('file', blob, fileName);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
formData.append('file', buffer, fileName);
|
|
27
|
+
}
|
|
28
|
+
return formData;
|
|
29
|
+
}
|
|
30
|
+
exports.prepareFormData = prepareFormData;
|
|
31
|
+
const mimeMap = {
|
|
32
|
+
png: 'image/png',
|
|
33
|
+
jpg: 'image/jpeg',
|
|
34
|
+
jpeg: 'image/jpeg',
|
|
35
|
+
gif: 'image/gif',
|
|
36
|
+
webp: 'image/webp',
|
|
37
|
+
svg: 'image/svg+xml',
|
|
38
|
+
tif: 'image/tiff',
|
|
39
|
+
tiff: 'image/tiff',
|
|
40
|
+
txt: 'text/plain',
|
|
41
|
+
csv: 'text/csv',
|
|
42
|
+
json: 'application/json',
|
|
43
|
+
xml: 'application/xml',
|
|
44
|
+
pdf: 'application/pdf',
|
|
45
|
+
xls: 'application/vnd.ms-excel',
|
|
46
|
+
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
47
|
+
doc: 'application/msword',
|
|
48
|
+
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
49
|
+
ppt: 'application/vnd.ms-powerpoint',
|
|
50
|
+
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
51
|
+
zip: 'application/zip',
|
|
52
|
+
mp3: 'audio/mpeg',
|
|
53
|
+
mp4: 'video/mp4',
|
|
54
|
+
};
|
|
55
|
+
function resolveMimeType(fileName) {
|
|
56
|
+
const ext = fileName.split('.').pop()?.toLowerCase();
|
|
57
|
+
return ext && mimeMap[ext] ? mimeMap[ext] : 'application/octet-stream';
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=form-data-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-data-util.js","sourceRoot":"","sources":["../../src/utils/form-data-util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;G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,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE,CAAC;IACrD,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC;AACzE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rtc4js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "RapidTableConnector provides an SDK that allows easy CRUD operations using the Rest API provided by RapidTable.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,11 +20,9 @@
|
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "https://github.com/rapid-table/rapid-table-connector.git"
|
|
22
22
|
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"axios": "^1.4.0"
|
|
25
|
-
},
|
|
26
23
|
"devDependencies": {
|
|
27
24
|
"@types/jest": "^29.4.0",
|
|
25
|
+
"@types/node": "^25.9.1",
|
|
28
26
|
"dotenv": "^16.0.3",
|
|
29
27
|
"jest": "^29.5.0",
|
|
30
28
|
"ts-jest": "^29.0.5",
|