ember-data-resources 5.2.2 → 5.2.3

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 (63) hide show
  1. package/README.md +291 -0
  2. package/dist/-private/resources/errors.js +13 -0
  3. package/dist/-private/resources/errors.js.map +1 -0
  4. package/dist/-private/resources/find-all.js +30 -0
  5. package/dist/-private/resources/find-all.js.map +1 -0
  6. package/dist/-private/resources/find-record.js +44 -0
  7. package/dist/-private/resources/find-record.js.map +1 -0
  8. package/dist/-private/resources/query-record.js +30 -0
  9. package/dist/-private/resources/query-record.js.map +1 -0
  10. package/dist/-private/resources/query.js +30 -0
  11. package/dist/-private/resources/query.js.map +1 -0
  12. package/dist/-private/resources/request.js +9 -0
  13. package/dist/-private/resources/request.js.map +1 -0
  14. package/dist/-private/resources/types.js +2 -0
  15. package/dist/-private/resources/types.js.map +1 -0
  16. package/dist/_app_/helpers/find-all.js +1 -0
  17. package/dist/_app_/helpers/find-record.js +1 -0
  18. package/dist/_app_/helpers/query-record.js +1 -0
  19. package/dist/_app_/helpers/query.js +1 -0
  20. package/dist/index.js +6 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/js-helpers.js +97 -0
  23. package/dist/js-helpers.js.map +1 -0
  24. package/dist/loose-mode-compat/helpers/find-all.js +9 -0
  25. package/dist/loose-mode-compat/helpers/find-all.js.map +1 -0
  26. package/dist/loose-mode-compat/helpers/find-record.js +9 -0
  27. package/dist/loose-mode-compat/helpers/find-record.js.map +1 -0
  28. package/dist/loose-mode-compat/helpers/query-record.js +9 -0
  29. package/dist/loose-mode-compat/helpers/query-record.js.map +1 -0
  30. package/dist/loose-mode-compat/helpers/query.js +9 -0
  31. package/dist/loose-mode-compat/helpers/query.js.map +1 -0
  32. package/dist/request-D75_GC-a.js +142 -0
  33. package/dist/request-D75_GC-a.js.map +1 -0
  34. package/dist-types/-private/resources/errors.d.ts +8 -0
  35. package/dist-types/-private/resources/errors.d.ts.map +1 -0
  36. package/dist-types/-private/resources/find-all.d.ts +20 -0
  37. package/dist-types/-private/resources/find-all.d.ts.map +1 -0
  38. package/dist-types/-private/resources/find-record.d.ts +19 -0
  39. package/dist-types/-private/resources/find-record.d.ts.map +1 -0
  40. package/dist-types/-private/resources/query-record.d.ts +20 -0
  41. package/dist-types/-private/resources/query-record.d.ts.map +1 -0
  42. package/dist-types/-private/resources/query.d.ts +22 -0
  43. package/dist-types/-private/resources/query.d.ts.map +1 -0
  44. package/dist-types/-private/resources/request.d.ts +24 -0
  45. package/dist-types/-private/resources/request.d.ts.map +1 -0
  46. package/dist-types/-private/resources/types.d.ts +2 -0
  47. package/dist-types/-private/resources/types.d.ts.map +1 -0
  48. package/dist-types/defineProperty-d7617aac.d.ts +2 -0
  49. package/dist-types/index.d.ts +5 -0
  50. package/dist-types/index.d.ts.map +1 -0
  51. package/dist-types/js-helpers.d.ts +28 -0
  52. package/dist-types/js-helpers.d.ts.map +1 -0
  53. package/dist-types/loose-mode-compat/helpers/find-all.d.ts +2 -0
  54. package/dist-types/loose-mode-compat/helpers/find-all.d.ts.map +1 -0
  55. package/dist-types/loose-mode-compat/helpers/find-record.d.ts +2 -0
  56. package/dist-types/loose-mode-compat/helpers/find-record.d.ts.map +1 -0
  57. package/dist-types/loose-mode-compat/helpers/query-record.d.ts +2 -0
  58. package/dist-types/loose-mode-compat/helpers/query-record.d.ts.map +1 -0
  59. package/dist-types/loose-mode-compat/helpers/query.d.ts +2 -0
  60. package/dist-types/loose-mode-compat/helpers/query.d.ts.map +1 -0
  61. package/dist-types/request-D75_GC-a.d.ts +9 -0
  62. package/dist-types/toPropertyKey-d7617aac.d.ts +4 -0
  63. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,291 @@
1
+ # ember-data-resources
2
+
3
+ Resources for reactive data fetching with ember-data's `store` service.
4
+
5
+ ## Compatibility
6
+
7
+ * ember-source v3.28 or above
8
+ * ember-data v3.28 or above
9
+ * ember-auto-import v2 or above
10
+ * ember-resources v5.3 or above
11
+ * typescript v4.8 or above
12
+
13
+ ## Installation
14
+
15
+ ```
16
+ npm add ember-data-resources
17
+ ```
18
+
19
+
20
+ ## Usage
21
+
22
+ ### `findAll`
23
+
24
+ ```js
25
+ import { findAll } from 'ember-data-resources';
26
+
27
+ export default class MyComponent extends Component {
28
+ @tracked included = '';
29
+
30
+ blog = findAll(this, 'blog', () => ({ included: this.included }));
31
+ // blog = findAll(this, 'blog');
32
+ }
33
+ ```
34
+ ```hbs
35
+ Available properties:
36
+ - {{this.blog.records}}
37
+ - {{this.blog.error}}
38
+ - {{this.blog.isLoading}}
39
+ - {{this.blog.isSuccess}}
40
+ - {{this.blog.isError}}
41
+ - {{this.blog.hasRan}}
42
+
43
+ Available methods:
44
+ - <button {{on 'click' this.blog.retry}}>Retry</button>
45
+ ```
46
+
47
+ **in a template**
48
+
49
+ ```hbs
50
+ {{#let (find-all 'blog') as |blogs|}}
51
+ {{#if blogs.isLoading}}
52
+ ...
53
+ {{else if blogs.isError}}
54
+ {{blogs.error}}
55
+ {{else}}
56
+ {{blogs.records}}
57
+ {{/if}}
58
+
59
+ Available properties:
60
+ - {{blog.records}}
61
+ - {{blog.error}}
62
+ - {{blog.isLoading}}
63
+ - {{blog.isSuccess}}
64
+ - {{blog.isError}}
65
+ - {{blog.hasRan}}
66
+
67
+ Available methods:
68
+ - <button {{on 'click' blog.retry}}>Retry</button>
69
+ {{/let}}
70
+ ```
71
+
72
+ **in strict mode**
73
+
74
+ See: [First-class Component Templates](https://github.com/emberjs/rfcs/pull/779)
75
+
76
+ ```jsx
77
+ import { FindAll } from 'ember-data-resources';
78
+
79
+ <template>
80
+ {{#let (FindAll 'blog') as |blogs|}}
81
+ ...
82
+ {{/let}}
83
+ </template>
84
+ ```
85
+
86
+ ### `findRecord`
87
+
88
+ ```js
89
+ import { findRecord } from 'ember-data-resources';
90
+
91
+ export default class MyComponent extends Component {
92
+ @tracked id = 1;
93
+
94
+ blog = findRecord(this, 'blog', () => this.id)
95
+ // blog = findRecord(this, 'blog', () => [this.id])
96
+ // blog = findRecord(this, 'blog', () => [this.id, { ...options }])
97
+ }
98
+ ```
99
+ ```hbs
100
+ Available properties:
101
+ - {{this.blog.record}}
102
+ - {{this.blog.error}}
103
+ - {{this.blog.isLoading}}
104
+ - {{this.blog.isSuccess}}
105
+ - {{this.blog.isError}}
106
+ - {{this.blog.hasRan}}
107
+
108
+ Available methods:
109
+ - <button {{on 'click' this.blog.retry}}>Retry</button>
110
+ ```
111
+
112
+ **in a template**
113
+
114
+ ```hbs
115
+ {{#let (find-record 'blog' @id) as |blog|}}
116
+ {{!-- or: (find-record 'blog' @id options=...) --}}
117
+ {{#if blog.isLoading}}
118
+ ...
119
+ {{else if blog.isError}}
120
+ {{blog.error}}
121
+ {{else}}
122
+ {{blog.record}}
123
+ {{/if}}
124
+
125
+ Available properties:
126
+ - {{blog.record}}
127
+ - {{blog.error}}
128
+ - {{blog.isLoading}}
129
+ - {{blog.isSuccess}}
130
+ - {{blog.isError}}
131
+ - {{blog.hasRan}}
132
+
133
+ Available methods:
134
+ - <button {{on 'click' blog.retry}}>Retry</button>
135
+ {{/let}}
136
+ ```
137
+
138
+ **in strict mode**
139
+
140
+ See: [First-class Component Templates](https://github.com/emberjs/rfcs/pull/779)
141
+
142
+ ```jsx
143
+ import { FindRecord } from 'ember-data-resources';
144
+
145
+ <template>
146
+ {{#let (FindRecord 'blog' @id) as |blog|}}
147
+ ...
148
+ {{/let}}
149
+ </template>
150
+ ```
151
+
152
+ ### `query`
153
+
154
+ ```js
155
+ import { query } from 'ember-data-resources';
156
+
157
+ export default class MyComponent extends Component {
158
+ blog = query(this, 'blog', () => ({ ...query }));
159
+ // blog = query(this, 'blog', () => [{ ...query }]);
160
+ // blog = query(this, 'blog', () => [{ ...query }, { ...options }]);
161
+ }
162
+ ```
163
+ ```hbs
164
+ Available properties:
165
+ - {{this.blog.records}}
166
+ - {{this.blog.error}}
167
+ - {{this.blog.isLoading}}
168
+ - {{this.blog.isSuccess}}
169
+ - {{this.blog.isError}}
170
+ - {{this.blog.hasRan}}
171
+
172
+ Available methods:
173
+ - <button {{on 'click' this.blog.retry}}>Retry</button>
174
+ ```
175
+
176
+ **in a template**
177
+
178
+ ```hbs
179
+ {{#let (query 'blog' (hash ...)) as |blogs|}}
180
+ {{#if blogs.isLoading}}
181
+ ...
182
+ {{else if blogs.isError}}
183
+ {{blogs.error}}
184
+ {{else}}
185
+ {{blogs.records}}
186
+ {{/if}}
187
+
188
+ Available properties:
189
+ - {{blog.records}}
190
+ - {{blog.error}}
191
+ - {{blog.isLoading}}
192
+ - {{blog.isSuccess}}
193
+ - {{blog.isError}}
194
+ - {{blog.hasRan}}
195
+
196
+ Available methods:
197
+ - <button {{on 'click' blog.retry}}>Retry</button>
198
+ {{/let}}
199
+ ```
200
+
201
+ **in strict mode**
202
+
203
+ See: [First-class Component Templates](https://github.com/emberjs/rfcs/pull/779)
204
+
205
+ ```jsx
206
+ import { Query } from 'ember-data-resources';
207
+
208
+ <template>
209
+ {{#let (Query 'blog' (hash ...)) as |blogs|}}
210
+ ...
211
+ {{/let}}
212
+ </template>
213
+ ```
214
+
215
+
216
+ ### `queryRecord`
217
+
218
+ ```js
219
+ import { queryRecord } from 'ember-data-resources';
220
+
221
+ export default class MyComponent extends Component {
222
+ @tracked id = 1;
223
+
224
+ blog = queryRecord(this, 'blog', () => ({ ...query }))
225
+ // blog = findRecord(this, 'blog', () => [{ ...query }])
226
+ // blog = findRecord(this, 'blog', () => [{ ...query }, { ...options }])
227
+ }
228
+ ```
229
+ ```hbs
230
+ Available properties:
231
+ - {{this.blog.record}}
232
+ - {{this.blog.error}}
233
+ - {{this.blog.isLoading}}
234
+ - {{this.blog.isSuccess}}
235
+ - {{this.blog.isError}}
236
+ - {{this.blog.hasRan}}
237
+
238
+ Available methods:
239
+ - <button {{on 'click' this.blog.retry}}>Retry</button>
240
+ ```
241
+
242
+ **in a template**
243
+
244
+ ```hbs
245
+ {{#let (query-record 'blog' (hash ...)) as |blog|}}
246
+ {{#if blog.isLoading}}
247
+ ...
248
+ {{else if blog.isError}}
249
+ {{blog.error}}
250
+ {{else}}
251
+ {{blog.record}}
252
+ {{/if}}
253
+
254
+ Available properties:
255
+ - {{blog.record}}
256
+ - {{blog.error}}
257
+ - {{blog.isLoading}}
258
+ - {{blog.isSuccess}}
259
+ - {{blog.isError}}
260
+ - {{blog.hasRan}}
261
+
262
+ Available methods:
263
+ - <button {{on 'click' blog.retry}}>Retry</button>
264
+
265
+ {{/let}}
266
+ ```
267
+
268
+ **in strict mode**
269
+
270
+ See: [First-class Component Templates](https://github.com/emberjs/rfcs/pull/779)
271
+
272
+ ```jsx
273
+ import { QueryRecord } from 'ember-data-resources';
274
+
275
+ <template>
276
+ {{#let (QueryRecord 'blog' (hash ...)) as |blog|}}
277
+ ...
278
+ {{/let}}
279
+ </template>
280
+ ```
281
+
282
+ Contributing
283
+ ------------------------------------------------------------------------------
284
+
285
+ See the [Contributing](CONTRIBUTING.md) guide for details.
286
+
287
+
288
+ License
289
+ ------------------------------------------------------------------------------
290
+
291
+ This project is licensed under the [MIT License](LICENSE.md).
@@ -0,0 +1,13 @@
1
+ class IdRequiredError extends TypeError {
2
+ constructor(modelName) {
3
+ super(`While trying to request a resource from ${modelName}, the ID was either null or undefined, and the ID is required for fetching resources`);
4
+ }
5
+ }
6
+ class IdTypeError extends TypeError {
7
+ constructor(modelName, id) {
8
+ super(`While trying to request a resource from ${modelName}, the ID was of invalid type ${typeof id}: only string and number are supported`);
9
+ }
10
+ }
11
+
12
+ export { IdRequiredError, IdTypeError };
13
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sources":["../../../src/-private/resources/errors.ts"],"sourcesContent":["export class IdRequiredError extends TypeError {\n constructor(modelName: string) {\n super(\n `While trying to request a resource from ${modelName}, the ID was either null or undefined, and the ID is required for fetching resources`,\n );\n }\n}\n\nexport class IdTypeError extends TypeError {\n constructor(modelName: string, id: unknown) {\n super(\n `While trying to request a resource from ${modelName}, the ID was of invalid type ${typeof id}: only string and number are supported`,\n );\n }\n}\n"],"names":["IdRequiredError","TypeError","constructor","modelName","IdTypeError","id"],"mappings":"AAAO,MAAMA,eAAe,SAASC,SAAS,CAAC;EAC7CC,WAAWA,CAACC,SAAiB,EAAE;AAC7B,IAAA,KAAK,CACF,CAAA,wCAAA,EAA0CA,SAAU,CAAA,oFAAA,CACvD,CAAC,CAAA;AACH,GAAA;AACF,CAAA;AAEO,MAAMC,WAAW,SAASH,SAAS,CAAC;AACzCC,EAAAA,WAAWA,CAACC,SAAiB,EAAEE,EAAW,EAAE;AAC1C,IAAA,KAAK,CACF,CAA0CF,wCAAAA,EAAAA,SAAU,gCAA+B,OAAOE,EAAG,wCAChG,CAAC,CAAA;AACH,GAAA;AACF;;;;"}
@@ -0,0 +1,30 @@
1
+ import { _ as _applyDecoratedDescriptor, R as Request, a as _initializerDefineProperty } from '../../request-D75_GC-a.js';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { isDestroyed, isDestroying } from '@ember/destroyable';
4
+ import { action } from '@ember/object';
5
+
6
+ var _class, _descriptor;
7
+ let FindAll = (_class = class FindAll extends Request {
8
+ constructor(...args) {
9
+ super(...args);
10
+ _initializerDefineProperty(this, "_records", _descriptor, this);
11
+ }
12
+ async __WRAPPED_FUNCTION__([modelName], {
13
+ options
14
+ }) {
15
+ const records = await this.store.findAll(modelName, options);
16
+ if (isDestroyed(this) || isDestroying(this)) return;
17
+ this._records = records;
18
+ }
19
+ get records() {
20
+ return this._records;
21
+ }
22
+ }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "_records", [tracked], {
23
+ configurable: true,
24
+ enumerable: true,
25
+ writable: true,
26
+ initializer: null
27
+ }), _applyDecoratedDescriptor(_class.prototype, "__WRAPPED_FUNCTION__", [action], Object.getOwnPropertyDescriptor(_class.prototype, "__WRAPPED_FUNCTION__"), _class.prototype)), _class);
28
+
29
+ export { FindAll };
30
+ //# sourceMappingURL=find-all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-all.js","sources":["../../../src/-private/resources/find-all.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport { isDestroyed, isDestroying } from '@ember/destroyable';\nimport { action } from '@ember/object';\n\nimport { Request } from './request';\n\nimport type ArrayProxy from '@ember/array/proxy';\nimport type Store from '@ember-data/store';\n\nexport type FindAllOptions = Parameters<Store['findAll']>[1];\n\ntype PositionalArgs = [string];\nexport interface NamedArgs {\n options: FindAllOptions;\n}\n\nexport interface Args {\n named: NamedArgs;\n positional: PositionalArgs;\n}\n\nexport class FindAll<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {\n @tracked private _records: ArrayProxy<Model> | undefined;\n\n @action\n async __WRAPPED_FUNCTION__([modelName]: PositionalArgs, { options }: NamedArgs): Promise<void> {\n const records = await this.store.findAll(modelName as never, options);\n\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this._records = records;\n }\n\n get records(): ArrayProxy<Model> | undefined {\n return this._records;\n }\n}\n"],"names":["FindAll","_class","Request","constructor","args","_initializerDefineProperty","_descriptor","__WRAPPED_FUNCTION__","modelName","options","records","store","findAll","isDestroyed","isDestroying","_records","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;AAqBaA,IAAAA,OAAO,IAAAC,MAAA,GAAb,MAAMD,OAAO,SAA+CE,OAAO,CAAY;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,mBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAGpF,EAAA,MACMC,oBAAoBA,CAAC,CAACC,SAAS,CAAiB,EAAE;AAAEC,IAAAA,OAAAA;AAAmB,GAAC,EAAiB;AAC7F,IAAA,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACC,KAAK,CAACC,OAAO,CAACJ,SAAS,EAAWC,OAAO,CAAC,CAAA;IAErE,IAAII,WAAW,CAAC,IAAI,CAAC,IAAIC,YAAY,CAAC,IAAI,CAAC,EAAE,OAAA;IAE7C,IAAI,CAACC,QAAQ,GAAGL,OAAO,CAAA;AACzB,GAAA;EAEA,IAAIA,OAAOA,GAAkC;IAC3C,OAAO,IAAI,CAACK,QAAQ,CAAA;AACtB,GAAA;AACF,CAAC,GAAAT,WAAA,GAAAU,yBAAA,CAAAf,MAAA,CAAAgB,SAAA,EAAA,UAAA,EAAA,CAdEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAAN,CAAAA,EAAAA,yBAAA,CAAAf,MAAA,CAAAgB,SAAA,EAEPM,sBAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAAxB,MAAA,CAAAgB,SAAA,EAAA,sBAAA,CAAA,EAAAhB,MAAA,CAAAgB,SAAA,IAAAhB,MAAA;;;;"}
@@ -0,0 +1,44 @@
1
+ import { _ as _applyDecoratedDescriptor, R as Request, a as _initializerDefineProperty } from '../../request-D75_GC-a.js';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { isDestroyed, isDestroying } from '@ember/destroyable';
4
+ import { action } from '@ember/object';
5
+ import { waitFor } from '@ember/test-waiters';
6
+ import { IdRequiredError, IdTypeError } from './errors.js';
7
+
8
+ var _class, _descriptor;
9
+ let FindRecord = (_class = class FindRecord extends Request {
10
+ constructor(...args) {
11
+ super(...args);
12
+ _initializerDefineProperty(this, "_record", _descriptor, this);
13
+ }
14
+ async __WRAPPED_FUNCTION__([modelName, id], {
15
+ options
16
+ }) {
17
+ /**
18
+ * ember-data forbids usage of invalid arguments
19
+ * in JS, this is typically fine as we can also try-catch, but
20
+ * since this *might* be used in a template as well as JS, we need to instead
21
+ * throw our own error that gives a bit more context to the user so
22
+ * they can pass in the correct arguments
23
+ */
24
+ if (id === null || id === undefined) {
25
+ throw new IdRequiredError(modelName);
26
+ } else if (typeof id !== 'string' && typeof id !== 'number') {
27
+ throw new IdTypeError(modelName, id);
28
+ }
29
+ const record = await this.store.findRecord(modelName, id, options);
30
+ if (isDestroyed(this) || isDestroying(this)) return;
31
+ this._record = record;
32
+ }
33
+ get record() {
34
+ return this._record;
35
+ }
36
+ }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "_record", [tracked], {
37
+ configurable: true,
38
+ enumerable: true,
39
+ writable: true,
40
+ initializer: null
41
+ }), _applyDecoratedDescriptor(_class.prototype, "__WRAPPED_FUNCTION__", [action, waitFor], Object.getOwnPropertyDescriptor(_class.prototype, "__WRAPPED_FUNCTION__"), _class.prototype)), _class);
42
+
43
+ export { FindRecord };
44
+ //# sourceMappingURL=find-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-record.js","sources":["../../../src/-private/resources/find-record.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport { isDestroyed, isDestroying } from '@ember/destroyable';\nimport { action } from '@ember/object';\nimport { waitFor } from '@ember/test-waiters';\n\nimport { IdRequiredError, IdTypeError } from './errors';\nimport { Request } from './request';\n\nimport type { Id } from './types';\nimport type Store from '@ember-data/store';\n\nexport type FindRecordOptions = Parameters<Store['findRecord']>[2];\n\ntype PositionalArgs = [string, Id];\nexport interface NamedArgs {\n options: FindRecordOptions;\n}\n\nexport interface Args {\n named: NamedArgs;\n positional: PositionalArgs;\n}\n\nexport class FindRecord<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {\n @tracked private _record: Model | undefined;\n\n @action\n @waitFor\n async __WRAPPED_FUNCTION__([modelName, id]: PositionalArgs, { options }: NamedArgs) {\n /**\n * ember-data forbids usage of invalid arguments\n * in JS, this is typically fine as we can also try-catch, but\n * since this *might* be used in a template as well as JS, we need to instead\n * throw our own error that gives a bit more context to the user so\n * they can pass in the correct arguments\n */\n if (id === null || id === undefined) {\n throw new IdRequiredError(modelName);\n } else if (typeof id !== 'string' && typeof id !== 'number') {\n throw new IdTypeError(modelName, id);\n }\n\n const record = await this.store.findRecord(modelName as never, id, options);\n\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this._record = record;\n }\n\n get record(): Model | undefined {\n return this._record;\n }\n}\n"],"names":["FindRecord","_class","Request","constructor","args","_initializerDefineProperty","_descriptor","__WRAPPED_FUNCTION__","modelName","id","options","undefined","IdRequiredError","IdTypeError","record","store","findRecord","isDestroyed","isDestroying","_record","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","waitFor","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;AAuBaA,IAAAA,UAAU,IAAAC,MAAA,GAAhB,MAAMD,UAAU,SAA+CE,OAAO,CAAY;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,kBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAGvF,EAAA,MAEMC,oBAAoBA,CAAC,CAACC,SAAS,EAAEC,EAAE,CAAiB,EAAE;AAAEC,IAAAA,OAAAA;AAAmB,GAAC,EAAE;AAClF;AACJ;AACA;AACA;AACA;AACA;AACA;AACI,IAAA,IAAID,EAAE,KAAK,IAAI,IAAIA,EAAE,KAAKE,SAAS,EAAE;AACnC,MAAA,MAAM,IAAIC,eAAe,CAACJ,SAAS,CAAC,CAAA;KACrC,MAAM,IAAI,OAAOC,EAAE,KAAK,QAAQ,IAAI,OAAOA,EAAE,KAAK,QAAQ,EAAE;AAC3D,MAAA,MAAM,IAAII,WAAW,CAACL,SAAS,EAAEC,EAAE,CAAC,CAAA;AACtC,KAAA;AAEA,IAAA,MAAMK,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAACC,UAAU,CAACR,SAAS,EAAWC,EAAE,EAAEC,OAAO,CAAC,CAAA;IAE3E,IAAIO,WAAW,CAAC,IAAI,CAAC,IAAIC,YAAY,CAAC,IAAI,CAAC,EAAE,OAAA;IAE7C,IAAI,CAACC,OAAO,GAAGL,MAAM,CAAA;AACvB,GAAA;EAEA,IAAIA,MAAMA,GAAsB;IAC9B,OAAO,IAAI,CAACK,OAAO,CAAA;AACrB,GAAA;AACF,CAAC,GAAAb,WAAA,GAAAc,yBAAA,CAAAnB,MAAA,CAAAoB,SAAA,EAAA,SAAA,EAAA,CA5BEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAAN,CAAAA,EAAAA,yBAAA,CAAAnB,MAAA,CAAAoB,SAAA,EAEPM,sBAAAA,EAAAA,CAAAA,MAAM,EACNC,OAAO,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAA7B,MAAA,CAAAoB,SAAA,2BAAApB,MAAA,CAAAoB,SAAA,CAAA,GAAApB,MAAA;;;;"}
@@ -0,0 +1,30 @@
1
+ import { _ as _applyDecoratedDescriptor, R as Request, a as _initializerDefineProperty } from '../../request-D75_GC-a.js';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { isDestroyed, isDestroying } from '@ember/destroyable';
4
+ import { action } from '@ember/object';
5
+
6
+ var _class, _descriptor;
7
+ let QueryRecord = (_class = class QueryRecord extends Request {
8
+ constructor(...args) {
9
+ super(...args);
10
+ _initializerDefineProperty(this, "_record", _descriptor, this);
11
+ }
12
+ async __WRAPPED_FUNCTION__([modelName, query], {
13
+ options
14
+ }) {
15
+ const record = await this.store.queryRecord(modelName, query, options);
16
+ if (isDestroyed(this) || isDestroying(this)) return;
17
+ this._record = record;
18
+ }
19
+ get record() {
20
+ return this._record;
21
+ }
22
+ }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "_record", [tracked], {
23
+ configurable: true,
24
+ enumerable: true,
25
+ writable: true,
26
+ initializer: null
27
+ }), _applyDecoratedDescriptor(_class.prototype, "__WRAPPED_FUNCTION__", [action], Object.getOwnPropertyDescriptor(_class.prototype, "__WRAPPED_FUNCTION__"), _class.prototype)), _class);
28
+
29
+ export { QueryRecord };
30
+ //# sourceMappingURL=query-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-record.js","sources":["../../../src/-private/resources/query-record.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport { isDestroyed, isDestroying } from '@ember/destroyable';\nimport { action } from '@ember/object';\n\nimport { Request } from './request';\n\nimport type Store from '@ember-data/store';\n\ntype QueryParams = Parameters<Store['queryRecord']>;\nexport type QueryRecordQuery = QueryParams[1];\nexport type QueryRecordOptions = QueryParams[2];\n\ntype PositionalArgs = [string, QueryRecordQuery];\nexport interface NamedArgs {\n options: QueryRecordOptions;\n}\n\nexport interface Args {\n named: NamedArgs;\n positional: PositionalArgs;\n}\n\nexport class QueryRecord<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {\n @tracked private _record: Model | undefined;\n\n @action\n async __WRAPPED_FUNCTION__([modelName, query]: PositionalArgs, { options }: NamedArgs) {\n const record = await this.store.queryRecord(modelName as never, query, options);\n\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this._record = record;\n }\n\n get record(): Model | undefined {\n return this._record;\n }\n}\n"],"names":["QueryRecord","_class","Request","constructor","args","_initializerDefineProperty","_descriptor","__WRAPPED_FUNCTION__","modelName","query","options","record","store","queryRecord","isDestroyed","isDestroying","_record","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;AAsBaA,IAAAA,WAAW,IAAAC,MAAA,GAAjB,MAAMD,WAAW,SAA+CE,OAAO,CAAY;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,0BAAA,kBAAAC,WAAA,EAAA,IAAA,CAAA,CAAA;AAAA,GAAA;AAGxF,EAAA,MACMC,oBAAoBA,CAAC,CAACC,SAAS,EAAEC,KAAK,CAAiB,EAAE;AAAEC,IAAAA,OAAAA;AAAmB,GAAC,EAAE;AACrF,IAAA,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAACC,WAAW,CAACL,SAAS,EAAWC,KAAK,EAAEC,OAAO,CAAC,CAAA;IAE/E,IAAII,WAAW,CAAC,IAAI,CAAC,IAAIC,YAAY,CAAC,IAAI,CAAC,EAAE,OAAA;IAE7C,IAAI,CAACC,OAAO,GAAGL,MAAM,CAAA;AACvB,GAAA;EAEA,IAAIA,MAAMA,GAAsB;IAC9B,OAAO,IAAI,CAACK,OAAO,CAAA;AACrB,GAAA;AACF,CAAC,GAAAV,WAAA,GAAAW,yBAAA,CAAAhB,MAAA,CAAAiB,SAAA,EAAA,SAAA,EAAA,CAdEC,OAAO,CAAA,EAAA;EAAAC,YAAA,EAAA,IAAA;EAAAC,UAAA,EAAA,IAAA;EAAAC,QAAA,EAAA,IAAA;EAAAC,WAAA,EAAA,IAAA;AAAA,CAAAN,CAAAA,EAAAA,yBAAA,CAAAhB,MAAA,CAAAiB,SAAA,EAEPM,sBAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAAzB,MAAA,CAAAiB,SAAA,EAAA,sBAAA,CAAA,EAAAjB,MAAA,CAAAiB,SAAA,IAAAjB,MAAA;;;;"}
@@ -0,0 +1,30 @@
1
+ import { _ as _applyDecoratedDescriptor, R as Request, a as _initializerDefineProperty } from '../../request-D75_GC-a.js';
2
+ import { tracked } from '@glimmer/tracking';
3
+ import { isDestroyed, isDestroying } from '@ember/destroyable';
4
+ import { action } from '@ember/object';
5
+
6
+ var _class, _descriptor;
7
+ let Query = (_class = class Query extends Request {
8
+ constructor(...args) {
9
+ super(...args);
10
+ _initializerDefineProperty(this, "_records", _descriptor, this);
11
+ }
12
+ async __WRAPPED_FUNCTION__([modelName, query], {
13
+ options
14
+ }) {
15
+ const records = await this.store.query(modelName, query, options);
16
+ if (isDestroyed(this) || isDestroying(this)) return;
17
+ this._records = records;
18
+ }
19
+ get records() {
20
+ return this._records;
21
+ }
22
+ }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "_records", [tracked], {
23
+ configurable: true,
24
+ enumerable: true,
25
+ writable: true,
26
+ initializer: null
27
+ }), _applyDecoratedDescriptor(_class.prototype, "__WRAPPED_FUNCTION__", [action], Object.getOwnPropertyDescriptor(_class.prototype, "__WRAPPED_FUNCTION__"), _class.prototype)), _class);
28
+
29
+ export { Query };
30
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sources":["../../../src/-private/resources/query.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport { isDestroyed, isDestroying } from '@ember/destroyable';\nimport { action } from '@ember/object';\n\nimport { Request } from './request';\n\nimport type ArrayProxy from '@ember/array/proxy';\nimport type Store from '@ember-data/store';\n\ntype QueryParams = Parameters<Store['query']>;\nexport type QueryQuery = QueryParams[1];\nexport type QueryOptions = QueryParams[2];\n\ntype PositionalArgs = [string, QueryQuery];\nexport interface NamedArgs {\n options: QueryOptions;\n}\n\nexport interface Args {\n named: NamedArgs;\n positional: PositionalArgs;\n}\n\nexport class Query<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {\n @tracked private _records: ArrayProxy<Model> | undefined;\n\n @action\n async __WRAPPED_FUNCTION__([modelName, query]: PositionalArgs, { options }: NamedArgs) {\n const records = await this.store.query(modelName as never, query, options);\n\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this._records = records;\n }\n\n get records(): ArrayProxy<Model> | undefined {\n return this._records;\n }\n}\n"],"names":["Query","_class","Request","constructor","args","_initializerDefineProperty","_descriptor","__WRAPPED_FUNCTION__","modelName","query","options","records","store","isDestroyed","isDestroying","_records","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getO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3
+ import '@ember/debug';
4
+ import '@ember/destroyable';
5
+ import '@ember/object';
6
+ import '@ember/service';
7
+ import '@ember/test-waiters';
8
+ import 'ember-modify-based-class-resource';
9
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export { default } from "ember-data-resources/loose-mode-compat/helpers/find-all";
@@ -0,0 +1 @@
1
+ export { default } from "ember-data-resources/loose-mode-compat/helpers/find-record";
@@ -0,0 +1 @@
1
+ export { default } from "ember-data-resources/loose-mode-compat/helpers/query-record";
@@ -0,0 +1 @@
1
+ export { default } from "ember-data-resources/loose-mode-compat/helpers/query";
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { FindAll } from './-private/resources/find-all.js';
2
+ export { FindRecord } from './-private/resources/find-record.js';
3
+ export { Query } from './-private/resources/query.js';
4
+ export { QueryRecord } from './-private/resources/query-record.js';
5
+ export { findAll, findRecord, query, queryRecord } from './js-helpers.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,97 @@
1
+ import { FindAll } from './-private/resources/find-all.js';
2
+ import { FindRecord } from './-private/resources/find-record.js';
3
+ import { Query } from './-private/resources/query.js';
4
+ import { QueryRecord } from './-private/resources/query-record.js';
5
+
6
+ /* eslint-disable @typescript-eslint/ban-types */
7
+ /**
8
+ * Wrapper around store.findRecord
9
+ */
10
+ function findRecord(destroyable, modelName, thunk) {
11
+ return FindRecord.from(destroyable, () => {
12
+ const reified = thunk();
13
+ let id;
14
+ let options;
15
+ if (Array.isArray(reified)) {
16
+ id = reified[0];
17
+ options = reified[1] ?? {};
18
+ } else {
19
+ id = reified;
20
+ options = {};
21
+ }
22
+ return {
23
+ positional: [modelName, id],
24
+ named: {
25
+ options
26
+ }
27
+ };
28
+ // Cast needed Until min-supported TS is 4.7
29
+ });
30
+ }
31
+ /**
32
+ * Wrapper around store.findAll
33
+ */
34
+ function findAll(destroyable, modelName, thunk) {
35
+ return FindAll.from(destroyable, () => {
36
+ const reified = thunk?.() || {};
37
+ const options = 'options' in reified ? reified.options : reified;
38
+ return {
39
+ positional: [modelName],
40
+ named: {
41
+ options
42
+ }
43
+ };
44
+ // Cast needed Until min-supported TS is 4.7
45
+ });
46
+ }
47
+ /**
48
+ * Wrapper around store.query
49
+ */
50
+ function query(destroyable, modelName, thunk) {
51
+ return Query.from(destroyable, () => {
52
+ const reified = thunk();
53
+ if (Array.isArray(reified)) {
54
+ const [query, options] = reified;
55
+ return {
56
+ positional: [modelName, query],
57
+ named: {
58
+ options: options || {}
59
+ }
60
+ };
61
+ }
62
+ return {
63
+ positional: [modelName, reified],
64
+ named: {
65
+ options: {}
66
+ }
67
+ };
68
+ // Cast needed Until min-supported TS is 4.7
69
+ });
70
+ }
71
+ /**
72
+ * Wrapper around store.queryRecord
73
+ */
74
+ function queryRecord(destroyable, modelName, thunk) {
75
+ return QueryRecord.from(destroyable, () => {
76
+ const reified = thunk();
77
+ if (Array.isArray(reified)) {
78
+ const [query, options] = reified;
79
+ return {
80
+ positional: [modelName, query],
81
+ named: {
82
+ options: options || {}
83
+ }
84
+ };
85
+ }
86
+ return {
87
+ positional: [modelName, reified],
88
+ named: {
89
+ options: {}
90
+ }
91
+ };
92
+ // Cast needed Until min-supported TS is 4.7
93
+ });
94
+ }
95
+
96
+ export { findAll, findRecord, query, queryRecord };
97
+ //# sourceMappingURL=js-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"js-helpers.js","sources":["../src/js-helpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-types */\nimport { FindAll } from './-private/resources/find-all';\nimport { FindRecord } from './-private/resources/find-record';\nimport { Query } from './-private/resources/query';\nimport { QueryRecord } from './-private/resources/query-record';\n\nimport type { FindAllOptions } from './-private/resources/find-all';\nimport type { FindRecordOptions } from './-private/resources/find-record';\nimport type { QueryOptions, QueryQuery } from './-private/resources/query';\nimport type { QueryRecordOptions, QueryRecordQuery } from './-private/resources/query-record';\nimport type { Id } from './-private/resources/types';\n\ntype FindRecordThunkResult = Id | [Id] | [Id, FindRecordOptions];\n\n/**\n * Wrapper around store.findRecord\n */\nexport function findRecord<Model = unknown>(\n destroyable: object,\n modelName: string,\n thunk: () => FindRecordThunkResult,\n) {\n return FindRecord.from(destroyable, () => {\n const reified = thunk();\n let id: Id;\n let options: FindRecordOptions;\n\n if (Array.isArray(reified)) {\n id = reified[0];\n options = reified[1] ?? {};\n } else {\n id = reified as Id;\n options = {};\n }\n\n return {\n positional: [modelName, id],\n named: {\n options,\n },\n };\n // Cast needed Until min-supported TS is 4.7\n }) as FindRecord<Model>;\n}\n\ntype FindAllThunkResult = { options: FindAllOptions } | FindAllOptions | void;\n\n/**\n * Wrapper around store.findAll\n */\nexport function findAll<Model = unknown>(\n destroyable: object,\n modelName: string,\n thunk?: () => FindAllThunkResult,\n) {\n return FindAll.from(destroyable, () => {\n const reified = thunk?.() || {};\n const options = 'options' in reified ? reified.options : reified;\n\n return {\n positional: [modelName],\n named: {\n options,\n },\n };\n // Cast needed Until min-supported TS is 4.7\n }) as FindAll<Model>;\n}\n\ntype QueryThunkResult = QueryQuery | [QueryQuery] | [QueryQuery, QueryOptions];\n\n/**\n * Wrapper around store.query\n */\nexport function query<Model = unknown>(\n destroyable: object,\n modelName: string,\n thunk: () => QueryThunkResult,\n) {\n return Query.from(destroyable, () => {\n const reified = thunk();\n\n if (Array.isArray(reified)) {\n const [query, options] = reified;\n\n return {\n positional: [modelName, query],\n named: {\n options: options || {},\n },\n };\n }\n\n return {\n positional: [modelName, reified],\n named: {\n options: {},\n },\n };\n // Cast needed Until min-supported TS is 4.7\n }) as Query<Model>;\n}\n\ntype QueryRecordThunkResult =\n | QueryRecordQuery\n | [QueryRecordQuery]\n | [QueryRecordQuery, QueryRecordOptions];\n\n/**\n * Wrapper around store.queryRecord\n */\nexport function queryRecord<Model = unknown>(\n destroyable: object,\n modelName: string,\n thunk: () => QueryRecordThunkResult,\n) {\n return QueryRecord.from(destroyable, () => {\n const reified = thunk();\n\n if (Array.isArray(reified)) {\n const [query, options] = reified;\n\n return {\n positional: [modelName, query],\n named: {\n options: options || {},\n },\n };\n }\n\n return {\n positional: [modelName, reified],\n named: {\n options: {},\n },\n };\n // Cast needed Until min-supported TS is 4.7\n }) as QueryRecord<Model>;\n}\n"],"names":["findRecord","destroyable","modelName","thunk","FindRecord","from","reified","id","options","Array","isArray","positional","named","findAll","FindAll","query","Query","queryRecord","QueryRecord"],"mappings":";;;;;AAAA;AAcA;AACA;AACA;AACO,SAASA,UAAUA,CACxBC,WAAmB,EACnBC,SAAiB,EACjBC,KAAkC,EAClC;AACA,EAAA,OAAOC,UAAU,CAACC,IAAI,CAACJ,WAAW,EAAE,MAAM;AACxC,IAAA,MAAMK,OAAO,GAAGH,KAAK,EAAE,CAAA;AACvB,IAAA,IAAII,EAAM,CAAA;AACV,IAAA,IAAIC,OAA0B,CAAA;AAE9B,IAAA,IAAIC,KAAK,CAACC,OAAO,CAACJ,OAAO,CAAC,EAAE;AAC1BC,MAAAA,EAAE,GAAGD,OAAO,CAAC,CAAC,CAAC,CAAA;AACfE,MAAAA,OAAO,GAAGF,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;AAC5B,KAAC,MAAM;AACLC,MAAAA,EAAE,GAAGD,OAAa,CAAA;MAClBE,OAAO,GAAG,EAAE,CAAA;AACd,KAAA;IAEA,OAAO;AACLG,MAAAA,UAAU,EAAE,CAACT,SAAS,EAAEK,EAAE,CAAC;AAC3BK,MAAAA,KAAK,EAAE;AACLJ,QAAAA,OAAAA;AACF,OAAA;KACD,CAAA;AACD;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ACnBC,SAAiB,EACjBC,KAAmC,EACnC;AACA,EAAA,OAAOe,WAAW,CAACb,IAAI,CAACJ,WAAW,EAAE,MAAM;AACzC,IAAA,MAAMK,OAAO,GAAGH,KAAK,EAAE,CAAA;AAEvB,IAAA,IAAIM,KAAK,CAACC,OAAO,CAACJ,OAAO,CAAC,EAAE;AAC1B,MAAA,MAAM,CAACS,KAAK,EAAEP,OAAO,CAAC,GAAGF,OAAO,CAAA;MAEhC,OAAO;AACLK,QAAAA,UAAU,EAAE,CAACT,SAAS,EAAEa,KAAK,CAAC;AAC9BH,QAAAA,KAAK,EAAE;UACLJ,OAAO,EAAEA,OAAO,IAAI,EAAC;AACvB,SAAA;OACD,CAAA;AACH,KAAA;IAEA,OAAO;AACLG,MAAAA,UAAU,EAAE,CAACT,SAAS,EAAEI,OAAO,CAAC;AAChCM,MAAAA,KAAK,EAAE;AACLJ,QAAAA,OAAO,EAAE,EAAC;AACZ,OAAA;KACD,CAAA;AACD;AACF,GAAC,CAAC,CAAA;AACJ;;;;"}
@@ -0,0 +1,9 @@
1
+ import { FindAll } from '../../-private/resources/find-all.js';
2
+ import '../../-private/resources/find-record.js';
3
+ import '../../-private/resources/query.js';
4
+ import '../../-private/resources/query-record.js';
5
+
6
+
7
+
8
+ export { FindAll as default };
9
+ //# sourceMappingURL=find-all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-all.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,9 @@
1
+ import '../../-private/resources/find-all.js';
2
+ import { FindRecord } from '../../-private/resources/find-record.js';
3
+ import '../../-private/resources/query.js';
4
+ import '../../-private/resources/query-record.js';
5
+
6
+
7
+
8
+ export { FindRecord as default };
9
+ //# sourceMappingURL=find-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-record.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,9 @@
1
+ import '../../-private/resources/find-all.js';
2
+ import '../../-private/resources/find-record.js';
3
+ import '../../-private/resources/query.js';
4
+ import { QueryRecord } from '../../-private/resources/query-record.js';
5
+
6
+
7
+
8
+ export { QueryRecord as default };
9
+ //# sourceMappingURL=query-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-record.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,9 @@
1
+ import '../../-private/resources/find-all.js';
2
+ import '../../-private/resources/find-record.js';
3
+ import { Query } from '../../-private/resources/query.js';
4
+ import '../../-private/resources/query-record.js';
5
+
6
+
7
+
8
+ export { Query as default };
9
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,142 @@
1
+ import { tracked } from '@glimmer/tracking';
2
+ import { assert } from '@ember/debug';
3
+ import { isDestroyed, isDestroying } from '@ember/destroyable';
4
+ import { action } from '@ember/object';
5
+ import * as emberService from '@ember/service';
6
+ import { waitFor, waitForPromise } from '@ember/test-waiters';
7
+ import { Resource } from 'ember-modify-based-class-resource';
8
+
9
+ function _initializerDefineProperty(target, property, descriptor, context) {
10
+ if (!descriptor) return;
11
+ Object.defineProperty(target, property, {
12
+ enumerable: descriptor.enumerable,
13
+ configurable: descriptor.configurable,
14
+ writable: descriptor.writable,
15
+ value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
16
+ });
17
+ }
18
+
19
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
20
+ var desc = {};
21
+ Object.keys(descriptor).forEach(function (key) {
22
+ desc[key] = descriptor[key];
23
+ });
24
+ desc.enumerable = !!desc.enumerable;
25
+ desc.configurable = !!desc.configurable;
26
+ if ('value' in desc || desc.initializer) {
27
+ desc.writable = true;
28
+ }
29
+ desc = decorators.slice().reverse().reduce(function (desc, decorator) {
30
+ return decorator(target, property, desc) || desc;
31
+ }, desc);
32
+ if (context && desc.initializer !== void 0) {
33
+ desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
34
+ desc.initializer = undefined;
35
+ }
36
+ if (desc.initializer === void 0) {
37
+ Object.defineProperty(target, property, desc);
38
+ desc = null;
39
+ }
40
+ return desc;
41
+ }
42
+
43
+ var _class, _descriptor, _descriptor2, _descriptor3, _descriptor4;
44
+ const service = emberService.service ?? emberService.inject;
45
+ let Request = (_class = class Request extends Resource {
46
+ constructor(...args) {
47
+ super(...args);
48
+ _initializerDefineProperty(this, "store", _descriptor, this);
49
+ _initializerDefineProperty(this, "error", _descriptor2, this);
50
+ _initializerDefineProperty(this, "isLoading", _descriptor3, this);
51
+ _initializerDefineProperty(this, "hasRan", _descriptor4, this);
52
+ }
53
+ /**
54
+ * Args saved, untracked, for retrying
55
+ */
56
+
57
+ modify(positional, named) {
58
+ this.positional = positional || [];
59
+ this.named = named || {};
60
+
61
+ /**
62
+ * We need to consume all arguments here so that we correctly respond to updates to
63
+ * dirtied source data.
64
+ *
65
+ * e.g.: when an id changes that is passed to findRecord, we re-fetch.
66
+ */
67
+ this.__REQUEST_FUNCTION__([...positional], {
68
+ ...named
69
+ });
70
+ }
71
+ async __WRAPPED_FUNCTION__(_positional, _named) {
72
+ throw new Error('Not Implemented');
73
+ }
74
+ get isSuccess() {
75
+ return !this.error;
76
+ }
77
+ get isError() {
78
+ return Boolean(this.error);
79
+ }
80
+ get records() {
81
+ return assert(`The resource for ${this.constructor.name} does not have a records property. ` + `You might be looking for .record instead.`);
82
+ }
83
+ get record() {
84
+ return assert(`The resource for ${this.constructor.name} does not have a record property. ` + `You might be looking for .records instead.`);
85
+ }
86
+ async retry() {
87
+ return waitForPromise(this.__WRAPPED_FUNCTION__(this.positional, this.named));
88
+ }
89
+ async __REQUEST_FUNCTION__(_positional, _named) {
90
+ /**
91
+ * Args are already consumed, but let's delay doing anything
92
+ * until we can get out of a tracking frame.
93
+ */
94
+ await Promise.resolve();
95
+ if (isDestroyed(this) || isDestroying(this)) return;
96
+ this.error = undefined;
97
+ this.isLoading = true;
98
+ try {
99
+ await this.retry();
100
+ } catch (e) {
101
+ if (isDestroyed(this) || isDestroying(this)) return;
102
+ if (e instanceof Error) {
103
+ this.error = e;
104
+ } else {
105
+ // How likely is this to happen?
106
+ throw e;
107
+ }
108
+ }
109
+ if (isDestroyed(this) || isDestroying(this)) {
110
+ return;
111
+ }
112
+ this.isLoading = false;
113
+ this.hasRan = true;
114
+ }
115
+ }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "store", [service], {
116
+ configurable: true,
117
+ enumerable: true,
118
+ writable: true,
119
+ initializer: null
120
+ }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "error", [tracked], {
121
+ configurable: true,
122
+ enumerable: true,
123
+ writable: true,
124
+ initializer: null
125
+ }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, "isLoading", [tracked], {
126
+ configurable: true,
127
+ enumerable: true,
128
+ writable: true,
129
+ initializer: function () {
130
+ return false;
131
+ }
132
+ }), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, "hasRan", [tracked], {
133
+ configurable: true,
134
+ enumerable: true,
135
+ writable: true,
136
+ initializer: function () {
137
+ return false;
138
+ }
139
+ }), _applyDecoratedDescriptor(_class.prototype, "retry", [action], Object.getOwnPropertyDescriptor(_class.prototype, "retry"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "__REQUEST_FUNCTION__", [action, waitFor], Object.getOwnPropertyDescriptor(_class.prototype, "__REQUEST_FUNCTION__"), _class.prototype)), _class);
140
+
141
+ export { Request as R, _applyDecoratedDescriptor as _, _initializerDefineProperty as a };
142
+ //# sourceMappingURL=request-D75_GC-a.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-D75_GC-a.js","sources":["../node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","../node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js","../src/-private/resources/request.ts"],"sourcesContent":["export default function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}","export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n return desc;\n}","import { tracked } from '@glimmer/tracking';\nimport { assert } from '@ember/debug';\nimport { isDestroyed, isDestroying } from '@ember/destroyable';\nimport { action } from '@ember/object';\nimport * as emberService from '@ember/service';\n\nconst service = emberService.service ?? emberService.inject;\n\nimport { waitFor, waitForPromise } from '@ember/test-waiters';\n\nimport { Resource } from 'ember-modify-based-class-resource';\n\nimport type Store from '@ember-data/store';\n\nexport type FindRecordOptions = Parameters<Store['findRecord']>[2];\n\nexport class Request<Args> extends Resource<Args> {\n @service declare store: Store;\n\n @tracked error: Error | undefined;\n @tracked isLoading = false;\n @tracked hasRan = false;\n\n /**\n * Args saved, untracked, for retrying\n */\n declare positional: unknown[];\n declare named: object;\n\n modify(positional?: unknown[], named?: object) {\n this.positional = positional || [];\n this.named = named || {};\n\n /**\n * We need to consume all arguments here so that we correctly respond to updates to\n * dirtied source data.\n *\n * e.g.: when an id changes that is passed to findRecord, we re-fetch.\n */\n this.__REQUEST_FUNCTION__([...(positional as unknown[])], {\n ...named,\n });\n }\n\n async __WRAPPED_FUNCTION__(_positional: unknown[], _named: object) {\n throw new Error('Not Implemented');\n }\n\n get isSuccess() {\n return !this.error;\n }\n\n get isError() {\n return Boolean(this.error);\n }\n\n get records(): unknown | undefined {\n return assert(\n `The resource for ${this.constructor.name} does not have a records property. ` +\n `You might be looking for .record instead.`,\n );\n }\n\n get record(): unknown | undefined {\n return assert(\n `The resource for ${this.constructor.name} does not have a record property. ` +\n `You might be looking for .records instead.`,\n );\n }\n\n @action\n async retry() {\n return waitForPromise(this.__WRAPPED_FUNCTION__(this.positional, this.named));\n }\n\n @action\n @waitFor\n async __REQUEST_FUNCTION__(_positional: unknown[], _named: object) {\n /**\n * Args are already consumed, but let's delay doing anything\n * until we can get out of a tracking frame.\n */\n await Promise.resolve();\n\n if (isDestroyed(this) || isDestroying(this)) return;\n\n this.error = undefined;\n this.isLoading = true;\n\n try {\n await this.retry();\n } catch (e) {\n if (isDestroyed(this) || isDestroying(this)) return;\n\n if (e instanceof Error) {\n this.error = e;\n } else {\n // How likely is this to happen?\n throw e;\n }\n }\n\n if (isDestroyed(this) || isDestroying(this)) {\n return;\n }\n\n this.isLoading = false;\n this.hasRan = true;\n }\n}\n"],"names":["_initializerDefineProperty","target","property","descriptor","context","Object","defineProperty","enumerable","configurable","writable","value","initializer","call","_applyDecoratedDescriptor","decorators","desc","keys","forEach","key","slice","reverse","reduce","decorator","undefined","service","emberService","inject","Request","_class","Resource","constructor","args","_descriptor","_descriptor2","_descriptor3","_descriptor4","modify","positional","named","__REQUEST_FUNCTION__","__WRAPPED_FUNCTION__","_positional","_named","Error","isSuccess","error","isError","Boolean","records","assert","name","record","retry","waitForPromise","Promise","resolve","isDestroyed","isDestroying","isLoading","e","hasRan","prototype","tracked","action","getOwnPropertyDescriptor","waitFor"],"mappings":";;;;;;;;AAAe,SAASA,0BAA0BA,CAACC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,OAAO,EAAE;EACxF,IAAI,CAACD,UAAU,EAAE,OAAA;AACjBE,EAAAA,MAAM,CAACC,cAAc,CAACL,MAAM,EAA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A,EAAA,IAAA;EAAAE,QAAA,EAAA,IAAA;AAAAE,EAAAA,WAAA,cAAA;AAAA,IAAA,OAAU,KAAK,CAAA;AAAA,GAAA;AAAA,CAAA,CAAA,EAAAE,yBAAA,CAAAe,MAAA,CAAAiC,SAAA,EAAA,OAAA,EAAA,CAiDtBE,MAAM,CAAA1D,EAAAA,MAAA,CAAA2D,wBAAA,CAAApC,MAAA,CAAAiC,SAAA,YAAAjC,MAAA,CAAAiC,SAAA,CAAAhD,EAAAA,yBAAA,CAAAe,MAAA,CAAAiC,SAAA,EAAA,sBAAA,EAAA,CAKNE,MAAM,EACNE,OAAO,GAAA5D,MAAA,CAAA2D,wBAAA,CAAApC,MAAA,CAAAiC,SAAA,EAAA,sBAAA,CAAA,EAAAjC,MAAA,CAAAiC,SAAA,IAAAjC,MAAA;;;;","x_google_ignoreList":[0,1]}
@@ -0,0 +1,8 @@
1
+ declare class IdRequiredError extends TypeError {
2
+ constructor(modelName: string);
3
+ }
4
+ declare class IdTypeError extends TypeError {
5
+ constructor(modelName: string, id: unknown);
6
+ }
7
+ export { IdRequiredError, IdTypeError };
8
+ //# sourceMappingURL=-private/resources/errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"-private/resources/errors.d.ts","sourceRoot":"","sources":["../src/-private/resources/errors.ts"],"names":[],"mappings":"AAAA,cAAa,eAAgB,SAAQ,SAAS;gBAC9B,SAAS,EAAE,MAAM;CAGhC;AACD,cAAa,WAAY,SAAQ,SAAS;gBAC1B,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO;CAG7C"}
@@ -0,0 +1,20 @@
1
+ /// <reference types="ember-data" />
2
+ /// <reference types="ember__array" />
3
+ import { Request } from "./request.js";
4
+ import ArrayProxy from '@ember/array/proxy';
5
+ import Store from '@ember-data/store';
6
+ type FindAllOptions = Parameters<Store['findAll']>[1];
7
+ type PositionalArgs = [string];
8
+ interface NamedArgs {
9
+ options: FindAllOptions;
10
+ }
11
+ interface Args {
12
+ named: NamedArgs;
13
+ positional: PositionalArgs;
14
+ }
15
+ declare class FindAll<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {
16
+ private _records;
17
+ __WRAPPED_FUNCTION__([modelName]: PositionalArgs, { options }: NamedArgs): Promise<void>;
18
+ get records(): ArrayProxy<Model> | undefined;
19
+ }
20
+ export { FindAllOptions, NamedArgs, Args, FindAll };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-all.d.ts","sourceRoot":"","sources":["../../../src/-private/resources/find-all.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7D,KAAK,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/B,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,qBAAa,OAAO,CAAC,KAAK,EAAE,SAAS,SAAS,IAAI,GAAG,IAAI,CAAE,SAAQ,OAAO,CAAC,SAAS,CAAC;IAC1E,OAAO,CAAC,QAAQ,CAAgC;IAGnD,oBAAoB,CAAC,CAAC,SAAS,CAAC,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ9F,IAAI,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS,CAE3C;CACF"}
@@ -0,0 +1,19 @@
1
+ /// <reference types="ember-data" />
2
+ import { Request } from "./request.js";
3
+ import { Id } from "./types.js";
4
+ import Store from '@ember-data/store';
5
+ type FindRecordOptions = Parameters<Store['findRecord']>[2];
6
+ type PositionalArgs = [string, Id];
7
+ interface NamedArgs {
8
+ options: FindRecordOptions;
9
+ }
10
+ interface Args {
11
+ named: NamedArgs;
12
+ positional: PositionalArgs;
13
+ }
14
+ declare class FindRecord<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {
15
+ private _record;
16
+ __WRAPPED_FUNCTION__([modelName, id]: PositionalArgs, { options }: NamedArgs): Promise<void>;
17
+ get record(): Model | undefined;
18
+ }
19
+ export { FindRecordOptions, NamedArgs, Args, FindRecord };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-record.d.ts","sourceRoot":"","sources":["../../../src/-private/resources/find-record.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnE,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnC,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,qBAAa,UAAU,CAAC,KAAK,EAAE,SAAS,SAAS,IAAI,GAAG,IAAI,CAAE,SAAQ,OAAO,CAAC,SAAS,CAAC;IAC7E,OAAO,CAAC,OAAO,CAAoB;IAItC,oBAAoB,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS;IAqBlF,IAAI,MAAM,IAAI,KAAK,GAAG,SAAS,CAE9B;CACF"}
@@ -0,0 +1,20 @@
1
+ /// <reference types="ember-data" />
2
+ import { Request } from "./request.js";
3
+ import Store from '@ember-data/store';
4
+ type QueryParams = Parameters<Store['queryRecord']>;
5
+ type QueryRecordQuery = QueryParams[1];
6
+ type QueryRecordOptions = QueryParams[2];
7
+ type PositionalArgs = [string, QueryRecordQuery];
8
+ interface NamedArgs {
9
+ options: QueryRecordOptions;
10
+ }
11
+ interface Args {
12
+ named: NamedArgs;
13
+ positional: PositionalArgs;
14
+ }
15
+ declare class QueryRecord<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {
16
+ private _record;
17
+ __WRAPPED_FUNCTION__([modelName, query]: PositionalArgs, { options }: NamedArgs): Promise<void>;
18
+ get record(): Model | undefined;
19
+ }
20
+ export { QueryRecordQuery, QueryRecordOptions, NamedArgs, Args, QueryRecord };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-record.d.ts","sourceRoot":"","sources":["../../../src/-private/resources/query-record.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,KAAK,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAC9C,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAEhD,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AACjD,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,qBAAa,WAAW,CAAC,KAAK,EAAE,SAAS,SAAS,IAAI,GAAG,IAAI,CAAE,SAAQ,OAAO,CAAC,SAAS,CAAC;IAC9E,OAAO,CAAC,OAAO,CAAoB;IAGtC,oBAAoB,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS;IAQrF,IAAI,MAAM,IAAI,KAAK,GAAG,SAAS,CAE9B;CACF"}
@@ -0,0 +1,22 @@
1
+ /// <reference types="ember-data" />
2
+ /// <reference types="ember__array" />
3
+ import { Request } from "./request.js";
4
+ import ArrayProxy from '@ember/array/proxy';
5
+ import Store from '@ember-data/store';
6
+ type QueryParams = Parameters<Store['query']>;
7
+ type QueryQuery = QueryParams[1];
8
+ type QueryOptions = QueryParams[2];
9
+ type PositionalArgs = [string, QueryQuery];
10
+ interface NamedArgs {
11
+ options: QueryOptions;
12
+ }
13
+ interface Args {
14
+ named: NamedArgs;
15
+ positional: PositionalArgs;
16
+ }
17
+ declare class Query<Model, LocalArgs extends Args = Args> extends Request<LocalArgs> {
18
+ private _records;
19
+ __WRAPPED_FUNCTION__([modelName, query]: PositionalArgs, { options }: NamedArgs): Promise<void>;
20
+ get records(): ArrayProxy<Model> | undefined;
21
+ }
22
+ export { QueryQuery, QueryOptions, NamedArgs, Args, Query };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/-private/resources/query.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,KAAK,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAE1C,KAAK,cAAc,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC3C,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,qBAAa,KAAK,CAAC,KAAK,EAAE,SAAS,SAAS,IAAI,GAAG,IAAI,CAAE,SAAQ,OAAO,CAAC,SAAS,CAAC;IACxE,OAAO,CAAC,QAAQ,CAAgC;IAGnD,oBAAoB,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS;IAQrF,IAAI,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,SAAS,CAE3C;CACF"}
@@ -0,0 +1,24 @@
1
+ /// <reference types="ember-data" />
2
+ import { Resource } from 'ember-modify-based-class-resource';
3
+ import Store from '@ember-data/store';
4
+ type FindRecordOptions = Parameters<Store['findRecord']>[2];
5
+ declare class Request<Args> extends Resource<Args> {
6
+ store: Store;
7
+ error: Error | undefined;
8
+ isLoading: boolean;
9
+ hasRan: boolean;
10
+ /**
11
+ * Args saved, untracked, for retrying
12
+ */
13
+ positional: unknown[];
14
+ named: object;
15
+ modify(positional?: unknown[], named?: object): void;
16
+ __WRAPPED_FUNCTION__(_positional: unknown[], _named: object): Promise<void>;
17
+ get isSuccess(): boolean;
18
+ get isError(): boolean;
19
+ get records(): unknown | undefined;
20
+ get record(): unknown | undefined;
21
+ retry(): Promise<void>;
22
+ __REQUEST_FUNCTION__(_positional: unknown[], _named: object): Promise<void>;
23
+ }
24
+ export { FindRecordOptions, Request };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/-private/resources/request.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEnE,qBAAa,OAAO,CAAC,IAAI,CAAE,SAAQ,QAAQ,CAAC,IAAI,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;IAErB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,SAAS,UAAS;IAClB,MAAM,UAAS;IAExB;;OAEG;IACK,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IAEtB,MAAM,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM;IAevC,oBAAoB,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM;IAIjE,IAAI,SAAS,YAEZ;IAED,IAAI,OAAO,YAEV;IAED,IAAI,OAAO,IAAI,OAAO,GAAG,SAAS,CAKjC;IAED,IAAI,MAAM,IAAI,OAAO,GAAG,SAAS,CAKhC;IAGK,KAAK;IAML,oBAAoB,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM;CAgClE"}
@@ -0,0 +1,2 @@
1
+ type Id = string | number | null | undefined;
2
+ export { Id };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/-private/resources/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare function _defineProperty(obj: any, key: any, value: any): any;
2
+ export { _defineProperty as default };
@@ -0,0 +1,5 @@
1
+ export { FindAll } from "./-private/resources/find-all.js";
2
+ export { FindRecord } from "./-private/resources/find-record.js";
3
+ export { Query } from "./-private/resources/query.js";
4
+ export { QueryRecord } from "./-private/resources/query-record.js";
5
+ export { findAll, findRecord, query, queryRecord } from "./js-helpers.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGhE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { FindAll, FindAllOptions } from "./-private/resources/find-all.js";
2
+ import { FindRecord, FindRecordOptions } from "./-private/resources/find-record.js";
3
+ import { Query, QueryOptions, QueryQuery } from "./-private/resources/query.js";
4
+ import { QueryRecord, QueryRecordOptions, QueryRecordQuery } from "./-private/resources/query-record.js";
5
+ import { Id } from "./-private/resources/types.js";
6
+ type FindRecordThunkResult = Id | [Id] | [Id, FindRecordOptions];
7
+ /**
8
+ * Wrapper around store.findRecord
9
+ */
10
+ declare function findRecord<Model = unknown>(destroyable: object, modelName: string, thunk: () => FindRecordThunkResult): FindRecord<Model, import("./-private/resources/find-record.js").Args>;
11
+ type FindAllThunkResult = {
12
+ options: FindAllOptions;
13
+ } | FindAllOptions | void;
14
+ /**
15
+ * Wrapper around store.findAll
16
+ */
17
+ declare function findAll<Model = unknown>(destroyable: object, modelName: string, thunk?: () => FindAllThunkResult): FindAll<Model, import("./-private/resources/find-all.js").Args>;
18
+ type QueryThunkResult = QueryQuery | [QueryQuery] | [QueryQuery, QueryOptions];
19
+ /**
20
+ * Wrapper around store.query
21
+ */
22
+ declare function query<Model = unknown>(destroyable: object, modelName: string, thunk: () => QueryThunkResult): Query<Model, import("./-private/resources/query.js").Args>;
23
+ type QueryRecordThunkResult = QueryRecordQuery | [QueryRecordQuery] | [QueryRecordQuery, QueryRecordOptions];
24
+ /**
25
+ * Wrapper around store.queryRecord
26
+ */
27
+ declare function queryRecord<Model = unknown>(destroyable: object, modelName: string, thunk: () => QueryRecordThunkResult): QueryRecord<Model, import("./-private/resources/query-record.js").Args>;
28
+ export { findRecord, findAll, query, queryRecord };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"js-helpers.d.ts","sourceRoot":"","sources":["../src/js-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC9F,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAC;AAErD,KAAK,qBAAqB,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;AAEjE;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,GAAG,OAAO,EACxC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,qBAAqB,sEAuBnC;AAED,KAAK,kBAAkB,GAAG;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,GAAG,cAAc,GAAG,IAAI,CAAC;AAE9E;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,GAAG,OAAO,EACrC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,kBAAkB,gEAcjC;AAED,KAAK,gBAAgB,GAAG,UAAU,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAE/E;;GAEG;AACH,wBAAgB,KAAK,CAAC,KAAK,GAAG,OAAO,EACnC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,gBAAgB,2DAwB9B;AAED,KAAK,sBAAsB,GACvB,gBAAgB,GAChB,CAAC,gBAAgB,CAAC,GAClB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;AAE3C;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,GAAG,OAAO,EACzC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,sBAAsB,wEAwBpC"}
@@ -0,0 +1,2 @@
1
+ import { FindAll } from "../../index.js";
2
+ export { FindAll as default };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-all.d.ts","sourceRoot":"","sources":["../../../src/loose-mode-compat/helpers/find-all.js"],"names":[],"mappings":";wBAAwB,aAAa"}
@@ -0,0 +1,2 @@
1
+ import { FindRecord } from "../../index.js";
2
+ export { FindRecord as default };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-record.d.ts","sourceRoot":"","sources":["../../../src/loose-mode-compat/helpers/find-record.js"],"names":[],"mappings":";2BAA2B,aAAa"}
@@ -0,0 +1,2 @@
1
+ import { QueryRecord } from "../../index.js";
2
+ export { QueryRecord as default };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-record.d.ts","sourceRoot":"","sources":["../../../src/loose-mode-compat/helpers/query-record.js"],"names":[],"mappings":";4BAA4B,aAAa"}
@@ -0,0 +1,2 @@
1
+ import { Query } from "../../index.js";
2
+ export { Query as default };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/loose-mode-compat/helpers/query.js"],"names":[],"mappings":";sBAAsB,aAAa"}
@@ -0,0 +1,9 @@
1
+ declare function _initializerDefineProperty(target: any, property: any, descriptor: any, context: any): void;
2
+ declare function _applyDecoratedDescriptor(target: any, property: any, decorators: any, descriptor: any, context: any): {
3
+ enumerable: any;
4
+ configurable: any;
5
+ writable: boolean;
6
+ value: any;
7
+ initializer: any;
8
+ };
9
+ export { _initializerDefineProperty as default };
@@ -0,0 +1,4 @@
1
+ declare function _typeof(o: any): any;
2
+ declare function toPrimitive(t: any, r: any): any;
3
+ declare function toPropertyKey(t: any): any;
4
+ export { _typeof as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-data-resources",
3
- "version": "5.2.2",
3
+ "version": "5.2.3",
4
4
  "description": "Resource helpers for reactively (re)fetching data with ember-data",
5
5
  "keywords": [
6
6
  "ember-addon"