ember-data-resources 4.0.4 → 5.1.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.
- package/LICENSE.md +1 -1
- package/README.md +11 -9
- package/addon-main.cjs +5 -0
- package/dist/-private/find.js +2 -0
- package/dist/-private/find.js.map +1 -0
- package/dist/-private/query.js +2 -0
- package/dist/-private/query.js.map +1 -0
- package/dist/-private/resources/errors.js +13 -0
- package/dist/-private/resources/errors.js.map +1 -0
- package/dist/-private/resources/find-all.js +30 -0
- package/dist/-private/resources/find-all.js.map +1 -0
- package/dist/-private/resources/find-record.js +44 -0
- package/dist/-private/resources/find-record.js.map +1 -0
- package/dist/-private/resources/query-record.js +30 -0
- package/dist/-private/resources/query-record.js.map +1 -0
- package/dist/-private/resources/query.js +30 -0
- package/dist/-private/resources/query.js.map +1 -0
- package/dist/-private/resources/request.js +9 -0
- package/dist/-private/resources/request.js.map +1 -0
- package/dist/-private/resources/types.js +2 -0
- package/dist/-private/resources/types.js.map +1 -0
- package/dist/_app_/helpers/find-all.js +1 -0
- package/dist/_app_/helpers/find-record.js +1 -0
- package/dist/_app_/helpers/query-record.js +1 -0
- package/dist/_app_/helpers/query.js +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/js-helpers.js +88 -0
- package/dist/js-helpers.js.map +1 -0
- package/dist/loose-mode-compat/helpers/find-all.js +9 -0
- package/dist/loose-mode-compat/helpers/find-all.js.map +1 -0
- package/dist/loose-mode-compat/helpers/find-record.js +9 -0
- package/dist/loose-mode-compat/helpers/find-record.js.map +1 -0
- package/dist/loose-mode-compat/helpers/query-record.js +9 -0
- package/dist/loose-mode-compat/helpers/query-record.js.map +1 -0
- package/dist/loose-mode-compat/helpers/query.js +9 -0
- package/dist/loose-mode-compat/helpers/query.js.map +1 -0
- package/dist/request-rVKgKutp.js +141 -0
- package/dist/request-rVKgKutp.js.map +1 -0
- package/dist-types/-private/find.d.ts +2 -0
- package/dist-types/-private/find.d.ts.map +1 -0
- package/dist-types/-private/query.d.ts +1 -0
- package/dist-types/-private/query.d.ts.map +1 -0
- package/dist-types/-private/resources/errors.d.ts +7 -0
- package/dist-types/-private/resources/errors.d.ts.map +1 -0
- package/dist-types/-private/resources/find-all.d.ts +18 -0
- package/dist-types/-private/resources/find-all.d.ts.map +1 -0
- package/dist-types/-private/resources/find-record.d.ts +18 -0
- package/dist-types/-private/resources/find-record.d.ts.map +1 -0
- package/dist-types/-private/resources/query-record.d.ts +19 -0
- package/dist-types/-private/resources/query-record.d.ts.map +1 -0
- package/dist-types/-private/resources/query.d.ts +20 -0
- package/dist-types/-private/resources/query.d.ts.map +1 -0
- package/dist-types/-private/resources/request.d.ts.map +1 -0
- package/dist-types/-private/resources/types.d.ts +2 -0
- package/dist-types/-private/resources/types.d.ts.map +1 -0
- package/dist-types/defineProperty-796354a6.d.ts +2 -0
- package/dist-types/index.d.ts +5 -0
- package/dist-types/index.d.ts.map +1 -0
- package/dist-types/js-helpers.d.ts +16 -0
- package/dist-types/js-helpers.d.ts.map +1 -0
- package/dist-types/loose-mode-compat/helpers/find-all.d.ts +2 -0
- package/dist-types/loose-mode-compat/helpers/find-all.d.ts.map +1 -0
- package/dist-types/loose-mode-compat/helpers/find-record.d.ts +2 -0
- package/dist-types/loose-mode-compat/helpers/find-record.d.ts.map +1 -0
- package/dist-types/loose-mode-compat/helpers/query-record.d.ts +2 -0
- package/dist-types/loose-mode-compat/helpers/query-record.d.ts.map +1 -0
- package/dist-types/loose-mode-compat/helpers/query.d.ts +2 -0
- package/dist-types/loose-mode-compat/helpers/query.d.ts.map +1 -0
- package/{-private/resources/request.d.ts → dist-types/request-rVKgKutp.d.ts} +13 -6
- package/dist-types/toPropertyKey-796354a6.d.ts +4 -0
- package/package.json +116 -127
- package/-private/find.d.ts +0 -1
- package/-private/query.d.ts +0 -1
- package/-private/resources/errors.d.ts +0 -7
- package/-private/resources/find-all.d.ts +0 -19
- package/-private/resources/find-record.d.ts +0 -19
- package/-private/resources/query-record.d.ts +0 -20
- package/-private/resources/query.d.ts +0 -21
- package/-private/resources/types.d.ts +0 -2
- package/.github/renovate.json5 +0 -93
- package/.github/workflows/ci.yml +0 -104
- package/.github/workflows/lint.yml +0 -101
- package/.github/workflows/types.yml +0 -46
- package/CHANGELOG.md +0 -257
- package/addon/-private/query.ts +0 -0
- package/addon/-private/resources/errors.ts +0 -15
- package/addon/-private/resources/find-all.ts +0 -37
- package/addon/-private/resources/find-record.ts +0 -53
- package/addon/-private/resources/query-record.ts +0 -38
- package/addon/-private/resources/query.ts +0 -39
- package/addon/-private/resources/request.ts +0 -113
- package/addon/-private/resources/types.ts +0 -1
- package/addon/index.ts +0 -10
- package/addon/js-helpers.ts +0 -127
- package/app/helpers/find-all.js +0 -1
- package/app/helpers/find-record.js +0 -1
- package/app/helpers/query-record.js +0 -1
- package/app/helpers/query.js +0 -1
- package/commitlint.config.js +0 -18
- package/config/environment.js +0 -5
- package/index.d.ts +0 -6
- package/index.js +0 -11
- package/js-helpers.d.ts +0 -21
- package/tsconfig.json +0 -101
- package/types/dummy/index.d.ts +0 -1
- package/types/ember-data/types/registries/model.d.ts +0 -6
- package/types/global.d.ts +0 -6
- /package/{addon/-private/find.ts → dist-types/-private/resources/request.d.ts} +0 -0
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2023
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -5,8 +5,10 @@ Resources for reactive data fetching with ember-data
|
|
|
5
5
|
|
|
6
6
|
## Compatibility
|
|
7
7
|
|
|
8
|
-
* ember-source v3.
|
|
8
|
+
* ember-source v3.28 or above
|
|
9
|
+
* ember-data v3.28 or above
|
|
9
10
|
* ember-auto-import v2 or above
|
|
11
|
+
* typescript v4.8 or above
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
## Installation
|
|
@@ -37,7 +39,7 @@ Available properties:
|
|
|
37
39
|
- {{this.blog.isLoading}}
|
|
38
40
|
- {{this.blog.isSuccess}}
|
|
39
41
|
- {{this.blog.isError}}
|
|
40
|
-
- {{this.blog.
|
|
42
|
+
- {{this.blog.hasRan}}
|
|
41
43
|
|
|
42
44
|
Available methods:
|
|
43
45
|
- <button {{on 'click' this.blog.retry}}>Retry</button>
|
|
@@ -61,7 +63,7 @@ Available methods:
|
|
|
61
63
|
- {{blog.isLoading}}
|
|
62
64
|
- {{blog.isSuccess}}
|
|
63
65
|
- {{blog.isError}}
|
|
64
|
-
- {{blog.
|
|
66
|
+
- {{blog.hasRan}}
|
|
65
67
|
|
|
66
68
|
Available methods:
|
|
67
69
|
- <button {{on 'click' blog.retry}}>Retry</button>
|
|
@@ -102,7 +104,7 @@ Available properties:
|
|
|
102
104
|
- {{this.blog.isLoading}}
|
|
103
105
|
- {{this.blog.isSuccess}}
|
|
104
106
|
- {{this.blog.isError}}
|
|
105
|
-
- {{this.blog.
|
|
107
|
+
- {{this.blog.hasRan}}
|
|
106
108
|
|
|
107
109
|
Available methods:
|
|
108
110
|
- <button {{on 'click' this.blog.retry}}>Retry</button>
|
|
@@ -127,7 +129,7 @@ Available methods:
|
|
|
127
129
|
- {{blog.isLoading}}
|
|
128
130
|
- {{blog.isSuccess}}
|
|
129
131
|
- {{blog.isError}}
|
|
130
|
-
- {{blog.
|
|
132
|
+
- {{blog.hasRan}}
|
|
131
133
|
|
|
132
134
|
Available methods:
|
|
133
135
|
- <button {{on 'click' blog.retry}}>Retry</button>
|
|
@@ -166,7 +168,7 @@ Available properties:
|
|
|
166
168
|
- {{this.blog.isLoading}}
|
|
167
169
|
- {{this.blog.isSuccess}}
|
|
168
170
|
- {{this.blog.isError}}
|
|
169
|
-
- {{this.blog.
|
|
171
|
+
- {{this.blog.hasRan}}
|
|
170
172
|
|
|
171
173
|
Available methods:
|
|
172
174
|
- <button {{on 'click' this.blog.retry}}>Retry</button>
|
|
@@ -190,7 +192,7 @@ Available methods:
|
|
|
190
192
|
- {{blog.isLoading}}
|
|
191
193
|
- {{blog.isSuccess}}
|
|
192
194
|
- {{blog.isError}}
|
|
193
|
-
- {{blog.
|
|
195
|
+
- {{blog.hasRan}}
|
|
194
196
|
|
|
195
197
|
Available methods:
|
|
196
198
|
- <button {{on 'click' blog.retry}}>Retry</button>
|
|
@@ -232,7 +234,7 @@ Available properties:
|
|
|
232
234
|
- {{this.blog.isLoading}}
|
|
233
235
|
- {{this.blog.isSuccess}}
|
|
234
236
|
- {{this.blog.isError}}
|
|
235
|
-
- {{this.blog.
|
|
237
|
+
- {{this.blog.hasRan}}
|
|
236
238
|
|
|
237
239
|
Available methods:
|
|
238
240
|
- <button {{on 'click' this.blog.retry}}>Retry</button>
|
|
@@ -256,7 +258,7 @@ Available methods:
|
|
|
256
258
|
- {{blog.isLoading}}
|
|
257
259
|
- {{blog.isSuccess}}
|
|
258
260
|
- {{blog.isError}}
|
|
259
|
-
- {{blog.
|
|
261
|
+
- {{blog.hasRan}}
|
|
260
262
|
|
|
261
263
|
Available methods:
|
|
262
264
|
- <button {{on 'click' blog.retry}}>Retry</button>
|
package/addon-main.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -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-rVKgKutp.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-rVKgKutp.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-rVKgKutp.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-rVKgKutp.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","getOwnPropertyDescriptor"],"mappings":";;;;;;AAuBaA,IAAAA,KAAK,IAAAC,MAAA,GAAX,MAAMD,KAAK,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;AAGlF,EAAA,MACMC,oBAAoBA,CAAC,CAACC,SAAS,EAAEC,KAAK,CAAiB,EAAE;AAAEC,IAAAA,OAAAA;AAAmB,GAAC,EAAE;AACrF,IAAA,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACC,KAAK,CAACH,KAAK,CAACD,SAAS,EAAWC,KAAK,EAAEC,OAAO,CAAC,CAAA;IAE1E,IAAIG,WAAW,CAAC,IAAI,CAAC,IAAIC,YAAY,CAAC,IAAI,CAAC,EAAE,OAAA;IAE7C,IAAI,CAACC,QAAQ,GAAGJ,OAAO,CAAA;AACzB,GAAA;EAEA,IAAIA,OAAOA,GAAkC;IAC3C,OAAO,IAAI,CAACI,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,9 @@
|
|
|
1
|
+
export { R as Request } from '../../request-rVKgKutp.js';
|
|
2
|
+
import '@glimmer/tracking';
|
|
3
|
+
import '@ember/debug';
|
|
4
|
+
import '@ember/destroyable';
|
|
5
|
+
import '@ember/object';
|
|
6
|
+
import '@ember/service';
|
|
7
|
+
import '@ember/test-waiters';
|
|
8
|
+
import 'ember-resources';
|
|
9
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -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,88 @@
|
|
|
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
|
+
function findRecord(destroyable, modelName, thunk) {
|
|
8
|
+
return FindRecord.from(destroyable, () => {
|
|
9
|
+
const reified = thunk();
|
|
10
|
+
let id;
|
|
11
|
+
let options;
|
|
12
|
+
if (Array.isArray(reified)) {
|
|
13
|
+
id = reified[0];
|
|
14
|
+
options = reified[1] ?? {};
|
|
15
|
+
} else {
|
|
16
|
+
id = reified;
|
|
17
|
+
options = {};
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
positional: [modelName, id],
|
|
21
|
+
named: {
|
|
22
|
+
options
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
// Cast needed Until min-supported TS is 4.7
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function findAll(destroyable, modelName, thunk) {
|
|
30
|
+
return FindAll.from(destroyable, () => {
|
|
31
|
+
const reified = thunk?.() || {};
|
|
32
|
+
const options = 'options' in reified ? reified.options : reified;
|
|
33
|
+
return {
|
|
34
|
+
positional: [modelName],
|
|
35
|
+
named: {
|
|
36
|
+
options
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
// Cast needed Until min-supported TS is 4.7
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function query(destroyable, modelName, thunk) {
|
|
44
|
+
return Query.from(destroyable, () => {
|
|
45
|
+
const reified = thunk();
|
|
46
|
+
if (Array.isArray(reified)) {
|
|
47
|
+
const [query, options] = reified;
|
|
48
|
+
return {
|
|
49
|
+
positional: [modelName, query],
|
|
50
|
+
named: {
|
|
51
|
+
options: options || {}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
positional: [modelName, reified],
|
|
57
|
+
named: {
|
|
58
|
+
options: {}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
// Cast needed Until min-supported TS is 4.7
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function queryRecord(destroyable, modelName, thunk) {
|
|
66
|
+
return QueryRecord.from(destroyable, () => {
|
|
67
|
+
const reified = thunk();
|
|
68
|
+
if (Array.isArray(reified)) {
|
|
69
|
+
const [query, options] = reified;
|
|
70
|
+
return {
|
|
71
|
+
positional: [modelName, query],
|
|
72
|
+
named: {
|
|
73
|
+
options: options || {}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
positional: [modelName, reified],
|
|
79
|
+
named: {
|
|
80
|
+
options: {}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
// Cast needed Until min-supported TS is 4.7
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { findAll, findRecord, query, queryRecord };
|
|
88
|
+
//# 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\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\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\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\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;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;AACF,GAAC,CAAC,CAAA;AACJ,CAAA;;AAIO,SAASK,OAAOA,CACrBZ,WAAmB,EACnBC,SAAiB,EACjBC,KAAgC,EAChC;AACA,EAAA,OAAOW,OAAO,CAACT,IAAI,CAACJ,WAAW,EAAE,MAAM;AACrC,IAAA,MAAMK,OAAO,GAAGH,KAAK,IAAI,IAAI,EAAE,CAAA;IAC/B,MAAMK,OAAO,GAAG,SAAS,IAAIF,OAAO,GAAGA,OAAO,CAACE,OAAO,GAAGF,OAAO,CAAA;IAEhE,OAAO;MACLK,UAAU,EAAE,CAACT,SAAS,CAAC;AACvBU,MAAAA,KAAK,EAAE;AACLJ,QAAAA,OAAAA;AACF,OAAA;KACD,CAAA;AACD;AACF,GAAC,CAAC,CAAA;AACJ,CAAA;;AAIO,SAASO,KAAKA,CACnBd,WAAmB,EACnBC,SAAiB,EACjBC,KAA6B,EAC7B;AACA,EAAA,OAAOa,KAAK,CAACX,IAAI,CAACJ,WAAW,EAAE,MAAM;AACnC,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,CAAA;;AAOO,SAASS,WAAWA,CACzBhB,WAAmB,EACnBC,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":";;;;;;;"}
|