@dagger.io/dagger 0.18.9 → 0.18.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/client.gen.d.ts +185 -28
- package/dist/src/api/client.gen.d.ts.map +1 -1
- package/dist/src/api/client.gen.js +206 -34
- package/dist/src/common/errors/ExecError.d.ts +6 -0
- package/dist/src/common/errors/ExecError.d.ts.map +1 -1
- package/dist/src/common/errors/ExecError.js +5 -0
- package/dist/src/common/errors/GraphQLRequestError.d.ts +5 -0
- package/dist/src/common/errors/GraphQLRequestError.d.ts.map +1 -1
- package/dist/src/common/errors/GraphQLRequestError.js +5 -0
- package/dist/src/common/graphql/compute_query.d.ts.map +1 -1
- package/dist/src/common/graphql/compute_query.js +1 -0
- package/dist/src/module/entrypoint/entrypoint.d.ts.map +1 -1
- package/dist/src/module/entrypoint/entrypoint.js +32 -9
- package/dist/src/provisioning/default.d.ts +1 -1
- package/dist/src/provisioning/default.d.ts.map +1 -1
- package/dist/src/provisioning/default.js +1 -1
- package/package.json +19 -19
|
@@ -45,7 +45,9 @@ export var ImageLayerCompression;
|
|
|
45
45
|
*/
|
|
46
46
|
export var ImageMediaTypes;
|
|
47
47
|
(function (ImageMediaTypes) {
|
|
48
|
+
ImageMediaTypes["Docker"] = "DOCKER";
|
|
48
49
|
ImageMediaTypes["Dockermediatypes"] = "DockerMediaTypes";
|
|
50
|
+
ImageMediaTypes["Oci"] = "OCI";
|
|
49
51
|
ImageMediaTypes["Ocimediatypes"] = "OCIMediaTypes";
|
|
50
52
|
})(ImageMediaTypes || (ImageMediaTypes = {}));
|
|
51
53
|
/**
|
|
@@ -53,8 +55,11 @@ export var ImageMediaTypes;
|
|
|
53
55
|
*/
|
|
54
56
|
export var ModuleSourceKind;
|
|
55
57
|
(function (ModuleSourceKind) {
|
|
58
|
+
ModuleSourceKind["Dir"] = "DIR";
|
|
56
59
|
ModuleSourceKind["DirSource"] = "DIR_SOURCE";
|
|
60
|
+
ModuleSourceKind["Git"] = "GIT";
|
|
57
61
|
ModuleSourceKind["GitSource"] = "GIT_SOURCE";
|
|
62
|
+
ModuleSourceKind["Local"] = "LOCAL";
|
|
58
63
|
ModuleSourceKind["LocalSource"] = "LOCAL_SOURCE";
|
|
59
64
|
})(ModuleSourceKind || (ModuleSourceKind = {}));
|
|
60
65
|
/**
|
|
@@ -88,54 +93,108 @@ export var ReturnType;
|
|
|
88
93
|
*/
|
|
89
94
|
export var TypeDefKind;
|
|
90
95
|
(function (TypeDefKind) {
|
|
96
|
+
/**
|
|
97
|
+
* A boolean value.
|
|
98
|
+
*/
|
|
99
|
+
TypeDefKind["Boolean"] = "BOOLEAN";
|
|
91
100
|
/**
|
|
92
101
|
* A boolean value.
|
|
93
102
|
*/
|
|
94
103
|
TypeDefKind["BooleanKind"] = "BOOLEAN_KIND";
|
|
104
|
+
/**
|
|
105
|
+
* A GraphQL enum type and its values
|
|
106
|
+
*
|
|
107
|
+
* Always paired with an EnumTypeDef.
|
|
108
|
+
*/
|
|
109
|
+
TypeDefKind["Enum"] = "ENUM";
|
|
95
110
|
/**
|
|
96
111
|
* A GraphQL enum type and its values
|
|
97
112
|
*
|
|
98
113
|
* Always paired with an EnumTypeDef.
|
|
99
114
|
*/
|
|
100
115
|
TypeDefKind["EnumKind"] = "ENUM_KIND";
|
|
116
|
+
/**
|
|
117
|
+
* A float value.
|
|
118
|
+
*/
|
|
119
|
+
TypeDefKind["Float"] = "FLOAT";
|
|
101
120
|
/**
|
|
102
121
|
* A float value.
|
|
103
122
|
*/
|
|
104
123
|
TypeDefKind["FloatKind"] = "FLOAT_KIND";
|
|
124
|
+
/**
|
|
125
|
+
* A graphql input type, used only when representing the core API via TypeDefs.
|
|
126
|
+
*/
|
|
127
|
+
TypeDefKind["Input"] = "INPUT";
|
|
105
128
|
/**
|
|
106
129
|
* A graphql input type, used only when representing the core API via TypeDefs.
|
|
107
130
|
*/
|
|
108
131
|
TypeDefKind["InputKind"] = "INPUT_KIND";
|
|
132
|
+
/**
|
|
133
|
+
* An integer value.
|
|
134
|
+
*/
|
|
135
|
+
TypeDefKind["Integer"] = "INTEGER";
|
|
109
136
|
/**
|
|
110
137
|
* An integer value.
|
|
111
138
|
*/
|
|
112
139
|
TypeDefKind["IntegerKind"] = "INTEGER_KIND";
|
|
113
140
|
/**
|
|
114
|
-
*
|
|
141
|
+
* Always paired with an InterfaceTypeDef.
|
|
115
142
|
*
|
|
143
|
+
* A named type of functions that can be matched+implemented by other objects+interfaces.
|
|
144
|
+
*/
|
|
145
|
+
TypeDefKind["Interface"] = "INTERFACE";
|
|
146
|
+
/**
|
|
116
147
|
* Always paired with an InterfaceTypeDef.
|
|
148
|
+
*
|
|
149
|
+
* A named type of functions that can be matched+implemented by other objects+interfaces.
|
|
117
150
|
*/
|
|
118
151
|
TypeDefKind["InterfaceKind"] = "INTERFACE_KIND";
|
|
119
152
|
/**
|
|
120
|
-
*
|
|
153
|
+
* Always paired with a ListTypeDef.
|
|
121
154
|
*
|
|
155
|
+
* A list of values all having the same type.
|
|
156
|
+
*/
|
|
157
|
+
TypeDefKind["List"] = "LIST";
|
|
158
|
+
/**
|
|
122
159
|
* Always paired with a ListTypeDef.
|
|
160
|
+
*
|
|
161
|
+
* A list of values all having the same type.
|
|
123
162
|
*/
|
|
124
163
|
TypeDefKind["ListKind"] = "LIST_KIND";
|
|
125
164
|
/**
|
|
126
|
-
*
|
|
165
|
+
* Always paired with an ObjectTypeDef.
|
|
127
166
|
*
|
|
167
|
+
* A named type defined in the GraphQL schema, with fields and functions.
|
|
168
|
+
*/
|
|
169
|
+
TypeDefKind["Object"] = "OBJECT";
|
|
170
|
+
/**
|
|
128
171
|
* Always paired with an ObjectTypeDef.
|
|
172
|
+
*
|
|
173
|
+
* A named type defined in the GraphQL schema, with fields and functions.
|
|
129
174
|
*/
|
|
130
175
|
TypeDefKind["ObjectKind"] = "OBJECT_KIND";
|
|
176
|
+
/**
|
|
177
|
+
* A scalar value of any basic kind.
|
|
178
|
+
*/
|
|
179
|
+
TypeDefKind["Scalar"] = "SCALAR";
|
|
131
180
|
/**
|
|
132
181
|
* A scalar value of any basic kind.
|
|
133
182
|
*/
|
|
134
183
|
TypeDefKind["ScalarKind"] = "SCALAR_KIND";
|
|
184
|
+
/**
|
|
185
|
+
* A string value.
|
|
186
|
+
*/
|
|
187
|
+
TypeDefKind["String"] = "STRING";
|
|
135
188
|
/**
|
|
136
189
|
* A string value.
|
|
137
190
|
*/
|
|
138
191
|
TypeDefKind["StringKind"] = "STRING_KIND";
|
|
192
|
+
/**
|
|
193
|
+
* A special kind used to signify that no value is returned.
|
|
194
|
+
*
|
|
195
|
+
* This is used for functions that have no return value. The outer TypeDef specifying this Kind is always Optional, as the Void is never actually represented.
|
|
196
|
+
*/
|
|
197
|
+
TypeDefKind["Void"] = "VOID";
|
|
139
198
|
/**
|
|
140
199
|
* A special kind used to signify that no value is returned.
|
|
141
200
|
*
|
|
@@ -180,6 +239,13 @@ export class Binding extends BaseClient {
|
|
|
180
239
|
const ctx = this._ctx.select("asCacheVolume");
|
|
181
240
|
return new CacheVolume(ctx);
|
|
182
241
|
};
|
|
242
|
+
/**
|
|
243
|
+
* Retrieve the binding value, as type Cloud
|
|
244
|
+
*/
|
|
245
|
+
asCloud = () => {
|
|
246
|
+
const ctx = this._ctx.select("asCloud");
|
|
247
|
+
return new Cloud(ctx);
|
|
248
|
+
};
|
|
183
249
|
/**
|
|
184
250
|
* Retrieve the binding value, as type Container
|
|
185
251
|
*/
|
|
@@ -351,6 +417,43 @@ export class CacheVolume extends BaseClient {
|
|
|
351
417
|
return response;
|
|
352
418
|
};
|
|
353
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Dagger Cloud configuration and state
|
|
422
|
+
*/
|
|
423
|
+
export class Cloud extends BaseClient {
|
|
424
|
+
_id = undefined;
|
|
425
|
+
_traceURL = undefined;
|
|
426
|
+
/**
|
|
427
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
428
|
+
*/
|
|
429
|
+
constructor(ctx, _id, _traceURL) {
|
|
430
|
+
super(ctx);
|
|
431
|
+
this._id = _id;
|
|
432
|
+
this._traceURL = _traceURL;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* A unique identifier for this Cloud.
|
|
436
|
+
*/
|
|
437
|
+
id = async () => {
|
|
438
|
+
if (this._id) {
|
|
439
|
+
return this._id;
|
|
440
|
+
}
|
|
441
|
+
const ctx = this._ctx.select("id");
|
|
442
|
+
const response = await ctx.execute();
|
|
443
|
+
return response;
|
|
444
|
+
};
|
|
445
|
+
/**
|
|
446
|
+
* The trace URL for the current session
|
|
447
|
+
*/
|
|
448
|
+
traceURL = async () => {
|
|
449
|
+
if (this._traceURL) {
|
|
450
|
+
return this._traceURL;
|
|
451
|
+
}
|
|
452
|
+
const ctx = this._ctx.select("traceURL");
|
|
453
|
+
const response = await ctx.execute();
|
|
454
|
+
return response;
|
|
455
|
+
};
|
|
456
|
+
}
|
|
354
457
|
/**
|
|
355
458
|
* An OCI-compatible container, also known as a Docker container.
|
|
356
459
|
*/
|
|
@@ -1083,7 +1186,7 @@ export class Container extends BaseClient {
|
|
|
1083
1186
|
return new Container(ctx);
|
|
1084
1187
|
};
|
|
1085
1188
|
/**
|
|
1086
|
-
* Establish a runtime dependency
|
|
1189
|
+
* Establish a runtime dependency from a container to a network service.
|
|
1087
1190
|
*
|
|
1088
1191
|
* The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
|
|
1089
1192
|
*
|
|
@@ -1097,6 +1200,16 @@ export class Container extends BaseClient {
|
|
|
1097
1200
|
const ctx = this._ctx.select("withServiceBinding", { alias, service });
|
|
1098
1201
|
return new Container(ctx);
|
|
1099
1202
|
};
|
|
1203
|
+
/**
|
|
1204
|
+
* Return a snapshot with a symlink
|
|
1205
|
+
* @param target Location of the file or directory to link to (e.g., "/existing/file").
|
|
1206
|
+
* @param linkName Location where the symbolic link will be created (e.g., "/new-file-link").
|
|
1207
|
+
* @param opts.expand Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
|
|
1208
|
+
*/
|
|
1209
|
+
withSymlink = (target, linkName, opts) => {
|
|
1210
|
+
const ctx = this._ctx.select("withSymlink", { target, linkName, ...opts });
|
|
1211
|
+
return new Container(ctx);
|
|
1212
|
+
};
|
|
1100
1213
|
/**
|
|
1101
1214
|
* Retrieves this container plus a socket forwarded to the given Unix socket path.
|
|
1102
1215
|
* @param path Location of the forwarded Unix socket (e.g., "/tmp/socket").
|
|
@@ -1577,6 +1690,15 @@ export class Directory extends BaseClient {
|
|
|
1577
1690
|
const ctx = this._ctx.select("withNewFile", { path, contents, ...opts });
|
|
1578
1691
|
return new Directory(ctx);
|
|
1579
1692
|
};
|
|
1693
|
+
/**
|
|
1694
|
+
* Return a snapshot with a symlink
|
|
1695
|
+
* @param target Location of the file or directory to link to (e.g., "/existing/file").
|
|
1696
|
+
* @param linkName Location where the symbolic link will be created (e.g., "/new-file-link").
|
|
1697
|
+
*/
|
|
1698
|
+
withSymlink = (target, linkName) => {
|
|
1699
|
+
const ctx = this._ctx.select("withSymlink", { target, linkName });
|
|
1700
|
+
return new Directory(ctx);
|
|
1701
|
+
};
|
|
1580
1702
|
/**
|
|
1581
1703
|
* Retrieves this directory with all file/dir timestamps set to the given time.
|
|
1582
1704
|
* @param timestamp Timestamp to set dir/files in.
|
|
@@ -1729,12 +1851,13 @@ export class EngineCache extends BaseClient {
|
|
|
1729
1851
|
};
|
|
1730
1852
|
/**
|
|
1731
1853
|
* Prune the cache of releaseable entries
|
|
1854
|
+
* @param opts.useDefaultPolicy Use the engine-wide default pruning policy if true, otherwise prune the whole cache of any releasable entries.
|
|
1732
1855
|
*/
|
|
1733
|
-
prune = async () => {
|
|
1856
|
+
prune = async (opts) => {
|
|
1734
1857
|
if (this._prune) {
|
|
1735
1858
|
return;
|
|
1736
1859
|
}
|
|
1737
|
-
const ctx = this._ctx.select("prune");
|
|
1860
|
+
const ctx = this._ctx.select("prune", { ...opts });
|
|
1738
1861
|
await ctx.execute();
|
|
1739
1862
|
};
|
|
1740
1863
|
/**
|
|
@@ -1947,6 +2070,14 @@ export class EnumTypeDef extends BaseClient {
|
|
|
1947
2070
|
const response = await ctx.execute();
|
|
1948
2071
|
return response;
|
|
1949
2072
|
};
|
|
2073
|
+
/**
|
|
2074
|
+
* The members of the enum.
|
|
2075
|
+
*/
|
|
2076
|
+
members = async () => {
|
|
2077
|
+
const ctx = this._ctx.select("members").select("id");
|
|
2078
|
+
const response = await ctx.execute();
|
|
2079
|
+
return response.map((r) => new Client(ctx.copy()).loadEnumValueTypeDefFromID(r.id));
|
|
2080
|
+
};
|
|
1950
2081
|
/**
|
|
1951
2082
|
* The name of the enum.
|
|
1952
2083
|
*/
|
|
@@ -1977,7 +2108,7 @@ export class EnumTypeDef extends BaseClient {
|
|
|
1977
2108
|
return response;
|
|
1978
2109
|
};
|
|
1979
2110
|
/**
|
|
1980
|
-
*
|
|
2111
|
+
* @deprecated use members instead
|
|
1981
2112
|
*/
|
|
1982
2113
|
values = async () => {
|
|
1983
2114
|
const ctx = this._ctx.select("values").select("id");
|
|
@@ -1992,14 +2123,16 @@ export class EnumValueTypeDef extends BaseClient {
|
|
|
1992
2123
|
_id = undefined;
|
|
1993
2124
|
_description = undefined;
|
|
1994
2125
|
_name = undefined;
|
|
2126
|
+
_value = undefined;
|
|
1995
2127
|
/**
|
|
1996
2128
|
* Constructor is used for internal usage only, do not create object from it.
|
|
1997
2129
|
*/
|
|
1998
|
-
constructor(ctx, _id, _description, _name) {
|
|
2130
|
+
constructor(ctx, _id, _description, _name, _value) {
|
|
1999
2131
|
super(ctx);
|
|
2000
2132
|
this._id = _id;
|
|
2001
2133
|
this._description = _description;
|
|
2002
2134
|
this._name = _name;
|
|
2135
|
+
this._value = _value;
|
|
2003
2136
|
}
|
|
2004
2137
|
/**
|
|
2005
2138
|
* A unique identifier for this EnumValueTypeDef.
|
|
@@ -2013,7 +2146,7 @@ export class EnumValueTypeDef extends BaseClient {
|
|
|
2013
2146
|
return response;
|
|
2014
2147
|
};
|
|
2015
2148
|
/**
|
|
2016
|
-
* A doc string for the enum
|
|
2149
|
+
* A doc string for the enum member, if any.
|
|
2017
2150
|
*/
|
|
2018
2151
|
description = async () => {
|
|
2019
2152
|
if (this._description) {
|
|
@@ -2024,7 +2157,7 @@ export class EnumValueTypeDef extends BaseClient {
|
|
|
2024
2157
|
return response;
|
|
2025
2158
|
};
|
|
2026
2159
|
/**
|
|
2027
|
-
* The name of the enum
|
|
2160
|
+
* The name of the enum member.
|
|
2028
2161
|
*/
|
|
2029
2162
|
name = async () => {
|
|
2030
2163
|
if (this._name) {
|
|
@@ -2035,12 +2168,23 @@ export class EnumValueTypeDef extends BaseClient {
|
|
|
2035
2168
|
return response;
|
|
2036
2169
|
};
|
|
2037
2170
|
/**
|
|
2038
|
-
* The location of this enum
|
|
2171
|
+
* The location of this enum member declaration.
|
|
2039
2172
|
*/
|
|
2040
2173
|
sourceMap = () => {
|
|
2041
2174
|
const ctx = this._ctx.select("sourceMap");
|
|
2042
2175
|
return new SourceMap(ctx);
|
|
2043
2176
|
};
|
|
2177
|
+
/**
|
|
2178
|
+
* The value of the enum member
|
|
2179
|
+
*/
|
|
2180
|
+
value = async () => {
|
|
2181
|
+
if (this._value) {
|
|
2182
|
+
return this._value;
|
|
2183
|
+
}
|
|
2184
|
+
const ctx = this._ctx.select("value");
|
|
2185
|
+
const response = await ctx.execute();
|
|
2186
|
+
return response;
|
|
2187
|
+
};
|
|
2044
2188
|
}
|
|
2045
2189
|
export class Env extends BaseClient {
|
|
2046
2190
|
_id = undefined;
|
|
@@ -2115,6 +2259,25 @@ export class Env extends BaseClient {
|
|
|
2115
2259
|
const ctx = this._ctx.select("withCacheVolumeOutput", { name, description });
|
|
2116
2260
|
return new Env(ctx);
|
|
2117
2261
|
};
|
|
2262
|
+
/**
|
|
2263
|
+
* Create or update a binding of type Cloud in the environment
|
|
2264
|
+
* @param name The name of the binding
|
|
2265
|
+
* @param value The Cloud value to assign to the binding
|
|
2266
|
+
* @param description The purpose of the input
|
|
2267
|
+
*/
|
|
2268
|
+
withCloudInput = (name, value, description) => {
|
|
2269
|
+
const ctx = this._ctx.select("withCloudInput", { name, value, description });
|
|
2270
|
+
return new Env(ctx);
|
|
2271
|
+
};
|
|
2272
|
+
/**
|
|
2273
|
+
* Declare a desired Cloud output to be assigned in the environment
|
|
2274
|
+
* @param name The name of the binding
|
|
2275
|
+
* @param description A description of the desired value of the binding
|
|
2276
|
+
*/
|
|
2277
|
+
withCloudOutput = (name, description) => {
|
|
2278
|
+
const ctx = this._ctx.select("withCloudOutput", { name, description });
|
|
2279
|
+
return new Env(ctx);
|
|
2280
|
+
};
|
|
2118
2281
|
/**
|
|
2119
2282
|
* Create or update a binding of type Container in the environment
|
|
2120
2283
|
* @param name The name of the binding
|
|
@@ -4134,16 +4297,14 @@ export class Module_ extends BaseClient {
|
|
|
4134
4297
|
*/
|
|
4135
4298
|
export class ModuleConfigClient extends BaseClient {
|
|
4136
4299
|
_id = undefined;
|
|
4137
|
-
_dev = undefined;
|
|
4138
4300
|
_directory = undefined;
|
|
4139
4301
|
_generator = undefined;
|
|
4140
4302
|
/**
|
|
4141
4303
|
* Constructor is used for internal usage only, do not create object from it.
|
|
4142
4304
|
*/
|
|
4143
|
-
constructor(ctx, _id,
|
|
4305
|
+
constructor(ctx, _id, _directory, _generator) {
|
|
4144
4306
|
super(ctx);
|
|
4145
4307
|
this._id = _id;
|
|
4146
|
-
this._dev = _dev;
|
|
4147
4308
|
this._directory = _directory;
|
|
4148
4309
|
this._generator = _generator;
|
|
4149
4310
|
}
|
|
@@ -4158,17 +4319,6 @@ export class ModuleConfigClient extends BaseClient {
|
|
|
4158
4319
|
const response = await ctx.execute();
|
|
4159
4320
|
return response;
|
|
4160
4321
|
};
|
|
4161
|
-
/**
|
|
4162
|
-
* If true, generate the client in developer mode.
|
|
4163
|
-
*/
|
|
4164
|
-
dev = async () => {
|
|
4165
|
-
if (this._dev) {
|
|
4166
|
-
return this._dev;
|
|
4167
|
-
}
|
|
4168
|
-
const ctx = this._ctx.select("dev");
|
|
4169
|
-
const response = await ctx.execute();
|
|
4170
|
-
return response;
|
|
4171
|
-
};
|
|
4172
4322
|
/**
|
|
4173
4323
|
* The directory the client is generated in.
|
|
4174
4324
|
*/
|
|
@@ -4515,14 +4665,9 @@ export class ModuleSource extends BaseClient {
|
|
|
4515
4665
|
* Update the module source with a new client to generate.
|
|
4516
4666
|
* @param generator The generator to use
|
|
4517
4667
|
* @param outputDir The output directory for the generated client.
|
|
4518
|
-
* @param opts.dev Generate in developer mode
|
|
4519
4668
|
*/
|
|
4520
|
-
withClient = (generator, outputDir
|
|
4521
|
-
const ctx = this._ctx.select("withClient", {
|
|
4522
|
-
generator,
|
|
4523
|
-
outputDir,
|
|
4524
|
-
...opts,
|
|
4525
|
-
});
|
|
4669
|
+
withClient = (generator, outputDir) => {
|
|
4670
|
+
const ctx = this._ctx.select("withClient", { generator, outputDir });
|
|
4526
4671
|
return new ModuleSource(ctx);
|
|
4527
4672
|
};
|
|
4528
4673
|
/**
|
|
@@ -4799,10 +4944,17 @@ export class Client extends BaseClient {
|
|
|
4799
4944
|
* Constructs a cache volume for a given cache key.
|
|
4800
4945
|
* @param key A string identifier to target this cache volume (e.g., "modules-cache").
|
|
4801
4946
|
*/
|
|
4802
|
-
cacheVolume = (key
|
|
4803
|
-
const ctx = this._ctx.select("cacheVolume", { key
|
|
4947
|
+
cacheVolume = (key) => {
|
|
4948
|
+
const ctx = this._ctx.select("cacheVolume", { key });
|
|
4804
4949
|
return new CacheVolume(ctx);
|
|
4805
4950
|
};
|
|
4951
|
+
/**
|
|
4952
|
+
* Dagger Cloud configuration and state
|
|
4953
|
+
*/
|
|
4954
|
+
cloud = () => {
|
|
4955
|
+
const ctx = this._ctx.select("cloud");
|
|
4956
|
+
return new Cloud(ctx);
|
|
4957
|
+
};
|
|
4806
4958
|
/**
|
|
4807
4959
|
* Creates a scratch container, with no image or metadata.
|
|
4808
4960
|
*
|
|
@@ -4913,6 +5065,7 @@ export class Client extends BaseClient {
|
|
|
4913
5065
|
* @param opts.keepGitDir DEPRECATED: Set to true to keep .git directory.
|
|
4914
5066
|
* @param opts.sshKnownHosts Set SSH known hosts
|
|
4915
5067
|
* @param opts.sshAuthSocket Set SSH auth socket
|
|
5068
|
+
* @param opts.httpAuthUsername Username used to populate the password during basic HTTP Authorization
|
|
4916
5069
|
* @param opts.httpAuthToken Secret used to populate the password during basic HTTP Authorization
|
|
4917
5070
|
* @param opts.httpAuthHeader Secret used to populate the Authorization HTTP header
|
|
4918
5071
|
* @param opts.experimentalServiceHost A service which must be started before the repo is fetched.
|
|
@@ -4964,6 +5117,13 @@ export class Client extends BaseClient {
|
|
|
4964
5117
|
const ctx = this._ctx.select("loadCacheVolumeFromID", { id });
|
|
4965
5118
|
return new CacheVolume(ctx);
|
|
4966
5119
|
};
|
|
5120
|
+
/**
|
|
5121
|
+
* Load a Cloud from its ID.
|
|
5122
|
+
*/
|
|
5123
|
+
loadCloudFromID = (id) => {
|
|
5124
|
+
const ctx = this._ctx.select("loadCloudFromID", { id });
|
|
5125
|
+
return new Cloud(ctx);
|
|
5126
|
+
};
|
|
4967
5127
|
/**
|
|
4968
5128
|
* Load a Container from its ID.
|
|
4969
5129
|
*/
|
|
@@ -5864,11 +6024,23 @@ export class TypeDef extends BaseClient {
|
|
|
5864
6024
|
const ctx = this._ctx.select("withEnum", { name, ...opts });
|
|
5865
6025
|
return new TypeDef(ctx);
|
|
5866
6026
|
};
|
|
6027
|
+
/**
|
|
6028
|
+
* Adds a static value for an Enum TypeDef, failing if the type is not an enum.
|
|
6029
|
+
* @param name The name of the member in the enum
|
|
6030
|
+
* @param opts.value The value of the member in the enum
|
|
6031
|
+
* @param opts.description A doc string for the member, if any
|
|
6032
|
+
* @param opts.sourceMap The source map for the enum member definition.
|
|
6033
|
+
*/
|
|
6034
|
+
withEnumMember = (name, opts) => {
|
|
6035
|
+
const ctx = this._ctx.select("withEnumMember", { name, ...opts });
|
|
6036
|
+
return new TypeDef(ctx);
|
|
6037
|
+
};
|
|
5867
6038
|
/**
|
|
5868
6039
|
* Adds a static value for an Enum TypeDef, failing if the type is not an enum.
|
|
5869
6040
|
* @param value The name of the value in the enum
|
|
5870
6041
|
* @param opts.description A doc string for the value, if any
|
|
5871
6042
|
* @param opts.sourceMap The source map for the enum value definition.
|
|
6043
|
+
* @deprecated Use withEnumMember instead
|
|
5872
6044
|
*/
|
|
5873
6045
|
withEnumValue = (value, opts) => {
|
|
5874
6046
|
const ctx = this._ctx.select("withEnumValue", { value, ...opts });
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { GraphQLErrorExtensions } from "graphql";
|
|
1
2
|
import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.js";
|
|
2
3
|
interface ExecErrorOptions extends DaggerSDKErrorOptions {
|
|
3
4
|
cmd: string[];
|
|
4
5
|
exitCode: number;
|
|
5
6
|
stdout: string;
|
|
6
7
|
stderr: string;
|
|
8
|
+
extensions?: GraphQLErrorExtensions;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* API error from an exec operation in a pipeline.
|
|
@@ -27,6 +29,10 @@ export declare class ExecError extends DaggerSDKError {
|
|
|
27
29
|
* The stderr of the command.
|
|
28
30
|
*/
|
|
29
31
|
stderr: string;
|
|
32
|
+
/**
|
|
33
|
+
* GraphQL error extensions
|
|
34
|
+
*/
|
|
35
|
+
extensions?: GraphQLErrorExtensions;
|
|
30
36
|
/**
|
|
31
37
|
* @hidden
|
|
32
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecError.d.ts","sourceRoot":"","sources":["../../../../src/common/errors/ExecError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAG3E,UAAU,gBAAiB,SAAQ,qBAAqB;IACtD,GAAG,EAAE,MAAM,EAAE,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"ExecError.d.ts","sourceRoot":"","sources":["../../../../src/common/errors/ExecError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAG3E,UAAU,gBAAiB,SAAQ,qBAAqB;IACtD,GAAG,EAAE,MAAM,EAAE,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,sBAAsB,CAAA;CACpC;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,cAAc;IAC3C,IAAI,cAAwB;IAC5B,IAAI,SAAwB;IAE5B;;OAEG;IACH,GAAG,EAAE,MAAM,EAAE,CAAA;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAA;IAEnC;;OAEG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB;CAQvD"}
|
|
@@ -22,6 +22,10 @@ export class ExecError extends DaggerSDKError {
|
|
|
22
22
|
* The stderr of the command.
|
|
23
23
|
*/
|
|
24
24
|
stderr;
|
|
25
|
+
/**
|
|
26
|
+
* GraphQL error extensions
|
|
27
|
+
*/
|
|
28
|
+
extensions;
|
|
25
29
|
/**
|
|
26
30
|
* @hidden
|
|
27
31
|
*/
|
|
@@ -31,5 +35,6 @@ export class ExecError extends DaggerSDKError {
|
|
|
31
35
|
this.exitCode = options.exitCode;
|
|
32
36
|
this.stdout = options.stdout;
|
|
33
37
|
this.stderr = options.stderr;
|
|
38
|
+
this.extensions = options.extensions;
|
|
34
39
|
}
|
|
35
40
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GraphQLErrorExtensions } from "graphql";
|
|
1
2
|
import { ClientError } from "graphql-request";
|
|
2
3
|
import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.js";
|
|
3
4
|
interface GraphQLRequestErrorOptions extends DaggerSDKErrorOptions {
|
|
@@ -17,6 +18,10 @@ export declare class GraphQLRequestError extends DaggerSDKError {
|
|
|
17
18
|
* the GraphQL response containing the error.
|
|
18
19
|
*/
|
|
19
20
|
response: ClientError["response"];
|
|
21
|
+
/**
|
|
22
|
+
* The GraphQL error extentions.
|
|
23
|
+
*/
|
|
24
|
+
extensions?: GraphQLErrorExtensions;
|
|
20
25
|
/**
|
|
21
26
|
* @hidden
|
|
22
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQLRequestError.d.ts","sourceRoot":"","sources":["../../../../src/common/errors/GraphQLRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAG3E,UAAU,0BAA2B,SAAQ,qBAAqB;IAChE,KAAK,EAAE,WAAW,CAAA;CACnB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,IAAI,wBAAkC;IACtC,IAAI,SAAkC;IAEtC;;OAEG;IACH,cAAc,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAEtC;;OAEG;IACH,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IAEjC;;OAEG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B;
|
|
1
|
+
{"version":3,"file":"GraphQLRequestError.d.ts","sourceRoot":"","sources":["../../../../src/common/errors/GraphQLRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAG3E,UAAU,0BAA2B,SAAQ,qBAAqB;IAChE,KAAK,EAAE,WAAW,CAAA;CACnB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc;IACrD,IAAI,wBAAkC;IACtC,IAAI,SAAkC;IAEtC;;OAEG;IACH,cAAc,EAAE,WAAW,CAAC,SAAS,CAAC,CAAA;IAEtC;;OAEG;IACH,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IAEjC;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAA;IAEnC;;OAEG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B;CAMjE"}
|
|
@@ -14,6 +14,10 @@ export class GraphQLRequestError extends DaggerSDKError {
|
|
|
14
14
|
* the GraphQL response containing the error.
|
|
15
15
|
*/
|
|
16
16
|
response;
|
|
17
|
+
/**
|
|
18
|
+
* The GraphQL error extentions.
|
|
19
|
+
*/
|
|
20
|
+
extensions;
|
|
17
21
|
/**
|
|
18
22
|
* @hidden
|
|
19
23
|
*/
|
|
@@ -21,5 +25,6 @@ export class GraphQLRequestError extends DaggerSDKError {
|
|
|
21
25
|
super(message, options);
|
|
22
26
|
this.requestContext = options.error.request;
|
|
23
27
|
this.response = options.error.response;
|
|
28
|
+
this.extensions = options.error.response.errors?.[0]?.extensions;
|
|
24
29
|
}
|
|
25
30
|
}
|
|
@@ -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,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,
|
|
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,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/entrypoint.ts"],"names":[],"mappings":"
|
|
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,4 +1,6 @@
|
|
|
1
1
|
import { dag } from "../../api/client.gen.js";
|
|
2
|
+
import { ExecError } from "../../common/errors/ExecError.js";
|
|
3
|
+
import { GraphQLRequestError } from "../../common/errors/GraphQLRequestError.js";
|
|
2
4
|
import { connection } from "../../connect.js";
|
|
3
5
|
import { Executor } from "../executor.js";
|
|
4
6
|
import { scan } from "../introspector/index.js";
|
|
@@ -39,15 +41,7 @@ export async function entrypoint(files) {
|
|
|
39
41
|
});
|
|
40
42
|
}
|
|
41
43
|
catch (e) {
|
|
42
|
-
|
|
43
|
-
if (e.cause) {
|
|
44
|
-
console.error(`${e.cause}`);
|
|
45
|
-
}
|
|
46
|
-
console.error(`Error: ${e.message}`);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
console.error(e);
|
|
50
|
-
}
|
|
44
|
+
await fnCall.returnError(formatError(e));
|
|
51
45
|
process.exit(1);
|
|
52
46
|
}
|
|
53
47
|
}
|
|
@@ -62,3 +56,32 @@ export async function entrypoint(files) {
|
|
|
62
56
|
await fnCall.returnValue(result);
|
|
63
57
|
}, { LogOutput: process.stdout });
|
|
64
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Take the error thrown by the user module and stringify it so it can
|
|
61
|
+
* be returned to Dagger.
|
|
62
|
+
*
|
|
63
|
+
* If the error is an instance of Error, we stringify the message.
|
|
64
|
+
* If the error is an instance of ExecError, we stringify the message and add the
|
|
65
|
+
* extensions fields in the error object.
|
|
66
|
+
*/
|
|
67
|
+
function formatError(e) {
|
|
68
|
+
if (e instanceof Error) {
|
|
69
|
+
let error = dag.error(e.message);
|
|
70
|
+
// If the error is an instance of GraphQLError or a inherit type of it,
|
|
71
|
+
// we can add the extensions fields in the error object.
|
|
72
|
+
if (e instanceof ExecError || e instanceof GraphQLRequestError) {
|
|
73
|
+
Object.entries(e.extensions ?? []).forEach(([key, value]) => {
|
|
74
|
+
if (value !== "" && value !== undefined && value !== null) {
|
|
75
|
+
error = error.withValue(key, JSON.stringify(value));
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return error;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
return dag.error(JSON.stringify(e));
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return dag.error(String(e));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.18.
|
|
1
|
+
export declare const CLI_VERSION = "0.18.11";
|
|
2
2
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/provisioning/default.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/provisioning/default.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,YAAY,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Code generated by dagger. DO NOT EDIT.
|
|
2
|
-
export const CLI_VERSION = "0.18.
|
|
2
|
+
export const CLI_VERSION = "0.18.11";
|