@fabrika/provider-zerops 0.9.0-dev.3 → 0.9.0-dev.5

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.
Files changed (81) hide show
  1. package/package.json +10 -9
  2. package/src/api/client.ts +12 -0
  3. package/src/api/readers.ts +29 -0
  4. package/src/api/types.ts +52 -0
  5. package/src/api.ts +2 -0
  6. package/src/cli.ts +11 -0
  7. package/src/collaborators.ts +0 -14
  8. package/src/compile.ts +1 -1
  9. package/src/control.ts +9 -57
  10. package/src/execution.ts +63 -185
  11. package/src/index.ts +2 -0
  12. package/src/installation/admin.ts +1 -1
  13. package/src/installation/deploy-options.ts +1 -2
  14. package/src/installation/deploy.ts +225 -80
  15. package/src/installation/generated/platform-console-schema.ts +3 -0
  16. package/src/installation/generated/platform-proxy-manifest.ts +1 -1
  17. package/src/installation/guide.md +48 -18
  18. package/src/installation/hosts.ts +1 -7
  19. package/src/installation/index.ts +13 -16
  20. package/src/installation/init-options.ts +2 -1
  21. package/src/installation/install-environment.ts +47 -108
  22. package/src/installation/install-options.ts +3 -1
  23. package/src/installation/install-secrets.ts +24 -68
  24. package/src/installation/install.ts +9 -4
  25. package/src/installation/sidecar.ts +5 -26
  26. package/src/installation/topology/setups.ts +15 -4
  27. package/src/installation/topology/topology.ts +31 -21
  28. package/src/installation/upgrade-options.ts +2 -2
  29. package/src/managed-env.ts +1 -174
  30. package/src/manifest.ts +2 -9
  31. package/src/namespace/claims.ts +56 -1
  32. package/src/namespace/errors.ts +1 -1
  33. package/src/namespace/manifest.ts +6 -19
  34. package/src/namespace/provisioning.ts +20 -2
  35. package/src/namespace/proxy-attempt.ts +14 -2
  36. package/src/namespace/proxy-reads.ts +12 -22
  37. package/src/namespace/types.ts +2 -0
  38. package/src/namespace-cli.ts +152 -0
  39. package/src/plan.ts +1 -6
  40. package/src/provider.ts +88 -126
  41. package/src/proxy-manifest-carrier.ts +18 -0
  42. package/src/types.ts +0 -2
  43. package/types/src/api/readers.d.ts +148 -10
  44. package/types/src/api/types.d.ts +49 -0
  45. package/types/src/api.d.ts +1 -1
  46. package/types/src/cli.d.ts +3 -0
  47. package/types/src/collaborators.d.ts +0 -2
  48. package/types/src/compile.d.ts +1 -1
  49. package/types/src/control.d.ts +3 -4
  50. package/types/src/execution.d.ts +5 -17
  51. package/types/src/index.d.ts +1 -1
  52. package/types/src/installation/deploy-options.d.ts +1 -1
  53. package/types/src/installation/deploy.d.ts +40 -0
  54. package/types/src/installation/generated/platform-proxy-manifest.d.ts +1 -1
  55. package/types/src/installation/hosts.d.ts +1 -5
  56. package/types/src/installation/index.d.ts +0 -2
  57. package/types/src/installation/install-environment.d.ts +11 -18
  58. package/types/src/installation/install-secrets.d.ts +3 -16
  59. package/types/src/installation/sidecar.d.ts +0 -2
  60. package/types/src/installation/topology/installation-schemas.d.ts +84 -84
  61. package/types/src/installation/topology/setups.d.ts +2 -1
  62. package/types/src/installation/topology/topology.d.ts +15 -10
  63. package/types/src/managed-env.d.ts +0 -33
  64. package/types/src/manifest.d.ts +0 -2
  65. package/types/src/namespace/claims.d.ts +14 -1
  66. package/types/src/namespace/codec.d.ts +4 -4
  67. package/types/src/namespace/errors.d.ts +1 -1
  68. package/types/src/namespace/proxy-attempt.d.ts +3 -0
  69. package/types/src/namespace/proxy-reads.d.ts +4 -15
  70. package/types/src/namespace/types.d.ts +2 -0
  71. package/types/src/namespace-cli.d.ts +2 -0
  72. package/types/src/plan.d.ts +2 -3
  73. package/types/src/provider.d.ts +0 -2
  74. package/types/src/proxy-manifest-carrier.d.ts +8 -0
  75. package/types/src/types.d.ts +0 -2
  76. package/src/installation/mcp.ts +0 -102
  77. package/src/installation/proxy-manifest.ts +0 -214
  78. package/src/installation/secrets.ts +0 -78
  79. package/types/src/installation/mcp.d.ts +0 -18
  80. package/types/src/installation/proxy-manifest.d.ts +0 -105
  81. package/types/src/installation/secrets.d.ts +0 -17
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { ZeropsImportResult, ZeropsProcess, ZeropsService, ZeropsServiceAutoscaling } from './types';
2
+ import type { ZeropsBackupConfig, ZeropsImportResult, ZeropsProcess, ZeropsService, ZeropsServiceAutoscaling } from './types';
3
3
  export declare const appVersionSchema: z.ZodObject<{
4
4
  id: z.ZodEffects<z.ZodString, string, string>;
5
5
  status: z.ZodCatch<z.ZodOptional<z.ZodEnum<["UPLOADING", "WAITING_TO_BUILD", "BUILDING", "BUILD_FAILED", "BUILD_VALIDATION_FAILED", "WAITING_TO_DEPLOY", "DEPLOYING", "DEPLOY_FAILED", "PREPARING_RUNTIME", "PREPARING_RUNTIME_FAILED", "ACTIVE", "BACKUP", "CANCELLED"]>>>;
@@ -636,6 +636,144 @@ export declare const serviceSchema: z.ZodEffects<z.ZodObject<{
636
636
  customAutoscaling?: unknown;
637
637
  currentAutoscaling?: unknown;
638
638
  }>;
639
+ /** A service's own retention that does not parse fails the whole read: reading it as absent would send the default over it. */
640
+ export declare const backupConfigSchema: z.ZodEffects<z.ZodObject<{
641
+ backupPeriod: z.ZodString;
642
+ defaultRetentionPolicy: z.ZodObject<{
643
+ maxTotalFiles: z.ZodNumber;
644
+ maxTotalGiB: z.ZodNumber;
645
+ protectedTags: z.ZodEffects<z.ZodNullable<z.ZodArray<z.ZodString, "many">>, string[], string[] | null>;
646
+ minDaily: z.ZodNumber;
647
+ maxDaily: z.ZodNumber;
648
+ minWeekly: z.ZodNumber;
649
+ maxWeekly: z.ZodNumber;
650
+ minMonthly: z.ZodNumber;
651
+ maxMonthly: z.ZodNumber;
652
+ }, "strip", z.ZodTypeAny, {
653
+ maxTotalFiles: number;
654
+ maxTotalGiB: number;
655
+ protectedTags: string[];
656
+ minDaily: number;
657
+ maxDaily: number;
658
+ minWeekly: number;
659
+ maxWeekly: number;
660
+ minMonthly: number;
661
+ maxMonthly: number;
662
+ }, {
663
+ maxTotalFiles: number;
664
+ maxTotalGiB: number;
665
+ protectedTags: string[] | null;
666
+ minDaily: number;
667
+ maxDaily: number;
668
+ minWeekly: number;
669
+ maxWeekly: number;
670
+ minMonthly: number;
671
+ maxMonthly: number;
672
+ }>;
673
+ retentionPolicy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
674
+ maxTotalFiles: z.ZodNumber;
675
+ maxTotalGiB: z.ZodNumber;
676
+ protectedTags: z.ZodEffects<z.ZodNullable<z.ZodArray<z.ZodString, "many">>, string[], string[] | null>;
677
+ minDaily: z.ZodNumber;
678
+ maxDaily: z.ZodNumber;
679
+ minWeekly: z.ZodNumber;
680
+ maxWeekly: z.ZodNumber;
681
+ minMonthly: z.ZodNumber;
682
+ maxMonthly: z.ZodNumber;
683
+ }, "strip", z.ZodTypeAny, {
684
+ maxTotalFiles: number;
685
+ maxTotalGiB: number;
686
+ protectedTags: string[];
687
+ minDaily: number;
688
+ maxDaily: number;
689
+ minWeekly: number;
690
+ maxWeekly: number;
691
+ minMonthly: number;
692
+ maxMonthly: number;
693
+ }, {
694
+ maxTotalFiles: number;
695
+ maxTotalGiB: number;
696
+ protectedTags: string[] | null;
697
+ minDaily: number;
698
+ maxDaily: number;
699
+ minWeekly: number;
700
+ maxWeekly: number;
701
+ minMonthly: number;
702
+ maxMonthly: number;
703
+ }>>>;
704
+ }, "strip", z.ZodTypeAny, {
705
+ backupPeriod: string;
706
+ defaultRetentionPolicy: {
707
+ maxTotalFiles: number;
708
+ maxTotalGiB: number;
709
+ protectedTags: string[];
710
+ minDaily: number;
711
+ maxDaily: number;
712
+ minWeekly: number;
713
+ maxWeekly: number;
714
+ minMonthly: number;
715
+ maxMonthly: number;
716
+ };
717
+ retentionPolicy?: {
718
+ maxTotalFiles: number;
719
+ maxTotalGiB: number;
720
+ protectedTags: string[];
721
+ minDaily: number;
722
+ maxDaily: number;
723
+ minWeekly: number;
724
+ maxWeekly: number;
725
+ minMonthly: number;
726
+ maxMonthly: number;
727
+ } | null | undefined;
728
+ }, {
729
+ backupPeriod: string;
730
+ defaultRetentionPolicy: {
731
+ maxTotalFiles: number;
732
+ maxTotalGiB: number;
733
+ protectedTags: string[] | null;
734
+ minDaily: number;
735
+ maxDaily: number;
736
+ minWeekly: number;
737
+ maxWeekly: number;
738
+ minMonthly: number;
739
+ maxMonthly: number;
740
+ };
741
+ retentionPolicy?: {
742
+ maxTotalFiles: number;
743
+ maxTotalGiB: number;
744
+ protectedTags: string[] | null;
745
+ minDaily: number;
746
+ maxDaily: number;
747
+ minWeekly: number;
748
+ maxWeekly: number;
749
+ minMonthly: number;
750
+ maxMonthly: number;
751
+ } | null | undefined;
752
+ }>, ZeropsBackupConfig, {
753
+ backupPeriod: string;
754
+ defaultRetentionPolicy: {
755
+ maxTotalFiles: number;
756
+ maxTotalGiB: number;
757
+ protectedTags: string[] | null;
758
+ minDaily: number;
759
+ maxDaily: number;
760
+ minWeekly: number;
761
+ maxWeekly: number;
762
+ minMonthly: number;
763
+ maxMonthly: number;
764
+ };
765
+ retentionPolicy?: {
766
+ maxTotalFiles: number;
767
+ maxTotalGiB: number;
768
+ protectedTags: string[] | null;
769
+ minDaily: number;
770
+ maxDaily: number;
771
+ minWeekly: number;
772
+ maxWeekly: number;
773
+ minMonthly: number;
774
+ maxMonthly: number;
775
+ } | null | undefined;
776
+ }>;
639
777
  export declare const projectSchema: z.ZodObject<{
640
778
  id: z.ZodEffects<z.ZodString, string, string>;
641
779
  name: z.ZodString;
@@ -647,15 +785,15 @@ export declare const projectSchema: z.ZodObject<{
647
785
  name: string;
648
786
  id: string;
649
787
  status?: "ACTIVE" | "FAILED" | "NEW" | "CREATING" | "DELETING" | "STOPPING" | "STOPPED" | "STARTING" | undefined;
650
- description?: string | undefined;
651
788
  mode?: "LIGHT" | "SERIOUS" | undefined;
789
+ description?: string | undefined;
652
790
  tagList?: string[] | undefined;
653
791
  }, {
654
792
  name: string;
655
793
  id: string;
656
794
  status?: unknown;
657
- description?: unknown;
658
795
  mode?: unknown;
796
+ description?: unknown;
659
797
  tagList?: unknown;
660
798
  }>;
661
799
  export declare const integrationTokenSchema: z.ZodObject<{
@@ -710,16 +848,16 @@ export declare const serviceEnvSchema: z.ZodEffects<z.ZodObject<{
710
848
  type: z.ZodCatch<z.ZodOptional<z.ZodString>>;
711
849
  sensitive: z.ZodBoolean;
712
850
  }, "strip", z.ZodTypeAny, {
851
+ sensitive: boolean;
713
852
  key: string;
714
853
  id: string;
715
- sensitive: boolean;
716
854
  content: string;
717
855
  type?: string | undefined;
718
856
  serviceStackId?: string | undefined;
719
857
  }, {
858
+ sensitive: boolean;
720
859
  key: string;
721
860
  id: string;
722
- sensitive: boolean;
723
861
  content: string;
724
862
  type?: unknown;
725
863
  serviceStackId?: unknown;
@@ -729,9 +867,9 @@ export declare const serviceEnvSchema: z.ZodEffects<z.ZodObject<{
729
867
  }) | (import("./types").ZeropsServiceEnvRecord & {
730
868
  sensitive: true;
731
869
  }), {
870
+ sensitive: boolean;
732
871
  key: string;
733
872
  id: string;
734
- sensitive: boolean;
735
873
  content: string;
736
874
  type?: unknown;
737
875
  serviceStackId?: unknown;
@@ -945,15 +1083,15 @@ export declare const projectMatchesSchema: z.ZodObject<{
945
1083
  name: string;
946
1084
  id: string;
947
1085
  status?: "ACTIVE" | "FAILED" | "NEW" | "CREATING" | "DELETING" | "STOPPING" | "STOPPED" | "STARTING" | undefined;
948
- description?: string | undefined;
949
1086
  mode?: "LIGHT" | "SERIOUS" | undefined;
1087
+ description?: string | undefined;
950
1088
  tagList?: string[] | undefined;
951
1089
  }, {
952
1090
  name: string;
953
1091
  id: string;
954
1092
  status?: unknown;
955
- description?: unknown;
956
1093
  mode?: unknown;
1094
+ description?: unknown;
957
1095
  tagList?: unknown;
958
1096
  }>, "many">;
959
1097
  }, "strip", z.ZodTypeAny, {
@@ -961,8 +1099,8 @@ export declare const projectMatchesSchema: z.ZodObject<{
961
1099
  name: string;
962
1100
  id: string;
963
1101
  status?: "ACTIVE" | "FAILED" | "NEW" | "CREATING" | "DELETING" | "STOPPING" | "STOPPED" | "STARTING" | undefined;
964
- description?: string | undefined;
965
1102
  mode?: "LIGHT" | "SERIOUS" | undefined;
1103
+ description?: string | undefined;
966
1104
  tagList?: string[] | undefined;
967
1105
  }[];
968
1106
  }, {
@@ -970,8 +1108,8 @@ export declare const projectMatchesSchema: z.ZodObject<{
970
1108
  name: string;
971
1109
  id: string;
972
1110
  status?: unknown;
973
- description?: unknown;
974
1111
  mode?: unknown;
1112
+ description?: unknown;
975
1113
  tagList?: unknown;
976
1114
  }[];
977
1115
  }>;
@@ -112,6 +112,32 @@ export interface ZeropsServiceAutoscaling {
112
112
  maxContainerCount: number | null;
113
113
  };
114
114
  }
115
+ /**
116
+ * How many backups of a managed service the platform keeps. VERIFIED AS A SHAPE: `OutDtoBackupRetentionPolicy` and
117
+ * `InDtoBodyBackupRetentionPolicy` carry these nine fields, all required. The `min*`/`max*` counts are per backup TAG
118
+ * (`daily`, `weekly`, `monthly`); UNVERIFIED: which tags an hourly automatic backup gets.
119
+ */
120
+ export interface ZeropsBackupRetentionPolicy {
121
+ maxTotalFiles: number;
122
+ maxTotalGiB: number;
123
+ /** Backups with one of these tags are never deleted automatically. */
124
+ protectedTags: string[];
125
+ minDaily: number;
126
+ maxDaily: number;
127
+ minWeekly: number;
128
+ maxWeekly: number;
129
+ minMonthly: number;
130
+ maxMonthly: number;
131
+ }
132
+ /** A managed service's backup schedule and retention. VERIFIED AS A SHAPE: `ResponseServiceStackBackupFileList`, without its `files`. */
133
+ export interface ZeropsBackupConfig {
134
+ /** UNVERIFIED: the format. Zerops' GUI documentation describes a 5-field cron (`min hour dom mon dow`). */
135
+ backupPeriod: string;
136
+ /** What the platform applies to a service with no retention of its own. UNVERIFIED: that it is what applies then. */
137
+ defaultRetentionPolicy: ZeropsBackupRetentionPolicy;
138
+ /** The service's own retention; absent when none was set. */
139
+ retentionPolicy?: ZeropsBackupRetentionPolicy;
140
+ }
115
141
  /** One service. VERIFIED: `ResponseServiceStack` (narrowed to the fields fabrika reads). */
116
142
  export interface ZeropsService {
117
143
  id: string;
@@ -433,6 +459,29 @@ export interface ZeropsApi {
433
459
  autoscaling: ZeropsServiceAutoscaling;
434
460
  signal: AbortSignal;
435
461
  }): Promise<ZeropsProcess | null>;
462
+ /**
463
+ * A managed service's backup schedule and retention. VERIFIED AS A SHAPE: `GET /service-stack/{id}/backup`
464
+ * (`ListBackups`), response `ResponseServiceStackBackupFileList`; the backup files it also lists are not read.
465
+ */
466
+ getBackupConfig(input: {
467
+ serviceId: string;
468
+ signal: AbortSignal;
469
+ }): Promise<ZeropsBackupConfig>;
470
+ /**
471
+ * Set a managed service's backup schedule and retention. VERIFIED AS A SHAPE: `PUT /service-stack/{id}/backup-config`
472
+ * (`ConfigureBackup`), body `RequestServiceStackBackupConfig`, response `ResponseProcessNil`. The platform stores the
473
+ * period as the service's `BACKUP_PERIOD` variable and may start a user-data sync, whose process this answers.
474
+ *
475
+ * `retentionPolicy` is required here although the body makes it optional. UNVERIFIED: whether a request without one
476
+ * resets the service's retention; a PUT elsewhere on this API resets every field it leaves out, so the caller sends
477
+ * the retention it read, whole.
478
+ */
479
+ configureBackup(input: {
480
+ serviceId: string;
481
+ backupPeriod: string;
482
+ retentionPolicy: ZeropsBackupRetentionPolicy;
483
+ signal: AbortSignal;
484
+ }): Promise<ZeropsProcess | null>;
436
485
  /** One service by id. VERIFIED: `GET /service-stack/{id}`. */
437
486
  getService(input: {
438
487
  serviceId: string;
@@ -3,4 +3,4 @@ export { ZEROPS_SERVICE_NOT_HTTP, ZeropsApiError } from './api/errors';
3
3
  export { enableSubdomainAccessWhenHttp, waitForProcess } from './api/polling';
4
4
  export { assertServiceEnvValueFits, ZEROPS_SERVICE_ENV_VALUE_MAX_BYTES, ZEROPS_SERVICE_ENV_VALUE_TOO_LARGE, ZeropsServiceEnvValueTooLargeError, } from './api/service-env-limit';
5
5
  export { readableContent } from './api/service-env-response';
6
- export { type FetchLike, ZEROPS_ACTIVE, ZEROPS_PROCESS_FINISHED, ZEROPS_PROCESS_TERMINAL, ZEROPS_TERMINAL, type ZeropsApi, type ZeropsApiOptions, type ZeropsAppVersion, type ZeropsAppVersionStatus, type ZeropsAppVersionUpload, type ZeropsImportedService, type ZeropsImportResult, type ZeropsIntegrationToken, type ZeropsLogAccess, type ZeropsLogLine, type ZeropsProcess, type ZeropsProject, type ZeropsProjectMode, type ZeropsProjectStatus, type ZeropsRoleCode, type ZeropsService, type ZeropsServiceAutoscaling, type ZeropsServiceEnv, type ZeropsServiceEnvWrite, type ZeropsServiceStatus, type ZeropsTokenProjectGrant, type ZeropsUserInfo, } from './api/types';
6
+ export { type FetchLike, ZEROPS_ACTIVE, ZEROPS_PROCESS_FINISHED, ZEROPS_PROCESS_TERMINAL, ZEROPS_TERMINAL, type ZeropsApi, type ZeropsApiOptions, type ZeropsAppVersion, type ZeropsAppVersionStatus, type ZeropsAppVersionUpload, type ZeropsBackupConfig, type ZeropsBackupRetentionPolicy, type ZeropsImportedService, type ZeropsImportResult, type ZeropsIntegrationToken, type ZeropsLogAccess, type ZeropsLogLine, type ZeropsProcess, type ZeropsProject, type ZeropsProjectMode, type ZeropsProjectStatus, type ZeropsRoleCode, type ZeropsService, type ZeropsServiceAutoscaling, type ZeropsServiceEnv, type ZeropsServiceEnvWrite, type ZeropsServiceStatus, type ZeropsTokenProjectGrant, type ZeropsUserInfo, } from './api/types';
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bun
2
+ import type { AppCli } from '@fabrika/provider-contract/app-cli';
2
3
  export declare const readZeropsSourceDescriptor: (root?: string) => Promise<import("./manifest").ZeropsArtifactSourceDescriptor>;
3
4
  export interface ZeropsManifestBuildOptions {
4
5
  /** App config path, resolved against the working directory like `--config`. */
@@ -8,3 +9,5 @@ export interface ZeropsManifestBuildOptions {
8
9
  /** The exact text `build` writes to `fabrika.manifest.json`, produced in memory and written nowhere. */
9
10
  export declare const buildZeropsManifestText: (options: ZeropsManifestBuildOptions) => Promise<string>;
10
11
  export declare const runZeropsCli: (argv: readonly string[]) => Promise<void>;
12
+ /** What `fabrika app build`, `app register` and `fabrika namespace` run for an application on Zerops. */
13
+ export declare const appCli: AppCli;
@@ -1,4 +1,3 @@
1
- import type { SchemaReconciler } from '@fabrika/provider-contract';
2
1
  import { type ZeropsApi } from './api';
3
2
  import { type ExposureAlerter } from './exposure';
4
3
  import type { ZeropsSourcePort } from './source/port';
@@ -9,7 +8,6 @@ export interface ZeropsCollaborators {
9
8
  api: ZeropsApi;
10
9
  /** Injected by the Zerops control composition; dry runs do not require it. */
11
10
  source?: ZeropsSourcePort;
12
- reconcileSchema: SchemaReconciler;
13
11
  /** Raises the Operations alert for a refused activation; best-effort. */
14
12
  alertExposure: ExposureAlerter;
15
13
  sleep: Sleeper;
@@ -2,7 +2,7 @@ import type { JsonValue } from '@fabrika/provider-contract';
2
2
  import type { ZeropsImportProject, ZeropsImportService } from './schema.generated';
3
3
  import type { ZeropsResourceContext, ZeropsSourceTarget } from './types';
4
4
  /** The ONLY value fabrika ever writes for `envIsolation`, at either level. Not a default — an assertion. */
5
- export declare const ENV_ISOLATION: 'service';
5
+ export declare const ENV_ISOLATION = "service";
6
6
  /**
7
7
  * The ONLY value fabrika ever writes for `override`, on EVERY service class including managed ones.
8
8
  * Live-verified: without it a re-apply is `400 serviceStackNameUnavailable` — see `compileService`.
@@ -1,4 +1,4 @@
1
- import type { ControlProvider, ProviderCodec, SchemaReconciler } from '@fabrika/provider-contract';
1
+ import type { ControlProvider, ProviderCodec } from '@fabrika/provider-contract';
2
2
  import { type ZeropsApi } from './api';
3
3
  import { type Sleeper } from './collaborators';
4
4
  import { type ExposureAlerter } from './exposure';
@@ -19,11 +19,8 @@ export declare const zeropsStoredTargetCodec: ProviderCodec<ZeropsStoredTarget>;
19
19
  export interface ZeropsControlProviderOptions {
20
20
  readonly accessToken: string;
21
21
  readonly apiBaseUrl?: string;
22
- readonly propustkaUrl?: string;
23
- readonly adminKey?: string;
24
22
  readonly api?: ZeropsApi;
25
23
  readonly source: ZeropsSourcePort;
26
- readonly reconcileSchema?: SchemaReconciler;
27
24
  readonly alertExposure?: ExposureAlerter;
28
25
  readonly sleep?: Sleeper;
29
26
  readonly namespaces?: {
@@ -31,6 +28,8 @@ export interface ZeropsControlProviderOptions {
31
28
  readonly proxySource: ZeropsNamespaceProxySource;
32
29
  readonly iamUrl: string;
33
30
  readonly iamKey: string;
31
+ /** The installation's own project, which no namespace may adopt. */
32
+ readonly installationProjectId?: string;
34
33
  /** The manifest parsers of the older releases' proxies, which a namespace pinned to an older source may run. */
35
34
  readonly olderProxies: OlderProxyReaders;
36
35
  };
@@ -1,6 +1,6 @@
1
1
  import { type ContractArtifact, type DevLauncherConfig } from '@fabrika/auth-core';
2
2
  import type { OperationsAssetRoot, OperationsSourceMapBuildUpload } from '@fabrika/operations-contract/releases';
3
- import { type JsonValue } from '@fabrika/provider-contract';
3
+ import type { JsonValue } from '@fabrika/provider-contract';
4
4
  import { type PreparedZeropsDescriptor } from './descriptor';
5
5
  /** The port the generated entrypoint listens on (`PORT`), and the one the proxy dials. */
6
6
  export declare const ZEROPS_APPLICATION_PORT = 3000;
@@ -12,8 +12,7 @@ export declare const ZEROPS_APPLICATION_RUNTIME = "alpine/bun@1.3";
12
12
  * release of the installation. A build checks with the application's own release instead (`checkRelease`).
13
13
  */
14
14
  export declare const FABRIKA_CHECK_VERSION: string;
15
- /** The compiler the platform type-checks with. It is fetched by version, never taken from the application's lockfile. */
16
- export declare const PLATFORM_TYPESCRIPT_VERSION = "5.9.3";
15
+ export { PLATFORM_TYPESCRIPT_VERSION } from '@fabrika/app/build';
17
16
  /** System packages an application may add to its runtime image, installed by the generated `run.prepareCommands`. */
18
17
  export declare const ZEROPS_RUNTIME_PACKAGES: readonly ["ffmpeg", "ghostscript", "imagemagick", "poppler-utils", "vips"];
19
18
  export type ZeropsRuntimePackage = (typeof ZEROPS_RUNTIME_PACKAGES)[number];
@@ -21,10 +20,6 @@ export interface ZeropsContractJob {
21
20
  readonly name: string;
22
21
  readonly schedule: string;
23
22
  }
24
- /** The framework's file scan job (`@fabrika/app`'s `FILE_SCAN_JOB`), run every minute when a collection scans. */
25
- export declare const ZEROPS_FILE_SCAN_JOB = "fabrika-file-scan";
26
- /** The framework's file sweep job (`@fabrika/app`'s `FILE_SWEEP_JOB` and its schedule), run when the contract has files. */
27
- export declare const ZEROPS_FILE_SWEEP_JOB = "fabrika-file-sweep";
28
23
  /**
29
24
  * The RAM in GB a container of a scanning application starts with: one `clamscan` over a batch peaks at about 1 GB
30
25
  * resident while it loads its signatures (measured with ClamAV 1.4), beside the application's own process.
@@ -83,7 +78,7 @@ export interface ZeropsDevExecution {
83
78
  readonly head: string;
84
79
  }
85
80
  /** The application ids the generated scripts may name: the contract's own id rule, so a script needs no quoting. */
86
- export declare const LOCKED_APP_ID_PATTERN: RegExp;
81
+ export { CONTRACT_APP_ID_PATTERN as LOCKED_APP_ID_PATTERN } from '@fabrika/app/build';
87
82
  export declare const CONTRACT_DIGEST_PATTERN: RegExp;
88
83
  /** A literal path of unreserved characters: it is written into the generated probes unquoted by any shell. */
89
84
  export declare const READINESS_PATH_PATTERN: RegExp;
@@ -113,16 +108,10 @@ export declare function lockedAuthoredBuild(entry: {
113
108
  }, setup: string): AuthoredBuild;
114
109
  /** What the dev launcher reads (`DEV_LAUNCHER_CONFIG_FILE`): the platform's, written after the checks. */
115
110
  export declare function devLauncherConfig(execution: ZeropsLockedExecution, authoredSpa: readonly string[]): DevLauncherConfig;
116
- /**
117
- * The generated build commands, in order; the authored SPA commands run before all of them. The application's tests
118
- * run first: they are authored code, so everything after them is reinstalled, regenerated or checked again. They run
119
- * `--isolate`, as the application skill runs them: a test file's DOM globals otherwise leak into the next file. `tsc`
120
- * runs before the checker, as in the skill's loop: the usual quick fix of a type error is a cast or an `any`, which only
121
- * the checker refuses, so the checker is the last word on the code.
122
- */
111
+ /** The generated build commands, in order; the authored SPA commands run before all of them. */
123
112
  export declare function generatedBuildCommands(execution: ZeropsLockedExecution, authoredSpa?: readonly string[]): readonly string[];
124
113
  /** How many job processes the crontab may run at once, each opening the application's database. */
125
- export declare const zeropsJobProcesses: (contract: ZeropsContractRun) => number;
114
+ export declare const zeropsJobProcesses: (execution: ZeropsLockedExecution) => number;
126
115
  /** The commands every container runs before `run.start`, in order; any failure stops the activation. */
127
116
  export declare function generatedInitCommands(execution: ZeropsLockedExecution): string[];
128
117
  /** The generated selected setup: the authored build kept, everything else the platform's. */
@@ -134,4 +123,3 @@ export declare function renderLockedSetup(setup: string, authored: AuthoredBuild
134
123
  * bytes and digest stay the artifact's identity; this document is what the build request carries.
135
124
  */
136
125
  export declare function renderLockedExecutionDescriptor(contents: string, setup: string | undefined, release: string | null, execution: ZeropsLockedExecution): PreparedZeropsDescriptor;
137
- export {};
@@ -1,5 +1,5 @@
1
1
  export { createZeropsApi, enableSubdomainAccessWhenHttp, readableContent, waitForProcess, ZEROPS_ACTIVE, ZEROPS_API_BASE, ZEROPS_PROCESS_FINISHED, ZEROPS_PROCESS_TERMINAL, ZEROPS_SERVICE_NOT_HTTP, ZEROPS_TERMINAL, ZeropsApiError, } from './api';
2
- export type { FetchLike, ZeropsApi, ZeropsApiOptions, ZeropsAppVersion, ZeropsAppVersionStatus, ZeropsAppVersionUpload, ZeropsImportedService, ZeropsImportResult, ZeropsIntegrationToken, ZeropsLogAccess, ZeropsLogLine, ZeropsProcess, ZeropsProject, ZeropsProjectMode, ZeropsProjectStatus, ZeropsRoleCode, ZeropsService, ZeropsServiceAutoscaling, ZeropsServiceEnv, ZeropsServiceEnvWrite, ZeropsServiceStatus, ZeropsTokenProjectGrant, ZeropsUserInfo, } from './api';
2
+ export type { FetchLike, ZeropsApi, ZeropsApiOptions, ZeropsAppVersion, ZeropsAppVersionStatus, ZeropsAppVersionUpload, ZeropsBackupConfig, ZeropsBackupRetentionPolicy, ZeropsImportedService, ZeropsImportResult, ZeropsIntegrationToken, ZeropsLogAccess, ZeropsLogLine, ZeropsProcess, ZeropsProject, ZeropsProjectMode, ZeropsProjectStatus, ZeropsRoleCode, ZeropsService, ZeropsServiceAutoscaling, ZeropsServiceEnv, ZeropsServiceEnvWrite, ZeropsServiceStatus, ZeropsTokenProjectGrant, ZeropsUserInfo, } from './api';
3
3
  export { defineApp, isZeropsAppConfig, useSharedPostgres, zeropsSharedServiceHostname, zeropsSharedServicePrefix } from './authoring';
4
4
  export type { ZeropsAuthoredAppConfig } from './authoring';
5
5
  export { parseZeropsCliArgs } from './cli-args';
@@ -1,4 +1,4 @@
1
- import { type McpClient } from './mcp';
1
+ import { type McpClient } from '@fabrika/installation-init';
2
2
  /** How the project this installation lives in is named. */
3
3
  export type ZeropsProjectSelector = {
4
4
  readonly kind: 'id';
@@ -39,6 +39,15 @@ export declare const PLATFORM_CONCURRENT_DEPLOY: readonly ["iam", "operations"];
39
39
  export declare const PLATFORM_SEQUENTIAL_DEPLOY: readonly ["proxy", "control"];
40
40
  /** The proxy's hostname. The only publicly routed service, and the one that carries the manifest. */
41
41
  export declare const PLATFORM_PROXY_SERVICE = "proxy";
42
+ /** IAM's and control's database, on both tiers. This command deploys nothing to it; it sets its backup schedule. */
43
+ export declare const PLATFORM_DATABASE_SERVICE = "db";
44
+ /** Operations' own database. A light installation created before it existed keeps Operations in `db`. */
45
+ export declare const OPERATIONS_DATABASE_SERVICE = "operationsdb";
46
+ /**
47
+ * Hourly. Zerops has no point-in-time recovery: a single-node database loses everything since its last `pg_dump`, which
48
+ * by default is daily. UNVERIFIED: that `backupPeriod` takes this 5-field cron, as the GUI documentation describes.
49
+ */
50
+ export declare const PLATFORM_DATABASE_BACKUP_PERIOD = "0 * * * *";
42
51
  /**
43
52
  * What deploying ONE service needs. Narrower than the whole command's collaborators so the bring-up
44
53
  * (`install.ts`), which deploys the proxy alone before any manifest exists, can reuse `deployPlatformService`
@@ -86,6 +95,37 @@ export declare const readServiceEnv: (serviceId: string, { api, signal }: Pick<P
86
95
  * one service, not an order — the order below stays this file's.
87
96
  */
88
97
  export declare const deployPlatformService: (service: ResolvedService, input: PlatformServiceDeployInput, collaborators: PlatformServiceDeployCollaborators) => Promise<void>;
98
+ /** What `ensureBackupPeriod` found and did. */
99
+ export type BackupPeriodOutcome = {
100
+ readonly kind: 'unchanged';
101
+ } | {
102
+ readonly kind: 'kept';
103
+ readonly current: string;
104
+ } | {
105
+ readonly kind: 'would-change';
106
+ readonly from: string;
107
+ } | {
108
+ readonly kind: 'changed';
109
+ readonly from: string;
110
+ } | {
111
+ readonly kind: 'unconfirmed';
112
+ readonly readBack: string;
113
+ };
114
+ /**
115
+ * Set a managed service's backup period, read-compare-write, replacing only a daily one.
116
+ *
117
+ * A different period is sent with the retention the service reads — its own, else the default — WHOLE, because a
118
+ * PUT on this API resets what it leaves out. The decision is the read-back, never the PUT returning.
119
+ */
120
+ export declare const ensureBackupPeriod: (input: {
121
+ readonly api: Pick<ZeropsApi, "getBackupConfig" | "configureBackup" | "getProcess">;
122
+ readonly sleep: Sleeper;
123
+ readonly signal: AbortSignal;
124
+ readonly serviceId: string;
125
+ readonly hostname: string;
126
+ readonly period: string;
127
+ readonly dryRun: boolean;
128
+ }) => Promise<BackupPeriodOutcome>;
89
129
  /**
90
130
  * Bring one Zerops platform installation to this checkout, unattended.
91
131
  *
@@ -1,2 +1,2 @@
1
- import type { PlatformProxyManifestTemplate } from '../proxy-manifest';
1
+ import type { PlatformProxyManifestTemplate } from '@fabrika/installation-init';
2
2
  export declare const PLATFORM_PROXY_MANIFEST_TEMPLATE: PlatformProxyManifestTemplate;
@@ -1,6 +1,4 @@
1
- import type { PlatformProxyService } from './proxy-manifest';
2
- /** The public hostname of each platform service, without a scheme and without a port. */
3
- export type PlatformHosts = Readonly<Record<PlatformProxyService, string>>;
1
+ import type { PlatformHosts, PlatformProxyService } from '@fabrika/installation-init';
4
2
  /** Everything the deploy needs to know about where this installation answers. */
5
3
  export interface PlatformPlacement {
6
4
  readonly hosts: PlatformHosts;
@@ -34,5 +32,3 @@ export interface PlatformListener {
34
32
  * guessed or missing host — is a proxy that fronts nothing at an address the console then bounces to.
35
33
  */
36
34
  export declare const derivePlatformHosts: (subdomains: string, listeners: readonly PlatformListener[]) => PlatformHosts;
37
- /** `https://<host>` — the origin a browser, a token's `iss` and a return-origin registry all use. */
38
- export declare const platformOrigin: (scheme: "http" | "https", host: string) => string;
@@ -2,8 +2,6 @@ import type { InstallationCli } from '@fabrika/provider-contract/installation';
2
2
  export { PLATFORM_CONCURRENT_DEPLOY, PLATFORM_DEPLOY_ORDER, PLATFORM_PROXY_SERVICE, PLATFORM_SEQUENTIAL_DEPLOY } from './deploy';
3
3
  export { PLATFORM_CONSOLE_APP_SCHEMA } from './generated/platform-console-schema';
4
4
  export { PLATFORM_PROXY_MANIFEST_TEMPLATE } from './generated/platform-proxy-manifest';
5
- export { type IamOAuthConfig, type McpClient, parseMcpClientsJson, platformIamOAuthConfig } from './mcp';
6
- export { type PlatformOAuthResourceTemplate, type PlatformProxyApp, platformProxyAppFor, type PlatformProxyComposition, type PlatformProxyManifest, type PlatformProxyManifestTemplate, type PlatformProxyPlacement, type PlatformProxyService, platformServiceTableDigest, resolvePlatformProxyManifest, } from './proxy-manifest';
7
5
  /** The operator's guide of this release, shipped beside this module. */
8
6
  export declare const readInstallationGuide: () => Promise<string>;
9
7
  export declare const installationCli: InstallationCli;
@@ -1,9 +1,7 @@
1
- import type { InstallationEmail } from '@fabrika/installation-init';
1
+ import { type InstallationEmail, type InstallationSecrets, type PlatformHosts } from '@fabrika/installation-init';
2
2
  import type { ZeropsNamespaceProxySource } from '../index';
3
3
  import type { PlatformDeployService, ResolvedService } from './deploy';
4
- import { type PlatformHosts } from './hosts';
5
4
  import { type InstallCollaborators } from './install-collaborators';
6
- import type { InstallationSecrets } from './secrets';
7
5
  import type { PlatformTier } from './topology/topology';
8
6
  /** The private address the proxy dials IAM at inside the project, and pass 1's placeholder issuer. */
9
7
  export declare const PRIVATE_IAM_UPSTREAM = "iam:3000";
@@ -20,6 +18,8 @@ export declare const PASS_ONE_PROXY_MANIFEST: string;
20
18
  /** What `installationServiceEnv` needs. Everything in it is settled before the first write. */
21
19
  export interface InstallationEnvInput {
22
20
  readonly environment: string;
21
+ /** The installation's own Zerops project, which no deployment namespace may adopt. */
22
+ readonly projectId: string;
23
23
  readonly tier: PlatformTier;
24
24
  readonly scheme: 'http' | 'https';
25
25
  readonly hosts: PlatformHosts;
@@ -33,26 +33,19 @@ export interface InstallationEnvInput {
33
33
  readonly email: InstallationEmail;
34
34
  }
35
35
  /**
36
- * EVERY variable this command places, per service.
36
+ * EVERY variable this command places, per service: fabrika's (`installationServiceEnvironment`) over this
37
+ * project's own references, and control's Zerops variables after them.
37
38
  *
38
39
  * Pure, and exported, because the matrix is the thing most worth pinning: a name that is right on
39
- * Cloudflare and wrong on Bun is a silent no-op rather than a failure. Two spelling rules run through
40
- * it, both verified against the runtimes rather than assumed:
41
- *
42
- * • IAM's Bun runtime reads `ISSUER` and `ENVIRONMENT` UNPREFIXED and everything else with the
43
- * `FABRIKA_IAM_` prefix (`packages/iam/src/node/runtime.ts`). The prefixed spellings below are the
44
- * ones that file actually reads; the unprefixed ones are the ones it actually reads too.
45
- * • No key any service declares in its own `zerops.yaml` appears here — `PORT`,
46
- * `FABRIKA_IAM_RPC_URL`, `FABRIKA_OPERATIONS_URL`, `FABRIKA_CONTROL_ASSETS_DIR`,
47
- * `FABRIKA_CONTROL_URL`, `FABRIKA_PROXY_MANIFEST`, `FABRIKA_PROXY_PORT`. The env API refuses those
48
- * (`provider-zerops/src/api.ts`), because the conflict cannot be resolved to a record id.
49
- *
50
- * The proxy manifest is deliberately absent: pass 1 writes an empty one and `deployPlatform` owns the
51
- * real one, in the same run as the code it describes (ADR-0027).
40
+ * Cloudflare and wrong on Bun is a silent no-op rather than a failure. No key any service declares in its
41
+ * own `zerops.yaml` appears here — `PORT`, `FABRIKA_IAM_RPC_URL`, `FABRIKA_OPERATIONS_URL`,
42
+ * `FABRIKA_CONTROL_ASSETS_DIR`, `FABRIKA_CONTROL_URL`, `FABRIKA_PROXY_MANIFEST`, `FABRIKA_PROXY_PORT`. The env
43
+ * API refuses those (`provider-zerops/src/api.ts`), because the conflict cannot be resolved to a record id.
52
44
  */
53
45
  export declare const installationServiceEnv: (input: InstallationEnvInput) => ReadonlyMap<PlatformDeployService, ReadonlyMap<string, string>>;
54
46
  /**
55
- * The keys whose VALUE this command generates, per service.
47
+ * The keys whose VALUE this command generates, per service: fabrika's, and the two Zerops names on control
48
+ * that carry the proxy key and the minted token.
56
49
  *
57
50
  * Their presence on a live service is what "this project already holds an installation" means, and it is
58
51
  * checked by KEY only — a value is never read back for comparison. `__tests__/install.test.ts` pins this
@@ -1,15 +1,4 @@
1
- import type { InstallationSecrets } from './secrets';
2
- /** `--secrets-file`: where the local copy goes. A new file, outside the source checkout. */
3
- export declare const SECRETS_FILE_FLAG = "--secrets-file";
4
- export declare const SECRETS_FILE_VARIABLE = "FABRIKA_PLATFORM_SECRETS_FILE";
5
- /**
6
- * Settle the path before anything is contacted.
7
- *
8
- * Refused when it exists, because overwriting one would destroy another installation's only copy, and
9
- * when it is inside the source checkout, where it would dirty the checkout `platform deploy` uploads
10
- * and could be committed.
11
- */
12
- export declare const checkedSecretsFilePath: (path: string, sourceDir: string) => string;
1
+ import { type InstallationSecrets } from '@fabrika/installation-init';
13
2
  /** What the file records beside the credentials, so it identifies its installation on its own. */
14
3
  export interface InstallationSecretsRecord {
15
4
  readonly environment: string;
@@ -20,11 +9,9 @@ export interface InstallationSecretsRecord {
20
9
  readonly zeropsAccessToken: string;
21
10
  }
22
11
  /**
23
- * The file's text: shell-sourceable assignments, named as the commands that read them name them.
12
+ * The file's text, named as the commands that read it name each value.
24
13
  *
25
14
  * `FABRIKA_ZEROPS_ACCESS_TOKEN` is the INTEGRATION token, which is what `platform init` and
26
15
  * `platform deploy` take; the personal token the install ran with is not written.
27
16
  */
28
- export declare const renderSecretsFile: (record: InstallationSecretsRecord) => string;
29
- /** Create the file with mode 0600, failing rather than replacing one that appeared since the check. */
30
- export declare const writeSecretsFile: (path: string, text: string) => Promise<void>;
17
+ export declare const renderInstallationSecretsFile: (record: InstallationSecretsRecord) => string;
@@ -13,8 +13,6 @@ export interface SidecarValues {
13
13
  /** The published fabrika tag to pin, used only when `fabrika.ref` does not exist yet. */
14
14
  readonly fabrikaRef: string;
15
15
  }
16
- /** The pinned ref, or an error naming what was found. A branch is refused, deliberately and loudly. */
17
- export declare const assertPinnedTag: (ref: string) => string;
18
16
  /** The generated pipeline for one installation. Its only placeholder is the installation, which names its GitHub Environment. */
19
17
  export declare const renderSidecarWorkflow: (installation: string) => Promise<string>;
20
18
  /**