@pylonsync/sdk 0.3.376 → 0.3.379

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type RouteMode = "static" | "server" | "live" | "ssr";
2
- export type FieldType = "string" | "int" | "float" | "bool" | "datetime" | "richtext" | `id(${string})`;
2
+ export type FieldType = "string" | "int" | "float" | "bool" | "datetime" | "richtext" | "json" | `id(${string})`;
3
3
  /**
4
4
  * CRDT container override for a field. Wire format is the kebab-case
5
5
  * string each variant maps to (`"text"`, `"counter"`, `"movable-list"`,
@@ -232,6 +232,16 @@ export declare const field: {
232
232
  boolean: () => FieldBuilder;
233
233
  datetime: () => FieldBuilder;
234
234
  richtext: () => FieldBuilder;
235
+ /**
236
+ * Arbitrary JSON value (object, array, or scalar), stored as a real
237
+ * column. Parsed-on-read everywhere: the entity API, `serverData`,
238
+ * `ctx.db`, and sync change events all carry the parsed value — never
239
+ * a string to `JSON.parse` yourself. On CRDT entities the whole value
240
+ * is one LWW register (concurrent writers converge on one writer's
241
+ * value; use `crdt: "list"`/`"tree"` or separate entities for
242
+ * mergeable structure). Not searchable and not encryptable.
243
+ */
244
+ json: () => FieldBuilder;
235
245
  id: (target: string) => FieldBuilder;
236
246
  /**
237
247
  * `field.enum(["pending", "paid", "failed"])` — stored as a string with
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.376",
6
+ "version": "0.3.379",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "types": "./dist/index.d.ts",
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ export type FieldType =
15
15
  | "bool"
16
16
  | "datetime"
17
17
  | "richtext"
18
+ | "json"
18
19
  | `id(${string})`;
19
20
 
20
21
  // ---------------------------------------------------------------------------
@@ -306,6 +307,16 @@ export const field = {
306
307
  boolean: () => createFieldBuilder("bool"),
307
308
  datetime: () => createFieldBuilder("datetime"),
308
309
  richtext: () => createFieldBuilder("richtext"),
310
+ /**
311
+ * Arbitrary JSON value (object, array, or scalar), stored as a real
312
+ * column. Parsed-on-read everywhere: the entity API, `serverData`,
313
+ * `ctx.db`, and sync change events all carry the parsed value — never
314
+ * a string to `JSON.parse` yourself. On CRDT entities the whole value
315
+ * is one LWW register (concurrent writers converge on one writer's
316
+ * value; use `crdt: "list"`/`"tree"` or separate entities for
317
+ * mergeable structure). Not searchable and not encryptable.
318
+ */
319
+ json: () => createFieldBuilder("json"),
309
320
  id: (target: string) => createFieldBuilder(`id(${target})`),
310
321
  /**
311
322
  * `field.enum(["pending", "paid", "failed"])` — stored as a string with