@dagger.io/dagger 0.6.4 → 0.8.1
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/dist/api/client.gen.d.ts +185 -96
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +374 -162
- package/dist/connect.d.ts +1 -1
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +8 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/provisioning/bin.d.ts +1 -1
- package/dist/provisioning/bin.d.ts.map +1 -1
- package/dist/provisioning/bin.js +17 -2
- package/dist/provisioning/default.d.ts +1 -1
- package/dist/provisioning/default.js +1 -1
- package/dist/provisioning/engineconn.d.ts +1 -1
- package/dist/provisioning/engineconn.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/connect.d.ts
CHANGED
package/dist/connect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../connect.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,MAAM,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../connect.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAG5C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAA;CACrB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAE3D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAC3B,EAAE,EAAE,WAAW,EACf,MAAM,GAAE,WAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAsCf"}
|
package/dist/connect.js
CHANGED
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import Client from "./api/client.gen.js";
|
|
10
|
+
import { Client } from "./api/client.gen.js";
|
|
11
11
|
import { Bin, CLI_VERSION } from "./provisioning/index.js";
|
|
12
12
|
/**
|
|
13
13
|
* connect runs GraphQL server and initializes a
|
|
@@ -38,6 +38,13 @@ export function connect(cb, config = {}) {
|
|
|
38
38
|
client = yield engineConn.Connect(config);
|
|
39
39
|
close = () => engineConn.Close();
|
|
40
40
|
}
|
|
41
|
+
// Warning shall be throw if versions are not compatible
|
|
42
|
+
try {
|
|
43
|
+
yield client.checkVersionCompatibility(CLI_VERSION);
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
console.error("failed to check version compatibility:", e);
|
|
47
|
+
}
|
|
41
48
|
yield cb(client).finally(() => __awaiter(this, void 0, void 0, function* () {
|
|
42
49
|
if (close) {
|
|
43
50
|
close();
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from "./api/client.gen.js";
|
|
2
2
|
export * from "./common/errors/index.js";
|
|
3
|
-
export { default } from "./api/client.gen.js";
|
|
4
3
|
export { gql } from "graphql-tag";
|
|
5
4
|
export { GraphQLClient } from "graphql-request";
|
|
6
5
|
export { connect, ConnectOpts, CallbackFct } from "./connect.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../provisioning/bin.ts"],"names":[],"mappings":"AAaA,OAAO,MAAM,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../provisioning/bin.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAQ7C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAMzD;;GAEG;AACH,qBAAa,GAAI,YAAW,UAAU;IACpC,OAAO,CAAC,UAAU,CAAC,CAAmB;IAEtC,OAAO,CAAC,OAAO,CAAC,CAAQ;IACxB,OAAO,CAAC,UAAU,CAAC,CAAQ;IAE3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAKxB;IAED,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAW;gBAErC,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAKjD,IAAI,IAAI,MAAM;IAIR,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;YAgBnC,WAAW;IAgEzB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAqBrB;;;OAGG;YACW,gBAAgB;YAwEhB,iBAAiB;IA2BzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAU5B;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAItB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB;;OAEG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;IACH,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,cAAc;YAOR,WAAW;YAkBX,gBAAgB;YAWhB,cAAc;IA4C5B;;OAEG;IACH,OAAO,CAAC,WAAW;CAGpB;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEjD;AAGD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE1D"}
|
package/dist/provisioning/bin.js
CHANGED
|
@@ -26,7 +26,7 @@ import * as process from "process";
|
|
|
26
26
|
import readline from "readline";
|
|
27
27
|
import * as tar from "tar";
|
|
28
28
|
import { fileURLToPath } from "url";
|
|
29
|
-
import Client from "../api/client.gen.js";
|
|
29
|
+
import { Client } from "../api/client.gen.js";
|
|
30
30
|
import { EngineSessionConnectionTimeoutError, EngineSessionConnectParamsParseError, EngineSessionError, InitEngineSessionBinaryError, } from "../common/errors/index.js";
|
|
31
31
|
const CLI_HOST = "dl.dagger.io";
|
|
32
32
|
let OVERRIDE_CLI_URL;
|
|
@@ -48,7 +48,13 @@ export class Bin {
|
|
|
48
48
|
Connect(opts) {
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
50
|
if (!this.binPath) {
|
|
51
|
+
if (opts.LogOutput) {
|
|
52
|
+
opts.LogOutput.write("Downloading CLI... ");
|
|
53
|
+
}
|
|
51
54
|
this.binPath = yield this.downloadCLI();
|
|
55
|
+
if (opts.LogOutput) {
|
|
56
|
+
opts.LogOutput.write("OK!\n");
|
|
57
|
+
}
|
|
52
58
|
}
|
|
53
59
|
return this.runEngineSession(this.binPath, opts);
|
|
54
60
|
});
|
|
@@ -145,6 +151,9 @@ export class Bin {
|
|
|
145
151
|
args.push(pair.flag, pair.value);
|
|
146
152
|
}
|
|
147
153
|
});
|
|
154
|
+
if (opts.LogOutput) {
|
|
155
|
+
opts.LogOutput.write("Creating new Engine session... ");
|
|
156
|
+
}
|
|
148
157
|
this.subProcess = execaCommand(args.join(" "), {
|
|
149
158
|
stdio: "pipe",
|
|
150
159
|
reject: true,
|
|
@@ -159,14 +168,20 @@ export class Bin {
|
|
|
159
168
|
input: (_b = this.subProcess) === null || _b === void 0 ? void 0 : _b.stdout,
|
|
160
169
|
});
|
|
161
170
|
const timeOutDuration = 300000;
|
|
171
|
+
if (opts.LogOutput) {
|
|
172
|
+
opts.LogOutput.write("OK!\nEstablishing connection to Engine... ");
|
|
173
|
+
}
|
|
162
174
|
const connectParams = (yield Promise.race([
|
|
163
175
|
this.readConnectParams(stdoutReader),
|
|
164
176
|
new Promise((_, reject) => {
|
|
165
177
|
setTimeout(() => {
|
|
166
|
-
reject(new EngineSessionConnectionTimeoutError("
|
|
178
|
+
reject(new EngineSessionConnectionTimeoutError("Engine connection timeout", { timeOutDuration }));
|
|
167
179
|
}, timeOutDuration).unref(); // long timeout to account for extensions, though that should be optimized in future
|
|
168
180
|
}),
|
|
169
181
|
]));
|
|
182
|
+
if (opts.LogOutput) {
|
|
183
|
+
opts.LogOutput.write("OK!\n");
|
|
184
|
+
}
|
|
170
185
|
return new Client({
|
|
171
186
|
host: `127.0.0.1:${connectParams.port}`,
|
|
172
187
|
sessionToken: connectParams.session_token,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.
|
|
1
|
+
export declare const CLI_VERSION = "0.8.1";
|
|
2
2
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Code generated by dagger. DO NOT EDIT.
|
|
2
|
-
export const CLI_VERSION = "0.
|
|
2
|
+
export const CLI_VERSION = "0.8.1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engineconn.d.ts","sourceRoot":"","sources":["../../provisioning/engineconn.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,MAAM,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"engineconn.d.ts","sourceRoot":"","sources":["../../provisioning/engineconn.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,MAAM,CAAA;IAElB;;;OAGG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAE/C;;OAEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dagger.io/dagger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"author": "hello@dagger.io",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@lifeomic/axios-fetch": "^3.0.1",
|
|
20
20
|
"adm-zip": "^0.5.10",
|
|
21
21
|
"env-paths": "^3.0.0",
|
|
22
|
-
"execa": "^7.
|
|
22
|
+
"execa": "^7.2.0",
|
|
23
23
|
"graphql": "^16.7.1",
|
|
24
24
|
"graphql-request": "^6.1.0",
|
|
25
25
|
"graphql-tag": "^2.12.6",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"docs:fmt": "yarn eslint --fix --resolve-plugins-relative-to=./ --ext=.js,.ts,.mjs,.mts ../../docs/current ."
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@trivago/prettier-plugin-sort-imports": "^4.
|
|
40
|
+
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
|
41
41
|
"@types/adm-zip": "^0.5.0",
|
|
42
42
|
"@types/mocha": "latest",
|
|
43
43
|
"@types/node": "~16",
|
|
44
44
|
"@types/tar": "^6.1.4",
|
|
45
45
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
46
46
|
"@typescript-eslint/parser": "^5.62.0",
|
|
47
|
-
"eslint": "^8.
|
|
48
|
-
"eslint-config-prettier": "^8.
|
|
47
|
+
"eslint": "^8.46.0",
|
|
48
|
+
"eslint-config-prettier": "^8.9.0",
|
|
49
49
|
"eslint-plugin-prettier": "^4.2.1",
|
|
50
50
|
"mocha": "^10.2.0",
|
|
51
51
|
"prettier": "^2.8.7",
|