@kardalum/plugin-sdk 0.15.0 → 0.16.0
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/CHANGELOG.md +11 -1
- package/README.md +10 -0
- package/dist/built-in-value-schemas.js +1 -1
- package/dist/built-ins.js +2 -2
- package/dist/capabilities.d.ts +8 -78
- package/dist/capabilities.js +23 -319
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -4
- package/dist/license-verdict-keys.js +4 -0
- package/dist/manifest-entry.d.ts +2 -2
- package/dist/manifest-entry.js +1 -1
- package/dist/manifest-schema.d.ts +81 -13
- package/dist/manifest-schema.js +108 -59
- package/dist/manifest.d.ts +105 -40
- package/dist/media/media-picker.js +21 -12
- package/dist/media/upload-error.d.ts +1 -1
- package/dist/media/upload-error.js +1 -1
- package/dist/plugin-context.d.ts +7 -0
- package/dist/plugin-context.js +7 -0
- package/dist/plugin-screen-context.d.ts +33 -2
- package/dist/plugin-screen-context.js +27 -2
- package/dist/read-all-pages.d.ts +23 -0
- package/dist/read-all-pages.js +30 -0
- package/dist/richtext/block-panel.js +4 -4
- package/dist/richtext/insert-menu.js +3 -3
- package/dist/views/content-list-view.js +2 -2
- package/dist/views/image-view.js +24 -39
- package/dist/views/rich-text-view.js +2 -2
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +43 -25
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +60 -8
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +12 -8
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +11 -7
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +107 -57
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +96 -60
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +39 -28
- package/node_modules/@kardalum/api-schemas/dist/index.js +19 -13
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
- package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +302 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +78 -6
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +38 -30
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +2 -2
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +82 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +88 -5
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +79 -17
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +585 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +536 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +213 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +25 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +21 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +16 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +44 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +162 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +8 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +11 -1
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +35 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +79 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +36 -6
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -5
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +8 -8
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +8 -8
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +2 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +11 -3
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +5 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +111 -0
- package/node_modules/@kardalum/plugin-package/dist/build-reference.js +61 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +351 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +3 -1
- package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +2 -0
- package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +6 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +20 -1
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +56 -16
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +4 -6
- package/node_modules/@kardalum/plugin-package/dist/types.js +15 -1
- package/node_modules/@kardalum/plugin-package/package.json +5 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +2 -2
- package/node_modules/@kardalum/ui/dist/components/property-field.js +4 -1
- package/package.json +2 -2
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** POST /assets/upload */
|
|
3
|
+
export declare const AssetUploadFieldsSchema: z.ZodObject<{
|
|
4
|
+
path: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare const AssetUploadBodySchema: z.ZodObject<{
|
|
7
|
+
path: z.ZodOptional<z.ZodString>;
|
|
8
|
+
file: z.ZodFile;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export type AssetUploadBody = z.infer<typeof AssetUploadBodySchema>;
|
|
11
|
+
/** POST /assets/extract-zip */
|
|
12
|
+
export declare const AssetExtractZipFieldsSchema: z.ZodObject<{
|
|
13
|
+
path: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export declare const AssetExtractZipBodySchema: z.ZodObject<{
|
|
16
|
+
path: z.ZodOptional<z.ZodString>;
|
|
17
|
+
file: z.ZodFile;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type AssetExtractZipBody = z.infer<typeof AssetExtractZipBodySchema>;
|
|
20
|
+
/** POST /media */
|
|
21
|
+
export declare const MediaUploadFieldsSchema: z.ZodObject<{
|
|
22
|
+
folderId: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export declare const MediaUploadBodySchema: z.ZodObject<{
|
|
25
|
+
folderId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
file: z.ZodFile;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export type MediaUploadBody = z.infer<typeof MediaUploadBodySchema>;
|
|
29
|
+
/** POST /media/:id/replace */
|
|
30
|
+
export declare const MediaReplaceFieldsSchema: z.ZodObject<{
|
|
31
|
+
width: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
32
|
+
height: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
export declare const MediaReplaceBodySchema: z.ZodObject<{
|
|
35
|
+
width: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
36
|
+
height: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
37
|
+
file: z.ZodFile;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type MediaReplaceBody = z.infer<typeof MediaReplaceBodySchema>;
|
|
40
|
+
/** What a rendition cut answers when a required field is missing (the reader's messages, kept). */
|
|
41
|
+
export declare const MEDIA_RENDITION_REQUIRED: {
|
|
42
|
+
readonly fieldId: "fieldId is required: it names the crop or thumbnail being cut";
|
|
43
|
+
readonly rect: "rect is required: a cut records the rectangle it was made from";
|
|
44
|
+
readonly dimensions: "width and height are required: a cut is made on a canvas, so its pixels are known";
|
|
45
|
+
readonly expectedVersion: "expectedVersion is required: a cut says which version it believes the item is serving";
|
|
46
|
+
};
|
|
47
|
+
export declare const MEDIA_RENDITION_RECT_INVALID = "rect must be a JSON object of fractions, such as {\"x\":0,\"y\":0,\"w\":0.75,\"h\":1}";
|
|
48
|
+
/** POST /media/:id/renditions: every field is required and comes before the file part. */
|
|
49
|
+
export declare const MediaRenditionFieldsSchema: z.ZodObject<{
|
|
50
|
+
fieldId: z.ZodString;
|
|
51
|
+
rect: z.ZodString;
|
|
52
|
+
width: z.ZodCoercedNumber<unknown>;
|
|
53
|
+
height: z.ZodCoercedNumber<unknown>;
|
|
54
|
+
expectedVersion: z.ZodCoercedNumber<unknown>;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
export declare const MediaRenditionBodySchema: z.ZodObject<{
|
|
57
|
+
fieldId: z.ZodString;
|
|
58
|
+
rect: z.ZodString;
|
|
59
|
+
width: z.ZodCoercedNumber<unknown>;
|
|
60
|
+
height: z.ZodCoercedNumber<unknown>;
|
|
61
|
+
expectedVersion: z.ZodCoercedNumber<unknown>;
|
|
62
|
+
file: z.ZodFile;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
export type MediaRenditionBody = z.infer<typeof MediaRenditionBodySchema>;
|
|
65
|
+
/** POST /plugins/upload. The answers may come before or after the package. */
|
|
66
|
+
export declare const PluginUploadFieldsSchema: z.ZodObject<{
|
|
67
|
+
answers: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export declare const PluginUploadBodySchema: z.ZodObject<{
|
|
70
|
+
answers: z.ZodOptional<z.ZodString>;
|
|
71
|
+
package: z.ZodFile;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
export type PluginUploadBody = z.infer<typeof PluginUploadBodySchema>;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// S303 (2026-10-17-s303-the-api-documented-design.md 3.2): the multipart request
|
|
3
|
+
// bodies of the six management upload routes, for the OpenAPI document and the
|
|
4
|
+
// reference page, and the schemas their field readers parse the text fields with
|
|
5
|
+
// (routes/multipart-fields.ts), so the document and the code share one source and
|
|
6
|
+
// the error text is the schema's. The route still streams the upload unvalidated;
|
|
7
|
+
// only the text fields are parsed, by hand, once the multipart parser has them.
|
|
8
|
+
// The pattern is PublicMediaUploadFieldsSchema / PublicMediaUploadBodySchema.
|
|
9
|
+
//
|
|
10
|
+
// A multipart text field reaches the route as a string, so a number is a
|
|
11
|
+
// z.coerce.number() here, as the readers always parsed it.
|
|
12
|
+
const BEFORE_FILE = "It must come before the file part in the multipart body: a field sent after the file may not be read.";
|
|
13
|
+
const PIXELS = "a positive whole number of pixels";
|
|
14
|
+
function positiveWholeNumber(name, requirement) {
|
|
15
|
+
const message = `${name} must be ${requirement}`;
|
|
16
|
+
// A refine, not .int(): the document types the field "number", as the brief's contract has it.
|
|
17
|
+
return z.coerce.number({ error: message }).refine(Number.isSafeInteger, { error: message }).positive({ error: message });
|
|
18
|
+
}
|
|
19
|
+
/** POST /assets/upload */
|
|
20
|
+
export const AssetUploadFieldsSchema = z
|
|
21
|
+
.object({
|
|
22
|
+
path: z.string().describe(`The folder the file is stored in, relative to the assets root. Empty or absent means the root. ${BEFORE_FILE}`).optional(),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
25
|
+
export const AssetUploadBodySchema = AssetUploadFieldsSchema.extend({
|
|
26
|
+
file: z.file().describe("The file to store. Its name is cleaned before it is stored."),
|
|
27
|
+
});
|
|
28
|
+
/** POST /assets/extract-zip */
|
|
29
|
+
export const AssetExtractZipFieldsSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
path: z.string().describe(`The folder the archive is unpacked into, relative to the assets root. Empty or absent means the root. ${BEFORE_FILE}`).optional(),
|
|
32
|
+
})
|
|
33
|
+
.strict();
|
|
34
|
+
export const AssetExtractZipBodySchema = AssetExtractZipFieldsSchema.extend({
|
|
35
|
+
file: z.file().describe("The .zip archive to unpack."),
|
|
36
|
+
});
|
|
37
|
+
/** POST /media */
|
|
38
|
+
export const MediaUploadFieldsSchema = z
|
|
39
|
+
.object({
|
|
40
|
+
folderId: z
|
|
41
|
+
.string()
|
|
42
|
+
.uuid("folderId must be a valid UUID")
|
|
43
|
+
.describe(`The media folder the file lands in. Empty or absent means the library root. ${BEFORE_FILE}`)
|
|
44
|
+
.optional(),
|
|
45
|
+
})
|
|
46
|
+
.strict();
|
|
47
|
+
export const MediaUploadBodySchema = MediaUploadFieldsSchema.extend({
|
|
48
|
+
file: z.file().describe("The file to store."),
|
|
49
|
+
});
|
|
50
|
+
/** POST /media/:id/replace */
|
|
51
|
+
export const MediaReplaceFieldsSchema = z
|
|
52
|
+
.object({
|
|
53
|
+
width: positiveWholeNumber("width", PIXELS).describe(`The width in pixels a browser measured before uploading. A whole number. Optional. ${BEFORE_FILE}`).optional(),
|
|
54
|
+
height: positiveWholeNumber("height", PIXELS).describe(`The height in pixels a browser measured before uploading. A whole number. Optional. ${BEFORE_FILE}`).optional(),
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
export const MediaReplaceBodySchema = MediaReplaceFieldsSchema.extend({
|
|
58
|
+
file: z.file().describe("The replacement file. Its type must match the item's."),
|
|
59
|
+
});
|
|
60
|
+
/** What a rendition cut answers when a required field is missing (the reader's messages, kept). */
|
|
61
|
+
export const MEDIA_RENDITION_REQUIRED = {
|
|
62
|
+
fieldId: "fieldId is required: it names the crop or thumbnail being cut",
|
|
63
|
+
rect: "rect is required: a cut records the rectangle it was made from",
|
|
64
|
+
dimensions: "width and height are required: a cut is made on a canvas, so its pixels are known",
|
|
65
|
+
expectedVersion: "expectedVersion is required: a cut says which version it believes the item is serving",
|
|
66
|
+
};
|
|
67
|
+
export const MEDIA_RENDITION_RECT_INVALID = 'rect must be a JSON object of fractions, such as {"x":0,"y":0,"w":0.75,"h":1}';
|
|
68
|
+
function isJsonText(text) {
|
|
69
|
+
try {
|
|
70
|
+
JSON.parse(text);
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** POST /media/:id/renditions: every field is required and comes before the file part. */
|
|
78
|
+
export const MediaRenditionFieldsSchema = z
|
|
79
|
+
.object({
|
|
80
|
+
fieldId: z.string().describe(`The field whose crop or thumbnail this is. ${BEFORE_FILE}`),
|
|
81
|
+
rect: z
|
|
82
|
+
.string()
|
|
83
|
+
.refine(isJsonText, { error: MEDIA_RENDITION_RECT_INVALID })
|
|
84
|
+
.describe(`The rectangle the cut was made from, as JSON text: an object of fractions of the original, such as {"x":0,"y":0,"w":0.75,"h":1}. ${BEFORE_FILE}`),
|
|
85
|
+
width: positiveWholeNumber("width", PIXELS).describe(`The cut's width in pixels. A whole number. ${BEFORE_FILE}`),
|
|
86
|
+
height: positiveWholeNumber("height", PIXELS).describe(`The cut's height in pixels. A whole number. ${BEFORE_FILE}`),
|
|
87
|
+
expectedVersion: positiveWholeNumber("expectedVersion", "a positive whole version number").describe(`The version of the item the cut was decided against. A whole number. The cut is refused if the item has moved on. ${BEFORE_FILE}`),
|
|
88
|
+
})
|
|
89
|
+
.strict();
|
|
90
|
+
export const MediaRenditionBodySchema = MediaRenditionFieldsSchema.extend({
|
|
91
|
+
file: z.file().describe("The cut's bytes. Its file name is ignored."),
|
|
92
|
+
});
|
|
93
|
+
/** POST /plugins/upload. The answers may come before or after the package. */
|
|
94
|
+
export const PluginUploadFieldsSchema = z
|
|
95
|
+
.object({
|
|
96
|
+
answers: z
|
|
97
|
+
.string()
|
|
98
|
+
.describe("The install answers as JSON text, shaped like the package's installAnswers declaration. Optional. It may be sent before or after the package part.")
|
|
99
|
+
.optional(),
|
|
100
|
+
})
|
|
101
|
+
.strict();
|
|
102
|
+
export const PluginUploadBodySchema = PluginUploadFieldsSchema.extend({
|
|
103
|
+
package: z.file().describe("The plugin package, a .zip archive. The part must be named package."),
|
|
104
|
+
});
|
|
@@ -78,6 +78,7 @@ export declare const MarketplaceListingSchema: z.ZodObject<{
|
|
|
78
78
|
hasArtifact: z.ZodBoolean;
|
|
79
79
|
}, z.core.$strip>>;
|
|
80
80
|
compatible: z.ZodBoolean;
|
|
81
|
+
cmsCompatible: z.ZodBoolean;
|
|
81
82
|
installedVersion: z.ZodNullable<z.ZodString>;
|
|
82
83
|
updateAvailable: z.ZodBoolean;
|
|
83
84
|
}, z.core.$strip>;
|
|
@@ -148,6 +149,83 @@ export declare const MarketplaceListingDetailVersionSchema: z.ZodObject<{
|
|
|
148
149
|
priceCents: z.ZodNumber;
|
|
149
150
|
}, z.core.$strip>>>>;
|
|
150
151
|
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
|
+
installInterface: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
153
|
+
consent: z.ZodArray<z.ZodObject<{
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
details: z.ZodArray<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
157
|
+
sampleContent: z.ZodNullable<z.ZodObject<{
|
|
158
|
+
default: z.ZodLiteral<true>;
|
|
159
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
160
|
+
en: z.ZodString;
|
|
161
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
164
|
+
id: z.ZodString;
|
|
165
|
+
label: z.ZodString;
|
|
166
|
+
actions: z.ZodArray<z.ZodString>;
|
|
167
|
+
default: z.ZodLiteral<false>;
|
|
168
|
+
}, z.core.$strip>>;
|
|
169
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
172
|
+
en: z.ZodString;
|
|
173
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
174
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
175
|
+
en: z.ZodString;
|
|
176
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
177
|
+
options: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
178
|
+
kind: z.ZodLiteral<"boolean">;
|
|
179
|
+
default: z.ZodBoolean;
|
|
180
|
+
id: z.ZodString;
|
|
181
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
182
|
+
en: z.ZodString;
|
|
183
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
184
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
185
|
+
en: z.ZodString;
|
|
186
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
187
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
188
|
+
kind: z.ZodLiteral<"select">;
|
|
189
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
192
|
+
en: z.ZodString;
|
|
193
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
194
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
195
|
+
en: z.ZodString;
|
|
196
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
197
|
+
}, z.core.$strict>>;
|
|
198
|
+
default: z.ZodOptional<z.ZodString>;
|
|
199
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
id: z.ZodString;
|
|
201
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
202
|
+
en: z.ZodString;
|
|
203
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
204
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
205
|
+
en: z.ZodString;
|
|
206
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
207
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
208
|
+
kind: z.ZodLiteral<"multiSelect">;
|
|
209
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
212
|
+
en: z.ZodString;
|
|
213
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
214
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
215
|
+
en: z.ZodString;
|
|
216
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
217
|
+
}, z.core.$strict>>;
|
|
218
|
+
default: z.ZodArray<z.ZodString>;
|
|
219
|
+
id: z.ZodString;
|
|
220
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
221
|
+
en: z.ZodString;
|
|
222
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
223
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
224
|
+
en: z.ZodString;
|
|
225
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
226
|
+
}, z.core.$strict>], "kind">>;
|
|
227
|
+
}, z.core.$strict>>;
|
|
228
|
+
}, z.core.$strip>>>;
|
|
151
229
|
}, z.core.$strip>;
|
|
152
230
|
export type MarketplaceListingDetailVersion = z.infer<typeof MarketplaceListingDetailVersionSchema>;
|
|
153
231
|
export declare const MarketplaceListingDetailSchema: z.ZodObject<{
|
|
@@ -159,6 +237,7 @@ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
|
|
|
159
237
|
priceCents: z.ZodNumber;
|
|
160
238
|
coverImagePath: z.ZodNullable<z.ZodString>;
|
|
161
239
|
compatible: z.ZodBoolean;
|
|
240
|
+
cmsCompatible: z.ZodBoolean;
|
|
162
241
|
installedVersion: z.ZodNullable<z.ZodString>;
|
|
163
242
|
updateAvailable: z.ZodBoolean;
|
|
164
243
|
latestVersion: z.ZodNullable<z.ZodObject<{
|
|
@@ -207,6 +286,83 @@ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
|
|
|
207
286
|
priceCents: z.ZodNumber;
|
|
208
287
|
}, z.core.$strip>>>>;
|
|
209
288
|
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
|
+
installInterface: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
290
|
+
consent: z.ZodArray<z.ZodObject<{
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
details: z.ZodArray<z.ZodString>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
sampleContent: z.ZodNullable<z.ZodObject<{
|
|
295
|
+
default: z.ZodLiteral<true>;
|
|
296
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
297
|
+
en: z.ZodString;
|
|
298
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
299
|
+
}, z.core.$strip>>;
|
|
300
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
301
|
+
id: z.ZodString;
|
|
302
|
+
label: z.ZodString;
|
|
303
|
+
actions: z.ZodArray<z.ZodString>;
|
|
304
|
+
default: z.ZodLiteral<false>;
|
|
305
|
+
}, z.core.$strip>>;
|
|
306
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
307
|
+
id: z.ZodString;
|
|
308
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
309
|
+
en: z.ZodString;
|
|
310
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
311
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
312
|
+
en: z.ZodString;
|
|
313
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
314
|
+
options: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
315
|
+
kind: z.ZodLiteral<"boolean">;
|
|
316
|
+
default: z.ZodBoolean;
|
|
317
|
+
id: z.ZodString;
|
|
318
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
319
|
+
en: z.ZodString;
|
|
320
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
321
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
322
|
+
en: z.ZodString;
|
|
323
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
324
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
325
|
+
kind: z.ZodLiteral<"select">;
|
|
326
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
327
|
+
id: z.ZodString;
|
|
328
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
329
|
+
en: z.ZodString;
|
|
330
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
331
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
332
|
+
en: z.ZodString;
|
|
333
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
334
|
+
}, z.core.$strict>>;
|
|
335
|
+
default: z.ZodOptional<z.ZodString>;
|
|
336
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
337
|
+
id: z.ZodString;
|
|
338
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
339
|
+
en: z.ZodString;
|
|
340
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
341
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
342
|
+
en: z.ZodString;
|
|
343
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
344
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
345
|
+
kind: z.ZodLiteral<"multiSelect">;
|
|
346
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
347
|
+
id: z.ZodString;
|
|
348
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
349
|
+
en: z.ZodString;
|
|
350
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
351
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
352
|
+
en: z.ZodString;
|
|
353
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
354
|
+
}, z.core.$strict>>;
|
|
355
|
+
default: z.ZodArray<z.ZodString>;
|
|
356
|
+
id: z.ZodString;
|
|
357
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
358
|
+
en: z.ZodString;
|
|
359
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
360
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
361
|
+
en: z.ZodString;
|
|
362
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
363
|
+
}, z.core.$strict>], "kind">>;
|
|
364
|
+
}, z.core.$strict>>;
|
|
365
|
+
}, z.core.$strip>>>;
|
|
210
366
|
}, z.core.$strip>>;
|
|
211
367
|
versions: z.ZodArray<z.ZodObject<{
|
|
212
368
|
version: z.ZodString;
|
|
@@ -254,6 +410,83 @@ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
|
|
|
254
410
|
priceCents: z.ZodNumber;
|
|
255
411
|
}, z.core.$strip>>>>;
|
|
256
412
|
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
413
|
+
installInterface: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
414
|
+
consent: z.ZodArray<z.ZodObject<{
|
|
415
|
+
id: z.ZodString;
|
|
416
|
+
details: z.ZodArray<z.ZodString>;
|
|
417
|
+
}, z.core.$strip>>;
|
|
418
|
+
sampleContent: z.ZodNullable<z.ZodObject<{
|
|
419
|
+
default: z.ZodLiteral<true>;
|
|
420
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
421
|
+
en: z.ZodString;
|
|
422
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
423
|
+
}, z.core.$strip>>;
|
|
424
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
425
|
+
id: z.ZodString;
|
|
426
|
+
label: z.ZodString;
|
|
427
|
+
actions: z.ZodArray<z.ZodString>;
|
|
428
|
+
default: z.ZodLiteral<false>;
|
|
429
|
+
}, z.core.$strip>>;
|
|
430
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
431
|
+
id: z.ZodString;
|
|
432
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
433
|
+
en: z.ZodString;
|
|
434
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
435
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
436
|
+
en: z.ZodString;
|
|
437
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
438
|
+
options: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
439
|
+
kind: z.ZodLiteral<"boolean">;
|
|
440
|
+
default: z.ZodBoolean;
|
|
441
|
+
id: z.ZodString;
|
|
442
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
443
|
+
en: z.ZodString;
|
|
444
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
445
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
446
|
+
en: z.ZodString;
|
|
447
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
448
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
449
|
+
kind: z.ZodLiteral<"select">;
|
|
450
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
451
|
+
id: z.ZodString;
|
|
452
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
453
|
+
en: z.ZodString;
|
|
454
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
455
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
456
|
+
en: z.ZodString;
|
|
457
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
458
|
+
}, z.core.$strict>>;
|
|
459
|
+
default: z.ZodOptional<z.ZodString>;
|
|
460
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
461
|
+
id: z.ZodString;
|
|
462
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
463
|
+
en: z.ZodString;
|
|
464
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
465
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
466
|
+
en: z.ZodString;
|
|
467
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
468
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
469
|
+
kind: z.ZodLiteral<"multiSelect">;
|
|
470
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
471
|
+
id: z.ZodString;
|
|
472
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
473
|
+
en: z.ZodString;
|
|
474
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
475
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
476
|
+
en: z.ZodString;
|
|
477
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
478
|
+
}, z.core.$strict>>;
|
|
479
|
+
default: z.ZodArray<z.ZodString>;
|
|
480
|
+
id: z.ZodString;
|
|
481
|
+
label: z.ZodPreprocess<z.ZodObject<{
|
|
482
|
+
en: z.ZodString;
|
|
483
|
+
}, z.core.$catchall<z.ZodString>>>;
|
|
484
|
+
description: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
|
|
485
|
+
en: z.ZodString;
|
|
486
|
+
}, z.core.$catchall<z.ZodString>>>>;
|
|
487
|
+
}, z.core.$strict>], "kind">>;
|
|
488
|
+
}, z.core.$strict>>;
|
|
489
|
+
}, z.core.$strip>>>;
|
|
257
490
|
}, z.core.$strip>>;
|
|
258
491
|
activeDialect: z.ZodString;
|
|
259
492
|
marketplaceBaseUrl: z.ZodString;
|
|
@@ -309,6 +542,7 @@ export declare const MarketplaceListResponseSchema: z.ZodObject<{
|
|
|
309
542
|
hasArtifact: z.ZodBoolean;
|
|
310
543
|
}, z.core.$strip>>;
|
|
311
544
|
compatible: z.ZodBoolean;
|
|
545
|
+
cmsCompatible: z.ZodBoolean;
|
|
312
546
|
installedVersion: z.ZodNullable<z.ZodString>;
|
|
313
547
|
updateAvailable: z.ZodBoolean;
|
|
314
548
|
}, z.core.$strip>>;
|
|
@@ -317,6 +551,55 @@ export declare const MarketplaceListResponseSchema: z.ZodObject<{
|
|
|
317
551
|
marketplaceBaseUrl: z.ZodString;
|
|
318
552
|
}, z.core.$strip>;
|
|
319
553
|
export type MarketplaceListResponse = z.infer<typeof MarketplaceListResponseSchema>;
|
|
554
|
+
/** S294 (2026-10-14-s294-update-available-design.md 3.1): the most plugin ids
|
|
555
|
+
* one GET /api/v1/listings/versions request names. */
|
|
556
|
+
export declare const MARKETPLACE_VERSIONS_MAX_IDS = 50;
|
|
557
|
+
/** The longest `ids` value that route reads before splitting it. A manifest id
|
|
558
|
+
* has no length cap of its own, so a long enough id could make fifty overrun
|
|
559
|
+
* this; the CMS's client therefore sends no id longer than 199 characters,
|
|
560
|
+
* so that fifty of them and their 49 commas (9,999 characters) always fit. */
|
|
561
|
+
export declare const MARKETPLACE_VERSIONS_IDS_MAX_LENGTH = 10000;
|
|
562
|
+
/** What a CMS decides an update with: a listing's latest published version,
|
|
563
|
+
* reduced to four facts. */
|
|
564
|
+
export declare const MarketplaceLatestVersionSchema: z.ZodObject<{
|
|
565
|
+
version: z.ZodString;
|
|
566
|
+
supportedDialects: z.ZodArray<z.ZodString>;
|
|
567
|
+
cmsVersion: z.ZodString;
|
|
568
|
+
hasArtifact: z.ZodBoolean;
|
|
569
|
+
}, z.core.$strip>;
|
|
570
|
+
export type MarketplaceLatestVersion = z.infer<typeof MarketplaceLatestVersionSchema>;
|
|
571
|
+
/** One item per published listing among the ids asked, in the order asked; an
|
|
572
|
+
* id with no published version is absent. Not strict: a key a newer
|
|
573
|
+
* marketplace adds is dropped, never fatal. */
|
|
574
|
+
export declare const MarketplaceVersionsResponseSchema: z.ZodObject<{
|
|
575
|
+
items: z.ZodArray<z.ZodObject<{
|
|
576
|
+
pluginId: z.ZodString;
|
|
577
|
+
latestVersion: z.ZodObject<{
|
|
578
|
+
version: z.ZodString;
|
|
579
|
+
supportedDialects: z.ZodArray<z.ZodString>;
|
|
580
|
+
cmsVersion: z.ZodString;
|
|
581
|
+
hasArtifact: z.ZodBoolean;
|
|
582
|
+
}, z.core.$strip>;
|
|
583
|
+
}, z.core.$strip>>;
|
|
584
|
+
}, z.core.$strip>;
|
|
585
|
+
export type MarketplaceVersionsResponse = z.infer<typeof MarketplaceVersionsResponseSchema>;
|
|
586
|
+
export type ParsedMarketplaceVersionsIds = {
|
|
587
|
+
ok: true;
|
|
588
|
+
ids: string[];
|
|
589
|
+
} | {
|
|
590
|
+
ok: false;
|
|
591
|
+
error: string;
|
|
592
|
+
};
|
|
593
|
+
/** The route's `ids` value, by the table in 3.1: capped before it is split,
|
|
594
|
+
* each entry checked with isPluginManifestId, a repeat answered once, in the
|
|
595
|
+
* place it first appears. The value is untrusted, so the order bounds the
|
|
596
|
+
* cost: the length cap comes before the split and the entry cap before any
|
|
597
|
+
* entry is checked, so the one pattern that runs (isPluginManifestId's, which
|
|
598
|
+
* the install door already applies to untrusted ids) sees at most
|
|
599
|
+
* MARKETPLACE_VERSIONS_MAX_IDS entries and MARKETPLACE_VERSIONS_IDS_MAX_LENGTH
|
|
600
|
+
* characters in all. Both caps count what was sent, before repeats collapse.
|
|
601
|
+
* Nothing is trimmed: a space or an empty entry is a bad id. */
|
|
602
|
+
export declare function parseMarketplaceVersionsIds(raw: string | null): ParsedMarketplaceVersionsIds;
|
|
320
603
|
export declare const MarketplacePluginIdParamsSchema: z.ZodObject<{
|
|
321
604
|
pluginId: z.ZodString;
|
|
322
605
|
}, z.core.$strip>;
|
|
@@ -324,7 +607,12 @@ export declare const MarketplaceInstallBodySchema: z.ZodObject<{
|
|
|
324
607
|
pluginId: z.ZodString;
|
|
325
608
|
version: z.ZodString;
|
|
326
609
|
licenseKey: z.ZodOptional<z.ZodString>;
|
|
327
|
-
|
|
610
|
+
answers: z.ZodOptional<z.ZodObject<{
|
|
611
|
+
sampleContent: z.ZodOptional<z.ZodBoolean>;
|
|
612
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
613
|
+
options: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString>]>>>>;
|
|
614
|
+
}, z.core.$strict>>;
|
|
615
|
+
}, z.core.$strict>;
|
|
328
616
|
export declare const MarketplaceInstallMemberSchema: z.ZodObject<{
|
|
329
617
|
pluginId: z.ZodString;
|
|
330
618
|
version: z.ZodString;
|
|
@@ -367,6 +655,14 @@ export declare const MarketplaceInstallResponseSchema: z.ZodObject<{
|
|
|
367
655
|
status: z.ZodLiteral<"added">;
|
|
368
656
|
count: z.ZodNumber;
|
|
369
657
|
}, z.core.$strip>], "status">>;
|
|
658
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
659
|
+
id: z.ZodString;
|
|
660
|
+
outcome: z.ZodEnum<{
|
|
661
|
+
created: "created";
|
|
662
|
+
"already-exists": "already-exists";
|
|
663
|
+
failed: "failed";
|
|
664
|
+
}>;
|
|
665
|
+
}, z.core.$strip>>>;
|
|
370
666
|
}, z.core.$strip>;
|
|
371
667
|
export type MarketplaceInstallResponse = z.infer<typeof MarketplaceInstallResponseSchema>;
|
|
372
668
|
/** The 409 a marketplace install or update answers. `reason` is present
|
|
@@ -379,3 +675,8 @@ export declare const MarketplaceInstallConflictSchema: z.ZodObject<{
|
|
|
379
675
|
reason: z.ZodOptional<z.ZodLiteral<"license-not-recorded">>;
|
|
380
676
|
}, z.core.$strip>;
|
|
381
677
|
export type MarketplaceInstallConflict = z.infer<typeof MarketplaceInstallConflictSchema>;
|
|
678
|
+
export type MarketplaceListQuery = z.infer<typeof MarketplaceListQuerySchema>;
|
|
679
|
+
/** The parsed side, which is also what a client sends: the schema has no defaults, so `licenseKey` and
|
|
680
|
+
* `answers` stay optional, and `answers.options` keeps its record type (the z.input side of its preprocess
|
|
681
|
+
* would be `unknown`). */
|
|
682
|
+
export type MarketplaceInstallBody = z.infer<typeof MarketplaceInstallBodySchema>;
|