@spacefast/common 0.0.23 → 0.0.24
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/config/domains.d.ts +1 -1
- package/dist/config/domains.js +1 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.js +0 -1
- package/dist/contracts/abuse.d.ts +2 -0
- package/dist/contracts/abuse.js +12 -0
- package/dist/contracts/access.d.ts +121 -9
- package/dist/contracts/access.js +73 -9
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +0 -9
- package/dist/contracts/api-keys.d.ts +21 -21
- package/dist/contracts/beta.js +1 -1
- package/dist/contracts/billing.d.ts +1 -34
- package/dist/contracts/billing.js +4 -53
- package/dist/contracts/builds.d.ts +8 -8
- package/dist/contracts/builds.js +10 -3
- package/dist/contracts/cli.d.ts +10 -0
- package/dist/contracts/cli.js +10 -0
- package/dist/contracts/collab-public.d.ts +63 -0
- package/dist/contracts/collab-public.js +46 -0
- package/dist/contracts/comments.d.ts +283 -54
- package/dist/contracts/comments.js +173 -52
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/device-auth.d.ts +6 -6
- package/dist/contracts/device-auth.js +1 -1
- package/dist/contracts/docs.d.ts +5 -5
- package/dist/contracts/domains.d.ts +36 -36
- package/dist/contracts/enums.d.ts +33 -30
- package/dist/contracts/enums.js +52 -38
- package/dist/contracts/error-code-meta.d.ts +37 -126
- package/dist/contracts/error-code-meta.js +12 -41
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +10 -32
- package/dist/contracts/execution.d.ts +35 -57
- package/dist/contracts/execution.js +41 -40
- package/dist/contracts/feature-lifecycle-core.d.ts +0 -6
- package/dist/contracts/feature-lifecycle-core.js +2 -31
- package/dist/contracts/feature-lifecycle.d.ts +8 -38
- package/dist/contracts/feature-lifecycle.js +16 -48
- package/dist/contracts/features.d.ts +15 -13
- package/dist/contracts/features.js +39 -38
- package/dist/contracts/functions.d.ts +97 -70
- package/dist/contracts/functions.js +101 -34
- package/dist/contracts/git.d.ts +1 -1
- package/dist/contracts/grants.d.ts +7 -3
- package/dist/contracts/grants.js +18 -9
- package/dist/contracts/internal.d.ts +14 -1
- package/dist/contracts/internal.js +17 -7
- package/dist/contracts/oauth-resources.d.ts +4 -3
- package/dist/contracts/oauth-resources.js +12 -3
- package/dist/contracts/operations.d.ts +90 -5
- package/dist/contracts/operations.js +75 -1
- package/dist/contracts/pages.d.ts +6 -1
- package/dist/contracts/pages.js +24 -1
- package/dist/contracts/plan-policy.d.ts +1 -3
- package/dist/contracts/plan-policy.js +1 -2
- package/dist/contracts/platform.d.ts +61 -148
- package/dist/contracts/platform.js +70 -126
- package/dist/contracts/publish-archive.d.ts +498 -0
- package/dist/contracts/publish-archive.js +25 -0
- package/dist/contracts/resources.d.ts +12 -24
- package/dist/contracts/resources.js +32 -12
- package/dist/contracts/runtime-api.d.ts +369 -175
- package/dist/contracts/runtime-api.js +372 -348
- package/dist/contracts/runtime-app.d.ts +127 -120
- package/dist/contracts/runtime-app.js +19 -10
- package/dist/contracts/runtime-db.d.ts +1 -1
- package/dist/contracts/runtime-services.d.ts +219 -0
- package/dist/contracts/runtime-services.js +437 -0
- package/dist/contracts/runtime-storage.d.ts +45 -32
- package/dist/contracts/runtime-storage.js +30 -8
- package/dist/contracts/space-config.d.ts +10 -16
- package/dist/contracts/space-config.js +14 -10
- package/dist/contracts/spaces.d.ts +241 -436
- package/dist/contracts/spaces.js +128 -145
- package/dist/contracts/superadmin-activity.d.ts +57 -4
- package/dist/contracts/superadmin-activity.js +48 -2
- package/dist/contracts/superadmin-search.d.ts +126 -0
- package/dist/contracts/superadmin-search.js +61 -0
- package/dist/contracts/superadmin-spaces.d.ts +358 -89
- package/dist/contracts/superadmin-spaces.js +97 -24
- package/dist/contracts/superadmin-teams.d.ts +28 -10
- package/dist/contracts/superadmin-teams.js +5 -8
- package/dist/contracts/superadmin.d.ts +0 -32
- package/dist/contracts/superadmin.js +3 -11
- package/dist/contracts/tags.d.ts +9 -9
- package/dist/contracts/teams.d.ts +38 -0
- package/dist/contracts/teams.js +34 -16
- package/dist/contracts/transfers.d.ts +0 -49
- package/dist/contracts/transfers.js +2 -6
- package/dist/contracts/usage.d.ts +61 -0
- package/dist/contracts/usage.js +64 -0
- package/dist/contracts/variables.d.ts +2 -7
- package/dist/contracts/variables.js +6 -5
- package/dist/contracts/webhooks.d.ts +2 -2
- package/dist/contracts/zero.d.ts +87 -56
- package/dist/contracts/zero.js +82 -20
- package/dist/dashboard-paths/index.d.ts +1 -1
- package/dist/dashboard-paths/index.js +1 -0
- package/dist/docs/agent-prose.d.ts +1 -1
- package/dist/docs/agent-prose.js +57 -61
- package/dist/docs/agent-setup.js +40 -13
- package/dist/docs/catalog.d.ts +19 -19
- package/dist/docs/catalog.js +30 -19
- package/dist/docs/error-docs.js +63 -151
- package/dist/test-helpers/fetch-stub.d.ts +16 -0
- package/dist/test-helpers/fetch-stub.js +24 -0
- package/dist/utils/build-settings.js +9 -3
- package/dist/utils/canonical-json.d.ts +10 -0
- package/dist/utils/canonical-json.js +21 -0
- package/dist/utils/cast-transport.d.ts +28 -0
- package/dist/utils/cast-transport.js +52 -0
- package/dist/utils/claim-token.d.ts +0 -8
- package/dist/utils/claim-token.js +3 -15
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/env-file.d.ts +17 -0
- package/dist/utils/env-file.js +96 -0
- package/dist/utils/error-code.d.ts +2 -0
- package/dist/utils/error-code.js +7 -0
- package/dist/utils/generate-space-name.d.ts +8 -10
- package/dist/utils/generate-space-name.js +206 -21
- package/dist/utils/grant-decision.fixtures.json +2938 -0
- package/dist/utils/grants.d.ts +2 -0
- package/dist/utils/grants.js +25 -2
- package/dist/utils/gravatar.d.ts +9 -0
- package/dist/utils/gravatar.js +31 -0
- package/dist/utils/idempotency.d.ts +6 -0
- package/dist/utils/idempotency.js +28 -0
- package/dist/utils/local-space-state.d.ts +1 -5
- package/dist/utils/local-space-state.js +7 -26
- package/dist/utils/page-fonts.d.ts +2 -2
- package/dist/utils/page-fonts.js +22 -4
- package/dist/utils/pages.d.ts +1 -2
- package/dist/utils/pages.js +21 -5
- package/dist/utils/publish-form-data.d.ts +12 -0
- package/dist/utils/publish-form-data.js +10 -0
- package/dist/utils/publish-policy.d.ts +20 -0
- package/dist/utils/publish-policy.fixtures.json +397 -0
- package/dist/utils/publish-policy.js +36 -19
- package/dist/utils/push-new.d.ts +7 -0
- package/dist/utils/push-new.js +7 -0
- package/dist/utils/query-keys.d.ts +0 -1
- package/dist/utils/query-keys.js +0 -1
- package/dist/utils/runtime-paths.d.ts +5 -0
- package/dist/utils/runtime-paths.js +5 -0
- package/dist/utils/runtime-upload-batch.d.ts +0 -5
- package/dist/utils/runtime-upload-batch.js +1 -27
- package/dist/utils/runtime-upload.d.ts +3 -13
- package/dist/utils/runtime-upload.js +4 -14
- package/dist/utils/space-config.d.ts +0 -33
- package/dist/utils/space-config.js +5 -326
- package/dist/utils/storage-policy.d.ts +1 -1
- package/dist/utils/storage-policy.js +3 -1
- package/dist/utils/structured-error.d.ts +14 -0
- package/dist/utils/structured-error.js +22 -0
- package/dist/utils/version-path.js +12 -3
- package/dist/vocabulary.d.ts +5 -3
- package/dist/vocabulary.js +13 -10
- package/package.json +10 -5
- package/dist/config/postgres-budget.d.ts +0 -129
- package/dist/config/postgres-budget.js +0 -140
- package/dist/config/postgres-budget.json +0 -51
- package/dist/contracts/archives.d.ts +0 -331
- package/dist/contracts/archives.js +0 -120
- package/dist/contracts/deployments.d.ts +0 -574
- package/dist/contracts/deployments.js +0 -97
- package/dist/contracts/sites.d.ts +0 -416
- package/dist/contracts/sites.js +0 -168
- package/dist/contracts/superadmin-queues.d.ts +0 -414
- package/dist/contracts/superadmin-queues.js +0 -202
- package/dist/contracts/superadmin-runtime.d.ts +0 -27
- package/dist/contracts/superadmin-runtime.js +0 -38
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/utils/api.d.ts +0 -4
- package/dist/utils/api.js +0 -13
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { BuildSettingsSchema, BuildTargetSchema, PublicBuildInputSchema } from "./builds.js";
|
|
3
|
-
import { CursorPaginationSchema, baseDiagnosticSchema, cursorListQuerySchema } from "./common.js";
|
|
4
|
-
import { buildStatus, versionStatus } from "./enums.js";
|
|
5
|
-
export const deploymentStatusSchema = z.enum([
|
|
6
|
-
"waiting_for_source",
|
|
7
|
-
"queued",
|
|
8
|
-
"building",
|
|
9
|
-
"ready",
|
|
10
|
-
"failed",
|
|
11
|
-
"canceled",
|
|
12
|
-
"skipped",
|
|
13
|
-
]);
|
|
14
|
-
export const DeploymentSourceSchema = z.object({
|
|
15
|
-
kind: z.string().nullable(),
|
|
16
|
-
provider: z.enum(["github", "gitlab", "bitbucket", "generic"]).nullable(),
|
|
17
|
-
repositoryId: z.string().nullable(),
|
|
18
|
-
repositoryName: z.string().nullable(),
|
|
19
|
-
repositoryFullName: z.string().nullable(),
|
|
20
|
-
repositoryUrl: z.string().nullable(),
|
|
21
|
-
ref: z.string().nullable(),
|
|
22
|
-
branch: z.string().nullable(),
|
|
23
|
-
commitSha: z.string().nullable(),
|
|
24
|
-
commitUrl: z.string().nullable(),
|
|
25
|
-
commitMessage: z.string().nullable(),
|
|
26
|
-
commitAuthorName: z.string().nullable(),
|
|
27
|
-
commitAuthorLogin: z.string().nullable(),
|
|
28
|
-
pullRequestNumber: z.number().int().positive().nullable(),
|
|
29
|
-
actorType: z.enum(["user", "api_key", "oauth_client", "anonymous_claim", "system"]).nullable(),
|
|
30
|
-
actorId: z.string().nullable(),
|
|
31
|
-
});
|
|
32
|
-
export const DeploymentUrlsSchema = z.object({
|
|
33
|
-
deployment: z.string().nullable(),
|
|
34
|
-
immutable: z.string().nullable(),
|
|
35
|
-
preview: z.string().nullable(),
|
|
36
|
-
external: z.string().nullable(),
|
|
37
|
-
});
|
|
38
|
-
export const DeploymentExternalSchema = z.object({
|
|
39
|
-
provider: z.enum(["github"]).nullable(),
|
|
40
|
-
deploymentId: z.string().nullable(),
|
|
41
|
-
deploymentUrl: z.string().nullable(),
|
|
42
|
-
environment: z.string().nullable(),
|
|
43
|
-
status: z.string().nullable(),
|
|
44
|
-
});
|
|
45
|
-
export const DeploymentChannelVersionSchema = z.object({
|
|
46
|
-
versionId: z.string(),
|
|
47
|
-
deploymentId: z.string(),
|
|
48
|
-
url: z.string().nullable(),
|
|
49
|
-
});
|
|
50
|
-
export const DeploymentChannelStateSchema = z.object({
|
|
51
|
-
name: z.string(),
|
|
52
|
-
current: DeploymentChannelVersionSchema.nullable(),
|
|
53
|
-
previous: DeploymentChannelVersionSchema.nullable(),
|
|
54
|
-
updatedAt: z.string().datetime(),
|
|
55
|
-
});
|
|
56
|
-
export const DeploymentActivityGroupSchema = z.object({
|
|
57
|
-
kind: z.enum(["channel", "pull_request", "branch", "source", "version"]),
|
|
58
|
-
key: z.string(),
|
|
59
|
-
label: z.string(),
|
|
60
|
-
});
|
|
61
|
-
export const DeploymentSchema = z.object({
|
|
62
|
-
id: z
|
|
63
|
-
.string()
|
|
64
|
-
.describe("Derived deployment id for the deployable artifact (`dep_build_*` when a build exists, otherwise `dep_version_*`)."),
|
|
65
|
-
spaceId: z.string(),
|
|
66
|
-
versionId: z.string().nullable(),
|
|
67
|
-
buildId: z.string().nullable(),
|
|
68
|
-
channel: z.string().nullable(),
|
|
69
|
-
channelState: DeploymentChannelStateSchema.nullable(),
|
|
70
|
-
activityGroup: DeploymentActivityGroupSchema,
|
|
71
|
-
status: deploymentStatusSchema,
|
|
72
|
-
versionStatus: versionStatus.nullable(),
|
|
73
|
-
buildStatus: buildStatus.nullable(),
|
|
74
|
-
input: PublicBuildInputSchema.nullable(),
|
|
75
|
-
settingsSnapshot: BuildSettingsSchema.nullable(),
|
|
76
|
-
target: BuildTargetSchema.nullable(),
|
|
77
|
-
source: DeploymentSourceSchema,
|
|
78
|
-
urls: DeploymentUrlsSchema,
|
|
79
|
-
external: DeploymentExternalSchema,
|
|
80
|
-
diagnostics: z.array(baseDiagnosticSchema),
|
|
81
|
-
failureCode: z.string().nullable(),
|
|
82
|
-
failureMessage: z.string().nullable(),
|
|
83
|
-
failedStage: z.string().nullable(),
|
|
84
|
-
url: z.string().nullable(),
|
|
85
|
-
createdAt: z.string().datetime(),
|
|
86
|
-
startedAt: z.string().datetime().nullable(),
|
|
87
|
-
readyAt: z.string().datetime().nullable(),
|
|
88
|
-
finishedAt: z.string().datetime().nullable(),
|
|
89
|
-
});
|
|
90
|
-
export const deploymentListQuerySchema = cursorListQuerySchema;
|
|
91
|
-
export const deploymentListResponseSchema = z.object({
|
|
92
|
-
data: z.array(DeploymentSchema),
|
|
93
|
-
pagination: CursorPaginationSchema,
|
|
94
|
-
});
|
|
95
|
-
export const deploymentGetResponseSchema = z.object({
|
|
96
|
-
data: DeploymentSchema,
|
|
97
|
-
});
|
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const SiteCapacitySchema: z.ZodObject<{
|
|
3
|
-
maxSpaces: z.ZodOptional<z.ZodNumber>;
|
|
4
|
-
usedSpaces: z.ZodOptional<z.ZodNumber>;
|
|
5
|
-
storageBytes: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
export type SiteCapacity = z.infer<typeof SiteCapacitySchema>;
|
|
8
|
-
export declare const SitePressureSchema: z.ZodObject<{
|
|
9
|
-
ewmaLimitedPct: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
ewma429: z.ZodOptional<z.ZodNumber>;
|
|
11
|
-
ewma429PerMin: z.ZodOptional<z.ZodNumber>;
|
|
12
|
-
ewmaWorkersMax: z.ZodOptional<z.ZodNumber>;
|
|
13
|
-
ewmaCpuPct: z.ZodOptional<z.ZodNumber>;
|
|
14
|
-
lastSampleAt: z.ZodOptional<z.ZodString>;
|
|
15
|
-
consecutivePressured: z.ZodOptional<z.ZodNumber>;
|
|
16
|
-
consecutiveClean: z.ZodOptional<z.ZodNumber>;
|
|
17
|
-
placementHoldRevision: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
pressureHoldUntil: z.ZodOptional<z.ZodString>;
|
|
19
|
-
lastBulkLaneActivityAt: z.ZodOptional<z.ZodString>;
|
|
20
|
-
}, z.core.$loose>;
|
|
21
|
-
export type SitePressure = z.infer<typeof SitePressureSchema>;
|
|
22
|
-
export declare const SiteSchema: z.ZodObject<{
|
|
23
|
-
id: z.ZodString;
|
|
24
|
-
tenantId: z.ZodString;
|
|
25
|
-
principal: z.ZodNullable<z.ZodObject<{
|
|
26
|
-
tenantId: z.ZodString;
|
|
27
|
-
principalType: z.ZodEnum<{
|
|
28
|
-
team: "team";
|
|
29
|
-
external: "external";
|
|
30
|
-
}>;
|
|
31
|
-
principalId: z.ZodString;
|
|
32
|
-
}, z.core.$strip>>;
|
|
33
|
-
kind: z.ZodEnum<{
|
|
34
|
-
static_runtime: "static_runtime";
|
|
35
|
-
}>;
|
|
36
|
-
isolation: z.ZodEnum<{
|
|
37
|
-
site: "site";
|
|
38
|
-
space: "space";
|
|
39
|
-
}>;
|
|
40
|
-
status: z.ZodEnum<{
|
|
41
|
-
active: "active";
|
|
42
|
-
provisioning: "provisioning";
|
|
43
|
-
suspended: "suspended";
|
|
44
|
-
deleted: "deleted";
|
|
45
|
-
ready_pool: "ready_pool";
|
|
46
|
-
degraded: "degraded";
|
|
47
|
-
}>;
|
|
48
|
-
region: z.ZodString;
|
|
49
|
-
managementHostname: z.ZodNullable<z.ZodString>;
|
|
50
|
-
runtimeInstanceId: z.ZodNullable<z.ZodString>;
|
|
51
|
-
provider: z.ZodLiteral<"wpcloud">;
|
|
52
|
-
capacity: z.ZodNullable<z.ZodObject<{
|
|
53
|
-
maxSpaces: z.ZodOptional<z.ZodNumber>;
|
|
54
|
-
usedSpaces: z.ZodOptional<z.ZodNumber>;
|
|
55
|
-
storageBytes: z.ZodOptional<z.ZodNumber>;
|
|
56
|
-
}, z.core.$strip>>;
|
|
57
|
-
operation: z.ZodNullable<z.ZodObject<{
|
|
58
|
-
id: z.ZodString;
|
|
59
|
-
kind: z.ZodString;
|
|
60
|
-
status: z.ZodEnum<{
|
|
61
|
-
failed: "failed";
|
|
62
|
-
canceled: "canceled";
|
|
63
|
-
queued: "queued";
|
|
64
|
-
running: "running";
|
|
65
|
-
succeeded: "succeeded";
|
|
66
|
-
}>;
|
|
67
|
-
resources: z.ZodArray<z.ZodObject<{
|
|
68
|
-
type: z.ZodString;
|
|
69
|
-
id: z.ZodString;
|
|
70
|
-
}, z.core.$strip>>;
|
|
71
|
-
progress: z.ZodOptional<z.ZodObject<{
|
|
72
|
-
total: z.ZodNumber;
|
|
73
|
-
completed: z.ZodNumber;
|
|
74
|
-
failed: z.ZodNumber;
|
|
75
|
-
}, z.core.$strip>>;
|
|
76
|
-
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
77
|
-
code: z.ZodString;
|
|
78
|
-
severity: z.ZodEnum<{
|
|
79
|
-
info: "info";
|
|
80
|
-
error: "error";
|
|
81
|
-
warning: "warning";
|
|
82
|
-
}>;
|
|
83
|
-
message: z.ZodString;
|
|
84
|
-
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
-
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
86
|
-
registrar: "registrar";
|
|
87
|
-
wpcloud: "wpcloud";
|
|
88
|
-
dns: "dns";
|
|
89
|
-
runtime: "runtime";
|
|
90
|
-
}>>>;
|
|
91
|
-
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
92
|
-
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
93
|
-
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
94
|
-
}, z.core.$strip>>>;
|
|
95
|
-
createdAt: z.ZodString;
|
|
96
|
-
finishedAt: z.ZodOptional<z.ZodString>;
|
|
97
|
-
}, z.core.$strip>>;
|
|
98
|
-
createdAt: z.ZodString;
|
|
99
|
-
updatedAt: z.ZodString;
|
|
100
|
-
}, z.core.$strip>;
|
|
101
|
-
export type Site = z.infer<typeof SiteSchema>;
|
|
102
|
-
export declare const operatorSiteProvisioningSchema: z.ZodOptional<z.ZodObject<{
|
|
103
|
-
importProviderSiteId: z.ZodOptional<z.ZodString>;
|
|
104
|
-
}, z.core.$strip>>;
|
|
105
|
-
export declare const tenantSiteProvisioningSchema: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
106
|
-
export declare const siteCreateSchema: z.ZodObject<{
|
|
107
|
-
teamId: z.ZodOptional<z.ZodString>;
|
|
108
|
-
kind: z.ZodDefault<z.ZodEnum<{
|
|
109
|
-
static_runtime: "static_runtime";
|
|
110
|
-
}>>;
|
|
111
|
-
isolation: z.ZodDefault<z.ZodEnum<{
|
|
112
|
-
site: "site";
|
|
113
|
-
space: "space";
|
|
114
|
-
}>>;
|
|
115
|
-
region: z.ZodOptional<z.ZodString>;
|
|
116
|
-
provisioning: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
117
|
-
}, z.core.$strict>;
|
|
118
|
-
export declare const siteListSchema: z.ZodObject<{
|
|
119
|
-
data: z.ZodArray<z.ZodObject<{
|
|
120
|
-
id: z.ZodString;
|
|
121
|
-
tenantId: z.ZodString;
|
|
122
|
-
principal: z.ZodNullable<z.ZodObject<{
|
|
123
|
-
tenantId: z.ZodString;
|
|
124
|
-
principalType: z.ZodEnum<{
|
|
125
|
-
team: "team";
|
|
126
|
-
external: "external";
|
|
127
|
-
}>;
|
|
128
|
-
principalId: z.ZodString;
|
|
129
|
-
}, z.core.$strip>>;
|
|
130
|
-
kind: z.ZodEnum<{
|
|
131
|
-
static_runtime: "static_runtime";
|
|
132
|
-
}>;
|
|
133
|
-
isolation: z.ZodEnum<{
|
|
134
|
-
site: "site";
|
|
135
|
-
space: "space";
|
|
136
|
-
}>;
|
|
137
|
-
status: z.ZodEnum<{
|
|
138
|
-
active: "active";
|
|
139
|
-
provisioning: "provisioning";
|
|
140
|
-
suspended: "suspended";
|
|
141
|
-
deleted: "deleted";
|
|
142
|
-
ready_pool: "ready_pool";
|
|
143
|
-
degraded: "degraded";
|
|
144
|
-
}>;
|
|
145
|
-
region: z.ZodString;
|
|
146
|
-
managementHostname: z.ZodNullable<z.ZodString>;
|
|
147
|
-
runtimeInstanceId: z.ZodNullable<z.ZodString>;
|
|
148
|
-
provider: z.ZodLiteral<"wpcloud">;
|
|
149
|
-
capacity: z.ZodNullable<z.ZodObject<{
|
|
150
|
-
maxSpaces: z.ZodOptional<z.ZodNumber>;
|
|
151
|
-
usedSpaces: z.ZodOptional<z.ZodNumber>;
|
|
152
|
-
storageBytes: z.ZodOptional<z.ZodNumber>;
|
|
153
|
-
}, z.core.$strip>>;
|
|
154
|
-
operation: z.ZodNullable<z.ZodObject<{
|
|
155
|
-
id: z.ZodString;
|
|
156
|
-
kind: z.ZodString;
|
|
157
|
-
status: z.ZodEnum<{
|
|
158
|
-
failed: "failed";
|
|
159
|
-
canceled: "canceled";
|
|
160
|
-
queued: "queued";
|
|
161
|
-
running: "running";
|
|
162
|
-
succeeded: "succeeded";
|
|
163
|
-
}>;
|
|
164
|
-
resources: z.ZodArray<z.ZodObject<{
|
|
165
|
-
type: z.ZodString;
|
|
166
|
-
id: z.ZodString;
|
|
167
|
-
}, z.core.$strip>>;
|
|
168
|
-
progress: z.ZodOptional<z.ZodObject<{
|
|
169
|
-
total: z.ZodNumber;
|
|
170
|
-
completed: z.ZodNumber;
|
|
171
|
-
failed: z.ZodNumber;
|
|
172
|
-
}, z.core.$strip>>;
|
|
173
|
-
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
174
|
-
code: z.ZodString;
|
|
175
|
-
severity: z.ZodEnum<{
|
|
176
|
-
info: "info";
|
|
177
|
-
error: "error";
|
|
178
|
-
warning: "warning";
|
|
179
|
-
}>;
|
|
180
|
-
message: z.ZodString;
|
|
181
|
-
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
182
|
-
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
183
|
-
registrar: "registrar";
|
|
184
|
-
wpcloud: "wpcloud";
|
|
185
|
-
dns: "dns";
|
|
186
|
-
runtime: "runtime";
|
|
187
|
-
}>>>;
|
|
188
|
-
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
189
|
-
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
190
|
-
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
191
|
-
}, z.core.$strip>>>;
|
|
192
|
-
createdAt: z.ZodString;
|
|
193
|
-
finishedAt: z.ZodOptional<z.ZodString>;
|
|
194
|
-
}, z.core.$strip>>;
|
|
195
|
-
createdAt: z.ZodString;
|
|
196
|
-
updatedAt: z.ZodString;
|
|
197
|
-
}, z.core.$strip>>;
|
|
198
|
-
pagination: z.ZodObject<{
|
|
199
|
-
nextCursor: z.ZodNullable<z.ZodString>;
|
|
200
|
-
hasMore: z.ZodBoolean;
|
|
201
|
-
}, z.core.$strip>;
|
|
202
|
-
}, z.core.$strip>;
|
|
203
|
-
export declare const siteListQuerySchema: z.ZodObject<{
|
|
204
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
205
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
206
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
207
|
-
static_runtime: "static_runtime";
|
|
208
|
-
}>>;
|
|
209
|
-
}, z.core.$strip>;
|
|
210
|
-
export declare const SuperadminSiteSchema: z.ZodObject<{
|
|
211
|
-
id: z.ZodString;
|
|
212
|
-
tenantId: z.ZodString;
|
|
213
|
-
principal: z.ZodNullable<z.ZodObject<{
|
|
214
|
-
tenantId: z.ZodString;
|
|
215
|
-
principalType: z.ZodEnum<{
|
|
216
|
-
team: "team";
|
|
217
|
-
external: "external";
|
|
218
|
-
}>;
|
|
219
|
-
principalId: z.ZodString;
|
|
220
|
-
}, z.core.$strip>>;
|
|
221
|
-
kind: z.ZodEnum<{
|
|
222
|
-
static_runtime: "static_runtime";
|
|
223
|
-
}>;
|
|
224
|
-
isolation: z.ZodEnum<{
|
|
225
|
-
site: "site";
|
|
226
|
-
space: "space";
|
|
227
|
-
}>;
|
|
228
|
-
status: z.ZodEnum<{
|
|
229
|
-
active: "active";
|
|
230
|
-
provisioning: "provisioning";
|
|
231
|
-
suspended: "suspended";
|
|
232
|
-
deleted: "deleted";
|
|
233
|
-
ready_pool: "ready_pool";
|
|
234
|
-
degraded: "degraded";
|
|
235
|
-
}>;
|
|
236
|
-
region: z.ZodString;
|
|
237
|
-
managementHostname: z.ZodNullable<z.ZodString>;
|
|
238
|
-
runtimeInstanceId: z.ZodNullable<z.ZodString>;
|
|
239
|
-
provider: z.ZodLiteral<"wpcloud">;
|
|
240
|
-
capacity: z.ZodNullable<z.ZodObject<{
|
|
241
|
-
maxSpaces: z.ZodOptional<z.ZodNumber>;
|
|
242
|
-
usedSpaces: z.ZodOptional<z.ZodNumber>;
|
|
243
|
-
storageBytes: z.ZodOptional<z.ZodNumber>;
|
|
244
|
-
}, z.core.$strip>>;
|
|
245
|
-
operation: z.ZodNullable<z.ZodObject<{
|
|
246
|
-
id: z.ZodString;
|
|
247
|
-
kind: z.ZodString;
|
|
248
|
-
status: z.ZodEnum<{
|
|
249
|
-
failed: "failed";
|
|
250
|
-
canceled: "canceled";
|
|
251
|
-
queued: "queued";
|
|
252
|
-
running: "running";
|
|
253
|
-
succeeded: "succeeded";
|
|
254
|
-
}>;
|
|
255
|
-
resources: z.ZodArray<z.ZodObject<{
|
|
256
|
-
type: z.ZodString;
|
|
257
|
-
id: z.ZodString;
|
|
258
|
-
}, z.core.$strip>>;
|
|
259
|
-
progress: z.ZodOptional<z.ZodObject<{
|
|
260
|
-
total: z.ZodNumber;
|
|
261
|
-
completed: z.ZodNumber;
|
|
262
|
-
failed: z.ZodNumber;
|
|
263
|
-
}, z.core.$strip>>;
|
|
264
|
-
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
265
|
-
code: z.ZodString;
|
|
266
|
-
severity: z.ZodEnum<{
|
|
267
|
-
info: "info";
|
|
268
|
-
error: "error";
|
|
269
|
-
warning: "warning";
|
|
270
|
-
}>;
|
|
271
|
-
message: z.ZodString;
|
|
272
|
-
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
273
|
-
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
274
|
-
registrar: "registrar";
|
|
275
|
-
wpcloud: "wpcloud";
|
|
276
|
-
dns: "dns";
|
|
277
|
-
runtime: "runtime";
|
|
278
|
-
}>>>;
|
|
279
|
-
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
280
|
-
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
281
|
-
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
282
|
-
}, z.core.$strip>>>;
|
|
283
|
-
createdAt: z.ZodString;
|
|
284
|
-
finishedAt: z.ZodOptional<z.ZodString>;
|
|
285
|
-
}, z.core.$strip>>;
|
|
286
|
-
createdAt: z.ZodString;
|
|
287
|
-
updatedAt: z.ZodString;
|
|
288
|
-
class: z.ZodEnum<{
|
|
289
|
-
shared: "shared";
|
|
290
|
-
dedicated: "dedicated";
|
|
291
|
-
shared_org: "shared_org";
|
|
292
|
-
anonymous_pool: "anonymous_pool";
|
|
293
|
-
dedicated_space: "dedicated_space";
|
|
294
|
-
}>;
|
|
295
|
-
providerClientId: z.ZodNullable<z.ZodString>;
|
|
296
|
-
providerRef: z.ZodNullable<z.ZodString>;
|
|
297
|
-
}, z.core.$strip>;
|
|
298
|
-
export declare const SuperadminSiteListSchema: z.ZodObject<{
|
|
299
|
-
sites: z.ZodArray<z.ZodObject<{
|
|
300
|
-
id: z.ZodString;
|
|
301
|
-
tenantId: z.ZodString;
|
|
302
|
-
principal: z.ZodNullable<z.ZodObject<{
|
|
303
|
-
tenantId: z.ZodString;
|
|
304
|
-
principalType: z.ZodEnum<{
|
|
305
|
-
team: "team";
|
|
306
|
-
external: "external";
|
|
307
|
-
}>;
|
|
308
|
-
principalId: z.ZodString;
|
|
309
|
-
}, z.core.$strip>>;
|
|
310
|
-
kind: z.ZodEnum<{
|
|
311
|
-
static_runtime: "static_runtime";
|
|
312
|
-
}>;
|
|
313
|
-
isolation: z.ZodEnum<{
|
|
314
|
-
site: "site";
|
|
315
|
-
space: "space";
|
|
316
|
-
}>;
|
|
317
|
-
status: z.ZodEnum<{
|
|
318
|
-
active: "active";
|
|
319
|
-
provisioning: "provisioning";
|
|
320
|
-
suspended: "suspended";
|
|
321
|
-
deleted: "deleted";
|
|
322
|
-
ready_pool: "ready_pool";
|
|
323
|
-
degraded: "degraded";
|
|
324
|
-
}>;
|
|
325
|
-
region: z.ZodString;
|
|
326
|
-
managementHostname: z.ZodNullable<z.ZodString>;
|
|
327
|
-
runtimeInstanceId: z.ZodNullable<z.ZodString>;
|
|
328
|
-
provider: z.ZodLiteral<"wpcloud">;
|
|
329
|
-
capacity: z.ZodNullable<z.ZodObject<{
|
|
330
|
-
maxSpaces: z.ZodOptional<z.ZodNumber>;
|
|
331
|
-
usedSpaces: z.ZodOptional<z.ZodNumber>;
|
|
332
|
-
storageBytes: z.ZodOptional<z.ZodNumber>;
|
|
333
|
-
}, z.core.$strip>>;
|
|
334
|
-
operation: z.ZodNullable<z.ZodObject<{
|
|
335
|
-
id: z.ZodString;
|
|
336
|
-
kind: z.ZodString;
|
|
337
|
-
status: z.ZodEnum<{
|
|
338
|
-
failed: "failed";
|
|
339
|
-
canceled: "canceled";
|
|
340
|
-
queued: "queued";
|
|
341
|
-
running: "running";
|
|
342
|
-
succeeded: "succeeded";
|
|
343
|
-
}>;
|
|
344
|
-
resources: z.ZodArray<z.ZodObject<{
|
|
345
|
-
type: z.ZodString;
|
|
346
|
-
id: z.ZodString;
|
|
347
|
-
}, z.core.$strip>>;
|
|
348
|
-
progress: z.ZodOptional<z.ZodObject<{
|
|
349
|
-
total: z.ZodNumber;
|
|
350
|
-
completed: z.ZodNumber;
|
|
351
|
-
failed: z.ZodNumber;
|
|
352
|
-
}, z.core.$strip>>;
|
|
353
|
-
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
354
|
-
code: z.ZodString;
|
|
355
|
-
severity: z.ZodEnum<{
|
|
356
|
-
info: "info";
|
|
357
|
-
error: "error";
|
|
358
|
-
warning: "warning";
|
|
359
|
-
}>;
|
|
360
|
-
message: z.ZodString;
|
|
361
|
-
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
362
|
-
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
363
|
-
registrar: "registrar";
|
|
364
|
-
wpcloud: "wpcloud";
|
|
365
|
-
dns: "dns";
|
|
366
|
-
runtime: "runtime";
|
|
367
|
-
}>>>;
|
|
368
|
-
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
369
|
-
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
370
|
-
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
371
|
-
}, z.core.$strip>>>;
|
|
372
|
-
createdAt: z.ZodString;
|
|
373
|
-
finishedAt: z.ZodOptional<z.ZodString>;
|
|
374
|
-
}, z.core.$strip>>;
|
|
375
|
-
createdAt: z.ZodString;
|
|
376
|
-
updatedAt: z.ZodString;
|
|
377
|
-
class: z.ZodEnum<{
|
|
378
|
-
shared: "shared";
|
|
379
|
-
dedicated: "dedicated";
|
|
380
|
-
shared_org: "shared_org";
|
|
381
|
-
anonymous_pool: "anonymous_pool";
|
|
382
|
-
dedicated_space: "dedicated_space";
|
|
383
|
-
}>;
|
|
384
|
-
providerClientId: z.ZodNullable<z.ZodString>;
|
|
385
|
-
providerRef: z.ZodNullable<z.ZodString>;
|
|
386
|
-
}, z.core.$strip>>;
|
|
387
|
-
}, z.core.$strip>;
|
|
388
|
-
export declare const superadminSiteCreateSchema: z.ZodObject<{
|
|
389
|
-
kind: z.ZodDefault<z.ZodEnum<{
|
|
390
|
-
static_runtime: "static_runtime";
|
|
391
|
-
}>>;
|
|
392
|
-
region: z.ZodOptional<z.ZodString>;
|
|
393
|
-
isolation: z.ZodDefault<z.ZodEnum<{
|
|
394
|
-
site: "site";
|
|
395
|
-
space: "space";
|
|
396
|
-
}>>;
|
|
397
|
-
tenantId: z.ZodString;
|
|
398
|
-
provisioning: z.ZodOptional<z.ZodObject<{
|
|
399
|
-
importProviderSiteId: z.ZodOptional<z.ZodString>;
|
|
400
|
-
}, z.core.$strip>>;
|
|
401
|
-
}, z.core.$strict>;
|
|
402
|
-
export declare const siteRebalanceRequestSchema: z.ZodObject<{
|
|
403
|
-
spaceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
404
|
-
}, z.core.$strip>;
|
|
405
|
-
export declare const SiteRebalanceResultSchema: z.ZodObject<{
|
|
406
|
-
siteId: z.ZodString;
|
|
407
|
-
moves: z.ZodArray<z.ZodObject<{
|
|
408
|
-
spaceId: z.ZodString;
|
|
409
|
-
operationId: z.ZodString;
|
|
410
|
-
}, z.core.$strip>>;
|
|
411
|
-
warning: z.ZodString;
|
|
412
|
-
domainsRequiringReverification: z.ZodArray<z.ZodObject<{
|
|
413
|
-
spaceId: z.ZodString;
|
|
414
|
-
hostname: z.ZodString;
|
|
415
|
-
}, z.core.$strip>>;
|
|
416
|
-
}, z.core.$strip>;
|
package/dist/contracts/sites.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { AsyncOperationSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
|
|
3
|
-
import { siteClass, siteIsolation, siteKind, siteStatus } from "./enums.js";
|
|
4
|
-
import { PrincipalRefSchema } from "./resources.js";
|
|
5
|
-
// Capacity accounting for shared-pool sites (internal-docs/platform.md "Site").
|
|
6
|
-
// `usedSpaces` counts spaces currently placed on the site.
|
|
7
|
-
export const SiteCapacitySchema = z
|
|
8
|
-
.object({
|
|
9
|
-
maxSpaces: z
|
|
10
|
-
.number()
|
|
11
|
-
.int()
|
|
12
|
-
.nonnegative()
|
|
13
|
-
.optional()
|
|
14
|
-
.describe("Maximum number of spaces this site can host."),
|
|
15
|
-
usedSpaces: z
|
|
16
|
-
.number()
|
|
17
|
-
.int()
|
|
18
|
-
.nonnegative()
|
|
19
|
-
.optional()
|
|
20
|
-
.describe("Spaces currently placed on this site."),
|
|
21
|
-
storageBytes: z
|
|
22
|
-
.number()
|
|
23
|
-
.int()
|
|
24
|
-
.nonnegative()
|
|
25
|
-
.optional()
|
|
26
|
-
.describe("Storage budget for the site in bytes."),
|
|
27
|
-
})
|
|
28
|
-
.describe("Capacity accounting for shared-pool sites.");
|
|
29
|
-
export const SitePressureSchema = z
|
|
30
|
-
.object({
|
|
31
|
-
ewmaLimitedPct: z.number().nonnegative().optional(),
|
|
32
|
-
ewma429: z.number().nonnegative().optional(),
|
|
33
|
-
ewma429PerMin: z.number().nonnegative().optional(),
|
|
34
|
-
ewmaWorkersMax: z.number().nonnegative().optional(),
|
|
35
|
-
ewmaCpuPct: z.number().nonnegative().optional(),
|
|
36
|
-
lastSampleAt: z.string().datetime().optional(),
|
|
37
|
-
consecutivePressured: z.number().int().nonnegative().optional(),
|
|
38
|
-
consecutiveClean: z.number().int().nonnegative().optional(),
|
|
39
|
-
// Monotonic CAS token shared by explicit operator hold actions and the
|
|
40
|
-
// pressure sampler. Every durable hold transition advances it, including
|
|
41
|
-
// transitions that restore a prior timestamp.
|
|
42
|
-
placementHoldRevision: z.number().int().nonnegative().optional(),
|
|
43
|
-
// Provenance stamp for the sampler's automatic hold: set on trip to the
|
|
44
|
-
// exact hold instant it wrote, so release only clears holds the pressure
|
|
45
|
-
// pipeline itself set — never an operator-set placement hold.
|
|
46
|
-
pressureHoldUntil: z.string().datetime().optional(),
|
|
47
|
-
// Last time a bulk-lane engine job on this site reported activity via the
|
|
48
|
-
// job callbacks (runtime/callback-events.ts); the sampler discounts the
|
|
49
|
-
// CPU signal while this is within the sampling window.
|
|
50
|
-
lastBulkLaneActivityAt: z.string().datetime().optional(),
|
|
51
|
-
})
|
|
52
|
-
.passthrough()
|
|
53
|
-
.describe("Placement pressure signals computed outside the request path.");
|
|
54
|
-
// A Site is THE placement unit (internal-docs/platform.md "Site", `site_`):
|
|
55
|
-
// one WP.Cloud site per row. Spaces are placed onto a site via `space.siteId`.
|
|
56
|
-
// Provider linkage (`providerClientId`, `providerRef`) is operator-only and
|
|
57
|
-
// never appears in this tenant-facing shape.
|
|
58
|
-
export const SiteSchema = z.object({
|
|
59
|
-
id: z.string().describe("The site id (`site_...`)."),
|
|
60
|
-
tenantId: z.string().describe("The owning tenant id (`ten_...`)."),
|
|
61
|
-
principal: PrincipalRefSchema.nullable().describe("Owning principal within the tenant; null for tenant-level and pool sites."),
|
|
62
|
-
kind: siteKind.describe("Runtime kind. Only the Spacefast static runtime exists today."),
|
|
63
|
-
isolation: siteIsolation.describe("Whether settings/access default to the site or to each space."),
|
|
64
|
-
status: siteStatus.describe("Site lifecycle status. `ready_pool` is a warm pre-provisioned pool site."),
|
|
65
|
-
region: z.string().describe('Placement region; `"auto"` lets placement decide.'),
|
|
66
|
-
managementHostname: z
|
|
67
|
-
.string()
|
|
68
|
-
.nullable()
|
|
69
|
-
.describe("Hostname the control plane manages the site runtime through."),
|
|
70
|
-
runtimeInstanceId: z.string().nullable().describe("Runtime instance id for this site."),
|
|
71
|
-
provider: z.literal("wpcloud").describe("Hosting provider."),
|
|
72
|
-
capacity: SiteCapacitySchema.nullable().describe("Capacity accounting; null when the site has no explicit budget."),
|
|
73
|
-
operation: AsyncOperationSchema.nullable(),
|
|
74
|
-
createdAt: z.string().datetime(),
|
|
75
|
-
updatedAt: z.string().datetime(),
|
|
76
|
-
});
|
|
77
|
-
// Operator-only WP.Cloud provisioning controls. Tenant site creation never
|
|
78
|
-
// accepts provider object identifiers: authority to create a Spacefast site
|
|
79
|
-
// must not imply authority to adopt existing provider infrastructure.
|
|
80
|
-
export const operatorSiteProvisioningSchema = z
|
|
81
|
-
.object({
|
|
82
|
-
importProviderSiteId: z
|
|
83
|
-
.string()
|
|
84
|
-
.trim()
|
|
85
|
-
.min(1)
|
|
86
|
-
.optional()
|
|
87
|
-
.describe("Import an existing WP.Cloud site by its `atomic_site_id` (operator flows)."),
|
|
88
|
-
})
|
|
89
|
-
.optional();
|
|
90
|
-
// An explicit empty object requests fresh provider provisioning while keeping
|
|
91
|
-
// every provider identity and runtime knob outside tenant control.
|
|
92
|
-
export const tenantSiteProvisioningSchema = z.object({}).strict().optional();
|
|
93
|
-
export const siteCreateSchema = z
|
|
94
|
-
.object({
|
|
95
|
-
teamId: z
|
|
96
|
-
.string()
|
|
97
|
-
.trim()
|
|
98
|
-
.min(1)
|
|
99
|
-
.optional()
|
|
100
|
-
.describe("Team id or slug that will own the site. If omitted, the server infers it from the principal."),
|
|
101
|
-
kind: siteKind.default("static_runtime"),
|
|
102
|
-
isolation: siteIsolation.default("site"),
|
|
103
|
-
region: z.string().trim().min(1).optional().describe('Placement region. Defaults to `"auto"`.'),
|
|
104
|
-
provisioning: tenantSiteProvisioningSchema,
|
|
105
|
-
})
|
|
106
|
-
.strict();
|
|
107
|
-
export const siteListSchema = z.object({
|
|
108
|
-
data: z.array(SiteSchema),
|
|
109
|
-
pagination: CursorPaginationSchema,
|
|
110
|
-
});
|
|
111
|
-
export const siteListQuerySchema = cursorListQuerySchema.extend({
|
|
112
|
-
kind: siteKind.optional().describe("Filter to sites with this runtime kind."),
|
|
113
|
-
});
|
|
114
|
-
// Superadmin site view: the tenant SiteSchema plus the internal provider
|
|
115
|
-
// linkage and placement class (hidden from tenant callers).
|
|
116
|
-
export const SuperadminSiteSchema = SiteSchema.extend({
|
|
117
|
-
class: siteClass.describe("Placement class: pool partition, shared team site, or dedicated."),
|
|
118
|
-
providerClientId: z
|
|
119
|
-
.string()
|
|
120
|
-
.nullable()
|
|
121
|
-
.describe("WP.Cloud client identity (`pvc_...`) the site is provisioned under."),
|
|
122
|
-
providerRef: z.string().nullable().describe("WP.Cloud `atomic_site_id`."),
|
|
123
|
-
});
|
|
124
|
-
export const SuperadminSiteListSchema = z.object({
|
|
125
|
-
sites: z.array(SuperadminSiteSchema),
|
|
126
|
-
});
|
|
127
|
-
// Superadmin site create targets an explicit tenant (the tenant-facing
|
|
128
|
-
// `siteCreateSchema` derives the tenant from the principal).
|
|
129
|
-
export const superadminSiteCreateSchema = siteCreateSchema
|
|
130
|
-
.omit({ provisioning: true, teamId: true })
|
|
131
|
-
.extend({
|
|
132
|
-
tenantId: z.string().trim().min(1),
|
|
133
|
-
provisioning: operatorSiteProvisioningSchema,
|
|
134
|
-
});
|
|
135
|
-
// Operator rebalance trigger (internal-docs/platform.md "Space placement and
|
|
136
|
-
// moves": operator rebalancing is a move trigger). Queues `space_move`
|
|
137
|
-
// operations off the site for the selected (default: all) live spaces.
|
|
138
|
-
export const siteRebalanceRequestSchema = z
|
|
139
|
-
.object({
|
|
140
|
-
spaceIds: z
|
|
141
|
-
.array(z.string().trim().min(1))
|
|
142
|
-
.max(100)
|
|
143
|
-
.optional()
|
|
144
|
-
.describe("Limit the rebalance to these space ids. If omitted, the server rebalances every live space on the site."),
|
|
145
|
-
})
|
|
146
|
-
.describe("Operator-only rebalance trigger: move spaces off this site. This is the ONLY path that relocates an existing Space, and it is not free — see the reverification warning on the result.");
|
|
147
|
-
export const SiteRebalanceResultSchema = z
|
|
148
|
-
.object({
|
|
149
|
-
siteId: z.string().describe("The site id that spaces are being moved off."),
|
|
150
|
-
moves: z
|
|
151
|
-
.array(z.object({
|
|
152
|
-
spaceId: z.string().describe("Space queued to move."),
|
|
153
|
-
operationId: z.string().describe("The queued `space_move` operation id (`op_...`)."),
|
|
154
|
-
}))
|
|
155
|
-
.describe("One queued move operation per affected space."),
|
|
156
|
-
warning: z
|
|
157
|
-
.string()
|
|
158
|
-
.describe("Consequence of relocating these spaces. Each hostname moves to another provider site. The provider re-runs its domain-exclusivity check and rejects the move unless the ownership TXT record is still live in DNS."),
|
|
159
|
-
domainsRequiringReverification: z
|
|
160
|
-
.array(z.object({
|
|
161
|
-
spaceId: z.string().describe("Space the hostname serves."),
|
|
162
|
-
hostname: z
|
|
163
|
-
.string()
|
|
164
|
-
.describe("Custom hostname whose provider ownership check re-runs during the move."),
|
|
165
|
-
}))
|
|
166
|
-
.describe("Live custom hostnames on the moved spaces. Empty means no customer-visible hostname is at risk."),
|
|
167
|
-
})
|
|
168
|
-
.describe("Queued rebalance moves; track each operation for completion.");
|