ember-data-resources 4.0.4 → 5.0.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 +3 -1
- 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-17f93aea.js +141 -0
- package/dist/request-17f93aea.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-17f93aea.d.ts} +13 -6
- package/dist-types/toPropertyKey-796354a6.d.ts +4 -0
- package/package.json +112 -126
- 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
|
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-17f93aea.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-17f93aea.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-17f93aea.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-17f93aea.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-17f93aea.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,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AAE,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":";;;;;;;"}
|
|
@@ -0,0 +1,141 @@
|
|
|
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 { inject } from '@ember/service';
|
|
6
|
+
import { waitFor, waitForPromise } from '@ember/test-waiters';
|
|
7
|
+
import { Resource } from 'ember-resources';
|
|
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
|
+
let Request = (_class = class Request extends Resource {
|
|
45
|
+
constructor(...args) {
|
|
46
|
+
super(...args);
|
|
47
|
+
_initializerDefineProperty(this, "store", _descriptor, this);
|
|
48
|
+
_initializerDefineProperty(this, "error", _descriptor2, this);
|
|
49
|
+
_initializerDefineProperty(this, "isLoading", _descriptor3, this);
|
|
50
|
+
_initializerDefineProperty(this, "hasRan", _descriptor4, this);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Args saved, untracked, for retrying
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
modify(positional, named) {
|
|
57
|
+
this.positional = positional;
|
|
58
|
+
this.named = named;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* We need to consume all arguments here so that we correctly respond to updates to
|
|
62
|
+
* dirtied source data.
|
|
63
|
+
*
|
|
64
|
+
* e.g.: when an id changes that is passed to findRecord, we re-fetch.
|
|
65
|
+
*/
|
|
66
|
+
this.__REQUEST_FUNCTION__([...positional], {
|
|
67
|
+
...named
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async __WRAPPED_FUNCTION__(_positional, _named) {
|
|
71
|
+
throw new Error('Not Implemented');
|
|
72
|
+
}
|
|
73
|
+
get isSuccess() {
|
|
74
|
+
return !this.error;
|
|
75
|
+
}
|
|
76
|
+
get isError() {
|
|
77
|
+
return Boolean(this.error);
|
|
78
|
+
}
|
|
79
|
+
get records() {
|
|
80
|
+
return assert(`The resource for ${this.constructor.name} does not have a records property. ` + `You might be looking for .record instead.`);
|
|
81
|
+
}
|
|
82
|
+
get record() {
|
|
83
|
+
return assert(`The resource for ${this.constructor.name} does not have a record property. ` + `You might be looking for .records instead.`);
|
|
84
|
+
}
|
|
85
|
+
async retry() {
|
|
86
|
+
return waitForPromise(this.__WRAPPED_FUNCTION__(this.positional, this.named));
|
|
87
|
+
}
|
|
88
|
+
async __REQUEST_FUNCTION__(_positional, _named) {
|
|
89
|
+
/**
|
|
90
|
+
* Args are already consumed, but let's delay doing anything
|
|
91
|
+
* until we can get out of a tracking frame.
|
|
92
|
+
*/
|
|
93
|
+
await Promise.resolve();
|
|
94
|
+
if (isDestroyed(this) || isDestroying(this)) return;
|
|
95
|
+
this.error = undefined;
|
|
96
|
+
this.isLoading = true;
|
|
97
|
+
try {
|
|
98
|
+
await this.retry();
|
|
99
|
+
} catch (e) {
|
|
100
|
+
if (isDestroyed(this) || isDestroying(this)) return;
|
|
101
|
+
if (e instanceof Error) {
|
|
102
|
+
this.error = e;
|
|
103
|
+
} else {
|
|
104
|
+
// How likely is this to happen?
|
|
105
|
+
throw e;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (isDestroyed(this) || isDestroying(this)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this.isLoading = false;
|
|
112
|
+
this.hasRan = true;
|
|
113
|
+
}
|
|
114
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "store", [inject], {
|
|
115
|
+
configurable: true,
|
|
116
|
+
enumerable: true,
|
|
117
|
+
writable: true,
|
|
118
|
+
initializer: null
|
|
119
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "error", [tracked], {
|
|
120
|
+
configurable: true,
|
|
121
|
+
enumerable: true,
|
|
122
|
+
writable: true,
|
|
123
|
+
initializer: null
|
|
124
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, "isLoading", [tracked], {
|
|
125
|
+
configurable: true,
|
|
126
|
+
enumerable: true,
|
|
127
|
+
writable: true,
|
|
128
|
+
initializer: function () {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, "hasRan", [tracked], {
|
|
132
|
+
configurable: true,
|
|
133
|
+
enumerable: true,
|
|
134
|
+
writable: true,
|
|
135
|
+
initializer: function () {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
}), _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);
|
|
139
|
+
|
|
140
|
+
export { Request as R, _applyDecoratedDescriptor as _, _initializerDefineProperty as a };
|
|
141
|
+
//# sourceMappingURL=request-17f93aea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-17f93aea.js","sources":["../../node_modules/.pnpm/@babel+runtime@7.22.5/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js","../../node_modules/.pnpm/@babel+runtime@7.22.5/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 { inject as service } from '@ember/service';\nimport { waitFor, waitForPromise } from '@ember/test-waiters';\n\nimport { Resource } from 'ember-resources';\n\nimport type Store from '@ember-data/store';\nimport type { ExpandArgs } from 'ember-resources';\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: ExpandArgs<Args>['Positional'];\n declare named: ExpandArgs<Args>['Named'];\n\n modify(positional: ExpandArgs<Args>['Positional'], named: ExpandArgs<Args>['Named']) {\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[])] as ExpandArgs<Args>['Positional'], {\n ...named,\n });\n }\n\n async __WRAPPED_FUNCTION__(\n _positional: ExpandArgs<Args>['Positional'],\n _named: ExpandArgs<Args>['Named']\n ) {\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__(\n _positional: ExpandArgs<Args>['Positional'],\n _named: ExpandArgs<Args>['Named']\n ) {\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","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","service","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,EAAEC,QAAQ,EAAE;IACtCK,UAAU,EAAEJ,UAAU,CAACI,UAAU;IACjCC,YAAY,EAAEL,UAAU,CAACK,YAAY;IACrCC,QAAQ,EAAEN,UAAU,CAACM,QAAQ;AAC7BC,IAAAA,KAAK,EAAEP,UAAU,CAACQ,WAAW,GAAGR,UAAU,CAACQ,WAAW,CAACC,IAAI,CAACR,OAAO,CAAC,GAAG,KAAK,CAAA;AAC9E,GAAC,CAAC,CAAA;AACJ;;ACRe,SAASS,yBAAyBA,CAACZ,MAAM,EAAEC,QAAQ,EAAEY,UAAU,EAAEX,UAAU,EAAEC,OAAO,EAAE;EACnG,IAAIW,IAAI,GAAG,EAAE,CAAA;EACbV,MAAM,CAACW,IAAI,CAACb,UAAU,CAAC,CAACc,OAAO,CAAC,UAAUC,GAAG,EAAE;AAC7CH,IAAAA,IAAI,CAACG,GAAG,CAAC,GAAGf,UAAU,CAACe,GAAG,CAAC,CAAA;AAC7B,GAAC,CAAC,CAAA;AACFH,EAAAA,IAAI,CAACR,UAAU,GAAG,CAAC,CAACQ,IAAI,CAACR,UAAU,CAAA;AACnCQ,EAAAA,IAAI,CAACP,YAAY,GAAG,CAAC,CAACO,IAAI,CAACP,YAAY,CAAA;AACvC,EAAA,IAAI,OAAO,IAAIO,IAAI,IAAIA,IAAI,CAACJ,WAAW,EAAE;IACvCI,IAAI,CAACN,QAAQ,GAAG,IAAI,CAAA;AAC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D,UAAA,EAAA,IAAA;EAAAE,QAAA,EAAA,IAAA;AAAAE,EAAAA,WAAA,cAAA;AAAA,IAAA,OAAa,KAAK,CAAA;AAAA,GAAA;AAAA,CAAAqB,CAAAA,EAAAA,YAAA,GAAAnB,yBAAA,CAAAY,MAAA,CAAAiC,SAAA,aACzBE,OAAO,CAAA,EAAA;EAAApD,YAAA,EAAA,IAAA;EAAAD,UAAA,EAAA,IAAA;EAAAE,QAAA,EAAA,IAAA;AAAAE,EAAAA,WAAA,cAAA;AAAA,IAAA,OAAU,KAAK,CAAA;AAAA,GAAA;AAAA,CAAA,CAAA,EAAAE,yBAAA,CAAAY,MAAA,CAAAiC,SAAA,EAAA,OAAA,EAAA,CAoDtBG,MAAM,CAAAxD,EAAAA,MAAA,CAAAyD,wBAAA,CAAArC,MAAA,CAAAiC,SAAA,YAAAjC,MAAA,CAAAiC,SAAA,CAAA7C,EAAAA,yBAAA,CAAAY,MAAA,CAAAiC,SAAA,EAAA,sBAAA,EAAA,CAKNG,MAAM,EACNE,OAAO,GAAA1D,MAAA,CAAAyD,wBAAA,CAAArC,MAAA,CAAAiC,SAAA,EAAA,sBAAA,CAAA,EAAAjC,MAAA,CAAAiC,SAAA,IAAAjC,MAAA;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"-private/find.d.ts","sourceRoot":"","sources":["../src/-private/find.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/-private/query.ts"],"names":[],"mappings":""}
|