@pylonsync/sdk 0.3.366 → 0.3.368
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 +25 -0
- package/package.json +1 -1
- package/src/index.ts +31 -0
package/dist/index.d.ts
CHANGED
|
@@ -60,6 +60,19 @@ export interface FieldDefinition {
|
|
|
60
60
|
* intent shows up in the schema.
|
|
61
61
|
*/
|
|
62
62
|
serverOnly?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* When true, the field is stripped from every REPLICATION surface —
|
|
65
|
+
* snapshot pull, delta pull, WS change fanout, `sync=1` cursor
|
|
66
|
+
* fetches — but stays on direct reads (entity get/list, queries,
|
|
67
|
+
* SSR serverData) and inside server functions.
|
|
68
|
+
*
|
|
69
|
+
* This is the "heavy but not secret" modifier: a large JSON/blob
|
|
70
|
+
* column (render plans, slide decks, generated markdown) should not
|
|
71
|
+
* ride into every browser's replica on every sync, but the detail
|
|
72
|
+
* view that needs it can still fetch it by id. Contrast
|
|
73
|
+
* `serverOnly`, which hides a field from ALL client surfaces.
|
|
74
|
+
*/
|
|
75
|
+
syncOmit?: boolean;
|
|
63
76
|
/**
|
|
64
77
|
* When true, the field is **set on insert but cannot be changed
|
|
65
78
|
* by client updates**. The framework rejects any `PATCH`/`PUT`
|
|
@@ -139,6 +152,15 @@ interface FieldBuilder {
|
|
|
139
152
|
* stripeWebhook action.
|
|
140
153
|
*/
|
|
141
154
|
serverOnly(): FieldBuilder;
|
|
155
|
+
/**
|
|
156
|
+
* Keep the field out of client REPLICAS while leaving direct reads
|
|
157
|
+
* intact. See [`FieldDefinition.syncOmit`] for the full semantics.
|
|
158
|
+
*
|
|
159
|
+
* Example: `slidesJson: field.string().syncOmit()` stops a multi-KB
|
|
160
|
+
* render plan from streaming into every browser on every sync; the
|
|
161
|
+
* editor still gets it via `db.get("Variant", id)`.
|
|
162
|
+
*/
|
|
163
|
+
syncOmit(): FieldBuilder;
|
|
142
164
|
/**
|
|
143
165
|
* Mark the field as set-on-insert-only. See [`FieldDefinition.readonly`]
|
|
144
166
|
* for the full semantics.
|
|
@@ -451,6 +473,9 @@ export interface ManifestField {
|
|
|
451
473
|
* [`FieldDefinition.serverOnly`]. Omitted by default so JSON
|
|
452
474
|
* manifests stay compact for unannotated apps. */
|
|
453
475
|
serverOnly?: boolean;
|
|
476
|
+
/** Set when the field is `field.X().syncOmit()` — see
|
|
477
|
+
* [`FieldDefinition.syncOmit`]. Omitted by default. */
|
|
478
|
+
syncOmit?: boolean;
|
|
454
479
|
/** Set when the field is `field.X().readonly()` — see
|
|
455
480
|
* [`FieldDefinition.readonly`]. Omitted by default. */
|
|
456
481
|
readonly?: boolean;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -85,6 +85,19 @@ export interface FieldDefinition {
|
|
|
85
85
|
* intent shows up in the schema.
|
|
86
86
|
*/
|
|
87
87
|
serverOnly?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* When true, the field is stripped from every REPLICATION surface —
|
|
90
|
+
* snapshot pull, delta pull, WS change fanout, `sync=1` cursor
|
|
91
|
+
* fetches — but stays on direct reads (entity get/list, queries,
|
|
92
|
+
* SSR serverData) and inside server functions.
|
|
93
|
+
*
|
|
94
|
+
* This is the "heavy but not secret" modifier: a large JSON/blob
|
|
95
|
+
* column (render plans, slide decks, generated markdown) should not
|
|
96
|
+
* ride into every browser's replica on every sync, but the detail
|
|
97
|
+
* view that needs it can still fetch it by id. Contrast
|
|
98
|
+
* `serverOnly`, which hides a field from ALL client surfaces.
|
|
99
|
+
*/
|
|
100
|
+
syncOmit?: boolean;
|
|
88
101
|
/**
|
|
89
102
|
* When true, the field is **set on insert but cannot be changed
|
|
90
103
|
* by client updates**. The framework rejects any `PATCH`/`PUT`
|
|
@@ -165,6 +178,15 @@ interface FieldBuilder {
|
|
|
165
178
|
* stripeWebhook action.
|
|
166
179
|
*/
|
|
167
180
|
serverOnly(): FieldBuilder;
|
|
181
|
+
/**
|
|
182
|
+
* Keep the field out of client REPLICAS while leaving direct reads
|
|
183
|
+
* intact. See [`FieldDefinition.syncOmit`] for the full semantics.
|
|
184
|
+
*
|
|
185
|
+
* Example: `slidesJson: field.string().syncOmit()` stops a multi-KB
|
|
186
|
+
* render plan from streaming into every browser on every sync; the
|
|
187
|
+
* editor still gets it via `db.get("Variant", id)`.
|
|
188
|
+
*/
|
|
189
|
+
syncOmit(): FieldBuilder;
|
|
168
190
|
/**
|
|
169
191
|
* Mark the field as set-on-insert-only. See [`FieldDefinition.readonly`]
|
|
170
192
|
* for the full semantics.
|
|
@@ -245,6 +267,9 @@ function buildField(def: FieldDefinition): FieldBuilder {
|
|
|
245
267
|
serverOnly() {
|
|
246
268
|
return buildField({ ...def, serverOnly: true });
|
|
247
269
|
},
|
|
270
|
+
syncOmit() {
|
|
271
|
+
return buildField({ ...def, syncOmit: true });
|
|
272
|
+
},
|
|
248
273
|
readonly() {
|
|
249
274
|
return buildField({ ...def, readonly: true });
|
|
250
275
|
},
|
|
@@ -611,6 +636,9 @@ export interface ManifestField {
|
|
|
611
636
|
* [`FieldDefinition.serverOnly`]. Omitted by default so JSON
|
|
612
637
|
* manifests stay compact for unannotated apps. */
|
|
613
638
|
serverOnly?: boolean;
|
|
639
|
+
/** Set when the field is `field.X().syncOmit()` — see
|
|
640
|
+
* [`FieldDefinition.syncOmit`]. Omitted by default. */
|
|
641
|
+
syncOmit?: boolean;
|
|
614
642
|
/** Set when the field is `field.X().readonly()` — see
|
|
615
643
|
* [`FieldDefinition.readonly`]. Omitted by default. */
|
|
616
644
|
readonly?: boolean;
|
|
@@ -903,6 +931,9 @@ export function entitiesToManifest(
|
|
|
903
931
|
if (fb._def.serverOnly) {
|
|
904
932
|
f.serverOnly = true;
|
|
905
933
|
}
|
|
934
|
+
if (fb._def.syncOmit) {
|
|
935
|
+
f.syncOmit = true;
|
|
936
|
+
}
|
|
906
937
|
if (fb._def.readonly) {
|
|
907
938
|
f.readonly = true;
|
|
908
939
|
}
|