@carlonicora/nextjs-jsonapi 6.13.1 → 6.14.0
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/{BlockNoteEditor-UBVEUFNR.js → BlockNoteEditor-CUNH4LSQ.js} +25 -25
- package/dist/{BlockNoteEditor-UBVEUFNR.js.map → BlockNoteEditor-CUNH4LSQ.js.map} +1 -1
- package/dist/{BlockNoteEditor-VXMDSQAA.mjs → BlockNoteEditor-QIVV2OB4.mjs} +10 -10
- package/dist/{BlockNoteViewer-2XYASA5Y.js → BlockNoteViewer-APBOPT4B.js} +8 -8
- package/dist/{BlockNoteViewer-2XYASA5Y.js.map → BlockNoteViewer-APBOPT4B.js.map} +1 -1
- package/dist/{BlockNoteViewer-NBW2H6LC.mjs → BlockNoteViewer-HIUAJQRI.mjs} +7 -7
- package/dist/JsonApiRequest-G4J2WTSU.js +26 -0
- package/dist/{JsonApiRequest-WISJZSDE.js.map → JsonApiRequest-G4J2WTSU.js.map} +1 -1
- package/dist/{JsonApiRequest-F6TMJ42G.mjs → JsonApiRequest-IKKHWCPB.mjs} +2 -2
- package/dist/billing/index.js +497 -497
- package/dist/billing/index.mjs +9 -9
- package/dist/{chunk-7DBJTNSU.mjs → chunk-4RPGFQBA.mjs} +2 -2
- package/dist/{chunk-BZ5J2FIV.js → chunk-4XLDBOSE.js} +11 -11
- package/dist/{chunk-BZ5J2FIV.js.map → chunk-4XLDBOSE.js.map} +1 -1
- package/dist/{chunk-27LQDGNP.mjs → chunk-4ZJIUTIV.mjs} +6 -1
- package/dist/chunk-4ZJIUTIV.mjs.map +1 -0
- package/dist/{chunk-PXDUJ47N.js → chunk-6RCZ64BQ.js} +18 -18
- package/dist/{chunk-PXDUJ47N.js.map → chunk-6RCZ64BQ.js.map} +1 -1
- package/dist/{chunk-7JZHPMGW.mjs → chunk-A3RB47X4.mjs} +44 -20
- package/dist/chunk-A3RB47X4.mjs.map +1 -0
- package/dist/{chunk-DOCIFE6A.mjs → chunk-AUD6ZLBB.mjs} +3 -3
- package/dist/{chunk-GB6DBFYY.js → chunk-DGN3PR2F.js} +3 -3
- package/dist/{chunk-GB6DBFYY.js.map → chunk-DGN3PR2F.js.map} +1 -1
- package/dist/{chunk-7ZHTPFFT.js → chunk-DJXSCARG.js} +15 -15
- package/dist/{chunk-7ZHTPFFT.js.map → chunk-DJXSCARG.js.map} +1 -1
- package/dist/{chunk-QKNGZDSQ.js → chunk-GM4VZTWL.js} +2 -2
- package/dist/{chunk-QKNGZDSQ.js.map → chunk-GM4VZTWL.js.map} +1 -1
- package/dist/{chunk-PYRZCKC2.js → chunk-GSRTVIIK.js} +923 -923
- package/dist/{chunk-PYRZCKC2.js.map → chunk-GSRTVIIK.js.map} +1 -1
- package/dist/{chunk-47BBY5KA.mjs → chunk-HAW5PNJG.mjs} +4 -4
- package/dist/{chunk-YRKIFYOE.mjs → chunk-KTGKW72G.mjs} +27 -8
- package/dist/chunk-KTGKW72G.mjs.map +1 -0
- package/dist/{chunk-PV4Z5W6V.js → chunk-KV4N7DEG.js} +19 -19
- package/dist/{chunk-PV4Z5W6V.js.map → chunk-KV4N7DEG.js.map} +1 -1
- package/dist/{chunk-ZLTOUZN2.mjs → chunk-M3N7LPHX.mjs} +4 -4
- package/dist/{chunk-DGWOVYEC.mjs → chunk-MQ7TXALH.mjs} +2 -2
- package/dist/{chunk-W62MHDWM.js → chunk-N5ZE2Z6I.js} +58 -34
- package/dist/chunk-N5ZE2Z6I.js.map +1 -0
- package/dist/{chunk-2SV4SS6N.js → chunk-OQQ7CZWT.js} +12 -12
- package/dist/{chunk-2SV4SS6N.js.map → chunk-OQQ7CZWT.js.map} +1 -1
- package/dist/{chunk-JJMMT24D.mjs → chunk-OUEYZOLB.mjs} +2 -2
- package/dist/{chunk-XXP3TQHF.mjs → chunk-OY65RYD3.mjs} +2 -2
- package/dist/{chunk-MOGEGWXW.js → chunk-PMESKNKL.js} +868 -868
- package/dist/{chunk-MOGEGWXW.js.map → chunk-PMESKNKL.js.map} +1 -1
- package/dist/{chunk-B6JGKDP2.js → chunk-QGVVF77L.js} +48 -29
- package/dist/chunk-QGVVF77L.js.map +1 -0
- package/dist/{chunk-BH6JWIKI.mjs → chunk-QIEF7HIL.mjs} +2 -2
- package/dist/{chunk-P445QGOC.mjs → chunk-RFKSJIQB.mjs} +7 -7
- package/dist/{chunk-6JUCIWDC.mjs → chunk-UOTHRJD2.mjs} +2 -2
- package/dist/{chunk-KMW7UNL2.js → chunk-WCEYT3GG.js} +8 -8
- package/dist/{chunk-KMW7UNL2.js.map → chunk-WCEYT3GG.js.map} +1 -1
- package/dist/{chunk-MHB36MYE.js → chunk-WUNSG3IN.js} +7 -2
- package/dist/chunk-WUNSG3IN.js.map +1 -0
- package/dist/{chunk-N4RZZKL5.mjs → chunk-YKNULEHB.mjs} +12 -12
- package/dist/{chunk-Z4POQWFG.js → chunk-ZYSNJKOP.js} +4 -4
- package/dist/{chunk-Z4POQWFG.js.map → chunk-ZYSNJKOP.js.map} +1 -1
- package/dist/client/index.js +10 -10
- package/dist/client/index.mjs +9 -9
- package/dist/components/index.js +10 -10
- package/dist/components/index.mjs +9 -9
- package/dist/contexts/index.js +10 -10
- package/dist/contexts/index.mjs +9 -9
- package/dist/core/index.js +7 -7
- package/dist/core/index.mjs +6 -6
- package/dist/email-automations/index.js +99 -99
- package/dist/email-automations/index.mjs +9 -9
- package/dist/features/analytics/index.js +126 -126
- package/dist/features/analytics/index.mjs +9 -9
- package/dist/features/analytics/server.js +10 -10
- package/dist/features/analytics/server.mjs +8 -8
- package/dist/features/blog/index.js +156 -156
- package/dist/features/blog/index.mjs +9 -9
- package/dist/features/blog/server.js +28 -28
- package/dist/features/blog/server.mjs +7 -7
- package/dist/features/help/index.js +43 -43
- package/dist/features/help/index.mjs +9 -9
- package/dist/features/tokenusage/index.js +132 -132
- package/dist/features/tokenusage/index.mjs +9 -9
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/{lifecycle-LKGPRBS7.mjs → lifecycle-KI3PCJSE.mjs} +3 -3
- package/dist/lifecycle-TO65I7TO.js +23 -0
- package/dist/{lifecycle-4GUOTB46.js.map → lifecycle-TO65I7TO.js.map} +1 -1
- package/dist/local-transport-4YDJ6FQG.js +15 -0
- package/dist/{local-transport-7H3SPZSA.js.map → local-transport-4YDJ6FQG.js.map} +1 -1
- package/dist/local-transport-C7YTA4I7.mjs +15 -0
- package/dist/offline/index.d.mts +160 -4
- package/dist/offline/index.d.ts +160 -4
- package/dist/offline/index.js +210 -163
- package/dist/offline/index.js.map +1 -1
- package/dist/offline/index.mjs +76 -29
- package/dist/offline/index.mjs.map +1 -1
- package/dist/request-66FGJIHB.mjs +10 -0
- package/dist/request-6W6UGKJV.js +10 -0
- package/dist/{request-KTBV6HHH.js.map → request-6W6UGKJV.js.map} +1 -1
- package/dist/server/index.js +9 -9
- package/dist/server/index.mjs +8 -8
- package/dist/write-through-BAPS24GL.js +15 -0
- package/dist/{write-through-FDQ7N4YI.js.map → write-through-BAPS24GL.js.map} +1 -1
- package/dist/write-through-IWQKXYHE.mjs +15 -0
- package/package.json +1 -1
- package/src/offline/__tests__/generic-answers.spec.ts +146 -3
- package/src/offline/__tests__/local-transport.spec.ts +15 -1
- package/src/offline/__tests__/offline-fixtures.ts +29 -2
- package/src/offline/__tests__/write-through.spec.ts +27 -1
- package/src/offline/config.ts +9 -0
- package/src/offline/generic-answers.ts +44 -17
- package/src/offline/index.ts +2 -0
- package/src/offline/local-transport.ts +5 -3
- package/src/offline/sync/__tests__/runtime.spec.ts +30 -1
- package/src/offline/sync/__tests__/sync-fixtures.ts +22 -0
- package/src/offline/sync/__tests__/sync-root.spec.ts +184 -1
- package/src/offline/sync/known-roots.ts +29 -7
- package/src/offline/sync/runtime.ts +3 -2
- package/src/offline/sync/sync-root.ts +70 -19
- package/src/offline/types.ts +39 -1
- package/src/offline/write-through.ts +6 -3
- package/dist/JsonApiRequest-WISJZSDE.js +0 -26
- package/dist/chunk-27LQDGNP.mjs.map +0 -1
- package/dist/chunk-7JZHPMGW.mjs.map +0 -1
- package/dist/chunk-B6JGKDP2.js.map +0 -1
- package/dist/chunk-MHB36MYE.js.map +0 -1
- package/dist/chunk-W62MHDWM.js.map +0 -1
- package/dist/chunk-YRKIFYOE.mjs.map +0 -1
- package/dist/lifecycle-4GUOTB46.js +0 -23
- package/dist/local-transport-7H3SPZSA.js +0 -15
- package/dist/local-transport-QYFKA6AN.mjs +0 -15
- package/dist/request-KTBV6HHH.js +0 -10
- package/dist/request-SQOUNWZ4.mjs +0 -10
- package/dist/write-through-FDQ7N4YI.js +0 -15
- package/dist/write-through-R25VQMH6.mjs +0 -15
- /package/dist/{BlockNoteEditor-VXMDSQAA.mjs.map → BlockNoteEditor-QIVV2OB4.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-NBW2H6LC.mjs.map → BlockNoteViewer-HIUAJQRI.mjs.map} +0 -0
- /package/dist/{JsonApiRequest-F6TMJ42G.mjs.map → JsonApiRequest-IKKHWCPB.mjs.map} +0 -0
- /package/dist/{chunk-7DBJTNSU.mjs.map → chunk-4RPGFQBA.mjs.map} +0 -0
- /package/dist/{chunk-DOCIFE6A.mjs.map → chunk-AUD6ZLBB.mjs.map} +0 -0
- /package/dist/{chunk-47BBY5KA.mjs.map → chunk-HAW5PNJG.mjs.map} +0 -0
- /package/dist/{chunk-ZLTOUZN2.mjs.map → chunk-M3N7LPHX.mjs.map} +0 -0
- /package/dist/{chunk-DGWOVYEC.mjs.map → chunk-MQ7TXALH.mjs.map} +0 -0
- /package/dist/{chunk-JJMMT24D.mjs.map → chunk-OUEYZOLB.mjs.map} +0 -0
- /package/dist/{chunk-XXP3TQHF.mjs.map → chunk-OY65RYD3.mjs.map} +0 -0
- /package/dist/{chunk-BH6JWIKI.mjs.map → chunk-QIEF7HIL.mjs.map} +0 -0
- /package/dist/{chunk-P445QGOC.mjs.map → chunk-RFKSJIQB.mjs.map} +0 -0
- /package/dist/{chunk-6JUCIWDC.mjs.map → chunk-UOTHRJD2.mjs.map} +0 -0
- /package/dist/{chunk-N4RZZKL5.mjs.map → chunk-YKNULEHB.mjs.map} +0 -0
- /package/dist/{lifecycle-LKGPRBS7.mjs.map → lifecycle-KI3PCJSE.mjs.map} +0 -0
- /package/dist/{local-transport-QYFKA6AN.mjs.map → local-transport-C7YTA4I7.mjs.map} +0 -0
- /package/dist/{request-SQOUNWZ4.mjs.map → request-66FGJIHB.mjs.map} +0 -0
- /package/dist/{write-through-R25VQMH6.mjs.map → write-through-IWQKXYHE.mjs.map} +0 -0
package/dist/offline/index.d.ts
CHANGED
|
@@ -17,6 +17,27 @@ type ApiRequestDataTypeInterface = {
|
|
|
17
17
|
model: new () => any;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
interface JsonApiHydratedDataInterface {
|
|
21
|
+
jsonApi: any;
|
|
22
|
+
included: any[];
|
|
23
|
+
allData?: any[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface ApiDataInterface {
|
|
27
|
+
get included(): any[];
|
|
28
|
+
get type(): string;
|
|
29
|
+
get id(): string;
|
|
30
|
+
get createdAt(): Date;
|
|
31
|
+
get updatedAt(): Date;
|
|
32
|
+
get self(): string | undefined;
|
|
33
|
+
get jsonApi(): any;
|
|
34
|
+
get identifier(): string;
|
|
35
|
+
generateApiUrl(params?: any): string;
|
|
36
|
+
dehydrate(): JsonApiHydratedDataInterface;
|
|
37
|
+
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
38
|
+
createJsonApi(data: any): any;
|
|
39
|
+
}
|
|
40
|
+
|
|
20
41
|
type OfflineChangeResolution = {
|
|
21
42
|
kind: "mine" | "merged";
|
|
22
43
|
/** Per conflicting field: whose value wins. */
|
|
@@ -183,6 +204,46 @@ type OfflineLinkedListFetch = {
|
|
|
183
204
|
id: string;
|
|
184
205
|
}) => string;
|
|
185
206
|
};
|
|
207
|
+
/** One more kind of root record beside `rootModule` (e.g. a notebook). Optional. */
|
|
208
|
+
type OfflineRootKind = {
|
|
209
|
+
/** The module of the root records of this kind. Sync reads `{module}/:rootId/sync`. */
|
|
210
|
+
module: ApiRequestDataTypeInterface;
|
|
211
|
+
/** The ids of the roots of this kind to keep on the device. Throw to keep the device copy unchanged. */
|
|
212
|
+
listSyncRoots: () => Promise<string[]>;
|
|
213
|
+
/**
|
|
214
|
+
* Per record type, the full list endpoint (query string included) that downloads every record of
|
|
215
|
+
* that type under one root of this kind, built from the stored root record. Replaces the type's
|
|
216
|
+
* `fetch` mode under this kind only. Never given `updatedSince`.
|
|
217
|
+
*/
|
|
218
|
+
typeEndpoints?: {
|
|
219
|
+
module: ApiRequestDataTypeInterface;
|
|
220
|
+
endpoint: (root: {
|
|
221
|
+
id: string;
|
|
222
|
+
resource: StoredRecord["resource"];
|
|
223
|
+
}) => string;
|
|
224
|
+
}[];
|
|
225
|
+
/** The module whose model reads this kind's sync answer. Default: the library's `RootSync` module (`root-syncs`). */
|
|
226
|
+
syncModule?: ApiRequestDataTypeInterface;
|
|
227
|
+
};
|
|
228
|
+
type LocalWriteBase = {
|
|
229
|
+
store: DeviceStore;
|
|
230
|
+
module: ApiRequestDataTypeInterface;
|
|
231
|
+
id: string;
|
|
232
|
+
};
|
|
233
|
+
/** What a generic local write (`afterLocalWrite`) did, inside its transaction. */
|
|
234
|
+
type OfflineLocalWriteContext = (LocalWriteBase & {
|
|
235
|
+
method: "POST";
|
|
236
|
+
resource: StoredRecord["resource"];
|
|
237
|
+
previous: null;
|
|
238
|
+
}) | (LocalWriteBase & {
|
|
239
|
+
method: "PUT" | "PATCH";
|
|
240
|
+
resource: StoredRecord["resource"];
|
|
241
|
+
previous: StoredRecord["resource"];
|
|
242
|
+
}) | (LocalWriteBase & {
|
|
243
|
+
method: "DELETE";
|
|
244
|
+
resource: null;
|
|
245
|
+
previous: StoredRecord["resource"];
|
|
246
|
+
});
|
|
186
247
|
type OfflineTypeConfig = {
|
|
187
248
|
module: ApiRequestDataTypeInterface;
|
|
188
249
|
/**
|
|
@@ -205,6 +266,11 @@ type OfflineTypeConfig = {
|
|
|
205
266
|
searchFields?: string[];
|
|
206
267
|
/** The server's order with no `orderBy` (default `updatedAt DESC`). */
|
|
207
268
|
defaultOrderBy?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Called by the generic POST/PUT/PATCH/DELETE local answers inside the same transaction as the
|
|
271
|
+
* write and the enqueue (a throw rolls both back). Never called by sync or write-through.
|
|
272
|
+
*/
|
|
273
|
+
afterLocalWrite?: (ctx: OfflineLocalWriteContext) => Promise<void>;
|
|
208
274
|
};
|
|
209
275
|
type OfflineConfig = {
|
|
210
276
|
getUserId: () => string | undefined;
|
|
@@ -219,6 +285,8 @@ type OfflineConfig = {
|
|
|
219
285
|
routes: OfflineRoute[];
|
|
220
286
|
/** Ids of the root records to keep on the device. */
|
|
221
287
|
listSyncRoots: () => Promise<string[]>;
|
|
288
|
+
/** More kinds of root records beside `rootModule`, each synced and kept on its own (optional). */
|
|
289
|
+
extraRootKinds?: OfflineRootKind[];
|
|
222
290
|
shellPath: (locale: string) => string;
|
|
223
291
|
syncIntervalMs: number;
|
|
224
292
|
/**
|
|
@@ -472,6 +540,92 @@ declare function mergeResource(before: any, identity: {
|
|
|
472
540
|
id: string;
|
|
473
541
|
}, data: ResourceDocumentData): any;
|
|
474
542
|
|
|
543
|
+
declare abstract class AbstractApiData implements ApiDataInterface {
|
|
544
|
+
static identifierFields: string[];
|
|
545
|
+
get identifier(): string;
|
|
546
|
+
protected _jsonApi?: any;
|
|
547
|
+
protected _included?: any[];
|
|
548
|
+
protected _id?: string;
|
|
549
|
+
protected _type?: string;
|
|
550
|
+
protected _createdAt?: Date;
|
|
551
|
+
protected _updatedAt?: Date;
|
|
552
|
+
protected _self?: string;
|
|
553
|
+
get type(): string;
|
|
554
|
+
get id(): string;
|
|
555
|
+
get self(): string | undefined;
|
|
556
|
+
get createdAt(): Date;
|
|
557
|
+
get updatedAt(): Date;
|
|
558
|
+
get included(): any[];
|
|
559
|
+
get jsonApi(): any;
|
|
560
|
+
ingestJsonApi(_data: JsonApiHydratedDataInterface): void;
|
|
561
|
+
generateApiUrl(_params?: any): string;
|
|
562
|
+
createJsonApi(_data?: any): any;
|
|
563
|
+
protected _readIncluded<T extends ApiDataInterface>(data: JsonApiHydratedDataInterface, type: string, dataType: ApiRequestDataTypeInterface): T | T[] | undefined;
|
|
564
|
+
/**
|
|
565
|
+
* Read included relationships with polymorphic type resolution.
|
|
566
|
+
* Determines the correct model class based on the JSON:API type in included data.
|
|
567
|
+
*/
|
|
568
|
+
protected _readIncludedPolymorphic<T extends ApiDataInterface>(data: JsonApiHydratedDataInterface, relationshipKey: string, candidateModules: ApiRequestDataTypeInterface[]): T | T[] | undefined;
|
|
569
|
+
/**
|
|
570
|
+
* Read included relationship data and augment with relationship meta properties.
|
|
571
|
+
* Handles both single relationships (one-to-one) and array relationships (one-to-many).
|
|
572
|
+
*
|
|
573
|
+
* For single relationships: meta is read from `relationships[type].meta`
|
|
574
|
+
* For array relationships: per-item meta is read from `relationships[type].data[].meta`
|
|
575
|
+
*
|
|
576
|
+
* @param data - Hydrated JSON:API data
|
|
577
|
+
* @param type - Relationship type key (e.g., "guide", "persons")
|
|
578
|
+
* @param dataType - Module reference for rehydration
|
|
579
|
+
* @returns Related object(s) augmented with meta properties, or undefined
|
|
580
|
+
*/
|
|
581
|
+
protected _readIncludedWithMeta<T extends ApiDataInterface, M extends Record<string, any>>(data: JsonApiHydratedDataInterface, type: string, dataType: ApiRequestDataTypeInterface): (T & M) | (T & M)[] | undefined;
|
|
582
|
+
/**
|
|
583
|
+
* Copies relationship meta onto a rehydrated entity as own data properties. Object.assign throws
|
|
584
|
+
* when the model declares a getter-only accessor of the same name (an app's `Chunk` with
|
|
585
|
+
* `get relevance()`); an own property shadows that getter, so the model reads the meta value.
|
|
586
|
+
*/
|
|
587
|
+
private static _mergeMeta;
|
|
588
|
+
dehydrate(): JsonApiHydratedDataInterface;
|
|
589
|
+
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
type RootSyncEntry = {
|
|
593
|
+
type: string;
|
|
594
|
+
id: string;
|
|
595
|
+
updatedAt: Date;
|
|
596
|
+
};
|
|
597
|
+
type RootSyncLink = {
|
|
598
|
+
fromType: string;
|
|
599
|
+
fromId: string;
|
|
600
|
+
toType: string;
|
|
601
|
+
toId: string;
|
|
602
|
+
kind: string;
|
|
603
|
+
props: Record<string, unknown>;
|
|
604
|
+
};
|
|
605
|
+
interface RootSyncInterface extends ApiDataInterface {
|
|
606
|
+
get serverTime(): Date;
|
|
607
|
+
get locked(): boolean;
|
|
608
|
+
get lockedFrom(): Date | undefined;
|
|
609
|
+
get entries(): RootSyncEntry[];
|
|
610
|
+
get links(): RootSyncLink[];
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/** The sync answer for one root record (`root-syncs`, id = root record id). Read-only. */
|
|
614
|
+
declare class RootSync extends AbstractApiData implements RootSyncInterface {
|
|
615
|
+
private _serverTime?;
|
|
616
|
+
private _locked;
|
|
617
|
+
private _lockedFrom?;
|
|
618
|
+
private _entries?;
|
|
619
|
+
private _links?;
|
|
620
|
+
get serverTime(): Date;
|
|
621
|
+
get locked(): boolean;
|
|
622
|
+
get lockedFrom(): Date | undefined;
|
|
623
|
+
get entries(): RootSyncEntry[];
|
|
624
|
+
get links(): RootSyncLink[];
|
|
625
|
+
rehydrate(data: JsonApiHydratedDataInterface): this;
|
|
626
|
+
createJsonApi(_data?: any): any;
|
|
627
|
+
}
|
|
628
|
+
|
|
475
629
|
/**
|
|
476
630
|
* Opens the device copy of `userId` (`nja-offline-<userId>.sqlite3` in the OPFS,
|
|
477
631
|
* through the worker). Only one user's file is open at a time: opening another
|
|
@@ -506,10 +660,12 @@ declare function isRootLocked(s: {
|
|
|
506
660
|
* are replaced, and artwork images are downloaded. The sync state is stored only once every
|
|
507
661
|
* fetch succeeded (or answered 403/404). A record with a waiting change is never overwritten.
|
|
508
662
|
*/
|
|
509
|
-
declare function syncRoot(rootId: string): Promise<void>;
|
|
663
|
+
declare function syncRoot(rootId: string, kind?: OfflineRootKind): Promise<void>;
|
|
510
664
|
/**
|
|
511
|
-
* Syncs every root record `listSyncRoots()`
|
|
512
|
-
*
|
|
665
|
+
* Syncs every root record of every kind (`listSyncRoots()` of the primary kind and of each
|
|
666
|
+
* `extraRootKinds` entry), then removes from the device the known root records no kind lists
|
|
667
|
+
* (unless they still have waiting changes). A kind whose list throws keeps its device copy
|
|
668
|
+
* unchanged; the primary kind's list throwing stops the sync. Does nothing offline.
|
|
513
669
|
*/
|
|
514
670
|
declare function syncAll(): Promise<void>;
|
|
515
671
|
|
|
@@ -604,4 +760,4 @@ declare function turnOffOffline(): Promise<{
|
|
|
604
760
|
pending: number;
|
|
605
761
|
}>;
|
|
606
762
|
|
|
607
|
-
export { type Conflict, type ConflictChoice, type ConflictKind, DEFAULT_DEVICE_WORKER_URL, DEFAULT_SQLITE_MODULE_URL, DEVICE_WORKER_FILE, type DeviceStore, DeviceStoreUnavailableError, type DrainResult, type ListOptions, type LocalAnswer, type LocalAnswerContext, NeedsConnectionError, OFFLINE_REPLAY_HEADER, OFFLINE_SQLITE_FILES, type OfflineAnswer, type OfflineChangeResolution, type OfflineConfig, type OfflineLinkedListFetch, type OfflineMethod, type OfflineRequest, type OfflineRoute, type OfflineState, type OfflineTypeConfig, OfflineUnavailableError, type PatternSegment, type QueueEntry, type QueueResolution, type QueueStatus, type ResourceDocumentData, type RouteMatch, SERVER_DEFAULT_ORDER_BY, type SkippedRecord, type StoredLink, type StoredRecord, type SyncState, configureOffline, deleteDeviceStore, drainQueue, errorAnswer, finishOfflineLogout, forgetOfflineStore, getOfflineConfig, getOfflineState, getOfflineStore, hasUnsentChanges, includedFor, isOfflineAvailable, isOfflineConfigured, isOfflineEnabledOnDevice, isRootLocked, linkKindFor, linkKindsOf, linksOfKind, listAnswer, localTransport, matchPattern, matchRoute, mergeResource, needsConnectionAnswer, notFoundAnswer, onUserSignedIn, openDeviceStore, openMemoryDeviceStore, orderRecords, orderedListAnswer, patternToString, prepareOfflineLogout, refreshOfflineDeviceState, resolveConflict, resourceFromDocument, resourceListAnswer, searchRecords, setDeviceStoreOpener, setOfflineState, singleAnswer, startOfflineRuntime, stopOfflineRuntime, subscribeOfflineState, syncAll, syncRoot, turnOffOffline, turnOnOffline, useConflicts, useNeedsConnection, useOfflineState, writeThrough };
|
|
763
|
+
export { type Conflict, type ConflictChoice, type ConflictKind, DEFAULT_DEVICE_WORKER_URL, DEFAULT_SQLITE_MODULE_URL, DEVICE_WORKER_FILE, type DeviceStore, DeviceStoreUnavailableError, type DrainResult, type ListOptions, type LocalAnswer, type LocalAnswerContext, NeedsConnectionError, OFFLINE_REPLAY_HEADER, OFFLINE_SQLITE_FILES, type OfflineAnswer, type OfflineChangeResolution, type OfflineConfig, type OfflineLinkedListFetch, type OfflineLocalWriteContext, type OfflineMethod, type OfflineRequest, type OfflineRootKind, type OfflineRoute, type OfflineState, type OfflineTypeConfig, OfflineUnavailableError, type PatternSegment, type QueueEntry, type QueueResolution, type QueueStatus, type ResourceDocumentData, RootSync, type RouteMatch, SERVER_DEFAULT_ORDER_BY, type SkippedRecord, type StoredLink, type StoredRecord, type SyncState, configureOffline, deleteDeviceStore, drainQueue, errorAnswer, finishOfflineLogout, forgetOfflineStore, getOfflineConfig, getOfflineState, getOfflineStore, hasUnsentChanges, includedFor, isOfflineAvailable, isOfflineConfigured, isOfflineEnabledOnDevice, isRootLocked, linkKindFor, linkKindsOf, linksOfKind, listAnswer, localTransport, matchPattern, matchRoute, mergeResource, needsConnectionAnswer, notFoundAnswer, onUserSignedIn, openDeviceStore, openMemoryDeviceStore, orderRecords, orderedListAnswer, patternToString, prepareOfflineLogout, refreshOfflineDeviceState, resolveConflict, resourceFromDocument, resourceListAnswer, searchRecords, setDeviceStoreOpener, setOfflineState, singleAnswer, startOfflineRuntime, stopOfflineRuntime, subscribeOfflineState, syncAll, syncRoot, turnOffOffline, turnOnOffline, useConflicts, useNeedsConnection, useOfflineState, writeThrough };
|