@capybara-hq/plugin-sdk 0.1.0-rc.47 → 0.1.0-rc.49
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/bootstrap.d.ts +71 -0
- package/dist/bootstrap.js +144 -1
- package/dist/device-protocol.d.ts +1 -1
- package/dist/device-protocol.js +1 -0
- package/dist/git-hosts.d.ts +9 -0
- package/dist/git-hosts.js +19 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/sandbox-operation.d.ts +15 -1
- package/dist/sandbox-operation.js +22 -2
- package/package.json +1 -1
- package/schemas/bootstrap-extra.v1.schema.json +172 -0
package/dist/bootstrap.d.ts
CHANGED
|
@@ -79,3 +79,74 @@ export declare function parseBootstrapManifest(json: unknown): BootstrapManifest
|
|
|
79
79
|
};
|
|
80
80
|
/** The file name of an entry's tgz in the bootstrap directory: `<name>-<version>.tgz`. */
|
|
81
81
|
export declare function bootstrapFileName(e: BootstrapEntry): string;
|
|
82
|
+
/** Extra manifest format version. */
|
|
83
|
+
export declare const BOOTSTRAP_EXTRA_MANIFEST_SCHEMA_VERSION = 1;
|
|
84
|
+
/** A `git` entry: a plugin directory of a declared marketplace at a pinned commit. */
|
|
85
|
+
export interface BootstrapGitEntry {
|
|
86
|
+
/** Catalog item name. */
|
|
87
|
+
name: string;
|
|
88
|
+
source: "git";
|
|
89
|
+
/** A name from the manifest's `marketplaces`. */
|
|
90
|
+
marketplace: string;
|
|
91
|
+
/** 40-hex commit the tree is read at (never a branch). */
|
|
92
|
+
commit: string;
|
|
93
|
+
/** The plugin directory inside the repository: `./<path>`, or `.` / `./` for its root. */
|
|
94
|
+
path: string;
|
|
95
|
+
/** Exact semver. */
|
|
96
|
+
version: string;
|
|
97
|
+
/** `sha512-<base64>` of the kernel's canonical pack of the tree. */
|
|
98
|
+
integrity: string;
|
|
99
|
+
required?: boolean;
|
|
100
|
+
builtin?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/** An entry of the extra manifest: npm (`required` optional) or git. */
|
|
103
|
+
export type BootstrapExtraEntry = (Omit<Extract<BootstrapEntry, {
|
|
104
|
+
source: "npm";
|
|
105
|
+
}>, "required"> & {
|
|
106
|
+
required?: boolean;
|
|
107
|
+
}) | BootstrapGitEntry;
|
|
108
|
+
/** A marketplace the extra manifest declares for its `git` entries. */
|
|
109
|
+
export interface BootstrapExtraMarketplace {
|
|
110
|
+
/** `^[a-z0-9][a-z0-9-]{0,63}$`, unique, not `official`. */
|
|
111
|
+
name: string;
|
|
112
|
+
/** An https URL without userinfo. */
|
|
113
|
+
url: string;
|
|
114
|
+
ref?: string;
|
|
115
|
+
/** HTTP basic username of the credential (`^[A-Za-z0-9._-]{1,64}$`). */
|
|
116
|
+
username?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The extra bootstrap manifest (`bootstrap-extra.v1`): a second manifest a distribution supplies (the file
|
|
120
|
+
* `bootstrap.extraManifest` points at), merged into the built-in one (spec 2026-11-20-bootstrap-extra-manifest §2). It adds
|
|
121
|
+
* `marketplaces` the entries can name, `git` entries (a plugin directory of such a marketplace at
|
|
122
|
+
* a pinned commit) and an optional `defaultTheme`. `required` is optional here (default `false`).
|
|
123
|
+
* Objects are strict. The committed JSON Schema (`schemas/bootstrap-extra.v1.schema.json`) is
|
|
124
|
+
* generated from {@link BootstrapExtraManifestSchema}; the cross-field rules (unique names, a
|
|
125
|
+
* declared marketplace, `defaultTheme` naming a builtin entry, not both `required` and `builtin`)
|
|
126
|
+
* are decided only by {@link parseBootstrapExtraManifest}.
|
|
127
|
+
*/
|
|
128
|
+
export interface BootstrapExtraManifest {
|
|
129
|
+
$schema?: string;
|
|
130
|
+
schemaVersion: 1;
|
|
131
|
+
marketplaces: BootstrapExtraMarketplace[];
|
|
132
|
+
plugins: BootstrapExtraEntry[];
|
|
133
|
+
/** The platform default theme: `plugin` is a builtin entry of this manifest. */
|
|
134
|
+
defaultTheme?: {
|
|
135
|
+
plugin: string;
|
|
136
|
+
theme: string;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The zod schema of the extra manifest (strict objects). The JSON Schema is generated with
|
|
141
|
+
* `z.toJSONSchema(BootstrapExtraManifestSchema, { io: "input" })`.
|
|
142
|
+
*/
|
|
143
|
+
export declare const BootstrapExtraManifestSchema: z.ZodType<BootstrapExtraManifest>;
|
|
144
|
+
/**
|
|
145
|
+
* Validates and parses the extra manifest. Invalid input returns `{ errors }` (`<path>: <reason>`,
|
|
146
|
+
* at most 50); never throws.
|
|
147
|
+
*/
|
|
148
|
+
export declare function parseBootstrapExtraManifest(json: unknown): {
|
|
149
|
+
manifest: BootstrapExtraManifest;
|
|
150
|
+
} | {
|
|
151
|
+
errors: string[];
|
|
152
|
+
};
|
package/dist/bootstrap.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { GIT_USERNAME_RE } from "./git-hosts.js";
|
|
3
|
+
import { CATALOG_ITEM_NAME_RE, isSafePackagePath, NPM_PACKAGE_NAME_RE, SEMVER_VERSION_RE, SHA512_INTEGRITY_RE, } from "./plugin-package.js";
|
|
3
4
|
/**
|
|
4
5
|
* The bootstrap manifest `packages/kernel/bootstrap.json` (package ecosystem spec §7): the plugins
|
|
5
6
|
* a deployment installs at init, each pinned to an exact version and the sha512 of its tgz. The
|
|
@@ -123,3 +124,145 @@ export function parseBootstrapManifest(json) {
|
|
|
123
124
|
export function bootstrapFileName(e) {
|
|
124
125
|
return `${e.name}-${e.version}.tgz`;
|
|
125
126
|
}
|
|
127
|
+
/** Extra manifest format version. */
|
|
128
|
+
export const BOOTSTRAP_EXTRA_MANIFEST_SCHEMA_VERSION = 1;
|
|
129
|
+
const RESERVED_MARKETPLACE_NAME = "official";
|
|
130
|
+
const extraCommon = {
|
|
131
|
+
name: common.name,
|
|
132
|
+
version: common.version,
|
|
133
|
+
integrity: common.integrity,
|
|
134
|
+
required: z.boolean().optional(),
|
|
135
|
+
builtin: common.builtin,
|
|
136
|
+
};
|
|
137
|
+
const extraEntry = z.discriminatedUnion("source", [
|
|
138
|
+
z.strictObject({
|
|
139
|
+
...extraCommon,
|
|
140
|
+
source: z.literal("npm"),
|
|
141
|
+
npm: z
|
|
142
|
+
.string()
|
|
143
|
+
.max(214)
|
|
144
|
+
.regex(NPM_PACKAGE_NAME_RE, { message: "npm must be an npm package name" }),
|
|
145
|
+
}),
|
|
146
|
+
z.strictObject({
|
|
147
|
+
...extraCommon,
|
|
148
|
+
source: z.literal("git"),
|
|
149
|
+
marketplace: common.name,
|
|
150
|
+
commit: z.string().regex(COMMIT_RE, { message: "commit must be 40 hex characters" }),
|
|
151
|
+
path: z
|
|
152
|
+
.string()
|
|
153
|
+
.max(512)
|
|
154
|
+
// "." / "./": the repository root (a single-plugin repository)
|
|
155
|
+
.refine((p) => p === "." || p === "./" || (p.startsWith("./") && isSafePackagePath(p.slice(2))), {
|
|
156
|
+
message: 'path must be "." (the repository root) or start with "./" and stay inside the repository',
|
|
157
|
+
}),
|
|
158
|
+
}),
|
|
159
|
+
]);
|
|
160
|
+
const extraMarketplace = z.strictObject({
|
|
161
|
+
name: common.name,
|
|
162
|
+
url: z
|
|
163
|
+
.string()
|
|
164
|
+
.max(URL_CHARS)
|
|
165
|
+
.regex(HTTPS_URL_RE, { message: "url must be an https URL" })
|
|
166
|
+
.refine((s) => {
|
|
167
|
+
try {
|
|
168
|
+
const u = new URL(s);
|
|
169
|
+
return u.username === "" && u.password === "";
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}, { message: "url must be a valid URL without userinfo" }),
|
|
175
|
+
ref: z.string().min(1).max(256).optional(),
|
|
176
|
+
username: z
|
|
177
|
+
.string()
|
|
178
|
+
.regex(GIT_USERNAME_RE, { message: "username must match ^[A-Za-z0-9._-]{1,64}$" })
|
|
179
|
+
.optional(),
|
|
180
|
+
});
|
|
181
|
+
const extraSchema = z
|
|
182
|
+
.strictObject({
|
|
183
|
+
$schema: z.string().max(URL_CHARS).optional(),
|
|
184
|
+
schemaVersion: z.literal(BOOTSTRAP_EXTRA_MANIFEST_SCHEMA_VERSION),
|
|
185
|
+
marketplaces: z.array(extraMarketplace).max(50),
|
|
186
|
+
plugins: z.array(extraEntry).max(500),
|
|
187
|
+
defaultTheme: z
|
|
188
|
+
.strictObject({
|
|
189
|
+
plugin: common.name,
|
|
190
|
+
theme: z.string().min(1).max(256),
|
|
191
|
+
})
|
|
192
|
+
.optional(),
|
|
193
|
+
})
|
|
194
|
+
.superRefine((m, ctx) => {
|
|
195
|
+
const marketplaces = new Set();
|
|
196
|
+
m.marketplaces.forEach((mk, i) => {
|
|
197
|
+
if (mk.name === RESERVED_MARKETPLACE_NAME) {
|
|
198
|
+
ctx.addIssue({
|
|
199
|
+
code: "custom",
|
|
200
|
+
path: ["marketplaces", i, "name"],
|
|
201
|
+
message: `the name ${RESERVED_MARKETPLACE_NAME} is reserved`,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
if (marketplaces.has(mk.name)) {
|
|
205
|
+
ctx.addIssue({
|
|
206
|
+
code: "custom",
|
|
207
|
+
path: ["marketplaces", i, "name"],
|
|
208
|
+
message: `duplicate marketplace ${mk.name}`,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
marketplaces.add(mk.name);
|
|
212
|
+
});
|
|
213
|
+
const seen = new Set();
|
|
214
|
+
m.plugins.forEach((e, i) => {
|
|
215
|
+
if (seen.has(e.name)) {
|
|
216
|
+
ctx.addIssue({
|
|
217
|
+
code: "custom",
|
|
218
|
+
path: ["plugins", i, "name"],
|
|
219
|
+
message: `duplicate entry ${e.name}`,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
seen.add(e.name);
|
|
223
|
+
if (e.required === true && e.builtin === true) {
|
|
224
|
+
ctx.addIssue({
|
|
225
|
+
code: "custom",
|
|
226
|
+
path: ["plugins", i, "builtin"],
|
|
227
|
+
message: "an entry is either required or builtin, not both",
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
if (e.source === "git" && !marketplaces.has(e.marketplace)) {
|
|
231
|
+
ctx.addIssue({
|
|
232
|
+
code: "custom",
|
|
233
|
+
path: ["plugins", i, "marketplace"],
|
|
234
|
+
message: `marketplace "${e.marketplace}" is not declared`,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
if (m.defaultTheme !== undefined) {
|
|
239
|
+
const target = m.plugins.find((e) => e.name === m.defaultTheme?.plugin);
|
|
240
|
+
if (target === undefined || target.builtin !== true) {
|
|
241
|
+
ctx.addIssue({
|
|
242
|
+
code: "custom",
|
|
243
|
+
path: ["defaultTheme", "plugin"],
|
|
244
|
+
message: "must name an entry of this manifest with builtin: true",
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
/**
|
|
250
|
+
* The zod schema of the extra manifest (strict objects). The JSON Schema is generated with
|
|
251
|
+
* `z.toJSONSchema(BootstrapExtraManifestSchema, { io: "input" })`.
|
|
252
|
+
*/
|
|
253
|
+
export const BootstrapExtraManifestSchema = extraSchema;
|
|
254
|
+
/**
|
|
255
|
+
* Validates and parses the extra manifest. Invalid input returns `{ errors }` (`<path>: <reason>`,
|
|
256
|
+
* at most 50); never throws.
|
|
257
|
+
*/
|
|
258
|
+
export function parseBootstrapExtraManifest(json) {
|
|
259
|
+
const r = BootstrapExtraManifestSchema.safeParse(json);
|
|
260
|
+
if (r.success)
|
|
261
|
+
return { manifest: r.data };
|
|
262
|
+
return {
|
|
263
|
+
errors: r.error.issues.slice(0, MAX_ERRORS).map((i) => {
|
|
264
|
+
const path = i.path.map(String).join(".");
|
|
265
|
+
return path ? `${path}: ${i.message}` : i.message;
|
|
266
|
+
}),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
@@ -457,7 +457,7 @@ export type DeviceResponse = Exclude<DeviceRes, {
|
|
|
457
457
|
* `invalid` never proves the operation had no effect (a skewed device may have parsed
|
|
458
458
|
* part of it): it must never join the not-run refusals (`isRefusal`, `failureKindOf`).
|
|
459
459
|
*/
|
|
460
|
-
kind: "gone" | "fs_gone" | "policy" | "error" | "denied" | "unsupported" | "unknown" | "invalid";
|
|
460
|
+
kind: "gone" | "fs_gone" | "policy" | "error" | "denied" | "unsupported" | "unsettled" | "unknown" | "invalid";
|
|
461
461
|
message: string;
|
|
462
462
|
};
|
|
463
463
|
};
|
package/dist/device-protocol.js
CHANGED
package/dist/git-hosts.d.ts
CHANGED
|
@@ -20,6 +20,15 @@ export declare const GIT_HOST_USERNAMES: {
|
|
|
20
20
|
readonly "github.com": "x-access-token";
|
|
21
21
|
readonly "*.ghe.com": "x-access-token";
|
|
22
22
|
};
|
|
23
|
+
/** A valid HTTP basic username: `^[A-Za-z0-9._-]{1,64}$`. */
|
|
24
|
+
export declare const GIT_USERNAME_RE: RegExp;
|
|
25
|
+
/** The username a git marketplace credential is presented with when none is stored. */
|
|
26
|
+
export declare const GIT_MARKETPLACE_USERNAME_DEFAULT = "x-access-token";
|
|
27
|
+
/**
|
|
28
|
+
* A hint for forms: the basic username well-known git hosts document for a token. Other hosts
|
|
29
|
+
* return `undefined`; the user enters the username the host's documentation names.
|
|
30
|
+
*/
|
|
31
|
+
export declare function suggestGitUsername(host: string): string | undefined;
|
|
23
32
|
/** One git host and the username its credential is presented with. */
|
|
24
33
|
export interface GitHostEntry {
|
|
25
34
|
/** Lower-case hostname with no scheme, port, path, wildcard or userinfo. */
|
package/dist/git-hosts.js
CHANGED
|
@@ -21,7 +21,24 @@ export const GIT_HOST_USERNAMES = {
|
|
|
21
21
|
"github.com": "x-access-token",
|
|
22
22
|
"*.ghe.com": "x-access-token",
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
/** A valid HTTP basic username: `^[A-Za-z0-9._-]{1,64}$`. */
|
|
25
|
+
export const GIT_USERNAME_RE = /^[A-Za-z0-9._-]{1,64}$/;
|
|
26
|
+
/** The username a git marketplace credential is presented with when none is stored. */
|
|
27
|
+
export const GIT_MARKETPLACE_USERNAME_DEFAULT = "x-access-token";
|
|
28
|
+
/**
|
|
29
|
+
* A hint for forms: the basic username well-known git hosts document for a token. Other hosts
|
|
30
|
+
* return `undefined`; the user enters the username the host's documentation names.
|
|
31
|
+
*/
|
|
32
|
+
export function suggestGitUsername(host) {
|
|
33
|
+
const h = host.toLowerCase();
|
|
34
|
+
if (h === "github.com" || h.endsWith(".ghe.com"))
|
|
35
|
+
return GIT_MARKETPLACE_USERNAME_DEFAULT;
|
|
36
|
+
if (h === "bitbucket.org")
|
|
37
|
+
return "x-token-auth";
|
|
38
|
+
if (h === "gitlab.com")
|
|
39
|
+
return "oauth2";
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
25
42
|
/** Why a host is refused; never echoes the value (it may be a pasted credential or URL). */
|
|
26
43
|
function hostProblems(h) {
|
|
27
44
|
if (/[@:/?#\s]/.test(h))
|
|
@@ -42,7 +59,7 @@ const GitHostEntrySchema = z.strictObject({
|
|
|
42
59
|
}),
|
|
43
60
|
username: z
|
|
44
61
|
.string()
|
|
45
|
-
.regex(
|
|
62
|
+
.regex(GIT_USERNAME_RE, "username must match ^[A-Za-z0-9._-]{1,64}$ (letters, digits, '.', '_', '-')"),
|
|
46
63
|
});
|
|
47
64
|
/**
|
|
48
65
|
* The zod schema of {@link GitSource} (strict objects, 1 to {@link GIT_HOSTS_LIMITS}`.hosts` hosts,
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -8,8 +8,22 @@ export declare class SandboxPermissionUnsupportedError extends Error {
|
|
|
8
8
|
readonly sandboxPermissionUnsupported: true;
|
|
9
9
|
constructor(message: string, opts?: ErrorOptions);
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Recognizes the inherited tag across SDK copies without requiring this class's identity, so every
|
|
13
|
+
* subclass counts too (for example {@link SandboxWorkUnsettledError}: the same definite refusal).
|
|
14
|
+
*/
|
|
12
15
|
export declare function isSandboxPermissionUnsupportedError(e: unknown): e is SandboxPermissionUnsupportedError;
|
|
16
|
+
/**
|
|
17
|
+
* Earlier work on the device has not settled, so it refused to start a new operation. It extends
|
|
18
|
+
* {@link SandboxPermissionUnsupportedError} so every check that treats that error as a definite
|
|
19
|
+
* refusal (nothing ran) treats this one the same way.
|
|
20
|
+
*/
|
|
21
|
+
export declare class SandboxWorkUnsettledError extends SandboxPermissionUnsupportedError {
|
|
22
|
+
readonly sandboxWorkUnsettled: true;
|
|
23
|
+
constructor(message: string, opts?: ErrorOptions);
|
|
24
|
+
}
|
|
25
|
+
/** Recognizes the name and tag across SDK copies without requiring this class's identity. */
|
|
26
|
+
export declare function isSandboxWorkUnsettledError(e: unknown): e is SandboxWorkUnsettledError;
|
|
13
27
|
/** The requested operation is outside the permitted scope. */
|
|
14
28
|
export declare class SandboxScopeDeniedError extends Error {
|
|
15
29
|
readonly sandboxScopeDenied: true;
|
|
@@ -11,12 +11,32 @@ export class SandboxPermissionUnsupportedError extends Error {
|
|
|
11
11
|
this.name = "SandboxPermissionUnsupportedError";
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Recognizes the inherited tag across SDK copies without requiring this class's identity, so every
|
|
16
|
+
* subclass counts too (for example {@link SandboxWorkUnsettledError}: the same definite refusal).
|
|
17
|
+
*/
|
|
15
18
|
export function isSandboxPermissionUnsupportedError(e) {
|
|
16
19
|
return (e instanceof Error &&
|
|
17
|
-
e.name === "SandboxPermissionUnsupportedError" &&
|
|
18
20
|
e.sandboxPermissionUnsupported === true);
|
|
19
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Earlier work on the device has not settled, so it refused to start a new operation. It extends
|
|
24
|
+
* {@link SandboxPermissionUnsupportedError} so every check that treats that error as a definite
|
|
25
|
+
* refusal (nothing ran) treats this one the same way.
|
|
26
|
+
*/
|
|
27
|
+
export class SandboxWorkUnsettledError extends SandboxPermissionUnsupportedError {
|
|
28
|
+
sandboxWorkUnsettled = true;
|
|
29
|
+
constructor(message, opts) {
|
|
30
|
+
super(message, opts);
|
|
31
|
+
this.name = "SandboxWorkUnsettledError";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** Recognizes the name and tag across SDK copies without requiring this class's identity. */
|
|
35
|
+
export function isSandboxWorkUnsettledError(e) {
|
|
36
|
+
return (e instanceof Error &&
|
|
37
|
+
e.name === "SandboxWorkUnsettledError" &&
|
|
38
|
+
e.sandboxWorkUnsettled === true);
|
|
39
|
+
}
|
|
20
40
|
/** The requested operation is outside the permitted scope. */
|
|
21
41
|
export class SandboxScopeDeniedError extends Error {
|
|
22
42
|
sandboxScopeDenied = true;
|
package/package.json
CHANGED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://capybarahq.com/schemas/bootstrap-extra.v1.schema.json",
|
|
4
|
+
"title": "Capybara extra bootstrap manifest bootstrap.extra.json (schemaVersion 1)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"$schema": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"maxLength": 2000
|
|
10
|
+
},
|
|
11
|
+
"schemaVersion": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"const": 1
|
|
14
|
+
},
|
|
15
|
+
"marketplaces": {
|
|
16
|
+
"maxItems": 50,
|
|
17
|
+
"type": "array",
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"properties": {
|
|
21
|
+
"name": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
24
|
+
},
|
|
25
|
+
"url": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"maxLength": 2000,
|
|
28
|
+
"pattern": "^https:\\/\\/\\S+$"
|
|
29
|
+
},
|
|
30
|
+
"ref": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"maxLength": 256
|
|
34
|
+
},
|
|
35
|
+
"username": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": [
|
|
41
|
+
"name",
|
|
42
|
+
"url"
|
|
43
|
+
],
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"plugins": {
|
|
48
|
+
"maxItems": 500,
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"oneOf": [
|
|
52
|
+
{
|
|
53
|
+
"type": "object",
|
|
54
|
+
"properties": {
|
|
55
|
+
"name": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
58
|
+
},
|
|
59
|
+
"version": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"maxLength": 256,
|
|
62
|
+
"pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$"
|
|
63
|
+
},
|
|
64
|
+
"integrity": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"pattern": "^sha512-[A-Za-z0-9+/]{86}==$"
|
|
67
|
+
},
|
|
68
|
+
"required": {
|
|
69
|
+
"type": "boolean"
|
|
70
|
+
},
|
|
71
|
+
"builtin": {
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
"source": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"const": "npm"
|
|
77
|
+
},
|
|
78
|
+
"npm": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"maxLength": 214,
|
|
81
|
+
"pattern": "^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*$"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"required": [
|
|
85
|
+
"name",
|
|
86
|
+
"version",
|
|
87
|
+
"integrity",
|
|
88
|
+
"source",
|
|
89
|
+
"npm"
|
|
90
|
+
],
|
|
91
|
+
"additionalProperties": false
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "object",
|
|
95
|
+
"properties": {
|
|
96
|
+
"name": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
99
|
+
},
|
|
100
|
+
"version": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"maxLength": 256,
|
|
103
|
+
"pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$"
|
|
104
|
+
},
|
|
105
|
+
"integrity": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"pattern": "^sha512-[A-Za-z0-9+/]{86}==$"
|
|
108
|
+
},
|
|
109
|
+
"required": {
|
|
110
|
+
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"builtin": {
|
|
113
|
+
"type": "boolean"
|
|
114
|
+
},
|
|
115
|
+
"source": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"const": "git"
|
|
118
|
+
},
|
|
119
|
+
"marketplace": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
122
|
+
},
|
|
123
|
+
"commit": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"pattern": "^[0-9a-f]{40}$"
|
|
126
|
+
},
|
|
127
|
+
"path": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"maxLength": 512
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"required": [
|
|
133
|
+
"name",
|
|
134
|
+
"version",
|
|
135
|
+
"integrity",
|
|
136
|
+
"source",
|
|
137
|
+
"marketplace",
|
|
138
|
+
"commit",
|
|
139
|
+
"path"
|
|
140
|
+
],
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"defaultTheme": {
|
|
147
|
+
"type": "object",
|
|
148
|
+
"properties": {
|
|
149
|
+
"plugin": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
152
|
+
},
|
|
153
|
+
"theme": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"minLength": 1,
|
|
156
|
+
"maxLength": 256
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"required": [
|
|
160
|
+
"plugin",
|
|
161
|
+
"theme"
|
|
162
|
+
],
|
|
163
|
+
"additionalProperties": false
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": [
|
|
167
|
+
"schemaVersion",
|
|
168
|
+
"marketplaces",
|
|
169
|
+
"plugins"
|
|
170
|
+
],
|
|
171
|
+
"additionalProperties": false
|
|
172
|
+
}
|