@ember-data/legacy-compat 5.3.2 → 5.3.4
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/README.md +8 -0
- package/addon-main.cjs +5 -0
- package/{addon/-private-1aicprWG.js → dist/-private-DVN28hvw.js} +176 -63
- package/dist/-private-DVN28hvw.js.map +1 -0
- package/dist/-private.js +1 -0
- package/dist/builders.js +323 -0
- package/dist/builders.js.map +1 -0
- package/{addon → dist}/index.js +244 -72
- package/dist/index.js.map +1 -0
- package/dist/utils.js +246 -0
- package/dist/utils.js.map +1 -0
- package/package.json +47 -63
- package/unstable-preview-types/-private.d.ts +17 -0
- package/unstable-preview-types/-private.d.ts.map +1 -0
- package/unstable-preview-types/builders/find-all.d.ts +41 -0
- package/unstable-preview-types/builders/find-all.d.ts.map +1 -0
- package/unstable-preview-types/builders/find-record.d.ts +62 -0
- package/unstable-preview-types/builders/find-record.d.ts.map +1 -0
- package/unstable-preview-types/builders/query.d.ts +72 -0
- package/unstable-preview-types/builders/query.d.ts.map +1 -0
- package/unstable-preview-types/builders/save-record.d.ts +40 -0
- package/unstable-preview-types/builders/save-record.d.ts.map +1 -0
- package/unstable-preview-types/builders/utils.d.ts +6 -0
- package/unstable-preview-types/builders/utils.d.ts.map +1 -0
- package/unstable-preview-types/builders.d.ts +18 -0
- package/unstable-preview-types/builders.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +162 -0
- package/unstable-preview-types/index.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/fetch-manager.d.ts +49 -0
- package/unstable-preview-types/legacy-network-handler/fetch-manager.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/identifier-has-id.d.ts +5 -0
- package/unstable-preview-types/legacy-network-handler/identifier-has-id.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/legacy-data-fetch.d.ts +14 -0
- package/unstable-preview-types/legacy-network-handler/legacy-data-fetch.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/legacy-data-utils.d.ts +8 -0
- package/unstable-preview-types/legacy-network-handler/legacy-data-utils.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/legacy-network-handler.d.ts +5 -0
- package/unstable-preview-types/legacy-network-handler/legacy-network-handler.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/minimum-adapter-interface.d.ts +549 -0
- package/unstable-preview-types/legacy-network-handler/minimum-adapter-interface.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/minimum-serializer-interface.d.ts +235 -0
- package/unstable-preview-types/legacy-network-handler/minimum-serializer-interface.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/serializer-response.d.ts +9 -0
- package/unstable-preview-types/legacy-network-handler/serializer-response.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/snapshot-record-array.d.ts +96 -0
- package/unstable-preview-types/legacy-network-handler/snapshot-record-array.d.ts.map +1 -0
- package/unstable-preview-types/legacy-network-handler/snapshot.d.ts +248 -0
- package/unstable-preview-types/legacy-network-handler/snapshot.d.ts.map +1 -0
- package/unstable-preview-types/utils.d.ts +161 -0
- package/unstable-preview-types/utils.d.ts.map +1 -0
- package/addon/-private-1aicprWG.js.map +0 -1
- package/addon/-private.js +0 -1
- package/addon/index.js.map +0 -1
- package/addon-main.js +0 -93
- /package/{addon → dist}/-private.js.map +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare module '@ember-data/legacy-compat/legacy-network-handler/fetch-manager' {
|
|
2
|
+
import { createDeferred } from '@ember-data/request';
|
|
3
|
+
import type Store from '@ember-data/store';
|
|
4
|
+
import type { Request, RequestStateService } from '@ember-data/store/-private';
|
|
5
|
+
import type { FindRecordOptions } from '@ember-data/store/types';
|
|
6
|
+
import type { StableExistingRecordIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
7
|
+
import type { TypeFromInstance } from '@warp-drive/core-types/record';
|
|
8
|
+
import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
|
|
9
|
+
import type { SingleResourceDocument } from '@warp-drive/core-types/spec/json-api-raw';
|
|
10
|
+
import { Snapshot } from '@ember-data/legacy-compat/legacy-network-handler/snapshot';
|
|
11
|
+
type Deferred<T> = ReturnType<typeof createDeferred<T>>;
|
|
12
|
+
export const SaveOp: "___(unique) Symbol(SaveOp)";
|
|
13
|
+
export type FetchMutationOptions = FindRecordOptions & {
|
|
14
|
+
[SaveOp]: 'createRecord' | 'deleteRecord' | 'updateRecord';
|
|
15
|
+
};
|
|
16
|
+
interface PendingFetchItem {
|
|
17
|
+
identifier: StableExistingRecordIdentifier;
|
|
18
|
+
queryRequest: Request;
|
|
19
|
+
resolver: Deferred<any>;
|
|
20
|
+
options: FindRecordOptions;
|
|
21
|
+
trace?: unknown;
|
|
22
|
+
promise: Promise<StableExistingRecordIdentifier>;
|
|
23
|
+
}
|
|
24
|
+
export class FetchManager {
|
|
25
|
+
isDestroyed: boolean;
|
|
26
|
+
requestCache: RequestStateService;
|
|
27
|
+
_pendingFetch: Map<string, Map<StableExistingRecordIdentifier, PendingFetchItem[]>>;
|
|
28
|
+
_store: Store;
|
|
29
|
+
constructor(store: Store);
|
|
30
|
+
createSnapshot<T>(identifier: StableRecordIdentifier<TypeFromInstance<T>>, options?: FindRecordOptions): Snapshot<T>;
|
|
31
|
+
createSnapshot(identifier: StableRecordIdentifier, options?: FindRecordOptions): Snapshot;
|
|
32
|
+
/**
|
|
33
|
+
This method is called by `record.save`, and gets passed a
|
|
34
|
+
resolver for the promise that `record.save` returns.
|
|
35
|
+
|
|
36
|
+
It schedules saving to happen at the end of the run loop.
|
|
37
|
+
|
|
38
|
+
@internal
|
|
39
|
+
*/
|
|
40
|
+
scheduleSave(identifier: StableRecordIdentifier, options: FetchMutationOptions): Promise<null | SingleResourceDocument>;
|
|
41
|
+
scheduleFetch(identifier: StableExistingRecordIdentifier, options: FindRecordOptions, request: ImmutableRequestInfo): Promise<StableExistingRecordIdentifier>;
|
|
42
|
+
getPendingFetch(identifier: StableExistingRecordIdentifier, options: FindRecordOptions): Promise<StableExistingRecordIdentifier<string>> | undefined;
|
|
43
|
+
flushAllPendingFetches(): void;
|
|
44
|
+
fetchDataIfNeededForIdentifier(identifier: StableExistingRecordIdentifier, options: FindRecordOptions<unknown> | undefined, request: ImmutableRequestInfo): Promise<StableExistingRecordIdentifier>;
|
|
45
|
+
destroy(): void;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=fetch-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-manager.d.ts","sourceRoot":"","sources":["../../src/legacy-network-handler/fetch-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAGV,OAAO,EACP,mBAAmB,EAEpB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,yBAAyB,CAAC;AAI9E,OAAO,KAAK,EAAE,8BAA8B,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAA8B,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAQnH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,KAAK,QAAQ,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAMxD,eAAO,MAAM,MAAM,8BAA6C,CAAC;AAEjE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG;IAAE,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,cAAc,GAAG,cAAc,CAA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O;CAGR"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare module '@ember-data/legacy-compat/legacy-network-handler/identifier-has-id' {
|
|
2
|
+
import type { StableExistingRecordIdentifier } from '@warp-drive/core-types/identifier';
|
|
3
|
+
export function assertIdentifierHasId(identifier: unknown): asserts identifier is StableExistingRecordIdentifier;
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=identifier-has-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifier-has-id.d.ts","sourceRoot":"","sources":["../../src/legacy-network-handler/identifier-has-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAC;AAExF,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,IAAI,8BAA8B,CAK/G"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module '@ember-data/legacy-compat/legacy-network-handler/legacy-data-fetch' {
|
|
2
|
+
import type Store from '@ember-data/store';
|
|
3
|
+
import type { BaseFinderOptions } from '@ember-data/store/types';
|
|
4
|
+
import type { StableRecordIdentifier } from '@warp-drive/core-types';
|
|
5
|
+
import type { LegacyRelationshipSchema as RelationshipSchema } from '@warp-drive/core-types/schema/fields';
|
|
6
|
+
import type { MinimumAdapterInterface } from '@ember-data/legacy-compat/legacy-network-handler/minimum-adapter-interface';
|
|
7
|
+
export function _findHasMany(adapter: MinimumAdapterInterface, store: Store, identifier: StableRecordIdentifier, link: string | null | {
|
|
8
|
+
href: string;
|
|
9
|
+
}, relationship: RelationshipSchema, options: BaseFinderOptions): Promise<import("@warp-drive/core-types/identifier").StableExistingRecordIdentifier<string> | import("@warp-drive/core-types/identifier").StableExistingRecordIdentifier<string>[] | null>;
|
|
10
|
+
export function _findBelongsTo(store: Store, identifier: StableRecordIdentifier, link: string | null | {
|
|
11
|
+
href: string;
|
|
12
|
+
}, relationship: RelationshipSchema, options: BaseFinderOptions): Promise<import("@warp-drive/core-types/identifier").StableExistingRecordIdentifier<string> | import("@warp-drive/core-types/identifier").StableExistingRecordIdentifier<string>[] | null>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=legacy-data-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-data-fetch.d.ts","sourceRoot":"","sources":["../../src/legacy-network-handler/legacy-data-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,wBAAwB,IAAI,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAK3G,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E,wBAAgB,YAAY,CAC1B,OAAO,EAAE,uBAAuB,EAChC,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,sBAAsB,EAClC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACtC,YAAY,EAAE,kBAAkB,EAChC,OAAO,EAAE,iBAAiB,6LA0C3B;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,sBAAsB,EAClC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACtC,YAAY,EAAE,kBAAkB,EAChC,OAAO,EAAE,iBAAiB,6LA0C3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare module '@ember-data/legacy-compat/legacy-network-handler/legacy-data-utils' {
|
|
2
|
+
import type { AdapterPayload } from '@ember-data/legacy-compat/legacy-network-handler/minimum-adapter-interface';
|
|
3
|
+
type IteratorCB<T> = ((o: T, index: number) => T) | ((o: T) => T);
|
|
4
|
+
export function iterateData<T>(data: T[] | T, fn: IteratorCB<T>): T | T[];
|
|
5
|
+
export function payloadIsNotBlank<T>(adapterPayload: T | AdapterPayload): adapterPayload is AdapterPayload;
|
|
6
|
+
export {};
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=legacy-data-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-data-utils.d.ts","sourceRoot":"","sources":["../../src/legacy-network-handler/legacy-data-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AAElE,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,WAM9D;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,cAAc,GAAG,cAAc,IAAI,cAAc,CAMzG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-network-handler.d.ts","sourceRoot":"","sources":["../../src/legacy-network-handler/legacy-network-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAU,OAAO,EAAkC,MAAM,qBAAqB,CAAC;AAiD3F,eAAO,MAAM,oBAAoB,EAAE,OAoClC,CAAC"}
|