@dagger.io/dagger 0.13.1 → 0.13.2
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/package.json +1 -1
- package/dist/api/client.gen.d.ts +0 -3668
- package/dist/api/client.gen.d.ts.map +0 -1
- package/dist/api/client.gen.js +0 -7133
- package/dist/api/utils.d.ts +0 -28
- package/dist/api/utils.d.ts.map +0 -1
- package/dist/api/utils.js +0 -170
- package/dist/common/errors/DaggerSDKError.d.ts +0 -32
- package/dist/common/errors/DaggerSDKError.d.ts.map +0 -1
- package/dist/common/errors/DaggerSDKError.js +0 -26
- package/dist/common/errors/DockerImageRefValidationError.d.ts +0 -22
- package/dist/common/errors/DockerImageRefValidationError.d.ts.map +0 -1
- package/dist/common/errors/DockerImageRefValidationError.js +0 -21
- package/dist/common/errors/EngineSessionConnectParamsParseError.d.ts +0 -21
- package/dist/common/errors/EngineSessionConnectParamsParseError.d.ts.map +0 -1
- package/dist/common/errors/EngineSessionConnectParamsParseError.js +0 -20
- package/dist/common/errors/EngineSessionConnectionTimeoutError.d.ts +0 -21
- package/dist/common/errors/EngineSessionConnectionTimeoutError.d.ts.map +0 -1
- package/dist/common/errors/EngineSessionConnectionTimeoutError.js +0 -20
- package/dist/common/errors/EngineSessionErrorOptions.d.ts +0 -16
- package/dist/common/errors/EngineSessionErrorOptions.d.ts.map +0 -1
- package/dist/common/errors/EngineSessionErrorOptions.js +0 -16
- package/dist/common/errors/ExecError.d.ts +0 -37
- package/dist/common/errors/ExecError.d.ts.map +0 -1
- package/dist/common/errors/ExecError.js +0 -38
- package/dist/common/errors/GraphQLRequestError.d.ts +0 -26
- package/dist/common/errors/GraphQLRequestError.d.ts.map +0 -1
- package/dist/common/errors/GraphQLRequestError.js +0 -25
- package/dist/common/errors/InitEngineSessionBinaryError.d.ts +0 -13
- package/dist/common/errors/InitEngineSessionBinaryError.d.ts.map +0 -1
- package/dist/common/errors/InitEngineSessionBinaryError.js +0 -15
- package/dist/common/errors/NotAwaitedRequestError.d.ts +0 -13
- package/dist/common/errors/NotAwaitedRequestError.d.ts.map +0 -1
- package/dist/common/errors/NotAwaitedRequestError.js +0 -15
- package/dist/common/errors/TooManyNestedObjectsError.d.ts +0 -21
- package/dist/common/errors/TooManyNestedObjectsError.d.ts.map +0 -1
- package/dist/common/errors/TooManyNestedObjectsError.js +0 -20
- package/dist/common/errors/UnknownDaggerError.d.ts +0 -13
- package/dist/common/errors/UnknownDaggerError.d.ts.map +0 -1
- package/dist/common/errors/UnknownDaggerError.js +0 -15
- package/dist/common/errors/errors-codes.d.ts +0 -51
- package/dist/common/errors/errors-codes.d.ts.map +0 -1
- package/dist/common/errors/errors-codes.js +0 -43
- package/dist/common/errors/index.d.ts +0 -13
- package/dist/common/errors/index.d.ts.map +0 -1
- package/dist/common/errors/index.js +0 -12
- package/dist/common/utils.d.ts +0 -68
- package/dist/common/utils.d.ts.map +0 -1
- package/dist/common/utils.js +0 -2
- package/dist/connect.d.ts +0 -32
- package/dist/connect.d.ts.map +0 -1
- package/dist/connect.js +0 -66
- package/dist/connectOpts.d.ts +0 -24
- package/dist/connectOpts.d.ts.map +0 -1
- package/dist/connectOpts.js +0 -1
- package/dist/context/builder.d.ts +0 -9
- package/dist/context/builder.d.ts.map +0 -1
- package/dist/context/builder.js +0 -34
- package/dist/context/context.d.ts +0 -40
- package/dist/context/context.d.ts.map +0 -1
- package/dist/context/context.js +0 -53
- package/dist/entrypoint/context.d.ts +0 -8
- package/dist/entrypoint/context.d.ts.map +0 -1
- package/dist/entrypoint/context.js +0 -1
- package/dist/entrypoint/entrypoint.d.ts +0 -2
- package/dist/entrypoint/entrypoint.d.ts.map +0 -1
- package/dist/entrypoint/entrypoint.js +0 -68
- package/dist/entrypoint/invoke.d.ts +0 -13
- package/dist/entrypoint/invoke.d.ts.map +0 -1
- package/dist/entrypoint/invoke.js +0 -40
- package/dist/entrypoint/load.d.ts +0 -56
- package/dist/entrypoint/load.d.ts.map +0 -1
- package/dist/entrypoint/load.js +0 -198
- package/dist/entrypoint/register.d.ts +0 -7
- package/dist/entrypoint/register.d.ts.map +0 -1
- package/dist/entrypoint/register.js +0 -140
- package/dist/graphql/client.d.ts +0 -3
- package/dist/graphql/client.d.ts.map +0 -1
- package/dist/graphql/client.js +0 -25
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/introspector/decorators/decorators.d.ts +0 -44
- package/dist/introspector/decorators/decorators.d.ts.map +0 -1
- package/dist/introspector/decorators/decorators.js +0 -47
- package/dist/introspector/registry/registry.d.ts +0 -89
- package/dist/introspector/registry/registry.d.ts.map +0 -1
- package/dist/introspector/registry/registry.js +0 -115
- package/dist/introspector/scanner/abtractions/argument.d.ts +0 -104
- package/dist/introspector/scanner/abtractions/argument.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/argument.js +0 -207
- package/dist/introspector/scanner/abtractions/constructor.d.ts +0 -17
- package/dist/introspector/scanner/abtractions/constructor.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/constructor.js +0 -40
- package/dist/introspector/scanner/abtractions/enum.d.ts +0 -33
- package/dist/introspector/scanner/abtractions/enum.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/enum.js +0 -73
- package/dist/introspector/scanner/abtractions/enumValue.d.ts +0 -24
- package/dist/introspector/scanner/abtractions/enumValue.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/enumValue.js +0 -51
- package/dist/introspector/scanner/abtractions/method.d.ts +0 -67
- package/dist/introspector/scanner/abtractions/method.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/method.js +0 -132
- package/dist/introspector/scanner/abtractions/module.d.ts +0 -26
- package/dist/introspector/scanner/abtractions/module.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/module.js +0 -103
- package/dist/introspector/scanner/abtractions/object.d.ts +0 -52
- package/dist/introspector/scanner/abtractions/object.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/object.js +0 -118
- package/dist/introspector/scanner/abtractions/property.d.ts +0 -55
- package/dist/introspector/scanner/abtractions/property.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/property.js +0 -110
- package/dist/introspector/scanner/abtractions/typeToTypedef.d.ts +0 -8
- package/dist/introspector/scanner/abtractions/typeToTypedef.d.ts.map +0 -1
- package/dist/introspector/scanner/abtractions/typeToTypedef.js +0 -85
- package/dist/introspector/scanner/scan.d.ts +0 -14
- package/dist/introspector/scanner/scan.d.ts.map +0 -1
- package/dist/introspector/scanner/scan.js +0 -26
- package/dist/introspector/scanner/typeDefs.d.ts +0 -45
- package/dist/introspector/scanner/typeDefs.d.ts.map +0 -1
- package/dist/introspector/scanner/typeDefs.js +0 -1
- package/dist/introspector/scanner/utils.d.ts +0 -22
- package/dist/introspector/scanner/utils.d.ts.map +0 -1
- package/dist/introspector/scanner/utils.js +0 -101
- package/dist/introspector/utils/files.d.ts +0 -5
- package/dist/introspector/utils/files.d.ts.map +0 -1
- package/dist/introspector/utils/files.js +0 -28
- package/dist/provisioning/bin.d.ts +0 -77
- package/dist/provisioning/bin.d.ts.map +0 -1
- package/dist/provisioning/bin.js +0 -353
- package/dist/provisioning/default.d.ts +0 -2
- package/dist/provisioning/default.d.ts.map +0 -1
- package/dist/provisioning/default.js +0 -2
- package/dist/provisioning/engineconn.d.ts +0 -28
- package/dist/provisioning/engineconn.d.ts.map +0 -1
- package/dist/provisioning/engineconn.js +0 -1
- package/dist/provisioning/index.d.ts +0 -4
- package/dist/provisioning/index.d.ts.map +0 -1
- package/dist/provisioning/index.js +0 -3
- package/dist/telemetry/attributes.d.ts +0 -5
- package/dist/telemetry/attributes.d.ts.map +0 -1
- package/dist/telemetry/attributes.js +0 -4
- package/dist/telemetry/index.d.ts +0 -3
- package/dist/telemetry/index.d.ts.map +0 -1
- package/dist/telemetry/index.js +0 -2
- package/dist/telemetry/init.d.ts +0 -21
- package/dist/telemetry/init.d.ts.map +0 -1
- package/dist/telemetry/init.js +0 -66
- package/dist/telemetry/telemetry.d.ts +0 -16
- package/dist/telemetry/telemetry.d.ts.map +0 -1
- package/dist/telemetry/telemetry.js +0 -38
- package/dist/telemetry/tracer.d.ts +0 -32
- package/dist/telemetry/tracer.d.ts.map +0 -1
- package/dist/telemetry/tracer.js +0 -54
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Expose the decorator publicly, so they insert data into the global registry.
|
|
3
|
-
*/
|
|
4
|
-
import { registry } from "../registry/registry.js";
|
|
5
|
-
/**
|
|
6
|
-
* The definition of the `@object` decorator that should be on top of any
|
|
7
|
-
* class module that must be exposed to the Dagger API.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export const object = registry.object;
|
|
11
|
-
/**
|
|
12
|
-
* The definition of @func decorator that should be on top of any
|
|
13
|
-
* class' method that must be exposed to the Dagger API.
|
|
14
|
-
*
|
|
15
|
-
* @param alias The alias to use for the field when exposed on the API.
|
|
16
|
-
*/
|
|
17
|
-
export const func = registry.func;
|
|
18
|
-
/**
|
|
19
|
-
* The definition of @field decorator that should be on top of any
|
|
20
|
-
* class' property that must be exposed to the Dagger API.
|
|
21
|
-
*
|
|
22
|
-
* @deprecated In favor of `@func`
|
|
23
|
-
* @param alias The alias to use for the field when exposed on the API.
|
|
24
|
-
*/
|
|
25
|
-
export const field = registry.field;
|
|
26
|
-
/**
|
|
27
|
-
* The definition of the `@enumType` decorator that should be on top of any
|
|
28
|
-
* class module that must be exposed to the Dagger API as enumeration.
|
|
29
|
-
*/
|
|
30
|
-
export const enumType = registry.enumType;
|
|
31
|
-
/**
|
|
32
|
-
* Add a `@argument` decorator to an argument of type `Directory` or `File` to load
|
|
33
|
-
* its contents from the module context directory.
|
|
34
|
-
*
|
|
35
|
-
* The context directory is the git repository containing the module.
|
|
36
|
-
* If there's no git repository, the context directory is the directory containing
|
|
37
|
-
* the module source code.
|
|
38
|
-
*
|
|
39
|
-
* @param opts.defaultPath Only applies to arguments of type File or Directory. If the argument is not set,
|
|
40
|
-
* load it from the given path in the context directory.
|
|
41
|
-
* @param opts.ignore Only applies to arguments of type Directory. The ignore patterns are applied to the input directory,
|
|
42
|
-
* and matching entries are filtered out, in a cache-efficient manner..
|
|
43
|
-
*
|
|
44
|
-
* Relative paths are relative to the current source files.
|
|
45
|
-
* Absolute paths are rooted to the module context directory.
|
|
46
|
-
*/
|
|
47
|
-
export const argument = registry.argument;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
export type Class = {
|
|
3
|
-
new (...args: any[]): any;
|
|
4
|
-
};
|
|
5
|
-
export type State = {
|
|
6
|
-
[property: string]: any;
|
|
7
|
-
};
|
|
8
|
-
export type Args = Record<string, unknown>;
|
|
9
|
-
export type ArgumentOptions = {
|
|
10
|
-
/**
|
|
11
|
-
* The contextual value to use for the argument.
|
|
12
|
-
*
|
|
13
|
-
* This should only be used for Directory or File types.
|
|
14
|
-
*
|
|
15
|
-
* An abslute path would be related to the context source directory (the git repo root or the module source root).
|
|
16
|
-
* A relative path would be relative to the module source root.
|
|
17
|
-
*/
|
|
18
|
-
defaultPath?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Patterns to ignore when loading the contextual argument value.
|
|
21
|
-
*
|
|
22
|
-
* This should only be used for Directory types.
|
|
23
|
-
*/
|
|
24
|
-
ignore?: string[];
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Registry stores class and method that have the @object decorator.
|
|
28
|
-
*
|
|
29
|
-
* This is a convenient way to make possible the invocation of class' function.
|
|
30
|
-
*
|
|
31
|
-
* The decorator @object store the class into the Registry, but also all the
|
|
32
|
-
* users method's name.
|
|
33
|
-
* It doesn't consider the `@func` decorator because this is
|
|
34
|
-
* used by the Dagger API to know what to expose or not.
|
|
35
|
-
* This might lead to unnecessary data register into the registry, but
|
|
36
|
-
* we use map as datastructure to optimize the searching process
|
|
37
|
-
* since we directly look through a key into the `class_` member of
|
|
38
|
-
* RegistryClass.
|
|
39
|
-
*/
|
|
40
|
-
export declare class Registry {
|
|
41
|
-
/**
|
|
42
|
-
* The definition of the @object decorator that should be on top of any
|
|
43
|
-
* class module that must be exposed to the Dagger API.
|
|
44
|
-
*/
|
|
45
|
-
object: () => (<T extends Class>(constructor: T) => T);
|
|
46
|
-
/**
|
|
47
|
-
* The definition of the @enum decorator that should be on top of any
|
|
48
|
-
* class module that must be exposed to the Dagger API as enumeration.
|
|
49
|
-
*/
|
|
50
|
-
enumType: () => (<T extends Class>(constructor: T) => T);
|
|
51
|
-
/**
|
|
52
|
-
* The definition of @field decorator that should be on top of any
|
|
53
|
-
* class' property that must be exposed to the Dagger API.
|
|
54
|
-
*
|
|
55
|
-
* @deprecated In favor of `@func`
|
|
56
|
-
* @param alias The alias to use for the field when exposed on the API.
|
|
57
|
-
*/
|
|
58
|
-
field: (alias?: string) => ((target: object, propertyKey: string) => void);
|
|
59
|
-
/**
|
|
60
|
-
* The definition of @func decorator that should be on top of any
|
|
61
|
-
* class' method that must be exposed to the Dagger API.
|
|
62
|
-
*/
|
|
63
|
-
func: (alias?: string) => ((target: object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => void);
|
|
64
|
-
argument: (opts?: ArgumentOptions) => ((target: object, propertyKey: string, parameterIndex: number) => void);
|
|
65
|
-
/**
|
|
66
|
-
* Build a class that is part of the module itself so you can
|
|
67
|
-
* access its sub functions.
|
|
68
|
-
*
|
|
69
|
-
* If there's no class associated, return the object itself.
|
|
70
|
-
*/
|
|
71
|
-
buildClass(object: string, state: State): any;
|
|
72
|
-
/**
|
|
73
|
-
* getResult check for the object and method in the registry and call it
|
|
74
|
-
* with the given input and state.
|
|
75
|
-
*
|
|
76
|
-
* This is the function responsible for any module methods execution.
|
|
77
|
-
*
|
|
78
|
-
* @param object The class to look for
|
|
79
|
-
* @param method The method to call in the class
|
|
80
|
-
* @param state The current state of the class
|
|
81
|
-
* @param inputs The input to send to the method to call
|
|
82
|
-
*/
|
|
83
|
-
getResult(object: string, method: string, state: State, inputs: Args): Promise<any>;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* The default registry used in any module.
|
|
87
|
-
*/
|
|
88
|
-
export declare const registry: Registry;
|
|
89
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../introspector/registry/registry.ts"],"names":[],"mappings":"AAKA,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,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAQ;IACnB;;;OAGG;IACH,MAAM,QAAO,CAAC,CAAC,CAAe,SAAL,KAAK,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAMpD;IAED;;;OAGG;IACH,QAAQ,QAAO,CAAC,CAAC,CAAe,SAAL,KAAK,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAItD;IAED;;;;;;OAMG;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,CAAC,EAAE,kBAAkB,KAC5B,IAAI,CAAC,CAMT;IAED,QAAQ,UACC,eAAe,KACrB,CAAC,CACF,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,KACnB,IAAI,CAAC,CAET;IAED;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG;IAY7C;;;;;;;;;;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,115 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
// @experimentalDecorators
|
|
4
|
-
// @emitDecoratorMetadata
|
|
5
|
-
import "reflect-metadata";
|
|
6
|
-
import { UnknownDaggerError } from "../../common/errors/UnknownDaggerError.js";
|
|
7
|
-
/**
|
|
8
|
-
* Registry stores class and method that have the @object decorator.
|
|
9
|
-
*
|
|
10
|
-
* This is a convenient way to make possible the invocation of class' function.
|
|
11
|
-
*
|
|
12
|
-
* The decorator @object store the class into the Registry, but also all the
|
|
13
|
-
* users method's name.
|
|
14
|
-
* It doesn't consider the `@func` decorator because this is
|
|
15
|
-
* used by the Dagger API to know what to expose or not.
|
|
16
|
-
* This might lead to unnecessary data register into the registry, but
|
|
17
|
-
* we use map as datastructure to optimize the searching process
|
|
18
|
-
* since we directly look through a key into the `class_` member of
|
|
19
|
-
* RegistryClass.
|
|
20
|
-
*/
|
|
21
|
-
export class Registry {
|
|
22
|
-
/**
|
|
23
|
-
* The definition of the @object decorator that should be on top of any
|
|
24
|
-
* class module that must be exposed to the Dagger API.
|
|
25
|
-
*/
|
|
26
|
-
object = () => {
|
|
27
|
-
return (constructor) => {
|
|
28
|
-
Reflect.defineMetadata(constructor.name, { class_: constructor }, this);
|
|
29
|
-
return constructor;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* The definition of the @enum decorator that should be on top of any
|
|
34
|
-
* class module that must be exposed to the Dagger API as enumeration.
|
|
35
|
-
*/
|
|
36
|
-
enumType = () => {
|
|
37
|
-
return (constructor) => {
|
|
38
|
-
return constructor;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* The definition of @field decorator that should be on top of any
|
|
43
|
-
* class' property that must be exposed to the Dagger API.
|
|
44
|
-
*
|
|
45
|
-
* @deprecated In favor of `@func`
|
|
46
|
-
* @param alias The alias to use for the field when exposed on the API.
|
|
47
|
-
*/
|
|
48
|
-
field = (alias) => {
|
|
49
|
-
return (target, propertyKey) => {
|
|
50
|
-
// A placeholder to declare field in the registry.
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* The definition of @func decorator that should be on top of any
|
|
55
|
-
* class' method that must be exposed to the Dagger API.
|
|
56
|
-
*/
|
|
57
|
-
func = (alias) => {
|
|
58
|
-
return (target, propertyKey, descriptor) => { };
|
|
59
|
-
};
|
|
60
|
-
argument = (opts) => {
|
|
61
|
-
return (target, propertyKey, parameterIndex) => { };
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Build a class that is part of the module itself so you can
|
|
65
|
-
* access its sub functions.
|
|
66
|
-
*
|
|
67
|
-
* If there's no class associated, return the object itself.
|
|
68
|
-
*/
|
|
69
|
-
buildClass(object, state) {
|
|
70
|
-
const resolver = Reflect.getMetadata(object, this);
|
|
71
|
-
if (!resolver) {
|
|
72
|
-
return object;
|
|
73
|
-
}
|
|
74
|
-
let r = Object.create(resolver.class_.prototype);
|
|
75
|
-
r = Object.assign(r, state);
|
|
76
|
-
return r;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* getResult check for the object and method in the registry and call it
|
|
80
|
-
* with the given input and state.
|
|
81
|
-
*
|
|
82
|
-
* This is the function responsible for any module methods execution.
|
|
83
|
-
*
|
|
84
|
-
* @param object The class to look for
|
|
85
|
-
* @param method The method to call in the class
|
|
86
|
-
* @param state The current state of the class
|
|
87
|
-
* @param inputs The input to send to the method to call
|
|
88
|
-
*/
|
|
89
|
-
async getResult(object, method, state, inputs) {
|
|
90
|
-
// Retrieve the resolver class from its key
|
|
91
|
-
const resolver = Reflect.getMetadata(object, this);
|
|
92
|
-
if (!resolver) {
|
|
93
|
-
throw new UnknownDaggerError(`${object} is not register as a resolver`, {});
|
|
94
|
-
}
|
|
95
|
-
// If method is nil, apply the constructor.
|
|
96
|
-
if (method === "") {
|
|
97
|
-
return new resolver.class_(...Object.values(inputs));
|
|
98
|
-
}
|
|
99
|
-
// Instantiate the class without calling the constructor
|
|
100
|
-
let r = Object.create(resolver.class_.prototype);
|
|
101
|
-
// Safety check to make sure the method called exist in the class
|
|
102
|
-
// to avoid the app to crash brutally.
|
|
103
|
-
if (!r[method]) {
|
|
104
|
-
throw new UnknownDaggerError(`${method} is not registered in the resolver ${object}`, {});
|
|
105
|
-
}
|
|
106
|
-
// Apply state to the class
|
|
107
|
-
r = Object.assign(r, state);
|
|
108
|
-
// Execute and return the result
|
|
109
|
-
return await r[method](...Object.values(inputs));
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* The default registry used in any module.
|
|
114
|
-
*/
|
|
115
|
-
export const registry = new Registry();
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { TypeDefKind } from "../../../api/client.gen.js";
|
|
3
|
-
import { TypeDef } from "../typeDefs.js";
|
|
4
|
-
export declare const ARGUMENT_DECORATOR: string;
|
|
5
|
-
export type Arguments = {
|
|
6
|
-
[name: string]: Argument;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Argument is an abstraction of a function argument.
|
|
10
|
-
*
|
|
11
|
-
* This aims to simplify and adds clarity to how we analyse the code and using
|
|
12
|
-
* clear accessor.
|
|
13
|
-
*/
|
|
14
|
-
export declare class Argument {
|
|
15
|
-
private symbol;
|
|
16
|
-
private checker;
|
|
17
|
-
private param;
|
|
18
|
-
private _name;
|
|
19
|
-
private _description;
|
|
20
|
-
private _type;
|
|
21
|
-
private _defaultValue;
|
|
22
|
-
private _isOptional;
|
|
23
|
-
private _isNullable;
|
|
24
|
-
private _isVariadic;
|
|
25
|
-
private _defaultPath?;
|
|
26
|
-
private _ignore?;
|
|
27
|
-
/**
|
|
28
|
-
* Create a new Argument instance.
|
|
29
|
-
*
|
|
30
|
-
* @param checker Checker to use to introspect the type of the argument.
|
|
31
|
-
* @param param The symbol of the argument to introspect.
|
|
32
|
-
*
|
|
33
|
-
* @throws UnknownDaggerError If the symbol doesn't have any declaration.
|
|
34
|
-
* @throws UnknownDaggerError If the declaration of the symbol isn't a parameter.
|
|
35
|
-
*/
|
|
36
|
-
constructor(checker: ts.TypeChecker, param: ts.Symbol);
|
|
37
|
-
get name(): string;
|
|
38
|
-
get description(): string;
|
|
39
|
-
/**
|
|
40
|
-
* Return the type of the argument in a Dagger TypeDef format.
|
|
41
|
-
*/
|
|
42
|
-
get type(): TypeDef<TypeDefKind>;
|
|
43
|
-
get defaultValue(): string | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Return true if the parameter is optional.
|
|
46
|
-
*
|
|
47
|
-
* A parameter is considered optional if he fits one of the following:
|
|
48
|
-
* - It has a question token (e.g. `foo?: <type>`).
|
|
49
|
-
* - It's variadic (e.g. `...foo: <type>[]`).
|
|
50
|
-
* - It's nullable (e.g. `foo: <type> | null`).
|
|
51
|
-
*/
|
|
52
|
-
get isOptional(): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Return true if the parameter is nullable.
|
|
55
|
-
*
|
|
56
|
-
* A parameter is considered nullable if itstype is a union type with `null`
|
|
57
|
-
* on the list of types.
|
|
58
|
-
* Example: `foo: string | null`.
|
|
59
|
-
*/
|
|
60
|
-
get isNullable(): boolean;
|
|
61
|
-
get isVariadic(): boolean;
|
|
62
|
-
get defaultPath(): string | undefined;
|
|
63
|
-
get ignore(): string[] | undefined;
|
|
64
|
-
toJSON(): {
|
|
65
|
-
name: string;
|
|
66
|
-
description: string;
|
|
67
|
-
type: TypeDef<TypeDefKind>;
|
|
68
|
-
isVariadic: boolean;
|
|
69
|
-
isNullable: boolean;
|
|
70
|
-
isOptional: boolean;
|
|
71
|
-
defaultValue: string | undefined;
|
|
72
|
-
defaultPath: string | undefined;
|
|
73
|
-
ignore: string[] | undefined;
|
|
74
|
-
};
|
|
75
|
-
private loadName;
|
|
76
|
-
private loadDescription;
|
|
77
|
-
private loadType;
|
|
78
|
-
private loadDefaultValue;
|
|
79
|
-
/**
|
|
80
|
-
* Return true if the parameter is optional.
|
|
81
|
-
*
|
|
82
|
-
* A parameter is considered optional if:
|
|
83
|
-
* - It has a question token (e.g. `foo?: <type>`).
|
|
84
|
-
* - It's variadic (e.g. `...foo: <type>[]`).
|
|
85
|
-
* - It's nullable (e.g. `foo: <type> | null`).
|
|
86
|
-
*/
|
|
87
|
-
private loadIsOptional;
|
|
88
|
-
private loadIsNullable;
|
|
89
|
-
private loadIsVariadic;
|
|
90
|
-
/**
|
|
91
|
-
* The TypeScript Compiler API returns the raw default value as it is written
|
|
92
|
-
* by the user.
|
|
93
|
-
* However, some notations are not supported by GraphQL so this function
|
|
94
|
-
* formats the default value to be compatible with the GraphQL syntax.
|
|
95
|
-
*
|
|
96
|
-
* Formatting rules:
|
|
97
|
-
* - Single quote strings are converted to double quote strings.
|
|
98
|
-
*
|
|
99
|
-
* @param value The value to format.
|
|
100
|
-
*/
|
|
101
|
-
private formatDefaultValue;
|
|
102
|
-
private loadMetadata;
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=argument.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAIxD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,eAAO,MAAM,kBAAkB,QAAgB,CAAA;AAE/C,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;IAGtC,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,aAAa,CAAoB;IACzC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAC,CAAQ;IAC7B,OAAO,CAAC,OAAO,CAAC,CAAU;IAE1B;;;;;;;;OAQG;gBACS,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM;IAiCrD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,CAE/B;IAED,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAErC;IAED;;;;;;;OAOG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;;;;;OAMG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,MAAM,IAAI,MAAM,EAAE,GAAG,SAAS,CAEjC;IAED,MAAM;;;;;;;;;;;IAcN,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,QAAQ;IAgBhB,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,cAAc;IAItB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,YAAY;CAgCrB"}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { UnknownDaggerError } from "../../../common/errors/UnknownDaggerError.js";
|
|
3
|
-
import { argument } from "../../decorators/decorators.js";
|
|
4
|
-
import { typeToTypedef } from "./typeToTypedef.js";
|
|
5
|
-
export const ARGUMENT_DECORATOR = argument.name;
|
|
6
|
-
/**
|
|
7
|
-
* Argument is an abstraction of a function argument.
|
|
8
|
-
*
|
|
9
|
-
* This aims to simplify and adds clarity to how we analyse the code and using
|
|
10
|
-
* clear accessor.
|
|
11
|
-
*/
|
|
12
|
-
export class Argument {
|
|
13
|
-
symbol;
|
|
14
|
-
checker;
|
|
15
|
-
param;
|
|
16
|
-
// Preloaded values.
|
|
17
|
-
_name;
|
|
18
|
-
_description;
|
|
19
|
-
_type;
|
|
20
|
-
_defaultValue;
|
|
21
|
-
_isOptional;
|
|
22
|
-
_isNullable;
|
|
23
|
-
_isVariadic;
|
|
24
|
-
_defaultPath;
|
|
25
|
-
_ignore;
|
|
26
|
-
/**
|
|
27
|
-
* Create a new Argument instance.
|
|
28
|
-
*
|
|
29
|
-
* @param checker Checker to use to introspect the type of the argument.
|
|
30
|
-
* @param param The symbol of the argument to introspect.
|
|
31
|
-
*
|
|
32
|
-
* @throws UnknownDaggerError If the symbol doesn't have any declaration.
|
|
33
|
-
* @throws UnknownDaggerError If the declaration of the symbol isn't a parameter.
|
|
34
|
-
*/
|
|
35
|
-
constructor(checker, param) {
|
|
36
|
-
this.symbol = param;
|
|
37
|
-
this.checker = checker;
|
|
38
|
-
const declarations = this.symbol.getDeclarations();
|
|
39
|
-
if (!declarations || declarations.length < 0) {
|
|
40
|
-
throw new UnknownDaggerError(`could not find param declarations of symbol ${this.symbol.name}`, {});
|
|
41
|
-
}
|
|
42
|
-
const parameterDeclaration = declarations[0];
|
|
43
|
-
if (!ts.isParameter(parameterDeclaration)) {
|
|
44
|
-
throw new UnknownDaggerError(`the declaration of symbol ${this.symbol.name} isn't a parameter`, {});
|
|
45
|
-
}
|
|
46
|
-
this.param = parameterDeclaration;
|
|
47
|
-
// Preload to optimize the introspection.
|
|
48
|
-
this._name = this.loadName();
|
|
49
|
-
this._description = this.loadDescription();
|
|
50
|
-
this._type = this.loadType();
|
|
51
|
-
this._defaultValue = this.loadDefaultValue();
|
|
52
|
-
this._isNullable = this.loadIsNullable();
|
|
53
|
-
this._isVariadic = this.loadIsVariadic();
|
|
54
|
-
this._isOptional = this.loadIsOptional();
|
|
55
|
-
this.loadMetadata();
|
|
56
|
-
}
|
|
57
|
-
get name() {
|
|
58
|
-
return this._name;
|
|
59
|
-
}
|
|
60
|
-
get description() {
|
|
61
|
-
return this._description;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Return the type of the argument in a Dagger TypeDef format.
|
|
65
|
-
*/
|
|
66
|
-
get type() {
|
|
67
|
-
return this._type;
|
|
68
|
-
}
|
|
69
|
-
get defaultValue() {
|
|
70
|
-
return this._defaultValue;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Return true if the parameter is optional.
|
|
74
|
-
*
|
|
75
|
-
* A parameter is considered optional if he fits one of the following:
|
|
76
|
-
* - It has a question token (e.g. `foo?: <type>`).
|
|
77
|
-
* - It's variadic (e.g. `...foo: <type>[]`).
|
|
78
|
-
* - It's nullable (e.g. `foo: <type> | null`).
|
|
79
|
-
*/
|
|
80
|
-
get isOptional() {
|
|
81
|
-
return this._isOptional;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Return true if the parameter is nullable.
|
|
85
|
-
*
|
|
86
|
-
* A parameter is considered nullable if itstype is a union type with `null`
|
|
87
|
-
* on the list of types.
|
|
88
|
-
* Example: `foo: string | null`.
|
|
89
|
-
*/
|
|
90
|
-
get isNullable() {
|
|
91
|
-
return this._isNullable;
|
|
92
|
-
}
|
|
93
|
-
get isVariadic() {
|
|
94
|
-
return this._isVariadic;
|
|
95
|
-
}
|
|
96
|
-
get defaultPath() {
|
|
97
|
-
return this._defaultPath;
|
|
98
|
-
}
|
|
99
|
-
get ignore() {
|
|
100
|
-
return this._ignore;
|
|
101
|
-
}
|
|
102
|
-
toJSON() {
|
|
103
|
-
return {
|
|
104
|
-
name: this.name,
|
|
105
|
-
description: this.description,
|
|
106
|
-
type: this.type,
|
|
107
|
-
isVariadic: this.isVariadic,
|
|
108
|
-
isNullable: this.isNullable,
|
|
109
|
-
isOptional: this.isOptional,
|
|
110
|
-
defaultValue: this.defaultValue,
|
|
111
|
-
defaultPath: this.defaultPath,
|
|
112
|
-
ignore: this.ignore,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
loadName() {
|
|
116
|
-
return this.symbol.getName();
|
|
117
|
-
}
|
|
118
|
-
loadDescription() {
|
|
119
|
-
return ts.displayPartsToString(this.symbol.getDocumentationComment(this.checker));
|
|
120
|
-
}
|
|
121
|
-
loadType() {
|
|
122
|
-
if (!this.symbol.valueDeclaration) {
|
|
123
|
-
throw new UnknownDaggerError("could not find symbol value declaration", {});
|
|
124
|
-
}
|
|
125
|
-
const type = this.checker.getTypeOfSymbolAtLocation(this.symbol, this.symbol.valueDeclaration);
|
|
126
|
-
return typeToTypedef(this.checker, type);
|
|
127
|
-
}
|
|
128
|
-
loadDefaultValue() {
|
|
129
|
-
if (this.param.initializer === undefined) {
|
|
130
|
-
return undefined;
|
|
131
|
-
}
|
|
132
|
-
return this.formatDefaultValue(this.param.initializer.getText());
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Return true if the parameter is optional.
|
|
136
|
-
*
|
|
137
|
-
* A parameter is considered optional if:
|
|
138
|
-
* - It has a question token (e.g. `foo?: <type>`).
|
|
139
|
-
* - It's variadic (e.g. `...foo: <type>[]`).
|
|
140
|
-
* - It's nullable (e.g. `foo: <type> | null`).
|
|
141
|
-
*/
|
|
142
|
-
loadIsOptional() {
|
|
143
|
-
return (this.param.questionToken !== undefined ||
|
|
144
|
-
this.isVariadic ||
|
|
145
|
-
this.isNullable);
|
|
146
|
-
}
|
|
147
|
-
loadIsNullable() {
|
|
148
|
-
if (!this.param.type) {
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
if (ts.isUnionTypeNode(this.param.type)) {
|
|
152
|
-
for (const _type of this.param.type.types) {
|
|
153
|
-
if (_type.getText() === "null") {
|
|
154
|
-
return true;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
loadIsVariadic() {
|
|
161
|
-
return this.param.dotDotDotToken !== undefined;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* The TypeScript Compiler API returns the raw default value as it is written
|
|
165
|
-
* by the user.
|
|
166
|
-
* However, some notations are not supported by GraphQL so this function
|
|
167
|
-
* formats the default value to be compatible with the GraphQL syntax.
|
|
168
|
-
*
|
|
169
|
-
* Formatting rules:
|
|
170
|
-
* - Single quote strings are converted to double quote strings.
|
|
171
|
-
*
|
|
172
|
-
* @param value The value to format.
|
|
173
|
-
*/
|
|
174
|
-
formatDefaultValue(value) {
|
|
175
|
-
const isSingleQuoteString = () => value.startsWith("'") && value.endsWith("'");
|
|
176
|
-
if (isSingleQuoteString()) {
|
|
177
|
-
return `"${value.slice(1, value.length - 1)}"`;
|
|
178
|
-
}
|
|
179
|
-
return value;
|
|
180
|
-
}
|
|
181
|
-
loadMetadata() {
|
|
182
|
-
const contextDecorator = ts.getDecorators(this.param)?.find((d) => {
|
|
183
|
-
if (ts.isCallExpression(d.expression)) {
|
|
184
|
-
return d.expression.expression.getText() === ARGUMENT_DECORATOR;
|
|
185
|
-
}
|
|
186
|
-
return false;
|
|
187
|
-
});
|
|
188
|
-
if (!contextDecorator) {
|
|
189
|
-
return undefined;
|
|
190
|
-
}
|
|
191
|
-
const expression = contextDecorator.expression;
|
|
192
|
-
const arg = expression.arguments[0];
|
|
193
|
-
if (!arg) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
// We eval the string to convert it to a JavaScript object, because parsing it
|
|
197
|
-
// with JSON.parse will fails if the properties are not quoted.
|
|
198
|
-
const parsedArg = eval(`(${arg.getText()})`);
|
|
199
|
-
if (parsedArg.defaultPath) {
|
|
200
|
-
this._defaultPath = parsedArg.defaultPath;
|
|
201
|
-
}
|
|
202
|
-
if (parsedArg.ignore) {
|
|
203
|
-
this._ignore = parsedArg.ignore;
|
|
204
|
-
}
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { Arguments } from "./argument.js";
|
|
3
|
-
export declare class Constructor {
|
|
4
|
-
private checker;
|
|
5
|
-
private declaration;
|
|
6
|
-
private _name;
|
|
7
|
-
private _arguments;
|
|
8
|
-
constructor(checker: ts.TypeChecker, declaration: ts.ConstructorDeclaration);
|
|
9
|
-
get name(): string;
|
|
10
|
-
get arguments(): Arguments;
|
|
11
|
-
toJSON(): {
|
|
12
|
-
args: Arguments;
|
|
13
|
-
};
|
|
14
|
-
getArgOrder(): string[];
|
|
15
|
-
private loadArguments;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=constructor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constructor.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/constructor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAG3B,OAAO,EAAY,SAAS,EAAE,MAAM,eAAe,CAAA;AAEnD,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,WAAW,CAA2B;IAG9C,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,UAAU,CAAW;gBAEjB,OAAO,EAAE,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,CAAC,sBAAsB;IAQ3E,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED,MAAM;;;IAMN,WAAW,IAAI,MAAM,EAAE;IAIvB,OAAO,CAAC,aAAa;CAiBtB"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { UnknownDaggerError } from "../../../common/errors/UnknownDaggerError.js";
|
|
2
|
-
import { Argument } from "./argument.js";
|
|
3
|
-
export class Constructor {
|
|
4
|
-
checker;
|
|
5
|
-
declaration;
|
|
6
|
-
// Preloaded values.
|
|
7
|
-
_name = "";
|
|
8
|
-
_arguments;
|
|
9
|
-
constructor(checker, declaration) {
|
|
10
|
-
this.checker = checker;
|
|
11
|
-
this.declaration = declaration;
|
|
12
|
-
// Preload values.
|
|
13
|
-
this._arguments = this.loadArguments();
|
|
14
|
-
}
|
|
15
|
-
get name() {
|
|
16
|
-
return this._name;
|
|
17
|
-
}
|
|
18
|
-
get arguments() {
|
|
19
|
-
return this._arguments;
|
|
20
|
-
}
|
|
21
|
-
toJSON() {
|
|
22
|
-
return {
|
|
23
|
-
args: this.arguments,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
getArgOrder() {
|
|
27
|
-
return Object.keys(this.arguments);
|
|
28
|
-
}
|
|
29
|
-
loadArguments() {
|
|
30
|
-
return this.declaration.parameters.reduce((acc, param) => {
|
|
31
|
-
const symbol = this.checker.getSymbolAtLocation(param.name);
|
|
32
|
-
if (!symbol) {
|
|
33
|
-
throw new UnknownDaggerError(`could not get constructor param: ${param.name.getText()}`, {});
|
|
34
|
-
}
|
|
35
|
-
const argument = new Argument(this.checker, symbol);
|
|
36
|
-
acc[argument.name] = argument;
|
|
37
|
-
return acc;
|
|
38
|
-
}, {});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { DaggerEnumValues } from "./enumValue.js";
|
|
3
|
-
export declare const ENUM_DECORATOR: string;
|
|
4
|
-
/**
|
|
5
|
-
* Return true if the given class declaration has the decorator @enum() on
|
|
6
|
-
* top of its declaration.
|
|
7
|
-
*/
|
|
8
|
-
export declare function isEnumDecorated(object: ts.ClassDeclaration): boolean;
|
|
9
|
-
export type DaggerEnums = {
|
|
10
|
-
[name: string]: DaggerEnum;
|
|
11
|
-
};
|
|
12
|
-
export declare class DaggerEnum {
|
|
13
|
-
private checker;
|
|
14
|
-
private enumClass;
|
|
15
|
-
private symbol;
|
|
16
|
-
private file;
|
|
17
|
-
private _name;
|
|
18
|
-
private _description;
|
|
19
|
-
private _values;
|
|
20
|
-
constructor(checker: ts.TypeChecker, file: ts.SourceFile, enumClassDeclaration: ts.ClassDeclaration);
|
|
21
|
-
get name(): string;
|
|
22
|
-
get description(): string;
|
|
23
|
-
get values(): DaggerEnumValues;
|
|
24
|
-
toJSON(): {
|
|
25
|
-
name: string;
|
|
26
|
-
description: string;
|
|
27
|
-
values: DaggerEnumValues;
|
|
28
|
-
};
|
|
29
|
-
private loadName;
|
|
30
|
-
private loadDescription;
|
|
31
|
-
private loadEnumValues;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=enum.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../../introspector/scanner/abtractions/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAI3B,OAAO,EAAmB,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAElE,eAAO,MAAM,cAAc,QAAgB,CAAA;AAE3C;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,GAAG,OAAO,CAUpE;AAED,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAA;AAExD,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,SAAS,CAAqB;IAEtC,OAAO,CAAC,MAAM,CAAW;IAEzB,OAAO,CAAC,IAAI,CAAe;IAE3B,OAAO,CAAC,KAAK,CAAQ;IAErB,OAAO,CAAC,YAAY,CAAQ;IAE5B,OAAO,CAAC,OAAO,CAAkB;gBAG/B,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,IAAI,EAAE,EAAE,CAAC,UAAU,EACnB,oBAAoB,EAAE,EAAE,CAAC,gBAAgB;IA+B3C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,MAAM,IAAI,gBAAgB,CAE7B;IAED,MAAM;;;;;IAQN,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,cAAc;CAYvB"}
|