@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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.9.0",
|
|
3
|
+
"archiveUrl": "https://github.com/WordPress/php-toolkit/releases/download/v0.9.0/data-liberation.zip",
|
|
4
|
+
"archiveBytes": 883739,
|
|
5
|
+
"archiveSha256": "sha256:ba6e691936699ae7f5ceaa0129ef7e7a10f1db77c559a32f824e8307747b7b54",
|
|
6
|
+
"archivePath": "data-liberation/php-toolkit.phar",
|
|
7
|
+
"embeddedPath": "engine/vendor/php-toolkit.phar",
|
|
8
|
+
"sha256": "sha256:bd452b61fd6ee9f4838ff416a3d225e6c82a742ffaf325a57ad327828eda446a"
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const spaceWorkModeSchema: z.ZodEnum<{
|
|
3
|
+
code: "code";
|
|
4
|
+
vibe: "vibe";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const spaceWorkModePreferenceSchema: z.ZodObject<{
|
|
7
|
+
space: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
mode: z.ZodNullable<z.ZodEnum<{
|
|
12
|
+
code: "code";
|
|
13
|
+
vibe: "vibe";
|
|
14
|
+
}>>;
|
|
15
|
+
revision: z.ZodNumber;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const spaceWorkModeUpdateSchema: z.ZodObject<{
|
|
18
|
+
mode: z.ZodEnum<{
|
|
19
|
+
code: "code";
|
|
20
|
+
vibe: "vibe";
|
|
21
|
+
}>;
|
|
22
|
+
expectedRevision: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type SpaceWorkModePreference = z.infer<typeof spaceWorkModePreferenceSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const spaceWorkModeSchema = z
|
|
3
|
+
.enum(["vibe", "code"])
|
|
4
|
+
.describe("The mode selected by the user. Vibe it hides routine code review.");
|
|
5
|
+
export const spaceWorkModePreferenceSchema = z.object({
|
|
6
|
+
space: z.object({ id: z.string(), title: z.string() }),
|
|
7
|
+
mode: spaceWorkModeSchema.nullable(),
|
|
8
|
+
revision: z.number().int().nonnegative(),
|
|
9
|
+
});
|
|
10
|
+
export const spaceWorkModeUpdateSchema = z.object({
|
|
11
|
+
mode: spaceWorkModeSchema,
|
|
12
|
+
expectedRevision: z
|
|
13
|
+
.number()
|
|
14
|
+
.int()
|
|
15
|
+
.nonnegative()
|
|
16
|
+
.describe("Revision from the current mode card. Use zero when no choice is saved."),
|
|
17
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Running `wp` against a Space's own WordPress.
|
|
4
|
+
*
|
|
5
|
+
* This is the escape hatch the bespoke surfaces (`sf zero`, `sf db`, `sf
|
|
6
|
+
* content`) are carved out of: everything WP-CLI can do that Spacefast has not
|
|
7
|
+
* given a noun to. It exists so a Space is never a dead end.
|
|
8
|
+
*
|
|
9
|
+
* The relay is deliberately server-side. wp.cloud's API is reachable only from
|
|
10
|
+
* allowlisted control-plane egress, so the provider credential cannot be handed
|
|
11
|
+
* to a caller — the control plane submits the command on the caller's behalf and
|
|
12
|
+
* the credential never leaves the server.
|
|
13
|
+
*/
|
|
14
|
+
/** The one WP-CLI context knob wp.cloud exposes. */
|
|
15
|
+
export declare const wpCliModeSchema: z.ZodEnum<{
|
|
16
|
+
limited: "limited";
|
|
17
|
+
full: "full";
|
|
18
|
+
}>;
|
|
19
|
+
export type WpCliMode = z.infer<typeof wpCliModeSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* wp.cloud caps a task's WP-CLI run at 5 minutes; there is no point waiting
|
|
22
|
+
* past that, and a caller that waits longer is waiting on nothing.
|
|
23
|
+
*/
|
|
24
|
+
export declare const WP_CLI_MAX_RUN_SECONDS = 300;
|
|
25
|
+
/** Bounds on the argument vector, so one call cannot post an unbounded form body. */
|
|
26
|
+
export declare const WP_CLI_MAX_ARGS = 64;
|
|
27
|
+
export declare const WP_CLI_MAX_ARG_LENGTH = 4096;
|
|
28
|
+
export declare const wpCliRunRequestSchema: z.ZodObject<{
|
|
29
|
+
args: z.ZodArray<z.ZodString>;
|
|
30
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
31
|
+
limited: "limited";
|
|
32
|
+
full: "full";
|
|
33
|
+
}>>;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export type WpCliRunRequest = z.infer<typeof wpCliRunRequestSchema>;
|
|
36
|
+
export declare const wpCliRunResultSchema: z.ZodObject<{
|
|
37
|
+
taskId: z.ZodNumber;
|
|
38
|
+
status: z.ZodEnum<{
|
|
39
|
+
failed: "failed";
|
|
40
|
+
succeeded: "succeeded";
|
|
41
|
+
}>;
|
|
42
|
+
args: z.ZodArray<z.ZodString>;
|
|
43
|
+
mode: z.ZodEnum<{
|
|
44
|
+
limited: "limited";
|
|
45
|
+
full: "full";
|
|
46
|
+
}>;
|
|
47
|
+
tookMs: z.ZodNullable<z.ZodNumber>;
|
|
48
|
+
output: z.ZodNullable<z.ZodString>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
export type WpCliRunResult = z.infer<typeof wpCliRunResultSchema>;
|
|
51
|
+
export declare const wpCliRunResponseSchema: z.ZodObject<{
|
|
52
|
+
data: z.ZodObject<{
|
|
53
|
+
taskId: z.ZodNumber;
|
|
54
|
+
status: z.ZodEnum<{
|
|
55
|
+
failed: "failed";
|
|
56
|
+
succeeded: "succeeded";
|
|
57
|
+
}>;
|
|
58
|
+
args: z.ZodArray<z.ZodString>;
|
|
59
|
+
mode: z.ZodEnum<{
|
|
60
|
+
limited: "limited";
|
|
61
|
+
full: "full";
|
|
62
|
+
}>;
|
|
63
|
+
tookMs: z.ZodNullable<z.ZodNumber>;
|
|
64
|
+
output: z.ZodNullable<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { dataEnvelope } from "./common.js";
|
|
3
|
+
/**
|
|
4
|
+
* Running `wp` against a Space's own WordPress.
|
|
5
|
+
*
|
|
6
|
+
* This is the escape hatch the bespoke surfaces (`sf zero`, `sf db`, `sf
|
|
7
|
+
* content`) are carved out of: everything WP-CLI can do that Spacefast has not
|
|
8
|
+
* given a noun to. It exists so a Space is never a dead end.
|
|
9
|
+
*
|
|
10
|
+
* The relay is deliberately server-side. wp.cloud's API is reachable only from
|
|
11
|
+
* allowlisted control-plane egress, so the provider credential cannot be handed
|
|
12
|
+
* to a caller — the control plane submits the command on the caller's behalf and
|
|
13
|
+
* the credential never leaves the server.
|
|
14
|
+
*/
|
|
15
|
+
/** The one WP-CLI context knob wp.cloud exposes. */
|
|
16
|
+
export const wpCliModeSchema = z.enum(["full", "limited"]);
|
|
17
|
+
/**
|
|
18
|
+
* wp.cloud caps a task's WP-CLI run at 5 minutes; there is no point waiting
|
|
19
|
+
* past that, and a caller that waits longer is waiting on nothing.
|
|
20
|
+
*/
|
|
21
|
+
export const WP_CLI_MAX_RUN_SECONDS = 300;
|
|
22
|
+
/** Bounds on the argument vector, so one call cannot post an unbounded form body. */
|
|
23
|
+
export const WP_CLI_MAX_ARGS = 64;
|
|
24
|
+
export const WP_CLI_MAX_ARG_LENGTH = 4096;
|
|
25
|
+
export const wpCliRunRequestSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
/**
|
|
28
|
+
* The `wp` argument vector, already split — `["option", "get", "blogname"]`,
|
|
29
|
+
* never `"option get blogname"`. A vector rather than a string because the
|
|
30
|
+
* provider takes a vector: there is no shell in the path, so nothing
|
|
31
|
+
* re-splits, re-globs, or re-quotes what the caller sent.
|
|
32
|
+
*/
|
|
33
|
+
args: z.array(z.string().min(1).max(WP_CLI_MAX_ARG_LENGTH)).min(1).max(WP_CLI_MAX_ARGS),
|
|
34
|
+
/**
|
|
35
|
+
* `full` loads the site's own themes and plugins, which is what most
|
|
36
|
+
* commands need and what a caller means by "run this on my site". `limited`
|
|
37
|
+
* skips them, so a core command still answers on a site whose own code is
|
|
38
|
+
* broken — the setting you reach for when `full` fails to bootstrap.
|
|
39
|
+
*/
|
|
40
|
+
mode: wpCliModeSchema.default("full"),
|
|
41
|
+
})
|
|
42
|
+
.strict();
|
|
43
|
+
export const wpCliRunResultSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
/** wp.cloud's task id, for correlating with provider-side support requests. */
|
|
46
|
+
taskId: z.number().int(),
|
|
47
|
+
/** Whether WP-CLI exited zero. wp.cloud reports the class, not the code. */
|
|
48
|
+
status: z.enum(["succeeded", "failed"]),
|
|
49
|
+
/** The vector that ran, echoed so a stored receipt is self-describing. */
|
|
50
|
+
args: z.array(z.string()),
|
|
51
|
+
mode: wpCliModeSchema,
|
|
52
|
+
/** Provider-measured run time, or null when wp.cloud did not report one. */
|
|
53
|
+
tookMs: z.number().int().nullable(),
|
|
54
|
+
/**
|
|
55
|
+
* WP-CLI's own output, when the provider returns any.
|
|
56
|
+
*
|
|
57
|
+
* wp.cloud's task API documents no stdout/stderr channel: a completed task
|
|
58
|
+
* reports how many sites exited zero and how long it took, and nothing
|
|
59
|
+
* about what the command printed. This field is therefore `null` on every
|
|
60
|
+
* response the documented API can produce, and is present so that the day
|
|
61
|
+
* the provider does carry output, callers already have the field rather
|
|
62
|
+
* than a breaking change. It is never a silent empty string standing in for
|
|
63
|
+
* output we did not get — `null` means "the provider returned none".
|
|
64
|
+
*/
|
|
65
|
+
output: z.string().nullable(),
|
|
66
|
+
})
|
|
67
|
+
.strict();
|
|
68
|
+
export const wpCliRunResponseSchema = dataEnvelope(wpCliRunResultSchema);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The merge that turns two Ability origins into one catalog.
|
|
3
|
+
*
|
|
4
|
+
* A Space publishes Abilities from two places and they arrive in different
|
|
5
|
+
* shapes: the runtime engine registers the platform sets in PHP (mirrored into
|
|
6
|
+
* `ZERO_PLATFORM_ABILITIES`), and a published capsule's content model carries
|
|
7
|
+
* its own compiled at publish. The control plane serves the merge over
|
|
8
|
+
* `GET /v1/spaces/:id/zero/abilities`, and `sf zero types` generates types from
|
|
9
|
+
* it. Both want the same rows in the same order, so the merge lives here rather
|
|
10
|
+
* than once in each — two merges would eventually disagree about which
|
|
11
|
+
* capability vocabulary a row is in, which is exactly the thing that must not
|
|
12
|
+
* drift.
|
|
13
|
+
*/
|
|
14
|
+
import type { ContentModelReleaseV1 } from "./content-model.js";
|
|
15
|
+
import type { SpaceZeroAbility } from "./zero-spacefast.js";
|
|
16
|
+
/** The platform sets, which a Space publishes because it runs the engine. */
|
|
17
|
+
export declare function zeroPlatformAbilityRows(): SpaceZeroAbility[];
|
|
18
|
+
/**
|
|
19
|
+
* Every Ability a Space with this content model publishes.
|
|
20
|
+
*
|
|
21
|
+
* Platform sets lead and are unconditional; the content set follows and is null
|
|
22
|
+
* when no capsule declared one. Content schemas are resolved against the
|
|
23
|
+
* release's own schema table so every row describes itself the same way — a row
|
|
24
|
+
* that pointed into a document the reader does not hold would describe nothing.
|
|
25
|
+
* A pointer with nothing behind it is a malformed release rather than an
|
|
26
|
+
* Ability without a schema, but a catalog is a read: it says what it can see
|
|
27
|
+
* instead of refusing the whole list over one bad row.
|
|
28
|
+
*/
|
|
29
|
+
export declare function zeroAbilityCatalog(contentModel: ContentModelReleaseV1 | null): SpaceZeroAbility[];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The merge that turns two Ability origins into one catalog.
|
|
3
|
+
*
|
|
4
|
+
* A Space publishes Abilities from two places and they arrive in different
|
|
5
|
+
* shapes: the runtime engine registers the platform sets in PHP (mirrored into
|
|
6
|
+
* `ZERO_PLATFORM_ABILITIES`), and a published capsule's content model carries
|
|
7
|
+
* its own compiled at publish. The control plane serves the merge over
|
|
8
|
+
* `GET /v1/spaces/:id/zero/abilities`, and `sf zero types` generates types from
|
|
9
|
+
* it. Both want the same rows in the same order, so the merge lives here rather
|
|
10
|
+
* than once in each — two merges would eventually disagree about which
|
|
11
|
+
* capability vocabulary a row is in, which is exactly the thing that must not
|
|
12
|
+
* drift.
|
|
13
|
+
*/
|
|
14
|
+
import { contentAbilityWordPressName } from "./content-model.js";
|
|
15
|
+
import { ZERO_PLATFORM_ABILITIES } from "./zero-platform-abilities.generated.js";
|
|
16
|
+
/** The platform sets, which a Space publishes because it runs the engine. */
|
|
17
|
+
export function zeroPlatformAbilityRows() {
|
|
18
|
+
return ZERO_PLATFORM_ABILITIES.map((ability) => ({
|
|
19
|
+
name: ability.name,
|
|
20
|
+
id: ability.id,
|
|
21
|
+
category: ability.category,
|
|
22
|
+
mode: ability.mode,
|
|
23
|
+
requires: { kind: "wordpress", capability: ability.capability },
|
|
24
|
+
inputSchema: ability.inputSchema,
|
|
25
|
+
outputSchema: ability.outputSchema,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Every Ability a Space with this content model publishes.
|
|
30
|
+
*
|
|
31
|
+
* Platform sets lead and are unconditional; the content set follows and is null
|
|
32
|
+
* when no capsule declared one. Content schemas are resolved against the
|
|
33
|
+
* release's own schema table so every row describes itself the same way — a row
|
|
34
|
+
* that pointed into a document the reader does not hold would describe nothing.
|
|
35
|
+
* A pointer with nothing behind it is a malformed release rather than an
|
|
36
|
+
* Ability without a schema, but a catalog is a read: it says what it can see
|
|
37
|
+
* instead of refusing the whole list over one bad row.
|
|
38
|
+
*/
|
|
39
|
+
export function zeroAbilityCatalog(contentModel) {
|
|
40
|
+
const platform = zeroPlatformAbilityRows();
|
|
41
|
+
if (contentModel === null) {
|
|
42
|
+
return platform;
|
|
43
|
+
}
|
|
44
|
+
const schemas = new Map(contentModel.schemas.map((schema) => [schema.id, schema.schema]));
|
|
45
|
+
const content = contentModel.abilities.map((ability) => ({
|
|
46
|
+
name: contentAbilityWordPressName(ability.id),
|
|
47
|
+
id: ability.id,
|
|
48
|
+
category: "zero-content",
|
|
49
|
+
mode: ability.mode,
|
|
50
|
+
requires: { kind: "grant", capabilities: [...ability.permits] },
|
|
51
|
+
inputSchema: schemas.get(ability.input.id) ?? null,
|
|
52
|
+
outputSchema: schemas.get(ability.output.id) ?? null,
|
|
53
|
+
}));
|
|
54
|
+
return [...platform, ...content];
|
|
55
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ContentModelJsonValue } from "./content-model.js";
|
|
2
|
+
/**
|
|
3
|
+
* One Ability the runtime engine registers for every Space, independent of any
|
|
4
|
+
* content model.
|
|
5
|
+
*
|
|
6
|
+
* These are the platform sets: a Space publishes them because it runs the
|
|
7
|
+
* engine, not because it published a capsule that declared them. A rollback
|
|
8
|
+
* does not move them; a new engine release does.
|
|
9
|
+
*/
|
|
10
|
+
export type ZeroPlatformAbility = Readonly<{
|
|
11
|
+
/** The name WordPress publishes the Ability under. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** The Ability's product id, before the Abilities API's flattening. */
|
|
14
|
+
id: string;
|
|
15
|
+
category: string;
|
|
16
|
+
mode: "read" | "write";
|
|
17
|
+
/** The WordPress capability the Ability's permission callback asks for. */
|
|
18
|
+
capability: string;
|
|
19
|
+
label: string;
|
|
20
|
+
description: string;
|
|
21
|
+
annotations: Readonly<{
|
|
22
|
+
readonly: boolean;
|
|
23
|
+
destructive: boolean;
|
|
24
|
+
idempotent: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
inputSchema: ContentModelJsonValue;
|
|
27
|
+
outputSchema: ContentModelJsonValue;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const ZERO_PLATFORM_ABILITIES: readonly ZeroPlatformAbility[];
|
|
30
|
+
/** The categories the platform sets register under. */
|
|
31
|
+
export declare const ZERO_PLATFORM_ABILITY_CATEGORIES: readonly string[];
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
// GENERATED FILE — DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Source of truth: runtime/engine/wordpress/content-users.php and
|
|
4
|
+
// runtime/engine/wordpress/content-storage.php, read through
|
|
5
|
+
// scripts/emit-zero-abilities.php — which loads those files and calls the same
|
|
6
|
+
// builders `*_register_abilities()` iterates, so every schema here is the object
|
|
7
|
+
// the runtime registers rather than a copy of it. Each `capability` is observed
|
|
8
|
+
// by running that Ability's own permission_callback.
|
|
9
|
+
//
|
|
10
|
+
// Regenerate: bun scripts/codegen-zero-abilities.ts --write
|
|
11
|
+
export const ZERO_PLATFORM_ABILITIES = [
|
|
12
|
+
{
|
|
13
|
+
name: "zero/storage-delete",
|
|
14
|
+
category: "zero-storage",
|
|
15
|
+
mode: "write",
|
|
16
|
+
capability: "delete_post",
|
|
17
|
+
label: "Delete a Space file",
|
|
18
|
+
description: "Trashes one file in this Space. The file leaves every listing and stays recoverable; nothing here removes it permanently.",
|
|
19
|
+
annotations: { readonly: false, destructive: true, idempotent: true },
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: { id: { type: "integer", minimum: 1 } },
|
|
23
|
+
required: ["id"],
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
},
|
|
26
|
+
outputSchema: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: { id: { type: "integer" }, trashed: { type: "boolean" } },
|
|
29
|
+
required: ["id", "trashed"],
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
},
|
|
32
|
+
id: "storage.delete",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "zero/storage-get",
|
|
36
|
+
category: "zero-storage",
|
|
37
|
+
mode: "read",
|
|
38
|
+
capability: "upload_files",
|
|
39
|
+
label: "Get a Space file",
|
|
40
|
+
description: "Reads one file stored in this Space.",
|
|
41
|
+
annotations: { readonly: true, destructive: false, idempotent: true },
|
|
42
|
+
inputSchema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: { id: { type: "integer", minimum: 1 } },
|
|
45
|
+
required: ["id"],
|
|
46
|
+
additionalProperties: false,
|
|
47
|
+
},
|
|
48
|
+
outputSchema: {
|
|
49
|
+
type: "object",
|
|
50
|
+
properties: {
|
|
51
|
+
id: { type: "integer" },
|
|
52
|
+
title: { type: "string" },
|
|
53
|
+
filename: { type: "string" },
|
|
54
|
+
url: { type: "string" },
|
|
55
|
+
mimeType: { type: "string" },
|
|
56
|
+
alt: { type: "string" },
|
|
57
|
+
folder: { type: "string" },
|
|
58
|
+
width: { type: ["integer", "null"] },
|
|
59
|
+
height: { type: ["integer", "null"] },
|
|
60
|
+
filesize: { type: ["integer", "null"] },
|
|
61
|
+
uploadedAt: { type: "string" },
|
|
62
|
+
},
|
|
63
|
+
required: ["id", "title", "filename", "url", "mimeType", "alt", "folder", "uploadedAt"],
|
|
64
|
+
additionalProperties: false,
|
|
65
|
+
},
|
|
66
|
+
id: "storage.get",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "zero/storage-list",
|
|
70
|
+
category: "zero-storage",
|
|
71
|
+
mode: "read",
|
|
72
|
+
capability: "upload_files",
|
|
73
|
+
label: "List Space files",
|
|
74
|
+
description: "Lists the files stored in this Space, optionally within one folder.",
|
|
75
|
+
annotations: { readonly: true, destructive: false, idempotent: true },
|
|
76
|
+
inputSchema: {
|
|
77
|
+
default: [],
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {
|
|
80
|
+
page: { type: "integer", minimum: 1 },
|
|
81
|
+
perPage: { type: "integer", minimum: 1, maximum: 100 },
|
|
82
|
+
folder: {
|
|
83
|
+
type: "string",
|
|
84
|
+
description: "A slash-separated folder path, or empty for the Space root.",
|
|
85
|
+
},
|
|
86
|
+
recursive: { type: "boolean" },
|
|
87
|
+
search: { type: "string" },
|
|
88
|
+
mimeType: { type: "string" },
|
|
89
|
+
},
|
|
90
|
+
required: [],
|
|
91
|
+
additionalProperties: false,
|
|
92
|
+
},
|
|
93
|
+
outputSchema: {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
page: { type: "integer" },
|
|
97
|
+
perPage: { type: "integer" },
|
|
98
|
+
files: {
|
|
99
|
+
type: "array",
|
|
100
|
+
items: {
|
|
101
|
+
type: "object",
|
|
102
|
+
properties: {
|
|
103
|
+
id: { type: "integer" },
|
|
104
|
+
title: { type: "string" },
|
|
105
|
+
filename: { type: "string" },
|
|
106
|
+
url: { type: "string" },
|
|
107
|
+
mimeType: { type: "string" },
|
|
108
|
+
alt: { type: "string" },
|
|
109
|
+
folder: { type: "string" },
|
|
110
|
+
width: { type: ["integer", "null"] },
|
|
111
|
+
height: { type: ["integer", "null"] },
|
|
112
|
+
filesize: { type: ["integer", "null"] },
|
|
113
|
+
uploadedAt: { type: "string" },
|
|
114
|
+
},
|
|
115
|
+
required: ["id", "title", "filename", "url", "mimeType", "alt", "folder", "uploadedAt"],
|
|
116
|
+
additionalProperties: false,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
required: ["page", "perPage", "files"],
|
|
121
|
+
additionalProperties: false,
|
|
122
|
+
},
|
|
123
|
+
id: "storage.list",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "zero/storage-move",
|
|
127
|
+
category: "zero-storage",
|
|
128
|
+
mode: "write",
|
|
129
|
+
capability: "edit_post",
|
|
130
|
+
label: "Move a Space file",
|
|
131
|
+
description: "Moves one file into a folder, creating the folder path if needed.",
|
|
132
|
+
annotations: { readonly: false, destructive: true, idempotent: true },
|
|
133
|
+
inputSchema: {
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: {
|
|
136
|
+
id: { type: "integer", minimum: 1 },
|
|
137
|
+
folder: {
|
|
138
|
+
type: "string",
|
|
139
|
+
description: "A slash-separated folder path, or empty for the Space root.",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
required: ["id", "folder"],
|
|
143
|
+
additionalProperties: false,
|
|
144
|
+
},
|
|
145
|
+
outputSchema: {
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
id: { type: "integer" },
|
|
149
|
+
title: { type: "string" },
|
|
150
|
+
filename: { type: "string" },
|
|
151
|
+
url: { type: "string" },
|
|
152
|
+
mimeType: { type: "string" },
|
|
153
|
+
alt: { type: "string" },
|
|
154
|
+
folder: { type: "string" },
|
|
155
|
+
width: { type: ["integer", "null"] },
|
|
156
|
+
height: { type: ["integer", "null"] },
|
|
157
|
+
filesize: { type: ["integer", "null"] },
|
|
158
|
+
uploadedAt: { type: "string" },
|
|
159
|
+
},
|
|
160
|
+
required: ["id", "title", "filename", "url", "mimeType", "alt", "folder", "uploadedAt"],
|
|
161
|
+
additionalProperties: false,
|
|
162
|
+
},
|
|
163
|
+
id: "storage.move",
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "zero/storage-upload",
|
|
167
|
+
category: "zero-storage",
|
|
168
|
+
mode: "write",
|
|
169
|
+
capability: "upload_files",
|
|
170
|
+
label: "Upload a Space file",
|
|
171
|
+
description: "Stores a file in this Space from base64 content, optionally in a folder. WordPress decides which file types are accepted.",
|
|
172
|
+
annotations: { readonly: false, destructive: false, idempotent: false },
|
|
173
|
+
inputSchema: {
|
|
174
|
+
type: "object",
|
|
175
|
+
properties: {
|
|
176
|
+
filename: { type: "string", minLength: 1, maxLength: 255 },
|
|
177
|
+
contentBase64: { type: "string", minLength: 1 },
|
|
178
|
+
title: { type: "string", maxLength: 250 },
|
|
179
|
+
alt: { type: "string", maxLength: 1000 },
|
|
180
|
+
folder: {
|
|
181
|
+
type: "string",
|
|
182
|
+
description: "A slash-separated folder path, or empty for the Space root.",
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
required: ["filename", "contentBase64"],
|
|
186
|
+
additionalProperties: false,
|
|
187
|
+
},
|
|
188
|
+
outputSchema: {
|
|
189
|
+
type: "object",
|
|
190
|
+
properties: {
|
|
191
|
+
id: { type: "integer" },
|
|
192
|
+
title: { type: "string" },
|
|
193
|
+
filename: { type: "string" },
|
|
194
|
+
url: { type: "string" },
|
|
195
|
+
mimeType: { type: "string" },
|
|
196
|
+
alt: { type: "string" },
|
|
197
|
+
folder: { type: "string" },
|
|
198
|
+
width: { type: ["integer", "null"] },
|
|
199
|
+
height: { type: ["integer", "null"] },
|
|
200
|
+
filesize: { type: ["integer", "null"] },
|
|
201
|
+
uploadedAt: { type: "string" },
|
|
202
|
+
},
|
|
203
|
+
required: ["id", "title", "filename", "url", "mimeType", "alt", "folder", "uploadedAt"],
|
|
204
|
+
additionalProperties: false,
|
|
205
|
+
},
|
|
206
|
+
id: "storage.upload",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "zero/wp-users-create",
|
|
210
|
+
category: "zero-wp-users",
|
|
211
|
+
mode: "write",
|
|
212
|
+
capability: "create_users",
|
|
213
|
+
label: "Create a Space user",
|
|
214
|
+
description: "Establishes the WordPress user for an (issuer, subject) authority and joins it to this Space. Roles are not set here: a caller's WordPress role is projected from their Grants. Only this Space is touched: if the authority already has a user that belongs solely to other Spaces on the site, the call is refused rather than reaching across to it.",
|
|
215
|
+
annotations: { readonly: false, destructive: false, idempotent: true },
|
|
216
|
+
inputSchema: {
|
|
217
|
+
type: "object",
|
|
218
|
+
properties: {
|
|
219
|
+
issuer: { type: "string", minLength: 1, maxLength: 512 },
|
|
220
|
+
subject: { type: "string", minLength: 1, maxLength: 512 },
|
|
221
|
+
displayName: { type: "string", maxLength: 250 },
|
|
222
|
+
},
|
|
223
|
+
required: ["issuer", "subject"],
|
|
224
|
+
additionalProperties: false,
|
|
225
|
+
},
|
|
226
|
+
outputSchema: {
|
|
227
|
+
type: "object",
|
|
228
|
+
properties: {
|
|
229
|
+
id: { type: "integer" },
|
|
230
|
+
login: { type: "string" },
|
|
231
|
+
displayName: { type: "string" },
|
|
232
|
+
principal: {
|
|
233
|
+
type: ["object", "null"],
|
|
234
|
+
properties: {
|
|
235
|
+
kind: { type: "string" },
|
|
236
|
+
issuer: { type: "string" },
|
|
237
|
+
subject: { type: "string" },
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
required: ["id", "login", "displayName", "principal"],
|
|
242
|
+
additionalProperties: false,
|
|
243
|
+
},
|
|
244
|
+
id: "wp.users.create",
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "zero/wp-users-get",
|
|
248
|
+
category: "zero-wp-users",
|
|
249
|
+
mode: "read",
|
|
250
|
+
capability: "list_users",
|
|
251
|
+
label: "Get a Space user",
|
|
252
|
+
description: "Reads one WordPress user belonging to this Space.",
|
|
253
|
+
annotations: { readonly: true, destructive: false, idempotent: true },
|
|
254
|
+
inputSchema: {
|
|
255
|
+
type: "object",
|
|
256
|
+
properties: { id: { type: "integer", minimum: 1 } },
|
|
257
|
+
required: ["id"],
|
|
258
|
+
additionalProperties: false,
|
|
259
|
+
},
|
|
260
|
+
outputSchema: {
|
|
261
|
+
type: "object",
|
|
262
|
+
properties: {
|
|
263
|
+
id: { type: "integer" },
|
|
264
|
+
login: { type: "string" },
|
|
265
|
+
displayName: { type: "string" },
|
|
266
|
+
principal: {
|
|
267
|
+
type: ["object", "null"],
|
|
268
|
+
properties: {
|
|
269
|
+
kind: { type: "string" },
|
|
270
|
+
issuer: { type: "string" },
|
|
271
|
+
subject: { type: "string" },
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
required: ["id", "login", "displayName", "principal"],
|
|
276
|
+
additionalProperties: false,
|
|
277
|
+
},
|
|
278
|
+
id: "wp.users.get",
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: "zero/wp-users-list",
|
|
282
|
+
category: "zero-wp-users",
|
|
283
|
+
mode: "read",
|
|
284
|
+
capability: "list_users",
|
|
285
|
+
label: "List Space users",
|
|
286
|
+
description: "Lists the WordPress users belonging to this Space.",
|
|
287
|
+
annotations: { readonly: true, destructive: false, idempotent: true },
|
|
288
|
+
inputSchema: {
|
|
289
|
+
default: [],
|
|
290
|
+
type: "object",
|
|
291
|
+
properties: {
|
|
292
|
+
page: { type: "integer", minimum: 1 },
|
|
293
|
+
perPage: { type: "integer", minimum: 1, maximum: 100 },
|
|
294
|
+
search: { type: "string" },
|
|
295
|
+
},
|
|
296
|
+
required: [],
|
|
297
|
+
additionalProperties: false,
|
|
298
|
+
},
|
|
299
|
+
outputSchema: {
|
|
300
|
+
type: "object",
|
|
301
|
+
properties: {
|
|
302
|
+
page: { type: "integer" },
|
|
303
|
+
perPage: { type: "integer" },
|
|
304
|
+
users: {
|
|
305
|
+
type: "array",
|
|
306
|
+
items: {
|
|
307
|
+
type: "object",
|
|
308
|
+
properties: {
|
|
309
|
+
id: { type: "integer" },
|
|
310
|
+
login: { type: "string" },
|
|
311
|
+
displayName: { type: "string" },
|
|
312
|
+
principal: {
|
|
313
|
+
type: ["object", "null"],
|
|
314
|
+
properties: {
|
|
315
|
+
kind: { type: "string" },
|
|
316
|
+
issuer: { type: "string" },
|
|
317
|
+
subject: { type: "string" },
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
required: ["id", "login", "displayName", "principal"],
|
|
322
|
+
additionalProperties: false,
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
required: ["page", "perPage", "users"],
|
|
327
|
+
additionalProperties: false,
|
|
328
|
+
},
|
|
329
|
+
id: "wp.users.list",
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: "zero/wp-users-update",
|
|
333
|
+
category: "zero-wp-users",
|
|
334
|
+
mode: "write",
|
|
335
|
+
capability: "edit_user",
|
|
336
|
+
label: "Update a Space user",
|
|
337
|
+
description: "Updates one WordPress user's profile in this Space.",
|
|
338
|
+
annotations: { readonly: false, destructive: true, idempotent: true },
|
|
339
|
+
inputSchema: {
|
|
340
|
+
type: "object",
|
|
341
|
+
properties: {
|
|
342
|
+
id: { type: "integer", minimum: 1 },
|
|
343
|
+
displayName: { type: "string", minLength: 1, maxLength: 250 },
|
|
344
|
+
},
|
|
345
|
+
required: ["id", "displayName"],
|
|
346
|
+
additionalProperties: false,
|
|
347
|
+
},
|
|
348
|
+
outputSchema: {
|
|
349
|
+
type: "object",
|
|
350
|
+
properties: {
|
|
351
|
+
id: { type: "integer" },
|
|
352
|
+
login: { type: "string" },
|
|
353
|
+
displayName: { type: "string" },
|
|
354
|
+
principal: {
|
|
355
|
+
type: ["object", "null"],
|
|
356
|
+
properties: {
|
|
357
|
+
kind: { type: "string" },
|
|
358
|
+
issuer: { type: "string" },
|
|
359
|
+
subject: { type: "string" },
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
required: ["id", "login", "displayName", "principal"],
|
|
364
|
+
additionalProperties: false,
|
|
365
|
+
},
|
|
366
|
+
id: "wp.users.update",
|
|
367
|
+
},
|
|
368
|
+
];
|
|
369
|
+
/** The categories the platform sets register under. */
|
|
370
|
+
export const ZERO_PLATFORM_ABILITY_CATEGORIES = [
|
|
371
|
+
"zero-storage",
|
|
372
|
+
"zero-wp-users",
|
|
373
|
+
];
|