@velora-cms/api-schemas 0.9.0 → 0.9.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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
// SimpleStorageAPI's HTTP surface (Session 68) —
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
2
|
+
// SimpleStorageAPI's HTTP surface (Session 68) — the SimpleStorageAPI
|
|
3
|
+
// interface is get(contentId, fieldId) / set(contentId, fieldId, value),
|
|
4
|
+
// with pluginId made explicit here as a required 3rd param: this is the
|
|
5
|
+
// lower-level adapter/HTTP surface, not the plugin-facing SDK ergonomics
|
|
6
|
+
// (usePluginValue(), Session 70, resolves pluginId from React context and
|
|
7
|
+
// never asks a plugin author to pass it by hand).
|
|
8
8
|
// Matches FieldDefinition.id's shape (document-type.schema.ts) — same
|
|
9
9
|
// stable key, just scoped to one plugin's stored value for that field.
|
|
10
10
|
const FieldIdSchema = z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/);
|
|
@@ -17,8 +17,8 @@ export const PluginStorageParamsSchema = z.object({
|
|
|
17
17
|
contentId: z.string().uuid(),
|
|
18
18
|
fieldId: FieldIdSchema,
|
|
19
19
|
});
|
|
20
|
-
// `value` is z.unknown(), not a record —
|
|
21
|
-
//
|
|
22
|
-
//
|
|
20
|
+
// `value` is z.unknown(), not a record — SimpleStorageAPI's value is
|
|
21
|
+
// untyped by design; a plugin can store a string, number, array, or
|
|
22
|
+
// object, not only key-value maps.
|
|
23
23
|
export const SetPluginFieldValueRequestSchema = z.object({ value: z.unknown() }).strict();
|
|
24
24
|
export const PluginFieldValueResponseSchema = z.object({ value: z.unknown() });
|
package/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velora-cms/api-schemas",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"description": "Zod schemas for Velora's API shapes — the single source of truth for request/response validation, TypeScript types, and OpenAPI generation.",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22.12"
|
|
8
|
+
},
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/velora-cms/velora/issues"
|
|
11
|
+
},
|
|
5
12
|
"type": "module",
|
|
6
13
|
"main": "dist/index.js",
|
|
7
14
|
"types": "dist/index.d.ts",
|