@distilled.cloud/cloudflare 0.5.4 → 0.6.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.
@@ -0,0 +1,1592 @@
1
+ /**
2
+ * Cloudflare CONTAINERS API
3
+ *
4
+ * Generated from Cloudflare TypeScript SDK.
5
+ * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service containers
6
+ */
7
+ import * as Schema from "effect/Schema";
8
+ import * as API from "../client/api.js";
9
+ import * as T from "../traits.js";
10
+ import {} from "../errors.js";
11
+ import { SensitiveString } from "../sensitive.js";
12
+ // =============================================================================
13
+ // Errors
14
+ // =============================================================================
15
+ export class ContainerApplicationNotFound extends Schema.TaggedErrorClass()("ContainerApplicationNotFound", { code: Schema.Number, message: Schema.String }) {
16
+ }
17
+ T.applyErrorMatchers(ContainerApplicationNotFound, [
18
+ { code: 1609, message: { includes: "Container application not found" } },
19
+ { code: 1609, message: { includes: "APPLICATION_NOT_FOUND" } },
20
+ ]);
21
+ export class DurableObjectAlreadyHasApplication extends Schema.TaggedErrorClass()("DurableObjectAlreadyHasApplication", { code: Schema.Number, message: Schema.String }) {
22
+ }
23
+ T.applyErrorMatchers(DurableObjectAlreadyHasApplication, [
24
+ {
25
+ code: 1608,
26
+ message: { includes: "DURABLE_OBJECT_ALREADY_HAS_APPLICATION" },
27
+ },
28
+ ]);
29
+ export class InvalidRoute extends Schema.TaggedErrorClass()("InvalidRoute", { code: Schema.Number, message: Schema.String }) {
30
+ }
31
+ T.applyErrorMatchers(InvalidRoute, [
32
+ { code: 7003, message: { includes: "Could not route" } },
33
+ ]);
34
+ export const GetContainerApplicationRequest =
35
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
36
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
37
+ applicationId: Schema.String.pipe(T.HttpPath("application_id")),
38
+ }).pipe(T.Http({
39
+ method: "GET",
40
+ path: "/accounts/{account_id}/containers/applications/{application_id}",
41
+ }));
42
+ export const GetContainerApplicationResponse =
43
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
44
+ id: Schema.String,
45
+ accountId: Schema.String,
46
+ name: Schema.String,
47
+ schedulingPolicy: Schema.Literals([
48
+ "moon",
49
+ "gpu",
50
+ "regional",
51
+ "fill_metals",
52
+ "default",
53
+ ]),
54
+ instances: Schema.Number,
55
+ maxInstances: Schema.Number,
56
+ constraints: Schema.Struct({
57
+ tier: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
58
+ }),
59
+ affinities: Schema.optional(Schema.Union([
60
+ Schema.Struct({
61
+ colocation: Schema.optional(Schema.Union([Schema.Literal("datacenter"), Schema.Null])),
62
+ }),
63
+ Schema.Null,
64
+ ])),
65
+ configuration: Schema.Struct({
66
+ image: Schema.String,
67
+ instanceType: Schema.optional(Schema.Union([
68
+ Schema.Literals([
69
+ "lite",
70
+ "dev",
71
+ "basic",
72
+ "standard",
73
+ "standard-1",
74
+ "standard-2",
75
+ "standard-3",
76
+ "standard-4",
77
+ ]),
78
+ Schema.Null,
79
+ ])),
80
+ observability: Schema.optional(Schema.Union([
81
+ Schema.Struct({
82
+ logs: Schema.optional(Schema.Union([
83
+ Schema.Struct({
84
+ enabled: Schema.Boolean,
85
+ }),
86
+ Schema.Null,
87
+ ])),
88
+ }),
89
+ Schema.Null,
90
+ ])),
91
+ sshPublicKeyIds: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
92
+ secrets: Schema.optional(Schema.Union([
93
+ Schema.Array(Schema.Struct({
94
+ name: Schema.String,
95
+ type: Schema.Literal("env"),
96
+ secret: SensitiveString,
97
+ })),
98
+ Schema.Null,
99
+ ])),
100
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
101
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
102
+ disk: Schema.optional(Schema.Union([
103
+ Schema.Struct({
104
+ size: Schema.String,
105
+ }),
106
+ Schema.Null,
107
+ ])),
108
+ environmentVariables: Schema.optional(Schema.Union([
109
+ Schema.Array(Schema.Struct({
110
+ name: Schema.String,
111
+ value: Schema.String,
112
+ })),
113
+ Schema.Null,
114
+ ])),
115
+ labels: Schema.optional(Schema.Union([
116
+ Schema.Array(Schema.Struct({
117
+ name: Schema.String,
118
+ value: Schema.String,
119
+ })),
120
+ Schema.Null,
121
+ ])),
122
+ network: Schema.optional(Schema.Union([
123
+ Schema.Struct({
124
+ assignIpv4: Schema.optional(Schema.Union([
125
+ Schema.Literals(["none", "predefined", "account"]),
126
+ Schema.Null,
127
+ ])),
128
+ assignIpv6: Schema.optional(Schema.Union([
129
+ Schema.Literals(["none", "predefined", "account"]),
130
+ Schema.Null,
131
+ ])),
132
+ mode: Schema.optional(Schema.Union([
133
+ Schema.Literals(["public", "private"]),
134
+ Schema.Null,
135
+ ])),
136
+ }).pipe(Schema.encodeKeys({
137
+ assignIpv4: "assign_ipv4",
138
+ assignIpv6: "assign_ipv6",
139
+ mode: "mode",
140
+ })),
141
+ Schema.Null,
142
+ ])),
143
+ command: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
144
+ entrypoint: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
145
+ dns: Schema.optional(Schema.Union([
146
+ Schema.Struct({
147
+ servers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
148
+ searches: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
149
+ }),
150
+ Schema.Null,
151
+ ])),
152
+ ports: Schema.optional(Schema.Union([
153
+ Schema.Array(Schema.Struct({
154
+ name: Schema.String,
155
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
156
+ })),
157
+ Schema.Null,
158
+ ])),
159
+ checks: Schema.optional(Schema.Union([
160
+ Schema.Array(Schema.Struct({
161
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
162
+ type: Schema.Literals(["http", "tcp"]),
163
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
164
+ port: Schema.String,
165
+ http: Schema.optional(Schema.Union([
166
+ Schema.Struct({
167
+ method: Schema.optional(Schema.Union([
168
+ Schema.Literals([
169
+ "GET",
170
+ "POST",
171
+ "PUT",
172
+ "PATCH",
173
+ "DELETE",
174
+ "OPTIONS",
175
+ "HEAD",
176
+ ]),
177
+ Schema.Null,
178
+ ])),
179
+ body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
180
+ path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
181
+ headers: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
182
+ }),
183
+ Schema.Null,
184
+ ])),
185
+ interval: Schema.String,
186
+ timeout: Schema.String,
187
+ retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
188
+ kind: Schema.Literals(["health", "ready"]),
189
+ })),
190
+ Schema.Null,
191
+ ])),
192
+ }).pipe(Schema.encodeKeys({
193
+ image: "image",
194
+ instanceType: "instance_type",
195
+ observability: "observability",
196
+ sshPublicKeyIds: "ssh_public_key_ids",
197
+ secrets: "secrets",
198
+ vcpu: "vcpu",
199
+ memory: "memory",
200
+ disk: "disk",
201
+ environmentVariables: "environment_variables",
202
+ labels: "labels",
203
+ network: "network",
204
+ command: "command",
205
+ entrypoint: "entrypoint",
206
+ dns: "dns",
207
+ ports: "ports",
208
+ checks: "checks",
209
+ })),
210
+ durableObjects: Schema.optional(Schema.Union([
211
+ Schema.Struct({
212
+ namespaceId: Schema.String,
213
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
214
+ Schema.Null,
215
+ ])),
216
+ createdAt: Schema.String,
217
+ version: Schema.Number,
218
+ durableObjectNamespaceId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
219
+ health: Schema.Struct({
220
+ instances: Schema.Unknown,
221
+ }),
222
+ })
223
+ .pipe(Schema.encodeKeys({
224
+ id: "id",
225
+ accountId: "account_id",
226
+ name: "name",
227
+ schedulingPolicy: "scheduling_policy",
228
+ instances: "instances",
229
+ maxInstances: "max_instances",
230
+ constraints: "constraints",
231
+ affinities: "affinities",
232
+ configuration: "configuration",
233
+ durableObjects: "durable_objects",
234
+ createdAt: "created_at",
235
+ version: "version",
236
+ durableObjectNamespaceId: "durable_object_namespace_id",
237
+ health: "health",
238
+ }))
239
+ .pipe(T.ResponsePath("result"));
240
+ export const getContainerApplication = API.make(() => ({
241
+ input: GetContainerApplicationRequest,
242
+ output: GetContainerApplicationResponse,
243
+ errors: [InvalidRoute, ContainerApplicationNotFound],
244
+ }));
245
+ export const ListContainerApplicationsRequest =
246
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
247
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
248
+ }).pipe(T.Http({
249
+ method: "GET",
250
+ path: "/accounts/{account_id}/containers/applications",
251
+ }));
252
+ export const ListContainerApplicationsResponse =
253
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
254
+ id: Schema.String,
255
+ accountId: Schema.String,
256
+ name: Schema.String,
257
+ schedulingPolicy: Schema.Literals([
258
+ "moon",
259
+ "gpu",
260
+ "regional",
261
+ "fill_metals",
262
+ "default",
263
+ ]),
264
+ instances: Schema.Number,
265
+ maxInstances: Schema.Number,
266
+ constraints: Schema.Struct({
267
+ tier: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
268
+ }),
269
+ affinities: Schema.optional(Schema.Union([
270
+ Schema.Struct({
271
+ colocation: Schema.optional(Schema.Union([Schema.Literal("datacenter"), Schema.Null])),
272
+ }),
273
+ Schema.Null,
274
+ ])),
275
+ configuration: Schema.Struct({
276
+ image: Schema.String,
277
+ instanceType: Schema.optional(Schema.Union([
278
+ Schema.Literals([
279
+ "lite",
280
+ "dev",
281
+ "basic",
282
+ "standard",
283
+ "standard-1",
284
+ "standard-2",
285
+ "standard-3",
286
+ "standard-4",
287
+ ]),
288
+ Schema.Null,
289
+ ])),
290
+ observability: Schema.optional(Schema.Union([
291
+ Schema.Struct({
292
+ logs: Schema.optional(Schema.Union([
293
+ Schema.Struct({
294
+ enabled: Schema.Boolean,
295
+ }),
296
+ Schema.Null,
297
+ ])),
298
+ }),
299
+ Schema.Null,
300
+ ])),
301
+ sshPublicKeyIds: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
302
+ secrets: Schema.optional(Schema.Union([
303
+ Schema.Array(Schema.Struct({
304
+ name: Schema.String,
305
+ type: Schema.Literal("env"),
306
+ secret: SensitiveString,
307
+ })),
308
+ Schema.Null,
309
+ ])),
310
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
311
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
312
+ disk: Schema.optional(Schema.Union([
313
+ Schema.Struct({
314
+ size: Schema.String,
315
+ }),
316
+ Schema.Null,
317
+ ])),
318
+ environmentVariables: Schema.optional(Schema.Union([
319
+ Schema.Array(Schema.Struct({
320
+ name: Schema.String,
321
+ value: Schema.String,
322
+ })),
323
+ Schema.Null,
324
+ ])),
325
+ labels: Schema.optional(Schema.Union([
326
+ Schema.Array(Schema.Struct({
327
+ name: Schema.String,
328
+ value: Schema.String,
329
+ })),
330
+ Schema.Null,
331
+ ])),
332
+ network: Schema.optional(Schema.Union([
333
+ Schema.Struct({
334
+ assignIpv4: Schema.optional(Schema.Union([
335
+ Schema.Literals(["none", "predefined", "account"]),
336
+ Schema.Null,
337
+ ])),
338
+ assignIpv6: Schema.optional(Schema.Union([
339
+ Schema.Literals(["none", "predefined", "account"]),
340
+ Schema.Null,
341
+ ])),
342
+ mode: Schema.optional(Schema.Union([
343
+ Schema.Literals(["public", "private"]),
344
+ Schema.Null,
345
+ ])),
346
+ }).pipe(Schema.encodeKeys({
347
+ assignIpv4: "assign_ipv4",
348
+ assignIpv6: "assign_ipv6",
349
+ mode: "mode",
350
+ })),
351
+ Schema.Null,
352
+ ])),
353
+ command: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
354
+ entrypoint: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
355
+ dns: Schema.optional(Schema.Union([
356
+ Schema.Struct({
357
+ servers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
358
+ searches: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
359
+ }),
360
+ Schema.Null,
361
+ ])),
362
+ ports: Schema.optional(Schema.Union([
363
+ Schema.Array(Schema.Struct({
364
+ name: Schema.String,
365
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
366
+ })),
367
+ Schema.Null,
368
+ ])),
369
+ checks: Schema.optional(Schema.Union([
370
+ Schema.Array(Schema.Struct({
371
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
372
+ type: Schema.Literals(["http", "tcp"]),
373
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
374
+ port: Schema.String,
375
+ http: Schema.optional(Schema.Union([
376
+ Schema.Struct({
377
+ method: Schema.optional(Schema.Union([
378
+ Schema.Literals([
379
+ "GET",
380
+ "POST",
381
+ "PUT",
382
+ "PATCH",
383
+ "DELETE",
384
+ "OPTIONS",
385
+ "HEAD",
386
+ ]),
387
+ Schema.Null,
388
+ ])),
389
+ body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
390
+ path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
391
+ headers: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
392
+ }),
393
+ Schema.Null,
394
+ ])),
395
+ interval: Schema.String,
396
+ timeout: Schema.String,
397
+ retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
398
+ kind: Schema.Literals(["health", "ready"]),
399
+ })),
400
+ Schema.Null,
401
+ ])),
402
+ }).pipe(Schema.encodeKeys({
403
+ image: "image",
404
+ instanceType: "instance_type",
405
+ observability: "observability",
406
+ sshPublicKeyIds: "ssh_public_key_ids",
407
+ secrets: "secrets",
408
+ vcpu: "vcpu",
409
+ memory: "memory",
410
+ disk: "disk",
411
+ environmentVariables: "environment_variables",
412
+ labels: "labels",
413
+ network: "network",
414
+ command: "command",
415
+ entrypoint: "entrypoint",
416
+ dns: "dns",
417
+ ports: "ports",
418
+ checks: "checks",
419
+ })),
420
+ durableObjects: Schema.optional(Schema.Union([
421
+ Schema.Struct({
422
+ namespaceId: Schema.String,
423
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
424
+ Schema.Null,
425
+ ])),
426
+ createdAt: Schema.String,
427
+ version: Schema.Number,
428
+ durableObjectNamespaceId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
429
+ health: Schema.Struct({
430
+ instances: Schema.Unknown,
431
+ }),
432
+ }).pipe(Schema.encodeKeys({
433
+ id: "id",
434
+ accountId: "account_id",
435
+ name: "name",
436
+ schedulingPolicy: "scheduling_policy",
437
+ instances: "instances",
438
+ maxInstances: "max_instances",
439
+ constraints: "constraints",
440
+ affinities: "affinities",
441
+ configuration: "configuration",
442
+ durableObjects: "durable_objects",
443
+ createdAt: "created_at",
444
+ version: "version",
445
+ durableObjectNamespaceId: "durable_object_namespace_id",
446
+ health: "health",
447
+ }))).pipe(T.ResponsePath("result"));
448
+ export const listContainerApplications = API.make(() => ({
449
+ input: ListContainerApplicationsRequest,
450
+ output: ListContainerApplicationsResponse,
451
+ errors: [InvalidRoute],
452
+ }));
453
+ export const CreateContainerApplicationRequest =
454
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
455
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
456
+ name: Schema.String,
457
+ maxInstances: Schema.Number,
458
+ configuration: Schema.Struct({
459
+ image: Schema.String,
460
+ instanceType: Schema.optional(Schema.Literals([
461
+ "lite",
462
+ "dev",
463
+ "basic",
464
+ "standard",
465
+ "standard-1",
466
+ "standard-2",
467
+ "standard-3",
468
+ "standard-4",
469
+ ])),
470
+ observability: Schema.optional(Schema.Struct({
471
+ logs: Schema.optional(Schema.Struct({
472
+ enabled: Schema.Boolean,
473
+ })),
474
+ })),
475
+ sshPublicKeyIds: Schema.optional(Schema.Array(Schema.String)),
476
+ secrets: Schema.optional(Schema.Array(Schema.Struct({
477
+ name: Schema.String,
478
+ type: Schema.Literal("env"),
479
+ secret: SensitiveString,
480
+ }))),
481
+ vcpu: Schema.optional(Schema.Number),
482
+ memory: Schema.optional(Schema.String),
483
+ disk: Schema.optional(Schema.Struct({
484
+ size: Schema.String,
485
+ })),
486
+ environmentVariables: Schema.optional(Schema.Array(Schema.Struct({
487
+ name: Schema.String,
488
+ value: Schema.String,
489
+ }))),
490
+ labels: Schema.optional(Schema.Array(Schema.Struct({
491
+ name: Schema.String,
492
+ value: Schema.String,
493
+ }))),
494
+ network: Schema.optional(Schema.Struct({
495
+ assignIpv4: Schema.optional(Schema.Literals(["none", "predefined", "account"])),
496
+ assignIpv6: Schema.optional(Schema.Literals(["none", "predefined", "account"])),
497
+ mode: Schema.optional(Schema.Literals(["public", "private"])),
498
+ }).pipe(Schema.encodeKeys({
499
+ assignIpv4: "assign_ipv4",
500
+ assignIpv6: "assign_ipv6",
501
+ mode: "mode",
502
+ }))),
503
+ command: Schema.optional(Schema.Array(Schema.String)),
504
+ entrypoint: Schema.optional(Schema.Array(Schema.String)),
505
+ dns: Schema.optional(Schema.Struct({
506
+ servers: Schema.optional(Schema.Array(Schema.String)),
507
+ searches: Schema.optional(Schema.Array(Schema.String)),
508
+ })),
509
+ ports: Schema.optional(Schema.Array(Schema.Struct({
510
+ name: Schema.String,
511
+ port: Schema.optional(Schema.Number),
512
+ }))),
513
+ checks: Schema.optional(Schema.Array(Schema.Struct({
514
+ name: Schema.optional(Schema.String),
515
+ type: Schema.Literals(["http", "tcp"]),
516
+ tls: Schema.optional(Schema.Boolean),
517
+ port: Schema.String,
518
+ http: Schema.optional(Schema.Struct({
519
+ method: Schema.optional(Schema.Literals([
520
+ "GET",
521
+ "POST",
522
+ "PUT",
523
+ "PATCH",
524
+ "DELETE",
525
+ "OPTIONS",
526
+ "HEAD",
527
+ ])),
528
+ body: Schema.optional(Schema.String),
529
+ path: Schema.optional(Schema.String),
530
+ headers: Schema.optional(Schema.Unknown),
531
+ })),
532
+ interval: Schema.String,
533
+ timeout: Schema.String,
534
+ retries: Schema.optional(Schema.Number),
535
+ kind: Schema.Literals(["health", "ready"]),
536
+ }))),
537
+ }).pipe(Schema.encodeKeys({
538
+ image: "image",
539
+ instanceType: "instance_type",
540
+ observability: "observability",
541
+ sshPublicKeyIds: "ssh_public_key_ids",
542
+ secrets: "secrets",
543
+ vcpu: "vcpu",
544
+ memory: "memory",
545
+ disk: "disk",
546
+ environmentVariables: "environment_variables",
547
+ labels: "labels",
548
+ network: "network",
549
+ command: "command",
550
+ entrypoint: "entrypoint",
551
+ dns: "dns",
552
+ ports: "ports",
553
+ checks: "checks",
554
+ })),
555
+ durableObjects: Schema.optional(Schema.Struct({
556
+ namespaceId: Schema.String,
557
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" }))),
558
+ instances: Schema.optional(Schema.Number),
559
+ schedulingPolicy: Schema.optional(Schema.Literals(["moon", "gpu", "regional", "fill_metals", "default"])),
560
+ constraints: Schema.optional(Schema.Struct({
561
+ tier: Schema.optional(Schema.Number),
562
+ })),
563
+ affinities: Schema.optional(Schema.Struct({
564
+ colocation: Schema.optional(Schema.Literal("datacenter")),
565
+ })),
566
+ }).pipe(Schema.encodeKeys({
567
+ name: "name",
568
+ maxInstances: "max_instances",
569
+ configuration: "configuration",
570
+ durableObjects: "durable_objects",
571
+ instances: "instances",
572
+ schedulingPolicy: "scheduling_policy",
573
+ constraints: "constraints",
574
+ affinities: "affinities",
575
+ }), T.Http({
576
+ method: "POST",
577
+ path: "/accounts/{account_id}/containers/applications",
578
+ }));
579
+ export const CreateContainerApplicationResponse =
580
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
581
+ id: Schema.String,
582
+ accountId: Schema.String,
583
+ name: Schema.String,
584
+ schedulingPolicy: Schema.Literals([
585
+ "moon",
586
+ "gpu",
587
+ "regional",
588
+ "fill_metals",
589
+ "default",
590
+ ]),
591
+ instances: Schema.Number,
592
+ maxInstances: Schema.Number,
593
+ constraints: Schema.Struct({
594
+ tier: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
595
+ }),
596
+ affinities: Schema.optional(Schema.Union([
597
+ Schema.Struct({
598
+ colocation: Schema.optional(Schema.Union([Schema.Literal("datacenter"), Schema.Null])),
599
+ }),
600
+ Schema.Null,
601
+ ])),
602
+ configuration: Schema.Struct({
603
+ image: Schema.String,
604
+ instanceType: Schema.optional(Schema.Union([
605
+ Schema.Literals([
606
+ "lite",
607
+ "dev",
608
+ "basic",
609
+ "standard",
610
+ "standard-1",
611
+ "standard-2",
612
+ "standard-3",
613
+ "standard-4",
614
+ ]),
615
+ Schema.Null,
616
+ ])),
617
+ observability: Schema.optional(Schema.Union([
618
+ Schema.Struct({
619
+ logs: Schema.optional(Schema.Union([
620
+ Schema.Struct({
621
+ enabled: Schema.Boolean,
622
+ }),
623
+ Schema.Null,
624
+ ])),
625
+ }),
626
+ Schema.Null,
627
+ ])),
628
+ sshPublicKeyIds: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
629
+ secrets: Schema.optional(Schema.Union([
630
+ Schema.Array(Schema.Struct({
631
+ name: Schema.String,
632
+ type: Schema.Literal("env"),
633
+ secret: SensitiveString,
634
+ })),
635
+ Schema.Null,
636
+ ])),
637
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
638
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
639
+ disk: Schema.optional(Schema.Union([
640
+ Schema.Struct({
641
+ size: Schema.String,
642
+ }),
643
+ Schema.Null,
644
+ ])),
645
+ environmentVariables: Schema.optional(Schema.Union([
646
+ Schema.Array(Schema.Struct({
647
+ name: Schema.String,
648
+ value: Schema.String,
649
+ })),
650
+ Schema.Null,
651
+ ])),
652
+ labels: Schema.optional(Schema.Union([
653
+ Schema.Array(Schema.Struct({
654
+ name: Schema.String,
655
+ value: Schema.String,
656
+ })),
657
+ Schema.Null,
658
+ ])),
659
+ network: Schema.optional(Schema.Union([
660
+ Schema.Struct({
661
+ assignIpv4: Schema.optional(Schema.Union([
662
+ Schema.Literals(["none", "predefined", "account"]),
663
+ Schema.Null,
664
+ ])),
665
+ assignIpv6: Schema.optional(Schema.Union([
666
+ Schema.Literals(["none", "predefined", "account"]),
667
+ Schema.Null,
668
+ ])),
669
+ mode: Schema.optional(Schema.Union([
670
+ Schema.Literals(["public", "private"]),
671
+ Schema.Null,
672
+ ])),
673
+ }).pipe(Schema.encodeKeys({
674
+ assignIpv4: "assign_ipv4",
675
+ assignIpv6: "assign_ipv6",
676
+ mode: "mode",
677
+ })),
678
+ Schema.Null,
679
+ ])),
680
+ command: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
681
+ entrypoint: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
682
+ dns: Schema.optional(Schema.Union([
683
+ Schema.Struct({
684
+ servers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
685
+ searches: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
686
+ }),
687
+ Schema.Null,
688
+ ])),
689
+ ports: Schema.optional(Schema.Union([
690
+ Schema.Array(Schema.Struct({
691
+ name: Schema.String,
692
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
693
+ })),
694
+ Schema.Null,
695
+ ])),
696
+ checks: Schema.optional(Schema.Union([
697
+ Schema.Array(Schema.Struct({
698
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
699
+ type: Schema.Literals(["http", "tcp"]),
700
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
701
+ port: Schema.String,
702
+ http: Schema.optional(Schema.Union([
703
+ Schema.Struct({
704
+ method: Schema.optional(Schema.Union([
705
+ Schema.Literals([
706
+ "GET",
707
+ "POST",
708
+ "PUT",
709
+ "PATCH",
710
+ "DELETE",
711
+ "OPTIONS",
712
+ "HEAD",
713
+ ]),
714
+ Schema.Null,
715
+ ])),
716
+ body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
717
+ path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
718
+ headers: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
719
+ }),
720
+ Schema.Null,
721
+ ])),
722
+ interval: Schema.String,
723
+ timeout: Schema.String,
724
+ retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
725
+ kind: Schema.Literals(["health", "ready"]),
726
+ })),
727
+ Schema.Null,
728
+ ])),
729
+ }).pipe(Schema.encodeKeys({
730
+ image: "image",
731
+ instanceType: "instance_type",
732
+ observability: "observability",
733
+ sshPublicKeyIds: "ssh_public_key_ids",
734
+ secrets: "secrets",
735
+ vcpu: "vcpu",
736
+ memory: "memory",
737
+ disk: "disk",
738
+ environmentVariables: "environment_variables",
739
+ labels: "labels",
740
+ network: "network",
741
+ command: "command",
742
+ entrypoint: "entrypoint",
743
+ dns: "dns",
744
+ ports: "ports",
745
+ checks: "checks",
746
+ })),
747
+ durableObjects: Schema.optional(Schema.Union([
748
+ Schema.Struct({
749
+ namespaceId: Schema.String,
750
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
751
+ Schema.Null,
752
+ ])),
753
+ createdAt: Schema.String,
754
+ version: Schema.Number,
755
+ durableObjectNamespaceId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
756
+ health: Schema.Struct({
757
+ instances: Schema.Unknown,
758
+ }),
759
+ })
760
+ .pipe(Schema.encodeKeys({
761
+ id: "id",
762
+ accountId: "account_id",
763
+ name: "name",
764
+ schedulingPolicy: "scheduling_policy",
765
+ instances: "instances",
766
+ maxInstances: "max_instances",
767
+ constraints: "constraints",
768
+ affinities: "affinities",
769
+ configuration: "configuration",
770
+ durableObjects: "durable_objects",
771
+ createdAt: "created_at",
772
+ version: "version",
773
+ durableObjectNamespaceId: "durable_object_namespace_id",
774
+ health: "health",
775
+ }))
776
+ .pipe(T.ResponsePath("result"));
777
+ export const createContainerApplication = API.make(() => ({
778
+ input: CreateContainerApplicationRequest,
779
+ output: CreateContainerApplicationResponse,
780
+ errors: [InvalidRoute, DurableObjectAlreadyHasApplication],
781
+ }));
782
+ export const UpdateContainerApplicationRequest =
783
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
784
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
785
+ applicationId: Schema.String.pipe(T.HttpPath("application_id")),
786
+ instances: Schema.optional(Schema.Number),
787
+ maxInstances: Schema.optional(Schema.Number),
788
+ affinities: Schema.optional(Schema.Struct({
789
+ colocation: Schema.optional(Schema.Literal("datacenter")),
790
+ })),
791
+ schedulingPolicy: Schema.optional(Schema.Literals(["moon", "gpu", "regional", "fill_metals", "default"])),
792
+ constraints: Schema.optional(Schema.Struct({
793
+ tier: Schema.optional(Schema.Number),
794
+ region: Schema.optional(Schema.Literals([
795
+ "AFR",
796
+ "APAC",
797
+ "EEUR",
798
+ "ENAM",
799
+ "WNAM",
800
+ "ME",
801
+ "OC",
802
+ "SAM",
803
+ "WEUR",
804
+ ])),
805
+ regions: Schema.optional(Schema.Array(Schema.Literals([
806
+ "AFR",
807
+ "APAC",
808
+ "EEUR",
809
+ "ENAM",
810
+ "WNAM",
811
+ "ME",
812
+ "OC",
813
+ "SAM",
814
+ "WEUR",
815
+ ]))),
816
+ cities: Schema.optional(Schema.Array(Schema.Literals([
817
+ "AFR",
818
+ "APAC",
819
+ "EEUR",
820
+ "ENAM",
821
+ "WNAM",
822
+ "ME",
823
+ "OC",
824
+ "SAM",
825
+ "WEUR",
826
+ ]))),
827
+ })),
828
+ configuration: Schema.optional(Schema.Struct({
829
+ image: Schema.String,
830
+ instanceType: Schema.optional(Schema.Literals([
831
+ "lite",
832
+ "dev",
833
+ "basic",
834
+ "standard",
835
+ "standard-1",
836
+ "standard-2",
837
+ "standard-3",
838
+ "standard-4",
839
+ ])),
840
+ observability: Schema.optional(Schema.Struct({
841
+ logs: Schema.optional(Schema.Struct({
842
+ enabled: Schema.Boolean,
843
+ })),
844
+ })),
845
+ sshPublicKeyIds: Schema.optional(Schema.Array(Schema.String)),
846
+ secrets: Schema.optional(Schema.Array(Schema.Struct({
847
+ name: Schema.String,
848
+ type: Schema.Literal("env"),
849
+ secret: SensitiveString,
850
+ }))),
851
+ vcpu: Schema.optional(Schema.Number),
852
+ memory: Schema.optional(Schema.String),
853
+ disk: Schema.optional(Schema.Struct({
854
+ size: Schema.String,
855
+ })),
856
+ environmentVariables: Schema.optional(Schema.Array(Schema.Struct({
857
+ name: Schema.String,
858
+ value: Schema.String,
859
+ }))),
860
+ labels: Schema.optional(Schema.Array(Schema.Struct({
861
+ name: Schema.String,
862
+ value: Schema.String,
863
+ }))),
864
+ network: Schema.optional(Schema.Struct({
865
+ assignIpv4: Schema.optional(Schema.Literals(["none", "predefined", "account"])),
866
+ assignIpv6: Schema.optional(Schema.Literals(["none", "predefined", "account"])),
867
+ mode: Schema.optional(Schema.Literals(["public", "private"])),
868
+ }).pipe(Schema.encodeKeys({
869
+ assignIpv4: "assign_ipv4",
870
+ assignIpv6: "assign_ipv6",
871
+ mode: "mode",
872
+ }))),
873
+ command: Schema.optional(Schema.Array(Schema.String)),
874
+ entrypoint: Schema.optional(Schema.Array(Schema.String)),
875
+ dns: Schema.optional(Schema.Struct({
876
+ servers: Schema.optional(Schema.Array(Schema.String)),
877
+ searches: Schema.optional(Schema.Array(Schema.String)),
878
+ })),
879
+ ports: Schema.optional(Schema.Array(Schema.Struct({
880
+ name: Schema.String,
881
+ port: Schema.optional(Schema.Number),
882
+ }))),
883
+ checks: Schema.optional(Schema.Array(Schema.Struct({
884
+ name: Schema.optional(Schema.String),
885
+ type: Schema.Literals(["http", "tcp"]),
886
+ tls: Schema.optional(Schema.Boolean),
887
+ port: Schema.String,
888
+ http: Schema.optional(Schema.Struct({
889
+ method: Schema.optional(Schema.Literals([
890
+ "GET",
891
+ "POST",
892
+ "PUT",
893
+ "PATCH",
894
+ "DELETE",
895
+ "OPTIONS",
896
+ "HEAD",
897
+ ])),
898
+ body: Schema.optional(Schema.String),
899
+ path: Schema.optional(Schema.String),
900
+ headers: Schema.optional(Schema.Unknown),
901
+ })),
902
+ interval: Schema.String,
903
+ timeout: Schema.String,
904
+ retries: Schema.optional(Schema.Number),
905
+ kind: Schema.Literals(["health", "ready"]),
906
+ }))),
907
+ }).pipe(Schema.encodeKeys({
908
+ image: "image",
909
+ instanceType: "instance_type",
910
+ observability: "observability",
911
+ sshPublicKeyIds: "ssh_public_key_ids",
912
+ secrets: "secrets",
913
+ vcpu: "vcpu",
914
+ memory: "memory",
915
+ disk: "disk",
916
+ environmentVariables: "environment_variables",
917
+ labels: "labels",
918
+ network: "network",
919
+ command: "command",
920
+ entrypoint: "entrypoint",
921
+ dns: "dns",
922
+ ports: "ports",
923
+ checks: "checks",
924
+ }))),
925
+ }).pipe(Schema.encodeKeys({
926
+ instances: "instances",
927
+ maxInstances: "max_instances",
928
+ affinities: "affinities",
929
+ schedulingPolicy: "scheduling_policy",
930
+ constraints: "constraints",
931
+ configuration: "configuration",
932
+ }), T.Http({
933
+ method: "PATCH",
934
+ path: "/accounts/{account_id}/containers/applications/{application_id}",
935
+ }));
936
+ export const UpdateContainerApplicationResponse =
937
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
938
+ id: Schema.String,
939
+ accountId: Schema.String,
940
+ name: Schema.String,
941
+ schedulingPolicy: Schema.Literals([
942
+ "moon",
943
+ "gpu",
944
+ "regional",
945
+ "fill_metals",
946
+ "default",
947
+ ]),
948
+ instances: Schema.Number,
949
+ maxInstances: Schema.Number,
950
+ constraints: Schema.Struct({
951
+ tier: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
952
+ }),
953
+ affinities: Schema.optional(Schema.Union([
954
+ Schema.Struct({
955
+ colocation: Schema.optional(Schema.Union([Schema.Literal("datacenter"), Schema.Null])),
956
+ }),
957
+ Schema.Null,
958
+ ])),
959
+ configuration: Schema.Struct({
960
+ image: Schema.String,
961
+ instanceType: Schema.optional(Schema.Union([
962
+ Schema.Literals([
963
+ "lite",
964
+ "dev",
965
+ "basic",
966
+ "standard",
967
+ "standard-1",
968
+ "standard-2",
969
+ "standard-3",
970
+ "standard-4",
971
+ ]),
972
+ Schema.Null,
973
+ ])),
974
+ observability: Schema.optional(Schema.Union([
975
+ Schema.Struct({
976
+ logs: Schema.optional(Schema.Union([
977
+ Schema.Struct({
978
+ enabled: Schema.Boolean,
979
+ }),
980
+ Schema.Null,
981
+ ])),
982
+ }),
983
+ Schema.Null,
984
+ ])),
985
+ sshPublicKeyIds: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
986
+ secrets: Schema.optional(Schema.Union([
987
+ Schema.Array(Schema.Struct({
988
+ name: Schema.String,
989
+ type: Schema.Literal("env"),
990
+ secret: SensitiveString,
991
+ })),
992
+ Schema.Null,
993
+ ])),
994
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
995
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
996
+ disk: Schema.optional(Schema.Union([
997
+ Schema.Struct({
998
+ size: Schema.String,
999
+ }),
1000
+ Schema.Null,
1001
+ ])),
1002
+ environmentVariables: Schema.optional(Schema.Union([
1003
+ Schema.Array(Schema.Struct({
1004
+ name: Schema.String,
1005
+ value: Schema.String,
1006
+ })),
1007
+ Schema.Null,
1008
+ ])),
1009
+ labels: Schema.optional(Schema.Union([
1010
+ Schema.Array(Schema.Struct({
1011
+ name: Schema.String,
1012
+ value: Schema.String,
1013
+ })),
1014
+ Schema.Null,
1015
+ ])),
1016
+ network: Schema.optional(Schema.Union([
1017
+ Schema.Struct({
1018
+ assignIpv4: Schema.optional(Schema.Union([
1019
+ Schema.Literals(["none", "predefined", "account"]),
1020
+ Schema.Null,
1021
+ ])),
1022
+ assignIpv6: Schema.optional(Schema.Union([
1023
+ Schema.Literals(["none", "predefined", "account"]),
1024
+ Schema.Null,
1025
+ ])),
1026
+ mode: Schema.optional(Schema.Union([
1027
+ Schema.Literals(["public", "private"]),
1028
+ Schema.Null,
1029
+ ])),
1030
+ }).pipe(Schema.encodeKeys({
1031
+ assignIpv4: "assign_ipv4",
1032
+ assignIpv6: "assign_ipv6",
1033
+ mode: "mode",
1034
+ })),
1035
+ Schema.Null,
1036
+ ])),
1037
+ command: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1038
+ entrypoint: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1039
+ dns: Schema.optional(Schema.Union([
1040
+ Schema.Struct({
1041
+ servers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1042
+ searches: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1043
+ }),
1044
+ Schema.Null,
1045
+ ])),
1046
+ ports: Schema.optional(Schema.Union([
1047
+ Schema.Array(Schema.Struct({
1048
+ name: Schema.String,
1049
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1050
+ })),
1051
+ Schema.Null,
1052
+ ])),
1053
+ checks: Schema.optional(Schema.Union([
1054
+ Schema.Array(Schema.Struct({
1055
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1056
+ type: Schema.Literals(["http", "tcp"]),
1057
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1058
+ port: Schema.String,
1059
+ http: Schema.optional(Schema.Union([
1060
+ Schema.Struct({
1061
+ method: Schema.optional(Schema.Union([
1062
+ Schema.Literals([
1063
+ "GET",
1064
+ "POST",
1065
+ "PUT",
1066
+ "PATCH",
1067
+ "DELETE",
1068
+ "OPTIONS",
1069
+ "HEAD",
1070
+ ]),
1071
+ Schema.Null,
1072
+ ])),
1073
+ body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1074
+ path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1075
+ headers: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
1076
+ }),
1077
+ Schema.Null,
1078
+ ])),
1079
+ interval: Schema.String,
1080
+ timeout: Schema.String,
1081
+ retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1082
+ kind: Schema.Literals(["health", "ready"]),
1083
+ })),
1084
+ Schema.Null,
1085
+ ])),
1086
+ }).pipe(Schema.encodeKeys({
1087
+ image: "image",
1088
+ instanceType: "instance_type",
1089
+ observability: "observability",
1090
+ sshPublicKeyIds: "ssh_public_key_ids",
1091
+ secrets: "secrets",
1092
+ vcpu: "vcpu",
1093
+ memory: "memory",
1094
+ disk: "disk",
1095
+ environmentVariables: "environment_variables",
1096
+ labels: "labels",
1097
+ network: "network",
1098
+ command: "command",
1099
+ entrypoint: "entrypoint",
1100
+ dns: "dns",
1101
+ ports: "ports",
1102
+ checks: "checks",
1103
+ })),
1104
+ durableObjects: Schema.optional(Schema.Union([
1105
+ Schema.Struct({
1106
+ namespaceId: Schema.String,
1107
+ }).pipe(Schema.encodeKeys({ namespaceId: "namespace_id" })),
1108
+ Schema.Null,
1109
+ ])),
1110
+ createdAt: Schema.String,
1111
+ version: Schema.Number,
1112
+ durableObjectNamespaceId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1113
+ health: Schema.Struct({
1114
+ instances: Schema.Unknown,
1115
+ }),
1116
+ })
1117
+ .pipe(Schema.encodeKeys({
1118
+ id: "id",
1119
+ accountId: "account_id",
1120
+ name: "name",
1121
+ schedulingPolicy: "scheduling_policy",
1122
+ instances: "instances",
1123
+ maxInstances: "max_instances",
1124
+ constraints: "constraints",
1125
+ affinities: "affinities",
1126
+ configuration: "configuration",
1127
+ durableObjects: "durable_objects",
1128
+ createdAt: "created_at",
1129
+ version: "version",
1130
+ durableObjectNamespaceId: "durable_object_namespace_id",
1131
+ health: "health",
1132
+ }))
1133
+ .pipe(T.ResponsePath("result"));
1134
+ export const updateContainerApplication = API.make(() => ({
1135
+ input: UpdateContainerApplicationRequest,
1136
+ output: UpdateContainerApplicationResponse,
1137
+ errors: [InvalidRoute, ContainerApplicationNotFound],
1138
+ }));
1139
+ export const DeleteContainerApplicationRequest =
1140
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1141
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1142
+ applicationId: Schema.String.pipe(T.HttpPath("application_id")),
1143
+ }).pipe(T.Http({
1144
+ method: "DELETE",
1145
+ path: "/accounts/{account_id}/containers/applications/{application_id}",
1146
+ }));
1147
+ export const DeleteContainerApplicationResponse =
1148
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
1149
+ export const deleteContainerApplication = API.make(() => ({
1150
+ input: DeleteContainerApplicationRequest,
1151
+ output: DeleteContainerApplicationResponse,
1152
+ errors: [InvalidRoute, ContainerApplicationNotFound],
1153
+ }));
1154
+ export const CreateContainerApplicationRolloutRequest =
1155
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1156
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1157
+ applicationId: Schema.String.pipe(T.HttpPath("application_id")),
1158
+ description: Schema.String,
1159
+ strategy: Schema.Literal("rolling"),
1160
+ kind: Schema.optional(Schema.Literal("full_auto")),
1161
+ stepPercentage: Schema.Number,
1162
+ targetConfiguration: Schema.Struct({
1163
+ image: Schema.String,
1164
+ instanceType: Schema.optional(Schema.Literals([
1165
+ "lite",
1166
+ "dev",
1167
+ "basic",
1168
+ "standard",
1169
+ "standard-1",
1170
+ "standard-2",
1171
+ "standard-3",
1172
+ "standard-4",
1173
+ ])),
1174
+ observability: Schema.optional(Schema.Struct({
1175
+ logs: Schema.optional(Schema.Struct({
1176
+ enabled: Schema.Boolean,
1177
+ })),
1178
+ })),
1179
+ sshPublicKeyIds: Schema.optional(Schema.Array(Schema.String)),
1180
+ secrets: Schema.optional(Schema.Array(Schema.Struct({
1181
+ name: Schema.String,
1182
+ type: Schema.Literal("env"),
1183
+ secret: SensitiveString,
1184
+ }))),
1185
+ vcpu: Schema.optional(Schema.Number),
1186
+ memory: Schema.optional(Schema.String),
1187
+ disk: Schema.optional(Schema.Struct({
1188
+ size: Schema.String,
1189
+ })),
1190
+ environmentVariables: Schema.optional(Schema.Array(Schema.Struct({
1191
+ name: Schema.String,
1192
+ value: Schema.String,
1193
+ }))),
1194
+ labels: Schema.optional(Schema.Array(Schema.Struct({
1195
+ name: Schema.String,
1196
+ value: Schema.String,
1197
+ }))),
1198
+ network: Schema.optional(Schema.Struct({
1199
+ assignIpv4: Schema.optional(Schema.Literals(["none", "predefined", "account"])),
1200
+ assignIpv6: Schema.optional(Schema.Literals(["none", "predefined", "account"])),
1201
+ mode: Schema.optional(Schema.Literals(["public", "private"])),
1202
+ }).pipe(Schema.encodeKeys({
1203
+ assignIpv4: "assign_ipv4",
1204
+ assignIpv6: "assign_ipv6",
1205
+ mode: "mode",
1206
+ }))),
1207
+ command: Schema.optional(Schema.Array(Schema.String)),
1208
+ entrypoint: Schema.optional(Schema.Array(Schema.String)),
1209
+ dns: Schema.optional(Schema.Struct({
1210
+ servers: Schema.optional(Schema.Array(Schema.String)),
1211
+ searches: Schema.optional(Schema.Array(Schema.String)),
1212
+ })),
1213
+ ports: Schema.optional(Schema.Array(Schema.Struct({
1214
+ name: Schema.String,
1215
+ port: Schema.optional(Schema.Number),
1216
+ }))),
1217
+ checks: Schema.optional(Schema.Array(Schema.Struct({
1218
+ name: Schema.optional(Schema.String),
1219
+ type: Schema.Literals(["http", "tcp"]),
1220
+ tls: Schema.optional(Schema.Boolean),
1221
+ port: Schema.String,
1222
+ http: Schema.optional(Schema.Struct({
1223
+ method: Schema.optional(Schema.Literals([
1224
+ "GET",
1225
+ "POST",
1226
+ "PUT",
1227
+ "PATCH",
1228
+ "DELETE",
1229
+ "OPTIONS",
1230
+ "HEAD",
1231
+ ])),
1232
+ body: Schema.optional(Schema.String),
1233
+ path: Schema.optional(Schema.String),
1234
+ headers: Schema.optional(Schema.Unknown),
1235
+ })),
1236
+ interval: Schema.String,
1237
+ timeout: Schema.String,
1238
+ retries: Schema.optional(Schema.Number),
1239
+ kind: Schema.Literals(["health", "ready"]),
1240
+ }))),
1241
+ }).pipe(Schema.encodeKeys({
1242
+ image: "image",
1243
+ instanceType: "instance_type",
1244
+ observability: "observability",
1245
+ sshPublicKeyIds: "ssh_public_key_ids",
1246
+ secrets: "secrets",
1247
+ vcpu: "vcpu",
1248
+ memory: "memory",
1249
+ disk: "disk",
1250
+ environmentVariables: "environment_variables",
1251
+ labels: "labels",
1252
+ network: "network",
1253
+ command: "command",
1254
+ entrypoint: "entrypoint",
1255
+ dns: "dns",
1256
+ ports: "ports",
1257
+ checks: "checks",
1258
+ })),
1259
+ }).pipe(Schema.encodeKeys({
1260
+ description: "description",
1261
+ strategy: "strategy",
1262
+ kind: "kind",
1263
+ stepPercentage: "step_percentage",
1264
+ targetConfiguration: "target_configuration",
1265
+ }), T.Http({
1266
+ method: "POST",
1267
+ path: "/accounts/{account_id}/containers/applications/{application_id}/rollouts",
1268
+ }));
1269
+ export const CreateContainerApplicationRolloutResponse =
1270
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1271
+ id: Schema.String,
1272
+ createdAt: Schema.String,
1273
+ lastUpdatedAt: Schema.String,
1274
+ description: Schema.String,
1275
+ status: Schema.Literals(["progressing", "completed", "failed"]),
1276
+ health: Schema.Struct({
1277
+ instances: Schema.Struct({
1278
+ healthy: Schema.Number,
1279
+ failed: Schema.Number,
1280
+ starting: Schema.Number,
1281
+ scheduling: Schema.Number,
1282
+ }),
1283
+ }),
1284
+ kind: Schema.Literal("full_auto"),
1285
+ strategy: Schema.Literal("rolling"),
1286
+ currentConfiguration: Schema.Struct({
1287
+ image: Schema.String,
1288
+ observability: Schema.optional(Schema.Union([
1289
+ Schema.Struct({
1290
+ logs: Schema.optional(Schema.Union([
1291
+ Schema.Struct({
1292
+ enabled: Schema.Boolean,
1293
+ }),
1294
+ Schema.Null,
1295
+ ])),
1296
+ }),
1297
+ Schema.Null,
1298
+ ])),
1299
+ }),
1300
+ targetConfiguration: Schema.Struct({
1301
+ image: Schema.String,
1302
+ instanceType: Schema.optional(Schema.Union([
1303
+ Schema.Literals([
1304
+ "lite",
1305
+ "dev",
1306
+ "basic",
1307
+ "standard",
1308
+ "standard-1",
1309
+ "standard-2",
1310
+ "standard-3",
1311
+ "standard-4",
1312
+ ]),
1313
+ Schema.Null,
1314
+ ])),
1315
+ observability: Schema.optional(Schema.Union([
1316
+ Schema.Struct({
1317
+ logs: Schema.optional(Schema.Union([
1318
+ Schema.Struct({
1319
+ enabled: Schema.Boolean,
1320
+ }),
1321
+ Schema.Null,
1322
+ ])),
1323
+ }),
1324
+ Schema.Null,
1325
+ ])),
1326
+ sshPublicKeyIds: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1327
+ secrets: Schema.optional(Schema.Union([
1328
+ Schema.Array(Schema.Struct({
1329
+ name: Schema.String,
1330
+ type: Schema.Literal("env"),
1331
+ secret: SensitiveString,
1332
+ })),
1333
+ Schema.Null,
1334
+ ])),
1335
+ vcpu: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1336
+ memory: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1337
+ disk: Schema.optional(Schema.Union([
1338
+ Schema.Struct({
1339
+ size: Schema.String,
1340
+ }),
1341
+ Schema.Null,
1342
+ ])),
1343
+ environmentVariables: Schema.optional(Schema.Union([
1344
+ Schema.Array(Schema.Struct({
1345
+ name: Schema.String,
1346
+ value: Schema.String,
1347
+ })),
1348
+ Schema.Null,
1349
+ ])),
1350
+ labels: Schema.optional(Schema.Union([
1351
+ Schema.Array(Schema.Struct({
1352
+ name: Schema.String,
1353
+ value: Schema.String,
1354
+ })),
1355
+ Schema.Null,
1356
+ ])),
1357
+ network: Schema.optional(Schema.Union([
1358
+ Schema.Struct({
1359
+ assignIpv4: Schema.optional(Schema.Union([
1360
+ Schema.Literals(["none", "predefined", "account"]),
1361
+ Schema.Null,
1362
+ ])),
1363
+ assignIpv6: Schema.optional(Schema.Union([
1364
+ Schema.Literals(["none", "predefined", "account"]),
1365
+ Schema.Null,
1366
+ ])),
1367
+ mode: Schema.optional(Schema.Union([
1368
+ Schema.Literals(["public", "private"]),
1369
+ Schema.Null,
1370
+ ])),
1371
+ }).pipe(Schema.encodeKeys({
1372
+ assignIpv4: "assign_ipv4",
1373
+ assignIpv6: "assign_ipv6",
1374
+ mode: "mode",
1375
+ })),
1376
+ Schema.Null,
1377
+ ])),
1378
+ command: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1379
+ entrypoint: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1380
+ dns: Schema.optional(Schema.Union([
1381
+ Schema.Struct({
1382
+ servers: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1383
+ searches: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1384
+ }),
1385
+ Schema.Null,
1386
+ ])),
1387
+ ports: Schema.optional(Schema.Union([
1388
+ Schema.Array(Schema.Struct({
1389
+ name: Schema.String,
1390
+ port: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1391
+ })),
1392
+ Schema.Null,
1393
+ ])),
1394
+ checks: Schema.optional(Schema.Union([
1395
+ Schema.Array(Schema.Struct({
1396
+ name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1397
+ type: Schema.Literals(["http", "tcp"]),
1398
+ tls: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1399
+ port: Schema.String,
1400
+ http: Schema.optional(Schema.Union([
1401
+ Schema.Struct({
1402
+ method: Schema.optional(Schema.Union([
1403
+ Schema.Literals([
1404
+ "GET",
1405
+ "POST",
1406
+ "PUT",
1407
+ "PATCH",
1408
+ "DELETE",
1409
+ "OPTIONS",
1410
+ "HEAD",
1411
+ ]),
1412
+ Schema.Null,
1413
+ ])),
1414
+ body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1415
+ path: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1416
+ headers: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
1417
+ }),
1418
+ Schema.Null,
1419
+ ])),
1420
+ interval: Schema.String,
1421
+ timeout: Schema.String,
1422
+ retries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1423
+ kind: Schema.Literals(["health", "ready"]),
1424
+ })),
1425
+ Schema.Null,
1426
+ ])),
1427
+ }).pipe(Schema.encodeKeys({
1428
+ image: "image",
1429
+ instanceType: "instance_type",
1430
+ observability: "observability",
1431
+ sshPublicKeyIds: "ssh_public_key_ids",
1432
+ secrets: "secrets",
1433
+ vcpu: "vcpu",
1434
+ memory: "memory",
1435
+ disk: "disk",
1436
+ environmentVariables: "environment_variables",
1437
+ labels: "labels",
1438
+ network: "network",
1439
+ command: "command",
1440
+ entrypoint: "entrypoint",
1441
+ dns: "dns",
1442
+ ports: "ports",
1443
+ checks: "checks",
1444
+ })),
1445
+ currentVersion: Schema.Number,
1446
+ targetVersion: Schema.Number,
1447
+ steps: Schema.Array(Schema.Struct({
1448
+ id: Schema.Number,
1449
+ status: Schema.Literals([
1450
+ "progressing",
1451
+ "pending",
1452
+ "completed",
1453
+ "failed",
1454
+ ]),
1455
+ stepSize: Schema.Struct({
1456
+ percentage: Schema.Number,
1457
+ }),
1458
+ description: Schema.String,
1459
+ startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1460
+ }).pipe(Schema.encodeKeys({
1461
+ id: "id",
1462
+ status: "status",
1463
+ stepSize: "step_size",
1464
+ description: "description",
1465
+ startedAt: "started_at",
1466
+ }))),
1467
+ progress: Schema.Struct({
1468
+ totalSteps: Schema.Number,
1469
+ currentStep: Schema.Number,
1470
+ updatedInstances: Schema.Number,
1471
+ totalInstances: Schema.Number,
1472
+ }).pipe(Schema.encodeKeys({
1473
+ totalSteps: "total_steps",
1474
+ currentStep: "current_step",
1475
+ updatedInstances: "updated_instances",
1476
+ totalInstances: "total_instances",
1477
+ })),
1478
+ })
1479
+ .pipe(Schema.encodeKeys({
1480
+ id: "id",
1481
+ createdAt: "created_at",
1482
+ lastUpdatedAt: "last_updated_at",
1483
+ description: "description",
1484
+ status: "status",
1485
+ health: "health",
1486
+ kind: "kind",
1487
+ strategy: "strategy",
1488
+ currentConfiguration: "current_configuration",
1489
+ targetConfiguration: "target_configuration",
1490
+ currentVersion: "current_version",
1491
+ targetVersion: "target_version",
1492
+ steps: "steps",
1493
+ progress: "progress",
1494
+ }))
1495
+ .pipe(T.ResponsePath("result"));
1496
+ export const createContainerApplicationRollout = API.make(() => ({
1497
+ input: CreateContainerApplicationRolloutRequest,
1498
+ output: CreateContainerApplicationRolloutResponse,
1499
+ errors: [InvalidRoute, ContainerApplicationNotFound],
1500
+ }));
1501
+ export const GetContainerIdentityRequest =
1502
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1503
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1504
+ }).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/containers/me" }));
1505
+ export const GetContainerIdentityResponse =
1506
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1507
+ accountId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1508
+ externalAccountId: Schema.String,
1509
+ legacyIdentity: Schema.String,
1510
+ capabilities: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1511
+ limits: Schema.Struct({
1512
+ accountId: Schema.String,
1513
+ vcpuPerDeployment: Schema.Number,
1514
+ memoryMibPerDeployment: Schema.Number,
1515
+ memoryPerDeployment: Schema.String,
1516
+ diskPerDeployment: Schema.String,
1517
+ diskMbPerDeployment: Schema.Number,
1518
+ totalVcpu: Schema.Number,
1519
+ totalMemoryMib: Schema.Number,
1520
+ nodeGroup: Schema.String,
1521
+ ipv4s: Schema.Number,
1522
+ networkModes: Schema.Array(Schema.String),
1523
+ totalDiskMb: Schema.Number,
1524
+ totalMemory: Schema.String,
1525
+ }).pipe(Schema.encodeKeys({
1526
+ accountId: "account_id",
1527
+ vcpuPerDeployment: "vcpu_per_deployment",
1528
+ memoryMibPerDeployment: "memory_mib_per_deployment",
1529
+ memoryPerDeployment: "memory_per_deployment",
1530
+ diskPerDeployment: "disk_per_deployment",
1531
+ diskMbPerDeployment: "disk_mb_per_deployment",
1532
+ totalVcpu: "total_vcpu",
1533
+ totalMemoryMib: "total_memory_mib",
1534
+ nodeGroup: "node_group",
1535
+ ipv4s: "ipv4s",
1536
+ networkModes: "network_modes",
1537
+ totalDiskMb: "total_disk_mb",
1538
+ totalMemory: "total_memory",
1539
+ })),
1540
+ locations: Schema.Array(Schema.Unknown),
1541
+ defaults: Schema.Struct({
1542
+ vcpus: Schema.Number,
1543
+ memoryMib: Schema.Number,
1544
+ memory: Schema.String,
1545
+ diskMb: Schema.Number,
1546
+ }).pipe(Schema.encodeKeys({
1547
+ vcpus: "vcpus",
1548
+ memoryMib: "memory_mib",
1549
+ memory: "memory",
1550
+ diskMb: "disk_mb",
1551
+ })),
1552
+ })
1553
+ .pipe(Schema.encodeKeys({
1554
+ accountId: "account_id",
1555
+ externalAccountId: "external_account_id",
1556
+ legacyIdentity: "legacy_identity",
1557
+ capabilities: "capabilities",
1558
+ limits: "limits",
1559
+ locations: "locations",
1560
+ defaults: "defaults",
1561
+ }))
1562
+ .pipe(T.ResponsePath("result"));
1563
+ export const getContainerIdentity = API.make(() => ({
1564
+ input: GetContainerIdentityRequest,
1565
+ output: GetContainerIdentityResponse,
1566
+ errors: [InvalidRoute],
1567
+ }));
1568
+ export const CreateContainerRegistryCredentialsRequest =
1569
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1570
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1571
+ registryId: Schema.String.pipe(T.HttpPath("registry_id")),
1572
+ permissions: Schema.Array(Schema.Literals(["pull", "push"])),
1573
+ expirationMinutes: Schema.Number,
1574
+ }).pipe(Schema.encodeKeys({
1575
+ permissions: "permissions",
1576
+ expirationMinutes: "expiration_minutes",
1577
+ }), T.Http({
1578
+ method: "POST",
1579
+ path: "/accounts/{account_id}/containers/registries/{registry_id}/credentials",
1580
+ }));
1581
+ export const CreateContainerRegistryCredentialsResponse =
1582
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1583
+ user: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1584
+ username: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1585
+ password: Schema.String,
1586
+ }).pipe(T.ResponsePath("result"));
1587
+ export const createContainerRegistryCredentials = API.make(() => ({
1588
+ input: CreateContainerRegistryCredentialsRequest,
1589
+ output: CreateContainerRegistryCredentialsResponse,
1590
+ errors: [InvalidRoute],
1591
+ }));
1592
+ //# sourceMappingURL=containers.js.map