@mintmcp/hosted-cli 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +87 -5
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +65 -4
- package/dist/api.js.map +1 -1
- package/dist/containerBuilder.d.ts +48 -0
- package/dist/containerBuilder.d.ts.map +1 -0
- package/dist/containerBuilder.js +364 -0
- package/dist/containerBuilder.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +400 -38
- package/dist/index.js.map +1 -1
- package/dist/updateBuilder.d.ts +28 -3
- package/dist/updateBuilder.d.ts.map +1 -1
- package/dist/updateBuilder.js +8 -3
- package/dist/updateBuilder.js.map +1 -1
- package/package.json +2 -2
- package/src/api.ts +87 -4
- package/src/containerBuilder.ts +602 -0
- package/src/index.ts +633 -63
- package/src/updateBuilder.ts +10 -3
package/dist/api.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import z from "zod";
|
|
|
2
2
|
export declare const HOSTED_ID_PREFIX: "hosted-";
|
|
3
3
|
export declare const HostedIdSchema: z.ZodBranded<z.ZodEffects<z.ZodString, string, string>, "HostedId">;
|
|
4
4
|
export type HostedId = z.infer<typeof HostedIdSchema>;
|
|
5
|
+
export declare const GatewayIdSchema: z.ZodString;
|
|
6
|
+
export type GatewayId = z.infer<typeof GatewayIdSchema>;
|
|
7
|
+
export declare const ManagedImageTagSchema: z.ZodString;
|
|
8
|
+
export type ManagedImageTag = z.infer<typeof ManagedImageTagSchema>;
|
|
5
9
|
export declare const EnvUpdateValueSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
6
10
|
type: z.ZodLiteral<"copyPreviousValue">;
|
|
7
11
|
fromName: z.ZodString;
|
|
@@ -45,7 +49,7 @@ export type HostedTransport = z.infer<typeof HostedTransportSchema>;
|
|
|
45
49
|
export declare const UserConfigUpdateSchema: z.ZodObject<{
|
|
46
50
|
userGivenName: z.ZodString;
|
|
47
51
|
image: z.ZodDefault<z.ZodString>;
|
|
48
|
-
command: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]
|
|
52
|
+
command: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
49
53
|
transport: z.ZodDefault<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
50
54
|
type: z.ZodLiteral<"http">;
|
|
51
55
|
path: z.ZodString;
|
|
@@ -115,7 +119,6 @@ export declare const UserConfigUpdateSchema: z.ZodObject<{
|
|
|
115
119
|
}, "strip", z.ZodTypeAny, {
|
|
116
120
|
userGivenName: string;
|
|
117
121
|
image: string;
|
|
118
|
-
command: string | string[];
|
|
119
122
|
transport: {
|
|
120
123
|
path: string;
|
|
121
124
|
type: "http";
|
|
@@ -137,10 +140,10 @@ export declare const UserConfigUpdateSchema: z.ZodObject<{
|
|
|
137
140
|
};
|
|
138
141
|
name: string;
|
|
139
142
|
}[];
|
|
143
|
+
command?: string | string[] | undefined;
|
|
140
144
|
secretDataZipGcsPath?: string | undefined;
|
|
141
145
|
}, {
|
|
142
146
|
userGivenName: string;
|
|
143
|
-
command: string | string[];
|
|
144
147
|
replaceEnv: {
|
|
145
148
|
value: {
|
|
146
149
|
type: "copyPreviousValue";
|
|
@@ -153,6 +156,7 @@ export declare const UserConfigUpdateSchema: z.ZodObject<{
|
|
|
153
156
|
name: string;
|
|
154
157
|
}[];
|
|
155
158
|
image?: string | undefined;
|
|
159
|
+
command?: string | string[] | undefined;
|
|
156
160
|
transport?: {
|
|
157
161
|
path: string;
|
|
158
162
|
type: "http";
|
|
@@ -181,7 +185,6 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
181
185
|
input: {
|
|
182
186
|
config: {
|
|
183
187
|
userGivenName: string;
|
|
184
|
-
command: string | string[];
|
|
185
188
|
replaceEnv: {
|
|
186
189
|
value: {
|
|
187
190
|
type: "copyPreviousValue";
|
|
@@ -194,6 +197,7 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
194
197
|
name: string;
|
|
195
198
|
}[];
|
|
196
199
|
image?: string | undefined;
|
|
200
|
+
command?: string | string[] | undefined;
|
|
197
201
|
transport?: {
|
|
198
202
|
path: string;
|
|
199
203
|
type: "http";
|
|
@@ -209,6 +213,7 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
209
213
|
};
|
|
210
214
|
output: {
|
|
211
215
|
hostedId: string & z.BRAND<"HostedId">;
|
|
216
|
+
gatewayId: string;
|
|
212
217
|
};
|
|
213
218
|
meta: object;
|
|
214
219
|
}>;
|
|
@@ -217,6 +222,75 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
217
222
|
hostedId: string;
|
|
218
223
|
update: {
|
|
219
224
|
userGivenName?: string | undefined;
|
|
225
|
+
image?: string | undefined;
|
|
226
|
+
command?: string | string[] | null | undefined;
|
|
227
|
+
transport?: {
|
|
228
|
+
path: string;
|
|
229
|
+
type: "http";
|
|
230
|
+
} | {
|
|
231
|
+
type: "stdio";
|
|
232
|
+
} | undefined;
|
|
233
|
+
secretDataZipGcsPath?: string | undefined;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
output: {
|
|
237
|
+
hostedId: string & z.BRAND<"HostedId">;
|
|
238
|
+
gatewayId?: string | undefined;
|
|
239
|
+
};
|
|
240
|
+
meta: object;
|
|
241
|
+
}>;
|
|
242
|
+
createRegistryPushSession: import("@trpc/server").TRPCMutationProcedure<{
|
|
243
|
+
input: {
|
|
244
|
+
hostedId: string;
|
|
245
|
+
};
|
|
246
|
+
output: {
|
|
247
|
+
registryHost: string;
|
|
248
|
+
repository: string;
|
|
249
|
+
username: string;
|
|
250
|
+
password: string;
|
|
251
|
+
imageTag: string;
|
|
252
|
+
finalizeToken: string;
|
|
253
|
+
};
|
|
254
|
+
meta: object;
|
|
255
|
+
}>;
|
|
256
|
+
createRegistryPushSessionForCreate: import("@trpc/server").TRPCMutationProcedure<{
|
|
257
|
+
input: {};
|
|
258
|
+
output: {
|
|
259
|
+
registryHost: string;
|
|
260
|
+
repository: string;
|
|
261
|
+
username: string;
|
|
262
|
+
password: string;
|
|
263
|
+
imageTag: string;
|
|
264
|
+
finalizeToken: string;
|
|
265
|
+
};
|
|
266
|
+
meta: object;
|
|
267
|
+
}>;
|
|
268
|
+
finalizeRegistryPush: import("@trpc/server").TRPCMutationProcedure<{
|
|
269
|
+
input: {
|
|
270
|
+
hostedId: string;
|
|
271
|
+
finalizeToken: string;
|
|
272
|
+
};
|
|
273
|
+
output: {
|
|
274
|
+
hostedId: string & z.BRAND<"HostedId">;
|
|
275
|
+
gatewayId?: string | undefined;
|
|
276
|
+
};
|
|
277
|
+
meta: object;
|
|
278
|
+
}>;
|
|
279
|
+
finalizeRegistryPushCreate: import("@trpc/server").TRPCMutationProcedure<{
|
|
280
|
+
input: {
|
|
281
|
+
config: {
|
|
282
|
+
userGivenName: string;
|
|
283
|
+
replaceEnv: {
|
|
284
|
+
value: {
|
|
285
|
+
type: "copyPreviousValue";
|
|
286
|
+
fromName: string;
|
|
287
|
+
} | {
|
|
288
|
+
value: string;
|
|
289
|
+
type: "set";
|
|
290
|
+
isSecret: boolean;
|
|
291
|
+
};
|
|
292
|
+
name: string;
|
|
293
|
+
}[];
|
|
220
294
|
command?: string | string[] | undefined;
|
|
221
295
|
transport?: {
|
|
222
296
|
path: string;
|
|
@@ -224,10 +298,18 @@ declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
224
298
|
} | {
|
|
225
299
|
type: "stdio";
|
|
226
300
|
} | undefined;
|
|
301
|
+
cpu?: number | undefined;
|
|
302
|
+
memoryMiB?: number | undefined;
|
|
303
|
+
urlPath?: string | undefined;
|
|
227
304
|
secretDataZipGcsPath?: string | undefined;
|
|
305
|
+
startupProbe?: "startupProbeOn" | "startupProbeOff" | undefined;
|
|
228
306
|
};
|
|
307
|
+
finalizeToken: string;
|
|
308
|
+
};
|
|
309
|
+
output: {
|
|
310
|
+
hostedId: string & z.BRAND<"HostedId">;
|
|
311
|
+
gatewayId: string;
|
|
229
312
|
};
|
|
230
|
-
output: unknown;
|
|
231
313
|
meta: object;
|
|
232
314
|
}>;
|
|
233
315
|
makeSignedUploadUrl: import("@trpc/server").TRPCMutationProcedure<{
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAQA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,eAAO,MAAM,gBAAgB,EAAG,SAAkB,CAAC;AACnD,eAAO,MAAM,cAAc,qEAOL,CAAC;AACvB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;IAU/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;KAWQ,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBjC,CAAC;AAKH,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAQA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,eAAO,MAAM,gBAAgB,EAAG,SAAkB,CAAC;AACnD,eAAO,MAAM,cAAc,qEAOL,CAAC;AACvB,MAAM,M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
16
|
+
export const GatewayIdSchema = z.string().min(1);
|
|
17
|
+
export const ManagedImageTagSchema = z.string().regex(/^mi_[0-9A-Za-z]{22}$/);
|
|
16
18
|
export const EnvUpdateValueSchema = z.discriminatedUnion("type", [
|
|
17
19
|
z.object({
|
|
18
20
|
type: z.literal("copyPreviousValue"),
|
|
@@ -41,7 +43,7 @@ export const UserConfigUpdateSchema = z.object({
|
|
|
41
43
|
image: z
|
|
42
44
|
.string()
|
|
43
45
|
.default("nikolaik/python-nodejs@sha256:1dcaf296688723fbe79c400e1dda743c8e8a8b2812ef4b0af70779914a9cec3c"),
|
|
44
|
-
command: z.union([z.string(), z.array(z.string())]),
|
|
46
|
+
command: z.union([z.string(), z.array(z.string())]).optional(),
|
|
45
47
|
transport: HostedTransportSchema,
|
|
46
48
|
cpu: z.number().default(1),
|
|
47
49
|
memoryMiB: z.number().default(4096),
|
|
@@ -58,7 +60,7 @@ const appRouter = router({
|
|
|
58
60
|
mcpHost: router({
|
|
59
61
|
createServer: procedure
|
|
60
62
|
.input(z.object({ config: UserConfigUpdateSchema }))
|
|
61
|
-
.output(z.object({ hostedId: HostedIdSchema }))
|
|
63
|
+
.output(z.object({ hostedId: HostedIdSchema, gatewayId: GatewayIdSchema }))
|
|
62
64
|
.mutation(() => {
|
|
63
65
|
throw new Error("stub");
|
|
64
66
|
}),
|
|
@@ -67,12 +69,71 @@ const appRouter = router({
|
|
|
67
69
|
hostedId: HostedIdSchema,
|
|
68
70
|
update: z.object({
|
|
69
71
|
userGivenName: z.string().optional(),
|
|
70
|
-
|
|
72
|
+
image: z.string().optional(),
|
|
73
|
+
command: z
|
|
74
|
+
.union([z.string(), z.array(z.string())])
|
|
75
|
+
.optional()
|
|
76
|
+
.nullable(),
|
|
71
77
|
transport: HostedTransportSchema.optional(),
|
|
72
78
|
secretDataZipGcsPath: z.string().optional(),
|
|
73
79
|
}),
|
|
74
80
|
}))
|
|
75
|
-
.output(z.
|
|
81
|
+
.output(z.object({
|
|
82
|
+
hostedId: HostedIdSchema,
|
|
83
|
+
gatewayId: GatewayIdSchema.optional(),
|
|
84
|
+
}))
|
|
85
|
+
.mutation(() => {
|
|
86
|
+
throw new Error("stub");
|
|
87
|
+
}),
|
|
88
|
+
createRegistryPushSession: procedure
|
|
89
|
+
.input(z.object({
|
|
90
|
+
hostedId: HostedIdSchema,
|
|
91
|
+
}))
|
|
92
|
+
.output(z.object({
|
|
93
|
+
registryHost: z.string(),
|
|
94
|
+
repository: z.string(),
|
|
95
|
+
username: z.string(),
|
|
96
|
+
password: z.string(),
|
|
97
|
+
imageTag: ManagedImageTagSchema,
|
|
98
|
+
finalizeToken: z.string(),
|
|
99
|
+
}))
|
|
100
|
+
.mutation(() => {
|
|
101
|
+
throw new Error("stub");
|
|
102
|
+
}),
|
|
103
|
+
createRegistryPushSessionForCreate: procedure
|
|
104
|
+
.input(z.object({}))
|
|
105
|
+
.output(z.object({
|
|
106
|
+
registryHost: z.string(),
|
|
107
|
+
repository: z.string(),
|
|
108
|
+
username: z.string(),
|
|
109
|
+
password: z.string(),
|
|
110
|
+
imageTag: ManagedImageTagSchema,
|
|
111
|
+
finalizeToken: z.string(),
|
|
112
|
+
}))
|
|
113
|
+
.mutation(() => {
|
|
114
|
+
throw new Error("stub");
|
|
115
|
+
}),
|
|
116
|
+
finalizeRegistryPush: procedure
|
|
117
|
+
.input(z.object({
|
|
118
|
+
hostedId: HostedIdSchema,
|
|
119
|
+
finalizeToken: z.string(),
|
|
120
|
+
}))
|
|
121
|
+
.output(z.object({
|
|
122
|
+
hostedId: HostedIdSchema,
|
|
123
|
+
gatewayId: GatewayIdSchema.optional(),
|
|
124
|
+
}))
|
|
125
|
+
.mutation(() => {
|
|
126
|
+
throw new Error("stub");
|
|
127
|
+
}),
|
|
128
|
+
finalizeRegistryPushCreate: procedure
|
|
129
|
+
.input(z.object({
|
|
130
|
+
finalizeToken: z.string(),
|
|
131
|
+
config: UserConfigUpdateSchema.omit({ image: true }),
|
|
132
|
+
}))
|
|
133
|
+
.output(z.object({
|
|
134
|
+
hostedId: HostedIdSchema,
|
|
135
|
+
gatewayId: GatewayIdSchema,
|
|
136
|
+
}))
|
|
76
137
|
.mutation(() => {
|
|
77
138
|
throw new Error("stub");
|
|
78
139
|
}),
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,uFAAuF;AACvF,EAAE;AACF,kGAAkG;AAClG,oBAAoB;AAEpB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,OAAO,GACX,iEAAiE,CAAC;AAEpE,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,MAAM,CACL,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC;IAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CACrD;KACA,KAAK,EAAc,CAAC;AAGvB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;KACrB,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QACtB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;KACtB,CAAC;CACH,CAAC,CAAC;AA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,CAAC,CAAC;QAC1B,CAAC,CAAC;QACJ,0BAA0B,EAAE,SAAS;aAClC,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;YACP,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;YACzB,MAAM,EAAE,sBAAsB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;SACrD,CAAC,CACH;aACA,MAAM,CACL,CAAC,CAAC,MAAM,CAAC;YACP,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE,eAAe;SAC3B,CAAC,CACH;aACA,QAAQ,CAAC,GAAG,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC,CAAC;QACJ,mBAAmB,EAAE,SAAS;aAC3B,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;aACzC,MAAM,CACL,CAAC,CAAC,MAAM,CAAC;YACP,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;YACf,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;YACxC,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE;SACjC,CAAC,CACH;aACA,QAAQ,CAAC,GAAG,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC,CAAC;KACL,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { execFileSync, spawn } from "node:child_process";
|
|
2
|
+
export interface BuildOptions {
|
|
3
|
+
dockerfile?: string;
|
|
4
|
+
context?: string;
|
|
5
|
+
buildArgs?: string[];
|
|
6
|
+
target?: string;
|
|
7
|
+
platform?: string;
|
|
8
|
+
imageRef: string;
|
|
9
|
+
}
|
|
10
|
+
export interface BuildResult {
|
|
11
|
+
imageRef: string;
|
|
12
|
+
platform?: string;
|
|
13
|
+
sizeBytes: number;
|
|
14
|
+
sizeHuman: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SmokeTestOptions {
|
|
17
|
+
imageRef: string;
|
|
18
|
+
probePath?: string;
|
|
19
|
+
probeTimeoutMs?: number;
|
|
20
|
+
env?: string[];
|
|
21
|
+
envFile?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SmokeTestResult {
|
|
24
|
+
containerName: string;
|
|
25
|
+
imageRef: string;
|
|
26
|
+
url: string;
|
|
27
|
+
}
|
|
28
|
+
interface ContainerBuilderDeps {
|
|
29
|
+
execFileSync: typeof execFileSync;
|
|
30
|
+
spawn: typeof spawn;
|
|
31
|
+
fetch: typeof fetch;
|
|
32
|
+
getAvailablePort: () => Promise<number>;
|
|
33
|
+
sleep: (ms: number) => Promise<void>;
|
|
34
|
+
now: () => number;
|
|
35
|
+
}
|
|
36
|
+
export declare function defaultBuildPlatform(): string;
|
|
37
|
+
export declare function defaultLocalTestImageRef(now?: number): string;
|
|
38
|
+
export declare function ensureDockerAvailable(deps?: ContainerBuilderDeps): void;
|
|
39
|
+
export declare function ensureDockerBuildxAvailable(deps?: ContainerBuilderDeps): void;
|
|
40
|
+
export declare function buildImage(options: BuildOptions, deps?: ContainerBuilderDeps): BuildResult;
|
|
41
|
+
export declare function pushImage(imageRef: string, deps?: ContainerBuilderDeps): void;
|
|
42
|
+
export declare function loginToRegistry(registryHost: string, username: string, password: string, deps?: ContainerBuilderDeps): void;
|
|
43
|
+
export declare function tagImage(sourceImageRef: string, targetImageRef: string, deps?: ContainerBuilderDeps): void;
|
|
44
|
+
export declare function ensureImageAvailableLocally(imageRef: string, deps?: ContainerBuilderDeps): void;
|
|
45
|
+
export declare function assertImageSupportsPlatform(imageRef: string, platform: string, deps?: ContainerBuilderDeps): void;
|
|
46
|
+
export declare function smokeTestImage(options: SmokeTestOptions, deps?: ContainerBuilderDeps): Promise<SmokeTestResult>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=containerBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"containerBuilder.d.ts","sourceRoot":"","sources":["../src/containerBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAK5E,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAYD,UAAU,oBAAoB;IAC5B,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,gBAAgB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,GAAG,EAAE,MAAM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