@ember-data/model 5.4.0-alpha.5 → 5.4.0-alpha.51

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 (76) hide show
  1. package/addon/-private.js +2 -2
  2. package/addon/has-many-pLEGkRYp.js +655 -0
  3. package/addon/has-many-pLEGkRYp.js.map +1 -0
  4. package/addon/{hooks-62d36619.js → hooks-BAZ34YZ_.js} +34 -15
  5. package/addon/hooks-BAZ34YZ_.js.map +1 -0
  6. package/addon/hooks.js +1 -1
  7. package/addon/index.js +3 -3
  8. package/addon/index.js.map +1 -1
  9. package/addon/migration-support.js +118 -0
  10. package/addon/migration-support.js.map +1 -0
  11. package/addon/{model-e642556d.js → model-8t1PguwE.js} +2037 -1877
  12. package/addon/model-8t1PguwE.js.map +1 -0
  13. package/addon/util-CSYkrwfb.js +35 -0
  14. package/addon/util-CSYkrwfb.js.map +1 -0
  15. package/addon-main.js +1 -0
  16. package/ember-data-logo-dark.svg +12 -0
  17. package/ember-data-logo-light.svg +12 -0
  18. package/package.json +88 -37
  19. package/unstable-preview-types/-private/attr.d.ts +174 -0
  20. package/unstable-preview-types/-private/attr.d.ts.map +1 -0
  21. package/unstable-preview-types/-private/attr.type-test.d.ts +4 -0
  22. package/unstable-preview-types/-private/attr.type-test.d.ts.map +1 -0
  23. package/unstable-preview-types/-private/belongs-to.d.ts +180 -0
  24. package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -0
  25. package/unstable-preview-types/-private/belongs-to.type-test.d.ts +4 -0
  26. package/unstable-preview-types/-private/belongs-to.type-test.d.ts.map +1 -0
  27. package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +8 -0
  28. package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts.map +1 -0
  29. package/unstable-preview-types/-private/errors.d.ts +308 -0
  30. package/unstable-preview-types/-private/errors.d.ts.map +1 -0
  31. package/unstable-preview-types/-private/has-many.d.ts +169 -0
  32. package/unstable-preview-types/-private/has-many.d.ts.map +1 -0
  33. package/unstable-preview-types/-private/has-many.type-test.d.ts +4 -0
  34. package/unstable-preview-types/-private/has-many.type-test.d.ts.map +1 -0
  35. package/unstable-preview-types/-private/hooks.d.ts +13 -0
  36. package/unstable-preview-types/-private/hooks.d.ts.map +1 -0
  37. package/unstable-preview-types/-private/legacy-relationships-support.d.ts +64 -0
  38. package/unstable-preview-types/-private/legacy-relationships-support.d.ts.map +1 -0
  39. package/unstable-preview-types/-private/many-array.d.ts +198 -0
  40. package/unstable-preview-types/-private/many-array.d.ts.map +1 -0
  41. package/unstable-preview-types/-private/model-for-mixin.d.ts +6 -0
  42. package/unstable-preview-types/-private/model-for-mixin.d.ts.map +1 -0
  43. package/unstable-preview-types/-private/model-methods.d.ts +36 -0
  44. package/unstable-preview-types/-private/model-methods.d.ts.map +1 -0
  45. package/unstable-preview-types/-private/model.d.ts +108 -0
  46. package/unstable-preview-types/-private/model.type-test.d.ts +4 -0
  47. package/unstable-preview-types/-private/model.type-test.d.ts.map +1 -0
  48. package/unstable-preview-types/-private/notify-changes.d.ts +8 -0
  49. package/unstable-preview-types/-private/notify-changes.d.ts.map +1 -0
  50. package/unstable-preview-types/-private/promise-belongs-to.d.ts +49 -0
  51. package/unstable-preview-types/-private/promise-belongs-to.d.ts.map +1 -0
  52. package/unstable-preview-types/-private/promise-many-array.d.ts +131 -0
  53. package/unstable-preview-types/-private/promise-many-array.d.ts.map +1 -0
  54. package/unstable-preview-types/-private/promise-proxy-base.d.ts +35 -0
  55. package/unstable-preview-types/-private/record-state.d.ts +91 -0
  56. package/unstable-preview-types/-private/record-state.d.ts.map +1 -0
  57. package/unstable-preview-types/-private/references/belongs-to.d.ts +503 -0
  58. package/unstable-preview-types/-private/references/belongs-to.d.ts.map +1 -0
  59. package/unstable-preview-types/-private/references/has-many.d.ts +515 -0
  60. package/unstable-preview-types/-private/references/has-many.d.ts.map +1 -0
  61. package/unstable-preview-types/-private/schema-provider.d.ts +27 -0
  62. package/unstable-preview-types/-private/schema-provider.d.ts.map +1 -0
  63. package/unstable-preview-types/-private/util.d.ts +11 -0
  64. package/unstable-preview-types/-private/util.d.ts.map +1 -0
  65. package/unstable-preview-types/-private.d.ts +12 -0
  66. package/unstable-preview-types/-private.d.ts.map +1 -0
  67. package/unstable-preview-types/hooks.d.ts +5 -0
  68. package/unstable-preview-types/hooks.d.ts.map +1 -0
  69. package/unstable-preview-types/index.d.ts +75 -0
  70. package/unstable-preview-types/index.d.ts.map +1 -0
  71. package/unstable-preview-types/migration-support.d.ts +11 -0
  72. package/unstable-preview-types/migration-support.d.ts.map +1 -0
  73. package/addon/has-many-d1ca9997.js +0 -507
  74. package/addon/has-many-d1ca9997.js.map +0 -1
  75. package/addon/hooks-62d36619.js.map +0 -1
  76. package/addon/model-e642556d.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"has-many.d.ts","sourceRoot":"","sources":["../../src/-private/has-many.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAkFvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+JE;AACF,wBAAgB,OAAO,IAAI,KAAK,CAAC;AACjC,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;AAC7C,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,mBAAmB,CAAC,CAAC,EAAE,OAAO,CAAC,GACvC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAK5B,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare module '@ember-data/model/-private/has-many.type-test' {
2
+ export {};
3
+ }
4
+ //# sourceMappingURL=has-many.type-test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"has-many.type-test.d.ts","sourceRoot":"","sources":["../../src/-private/has-many.type-test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ declare module '@ember-data/model/-private/hooks' {
2
+ import { type Store } from '@ember-data/store/-private';
3
+ import type { StableRecordIdentifier } from '@warp-drive/core-types';
4
+ import type { TypeFromInstance } from '@warp-drive/core-types/record';
5
+ import type { Model } from '@ember-data/model/-private/model';
6
+ export function instantiateRecord(this: Store, identifier: StableRecordIdentifier, createRecordArgs: {
7
+ [key: string]: unknown;
8
+ }): Model;
9
+ export function teardownRecord(record: Model): void;
10
+ export function modelFor<T>(type: TypeFromInstance<T>): typeof Model | void;
11
+ export function modelFor(type: string): typeof Model | void;
12
+ }
13
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/-private/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoC,KAAK,KAAK,EAAY,MAAM,4BAA4B,CAAC;AACpG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAA4B,MAAM,+BAA+B,CAAC;AAEhG,OAAO,KAAK,EAAE,KAAK,EAAc,MAAM,SAAS,CAAC;AAMjD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,KAAK,EACX,UAAU,EAAE,sBAAsB,EAClC,gBAAgB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GAC3C,KAAK,CAwBP;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,CAMlD;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,GAAG,IAAI,CAAC;AAC5E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,KAAK,GAAG,IAAI,CAAC"}
@@ -0,0 +1,64 @@
1
+ declare module '@ember-data/model/-private/legacy-relationships-support' {
2
+ import type { UpgradedMeta } from '@ember-data/graph/-private/-edge-definition';
3
+ import type { CollectionEdge } from '@ember-data/graph/-private/edges/collection';
4
+ import type { ResourceEdge } from '@ember-data/graph/-private/edges/resource';
5
+ import type { Graph } from '@ember-data/graph/-private/graph';
6
+ import type Store from '@ember-data/store';
7
+ import type { Cache } from '@ember-data/store/-types/q/cache';
8
+ import type { JsonApiRelationship } from '@ember-data/store/-types/q/record-data-json-api';
9
+ import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
10
+ import type { BaseFinderOptions } from '@ember-data/store/-types/q/store';
11
+ import type { StableRecordIdentifier } from '@warp-drive/core-types';
12
+ import type { CollectionRelationship } from '@warp-drive/core-types/cache/relationship';
13
+ import type { LocalRelationshipOperation } from '@warp-drive/core-types/graph';
14
+ import type { CollectionResourceRelationship, SingleResourceRelationship } from '@warp-drive/core-types/spec/raw';
15
+ import type { ManyArray } from '@ember-data/model/-private';
16
+ import RelatedCollection from '@ember-data/model/-private/many-array';
17
+ import type { MinimalLegacyRecord } from '@ember-data/model/-private/model-methods';
18
+ import type { BelongsToProxyCreateArgs } from '@ember-data/model/-private/promise-belongs-to';
19
+ import { PromiseBelongsTo } from '@ember-data/model/-private/promise-belongs-to';
20
+ import type { HasManyProxyCreateArgs } from '@ember-data/model/-private/promise-many-array';
21
+ import PromiseManyArray from '@ember-data/model/-private/promise-many-array';
22
+ import BelongsToReference from '@ember-data/model/-private/references/belongs-to';
23
+ import HasManyReference from '@ember-data/model/-private/references/has-many';
24
+ export const LEGACY_SUPPORT: Map<StableRecordIdentifier | MinimalLegacyRecord, LegacySupport>;
25
+ export function lookupLegacySupport(record: MinimalLegacyRecord): LegacySupport;
26
+ export class LegacySupport {
27
+ record: MinimalLegacyRecord;
28
+ store: Store;
29
+ graph: Graph;
30
+ cache: Cache;
31
+ references: Record<string, BelongsToReference | HasManyReference>;
32
+ identifier: StableRecordIdentifier;
33
+ _manyArrayCache: Record<string, RelatedCollection>;
34
+ _relationshipPromisesCache: Record<string, Promise<RelatedCollection | OpaqueRecordInstance>>;
35
+ _relationshipProxyCache: Record<string, PromiseManyArray | PromiseBelongsTo | undefined>;
36
+ _pending: Record<string, Promise<StableRecordIdentifier | null> | undefined>;
37
+ isDestroying: boolean;
38
+ isDestroyed: boolean;
39
+ constructor(record: MinimalLegacyRecord);
40
+ _syncArray(array: RelatedCollection): void;
41
+ mutate(mutation: LocalRelationshipOperation): void;
42
+ _findBelongsTo(key: string, resource: SingleResourceRelationship, relationship: ResourceEdge, options?: BaseFinderOptions): Promise<OpaqueRecordInstance | null>;
43
+ reloadBelongsTo(key: string, options?: BaseFinderOptions): Promise<OpaqueRecordInstance | null>;
44
+ getBelongsTo(key: string, options?: BaseFinderOptions): PromiseBelongsTo | OpaqueRecordInstance | null;
45
+ setDirtyBelongsTo(key: string, value: OpaqueRecordInstance | null): void;
46
+ _getCurrentState(identifier: StableRecordIdentifier, field: string): [StableRecordIdentifier[], CollectionRelationship];
47
+ getManyArray<T>(key: string, definition?: UpgradedMeta): RelatedCollection<T>;
48
+ fetchAsyncHasMany(key: string, relationship: CollectionEdge, manyArray: RelatedCollection, options?: BaseFinderOptions): Promise<RelatedCollection>;
49
+ reloadHasMany<T>(key: string, options?: BaseFinderOptions): Promise<ManyArray<T>> | PromiseManyArray<T>;
50
+ getHasMany(key: string, options?: BaseFinderOptions): PromiseManyArray | RelatedCollection;
51
+ _updatePromiseProxyFor(kind: 'hasMany', key: string, args: HasManyProxyCreateArgs): PromiseManyArray;
52
+ _updatePromiseProxyFor(kind: 'belongsTo', key: string, args: BelongsToProxyCreateArgs): PromiseBelongsTo;
53
+ _updatePromiseProxyFor(kind: 'belongsTo', key: string, args: {
54
+ promise: Promise<OpaqueRecordInstance | null>;
55
+ }): PromiseBelongsTo;
56
+ referenceFor(kind: 'belongsTo', name: string): BelongsToReference;
57
+ referenceFor(kind: 'hasMany', name: string): HasManyReference;
58
+ _findHasManyByJsonApiResource(resource: CollectionResourceRelationship, parentIdentifier: StableRecordIdentifier, relationship: CollectionEdge, options?: BaseFinderOptions): Promise<void | unknown[]> | void;
59
+ _findBelongsToByJsonApiResource(resource: SingleResourceRelationship, parentIdentifier: StableRecordIdentifier, relationship: ResourceEdge, options?: BaseFinderOptions): Promise<StableRecordIdentifier | null>;
60
+ destroy(): void;
61
+ }
62
+ export function areAllInverseRecordsLoaded(store: Store, resource: JsonApiRelationship): boolean;
63
+ }
64
+ //# sourceMappingURL=legacy-relationships-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-relationships-support.d.ts","sourceRoot":"","sources":["../../src/-private/legacy-relationships-support.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAa,MAAM,kCAAkC,CAAC;AAGzE,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAS3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,KAAK,EAAE,iBAAiB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;CAyBR;AA0GD,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,mBAAmB,GAAG,OAAO,CAgB/F"}
@@ -0,0 +1,198 @@
1
+ declare module '@ember-data/model/-private/many-array' {
2
+ import type Store from '@ember-data/store';
3
+ import type { NativeProxy } from '@ember-data/store/-private';
4
+ import { MUTATE, RecordArray } from '@ember-data/store/-private';
5
+ import type { CreateRecordProperties } from '@ember-data/store/-private/store-service';
6
+ import type { Cache } from '@ember-data/store/-types/q/cache';
7
+ import type { ModelSchema } from '@ember-data/store/-types/q/ds-model';
8
+ import type { BaseFinderOptions } from '@ember-data/store/-types/q/store';
9
+ import type { Signal } from '@ember-data/tracking/-private';
10
+ import type { StableRecordIdentifier } from '@warp-drive/core-types';
11
+ import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
12
+ import type { Links, PaginationLinks } from '@warp-drive/core-types/spec/raw';
13
+ import type { LegacySupport } from '@ember-data/model/-private/legacy-relationships-support';
14
+ export interface ManyArrayCreateArgs {
15
+ identifiers: StableRecordIdentifier[];
16
+ type: string;
17
+ store: Store;
18
+ allowMutation: boolean;
19
+ manager: LegacySupport;
20
+ identifier: StableRecordIdentifier;
21
+ cache: Cache;
22
+ meta: Record<string, unknown> | null;
23
+ links: Links | PaginationLinks | null;
24
+ key: string;
25
+ isPolymorphic: boolean;
26
+ isAsync: boolean;
27
+ _inverseIsAsync: boolean;
28
+ isLoaded: boolean;
29
+ }
30
+ /**
31
+ A `ManyArray` is a `MutableArray` that represents the contents of a has-many
32
+ relationship.
33
+
34
+ The `ManyArray` is instantiated lazily the first time the relationship is
35
+ requested.
36
+
37
+ This class is not intended to be directly instantiated by consuming applications.
38
+
39
+ ### Inverses
40
+
41
+ Often, the relationships in Ember Data applications will have
42
+ an inverse. For example, imagine the following models are
43
+ defined:
44
+
45
+ ```app/models/post.js
46
+ import Model, { hasMany } from '@ember-data/model';
47
+
48
+ export default class PostModel extends Model {
49
+ @hasMany('comment') comments;
50
+ }
51
+ ```
52
+
53
+ ```app/models/comment.js
54
+ import Model, { belongsTo } from '@ember-data/model';
55
+
56
+ export default class CommentModel extends Model {
57
+ @belongsTo('post') post;
58
+ }
59
+ ```
60
+
61
+ If you created a new instance of `Post` and added
62
+ a `Comment` record to its `comments` has-many
63
+ relationship, you would expect the comment's `post`
64
+ property to be set to the post that contained
65
+ the has-many.
66
+
67
+ We call the record to which a relationship belongs-to the
68
+ relationship's _owner_.
69
+
70
+ @class ManyArray
71
+ @public
72
+ */
73
+ export default class RelatedCollection<T = unknown> extends RecordArray<T> {
74
+ isAsync: boolean;
75
+ /**
76
+ The loading state of this array
77
+
78
+ @property {Boolean} isLoaded
79
+ @public
80
+ */
81
+ isLoaded: boolean;
82
+ /**
83
+ `true` if the relationship is polymorphic, `false` otherwise.
84
+
85
+ @property {Boolean} isPolymorphic
86
+ @private
87
+ */
88
+ isPolymorphic: boolean;
89
+ _inverseIsAsync: boolean;
90
+ /**
91
+ Metadata associated with the request for async hasMany relationships.
92
+
93
+ Example
94
+
95
+ Given that the server returns the following JSON payload when fetching a
96
+ hasMany relationship:
97
+
98
+ ```js
99
+ {
100
+ "comments": [{
101
+ "id": 1,
102
+ "comment": "This is the first comment",
103
+ }, {
104
+ // ...
105
+ }],
106
+
107
+ "meta": {
108
+ "page": 1,
109
+ "total": 5
110
+ }
111
+ }
112
+ ```
113
+
114
+ You can then access the meta data via the `meta` property:
115
+
116
+ ```js
117
+ let comments = await post.comments;
118
+ let meta = comments.meta;
119
+
120
+ // meta.page => 1
121
+ // meta.total => 5
122
+ ```
123
+
124
+ @property {Object | null} meta
125
+ @public
126
+ */
127
+ meta: Record<string, unknown> | null;
128
+ /**
129
+ * Retrieve the links for this relationship
130
+ *
131
+ @property {Object | null} links
132
+ @public
133
+ */
134
+ links: Links | PaginationLinks | null;
135
+ identifier: StableRecordIdentifier;
136
+ cache: Cache;
137
+ _manager: LegacySupport;
138
+ store: Store;
139
+ key: string;
140
+ type: ModelSchema;
141
+ modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
142
+ constructor(options: ManyArrayCreateArgs);
143
+ [MUTATE](target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
144
+ notify(): void;
145
+ /**
146
+ Reloads all of the records in the manyArray. If the manyArray
147
+ holds a relationship that was originally fetched using a links url
148
+ EmberData will revisit the original links url to repopulate the
149
+ relationship.
150
+
151
+ If the ManyArray holds the result of a `store.query()` reload will
152
+ re-run the original query.
153
+
154
+ Example
155
+
156
+ ```javascript
157
+ let user = store.peekRecord('user', '1')
158
+ await login(user);
159
+
160
+ let permissions = await user.permissions;
161
+ await permissions.reload();
162
+ ```
163
+
164
+ @method reload
165
+ @public
166
+ */
167
+ reload(options?: BaseFinderOptions): Promise<this>;
168
+ /**
169
+ Saves all of the records in the `ManyArray`.
170
+
171
+ Example
172
+
173
+ ```javascript
174
+ let inbox = await store.findRecord('inbox', '1');
175
+ let messages = await inbox.messages;
176
+ messages.forEach((message) => {
177
+ message.isRead = true;
178
+ });
179
+ messages.save();
180
+ ```
181
+
182
+ @method save
183
+ @public
184
+ @return {PromiseArray} promise
185
+ */
186
+ /**
187
+ Create a child record within the owner
188
+
189
+ @method createRecord
190
+ @public
191
+ @param {Object} hash
192
+ @return {Model} record
193
+ */
194
+ createRecord(hash: CreateRecordProperties<T>): T;
195
+ destroy(): void;
196
+ }
197
+ }
198
+ //# sourceMappingURL=many-array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"many-array.d.ts","sourceRoot":"","sources":["../../src/-private/many-array.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAGL,MAAM,EAEN,WAAW,EAGZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE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EAAE,OAAO,CAAC;IACzB;;;;;QAKI;IAEI,QAAQ,EAAE,OAAO,CAAC;IAC1B;;;;;QAKI;IACI,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoCI;IACI,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7C;;;;;SAKK;IACG,KAAK,EAAE,KAAK,GAAG,eAAe,GAAG,IAAI,CAAC;IACtC,UAAU,EAAE,sBAAsB,CAAC;IACnC,KAAK,EAAE,KAAK,CAAC;IAEb,QAAQ,EAAE,aAAa,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,CAAC,SAAS,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;gBAEpE,OAAO,EAAE,mBAAmB;IASxC,CAAC,MAAM,CAAC,CACN,MAAM,EAAE,sBAAsB,EAAE,EAChC,QAAQ,EAAE,OAAO,WAAW,CAAC,sBAAsB,EAAE,EAAE,CAAC,EAAE,CAAC,EAC3D,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd,OAAO;IA4MV,MAAM;IAON;;;;;;;;;;;;;;;;;;;;;MAqBE;IACF,MAAM,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD;;;;;;;;;;;;;;;;;MAiBE;IAEF;;;;;;;MAOE;IACF,YAAY,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,CAAC;IASvC,OAAO;CAGjB"}
@@ -0,0 +1,6 @@
1
+ declare module '@ember-data/model/-private/model-for-mixin' {
2
+ import type Store from '@ember-data/store';
3
+ import { type ModelFactory } from '@ember-data/model/-private/model';
4
+ export default function modelForMixin(store: Store, normalizedModelName: string): ModelFactory | undefined;
5
+ }
6
+ //# sourceMappingURL=model-for-mixin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-for-mixin.d.ts","sourceRoot":"","sources":["../../src/-private/model-for-mixin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAkBnD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAYzG"}
@@ -0,0 +1,36 @@
1
+ declare module '@ember-data/model/-private/model-methods' {
2
+ import type { Snapshot } from '@ember-data/legacy-compat/-private';
3
+ import type Store from '@ember-data/store';
4
+ import type { ChangedAttributesHash } from '@warp-drive/core-types/cache';
5
+ import { RecordStore } from '@warp-drive/core-types/symbols';
6
+ import type Errors from '@ember-data/model/-private/errors';
7
+ import type RecordState from '@ember-data/model/-private/record-state';
8
+ import type BelongsToReference from '@ember-data/model/-private/references/belongs-to';
9
+ import type HasManyReference from '@ember-data/model/-private/references/has-many';
10
+ export interface MinimalLegacyRecord {
11
+ errors: Errors;
12
+ ___recordState: RecordState;
13
+ currentState: RecordState;
14
+ isDestroyed: boolean;
15
+ isDestroying: boolean;
16
+ isReloading: boolean;
17
+ isValid: boolean;
18
+ [RecordStore]: Store;
19
+ deleteRecord(): void;
20
+ unloadRecord(): void;
21
+ save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
22
+ destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
23
+ }
24
+ export function rollbackAttributes(this: MinimalLegacyRecord): void;
25
+ export function unloadRecord(this: MinimalLegacyRecord): void;
26
+ export function belongsTo(this: MinimalLegacyRecord, prop: string): BelongsToReference;
27
+ export function hasMany(this: MinimalLegacyRecord, prop: string): HasManyReference;
28
+ export function reload<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
29
+ export function changedAttributes<T extends MinimalLegacyRecord>(this: T): ChangedAttributesHash;
30
+ export function serialize<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): unknown;
31
+ export function deleteRecord<T extends MinimalLegacyRecord>(this: T): void;
32
+ export function save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
33
+ export function destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
34
+ export function createSnapshot<T extends MinimalLegacyRecord>(this: T): Snapshot<T>;
35
+ }
36
+ //# sourceMappingURL=model-methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-methods.d.ts","sourceRoot":"","sources":["../../src/-private/model-methods.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAG3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,WAAW,CAAC;IAC5B,YAAY,EAAE,WAAW,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;IAEr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AC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAW1G;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,mBAAmB,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAUnH;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,mBAAmB,EAAE,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAalF"}
@@ -0,0 +1,108 @@
1
+ declare module '@ember-data/model/-private/model' {
2
+ import type EmberObject from '@ember/object';
3
+
4
+ import type { Errors } from '@ember-data/model/-private/errors';
5
+ import type Store from '@ember-data/store';
6
+
7
+ import type { AttributeSchema, RelationshipSchema, RelationshipsSchema } from '@warp-drive/core-types/schema';
8
+ import type { JsonApiError } from '@ember-data/store/-types/q/record-data-json-api';
9
+ import type HasManyReference from '@ember-data/model/-private/references/has-many';
10
+ import type BelongsToReference from '@ember-data/model/-private/references/belongs-to';
11
+ import type { StableRecordIdentifier } from '@warp-drive/core-types';
12
+ import type { LegacySupport } from '@ember-data/model/-private/legacy-relationships-support';
13
+ import type { Cache } from '@warp-drive/core-types/cache';
14
+ import type RecordState from '@ember-data/model/-private/record-state';
15
+
16
+ export type ModelCreateArgs = {
17
+ _createProps: Record<string, unknown>;
18
+ // TODO @deprecate consider deprecating accessing record properties during init which the below is necessary for
19
+ _secretInit: {
20
+ identifier: StableRecordIdentifier;
21
+ cache: Cache;
22
+ store: Store;
23
+ cb: (record: Model, cache: Cache, identifier: StableRecordIdentifier, store: Store) => void;
24
+ };
25
+ };
26
+
27
+ class Model extends EmberObject {
28
+ store: Store;
29
+ errors: Errors;
30
+ currentState: RecordState;
31
+ adapterError?: Error;
32
+ toString(): string;
33
+ save(): Promise<this>;
34
+ hasMany<T extends keyof this & string>(key: T): HasManyReference<this, T>;
35
+ belongsTo<T extends keyof this & string>(key: T): BelongsToReference<this, T>;
36
+ eachRelationship<T extends Model, K extends keyof T & string>(
37
+ callback: (this: T, key: K, meta: RelationshipSchema) => void,
38
+ binding?: T
39
+ ): void;
40
+ eachAttribute<T extends Model, K extends keyof T & string>(
41
+ callback: (this: T, key: K, meta: AttributeSchema) => void,
42
+ binding?: T
43
+ ): void;
44
+ invalidErrorsChanged(errors: JsonApiError[]): void;
45
+ rollbackAttributes(): void;
46
+ changedAttributes(): Record<string, [unknown, unknown]>;
47
+ id: string;
48
+ isValid: boolean;
49
+ isSaving: boolean;
50
+ isNew: boolean;
51
+ isEmpty: boolean;
52
+ isDeleted: boolean;
53
+ hasDirtyAttributes: boolean;
54
+ isLoaded: boolean;
55
+ isLoading: boolean;
56
+ isReloading: boolean;
57
+ dirtyType: string;
58
+ deleteRecord(): void;
59
+ unloadRecord(): void;
60
+ serialize(): Record<string, unknown>;
61
+
62
+ static modelName: string;
63
+ static fields: Map<keyof this & string, 'attribute' | 'belongsTo' | 'hasMany'>;
64
+ static attributes: Map<keyof this & string, AttributeSchema>;
65
+ static relationshipsByName: Map<keyof this & string, RelationshipSchema>;
66
+ static eachAttribute<K extends keyof this & string>(
67
+ callback: (this: ModelSchema<this>, key: K, attribute: AttributeSchema) => void,
68
+ binding?: T
69
+ ): void;
70
+ static eachRelationship<K extends keyof this & string>(
71
+ callback: (this: ModelSchema<this>, key: K, relationship: RelationshipSchema) => void,
72
+ binding?: T
73
+ ): void;
74
+ static eachTransformedAttribute<K extends keyof this & string>(
75
+ callback: (this: ModelSchema<this>, key: K, type: string) => void,
76
+ binding?: T
77
+ ): void;
78
+ static determineRelationshipType(
79
+ knownSide: RelationshipSchema,
80
+ store: Store
81
+ ): 'oneToOne' | 'manyToOne' | 'oneToMany' | 'manyToMany' | 'oneToNone' | 'manyToNone';
82
+
83
+ static toString(): string;
84
+ static isModel: true;
85
+ static relationshipsObject: RelationshipsSchema;
86
+ static extend(...mixins: unknown[]): typeof Model;
87
+ static create(createArgs: ModelCreateArgs): Model;
88
+ static __isMixin?: true;
89
+ static __mixin?: unknown;
90
+ }
91
+
92
+ interface Model {
93
+ constructor: typeof Model;
94
+ }
95
+
96
+ export { Model };
97
+
98
+ export type StaticModel = typeof Model;
99
+
100
+ export const LEGACY_SUPPORT: Map<StableRecordIdentifier | Model, LegacySupport>;
101
+
102
+ export type ModelFactory = { class: StaticModel };
103
+ export type FactoryCache = Record<string, ModelFactory>;
104
+ // we put this on the store for interop because it's used by modelFor and
105
+ // instantiateRecord as well.
106
+ export type ModelStore = Store & { _modelFactoryCache: FactoryCache };
107
+
108
+ }
@@ -0,0 +1,4 @@
1
+ declare module '@ember-data/model/-private/model.type-test' {
2
+ export {};
3
+ }
4
+ //# sourceMappingURL=model.type-test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.type-test.d.ts","sourceRoot":"","sources":["../../src/-private/model.type-test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ declare module '@ember-data/model/-private/notify-changes' {
2
+ import type Store from '@ember-data/store';
3
+ import type { NotificationType } from '@ember-data/store/-private/managers/notification-manager';
4
+ import type { StableRecordIdentifier } from '@warp-drive/core-types';
5
+ import type { Model } from '@ember-data/model/-private/model';
6
+ export default function notifyChanges(identifier: StableRecordIdentifier, value: NotificationType, key: string | undefined, record: Model, store: Store): void;
7
+ }
8
+ //# sourceMappingURL=notify-changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notify-changes.d.ts","sourceRoot":"","sources":["../../src/-private/notify-changes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AACjG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,UAAU,EAAE,sBAAsB,EAClC,KAAK,EAAE,gBAAgB,EACvB,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,MAAM,EAAE,KAAK,EACb,KAAK,EAAE,KAAK,QAuBb"}
@@ -0,0 +1,49 @@
1
+ declare module '@ember-data/model/-private/promise-belongs-to' {
2
+ /// <reference types="ember-source/types" />
3
+ /// <reference types="ember-source/types" />
4
+ import type PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
5
+ import type ObjectProxy from '@ember/object/proxy';
6
+ import type Store from '@ember-data/store';
7
+ import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
8
+ import type { TypeFromInstanceOrString } from '@warp-drive/core-types/record';
9
+ import type { LegacySupport } from '@ember-data/model/-private/legacy-relationships-support';
10
+ export interface BelongsToProxyMeta<T = unknown> {
11
+ key: string;
12
+ store: Store;
13
+ legacySupport: LegacySupport;
14
+ modelName: TypeFromInstanceOrString<T>;
15
+ }
16
+ export interface BelongsToProxyCreateArgs<T = unknown> {
17
+ promise: Promise<T | null>;
18
+ content?: T | null;
19
+ _belongsToState: BelongsToProxyMeta<T>;
20
+ }
21
+ export const LegacyPromiseProxy: unique symbol;
22
+ interface PromiseObjectType<T> extends PromiseProxyMixin<T | null>, ObjectProxy<T> {
23
+ new <PT>(...args: unknown[]): PromiseObjectType<PT>;
24
+ }
25
+ class PromiseObjectType<T> {
26
+ }
27
+ const Extended: PromiseObjectType<OpaqueRecordInstance>;
28
+ /**
29
+ @module @ember-data/model
30
+ */
31
+ /**
32
+ A PromiseBelongsTo is a PromiseObject that also proxies certain method calls
33
+ to the underlying belongsTo model.
34
+ Right now we proxy:
35
+ * `reload()`
36
+ @class PromiseBelongsTo
37
+ @extends PromiseObject
38
+ @private
39
+ */
40
+ class PromiseBelongsTo<T = unknown> extends Extended<T> {
41
+ _belongsToState: BelongsToProxyMeta<T>;
42
+ get id(): string | null;
43
+ get meta(): void;
44
+ reload(options: Record<string, unknown>): Promise<this>;
45
+ [LegacyPromiseProxy]: true;
46
+ }
47
+ export { PromiseBelongsTo };
48
+ }
49
+ //# sourceMappingURL=promise-belongs-to.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promise-belongs-to.d.ts","sourceRoot":"","sources":["../../src/-private/promise-belongs-to.ts"],"names":[],"mappings":";;AAEA,OAAO,KAAK,iBAAiB,MAAM,mCAAmC,CAAC;AACvE,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAEvF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAGpE,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,OAAO;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,wBAAwB,CAAC,CAAC,GAAG,OAAO;IACnD,OAAO,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IACnB,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,kBAAkB,eAAmC,CAAC;AAEnE,UAAU,iBAAiB,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IAEhF,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;CACrD;AAED,OAAO,OAAO,iBAAiB,CA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