@pylonsync/sdk 0.3.304 → 0.3.306
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 +13 -0
- package/package.json +1 -1
- package/src/index.ts +18 -0
package/dist/index.d.ts
CHANGED
|
@@ -275,11 +275,21 @@ export interface EntityDefinition {
|
|
|
275
275
|
indexes?: IndexDefinition[];
|
|
276
276
|
relations?: RelationDefinition[];
|
|
277
277
|
search?: SearchConfig;
|
|
278
|
+
/**
|
|
279
|
+
* Client replication. Default `true` — the entity is bulk-snapshotted +
|
|
280
|
+
* delta-streamed into every client's local replica. Set `false` for a large,
|
|
281
|
+
* server-queried catalog (e.g. a 10k-row product table) the client reaches via
|
|
282
|
+
* `db.useSearch` + by-id fetch instead of holding the whole table locally:
|
|
283
|
+
* `sync: false` keeps it out of the replica entirely. Direct reads
|
|
284
|
+
* (`/api/entities/X`, `/api/search/X`) and policies are unchanged.
|
|
285
|
+
*/
|
|
286
|
+
sync?: boolean;
|
|
278
287
|
}
|
|
279
288
|
export declare function entity(name: string, fields: Record<string, FieldBuilder>, options?: {
|
|
280
289
|
indexes?: IndexDefinition[];
|
|
281
290
|
relations?: RelationDefinition[];
|
|
282
291
|
search?: SearchConfig;
|
|
292
|
+
sync?: boolean;
|
|
283
293
|
}): EntityDefinition;
|
|
284
294
|
export declare function relation(def: RelationDefinition): RelationDefinition;
|
|
285
295
|
export type AuthMode = "public" | "user";
|
|
@@ -452,6 +462,9 @@ export interface ManifestEntity {
|
|
|
452
462
|
facets?: string[];
|
|
453
463
|
sortable?: string[];
|
|
454
464
|
};
|
|
465
|
+
/** Client replication; omitted when true (the default). `false` keeps the
|
|
466
|
+
* entity out of the client replica (snapshot + delta) — server-queried only. */
|
|
467
|
+
sync?: boolean;
|
|
455
468
|
}
|
|
456
469
|
export interface ManifestRoute {
|
|
457
470
|
path: string;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -360,6 +360,15 @@ export interface EntityDefinition {
|
|
|
360
360
|
indexes?: IndexDefinition[];
|
|
361
361
|
relations?: RelationDefinition[];
|
|
362
362
|
search?: SearchConfig;
|
|
363
|
+
/**
|
|
364
|
+
* Client replication. Default `true` — the entity is bulk-snapshotted +
|
|
365
|
+
* delta-streamed into every client's local replica. Set `false` for a large,
|
|
366
|
+
* server-queried catalog (e.g. a 10k-row product table) the client reaches via
|
|
367
|
+
* `db.useSearch` + by-id fetch instead of holding the whole table locally:
|
|
368
|
+
* `sync: false` keeps it out of the replica entirely. Direct reads
|
|
369
|
+
* (`/api/entities/X`, `/api/search/X`) and policies are unchanged.
|
|
370
|
+
*/
|
|
371
|
+
sync?: boolean;
|
|
363
372
|
}
|
|
364
373
|
|
|
365
374
|
export function entity(
|
|
@@ -369,6 +378,7 @@ export function entity(
|
|
|
369
378
|
indexes?: IndexDefinition[];
|
|
370
379
|
relations?: RelationDefinition[];
|
|
371
380
|
search?: SearchConfig;
|
|
381
|
+
sync?: boolean;
|
|
372
382
|
},
|
|
373
383
|
): EntityDefinition {
|
|
374
384
|
return {
|
|
@@ -377,6 +387,7 @@ export function entity(
|
|
|
377
387
|
indexes: options?.indexes,
|
|
378
388
|
relations: options?.relations,
|
|
379
389
|
search: options?.search,
|
|
390
|
+
sync: options?.sync,
|
|
380
391
|
};
|
|
381
392
|
}
|
|
382
393
|
|
|
@@ -606,6 +617,9 @@ export interface ManifestEntity {
|
|
|
606
617
|
facets?: string[];
|
|
607
618
|
sortable?: string[];
|
|
608
619
|
};
|
|
620
|
+
/** Client replication; omitted when true (the default). `false` keeps the
|
|
621
|
+
* entity out of the client replica (snapshot + delta) — server-queried only. */
|
|
622
|
+
sync?: boolean;
|
|
609
623
|
}
|
|
610
624
|
|
|
611
625
|
export interface ManifestRoute {
|
|
@@ -885,6 +899,10 @@ export function entitiesToManifest(
|
|
|
885
899
|
};
|
|
886
900
|
}
|
|
887
901
|
}
|
|
902
|
+
// Emit only when opted OUT — the runtime defaults sync to true.
|
|
903
|
+
if (e.sync === false) {
|
|
904
|
+
result.sync = false;
|
|
905
|
+
}
|
|
888
906
|
return result;
|
|
889
907
|
});
|
|
890
908
|
}
|