@ember-data/model 5.4.0-alpha.32 → 5.4.0-alpha.34

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 (37) hide show
  1. package/addon/-private.js +1 -1
  2. package/addon/{has-many-Qm5aUQol.js → has-many-Mz5PIxmL.js} +10 -0
  3. package/addon/{has-many-Qm5aUQol.js.map → has-many-Mz5PIxmL.js.map} +1 -1
  4. package/addon/index.js +1 -1
  5. package/addon/model-eXqU5A13.js.map +1 -1
  6. package/package.json +19 -19
  7. package/unstable-preview-types/-private/attr.d.ts +170 -168
  8. package/unstable-preview-types/-private/attr.type-test.d.ts +3 -1
  9. package/unstable-preview-types/-private/belongs-to.d.ts +179 -178
  10. package/unstable-preview-types/-private/belongs-to.d.ts.map +1 -1
  11. package/unstable-preview-types/-private/belongs-to.type-test.d.ts +3 -1
  12. package/unstable-preview-types/-private/debug/assert-polymorphic-type.d.ts +7 -5
  13. package/unstable-preview-types/-private/errors.d.ts +288 -286
  14. package/unstable-preview-types/-private/has-many.d.ts +168 -167
  15. package/unstable-preview-types/-private/has-many.d.ts.map +1 -1
  16. package/unstable-preview-types/-private/has-many.type-test.d.ts +3 -1
  17. package/unstable-preview-types/-private/hooks.d.ts +12 -10
  18. package/unstable-preview-types/-private/legacy-relationships-support.d.ts +60 -58
  19. package/unstable-preview-types/-private/many-array.d.ts +192 -189
  20. package/unstable-preview-types/-private/many-array.d.ts.map +1 -1
  21. package/unstable-preview-types/-private/model-for-mixin.d.ts +5 -3
  22. package/unstable-preview-types/-private/model-methods.d.ts +32 -30
  23. package/unstable-preview-types/-private/model.d.ts +103 -100
  24. package/unstable-preview-types/-private/model.type-test.d.ts +3 -1
  25. package/unstable-preview-types/-private/notify-changes.d.ts +7 -5
  26. package/unstable-preview-types/-private/promise-belongs-to.d.ts +45 -43
  27. package/unstable-preview-types/-private/promise-many-array.d.ts +127 -125
  28. package/unstable-preview-types/-private/promise-proxy-base.d.ts +35 -32
  29. package/unstable-preview-types/-private/record-state.d.ts +86 -84
  30. package/unstable-preview-types/-private/references/belongs-to.d.ts +471 -469
  31. package/unstable-preview-types/-private/references/has-many.d.ts +486 -484
  32. package/unstable-preview-types/-private/schema-provider.d.ts +25 -23
  33. package/unstable-preview-types/-private/util.d.ts +10 -8
  34. package/unstable-preview-types/-private.d.ts +11 -9
  35. package/unstable-preview-types/hooks.d.ts +4 -2
  36. package/unstable-preview-types/index.d.ts +74 -45
  37. package/unstable-preview-types/migration-support.d.ts +10 -8
@@ -1,195 +1,198 @@
1
- import type Store from '@ember-data/store';
2
- import { MUTATE, RecordArray } from '@ember-data/store/-private';
3
- import type { CreateRecordProperties } from '@ember-data/store/-private/store-service';
4
- import type { Cache } from '@ember-data/store/-types/q/cache';
5
- import type { ModelSchema } from '@ember-data/store/-types/q/ds-model';
6
- import type { BaseFinderOptions } from '@ember-data/store/-types/q/store';
7
- import type { Signal } from '@ember-data/tracking/-private';
8
- import type { StableRecordIdentifier } from '@warp-drive/core-types';
9
- import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
10
- import type { Links, PaginationLinks } from '@warp-drive/core-types/spec/raw';
11
- import type { LegacySupport } from './legacy-relationships-support';
12
- export interface ManyArrayCreateArgs {
13
- identifiers: StableRecordIdentifier[];
14
- type: string;
15
- store: Store;
16
- allowMutation: boolean;
17
- manager: LegacySupport;
18
- identifier: StableRecordIdentifier;
19
- cache: Cache;
20
- meta: Record<string, unknown> | null;
21
- links: Links | PaginationLinks | null;
22
- key: string;
23
- isPolymorphic: boolean;
24
- isAsync: boolean;
25
- _inverseIsAsync: boolean;
26
- isLoaded: boolean;
27
- }
28
- /**
29
- A `ManyArray` is a `MutableArray` that represents the contents of a has-many
30
- relationship.
31
-
32
- The `ManyArray` is instantiated lazily the first time the relationship is
33
- requested.
34
-
35
- This class is not intended to be directly instantiated by consuming applications.
36
-
37
- ### Inverses
38
-
39
- Often, the relationships in Ember Data applications will have
40
- an inverse. For example, imagine the following models are
41
- defined:
42
-
43
- ```app/models/post.js
44
- import Model, { hasMany } from '@ember-data/model';
45
-
46
- export default class PostModel extends Model {
47
- @hasMany('comment') comments;
48
- }
49
- ```
50
-
51
- ```app/models/comment.js
52
- import Model, { belongsTo } from '@ember-data/model';
53
-
54
- export default class CommentModel extends Model {
55
- @belongsTo('post') post;
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;
56
29
  }
57
- ```
58
-
59
- If you created a new instance of `Post` and added
60
- a `Comment` record to its `comments` has-many
61
- relationship, you would expect the comment's `post`
62
- property to be set to the post that contained
63
- the has-many.
64
-
65
- We call the record to which a relationship belongs-to the
66
- relationship's _owner_.
67
-
68
- @class ManyArray
69
- @public
70
- */
71
- export default class RelatedCollection<T = unknown> extends RecordArray<T> {
72
- isAsync: boolean;
73
- /**
74
- The loading state of this array
75
-
76
- @property {Boolean} isLoaded
77
- @public
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
+ Ember Data 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
78
166
  */
79
- isLoaded: boolean;
80
- /**
81
- `true` if the relationship is polymorphic, `false` otherwise.
82
-
83
- @property {Boolean} isPolymorphic
84
- @private
167
+ reload(options?: BaseFinderOptions): Promise<unknown> | import("./promise-many-array").default<unknown>;
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
85
185
  */
86
- isPolymorphic: boolean;
87
- _inverseIsAsync: boolean;
88
- /**
89
- Metadata associated with the request for async hasMany relationships.
90
-
91
- Example
92
-
93
- Given that the server returns the following JSON payload when fetching a
94
- hasMany relationship:
95
-
96
- ```js
97
- {
98
- "comments": [{
99
- "id": 1,
100
- "comment": "This is the first comment",
101
- }, {
102
- // ...
103
- }],
104
-
105
- "meta": {
106
- "page": 1,
107
- "total": 5
108
- }
109
- }
110
- ```
111
-
112
- You can then access the meta data via the `meta` property:
113
-
114
- ```js
115
- let comments = await post.comments;
116
- let meta = comments.meta;
117
-
118
- // meta.page => 1
119
- // meta.total => 5
120
- ```
121
-
122
- @property {Object | null} meta
123
- @public
186
+ /**
187
+ Create a child record within the owner
188
+
189
+ @method createRecord
190
+ @public
191
+ @param {Object} hash
192
+ @return {Model} record
124
193
  */
125
- meta: Record<string, unknown> | null;
126
- /**
127
- * Retrieve the links for this relationship
128
- *
129
- @property {Object | null} links
130
- @public
131
- */
132
- links: Links | PaginationLinks | null;
133
- identifier: StableRecordIdentifier;
134
- cache: Cache;
135
- _manager: LegacySupport;
136
- store: Store;
137
- key: string;
138
- type: ModelSchema;
139
- modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
140
- constructor(options: ManyArrayCreateArgs);
141
- [MUTATE](target: StableRecordIdentifier[], receiver: typeof Proxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: Signal): unknown;
142
- notify(): void;
143
- /**
144
- Reloads all of the records in the manyArray. If the manyArray
145
- holds a relationship that was originally fetched using a links url
146
- Ember Data will revisit the original links url to repopulate the
147
- relationship.
148
-
149
- If the manyArray holds the result of a `store.query()` reload will
150
- re-run the original query.
151
-
152
- Example
153
-
154
- ```javascript
155
- let user = store.peekRecord('user', '1')
156
- await login(user);
157
-
158
- let permissions = await user.permissions;
159
- await permissions.reload();
160
- ```
161
-
162
- @method reload
163
- @public
164
- */
165
- reload(options?: BaseFinderOptions): Promise<unknown> | import("./promise-many-array").default<unknown>;
166
- /**
167
- Saves all of the records in the `ManyArray`.
168
-
169
- Example
170
-
171
- ```javascript
172
- let inbox = await store.findRecord('inbox', '1');
173
- let messages = await inbox.messages;
174
- messages.forEach((message) => {
175
- message.isRead = true;
176
- });
177
- messages.save();
178
- ```
179
-
180
- @method save
181
- @public
182
- @return {PromiseArray} promise
183
- */
184
- /**
185
- Create a child record within the owner
186
-
187
- @method createRecord
188
- @public
189
- @param {Object} hash
190
- @return {Model} record
191
- */
192
- createRecord(hash: CreateRecordProperties<T>): T;
193
- destroy(): void;
194
+ createRecord(hash: CreateRecordProperties<T>): T;
195
+ destroy(): void;
196
+ }
194
197
  }
195
198
  //# sourceMappingURL=many-array.d.ts.map
@@ -1 +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,EAGL,MAAM,EAEN,WAAW,EAGZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,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,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;IAKlC;;;;;;;;;;;;;;;;;MAiBE;IAEF;;;;;;;MAOE;IACF,YAAY,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,CAAC;IASvC,OAAO;CAGjB"}
@@ -1,4 +1,6 @@
1
- import type Store from '@ember-data/store';
2
- import { type ModelFactory } from './model';
3
- export default function modelForMixin(store: Store, normalizedModelName: string): ModelFactory | undefined;
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
+ }
4
6
  //# sourceMappingURL=model-for-mixin.d.ts.map
@@ -1,32 +1,34 @@
1
- import type { Snapshot } from '@ember-data/legacy-compat/-private';
2
- import type Store from '@ember-data/store';
3
- import type { ChangedAttributesHash } from '@warp-drive/core-types/cache';
4
- import { RecordStore } from '@warp-drive/core-types/symbols';
5
- import type Errors from './errors';
6
- import type RecordState from './record-state';
7
- export interface MinimalLegacyRecord {
8
- errors: Errors;
9
- ___recordState: RecordState;
10
- currentState: RecordState;
11
- isDestroyed: boolean;
12
- isDestroying: boolean;
13
- isReloading: boolean;
14
- isValid: boolean;
15
- [RecordStore]: Store;
16
- deleteRecord(): void;
17
- unloadRecord(): void;
18
- save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
19
- destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
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
+ export interface MinimalLegacyRecord {
9
+ errors: Errors;
10
+ ___recordState: RecordState;
11
+ currentState: RecordState;
12
+ isDestroyed: boolean;
13
+ isDestroying: boolean;
14
+ isReloading: boolean;
15
+ isValid: boolean;
16
+ [RecordStore]: Store;
17
+ deleteRecord(): void;
18
+ unloadRecord(): void;
19
+ save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
20
+ destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
21
+ }
22
+ export declare function rollbackAttributes(this: MinimalLegacyRecord): void;
23
+ export declare function unloadRecord(this: MinimalLegacyRecord): void;
24
+ export declare function belongsTo(this: MinimalLegacyRecord, prop: string): import("./references/belongs-to").default<unknown, string, unknown> | import("./references/has-many").default<unknown, string, unknown>;
25
+ export declare function hasMany(this: MinimalLegacyRecord, prop: string): import("./references/belongs-to").default<unknown, string, unknown> | import("./references/has-many").default<unknown, string, unknown>;
26
+ export declare function reload<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
27
+ export declare function changedAttributes<T extends MinimalLegacyRecord>(this: T): ChangedAttributesHash;
28
+ export declare function serialize<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): unknown;
29
+ export declare function deleteRecord<T extends MinimalLegacyRecord>(this: T): void;
30
+ export declare function save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
31
+ export declare function destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
32
+ export declare function createSnapshot<T extends MinimalLegacyRecord>(this: T): Snapshot<T>;
20
33
  }
21
- export declare function rollbackAttributes(this: MinimalLegacyRecord): void;
22
- export declare function unloadRecord(this: MinimalLegacyRecord): void;
23
- export declare function belongsTo(this: MinimalLegacyRecord, prop: string): import("./references/belongs-to").default<unknown, string, unknown> | import("./references/has-many").default<unknown, string, unknown>;
24
- export declare function hasMany(this: MinimalLegacyRecord, prop: string): import("./references/belongs-to").default<unknown, string, unknown> | import("./references/has-many").default<unknown, string, unknown>;
25
- export declare function reload<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
26
- export declare function changedAttributes<T extends MinimalLegacyRecord>(this: T): ChangedAttributesHash;
27
- export declare function serialize<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): unknown;
28
- export declare function deleteRecord<T extends MinimalLegacyRecord>(this: T): void;
29
- export declare function save<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
30
- export declare function destroyRecord<T extends MinimalLegacyRecord>(this: T, options?: Record<string, unknown>): Promise<T>;
31
- export declare function createSnapshot<T extends MinimalLegacyRecord>(this: T): Snapshot<T>;
32
34
  //# sourceMappingURL=model-methods.d.ts.map