@ember-data/store 5.4.0-alpha.5 → 5.4.0-alpha.50

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 (77) hide show
  1. package/README.md +8 -4
  2. package/addon/-private.js +1 -1
  3. package/addon/{store-service-aa7f91c0.js → cache-handler-BGVZPfAA.js} +1247 -1042
  4. package/addon/cache-handler-BGVZPfAA.js.map +1 -0
  5. package/addon/index.js +1 -1
  6. package/addon/index.js.map +1 -1
  7. package/addon-main.js +1 -0
  8. package/package.json +64 -43
  9. package/unstable-preview-types/-private/cache-handler.d.ts +141 -0
  10. package/unstable-preview-types/-private/cache-handler.d.ts.map +1 -0
  11. package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -0
  12. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -0
  13. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +182 -0
  14. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
  15. package/unstable-preview-types/-private/caches/instance-cache.d.ts +63 -0
  16. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -0
  17. package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -0
  18. package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +1 -0
  19. package/unstable-preview-types/-private/document.d.ts +146 -0
  20. package/unstable-preview-types/-private/document.d.ts.map +1 -0
  21. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +179 -0
  22. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -0
  23. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -0
  24. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -0
  25. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +29 -0
  26. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -0
  27. package/unstable-preview-types/-private/managers/cache-manager.d.ts +442 -0
  28. package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -0
  29. package/unstable-preview-types/-private/managers/notification-manager.d.ts +98 -0
  30. package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -0
  31. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +97 -0
  32. package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -0
  33. package/unstable-preview-types/-private/network/request-cache.d.ts +109 -0
  34. package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -0
  35. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +133 -0
  36. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -0
  37. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +118 -0
  38. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +1 -0
  39. package/unstable-preview-types/-private/store-service.d.ts +1554 -0
  40. package/unstable-preview-types/-private/store-service.d.ts.map +1 -0
  41. package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -0
  42. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -0
  43. package/unstable-preview-types/-private/utils/construct-resource.d.ts +10 -0
  44. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -0
  45. package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts +7 -0
  46. package/unstable-preview-types/-private/utils/identifier-debug-consts.d.ts.map +1 -0
  47. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -0
  48. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -0
  49. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -0
  50. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -0
  51. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -0
  52. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +1 -0
  53. package/unstable-preview-types/-private.d.ts +20 -0
  54. package/unstable-preview-types/-private.d.ts.map +1 -0
  55. package/unstable-preview-types/-types/overview.d.ts +21 -0
  56. package/unstable-preview-types/-types/overview.d.ts.map +1 -0
  57. package/unstable-preview-types/-types/q/cache-store-wrapper.d.ts +107 -0
  58. package/unstable-preview-types/-types/q/cache-store-wrapper.d.ts.map +1 -0
  59. package/unstable-preview-types/-types/q/cache.d.ts +47 -0
  60. package/unstable-preview-types/-types/q/cache.d.ts.map +1 -0
  61. package/unstable-preview-types/-types/q/ds-model.d.ts +15 -0
  62. package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -0
  63. package/unstable-preview-types/-types/q/identifier.d.ts +171 -0
  64. package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -0
  65. package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -0
  66. package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +1 -0
  67. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -0
  68. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -0
  69. package/unstable-preview-types/-types/q/record-instance.d.ts +29 -0
  70. package/unstable-preview-types/-types/q/record-instance.d.ts.map +1 -0
  71. package/unstable-preview-types/-types/q/schema-service.d.ts +214 -0
  72. package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -0
  73. package/unstable-preview-types/-types/q/store.d.ts +17 -0
  74. package/unstable-preview-types/-types/q/store.d.ts.map +1 -0
  75. package/unstable-preview-types/index.d.ts +220 -0
  76. package/unstable-preview-types/index.d.ts.map +1 -0
  77. package/addon/store-service-aa7f91c0.js.map +0 -1
package/addon/index.js CHANGED
@@ -1 +1 @@
1
- export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, s as storeFor } from "./store-service-aa7f91c0";
1
+ export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, s as storeFor } from "./cache-handler-BGVZPfAA";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/addon-main.js CHANGED
@@ -58,6 +58,7 @@ module.exports = {
58
58
 
59
59
  // copy configs forward
60
60
  const ownConfig = this.options['@embroider/macros'].setOwnConfig;
61
+ ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
61
62
  ownConfig.compatWith = hostOptions.compatWith || null;
62
63
  ownConfig.debug = debugOptions;
63
64
  ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-data/store",
3
- "version": "5.4.0-alpha.5",
3
+ "version": "5.4.0-alpha.50",
4
4
  "description": "The core of EmberData. Provides the Store service which coordinates the cache with the network and presentation layers.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -11,70 +11,91 @@
11
11
  "directory": "packages/store"
12
12
  },
13
13
  "license": "MIT",
14
- "author": "",
15
- "directories": {},
16
- "ember-addon": {
17
- "main": "addon-main.js",
18
- "type": "addon",
19
- "version": 1
20
- },
14
+ "author": "Chris Thoburn <runspired@users.noreply.github.com>",
21
15
  "files": [
16
+ "unstable-preview-types",
22
17
  "addon-main.js",
23
18
  "addon",
24
19
  "README.md",
25
20
  "LICENSE.md",
26
21
  "ember-data-logo-dark.svg",
27
- "ember-data-logo-light.svg",
28
- "ember-data-logo-dark.svg",
29
22
  "ember-data-logo-light.svg"
30
23
  ],
31
- "peerDependencies": {
32
- "@ember-data/tracking": "5.4.0-alpha.5",
33
- "@ember/string": "^3.1.1",
34
- "@glimmer/tracking": "^1.1.2"
24
+ "scripts": {
25
+ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives",
26
+ "build:runtime": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js",
27
+ "build:types": "tsc --build",
28
+ "_build": "bun run build:runtime && bun run build:types",
29
+ "_syncPnpm": "bun run sync-dependencies-meta-injected"
30
+ },
31
+ "dependencies": {
32
+ "@ember-data/private-build-infra": "5.4.0-alpha.50",
33
+ "@embroider/macros": "^1.15.0",
34
+ "ember-cli-babel": "^8.2.0"
35
35
  },
36
36
  "dependenciesMeta": {
37
37
  "@ember-data/private-build-infra": {
38
38
  "injected": true
39
+ },
40
+ "@ember-data/tracking": {
41
+ "injected": true
42
+ },
43
+ "@ember-data/request": {
44
+ "injected": true
45
+ },
46
+ "@warp-drive/core-types": {
47
+ "injected": true
48
+ },
49
+ "@ember/string": {
50
+ "injected": true
39
51
  }
40
52
  },
41
- "dependencies": {
42
- "@ember-data/private-build-infra": "5.4.0-alpha.5",
43
- "@embroider/macros": "^1.13.1",
44
- "ember-cached-decorator-polyfill": "^1.0.2",
45
- "ember-cli-babel": "^8.0.0"
53
+ "peerDependencies": {
54
+ "@ember-data/request": "5.4.0-alpha.50",
55
+ "@ember-data/tracking": "5.4.0-alpha.50",
56
+ "@ember/string": "^3.1.1",
57
+ "@warp-drive/core-types": "0.0.0-alpha.36"
46
58
  },
47
59
  "devDependencies": {
48
- "@babel/cli": "^7.22.10",
49
- "@babel/core": "^7.22.11",
50
- "@babel/plugin-proposal-decorators": "^7.22.10",
51
- "@babel/plugin-transform-class-properties": "^7.22.5",
52
- "@babel/plugin-transform-private-methods": "^7.22.5",
53
- "@babel/plugin-transform-runtime": "^7.22.10",
54
- "@babel/plugin-transform-typescript": "^7.22.11",
55
- "@babel/preset-env": "^7.22.10",
56
- "@babel/preset-typescript": "^7.22.11",
57
- "@babel/runtime": "^7.22.11",
58
- "@embroider/addon-dev": "^4.1.0",
60
+ "@babel/cli": "^7.24.1",
61
+ "@babel/core": "^7.24.3",
62
+ "@babel/plugin-proposal-decorators": "^7.24.1",
63
+ "@babel/plugin-transform-class-properties": "^7.24.1",
64
+ "@babel/plugin-transform-private-methods": "^7.24.1",
65
+ "@babel/plugin-transform-runtime": "^7.24.3",
66
+ "@babel/plugin-transform-typescript": "^7.24.1",
67
+ "@babel/preset-env": "^7.24.3",
68
+ "@babel/preset-typescript": "^7.24.1",
69
+ "@babel/runtime": "^7.24.1",
70
+ "@ember-data/request": "5.4.0-alpha.50",
71
+ "@ember-data/tracking": "5.4.0-alpha.50",
72
+ "@ember/string": "^3.1.1",
73
+ "@embroider/addon-dev": "^4.2.1",
59
74
  "@glimmer/component": "^1.1.2",
60
- "@rollup/plugin-babel": "^6.0.3",
61
- "@rollup/plugin-node-resolve": "^15.2.1",
62
- "ember-source": "~5.2.0",
63
- "rollup": "^3.28.1",
64
- "tslib": "^2.6.2",
65
- "typescript": "^5.2.2",
75
+ "@rollup/plugin-babel": "^6.0.4",
76
+ "@rollup/plugin-node-resolve": "^15.2.3",
77
+ "@warp-drive/core-types": "0.0.0-alpha.36",
78
+ "@warp-drive/internal-config": "5.4.0-alpha.50",
79
+ "ember-source": "~5.7.0",
80
+ "pnpm-sync-dependencies-meta-injected": "0.0.10",
81
+ "rollup": "^4.13.0",
82
+ "typescript": "^5.4.3",
66
83
  "walk-sync": "^3.0.0",
67
- "webpack": "^5.88.2"
84
+ "webpack": "^5.91.0"
68
85
  },
69
86
  "engines": {
70
- "node": "16.* || >= 18.*"
87
+ "node": ">= 18.19.1"
71
88
  },
72
89
  "volta": {
73
90
  "extends": "../../package.json"
74
91
  },
75
- "packageManager": "pnpm@8.7.0",
76
- "scripts": {
77
- "build": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js",
78
- "start": "rollup --config --watch"
92
+ "packageManager": "pnpm@8.15.5",
93
+ "ember-addon": {
94
+ "main": "addon-main.js",
95
+ "type": "addon",
96
+ "version": 1
97
+ },
98
+ "ember": {
99
+ "edition": "octane"
79
100
  }
80
- }
101
+ }
@@ -0,0 +1,141 @@
1
+ declare module '@ember-data/store/-private/cache-handler' {
2
+ import type { CacheHandler as CacheHandlerType } from '@ember-data/request';
3
+ import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
4
+ import type { ImmutableRequestInfo, RequestContext, ResponseInfo } from '@warp-drive/core-types/request';
5
+ import { EnableHydration } from '@warp-drive/core-types/request';
6
+ import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/raw';
7
+ import type Store from '@ember-data/store/-private/store-service';
8
+ /**
9
+ * A service which an application may provide to the store via
10
+ * the store's `lifetimes` property to configure the behavior
11
+ * of the CacheHandler.
12
+ *
13
+ * The default behavior for request lifetimes is to never expire
14
+ * unless manually refreshed via `cacheOptions.reload` or `cacheOptions.backgroundReload`.
15
+ *
16
+ * Implementing this service allows you to programatically define
17
+ * when a request should be considered expired.
18
+ *
19
+ * @class <Interface> LifetimesService
20
+ * @public
21
+ */
22
+ export interface LifetimesService {
23
+ /**
24
+ * Invoked to determine if the request may be fulfilled from cache
25
+ * if possible.
26
+ *
27
+ * Note, this is only invoked if the request has a cache-key.
28
+ *
29
+ * If no cache entry is found or the entry is hard expired,
30
+ * the request will be fulfilled from the configured request handlers
31
+ * and the cache will be updated before returning the response.
32
+ *
33
+ * @method isHardExpired
34
+ * @public
35
+ * @param {StableDocumentIdentifier} identifier
36
+ * @param {Store} store
37
+ * @return {boolean} true if the request is considered hard expired
38
+ */
39
+ isHardExpired(identifier: StableDocumentIdentifier, store: Store): boolean;
40
+ /**
41
+ * Invoked if `isHardExpired` is false to determine if the request
42
+ * should be update behind the scenes if cache data is already available.
43
+ *
44
+ * Note, this is only invoked if the request has a cache-key.
45
+ *
46
+ * If true, the request will be fulfilled from cache while a backgrounded
47
+ * request is made to update the cache via the configured request handlers.
48
+ *
49
+ * @method isSoftExpired
50
+ * @public
51
+ * @param {StableDocumentIdentifier} identifier
52
+ * @param {Store} store
53
+ * @return {boolean} true if the request is considered soft expired
54
+ */
55
+ isSoftExpired(identifier: StableDocumentIdentifier, store: Store): boolean;
56
+ /**
57
+ * Invoked when a request will be sent to the configured request handlers.
58
+ * This is invoked for both foreground and background requests.
59
+ *
60
+ * Note, this is invoked regardless of whether the request has a cache-key.
61
+ *
62
+ * @method willRequest [Optional]
63
+ * @public
64
+ * @param {ImmutableRequestInfo} request
65
+ * @param {StableDocumentIdentifier | null} identifier
66
+ * @param {Store} store
67
+ * @return {void}
68
+ */
69
+ willRequest?(request: ImmutableRequestInfo, identifier: StableDocumentIdentifier | null, store: Store): void;
70
+ /**
71
+ * Invoked when a request has been fulfilled from the configured request handlers.
72
+ * This is invoked for both foreground and background requests once the cache has
73
+ * been updated.
74
+ *
75
+ * Note, this is invoked regardless of whether the request has a cache-key.
76
+ *
77
+ * @method didRequest [Optional]
78
+ * @public
79
+ * @param {ImmutableRequestInfo} request
80
+ * @param {ImmutableResponse} response
81
+ * @param {StableDocumentIdentifier | null} identifier
82
+ * @param {Store} store
83
+ * @return {void}
84
+ */
85
+ didRequest?(request: ImmutableRequestInfo, response: Response | ResponseInfo | null, identifier: StableDocumentIdentifier | null, store: Store): void;
86
+ }
87
+ export type LooseStoreRequestInfo = Omit<ImmutableRequestInfo, 'records' | 'headers'> & {
88
+ records?: ResourceIdentifierObject[];
89
+ headers?: Headers;
90
+ };
91
+ export type StoreRequestInput = ImmutableRequestInfo | LooseStoreRequestInfo;
92
+ export interface StoreRequestContext extends RequestContext {
93
+ request: ImmutableRequestInfo & {
94
+ store: Store;
95
+ [EnableHydration]?: boolean;
96
+ };
97
+ }
98
+ /**
99
+ * A CacheHandler that adds support for using an EmberData Cache with a RequestManager.
100
+ *
101
+ * This handler will only run when a request has supplied a `store` instance. Requests
102
+ * issued by the store via `store.request()` will automatically have the `store` instance
103
+ * attached to the request.
104
+ *
105
+ * ```ts
106
+ * requestManager.request({
107
+ * store: store,
108
+ * url: '/api/posts',
109
+ * method: 'GET'
110
+ * });
111
+ * ```
112
+ *
113
+ * When this handler elects to handle a request, it will return the raw `StructuredDocument`
114
+ * unless the request has `[EnableHydration]` set to `true`. In this case, the handler will
115
+ * return a `Document` instance that will automatically update the UI when the cache is updated
116
+ * in the future and will hydrate any identifiers in the StructuredDocument into Record instances.
117
+ *
118
+ * When issuing a request via the store, [EnableHydration] is automatically set to `true`. This
119
+ * means that if desired you can issue requests that utilize the cache without needing to also
120
+ * utilize Record instances if desired.
121
+ *
122
+ * Said differently, you could elect to issue all requests via a RequestManager, without ever using
123
+ * the store directly, by setting [EnableHydration] to `true` and providing a store instance. Not
124
+ * necessarily the most useful thing, but the decoupled nature of the RequestManager and incremental-feature
125
+ * approach of EmberData allows for this flexibility.
126
+ *
127
+ * ```ts
128
+ * import { EnableHydration } from '@warp-drive/core-types/request';
129
+ *
130
+ * requestManager.request({
131
+ * store: store,
132
+ * url: '/api/posts',
133
+ * method: 'GET',
134
+ * [EnableHydration]: true
135
+ * });
136
+ *
137
+ * @typedoc
138
+ */
139
+ export const CacheHandler: CacheHandlerType;
140
+ }
141
+ //# sourceMappingURL=cache-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-handler.d.ts","sourceRoot":"","sources":["../../src/-private/cache-handler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAGV,oBAAoB,EAEpB,cAAc,EACd,YAAY,EAGb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAa,MAAM,gCAAgC,CAAC;AAO5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAIhF,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;OAeG;IACH,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAC3E;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAE3E;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAE7G;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,CACT,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,EACxC,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAC3C,KAAK,EAAE,KAAK,GACX,IAAI,CAAC;CACT;AAED,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,SAAS,CAAC,GAAG;IACtF,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAE7E,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,OAAO,EAAE,oBAAoB,GAAG;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC/E;AAiTD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,YAAY,EAAE,gBAoD1B,CAAC"}
@@ -0,0 +1,11 @@
1
+ declare module '@ember-data/store/-private/caches/cache-utils' {
2
+ import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
+ import type { Cache } from '@ember-data/store/-types/q/cache';
4
+ import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
5
+ export const CacheForIdentifierCache: Map<unknown, Cache>;
6
+ export function setCacheFor(identifier: StableRecordIdentifier | OpaqueRecordInstance, cache: Cache): void;
7
+ export function removeRecordDataFor(identifier: StableRecordIdentifier | OpaqueRecordInstance): void;
8
+ export default function peekCache(instance: StableRecordIdentifier): Cache | null;
9
+ export default function peekCache(instance: OpaqueRecordInstance): Cache;
10
+ }
11
+ //# sourceMappingURL=cache-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-utils.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/cache-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAO3E,eAAO,MAAM,uBAAuB,qBAAkE,CAAC;AAEvG,wBAAgB,WAAW,CAAC,UAAU,EAAE,sBAAsB,GAAG,oBAAoB,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAMzG;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,sBAAsB,GAAG,oBAAoB,GAAG,IAAI,CAEnG;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,QAAQ,EAAE,sBAAsB,GAAG,KAAK,GAAG,IAAI,CAAC;AAClF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,QAAQ,EAAE,oBAAoB,GAAG,KAAK,CAAC"}
@@ -0,0 +1,182 @@
1
+ declare module '@ember-data/store/-private/caches/identifier-cache' {
2
+ import { type Identifier, type RecordIdentifier, type StableDocumentIdentifier, type StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
+ import type { ImmutableRequestInfo } from '@warp-drive/core-types/request';
4
+ import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/raw';
5
+ import type { ForgetMethod, GenerationMethod, ResetMethod, UpdateMethod } from '@ember-data/store/-types/q/identifier';
6
+ export function isStableIdentifier(identifier: unknown): identifier is StableRecordIdentifier;
7
+ export function isDocumentIdentifier(identifier: unknown): identifier is StableDocumentIdentifier;
8
+ interface KeyOptions {
9
+ lid: IdentifierMap;
10
+ id: IdentifierMap;
11
+ }
12
+ type TypeMap = {
13
+ [key: string]: KeyOptions;
14
+ };
15
+ type IdentifierMap = Map<string, StableRecordIdentifier>;
16
+ type KeyInfo = {
17
+ id: string | null;
18
+ type: string;
19
+ };
20
+ type StableCache = {
21
+ resources: IdentifierMap;
22
+ documents: Map<string, StableDocumentIdentifier>;
23
+ resourcesByType: TypeMap;
24
+ polymorphicLidBackMap: Map<string, string[]>;
25
+ };
26
+ export type KeyInfoMethod = (resource: unknown, known: StableRecordIdentifier | null) => KeyInfo;
27
+ export type MergeMethod = (targetIdentifier: StableRecordIdentifier, matchedIdentifier: StableRecordIdentifier, resourceData: unknown) => StableRecordIdentifier;
28
+ export function setIdentifierGenerationMethod(method: GenerationMethod | null): void;
29
+ export function setIdentifierUpdateMethod(method: UpdateMethod | null): void;
30
+ export function setIdentifierForgetMethod(method: ForgetMethod | null): void;
31
+ export function setIdentifierResetMethod(method: ResetMethod | null): void;
32
+ export function setKeyInfoForResource(method: KeyInfoMethod | null): void;
33
+ /**
34
+ * Each instance of {Store} receives a unique instance of a IdentifierCache.
35
+ *
36
+ * This cache is responsible for assigning or retrieving the unique identify
37
+ * for arbitrary resource data encountered by the store. Data representing
38
+ * a unique resource or record should always be represented by the same
39
+ * identifier.
40
+ *
41
+ * It can be configured by consuming applications.
42
+ *
43
+ * @class IdentifierCache
44
+ @public
45
+ */
46
+ export class IdentifierCache {
47
+ _cache: StableCache;
48
+ _generate: GenerationMethod;
49
+ _update: UpdateMethod;
50
+ _forget: ForgetMethod;
51
+ _reset: ResetMethod;
52
+ _merge: MergeMethod;
53
+ _keyInfoForResource: KeyInfoMethod;
54
+ _isDefaultConfig: boolean;
55
+ _id: number;
56
+ constructor();
57
+ /**
58
+ * Internal hook to allow management of merge conflicts with identifiers.
59
+ *
60
+ * we allow late binding of this private internal merge so that
61
+ * the cache can insert itself here to handle elimination of duplicates
62
+ *
63
+ * @method __configureMerge
64
+ * @private
65
+ */
66
+ __configureMerge(method: MergeMethod | null): void;
67
+ upgradeIdentifier(resource: {
68
+ type: string;
69
+ id: string | null;
70
+ lid?: string;
71
+ }): StableRecordIdentifier;
72
+ /**
73
+ * @method _getRecordIdentifier
74
+ * @private
75
+ */
76
+ _getRecordIdentifier(resource: {
77
+ type: string;
78
+ id: string | null;
79
+ lid?: string;
80
+ }, shouldGenerate: 2): StableRecordIdentifier;
81
+ _getRecordIdentifier(resource: unknown, shouldGenerate: 1): StableRecordIdentifier;
82
+ _getRecordIdentifier(resource: unknown, shouldGenerate: 0): StableRecordIdentifier | undefined;
83
+ /**
84
+ * allows us to peek without generating when needed
85
+ * useful for the "create" case when we need to see if
86
+ * we are accidentally overwritting something
87
+ *
88
+ * @method peekRecordIdentifier
89
+ * @param resource
90
+ * @return {StableRecordIdentifier | undefined}
91
+ * @private
92
+ */
93
+ peekRecordIdentifier(resource: ResourceIdentifierObject | Identifier): StableRecordIdentifier | undefined;
94
+ /**
95
+ Returns the DocumentIdentifier for the given Request, creates one if it does not yet exist.
96
+ Returns `null` if the request does not have a `cacheKey` or `url`.
97
+
98
+ @method getOrCreateDocumentIdentifier
99
+ @param request
100
+ @return {StableDocumentIdentifier | null}
101
+ @public
102
+ */
103
+ getOrCreateDocumentIdentifier(request: ImmutableRequestInfo): StableDocumentIdentifier | null;
104
+ /**
105
+ Returns the Identifier for the given Resource, creates one if it does not yet exist.
106
+
107
+ Specifically this means that we:
108
+
109
+ - validate the `id` `type` and `lid` combo against known identifiers
110
+ - return an object with an `lid` that is stable (repeated calls with the same
111
+ `id` + `type` or `lid` will return the same `lid` value)
112
+ - this referential stability of the object itself is guaranteed
113
+
114
+ @method getOrCreateRecordIdentifier
115
+ @param resource
116
+ @return {StableRecordIdentifier}
117
+ @public
118
+ */
119
+ getOrCreateRecordIdentifier(resource: unknown): StableRecordIdentifier;
120
+ /**
121
+ Returns a new Identifier for the supplied data. Call this method to generate
122
+ an identifier when a new resource is being created local to the client and
123
+ potentially does not have an `id`.
124
+
125
+ Delegates generation to the user supplied `GenerateMethod` if one has been provided
126
+ with the signature `generateMethod({ type }, 'record')`.
127
+
128
+ @method createIdentifierForNewRecord
129
+ @param data
130
+ @return {StableRecordIdentifier}
131
+ @public
132
+ */
133
+ createIdentifierForNewRecord(data: {
134
+ type: string;
135
+ id?: string | null;
136
+ }): StableRecordIdentifier;
137
+ /**
138
+ Provides the opportunity to update secondary lookup tables for existing identifiers
139
+ Called after an identifier created with `createIdentifierForNewRecord` has been
140
+ committed.
141
+
142
+ Assigned `id` to an `Identifier` if `id` has not previously existed; however,
143
+ attempting to change the `id` or calling update without providing an `id` when
144
+ one is missing will throw an error.
145
+
146
+ - sets `id` (if `id` was previously `null`)
147
+ - `lid` and `type` MUST NOT be altered post creation
148
+
149
+ If a merge occurs, it is possible the returned identifier does not match the originally
150
+ provided identifier. In this case the abandoned identifier will go through the usual
151
+ `forgetRecordIdentifier` codepaths.
152
+
153
+ @method updateRecordIdentifier
154
+ @param identifierObject
155
+ @param data
156
+ @return {StableRecordIdentifier}
157
+ @public
158
+ */
159
+ updateRecordIdentifier(identifierObject: RecordIdentifier, data: unknown): StableRecordIdentifier;
160
+ /**
161
+ * @method _mergeRecordIdentifiers
162
+ * @private
163
+ */
164
+ _mergeRecordIdentifiers(keyInfo: KeyInfo, identifier: StableRecordIdentifier, existingIdentifier: StableRecordIdentifier, data: unknown): StableRecordIdentifier;
165
+ /**
166
+ Provides the opportunity to eliminate an identifier from secondary lookup tables
167
+ as well as eliminates it from ember-data's own lookup tables and book keeping.
168
+
169
+ Useful when a record has been deleted and the deletion has been persisted and
170
+ we do not care about the record anymore. Especially useful when an `id` of a
171
+ deleted record might be reused later for a new record.
172
+
173
+ @method forgetRecordIdentifier
174
+ @param identifierObject
175
+ @public
176
+ */
177
+ forgetRecordIdentifier(identifierObject: RecordIdentifier): void;
178
+ destroy(): void;
179
+ }
180
+ export {};
181
+ }
182
+ //# sourceMappingURL=identifier-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifier-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/identifier-cache.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,63 @@
1
+ declare module '@ember-data/store/-private/caches/instance-cache' {
2
+ import type { RecordIdentifier, StableRecordIdentifier } from '@warp-drive/core-types/identifier';
3
+ import type { Value } from '@warp-drive/core-types/json/raw';
4
+ import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
5
+ import type { Cache } from '@ember-data/store/-types/q/cache';
6
+ import type { OpaqueRecordInstance } from '@ember-data/store/-types/q/record-instance';
7
+ import RecordReference from '@ember-data/store/-private/legacy-model-support/record-reference';
8
+ import { CacheCapabilitiesManager } from '@ember-data/store/-private/managers/cache-capabilities-manager';
9
+ import type { CacheManager } from '@ember-data/store/-private/managers/cache-manager';
10
+ import type { CreateRecordProperties } from '@ember-data/store/-private/store-service';
11
+ import type Store from '@ember-data/store/-private/store-service';
12
+ export function peekRecordIdentifier(record: OpaqueRecordInstance): StableRecordIdentifier | undefined;
13
+ /**
14
+ Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)
15
+ assigned to the given record instance.
16
+ ```js
17
+ import { recordIdentifierFor } from "@ember-data/store";
18
+ // ... gain access to a record, for instance with peekRecord or findRecord
19
+ const record = store.peekRecord("user", "1");
20
+ // get the identifier for the record (see docs for StableRecordIdentifier)
21
+ const identifier = recordIdentifierFor(record);
22
+ // access the identifier's properties.
23
+ const { id, type, lid } = identifier;
24
+ ```
25
+ @method recordIdentifierFor
26
+ @public
27
+ @static
28
+ @for @ember-data/store
29
+ @param {Object} record a record instance previously obstained from the store.
30
+ @return {StableRecordIdentifier}
31
+ */
32
+ export function recordIdentifierFor<T extends TypedRecordInstance>(record: T): StableRecordIdentifier<TypeFromInstance<T>>;
33
+ export function recordIdentifierFor(record: OpaqueRecordInstance): StableRecordIdentifier;
34
+ export function setRecordIdentifier(record: OpaqueRecordInstance, identifier: StableRecordIdentifier): void;
35
+ export const StoreMap: Map<unknown, Store>;
36
+ export function storeFor(record: OpaqueRecordInstance): Store | undefined;
37
+ type Caches = {
38
+ record: Map<StableRecordIdentifier, OpaqueRecordInstance>;
39
+ reference: WeakMap<StableRecordIdentifier, RecordReference>;
40
+ };
41
+ export class InstanceCache {
42
+ store: Store;
43
+ cache: Cache;
44
+ _storeWrapper: CacheCapabilitiesManager;
45
+ __cacheFor: (resource: RecordIdentifier) => Cache;
46
+ __cacheManager: CacheManager;
47
+ __instances: Caches;
48
+ constructor(store: Store);
49
+ peek(identifier: StableRecordIdentifier): Cache | OpaqueRecordInstance | undefined;
50
+ getRecord(identifier: StableRecordIdentifier, properties?: CreateRecordProperties): OpaqueRecordInstance;
51
+ getReference(identifier: StableRecordIdentifier): RecordReference;
52
+ recordIsLoaded(identifier: StableRecordIdentifier, filterDeleted?: boolean): boolean;
53
+ disconnect(identifier: StableRecordIdentifier): void;
54
+ unloadRecord(identifier: StableRecordIdentifier): void;
55
+ clear(type?: string): void;
56
+ setRecordId(identifier: StableRecordIdentifier, id: string): void;
57
+ }
58
+ export function resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: StableRecordIdentifier): boolean;
59
+ export function preloadData(store: Store, identifier: StableRecordIdentifier, preload: Record<string, Value>): void;
60
+ export function _clearCaches(): void;
61
+ export {};
62
+ }
63
+ //# sourceMappingURL=instance-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance-cache.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/instance-cache.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAClG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAA4B,MAAM,+BAA+B,CAAC;AAIrH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,eAAe,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAoB1C,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,sBAAsB,GAAG,SAAS,CAErG;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,mBAAmB,EAC/D,MAAM,EAAE,CAAC,GACR,sBAAsB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,sBAAsB,CAAC;AAM1F,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAgB1G;AAED,eAAO,MAAM,QAAQ,qBAAyC,CAAC;AAE/D,wBAAgB,QAAQ,CAAC,MAAM,EAAE,oBAAoB,GAAG,KAAK,GAAG,SAAS,CAQxE;AAED,KAAK,MAAM,GAAG;IACZ,MAAM,EAAE,GAAG,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;IAC1D,SAAS,EAAE,OAAO,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;CAC7D,CAAC;AAEF,qBAAa,aAAa;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,wBAAwB,CAAC;IACxC,UAAU,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,KAAK,CAAC;IAElD,cAAc,EAAE,YAAY,CAAC;IACrC,WAAW,EAAE,MAAM,CAGjB;gBAEU,KAAK,EAAE,KAAK;IAkExB,IAAI,CAAC,UAAU,EAAE,sBAAsB,GAAG,KAAK,GAAG,oBAAoB,GAAG,SAAS;IAIlF,SAAS,CAAC,UAAU,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAE,sBAAsB,GAAG,oBAAoB;IA2BxG,YAAY,CAAC,UAAU,EAAE,sBAAsB;IAW/C,cAAc,CAAC,UAAU,EAAE,sBAAsB,EAAE,aAAa,UAAQ;IAsBxE,UAAU,CAAC,UAAU,EAAE,sBAAsB;IAkB7C,YAAY,CAAC,UAAU,EAAE,sBAAsB;IAuD/C,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM;IAuBnB,WAAW,CAAC,UAAU,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM;CA+C3D;AAMD,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,sBAAsB,GAAG,OAAO,CAGhH;AAcD,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,QAwB3G;AAiCD,wBAAgB,YAAY,SAI3B"}
@@ -0,0 +1,12 @@
1
+ declare module '@ember-data/store/-private/caches/resource-utils' {
2
+ export function hasLid(resource: unknown): resource is {
3
+ lid: string;
4
+ };
5
+ export function hasId(resource: unknown): resource is {
6
+ id: string;
7
+ };
8
+ export function hasType(resource: unknown): resource is {
9
+ type: string;
10
+ };
11
+ }
12
+ //# sourceMappingURL=resource-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-utils.d.ts","sourceRoot":"","sources":["../../../src/-private/caches/resource-utils.ts"],"names":[],"mappings":"AAUA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAErE;AAED,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAInE;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAEvE"}