bdy 1.23.20-dev → 1.23.22-dev
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/distTs/package.json +3 -2
- package/distTs/src/api/client.js +16 -7
- package/package.json +3 -2
package/distTs/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bdy",
|
|
3
3
|
"preferGlobal": false,
|
|
4
|
-
"version": "1.23.
|
|
4
|
+
"version": "1.23.22-dev",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://buddy.works/docs/cli",
|
|
@@ -119,13 +119,14 @@
|
|
|
119
119
|
"@types/tar-stream": "3.1.4",
|
|
120
120
|
"@types/terminal-kit": "2.5.7",
|
|
121
121
|
"@types/unzipper": "0.10.11",
|
|
122
|
-
"@types/uuid": "11.0.0",
|
|
123
122
|
"@types/which": "3.0.4",
|
|
124
123
|
"@types/ws": "8.18.1",
|
|
125
124
|
"eslint": "10.4.1",
|
|
126
125
|
"eslint-config-prettier": "10.1.8",
|
|
127
126
|
"globals": "17.6.0",
|
|
127
|
+
"postject": "1.0.0-alpha.6",
|
|
128
128
|
"prettier": "3.8.4",
|
|
129
|
+
"resedit-cli": "2.1.0",
|
|
129
130
|
"rollup": "4.61.1",
|
|
130
131
|
"rollup-plugin-natives": "0.7.8",
|
|
131
132
|
"typescript": "6.0.3",
|
package/distTs/src/api/client.js
CHANGED
|
@@ -4,12 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.formDataFileName = void 0;
|
|
7
|
-
const undici_1 = require("undici");
|
|
8
7
|
const texts_1 = require("../texts");
|
|
9
8
|
const logger_1 = __importDefault(require("../logger"));
|
|
10
9
|
const utils_1 = require("../utils");
|
|
11
10
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
12
11
|
const cfg_1 = __importDefault(require("../tunnel/cfg"));
|
|
12
|
+
// Resolved on first use rather than imported. Loading undici costs ~0.25s of the CLI's ~0.33s
|
|
13
|
+
// startup, and this file is on the import path of nearly every command - including the ones that
|
|
14
|
+
// never make a request (`--help`, local config, anything that exits on a validation error). Every
|
|
15
|
+
// other undici caller in the CLI already requires it lazily; this was the last eager one.
|
|
16
|
+
let _undici;
|
|
17
|
+
const undici = () => {
|
|
18
|
+
if (!_undici)
|
|
19
|
+
_undici = require('undici');
|
|
20
|
+
return _undici;
|
|
21
|
+
};
|
|
13
22
|
/**
|
|
14
23
|
* Name a file is sent under in a multipart body. FormData escapes these
|
|
15
24
|
* characters in the Content-Disposition header, so the server can only ever
|
|
@@ -52,7 +61,7 @@ class ApiClient {
|
|
|
52
61
|
this.clientId = clientId;
|
|
53
62
|
this.clientSecret = clientSecret;
|
|
54
63
|
this.clientToken = clientToken;
|
|
55
|
-
this.client = new
|
|
64
|
+
this.client = new (undici().Pool)(baseUrl, {
|
|
56
65
|
connect: {
|
|
57
66
|
rejectUnauthorized: !(0, utils_1.canSkipSslVerify)(baseUrl.hostname),
|
|
58
67
|
},
|
|
@@ -93,7 +102,7 @@ class ApiClient {
|
|
|
93
102
|
}
|
|
94
103
|
let bodyParsed = undefined;
|
|
95
104
|
if (body) {
|
|
96
|
-
if (body instanceof
|
|
105
|
+
if (body instanceof undici().FormData) {
|
|
97
106
|
bodyParsed = body;
|
|
98
107
|
}
|
|
99
108
|
else {
|
|
@@ -847,7 +856,7 @@ class ApiClient {
|
|
|
847
856
|
if (userName) {
|
|
848
857
|
query = { userName };
|
|
849
858
|
}
|
|
850
|
-
const formData = new
|
|
859
|
+
const formData = new (undici().FormData)();
|
|
851
860
|
const file = await node_fs_1.default.openAsBlob(localPath);
|
|
852
861
|
formData.set('file', file);
|
|
853
862
|
const encodedRemotePath = remotePath
|
|
@@ -1425,7 +1434,7 @@ class ApiClient {
|
|
|
1425
1434
|
});
|
|
1426
1435
|
}
|
|
1427
1436
|
async createArtifactComposerVersion(workspace, artifactId, root, composer, readme, note, agentNote) {
|
|
1428
|
-
const form = new
|
|
1437
|
+
const form = new (undici().FormData)();
|
|
1429
1438
|
form.append('root', root);
|
|
1430
1439
|
form.append('composer', composer);
|
|
1431
1440
|
if (readme)
|
|
@@ -1462,7 +1471,7 @@ class ApiClient {
|
|
|
1462
1471
|
});
|
|
1463
1472
|
}
|
|
1464
1473
|
async uploadRunFiles(workspace, project, pipelineId, files) {
|
|
1465
|
-
const form = new
|
|
1474
|
+
const form = new (undici().FormData)();
|
|
1466
1475
|
files.forEach((f) => {
|
|
1467
1476
|
form.append(f.name, f.file, f.name);
|
|
1468
1477
|
});
|
|
@@ -1474,7 +1483,7 @@ class ApiClient {
|
|
|
1474
1483
|
});
|
|
1475
1484
|
}
|
|
1476
1485
|
async createArtifactVersionZip(workspace, artifactId, versionId, file) {
|
|
1477
|
-
const form = new
|
|
1486
|
+
const form = new (undici().FormData)();
|
|
1478
1487
|
form.append('file', file, 'file.zip');
|
|
1479
1488
|
return await this.request({
|
|
1480
1489
|
method: 'POST',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bdy",
|
|
3
3
|
"preferGlobal": false,
|
|
4
|
-
"version": "1.23.
|
|
4
|
+
"version": "1.23.22-dev",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://buddy.works/docs/cli",
|
|
@@ -119,13 +119,14 @@
|
|
|
119
119
|
"@types/tar-stream": "3.1.4",
|
|
120
120
|
"@types/terminal-kit": "2.5.7",
|
|
121
121
|
"@types/unzipper": "0.10.11",
|
|
122
|
-
"@types/uuid": "11.0.0",
|
|
123
122
|
"@types/which": "3.0.4",
|
|
124
123
|
"@types/ws": "8.18.1",
|
|
125
124
|
"eslint": "10.4.1",
|
|
126
125
|
"eslint-config-prettier": "10.1.8",
|
|
127
126
|
"globals": "17.6.0",
|
|
127
|
+
"postject": "1.0.0-alpha.6",
|
|
128
128
|
"prettier": "3.8.4",
|
|
129
|
+
"resedit-cli": "2.1.0",
|
|
129
130
|
"rollup": "4.61.1",
|
|
130
131
|
"rollup-plugin-natives": "0.7.8",
|
|
131
132
|
"typescript": "6.0.3",
|