@dagger.io/dagger 0.11.2 → 0.11.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.
- package/dist/api/client.gen.d.ts +77 -1
- package/dist/api/client.gen.d.ts.map +1 -1
- package/dist/api/client.gen.js +182 -1
- package/dist/common/utils.d.ts +2 -1
- package/dist/common/utils.d.ts.map +1 -1
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +18 -2
- package/dist/context/context.d.ts +1 -0
- package/dist/context/context.d.ts.map +1 -1
- package/dist/context/context.js +6 -0
- package/dist/entrypoint/entrypoint.d.ts.map +1 -1
- package/dist/entrypoint/entrypoint.js +19 -9
- package/dist/entrypoint/load.d.ts +5 -5
- package/dist/entrypoint/load.d.ts.map +1 -1
- package/dist/entrypoint/load.js +1 -0
- package/dist/entrypoint/register.d.ts.map +1 -1
- package/dist/entrypoint/register.js +2 -0
- package/dist/graphql/client.d.ts.map +1 -1
- package/dist/graphql/client.js +8 -1
- package/dist/introspector/registry/registry.d.ts +2 -2
- package/dist/introspector/registry/registry.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/argument.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/argument.js +2 -4
- package/dist/introspector/scanner/abtractions/constructor.d.ts +1 -1
- package/dist/introspector/scanner/abtractions/constructor.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/method.d.ts +1 -1
- package/dist/introspector/scanner/abtractions/method.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/method.js +2 -3
- package/dist/introspector/scanner/abtractions/module.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/module.js +1 -1
- package/dist/introspector/scanner/abtractions/object.d.ts +1 -1
- package/dist/introspector/scanner/abtractions/object.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/object.js +2 -2
- package/dist/introspector/scanner/abtractions/property.d.ts +1 -1
- package/dist/introspector/scanner/abtractions/property.d.ts.map +1 -1
- package/dist/introspector/scanner/abtractions/property.js +2 -4
- package/dist/introspector/scanner/scan.d.ts +1 -1
- package/dist/introspector/scanner/scan.d.ts.map +1 -1
- package/dist/introspector/scanner/typeDefs.d.ts +10 -2
- package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
- package/dist/introspector/scanner/utils.d.ts +2 -2
- package/dist/introspector/scanner/utils.d.ts.map +1 -1
- package/dist/introspector/scanner/utils.js +30 -11
- package/dist/provisioning/default.d.ts +1 -1
- package/dist/provisioning/default.js +1 -1
- package/dist/telemetry/attributes.d.ts +13 -0
- package/dist/telemetry/attributes.d.ts.map +1 -0
- package/dist/telemetry/attributes.js +12 -0
- package/dist/telemetry/index.d.ts +3 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +2 -0
- package/dist/telemetry/init.d.ts +21 -0
- package/dist/telemetry/init.d.ts.map +1 -0
- package/dist/telemetry/init.js +66 -0
- package/dist/telemetry/telemetry.d.ts +16 -0
- package/dist/telemetry/telemetry.d.ts.map +1 -0
- package/dist/telemetry/telemetry.js +38 -0
- package/dist/telemetry/tracer.d.ts +32 -0
- package/dist/telemetry/tracer.d.ts.map +1 -0
- package/dist/telemetry/tracer.js +54 -0
- package/package.json +21 -12
- package/dist/introspector/scanner/serialize.d.ts +0 -10
- package/dist/introspector/scanner/serialize.d.ts.map +0 -1
- package/dist/introspector/scanner/serialize.js +0 -15
|
@@ -25,6 +25,7 @@ export declare class Context {
|
|
|
25
25
|
* If no client is set, it will create one.
|
|
26
26
|
*/
|
|
27
27
|
connection(cfg?: ConnectOpts): Promise<GraphQLClient>;
|
|
28
|
+
getGQLClient(): GraphQLClient;
|
|
28
29
|
/**
|
|
29
30
|
* Close the connection and the engine if this one was started by the node
|
|
30
31
|
* SDK.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../context/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/C,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,UAAU,CAAC,EAAE,iBAAiB,CAAA;CAC/B;AAED;;;;;;;;;GASG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,OAAO,CAAC,CAAe;IAC/B,OAAO,CAAC,WAAW,CAAC,CAAmB;gBAE3B,MAAM,CAAC,EAAE,aAAa;IAKlC;;;;OAIG;IACU,UAAU,CAAC,GAAG,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../context/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/C,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,UAAU,CAAC,EAAE,iBAAiB,CAAA;CAC/B;AAED;;;;;;;;;GASG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,OAAO,CAAC,CAAe;IAC/B,OAAO,CAAC,WAAW,CAAC,CAAmB;gBAE3B,MAAM,CAAC,EAAE,aAAa;IAKlC;;;;OAIG;IACU,UAAU,CAAC,GAAG,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAU/D,YAAY,IAAI,aAAa;IAUpC;;;OAGG;IACI,KAAK,IAAI,IAAI;CAYrB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,SAAgB,CAAA"}
|
package/dist/context/context.js
CHANGED
|
@@ -29,6 +29,12 @@ export class Context {
|
|
|
29
29
|
}
|
|
30
30
|
return this._client;
|
|
31
31
|
}
|
|
32
|
+
getGQLClient() {
|
|
33
|
+
if (!this._client) {
|
|
34
|
+
throw new Error("graphQL connection not established yet, please use it inside a connect or connection function.");
|
|
35
|
+
}
|
|
36
|
+
return this._client;
|
|
37
|
+
}
|
|
32
38
|
/**
|
|
33
39
|
* Close the connection and the engine if this one was started by the node
|
|
34
40
|
* SDK.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../entrypoint/entrypoint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../entrypoint/entrypoint.ts"],"names":[],"mappings":"AAmBA,wBAAsB,UAAU,kBA+E/B"}
|
|
@@ -4,6 +4,8 @@ import { dag } from "../api/client.gen.js";
|
|
|
4
4
|
import { connection } from "../connect.js";
|
|
5
5
|
import { scan } from "../introspector/scanner/scan.js";
|
|
6
6
|
import { listFiles } from "../introspector/utils/files.js";
|
|
7
|
+
import { UI_MASK, UI_PASSTHROUGH } from "../telemetry/attributes.js";
|
|
8
|
+
import { getTracer } from "../telemetry/index.js";
|
|
7
9
|
import { invoke } from "./invoke.js";
|
|
8
10
|
import { load } from "./load.js";
|
|
9
11
|
import { register } from "./register.js";
|
|
@@ -24,9 +26,9 @@ export async function entrypoint() {
|
|
|
24
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
27
|
let result;
|
|
26
28
|
if (parentName === "") {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
result = await getTracer().startActiveSpan("typescript module registration", async () => {
|
|
30
|
+
return await register(files, scanResult);
|
|
31
|
+
}, { [UI_MASK]: true });
|
|
30
32
|
}
|
|
31
33
|
else {
|
|
32
34
|
// Invocation
|
|
@@ -40,16 +42,24 @@ export async function entrypoint() {
|
|
|
40
42
|
}
|
|
41
43
|
await load(files);
|
|
42
44
|
try {
|
|
43
|
-
result = await
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
result = await getTracer().startActiveSpan("typescript module execution", async () => {
|
|
46
|
+
return await invoke(scanResult, {
|
|
47
|
+
parentName,
|
|
48
|
+
fnName,
|
|
49
|
+
parentArgs,
|
|
50
|
+
fnArgs: args,
|
|
51
|
+
});
|
|
52
|
+
}, {
|
|
53
|
+
[UI_MASK]: true,
|
|
54
|
+
[UI_PASSTHROUGH]: true,
|
|
48
55
|
});
|
|
49
56
|
}
|
|
50
57
|
catch (e) {
|
|
51
58
|
if (e instanceof Error) {
|
|
52
|
-
console.error(
|
|
59
|
+
console.error(`Error: ${e.message}`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.error(e);
|
|
53
63
|
}
|
|
54
64
|
process.exit(1);
|
|
55
65
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TypeDefKind } from "../api/client.gen.js";
|
|
2
|
-
import {
|
|
3
|
-
import { InvokeCtx } from "./context.js";
|
|
4
|
-
import { DaggerModule } from "../introspector/scanner/abtractions/module.js";
|
|
5
|
-
import { Method } from "../introspector/scanner/abtractions/method.js";
|
|
2
|
+
import { Args } from "../introspector/registry/registry.js";
|
|
6
3
|
import { Constructor } from "../introspector/scanner/abtractions/constructor.js";
|
|
4
|
+
import { Method } from "../introspector/scanner/abtractions/method.js";
|
|
5
|
+
import { DaggerModule } from "../introspector/scanner/abtractions/module.js";
|
|
7
6
|
import { DaggerObject } from "../introspector/scanner/abtractions/object.js";
|
|
8
|
-
import {
|
|
7
|
+
import { TypeDef } from "../introspector/scanner/typeDefs.js";
|
|
8
|
+
import { InvokeCtx } from "./context.js";
|
|
9
9
|
/**
|
|
10
10
|
* Import all given typescript files so that trigger their decorators
|
|
11
11
|
* and register their class and functions inside the Registry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../entrypoint/load.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../entrypoint/load.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,MAAM,GACjB,YAAY,CAEd;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,SAAS,GACb,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,SAAS,CAMpC;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,MAAM,GAAG,WAAW,EAC5B,GAAG,EAAE,SAAS,GACb,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,SAAS,GACb,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,GAAG,EACV,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GACzB,OAAO,CAAC,GAAG,CAAC,CAuCd;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,GACb,YAAY,CAmBd;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,GAAG,CAAC,CAoDd"}
|
package/dist/entrypoint/load.js
CHANGED
|
@@ -107,6 +107,7 @@ export async function loadValue(value, type) {
|
|
|
107
107
|
case TypeDefKind.IntegerKind:
|
|
108
108
|
case TypeDefKind.BooleanKind:
|
|
109
109
|
case TypeDefKind.VoidKind:
|
|
110
|
+
case TypeDefKind.ScalarKind:
|
|
110
111
|
return value;
|
|
111
112
|
default:
|
|
112
113
|
throw new Error(`unsupported type ${type.kind}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../entrypoint/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EAGT,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAA;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../entrypoint/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EAGT,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAW5E;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,QAAQ,CAAC,CA8CnB"}
|
|
@@ -84,6 +84,8 @@ function addArg(args) {
|
|
|
84
84
|
*/
|
|
85
85
|
function addTypeDef(type) {
|
|
86
86
|
switch (type.kind) {
|
|
87
|
+
case TypeDefKind.ScalarKind:
|
|
88
|
+
return dag.typeDef().withScalar(type.name);
|
|
87
89
|
case TypeDefKind.ObjectKind:
|
|
88
90
|
return dag.typeDef().withObject(type.name);
|
|
89
91
|
case TypeDefKind.ListKind:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../graphql/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../graphql/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAiB1E"}
|
package/dist/graphql/client.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import * as opentelemetry from "@opentelemetry/api";
|
|
1
2
|
import { GraphQLClient } from "graphql-request";
|
|
2
3
|
export function createGQLClient(port, token) {
|
|
3
|
-
|
|
4
|
+
const client = new GraphQLClient(`http://127.0.0.1:${port}/query`, {
|
|
4
5
|
headers: {
|
|
5
6
|
Authorization: "Basic " + Buffer.from(token + ":").toString("base64"),
|
|
6
7
|
},
|
|
8
|
+
// Inject trace parent into the request headers so it can be correctly linked
|
|
9
|
+
requestMiddleware: async (req) => {
|
|
10
|
+
opentelemetry.propagation.inject(opentelemetry.context.active(), req.headers);
|
|
11
|
+
return req;
|
|
12
|
+
},
|
|
7
13
|
});
|
|
14
|
+
return client;
|
|
8
15
|
}
|
|
@@ -33,12 +33,12 @@ export declare class Registry {
|
|
|
33
33
|
*
|
|
34
34
|
* @param alias The alias to use for the field when exposed on the API.
|
|
35
35
|
*/
|
|
36
|
-
field: (alias?: string) => (target: object, propertyKey: string) => void;
|
|
36
|
+
field: (alias?: string) => ((target: object, propertyKey: string) => void);
|
|
37
37
|
/**
|
|
38
38
|
* The definition of @func decorator that should be on top of any
|
|
39
39
|
* class' method that must be exposed to the Dagger API.
|
|
40
40
|
*/
|
|
41
|
-
func: (alias?: string) => (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void;
|
|
41
|
+
func: (alias?: string) => ((target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void);
|
|
42
42
|
/**
|
|
43
43
|
* getResult check for the object and method in the registry and call it
|
|
44
44
|
* with the given input and state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../introspector/registry/registry.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAA;AAIzB,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;CAAE,CAAA;AAEjD,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAE/C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAU1C;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;IACH,MAAM
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../introspector/registry/registry.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAA;AAIzB,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;CAAE,CAAA;AAEjD,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAE/C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAU1C;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;IACH,MAAM,uCAAuC,CAAC,KAAK,CAAC,CAMnD;IAED;;;;;OAKG;IACH,KAAK,WAAY,MAAM,KAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,CAIxE;IAED;;;OAGG;IACH,IAAI,WACM,MAAM,KACb,CAAC,CACF,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,UAAU,EAAE,kBAAkB,KAC3B,IAAI,CAAC,CAUT;IAED;;;;;;;;;;OAUG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,IAAI,GACX,OAAO,CAAC,GAAG,CAAC;CAiChB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAiB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argument.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/argument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"argument.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/argument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAG5D,MAAM,MAAM,SAAS,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA;AAEpD;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAW;IAEzB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,KAAK,CAAyB;IAEtC;;;;;;;;OAQG;gBACS,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM;IAuBrD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,WAAW,IAAI,MAAM,CAIxB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,CAc/B;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAMrC;IAED;;;;;;;OAOG;IACH,IAAI,UAAU,IAAI,OAAO,CAMxB;IAED;;;;;;OAMG;IACH,IAAI,UAAU,IAAI,OAAO,CAcxB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAID,IAAI,OAAO,IAAI,kBAAkB,CAShC;IAED,MAAM;;;;;;;;;IAYN;;;;;;;;;;OAUG;IACH,OAAO,CAAC,kBAAkB;CAU3B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { UnknownDaggerError } from "../../../common/errors/UnknownDaggerError.js";
|
|
3
|
-
import {
|
|
4
|
-
import { typeNameToTypedef } from "../utils.js";
|
|
3
|
+
import { typeToTypedef } from "../utils.js";
|
|
5
4
|
/**
|
|
6
5
|
* Argument is an abstraction of a function argument.
|
|
7
6
|
*
|
|
@@ -48,8 +47,7 @@ export class Argument {
|
|
|
48
47
|
throw new UnknownDaggerError("could not find symbol value declaration", {});
|
|
49
48
|
}
|
|
50
49
|
const type = this.checker.getTypeOfSymbolAtLocation(this.symbol, this.symbol.valueDeclaration);
|
|
51
|
-
|
|
52
|
-
return typeNameToTypedef(typeName);
|
|
50
|
+
return typeToTypedef(this.checker, type);
|
|
53
51
|
}
|
|
54
52
|
get defaultValue() {
|
|
55
53
|
if (this.param.initializer === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructor.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/constructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"constructor.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/constructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,kBAAkB,EAAsB,MAAM,gBAAgB,CAAA;AACvE,OAAO,EAAY,SAAS,EAAE,MAAM,eAAe,CAAA;AAEnD,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,WAAW,CAA2B;gBAElC,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,CAAC,sBAAsB;IAK3E,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,SAAS,IAAI,SAAS,CAgBzB;IAID,IAAI,OAAO,IAAI,kBAAkB,CAWhC;IAED,MAAM;;;IAMN,WAAW,IAAI,MAAM,EAAE;CAGxB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { Arguments } from "./argument.js";
|
|
3
2
|
import { TypeDefKind } from "../../../api/client.gen.js";
|
|
4
3
|
import { FunctionTypedef, TypeDef } from "../typeDefs.js";
|
|
4
|
+
import { Arguments } from "./argument.js";
|
|
5
5
|
export type Methods = {
|
|
6
6
|
[name: string]: Method;
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAsB,eAAe,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7E,OAAO,EAAY,SAAS,EAAE,MAAM,eAAe,CAAA;AAInD,MAAM,MAAM,OAAO,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAA;AAEhD;;;;;GAKG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,MAAM,CAAsB;IAEpC,OAAO,CAAC,MAAM,CAAW;IAEzB,OAAO,CAAC,SAAS,CAAc;IAE/B,OAAO,CAAC,SAAS,CAA0B;IAE3C;;;;;;;;OAQG;gBACS,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,CAAC,iBAAiB;IAiCjE,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,WAAW,IAAI,MAAM,CAIxB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAa9B;IAED,IAAI,SAAS,IAAI,SAAS,CAQzB;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,CAErC;IAED,IAAI,OAAO,IAAI,eAAe,CAe7B;IAED,MAAM;;;;;;;IAUN,WAAW,IAAI,MAAM,EAAE;CAGxB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { UnknownDaggerError } from "../../../common/errors/UnknownDaggerError.js";
|
|
3
|
+
import { typeToTypedef } from "../utils.js";
|
|
3
4
|
import { Argument } from "./argument.js";
|
|
4
|
-
import { serializeType } from "../serialize.js";
|
|
5
|
-
import { typeNameToTypedef } from "../utils.js";
|
|
6
5
|
const METHOD_DECORATOR = "func";
|
|
7
6
|
/**
|
|
8
7
|
* Method is an abstraction of a function or method.
|
|
@@ -76,7 +75,7 @@ export class Method {
|
|
|
76
75
|
* Return the type of the return value in a Dagger TypeDef format.
|
|
77
76
|
*/
|
|
78
77
|
get returnType() {
|
|
79
|
-
return
|
|
78
|
+
return typeToTypedef(this.checker, this.signature.getReturnType());
|
|
80
79
|
}
|
|
81
80
|
get typeDef() {
|
|
82
81
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEzD,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IAEhC,IAAI,EAAE,MAAM,CAAA;gBAGjB,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,oBAAK,EACT,KAAK,EAAE,SAAS,EAAE,CAAC,UAAU,EAAE;IAOjC,IAAI,OAAO,IAAI,aAAa,CAc3B;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAgCpC;IAED,MAAM;;;;;;;CAcP"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
+
import { ClassTypeDef } from "../typeDefs.js";
|
|
2
3
|
import { Constructor } from "./constructor.js";
|
|
3
4
|
import { Methods } from "./method.js";
|
|
4
5
|
import { Properties } from "./property.js";
|
|
5
|
-
import { ClassTypeDef } from "../typeDefs.js";
|
|
6
6
|
export type DaggerObjects = {
|
|
7
7
|
[name: string]: DaggerObject;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,YAAY,EAAiC,MAAM,gBAAgB,CAAA;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAU,OAAO,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAY,MAAM,eAAe,CAAA;AAEpD,MAAM,MAAM,aAAa,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;CAAE,CAAA;AAE5D,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,KAAK,CAAqB;IAElC,OAAO,CAAC,MAAM,CAAW;IAElB,IAAI,EAAE,EAAE,CAAC,UAAU,CAAA;IAE1B;;;;;;;OAOG;gBAED,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,UAAU,EACnB,gBAAgB,EAAE,EAAE,CAAC,gBAAgB;IAwBvC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,WAAW,IAAI,MAAM,CAIxB;IAED,IAAI,YAAY,IAAI,WAAW,GAAG,SAAS,CAe1C;IAED,IAAI,OAAO,IAAI,OAAO,CAUrB;IAED,IAAI,UAAU,IAAI,UAAU,CAY3B;IAID,IAAI,OAAO,IAAI,YAAY,CAoB1B;IAED,MAAM;;;;;;;CASP"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import { Constructor } from "./constructor.js";
|
|
3
2
|
import { UnknownDaggerError } from "../../../common/errors/UnknownDaggerError.js";
|
|
3
|
+
import { isFunction } from "../utils.js";
|
|
4
|
+
import { Constructor } from "./constructor.js";
|
|
4
5
|
import { Method } from "./method.js";
|
|
5
6
|
import { Property } from "./property.js";
|
|
6
|
-
import { isFunction } from "../utils.js";
|
|
7
7
|
export class DaggerObject {
|
|
8
8
|
checker;
|
|
9
9
|
class;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"property.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAKtD,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,CAAA;AAErD;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAW;IAEzB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,QAAQ,CAAwB;IAExC,OAAO,CAAC,SAAS,CAA0B;IAE3C;;;;;;OAMG;gBACS,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE,CAAC,mBAAmB;IAuBrE,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,WAAW,IAAI,MAAM,CAIxB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAa9B;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,CAc/B;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAID,IAAI,OAAO,IAAI,YAAY,CAQ1B;IAED,MAAM;;;;;;;CASP"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { UnknownDaggerError } from "../../../common/errors/UnknownDaggerError.js";
|
|
3
|
-
import {
|
|
4
|
-
import { typeNameToTypedef } from "../utils.js";
|
|
3
|
+
import { typeToTypedef } from "../utils.js";
|
|
5
4
|
const PROPERTY_DECORATOR = "field";
|
|
6
5
|
/**
|
|
7
6
|
* Property is an abstraction of a class property.
|
|
@@ -64,8 +63,7 @@ export class Property {
|
|
|
64
63
|
throw new UnknownDaggerError("could not find symbol value declaration", {});
|
|
65
64
|
}
|
|
66
65
|
const type = this.checker.getTypeOfSymbolAtLocation(this.symbol, this.symbol.valueDeclaration);
|
|
67
|
-
|
|
68
|
-
return typeNameToTypedef(typeName);
|
|
66
|
+
return typeToTypedef(this.checker, type);
|
|
69
67
|
}
|
|
70
68
|
get isExposed() {
|
|
71
69
|
return this.decorator !== undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/scan.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/scan.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE7D,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE;QACN,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE,CAAA;IACzC,SAAS,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAA;CAC/C,CAAA;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,UAAU,SAAK,GAAG,YAAY,CAUnE"}
|
|
@@ -12,6 +12,13 @@ export type ObjectTypeDef = BaseTypeDef & {
|
|
|
12
12
|
kind: TypeDefKind.ObjectKind;
|
|
13
13
|
name: string;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Extends the base typedef if it's a scalar to add its name and real type.
|
|
17
|
+
*/
|
|
18
|
+
export type ScalarTypeDef = BaseTypeDef & {
|
|
19
|
+
kind: TypeDefKind.ScalarKind;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
15
22
|
/**
|
|
16
23
|
* Extends the base if it's a list to add its subtype.
|
|
17
24
|
*/
|
|
@@ -23,10 +30,11 @@ export type ListTypeDef = BaseTypeDef & {
|
|
|
23
30
|
* A generic TypeDef that will dynamically add necessary properties
|
|
24
31
|
* depending on its type.
|
|
25
32
|
*
|
|
26
|
-
* If it's type of kind
|
|
33
|
+
* If it's a type of kind scalar, it transforms the BaseTypeDef into a ScalarTypeDef.
|
|
34
|
+
* If it's type of kind object, it transforms the BaseTypeDef into an ObjectTypeDef.
|
|
27
35
|
* If it's a type of kind list, it transforms the BaseTypeDef into a ListTypeDef.
|
|
28
36
|
*/
|
|
29
|
-
export type TypeDef<T extends BaseTypeDef["kind"]> = T extends TypeDefKind.ObjectKind ? ObjectTypeDef : T extends TypeDefKind.ListKind ? ListTypeDef : BaseTypeDef;
|
|
37
|
+
export type TypeDef<T extends BaseTypeDef["kind"]> = T extends TypeDefKind.ScalarKind ? ScalarTypeDef : T extends TypeDefKind.ObjectKind ? ObjectTypeDef : T extends TypeDefKind.ListKind ? ListTypeDef : BaseTypeDef;
|
|
30
38
|
/**
|
|
31
39
|
* The type of field in a class
|
|
32
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefs.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/typeDefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,WAAW,CAAA;CAClB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAC9B,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"typeDefs.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/typeDefs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,WAAW,CAAA;CAClB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG;IACxC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAC9B,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,IAC/C,CAAC,SAAS,WAAW,CAAC,UAAU,GAC5B,aAAa,GACb,CAAC,SAAS,WAAW,CAAC,UAAU,GAC9B,aAAa,GACb,CAAC,SAAS,WAAW,CAAC,QAAQ,GAC5B,WAAW,GACX,WAAW,CAAA;AAErB;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAC7B,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CAC9B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAA;KAAE,CAAA;IAC5C,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAA;KAAE,CAAA;CAC7C,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE,CAAA;IACxC,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,OAAO,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;KAAE,CAAA;CAC7C,CAAA"}
|
|
@@ -16,7 +16,7 @@ export declare function toPascalCase(input: string): string;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function isFunction(method: ts.MethodDeclaration): boolean;
|
|
18
18
|
/**
|
|
19
|
-
* Convert a
|
|
19
|
+
* Convert a type into a Dagger Typedef using dynamic typing.
|
|
20
20
|
*/
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function typeToTypedef(checker: ts.TypeChecker, type: ts.Type): TypeDef<TypeDefKind>;
|
|
22
22
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,GAAG,OAAO,CAU7D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoBlD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,GAAG,OAAO,CAUhE;AAED;;GAEG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../introspector/scanner/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,GAAG,OAAO,CAU7D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoBlD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,GAAG,OAAO,CAUhE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,OAAO,CAAC,WAAW,CAAC,CAgDtB"}
|
|
@@ -45,18 +45,33 @@ export function isFunction(method) {
|
|
|
45
45
|
}) !== undefined);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Convert a
|
|
48
|
+
* Convert a type into a Dagger Typedef using dynamic typing.
|
|
49
49
|
*/
|
|
50
|
-
export function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
export function typeToTypedef(checker, type) {
|
|
51
|
+
if (type.symbol?.name === "Promise") {
|
|
52
|
+
const typeArgs = checker.getTypeArguments(type);
|
|
53
|
+
if (typeArgs.length > 0) {
|
|
54
|
+
return typeToTypedef(checker, typeArgs[0]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (type.symbol?.name === "Array") {
|
|
58
|
+
const typeArgs = checker.getTypeArguments(type);
|
|
59
|
+
if (typeArgs.length === 0) {
|
|
60
|
+
throw new Error("Generic array not supported");
|
|
61
|
+
}
|
|
54
62
|
return {
|
|
55
63
|
kind: TypeDefKind.ListKind,
|
|
56
|
-
typeDef:
|
|
64
|
+
typeDef: typeToTypedef(checker, typeArgs[0]),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (type.symbol?.name && type.isClassOrInterface()) {
|
|
68
|
+
return {
|
|
69
|
+
kind: TypeDefKind.ObjectKind,
|
|
70
|
+
name: type.symbol.name,
|
|
57
71
|
};
|
|
58
72
|
}
|
|
59
|
-
|
|
73
|
+
const strType = checker.typeToString(type);
|
|
74
|
+
switch (strType) {
|
|
60
75
|
case "string":
|
|
61
76
|
return { kind: TypeDefKind.StringKind };
|
|
62
77
|
case "number":
|
|
@@ -66,9 +81,13 @@ export function typeNameToTypedef(typeName) {
|
|
|
66
81
|
case "void":
|
|
67
82
|
return { kind: TypeDefKind.VoidKind };
|
|
68
83
|
default:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
// If it's a union, then it's a scalar type
|
|
85
|
+
if (type.isUnionOrIntersection()) {
|
|
86
|
+
return {
|
|
87
|
+
kind: TypeDefKind.ScalarKind,
|
|
88
|
+
name: strType,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
throw new Error(`Unsupported type ${strType}`);
|
|
73
92
|
}
|
|
74
93
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.11.
|
|
1
|
+
export declare const CLI_VERSION = "0.11.4";
|
|
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.11.
|
|
2
|
+
export const CLI_VERSION = "0.11.4";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replace parent span (e.g., `exec /runtime`).
|
|
3
|
+
*/
|
|
4
|
+
export declare const UI_MASK = "dagger.io/ui.mask";
|
|
5
|
+
/**
|
|
6
|
+
* Reveal only child spans (e.g., `typescript runtime execution` parent span).
|
|
7
|
+
*/
|
|
8
|
+
export declare const UI_PASSTHROUGH = "dagger.io/ui.passthrough";
|
|
9
|
+
/**
|
|
10
|
+
* Hide children by default (e.g., test case that runs pipelines).
|
|
11
|
+
*/
|
|
12
|
+
export declare const UI_ENCAPSULATE = "dagger.io/ui.encapsulate";
|
|
13
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../telemetry/attributes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO,sBAAsB,CAAA;AAE1C;;GAEG;AACH,eAAO,MAAM,cAAc,6BAA6B,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,cAAc,6BAA6B,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replace parent span (e.g., `exec /runtime`).
|
|
3
|
+
*/
|
|
4
|
+
export const UI_MASK = "dagger.io/ui.mask";
|
|
5
|
+
/**
|
|
6
|
+
* Reveal only child spans (e.g., `typescript runtime execution` parent span).
|
|
7
|
+
*/
|
|
8
|
+
export const UI_PASSTHROUGH = "dagger.io/ui.passthrough";
|
|
9
|
+
/**
|
|
10
|
+
* Hide children by default (e.g., test case that runs pipelines).
|
|
11
|
+
*/
|
|
12
|
+
export const UI_ENCAPSULATE = "dagger.io/ui.encapsulate";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../telemetry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A wrapper around the OpenTelemetry SDK to configure it for Dagger.
|
|
3
|
+
*/
|
|
4
|
+
export declare class DaggerOtelConfigurator {
|
|
5
|
+
private is_configured;
|
|
6
|
+
private sdk?;
|
|
7
|
+
/**
|
|
8
|
+
* Initialize the Open Telemetry SDK if enabled or not already configured.
|
|
9
|
+
*/
|
|
10
|
+
initialize(): void;
|
|
11
|
+
configure(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Shutdown the Open Telemetry SDK to flush traces and metrics and close the connection.
|
|
14
|
+
*/
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Setup environment for auto-configuring the SDK.
|
|
18
|
+
*/
|
|
19
|
+
setupEnv(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../telemetry/init.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,qBAAa,sBAAsB;IACjC,OAAO,CAAC,aAAa,CAAQ;IAE7B,OAAO,CAAC,GAAG,CAAC,CAAS;IAErB;;OAEG;IACH,UAAU;IAQV,SAAS;IAoBT;;OAEG;IACG,KAAK;IAMX;;OAEG;IACH,QAAQ;CAeT"}
|