@spacefast/common 0.0.5 → 0.0.7
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/brand-assets/spacefast-favicon.svg +16 -0
- package/brand-assets/spacefast-sf-full-bleed.svg +13 -0
- package/brand-assets/spacefast-wordmark.svg +5 -0
- package/dist/agents/connect-targets.d.ts +138 -0
- package/dist/agents/connect-targets.js +243 -0
- package/dist/brand-assets-build.d.ts +26 -0
- package/dist/brand-assets-build.js +81 -0
- package/dist/brand-assets.d.ts +42 -0
- package/dist/brand-assets.js +30 -0
- package/dist/brand.d.ts +1 -0
- package/dist/brand.js +5 -0
- package/dist/config/domains.d.ts +12 -6
- package/dist/config/domains.js +30 -38
- package/dist/contracts/access.d.ts +967 -124
- package/dist/contracts/access.js +804 -148
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +28 -2
- package/dist/contracts/annotations.d.ts +2 -4
- package/dist/contracts/api-keys.d.ts +126 -4
- package/dist/contracts/api-keys.js +74 -6
- package/dist/contracts/archives.d.ts +8 -2
- package/dist/contracts/archives.js +11 -4
- package/dist/contracts/billing.d.ts +0 -9
- package/dist/contracts/builds.d.ts +65 -21
- package/dist/contracts/builds.js +29 -0
- package/dist/contracts/common.d.ts +2 -0
- package/dist/contracts/common.js +4 -0
- package/dist/contracts/continuation.d.ts +0 -3
- package/dist/contracts/countries.d.ts +2 -0
- package/dist/contracts/countries.js +261 -0
- package/dist/contracts/deployments.d.ts +34 -34
- package/dist/contracts/device-auth.d.ts +4 -11
- package/dist/contracts/device-auth.js +4 -0
- package/dist/contracts/docs.d.ts +119 -0
- package/dist/contracts/docs.js +51 -0
- package/dist/contracts/domains.d.ts +96 -54
- package/dist/contracts/domains.js +26 -4
- package/dist/contracts/enums.d.ts +15 -16
- package/dist/contracts/enums.js +26 -14
- package/dist/contracts/error-code-meta.d.ts +184 -0
- package/dist/contracts/error-code-meta.js +124 -10
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +42 -0
- package/dist/contracts/events.d.ts +1 -1
- package/dist/contracts/feature-lifecycle-core.d.ts +36 -0
- package/dist/contracts/feature-lifecycle-core.js +220 -0
- package/dist/contracts/feature-lifecycle.d.ts +7 -0
- package/dist/contracts/feature-lifecycle.js +31 -0
- package/dist/contracts/features.d.ts +76 -6
- package/dist/contracts/features.js +178 -13
- package/dist/contracts/generated-feature-launch-entries.d.ts +2 -0
- package/dist/contracts/generated-feature-launch-entries.js +518 -0
- package/dist/contracts/git.d.ts +2 -8
- package/dist/contracts/ids.d.ts +9 -0
- package/dist/contracts/ids.js +13 -0
- package/dist/contracts/mcp.d.ts +8 -10
- package/dist/contracts/me.js +1 -1
- package/dist/contracts/oauth-resources.d.ts +19 -8
- package/dist/contracts/oauth-resources.js +44 -13
- package/dist/contracts/operations.d.ts +161 -1
- package/dist/contracts/operations.js +49 -1
- package/dist/contracts/platform.d.ts +6 -102
- package/dist/contracts/platform.js +6 -50
- package/dist/contracts/publishes.d.ts +130 -0
- package/dist/contracts/publishes.js +145 -0
- package/dist/contracts/push-new.d.ts +4 -4
- package/dist/contracts/quotas.d.ts +2 -0
- package/dist/contracts/quotas.js +8 -0
- package/dist/contracts/repository-connections.d.ts +9 -8
- package/dist/contracts/repository-connections.js +13 -0
- package/dist/contracts/resources.d.ts +99 -13
- package/dist/contracts/resources.js +36 -4
- package/dist/contracts/routes.d.ts +0 -2
- package/dist/contracts/runtime-api.d.ts +363 -39
- package/dist/contracts/runtime-api.js +276 -6
- package/dist/contracts/sf-config-v1.d.ts +75 -0
- package/dist/contracts/sf-config-v1.js +6 -0
- package/dist/contracts/sites.d.ts +19 -2
- package/dist/contracts/sites.js +21 -0
- package/dist/contracts/space-config.d.ts +201 -2
- package/dist/contracts/space-config.js +135 -5
- package/dist/contracts/spaces.d.ts +376 -196
- package/dist/contracts/spaces.js +62 -10
- package/dist/contracts/superadmin-emails.d.ts +4 -2
- package/dist/contracts/superadmin-emails.js +8 -0
- package/dist/contracts/superadmin-queues.d.ts +26 -26
- package/dist/contracts/superadmin-spaces.d.ts +172 -42
- package/dist/contracts/superadmin-tenants.d.ts +6 -6
- package/dist/contracts/superadmin-tenants.js +6 -11
- package/dist/contracts/superadmin.d.ts +6 -93
- package/dist/contracts/superadmin.js +6 -14
- package/dist/contracts/tags.d.ts +10 -9
- package/dist/contracts/tags.js +2 -1
- package/dist/contracts/teams.d.ts +26 -30
- package/dist/contracts/teams.js +11 -17
- package/dist/contracts/theme-json.d.ts +30 -0
- package/dist/contracts/theme-json.js +48 -0
- package/dist/contracts/variables.d.ts +0 -2
- package/dist/contracts/variables.js +0 -5
- package/dist/contracts/webhooks.d.ts +2 -0
- package/dist/contracts/webhooks.js +1 -1
- package/dist/contracts/zero.d.ts +5 -10
- package/dist/docs/agent-prose.d.ts +43 -3
- package/dist/docs/agent-prose.js +146 -7
- package/dist/docs/agent-setup.d.ts +51 -0
- package/dist/docs/agent-setup.js +211 -14
- package/dist/docs/agent-solutions.d.ts +5 -5
- package/dist/docs/agent-solutions.js +2 -2
- package/dist/docs/catalog.d.ts +650 -0
- package/dist/docs/catalog.js +758 -0
- package/dist/docs/error-docs.d.ts +0 -2
- package/dist/docs/error-docs.js +189 -35
- package/dist/docs/index-build.d.ts +17 -0
- package/dist/docs/index-build.js +24 -0
- package/dist/docs/search.d.ts +54 -0
- package/dist/docs/search.js +96 -0
- package/dist/docs/skill-distribution.d.ts +5 -3
- package/dist/docs/skill-distribution.js +8 -8
- package/dist/slug-policy/blocklist.d.ts +4 -0
- package/dist/slug-policy/blocklist.js +122 -0
- package/dist/slug-policy/index.d.ts +17 -0
- package/dist/slug-policy/index.js +86 -0
- package/dist/utils/access-match.d.ts +39 -0
- package/dist/utils/access-match.js +296 -0
- package/dist/utils/auth-redirect.d.ts +3 -1
- package/dist/utils/auth-redirect.js +21 -1
- package/dist/utils/build-settings.d.ts +6 -0
- package/dist/utils/build-settings.js +429 -46
- package/dist/utils/claim-token.d.ts +8 -0
- package/dist/utils/claim-token.js +23 -2
- package/dist/utils/concurrency.d.ts +1 -0
- package/dist/utils/concurrency.js +22 -0
- package/dist/utils/content-type.d.ts +1 -0
- package/dist/utils/content-type.js +1 -1
- package/dist/utils/credential-policy.d.ts +54 -0
- package/dist/utils/{access-policy.js → credential-policy.js} +28 -2
- package/dist/utils/email.d.ts +1 -0
- package/dist/utils/email.js +3 -0
- package/dist/utils/gate-theme.d.ts +61 -0
- package/dist/utils/gate-theme.js +217 -0
- package/dist/utils/git-repository.d.ts +0 -1
- package/dist/utils/git-repository.js +0 -3
- package/dist/utils/id-hints.d.ts +8 -0
- package/dist/utils/id-hints.js +61 -0
- package/dist/utils/local-space-state.d.ts +91 -0
- package/dist/utils/local-space-state.js +251 -0
- package/dist/utils/oauth-signed-query.d.ts +8 -0
- package/dist/utils/oauth-signed-query.js +26 -0
- package/dist/utils/publish-detection.d.ts +0 -8
- package/dist/utils/publish-detection.js +0 -93
- package/dist/utils/publish-policy.d.ts +6 -5
- package/dist/utils/publish-policy.js +71 -7
- package/dist/utils/query-keys.d.ts +16 -4
- package/dist/utils/query-keys.js +31 -4
- package/dist/utils/runtime-paths.d.ts +0 -1
- package/dist/utils/runtime-paths.js +0 -1
- package/dist/utils/runtime-upload-batch.d.ts +18 -0
- package/dist/utils/runtime-upload-batch.js +90 -0
- package/dist/utils/runtime-upload.d.ts +2 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/sf-config-v1.d.ts +2 -0
- package/dist/utils/sf-config-v1.js +542 -0
- package/dist/utils/space-config.d.ts +4 -0
- package/dist/utils/space-config.js +10 -1
- package/dist/utils/space-theme.d.ts +2 -0
- package/dist/utils/space-theme.js +9 -0
- package/dist/utils/static-runtime-policy.d.ts +0 -21
- package/dist/utils/static-runtime-policy.js +19 -103
- package/dist/utils/upload-session.d.ts +1 -1
- package/dist/utils/wpcom-auth-redirects.d.ts +32 -2
- package/dist/utils/wpcom-auth-redirects.js +26 -10
- package/dist/vocabulary.d.ts +130 -30
- package/dist/vocabulary.js +77 -36
- package/package.json +35 -1
- package/dist/contracts/account.d.ts +0 -28
- package/dist/contracts/account.js +0 -54
- package/dist/contracts/intercom.d.ts +0 -6
- package/dist/contracts/intercom.js +0 -5
- package/dist/contracts/telemetry.d.ts +0 -2
- package/dist/contracts/telemetry.js +0 -1
- package/dist/utils/access-policy.d.ts +0 -39
- package/dist/utils/error-display.d.ts +0 -7
- package/dist/utils/error-display.js +0 -42
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
export const FEATURE_STAGES = ["internal", "private_beta", "ga"];
|
|
2
|
+
export const FEATURE_ASSIGNMENT_SCOPES = ["user", "team", "global"];
|
|
3
|
+
export const FEATURE_EXECUTION_ACTOR_POLICIES = [
|
|
4
|
+
"request_actor",
|
|
5
|
+
"persisted_request_actor",
|
|
6
|
+
"resource_team",
|
|
7
|
+
"global_policy",
|
|
8
|
+
];
|
|
9
|
+
export const FEATURE_OWNER_IDS = [
|
|
10
|
+
"team:access",
|
|
11
|
+
"team:build-platform",
|
|
12
|
+
"team:collaboration",
|
|
13
|
+
"team:commerce",
|
|
14
|
+
"team:domains",
|
|
15
|
+
"team:publishing",
|
|
16
|
+
"team:runtime",
|
|
17
|
+
"team:spaces",
|
|
18
|
+
"team:tag-manager",
|
|
19
|
+
"team:zero",
|
|
20
|
+
];
|
|
21
|
+
export function freezeFeatureRegistryEntry(definition) {
|
|
22
|
+
return Object.freeze({
|
|
23
|
+
...definition,
|
|
24
|
+
assignmentScopes: Object.freeze([...definition.assignmentScopes]),
|
|
25
|
+
docs: definition.docs === null ? null : Object.freeze({ ...definition.docs }),
|
|
26
|
+
requires: Object.freeze([...definition.requires]),
|
|
27
|
+
allowedActorPolicies: Object.freeze([...definition.allowedActorPolicies]),
|
|
28
|
+
downRamp: Object.freeze({ ...definition.downRamp }),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function isStrictLifecycleDate(value) {
|
|
32
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(value))
|
|
33
|
+
return false;
|
|
34
|
+
const date = new Date(`${value}T00:00:00.000Z`);
|
|
35
|
+
return !Number.isNaN(date.getTime()) && date.toISOString().slice(0, 10) === value;
|
|
36
|
+
}
|
|
37
|
+
function hasCanonicalDocsSlug(channel, slug) {
|
|
38
|
+
const prefix = channel === "public" ? "/docs/" : "/features/";
|
|
39
|
+
return (slug.startsWith(prefix) &&
|
|
40
|
+
slug
|
|
41
|
+
.slice(prefix.length)
|
|
42
|
+
.split("/")
|
|
43
|
+
.every((segment) => /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(segment)));
|
|
44
|
+
}
|
|
45
|
+
function hasRequiredMetadata(value) {
|
|
46
|
+
const normalized = value.trim();
|
|
47
|
+
return normalized.length > 0 && normalized.toUpperCase() !== "TBD";
|
|
48
|
+
}
|
|
49
|
+
function duplicateValues(values) {
|
|
50
|
+
const seen = new Set();
|
|
51
|
+
const duplicates = new Set();
|
|
52
|
+
for (const value of values) {
|
|
53
|
+
if (seen.has(value))
|
|
54
|
+
duplicates.add(value);
|
|
55
|
+
seen.add(value);
|
|
56
|
+
}
|
|
57
|
+
return [...duplicates].toSorted();
|
|
58
|
+
}
|
|
59
|
+
function isValidUrl(value) {
|
|
60
|
+
try {
|
|
61
|
+
const url = new URL(value);
|
|
62
|
+
return url.protocol === "https:" || url.protocol === "http:";
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export function validateFeatureLifecycleRegistry(registry) {
|
|
69
|
+
const errors = [];
|
|
70
|
+
const keys = new Set(registry.map(({ key }) => key));
|
|
71
|
+
const downRampCodes = new Set(registry.map(({ downRamp }) => downRamp.code));
|
|
72
|
+
if (keys.size !== registry.length)
|
|
73
|
+
errors.push("registry: duplicate feature key");
|
|
74
|
+
if (downRampCodes.size !== registry.length)
|
|
75
|
+
errors.push("registry: duplicate down-ramp code");
|
|
76
|
+
const byKey = new Map(registry.map((definition) => [definition.key, definition]));
|
|
77
|
+
for (const [index, definition] of registry.entries()) {
|
|
78
|
+
const lifecycleAdoptedAtValid = isStrictLifecycleDate(definition.lifecycleAdoptedAt);
|
|
79
|
+
const reviewAfterValid = definition.reviewAfter === null || isStrictLifecycleDate(definition.reviewAfter);
|
|
80
|
+
const removeAfterValid = definition.removeAfter === null || isStrictLifecycleDate(definition.removeAfter);
|
|
81
|
+
const gaAtValid = definition.gaAt === null || isStrictLifecycleDate(definition.gaAt);
|
|
82
|
+
if (!lifecycleAdoptedAtValid)
|
|
83
|
+
errors.push(`${definition.key}: lifecycleAdoptedAt must be a real YYYY-MM-DD date`);
|
|
84
|
+
if (!reviewAfterValid)
|
|
85
|
+
errors.push(`${definition.key}: reviewAfter must be a real YYYY-MM-DD date`);
|
|
86
|
+
if (!removeAfterValid)
|
|
87
|
+
errors.push(`${definition.key}: removeAfter must be a real YYYY-MM-DD date`);
|
|
88
|
+
if (!gaAtValid)
|
|
89
|
+
errors.push(`${definition.key}: gaAt must be a real YYYY-MM-DD date`);
|
|
90
|
+
if (!hasRequiredMetadata(definition.name))
|
|
91
|
+
errors.push(`${definition.key}: name must not be blank or TBD`);
|
|
92
|
+
if (!hasRequiredMetadata(definition.description))
|
|
93
|
+
errors.push(`${definition.key}: description must not be blank or TBD`);
|
|
94
|
+
if (!hasRequiredMetadata(definition.owner))
|
|
95
|
+
errors.push(`${definition.key}: owner must not be blank or TBD`);
|
|
96
|
+
if (!hasRequiredMetadata(definition.downRamp.code))
|
|
97
|
+
errors.push(`${definition.key}: downRamp.code must not be blank or TBD`);
|
|
98
|
+
if (!hasRequiredMetadata(definition.downRamp.summary))
|
|
99
|
+
errors.push(`${definition.key}: downRamp.summary must not be blank or TBD`);
|
|
100
|
+
if (!hasRequiredMetadata(definition.key))
|
|
101
|
+
errors.push(`registry[${index}]: feature key must not be blank or TBD`);
|
|
102
|
+
else if (!/^[a-z][a-z0-9]*(?:[._][a-z][a-z0-9]*)*$/.test(definition.key))
|
|
103
|
+
errors.push(`${definition.key}: feature key must use canonical lowercase segments`);
|
|
104
|
+
if (hasRequiredMetadata(definition.downRamp.code) &&
|
|
105
|
+
!/^[a-z][a-z0-9]*(?:_[a-z][a-z0-9]*)*$/.test(definition.downRamp.code))
|
|
106
|
+
errors.push(`${definition.key}: downRamp.code must use canonical snake_case`);
|
|
107
|
+
if (definition.assignmentScopes.length === 0 || !definition.assignmentScopes.includes("global"))
|
|
108
|
+
errors.push(`${definition.key}: assignmentScopes must include global`);
|
|
109
|
+
if (definition.allowedActorPolicies.length === 0)
|
|
110
|
+
errors.push(`${definition.key}: allowedActorPolicies must not be empty`);
|
|
111
|
+
for (const [field, values] of [
|
|
112
|
+
["assignmentScopes", definition.assignmentScopes],
|
|
113
|
+
["allowedActorPolicies", definition.allowedActorPolicies],
|
|
114
|
+
["requires", definition.requires],
|
|
115
|
+
]) {
|
|
116
|
+
for (const duplicate of duplicateValues(values))
|
|
117
|
+
errors.push(`${definition.key}: ${field} contains duplicate ${duplicate}`);
|
|
118
|
+
}
|
|
119
|
+
if (definition.allowedActorPolicies.includes("global_policy") &&
|
|
120
|
+
(definition.assignmentScopes.length !== 1 || definition.assignmentScopes[0] !== "global"))
|
|
121
|
+
errors.push(`${definition.key}: global policy requires exactly global assignment scope`);
|
|
122
|
+
if (definition.stage !== "ga" && definition.surface && definition.defaultEnabled)
|
|
123
|
+
errors.push(`${definition.key}: non-GA features default off`);
|
|
124
|
+
if (definition.stage === "ga" && definition.surface && !definition.defaultEnabled)
|
|
125
|
+
errors.push(`${definition.key}: GA surface features default on`);
|
|
126
|
+
if (!definition.surface && definition.docs !== null)
|
|
127
|
+
errors.push(`${definition.key}: non-surface features must not have docs`);
|
|
128
|
+
if (definition.docs !== null &&
|
|
129
|
+
!hasCanonicalDocsSlug(definition.docs.channel, definition.docs.slug))
|
|
130
|
+
errors.push(`${definition.key}: docs slug must be a canonical ${definition.docs.channel} path`);
|
|
131
|
+
if (definition.docs !== null &&
|
|
132
|
+
definition.docs.feedbackUrl !== null &&
|
|
133
|
+
!isValidUrl(definition.docs.feedbackUrl))
|
|
134
|
+
errors.push(`${definition.key}: docs feedbackUrl must be a valid URL`);
|
|
135
|
+
if (definition.stage === "internal" && definition.docs?.channel === "public")
|
|
136
|
+
errors.push(`${definition.key}: internal features must not have public docs`);
|
|
137
|
+
if (definition.stage === "private_beta" && definition.docs?.channel !== "public")
|
|
138
|
+
errors.push(`${definition.key}: private beta requires public docs`);
|
|
139
|
+
if (definition.stage === "ga" && definition.surface && definition.docs?.channel !== "public")
|
|
140
|
+
errors.push(`${definition.key}: GA surface features require public docs`);
|
|
141
|
+
if (definition.stage !== "ga" && definition.surface && definition.reviewAfter === null)
|
|
142
|
+
errors.push(`${definition.key}: non-GA surface features require reviewAfter`);
|
|
143
|
+
if (definition.surface && definition.removeAfter === null)
|
|
144
|
+
errors.push(`${definition.key}: surface features require removeAfter`);
|
|
145
|
+
if (lifecycleAdoptedAtValid &&
|
|
146
|
+
reviewAfterValid &&
|
|
147
|
+
definition.reviewAfter !== null &&
|
|
148
|
+
definition.lifecycleAdoptedAt > definition.reviewAfter)
|
|
149
|
+
errors.push(`${definition.key}: lifecycleAdoptedAt must not follow reviewAfter`);
|
|
150
|
+
if (reviewAfterValid &&
|
|
151
|
+
removeAfterValid &&
|
|
152
|
+
definition.reviewAfter !== null &&
|
|
153
|
+
definition.removeAfter !== null &&
|
|
154
|
+
definition.reviewAfter > definition.removeAfter)
|
|
155
|
+
errors.push(`${definition.key}: reviewAfter must not follow removeAfter`);
|
|
156
|
+
if (lifecycleAdoptedAtValid &&
|
|
157
|
+
removeAfterValid &&
|
|
158
|
+
definition.removeAfter !== null &&
|
|
159
|
+
definition.lifecycleAdoptedAt > definition.removeAfter)
|
|
160
|
+
errors.push(`${definition.key}: lifecycleAdoptedAt must not follow removeAfter`);
|
|
161
|
+
if (definition.gaAt !== null && definition.stage !== "ga")
|
|
162
|
+
errors.push(`${definition.key}: only GA features may set gaAt`);
|
|
163
|
+
if (definition.stage === "ga" && definition.gaAt === null)
|
|
164
|
+
errors.push(`${definition.key}: GA features require gaAt`);
|
|
165
|
+
if (lifecycleAdoptedAtValid &&
|
|
166
|
+
gaAtValid &&
|
|
167
|
+
definition.gaAt !== null &&
|
|
168
|
+
definition.gaAt < definition.lifecycleAdoptedAt)
|
|
169
|
+
errors.push(`${definition.key}: gaAt must not precede lifecycleAdoptedAt`);
|
|
170
|
+
if (gaAtValid &&
|
|
171
|
+
removeAfterValid &&
|
|
172
|
+
definition.gaAt !== null &&
|
|
173
|
+
definition.removeAfter !== null &&
|
|
174
|
+
definition.gaAt > definition.removeAfter)
|
|
175
|
+
errors.push(`${definition.key}: gaAt must not follow removeAfter`);
|
|
176
|
+
if (definition.assignmentScopes.includes("user") &&
|
|
177
|
+
!definition.allowedActorPolicies.some((policy) => policy === "request_actor" || policy === "persisted_request_actor"))
|
|
178
|
+
errors.push(`${definition.key}: user scope requires an actor-aware policy`);
|
|
179
|
+
for (const dependency of definition.requires) {
|
|
180
|
+
const dependencyDefinition = byKey.get(dependency);
|
|
181
|
+
if (!dependencyDefinition) {
|
|
182
|
+
errors.push(`${definition.key}: unknown dependency ${dependency}`);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
if (definition.allowedActorPolicies.some((policy) => !dependencyDefinition.allowedActorPolicies.includes(policy)))
|
|
186
|
+
errors.push(`${definition.key}: actor policies must be allowed by dependency ${dependency}`);
|
|
187
|
+
if (definition.assignmentScopes.some((scope) => !dependencyDefinition.assignmentScopes.includes(scope)))
|
|
188
|
+
errors.push(`${definition.key}: assignment scopes must be supported by dependency ${dependency}`);
|
|
189
|
+
if (FEATURE_STAGES.indexOf(dependencyDefinition.stage) <
|
|
190
|
+
FEATURE_STAGES.indexOf(definition.stage))
|
|
191
|
+
errors.push(`${definition.key}: dependency ${dependency} must be at least as mature as its dependent`);
|
|
192
|
+
if (definition.defaultEnabled && !dependencyDefinition.defaultEnabled)
|
|
193
|
+
errors.push(`${definition.key}: default-enabled feature requires default-enabled dependency ${dependency}`);
|
|
194
|
+
if (removeAfterValid &&
|
|
195
|
+
dependencyDefinition.removeAfter !== null &&
|
|
196
|
+
isStrictLifecycleDate(dependencyDefinition.removeAfter) &&
|
|
197
|
+
(definition.removeAfter === null ||
|
|
198
|
+
dependencyDefinition.removeAfter < definition.removeAfter))
|
|
199
|
+
errors.push(`${definition.key}: dependency ${dependency} retires before its dependent`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const visiting = new Set();
|
|
203
|
+
const visited = new Set();
|
|
204
|
+
const visit = (key) => {
|
|
205
|
+
if (visiting.has(key)) {
|
|
206
|
+
errors.push(`${key}: dependency cycle`);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (visited.has(key))
|
|
210
|
+
return;
|
|
211
|
+
visiting.add(key);
|
|
212
|
+
for (const dependency of byKey.get(key)?.requires ?? [])
|
|
213
|
+
visit(dependency);
|
|
214
|
+
visiting.delete(key);
|
|
215
|
+
visited.add(key);
|
|
216
|
+
};
|
|
217
|
+
for (const key of keys)
|
|
218
|
+
visit(key);
|
|
219
|
+
return errors;
|
|
220
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FeatureRegistryEntry } from "./feature-lifecycle-core.js";
|
|
2
|
+
import { launchEntries as compiledLaunchEntries } from "./generated-feature-launch-entries.js";
|
|
3
|
+
export { FEATURE_ASSIGNMENT_SCOPES, FEATURE_EXECUTION_ACTOR_POLICIES, FEATURE_OWNER_IDS, FEATURE_STAGES, freezeFeatureRegistryEntry, validateFeatureLifecycleRegistry, } from "./feature-lifecycle-core.js";
|
|
4
|
+
export type { FeatureAssignmentScope, FeatureExecutionActorPolicy, FeatureOwnerId, FeatureRegistryEntry, FeatureStage, } from "./feature-lifecycle-core.js";
|
|
5
|
+
export type LifecycleFeatureKey = (typeof compiledLaunchEntries)[number]["key"];
|
|
6
|
+
export declare const FEATURE_LIFECYCLE_REGISTRY: readonly FeatureRegistryEntry<LifecycleFeatureKey>[];
|
|
7
|
+
export declare const FEATURE_LIFECYCLE_BY_KEY: ReadonlyMap<LifecycleFeatureKey, FeatureRegistryEntry<LifecycleFeatureKey>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { launchEntries as compiledLaunchEntries } from "./generated-feature-launch-entries.js";
|
|
2
|
+
export { FEATURE_ASSIGNMENT_SCOPES, FEATURE_EXECUTION_ACTOR_POLICIES, FEATURE_OWNER_IDS, FEATURE_STAGES, freezeFeatureRegistryEntry, validateFeatureLifecycleRegistry, } from "./feature-lifecycle-core.js";
|
|
3
|
+
export const FEATURE_LIFECYCLE_REGISTRY = compiledLaunchEntries;
|
|
4
|
+
const featureLifecycleByKey = new Map(FEATURE_LIFECYCLE_REGISTRY.map((definition) => [definition.key, definition]));
|
|
5
|
+
export const FEATURE_LIFECYCLE_BY_KEY = Object.freeze({
|
|
6
|
+
get size() {
|
|
7
|
+
return featureLifecycleByKey.size;
|
|
8
|
+
},
|
|
9
|
+
get(key) {
|
|
10
|
+
return featureLifecycleByKey.get(key);
|
|
11
|
+
},
|
|
12
|
+
has(key) {
|
|
13
|
+
return featureLifecycleByKey.has(key);
|
|
14
|
+
},
|
|
15
|
+
entries() {
|
|
16
|
+
return featureLifecycleByKey.entries();
|
|
17
|
+
},
|
|
18
|
+
keys() {
|
|
19
|
+
return featureLifecycleByKey.keys();
|
|
20
|
+
},
|
|
21
|
+
values() {
|
|
22
|
+
return featureLifecycleByKey.values();
|
|
23
|
+
},
|
|
24
|
+
forEach(callback, thisArg) {
|
|
25
|
+
for (const [key, value] of featureLifecycleByKey)
|
|
26
|
+
callback.call(thisArg, value, key, this);
|
|
27
|
+
},
|
|
28
|
+
[Symbol.iterator]() {
|
|
29
|
+
return featureLifecycleByKey[Symbol.iterator]();
|
|
30
|
+
},
|
|
31
|
+
});
|
|
@@ -9,7 +9,7 @@ export declare const planCodeSchema: z.ZodEnum<{
|
|
|
9
9
|
}>;
|
|
10
10
|
export type PlanCode = z.infer<typeof planCodeSchema>;
|
|
11
11
|
export declare const DEFAULT_PLAN_CODE: PlanCode;
|
|
12
|
-
export declare const FEATURE_KEYS: readonly ["plans.paid.available", "anonymous.publishing", "beta.enrollment_gate", "domains.search", "domains.registration", "domains.dns_management", "domains.proxy_bindings", "annotations.preview_loader", "annotations.comments", "annotations.anonymous_reviewers", "annotations.cli", "annotations.notices", "annotations.
|
|
12
|
+
export declare const FEATURE_KEYS: readonly ["plans.paid.available", "anonymous.publishing", "beta.enrollment_gate", "domains.search", "domains.registration", "domains.dns_management", "domains.wpcom_dns", "domains.domain_connect", "domains.proxy_bindings", "annotations.preview_loader", "annotations.comments", "annotations.anonymous_reviewers", "annotations.cli", "annotations.notices", "annotations.published_comments", "sites.dedicated_runtime", "shelf", "tags", "zero", "access.share_links", "access.invites", "access.firewall_card", "access.sso_connections", "access.byo_issuers", "access.views_panel", "pages.white_label"];
|
|
13
13
|
export declare const featureKeySchema: z.ZodEnum<{
|
|
14
14
|
zero: "zero";
|
|
15
15
|
"plans.paid.available": "plans.paid.available";
|
|
@@ -18,17 +18,25 @@ export declare const featureKeySchema: z.ZodEnum<{
|
|
|
18
18
|
"domains.search": "domains.search";
|
|
19
19
|
"domains.registration": "domains.registration";
|
|
20
20
|
"domains.dns_management": "domains.dns_management";
|
|
21
|
+
"domains.wpcom_dns": "domains.wpcom_dns";
|
|
22
|
+
"domains.domain_connect": "domains.domain_connect";
|
|
21
23
|
"domains.proxy_bindings": "domains.proxy_bindings";
|
|
22
24
|
"annotations.preview_loader": "annotations.preview_loader";
|
|
23
25
|
"annotations.comments": "annotations.comments";
|
|
24
26
|
"annotations.anonymous_reviewers": "annotations.anonymous_reviewers";
|
|
25
27
|
"annotations.cli": "annotations.cli";
|
|
26
28
|
"annotations.notices": "annotations.notices";
|
|
27
|
-
"annotations.spacefast_token": "annotations.spacefast_token";
|
|
28
29
|
"annotations.published_comments": "annotations.published_comments";
|
|
29
30
|
"sites.dedicated_runtime": "sites.dedicated_runtime";
|
|
30
31
|
shelf: "shelf";
|
|
31
32
|
tags: "tags";
|
|
33
|
+
"access.share_links": "access.share_links";
|
|
34
|
+
"access.invites": "access.invites";
|
|
35
|
+
"access.firewall_card": "access.firewall_card";
|
|
36
|
+
"access.sso_connections": "access.sso_connections";
|
|
37
|
+
"access.byo_issuers": "access.byo_issuers";
|
|
38
|
+
"access.views_panel": "access.views_panel";
|
|
39
|
+
"pages.white_label": "pages.white_label";
|
|
32
40
|
}>;
|
|
33
41
|
export type FeatureKey = z.infer<typeof featureKeySchema>;
|
|
34
42
|
export declare const FEATURE_OVERRIDE_STATES: readonly ["enabled", "disabled", "kill_switch"];
|
|
@@ -56,6 +64,15 @@ export declare const planLimitsSchema: z.ZodObject<{
|
|
|
56
64
|
buildAccessLogRetentionHours: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
57
65
|
buildsDeploysMonthly: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
58
66
|
analyticsRetentionDays: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
67
|
+
cloudRulesPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
68
|
+
shareLinksPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
69
|
+
invitesPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
70
|
+
inviteEmailsPerSpaceDaily: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
71
|
+
inviteEmailsPerAccountDaily: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
72
|
+
pendingAccessRequestsPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
73
|
+
serviceTokensPerTeam: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
74
|
+
connectionsPerTeam: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
75
|
+
teamDefaultRules: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
59
76
|
}, z.core.$strip>;
|
|
60
77
|
export type PlanLimits = z.infer<typeof planLimitsSchema>;
|
|
61
78
|
export declare const teamEntitlementsSchema: z.ZodObject<{
|
|
@@ -82,9 +99,22 @@ export declare const teamEntitlementsSchema: z.ZodObject<{
|
|
|
82
99
|
buildAccessLogRetentionHours: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
83
100
|
buildsDeploysMonthly: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
84
101
|
analyticsRetentionDays: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
102
|
+
cloudRulesPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
103
|
+
shareLinksPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
104
|
+
invitesPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
105
|
+
inviteEmailsPerSpaceDaily: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
106
|
+
inviteEmailsPerAccountDaily: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
107
|
+
pendingAccessRequestsPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
108
|
+
serviceTokensPerTeam: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
109
|
+
connectionsPerTeam: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
110
|
+
teamDefaultRules: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
85
111
|
}, z.core.$strip>;
|
|
86
112
|
headersBasicAuth: z.ZodBoolean;
|
|
87
113
|
externalProxy: z.ZodBoolean;
|
|
114
|
+
dedicatedRuntime: z.ZodBoolean;
|
|
115
|
+
pagesWhiteLabel: z.ZodBoolean;
|
|
116
|
+
pagesCustomHtml: z.ZodBoolean;
|
|
117
|
+
pagesAdvancedTheming: z.ZodBoolean;
|
|
88
118
|
runtimePhpWorkers: z.ZodNumber;
|
|
89
119
|
analyticsHourlyGranularity: z.ZodBoolean;
|
|
90
120
|
versionDiagnosticsIncluded: z.ZodBoolean;
|
|
@@ -100,6 +130,10 @@ export declare const teamEntitlementsResponseSchema: z.ZodObject<{
|
|
|
100
130
|
}>;
|
|
101
131
|
headersBasicAuth: z.ZodBoolean;
|
|
102
132
|
externalProxy: z.ZodBoolean;
|
|
133
|
+
dedicatedRuntime: z.ZodBoolean;
|
|
134
|
+
pagesWhiteLabel: z.ZodBoolean;
|
|
135
|
+
pagesCustomHtml: z.ZodBoolean;
|
|
136
|
+
pagesAdvancedTheming: z.ZodBoolean;
|
|
103
137
|
runtimePhpWorkers: z.ZodNumber;
|
|
104
138
|
analyticsHourlyGranularity: z.ZodBoolean;
|
|
105
139
|
versionDiagnosticsIncluded: z.ZodBoolean;
|
|
@@ -116,9 +150,17 @@ export declare const teamEntitlementsResponseSchema: z.ZodObject<{
|
|
|
116
150
|
buildAccessLogRetentionHours: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
117
151
|
buildsDeploysMonthly: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
118
152
|
analyticsRetentionDays: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
153
|
+
cloudRulesPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
154
|
+
shareLinksPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
155
|
+
invitesPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
156
|
+
inviteEmailsPerSpaceDaily: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
157
|
+
inviteEmailsPerAccountDaily: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
158
|
+
pendingAccessRequestsPerSpace: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
159
|
+
serviceTokensPerTeam: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
160
|
+
connectionsPerTeam: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
161
|
+
teamDefaultRules: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"unlimited">]>;
|
|
119
162
|
}, z.core.$strip>;
|
|
120
163
|
}, z.core.$strip>;
|
|
121
|
-
export type TeamEntitlementsResponse = z.infer<typeof teamEntitlementsResponseSchema>;
|
|
122
164
|
export type PlanDefinition = {
|
|
123
165
|
code: PlanCode;
|
|
124
166
|
name: string;
|
|
@@ -126,6 +168,10 @@ export type PlanDefinition = {
|
|
|
126
168
|
limits: PlanLimits;
|
|
127
169
|
headersBasicAuth: boolean;
|
|
128
170
|
externalProxy: boolean;
|
|
171
|
+
dedicatedRuntime: boolean;
|
|
172
|
+
pagesWhiteLabel: boolean;
|
|
173
|
+
pagesCustomHtml: boolean;
|
|
174
|
+
pagesAdvancedTheming: boolean;
|
|
129
175
|
runtimePhpWorkers: number;
|
|
130
176
|
analyticsHourlyGranularity: boolean;
|
|
131
177
|
};
|
|
@@ -155,17 +201,25 @@ export declare const FeatureStateSchema: z.ZodObject<{
|
|
|
155
201
|
"domains.search": "domains.search";
|
|
156
202
|
"domains.registration": "domains.registration";
|
|
157
203
|
"domains.dns_management": "domains.dns_management";
|
|
204
|
+
"domains.wpcom_dns": "domains.wpcom_dns";
|
|
205
|
+
"domains.domain_connect": "domains.domain_connect";
|
|
158
206
|
"domains.proxy_bindings": "domains.proxy_bindings";
|
|
159
207
|
"annotations.preview_loader": "annotations.preview_loader";
|
|
160
208
|
"annotations.comments": "annotations.comments";
|
|
161
209
|
"annotations.anonymous_reviewers": "annotations.anonymous_reviewers";
|
|
162
210
|
"annotations.cli": "annotations.cli";
|
|
163
211
|
"annotations.notices": "annotations.notices";
|
|
164
|
-
"annotations.spacefast_token": "annotations.spacefast_token";
|
|
165
212
|
"annotations.published_comments": "annotations.published_comments";
|
|
166
213
|
"sites.dedicated_runtime": "sites.dedicated_runtime";
|
|
167
214
|
shelf: "shelf";
|
|
168
215
|
tags: "tags";
|
|
216
|
+
"access.share_links": "access.share_links";
|
|
217
|
+
"access.invites": "access.invites";
|
|
218
|
+
"access.firewall_card": "access.firewall_card";
|
|
219
|
+
"access.sso_connections": "access.sso_connections";
|
|
220
|
+
"access.byo_issuers": "access.byo_issuers";
|
|
221
|
+
"access.views_panel": "access.views_panel";
|
|
222
|
+
"pages.white_label": "pages.white_label";
|
|
169
223
|
}>;
|
|
170
224
|
enabled: z.ZodBoolean;
|
|
171
225
|
source: z.ZodEnum<{
|
|
@@ -191,17 +245,25 @@ export declare const FeatureStateResponseSchema: z.ZodObject<{
|
|
|
191
245
|
"domains.search": "domains.search";
|
|
192
246
|
"domains.registration": "domains.registration";
|
|
193
247
|
"domains.dns_management": "domains.dns_management";
|
|
248
|
+
"domains.wpcom_dns": "domains.wpcom_dns";
|
|
249
|
+
"domains.domain_connect": "domains.domain_connect";
|
|
194
250
|
"domains.proxy_bindings": "domains.proxy_bindings";
|
|
195
251
|
"annotations.preview_loader": "annotations.preview_loader";
|
|
196
252
|
"annotations.comments": "annotations.comments";
|
|
197
253
|
"annotations.anonymous_reviewers": "annotations.anonymous_reviewers";
|
|
198
254
|
"annotations.cli": "annotations.cli";
|
|
199
255
|
"annotations.notices": "annotations.notices";
|
|
200
|
-
"annotations.spacefast_token": "annotations.spacefast_token";
|
|
201
256
|
"annotations.published_comments": "annotations.published_comments";
|
|
202
257
|
"sites.dedicated_runtime": "sites.dedicated_runtime";
|
|
203
258
|
shelf: "shelf";
|
|
204
259
|
tags: "tags";
|
|
260
|
+
"access.share_links": "access.share_links";
|
|
261
|
+
"access.invites": "access.invites";
|
|
262
|
+
"access.firewall_card": "access.firewall_card";
|
|
263
|
+
"access.sso_connections": "access.sso_connections";
|
|
264
|
+
"access.byo_issuers": "access.byo_issuers";
|
|
265
|
+
"access.views_panel": "access.views_panel";
|
|
266
|
+
"pages.white_label": "pages.white_label";
|
|
205
267
|
}>, z.ZodObject<{
|
|
206
268
|
key: z.ZodEnum<{
|
|
207
269
|
zero: "zero";
|
|
@@ -211,17 +273,25 @@ export declare const FeatureStateResponseSchema: z.ZodObject<{
|
|
|
211
273
|
"domains.search": "domains.search";
|
|
212
274
|
"domains.registration": "domains.registration";
|
|
213
275
|
"domains.dns_management": "domains.dns_management";
|
|
276
|
+
"domains.wpcom_dns": "domains.wpcom_dns";
|
|
277
|
+
"domains.domain_connect": "domains.domain_connect";
|
|
214
278
|
"domains.proxy_bindings": "domains.proxy_bindings";
|
|
215
279
|
"annotations.preview_loader": "annotations.preview_loader";
|
|
216
280
|
"annotations.comments": "annotations.comments";
|
|
217
281
|
"annotations.anonymous_reviewers": "annotations.anonymous_reviewers";
|
|
218
282
|
"annotations.cli": "annotations.cli";
|
|
219
283
|
"annotations.notices": "annotations.notices";
|
|
220
|
-
"annotations.spacefast_token": "annotations.spacefast_token";
|
|
221
284
|
"annotations.published_comments": "annotations.published_comments";
|
|
222
285
|
"sites.dedicated_runtime": "sites.dedicated_runtime";
|
|
223
286
|
shelf: "shelf";
|
|
224
287
|
tags: "tags";
|
|
288
|
+
"access.share_links": "access.share_links";
|
|
289
|
+
"access.invites": "access.invites";
|
|
290
|
+
"access.firewall_card": "access.firewall_card";
|
|
291
|
+
"access.sso_connections": "access.sso_connections";
|
|
292
|
+
"access.byo_issuers": "access.byo_issuers";
|
|
293
|
+
"access.views_panel": "access.views_panel";
|
|
294
|
+
"pages.white_label": "pages.white_label";
|
|
225
295
|
}>;
|
|
226
296
|
enabled: z.ZodBoolean;
|
|
227
297
|
source: z.ZodEnum<{
|