@spacefast/common 0.0.26 → 0.2.1
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/agents/connect-targets.d.ts +6 -146
- package/dist/agents/connect-targets.js +63 -295
- package/dist/agents/private-key-oauth.d.ts +31 -1
- package/dist/agents/private-key-oauth.js +124 -33
- package/dist/agents/registry/core.d.ts +292 -0
- package/dist/agents/registry/core.js +1388 -0
- package/dist/agents/registry/deeplink-probes.d.ts +23 -0
- package/dist/agents/registry/deeplink-probes.js +18 -0
- package/dist/agents/registry/node.d.ts +56 -0
- package/dist/agents/registry/node.js +339 -0
- package/dist/brand-assets-build.js +1 -2
- package/dist/brand-assets.js +4 -7
- package/dist/brand.d.ts +17 -0
- package/dist/brand.js +24 -4
- package/dist/config/domains.d.ts +55 -28
- package/dist/config/domains.js +85 -41
- package/dist/config/index.js +1 -2
- package/dist/contracts/abuse.js +9 -24
- package/dist/contracts/access-profiles.d.ts +86 -0
- package/dist/contracts/access-profiles.js +89 -0
- package/dist/contracts/access.d.ts +21 -27
- package/dist/contracts/access.js +33 -64
- package/dist/contracts/activity.d.ts +18 -1
- package/dist/contracts/activity.js +70 -26
- package/dist/contracts/analytics.js +8 -10
- package/dist/contracts/api-keys.d.ts +77 -52
- package/dist/contracts/api-keys.js +44 -24
- package/dist/contracts/application-journal.d.ts +216 -0
- package/dist/contracts/application-journal.js +167 -0
- package/dist/contracts/auth.d.ts +90 -17
- package/dist/contracts/auth.js +86 -17
- package/dist/contracts/beta.d.ts +9 -4
- package/dist/contracts/beta.js +20 -16
- package/dist/contracts/billing.js +7 -11
- package/dist/contracts/bootstrap.d.ts +791 -0
- package/dist/contracts/bootstrap.js +51 -0
- package/dist/contracts/builds.d.ts +186 -7
- package/dist/contracts/builds.js +75 -21
- package/dist/contracts/channels.d.ts +43 -0
- package/dist/contracts/channels.js +25 -9
- package/dist/contracts/cli.d.ts +7 -0
- package/dist/contracts/cli.js +6 -0
- package/dist/contracts/collab-public.d.ts +1 -1
- package/dist/contracts/collab-public.js +5 -8
- package/dist/contracts/comments.d.ts +45 -35
- package/dist/contracts/comments.js +107 -77
- package/dist/contracts/commerce.d.ts +165 -0
- package/dist/contracts/commerce.js +146 -0
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/common.js +18 -29
- package/dist/contracts/content-contract-verification.d.ts +521 -0
- package/dist/contracts/content-contract-verification.js +320 -0
- package/dist/contracts/content-platform-fixture.d.ts +1278 -0
- package/dist/contracts/content-platform-fixture.js +44 -0
- package/dist/contracts/content-program.d.ts +994 -0
- package/dist/contracts/content-program.js +658 -0
- package/dist/contracts/content-sync.d.ts +290 -0
- package/dist/contracts/content-sync.js +167 -0
- package/dist/contracts/content.d.ts +432 -0
- package/dist/contracts/content.js +303 -0
- package/dist/contracts/continuation.d.ts +17 -1
- package/dist/contracts/continuation.js +23 -23
- package/dist/contracts/countries.js +3 -4
- package/dist/contracts/crons.d.ts +17 -0
- package/dist/contracts/crons.js +33 -15
- package/dist/contracts/dashboard-prefs.d.ts +56 -0
- package/dist/contracts/dashboard-prefs.js +51 -0
- package/dist/contracts/device-auth.d.ts +234 -37
- package/dist/contracts/device-auth.js +267 -53
- package/dist/contracts/docs.d.ts +6 -10
- package/dist/contracts/docs.js +5 -13
- package/dist/contracts/domains.d.ts +499 -102
- package/dist/contracts/domains.js +169 -58
- package/dist/contracts/email-preferences.d.ts +3 -3
- package/dist/contracts/email-preferences.js +6 -7
- package/dist/contracts/enums.d.ts +26 -26
- package/dist/contracts/enums.js +61 -54
- package/dist/contracts/error-code-meta.d.ts +269 -7
- package/dist/contracts/error-code-meta.js +80 -5
- package/dist/contracts/error-codes.d.ts +5 -5
- package/dist/contracts/error-codes.js +78 -16
- package/dist/contracts/events.d.ts +100 -20
- package/dist/contracts/events.js +107 -20
- package/dist/contracts/execution.d.ts +47 -66
- package/dist/contracts/execution.js +51 -64
- package/dist/contracts/feature-lifecycle.d.ts +70 -14
- package/dist/contracts/feature-lifecycle.js +86 -15
- package/dist/contracts/features.d.ts +100 -37
- package/dist/contracts/features.js +21 -27
- package/dist/contracts/fixtures/content-platform-v1.json +1108 -0
- package/dist/contracts/frame-session.d.ts +192 -0
- package/dist/contracts/frame-session.js +164 -0
- package/dist/contracts/functions.d.ts +218 -211
- package/dist/contracts/functions.js +273 -260
- package/dist/contracts/grant-copy.d.ts +43 -0
- package/dist/contracts/grant-copy.js +44 -0
- package/dist/contracts/grants.d.ts +64 -56
- package/dist/contracts/grants.js +124 -23
- package/dist/contracts/ids.d.ts +4 -1
- package/dist/contracts/ids.js +4 -1
- package/dist/contracts/internal.d.ts +5 -4
- package/dist/contracts/internal.js +12 -3
- package/dist/contracts/mcp.d.ts +17 -0
- package/dist/contracts/mcp.js +23 -0
- package/dist/contracts/me.d.ts +6 -1
- package/dist/contracts/me.js +12 -6
- package/dist/contracts/notifications.d.ts +27 -29
- package/dist/contracts/notifications.js +9 -4
- package/dist/contracts/oauth-resources.d.ts +112 -10
- package/dist/contracts/oauth-resources.js +116 -11
- package/dist/contracts/oauth-scope-actions.d.ts +90 -0
- package/dist/contracts/oauth-scope-actions.js +126 -0
- package/dist/contracts/operations.d.ts +27 -4
- package/dist/contracts/operations.js +11 -5
- package/dist/contracts/pages.d.ts +29 -5
- package/dist/contracts/pages.js +22 -5
- package/dist/contracts/partner-notifications.d.ts +3 -0
- package/dist/contracts/partner-notifications.js +65 -0
- package/dist/contracts/{platform.d.ts → partner.d.ts} +29 -42
- package/dist/contracts/{platform.js → partner.js} +27 -40
- package/dist/contracts/plan-policy.d.ts +1 -1
- package/dist/contracts/principal-assertion.d.ts +43 -0
- package/dist/contracts/principal-assertion.js +67 -0
- package/dist/contracts/principals.d.ts +73 -0
- package/dist/contracts/principals.js +59 -0
- package/dist/contracts/privacy.d.ts +11 -0
- package/dist/contracts/privacy.js +17 -0
- package/dist/contracts/problem-document.js +3 -4
- package/dist/contracts/publish-archive.d.ts +116 -18
- package/dist/contracts/publish-archive.js +6 -3
- package/dist/contracts/push-new.d.ts +4 -4
- package/dist/contracts/quotas.js +3 -3
- package/dist/contracts/realtime.d.ts +52 -0
- package/dist/contracts/realtime.js +54 -0
- package/dist/contracts/repository-connections.d.ts +1 -1
- package/dist/contracts/repository-connections.js +6 -2
- package/dist/contracts/resources.d.ts +105 -14
- package/dist/contracts/resources.js +145 -21
- package/dist/contracts/route-inventory.d.ts +358 -0
- package/dist/contracts/route-inventory.js +141 -0
- package/dist/contracts/runtime-api.d.ts +112 -35
- package/dist/contracts/runtime-api.js +86 -66
- package/dist/contracts/runtime-app.d.ts +11 -21
- package/dist/contracts/runtime-app.js +39 -24
- package/dist/contracts/runtime-components.d.ts +143 -0
- package/dist/contracts/runtime-components.js +199 -0
- package/dist/contracts/runtime-db.d.ts +45 -19
- package/dist/contracts/runtime-db.js +85 -20
- package/dist/contracts/runtime-purge.js +3 -5
- package/dist/contracts/runtime-services.d.ts +43 -75
- package/dist/contracts/runtime-services.js +29 -49
- package/dist/contracts/runtime-storage.d.ts +14 -14
- package/dist/contracts/runtime-storage.js +28 -13
- package/dist/contracts/sf-config-v1.d.ts +14 -18
- package/dist/contracts/slugs.js +13 -4
- package/dist/contracts/space-config.d.ts +235 -28
- package/dist/contracts/space-config.js +246 -91
- package/dist/contracts/spaces.d.ts +360 -255
- package/dist/contracts/spaces.js +190 -122
- package/dist/contracts/superadmin-activity.d.ts +3 -43
- package/dist/contracts/superadmin-activity.js +6 -30
- package/dist/contracts/superadmin-emails.d.ts +1 -0
- package/dist/contracts/superadmin-emails.js +17 -1
- package/dist/contracts/superadmin-runtime.d.ts +199 -0
- package/dist/contracts/superadmin-runtime.js +141 -0
- package/dist/contracts/superadmin-search.d.ts +22 -2
- package/dist/contracts/superadmin-search.js +14 -6
- package/dist/contracts/superadmin-spaces.d.ts +435 -186
- package/dist/contracts/superadmin-spaces.js +131 -25
- package/dist/contracts/superadmin-teams.d.ts +3 -0
- package/dist/contracts/superadmin-teams.js +1 -2
- package/dist/contracts/superadmin-tenants.d.ts +627 -6
- package/dist/contracts/superadmin-tenants.js +32 -7
- package/dist/contracts/superadmin.d.ts +98 -16
- package/dist/contracts/superadmin.js +63 -10
- package/dist/contracts/tags.d.ts +85 -58
- package/dist/contracts/tags.js +44 -34
- package/dist/contracts/teams.d.ts +72 -9
- package/dist/contracts/teams.js +84 -25
- package/dist/contracts/tenants.d.ts +135 -0
- package/dist/contracts/tenants.js +120 -0
- package/dist/contracts/test-triggers.d.ts +70 -0
- package/dist/contracts/test-triggers.js +116 -0
- package/dist/contracts/theme-json.js +3 -8
- package/dist/contracts/transfers.d.ts +1 -0
- package/dist/contracts/transfers.js +1 -0
- package/dist/contracts/usage.d.ts +209 -0
- package/dist/contracts/usage.js +124 -12
- package/dist/contracts/variables.d.ts +2 -2
- package/dist/contracts/variables.js +9 -13
- package/dist/contracts/webhooks.d.ts +13 -5
- package/dist/contracts/webhooks.js +3 -1
- package/dist/contracts/zero.d.ts +57 -64
- package/dist/contracts/zero.js +68 -66
- package/dist/dashboard-paths/index.d.ts +24 -21
- package/dist/dashboard-paths/index.js +35 -47
- package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -0
- package/dist/dashboard-paths/route-reservations.generated.js +36 -0
- package/dist/docs/agent-arrival.d.ts +92 -0
- package/dist/docs/agent-arrival.js +227 -0
- package/dist/docs/agent-output-policy.d.ts +6 -0
- package/dist/docs/agent-output-policy.js +22 -0
- package/dist/docs/agent-prose.d.ts +11 -17
- package/dist/docs/agent-prose.js +62 -37
- package/dist/docs/agent-setup.d.ts +72 -41
- package/dist/docs/agent-setup.js +336 -436
- package/dist/docs/catalog.d.ts +147 -89
- package/dist/docs/catalog.js +157 -42
- package/dist/docs/error-docs.d.ts +2098 -1
- package/dist/docs/error-docs.js +281 -16
- package/dist/docs/index-build.d.ts +0 -1
- package/dist/docs/index-build.js +2 -3
- package/dist/docs/page-context-prompt.d.ts +77 -0
- package/dist/docs/page-context-prompt.js +131 -0
- package/dist/docs/reference-urls.d.ts +46 -0
- package/dist/docs/reference-urls.js +79 -0
- package/dist/docs/search.d.ts +6 -8
- package/dist/docs/search.js +10 -13
- package/dist/docs/skill-distribution.d.ts +4 -1
- package/dist/docs/skill-distribution.js +10 -5
- package/dist/docs/skills.d.ts +117 -117
- package/dist/docs/skills.js +120 -72
- package/dist/docs/start-prompts.d.ts +45 -0
- package/dist/docs/start-prompts.js +62 -0
- package/dist/domain-exploration.js +9 -13
- package/dist/og-template.d.ts +56 -0
- package/dist/og-template.js +56 -0
- package/dist/slug-policy/index.js +5 -11
- package/dist/utils/browser-credential.d.ts +13 -6
- package/dist/utils/browser-credential.js +14 -7
- package/dist/utils/build-settings.d.ts +16 -0
- package/dist/utils/build-settings.js +63 -17
- package/dist/utils/canonical-json.d.ts +3 -5
- package/dist/utils/canonical-json.js +3 -5
- package/dist/utils/cast-transport.d.ts +5 -17
- package/dist/utils/cast-transport.js +6 -19
- package/dist/utils/claim-token.js +1 -2
- package/dist/utils/comment-avatars.js +4 -6
- package/dist/utils/concurrency.js +2 -3
- package/dist/utils/content-type.d.ts +7 -6
- package/dist/utils/content-type.js +73 -51
- package/dist/utils/credential-policy.d.ts +50 -6
- package/dist/utils/credential-policy.js +123 -57
- package/dist/utils/egress-policy.fixtures.json +1 -1
- package/dist/utils/generate-space-name.d.ts +3 -8
- package/dist/utils/generate-space-name.js +3 -8
- package/dist/utils/grants.d.ts +0 -1
- package/dist/utils/grants.js +4 -7
- package/dist/utils/gravatar.d.ts +2 -4
- package/dist/utils/gravatar.js +6 -12
- package/dist/utils/id-hints.js +14 -23
- package/dist/utils/idempotency.d.ts +3 -3
- package/dist/utils/idempotency.js +6 -7
- package/dist/utils/local-space-state.d.ts +15 -15
- package/dist/utils/local-space-state.js +34 -23
- package/dist/utils/oauth-signed-query.d.ts +3 -5
- package/dist/utils/oauth-signed-query.js +6 -9
- package/dist/utils/one-shot-replay.d.ts +3 -5
- package/dist/utils/one-shot-replay.js +3 -5
- package/dist/utils/page-colors.d.ts +4 -10
- package/dist/utils/page-colors.js +11 -35
- package/dist/utils/page-fonts.js +6 -11
- package/dist/utils/page-preview.d.ts +0 -1
- package/dist/utils/page-preview.js +0 -1
- package/dist/utils/pages.d.ts +22 -11
- package/dist/utils/pages.js +70 -30
- package/dist/utils/privacy-regions.d.ts +19 -0
- package/dist/utils/privacy-regions.js +91 -0
- package/dist/utils/publish-form-data.d.ts +4 -5
- package/dist/utils/publish-form-data.js +2 -3
- package/dist/utils/publish-policy.d.ts +10 -23
- package/dist/utils/publish-policy.js +63 -116
- package/dist/utils/query-client.d.ts +2 -0
- package/dist/utils/query-client.js +10 -1
- package/dist/utils/runtime-paths.d.ts +4 -4
- package/dist/utils/runtime-paths.js +6 -8
- package/dist/utils/runtime-upload.d.ts +4 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/secure-local-file.d.ts +3 -3
- package/dist/utils/secure-local-file.js +18 -24
- package/dist/utils/space-config.d.ts +11 -14
- package/dist/utils/space-config.js +10 -16
- package/dist/utils/static-runtime-policy.d.ts +5 -8
- package/dist/utils/static-runtime-policy.generated.d.ts +16 -0
- package/dist/utils/static-runtime-policy.generated.js +70 -0
- package/dist/utils/static-runtime-policy.js +17 -84
- package/dist/utils/storage-policy.js +1 -2
- package/dist/utils/upload-session.js +8 -14
- package/dist/utils/version-path.js +11 -19
- package/dist/utils/wpcom-auth-redirects.d.ts +5 -14
- package/dist/utils/wpcom-auth-redirects.js +1 -4
- package/dist/vocabulary.d.ts +7 -7
- package/dist/vocabulary.js +30 -16
- package/package.json +14 -2
- package/dist/agents/client-registry.d.ts +0 -22
- package/dist/agents/client-registry.js +0 -41
- package/dist/docs/agent-handoff-document.d.ts +0 -15
- package/dist/docs/agent-handoff-document.js +0 -180
- package/dist/docs/agent-solutions.d.ts +0 -110
- package/dist/docs/agent-solutions.js +0 -183
- package/dist/utils/query-keys.d.ts +0 -84
- package/dist/utils/query-keys.js +0 -108
package/dist/contracts/access.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { grantConstraintsPatchSchema, grantConstraintsSchema, grantResourceSetSchema, grantTargetSelectorSchema, } from "./grants.js";
|
|
3
|
-
// ---------------------------------------------------------------------------
|
|
4
|
-
// Canonical sharing model
|
|
5
|
-
// ---------------------------------------------------------------------------
|
|
6
3
|
export const SPACE_ACCESS_PRESETS = ["private", "team", "public"];
|
|
7
4
|
export const ACCESS_HANDOFF_MEDIA_TYPE = "application/vnd.spacefast.access-handoff+json";
|
|
8
5
|
export const spaceAccessPresetSchema = z.enum(SPACE_ACCESS_PRESETS);
|
|
9
6
|
/**
|
|
10
7
|
* The sharing vocabulary. Capabilities are the ground truth; a role is a named
|
|
11
|
-
* set of them, ordered from least to most. This is the only role enum
|
|
12
|
-
*
|
|
13
|
-
* API, comments) names access with these four words and derives capabilities
|
|
14
|
-
* here rather than keeping its own preset list.
|
|
8
|
+
* set of them, ordered from least to most. This is the product's only role enum
|
|
9
|
+
* and role⇄capability mapping: every surface derives its capabilities here.
|
|
15
10
|
*/
|
|
16
11
|
export const ACCESS_ROLES = ["viewer", "commenter", "editor", "manager"];
|
|
17
12
|
export const accessRoleSchema = z.enum(ACCESS_ROLES);
|
|
@@ -25,9 +20,8 @@ export function accessRoleCapabilities(role) {
|
|
|
25
20
|
return [...ACCESS_ROLE_CAPABILITIES[role]];
|
|
26
21
|
}
|
|
27
22
|
/**
|
|
28
|
-
* The role a capability set amounts to
|
|
29
|
-
*
|
|
30
|
-
* exactly; this reports the role it reaches, never more.
|
|
23
|
+
* The role a capability set amounts to: the strongest role it reaches, never
|
|
24
|
+
* more. A Grant assembled capability-by-capability need not match one exactly.
|
|
31
25
|
*/
|
|
32
26
|
export function accessRoleForCapabilities(capabilities) {
|
|
33
27
|
if (capabilities.includes("access.manage"))
|
|
@@ -39,9 +33,8 @@ export function accessRoleForCapabilities(capabilities) {
|
|
|
39
33
|
return "viewer";
|
|
40
34
|
}
|
|
41
35
|
/**
|
|
42
|
-
* Roles a
|
|
43
|
-
*
|
|
44
|
-
* the same boundary `grantSchema` enforces on the capabilities themselves.
|
|
36
|
+
* Roles a forwardable secret (a Link, a password) can carry. It never publishes
|
|
37
|
+
* and never manages access; `grantSchema` enforces that on capabilities too.
|
|
45
38
|
*/
|
|
46
39
|
export const VISITOR_ACCESS_ROLES = [
|
|
47
40
|
"viewer",
|
|
@@ -137,16 +130,12 @@ export const authorityReferenceSchema = z
|
|
|
137
130
|
.string()
|
|
138
131
|
.regex(/^(member|person|link|password|machine|claim-preview|external):[A-Za-z0-9_.-]+$/);
|
|
139
132
|
// WHO a session is, orthogonal to WHAT it may do. A session has exactly one
|
|
140
|
-
// principal and any number of authorities; neither implies the other.
|
|
141
|
-
// who arrives by share link is still that member, and a link authority alone
|
|
142
|
-
// never makes someone anonymous.
|
|
133
|
+
// principal and any number of authorities; neither implies the other.
|
|
143
134
|
export const accountPrincipalSchema = z.string().regex(/^account:[A-Za-z0-9_-]+$/);
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
// key, a claim preview — authenticates no one: those sessions stay anonymous
|
|
149
|
-
// and carry the credential purely as an authority.
|
|
135
|
+
// `person:` is someone this Space invited by email and who accepted, a named
|
|
136
|
+
// identity with no platform account behind it. `external:` is a subject an
|
|
137
|
+
// identity connection vouched for. Every other authority class (Link, password,
|
|
138
|
+
// machine, claim preview) authenticates no one and leaves the session anonymous.
|
|
150
139
|
export const identifiedPrincipalSchema = z
|
|
151
140
|
.string()
|
|
152
141
|
.regex(/^(?:account|person|external):[A-Za-z0-9_.-]+$/);
|
|
@@ -161,9 +150,8 @@ export function accountPrincipalUserId(principal) {
|
|
|
161
150
|
return principal.slice("account:".length);
|
|
162
151
|
}
|
|
163
152
|
/**
|
|
164
|
-
* The identity an authority reference names on its own, if any.
|
|
165
|
-
*
|
|
166
|
-
* the exchange that just authenticated it, never downstream.
|
|
153
|
+
* The identity an authority reference names on its own, if any. The ONE place a
|
|
154
|
+
* class maps to an identity: at the exchange that authenticated it, never after.
|
|
167
155
|
*/
|
|
168
156
|
export function principalForAuthority(reference) {
|
|
169
157
|
return reference.startsWith("person:") || reference.startsWith("external:")
|
|
@@ -238,16 +226,14 @@ export const accessShareLinkSchema = z.object({
|
|
|
238
226
|
export const accessShareLinkWithUrlSchema = accessShareLinkSchema.extend({
|
|
239
227
|
url: z.string().url(),
|
|
240
228
|
});
|
|
241
|
-
// Reads re-derive the
|
|
242
|
-
//
|
|
243
|
-
// rather than pretending to hold a URL that would not open.
|
|
229
|
+
// Reads re-derive the branded URL from the sealed token. Links minted before
|
|
230
|
+
// branded URLs existed report null until the backfill mints theirs.
|
|
244
231
|
export const accessShareLinkReadSchema = accessShareLinkSchema.extend({
|
|
245
232
|
url: z.string().url().nullable(),
|
|
246
233
|
});
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
//
|
|
250
|
-
// ownership; claim credentials stay a separate receipt field.
|
|
234
|
+
// One durable access capability in both transports: a browser entry URL and the
|
|
235
|
+
// raw token integrations send in X-SF-Authorization. It is access to published
|
|
236
|
+
// bytes, never proof of ownership; claim credentials are a separate receipt field.
|
|
251
237
|
export const publishedAccessSchema = z.object({
|
|
252
238
|
url: z.string().url(),
|
|
253
239
|
token: z.string().min(16).max(512),
|
|
@@ -292,8 +278,6 @@ export const linkCapabilitiesSchema = z
|
|
|
292
278
|
export const personGrantWriteSchema = z.object({
|
|
293
279
|
scope: accessScopePathSchema,
|
|
294
280
|
role: accessRoleSchema,
|
|
295
|
-
// A Person can be invited to the live site, to one immutable Version, to a
|
|
296
|
-
// branch, or to every Version — the same selector Links and Grants take.
|
|
297
281
|
target: grantTargetSelectorSchema.default({ kind: "live" }),
|
|
298
282
|
});
|
|
299
283
|
export const spacePersonInviteWriteSchema = z.object({
|
|
@@ -307,8 +291,6 @@ export const accessShareLinkCreateSchema = z.object({
|
|
|
307
291
|
name: z.string().trim().min(1).max(200),
|
|
308
292
|
landingPath: accessScopePathSchema.default("/"),
|
|
309
293
|
resources: grantResourceSetSchema,
|
|
310
|
-
// Anonymous commenting is a product default: a Link that names no
|
|
311
|
-
// capabilities admits reading the page and leaving a comment.
|
|
312
294
|
capabilities: linkCapabilitiesSchema.default(["page.view", "comments.read", "comments.write"]),
|
|
313
295
|
constraints: grantConstraintsSchema.default({}),
|
|
314
296
|
target: grantTargetSelectorSchema.default({ kind: "live" }),
|
|
@@ -353,27 +335,21 @@ export const teamSpaceAccessDefaultSchema = z.object({
|
|
|
353
335
|
export const teamSpaceAccessDefaultWriteSchema = z.object({
|
|
354
336
|
newSpaceGrantPreset: spaceAccessPresetSchema,
|
|
355
337
|
});
|
|
356
|
-
// ---------------------------------------------------------------------------
|
|
357
|
-
// Unified visitor and collaboration tokens
|
|
358
|
-
// ---------------------------------------------------------------------------
|
|
359
338
|
export const ACCESS_TOKEN_KID = "spacefast-runtime-v1";
|
|
360
339
|
export const ACCESS_TOKEN_ALG = "EdDSA";
|
|
361
340
|
/**
|
|
362
|
-
* The claim-schema version every platform token carries in `v`.
|
|
363
|
-
*
|
|
364
|
-
* under a later shape instead of reading unknown claims optimistically.
|
|
341
|
+
* The claim-schema version every platform token carries in `v`. A verifier that
|
|
342
|
+
* understands v1 refuses a token minted under a later shape.
|
|
365
343
|
*/
|
|
366
344
|
export const PLATFORM_TOKEN_CLAIM_VERSION = 1;
|
|
367
345
|
export const BLOB_GATE_DOWNLOAD_TTL_SECONDS = 10 * 60;
|
|
368
346
|
export const BLOB_GATE_SCAN_TTL_SECONDS = 60 * 60;
|
|
369
347
|
export const BLOB_GATE_UPLOAD_TTL_SECONDS = 60 * 60;
|
|
370
348
|
export const RUNTIME_JWKS_WELL_KNOWN_FILENAME = "spacefast-runtime-jwks.json";
|
|
371
|
-
// Public identity attached only when a
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
//
|
|
375
|
-
// then drops the email. Raw email and provider-private profile metadata never
|
|
376
|
-
// belong here.
|
|
349
|
+
// Public identity, attached only when a consumer must render the person behind
|
|
350
|
+
// an authority. The minting side normalizes a provider avatar or derives one
|
|
351
|
+
// from the email, then drops the email. Raw email and provider-private profile
|
|
352
|
+
// metadata never belong here.
|
|
377
353
|
export const accessTokenPublicProfileSchema = z
|
|
378
354
|
.object({
|
|
379
355
|
name: z.string().min(1).max(120).optional(),
|
|
@@ -386,32 +362,25 @@ export const accessTokenPublicProfileSchema = z
|
|
|
386
362
|
.strict();
|
|
387
363
|
export const accessTokenPayloadSchema = z.object({
|
|
388
364
|
// Typed purpose from the one platform signer. The runtime REQUIRES exactly
|
|
389
|
-
// this value before consuming the jti
|
|
390
|
-
//
|
|
391
|
-
// and a handoff can never pass a system-view check.
|
|
365
|
+
// this value before consuming the jti, so no other purpose signed by the same
|
|
366
|
+
// key can redeem into a visitor session.
|
|
392
367
|
purpose: z.literal("handoff"),
|
|
393
|
-
// Claim-schema version stamped by the one signer.
|
|
394
368
|
v: z.literal(PLATFORM_TOKEN_CLAIM_VERSION),
|
|
395
369
|
sub: authorityReferenceSchema,
|
|
396
|
-
// Who this handoff authenticated, when it authenticated anybody.
|
|
397
|
-
//
|
|
398
|
-
//
|
|
399
|
-
// machine, and claim-preview lanes never set it, and its absence means the
|
|
400
|
-
// runtime session is anonymous. Identity comes from here alone — never
|
|
401
|
-
// inferred from the authority classes below.
|
|
370
|
+
// Who this handoff authenticated, when it authenticated anybody. Its absence
|
|
371
|
+
// means the runtime session is anonymous. Identity comes from here alone,
|
|
372
|
+
// never inferred from the authority classes below.
|
|
402
373
|
principal: identifiedPrincipalSchema.optional(),
|
|
403
374
|
authorities: z.array(authorityReferenceSchema).min(1).max(16),
|
|
404
375
|
exp: z.number().int().nonnegative(),
|
|
405
376
|
nbf: z.number().int().nonnegative(),
|
|
406
377
|
iat: z.number().int().nonnegative(),
|
|
407
378
|
iss: z.string().min(1),
|
|
408
|
-
// The Space this handoff belongs to
|
|
409
|
-
//
|
|
410
|
-
// so the audience is stable where a serving host is not.
|
|
379
|
+
// The Space this handoff belongs to. A Space keeps its id across claim,
|
|
380
|
+
// rename, and custom domains, so the audience is stable where a host is not.
|
|
411
381
|
aud: z.string().min(1),
|
|
412
|
-
// The lowercased serving host the handoff was minted for.
|
|
413
|
-
//
|
|
414
|
-
// rejects a token presented on any other host.
|
|
382
|
+
// The lowercased serving host the handoff was minted for. The runtime rejects
|
|
383
|
+
// a token presented on any other host.
|
|
415
384
|
host: z.string().min(1),
|
|
416
385
|
spaceId: z.string().min(1),
|
|
417
386
|
// Shared opaque identity for the runtime session and its access-origin
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const ACTIVITY_EVENT_CODES: readonly ["space.created", "space.claimed", "feedback.lead_claim_pending", "space.transferred", "space.expired", "space.disabled", "space.enabled", "space.deleted", "space.config_updated", "space.slug_updated", "site.provision_requested", "site.
|
|
2
|
+
export declare const ACTIVITY_EVENT_CODES: readonly ["space.created", "space.claimed", "feedback.lead_claim_pending", "space.transferred", "space.expired", "space.disabled", "space.enabled", "space.deleted", "space.config_updated", "space.slug_updated", "site.provision_requested", "site.burst_toggled", "space.access_logout_all", "space.access_transfer_scrub", "space.share_link_created", "space.share_link_revoked", "space.access_request_created", "space.access_request_resolved", "space.grant_created", "space.grant_updated", "space.grant_revoked", "team.access_defaults_updated", "version.created", "version.ready", "version.warning", "version.failed", "version.expired", "version.canceled", "version.deleted", "channel.promoted", "build.created", "build.succeeded", "build.failed", "build.canceled", "build.skipped", "domain.created", "domain.verified", "domain.verification_failed", "domain.control_lost", "domain.dns_updated", "domain.nameservers_updated", "domain.registration_purchased", "domain.registration_renewed", "domain.registration_expiring", "domain.registration_expired", "domain.transfer_in_started", "domain.transfer_out_started", "domain.deleted", "domain.attached", "domain.activated", "domain.blocked", "domain.detached", "transfer.requested", "transfer.confirmed", "transfer.completed", "transfer.canceled", "transfer.expired", "transfer.failed", "cron.failed", "variable.updated", "variable.deleted", "api_key.created", "api_key.updated", "api_key.revoked", "agent_handoff.created", "agent_handoff.redeemed", "agent_handoff.revoked", "webhook.created", "webhook.updated", "webhook.secret_rotated", "webhook.disabled", "webhook.deleted", "team.updated", "team.slug_updated", "team.member_added", "team.member_removed", "team.member_role_updated", "team.builds_deploys_quota_exceeded", "tenant.past_due", "tenant.suspended", "tenant.reactivated", "tenant.deleted", "principal.plan_reset", "principal.space_quota_exceeded", "principal.suspended", "principal.unsuspended", "principal.closed", "usage.threshold_crossed", "usage.period_finalized", "usage.corrected", "principal.notification.claim", "principal.notification.space_expiry", "principal.notification.access_invitation", "principal.notification.access_request", "principal.notification.access_verification", "principal.notification.publish_receipt", "principal.notification.comment", "comment.token_minted", "comment.created", "comment.reply_created", "comment.archived", "comment.unarchived", "abuse_report.created", "abuse_report.updated", "claim.blocked_takedown", "claim.authority_rotated", "user.created", "user.signed_in", "user.deleted", "user.impersonation_started", "user.impersonation_stopped", "user.two_factor_enabled", "user.two_factor_disabled", "user.password_set", "user.password_changed", "user.provider_linked", "user.provider_unlinked", "user.email_added", "user.email_removed", "user.primary_email_changed", "user.superadmin_granted", "user.superadmin_revoked", "user.privacy_updated", "user.deletion_requested", "user.deletion_completed"];
|
|
3
3
|
export type ActivityEventCode = (typeof ACTIVITY_EVENT_CODES)[number];
|
|
4
4
|
export declare function isActivityEventCode(value: string): value is ActivityEventCode;
|
|
5
5
|
export declare function isValidActivityEventFilter(filter: string): boolean;
|
|
@@ -10,6 +10,9 @@ export declare const activityActorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
10
10
|
}, z.core.$strip>, z.ZodObject<{
|
|
11
11
|
type: z.ZodLiteral<"api_key">;
|
|
12
12
|
id: z.ZodString;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
type: z.ZodLiteral<"partner_token">;
|
|
15
|
+
id: z.ZodString;
|
|
13
16
|
}, z.core.$strip>, z.ZodObject<{
|
|
14
17
|
type: z.ZodLiteral<"oauth_client">;
|
|
15
18
|
id: z.ZodString;
|
|
@@ -32,6 +35,10 @@ export declare const activityEventSchema: z.ZodObject<{
|
|
|
32
35
|
id: z.ZodString;
|
|
33
36
|
sequence: z.ZodNumber;
|
|
34
37
|
tenantId: z.ZodString;
|
|
38
|
+
mode: z.ZodEnum<{
|
|
39
|
+
live: "live";
|
|
40
|
+
test: "test";
|
|
41
|
+
}>;
|
|
35
42
|
principal: z.ZodNullable<z.ZodObject<{
|
|
36
43
|
tenantId: z.ZodString;
|
|
37
44
|
principalType: z.ZodEnum<{
|
|
@@ -47,6 +54,9 @@ export declare const activityEventSchema: z.ZodObject<{
|
|
|
47
54
|
}, z.core.$strip>, z.ZodObject<{
|
|
48
55
|
type: z.ZodLiteral<"api_key">;
|
|
49
56
|
id: z.ZodString;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
type: z.ZodLiteral<"partner_token">;
|
|
59
|
+
id: z.ZodString;
|
|
50
60
|
}, z.core.$strip>, z.ZodObject<{
|
|
51
61
|
type: z.ZodLiteral<"oauth_client">;
|
|
52
62
|
id: z.ZodString;
|
|
@@ -80,6 +90,10 @@ export declare const activityListResponseSchema: z.ZodObject<{
|
|
|
80
90
|
id: z.ZodString;
|
|
81
91
|
sequence: z.ZodNumber;
|
|
82
92
|
tenantId: z.ZodString;
|
|
93
|
+
mode: z.ZodEnum<{
|
|
94
|
+
live: "live";
|
|
95
|
+
test: "test";
|
|
96
|
+
}>;
|
|
83
97
|
principal: z.ZodNullable<z.ZodObject<{
|
|
84
98
|
tenantId: z.ZodString;
|
|
85
99
|
principalType: z.ZodEnum<{
|
|
@@ -95,6 +109,9 @@ export declare const activityListResponseSchema: z.ZodObject<{
|
|
|
95
109
|
}, z.core.$strip>, z.ZodObject<{
|
|
96
110
|
type: z.ZodLiteral<"api_key">;
|
|
97
111
|
id: z.ZodString;
|
|
112
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
113
|
+
type: z.ZodLiteral<"partner_token">;
|
|
114
|
+
id: z.ZodString;
|
|
98
115
|
}, z.core.$strip>, z.ZodObject<{
|
|
99
116
|
type: z.ZodLiteral<"oauth_client">;
|
|
100
117
|
id: z.ZodString;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AnyObjectSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
import { tenantMode } from "./enums.js";
|
|
4
|
+
import { PRINCIPAL_NOTIFICATION_EVENT_CODES } from "./partner-notifications.js";
|
|
5
|
+
// The single event taxonomy (the platform spec "Event taxonomy"). Every emitted
|
|
6
|
+
// event and every webhook `events` filter selects on these codes, and
|
|
7
|
+
// `appendActivityEvent` is typed against the list, so an off-list code fails CI.
|
|
8
8
|
export const ACTIVITY_EVENT_CODES = [
|
|
9
9
|
// space
|
|
10
10
|
"space.created",
|
|
@@ -19,8 +19,6 @@ export const ACTIVITY_EVENT_CODES = [
|
|
|
19
19
|
"space.slug_updated",
|
|
20
20
|
// site
|
|
21
21
|
"site.provision_requested",
|
|
22
|
-
"site.placement_hold_set",
|
|
23
|
-
"site.placement_hold_cleared",
|
|
24
22
|
"site.burst_toggled",
|
|
25
23
|
// access
|
|
26
24
|
"space.access_logout_all",
|
|
@@ -94,38 +92,59 @@ export const ACTIVITY_EVENT_CODES = [
|
|
|
94
92
|
"webhook.secret_rotated",
|
|
95
93
|
"webhook.disabled",
|
|
96
94
|
"webhook.deleted",
|
|
97
|
-
// team (
|
|
98
|
-
// pooled monthly builds+deploys meter is SOFT — it tracks, never blocks)
|
|
95
|
+
// team (the pooled monthly builds+deploys meter is SOFT: it tracks, never blocks)
|
|
99
96
|
"team.updated",
|
|
100
97
|
"team.slug_updated",
|
|
101
98
|
"team.member_added",
|
|
102
99
|
"team.member_removed",
|
|
103
100
|
"team.member_role_updated",
|
|
104
101
|
"team.builds_deploys_quota_exceeded",
|
|
105
|
-
// tenant
|
|
102
|
+
// tenant
|
|
106
103
|
"tenant.past_due",
|
|
107
104
|
"tenant.suspended",
|
|
108
105
|
"tenant.reactivated",
|
|
109
106
|
"tenant.deleted",
|
|
107
|
+
// principal (partner commerce lifecycle; §4/§5). `plan_reset` fires when a
|
|
108
|
+
// plan an external principal is assigned to drops out of the tenant's
|
|
109
|
+
// system-space plan catalog and the assignment falls back to the default.
|
|
110
|
+
"principal.plan_reset",
|
|
111
|
+
// Fires when an external principal creates a space that trips its plan's
|
|
112
|
+
// space-count quota under the `warn` enforcement policy — the create is
|
|
113
|
+
// allowed through and this records the overage instead of blocking.
|
|
114
|
+
"principal.space_quota_exceeded",
|
|
115
|
+
// Lifecycle transitions (§4). `suspended` darkens the principal's spaces
|
|
116
|
+
// (402 suspended page) and blocks its mutations; `unsuspended` restores both;
|
|
117
|
+
// `closed` is terminal. Each carries the acting actor so a Spacefast-applied
|
|
118
|
+
// status is distinguishable from a partner-applied one.
|
|
119
|
+
"principal.suspended",
|
|
120
|
+
"principal.unsuspended",
|
|
121
|
+
"principal.closed",
|
|
122
|
+
// partner usage ledger
|
|
123
|
+
"usage.threshold_crossed",
|
|
124
|
+
"usage.period_finalized",
|
|
125
|
+
"usage.corrected",
|
|
126
|
+
// principal notifications (partner API §7): the customer-facing notifications
|
|
127
|
+
// a partner white-labels. Spacefast delegates them — instead of emailing the
|
|
128
|
+
// partner's own end customer, it emits the event here for the partner to
|
|
129
|
+
// deliver. Defined in partner-notifications.ts (the subscribe-side catalog)
|
|
130
|
+
// and folded in so each is a first-class taxonomy code with a grammar row and
|
|
131
|
+
// a valid webhook filter.
|
|
132
|
+
...PRINCIPAL_NOTIFICATION_EVENT_CODES,
|
|
110
133
|
// comments
|
|
111
134
|
"comment.token_minted",
|
|
112
135
|
"comment.created",
|
|
113
136
|
"comment.reply_created",
|
|
114
137
|
"comment.archived",
|
|
115
138
|
"comment.unarchived",
|
|
116
|
-
// abuse
|
|
139
|
+
// abuse
|
|
117
140
|
"abuse_report.created",
|
|
118
141
|
"abuse_report.updated",
|
|
119
|
-
// claim (
|
|
120
|
-
// flagged, never silently 404ed — the platform spec "Abuse Posture")
|
|
142
|
+
// claim (an attempt against a taken-down space is flagged, never silently 404ed)
|
|
121
143
|
"claim.blocked_takedown",
|
|
122
144
|
"claim.authority_rotated",
|
|
123
|
-
// user
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
// signup; `user.signed_in` fires per non-impersonation session creation;
|
|
127
|
-
// `user.deleted` fires on account deletion and retains the analyticsId in
|
|
128
|
-
// its details so right-to-erasure can be completed in every provider.
|
|
145
|
+
// user. `user.signed_in` fires per non-impersonation session creation.
|
|
146
|
+
// `user.deleted` retains the analyticsId in its details so right-to-erasure
|
|
147
|
+
// can be completed in every provider.
|
|
129
148
|
"user.created",
|
|
130
149
|
"user.signed_in",
|
|
131
150
|
"user.deleted",
|
|
@@ -133,20 +152,43 @@ export const ACTIVITY_EVENT_CODES = [
|
|
|
133
152
|
"user.impersonation_stopped",
|
|
134
153
|
"user.two_factor_enabled",
|
|
135
154
|
"user.two_factor_disabled",
|
|
155
|
+
// Security notifications (auth/security-events.ts): every auth mutation that
|
|
156
|
+
// changes how the account can be entered lands here AND mails the owner
|
|
157
|
+
// through the same pipeline. Ids only in details, never addresses or names.
|
|
158
|
+
"user.password_set",
|
|
159
|
+
"user.password_changed",
|
|
160
|
+
"user.provider_linked",
|
|
161
|
+
"user.provider_unlinked",
|
|
162
|
+
"user.email_added",
|
|
163
|
+
"user.email_removed",
|
|
164
|
+
"user.primary_email_changed",
|
|
165
|
+
"user.superadmin_granted",
|
|
166
|
+
"user.superadmin_revoked",
|
|
167
|
+
"user.privacy_updated",
|
|
168
|
+
"user.deletion_requested",
|
|
169
|
+
"user.deletion_completed",
|
|
136
170
|
];
|
|
137
171
|
const ACTIVITY_EVENT_CODE_SET = new Set(ACTIVITY_EVENT_CODES);
|
|
138
|
-
|
|
172
|
+
// Every dot-delimited prefix a code carries, at each segment boundary — the set
|
|
173
|
+
// a prefix wildcard may name. `version.ready` contributes `version`;
|
|
174
|
+
// `principal.notification.claim` contributes both `principal` and
|
|
175
|
+
// `principal.notification`, so a partner can subscribe to the whole
|
|
176
|
+
// `principal.notification.*` class in one filter.
|
|
177
|
+
const ACTIVITY_EVENT_PREFIXES = new Set(ACTIVITY_EVENT_CODES.flatMap((code) => {
|
|
178
|
+
const parts = code.split(".");
|
|
179
|
+
return parts.slice(0, -1).map((_, index) => parts.slice(0, index + 1).join("."));
|
|
180
|
+
}));
|
|
139
181
|
export function isActivityEventCode(value) {
|
|
140
182
|
return ACTIVITY_EVENT_CODE_SET.has(value);
|
|
141
183
|
}
|
|
142
|
-
// Webhook `events` filters accept exact codes, prefix wildcards ("version.*"
|
|
143
|
-
// and the catch-all ["*"].
|
|
184
|
+
// Webhook `events` filters accept exact codes, prefix wildcards ("version.*",
|
|
185
|
+
// "principal.notification.*"), and the catch-all ["*"].
|
|
144
186
|
export function isValidActivityEventFilter(filter) {
|
|
145
187
|
if (filter === "*") {
|
|
146
188
|
return true;
|
|
147
189
|
}
|
|
148
190
|
if (filter.endsWith(".*")) {
|
|
149
|
-
return
|
|
191
|
+
return ACTIVITY_EVENT_PREFIXES.has(filter.slice(0, -2));
|
|
150
192
|
}
|
|
151
193
|
return ACTIVITY_EVENT_CODE_SET.has(filter);
|
|
152
194
|
}
|
|
@@ -158,6 +200,7 @@ export function matchesActivityEventFilters(filters, code) {
|
|
|
158
200
|
export const activityActorSchema = z.discriminatedUnion("type", [
|
|
159
201
|
z.object({ type: z.literal("user"), id: z.string().min(1) }),
|
|
160
202
|
z.object({ type: z.literal("api_key"), id: z.string().min(1) }),
|
|
203
|
+
z.object({ type: z.literal("partner_token"), id: z.string().min(1) }),
|
|
161
204
|
z.object({ type: z.literal("oauth_client"), id: z.string().min(1) }),
|
|
162
205
|
z.object({ type: z.literal("anonymous_claim"), id: z.string().min(1) }),
|
|
163
206
|
z.object({ type: z.literal("system"), id: z.string().min(1) }),
|
|
@@ -171,6 +214,7 @@ export const activityEventSchema = z.object({
|
|
|
171
214
|
id: z.string(),
|
|
172
215
|
sequence: z.number().int().nonnegative(),
|
|
173
216
|
tenantId: z.string(),
|
|
217
|
+
mode: tenantMode.describe("`test` when the event's tenant is a linked test tenant, `live` otherwise."),
|
|
174
218
|
principal: activityPrincipalSchema.nullable(),
|
|
175
219
|
spaceId: z.string().nullable(),
|
|
176
220
|
actor: activityActorSchema,
|
|
@@ -183,9 +227,9 @@ export const activityQuerySchema = cursorListQuerySchema.extend({
|
|
|
183
227
|
principalType: z
|
|
184
228
|
.enum(["team", "external"])
|
|
185
229
|
.optional()
|
|
186
|
-
.describe("Filter
|
|
187
|
-
principalId: z.string().min(1).optional().describe("Filter to
|
|
188
|
-
spaceId: z.string().min(1).optional().describe("Filter to
|
|
230
|
+
.describe("Filter by owning principal type."),
|
|
231
|
+
principalId: z.string().min(1).optional().describe("Filter to one principal."),
|
|
232
|
+
spaceId: z.string().min(1).optional().describe("Filter to one space."),
|
|
189
233
|
code: z
|
|
190
234
|
.string()
|
|
191
235
|
.min(1)
|
|
@@ -4,11 +4,10 @@ export const DOMAIN_SSH_ANALYTICS_EVENTS = [
|
|
|
4
4
|
"domain_ssh_session_ended",
|
|
5
5
|
"domain_ssh_lookup_requested",
|
|
6
6
|
];
|
|
7
|
-
// Direct product analytics events
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
// activity fan-out instead, so a business moment is never captured twice.
|
|
7
|
+
// Direct product analytics events: request/funnel moments the activity taxonomy
|
|
8
|
+
// (contracts/activity.ts) deliberately does NOT record. Everything that IS an
|
|
9
|
+
// activity event reaches the providers through the activity fan-out, so a
|
|
10
|
+
// business moment is never captured twice.
|
|
12
11
|
export const ANALYTICS_EVENTS = [
|
|
13
12
|
"version_intent_created",
|
|
14
13
|
"version_finalize_queued",
|
|
@@ -57,11 +56,10 @@ export const domainSshAnalyticsEventSchema = z.object({
|
|
|
57
56
|
.optional(),
|
|
58
57
|
units: z.coerce.number().int().min(1).max(DOMAIN_SSH_ANALYTICS_MAX_UNITS).optional(),
|
|
59
58
|
});
|
|
60
|
-
// Tracks (Automattic analytics) naming rules, shared by the browser pixel
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
64
|
-
// (`space.created`, `cli.command`) and camelCase details, so both normalize.
|
|
59
|
+
// Tracks (Automattic analytics) naming rules, shared by the browser pixel client
|
|
60
|
+
// and the control-plane REST client: event names are `stattic_<noun>_<verb>` and
|
|
61
|
+
// property names lowercase snake_case (calypso-analytics validation). Internal
|
|
62
|
+
// names use dots and camelCase, so both normalize.
|
|
65
63
|
export const TRACKS_EVENT_PREFIX = "stattic";
|
|
66
64
|
export function tracksEventName(name) {
|
|
67
65
|
const normalized = name
|