@spacefast/common 0.2.2 → 0.4.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/marketplace-prompts.d.ts +1 -0
- package/dist/agents/marketplace-prompts.js +6 -0
- package/dist/agents/registry/core.d.ts +4 -12
- package/dist/agents/registry/core.js +7 -28
- package/dist/config/domains.d.ts +10 -8
- package/dist/config/domains.js +4 -7
- package/dist/contracts/access-core.d.ts +135 -0
- package/dist/contracts/access-core.js +242 -0
- package/dist/contracts/access-profiles.d.ts +8 -8
- package/dist/contracts/access-profiles.js +8 -8
- package/dist/contracts/access.d.ts +14 -103
- package/dist/contracts/access.js +10 -210
- package/dist/contracts/activity.d.ts +54 -55
- package/dist/contracts/activity.js +38 -9
- package/dist/contracts/api-keys.d.ts +69 -26
- package/dist/contracts/api-keys.js +29 -2
- package/dist/contracts/application-journal.d.ts +197 -4
- package/dist/contracts/application-journal.js +97 -16
- package/dist/contracts/auth.d.ts +20 -0
- package/dist/contracts/auth.js +18 -0
- package/dist/contracts/beta.d.ts +13 -0
- package/dist/contracts/beta.js +28 -0
- package/dist/contracts/billing.d.ts +2 -2
- package/dist/contracts/bootstrap.d.ts +23 -6
- package/dist/contracts/builds.d.ts +18 -4
- package/dist/contracts/builds.js +7 -4
- package/dist/contracts/channels.d.ts +43 -0
- package/dist/contracts/channels.js +22 -6
- package/dist/contracts/comments.d.ts +49 -0
- package/dist/contracts/comments.js +61 -2
- package/dist/contracts/commerce.d.ts +19 -13
- package/dist/contracts/connector-access.d.ts +28 -0
- package/dist/contracts/connector-access.js +31 -0
- package/dist/contracts/connectors.d.ts +2382 -0
- package/dist/contracts/connectors.js +941 -0
- package/dist/contracts/content-contract-verification.d.ts +112 -58
- package/dist/contracts/content-contract-verification.js +42 -54
- package/dist/contracts/content-model-emit.d.ts +97 -0
- package/dist/contracts/content-model-emit.js +306 -0
- package/dist/contracts/content-model-sdk.d.ts +101 -0
- package/dist/contracts/content-model-sdk.js +232 -0
- package/dist/contracts/{content-program.d.ts → content-model.d.ts} +338 -82
- package/dist/contracts/{content-program.js → content-model.js} +291 -63
- package/dist/contracts/content-platform-fixture.d.ts +380 -110
- package/dist/contracts/content-platform-fixture.js +8 -8
- package/dist/contracts/content-sync.d.ts +197 -74
- package/dist/contracts/content-sync.js +98 -37
- package/dist/contracts/content.d.ts +30 -422
- package/dist/contracts/content.js +34 -294
- package/dist/contracts/dashboard-prefs.d.ts +10 -3
- package/dist/contracts/dashboard-prefs.js +6 -3
- package/dist/contracts/data-location.d.ts +9 -0
- package/dist/contracts/data-location.js +7 -0
- package/dist/contracts/deployment-comparison.d.ts +67 -0
- package/dist/contracts/deployment-comparison.js +68 -0
- package/dist/contracts/device-auth.d.ts +55 -11
- package/dist/contracts/domains.d.ts +40 -16
- package/dist/contracts/domains.js +23 -0
- package/dist/contracts/enums.d.ts +1 -10
- package/dist/contracts/enums.js +0 -15
- package/dist/contracts/error-code-meta.d.ts +384 -20
- package/dist/contracts/error-code-meta.js +200 -5
- package/dist/contracts/error-codes.d.ts +17 -4
- package/dist/contracts/error-codes.js +108 -10
- package/dist/contracts/events.d.ts +5 -0
- package/dist/contracts/events.js +12 -3
- package/dist/contracts/execution.d.ts +5 -1
- package/dist/contracts/execution.js +4 -0
- package/dist/contracts/feature-lifecycle.d.ts +53 -20
- package/dist/contracts/feature-lifecycle.js +65 -23
- package/dist/contracts/features.d.ts +57 -31
- package/dist/contracts/features.js +0 -1
- package/dist/contracts/feedback.d.ts +124 -0
- package/dist/contracts/feedback.js +64 -0
- package/dist/contracts/fixtures/content-model-sdk-v1.generated.d.ts +129 -0
- package/dist/contracts/fixtures/content-model-sdk-v1.generated.js +48 -0
- package/dist/contracts/fixtures/content-platform-v1.json +101 -49
- package/dist/contracts/frame-session.d.ts +60 -10
- package/dist/contracts/frame-session.js +52 -12
- package/dist/contracts/functions.d.ts +28 -2
- package/dist/contracts/functions.js +25 -2
- package/dist/contracts/grant-copy.d.ts +2 -0
- package/dist/contracts/grant-copy.js +2 -0
- package/dist/contracts/grants-core.d.ts +95 -0
- package/dist/contracts/grants-core.js +435 -0
- package/dist/contracts/grants.d.ts +13 -84
- package/dist/contracts/grants.js +21 -369
- package/dist/contracts/ids-core.d.ts +11 -0
- package/dist/contracts/ids-core.js +14 -0
- package/dist/contracts/ids.d.ts +7 -4
- package/dist/contracts/ids.js +12 -4
- package/dist/contracts/internal.d.ts +18 -0
- package/dist/contracts/internal.js +19 -0
- package/dist/contracts/mcp.d.ts +8 -18
- package/dist/contracts/mcp.js +2 -23
- package/dist/contracts/notifications.d.ts +4 -1
- package/dist/contracts/notifications.js +1 -0
- package/dist/contracts/oauth-resources.d.ts +46 -9
- package/dist/contracts/oauth-resources.js +50 -1
- package/dist/contracts/oauth-scope-actions.d.ts +27 -3
- package/dist/contracts/oauth-scope-actions.js +18 -8
- package/dist/contracts/operations.d.ts +1 -1
- package/dist/contracts/partner-account.d.ts +629 -0
- package/dist/contracts/partner-account.js +18 -0
- package/dist/contracts/principal-assertion.d.ts +74 -1
- package/dist/contracts/principal-assertion.js +67 -3
- package/dist/contracts/publish-archive.d.ts +22 -1
- package/dist/contracts/push-new.d.ts +3 -3
- package/dist/contracts/push-new.js +1 -1
- package/dist/contracts/quotas.js +2 -1
- package/dist/contracts/repository-connections.d.ts +10 -6
- package/dist/contracts/repository-connections.js +15 -0
- package/dist/contracts/resources.d.ts +6 -5
- package/dist/contracts/resources.js +7 -0
- package/dist/contracts/route-inventory.d.ts +74 -19
- package/dist/contracts/route-inventory.js +20 -6
- package/dist/contracts/runtime-api.d.ts +415 -4
- package/dist/contracts/runtime-api.js +60 -15
- package/dist/contracts/runtime-app.d.ts +6 -1
- package/dist/contracts/runtime-components.d.ts +646 -18
- package/dist/contracts/runtime-components.js +304 -188
- package/dist/contracts/runtime-services.d.ts +15 -0
- package/dist/contracts/runtime-services.js +25 -0
- package/dist/contracts/runtime-storage.d.ts +32 -0
- package/dist/contracts/runtime-storage.js +37 -0
- package/dist/contracts/source-workspaces.d.ts +511 -0
- package/dist/contracts/source-workspaces.js +276 -0
- package/dist/contracts/space-config-spacefast.d.ts +394 -0
- package/dist/contracts/space-config-spacefast.js +70 -0
- package/dist/contracts/space-config.d.ts +177 -90
- package/dist/contracts/space-config.js +77 -92
- package/dist/contracts/spaces.d.ts +132 -24
- package/dist/contracts/spaces.js +77 -13
- package/dist/contracts/superadmin-connectors.d.ts +371 -0
- package/dist/contracts/superadmin-connectors.js +61 -0
- package/dist/contracts/superadmin-emails.d.ts +1 -1
- package/dist/contracts/superadmin-emails.js +1 -1
- package/dist/contracts/superadmin-entities.d.ts +105 -0
- package/dist/contracts/superadmin-entities.js +64 -0
- package/dist/contracts/superadmin-runtime.d.ts +35 -116
- package/dist/contracts/superadmin-runtime.js +13 -69
- package/dist/contracts/superadmin-search.d.ts +12 -14
- package/dist/contracts/superadmin-search.js +2 -2
- package/dist/contracts/superadmin-spaces.d.ts +15 -72
- package/dist/contracts/superadmin-spaces.js +2 -7
- package/dist/contracts/superadmin-teams.d.ts +12 -0
- package/dist/contracts/superadmin-teams.js +7 -1
- package/dist/contracts/superadmin-tenants.d.ts +44 -16
- package/dist/contracts/superadmin.d.ts +2 -2
- package/dist/contracts/tags.d.ts +12 -12
- package/dist/contracts/teams.d.ts +29 -1
- package/dist/contracts/teams.js +24 -2
- package/dist/contracts/tenants.d.ts +98 -0
- package/dist/contracts/tenants.js +20 -0
- package/dist/contracts/transfers.d.ts +92 -0
- package/dist/contracts/transfers.js +37 -0
- package/dist/contracts/usage.d.ts +9 -1
- package/dist/contracts/usage.js +2 -0
- package/dist/contracts/visual-review.d.ts +448 -0
- package/dist/contracts/visual-review.js +156 -0
- package/dist/contracts/wordpress-php-toolkit.json +9 -0
- package/dist/contracts/work-mode.d.ts +24 -0
- package/dist/contracts/work-mode.js +17 -0
- package/dist/contracts/wp-cli.d.ts +66 -0
- package/dist/contracts/wp-cli.js +68 -0
- package/dist/contracts/zero-catalog.d.ts +29 -0
- package/dist/contracts/zero-catalog.js +55 -0
- package/dist/contracts/zero-platform-abilities.generated.d.ts +31 -0
- package/dist/contracts/zero-platform-abilities.generated.js +373 -0
- package/dist/contracts/zero-spacefast.d.ts +444 -0
- package/dist/contracts/zero-spacefast.js +149 -0
- package/dist/contracts/zero-types.d.ts +47 -0
- package/dist/contracts/zero-types.js +263 -0
- package/dist/contracts/zero.d.ts +781 -14
- package/dist/contracts/zero.js +204 -10
- package/dist/dashboard-paths/index.d.ts +2 -2
- package/dist/dashboard-paths/route-reservations.generated.d.ts +2 -2
- package/dist/dashboard-paths/route-reservations.generated.js +5 -0
- package/dist/docs/agent-prose.d.ts +1 -1
- package/dist/docs/agent-prose.js +15 -18
- package/dist/docs/agent-setup.d.ts +1 -1
- package/dist/docs/agent-setup.js +5 -13
- package/dist/docs/catalog.d.ts +64 -28
- package/dist/docs/catalog.js +155 -28
- package/dist/docs/error-docs.d.ts +361 -17
- package/dist/docs/error-docs.js +365 -21
- package/dist/docs/reference-urls.js +1 -1
- package/dist/docs/skills.d.ts +84 -84
- package/dist/docs/skills.js +66 -47
- package/dist/docs/start-prompts.d.ts +14 -0
- package/dist/docs/start-prompts.js +20 -0
- package/dist/utils/account-labels.d.ts +7 -0
- package/dist/utils/account-labels.js +15 -0
- package/dist/utils/auth.d.ts +1 -0
- package/dist/utils/auth.js +1 -0
- package/dist/utils/credential-policy.d.ts +22 -1
- package/dist/utils/credential-policy.js +55 -6
- package/dist/utils/local-space-state.d.ts +7 -0
- package/dist/utils/local-space-state.js +7 -0
- package/dist/utils/logger.d.ts +34 -0
- package/dist/utils/logger.js +144 -0
- package/dist/utils/page-routes.d.ts +9 -0
- package/dist/utils/page-routes.js +82 -0
- package/dist/utils/pages.d.ts +2 -0
- package/dist/utils/pages.js +7 -0
- package/dist/utils/publish-form-data.d.ts +2 -0
- package/dist/utils/publish-form-data.js +2 -0
- package/dist/utils/publish-policy-spacefast.d.ts +13 -0
- package/dist/utils/publish-policy-spacefast.js +117 -0
- package/dist/utils/publish-policy.d.ts +22 -16
- package/dist/utils/publish-policy.fixtures.json +15 -0
- package/dist/utils/publish-policy.js +62 -139
- package/dist/utils/query-client.js +9 -1
- package/dist/utils/runtime-upload.d.ts +4 -0
- package/dist/utils/runtime-upload.js +5 -0
- package/dist/utils/space-config.d.ts +2 -3
- package/dist/utils/space-config.js +1 -1
- package/dist/utils/uploaded-source.d.ts +4 -0
- package/dist/utils/uploaded-source.js +12 -0
- package/dist/visual-review.d.ts +4 -0
- package/dist/visual-review.js +208 -0
- package/dist/vocabulary.d.ts +38 -0
- package/dist/vocabulary.js +55 -0
- package/package.json +7 -2
- package/dist/agents/registry/deeplink-probes.d.ts +0 -23
- package/dist/agents/registry/deeplink-probes.js +0 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { OAUTH_SHARED_API_RESOURCE_SCOPES } from "./oauth-resources.js";
|
|
2
|
+
import { OAUTH_AGENT_DEFAULT_SCOPES, OAUTH_SHARED_API_RESOURCE_SCOPES } from "./oauth-resources.js";
|
|
3
3
|
import { isTenantAdmissionAction, oauthScopeActions } from "./oauth-scope-actions.js";
|
|
4
4
|
/**
|
|
5
5
|
* The scopes any interactive authorization may grant — THE list every surface
|
|
@@ -23,10 +23,10 @@ export const AccessProfileIdSchema = z.enum(ACCESS_PROFILE_IDS);
|
|
|
23
23
|
/**
|
|
24
24
|
* Named grant profiles. A profile is REQUEST INTENT — one word on device start
|
|
25
25
|
* with a server-owned meaning — never authority. Scopes are the grant
|
|
26
|
-
* vocabulary; actions are authority.
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* vocabulary; actions are authority. Agent access grants routine capabilities by
|
|
27
|
+
* default and leaves destructive Space deletion for explicit or temporary
|
|
28
|
+
* approval. Every capability remains capped per team by the approver's live role
|
|
29
|
+
* at request time.
|
|
30
30
|
*/
|
|
31
31
|
export const ACCESS_PROFILES = {
|
|
32
32
|
// Read-only. It can open a hosted MCP session and invoke tools (each tool call
|
|
@@ -43,9 +43,9 @@ export const ACCESS_PROFILES = {
|
|
|
43
43
|
agent: {
|
|
44
44
|
id: "agent",
|
|
45
45
|
label: "Agent access",
|
|
46
|
-
blurb: "Create and publish sites
|
|
47
|
-
limits: "It can't
|
|
48
|
-
scopes: [...
|
|
46
|
+
blurb: "Create and publish sites. Manage domains and DNS. Invite team members, create teams, and use Spacefast tools.",
|
|
47
|
+
limits: "It asks for temporary approval before it deletes sites. It can't remove team members, change their roles, change billing, or mint credentials.",
|
|
48
|
+
scopes: [...OAUTH_AGENT_DEFAULT_SCOPES],
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
export const DEFAULT_ACCESS_PROFILE_ID = "agent";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
export * from "./access-core.js";
|
|
3
|
+
/** The sharing preset a Space is created with, and what the dashboard offers. */
|
|
3
4
|
export declare const SPACE_ACCESS_PRESETS: readonly ["private", "team", "public"];
|
|
4
|
-
export declare const ACCESS_HANDOFF_MEDIA_TYPE = "application/vnd.spacefast.access-handoff+json";
|
|
5
5
|
export declare const spaceAccessPresetSchema: z.ZodEnum<{
|
|
6
6
|
team: "team";
|
|
7
7
|
private: "private";
|
|
@@ -9,67 +9,14 @@ export declare const spaceAccessPresetSchema: z.ZodEnum<{
|
|
|
9
9
|
}>;
|
|
10
10
|
export type SpaceAccessPreset = z.infer<typeof spaceAccessPresetSchema>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* and role⇄capability mapping: every surface derives its capabilities here.
|
|
12
|
+
* Capabilities a forwardable secret (a Link, a password) can carry. It never
|
|
13
|
+
* publishes and never manages access.
|
|
15
14
|
*/
|
|
16
|
-
export declare const ACCESS_ROLES: readonly ["viewer", "commenter", "editor", "manager"];
|
|
17
|
-
export declare const accessRoleSchema: z.ZodEnum<{
|
|
18
|
-
editor: "editor";
|
|
19
|
-
viewer: "viewer";
|
|
20
|
-
commenter: "commenter";
|
|
21
|
-
manager: "manager";
|
|
22
|
-
}>;
|
|
23
|
-
export type AccessRole = z.infer<typeof accessRoleSchema>;
|
|
24
|
-
export declare const ACCESS_ROLE_CAPABILITIES: {
|
|
25
|
-
readonly viewer: readonly ["page.view"];
|
|
26
|
-
readonly commenter: readonly ["page.view", "comments.read", "comments.write"];
|
|
27
|
-
readonly editor: readonly ["page.view", "comments.read", "comments.write", "content.publish"];
|
|
28
|
-
readonly manager: readonly ["page.view", "comments.read", "comments.write", "content.publish", "access.manage"];
|
|
29
|
-
};
|
|
30
|
-
export declare function accessRoleCapabilities(role: AccessRole): GrantCapability[];
|
|
31
|
-
/**
|
|
32
|
-
* The role a capability set amounts to: the strongest role it reaches, never
|
|
33
|
-
* more. A Grant assembled capability-by-capability need not match one exactly.
|
|
34
|
-
*/
|
|
35
|
-
export declare function accessRoleForCapabilities(capabilities: readonly GrantCapability[]): AccessRole;
|
|
36
|
-
/**
|
|
37
|
-
* Roles a forwardable secret (a Link, a password) can carry. It never publishes
|
|
38
|
-
* and never manages access; `grantSchema` enforces that on capabilities too.
|
|
39
|
-
*/
|
|
40
|
-
export declare const VISITOR_ACCESS_ROLES: readonly ["viewer", "commenter"];
|
|
41
|
-
export type VisitorAccessRole = (typeof VISITOR_ACCESS_ROLES)[number];
|
|
42
15
|
export declare const linkCapabilitySchema: z.ZodEnum<{
|
|
43
16
|
"page.view": "page.view";
|
|
44
17
|
"comments.read": "comments.read";
|
|
45
18
|
"comments.write": "comments.write";
|
|
46
19
|
}>;
|
|
47
|
-
export declare function accessRoleRank(role: AccessRole): number;
|
|
48
|
-
export declare function maxAccessRole(left: AccessRole | null, right: AccessRole | null): AccessRole | null;
|
|
49
|
-
/**
|
|
50
|
-
* Canonicalizes the URL route identity used by People, Links, requests,
|
|
51
|
-
* comments, and runtime authorization.
|
|
52
|
-
*/
|
|
53
|
-
export declare function normalizeAccessScopePath(input: string): string;
|
|
54
|
-
export declare const accessScopePathSchema: z.ZodString;
|
|
55
|
-
export type AccessScopePath = z.infer<typeof accessScopePathSchema>;
|
|
56
|
-
export declare function accessScopeContains(scope: string, path: string): boolean;
|
|
57
|
-
export declare const authorityReferenceSchema: z.ZodString;
|
|
58
|
-
export type AuthorityReference = z.infer<typeof authorityReferenceSchema>;
|
|
59
|
-
export declare const accountPrincipalSchema: z.ZodString;
|
|
60
|
-
export type AccountPrincipal = z.infer<typeof accountPrincipalSchema>;
|
|
61
|
-
export declare const identifiedPrincipalSchema: z.ZodString;
|
|
62
|
-
export type IdentifiedPrincipal = z.infer<typeof identifiedPrincipalSchema>;
|
|
63
|
-
export declare const accessPrincipalSchema: z.ZodUnion<readonly [z.ZodLiteral<"anonymous">, z.ZodString]>;
|
|
64
|
-
export type AccessPrincipal = z.infer<typeof accessPrincipalSchema>;
|
|
65
|
-
export declare function accountPrincipal(userId: string): AccountPrincipal;
|
|
66
|
-
/** The user id behind an account principal; null for anonymous or malformed. */
|
|
67
|
-
export declare function accountPrincipalUserId(principal: string | undefined | null): string | null;
|
|
68
|
-
/**
|
|
69
|
-
* The identity an authority reference names on its own, if any. The ONE place a
|
|
70
|
-
* class maps to an identity: at the exchange that authenticated it, never after.
|
|
71
|
-
*/
|
|
72
|
-
export declare function principalForAuthority(reference: AuthorityReference): IdentifiedPrincipal | undefined;
|
|
73
20
|
export declare const personGrantSchema: z.ZodObject<{
|
|
74
21
|
id: z.ZodString;
|
|
75
22
|
scope: z.ZodString;
|
|
@@ -95,9 +42,9 @@ export declare const personGrantSchema: z.ZodObject<{
|
|
|
95
42
|
}, z.core.$strip>;
|
|
96
43
|
export type PersonGrant = z.infer<typeof personGrantSchema>;
|
|
97
44
|
export declare const spacePersonStatusSchema: z.ZodEnum<{
|
|
98
|
-
revoked: "revoked";
|
|
99
45
|
pending: "pending";
|
|
100
46
|
accepted: "accepted";
|
|
47
|
+
revoked: "revoked";
|
|
101
48
|
}>;
|
|
102
49
|
export declare const spacePersonDisplayNameSchema: z.ZodString;
|
|
103
50
|
export declare function fallbackSpacePersonDisplayName(personId: string): string;
|
|
@@ -107,9 +54,9 @@ export declare const spacePersonSchema: z.ZodObject<{
|
|
|
107
54
|
displayName: z.ZodString;
|
|
108
55
|
email: z.ZodNullable<z.ZodString>;
|
|
109
56
|
status: z.ZodEnum<{
|
|
110
|
-
revoked: "revoked";
|
|
111
57
|
pending: "pending";
|
|
112
58
|
accepted: "accepted";
|
|
59
|
+
revoked: "revoked";
|
|
113
60
|
}>;
|
|
114
61
|
grants: z.ZodArray<z.ZodObject<{
|
|
115
62
|
id: z.ZodString;
|
|
@@ -162,9 +109,9 @@ export declare const spacePeopleListSchema: z.ZodObject<{
|
|
|
162
109
|
displayName: z.ZodString;
|
|
163
110
|
email: z.ZodNullable<z.ZodString>;
|
|
164
111
|
status: z.ZodEnum<{
|
|
165
|
-
revoked: "revoked";
|
|
166
112
|
pending: "pending";
|
|
167
113
|
accepted: "accepted";
|
|
114
|
+
revoked: "revoked";
|
|
168
115
|
}>;
|
|
169
116
|
grants: z.ZodArray<z.ZodObject<{
|
|
170
117
|
id: z.ZodString;
|
|
@@ -237,6 +184,7 @@ export declare const accessShareLinkSchema: z.ZodObject<{
|
|
|
237
184
|
excludedCountries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
238
185
|
excludedUserAgentSubstrings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
239
186
|
}, z.core.$strict>>;
|
|
187
|
+
frameOrigin: z.ZodOptional<z.ZodString>;
|
|
240
188
|
}, z.core.$strict>;
|
|
241
189
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
242
190
|
kind: z.ZodLiteral<"live">;
|
|
@@ -284,6 +232,7 @@ export declare const accessShareLinkWithUrlSchema: z.ZodObject<{
|
|
|
284
232
|
excludedCountries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
285
233
|
excludedUserAgentSubstrings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
286
234
|
}, z.core.$strict>>;
|
|
235
|
+
frameOrigin: z.ZodOptional<z.ZodString>;
|
|
287
236
|
}, z.core.$strict>;
|
|
288
237
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
289
238
|
kind: z.ZodLiteral<"live">;
|
|
@@ -332,6 +281,7 @@ export declare const accessShareLinkReadSchema: z.ZodObject<{
|
|
|
332
281
|
excludedCountries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
333
282
|
excludedUserAgentSubstrings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
334
283
|
}, z.core.$strict>>;
|
|
284
|
+
frameOrigin: z.ZodOptional<z.ZodString>;
|
|
335
285
|
}, z.core.$strict>;
|
|
336
286
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
337
287
|
kind: z.ZodLiteral<"live">;
|
|
@@ -505,6 +455,7 @@ export declare const accessShareLinkCreateSchema: z.ZodObject<{
|
|
|
505
455
|
excludedCountries: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
506
456
|
excludedUserAgentSubstrings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
507
457
|
}, z.core.$strict>>;
|
|
458
|
+
frameOrigin: z.ZodOptional<z.ZodString>;
|
|
508
459
|
}, z.core.$strict>>;
|
|
509
460
|
target: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
510
461
|
kind: z.ZodLiteral<"live">;
|
|
@@ -536,6 +487,7 @@ export declare const accessShareLinkUpdateSchema: z.ZodObject<{
|
|
|
536
487
|
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
537
488
|
maxUses: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
538
489
|
requireVerifiedEmail: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
490
|
+
frameOrigin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
539
491
|
network: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
540
492
|
ipCidrs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
541
493
|
countries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
@@ -580,8 +532,8 @@ export declare const openHandoffSchema: z.ZodObject<{
|
|
|
580
532
|
expiresAt: z.ZodString;
|
|
581
533
|
kind: z.ZodEnum<{
|
|
582
534
|
management: "management";
|
|
583
|
-
person: "person";
|
|
584
535
|
claim_preview: "claim_preview";
|
|
536
|
+
person: "person";
|
|
585
537
|
}>;
|
|
586
538
|
}, z.core.$strip>;
|
|
587
539
|
export declare const openLinkSchema: z.ZodObject<{
|
|
@@ -598,8 +550,8 @@ export declare const privateOpenSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
598
550
|
expiresAt: z.ZodString;
|
|
599
551
|
kind: z.ZodEnum<{
|
|
600
552
|
management: "management";
|
|
601
|
-
person: "person";
|
|
602
553
|
claim_preview: "claim_preview";
|
|
554
|
+
person: "person";
|
|
603
555
|
}>;
|
|
604
556
|
}, z.core.$strip>]>;
|
|
605
557
|
export declare const openHandoffCreateSchema: z.ZodObject<{
|
|
@@ -623,44 +575,3 @@ export declare const teamSpaceAccessDefaultWriteSchema: z.ZodObject<{
|
|
|
623
575
|
public: "public";
|
|
624
576
|
}>;
|
|
625
577
|
}, z.core.$strip>;
|
|
626
|
-
export declare const ACCESS_TOKEN_KID = "spacefast-runtime-v1";
|
|
627
|
-
export declare const ACCESS_TOKEN_ALG = "EdDSA";
|
|
628
|
-
/**
|
|
629
|
-
* The claim-schema version every platform token carries in `v`. A verifier that
|
|
630
|
-
* understands v1 refuses a token minted under a later shape.
|
|
631
|
-
*/
|
|
632
|
-
export declare const PLATFORM_TOKEN_CLAIM_VERSION: 1;
|
|
633
|
-
export declare const BLOB_GATE_DOWNLOAD_TTL_SECONDS: number;
|
|
634
|
-
export declare const BLOB_GATE_SCAN_TTL_SECONDS: number;
|
|
635
|
-
export declare const BLOB_GATE_UPLOAD_TTL_SECONDS: number;
|
|
636
|
-
export declare const RUNTIME_JWKS_WELL_KNOWN_FILENAME = "spacefast-runtime-jwks.json";
|
|
637
|
-
export declare const accessTokenPublicProfileSchema: z.ZodObject<{
|
|
638
|
-
name: z.ZodOptional<z.ZodString>;
|
|
639
|
-
username: z.ZodOptional<z.ZodString>;
|
|
640
|
-
avatar_url: z.ZodOptional<z.ZodURL>;
|
|
641
|
-
}, z.core.$strict>;
|
|
642
|
-
export type AccessTokenPublicProfile = z.infer<typeof accessTokenPublicProfileSchema>;
|
|
643
|
-
export declare const accessTokenPayloadSchema: z.ZodObject<{
|
|
644
|
-
purpose: z.ZodLiteral<"handoff">;
|
|
645
|
-
v: z.ZodLiteral<1>;
|
|
646
|
-
sub: z.ZodString;
|
|
647
|
-
principal: z.ZodOptional<z.ZodString>;
|
|
648
|
-
authorities: z.ZodArray<z.ZodString>;
|
|
649
|
-
exp: z.ZodNumber;
|
|
650
|
-
nbf: z.ZodNumber;
|
|
651
|
-
iat: z.ZodNumber;
|
|
652
|
-
iss: z.ZodString;
|
|
653
|
-
aud: z.ZodString;
|
|
654
|
-
host: z.ZodString;
|
|
655
|
-
spaceId: z.ZodString;
|
|
656
|
-
sid: z.ZodString;
|
|
657
|
-
generation: z.ZodNumber;
|
|
658
|
-
emailVerified: z.ZodDefault<z.ZodBoolean>;
|
|
659
|
-
profile: z.ZodOptional<z.ZodObject<{
|
|
660
|
-
name: z.ZodOptional<z.ZodString>;
|
|
661
|
-
username: z.ZodOptional<z.ZodString>;
|
|
662
|
-
avatar_url: z.ZodOptional<z.ZodURL>;
|
|
663
|
-
}, z.core.$strict>>;
|
|
664
|
-
jti: z.ZodString;
|
|
665
|
-
}, z.core.$strip>;
|
|
666
|
-
export type AccessTokenPayload = z.infer<typeof accessTokenPayloadSchema>;
|
package/dist/contracts/access.js
CHANGED
|
@@ -1,163 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { accessRoleSchema, accessScopePathSchema } from "./access-core.js";
|
|
3
|
+
import { grantConstraintsPatchSchema, grantConstraintsSchema, grantResourceSetSchema, grantTargetSelectorSchema, } from "./grants-core.js";
|
|
4
|
+
// Spacefast's access DIRECTORY: the people, Links, access requests and team
|
|
5
|
+
// defaults behind a session. The vocabulary those records are written in — roles,
|
|
6
|
+
// capabilities, scopes, principals, the handoff token — is host-agnostic and
|
|
7
|
+
// lives in `./access-core.js`, which this module re-exports.
|
|
8
|
+
export * from "./access-core.js";
|
|
9
|
+
/** The sharing preset a Space is created with, and what the dashboard offers. */
|
|
3
10
|
export const SPACE_ACCESS_PRESETS = ["private", "team", "public"];
|
|
4
|
-
export const ACCESS_HANDOFF_MEDIA_TYPE = "application/vnd.spacefast.access-handoff+json";
|
|
5
11
|
export const spaceAccessPresetSchema = z.enum(SPACE_ACCESS_PRESETS);
|
|
6
12
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* and role⇄capability mapping: every surface derives its capabilities here.
|
|
13
|
+
* Capabilities a forwardable secret (a Link, a password) can carry. It never
|
|
14
|
+
* publishes and never manages access.
|
|
10
15
|
*/
|
|
11
|
-
export const ACCESS_ROLES = ["viewer", "commenter", "editor", "manager"];
|
|
12
|
-
export const accessRoleSchema = z.enum(ACCESS_ROLES);
|
|
13
|
-
export const ACCESS_ROLE_CAPABILITIES = {
|
|
14
|
-
viewer: ["page.view"],
|
|
15
|
-
commenter: ["page.view", "comments.read", "comments.write"],
|
|
16
|
-
editor: ["page.view", "comments.read", "comments.write", "content.publish"],
|
|
17
|
-
manager: ["page.view", "comments.read", "comments.write", "content.publish", "access.manage"],
|
|
18
|
-
};
|
|
19
|
-
export function accessRoleCapabilities(role) {
|
|
20
|
-
return [...ACCESS_ROLE_CAPABILITIES[role]];
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
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.
|
|
25
|
-
*/
|
|
26
|
-
export function accessRoleForCapabilities(capabilities) {
|
|
27
|
-
if (capabilities.includes("access.manage"))
|
|
28
|
-
return "manager";
|
|
29
|
-
if (capabilities.includes("content.publish"))
|
|
30
|
-
return "editor";
|
|
31
|
-
if (capabilities.includes("comments.write"))
|
|
32
|
-
return "commenter";
|
|
33
|
-
return "viewer";
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
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.
|
|
38
|
-
*/
|
|
39
|
-
export const VISITOR_ACCESS_ROLES = [
|
|
40
|
-
"viewer",
|
|
41
|
-
"commenter",
|
|
42
|
-
];
|
|
43
16
|
export const linkCapabilitySchema = z.enum(["page.view", "comments.read", "comments.write"]);
|
|
44
|
-
export function accessRoleRank(role) {
|
|
45
|
-
return ACCESS_ROLES.indexOf(role);
|
|
46
|
-
}
|
|
47
|
-
export function maxAccessRole(left, right) {
|
|
48
|
-
if (left === null)
|
|
49
|
-
return right;
|
|
50
|
-
if (right === null)
|
|
51
|
-
return left;
|
|
52
|
-
return accessRoleRank(left) >= accessRoleRank(right) ? left : right;
|
|
53
|
-
}
|
|
54
|
-
function hasUnsafeScopeCharacter(value) {
|
|
55
|
-
for (const character of value) {
|
|
56
|
-
const codePoint = character.codePointAt(0);
|
|
57
|
-
if (codePoint === undefined ||
|
|
58
|
-
codePoint <= 0x1f ||
|
|
59
|
-
codePoint === 0x7f ||
|
|
60
|
-
character === "\\" ||
|
|
61
|
-
character === "?" ||
|
|
62
|
-
character === "#") {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Canonicalizes the URL route identity used by People, Links, requests,
|
|
70
|
-
* comments, and runtime authorization.
|
|
71
|
-
*/
|
|
72
|
-
export function normalizeAccessScopePath(input) {
|
|
73
|
-
const value = input;
|
|
74
|
-
if (!value.startsWith("/") || value.startsWith("//") || hasUnsafeScopeCharacter(value)) {
|
|
75
|
-
throw new TypeError("scope must be a plain absolute URL path");
|
|
76
|
-
}
|
|
77
|
-
let decoded;
|
|
78
|
-
try {
|
|
79
|
-
decoded = decodeURIComponent(value);
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
throw new TypeError("scope contains malformed percent encoding");
|
|
83
|
-
}
|
|
84
|
-
if (/%2f|%5c/iu.test(value) || hasUnsafeScopeCharacter(decoded)) {
|
|
85
|
-
throw new TypeError("scope contains an ambiguous encoded separator");
|
|
86
|
-
}
|
|
87
|
-
const segments = [];
|
|
88
|
-
for (const rawSegment of decoded.split("/")) {
|
|
89
|
-
const segment = rawSegment.normalize("NFC");
|
|
90
|
-
if (segment === "" || segment === ".")
|
|
91
|
-
continue;
|
|
92
|
-
if (segment === "..") {
|
|
93
|
-
if (segments.length === 0) {
|
|
94
|
-
throw new TypeError("scope escapes the URL root");
|
|
95
|
-
}
|
|
96
|
-
segments.pop();
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
segments.push(segment);
|
|
100
|
-
}
|
|
101
|
-
if (segments.at(-1) === "index.html") {
|
|
102
|
-
segments.pop();
|
|
103
|
-
}
|
|
104
|
-
return segments.length === 0 ? "/" : `/${segments.join("/")}`;
|
|
105
|
-
}
|
|
106
|
-
export const accessScopePathSchema = z
|
|
107
|
-
.string()
|
|
108
|
-
.min(1)
|
|
109
|
-
.max(1024)
|
|
110
|
-
.check((context) => {
|
|
111
|
-
try {
|
|
112
|
-
context.value = normalizeAccessScopePath(context.value);
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
context.issues.push({
|
|
116
|
-
code: "custom",
|
|
117
|
-
input: context.value,
|
|
118
|
-
message: error instanceof Error ? error.message : "invalid access scope",
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
export function accessScopeContains(scope, path) {
|
|
123
|
-
const canonicalScope = normalizeAccessScopePath(scope);
|
|
124
|
-
const canonicalPath = normalizeAccessScopePath(path);
|
|
125
|
-
return (canonicalScope === "/" ||
|
|
126
|
-
canonicalPath === canonicalScope ||
|
|
127
|
-
canonicalPath.startsWith(`${canonicalScope}/`));
|
|
128
|
-
}
|
|
129
|
-
export const authorityReferenceSchema = z
|
|
130
|
-
.string()
|
|
131
|
-
.regex(/^(member|person|link|password|machine|claim-preview|external):[A-Za-z0-9_.-]+$/);
|
|
132
|
-
// WHO a session is, orthogonal to WHAT it may do. A session has exactly one
|
|
133
|
-
// principal and any number of authorities; neither implies the other.
|
|
134
|
-
export const accountPrincipalSchema = z.string().regex(/^account:[A-Za-z0-9_-]+$/);
|
|
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.
|
|
139
|
-
export const identifiedPrincipalSchema = z
|
|
140
|
-
.string()
|
|
141
|
-
.regex(/^(?:account|person|external):[A-Za-z0-9_.-]+$/);
|
|
142
|
-
export const accessPrincipalSchema = z.union([z.literal("anonymous"), identifiedPrincipalSchema]);
|
|
143
|
-
export function accountPrincipal(userId) {
|
|
144
|
-
return accountPrincipalSchema.parse(`account:${userId}`);
|
|
145
|
-
}
|
|
146
|
-
/** The user id behind an account principal; null for anonymous or malformed. */
|
|
147
|
-
export function accountPrincipalUserId(principal) {
|
|
148
|
-
if (!principal || !accountPrincipalSchema.safeParse(principal).success)
|
|
149
|
-
return null;
|
|
150
|
-
return principal.slice("account:".length);
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
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.
|
|
155
|
-
*/
|
|
156
|
-
export function principalForAuthority(reference) {
|
|
157
|
-
return reference.startsWith("person:") || reference.startsWith("external:")
|
|
158
|
-
? identifiedPrincipalSchema.parse(reference)
|
|
159
|
-
: undefined;
|
|
160
|
-
}
|
|
161
17
|
export const personGrantSchema = z.object({
|
|
162
18
|
id: z.string().min(1),
|
|
163
19
|
scope: accessScopePathSchema,
|
|
@@ -335,59 +191,3 @@ export const teamSpaceAccessDefaultSchema = z.object({
|
|
|
335
191
|
export const teamSpaceAccessDefaultWriteSchema = z.object({
|
|
336
192
|
newSpaceGrantPreset: spaceAccessPresetSchema,
|
|
337
193
|
});
|
|
338
|
-
export const ACCESS_TOKEN_KID = "spacefast-runtime-v1";
|
|
339
|
-
export const ACCESS_TOKEN_ALG = "EdDSA";
|
|
340
|
-
/**
|
|
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.
|
|
343
|
-
*/
|
|
344
|
-
export const PLATFORM_TOKEN_CLAIM_VERSION = 1;
|
|
345
|
-
export const BLOB_GATE_DOWNLOAD_TTL_SECONDS = 10 * 60;
|
|
346
|
-
export const BLOB_GATE_SCAN_TTL_SECONDS = 60 * 60;
|
|
347
|
-
export const BLOB_GATE_UPLOAD_TTL_SECONDS = 60 * 60;
|
|
348
|
-
export const RUNTIME_JWKS_WELL_KNOWN_FILENAME = "spacefast-runtime-jwks.json";
|
|
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.
|
|
353
|
-
export const accessTokenPublicProfileSchema = z
|
|
354
|
-
.object({
|
|
355
|
-
name: z.string().min(1).max(120).optional(),
|
|
356
|
-
username: z.string().min(1).max(160).optional(),
|
|
357
|
-
avatar_url: z
|
|
358
|
-
.url({ protocol: /^https?$/ })
|
|
359
|
-
.max(2_048)
|
|
360
|
-
.optional(),
|
|
361
|
-
})
|
|
362
|
-
.strict();
|
|
363
|
-
export const accessTokenPayloadSchema = z.object({
|
|
364
|
-
// Typed purpose from the one platform signer. The runtime REQUIRES exactly
|
|
365
|
-
// this value before consuming the jti, so no other purpose signed by the same
|
|
366
|
-
// key can redeem into a visitor session.
|
|
367
|
-
purpose: z.literal("handoff"),
|
|
368
|
-
v: z.literal(PLATFORM_TOKEN_CLAIM_VERSION),
|
|
369
|
-
sub: authorityReferenceSchema,
|
|
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.
|
|
373
|
-
principal: identifiedPrincipalSchema.optional(),
|
|
374
|
-
authorities: z.array(authorityReferenceSchema).min(1).max(16),
|
|
375
|
-
exp: z.number().int().nonnegative(),
|
|
376
|
-
nbf: z.number().int().nonnegative(),
|
|
377
|
-
iat: z.number().int().nonnegative(),
|
|
378
|
-
iss: z.string().min(1),
|
|
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.
|
|
381
|
-
aud: z.string().min(1),
|
|
382
|
-
// The lowercased serving host the handoff was minted for. The runtime rejects
|
|
383
|
-
// a token presented on any other host.
|
|
384
|
-
host: z.string().min(1),
|
|
385
|
-
spaceId: z.string().min(1),
|
|
386
|
-
// Shared opaque identity for the runtime session and its access-origin
|
|
387
|
-
// collaboration session. It is random per handoff and never authorizes by itself.
|
|
388
|
-
sid: z.string().regex(/^[a-f0-9]{64}$/),
|
|
389
|
-
generation: z.number().int().nonnegative(),
|
|
390
|
-
emailVerified: z.boolean().default(false),
|
|
391
|
-
profile: accessTokenPublicProfileSchema.optional(),
|
|
392
|
-
jti: z.string().min(1),
|
|
393
|
-
});
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const ACTIVITY_EVENT_CODES: readonly ["space.created", "space.claimed", "
|
|
2
|
+
export declare const ACTIVITY_EVENT_CODES: readonly ["space.created", "space.claimed", "space.transferred", "space.expired", "space.disabled", "space.enabled", "space.deleted", "space.config_updated", "space.slug_updated", "space.wp_cli_run", "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", "channel.promotion_changed", "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", "visitor_connection.created", "visitor_connection.revoked", "connector_binding.created", "connector_binding.removed", "connection.serving_granted", "connection.serving_revoked", "connector_policy.created", "connector_policy.updated", "connector_policy.deleted", "connector_run.parked", "connector_run.decided", "connector_run.expired", "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;
|
|
6
6
|
export declare function matchesActivityEventFilters(filters: readonly string[], code: string): boolean;
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
export declare const ACTIVITY_ACTOR_TYPES: readonly ["visitor", "user", "api_key", "partner_token", "oauth_client", "anonymous_claim", "system"];
|
|
8
|
+
export declare const activityActorTypeSchema: z.ZodEnum<{
|
|
9
|
+
system: "system";
|
|
10
|
+
user: "user";
|
|
11
|
+
visitor: "visitor";
|
|
12
|
+
api_key: "api_key";
|
|
13
|
+
partner_token: "partner_token";
|
|
14
|
+
oauth_client: "oauth_client";
|
|
15
|
+
anonymous_claim: "anonymous_claim";
|
|
16
|
+
}>;
|
|
17
|
+
export declare const activityActorSchema: z.ZodObject<{
|
|
18
|
+
type: z.ZodEnum<{
|
|
19
|
+
system: "system";
|
|
20
|
+
user: "user";
|
|
21
|
+
visitor: "visitor";
|
|
22
|
+
api_key: "api_key";
|
|
23
|
+
partner_token: "partner_token";
|
|
24
|
+
oauth_client: "oauth_client";
|
|
25
|
+
anonymous_claim: "anonymous_claim";
|
|
26
|
+
}>;
|
|
24
27
|
id: z.ZodString;
|
|
25
|
-
}, z.core.$strip
|
|
28
|
+
}, z.core.$strip>;
|
|
26
29
|
export declare const activityPrincipalSchema: z.ZodObject<{
|
|
27
30
|
tenantId: z.ZodString;
|
|
28
31
|
principalType: z.ZodEnum<{
|
|
@@ -48,25 +51,18 @@ export declare const activityEventSchema: z.ZodObject<{
|
|
|
48
51
|
principalId: z.ZodString;
|
|
49
52
|
}, z.core.$strip>>;
|
|
50
53
|
spaceId: z.ZodNullable<z.ZodString>;
|
|
51
|
-
actor: z.
|
|
52
|
-
type: z.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
type: z.ZodLiteral<"oauth_client">;
|
|
62
|
-
id: z.ZodString;
|
|
63
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
-
type: z.ZodLiteral<"anonymous_claim">;
|
|
65
|
-
id: z.ZodString;
|
|
66
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
67
|
-
type: z.ZodLiteral<"system">;
|
|
54
|
+
actor: z.ZodObject<{
|
|
55
|
+
type: z.ZodEnum<{
|
|
56
|
+
system: "system";
|
|
57
|
+
user: "user";
|
|
58
|
+
visitor: "visitor";
|
|
59
|
+
api_key: "api_key";
|
|
60
|
+
partner_token: "partner_token";
|
|
61
|
+
oauth_client: "oauth_client";
|
|
62
|
+
anonymous_claim: "anonymous_claim";
|
|
63
|
+
}>;
|
|
68
64
|
id: z.ZodString;
|
|
69
|
-
}, z.core.$strip
|
|
65
|
+
}, z.core.$strip>;
|
|
70
66
|
code: z.ZodString;
|
|
71
67
|
message: z.ZodString;
|
|
72
68
|
details: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -81,6 +77,16 @@ export declare const activityQuerySchema: z.ZodObject<{
|
|
|
81
77
|
}>>;
|
|
82
78
|
principalId: z.ZodOptional<z.ZodString>;
|
|
83
79
|
spaceId: z.ZodOptional<z.ZodString>;
|
|
80
|
+
actorType: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
system: "system";
|
|
82
|
+
user: "user";
|
|
83
|
+
visitor: "visitor";
|
|
84
|
+
api_key: "api_key";
|
|
85
|
+
partner_token: "partner_token";
|
|
86
|
+
oauth_client: "oauth_client";
|
|
87
|
+
anonymous_claim: "anonymous_claim";
|
|
88
|
+
}>>;
|
|
89
|
+
actorId: z.ZodOptional<z.ZodString>;
|
|
84
90
|
code: z.ZodOptional<z.ZodString>;
|
|
85
91
|
since: z.ZodOptional<z.ZodString>;
|
|
86
92
|
until: z.ZodOptional<z.ZodString>;
|
|
@@ -103,25 +109,18 @@ export declare const activityListResponseSchema: z.ZodObject<{
|
|
|
103
109
|
principalId: z.ZodString;
|
|
104
110
|
}, z.core.$strip>>;
|
|
105
111
|
spaceId: z.ZodNullable<z.ZodString>;
|
|
106
|
-
actor: z.
|
|
107
|
-
type: z.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
type: z.ZodLiteral<"oauth_client">;
|
|
117
|
-
id: z.ZodString;
|
|
118
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
119
|
-
type: z.ZodLiteral<"anonymous_claim">;
|
|
120
|
-
id: z.ZodString;
|
|
121
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
122
|
-
type: z.ZodLiteral<"system">;
|
|
112
|
+
actor: z.ZodObject<{
|
|
113
|
+
type: z.ZodEnum<{
|
|
114
|
+
system: "system";
|
|
115
|
+
user: "user";
|
|
116
|
+
visitor: "visitor";
|
|
117
|
+
api_key: "api_key";
|
|
118
|
+
partner_token: "partner_token";
|
|
119
|
+
oauth_client: "oauth_client";
|
|
120
|
+
anonymous_claim: "anonymous_claim";
|
|
121
|
+
}>;
|
|
123
122
|
id: z.ZodString;
|
|
124
|
-
}, z.core.$strip
|
|
123
|
+
}, z.core.$strip>;
|
|
125
124
|
code: z.ZodString;
|
|
126
125
|
message: z.ZodString;
|
|
127
126
|
details: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|