@dagger.io/dagger 0.18.12 → 0.18.13

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.
Files changed (31) hide show
  1. package/dist/src/api/client.gen.d.ts +82 -19
  2. package/dist/src/api/client.gen.d.ts.map +1 -1
  3. package/dist/src/api/client.gen.js +377 -34
  4. package/dist/src/common/graphql/client.d.ts.map +1 -1
  5. package/dist/src/common/graphql/client.js +12 -2
  6. package/dist/src/common/graphql/compute_query.d.ts +1 -0
  7. package/dist/src/common/graphql/compute_query.d.ts.map +1 -1
  8. package/dist/src/common/graphql/compute_query.js +1 -1
  9. package/dist/src/common/utils.d.ts +1 -0
  10. package/dist/src/common/utils.d.ts.map +1 -1
  11. package/dist/src/common/utils.js +4 -0
  12. package/dist/src/module/entrypoint/entrypoint.d.ts.map +1 -1
  13. package/dist/src/module/entrypoint/entrypoint.js +7 -2
  14. package/dist/src/module/entrypoint/load.d.ts.map +1 -1
  15. package/dist/src/module/entrypoint/load.js +28 -4
  16. package/dist/src/module/entrypoint/register.d.ts +32 -6
  17. package/dist/src/module/entrypoint/register.d.ts.map +1 -1
  18. package/dist/src/module/entrypoint/register.js +147 -113
  19. package/dist/src/module/executor.d.ts +8 -0
  20. package/dist/src/module/executor.d.ts.map +1 -1
  21. package/dist/src/module/executor.js +17 -0
  22. package/dist/src/module/introspector/dagger_module/enum.d.ts +1 -0
  23. package/dist/src/module/introspector/dagger_module/enum.d.ts.map +1 -1
  24. package/dist/src/module/introspector/dagger_module/enum.js +2 -1
  25. package/dist/src/module/introspector/dagger_module/enumClass.d.ts +1 -0
  26. package/dist/src/module/introspector/dagger_module/enumClass.d.ts.map +1 -1
  27. package/dist/src/module/introspector/dagger_module/enumClass.js +2 -1
  28. package/dist/src/provisioning/default.d.ts +1 -1
  29. package/dist/src/provisioning/default.js +1 -1
  30. package/dist/src/telemetry/init.js +1 -1
  31. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import * as opentelemetry from "@opentelemetry/api";
2
2
  import { GraphQLClient } from "graphql-request";
3
- import fetch from "node-fetch";
3
+ import nodeFetch from "node-fetch";
4
+ import { isDeno } from "../utils.js";
4
5
  const createFetchWithTimeout = (timeout) => async (input, init) => {
5
6
  if (init?.signal) {
6
7
  throw new Error("Internal error: could not create fetch client with timeout");
@@ -10,7 +11,16 @@ const createFetchWithTimeout = (timeout) => async (input, init) => {
10
11
  controller.abort();
11
12
  }, timeout);
12
13
  try {
13
- return (await fetch(input, {
14
+ // Edge case for Deno that doesn't work as expected with node-fetch and would
15
+ // rather rely on its native fetch implementation
16
+ // See: https://github.com/dagger/dagger/issues/10546
17
+ if (isDeno()) {
18
+ return await fetch(input, {
19
+ ...init,
20
+ signal: controller.signal,
21
+ });
22
+ }
23
+ return (await nodeFetch(input, {
14
24
  ...init,
15
25
  signal: controller.signal,
16
26
  }));
@@ -6,6 +6,7 @@ export type QueryTree = {
6
6
  export type Metadata = {
7
7
  [key: string]: {
8
8
  is_enum?: boolean;
9
+ value_to_name?: (value: any) => string;
9
10
  };
10
11
  };
11
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"compute_query.d.ts","sourceRoot":"","sources":["../../../../src/common/graphql/compute_query.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAUjE,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;CACF,CAAA;AAkHD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,MAAM,CAYjD;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,CAA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,7 @@ function buildArgs(args) {
10
10
  const formatValue = (key, value) => {
11
11
  // Special treatment for enumeration, they must be inserted without quotes
12
12
  if (metadata[key]?.is_enum) {
13
- return JSON.stringify(value).replace(/['"]+/g, "");
13
+ return JSON.stringify(metadata[key].value_to_name?.(value)).replace(/['"]+/g, "");
14
14
  }
15
15
  return JSON.stringify(value).replace(/\{"[a-zA-Z]+":|,"[a-zA-Z]+":/gi, (str) => {
16
16
  return str.replace(/"/g, "");
@@ -65,4 +65,5 @@ export declare const log: (stack?: string) => {
65
65
  debug(...args: any[]): void;
66
66
  success(...args: any[]): void;
67
67
  };
68
+ export declare function isDeno(): boolean;
68
69
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,GAAI,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACe,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/common/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,GAAI,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACe,CAAA;AAEjD,wBAAgB,MAAM,IAAI,OAAO,CAGhC"}
@@ -1,2 +1,6 @@
1
1
  import logger from "node-color-log";
2
2
  export const log = (stack) => logger.bgColor("red").color("black").log(stack);
3
+ export function isDeno() {
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ return typeof globalThis.Deno !== "undefined";
6
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/entrypoint.ts"],"names":[],"mappings":"AAWA,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,iBAyD/C"}
1
+ {"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/entrypoint.ts"],"names":[],"mappings":"AAYA,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,iBA+D/C"}
@@ -2,11 +2,12 @@ import { dag } from "../../api/client.gen.js";
2
2
  import { ExecError } from "../../common/errors/ExecError.js";
3
3
  import { GraphQLRequestError } from "../../common/errors/GraphQLRequestError.js";
4
4
  import { connection } from "../../connect.js";
5
+ import * as telemetry from "../../telemetry/telemetry.js";
5
6
  import { Executor } from "../executor.js";
6
7
  import { scan } from "../introspector/index.js";
7
8
  import { invoke } from "./invoke.js";
8
9
  import { load } from "./load.js";
9
- import { register } from "./register.js";
10
+ import { Register } from "./register.js";
10
11
  export async function entrypoint(files) {
11
12
  // Start a Dagger session to get the call context
12
13
  await connection(async () => {
@@ -18,7 +19,7 @@ export async function entrypoint(files) {
18
19
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
20
  let result;
20
21
  if (parentName === "") {
21
- result = await register(files, scanResult);
22
+ result = await new Register(scanResult).run();
22
23
  }
23
24
  else {
24
25
  // Invocation
@@ -42,6 +43,10 @@ export async function entrypoint(files) {
42
43
  }
43
44
  catch (e) {
44
45
  await fnCall.returnError(formatError(e));
46
+ // Closing telemetry here since the process is shutdown after
47
+ // so any parent's finally will not be executed.
48
+ // That way, we guarantee that the spans are flushed.
49
+ await telemetry.close();
45
50
  process.exit(1);
46
51
  }
47
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/load.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAO,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EACL,iBAAiB,IAAI,WAAW,EAChC,cAAc,IAAI,MAAM,EAExB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,EAAE,GAAG,EACV,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GACzB,OAAO,CAAC,GAAG,CAAC,CAqDd;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,MAAM,GACb,gBAAgB,GAAG,cAAc,CA4BnC;AAED,wBAAsB,UAAU,CAC9B,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,gBAAgB,GAAG,cAAc,GACxC,OAAO,CAAC,GAAG,CAAC,CA0Gd"}
@@ -1,5 +1,5 @@
1
1
  import { dag, TypeDefKind } from "../../api/client.gen.js";
2
- import { DaggerEnum, DaggerObject, DaggerTypeObject, } from "../introspector/dagger_module/index.js";
2
+ import { DaggerEnum, DaggerObject, DaggerTypeObject, DaggerEnumClass, } from "../introspector/dagger_module/index.js";
3
3
  /**
4
4
  * Import all given typescript files so that trigger their decorators
5
5
  * and register their class and functions inside the Registry.
@@ -111,6 +111,10 @@ export async function loadValue(executor, value, type) {
111
111
  const interfaceType = type.name;
112
112
  return executor.buildInterface(interfaceType, value);
113
113
  }
114
+ case TypeDefKind.EnumKind: {
115
+ const enumType = type.name;
116
+ return executor.buildEnum(enumType, value);
117
+ }
114
118
  // Cannot use `,` to specify multiple matching case so instead we use fallthrough.
115
119
  case TypeDefKind.StringKind:
116
120
  case TypeDefKind.IntegerKind:
@@ -118,7 +122,6 @@ export async function loadValue(executor, value, type) {
118
122
  case TypeDefKind.FloatKind:
119
123
  case TypeDefKind.VoidKind:
120
124
  case TypeDefKind.ScalarKind:
121
- case TypeDefKind.EnumKind:
122
125
  return value;
123
126
  default:
124
127
  throw new Error(`unsupported type ${type.kind}`);
@@ -146,6 +149,9 @@ export function loadObjectReturnType(module, object, method) {
146
149
  while (listType.kind === TypeDefKind.ListKind) {
147
150
  listType = listType.typeDef;
148
151
  }
152
+ if (listType.kind === TypeDefKind.EnumKind) {
153
+ return module.enums[listType.name];
154
+ }
149
155
  return module.objects[listType.name];
150
156
  }
151
157
  case TypeDefKind.ObjectKind:
@@ -196,6 +202,16 @@ export async function loadResult(result, module, object) {
196
202
  referencedObject =
197
203
  module.objects[_property.name];
198
204
  }
205
+ // If the original type is a enum, we use it as the referenced object.
206
+ if (_property.kind === TypeDefKind.EnumKind) {
207
+ referencedObject =
208
+ module.enums[_property.name];
209
+ }
210
+ }
211
+ // Handle enums
212
+ if (property.type.kind === TypeDefKind.EnumKind) {
213
+ referencedObject =
214
+ module.enums[property.type.name];
199
215
  }
200
216
  // If there's no referenced object, we use the current object.
201
217
  if (!referencedObject) {
@@ -205,8 +221,16 @@ export async function loadResult(result, module, object) {
205
221
  }
206
222
  return state;
207
223
  }
208
- if (typeof result === "object" && object instanceof DaggerEnum) {
209
- return result;
224
+ // If it's an enum, we need to resolve the enum member name instead of the value.
225
+ // A enum value A = "a" will be returned as "a" by the function so we need to
226
+ // transform it back to "A" to be sent as result to the engine.
227
+ if (object instanceof DaggerEnum || object instanceof DaggerEnumClass) {
228
+ const enumMember = Object.entries(object.values).find(([, member]) => member.value === result);
229
+ // If the enum member is not found, we return the result as is and let the engine handle it.
230
+ if (!enumMember) {
231
+ return result;
232
+ }
233
+ return enumMember[0];
210
234
  }
211
235
  // Handle primitive types
212
236
  return result;
@@ -1,7 +1,33 @@
1
- import { ModuleID } from "../../api/client.gen.js";
2
- import { DaggerModule } from "../introspector/dagger_module/index.js";
3
- /**
4
- * Register the module files and returns its ID
5
- */
6
- export declare function register(files: string[], module: DaggerModule): Promise<ModuleID>;
1
+ import { Function_, ModuleID, TypeDef } from "../../api/client.gen.js";
2
+ import { DaggerArguments as Arguments, DaggerConstructor as Constructor, DaggerFunction as Method, DaggerModule, DaggerArgument } from "../introspector/dagger_module/index.js";
3
+ import { DaggerInterfaceFunction } from "../introspector/dagger_module/interfaceFunction.js";
4
+ export declare class Register {
5
+ private readonly module;
6
+ constructor(module: DaggerModule);
7
+ /**
8
+ * Register the module in the engine and returns its ID
9
+ */
10
+ run(): Promise<ModuleID>;
11
+ /**
12
+ * Bind a constructor to the given object.
13
+ */
14
+ addConstructor(constructor: Constructor, owner: TypeDef): Function_;
15
+ /**
16
+ * Create a function in the Dagger API.
17
+ */
18
+ addFunction(fct: Method | DaggerInterfaceFunction): Function_;
19
+ /**
20
+ * Register all arguments in the function.
21
+ */
22
+ addArg(args: Arguments): (fct: Function_) => Function_;
23
+ /**
24
+ * Extract the default value from the argument.
25
+ * - If the argument isn't a primitive type, we can't resolve it so we make it optional and let the runtime
26
+ * resolve it on execution.
27
+ * - If the argument is a primitive type but not an enum, we resolve it directly.
28
+ * - If the argument is an enum but not registered in the module, it must be a core enum so we keep the value as is.
29
+ * - If the argument is an enum registered in the module, we resolve the value to the member name.
30
+ */
31
+ getDefaultValueFromArg(arg: DaggerArgument): unknown | undefined;
32
+ }
7
33
  //# sourceMappingURL=register.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EAIT,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAIL,YAAY,EAEb,MAAM,wCAAwC,CAAA;AAW/C;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,QAAQ,CAAC,CA8EnB"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,QAAQ,EACR,OAAO,EAGR,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,eAAe,IAAI,SAAS,EAC5B,iBAAiB,IAAI,WAAW,EAChC,cAAc,IAAI,MAAM,EACxB,YAAY,EAEZ,cAAc,EACf,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAA;AAU5F,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEjD;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;IAgF9B;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS;IAInE;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IAQ7D;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS;IAoDtD;;;;;;;OAOG;IACH,sBAAsB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS;CA4BjE"}
@@ -1,125 +1,159 @@
1
1
  import { dag, TypeDefKind, } from "../../api/client.gen.js";
2
- /**
3
- * Register the module files and returns its ID
4
- */
5
- export async function register(files, module) {
6
- // Get a new module that we will fill in with all the types
7
- let mod = dag.module_();
8
- // Add module description if any.
9
- if (module.description) {
10
- mod = mod.withDescription(module.description);
2
+ export class Register {
3
+ module;
4
+ constructor(module) {
5
+ this.module = module;
11
6
  }
12
- // For each class scanned, register its type, method and properties in the module.
13
- Object.values(module.objects).forEach((object) => {
14
- // Register the class Typedef object in Dagger
15
- let typeDef = dag.typeDef().withObject(object.name, {
16
- description: object.description,
17
- sourceMap: addSourceMap(object),
18
- });
19
- // Register all functions (methods) to this object
20
- Object.values(object.methods).forEach((method) => {
21
- typeDef = typeDef.withFunction(addFunction(method));
22
- });
23
- // Register all fields that belong to this object
24
- Object.values(object.properties).forEach((field) => {
25
- if (field.isExposed) {
26
- typeDef = typeDef.withField(field.alias ?? field.name, addTypeDef(field.type), {
27
- description: field.description,
28
- sourceMap: addSourceMap(field),
29
- });
30
- }
31
- });
32
- if (object._constructor) {
33
- typeDef = typeDef.withConstructor(addConstructor(object._constructor, typeDef));
7
+ /**
8
+ * Register the module in the engine and returns its ID
9
+ */
10
+ async run() {
11
+ // Get a new module that we will fill in with all the types
12
+ let mod = dag.module_();
13
+ // Add module description if any.
14
+ if (this.module.description) {
15
+ mod = mod.withDescription(this.module.description);
34
16
  }
35
- // Add it to the module object
36
- mod = mod.withObject(typeDef);
37
- });
38
- // Register all enums defined by this modules
39
- Object.values(module.enums).forEach((enum_) => {
40
- let typeDef = dag.typeDef().withEnum(enum_.name, {
41
- description: enum_.description,
42
- sourceMap: addSourceMap(enum_),
43
- });
44
- Object.values(enum_.values).forEach((value) => {
45
- typeDef = typeDef.withEnumValue(value.value, {
46
- description: value.description,
47
- sourceMap: addSourceMap(value),
17
+ // For each class scanned, register its type, method and properties in the module.
18
+ Object.values(this.module.objects).forEach((object) => {
19
+ // Register the class Typedef object in Dagger
20
+ let typeDef = dag.typeDef().withObject(object.name, {
21
+ description: object.description,
22
+ sourceMap: addSourceMap(object),
23
+ });
24
+ // Register all functions (methods) to this object
25
+ Object.values(object.methods).forEach((method) => {
26
+ typeDef = typeDef.withFunction(this.addFunction(method));
48
27
  });
28
+ // Register all fields that belong to this object
29
+ Object.values(object.properties).forEach((field) => {
30
+ if (field.isExposed) {
31
+ typeDef = typeDef.withField(field.alias ?? field.name, addTypeDef(field.type), {
32
+ description: field.description,
33
+ sourceMap: addSourceMap(field),
34
+ });
35
+ }
36
+ });
37
+ if (object._constructor) {
38
+ typeDef = typeDef.withConstructor(this.addConstructor(object._constructor, typeDef));
39
+ }
40
+ // Add it to the module object
41
+ mod = mod.withObject(typeDef);
49
42
  });
50
- mod = mod.withEnum(typeDef);
51
- });
52
- // Register all interfaces defined by this module
53
- Object.values(module.interfaces).forEach((interface_) => {
54
- let typeDef = dag.typeDef().withInterface(interface_.name, {
55
- description: interface_.description,
43
+ // Register all enums defined by this modules
44
+ Object.values(this.module.enums).forEach((enum_) => {
45
+ let typeDef = dag.typeDef().withEnum(enum_.name, {
46
+ description: enum_.description,
47
+ sourceMap: addSourceMap(enum_),
48
+ });
49
+ Object.values(enum_.values).forEach((value) => {
50
+ typeDef = typeDef.withEnumMember(value.name, {
51
+ value: value.value,
52
+ description: value.description,
53
+ sourceMap: addSourceMap(value),
54
+ });
55
+ });
56
+ mod = mod.withEnum(typeDef);
56
57
  });
57
- Object.values(interface_.functions).forEach((function_) => {
58
- typeDef = typeDef.withFunction(addFunction(function_));
58
+ // Register all interfaces defined by this module
59
+ Object.values(this.module.interfaces).forEach((interface_) => {
60
+ let typeDef = dag.typeDef().withInterface(interface_.name, {
61
+ description: interface_.description,
62
+ });
63
+ Object.values(interface_.functions).forEach((function_) => {
64
+ typeDef = typeDef.withFunction(this.addFunction(function_));
65
+ });
66
+ mod = mod.withInterface(typeDef);
59
67
  });
60
- mod = mod.withInterface(typeDef);
61
- });
62
- // Call ID to actually execute the registration
63
- return await mod.id();
64
- }
65
- /**
66
- * Bind a constructor to the given object.
67
- */
68
- function addConstructor(constructor, owner) {
69
- return dag.function_("", owner).with(addArg(constructor.arguments));
70
- }
71
- /**
72
- * Create a function in the Dagger API.
73
- */
74
- function addFunction(fct) {
75
- return dag
76
- .function_(fct.alias ?? fct.name, addTypeDef(fct.returnType))
77
- .withDescription(fct.description)
78
- .withSourceMap(addSourceMap(fct))
79
- .with(addArg(fct.arguments));
80
- }
81
- /**
82
- * Register all arguments in the function.
83
- */
84
- function addArg(args) {
85
- return function (fct) {
86
- Object.values(args).forEach((arg) => {
87
- const opts = {
88
- description: arg.description,
89
- sourceMap: addSourceMap(arg),
90
- };
91
- let typeDef = addTypeDef(arg.type);
92
- if (arg.isOptional) {
93
- typeDef = typeDef.withOptional(true);
94
- }
95
- // Check if both values are used, return an error if so.
96
- if (arg.defaultValue && arg.defaultPath) {
97
- throw new Error("cannot set both default value and default path from context");
98
- }
99
- // We do not set the default value if it's not a primitive type, we let TypeScript
100
- // resolve the default value during the runtime instead.
101
- // If it has a default value but is not primitive, we set the value as optional
102
- // to workaround the fact that the API isn't aware of the default value and will
103
- // expect it to be set as required input.
104
- if (arg.defaultValue !== undefined) {
105
- if (isPrimitiveType(arg.type)) {
106
- opts.defaultValue = JSON.stringify(arg.defaultValue);
107
- }
108
- else {
68
+ return await mod.id();
69
+ }
70
+ /**
71
+ * Bind a constructor to the given object.
72
+ */
73
+ addConstructor(constructor, owner) {
74
+ return dag.function_("", owner).with(this.addArg(constructor.arguments));
75
+ }
76
+ /**
77
+ * Create a function in the Dagger API.
78
+ */
79
+ addFunction(fct) {
80
+ return dag
81
+ .function_(fct.alias ?? fct.name, addTypeDef(fct.returnType))
82
+ .withDescription(fct.description)
83
+ .withSourceMap(addSourceMap(fct))
84
+ .with(this.addArg(fct.arguments));
85
+ }
86
+ /**
87
+ * Register all arguments in the function.
88
+ */
89
+ addArg(args) {
90
+ return (fct) => {
91
+ Object.values(args).forEach((arg) => {
92
+ const opts = {
93
+ description: arg.description,
94
+ sourceMap: addSourceMap(arg),
95
+ };
96
+ let typeDef = addTypeDef(arg.type);
97
+ if (arg.isOptional) {
109
98
  typeDef = typeDef.withOptional(true);
110
99
  }
111
- }
112
- // If the argument is a contextual argument, it becomes optional.
113
- if (arg.defaultPath) {
114
- opts.defaultPath = arg.defaultPath;
115
- }
116
- if (arg.ignore) {
117
- opts.ignore = arg.ignore;
118
- }
119
- fct = fct.withArg(arg.name, typeDef, opts);
120
- });
121
- return fct;
122
- };
100
+ // Check if both values are used, return an error if so.
101
+ if (arg.defaultValue && arg.defaultPath) {
102
+ throw new Error("cannot set both default value and default path from context");
103
+ }
104
+ // We do not set the default value if it's not a primitive type, we let TypeScript
105
+ // resolve the default value during the runtime instead.
106
+ // If it has a default value but is not primitive, we set the value as optional
107
+ // to workaround the fact that the API isn't aware of the default value and will
108
+ // expect it to be set as required input.
109
+ if (arg.defaultValue !== undefined) {
110
+ const defaultValue = this.getDefaultValueFromArg(arg);
111
+ if (defaultValue === undefined) {
112
+ typeDef = typeDef.withOptional(true);
113
+ }
114
+ else {
115
+ opts.defaultValue = JSON.stringify(defaultValue);
116
+ }
117
+ }
118
+ // If the argument is a contextual argument, it becomes optional.
119
+ if (arg.defaultPath) {
120
+ opts.defaultPath = arg.defaultPath;
121
+ }
122
+ if (arg.ignore) {
123
+ opts.ignore = arg.ignore;
124
+ }
125
+ fct = fct.withArg(arg.name, typeDef, opts);
126
+ });
127
+ return fct;
128
+ };
129
+ }
130
+ /**
131
+ * Extract the default value from the argument.
132
+ * - If the argument isn't a primitive type, we can't resolve it so we make it optional and let the runtime
133
+ * resolve it on execution.
134
+ * - If the argument is a primitive type but not an enum, we resolve it directly.
135
+ * - If the argument is an enum but not registered in the module, it must be a core enum so we keep the value as is.
136
+ * - If the argument is an enum registered in the module, we resolve the value to the member name.
137
+ */
138
+ getDefaultValueFromArg(arg) {
139
+ if (!isPrimitiveType(arg.type)) {
140
+ return undefined;
141
+ }
142
+ if (arg.type.kind !== TypeDefKind.EnumKind) {
143
+ return arg.defaultValue;
144
+ }
145
+ const enumObj = this.module.enums[arg.type.name];
146
+ if (!enumObj) {
147
+ // If the enum isn't found in the module, it may be a core enum so we keep the value
148
+ return arg.defaultValue;
149
+ }
150
+ // If it's a known enum, we need to resolve set the name of the member as default value instead of the actual value
151
+ const enumMember = Object.entries(enumObj.values).find(([, member]) => member.value === arg.defaultValue);
152
+ if (!enumMember) {
153
+ throw new Error(`could not resolve default value '${arg.defaultValue}' for enum ${arg.type.name}`);
154
+ }
155
+ return enumMember[0];
156
+ }
123
157
  }
124
158
  /**
125
159
  * Wrapper around TypeDef to return the right Dagger TypesDef with its options.
@@ -15,6 +15,14 @@ export declare class Executor {
15
15
  * interface serves as module call binding to reach the true implementation.
16
16
  */
17
17
  buildInterface(iface: string, id: string): any;
18
+ /**
19
+ * Transfer a Dagger enum member name into its implemented value.
20
+ * An enum value A = "a" will be received as "A" by the entrypoint
21
+ * but should be transformed into "a" to be sent to the function.
22
+ * If the enum isn't found in the module, it may be a core enum so we keep the value
23
+ * as is.
24
+ */
25
+ buildEnum(enumName: string, value: string): any;
18
26
  getResult(object: string, method: string, state: State, inputs: Args): Promise<any>;
19
27
  }
20
28
  //# sourceMappingURL=executor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/module/executor.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAA;AAMhC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAIpE,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;AAE1C,qBAAa,QAAQ;aAED,OAAO,EAAE,MAAM,EAAE;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADb,OAAO,EAAE,MAAM,EAAE,EAChB,YAAY,EAAE,YAAY;IAG7C,OAAO,CAAC,iBAAiB;IAUzB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG;IAqB7C;;;OAGG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,GAAG;IAiBxC,SAAS,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,IAAI,GACX,OAAO,CAAC,GAAG,CAAC;CAchB"}
1
+ {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/module/executor.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,aAAa,CAAA;AAMhC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAIpE,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;AAE1C,qBAAa,QAAQ;aAED,OAAO,EAAE,MAAM,EAAE;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADb,OAAO,EAAE,MAAM,EAAE,EAChB,YAAY,EAAE,YAAY;IAG7C,OAAO,CAAC,iBAAiB;IAUzB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG;IAqB7C;;;OAGG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,GAAG;IAiB9C;;;;;;OAMG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG;IAazC,SAAS,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,IAAI,GACX,OAAO,CAAC,GAAG,CAAC;CAchB"}
@@ -46,6 +46,23 @@ export class Executor {
46
46
  const ifaceImpl = new InterfaceWrapper(this, this.daggerModule, `${this.daggerModule.name}${iface}`, id, interfaceObject.functions);
47
47
  return ifaceImpl;
48
48
  }
49
+ /**
50
+ * Transfer a Dagger enum member name into its implemented value.
51
+ * An enum value A = "a" will be received as "A" by the entrypoint
52
+ * but should be transformed into "a" to be sent to the function.
53
+ * If the enum isn't found in the module, it may be a core enum so we keep the value
54
+ * as is.
55
+ */
56
+ buildEnum(enumName, value) {
57
+ const enumObject = this.daggerModule.enums[enumName];
58
+ if (!enumObject) {
59
+ return value;
60
+ }
61
+ if (!enumObject.values[value]) {
62
+ throw new Error(`Enum ${enumName} does not have member ${value}`);
63
+ }
64
+ return enumObject.values[value].value;
65
+ }
49
66
  async getResult(object, method, state, inputs) {
50
67
  const obj = this.getExportedObject(object);
51
68
  if (method === "") {
@@ -18,6 +18,7 @@ export declare class DaggerEnumValue extends Locatable implements DaggerEnumBase
18
18
  constructor(node: ts.EnumMember, ast: AST);
19
19
  toJSON(): {
20
20
  name: string;
21
+ value: string;
21
22
  description: string;
22
23
  };
23
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAA;AACxD,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;CAAE,CAAA;AAElE,qBAAa,eAAgB,SAAQ,SAAU,YAAW,mBAAmB;IAQzE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IAE1B,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,UAAU,EACnB,GAAG,EAAE,GAAG;IAiB3B,MAAM;;;;CAMP;AAED,qBAAa,UAAW,SAAQ,SAAU,YAAW,cAAc;IAQ/D,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,gBAAgB,CAAK;IAEpC,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,eAAe,EACxB,GAAG,EAAE,GAAG;IAgB3B,MAAM;;;;;CAOP"}
1
+ {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAA;AACxD,MAAM,MAAM,gBAAgB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;CAAE,CAAA;AAElE,qBAAa,eAAgB,SAAQ,SAAU,YAAW,mBAAmB;IAQzE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IAE1B,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,UAAU,EACnB,GAAG,EAAE,GAAG;IAiB3B,MAAM;;;;;CAOP;AAED,qBAAa,UAAW,SAAQ,SAAU,YAAW,cAAc;IAQ/D,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,gBAAgB,CAAK;IAEpC,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,eAAe,EACxB,GAAG,EAAE,GAAG;IAgB3B,MAAM;;;;;CAOP"}
@@ -23,7 +23,8 @@ export class DaggerEnumValue extends Locatable {
23
23
  }
24
24
  toJSON() {
25
25
  return {
26
- name: this.value,
26
+ name: this.name,
27
+ value: this.value,
27
28
  description: this.description,
28
29
  };
29
30
  }
@@ -18,6 +18,7 @@ export declare class DaggerEnumClassValue extends Locatable implements DaggerEnu
18
18
  constructor(node: ts.PropertyDeclaration, ast: AST);
19
19
  toJSON(): {
20
20
  name: string;
21
+ value: string;
21
22
  description: string;
22
23
  };
23
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"enumClass.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/enumClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;CAAE,CAAA;AAEnE,MAAM,MAAM,qBAAqB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAAA;CAAE,CAAA;AAE5E,qBAAa,oBACX,SAAQ,SACR,YAAW,mBAAmB;IAS5B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IAE1B,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,mBAAmB,EAC5B,GAAG,EAAE,GAAG;IAe3B,MAAM;;;;CAMP;AAED,qBAAa,eAAgB,SAAQ,SAAU,YAAW,cAAc;IAQpE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,qBAAqB,CAAK;IAEzC,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,gBAAgB,EACzB,GAAG,EAAE,GAAG;IAuB3B,MAAM;;;;;CAOP"}
1
+ {"version":3,"file":"enumClass.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/enumClass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAA;CAAE,CAAA;AAEnE,MAAM,MAAM,qBAAqB,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAAA;CAAE,CAAA;AAE5E,qBAAa,oBACX,SAAQ,SACR,YAAW,mBAAmB;IAS5B,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IAE1B,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,mBAAmB,EAC5B,GAAG,EAAE,GAAG;IAe3B,MAAM;;;;;CAOP;AAED,qBAAa,eAAgB,SAAQ,SAAU,YAAW,cAAc;IAQpE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,qBAAqB,CAAK;IAEzC,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,gBAAgB,EACzB,GAAG,EAAE,GAAG;IAuB3B,MAAM;;;;;CAOP"}
@@ -24,7 +24,8 @@ export class DaggerEnumClassValue extends Locatable {
24
24
  }
25
25
  toJSON() {
26
26
  return {
27
- name: this.value,
27
+ name: this.name,
28
+ value: this.value,
28
29
  description: this.description,
29
30
  };
30
31
  }
@@ -1,2 +1,2 @@
1
- export declare const CLI_VERSION = "0.18.12";
1
+ export declare const CLI_VERSION = "0.18.13";
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.18.12";
2
+ export const CLI_VERSION = "0.18.13";