@ember-data/store 5.5.0-alpha.9 → 5.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE.md +19 -7
  2. package/README.md +21 -12
  3. package/addon-main.cjs +5 -0
  4. package/dist/-private.js +2 -0
  5. package/{addon → dist}/-private.js.map +1 -1
  6. package/dist/configure-BfLLW6GY.js +161 -0
  7. package/dist/configure-BfLLW6GY.js.map +1 -0
  8. package/dist/configure.js +1 -0
  9. package/dist/configure.js.map +1 -0
  10. package/dist/index.js +5 -0
  11. package/{addon → dist}/index.js.map +1 -1
  12. package/dist/request-state-uRtpn0Lc.js +7709 -0
  13. package/dist/request-state-uRtpn0Lc.js.map +1 -0
  14. package/dist/types.js +0 -0
  15. package/dist/types.js.map +1 -0
  16. package/logos/NCC-1701-a-blue.svg +4 -0
  17. package/logos/NCC-1701-a-gold.svg +4 -0
  18. package/logos/NCC-1701-a-gold_100.svg +1 -0
  19. package/logos/NCC-1701-a-gold_base-64.txt +1 -0
  20. package/logos/NCC-1701-a.svg +4 -0
  21. package/logos/README.md +4 -0
  22. package/logos/docs-badge.svg +2 -0
  23. package/logos/github-header.svg +444 -0
  24. package/logos/social1.png +0 -0
  25. package/logos/social2.png +0 -0
  26. package/logos/warp-drive-logo-dark.svg +4 -0
  27. package/logos/warp-drive-logo-gold.svg +4 -0
  28. package/package.json +66 -53
  29. package/unstable-preview-types/-private/cache-handler/handler.d.ts +62 -0
  30. package/unstable-preview-types/-private/cache-handler/handler.d.ts.map +1 -0
  31. package/unstable-preview-types/-private/cache-handler/types.d.ts +107 -0
  32. package/unstable-preview-types/-private/cache-handler/types.d.ts.map +1 -0
  33. package/unstable-preview-types/-private/cache-handler/utils.d.ts +34 -0
  34. package/unstable-preview-types/-private/cache-handler/utils.d.ts.map +1 -0
  35. package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -0
  36. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -0
  37. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +180 -0
  38. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
  39. package/unstable-preview-types/-private/caches/instance-cache.d.ts +64 -0
  40. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -0
  41. package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -0
  42. package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +1 -0
  43. package/unstable-preview-types/-private/debug/utils.d.ts +9 -0
  44. package/unstable-preview-types/-private/debug/utils.d.ts.map +1 -0
  45. package/unstable-preview-types/-private/document.d.ts +155 -0
  46. package/unstable-preview-types/-private/document.d.ts.map +1 -0
  47. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +179 -0
  48. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -0
  49. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -0
  50. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -0
  51. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +31 -0
  52. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -0
  53. package/unstable-preview-types/-private/managers/cache-manager.d.ts +463 -0
  54. package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -0
  55. package/unstable-preview-types/-private/managers/notification-manager.d.ts +101 -0
  56. package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -0
  57. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +101 -0
  58. package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -0
  59. package/unstable-preview-types/-private/network/request-cache.d.ts +109 -0
  60. package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -0
  61. package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts +289 -0
  62. package/unstable-preview-types/-private/new-core-tmp/promise-state.d.ts.map +1 -0
  63. package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts +92 -0
  64. package/unstable-preview-types/-private/new-core-tmp/reactivity/configure.d.ts.map +1 -0
  65. package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts +172 -0
  66. package/unstable-preview-types/-private/new-core-tmp/reactivity/internal.d.ts.map +1 -0
  67. package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts +32 -0
  68. package/unstable-preview-types/-private/new-core-tmp/reactivity/signal.d.ts.map +1 -0
  69. package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts +276 -0
  70. package/unstable-preview-types/-private/new-core-tmp/request-state.d.ts.map +1 -0
  71. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +145 -0
  72. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -0
  73. package/unstable-preview-types/-private/record-arrays/many-array.d.ts +203 -0
  74. package/unstable-preview-types/-private/record-arrays/many-array.d.ts.map +1 -0
  75. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +118 -0
  76. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +1 -0
  77. package/unstable-preview-types/-private/store-service.d.ts +1601 -0
  78. package/unstable-preview-types/-private/store-service.d.ts.map +1 -0
  79. package/unstable-preview-types/-private/store-service.type-test.d.ts +4 -0
  80. package/unstable-preview-types/-private/store-service.type-test.d.ts.map +1 -0
  81. package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -0
  82. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -0
  83. package/unstable-preview-types/-private/utils/construct-resource.d.ts +9 -0
  84. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -0
  85. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -0
  86. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -0
  87. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -0
  88. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -0
  89. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -0
  90. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +1 -0
  91. package/unstable-preview-types/-private.d.ts +33 -0
  92. package/unstable-preview-types/-private.d.ts.map +1 -0
  93. package/unstable-preview-types/-types/overview.d.ts +21 -0
  94. package/unstable-preview-types/-types/overview.d.ts.map +1 -0
  95. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +110 -0
  96. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +1 -0
  97. package/unstable-preview-types/-types/q/ds-model.d.ts +25 -0
  98. package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -0
  99. package/unstable-preview-types/-types/q/identifier.d.ts +193 -0
  100. package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -0
  101. package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -0
  102. package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +1 -0
  103. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -0
  104. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -0
  105. package/unstable-preview-types/-types/q/record-instance.d.ts +29 -0
  106. package/unstable-preview-types/-types/q/record-instance.d.ts.map +1 -0
  107. package/unstable-preview-types/-types/q/schema-service.d.ts +354 -0
  108. package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -0
  109. package/unstable-preview-types/-types/q/store.d.ts +38 -0
  110. package/unstable-preview-types/-types/q/store.d.ts.map +1 -0
  111. package/unstable-preview-types/configure.d.ts +21 -0
  112. package/unstable-preview-types/configure.d.ts.map +1 -0
  113. package/unstable-preview-types/index.d.ts +229 -0
  114. package/unstable-preview-types/index.d.ts.map +1 -0
  115. package/unstable-preview-types/types.d.ts +7 -0
  116. package/unstable-preview-types/types.d.ts.map +1 -0
  117. package/addon/-private.js +0 -1
  118. package/addon/index.js +0 -1
  119. package/addon/store-service-45bbfe5a.js +0 -5619
  120. package/addon/store-service-45bbfe5a.js.map +0 -1
  121. package/addon-main.js +0 -93
  122. /package/{ember-data-logo-dark.svg → logos/ember-data-logo-dark.svg} +0 -0
  123. /package/{ember-data-logo-light.svg → logos/ember-data-logo-light.svg} +0 -0
@@ -0,0 +1,32 @@
1
+ declare module '@ember-data/store/-private/new-core-tmp/reactivity/signal' {
2
+ import type { SignalStore, WarpDriveSignal } from '@ember-data/store/-private/new-core-tmp/reactivity/internal';
3
+ /**
4
+ * Creates a signal for the key/object pairing and subscribes to the signal.
5
+ *
6
+ * Use when you need to ensure a signal exists and is subscribed to.
7
+ *
8
+ * @internal
9
+ */
10
+ export function entangleSignal<T extends object>(signals: SignalStore, obj: T, key: string | symbol, initialValue: unknown): WarpDriveSignal;
11
+ /**
12
+ * define an enumerable signal property.
13
+ *
14
+ * Akin to Object.defineProperty.
15
+ *
16
+ * The signal will be lazily created when accessed and scoped to the
17
+ * instance of the object.
18
+ *
19
+ * @internal
20
+ */
21
+ export function defineSignal<T extends object>(obj: T, key: string, v?: unknown): void;
22
+ /**
23
+ * Define a non-enumerable signal property.
24
+ *
25
+ * @internal
26
+ */
27
+ export function defineNonEnumerableSignal<T extends object>(obj: T, key: string, v?: unknown): void;
28
+ export function memoized<T extends object, K extends keyof T & string>(target: T, key: K, descriptor: PropertyDescriptor): PropertyDescriptor;
29
+ export function gate<T extends object, K extends keyof T & string>(_target: T, key: K, desc: PropertyDescriptor): PropertyDescriptor;
30
+ export function defineGate<T extends object>(obj: T, key: string, desc: PropertyDescriptor): void;
31
+ }
32
+ //# sourceMappingURL=signal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../../../src/-private/new-core-tmp/reactivity/signal.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAW,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAUxE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAC7C,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,YAAY,EAAE,OAAO,GACpB,eAAe,CAQjB;AAsBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,QAE9E;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,QAI3F;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EACnE,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,CAAC,EACN,UAAU,EAAE,kBAAkB,sBAoC/B;AAED,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,sBAqC9G;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,QAGzF"}
@@ -0,0 +1,276 @@
1
+ declare module '@ember-data/store/-private/new-core-tmp/request-state' {
2
+ import type { Future, ImmutableRequestInfo, ResponseInfo, StructuredErrorDocument } from '@ember-data/request';
3
+ import type { PendingPromise, RejectedPromise, ResolvedPromise } from '@ember-data/store/-private/new-core-tmp/promise-state';
4
+ /**
5
+ * Lazily consumes the stream of a request, providing a number of
6
+ * reactive properties that can be used to build UIs that respond
7
+ * to the progress of a request.
8
+ *
9
+ * @typedoc
10
+ */
11
+ export class RequestLoadingState {
12
+ _sizeHint: number;
13
+ _bytesLoaded: number;
14
+ _startTime: number;
15
+ _endTime: number;
16
+ _lastPacketTime: number;
17
+ _isPending: boolean;
18
+ _isStarted: boolean;
19
+ _isComplete: boolean;
20
+ _isCancelled: boolean;
21
+ _isErrored: boolean;
22
+ _error: Error | null;
23
+ _stream: TransformStream | null;
24
+ _future: Future<unknown>;
25
+ _triggered: boolean;
26
+ _trigger(): void;
27
+ promise: Promise<void> | null;
28
+ get isPending(): boolean;
29
+ get sizeHint(): number;
30
+ get stream(): ReadableStream | null;
31
+ get isStarted(): boolean;
32
+ get bytesLoaded(): number;
33
+ get startTime(): number;
34
+ get endTime(): number;
35
+ get lastPacketTime(): number;
36
+ get isComplete(): boolean;
37
+ get isCancelled(): boolean;
38
+ get isErrored(): boolean;
39
+ get error(): Error | null;
40
+ get elapsedTime(): number;
41
+ get completedRatio(): number;
42
+ get remainingRatio(): number;
43
+ get duration(): number;
44
+ get speed(): number;
45
+ constructor(future: Future<unknown>);
46
+ abort: () => void;
47
+ }
48
+ /**
49
+ * The state of a request in the "pending"
50
+ * state. This is the default initial state.
51
+ *
52
+ * Extends the {@link PendingPromise} interface.
53
+ *
54
+ * @typedoc
55
+ */
56
+ export interface PendingRequest extends PendingPromise {
57
+ /**
58
+ * Whether the request is cancelled.
59
+ *
60
+ * @typedoc
61
+ */
62
+ isCancelled: false;
63
+ loadingState: RequestLoadingState;
64
+ request: null;
65
+ response: null;
66
+ }
67
+ /**
68
+ * The state of a request in the "fulfilled" state.
69
+ * This is the state of a request that has resolved
70
+ * successfully.
71
+ *
72
+ * Extends the {@link ResolvedPromise} interface.
73
+ *
74
+ * @typedoc
75
+ */
76
+ export interface ResolvedRequest<T, RT> extends ResolvedPromise<RT> {
77
+ /**
78
+ * Whether the request is cancelled.
79
+ *
80
+ * @typedoc
81
+ */
82
+ isCancelled: false;
83
+ loadingState: RequestLoadingState;
84
+ request: ImmutableRequestInfo<T, RT> | null;
85
+ response: Response | ResponseInfo | null;
86
+ }
87
+ /**
88
+ * The state of a request in the "rejected" state.
89
+ * This is the state of a request that has rejected
90
+ * with an error.
91
+ *
92
+ * Extends the {@link RejectedPromise} interface.
93
+ *
94
+ * @typedoc
95
+ */
96
+ export interface RejectedRequest<T, RT, E extends StructuredErrorDocument = StructuredErrorDocument> extends RejectedPromise<E> {
97
+ /**
98
+ * Whether the request is cancelled.
99
+ *
100
+ * @typedoc
101
+ */
102
+ isCancelled: false;
103
+ loadingState: RequestLoadingState;
104
+ request: ImmutableRequestInfo<T, RT> | null;
105
+ response: Response | ResponseInfo | null;
106
+ }
107
+ /**
108
+ * The state of a request in the "cancelled" state.
109
+ * This is the state of a promise that has been
110
+ * cancelled.
111
+ *
112
+ * @typedoc
113
+ */
114
+ export interface CancelledRequest<T, RT, E extends StructuredErrorDocument = StructuredErrorDocument> {
115
+ /**
116
+ * The status of the request.
117
+ *
118
+ * @typedoc
119
+ */
120
+ status: 'cancelled';
121
+ /**
122
+ * Whether the request is pending.
123
+ *
124
+ * @typedoc
125
+ */
126
+ isPending: false;
127
+ /**
128
+ * Whether the request is pending.
129
+ *
130
+ * @typedoc
131
+ */
132
+ isLoading: false;
133
+ /**
134
+ * Whether the request has resolved
135
+ * successfully.
136
+ *
137
+ * @typedoc
138
+ */
139
+ isSuccess: false;
140
+ /**
141
+ * Whether the request has rejected
142
+ * with an error.
143
+ *
144
+ * @typedoc
145
+ */
146
+ isError: true;
147
+ /**
148
+ * Once the request has resolved, this will
149
+ * be the value the request resolved to.
150
+ *
151
+ * @typedoc
152
+ */
153
+ value: null;
154
+ /**
155
+ * Once the request has resolved, this will
156
+ * be the value the request resolved to.
157
+ *
158
+ * @deprecated use `value` instead
159
+ * @typedoc
160
+ */
161
+ result: null;
162
+ /**
163
+ * Once the request has rejected, this will
164
+ * be the error the request rejected with.
165
+ *
166
+ *
167
+ * @deprecated use `reason` instead
168
+ * @typedoc
169
+ */
170
+ error: E;
171
+ /**
172
+ * Once the request has rejected, this will
173
+ * be the error the request rejected with.
174
+ *
175
+ * @typedoc
176
+ */
177
+ reason: E;
178
+ /**
179
+ * Whether the request is cancelled.
180
+ *
181
+ * @typedoc
182
+ */
183
+ isCancelled: true;
184
+ loadingState: RequestLoadingState;
185
+ request: ImmutableRequestInfo<T, RT> | null;
186
+ response: Response | ResponseInfo | null;
187
+ }
188
+ /**
189
+ * RequestState extends the concept of PromiseState to provide a reactive
190
+ * wrapper for a request `Future` which allows you write declarative code
191
+ * around a Future's control flow.
192
+ *
193
+ * It is useful in both Template and JavaScript contexts, allowing you
194
+ * to quickly derive behaviors and data from pending, error and success
195
+ * states.
196
+ *
197
+ * The key difference between a Promise and a Future is that Futures provide
198
+ * access to a stream of their content, the identity of the request (if any)
199
+ * as well as the ability to attempt to abort the request.
200
+ *
201
+ * ```ts
202
+ * interface Future<T> extends Promise<T>> {
203
+ * getStream(): Promise<ReadableStream>;
204
+ * abort(): void;
205
+ * lid: StableDocumentIdentifier | null;
206
+ * }
207
+ * ```
208
+ *
209
+ * These additional APIs allow us to craft even richer state experiences.
210
+ *
211
+ * To get the state of a request, use `getRequestState`.
212
+ *
213
+ * See also:
214
+ * - {@link PendingRequest}
215
+ * - {@link ResolvedRequest}
216
+ * - {@link RejectedRequest}
217
+ * - {@link CancelledRequest}
218
+ *
219
+ * @typedoc
220
+ */
221
+ export type RequestCacheRequestState<T = unknown, RT = unknown, E extends StructuredErrorDocument = StructuredErrorDocument> = PendingRequest | ResolvedRequest<T, RT> | RejectedRequest<T, RT, E> | CancelledRequest<T, RT, E>;
222
+ export function createRequestState<T, RT, E>(future: Future<RT>): Readonly<RequestCacheRequestState<T, RT, StructuredErrorDocument<E>>>;
223
+ /**
224
+ * `getRequestState` can be used in both JavaScript and Template contexts.
225
+ *
226
+ * ```ts
227
+ * import { getRequestState } from '@warp-drive/ember';
228
+ *
229
+ * const state = getRequestState(future);
230
+ * ```
231
+ *
232
+ * For instance, we could write a getter on a component that updates whenever
233
+ * the request state advances or the future changes, by combining the function
234
+ * with the use of `@cached`
235
+ *
236
+ * ```ts
237
+ * class Component {
238
+ * @cached
239
+ * get title() {
240
+ * const state = getRequestState(this.args.request);
241
+ * if (state.isPending) {
242
+ * return 'loading...';
243
+ * }
244
+ * if (state.isError) { return null; }
245
+ * return state.result.title;
246
+ * }
247
+ * }
248
+ * ```
249
+ *
250
+ * Or in a template as a helper:
251
+ *
252
+ * ```gjs
253
+ * import { getRequestState } from '@warp-drive/ember';
254
+ *
255
+ * <template>
256
+ * {{#let (getRequestState @request) as |state|}}
257
+ * {{#if state.isPending}}
258
+ * <Spinner />
259
+ * {{else if state.isError}}
260
+ * <ErrorForm @error={{state.error}} />
261
+ * {{else}}
262
+ * <h1>{{state.result.title}}</h1>
263
+ * {{/if}}
264
+ * {{/let}}
265
+ * </template>
266
+ * ```
267
+ *
268
+ * If looking to use in a template, consider also the `<Request />` component
269
+ * which offers a numbe of additional capabilities for requests *beyond* what
270
+ * `RequestState` provides.
271
+ *
272
+ * @typedoc
273
+ */
274
+ export function getRequestState<RT, T, E>(future: Future<RT>): Readonly<RequestCacheRequestState<T, RT, StructuredErrorDocument<E>>>;
275
+ }
276
+ //# sourceMappingURL=request-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-state.d.ts","sourceRoot":"","sources":["../../../src/-private/new-core-tmp/request-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,MAAM,EACN,oBAAoB,EACpB,YAAY,EAEZ,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAiExF;;;;;;GAMG;AACH,qBAAa,mBAAmB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,O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AAC;IAClC,OAAO,EAAE,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;IAC5C,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,CAAC;CAC1C;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,wBAAwB,CAClC,CAAC,GAAG,OAAO,EACX,EAAE,GAAG,OAAO,EACZ,CAAC,SAAS,uBAAuB,GAAG,uBAAuB,IACzD,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAiCrG,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EACzC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GACjB,QAAQ,CAAC,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CAwDvE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EACtC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GACjB,QAAQ,CAAC,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CASvE"}
@@ -0,0 +1,145 @@
1
+ declare module '@ember-data/store/-private/record-arrays/identifier-array' {
2
+ import type { LocalRelationshipOperation } from '@warp-drive/core-types/graph';
3
+ import type { StableDocumentIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
4
+ import type { TypeFromInstanceOrString } from '@warp-drive/core-types/record';
5
+ import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
6
+ import type { Links, PaginationLinks } from '@warp-drive/core-types/spec/json-api-raw';
7
+ import type { BaseFinderOptions } from '@ember-data/store/types';
8
+ import type { RecordArrayManager } from '@ember-data/store/-private/managers/record-array-manager';
9
+ import type { WarpDriveSignal } from '@ember-data/store/-private/new-core-tmp/reactivity/internal';
10
+ import { ARRAY_SIGNAL } from '@ember-data/store/-private/new-core-tmp/reactivity/internal';
11
+ import type { Store } from '@ember-data/store/-private/store-service';
12
+ import { NativeProxy } from '@ember-data/store/-private/record-arrays/native-proxy-type-fix';
13
+ export const SOURCE: "___(unique) Symbol(#source)";
14
+ export const MUTATE: "___(unique) Symbol(#update)";
15
+ const IS_COLLECTION: "___(unique) Symbol(IS_COLLECTION)";
16
+ export type IdentifierArrayCreateOptions<T = unknown> = {
17
+ identifiers: StableRecordIdentifier<TypeFromInstanceOrString<T>>[];
18
+ type?: TypeFromInstanceOrString<T>;
19
+ store: Store;
20
+ allowMutation: boolean;
21
+ manager: MinimumManager;
22
+ links?: Links | PaginationLinks | null;
23
+ meta?: Record<string, unknown> | null;
24
+ identifier?: StableDocumentIdentifier | null;
25
+ };
26
+ type PromiseTo<T> = Omit<Promise<T>, typeof Symbol.toStringTag>;
27
+ type PromiseManyArray<T> = {
28
+ length: number;
29
+ content: IdentifierArray<T> | null;
30
+ promise: Promise<IdentifierArray<T>> | null;
31
+ } & PromiseTo<IdentifierArray<T>>;
32
+ export type MinimumManager = {
33
+ _syncArray: (array: IdentifierArray) => void;
34
+ mutate?(mutation: LocalRelationshipOperation): void;
35
+ reloadHasMany?<T>(key: string, options?: BaseFinderOptions): Promise<IdentifierArray<T>> | PromiseManyArray<T>;
36
+ };
37
+ /**
38
+ A record array is an array that contains records of a certain type (or modelName).
39
+ The record array materializes records as needed when they are retrieved for the first
40
+ time. You should not create record arrays yourself. Instead, an instance of
41
+ `RecordArray` or its subclasses will be returned by your application's store
42
+ in response to queries.
43
+
44
+ This class should not be imported and instantiated by consuming applications.
45
+
46
+ @class RecordArray
47
+ @public
48
+ */
49
+ export interface IdentifierArray<T = unknown> extends Omit<Array<T>, '[]'> {
50
+ [MUTATE]?(target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: WarpDriveSignal): unknown;
51
+ }
52
+ export class IdentifierArray<T = unknown> {
53
+ DEPRECATED_CLASS_NAME: string;
54
+ /**
55
+ The flag to signal a `RecordArray` is currently loading data.
56
+ Example
57
+ ```javascript
58
+ let people = store.peekAll('person');
59
+ people.isUpdating; // false
60
+ people.update();
61
+ people.isUpdating; // true
62
+ ```
63
+ @property isUpdating
64
+ @public
65
+ @type Boolean
66
+ */
67
+ isUpdating: boolean;
68
+ isLoaded: boolean;
69
+ isDestroying: boolean;
70
+ isDestroyed: boolean;
71
+ _updatingPromise: Promise<IdentifierArray<T>> | null;
72
+ readonly identifier: StableDocumentIdentifier | null;
73
+ [IS_COLLECTION]: boolean;
74
+ [ARRAY_SIGNAL]: WarpDriveSignal;
75
+ [SOURCE]: StableRecordIdentifier[];
76
+ links: Links | PaginationLinks | null;
77
+ meta: Record<string, unknown> | null;
78
+ modelName?: TypeFromInstanceOrString<T>;
79
+ /**
80
+ The store that created this record array.
81
+
82
+ @property store
83
+ @private
84
+ @type Store
85
+ */
86
+ store: Store;
87
+ _manager: MinimumManager;
88
+ destroy(clear: boolean): void;
89
+ constructor(options: IdentifierArrayCreateOptions<T>);
90
+ /**
91
+ Used to get the latest version of all of the records in this array
92
+ from the adapter.
93
+
94
+ Example
95
+
96
+ ```javascript
97
+ let people = store.peekAll('person');
98
+ people.isUpdating; // false
99
+
100
+ people.update().then(function() {
101
+ people.isUpdating; // false
102
+ });
103
+
104
+ people.isUpdating; // true
105
+ ```
106
+
107
+ @method update
108
+ @public
109
+ */
110
+ update(): Promise<IdentifierArray<T>>;
111
+ _update(): Promise<IdentifierArray<T>>;
112
+ /**
113
+ Saves all of the records in the `RecordArray`.
114
+
115
+ Example
116
+
117
+ ```javascript
118
+ let messages = store.peekAll('message');
119
+ messages.forEach(function(message) {
120
+ message.hasBeenSeen = true;
121
+ });
122
+ messages.save();
123
+ ```
124
+
125
+ @method save
126
+ @public
127
+ @return {Promise<IdentifierArray>} promise
128
+ */
129
+ save(): Promise<IdentifierArray>;
130
+ }
131
+ export type CollectionCreateOptions = IdentifierArrayCreateOptions & {
132
+ manager: RecordArrayManager;
133
+ query: ImmutableRequestInfo | Record<string, unknown> | null;
134
+ isLoaded: boolean;
135
+ };
136
+ export class Collection<T = unknown> extends IdentifierArray<T> {
137
+ query: ImmutableRequestInfo | Record<string, unknown> | null;
138
+ _manager: RecordArrayManager;
139
+ constructor(options: CollectionCreateOptions);
140
+ _update(): Promise<Collection<T>>;
141
+ destroy(clear: boolean): void;
142
+ }
143
+ export {};
144
+ }
145
+ //# sourceMappingURL=identifier-array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifier-array.d.ts","sourceRoot":"","sources":["../../../src/-private/record-arrays/identifier-array.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC1G,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAGvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EACL,YAAY,EAIb,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EA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IAEjC,OAAO,CAAC,KAAK,EAAE,OAAO;gBASV,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC;IA8PpD;;;;;;;;;;;;;;;;;;;MAmBE;IACF,MAAM,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAyBrC,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAUtC;;;;;;;;;;;;;;;;MAgBE;IACF,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;CAKjC;AAsBD,MAAM,MAAM,uBAAuB,GAAG,4BAA4B,GAAG;IACnE,OAAO,EAAE,kBAAkB,CAAC;IAC5B,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7D,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,qBAAa,UAAU,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IAC7D,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAQ;IAC5D,QAAQ,EAAE,kBAAkB,CAAC;gBAEzB,OAAO,EAAE,uBAAuB;IAM5C,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAejC,OAAO,CAAC,KAAK,EAAE,OAAO;CAKvB"}
@@ -0,0 +1,203 @@
1
+ declare module '@ember-data/store/-private/record-arrays/many-array' {
2
+ import type { StableRecordIdentifier } from '@warp-drive/core-types';
3
+ import type { Cache } from '@warp-drive/core-types/cache';
4
+ import type { TypedRecordInstance, TypeFromInstance, TypeFromInstanceOrString } from '@warp-drive/core-types/record';
5
+ import type { Links, PaginationLinks } from '@warp-drive/core-types/spec/json-api-raw';
6
+ import type { BaseFinderOptions, ModelSchema } from '@ember-data/store/types';
7
+ import { type WarpDriveSignal } from '@ember-data/store/-private/new-core-tmp/reactivity/internal';
8
+ import type { CreateRecordProperties, Store } from '@ember-data/store/-private/store-service';
9
+ import type { MinimumManager } from '@ember-data/store/-private/record-arrays/identifier-array';
10
+ import { IdentifierArray, MUTATE } from '@ember-data/store/-private/record-arrays/identifier-array';
11
+ import type { NativeProxy } from '@ember-data/store/-private/record-arrays/native-proxy-type-fix';
12
+ export interface ManyArrayCreateArgs<T> {
13
+ identifiers: StableRecordIdentifier<TypeFromInstanceOrString<T>>[];
14
+ type: TypeFromInstanceOrString<T>;
15
+ store: Store;
16
+ allowMutation: boolean;
17
+ manager: MinimumManager;
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;
56
+ }
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 class RelatedCollection<T = unknown> extends IdentifierArray<T> {
72
+ isAsync: boolean;
73
+ /**
74
+ The loading state of this array
75
+
76
+ @property isLoaded
77
+ @type {Boolean}
78
+ @public
79
+ */
80
+ isLoaded: boolean;
81
+ /**
82
+ `true` if the relationship is polymorphic, `false` otherwise.
83
+
84
+ @property isPolymorphic
85
+ @type {Boolean}
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 meta
125
+ @type {Object | null}
126
+ @public
127
+ */
128
+ meta: Record<string, unknown> | null;
129
+ /**
130
+ * Retrieve the links for this relationship
131
+ *
132
+ @property links
133
+ @type {Object | null}
134
+ @public
135
+ */
136
+ links: Links | PaginationLinks | null;
137
+ identifier: StableRecordIdentifier;
138
+ cache: Cache;
139
+ _manager: MinimumManager;
140
+ store: Store;
141
+ key: string;
142
+ type: ModelSchema;
143
+ modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
144
+ constructor(options: ManyArrayCreateArgs<T>);
145
+ [MUTATE](target: StableRecordIdentifier[], receiver: typeof NativeProxy<StableRecordIdentifier[], T[]>, prop: string, args: unknown[], _SIGNAL: WarpDriveSignal): unknown;
146
+ notify(): void;
147
+ /**
148
+ Reloads all of the records in the manyArray. If the manyArray
149
+ holds a relationship that was originally fetched using a links url
150
+ EmberData will revisit the original links url to repopulate the
151
+ relationship.
152
+
153
+ If the ManyArray holds the result of a `store.query()` reload will
154
+ re-run the original query.
155
+
156
+ Example
157
+
158
+ ```javascript
159
+ let user = store.peekRecord('user', '1')
160
+ await login(user);
161
+
162
+ let permissions = await user.permissions;
163
+ await permissions.reload();
164
+ ```
165
+
166
+ @method reload
167
+ @public
168
+ */
169
+ reload(options?: BaseFinderOptions): Promise<this>;
170
+ /**
171
+ Saves all of the records in the `ManyArray`.
172
+
173
+ Note: this API can only be used in legacy mode with a configured Adapter.
174
+
175
+ Example
176
+
177
+ ```javascript
178
+ const { content: { data: inbox } } = await store.request(findRecord({ type: 'inbox', id: '1' }));
179
+
180
+ let messages = await inbox.messages;
181
+ messages.forEach((message) => {
182
+ message.isRead = true;
183
+ });
184
+ messages.save();
185
+ ```
186
+
187
+ @method save
188
+ @public
189
+ @return {PromiseArray} promise
190
+ */
191
+ /**
192
+ Create a child record within the owner
193
+
194
+ @method createRecord
195
+ @public
196
+ @param {Object} hash
197
+ @return {Model} record
198
+ */
199
+ createRecord(hash: CreateRecordProperties<T>): T;
200
+ destroy(): void;
201
+ }
202
+ }
203
+ //# sourceMappingURL=many-array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"many-array.d.ts","sourceRoot":"","sources":["../../../src/-private/record-arrays/many-array.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAEV,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGlE,OAAO,EAAsC,KAAK,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC/G,OAAO,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,kBA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