@warp-drive-mirror/experiments 0.0.1-beta.0 → 0.0.1-beta.2

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.
Files changed (48) hide show
  1. package/dist/data-worker.js +3 -3
  2. package/dist/data-worker.js.map +1 -1
  3. package/dist/image-fetch.js +2 -2
  4. package/dist/image-fetch.js.map +1 -1
  5. package/dist/index-Cn3o840t.js +2 -2
  6. package/dist/index-Cn3o840t.js.map +1 -1
  7. package/dist/persisted-cache.js +19 -19
  8. package/dist/persisted-cache.js.map +1 -1
  9. package/dist/worker-fetch.js +2 -2
  10. package/dist/worker-fetch.js.map +1 -1
  11. package/package.json +18 -19
  12. package/unstable-preview-types/data-worker/cache-handler.d.ts +0 -11
  13. package/unstable-preview-types/data-worker/cache-handler.d.ts.map +0 -1
  14. package/unstable-preview-types/data-worker/fetch.d.ts +0 -37
  15. package/unstable-preview-types/data-worker/fetch.d.ts.map +0 -1
  16. package/unstable-preview-types/data-worker/types.d.ts +0 -34
  17. package/unstable-preview-types/data-worker/types.d.ts.map +0 -1
  18. package/unstable-preview-types/data-worker/utils.d.ts +0 -23
  19. package/unstable-preview-types/data-worker/utils.d.ts.map +0 -1
  20. package/unstable-preview-types/data-worker/worker.d.ts +0 -26
  21. package/unstable-preview-types/data-worker/worker.d.ts.map +0 -1
  22. package/unstable-preview-types/data-worker.d.ts +0 -5
  23. package/unstable-preview-types/data-worker.d.ts.map +0 -1
  24. package/unstable-preview-types/document-storage/index.d.ts +0 -93
  25. package/unstable-preview-types/document-storage/index.d.ts.map +0 -1
  26. package/unstable-preview-types/document-storage.d.ts +0 -4
  27. package/unstable-preview-types/document-storage.d.ts.map +0 -1
  28. package/unstable-preview-types/image-fetch.d.ts +0 -4
  29. package/unstable-preview-types/image-fetch.d.ts.map +0 -1
  30. package/unstable-preview-types/image-worker/fetch.d.ts +0 -21
  31. package/unstable-preview-types/image-worker/fetch.d.ts.map +0 -1
  32. package/unstable-preview-types/image-worker/types.d.ts +0 -24
  33. package/unstable-preview-types/image-worker/types.d.ts.map +0 -1
  34. package/unstable-preview-types/image-worker/worker.d.ts +0 -20
  35. package/unstable-preview-types/image-worker/worker.d.ts.map +0 -1
  36. package/unstable-preview-types/image-worker.d.ts +0 -4
  37. package/unstable-preview-types/image-worker.d.ts.map +0 -1
  38. package/unstable-preview-types/index.d.ts +0 -18
  39. package/unstable-preview-types/persisted-cache/cache.d.ts +0 -433
  40. package/unstable-preview-types/persisted-cache/cache.d.ts.map +0 -1
  41. package/unstable-preview-types/persisted-cache/db.d.ts +0 -25
  42. package/unstable-preview-types/persisted-cache/db.d.ts.map +0 -1
  43. package/unstable-preview-types/persisted-cache/fetch.d.ts +0 -11
  44. package/unstable-preview-types/persisted-cache/fetch.d.ts.map +0 -1
  45. package/unstable-preview-types/persisted-cache.d.ts +0 -4
  46. package/unstable-preview-types/persisted-cache.d.ts.map +0 -1
  47. package/unstable-preview-types/worker-fetch.d.ts +0 -4
  48. package/unstable-preview-types/worker-fetch.d.ts.map +0 -1
@@ -1,24 +0,0 @@
1
- declare module '@warp-drive-mirror/experiments/image-worker/types' {
2
- export type SuccessResponseEventData = {
3
- type: 'success-response';
4
- thread: string;
5
- url: string;
6
- };
7
- export type ErrorResponseEventData = {
8
- type: 'error-response';
9
- thread: string;
10
- url: string;
11
- };
12
- export type RequestEventData = {
13
- type: 'load';
14
- thread: string;
15
- url: string;
16
- };
17
- export type ThreadInitEventData = {
18
- type: 'connect';
19
- thread: string;
20
- };
21
- export type MainThreadEvent = MessageEvent<SuccessResponseEventData | ErrorResponseEventData>;
22
- export type WorkerThreadEvent = MessageEvent<RequestEventData> | MessageEvent<ThreadInitEventData>;
23
- }
24
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/image-worker/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,wBAAwB,GAAG,sBAAsB,CAAC,CAAC;AAC9F,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,gBAAgB,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC"}
@@ -1,20 +0,0 @@
1
- declare module '@warp-drive-mirror/experiments/image-worker/worker' {
2
- import type { RequestEventData } from '@warp-drive-mirror/experiments/image-worker/types';
3
- export class ImageWorker {
4
- threads: Map<string, MessagePort>;
5
- pendingImages: Map<string, Promise<string>>;
6
- options: {
7
- persisted: boolean;
8
- };
9
- isSharedWorker: boolean;
10
- cache: Map<string, string>;
11
- constructor(options?: {
12
- persisted: boolean;
13
- });
14
- fetch(url: string): Promise<string>;
15
- initialize(): void;
16
- setupThread(thread: string, port: MessagePort): void;
17
- request(event: RequestEventData): Promise<void>;
18
- }
19
- }
20
- //# sourceMappingURL=worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/image-worker/worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA0C,MAAM,SAAS,CAAC;AAUxF,qBAAa,WAAW;IACd,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEvB,OAAO,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE;IAa5C,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAmBnC,UAAU;IA4BV,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW;IAiBvC,OAAO,CAAC,KAAK,EAAE,gBAAgB;CAOtC"}
@@ -1,4 +0,0 @@
1
- declare module '@warp-drive-mirror/experiments/image-worker' {
2
- export { ImageWorker } from '@warp-drive-mirror/experiments/image-worker/worker';
3
- }
4
- //# sourceMappingURL=image-worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image-worker.d.ts","sourceRoot":"","sources":["../src/image-worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,18 +0,0 @@
1
- /// <reference path="./persisted-cache.d.ts" />
2
- /// <reference path="./data-worker.d.ts" />
3
- /// <reference path="./document-storage.d.ts" />
4
- /// <reference path="./image-fetch.d.ts" />
5
- /// <reference path="./worker-fetch.d.ts" />
6
- /// <reference path="./image-worker.d.ts" />
7
- /// <reference path="./data-worker/types.d.ts" />
8
- /// <reference path="./data-worker/cache-handler.d.ts" />
9
- /// <reference path="./data-worker/worker.d.ts" />
10
- /// <reference path="./data-worker/utils.d.ts" />
11
- /// <reference path="./data-worker/fetch.d.ts" />
12
- /// <reference path="./document-storage/index.d.ts" />
13
- /// <reference path="./image-worker/types.d.ts" />
14
- /// <reference path="./image-worker/worker.d.ts" />
15
- /// <reference path="./image-worker/fetch.d.ts" />
16
- /// <reference path="./persisted-cache/db.d.ts" />
17
- /// <reference path="./persisted-cache/cache.d.ts" />
18
- /// <reference path="./persisted-cache/fetch.d.ts" />
@@ -1,433 +0,0 @@
1
- declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
2
- import type { StableRecordIdentifier } from '@warp-drive-mirror/core-types';
3
- import type { Cache, ChangedAttributesHash, RelationshipDiff } from '@warp-drive-mirror/core-types/cache';
4
- import type { ResourceBlob } from '@warp-drive-mirror/core-types/cache/aliases';
5
- import type { Change } from '@warp-drive-mirror/core-types/cache/change';
6
- import type { Mutation } from '@warp-drive-mirror/core-types/cache/mutations';
7
- import type { Operation } from '@warp-drive-mirror/core-types/cache/operations';
8
- import type { CollectionRelationship, ResourceRelationship } from '@warp-drive-mirror/core-types/cache/relationship';
9
- import type { StableDocumentIdentifier } from '@warp-drive-mirror/core-types/identifier';
10
- import type { Value } from '@warp-drive-mirror/core-types/json/raw';
11
- import type { TypeFromInstanceOrString } from '@warp-drive-mirror/core-types/record';
12
- import type { RequestContext, StructuredDataDocument, StructuredDocument } from '@warp-drive-mirror/core-types/request';
13
- import type { ResourceDocument, SingleResourceDataDocument } from '@warp-drive-mirror/core-types/spec/document';
14
- import type { ApiError } from '@warp-drive-mirror/core-types/spec/error';
15
- /**
16
- * The PersistedCache wraps a Cache to enhance it with
17
- * Persisted Storage capabilities.
18
- *
19
- * @class PersistedCache
20
- * @internal
21
- */
22
- export class PersistedCache implements Cache {
23
- _cache: Cache;
24
- _db: IDBDatabase;
25
- version: '2';
26
- constructor(cache: Cache, db: IDBDatabase);
27
- /**
28
- * Cache the response to a request
29
- *
30
- * Unlike `store.push` which has UPSERT
31
- * semantics, `put` has `replace` semantics similar to
32
- * the `http` method `PUT`
33
- *
34
- * the individually cacheabl
35
- * e resource data it may contain
36
- * should upsert, but the document data surrounding it should
37
- * fully replace any existing information
38
- *
39
- * Note that in order to support inserting arbitrary data
40
- * to the cache that did not originate from a request `put`
41
- * should expect to sometimes encounter a document with only
42
- * a `content` member and therefor must not assume the existence
43
- * of `request` and `response` on the document.
44
- *
45
- * @method put
46
- * @param {StructuredDocument} doc
47
- * @returns {ResourceDocument}
48
- * @internal
49
- */
50
- put<T>(doc: StructuredDocument<T> | {
51
- content: T;
52
- }): ResourceDocument;
53
- /**
54
- * Perform an operation on the cache to update the remote state.
55
- *
56
- * Note: currently the only valid operation is a MergeOperation
57
- * which occurs when a collision of identifiers is detected.
58
- *
59
- * @method patch
60
- * @internal
61
- * @param op the operation to perform
62
- * @returns {void}
63
- */
64
- patch(op: Operation): void;
65
- /**
66
- * Update resource data with a local mutation. Currently supports operations
67
- * on relationships only.
68
- *
69
- * @method mutate
70
- * @internal
71
- * @param mutation
72
- */
73
- mutate(mutation: Mutation): void;
74
- /**
75
- * Peek resource data from the Cache.
76
- *
77
- * In development, if the return value
78
- * is JSON the return value
79
- * will be deep-cloned and deep-frozen
80
- * to prevent mutation thereby enforcing cache
81
- * Immutability.
82
- *
83
- * This form of peek is useful for implementations
84
- * that want to feed raw-data from cache to the UI
85
- * or which want to interact with a blob of data
86
- * directly from the presentation cache.
87
- *
88
- * An implementation might want to do this because
89
- * de-referencing records which read from their own
90
- * blob is generally safer because the record does
91
- * not require retainining connections to the Store
92
- * and Cache to present data on a per-field basis.
93
- *
94
- * This generally takes the place of `getAttr` as
95
- * an API and may even take the place of `getRelationship`
96
- * depending on implementation specifics, though this
97
- * latter usage is less recommended due to the advantages
98
- * of the Graph handling necessary entanglements and
99
- * notifications for relational data.
100
- *
101
- * @method peek
102
- * @internal
103
- * @param {StableRecordIdentifier | StableDocumentIdentifier} identifier
104
- * @returns {ResourceDocument | ResourceBlob | null} the known resource data
105
- */
106
- peek<T = unknown>(identifier: StableRecordIdentifier<TypeFromInstanceOrString<T>>): T | null;
107
- peek(identifier: StableDocumentIdentifier): ResourceDocument | null;
108
- /**
109
- * Peek the Cache for the existing request data associated with
110
- * a cacheable request
111
- *
112
- * @method peekRequest
113
- * @param {StableDocumentIdentifier}
114
- * @returns {StableDocumentIdentifier | null}
115
- * @internal
116
- */
117
- peekRequest(identifier: StableDocumentIdentifier): StructuredDocument<ResourceDocument> | null;
118
- /**
119
- * Push resource data from a remote source into the cache for this identifier
120
- *
121
- * @method upsert
122
- * @internal
123
- * @param identifier
124
- * @param data
125
- * @param hasRecord
126
- * @returns {void | string[]} if `hasRecord` is true then calculated key changes should be returned
127
- */
128
- upsert(identifier: StableRecordIdentifier, data: ResourceBlob, hasRecord: boolean): void | string[];
129
- /**
130
- * Create a fork of the cache from the current state.
131
- *
132
- * Applications should typically not call this method themselves,
133
- * preferring instead to fork at the Store level, which will
134
- * utilize this method to fork the cache.
135
- *
136
- * @method fork
137
- * @internal
138
- * @returns Promise<Cache>
139
- */
140
- fork(): Promise<Cache>;
141
- /**
142
- * Merge a fork back into a parent Cache.
143
- *
144
- * Applications should typically not call this method themselves,
145
- * preferring instead to merge at the Store level, which will
146
- * utilize this method to merge the caches.
147
- *
148
- * @method merge
149
- * @param {Cache} cache
150
- * @internal
151
- * @returns Promise<void>
152
- */
153
- merge(cache: Cache): Promise<void>;
154
- /**
155
- * Generate the list of changes applied to all
156
- * record in the store.
157
- *
158
- * Each individual resource or document that has
159
- * been mutated should be described as an individual
160
- * `Change` entry in the returned array.
161
- *
162
- * A `Change` is described by an object containing up to
163
- * three properties: (1) the `identifier` of the entity that
164
- * changed; (2) the `op` code of that change being one of
165
- * `upsert` or `remove`, and if the op is `upsert` a `patch`
166
- * containing the data to merge into the cache for the given
167
- * entity.
168
- *
169
- * This `patch` is opaque to the Store but should be understood
170
- * by the Cache and may expect to be utilized by an Adapter
171
- * when generating data during a `save` operation.
172
- *
173
- * It is generally recommended that the `patch` contain only
174
- * the updated state, ignoring fields that are unchanged
175
- *
176
- * ```ts
177
- * interface Change {
178
- * identifier: StableRecordIdentifier | StableDocumentIdentifier;
179
- * op: 'upsert' | 'remove';
180
- * patch?: unknown;
181
- * }
182
- * ```
183
- *
184
- * @method diff
185
- * @internal
186
- */
187
- diff(): Promise<Change[]>;
188
- /**
189
- * Serialize the entire contents of the Cache into a Stream
190
- * which may be fed back into a new instance of the same Cache
191
- * via `cache.hydrate`.
192
- *
193
- * @method dump
194
- * @returns {Promise<ReadableStream>}
195
- * @internal
196
- */
197
- dump(): Promise<ReadableStream<unknown>>;
198
- /**
199
- * hydrate a Cache from a Stream with content previously serialized
200
- * from another instance of the same Cache, resolving when hydration
201
- * is complete.
202
- *
203
- * This method should expect to be called both in the context of restoring
204
- * the Cache during application rehydration after SSR **AND** at unknown
205
- * times during the lifetime of an already booted application when it is
206
- * desired to bulk-load additional information into the cache. This latter
207
- * behavior supports optimizing pre/fetching of data for route transitions
208
- * via data-only SSR modes.
209
- *
210
- * @method hydrate
211
- * @param {ReadableStream} stream
212
- * @returns {Promise<void>}
213
- * @internal
214
- */
215
- hydrate(stream: ReadableStream<unknown>): Promise<void>;
216
- /**
217
- * [LIFECYLCE] Signal to the cache that a new record has been instantiated on the client
218
- *
219
- * It returns properties from options that should be set on the record during the create
220
- * process. This return value behavior is deprecated.
221
- *
222
- * @method clientDidCreate
223
- * @internal
224
- * @param identifier
225
- * @param options
226
- */
227
- clientDidCreate(identifier: StableRecordIdentifier, options?: Record<string, unknown>): Record<string, unknown>;
228
- /**
229
- * [LIFECYCLE] Signals to the cache that a resource
230
- * will be part of a save transaction.
231
- *
232
- * @method willCommit
233
- * @internal
234
- * @param identifier
235
- */
236
- willCommit(identifier: StableRecordIdentifier, context: RequestContext): void;
237
- /**
238
- * [LIFECYCLE] Signals to the cache that a resource
239
- * was successfully updated as part of a save transaction.
240
- *
241
- * @method didCommit
242
- * @internal
243
- * @param identifier
244
- * @param data
245
- */
246
- didCommit(identifier: StableRecordIdentifier, result: StructuredDataDocument<unknown>): SingleResourceDataDocument;
247
- /**
248
- * [LIFECYCLE] Signals to the cache that a resource
249
- * was update via a save transaction failed.
250
- *
251
- * @method commitWasRejected
252
- * @internal
253
- * @param identifier
254
- * @param errors
255
- */
256
- commitWasRejected(identifier: StableRecordIdentifier, errors?: ApiError[]): void;
257
- /**
258
- * [LIFECYCLE] Signals to the cache that all data for a resource
259
- * should be cleared.
260
- *
261
- * @method unloadRecord
262
- * @internal
263
- * @param identifier
264
- */
265
- unloadRecord(identifier: StableRecordIdentifier): void;
266
- /**
267
- * Retrieve the data for an attribute from the cache
268
- *
269
- * @method getAttr
270
- * @internal
271
- * @param identifier
272
- * @param propertyName
273
- * @returns {unknown}
274
- */
275
- getAttr(identifier: StableRecordIdentifier, field: string): Value | undefined;
276
- /**
277
- * Mutate the data for an attribute in the cache
278
- *
279
- * @method setAttr
280
- * @internal
281
- * @param identifier
282
- * @param propertyName
283
- * @param value
284
- */
285
- setAttr(identifier: StableRecordIdentifier, propertyName: string, value: Value): void;
286
- /**
287
- * Query the cache for the changed attributes of a resource.
288
- *
289
- * @method changedAttrs
290
- * @internal
291
- * @param identifier
292
- * @returns
293
- */
294
- changedAttrs(identifier: StableRecordIdentifier): ChangedAttributesHash;
295
- /**
296
- * Query the cache for whether any mutated attributes exist
297
- *
298
- * @method hasChangedAttrs
299
- * @internal
300
- * @param identifier
301
- * @returns {boolean}
302
- */
303
- hasChangedAttrs(identifier: StableRecordIdentifier): boolean;
304
- /**
305
- * Tell the cache to discard any uncommitted mutations to attributes
306
- *
307
- * @method rollbackAttrs
308
- * @internal
309
- * @param identifier
310
- * @returns the names of attributes that were restored
311
- */
312
- rollbackAttrs(identifier: StableRecordIdentifier): string[];
313
- /**
314
- * Query the cache for the changes to relationships of a resource.
315
- *
316
- * Returns a map of relationship names to RelationshipDiff objects.
317
- *
318
- * ```ts
319
- * type RelationshipDiff =
320
- | {
321
- kind: 'collection';
322
- remoteState: StableRecordIdentifier[];
323
- additions: Set<StableRecordIdentifier>;
324
- removals: Set<StableRecordIdentifier>;
325
- localState: StableRecordIdentifier[];
326
- reordered: boolean;
327
- }
328
- | {
329
- kind: 'resource';
330
- remoteState: StableRecordIdentifier | null;
331
- localState: StableRecordIdentifier | null;
332
- };
333
- ```
334
- *
335
- * @method changedRelationships
336
- * @public
337
- * @param {StableRecordIdentifier} identifier
338
- * @return {Map<string, RelationshipDiff>}
339
- */
340
- changedRelationships(identifier: StableRecordIdentifier): Map<string, RelationshipDiff>;
341
- /**
342
- * Query the cache for whether any mutated attributes exist
343
- *
344
- * @method hasChangedRelationships
345
- * @public
346
- * @param {StableRecordIdentifier} identifier
347
- * @return {boolean}
348
- */
349
- hasChangedRelationships(identifier: StableRecordIdentifier): boolean;
350
- /**
351
- * Tell the cache to discard any uncommitted mutations to relationships.
352
- *
353
- * This will also discard the change on any appropriate inverses.
354
- *
355
- * This method is a candidate to become a mutation
356
- *
357
- * @method rollbackRelationships
358
- * @public
359
- * @param {StableRecordIdentifier} identifier
360
- * @return {string[]} the names of relationships that were restored
361
- */
362
- rollbackRelationships(identifier: StableRecordIdentifier): string[];
363
- /**
364
- * Query the cache for the current state of a relationship property
365
- *
366
- * @method getRelationship
367
- * @internal
368
- * @param identifier
369
- * @param propertyName
370
- * @returns resource relationship object
371
- */
372
- getRelationship(identifier: StableRecordIdentifier, field: string, isCollection?: boolean): ResourceRelationship | CollectionRelationship;
373
- /**
374
- * Update the cache state for the given resource to be marked as locally deleted,
375
- * or remove such a mark.
376
- *
377
- * @method setIsDeleted
378
- * @internal
379
- * @param identifier
380
- * @param isDeleted
381
- */
382
- setIsDeleted(identifier: StableRecordIdentifier, isDeleted: boolean): void;
383
- /**
384
- * Query the cache for any validation errors applicable to the given resource.
385
- *
386
- * @method getErrors
387
- * @internal
388
- * @param identifier
389
- * @returns
390
- */
391
- getErrors(identifier: StableRecordIdentifier): ApiError[];
392
- /**
393
- * Query the cache for whether a given resource has any available data
394
- *
395
- * @method isEmpty
396
- * @internal
397
- * @param identifier
398
- * @returns {boolean}
399
- */
400
- isEmpty(identifier: StableRecordIdentifier): boolean;
401
- /**
402
- * Query the cache for whether a given resource was created locally and not
403
- * yet persisted.
404
- *
405
- * @method isNew
406
- * @internal
407
- * @param identifier
408
- * @returns {boolean}
409
- */
410
- isNew(identifier: StableRecordIdentifier): boolean;
411
- /**
412
- * Query the cache for whether a given resource is marked as deleted (but not
413
- * necessarily persisted yet).
414
- *
415
- * @method isDeleted
416
- * @internal
417
- * @param identifier
418
- * @returns {boolean}
419
- */
420
- isDeleted(identifier: StableRecordIdentifier): boolean;
421
- /**
422
- * Query the cache for whether a given resource has been deleted and that deletion
423
- * has also been persisted.
424
- *
425
- * @method isDeletionCommitted
426
- * @internal
427
- * @param identifier
428
- * @returns {boolean}
429
- */
430
- isDeletionCommitted(identifier: StableRecordIdentifier): boolean;
431
- }
432
- }
433
- //# sourceMappingURL=cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/persisted-cache/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAC9G,OAAO,KAAK,EAAE,wBAAwB,EAAkC,MAAM,mCAAmC,CAAC;AAClH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,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BAAsB,GAAG,OAAO;IAI5D;;;;;;;OAOG;IACH,aAAa,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,EAAE;IAI3D;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,oBAAoB,CAAC,UAAU,EAAE,sBAAsB,GAAG,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAIvF;;;;;;;OAOG;IACH,uBAAuB,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO;IAIpE;;;;;;;;;;;OAWG;IACH,qBAAqB,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,EAAE;IAOnE;;;;;;;;OAQG;IACH,eAAe,CACb,UAAU,EAAE,sBAAsB,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,OAAO,GACrB,oBAAoB,GAAG,sBAAsB;IAOhD;;;;;;;;OAQG;IACH,YAAY,CAAC,UAAU,EAAE,sBAAsB,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;IAI1E;;;;;;;OAOG;IACH,SAAS,CAAC,UAAU,EAAE,sBAAsB,GAAG,QAAQ,EAAE;IAIzD;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO;IAIpD;;;;;;;;OAQG;IACH,KAAK,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO;IAIlD;;;;;;;;OAQG;IACH,SAAS,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO;IAItD;;;;;;;;OAQG;IACH,mBAAmB,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO;CAGjE"}
@@ -1,25 +0,0 @@
1
- declare module '@warp-drive-mirror/experiments/persisted-cache/db' {
2
- import type { StructuredDocument } from '@ember-data-mirror/request';
3
- import type { ExistingRecordIdentifier } from '@warp-drive-mirror/core-types/identifier';
4
- import type { ResourceDocument } from '@warp-drive-mirror/core-types/spec/document';
5
- import type { ExistingResourceObject } from '@warp-drive-mirror/core-types/spec/json-api-raw';
6
- /**
7
- * Retrieve the configured IndexedDB database instance
8
- *
9
- * @typedoc
10
- */
11
- export function getCache(): Promise<IDBDatabase>;
12
- /**
13
- * Retrieve a previously cached request from the IndexedDB database
14
- * if one exists.
15
- *
16
- * If the request is found, the associated resources will also be
17
- * loaded from the cache and added to the response.
18
- *
19
- * If any resource is not found in the cache, the result will be null.
20
- *
21
- * @typedoc
22
- */
23
- export function getCachedRequest(db: IDBDatabase, lid: string): Promise<StructuredDocument<ResourceDocument<ExistingResourceObject & ExistingRecordIdentifier>> | null>;
24
- }
25
- //# sourceMappingURL=db.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/persisted-cache/db.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AASvF;;;;GAIG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAgBrD;AA4ED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,sBAAsB,GAAG,wBAAwB,CAAC,CAAC,GAAG,IAAI,CAAC,CAiEzG"}
@@ -1,11 +0,0 @@
1
- declare module '@warp-drive-mirror/experiments/persisted-cache/fetch' {
2
- import type { Future, Handler, NextFn, StructuredDataDocument } from '@ember-data-mirror/request';
3
- import type { StoreRequestContext } from '@ember-data-mirror/store';
4
- /**
5
- * A Handler that resolves requests from the persisted cache.
6
- */
7
- export class PersistedFetch implements Handler {
8
- request<T>(context: StoreRequestContext, next: NextFn<T>): Future<T> | Promise<StructuredDataDocument<T>>;
9
- }
10
- }
11
- //# sourceMappingURL=fetch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/persisted-cache/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EAEP,MAAM,EACN,sBAAsB,EAEvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAM7D;;GAEG;AACH,qBAAa,cAAe,YAAW,OAAO;IAC5C,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;CAsE1G"}
@@ -1,4 +0,0 @@
1
- declare module '@warp-drive-mirror/experiments/persisted-cache' {
2
- export { PersistedCache } from '@warp-drive-mirror/experiments/persisted-cache/cache';
3
- }
4
- //# sourceMappingURL=persisted-cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"persisted-cache.d.ts","sourceRoot":"","sources":["../src/persisted-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,4 +0,0 @@
1
- declare module '@warp-drive-mirror/experiments/worker-fetch' {
2
- export { WorkerFetch } from '@warp-drive-mirror/experiments/data-worker/fetch';
3
- }
4
- //# sourceMappingURL=worker-fetch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker-fetch.d.ts","sourceRoot":"","sources":["../src/worker-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC"}