@jigs.design/protocol 0.3.0 → 0.3.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/parse.js CHANGED
@@ -94,7 +94,7 @@ function parseComponentSchema(value) {
94
94
  };
95
95
  }
96
96
  function parseProcedure(value) {
97
- if (!isRecord(value) || value.kind !== "query" && value.kind !== "mutation" && value.kind !== "action" || !isStringList(value.invalidates)) return null;
97
+ if (!isRecord(value) || value.kind !== "query" && value.kind !== "mutation" && value.kind !== "action" && value.kind !== "data" || !isStringList(value.invalidates)) return null;
98
98
  return {
99
99
  invalidates: value.invalidates,
100
100
  kind: value.kind
package/dist/types.d.ts CHANGED
@@ -40,8 +40,11 @@ export interface ComponentSchema {
40
40
  children: ChildrenKind;
41
41
  props: Readonly<Record<string, PropSchema>>;
42
42
  }
43
- /** `action` is a mutation the embedding page handles instead of the server. */
44
- export type ProcedureKind = "action" | "mutation" | "query";
43
+ /**
44
+ * `action` is a mutation the embedding page handles instead of the server;
45
+ * `data` is a slot the page provides, read with `useQuery` and never fetched.
46
+ */
47
+ export type ProcedureKind = "action" | "data" | "mutation" | "query";
45
48
  export interface ProcedureEntry {
46
49
  invalidates: ReadonlyArray<string>;
47
50
  kind: ProcedureKind;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jigs.design/protocol",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "The program format, the diagnostics, and the types and messages the server, the browser and the sandbox share. No runtime and no dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {