@dagger.io/dagger 0.0.1-0
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/LICENSE +191 -0
- package/README.md +88 -0
- package/dist/src/api/client.gen.d.ts +6123 -0
- package/dist/src/api/client.gen.d.ts.map +1 -0
- package/dist/src/api/client.gen.js +8494 -0
- package/dist/src/common/context.d.ts +12 -0
- package/dist/src/common/context.d.ts.map +1 -0
- package/dist/src/common/context.js +22 -0
- package/dist/src/common/errors/DaggerSDKError.d.ts +32 -0
- package/dist/src/common/errors/DaggerSDKError.d.ts.map +1 -0
- package/dist/src/common/errors/DaggerSDKError.js +26 -0
- package/dist/src/common/errors/DockerImageRefValidationError.d.ts +22 -0
- package/dist/src/common/errors/DockerImageRefValidationError.d.ts.map +1 -0
- package/dist/src/common/errors/DockerImageRefValidationError.js +21 -0
- package/dist/src/common/errors/EngineSessionConnectParamsParseError.d.ts +21 -0
- package/dist/src/common/errors/EngineSessionConnectParamsParseError.d.ts.map +1 -0
- package/dist/src/common/errors/EngineSessionConnectParamsParseError.js +20 -0
- package/dist/src/common/errors/EngineSessionConnectionTimeoutError.d.ts +21 -0
- package/dist/src/common/errors/EngineSessionConnectionTimeoutError.d.ts.map +1 -0
- package/dist/src/common/errors/EngineSessionConnectionTimeoutError.js +20 -0
- package/dist/src/common/errors/EngineSessionErrorOptions.d.ts +16 -0
- package/dist/src/common/errors/EngineSessionErrorOptions.d.ts.map +1 -0
- package/dist/src/common/errors/EngineSessionErrorOptions.js +16 -0
- package/dist/src/common/errors/ExecError.d.ts +42 -0
- package/dist/src/common/errors/ExecError.d.ts.map +1 -0
- package/dist/src/common/errors/ExecError.js +40 -0
- package/dist/src/common/errors/FunctionNotFound.d.ts +7 -0
- package/dist/src/common/errors/FunctionNotFound.d.ts.map +1 -0
- package/dist/src/common/errors/FunctionNotFound.js +9 -0
- package/dist/src/common/errors/GraphQLRequestError.d.ts +31 -0
- package/dist/src/common/errors/GraphQLRequestError.d.ts.map +1 -0
- package/dist/src/common/errors/GraphQLRequestError.js +30 -0
- package/dist/src/common/errors/InitEngineSessionBinaryError.d.ts +13 -0
- package/dist/src/common/errors/InitEngineSessionBinaryError.d.ts.map +1 -0
- package/dist/src/common/errors/InitEngineSessionBinaryError.js +15 -0
- package/dist/src/common/errors/IntrospectionError.d.ts +7 -0
- package/dist/src/common/errors/IntrospectionError.d.ts.map +1 -0
- package/dist/src/common/errors/IntrospectionError.js +9 -0
- package/dist/src/common/errors/NotAwaitedRequestError.d.ts +13 -0
- package/dist/src/common/errors/NotAwaitedRequestError.d.ts.map +1 -0
- package/dist/src/common/errors/NotAwaitedRequestError.js +15 -0
- package/dist/src/common/errors/TooManyNestedObjectsError.d.ts +21 -0
- package/dist/src/common/errors/TooManyNestedObjectsError.d.ts.map +1 -0
- package/dist/src/common/errors/TooManyNestedObjectsError.js +20 -0
- package/dist/src/common/errors/UnknownDaggerError.d.ts +13 -0
- package/dist/src/common/errors/UnknownDaggerError.d.ts.map +1 -0
- package/dist/src/common/errors/UnknownDaggerError.js +15 -0
- package/dist/src/common/errors/errors-codes.d.ts +55 -0
- package/dist/src/common/errors/errors-codes.d.ts.map +1 -0
- package/dist/src/common/errors/errors-codes.js +47 -0
- package/dist/src/common/errors/index.d.ts +15 -0
- package/dist/src/common/errors/index.d.ts.map +1 -0
- package/dist/src/common/errors/index.js +14 -0
- package/dist/src/common/graphql/client.d.ts +3 -0
- package/dist/src/common/graphql/client.d.ts.map +1 -0
- package/dist/src/common/graphql/client.js +58 -0
- package/dist/src/common/graphql/compute_query.d.ts +37 -0
- package/dist/src/common/graphql/compute_query.d.ts.map +1 -0
- package/dist/src/common/graphql/compute_query.js +171 -0
- package/dist/src/common/graphql/connect.d.ts +8 -0
- package/dist/src/common/graphql/connect.d.ts.map +1 -0
- package/dist/src/common/graphql/connect.js +22 -0
- package/dist/src/common/graphql/connection.d.ts +14 -0
- package/dist/src/common/graphql/connection.d.ts.map +1 -0
- package/dist/src/common/graphql/connection.js +23 -0
- package/dist/src/common/utils.d.ts +70 -0
- package/dist/src/common/utils.d.ts.map +1 -0
- package/dist/src/common/utils.js +6 -0
- package/dist/src/connect.d.ts +28 -0
- package/dist/src/connect.d.ts.map +1 -0
- package/dist/src/connect.js +64 -0
- package/dist/src/connectOpts.d.ts +24 -0
- package/dist/src/connectOpts.d.ts.map +1 -0
- package/dist/src/connectOpts.js +1 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +13 -0
- package/dist/src/module/decorators.d.ts +52 -0
- package/dist/src/module/decorators.d.ts.map +1 -0
- package/dist/src/module/decorators.js +55 -0
- package/dist/src/module/entrypoint/context.d.ts +8 -0
- package/dist/src/module/entrypoint/context.d.ts.map +1 -0
- package/dist/src/module/entrypoint/context.js +1 -0
- package/dist/src/module/entrypoint/entrypoint.d.ts +2 -0
- package/dist/src/module/entrypoint/entrypoint.d.ts.map +1 -0
- package/dist/src/module/entrypoint/entrypoint.js +92 -0
- package/dist/src/module/entrypoint/introspection_entrypoint.d.ts +2 -0
- package/dist/src/module/entrypoint/introspection_entrypoint.d.ts.map +1 -0
- package/dist/src/module/entrypoint/introspection_entrypoint.js +52 -0
- package/dist/src/module/entrypoint/invoke.d.ts +14 -0
- package/dist/src/module/entrypoint/invoke.d.ts.map +1 -0
- package/dist/src/module/entrypoint/invoke.js +66 -0
- package/dist/src/module/entrypoint/load.d.ts +53 -0
- package/dist/src/module/entrypoint/load.d.ts.map +1 -0
- package/dist/src/module/entrypoint/load.js +237 -0
- package/dist/src/module/entrypoint/register.d.ts +33 -0
- package/dist/src/module/entrypoint/register.d.ts.map +1 -0
- package/dist/src/module/entrypoint/register.js +227 -0
- package/dist/src/module/executor.d.ts +28 -0
- package/dist/src/module/executor.d.ts.map +1 -0
- package/dist/src/module/executor.js +171 -0
- package/dist/src/module/introspector/case_convertor.d.ts +2 -0
- package/dist/src/module/introspector/case_convertor.d.ts.map +1 -0
- package/dist/src/module/introspector/case_convertor.js +15 -0
- package/dist/src/module/introspector/dagger_module/argument.d.ts +50 -0
- package/dist/src/module/introspector/dagger_module/argument.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/argument.js +118 -0
- package/dist/src/module/introspector/dagger_module/constructor.d.ts +18 -0
- package/dist/src/module/introspector/dagger_module/constructor.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/constructor.js +38 -0
- package/dist/src/module/introspector/dagger_module/decorator.d.ts +8 -0
- package/dist/src/module/introspector/dagger_module/decorator.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/decorator.js +7 -0
- package/dist/src/module/introspector/dagger_module/enum.d.ts +41 -0
- package/dist/src/module/introspector/dagger_module/enum.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/enum.js +63 -0
- package/dist/src/module/introspector/dagger_module/enumBase.d.ts +19 -0
- package/dist/src/module/introspector/dagger_module/enumBase.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/enumBase.js +1 -0
- package/dist/src/module/introspector/dagger_module/enumClass.d.ts +41 -0
- package/dist/src/module/introspector/dagger_module/enumClass.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/enumClass.js +69 -0
- package/dist/src/module/introspector/dagger_module/function.d.ts +39 -0
- package/dist/src/module/introspector/dagger_module/function.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/function.js +102 -0
- package/dist/src/module/introspector/dagger_module/index.d.ts +15 -0
- package/dist/src/module/introspector/dagger_module/index.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/index.js +14 -0
- package/dist/src/module/introspector/dagger_module/interface.d.ts +25 -0
- package/dist/src/module/introspector/dagger_module/interface.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/interface.js +56 -0
- package/dist/src/module/introspector/dagger_module/interfaceFunction.d.ts +35 -0
- package/dist/src/module/introspector/dagger_module/interfaceFunction.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/interfaceFunction.js +92 -0
- package/dist/src/module/introspector/dagger_module/locatable.d.ts +12 -0
- package/dist/src/module/introspector/dagger_module/locatable.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/locatable.js +14 -0
- package/dist/src/module/introspector/dagger_module/module.d.ts +118 -0
- package/dist/src/module/introspector/dagger_module/module.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/module.js +316 -0
- package/dist/src/module/introspector/dagger_module/object.d.ts +46 -0
- package/dist/src/module/introspector/dagger_module/object.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/object.js +113 -0
- package/dist/src/module/introspector/dagger_module/objectBase.d.ts +32 -0
- package/dist/src/module/introspector/dagger_module/objectBase.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/objectBase.js +1 -0
- package/dist/src/module/introspector/dagger_module/property.d.ts +36 -0
- package/dist/src/module/introspector/dagger_module/property.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/property.js +82 -0
- package/dist/src/module/introspector/dagger_module/reference.d.ts +13 -0
- package/dist/src/module/introspector/dagger_module/reference.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/reference.js +33 -0
- package/dist/src/module/introspector/dagger_module/typeObject.d.ts +49 -0
- package/dist/src/module/introspector/dagger_module/typeObject.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/typeObject.js +87 -0
- package/dist/src/module/introspector/dagger_module/typeObjectProperty.d.ts +34 -0
- package/dist/src/module/introspector/dagger_module/typeObjectProperty.d.ts.map +1 -0
- package/dist/src/module/introspector/dagger_module/typeObjectProperty.js +60 -0
- package/dist/src/module/introspector/index.d.ts +3 -0
- package/dist/src/module/introspector/index.d.ts.map +1 -0
- package/dist/src/module/introspector/index.js +19 -0
- package/dist/src/module/introspector/typedef.d.ts +52 -0
- package/dist/src/module/introspector/typedef.d.ts.map +1 -0
- package/dist/src/module/introspector/typedef.js +1 -0
- package/dist/src/module/introspector/typescript_module/ast.d.ts +64 -0
- package/dist/src/module/introspector/typescript_module/ast.d.ts.map +1 -0
- package/dist/src/module/introspector/typescript_module/ast.js +476 -0
- package/dist/src/module/introspector/typescript_module/declarations.d.ts +15 -0
- package/dist/src/module/introspector/typescript_module/declarations.d.ts.map +1 -0
- package/dist/src/module/introspector/typescript_module/declarations.js +10 -0
- package/dist/src/module/introspector/typescript_module/index.d.ts +4 -0
- package/dist/src/module/introspector/typescript_module/index.d.ts.map +1 -0
- package/dist/src/module/introspector/typescript_module/index.js +3 -0
- package/dist/src/module/introspector/typescript_module/location.d.ts +6 -0
- package/dist/src/module/introspector/typescript_module/location.d.ts.map +1 -0
- package/dist/src/module/introspector/typescript_module/location.js +1 -0
- package/dist/src/module/introspector/typescript_module/typedef_utils.d.ts +5 -0
- package/dist/src/module/introspector/typescript_module/typedef_utils.d.ts.map +1 -0
- package/dist/src/module/introspector/typescript_module/typedef_utils.js +26 -0
- package/dist/src/module/introspector/utils/files.d.ts +5 -0
- package/dist/src/module/introspector/utils/files.d.ts.map +1 -0
- package/dist/src/module/introspector/utils/files.js +28 -0
- package/dist/src/module/registry.d.ts +109 -0
- package/dist/src/module/registry.d.ts.map +1 -0
- package/dist/src/module/registry.js +123 -0
- package/dist/src/provisioning/bin.d.ts +77 -0
- package/dist/src/provisioning/bin.d.ts.map +1 -0
- package/dist/src/provisioning/bin.js +353 -0
- package/dist/src/provisioning/default.d.ts +2 -0
- package/dist/src/provisioning/default.d.ts.map +1 -0
- package/dist/src/provisioning/default.js +2 -0
- package/dist/src/provisioning/engineconn.d.ts +30 -0
- package/dist/src/provisioning/engineconn.d.ts.map +1 -0
- package/dist/src/provisioning/engineconn.js +1 -0
- package/dist/src/provisioning/index.d.ts +4 -0
- package/dist/src/provisioning/index.d.ts.map +1 -0
- package/dist/src/provisioning/index.js +14 -0
- package/dist/src/telemetry/index.d.ts +3 -0
- package/dist/src/telemetry/index.d.ts.map +1 -0
- package/dist/src/telemetry/index.js +2 -0
- package/dist/src/telemetry/init.d.ts +21 -0
- package/dist/src/telemetry/init.d.ts.map +1 -0
- package/dist/src/telemetry/init.js +86 -0
- package/dist/src/telemetry/live_processor.d.ts +12 -0
- package/dist/src/telemetry/live_processor.d.ts.map +1 -0
- package/dist/src/telemetry/live_processor.js +13 -0
- package/dist/src/telemetry/telemetry.d.ts +16 -0
- package/dist/src/telemetry/telemetry.d.ts.map +1 -0
- package/dist/src/telemetry/telemetry.js +38 -0
- package/dist/src/telemetry/tracer.d.ts +32 -0
- package/dist/src/telemetry/tracer.d.ts.map +1 -0
- package/dist/src/telemetry/tracer.js +54 -0
- package/package.json +74 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const ERROR_CODES: {
|
|
2
|
+
/**
|
|
3
|
+
* {@link GraphQLRequestError}
|
|
4
|
+
*/
|
|
5
|
+
readonly GraphQLRequestError: "D100";
|
|
6
|
+
/**
|
|
7
|
+
* {@link UnknownDaggerError}
|
|
8
|
+
*/
|
|
9
|
+
readonly UnknownDaggerError: "D101";
|
|
10
|
+
/**
|
|
11
|
+
* {@link TooManyNestedObjectsError}
|
|
12
|
+
*/
|
|
13
|
+
readonly TooManyNestedObjectsError: "D102";
|
|
14
|
+
/**
|
|
15
|
+
* {@link EngineSessionConnectParamsParseError}
|
|
16
|
+
*/
|
|
17
|
+
readonly EngineSessionConnectParamsParseError: "D103";
|
|
18
|
+
/**
|
|
19
|
+
* {@link EngineSessionConnectionTimeoutError}
|
|
20
|
+
*/
|
|
21
|
+
readonly EngineSessionConnectionTimeoutError: "D104";
|
|
22
|
+
/**
|
|
23
|
+
* {@link EngineSessionError}
|
|
24
|
+
*/
|
|
25
|
+
readonly EngineSessionError: "D105";
|
|
26
|
+
/**
|
|
27
|
+
* {@link InitEngineSessionBinaryError}
|
|
28
|
+
*/
|
|
29
|
+
readonly InitEngineSessionBinaryError: "D106";
|
|
30
|
+
/**
|
|
31
|
+
* {@link DockerImageRefValidationError}
|
|
32
|
+
*/
|
|
33
|
+
readonly DockerImageRefValidationError: "D107";
|
|
34
|
+
/**
|
|
35
|
+
* {@link NotAwaitedRequestError}
|
|
36
|
+
*/
|
|
37
|
+
readonly NotAwaitedRequestError: "D108";
|
|
38
|
+
/**
|
|
39
|
+
* (@link ExecError}
|
|
40
|
+
*/
|
|
41
|
+
readonly ExecError: "D109";
|
|
42
|
+
/**
|
|
43
|
+
* {@link IntrospectionError}
|
|
44
|
+
*/
|
|
45
|
+
readonly IntrospectionError: "D110";
|
|
46
|
+
};
|
|
47
|
+
type ErrorCodesType = typeof ERROR_CODES;
|
|
48
|
+
export type ErrorNames = keyof ErrorCodesType;
|
|
49
|
+
export type ErrorCodes = ErrorCodesType[ErrorNames];
|
|
50
|
+
type ErrorNamesMap = {
|
|
51
|
+
readonly [Key in ErrorNames]: Key;
|
|
52
|
+
};
|
|
53
|
+
export declare const ERROR_NAMES: ErrorNamesMap;
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=errors-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-codes.d.ts","sourceRoot":"","sources":["../../../../src/common/errors/errors-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;IACtB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAA;AAEV,KAAK,cAAc,GAAG,OAAO,WAAW,CAAA;AACxC,MAAM,MAAM,UAAU,GAAG,MAAM,cAAc,CAAA;AAC7C,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,CAAA;AAEnD,KAAK,aAAa,GAAG;IAAE,QAAQ,EAAE,GAAG,IAAI,UAAU,GAAG,GAAG;CAAE,CAAA;AAC1D,eAAO,MAAM,WAAW,EAAE,aAKzB,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export const ERROR_CODES = {
|
|
2
|
+
/**
|
|
3
|
+
* {@link GraphQLRequestError}
|
|
4
|
+
*/
|
|
5
|
+
GraphQLRequestError: "D100",
|
|
6
|
+
/**
|
|
7
|
+
* {@link UnknownDaggerError}
|
|
8
|
+
*/
|
|
9
|
+
UnknownDaggerError: "D101",
|
|
10
|
+
/**
|
|
11
|
+
* {@link TooManyNestedObjectsError}
|
|
12
|
+
*/
|
|
13
|
+
TooManyNestedObjectsError: "D102",
|
|
14
|
+
/**
|
|
15
|
+
* {@link EngineSessionConnectParamsParseError}
|
|
16
|
+
*/
|
|
17
|
+
EngineSessionConnectParamsParseError: "D103",
|
|
18
|
+
/**
|
|
19
|
+
* {@link EngineSessionConnectionTimeoutError}
|
|
20
|
+
*/
|
|
21
|
+
EngineSessionConnectionTimeoutError: "D104",
|
|
22
|
+
/**
|
|
23
|
+
* {@link EngineSessionError}
|
|
24
|
+
*/
|
|
25
|
+
EngineSessionError: "D105",
|
|
26
|
+
/**
|
|
27
|
+
* {@link InitEngineSessionBinaryError}
|
|
28
|
+
*/
|
|
29
|
+
InitEngineSessionBinaryError: "D106",
|
|
30
|
+
/**
|
|
31
|
+
* {@link DockerImageRefValidationError}
|
|
32
|
+
*/
|
|
33
|
+
DockerImageRefValidationError: "D107",
|
|
34
|
+
/**
|
|
35
|
+
* {@link NotAwaitedRequestError}
|
|
36
|
+
*/
|
|
37
|
+
NotAwaitedRequestError: "D108",
|
|
38
|
+
/**
|
|
39
|
+
* (@link ExecError}
|
|
40
|
+
*/
|
|
41
|
+
ExecError: "D109",
|
|
42
|
+
/**
|
|
43
|
+
* {@link IntrospectionError}
|
|
44
|
+
*/
|
|
45
|
+
IntrospectionError: "D110",
|
|
46
|
+
};
|
|
47
|
+
export const ERROR_NAMES = Object.keys(ERROR_CODES).reduce((obj, item) => ({ ...obj, [item]: item }), {});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { DaggerSDKError } from "./DaggerSDKError.js";
|
|
2
|
+
export { UnknownDaggerError } from "./UnknownDaggerError.js";
|
|
3
|
+
export { DockerImageRefValidationError } from "./DockerImageRefValidationError.js";
|
|
4
|
+
export { EngineSessionConnectParamsParseError } from "./EngineSessionConnectParamsParseError.js";
|
|
5
|
+
export { ExecError } from "./ExecError.js";
|
|
6
|
+
export { GraphQLRequestError } from "./GraphQLRequestError.js";
|
|
7
|
+
export { InitEngineSessionBinaryError } from "./InitEngineSessionBinaryError.js";
|
|
8
|
+
export { TooManyNestedObjectsError } from "./TooManyNestedObjectsError.js";
|
|
9
|
+
export { EngineSessionError } from "./EngineSessionErrorOptions.js";
|
|
10
|
+
export { EngineSessionConnectionTimeoutError } from "./EngineSessionConnectionTimeoutError.js";
|
|
11
|
+
export { NotAwaitedRequestError } from "./NotAwaitedRequestError.js";
|
|
12
|
+
export { FunctionNotFound } from "./FunctionNotFound.js";
|
|
13
|
+
export { IntrospectionError } from "./IntrospectionError.js";
|
|
14
|
+
export { ERROR_CODES } from "./errors-codes.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/common/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAA;AAClF,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAA;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAA;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { DaggerSDKError } from "./DaggerSDKError.js";
|
|
2
|
+
export { UnknownDaggerError } from "./UnknownDaggerError.js";
|
|
3
|
+
export { DockerImageRefValidationError } from "./DockerImageRefValidationError.js";
|
|
4
|
+
export { EngineSessionConnectParamsParseError } from "./EngineSessionConnectParamsParseError.js";
|
|
5
|
+
export { ExecError } from "./ExecError.js";
|
|
6
|
+
export { GraphQLRequestError } from "./GraphQLRequestError.js";
|
|
7
|
+
export { InitEngineSessionBinaryError } from "./InitEngineSessionBinaryError.js";
|
|
8
|
+
export { TooManyNestedObjectsError } from "./TooManyNestedObjectsError.js";
|
|
9
|
+
export { EngineSessionError } from "./EngineSessionErrorOptions.js";
|
|
10
|
+
export { EngineSessionConnectionTimeoutError } from "./EngineSessionConnectionTimeoutError.js";
|
|
11
|
+
export { NotAwaitedRequestError } from "./NotAwaitedRequestError.js";
|
|
12
|
+
export { FunctionNotFound } from "./FunctionNotFound.js";
|
|
13
|
+
export { IntrospectionError } from "./IntrospectionError.js";
|
|
14
|
+
export { ERROR_CODES } from "./errors-codes.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/common/graphql/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAuD/C,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,aAAa,CAsB1E"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as opentelemetry from "@opentelemetry/api";
|
|
2
|
+
import { GraphQLClient } from "graphql-request";
|
|
3
|
+
import nodeFetch from "node-fetch";
|
|
4
|
+
import { isDeno } from "../utils.js";
|
|
5
|
+
const createFetchWithTimeout = (timeout) => async (input, init) => {
|
|
6
|
+
if (init?.signal) {
|
|
7
|
+
throw new Error("Internal error: could not create fetch client with timeout");
|
|
8
|
+
}
|
|
9
|
+
const controller = new AbortController();
|
|
10
|
+
const timerId = setTimeout(() => {
|
|
11
|
+
controller.abort();
|
|
12
|
+
}, timeout);
|
|
13
|
+
try {
|
|
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, {
|
|
24
|
+
...init,
|
|
25
|
+
signal: controller.signal,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
clearTimeout(timerId);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Customer setter to inject trace parent into the request headers
|
|
34
|
+
* This is required because `graphql-request` 7.0.1 changes its header
|
|
35
|
+
* type to `Headers` which break the default open telemetry propagator.
|
|
36
|
+
*/
|
|
37
|
+
class CustomSetter {
|
|
38
|
+
set(carrier, key, value) {
|
|
39
|
+
carrier.set(key, value);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export function createGQLClient(port, token) {
|
|
43
|
+
const client = new GraphQLClient(`http://127.0.0.1:${port}/query`, {
|
|
44
|
+
// 1 week timeout so we should never hit that one.
|
|
45
|
+
// This is to bypass the current graphql-request timeout, which depends on
|
|
46
|
+
// node-fetch and is 5minutes by default.
|
|
47
|
+
fetch: createFetchWithTimeout(1000 * 60 * 60 * 24 * 7),
|
|
48
|
+
headers: {
|
|
49
|
+
Authorization: "Basic " + Buffer.from(token + ":").toString("base64"),
|
|
50
|
+
},
|
|
51
|
+
// Inject trace parent into the request headers so it can be correctly linked
|
|
52
|
+
requestMiddleware: async (req) => {
|
|
53
|
+
opentelemetry.propagation.inject(opentelemetry.context.active(), req.headers, new CustomSetter());
|
|
54
|
+
return req;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
return client;
|
|
58
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GraphQLClient } from "graphql-request";
|
|
2
|
+
export type QueryTree = {
|
|
3
|
+
operation: string;
|
|
4
|
+
args?: Record<string, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export type Metadata = {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
is_enum?: boolean;
|
|
9
|
+
value_to_name?: (value: any) => string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Convert the queryTree into a GraphQL query
|
|
14
|
+
* @param q
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildQuery(q: QueryTree[]): string;
|
|
18
|
+
/**
|
|
19
|
+
* Convert querytree into a Graphql query then compute it
|
|
20
|
+
* @param q | QueryTree[]
|
|
21
|
+
* @param client | GraphQLClient
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare function computeQuery<T>(q: QueryTree[], client: GraphQLClient): Promise<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Return a Graphql query result flattened
|
|
27
|
+
* @param response any
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
export declare function queryFlatten<T>(response: any): T;
|
|
31
|
+
/**
|
|
32
|
+
* Send a GraphQL document to the server
|
|
33
|
+
* return a flatten result
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export declare function compute<T>(query: string, client: GraphQLClient): Promise<T>;
|
|
37
|
+
//# sourceMappingURL=compute_query.d.ts.map
|
|
@@ -0,0 +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;QACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAA;KACvC,CAAA;CACF,CAAA;AAqHD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,MAAM,CAYjD;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,CAAC,EAAE,SAAS,EAAE,EACd,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,CAAC,CAAC,CAMZ;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,CAuBhD;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,CAAC,EAC7B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,CAAC,CAAC,CA6CZ"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { ClientError, gql } from "graphql-request";
|
|
3
|
+
import { GraphQLRequestError, TooManyNestedObjectsError, UnknownDaggerError, NotAwaitedRequestError, ExecError, } from "../errors/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Format argument into GraphQL query format.
|
|
6
|
+
*/
|
|
7
|
+
function buildArgs(args) {
|
|
8
|
+
const metadata = args.__metadata || {};
|
|
9
|
+
// Remove unwanted quotes
|
|
10
|
+
const formatValue = (key, value) => {
|
|
11
|
+
// Special treatment for enumeration, they must be inserted without quotes
|
|
12
|
+
if (metadata[key]?.is_enum) {
|
|
13
|
+
return JSON.stringify(metadata[key].value_to_name?.(value)).replace(/['"]+/g, "");
|
|
14
|
+
}
|
|
15
|
+
return JSON.stringify(value).replace(/\{"[a-zA-Z]+":|,"[a-zA-Z]+":/gi, (str) => {
|
|
16
|
+
return str.replace(/"/g, "");
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
if (args === undefined || args === null) {
|
|
20
|
+
return "";
|
|
21
|
+
}
|
|
22
|
+
const formattedArgs = Object.entries(args).reduce((acc, [key, value]) => {
|
|
23
|
+
// Ignore internal metadata key
|
|
24
|
+
if (key === "__metadata") {
|
|
25
|
+
return acc;
|
|
26
|
+
}
|
|
27
|
+
if (value !== undefined && value !== null) {
|
|
28
|
+
acc.push(`${key}: ${formatValue(key, value)}`);
|
|
29
|
+
}
|
|
30
|
+
return acc;
|
|
31
|
+
}, []);
|
|
32
|
+
if (formattedArgs.length === 0) {
|
|
33
|
+
return "";
|
|
34
|
+
}
|
|
35
|
+
return `(${formattedArgs})`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Find QueryTree, convert them into GraphQl query
|
|
39
|
+
* then compute and return the result to the appropriate field
|
|
40
|
+
*/
|
|
41
|
+
async function computeNestedQuery(query, client) {
|
|
42
|
+
// Check if there is a nested queryTree to be executed
|
|
43
|
+
const isQueryTree = (value) => value["_ctx"] !== undefined;
|
|
44
|
+
// Check if there is a nested array of queryTree to be executed
|
|
45
|
+
const isArrayQueryTree = (value) => value.every((v) => v instanceof Object && isQueryTree(v));
|
|
46
|
+
// Prepare query tree for final query by computing nested queries
|
|
47
|
+
// and building it with their results.
|
|
48
|
+
const computeQueryTree = async (value) => {
|
|
49
|
+
// Resolve sub queries if operation's args is a subquery
|
|
50
|
+
for (const op of value["_ctx"]["_queryTree"]) {
|
|
51
|
+
await computeNestedQuery([op], client);
|
|
52
|
+
}
|
|
53
|
+
// push an id that will be used by the container
|
|
54
|
+
return buildQuery([
|
|
55
|
+
...value["_ctx"]["_queryTree"],
|
|
56
|
+
{
|
|
57
|
+
operation: "id",
|
|
58
|
+
},
|
|
59
|
+
]);
|
|
60
|
+
};
|
|
61
|
+
// Remove all undefined args and assert args type
|
|
62
|
+
const queryToExec = query.filter((q) => !!q.args);
|
|
63
|
+
for (const q of queryToExec) {
|
|
64
|
+
await Promise.all(
|
|
65
|
+
// Compute nested query for single object
|
|
66
|
+
Object.entries(q.args).map(async ([key, value]) => {
|
|
67
|
+
if (value instanceof Object && isQueryTree(value)) {
|
|
68
|
+
// push an id that will be used by the container
|
|
69
|
+
const getQueryTree = await computeQueryTree(value);
|
|
70
|
+
q.args[key] = await compute(getQueryTree, client);
|
|
71
|
+
}
|
|
72
|
+
// Compute nested query for array of object
|
|
73
|
+
if (Array.isArray(value) && isArrayQueryTree(value)) {
|
|
74
|
+
const tmp = q.args[key];
|
|
75
|
+
for (let i = 0; i < value.length; i++) {
|
|
76
|
+
// push an id that will be used by the container
|
|
77
|
+
const getQueryTree = await computeQueryTree(value[i]);
|
|
78
|
+
tmp[i] = await compute(getQueryTree, client);
|
|
79
|
+
}
|
|
80
|
+
q.args[key] = tmp;
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Convert the queryTree into a GraphQL query
|
|
87
|
+
* @param q
|
|
88
|
+
* @returns
|
|
89
|
+
*/
|
|
90
|
+
export function buildQuery(q) {
|
|
91
|
+
const query = q.reduce((acc, { operation, args }, i) => {
|
|
92
|
+
const qLen = q.length;
|
|
93
|
+
acc += ` ${operation} ${args ? `${buildArgs(args)}` : ""} ${qLen - 1 !== i ? "{" : "}".repeat(qLen - 1)}`;
|
|
94
|
+
return acc;
|
|
95
|
+
}, "");
|
|
96
|
+
return `{${query} }`;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Convert querytree into a Graphql query then compute it
|
|
100
|
+
* @param q | QueryTree[]
|
|
101
|
+
* @param client | GraphQLClient
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
export async function computeQuery(q, client) {
|
|
105
|
+
await computeNestedQuery(q, client);
|
|
106
|
+
const query = buildQuery(q);
|
|
107
|
+
return await compute(query, client);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Return a Graphql query result flattened
|
|
111
|
+
* @param response any
|
|
112
|
+
* @returns
|
|
113
|
+
*/
|
|
114
|
+
export function queryFlatten(response) {
|
|
115
|
+
// Recursion break condition
|
|
116
|
+
// If our response is not an object or an array we assume we reached the value
|
|
117
|
+
if (!(response instanceof Object) || Array.isArray(response)) {
|
|
118
|
+
return response;
|
|
119
|
+
}
|
|
120
|
+
const keys = Object.keys(response);
|
|
121
|
+
if (keys.length != 1) {
|
|
122
|
+
// Dagger is currently expecting to only return one value
|
|
123
|
+
// If the response is nested in a way were more than one object is nested inside throw an error
|
|
124
|
+
throw new TooManyNestedObjectsError("Too many nested objects inside graphql response", {
|
|
125
|
+
response: response,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const nestedKey = keys[0];
|
|
129
|
+
return queryFlatten(response[nestedKey]);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Send a GraphQL document to the server
|
|
133
|
+
* return a flatten result
|
|
134
|
+
* @hidden
|
|
135
|
+
*/
|
|
136
|
+
export async function compute(query, client) {
|
|
137
|
+
let computeQuery;
|
|
138
|
+
try {
|
|
139
|
+
computeQuery = await client.request(gql `
|
|
140
|
+
${query}
|
|
141
|
+
`);
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
if (e instanceof ClientError) {
|
|
145
|
+
const msg = e.response.errors?.[0]?.message ?? `API Error`;
|
|
146
|
+
const ext = e.response.errors?.[0]?.extensions;
|
|
147
|
+
if (ext?._type === "EXEC_ERROR") {
|
|
148
|
+
throw new ExecError(msg, {
|
|
149
|
+
cmd: ext.cmd ?? [],
|
|
150
|
+
exitCode: ext.exitCode ?? -1,
|
|
151
|
+
stdout: ext.stdout ?? "",
|
|
152
|
+
stderr: ext.stderr ?? "",
|
|
153
|
+
extensions: ext,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
throw new GraphQLRequestError(msg, {
|
|
157
|
+
error: e,
|
|
158
|
+
cause: e,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
// Looking for connection error in case the function has not been awaited.
|
|
162
|
+
if (e.errno === "ECONNREFUSED") {
|
|
163
|
+
throw new NotAwaitedRequestError("Encountered an error while requesting data via graphql through a synchronous call. Make sure the function called is awaited.", { cause: e });
|
|
164
|
+
}
|
|
165
|
+
// Just throw the unknown error
|
|
166
|
+
throw new UnknownDaggerError("Encountered an unknown error while requesting data via graphql", {
|
|
167
|
+
cause: e,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return queryFlatten(computeQuery);
|
|
171
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GraphQLClient } from "graphql-request";
|
|
2
|
+
import { ConnectOpts } from "../../connectOpts.js";
|
|
3
|
+
/**
|
|
4
|
+
* Execute the callback with a GraphQL client connected to the Dagger engine.
|
|
5
|
+
* It automatically provisions the engine if needed.
|
|
6
|
+
*/
|
|
7
|
+
export declare function withGQLClient<T>(connectOpts: ConnectOpts, cb: (gqlClient: GraphQLClient) => Promise<T>): Promise<T>;
|
|
8
|
+
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../src/common/graphql/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGlD;;;GAGG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACnC,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,GAC3C,OAAO,CAAC,CAAC,CAAC,CAuBZ"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createGQLClient } from "./client.js";
|
|
2
|
+
/**
|
|
3
|
+
* Execute the callback with a GraphQL client connected to the Dagger engine.
|
|
4
|
+
* It automatically provisions the engine if needed.
|
|
5
|
+
*/
|
|
6
|
+
export async function withGQLClient(connectOpts, cb) {
|
|
7
|
+
if (process.env["DAGGER_SESSION_PORT"]) {
|
|
8
|
+
const port = process.env["DAGGER_SESSION_PORT"];
|
|
9
|
+
if (!process.env["DAGGER_SESSION_TOKEN"]) {
|
|
10
|
+
throw new Error("DAGGER_SESSION_TOKEN must be set if DAGGER_SESSION_PORT is set");
|
|
11
|
+
}
|
|
12
|
+
const token = process.env["DAGGER_SESSION_TOKEN"];
|
|
13
|
+
return await cb(createGQLClient(Number(port), token));
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const provisioning = await import("../../provisioning/index.js");
|
|
17
|
+
return await provisioning.withEngineSession(connectOpts, cb);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
throw new Error(`failed to execute function with automatic provisioning: ${e}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GraphQLClient } from "graphql-request";
|
|
2
|
+
/**
|
|
3
|
+
* Wraps the GraphQL client to allow lazy initialization and setting
|
|
4
|
+
* the GQL client of the global Dagger client instance (`dag`).
|
|
5
|
+
*/
|
|
6
|
+
export declare class Connection {
|
|
7
|
+
private _gqlClient?;
|
|
8
|
+
constructor(_gqlClient?: GraphQLClient | undefined);
|
|
9
|
+
resetClient(): void;
|
|
10
|
+
setGQLClient(gqlClient: GraphQLClient): void;
|
|
11
|
+
getGQLClient(): GraphQLClient;
|
|
12
|
+
}
|
|
13
|
+
export declare const globalConnection: Connection;
|
|
14
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../../src/common/graphql/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;;GAGG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,UAAU,CAAC;gBAAX,UAAU,CAAC,EAAE,aAAa,YAAA;IAE9C,WAAW;IAIX,YAAY,CAAC,SAAS,EAAE,aAAa;IAIrC,YAAY,IAAI,aAAa;CAO9B;AAED,eAAO,MAAM,gBAAgB,YAAmB,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps the GraphQL client to allow lazy initialization and setting
|
|
3
|
+
* the GQL client of the global Dagger client instance (`dag`).
|
|
4
|
+
*/
|
|
5
|
+
export class Connection {
|
|
6
|
+
_gqlClient;
|
|
7
|
+
constructor(_gqlClient) {
|
|
8
|
+
this._gqlClient = _gqlClient;
|
|
9
|
+
}
|
|
10
|
+
resetClient() {
|
|
11
|
+
this._gqlClient = undefined;
|
|
12
|
+
}
|
|
13
|
+
setGQLClient(gqlClient) {
|
|
14
|
+
this._gqlClient = gqlClient;
|
|
15
|
+
}
|
|
16
|
+
getGQLClient() {
|
|
17
|
+
if (!this._gqlClient) {
|
|
18
|
+
throw new Error("GraphQL client is not set");
|
|
19
|
+
}
|
|
20
|
+
return this._gqlClient;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export const globalConnection = new Connection();
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const log: (stack?: string) => {
|
|
2
|
+
command: string;
|
|
3
|
+
lastCommand: string;
|
|
4
|
+
level: any;
|
|
5
|
+
noColor: boolean;
|
|
6
|
+
setLevel(level: "error" | "debug" | "info" | "warn" | "disable" | "success"): void;
|
|
7
|
+
createNamedLogger(name: string): /*elided*/ any;
|
|
8
|
+
setLogStream(stream: import("node:stream")): /*elided*/ any;
|
|
9
|
+
setLevelNoColor(): void;
|
|
10
|
+
setLevelColor(): void;
|
|
11
|
+
enableFileAndLine(enable: boolean, isShortFile?: boolean): void;
|
|
12
|
+
isLevelValid(level: "error" | "debug" | "info" | "warn" | "disable" | "success"): boolean;
|
|
13
|
+
isAllowedLevel(level: "error" | "debug" | "info" | "warn" | "disable" | "success"): boolean;
|
|
14
|
+
checkSetting(setting: {
|
|
15
|
+
reverse?: boolean | undefined;
|
|
16
|
+
bold?: boolean | undefined;
|
|
17
|
+
italic?: boolean | undefined;
|
|
18
|
+
dim?: boolean | undefined;
|
|
19
|
+
underscore?: boolean | undefined;
|
|
20
|
+
strikethrough?: boolean | undefined;
|
|
21
|
+
}): string;
|
|
22
|
+
joint(): /*elided*/ any;
|
|
23
|
+
append(...args: any[]): /*elided*/ any;
|
|
24
|
+
reset(): /*elided*/ any;
|
|
25
|
+
setDate(callback: Function): void;
|
|
26
|
+
getDate(): string;
|
|
27
|
+
color(ticket: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white"): /*elided*/ any;
|
|
28
|
+
bgColor(ticket: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white"): /*elided*/ any;
|
|
29
|
+
bold(): /*elided*/ any;
|
|
30
|
+
dim(): /*elided*/ any;
|
|
31
|
+
underscore(): /*elided*/ any;
|
|
32
|
+
strikethrough(): /*elided*/ any;
|
|
33
|
+
reverse(): /*elided*/ any;
|
|
34
|
+
italic(): /*elided*/ any;
|
|
35
|
+
fontColorLog(ticket: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white", text: string, setting?: {
|
|
36
|
+
reverse?: boolean | undefined;
|
|
37
|
+
bold?: boolean | undefined;
|
|
38
|
+
italic?: boolean | undefined;
|
|
39
|
+
dim?: boolean | undefined;
|
|
40
|
+
underscore?: boolean | undefined;
|
|
41
|
+
strikethrough?: boolean | undefined;
|
|
42
|
+
}): void;
|
|
43
|
+
bgColorLog(ticket: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white", text: string, setting?: {
|
|
44
|
+
reverse?: boolean | undefined;
|
|
45
|
+
bold?: boolean | undefined;
|
|
46
|
+
italic?: boolean | undefined;
|
|
47
|
+
dim?: boolean | undefined;
|
|
48
|
+
underscore?: boolean | undefined;
|
|
49
|
+
strikethrough?: boolean | undefined;
|
|
50
|
+
}): void;
|
|
51
|
+
colorLog(ticketObj: {
|
|
52
|
+
font?: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white";
|
|
53
|
+
bg?: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white";
|
|
54
|
+
}, text: string, setting?: {
|
|
55
|
+
reverse?: boolean | undefined;
|
|
56
|
+
bold?: boolean | undefined;
|
|
57
|
+
italic?: boolean | undefined;
|
|
58
|
+
dim?: boolean | undefined;
|
|
59
|
+
underscore?: boolean | undefined;
|
|
60
|
+
strikethrough?: boolean | undefined;
|
|
61
|
+
}): void;
|
|
62
|
+
log(...args: any[]): /*elided*/ any;
|
|
63
|
+
error(...args: any[]): void;
|
|
64
|
+
warn(...args: any[]): void;
|
|
65
|
+
info(...args: any[]): void;
|
|
66
|
+
debug(...args: any[]): void;
|
|
67
|
+
success(...args: any[]): void;
|
|
68
|
+
};
|
|
69
|
+
export declare function isDeno(): boolean;
|
|
70
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +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;AAEjD,wBAAgB,MAAM,IAAI,OAAO,CAGhC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Client } from "./api/client.gen.js";
|
|
2
|
+
import { ConnectOpts } from "./connectOpts.js";
|
|
3
|
+
export type CallbackFct = (client: Client) => Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* connection executes the given function using the default global Dagger client.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* await connection(
|
|
10
|
+
* async () => {
|
|
11
|
+
* await dag
|
|
12
|
+
* .container()
|
|
13
|
+
* .from("alpine")
|
|
14
|
+
* .withExec(["apk", "add", "curl"])
|
|
15
|
+
* .withExec(["curl", "https://dagger.io/"])
|
|
16
|
+
* .sync()
|
|
17
|
+
* }, { LogOutput: process.stderr }
|
|
18
|
+
* )
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function connection(fct: () => Promise<void>, cfg?: ConnectOpts): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* connect runs GraphQL server and initializes a
|
|
24
|
+
* GraphQL client to execute query on it through its callback.
|
|
25
|
+
* This implementation is based on the existing Go SDK.
|
|
26
|
+
*/
|
|
27
|
+
export declare function connect(cb: CallbackFct, config?: ConnectOpts): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAI5C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAG9C,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;AAE3D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACxB,GAAG,GAAE,WAAgB,iBAqBtB;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAC3B,EAAE,EAAE,WAAW,EACf,MAAM,GAAE,WAAgB,GACvB,OAAO,CAAC,IAAI,CAAC,CAef"}
|