@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,8 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { accessScopePathSchema } from "./access.js";
|
|
3
|
+
import { makeOffsetListSchema } from "./common.js";
|
|
4
|
+
import { spaceStatus } from "./enums.js";
|
|
3
5
|
import { SpaceSchema } from "./resources.js";
|
|
6
|
+
import { superadminPaginationSchema } from "./superadmin.js";
|
|
4
7
|
import { ZERO_RUNTIME_KIND } from "./zero.js";
|
|
5
|
-
const zeroLogLevelSchema = z.enum(["debug", "info", "warn", "error"]);
|
|
6
8
|
export const SuperadminSpaceHostnameSchema = z.object({
|
|
7
9
|
hostname: z.string(),
|
|
8
10
|
url: z.string(),
|
|
@@ -39,12 +41,13 @@ export const SuperadminSpaceVersionZeroSchema = z
|
|
|
39
41
|
runnerCompatibilityTarget: z.string().nullable(),
|
|
40
42
|
runnerSha256: z.string().nullable(),
|
|
41
43
|
blockIncompatibleRollback: z.boolean(),
|
|
44
|
+
// No log counts. A capsule's output is the space's runtime log like any
|
|
45
|
+
// other tier's, and that lives in one place only — the provider's PHP error
|
|
46
|
+
// log, windowed and paged. Summarising it per version would mean scanning
|
|
47
|
+
// that window on every superadmin page load; read it on the log surface
|
|
48
|
+
// instead.
|
|
42
49
|
operations: z
|
|
43
50
|
.object({
|
|
44
|
-
centralLogCount: z.number().int().nonnegative(),
|
|
45
|
-
centralErrorLogCount: z.number().int().nonnegative(),
|
|
46
|
-
latestLogAt: z.string().datetime().nullable(),
|
|
47
|
-
latestLogLevel: zeroLogLevelSchema.nullable(),
|
|
48
51
|
replayEventCount: z.number().int().nonnegative(),
|
|
49
52
|
latestReplayEventAt: z.string().datetime().nullable(),
|
|
50
53
|
latestReplayEventId: z.string().nullable(),
|
|
@@ -102,27 +105,97 @@ export const SuperadminSpaceViewLinkSchema = z
|
|
|
102
105
|
url: z.string().url(),
|
|
103
106
|
})
|
|
104
107
|
.strict();
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
// The cross-tenant Space list. Same Space resource the customer API returns —
|
|
109
|
+
// operators need the identical shape, not a parallel projection — narrowed by
|
|
110
|
+
// the operator-only facets (tenant, team, ownership, lifecycle, serving).
|
|
111
|
+
export const SuperadminSpaceListSchema = makeOffsetListSchema("spaces", SpaceSchema, superadminPaginationSchema);
|
|
112
|
+
export const superadminSpaceListQuerySchema = z.object({
|
|
113
|
+
limit: z.coerce.number().int().min(1).max(100).default(25),
|
|
114
|
+
offset: z.coerce.number().int().min(0).default(0),
|
|
115
|
+
// Unscoped search is restricted to slug prefixes and exact ids so the query
|
|
116
|
+
// stays index-backed; substring search requires a scoping filter.
|
|
117
|
+
search: z.string().trim().optional(),
|
|
118
|
+
tenantId: z.string().trim().optional(),
|
|
119
|
+
teamId: z.string().trim().optional(),
|
|
120
|
+
// Customer-360: every space owned by any team this user is a member of.
|
|
121
|
+
memberUserId: z.string().trim().optional(),
|
|
122
|
+
ownership: z.enum(["team", "external", "anonymous"]).optional(),
|
|
123
|
+
status: spaceStatus.optional(),
|
|
124
|
+
// Serving axis, independent of lifecycle status: true selects spaces whose
|
|
125
|
+
// serving is currently disabled (takedown, suspension), false the rest.
|
|
126
|
+
disabled: z.stringbool().optional(),
|
|
119
127
|
});
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
// Per-space scan visibility. The evidence is content-addressed — one verdict
|
|
129
|
+
// per (digest, engine, signature DB version), shared by every version that
|
|
130
|
+
// published the same bytes — so this projects it back onto the version's
|
|
131
|
+
// manifest, which is the coordinate an operator actually has.
|
|
132
|
+
export const superadminSpaceScanResultsQuerySchema = z.object({
|
|
133
|
+
// Narrow to one version; otherwise the newest `versionLimit` are returned.
|
|
134
|
+
versionId: z.string().trim().min(1).optional(),
|
|
135
|
+
versionLimit: z.coerce.number().int().min(1).max(20).default(5),
|
|
122
136
|
});
|
|
123
|
-
export const
|
|
137
|
+
export const SuperadminSpaceScanVerdictSchema = z
|
|
138
|
+
.object({
|
|
139
|
+
engine: z.string(),
|
|
140
|
+
signatureDbVersion: z.string(),
|
|
141
|
+
// The evidence row exactly as the engine wrote it. The hash allowlist never
|
|
142
|
+
// rewrites this — suppression is prospective, not a retraction.
|
|
143
|
+
verdict: z.enum(["clean", "flagged", "skipped"]),
|
|
144
|
+
// What enforcement acts on: an allowlisted media-hash flag reads clean.
|
|
145
|
+
effectiveVerdict: z.enum(["clean", "flagged", "skipped"]),
|
|
146
|
+
whitelisted: z.boolean(),
|
|
147
|
+
category: z.string().nullable(),
|
|
148
|
+
severity: z.number().int().nullable(),
|
|
149
|
+
signature: z.string().nullable(),
|
|
150
|
+
firstSeenAt: z.string().datetime().nullable(),
|
|
151
|
+
})
|
|
152
|
+
.strict();
|
|
153
|
+
export const SuperadminSpaceScanFileSchema = z
|
|
154
|
+
.object({
|
|
155
|
+
path: z.string(),
|
|
156
|
+
size: z.number().int().nonnegative(),
|
|
157
|
+
// Historical manifest rows and sourceUrl entries can lack a digest; those
|
|
158
|
+
// files are uncorrelatable and count as unscanned.
|
|
159
|
+
sha256: z.string().nullable(),
|
|
160
|
+
verdicts: z.array(SuperadminSpaceScanVerdictSchema),
|
|
161
|
+
})
|
|
162
|
+
.strict();
|
|
163
|
+
export const SuperadminSpaceScanVersionSchema = z
|
|
164
|
+
.object({
|
|
165
|
+
versionId: z.string(),
|
|
166
|
+
number: z.number().int().nullable(),
|
|
167
|
+
status: z.string(),
|
|
168
|
+
readyAt: z.string().datetime().nullable(),
|
|
169
|
+
files: z.array(SuperadminSpaceScanFileSchema),
|
|
170
|
+
// One bucket per manifest file, by the worst effective verdict it carries:
|
|
171
|
+
// flagged beats skipped beats clean, and a file with no evidence row at all
|
|
172
|
+
// is unscanned. The four always sum to the manifest file count.
|
|
173
|
+
summary: z
|
|
174
|
+
.object({
|
|
175
|
+
flagged: z.number().int().nonnegative(),
|
|
176
|
+
skipped: z.number().int().nonnegative(),
|
|
177
|
+
clean: z.number().int().nonnegative(),
|
|
178
|
+
unscanned: z.number().int().nonnegative(),
|
|
179
|
+
})
|
|
180
|
+
.strict(),
|
|
181
|
+
})
|
|
182
|
+
.strict();
|
|
183
|
+
export const SuperadminSpaceScanResultsSchema = z
|
|
184
|
+
.object({
|
|
185
|
+
// The aggregated space-level verdict the enforcement pipeline settled on.
|
|
186
|
+
spaceScanVerdict: z.string().nullable(),
|
|
187
|
+
versions: z.array(SuperadminSpaceScanVersionSchema),
|
|
188
|
+
})
|
|
189
|
+
.strict();
|
|
190
|
+
// Operator re-home: one assign for every space, claimed or not. The reason is
|
|
191
|
+
// the operator's own note on why ownership moved — it lands in the space's
|
|
192
|
+
// activity feed, so the customer can read it.
|
|
193
|
+
export const superadminSpaceAssignSchema = z
|
|
194
|
+
.object({
|
|
124
195
|
teamId: z.string().min(1),
|
|
125
|
-
|
|
126
|
-
|
|
196
|
+
reason: z.string().trim().min(1).max(500).optional(),
|
|
197
|
+
})
|
|
198
|
+
.strict();
|
|
199
|
+
export const SuperadminSpaceAssignResponseSchema = z.object({
|
|
127
200
|
space: SpaceSchema,
|
|
128
201
|
});
|
|
@@ -14,12 +14,21 @@ export declare const SuperadminTeamSchema: z.ZodObject<{
|
|
|
14
14
|
updatedAt: z.ZodString;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
16
|
export declare const SuperadminTeamMemberSchema: z.ZodObject<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
joinedAt: z.ZodString;
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
teamId: z.ZodString;
|
|
20
19
|
userId: z.ZodString;
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
role: z.ZodEnum<{
|
|
21
|
+
owner: "owner";
|
|
22
|
+
admin: "admin";
|
|
23
|
+
member: "member";
|
|
24
|
+
}>;
|
|
25
|
+
createdAt: z.ZodString;
|
|
26
|
+
user: z.ZodNullable<z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
email: z.ZodString;
|
|
30
|
+
image: z.ZodNullable<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
23
32
|
userBanned: z.ZodBoolean;
|
|
24
33
|
}, z.core.$strip>;
|
|
25
34
|
export declare const SuperadminTeamDetailSchema: z.ZodObject<{
|
|
@@ -36,12 +45,21 @@ export declare const SuperadminTeamDetailSchema: z.ZodObject<{
|
|
|
36
45
|
createdAt: z.ZodString;
|
|
37
46
|
updatedAt: z.ZodString;
|
|
38
47
|
members: z.ZodArray<z.ZodObject<{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
joinedAt: z.ZodString;
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
teamId: z.ZodString;
|
|
42
50
|
userId: z.ZodString;
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
role: z.ZodEnum<{
|
|
52
|
+
owner: "owner";
|
|
53
|
+
admin: "admin";
|
|
54
|
+
member: "member";
|
|
55
|
+
}>;
|
|
56
|
+
createdAt: z.ZodString;
|
|
57
|
+
user: z.ZodNullable<z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
email: z.ZodString;
|
|
61
|
+
image: z.ZodNullable<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
45
63
|
userBanned: z.ZodBoolean;
|
|
46
64
|
}, z.core.$strip>>;
|
|
47
65
|
}, z.core.$strip>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { makeOffsetListSchema } from "./common.js";
|
|
3
3
|
import { superadminPaginationSchema } from "./superadmin.js";
|
|
4
|
+
import { TeamMemberSchema } from "./teams.js";
|
|
4
5
|
export const SuperadminTeamSchema = z.object({
|
|
5
6
|
id: z.string(),
|
|
6
7
|
tenantId: z.string(),
|
|
@@ -15,14 +16,10 @@ export const SuperadminTeamSchema = z.object({
|
|
|
15
16
|
createdAt: z.string().datetime(),
|
|
16
17
|
updatedAt: z.string().datetime(),
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
userId: z.string(),
|
|
23
|
-
userName: z.string(),
|
|
24
|
-
userEmail: z.string().email(),
|
|
25
|
-
userBanned: z.boolean(),
|
|
19
|
+
// Superadmin reads the same membership shape every other surface does, plus
|
|
20
|
+
// the one operator-only fact the product API never exposes.
|
|
21
|
+
export const SuperadminTeamMemberSchema = TeamMemberSchema.extend({
|
|
22
|
+
userBanned: z.boolean().describe("Whether the member's user account is banned."),
|
|
26
23
|
});
|
|
27
24
|
export const SuperadminTeamDetailSchema = SuperadminTeamSchema.extend({
|
|
28
25
|
members: z.array(SuperadminTeamMemberSchema),
|
|
@@ -314,8 +314,6 @@ export declare const SuperadminBillingTransactionSchema: z.ZodObject<{
|
|
|
314
314
|
teamName: z.ZodNullable<z.ZodString>;
|
|
315
315
|
provider: z.ZodEnum<{
|
|
316
316
|
stripe: "stripe";
|
|
317
|
-
app_store: "app_store";
|
|
318
|
-
google_play: "google_play";
|
|
319
317
|
}>;
|
|
320
318
|
kind: z.ZodEnum<{
|
|
321
319
|
purchase: "purchase";
|
|
@@ -356,8 +354,6 @@ export declare const SuperadminTeamBillingOverviewSchema: z.ZodObject<{
|
|
|
356
354
|
provider: z.ZodEnum<{
|
|
357
355
|
grant: "grant";
|
|
358
356
|
stripe: "stripe";
|
|
359
|
-
app_store: "app_store";
|
|
360
|
-
google_play: "google_play";
|
|
361
357
|
}>;
|
|
362
358
|
planCode: z.ZodString;
|
|
363
359
|
active: z.ZodBoolean;
|
|
@@ -369,26 +365,12 @@ export declare const SuperadminTeamBillingOverviewSchema: z.ZodObject<{
|
|
|
369
365
|
export declare const SuperadminWpCloudSiteSchema: z.ZodObject<{
|
|
370
366
|
providerSiteId: z.ZodString;
|
|
371
367
|
placementId: z.ZodNullable<z.ZodString>;
|
|
372
|
-
placementKind: z.ZodNullable<z.ZodEnum<{
|
|
373
|
-
shared: "shared";
|
|
374
|
-
dedicated: "dedicated";
|
|
375
|
-
shared_org: "shared_org";
|
|
376
|
-
anonymous_pool: "anonymous_pool";
|
|
377
|
-
dedicated_space: "dedicated_space";
|
|
378
|
-
}>>;
|
|
379
368
|
placementState: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
380
369
|
placementStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
381
370
|
placementPrimaryHostname: z.ZodNullable<z.ZodString>;
|
|
382
371
|
placementDatacenterId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
383
372
|
placementRegion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
384
373
|
placementGeoAffinity: z.ZodNullable<z.ZodString>;
|
|
385
|
-
anonymousPoolId: z.ZodNullable<z.ZodString>;
|
|
386
|
-
anonymousPoolState: z.ZodNullable<z.ZodEnum<{
|
|
387
|
-
active: "active";
|
|
388
|
-
disabled: "disabled";
|
|
389
|
-
draining: "draining";
|
|
390
|
-
}>>;
|
|
391
|
-
anonymousPoolAssignedSpaceCount: z.ZodNullable<z.ZodNumber>;
|
|
392
374
|
assignedSpaceCount: z.ZodNumber;
|
|
393
375
|
assignedSpaces: z.ZodArray<z.ZodObject<{
|
|
394
376
|
id: z.ZodString;
|
|
@@ -437,26 +419,12 @@ export declare const SuperadminWpCloudSiteListSchema: z.ZodObject<{
|
|
|
437
419
|
sites: z.ZodArray<z.ZodObject<{
|
|
438
420
|
providerSiteId: z.ZodString;
|
|
439
421
|
placementId: z.ZodNullable<z.ZodString>;
|
|
440
|
-
placementKind: z.ZodNullable<z.ZodEnum<{
|
|
441
|
-
shared: "shared";
|
|
442
|
-
dedicated: "dedicated";
|
|
443
|
-
shared_org: "shared_org";
|
|
444
|
-
anonymous_pool: "anonymous_pool";
|
|
445
|
-
dedicated_space: "dedicated_space";
|
|
446
|
-
}>>;
|
|
447
422
|
placementState: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
448
423
|
placementStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
449
424
|
placementPrimaryHostname: z.ZodNullable<z.ZodString>;
|
|
450
425
|
placementDatacenterId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
451
426
|
placementRegion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
452
427
|
placementGeoAffinity: z.ZodNullable<z.ZodString>;
|
|
453
|
-
anonymousPoolId: z.ZodNullable<z.ZodString>;
|
|
454
|
-
anonymousPoolState: z.ZodNullable<z.ZodEnum<{
|
|
455
|
-
active: "active";
|
|
456
|
-
disabled: "disabled";
|
|
457
|
-
draining: "draining";
|
|
458
|
-
}>>;
|
|
459
|
-
anonymousPoolAssignedSpaceCount: z.ZodNullable<z.ZodNumber>;
|
|
460
428
|
assignedSpaceCount: z.ZodNumber;
|
|
461
429
|
assignedSpaces: z.ZodArray<z.ZodObject<{
|
|
462
430
|
id: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { makeOffsetListSchema } from "./common.js";
|
|
3
|
-
import { buildStatus
|
|
3
|
+
import { buildStatus } from "./enums.js";
|
|
4
4
|
// Operator-only offset pagination. The platform API uses opaque cursors exclusively
|
|
5
5
|
// (contracts/common.ts); the superadmin surface is the one sanctioned exception.
|
|
6
6
|
export const superadminPaginationSchema = z.object({
|
|
@@ -183,7 +183,7 @@ export const SuperadminBillingTransactionSchema = z.object({
|
|
|
183
183
|
teamId: z.string().nullable(),
|
|
184
184
|
teamSlug: z.string().nullable(),
|
|
185
185
|
teamName: z.string().nullable(),
|
|
186
|
-
provider: z.enum(["stripe"
|
|
186
|
+
provider: z.enum(["stripe"]),
|
|
187
187
|
kind: z.enum(["purchase", "renewal", "refund", "adjustment"]),
|
|
188
188
|
scope: z.enum(["plan", "seats", "domain", "other"]),
|
|
189
189
|
planCode: z.string().nullable(),
|
|
@@ -210,7 +210,7 @@ export const SuperadminTeamBillingOverviewSchema = z.object({
|
|
|
210
210
|
}),
|
|
211
211
|
planCode: z.string(),
|
|
212
212
|
sources: z.array(z.object({
|
|
213
|
-
provider: z.enum(["stripe", "
|
|
213
|
+
provider: z.enum(["stripe", "grant"]),
|
|
214
214
|
planCode: z.string(),
|
|
215
215
|
active: z.boolean(),
|
|
216
216
|
detail: z.string(),
|
|
@@ -221,20 +221,12 @@ export const SuperadminTeamBillingOverviewSchema = z.object({
|
|
|
221
221
|
export const SuperadminWpCloudSiteSchema = z.object({
|
|
222
222
|
providerSiteId: z.string(),
|
|
223
223
|
placementId: z.string().nullable(),
|
|
224
|
-
// Reuses `siteClass` (enums.ts) rather than a private legacy-only literal
|
|
225
|
-
// union — this echoes the site's raw placementMode column, which Deploy T
|
|
226
|
-
// still tolerates in both legacy (anonymous_pool/shared_org/dedicated_space)
|
|
227
|
-
// and normalized (shared/dedicated) form.
|
|
228
|
-
placementKind: siteClass.nullable(),
|
|
229
224
|
placementState: z.string().nullable().optional(),
|
|
230
225
|
placementStatus: z.string().nullable().optional(),
|
|
231
226
|
placementPrimaryHostname: z.string().nullable(),
|
|
232
227
|
placementDatacenterId: z.string().nullable().optional(),
|
|
233
228
|
placementRegion: z.string().nullable().optional(),
|
|
234
229
|
placementGeoAffinity: z.string().nullable(),
|
|
235
|
-
anonymousPoolId: z.string().nullable(),
|
|
236
|
-
anonymousPoolState: z.enum(["active", "draining", "disabled"]).nullable(),
|
|
237
|
-
anonymousPoolAssignedSpaceCount: z.number().int().nonnegative().nullable(),
|
|
238
230
|
assignedSpaceCount: z.number().int().nonnegative(),
|
|
239
231
|
assignedSpaces: z.array(z.object({
|
|
240
232
|
id: z.string(),
|
package/dist/contracts/tags.d.ts
CHANGED
|
@@ -81,8 +81,8 @@ export declare const tagConsentPolicySchema: z.ZodObject<{
|
|
|
81
81
|
code: z.ZodString;
|
|
82
82
|
severity: z.ZodEnum<{
|
|
83
83
|
info: "info";
|
|
84
|
-
error: "error";
|
|
85
84
|
warning: "warning";
|
|
85
|
+
error: "error";
|
|
86
86
|
}>;
|
|
87
87
|
message: z.ZodString;
|
|
88
88
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -142,8 +142,8 @@ export declare const tagValidationResultSchema: z.ZodObject<{
|
|
|
142
142
|
code: z.ZodString;
|
|
143
143
|
severity: z.ZodEnum<{
|
|
144
144
|
info: "info";
|
|
145
|
-
error: "error";
|
|
146
145
|
warning: "warning";
|
|
146
|
+
error: "error";
|
|
147
147
|
}>;
|
|
148
148
|
message: z.ZodString;
|
|
149
149
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -191,8 +191,8 @@ export declare const tagVersionSchema: z.ZodObject<{
|
|
|
191
191
|
code: z.ZodString;
|
|
192
192
|
severity: z.ZodEnum<{
|
|
193
193
|
info: "info";
|
|
194
|
-
error: "error";
|
|
195
194
|
warning: "warning";
|
|
195
|
+
error: "error";
|
|
196
196
|
}>;
|
|
197
197
|
message: z.ZodString;
|
|
198
198
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -261,8 +261,8 @@ export declare const tagVersionListResponseSchema: z.ZodObject<{
|
|
|
261
261
|
code: z.ZodString;
|
|
262
262
|
severity: z.ZodEnum<{
|
|
263
263
|
info: "info";
|
|
264
|
-
error: "error";
|
|
265
264
|
warning: "warning";
|
|
265
|
+
error: "error";
|
|
266
266
|
}>;
|
|
267
267
|
message: z.ZodString;
|
|
268
268
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -324,8 +324,8 @@ export declare const tagVersionResponseSchema: z.ZodObject<{
|
|
|
324
324
|
code: z.ZodString;
|
|
325
325
|
severity: z.ZodEnum<{
|
|
326
326
|
info: "info";
|
|
327
|
-
error: "error";
|
|
328
327
|
warning: "warning";
|
|
328
|
+
error: "error";
|
|
329
329
|
}>;
|
|
330
330
|
message: z.ZodString;
|
|
331
331
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -419,8 +419,8 @@ export declare const tagValidateResponseSchema: z.ZodObject<{
|
|
|
419
419
|
code: z.ZodString;
|
|
420
420
|
severity: z.ZodEnum<{
|
|
421
421
|
info: "info";
|
|
422
|
-
error: "error";
|
|
423
422
|
warning: "warning";
|
|
423
|
+
error: "error";
|
|
424
424
|
}>;
|
|
425
425
|
message: z.ZodString;
|
|
426
426
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -640,8 +640,8 @@ export declare const tagApplyResponseSchema: z.ZodObject<{
|
|
|
640
640
|
code: z.ZodString;
|
|
641
641
|
severity: z.ZodEnum<{
|
|
642
642
|
info: "info";
|
|
643
|
-
error: "error";
|
|
644
643
|
warning: "warning";
|
|
644
|
+
error: "error";
|
|
645
645
|
}>;
|
|
646
646
|
message: z.ZodString;
|
|
647
647
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -673,8 +673,8 @@ export declare const tagApplyResponseSchema: z.ZodObject<{
|
|
|
673
673
|
code: z.ZodString;
|
|
674
674
|
severity: z.ZodEnum<{
|
|
675
675
|
info: "info";
|
|
676
|
-
error: "error";
|
|
677
676
|
warning: "warning";
|
|
677
|
+
error: "error";
|
|
678
678
|
}>;
|
|
679
679
|
message: z.ZodString;
|
|
680
680
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1022,8 +1022,8 @@ export declare const tagConsentPolicyResponseSchema: z.ZodObject<{
|
|
|
1022
1022
|
code: z.ZodString;
|
|
1023
1023
|
severity: z.ZodEnum<{
|
|
1024
1024
|
info: "info";
|
|
1025
|
-
error: "error";
|
|
1026
1025
|
warning: "warning";
|
|
1026
|
+
error: "error";
|
|
1027
1027
|
}>;
|
|
1028
1028
|
message: z.ZodString;
|
|
1029
1029
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -5,6 +5,12 @@ export declare const teamMemberRole: z.ZodEnum<{
|
|
|
5
5
|
admin: "admin";
|
|
6
6
|
member: "member";
|
|
7
7
|
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Better Auth stores the member role as free text, so every surface that reads
|
|
10
|
+
* it back has to land on the same canonical value. Unknown roles carry no
|
|
11
|
+
* privilege, so they read as the least-privileged one.
|
|
12
|
+
*/
|
|
13
|
+
export declare function normalizeTeamMemberRole(role: string | null | undefined): "owner" | "admin" | "member";
|
|
8
14
|
export declare const teamInvitationCreateSchema: z.ZodObject<{
|
|
9
15
|
email: z.ZodString;
|
|
10
16
|
role: z.ZodDefault<z.ZodEnum<{
|
|
@@ -29,6 +35,37 @@ export declare const teamSpaceListQuerySchema: z.ZodObject<{
|
|
|
29
35
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
30
36
|
cursor: z.ZodOptional<z.ZodString>;
|
|
31
37
|
}, z.core.$strip>;
|
|
38
|
+
export declare const TeamMemberUserSchema: z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
email: z.ZodString;
|
|
42
|
+
image: z.ZodNullable<z.ZodString>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const TeamMemberSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
teamId: z.ZodString;
|
|
47
|
+
userId: z.ZodString;
|
|
48
|
+
role: z.ZodEnum<{
|
|
49
|
+
owner: "owner";
|
|
50
|
+
admin: "admin";
|
|
51
|
+
member: "member";
|
|
52
|
+
}>;
|
|
53
|
+
createdAt: z.ZodString;
|
|
54
|
+
user: z.ZodNullable<z.ZodObject<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
email: z.ZodString;
|
|
58
|
+
image: z.ZodNullable<z.ZodString>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export declare const teamMemberRoleUpdateSchema: z.ZodObject<{
|
|
62
|
+
role: z.ZodEnum<{
|
|
63
|
+
owner: "owner";
|
|
64
|
+
admin: "admin";
|
|
65
|
+
member: "member";
|
|
66
|
+
}>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type TeamMember = z.infer<typeof TeamMemberSchema>;
|
|
32
69
|
export declare const TeamInvitationSchema: z.ZodObject<{
|
|
33
70
|
id: z.ZodString;
|
|
34
71
|
teamId: z.ZodString;
|
|
@@ -42,6 +79,7 @@ export declare const TeamInvitationSchema: z.ZodObject<{
|
|
|
42
79
|
expiresAt: z.ZodString;
|
|
43
80
|
createdAt: z.ZodString;
|
|
44
81
|
}, z.core.$strip>;
|
|
82
|
+
export type TeamInvitation = z.infer<typeof TeamInvitationSchema>;
|
|
45
83
|
export declare const teamPlanCode: z.ZodEnum<{
|
|
46
84
|
free: "free";
|
|
47
85
|
internal: "internal";
|
package/dist/contracts/teams.js
CHANGED
|
@@ -3,6 +3,15 @@ import { CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
|
|
|
3
3
|
import { planCodeSchema, planLimitValueSchema } from "./features.js";
|
|
4
4
|
export const TEAM_ROLE_VALUES = ["owner", "admin", "member"];
|
|
5
5
|
export const teamMemberRole = z.enum(TEAM_ROLE_VALUES);
|
|
6
|
+
/**
|
|
7
|
+
* Better Auth stores the member role as free text, so every surface that reads
|
|
8
|
+
* it back has to land on the same canonical value. Unknown roles carry no
|
|
9
|
+
* privilege, so they read as the least-privileged one.
|
|
10
|
+
*/
|
|
11
|
+
export function normalizeTeamMemberRole(role) {
|
|
12
|
+
const parsed = teamMemberRole.safeParse(role ?? "member");
|
|
13
|
+
return parsed.success ? parsed.data : "member";
|
|
14
|
+
}
|
|
6
15
|
export const teamInvitationCreateSchema = z.object({
|
|
7
16
|
email: z.string().trim().email().toLowerCase(),
|
|
8
17
|
role: teamMemberRole.default("member"),
|
|
@@ -11,19 +20,26 @@ export const teamMemberListQuerySchema = cursorListQuerySchema;
|
|
|
11
20
|
export const teamInvitationListQuerySchema = cursorListQuerySchema;
|
|
12
21
|
export const teamListQuerySchema = cursorListQuerySchema;
|
|
13
22
|
export const teamSpaceListQuerySchema = cursorListQuerySchema;
|
|
14
|
-
const TeamMemberUserSchema = z.object({
|
|
15
|
-
id: z.string(),
|
|
16
|
-
name: z.string(),
|
|
17
|
-
email: z.string().email(),
|
|
18
|
-
image: z.string().nullable(),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
export const TeamMemberUserSchema = z.object({
|
|
24
|
+
id: z.string().describe("The member's user id."),
|
|
25
|
+
name: z.string().describe("The member's display name."),
|
|
26
|
+
email: z.string().email().describe("The member's email address."),
|
|
27
|
+
image: z.string().nullable().describe("Avatar URL, or null when the user has none."),
|
|
28
|
+
});
|
|
29
|
+
// The one membership shape: every surface that shows or edits a team member
|
|
30
|
+
// (dashboard, superadmin, CLI, MCP) types from this. Better Auth's
|
|
31
|
+
// organization plugin owns the underlying rows, but its plugin-inferred types
|
|
32
|
+
// never cross an app boundary.
|
|
33
|
+
export const TeamMemberSchema = z.object({
|
|
34
|
+
id: z.string().describe("The membership id, stable for the life of the membership."),
|
|
35
|
+
teamId: z.string().describe("The team this membership belongs to."),
|
|
36
|
+
userId: z.string().describe("The member's user id."),
|
|
37
|
+
role: teamMemberRole.describe("The member's role on the team."),
|
|
38
|
+
createdAt: z.string().datetime().describe("Instant the member joined the team."),
|
|
39
|
+
user: TeamMemberUserSchema.nullable().describe("The member's user record; null when the user row is unavailable."),
|
|
40
|
+
});
|
|
41
|
+
export const teamMemberRoleUpdateSchema = z.object({
|
|
42
|
+
role: teamMemberRole.describe("The role to grant this member."),
|
|
27
43
|
});
|
|
28
44
|
export const TeamInvitationSchema = z.object({
|
|
29
45
|
id: z.string(),
|
|
@@ -135,7 +151,9 @@ export const teamUsageResponseSchema = z.object({
|
|
|
135
151
|
spaces: z.number().int().describe("Live spaces in the team."),
|
|
136
152
|
domains: z.number().int().describe("External domain groups counted against the plan."),
|
|
137
153
|
members: z.number().int().describe("Team members."),
|
|
138
|
-
storageBytes: z
|
|
154
|
+
storageBytes: z
|
|
155
|
+
.number()
|
|
156
|
+
.describe("Disk actually occupied across the team's spaces, as measured by the serving infrastructure. Nothing is deduplicated: a file present in two spaces sits on two disks and counts twice."),
|
|
139
157
|
storageQuotaBytes: z
|
|
140
158
|
.union([z.number(), z.literal("unlimited")])
|
|
141
159
|
.describe('Plan storage quota; "unlimited" when unbounded.'),
|
|
@@ -143,7 +161,7 @@ export const teamUsageResponseSchema = z.object({
|
|
|
143
161
|
storageCalculatedAt: z
|
|
144
162
|
.string()
|
|
145
163
|
.nullable()
|
|
146
|
-
.describe("
|
|
164
|
+
.describe("How far back the weakest measurement behind this total reaches. Null when the team's storage has not been measured yet. This is a lagging meter — expect it to trail the present by about an hour."),
|
|
147
165
|
buildsDeploysThisMonth: z
|
|
148
166
|
.number()
|
|
149
167
|
.int()
|
|
@@ -162,7 +180,7 @@ export const teamUsageResponseSchema = z.object({
|
|
|
162
180
|
title: z.string().describe("Space display title."),
|
|
163
181
|
storageBytes: z
|
|
164
182
|
.number()
|
|
165
|
-
.describe("
|
|
183
|
+
.describe("Disk this space occupies, as measured by the infrastructure serving it. Zero for a space that has not been measured yet."),
|
|
166
184
|
}))
|
|
167
185
|
.describe("Per-space storage breakdown for spaces the caller can read."),
|
|
168
186
|
});
|
|
@@ -45,59 +45,10 @@ export declare const spaceTransferSchema: z.ZodObject<{
|
|
|
45
45
|
}, z.core.$strip>;
|
|
46
46
|
status: z.ZodEnum<{
|
|
47
47
|
pending_confirmation: "pending_confirmation";
|
|
48
|
-
confirming_domains: "confirming_domains";
|
|
49
48
|
completed: "completed";
|
|
50
49
|
canceled: "canceled";
|
|
51
50
|
expired: "expired";
|
|
52
51
|
}>;
|
|
53
|
-
requiredActions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
54
|
-
type: z.ZodLiteral<"dns">;
|
|
55
|
-
instructions: z.ZodArray<z.ZodObject<{
|
|
56
|
-
type: z.ZodEnum<{
|
|
57
|
-
A: "A";
|
|
58
|
-
AAAA: "AAAA";
|
|
59
|
-
CNAME: "CNAME";
|
|
60
|
-
TXT: "TXT";
|
|
61
|
-
ALIAS: "ALIAS";
|
|
62
|
-
}>;
|
|
63
|
-
name: z.ZodString;
|
|
64
|
-
value: z.ZodString;
|
|
65
|
-
ttl: z.ZodOptional<z.ZodNumber>;
|
|
66
|
-
purpose: z.ZodEnum<{
|
|
67
|
-
verification: "verification";
|
|
68
|
-
routing: "routing";
|
|
69
|
-
ssl: "ssl";
|
|
70
|
-
}>;
|
|
71
|
-
}, z.core.$strip>>;
|
|
72
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
73
|
-
type: z.ZodLiteral<"confirm_move">;
|
|
74
|
-
conflictId: z.ZodString;
|
|
75
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
-
type: z.ZodLiteral<"verify_domain">;
|
|
77
|
-
domainId: z.ZodString;
|
|
78
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
-
type: z.ZodLiteral<"renew">;
|
|
80
|
-
domainId: z.ZodString;
|
|
81
|
-
}, z.core.$strip>], "type">>;
|
|
82
|
-
diagnostics: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
83
|
-
code: z.ZodString;
|
|
84
|
-
severity: z.ZodEnum<{
|
|
85
|
-
info: "info";
|
|
86
|
-
error: "error";
|
|
87
|
-
warning: "warning";
|
|
88
|
-
}>;
|
|
89
|
-
message: z.ZodString;
|
|
90
|
-
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
-
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
92
|
-
registrar: "registrar";
|
|
93
|
-
wpcloud: "wpcloud";
|
|
94
|
-
dns: "dns";
|
|
95
|
-
runtime: "runtime";
|
|
96
|
-
}>>>;
|
|
97
|
-
details: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
98
|
-
fix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
-
retryable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
100
|
-
}, z.core.$strip>>>;
|
|
101
52
|
expiresAt: z.ZodString;
|
|
102
53
|
createdAt: z.ZodString;
|
|
103
54
|
updatedAt: z.ZodString;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { baseDiagnosticSchema, requiredActionsSchema } from "./common.js";
|
|
3
2
|
import { spaceTransferStatus } from "./enums.js";
|
|
4
3
|
// Tenant-local external principal id grammar (internal-docs/platform.md
|
|
5
4
|
// "Principal"): 1-256 chars, no whitespace, no `/` or `\`, no
|
|
@@ -34,11 +33,8 @@ export const spaceTransferSchema = z.object({
|
|
|
34
33
|
id: z.string().describe("SpaceTransfer id (`trf_`)."),
|
|
35
34
|
spaceId: z.string().describe("Space being transferred."),
|
|
36
35
|
from: transferPrincipalSchema.describe("Current owner. Keeps full control, serving, and billing attribution until `completed`."),
|
|
37
|
-
to: transferPrincipalSchema.describe("Receiving principal.
|
|
38
|
-
status: spaceTransferStatus.describe("Transfer state.
|
|
39
|
-
// Domain confirmations the receiving principal must complete before the move.
|
|
40
|
-
requiredActions: requiredActionsSchema,
|
|
41
|
-
diagnostics: z.array(baseDiagnosticSchema).default([]),
|
|
36
|
+
to: transferPrincipalSchema.describe("Receiving principal. Accept is a to-side action."),
|
|
37
|
+
status: spaceTransferStatus.describe("Transfer state. Accepting moves ownership in one transaction, so a transfer is either still `pending_confirmation` or already terminal."),
|
|
42
38
|
expiresAt: z
|
|
43
39
|
.string()
|
|
44
40
|
.datetime()
|