@ember-data/store 5.4.0-alpha.64 → 5.4.0-alpha.70

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 (71) hide show
  1. package/addon-main.cjs +5 -0
  2. package/dist/-private.js +1 -0
  3. package/{addon/cache-handler-Dl0DS1Iq.js → dist/cache-handler-BCWOzbbB.js} +954 -598
  4. package/dist/cache-handler-BCWOzbbB.js.map +1 -0
  5. package/dist/index.js +4 -0
  6. package/{addon → dist}/index.js.map +1 -1
  7. package/dist/types.js +0 -0
  8. package/dist/types.js.map +1 -0
  9. package/package.json +31 -43
  10. package/unstable-preview-types/-private/cache-handler.d.ts +7 -4
  11. package/unstable-preview-types/-private/cache-handler.d.ts.map +1 -1
  12. package/unstable-preview-types/-private/caches/cache-utils.d.ts +3 -3
  13. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -1
  14. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +1 -2
  15. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -1
  16. package/unstable-preview-types/-private/caches/instance-cache.d.ts +3 -5
  17. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -1
  18. package/unstable-preview-types/-private/document.d.ts +7 -7
  19. package/unstable-preview-types/-private/document.d.ts.map +1 -1
  20. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +2 -2
  21. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -1
  22. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +6 -6
  23. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -1
  24. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +5 -3
  25. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -1
  26. package/unstable-preview-types/-private/managers/cache-manager.d.ts +2 -3
  27. package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -1
  28. package/unstable-preview-types/-private/managers/notification-manager.d.ts +2 -4
  29. package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -1
  30. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +5 -5
  31. package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -1
  32. package/unstable-preview-types/-private/network/request-cache.d.ts +4 -4
  33. package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -1
  34. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +22 -17
  35. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -1
  36. package/unstable-preview-types/-private/store-service.d.ts +158 -196
  37. package/unstable-preview-types/-private/store-service.d.ts.map +1 -1
  38. package/unstable-preview-types/-private/utils/coerce-id.d.ts +2 -2
  39. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -1
  40. package/unstable-preview-types/-private/utils/construct-resource.d.ts +6 -7
  41. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -1
  42. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +1 -1
  43. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -1
  44. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +1 -1
  45. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -1
  46. package/unstable-preview-types/-private.d.ts +12 -8
  47. package/unstable-preview-types/-private.d.ts.map +1 -1
  48. package/unstable-preview-types/-types/q/{cache-store-wrapper.d.ts → cache-capabilities-manager.d.ts} +8 -6
  49. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +1 -0
  50. package/unstable-preview-types/-types/q/ds-model.d.ts +15 -5
  51. package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -1
  52. package/unstable-preview-types/-types/q/identifier.d.ts +0 -2
  53. package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -1
  54. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +1 -1
  55. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -1
  56. package/unstable-preview-types/-types/q/schema-service.d.ts +164 -29
  57. package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -1
  58. package/unstable-preview-types/index.d.ts +26 -27
  59. package/unstable-preview-types/index.d.ts.map +1 -1
  60. package/unstable-preview-types/types.d.ts +7 -0
  61. package/unstable-preview-types/types.d.ts.map +1 -0
  62. package/addon/-private.js +0 -1
  63. package/addon/cache-handler-Dl0DS1Iq.js.map +0 -1
  64. package/addon/index.js +0 -1
  65. package/addon-main.js +0 -94
  66. package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts +0 -7
  67. package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts.map +0 -1
  68. package/unstable-preview-types/-types/q/cache-store-wrapper.d.ts.map +0 -1
  69. package/unstable-preview-types/-types/q/cache.d.ts +0 -47
  70. package/unstable-preview-types/-types/q/cache.d.ts.map +0 -1
  71. /package/{addon → dist}/-private.js.map +0 -0
package/addon/index.js DELETED
@@ -1 +0,0 @@
1
- export { C as CacheHandler, S as default, r as recordIdentifierFor, q as setIdentifierForgetMethod, m as setIdentifierGenerationMethod, t as setIdentifierResetMethod, o as setIdentifierUpdateMethod, u as setKeyInfoForResource, s as storeFor } from "./cache-handler-Dl0DS1Iq";
package/addon-main.js DELETED
@@ -1,94 +0,0 @@
1
- const requireModule = require('@ember-data/private-build-infra/src/utilities/require-module');
2
- const getEnv = require('@ember-data/private-build-infra/src/utilities/get-env');
3
- const detectModule = require('@ember-data/private-build-infra/src/utilities/detect-module');
4
-
5
- const pkg = require('./package.json');
6
-
7
- module.exports = {
8
- name: pkg.name,
9
-
10
- options: {
11
- '@embroider/macros': {
12
- setOwnConfig: {},
13
- },
14
- },
15
-
16
- _emberDataConfig: null,
17
- configureEmberData() {
18
- if (this._emberDataConfig) {
19
- return this._emberDataConfig;
20
- }
21
- const app = this._findHost();
22
- const isProd = /production/.test(process.env.EMBER_ENV);
23
- const hostOptions = app.options?.emberData || {};
24
- const debugOptions = Object.assign(
25
- {
26
- LOG_PAYLOADS: false,
27
- LOG_OPERATIONS: false,
28
- LOG_MUTATIONS: false,
29
- LOG_NOTIFICATIONS: false,
30
- LOG_REQUESTS: false,
31
- LOG_REQUEST_STATUS: false,
32
- LOG_IDENTIFIERS: false,
33
- LOG_GRAPH: false,
34
- LOG_INSTANCE_CACHE: false,
35
- },
36
- hostOptions.debug || {}
37
- );
38
-
39
- const HAS_DEBUG_PACKAGE = detectModule(require, '@ember-data/debug', __dirname, pkg);
40
- const HAS_META_PACKAGE = detectModule(require, 'ember-data', __dirname, pkg);
41
-
42
- const includeDataAdapterInProduction =
43
- typeof hostOptions.includeDataAdapterInProduction === 'boolean'
44
- ? hostOptions.includeDataAdapterInProduction
45
- : HAS_META_PACKAGE;
46
-
47
- const includeDataAdapter = HAS_DEBUG_PACKAGE ? (isProd ? includeDataAdapterInProduction : true) : false;
48
- const DEPRECATIONS = require('@ember-data/private-build-infra/src/deprecations')(hostOptions.compatWith || null);
49
- const FEATURES = require('@ember-data/private-build-infra/src/features')(isProd);
50
-
51
- const ALL_PACKAGES = requireModule('@ember-data/private-build-infra/virtual-packages/packages.js');
52
- const MACRO_PACKAGE_FLAGS = Object.assign({}, ALL_PACKAGES.default);
53
- delete MACRO_PACKAGE_FLAGS['HAS_DEBUG_PACKAGE'];
54
-
55
- Object.keys(MACRO_PACKAGE_FLAGS).forEach((key) => {
56
- MACRO_PACKAGE_FLAGS[key] = detectModule(require, MACRO_PACKAGE_FLAGS[key], __dirname, pkg);
57
- });
58
-
59
- // copy configs forward
60
- const ownConfig = this.options['@embroider/macros'].setOwnConfig;
61
- ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
62
- ownConfig.compatWith = hostOptions.compatWith || null;
63
- ownConfig.debug = debugOptions;
64
- ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
65
- ownConfig.features = Object.assign({}, FEATURES, ownConfig.features || {}, hostOptions.features || {});
66
- ownConfig.includeDataAdapter = includeDataAdapter;
67
- ownConfig.packages = MACRO_PACKAGE_FLAGS;
68
- ownConfig.env = getEnv(ownConfig);
69
-
70
- this._emberDataConfig = ownConfig;
71
- return ownConfig;
72
- },
73
-
74
- included() {
75
- this.configureEmberData();
76
- return this._super.included.call(this, ...arguments);
77
- },
78
-
79
- treeForVendor() {
80
- return;
81
- },
82
- treeForPublic() {
83
- return;
84
- },
85
- treeForStyles() {
86
- return;
87
- },
88
- treeForAddonStyles() {
89
- return;
90
- },
91
- treeForApp() {
92
- return;
93
- },
94
- };
@@ -1,7 +0,0 @@
1
- declare module '@ember-data/store/-private/utils/identifier-debug-consts' {
2
- export const DEBUG_CLIENT_ORIGINATED: unique symbol;
3
- export const DEBUG_IDENTIFIER_BUCKET: unique symbol;
4
- export const DEBUG_STALE_CACHE_OWNER: unique symbol;
5
- export const CACHE_OWNER: unique symbol;
6
- }
7
- //# sourceMappingURL=identifier-debug-consts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"identifier-debug-consts.d.ts","sourceRoot":"","sources":["../../../src/-private/utils/identifier-debug-consts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,uBAAuB,EAAE,OAAO,MAA8C,CAAC;AAC5F,eAAO,MAAM,uBAAuB,EAAE,OAAO,MAAoC,CAAC;AAClF,eAAO,MAAM,uBAAuB,EAAE,OAAO,MAAsC,CAAC;AAGpF,eAAO,MAAM,WAAW,EAAE,OAAO,MAAiC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache-store-wrapper.d.ts","sourceRoot":"","sources":["../../../src/-types/q/cache-store-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE1G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;EAEE;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;OASG;IACH,eAAe,EAAE,eAAe,CAAC;IAEjC;;;;;;;;;OASG;IACH,0BAA0B,IAAI,aAAa,CAAC;IAE5C;;;;;;;;;OASG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;;;;;;;OAQG;IACH,WAAW,CAAC,UAAU,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAElE;;;;;;;;;OASG;IACH,gBAAgB,CAAC,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAE3D;;;;;;;;OAQG;IACH,SAAS,CAAC,UAAU,EAAE,sBAAsB,GAAG,OAAO,CAAC;IAEvD;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,UAAU,EAAE,sBAAsB,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACvF,YAAY,CAAC,UAAU,EAAE,wBAAwB,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;IACrG,YAAY,CAAC,UAAU,EAAE,sBAAsB,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClG,YAAY,CACV,UAAU,EAAE,sBAAsB,GAAG,wBAAwB,EAC7D,SAAS,EAAE,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,EAC7D,GAAG,CAAC,EAAE,MAAM,GACX,IAAI,CAAC;CACT"}
@@ -1,47 +0,0 @@
1
- declare module '@ember-data/store/-types/q/cache' {
2
- import type { Cache, ChangedAttributesHash } from '@warp-drive/core-types/cache';
3
- import type { RecordIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
4
- import type { ApiError } from '@warp-drive/core-types/spec/error';
5
- import type { CollectionResourceRelationship, SingleResourceRelationship } from '@warp-drive/core-types/spec/raw';
6
- import type { JsonApiResource } from '@ember-data/store/-types/q/record-data-json-api';
7
- /**
8
- @module @ember-data/store
9
- */
10
- export interface MergeOperation {
11
- op: 'mergeIdentifiers';
12
- record: StableRecordIdentifier;
13
- value: StableRecordIdentifier;
14
- }
15
- export interface CacheV1 {
16
- version?: '1';
17
- getResourceIdentifier(): RecordIdentifier | undefined;
18
- pushData(data: JsonApiResource, calculateChange: true): string[];
19
- pushData(data: JsonApiResource, calculateChange?: false): void;
20
- pushData(data: JsonApiResource, calculateChange?: boolean): string[] | void;
21
- clientDidCreate(): void;
22
- _initRecordCreateOptions(options?: Record<string, unknown>): Record<string, unknown>;
23
- willCommit(): void;
24
- didCommit(data: JsonApiResource | null): void;
25
- commitWasRejected(recordIdentifier?: RecordIdentifier, errors?: ApiError[]): void;
26
- unloadRecord(): void;
27
- getAttr(key: string): unknown;
28
- setDirtyAttribute(key: string, value: unknown): void;
29
- changedAttributes(): ChangedAttributesHash;
30
- hasChangedAttributes(): boolean;
31
- rollbackAttributes(): string[];
32
- getBelongsTo(key: string): SingleResourceRelationship;
33
- getHasMany(key: string): CollectionResourceRelationship;
34
- setDirtyBelongsTo(name: string, recordData: Cache | null): void;
35
- setDirtyHasMany(key: string, recordDatas: Cache[]): void;
36
- addToHasMany(key: string, recordDatas: Cache[], idx?: number): void;
37
- removeFromHasMany(key: string, recordDatas: Cache[]): void;
38
- setIsDeleted(isDeleted: boolean): void;
39
- getErrors(identifier: StableRecordIdentifier): ApiError[];
40
- isEmpty?(identifier: StableRecordIdentifier): boolean;
41
- isNew(identifier: StableRecordIdentifier): boolean;
42
- isDeleted(identifier: StableRecordIdentifier): boolean;
43
- isDeletionCommitted(identifier: StableRecordIdentifier): boolean;
44
- }
45
- export type { Cache };
46
- }
47
- //# sourceMappingURL=cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/-types/q/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KA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