@treeseed/sdk 0.13.0-rc.72 → 0.13.0-rc.73
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/.treeseed-build-complete.json +1 -1
- package/dist/deployment/hosted-topology.d.ts +617 -26
- package/dist/deployment/hosted-topology.js +46 -13
- package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +46 -0
- package/dist/operator-contracts/control-plane-operations.d.ts +46 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"completedAt":"2026-09-
|
|
1
|
+
{"completedAt":"2026-09-02T03:14:56.048Z"}
|
|
@@ -321,19 +321,122 @@ export declare const hostedResourceObservationSchema: z.ZodObject<{
|
|
|
321
321
|
observedDigest: string | null;
|
|
322
322
|
observedAt: string;
|
|
323
323
|
}>;
|
|
324
|
-
export declare const hostedTopologyPlanSchema: z.ZodObject<{
|
|
325
|
-
schemaVersion: z.ZodLiteral<"treeseed.hosted-topology-plan/v1">;
|
|
326
|
-
planId: z.ZodString;
|
|
327
|
-
planDigest: z.ZodString;
|
|
328
|
-
declarationDigest: z.ZodString;
|
|
329
|
-
topologyId: z.ZodString;
|
|
330
|
-
environment: z.ZodEnum<["staging", "production"]>;
|
|
331
|
-
platformCommit: z.ZodString;
|
|
332
|
-
actions: z.ZodArray<z.ZodObject<{
|
|
324
|
+
export declare const hostedTopologyPlanSchema: z.ZodEffects<z.ZodObject<{
|
|
325
|
+
readonly schemaVersion: z.ZodLiteral<"treeseed.hosted-topology-plan/v1">;
|
|
326
|
+
readonly planId: z.ZodString;
|
|
327
|
+
readonly planDigest: z.ZodString;
|
|
328
|
+
readonly declarationDigest: z.ZodString;
|
|
329
|
+
readonly topologyId: z.ZodString;
|
|
330
|
+
readonly environment: z.ZodEnum<["staging", "production"]>;
|
|
331
|
+
readonly platformCommit: z.ZodString;
|
|
332
|
+
readonly actions: z.ZodArray<z.ZodObject<{
|
|
333
333
|
resourceId: z.ZodString;
|
|
334
334
|
provider: z.ZodEnum<["cloudflare", "railway"]>;
|
|
335
335
|
kind: z.ZodEnum<["admin-application", "dns-record", "tls-policy", "api-proxy", "control-plane-api", "postgresql", "operations-runner", "treedx-service"]>;
|
|
336
336
|
action: z.ZodEnum<["create", "adopt", "update", "noop"]>;
|
|
337
|
+
desiredResource: z.ZodObject<{
|
|
338
|
+
id: z.ZodString;
|
|
339
|
+
provider: z.ZodEnum<["cloudflare", "railway"]>;
|
|
340
|
+
kind: z.ZodEnum<["admin-application", "dns-record", "tls-policy", "api-proxy", "control-plane-api", "postgresql", "operations-runner", "treedx-service"]>;
|
|
341
|
+
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
342
|
+
parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
343
|
+
input: z.ZodString;
|
|
344
|
+
}, "strict", z.ZodTypeAny, {
|
|
345
|
+
input: string;
|
|
346
|
+
}, {
|
|
347
|
+
input: string;
|
|
348
|
+
}>, z.ZodObject<{
|
|
349
|
+
artifact: z.ZodString;
|
|
350
|
+
}, "strict", z.ZodTypeAny, {
|
|
351
|
+
artifact: string;
|
|
352
|
+
}, {
|
|
353
|
+
artifact: string;
|
|
354
|
+
}>, z.ZodObject<{
|
|
355
|
+
resourceOutput: z.ZodObject<{
|
|
356
|
+
resourceId: z.ZodString;
|
|
357
|
+
output: z.ZodString;
|
|
358
|
+
}, "strict", z.ZodTypeAny, {
|
|
359
|
+
resourceId: string;
|
|
360
|
+
output: string;
|
|
361
|
+
}, {
|
|
362
|
+
resourceId: string;
|
|
363
|
+
output: string;
|
|
364
|
+
}>;
|
|
365
|
+
}, "strict", z.ZodTypeAny, {
|
|
366
|
+
resourceOutput: {
|
|
367
|
+
resourceId: string;
|
|
368
|
+
output: string;
|
|
369
|
+
};
|
|
370
|
+
}, {
|
|
371
|
+
resourceOutput: {
|
|
372
|
+
resourceId: string;
|
|
373
|
+
output: string;
|
|
374
|
+
};
|
|
375
|
+
}>, z.ZodObject<{
|
|
376
|
+
literal: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
377
|
+
}, "strict", z.ZodTypeAny, {
|
|
378
|
+
literal: string | number | boolean;
|
|
379
|
+
}, {
|
|
380
|
+
literal: string | number | boolean;
|
|
381
|
+
}>]>>>;
|
|
382
|
+
adoption: z.ZodObject<{
|
|
383
|
+
mode: z.ZodLiteral<"adopt-or-create">;
|
|
384
|
+
externalIdInput: z.ZodOptional<z.ZodString>;
|
|
385
|
+
replacement: z.ZodLiteral<"forbidden">;
|
|
386
|
+
}, "strict", z.ZodTypeAny, {
|
|
387
|
+
mode: "adopt-or-create";
|
|
388
|
+
replacement: "forbidden";
|
|
389
|
+
externalIdInput?: string | undefined;
|
|
390
|
+
}, {
|
|
391
|
+
mode: "adopt-or-create";
|
|
392
|
+
replacement: "forbidden";
|
|
393
|
+
externalIdInput?: string | undefined;
|
|
394
|
+
}>;
|
|
395
|
+
}, "strict", z.ZodTypeAny, {
|
|
396
|
+
id: string;
|
|
397
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
398
|
+
provider: "cloudflare" | "railway";
|
|
399
|
+
dependsOn: string[];
|
|
400
|
+
parameters: Record<string, {
|
|
401
|
+
input: string;
|
|
402
|
+
} | {
|
|
403
|
+
artifact: string;
|
|
404
|
+
} | {
|
|
405
|
+
resourceOutput: {
|
|
406
|
+
resourceId: string;
|
|
407
|
+
output: string;
|
|
408
|
+
};
|
|
409
|
+
} | {
|
|
410
|
+
literal: string | number | boolean;
|
|
411
|
+
}>;
|
|
412
|
+
adoption: {
|
|
413
|
+
mode: "adopt-or-create";
|
|
414
|
+
replacement: "forbidden";
|
|
415
|
+
externalIdInput?: string | undefined;
|
|
416
|
+
};
|
|
417
|
+
}, {
|
|
418
|
+
id: string;
|
|
419
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
420
|
+
provider: "cloudflare" | "railway";
|
|
421
|
+
adoption: {
|
|
422
|
+
mode: "adopt-or-create";
|
|
423
|
+
replacement: "forbidden";
|
|
424
|
+
externalIdInput?: string | undefined;
|
|
425
|
+
};
|
|
426
|
+
dependsOn?: string[] | undefined;
|
|
427
|
+
parameters?: Record<string, {
|
|
428
|
+
input: string;
|
|
429
|
+
} | {
|
|
430
|
+
artifact: string;
|
|
431
|
+
} | {
|
|
432
|
+
resourceOutput: {
|
|
433
|
+
resourceId: string;
|
|
434
|
+
output: string;
|
|
435
|
+
};
|
|
436
|
+
} | {
|
|
437
|
+
literal: string | number | boolean;
|
|
438
|
+
}> | undefined;
|
|
439
|
+
}>;
|
|
337
440
|
desiredDigest: z.ZodString;
|
|
338
441
|
previousDigest: z.ZodNullable<z.ZodString>;
|
|
339
442
|
providerResourceId: z.ZodNullable<z.ZodString>;
|
|
@@ -343,6 +446,29 @@ export declare const hostedTopologyPlanSchema: z.ZodObject<{
|
|
|
343
446
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
344
447
|
provider: "cloudflare" | "railway";
|
|
345
448
|
providerResourceId: string | null;
|
|
449
|
+
desiredResource: {
|
|
450
|
+
id: string;
|
|
451
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
452
|
+
provider: "cloudflare" | "railway";
|
|
453
|
+
dependsOn: string[];
|
|
454
|
+
parameters: Record<string, {
|
|
455
|
+
input: string;
|
|
456
|
+
} | {
|
|
457
|
+
artifact: string;
|
|
458
|
+
} | {
|
|
459
|
+
resourceOutput: {
|
|
460
|
+
resourceId: string;
|
|
461
|
+
output: string;
|
|
462
|
+
};
|
|
463
|
+
} | {
|
|
464
|
+
literal: string | number | boolean;
|
|
465
|
+
}>;
|
|
466
|
+
adoption: {
|
|
467
|
+
mode: "adopt-or-create";
|
|
468
|
+
replacement: "forbidden";
|
|
469
|
+
externalIdInput?: string | undefined;
|
|
470
|
+
};
|
|
471
|
+
};
|
|
346
472
|
desiredDigest: string;
|
|
347
473
|
previousDigest: string | null;
|
|
348
474
|
}, {
|
|
@@ -351,10 +477,33 @@ export declare const hostedTopologyPlanSchema: z.ZodObject<{
|
|
|
351
477
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
352
478
|
provider: "cloudflare" | "railway";
|
|
353
479
|
providerResourceId: string | null;
|
|
480
|
+
desiredResource: {
|
|
481
|
+
id: string;
|
|
482
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
483
|
+
provider: "cloudflare" | "railway";
|
|
484
|
+
adoption: {
|
|
485
|
+
mode: "adopt-or-create";
|
|
486
|
+
replacement: "forbidden";
|
|
487
|
+
externalIdInput?: string | undefined;
|
|
488
|
+
};
|
|
489
|
+
dependsOn?: string[] | undefined;
|
|
490
|
+
parameters?: Record<string, {
|
|
491
|
+
input: string;
|
|
492
|
+
} | {
|
|
493
|
+
artifact: string;
|
|
494
|
+
} | {
|
|
495
|
+
resourceOutput: {
|
|
496
|
+
resourceId: string;
|
|
497
|
+
output: string;
|
|
498
|
+
};
|
|
499
|
+
} | {
|
|
500
|
+
literal: string | number | boolean;
|
|
501
|
+
}> | undefined;
|
|
502
|
+
};
|
|
354
503
|
desiredDigest: string;
|
|
355
504
|
previousDigest: string | null;
|
|
356
505
|
}>, "many">;
|
|
357
|
-
blockers: z.ZodArray<z.ZodObject<{
|
|
506
|
+
readonly blockers: z.ZodArray<z.ZodObject<{
|
|
358
507
|
code: z.ZodEnum<["connection-unavailable", "dependency-cycle", "observation-unhealthy", "adoption-drift"]>;
|
|
359
508
|
resourceId: z.ZodOptional<z.ZodString>;
|
|
360
509
|
message: z.ZodString;
|
|
@@ -367,8 +516,8 @@ export declare const hostedTopologyPlanSchema: z.ZodObject<{
|
|
|
367
516
|
message: string;
|
|
368
517
|
resourceId?: string | undefined;
|
|
369
518
|
}>, "many">;
|
|
370
|
-
approvalRequired: z.ZodBoolean;
|
|
371
|
-
executable: z.ZodLiteral<false>;
|
|
519
|
+
readonly approvalRequired: z.ZodBoolean;
|
|
520
|
+
readonly executable: z.ZodLiteral<false>;
|
|
372
521
|
}, "strict", z.ZodTypeAny, {
|
|
373
522
|
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
374
523
|
blockers: {
|
|
@@ -383,6 +532,123 @@ export declare const hostedTopologyPlanSchema: z.ZodObject<{
|
|
|
383
532
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
384
533
|
provider: "cloudflare" | "railway";
|
|
385
534
|
providerResourceId: string | null;
|
|
535
|
+
desiredResource: {
|
|
536
|
+
id: string;
|
|
537
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
538
|
+
provider: "cloudflare" | "railway";
|
|
539
|
+
dependsOn: string[];
|
|
540
|
+
parameters: Record<string, {
|
|
541
|
+
input: string;
|
|
542
|
+
} | {
|
|
543
|
+
artifact: string;
|
|
544
|
+
} | {
|
|
545
|
+
resourceOutput: {
|
|
546
|
+
resourceId: string;
|
|
547
|
+
output: string;
|
|
548
|
+
};
|
|
549
|
+
} | {
|
|
550
|
+
literal: string | number | boolean;
|
|
551
|
+
}>;
|
|
552
|
+
adoption: {
|
|
553
|
+
mode: "adopt-or-create";
|
|
554
|
+
replacement: "forbidden";
|
|
555
|
+
externalIdInput?: string | undefined;
|
|
556
|
+
};
|
|
557
|
+
};
|
|
558
|
+
desiredDigest: string;
|
|
559
|
+
previousDigest: string | null;
|
|
560
|
+
}[];
|
|
561
|
+
environment: "production" | "staging";
|
|
562
|
+
executable: false;
|
|
563
|
+
planId: string;
|
|
564
|
+
declarationDigest: string;
|
|
565
|
+
topologyId: string;
|
|
566
|
+
platformCommit: string;
|
|
567
|
+
approvalRequired: boolean;
|
|
568
|
+
}, {
|
|
569
|
+
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
570
|
+
blockers: {
|
|
571
|
+
code: "connection-unavailable" | "dependency-cycle" | "observation-unhealthy" | "adoption-drift";
|
|
572
|
+
message: string;
|
|
573
|
+
resourceId?: string | undefined;
|
|
574
|
+
}[];
|
|
575
|
+
planDigest: string;
|
|
576
|
+
actions: {
|
|
577
|
+
action: "noop" | "create" | "adopt" | "update";
|
|
578
|
+
resourceId: string;
|
|
579
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
580
|
+
provider: "cloudflare" | "railway";
|
|
581
|
+
providerResourceId: string | null;
|
|
582
|
+
desiredResource: {
|
|
583
|
+
id: string;
|
|
584
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
585
|
+
provider: "cloudflare" | "railway";
|
|
586
|
+
adoption: {
|
|
587
|
+
mode: "adopt-or-create";
|
|
588
|
+
replacement: "forbidden";
|
|
589
|
+
externalIdInput?: string | undefined;
|
|
590
|
+
};
|
|
591
|
+
dependsOn?: string[] | undefined;
|
|
592
|
+
parameters?: Record<string, {
|
|
593
|
+
input: string;
|
|
594
|
+
} | {
|
|
595
|
+
artifact: string;
|
|
596
|
+
} | {
|
|
597
|
+
resourceOutput: {
|
|
598
|
+
resourceId: string;
|
|
599
|
+
output: string;
|
|
600
|
+
};
|
|
601
|
+
} | {
|
|
602
|
+
literal: string | number | boolean;
|
|
603
|
+
}> | undefined;
|
|
604
|
+
};
|
|
605
|
+
desiredDigest: string;
|
|
606
|
+
previousDigest: string | null;
|
|
607
|
+
}[];
|
|
608
|
+
environment: "production" | "staging";
|
|
609
|
+
executable: false;
|
|
610
|
+
planId: string;
|
|
611
|
+
declarationDigest: string;
|
|
612
|
+
topologyId: string;
|
|
613
|
+
platformCommit: string;
|
|
614
|
+
approvalRequired: boolean;
|
|
615
|
+
}>, {
|
|
616
|
+
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
617
|
+
blockers: {
|
|
618
|
+
code: "connection-unavailable" | "dependency-cycle" | "observation-unhealthy" | "adoption-drift";
|
|
619
|
+
message: string;
|
|
620
|
+
resourceId?: string | undefined;
|
|
621
|
+
}[];
|
|
622
|
+
planDigest: string;
|
|
623
|
+
actions: {
|
|
624
|
+
action: "noop" | "create" | "adopt" | "update";
|
|
625
|
+
resourceId: string;
|
|
626
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
627
|
+
provider: "cloudflare" | "railway";
|
|
628
|
+
providerResourceId: string | null;
|
|
629
|
+
desiredResource: {
|
|
630
|
+
id: string;
|
|
631
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
632
|
+
provider: "cloudflare" | "railway";
|
|
633
|
+
dependsOn: string[];
|
|
634
|
+
parameters: Record<string, {
|
|
635
|
+
input: string;
|
|
636
|
+
} | {
|
|
637
|
+
artifact: string;
|
|
638
|
+
} | {
|
|
639
|
+
resourceOutput: {
|
|
640
|
+
resourceId: string;
|
|
641
|
+
output: string;
|
|
642
|
+
};
|
|
643
|
+
} | {
|
|
644
|
+
literal: string | number | boolean;
|
|
645
|
+
}>;
|
|
646
|
+
adoption: {
|
|
647
|
+
mode: "adopt-or-create";
|
|
648
|
+
replacement: "forbidden";
|
|
649
|
+
externalIdInput?: string | undefined;
|
|
650
|
+
};
|
|
651
|
+
};
|
|
386
652
|
desiredDigest: string;
|
|
387
653
|
previousDigest: string | null;
|
|
388
654
|
}[];
|
|
@@ -407,6 +673,29 @@ export declare const hostedTopologyPlanSchema: z.ZodObject<{
|
|
|
407
673
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
408
674
|
provider: "cloudflare" | "railway";
|
|
409
675
|
providerResourceId: string | null;
|
|
676
|
+
desiredResource: {
|
|
677
|
+
id: string;
|
|
678
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
679
|
+
provider: "cloudflare" | "railway";
|
|
680
|
+
adoption: {
|
|
681
|
+
mode: "adopt-or-create";
|
|
682
|
+
replacement: "forbidden";
|
|
683
|
+
externalIdInput?: string | undefined;
|
|
684
|
+
};
|
|
685
|
+
dependsOn?: string[] | undefined;
|
|
686
|
+
parameters?: Record<string, {
|
|
687
|
+
input: string;
|
|
688
|
+
} | {
|
|
689
|
+
artifact: string;
|
|
690
|
+
} | {
|
|
691
|
+
resourceOutput: {
|
|
692
|
+
resourceId: string;
|
|
693
|
+
output: string;
|
|
694
|
+
};
|
|
695
|
+
} | {
|
|
696
|
+
literal: string | number | boolean;
|
|
697
|
+
}> | undefined;
|
|
698
|
+
};
|
|
410
699
|
desiredDigest: string;
|
|
411
700
|
previousDigest: string | null;
|
|
412
701
|
}[];
|
|
@@ -440,7 +729,30 @@ export declare const hostedTopologyApprovalSchema: z.ZodObject<{
|
|
|
440
729
|
approvedBy: string;
|
|
441
730
|
approvedAt: string;
|
|
442
731
|
}>;
|
|
443
|
-
export declare const authorizedHostedTopologyPlanSchema: z.ZodObject<Omit<{
|
|
732
|
+
export declare const authorizedHostedTopologyPlanSchema: z.ZodEffects<z.ZodObject<Omit<{
|
|
733
|
+
executable: z.ZodLiteral<true>;
|
|
734
|
+
approval: z.ZodNullable<z.ZodObject<{
|
|
735
|
+
schemaVersion: z.ZodLiteral<"treeseed.hosted-topology-approval/v1">;
|
|
736
|
+
planDigest: z.ZodString;
|
|
737
|
+
environment: z.ZodEnum<["staging", "production"]>;
|
|
738
|
+
decision: z.ZodLiteral<"approved">;
|
|
739
|
+
approvedBy: z.ZodString;
|
|
740
|
+
approvedAt: z.ZodString;
|
|
741
|
+
}, "strict", z.ZodTypeAny, {
|
|
742
|
+
schemaVersion: "treeseed.hosted-topology-approval/v1";
|
|
743
|
+
planDigest: string;
|
|
744
|
+
environment: "production" | "staging";
|
|
745
|
+
decision: "approved";
|
|
746
|
+
approvedBy: string;
|
|
747
|
+
approvedAt: string;
|
|
748
|
+
}, {
|
|
749
|
+
schemaVersion: "treeseed.hosted-topology-approval/v1";
|
|
750
|
+
planDigest: string;
|
|
751
|
+
environment: "production" | "staging";
|
|
752
|
+
decision: "approved";
|
|
753
|
+
approvedBy: string;
|
|
754
|
+
approvedAt: string;
|
|
755
|
+
}>>;
|
|
444
756
|
schemaVersion: z.ZodLiteral<"treeseed.hosted-topology-plan/v1">;
|
|
445
757
|
planId: z.ZodString;
|
|
446
758
|
planDigest: z.ZodString;
|
|
@@ -453,6 +765,109 @@ export declare const authorizedHostedTopologyPlanSchema: z.ZodObject<Omit<{
|
|
|
453
765
|
provider: z.ZodEnum<["cloudflare", "railway"]>;
|
|
454
766
|
kind: z.ZodEnum<["admin-application", "dns-record", "tls-policy", "api-proxy", "control-plane-api", "postgresql", "operations-runner", "treedx-service"]>;
|
|
455
767
|
action: z.ZodEnum<["create", "adopt", "update", "noop"]>;
|
|
768
|
+
desiredResource: z.ZodObject<{
|
|
769
|
+
id: z.ZodString;
|
|
770
|
+
provider: z.ZodEnum<["cloudflare", "railway"]>;
|
|
771
|
+
kind: z.ZodEnum<["admin-application", "dns-record", "tls-policy", "api-proxy", "control-plane-api", "postgresql", "operations-runner", "treedx-service"]>;
|
|
772
|
+
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
773
|
+
parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
774
|
+
input: z.ZodString;
|
|
775
|
+
}, "strict", z.ZodTypeAny, {
|
|
776
|
+
input: string;
|
|
777
|
+
}, {
|
|
778
|
+
input: string;
|
|
779
|
+
}>, z.ZodObject<{
|
|
780
|
+
artifact: z.ZodString;
|
|
781
|
+
}, "strict", z.ZodTypeAny, {
|
|
782
|
+
artifact: string;
|
|
783
|
+
}, {
|
|
784
|
+
artifact: string;
|
|
785
|
+
}>, z.ZodObject<{
|
|
786
|
+
resourceOutput: z.ZodObject<{
|
|
787
|
+
resourceId: z.ZodString;
|
|
788
|
+
output: z.ZodString;
|
|
789
|
+
}, "strict", z.ZodTypeAny, {
|
|
790
|
+
resourceId: string;
|
|
791
|
+
output: string;
|
|
792
|
+
}, {
|
|
793
|
+
resourceId: string;
|
|
794
|
+
output: string;
|
|
795
|
+
}>;
|
|
796
|
+
}, "strict", z.ZodTypeAny, {
|
|
797
|
+
resourceOutput: {
|
|
798
|
+
resourceId: string;
|
|
799
|
+
output: string;
|
|
800
|
+
};
|
|
801
|
+
}, {
|
|
802
|
+
resourceOutput: {
|
|
803
|
+
resourceId: string;
|
|
804
|
+
output: string;
|
|
805
|
+
};
|
|
806
|
+
}>, z.ZodObject<{
|
|
807
|
+
literal: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
808
|
+
}, "strict", z.ZodTypeAny, {
|
|
809
|
+
literal: string | number | boolean;
|
|
810
|
+
}, {
|
|
811
|
+
literal: string | number | boolean;
|
|
812
|
+
}>]>>>;
|
|
813
|
+
adoption: z.ZodObject<{
|
|
814
|
+
mode: z.ZodLiteral<"adopt-or-create">;
|
|
815
|
+
externalIdInput: z.ZodOptional<z.ZodString>;
|
|
816
|
+
replacement: z.ZodLiteral<"forbidden">;
|
|
817
|
+
}, "strict", z.ZodTypeAny, {
|
|
818
|
+
mode: "adopt-or-create";
|
|
819
|
+
replacement: "forbidden";
|
|
820
|
+
externalIdInput?: string | undefined;
|
|
821
|
+
}, {
|
|
822
|
+
mode: "adopt-or-create";
|
|
823
|
+
replacement: "forbidden";
|
|
824
|
+
externalIdInput?: string | undefined;
|
|
825
|
+
}>;
|
|
826
|
+
}, "strict", z.ZodTypeAny, {
|
|
827
|
+
id: string;
|
|
828
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
829
|
+
provider: "cloudflare" | "railway";
|
|
830
|
+
dependsOn: string[];
|
|
831
|
+
parameters: Record<string, {
|
|
832
|
+
input: string;
|
|
833
|
+
} | {
|
|
834
|
+
artifact: string;
|
|
835
|
+
} | {
|
|
836
|
+
resourceOutput: {
|
|
837
|
+
resourceId: string;
|
|
838
|
+
output: string;
|
|
839
|
+
};
|
|
840
|
+
} | {
|
|
841
|
+
literal: string | number | boolean;
|
|
842
|
+
}>;
|
|
843
|
+
adoption: {
|
|
844
|
+
mode: "adopt-or-create";
|
|
845
|
+
replacement: "forbidden";
|
|
846
|
+
externalIdInput?: string | undefined;
|
|
847
|
+
};
|
|
848
|
+
}, {
|
|
849
|
+
id: string;
|
|
850
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
851
|
+
provider: "cloudflare" | "railway";
|
|
852
|
+
adoption: {
|
|
853
|
+
mode: "adopt-or-create";
|
|
854
|
+
replacement: "forbidden";
|
|
855
|
+
externalIdInput?: string | undefined;
|
|
856
|
+
};
|
|
857
|
+
dependsOn?: string[] | undefined;
|
|
858
|
+
parameters?: Record<string, {
|
|
859
|
+
input: string;
|
|
860
|
+
} | {
|
|
861
|
+
artifact: string;
|
|
862
|
+
} | {
|
|
863
|
+
resourceOutput: {
|
|
864
|
+
resourceId: string;
|
|
865
|
+
output: string;
|
|
866
|
+
};
|
|
867
|
+
} | {
|
|
868
|
+
literal: string | number | boolean;
|
|
869
|
+
}> | undefined;
|
|
870
|
+
}>;
|
|
456
871
|
desiredDigest: z.ZodString;
|
|
457
872
|
previousDigest: z.ZodNullable<z.ZodString>;
|
|
458
873
|
providerResourceId: z.ZodNullable<z.ZodString>;
|
|
@@ -462,6 +877,29 @@ export declare const authorizedHostedTopologyPlanSchema: z.ZodObject<Omit<{
|
|
|
462
877
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
463
878
|
provider: "cloudflare" | "railway";
|
|
464
879
|
providerResourceId: string | null;
|
|
880
|
+
desiredResource: {
|
|
881
|
+
id: string;
|
|
882
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
883
|
+
provider: "cloudflare" | "railway";
|
|
884
|
+
dependsOn: string[];
|
|
885
|
+
parameters: Record<string, {
|
|
886
|
+
input: string;
|
|
887
|
+
} | {
|
|
888
|
+
artifact: string;
|
|
889
|
+
} | {
|
|
890
|
+
resourceOutput: {
|
|
891
|
+
resourceId: string;
|
|
892
|
+
output: string;
|
|
893
|
+
};
|
|
894
|
+
} | {
|
|
895
|
+
literal: string | number | boolean;
|
|
896
|
+
}>;
|
|
897
|
+
adoption: {
|
|
898
|
+
mode: "adopt-or-create";
|
|
899
|
+
replacement: "forbidden";
|
|
900
|
+
externalIdInput?: string | undefined;
|
|
901
|
+
};
|
|
902
|
+
};
|
|
465
903
|
desiredDigest: string;
|
|
466
904
|
previousDigest: string | null;
|
|
467
905
|
}, {
|
|
@@ -470,6 +908,29 @@ export declare const authorizedHostedTopologyPlanSchema: z.ZodObject<Omit<{
|
|
|
470
908
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
471
909
|
provider: "cloudflare" | "railway";
|
|
472
910
|
providerResourceId: string | null;
|
|
911
|
+
desiredResource: {
|
|
912
|
+
id: string;
|
|
913
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
914
|
+
provider: "cloudflare" | "railway";
|
|
915
|
+
adoption: {
|
|
916
|
+
mode: "adopt-or-create";
|
|
917
|
+
replacement: "forbidden";
|
|
918
|
+
externalIdInput?: string | undefined;
|
|
919
|
+
};
|
|
920
|
+
dependsOn?: string[] | undefined;
|
|
921
|
+
parameters?: Record<string, {
|
|
922
|
+
input: string;
|
|
923
|
+
} | {
|
|
924
|
+
artifact: string;
|
|
925
|
+
} | {
|
|
926
|
+
resourceOutput: {
|
|
927
|
+
resourceId: string;
|
|
928
|
+
output: string;
|
|
929
|
+
};
|
|
930
|
+
} | {
|
|
931
|
+
literal: string | number | boolean;
|
|
932
|
+
}> | undefined;
|
|
933
|
+
};
|
|
473
934
|
desiredDigest: string;
|
|
474
935
|
previousDigest: string | null;
|
|
475
936
|
}>, "many">;
|
|
@@ -487,31 +948,115 @@ export declare const authorizedHostedTopologyPlanSchema: z.ZodObject<Omit<{
|
|
|
487
948
|
resourceId?: string | undefined;
|
|
488
949
|
}>, "many">;
|
|
489
950
|
approvalRequired: z.ZodBoolean;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
951
|
+
}, "approvalRequired">, "strict", z.ZodTypeAny, {
|
|
952
|
+
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
953
|
+
blockers: {
|
|
954
|
+
code: "connection-unavailable" | "dependency-cycle" | "observation-unhealthy" | "adoption-drift";
|
|
955
|
+
message: string;
|
|
956
|
+
resourceId?: string | undefined;
|
|
957
|
+
}[];
|
|
958
|
+
planDigest: string;
|
|
959
|
+
actions: {
|
|
960
|
+
action: "noop" | "create" | "adopt" | "update";
|
|
961
|
+
resourceId: string;
|
|
962
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
963
|
+
provider: "cloudflare" | "railway";
|
|
964
|
+
providerResourceId: string | null;
|
|
965
|
+
desiredResource: {
|
|
966
|
+
id: string;
|
|
967
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
968
|
+
provider: "cloudflare" | "railway";
|
|
969
|
+
dependsOn: string[];
|
|
970
|
+
parameters: Record<string, {
|
|
971
|
+
input: string;
|
|
972
|
+
} | {
|
|
973
|
+
artifact: string;
|
|
974
|
+
} | {
|
|
975
|
+
resourceOutput: {
|
|
976
|
+
resourceId: string;
|
|
977
|
+
output: string;
|
|
978
|
+
};
|
|
979
|
+
} | {
|
|
980
|
+
literal: string | number | boolean;
|
|
981
|
+
}>;
|
|
982
|
+
adoption: {
|
|
983
|
+
mode: "adopt-or-create";
|
|
984
|
+
replacement: "forbidden";
|
|
985
|
+
externalIdInput?: string | undefined;
|
|
986
|
+
};
|
|
987
|
+
};
|
|
988
|
+
desiredDigest: string;
|
|
989
|
+
previousDigest: string | null;
|
|
990
|
+
}[];
|
|
991
|
+
environment: "production" | "staging";
|
|
992
|
+
executable: true;
|
|
993
|
+
planId: string;
|
|
994
|
+
declarationDigest: string;
|
|
995
|
+
topologyId: string;
|
|
996
|
+
platformCommit: string;
|
|
997
|
+
approval: {
|
|
500
998
|
schemaVersion: "treeseed.hosted-topology-approval/v1";
|
|
501
999
|
planDigest: string;
|
|
502
1000
|
environment: "production" | "staging";
|
|
503
1001
|
decision: "approved";
|
|
504
1002
|
approvedBy: string;
|
|
505
1003
|
approvedAt: string;
|
|
506
|
-
}
|
|
1004
|
+
} | null;
|
|
1005
|
+
}, {
|
|
1006
|
+
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
1007
|
+
blockers: {
|
|
1008
|
+
code: "connection-unavailable" | "dependency-cycle" | "observation-unhealthy" | "adoption-drift";
|
|
1009
|
+
message: string;
|
|
1010
|
+
resourceId?: string | undefined;
|
|
1011
|
+
}[];
|
|
1012
|
+
planDigest: string;
|
|
1013
|
+
actions: {
|
|
1014
|
+
action: "noop" | "create" | "adopt" | "update";
|
|
1015
|
+
resourceId: string;
|
|
1016
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
1017
|
+
provider: "cloudflare" | "railway";
|
|
1018
|
+
providerResourceId: string | null;
|
|
1019
|
+
desiredResource: {
|
|
1020
|
+
id: string;
|
|
1021
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
1022
|
+
provider: "cloudflare" | "railway";
|
|
1023
|
+
adoption: {
|
|
1024
|
+
mode: "adopt-or-create";
|
|
1025
|
+
replacement: "forbidden";
|
|
1026
|
+
externalIdInput?: string | undefined;
|
|
1027
|
+
};
|
|
1028
|
+
dependsOn?: string[] | undefined;
|
|
1029
|
+
parameters?: Record<string, {
|
|
1030
|
+
input: string;
|
|
1031
|
+
} | {
|
|
1032
|
+
artifact: string;
|
|
1033
|
+
} | {
|
|
1034
|
+
resourceOutput: {
|
|
1035
|
+
resourceId: string;
|
|
1036
|
+
output: string;
|
|
1037
|
+
};
|
|
1038
|
+
} | {
|
|
1039
|
+
literal: string | number | boolean;
|
|
1040
|
+
}> | undefined;
|
|
1041
|
+
};
|
|
1042
|
+
desiredDigest: string;
|
|
1043
|
+
previousDigest: string | null;
|
|
1044
|
+
}[];
|
|
1045
|
+
environment: "production" | "staging";
|
|
1046
|
+
executable: true;
|
|
1047
|
+
planId: string;
|
|
1048
|
+
declarationDigest: string;
|
|
1049
|
+
topologyId: string;
|
|
1050
|
+
platformCommit: string;
|
|
1051
|
+
approval: {
|
|
507
1052
|
schemaVersion: "treeseed.hosted-topology-approval/v1";
|
|
508
1053
|
planDigest: string;
|
|
509
1054
|
environment: "production" | "staging";
|
|
510
1055
|
decision: "approved";
|
|
511
1056
|
approvedBy: string;
|
|
512
1057
|
approvedAt: string;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
1058
|
+
} | null;
|
|
1059
|
+
}>, {
|
|
515
1060
|
schemaVersion: "treeseed.hosted-topology-plan/v1";
|
|
516
1061
|
blockers: {
|
|
517
1062
|
code: "connection-unavailable" | "dependency-cycle" | "observation-unhealthy" | "adoption-drift";
|
|
@@ -525,6 +1070,29 @@ export declare const authorizedHostedTopologyPlanSchema: z.ZodObject<Omit<{
|
|
|
525
1070
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
526
1071
|
provider: "cloudflare" | "railway";
|
|
527
1072
|
providerResourceId: string | null;
|
|
1073
|
+
desiredResource: {
|
|
1074
|
+
id: string;
|
|
1075
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
1076
|
+
provider: "cloudflare" | "railway";
|
|
1077
|
+
dependsOn: string[];
|
|
1078
|
+
parameters: Record<string, {
|
|
1079
|
+
input: string;
|
|
1080
|
+
} | {
|
|
1081
|
+
artifact: string;
|
|
1082
|
+
} | {
|
|
1083
|
+
resourceOutput: {
|
|
1084
|
+
resourceId: string;
|
|
1085
|
+
output: string;
|
|
1086
|
+
};
|
|
1087
|
+
} | {
|
|
1088
|
+
literal: string | number | boolean;
|
|
1089
|
+
}>;
|
|
1090
|
+
adoption: {
|
|
1091
|
+
mode: "adopt-or-create";
|
|
1092
|
+
replacement: "forbidden";
|
|
1093
|
+
externalIdInput?: string | undefined;
|
|
1094
|
+
};
|
|
1095
|
+
};
|
|
528
1096
|
desiredDigest: string;
|
|
529
1097
|
previousDigest: string | null;
|
|
530
1098
|
}[];
|
|
@@ -556,6 +1124,29 @@ export declare const authorizedHostedTopologyPlanSchema: z.ZodObject<Omit<{
|
|
|
556
1124
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
557
1125
|
provider: "cloudflare" | "railway";
|
|
558
1126
|
providerResourceId: string | null;
|
|
1127
|
+
desiredResource: {
|
|
1128
|
+
id: string;
|
|
1129
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
1130
|
+
provider: "cloudflare" | "railway";
|
|
1131
|
+
adoption: {
|
|
1132
|
+
mode: "adopt-or-create";
|
|
1133
|
+
replacement: "forbidden";
|
|
1134
|
+
externalIdInput?: string | undefined;
|
|
1135
|
+
};
|
|
1136
|
+
dependsOn?: string[] | undefined;
|
|
1137
|
+
parameters?: Record<string, {
|
|
1138
|
+
input: string;
|
|
1139
|
+
} | {
|
|
1140
|
+
artifact: string;
|
|
1141
|
+
} | {
|
|
1142
|
+
resourceOutput: {
|
|
1143
|
+
resourceId: string;
|
|
1144
|
+
output: string;
|
|
1145
|
+
};
|
|
1146
|
+
} | {
|
|
1147
|
+
literal: string | number | boolean;
|
|
1148
|
+
}> | undefined;
|
|
1149
|
+
};
|
|
559
1150
|
desiredDigest: string;
|
|
560
1151
|
previousDigest: string | null;
|
|
561
1152
|
}[];
|
|
@@ -27,6 +27,14 @@ const resourceProviderKinds = {
|
|
|
27
27
|
};
|
|
28
28
|
const sensitiveKey = /(?:credential|password|private.?key|registration.?code|secret|token)/iu;
|
|
29
29
|
const personalPath = /(?:^|[\s'"`:=])(?:\/home\/[^/\s]+|\/Users\/[^/\s]+|[A-Za-z]:\\Users\\[^\\\s]+)/u;
|
|
30
|
+
const hostedResourceDeclarationSchema = z.object({
|
|
31
|
+
id: identifier,
|
|
32
|
+
provider: hostedProviderSchema,
|
|
33
|
+
kind: hostedResourceKindSchema,
|
|
34
|
+
dependsOn: z.array(identifier).default([]),
|
|
35
|
+
parameters: z.record(identifier, parameterSchema).default({}),
|
|
36
|
+
adoption: z.object({ mode: z.literal("adopt-or-create"), externalIdInput: identifier.optional(), replacement: z.literal("forbidden") }).strict()
|
|
37
|
+
}).strict();
|
|
30
38
|
const hostedTopologyDeclarationSchema = z.object({
|
|
31
39
|
schemaVersion: z.literal("treeseed.hosted-topology/v1"),
|
|
32
40
|
id: identifier,
|
|
@@ -35,14 +43,7 @@ const hostedTopologyDeclarationSchema = z.object({
|
|
|
35
43
|
platform: z.object({ repository: z.literal("treeseed-ai/platform"), commit: gitCommit }).strict(),
|
|
36
44
|
providerConnections: z.record(hostedProviderSchema, z.object({ connectionRef: identifier }).strict()),
|
|
37
45
|
artifacts: z.record(identifier, z.object({ digest, source: z.string().url() }).strict()),
|
|
38
|
-
resources: z.array(
|
|
39
|
-
id: identifier,
|
|
40
|
-
provider: hostedProviderSchema,
|
|
41
|
-
kind: hostedResourceKindSchema,
|
|
42
|
-
dependsOn: z.array(identifier).default([]),
|
|
43
|
-
parameters: z.record(identifier, parameterSchema).default({}),
|
|
44
|
-
adoption: z.object({ mode: z.literal("adopt-or-create"), externalIdInput: identifier.optional(), replacement: z.literal("forbidden") }).strict()
|
|
45
|
-
}).strict()).min(1)
|
|
46
|
+
resources: z.array(hostedResourceDeclarationSchema).min(1)
|
|
46
47
|
}).strict().superRefine((declaration, context) => {
|
|
47
48
|
const ids = declaration.resources.map(({ id }) => id);
|
|
48
49
|
if (new Set(ids).size !== ids.length) context.addIssue({ code: z.ZodIssueCode.custom, path: ["resources"], message: "Hosted topology resource identities must be unique." });
|
|
@@ -63,7 +64,7 @@ const hostedResourceObservationSchema = z.object({
|
|
|
63
64
|
observedDigest: digest.nullable(),
|
|
64
65
|
observedAt: timestamp
|
|
65
66
|
}).strict();
|
|
66
|
-
const
|
|
67
|
+
const hostedTopologyPlanShape = {
|
|
67
68
|
schemaVersion: z.literal("treeseed.hosted-topology-plan/v1"),
|
|
68
69
|
planId: z.string().regex(/^topology-plan-[a-f0-9]{16}$/u),
|
|
69
70
|
planDigest: digest,
|
|
@@ -76,6 +77,7 @@ const hostedTopologyPlanSchema = z.object({
|
|
|
76
77
|
provider: hostedProviderSchema,
|
|
77
78
|
kind: hostedResourceKindSchema,
|
|
78
79
|
action: z.enum(["create", "adopt", "update", "noop"]),
|
|
80
|
+
desiredResource: hostedResourceDeclarationSchema,
|
|
79
81
|
desiredDigest: digest,
|
|
80
82
|
previousDigest: digest.nullable(),
|
|
81
83
|
providerResourceId: z.string().min(1).max(512).nullable()
|
|
@@ -83,7 +85,28 @@ const hostedTopologyPlanSchema = z.object({
|
|
|
83
85
|
blockers: z.array(z.object({ code: z.enum(["connection-unavailable", "dependency-cycle", "observation-unhealthy", "adoption-drift"]), resourceId: identifier.optional(), message: z.string().min(1) }).strict()),
|
|
84
86
|
approvalRequired: z.boolean(),
|
|
85
87
|
executable: z.literal(false)
|
|
86
|
-
}
|
|
88
|
+
};
|
|
89
|
+
function verifyPlanBinding(plan, context) {
|
|
90
|
+
for (const [index, action] of plan.actions.entries()) {
|
|
91
|
+
const desired = hostedResourceDeclarationSchema.parse(action.desiredResource);
|
|
92
|
+
if (desired.id !== action.resourceId || desired.provider !== action.provider || desired.kind !== action.kind)
|
|
93
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["actions", index, "desiredResource"], message: "Hosted plan action identity must match its desired resource specification." });
|
|
94
|
+
if (deploymentDigest(desired) !== action.desiredDigest)
|
|
95
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["actions", index, "desiredDigest"], message: "Hosted plan desired digest must bind its complete desired resource specification." });
|
|
96
|
+
}
|
|
97
|
+
const core = {
|
|
98
|
+
declarationDigest: plan.declarationDigest,
|
|
99
|
+
topologyId: plan.topologyId,
|
|
100
|
+
environment: plan.environment,
|
|
101
|
+
platformCommit: plan.platformCommit,
|
|
102
|
+
actions: plan.actions,
|
|
103
|
+
blockers: plan.blockers
|
|
104
|
+
};
|
|
105
|
+
const expected = deploymentDigest(core);
|
|
106
|
+
if (expected !== plan.planDigest || plan.planId !== `topology-plan-${expected.slice(7, 23)}`)
|
|
107
|
+
context.addIssue({ code: z.ZodIssueCode.custom, path: ["planDigest"], message: "Hosted topology plan identity must bind the exact canonical plan." });
|
|
108
|
+
}
|
|
109
|
+
const hostedTopologyPlanSchema = z.object(hostedTopologyPlanShape).strict().superRefine(verifyPlanBinding);
|
|
87
110
|
const hostedTopologyApprovalSchema = z.object({
|
|
88
111
|
schemaVersion: z.literal("treeseed.hosted-topology-approval/v1"),
|
|
89
112
|
planDigest: digest,
|
|
@@ -92,10 +115,11 @@ const hostedTopologyApprovalSchema = z.object({
|
|
|
92
115
|
approvedBy: z.string().min(1).max(256),
|
|
93
116
|
approvedAt: timestamp
|
|
94
117
|
}).strict();
|
|
95
|
-
const authorizedHostedTopologyPlanSchema =
|
|
118
|
+
const authorizedHostedTopologyPlanSchema = z.object({
|
|
119
|
+
...hostedTopologyPlanShape,
|
|
96
120
|
executable: z.literal(true),
|
|
97
121
|
approval: hostedTopologyApprovalSchema.nullable()
|
|
98
|
-
}).omit({ approvalRequired: true });
|
|
122
|
+
}).strict().omit({ approvalRequired: true }).superRefine(verifyPlanBinding);
|
|
99
123
|
const hostedTopologyReceiptSchema = z.object({
|
|
100
124
|
schemaVersion: z.literal("treeseed.hosted-topology-receipt/v1"),
|
|
101
125
|
receiptId: z.string().regex(/^topology-receipt-[a-f0-9]{16}$/u),
|
|
@@ -182,7 +206,16 @@ function planHostedTopology(input) {
|
|
|
182
206
|
else if (observation.managedBy === "external") blockers.push({ code: "adoption-drift", resourceId: resource.id, message: `External resource ${resource.id} differs from the declaration and cannot be replaced.` });
|
|
183
207
|
else action = "update";
|
|
184
208
|
}
|
|
185
|
-
return {
|
|
209
|
+
return {
|
|
210
|
+
resourceId: resource.id,
|
|
211
|
+
provider: resource.provider,
|
|
212
|
+
kind: resource.kind,
|
|
213
|
+
action,
|
|
214
|
+
desiredResource: resource,
|
|
215
|
+
desiredDigest,
|
|
216
|
+
previousDigest: observation?.observedDigest ?? null,
|
|
217
|
+
providerResourceId: observation?.providerResourceId ?? null
|
|
218
|
+
};
|
|
186
219
|
});
|
|
187
220
|
const declarationDigest = deploymentDigest(normalizedDeclaration);
|
|
188
221
|
const core = { declarationDigest, topologyId: declaration.id, environment: declaration.environment, platformCommit: declaration.platform.commit, actions, blockers };
|
|
@@ -56,6 +56,29 @@ export declare const HOSTED_TOPOLOGY_OPERATIONS: {
|
|
|
56
56
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
57
57
|
provider: "cloudflare" | "railway";
|
|
58
58
|
providerResourceId: string | null;
|
|
59
|
+
desiredResource: {
|
|
60
|
+
id: string;
|
|
61
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
62
|
+
provider: "cloudflare" | "railway";
|
|
63
|
+
adoption: {
|
|
64
|
+
mode: "adopt-or-create";
|
|
65
|
+
replacement: "forbidden";
|
|
66
|
+
externalIdInput?: string | undefined;
|
|
67
|
+
};
|
|
68
|
+
dependsOn?: string[] | undefined;
|
|
69
|
+
parameters?: Record<string, {
|
|
70
|
+
input: string;
|
|
71
|
+
} | {
|
|
72
|
+
artifact: string;
|
|
73
|
+
} | {
|
|
74
|
+
resourceOutput: {
|
|
75
|
+
resourceId: string;
|
|
76
|
+
output: string;
|
|
77
|
+
};
|
|
78
|
+
} | {
|
|
79
|
+
literal: string | number | boolean;
|
|
80
|
+
}> | undefined;
|
|
81
|
+
};
|
|
59
82
|
desiredDigest: string;
|
|
60
83
|
previousDigest: string | null;
|
|
61
84
|
}[];
|
|
@@ -92,6 +115,29 @@ export declare const HOSTED_TOPOLOGY_OPERATIONS: {
|
|
|
92
115
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
93
116
|
provider: "cloudflare" | "railway";
|
|
94
117
|
providerResourceId: string | null;
|
|
118
|
+
desiredResource: {
|
|
119
|
+
id: string;
|
|
120
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
121
|
+
provider: "cloudflare" | "railway";
|
|
122
|
+
adoption: {
|
|
123
|
+
mode: "adopt-or-create";
|
|
124
|
+
replacement: "forbidden";
|
|
125
|
+
externalIdInput?: string | undefined;
|
|
126
|
+
};
|
|
127
|
+
dependsOn?: string[] | undefined;
|
|
128
|
+
parameters?: Record<string, {
|
|
129
|
+
input: string;
|
|
130
|
+
} | {
|
|
131
|
+
artifact: string;
|
|
132
|
+
} | {
|
|
133
|
+
resourceOutput: {
|
|
134
|
+
resourceId: string;
|
|
135
|
+
output: string;
|
|
136
|
+
};
|
|
137
|
+
} | {
|
|
138
|
+
literal: string | number | boolean;
|
|
139
|
+
}> | undefined;
|
|
140
|
+
};
|
|
95
141
|
desiredDigest: string;
|
|
96
142
|
previousDigest: string | null;
|
|
97
143
|
}[];
|
|
@@ -59,6 +59,29 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
59
59
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
60
60
|
provider: "cloudflare" | "railway";
|
|
61
61
|
providerResourceId: string | null;
|
|
62
|
+
desiredResource: {
|
|
63
|
+
id: string;
|
|
64
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
65
|
+
provider: "cloudflare" | "railway";
|
|
66
|
+
adoption: {
|
|
67
|
+
mode: "adopt-or-create";
|
|
68
|
+
replacement: "forbidden";
|
|
69
|
+
externalIdInput?: string | undefined;
|
|
70
|
+
};
|
|
71
|
+
dependsOn?: string[] | undefined;
|
|
72
|
+
parameters?: Record<string, {
|
|
73
|
+
input: string;
|
|
74
|
+
} | {
|
|
75
|
+
artifact: string;
|
|
76
|
+
} | {
|
|
77
|
+
resourceOutput: {
|
|
78
|
+
resourceId: string;
|
|
79
|
+
output: string;
|
|
80
|
+
};
|
|
81
|
+
} | {
|
|
82
|
+
literal: string | number | boolean;
|
|
83
|
+
}> | undefined;
|
|
84
|
+
};
|
|
62
85
|
desiredDigest: string;
|
|
63
86
|
previousDigest: string | null;
|
|
64
87
|
}[];
|
|
@@ -95,6 +118,29 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
95
118
|
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
96
119
|
provider: "cloudflare" | "railway";
|
|
97
120
|
providerResourceId: string | null;
|
|
121
|
+
desiredResource: {
|
|
122
|
+
id: string;
|
|
123
|
+
kind: "admin-application" | "dns-record" | "tls-policy" | "api-proxy" | "control-plane-api" | "postgresql" | "operations-runner" | "treedx-service";
|
|
124
|
+
provider: "cloudflare" | "railway";
|
|
125
|
+
adoption: {
|
|
126
|
+
mode: "adopt-or-create";
|
|
127
|
+
replacement: "forbidden";
|
|
128
|
+
externalIdInput?: string | undefined;
|
|
129
|
+
};
|
|
130
|
+
dependsOn?: string[] | undefined;
|
|
131
|
+
parameters?: Record<string, {
|
|
132
|
+
input: string;
|
|
133
|
+
} | {
|
|
134
|
+
artifact: string;
|
|
135
|
+
} | {
|
|
136
|
+
resourceOutput: {
|
|
137
|
+
resourceId: string;
|
|
138
|
+
output: string;
|
|
139
|
+
};
|
|
140
|
+
} | {
|
|
141
|
+
literal: string | number | boolean;
|
|
142
|
+
}> | undefined;
|
|
143
|
+
};
|
|
98
144
|
desiredDigest: string;
|
|
99
145
|
previousDigest: string | null;
|
|
100
146
|
}[];
|