@ember-data/store 5.4.0-beta.1 → 5.4.0-beta.11

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 (82) hide show
  1. package/README.md +16 -4
  2. package/addon-main.cjs +5 -0
  3. package/dist/-private.js +1 -0
  4. package/{addon/store-service-f6cb9898.js → dist/cache-handler-C5ilAUZ5.js} +1950 -1474
  5. package/dist/cache-handler-C5ilAUZ5.js.map +1 -0
  6. package/{addon → dist}/index.js +4 -1
  7. package/dist/types.js +0 -0
  8. package/dist/types.js.map +1 -0
  9. package/package.json +61 -48
  10. package/unstable-preview-types/-private/cache-handler.d.ts +144 -0
  11. package/unstable-preview-types/-private/cache-handler.d.ts.map +1 -0
  12. package/unstable-preview-types/-private/caches/cache-utils.d.ts +11 -0
  13. package/unstable-preview-types/-private/caches/cache-utils.d.ts.map +1 -0
  14. package/unstable-preview-types/-private/caches/identifier-cache.d.ts +176 -0
  15. package/unstable-preview-types/-private/caches/identifier-cache.d.ts.map +1 -0
  16. package/unstable-preview-types/-private/caches/instance-cache.d.ts +61 -0
  17. package/unstable-preview-types/-private/caches/instance-cache.d.ts.map +1 -0
  18. package/unstable-preview-types/-private/caches/resource-utils.d.ts +12 -0
  19. package/unstable-preview-types/-private/caches/resource-utils.d.ts.map +1 -0
  20. package/unstable-preview-types/-private/document.d.ts +146 -0
  21. package/unstable-preview-types/-private/document.d.ts.map +1 -0
  22. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts +179 -0
  23. package/unstable-preview-types/-private/legacy-model-support/record-reference.d.ts.map +1 -0
  24. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts +19 -0
  25. package/unstable-preview-types/-private/legacy-model-support/shim-model-class.d.ts.map +1 -0
  26. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts +31 -0
  27. package/unstable-preview-types/-private/managers/cache-capabilities-manager.d.ts.map +1 -0
  28. package/unstable-preview-types/-private/managers/cache-manager.d.ts +441 -0
  29. package/unstable-preview-types/-private/managers/cache-manager.d.ts.map +1 -0
  30. package/unstable-preview-types/-private/managers/notification-manager.d.ts +96 -0
  31. package/unstable-preview-types/-private/managers/notification-manager.d.ts.map +1 -0
  32. package/unstable-preview-types/-private/managers/record-array-manager.d.ts +97 -0
  33. package/unstable-preview-types/-private/managers/record-array-manager.d.ts.map +1 -0
  34. package/unstable-preview-types/-private/network/request-cache.d.ts +109 -0
  35. package/unstable-preview-types/-private/network/request-cache.d.ts.map +1 -0
  36. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts +138 -0
  37. package/unstable-preview-types/-private/record-arrays/identifier-array.d.ts.map +1 -0
  38. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts +118 -0
  39. package/unstable-preview-types/-private/record-arrays/native-proxy-type-fix.d.ts.map +1 -0
  40. package/unstable-preview-types/-private/store-service.d.ts +1522 -0
  41. package/unstable-preview-types/-private/store-service.d.ts.map +1 -0
  42. package/unstable-preview-types/-private/store-service.type-test.d.ts +4 -0
  43. package/unstable-preview-types/-private/store-service.type-test.d.ts.map +1 -0
  44. package/unstable-preview-types/-private/utils/coerce-id.d.ts +10 -0
  45. package/unstable-preview-types/-private/utils/coerce-id.d.ts.map +1 -0
  46. package/unstable-preview-types/-private/utils/construct-resource.d.ts +9 -0
  47. package/unstable-preview-types/-private/utils/construct-resource.d.ts.map +1 -0
  48. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts +4 -0
  49. package/unstable-preview-types/-private/utils/is-non-empty-string.d.ts.map +1 -0
  50. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts +4 -0
  51. package/unstable-preview-types/-private/utils/normalize-model-name.d.ts.map +1 -0
  52. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts +4 -0
  53. package/unstable-preview-types/-private/utils/uuid-polyfill.d.ts.map +1 -0
  54. package/unstable-preview-types/-private.d.ts +25 -0
  55. package/unstable-preview-types/-private.d.ts.map +1 -0
  56. package/unstable-preview-types/-types/overview.d.ts +21 -0
  57. package/unstable-preview-types/-types/overview.d.ts.map +1 -0
  58. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts +109 -0
  59. package/unstable-preview-types/-types/q/cache-capabilities-manager.d.ts.map +1 -0
  60. package/unstable-preview-types/-types/q/ds-model.d.ts +25 -0
  61. package/unstable-preview-types/-types/q/ds-model.d.ts.map +1 -0
  62. package/unstable-preview-types/-types/q/identifier.d.ts +193 -0
  63. package/unstable-preview-types/-types/q/identifier.d.ts.map +1 -0
  64. package/unstable-preview-types/-types/q/promise-proxies.d.ts +4 -0
  65. package/unstable-preview-types/-types/q/promise-proxies.d.ts.map +1 -0
  66. package/unstable-preview-types/-types/q/record-data-json-api.d.ts +36 -0
  67. package/unstable-preview-types/-types/q/record-data-json-api.d.ts.map +1 -0
  68. package/unstable-preview-types/-types/q/record-instance.d.ts +29 -0
  69. package/unstable-preview-types/-types/q/record-instance.d.ts.map +1 -0
  70. package/unstable-preview-types/-types/q/schema-service.d.ts +358 -0
  71. package/unstable-preview-types/-types/q/schema-service.d.ts.map +1 -0
  72. package/unstable-preview-types/-types/q/store.d.ts +38 -0
  73. package/unstable-preview-types/-types/q/store.d.ts.map +1 -0
  74. package/unstable-preview-types/index.d.ts +222 -0
  75. package/unstable-preview-types/index.d.ts.map +1 -0
  76. package/unstable-preview-types/types.d.ts +7 -0
  77. package/unstable-preview-types/types.d.ts.map +1 -0
  78. package/addon/-private.js +0 -1
  79. package/addon/store-service-f6cb9898.js.map +0 -1
  80. package/addon-main.js +0 -93
  81. /package/{addon → dist}/-private.js.map +0 -0
  82. /package/{addon → dist}/index.js.map +0 -0
@@ -1 +1,4 @@
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-f6cb9898";
1
+ export { C as CacheHandler, S as default, r as recordIdentifierFor, c as setIdentifierForgetMethod, a as setIdentifierGenerationMethod, d as setIdentifierResetMethod, b as setIdentifierUpdateMethod, e as setKeyInfoForResource, s as storeFor } from "./cache-handler-C5ilAUZ5.js";
2
+ import '@ember/debug';
3
+ import '@embroider/macros';
4
+ import '@ember-data/request-utils/string';
package/dist/types.js ADDED
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-data/store",
3
- "version": "5.4.0-beta.1",
3
+ "version": "5.4.0-beta.11",
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,74 +11,87 @@
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": [
22
- "addon-main.js",
23
- "addon",
16
+ "unstable-preview-types",
17
+ "addon-main.cjs",
18
+ "dist",
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-beta.1",
33
- "@ember/string": "^3.1.1",
34
- "@glimmer/tracking": "^1.1.2"
24
+ "exports": {
25
+ ".": {
26
+ "default": "./dist/index.js"
27
+ },
28
+ "./*": {
29
+ "default": "./dist/*.js"
30
+ }
31
+ },
32
+ "scripts": {
33
+ "lint": "eslint . --quiet --cache --cache-strategy=content --report-unused-disable-directives",
34
+ "build:pkg": "vite build;",
35
+ "sync-hardlinks": "bun run sync-dependencies-meta-injected"
35
36
  },
36
37
  "dependenciesMeta": {
37
- "@ember-data/private-build-infra": {
38
+ "@ember-data/tracking": {
39
+ "injected": true
40
+ },
41
+ "@ember-data/request": {
38
42
  "injected": true
39
43
  },
40
- "@ember/string": {
44
+ "@ember-data/request-utils": {
45
+ "injected": true
46
+ },
47
+ "@warp-drive/core-types": {
48
+ "injected": true
49
+ },
50
+ "@warp-drive/build-config": {
41
51
  "injected": true
42
52
  }
43
53
  },
44
54
  "dependencies": {
45
- "@ember-data/private-build-infra": "5.4.0-beta.1",
46
- "@embroider/macros": "^1.13.1",
47
- "ember-cached-decorator-polyfill": "^1.0.2",
48
- "ember-cli-babel": "^8.0.0",
49
- "@glimmer/validator": "^0.84.3"
55
+ "@embroider/macros": "^1.16.1",
56
+ "@warp-drive/build-config": "0.0.0-beta.6"
57
+ },
58
+ "peerDependencies": {
59
+ "@ember-data/request": "5.4.0-beta.11",
60
+ "@ember-data/request-utils": "5.4.0-beta.11",
61
+ "@ember-data/tracking": "5.4.0-beta.11",
62
+ "@warp-drive/core-types": "0.0.0-beta.11"
50
63
  },
51
64
  "devDependencies": {
52
- "@babel/cli": "^7.22.15",
53
- "@babel/core": "^7.22.20",
54
- "@babel/plugin-proposal-decorators": "^7.22.15",
55
- "@babel/plugin-transform-class-properties": "^7.22.5",
56
- "@babel/plugin-transform-private-methods": "^7.22.5",
57
- "@babel/plugin-transform-runtime": "^7.22.15",
58
- "@babel/plugin-transform-typescript": "^7.22.15",
59
- "@babel/preset-env": "^7.22.20",
60
- "@babel/preset-typescript": "^7.22.15",
61
- "@babel/runtime": "^7.22.15",
62
- "@embroider/addon-dev": "^4.1.0",
65
+ "@babel/core": "^7.24.5",
66
+ "@babel/plugin-transform-typescript": "^7.24.5",
67
+ "@babel/preset-env": "^7.24.5",
68
+ "@babel/preset-typescript": "^7.24.1",
69
+ "@ember-data/request": "5.4.0-beta.11",
70
+ "@ember-data/request-utils": "5.4.0-beta.11",
71
+ "@ember-data/tracking": "5.4.0-beta.11",
63
72
  "@glimmer/component": "^1.1.2",
64
- "@rollup/plugin-babel": "^6.0.3",
65
- "@rollup/plugin-node-resolve": "^15.2.1",
66
- "ember-source": "~5.3.0",
67
- "rollup": "^3.29.3",
68
- "tslib": "^2.6.2",
69
- "typescript": "^5.2.2",
70
- "walk-sync": "^3.0.0",
71
- "webpack": "^5.88.2"
73
+ "@warp-drive/core-types": "0.0.0-beta.11",
74
+ "@warp-drive/internal-config": "5.4.0-beta.11",
75
+ "decorator-transforms": "^2.0.0",
76
+ "ember-source": "~5.8.0",
77
+ "expect-type": "^0.19.0",
78
+ "pnpm-sync-dependencies-meta-injected": "0.0.14",
79
+ "typescript": "^5.4.5",
80
+ "vite": "^5.2.11"
72
81
  },
73
82
  "engines": {
74
- "node": "16.* || >= 18.*"
83
+ "node": ">= 18.20.3"
75
84
  },
76
85
  "volta": {
77
86
  "extends": "../../package.json"
78
87
  },
79
- "packageManager": "pnpm@8.7.6",
80
- "scripts": {
81
- "build": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js",
82
- "start": "rollup --config --watch"
88
+ "packageManager": "pnpm@8.15.8",
89
+ "ember-addon": {
90
+ "main": "addon-main.cjs",
91
+ "type": "addon",
92
+ "version": 2
93
+ },
94
+ "ember": {
95
+ "edition": "octane"
83
96
  }
84
- }
97
+ }
@@ -0,0 +1,144 @@
1
+ declare module '@ember-data/store/-private/cache-handler' {
2
+ /**
3
+ * @module @ember-data/store
4
+ */
5
+ import type { CacheHandler as CacheHandlerType } from '@ember-data/request';
6
+ import type { StableDocumentIdentifier } from '@warp-drive/core-types/identifier';
7
+ import type { ImmutableRequestInfo, RequestContext, ResponseInfo } from '@warp-drive/core-types/request';
8
+ import { EnableHydration } from '@warp-drive/core-types/request';
9
+ import type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';
10
+ import type { Store } from '@ember-data/store/-private/store-service';
11
+ /**
12
+ * A service which an application may provide to the store via
13
+ * the store's `lifetimes` property to configure the behavior
14
+ * of the CacheHandler.
15
+ *
16
+ * The default behavior for request lifetimes is to never expire
17
+ * unless manually refreshed via `cacheOptions.reload` or `cacheOptions.backgroundReload`.
18
+ *
19
+ * Implementing this service allows you to programatically define
20
+ * when a request should be considered expired.
21
+ *
22
+ * @class <Interface> CachePolicy
23
+ * @public
24
+ */
25
+ export interface CachePolicy {
26
+ /**
27
+ * Invoked to determine if the request may be fulfilled from cache
28
+ * if possible.
29
+ *
30
+ * Note, this is only invoked if the request has a cache-key.
31
+ *
32
+ * If no cache entry is found or the entry is hard expired,
33
+ * the request will be fulfilled from the configured request handlers
34
+ * and the cache will be updated before returning the response.
35
+ *
36
+ * @method isHardExpired
37
+ * @public
38
+ * @param {StableDocumentIdentifier} identifier
39
+ * @param {Store} store
40
+ * @return {boolean} true if the request is considered hard expired
41
+ */
42
+ isHardExpired(identifier: StableDocumentIdentifier, store: Store): boolean;
43
+ /**
44
+ * Invoked if `isHardExpired` is false to determine if the request
45
+ * should be update behind the scenes if cache data is already available.
46
+ *
47
+ * Note, this is only invoked if the request has a cache-key.
48
+ *
49
+ * If true, the request will be fulfilled from cache while a backgrounded
50
+ * request is made to update the cache via the configured request handlers.
51
+ *
52
+ * @method isSoftExpired
53
+ * @public
54
+ * @param {StableDocumentIdentifier} identifier
55
+ * @param {Store} store
56
+ * @return {boolean} true if the request is considered soft expired
57
+ */
58
+ isSoftExpired(identifier: StableDocumentIdentifier, store: Store): boolean;
59
+ /**
60
+ * Invoked when a request will be sent to the configured request handlers.
61
+ * This is invoked for both foreground and background requests.
62
+ *
63
+ * Note, this is invoked regardless of whether the request has a cache-key.
64
+ *
65
+ * @method willRequest [Optional]
66
+ * @public
67
+ * @param {ImmutableRequestInfo} request
68
+ * @param {StableDocumentIdentifier | null} identifier
69
+ * @param {Store} store
70
+ * @return {void}
71
+ */
72
+ willRequest?(request: ImmutableRequestInfo, identifier: StableDocumentIdentifier | null, store: Store): void;
73
+ /**
74
+ * Invoked when a request has been fulfilled from the configured request handlers.
75
+ * This is invoked for both foreground and background requests once the cache has
76
+ * been updated.
77
+ *
78
+ * Note, this is invoked regardless of whether the request has a cache-key.
79
+ *
80
+ * @method didRequest [Optional]
81
+ * @public
82
+ * @param {ImmutableRequestInfo} request
83
+ * @param {ImmutableResponse} response
84
+ * @param {StableDocumentIdentifier | null} identifier
85
+ * @param {Store} store
86
+ * @return {void}
87
+ */
88
+ didRequest?(request: ImmutableRequestInfo, response: Response | ResponseInfo | null, identifier: StableDocumentIdentifier | null, store: Store): void;
89
+ }
90
+ export type LooseStoreRequestInfo<T = unknown, RT = unknown> = Omit<ImmutableRequestInfo<T, RT>, 'records' | 'headers'> & {
91
+ records?: ResourceIdentifierObject[];
92
+ headers?: Headers;
93
+ };
94
+ export type StoreRequestInput<T = unknown, RT = unknown> = ImmutableRequestInfo<T, RT> | LooseStoreRequestInfo<T, RT>;
95
+ export interface StoreRequestContext extends RequestContext {
96
+ request: ImmutableRequestInfo & {
97
+ store: Store;
98
+ [EnableHydration]?: boolean;
99
+ };
100
+ }
101
+ /**
102
+ * A CacheHandler that adds support for using an EmberData Cache with a RequestManager.
103
+ *
104
+ * This handler will only run when a request has supplied a `store` instance. Requests
105
+ * issued by the store via `store.request()` will automatically have the `store` instance
106
+ * attached to the request.
107
+ *
108
+ * ```ts
109
+ * requestManager.request({
110
+ * store: store,
111
+ * url: '/api/posts',
112
+ * method: 'GET'
113
+ * });
114
+ * ```
115
+ *
116
+ * When this handler elects to handle a request, it will return the raw `StructuredDocument`
117
+ * unless the request has `[EnableHydration]` set to `true`. In this case, the handler will
118
+ * return a `Document` instance that will automatically update the UI when the cache is updated
119
+ * in the future and will hydrate any identifiers in the StructuredDocument into Record instances.
120
+ *
121
+ * When issuing a request via the store, [EnableHydration] is automatically set to `true`. This
122
+ * means that if desired you can issue requests that utilize the cache without needing to also
123
+ * utilize Record instances if desired.
124
+ *
125
+ * Said differently, you could elect to issue all requests via a RequestManager, without ever using
126
+ * the store directly, by setting [EnableHydration] to `true` and providing a store instance. Not
127
+ * necessarily the most useful thing, but the decoupled nature of the RequestManager and incremental-feature
128
+ * approach of EmberData allows for this flexibility.
129
+ *
130
+ * ```ts
131
+ * import { EnableHydration } from '@warp-drive/core-types/request';
132
+ *
133
+ * requestManager.request({
134
+ * store: store,
135
+ * url: '/api/posts',
136
+ * method: 'GET',
137
+ * [EnableHydration]: true
138
+ * });
139
+ *
140
+ * @typedoc
141
+ */
142
+ export const CacheHandler: CacheHandlerType;
143
+ }
144
+ //# 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":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAE5F,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,0CAA0C,CAAC;AAIzF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;;;;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,CAAC,CAAC,GAAG,OAAO,EAAE,EAAE,GAAG,OAAO,IAAI,IAAI,CACjE,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC3B,SAAS,GAAG,SAAS,CACtB,GAAG;IACF,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,EAAE,EAAE,GAAG,OAAO,IAAI,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,qBAAqB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAEtH,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;AA6TD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,YAAY,EAAE,gBAuD1B,CAAC"}
@@ -0,0 +1,11 @@
1
+ declare module '@ember-data/store/-private/caches/cache-utils' {
2
+ import type { Cache } from '@warp-drive/core-types/cache';
3
+ import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
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 function peekCache(instance: StableRecordIdentifier): Cache | null;
9
+ export 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,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAO3E,eAAO,MAAM,uBAAuB,qBAGnC,CAAC;AAEF,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,wBAAgB,SAAS,CAAC,QAAQ,EAAE,sBAAsB,GAAG,KAAK,GAAG,IAAI,CAAC;AAC1E,wBAAgB,SAAS,CAAC,QAAQ,EAAE,oBAAoB,GAAG,KAAK,CAAC"}
@@ -0,0 +1,176 @@
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/json-api-raw';
5
+ import type { ForgetMethod, GenerationMethod, KeyInfo, KeyInfoMethod, 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 StableCache = {
17
+ resources: IdentifierMap;
18
+ documents: Map<string, StableDocumentIdentifier>;
19
+ resourcesByType: TypeMap;
20
+ polymorphicLidBackMap: Map<string, string[]>;
21
+ };
22
+ export type MergeMethod = (targetIdentifier: StableRecordIdentifier, matchedIdentifier: StableRecordIdentifier, resourceData: unknown) => StableRecordIdentifier;
23
+ export function setIdentifierGenerationMethod(method: GenerationMethod | null): void;
24
+ export function setIdentifierUpdateMethod(method: UpdateMethod | null): void;
25
+ export function setIdentifierForgetMethod(method: ForgetMethod | null): void;
26
+ export function setIdentifierResetMethod(method: ResetMethod | null): void;
27
+ export function setKeyInfoForResource(method: KeyInfoMethod | null): void;
28
+ /**
29
+ * Each instance of {Store} receives a unique instance of a IdentifierCache.
30
+ *
31
+ * This cache is responsible for assigning or retrieving the unique identify
32
+ * for arbitrary resource data encountered by the store. Data representing
33
+ * a unique resource or record should always be represented by the same
34
+ * identifier.
35
+ *
36
+ * It can be configured by consuming applications.
37
+ *
38
+ * @class IdentifierCache
39
+ @public
40
+ */
41
+ export class IdentifierCache {
42
+ _cache: StableCache;
43
+ _generate: GenerationMethod;
44
+ _update: UpdateMethod;
45
+ _forget: ForgetMethod;
46
+ _reset: ResetMethod;
47
+ _merge: MergeMethod;
48
+ _keyInfoForResource: KeyInfoMethod;
49
+ _id: number;
50
+ constructor();
51
+ /**
52
+ * Internal hook to allow management of merge conflicts with identifiers.
53
+ *
54
+ * we allow late binding of this private internal merge so that
55
+ * the cache can insert itself here to handle elimination of duplicates
56
+ *
57
+ * @method __configureMerge
58
+ * @private
59
+ */
60
+ __configureMerge(method: MergeMethod | null): void;
61
+ upgradeIdentifier(resource: {
62
+ type: string;
63
+ id: string | null;
64
+ lid?: string;
65
+ }): StableRecordIdentifier;
66
+ /**
67
+ * @method _getRecordIdentifier
68
+ * @private
69
+ */
70
+ _getRecordIdentifier(resource: {
71
+ type: string;
72
+ id: string | null;
73
+ lid?: string;
74
+ }, shouldGenerate: 2): StableRecordIdentifier;
75
+ _getRecordIdentifier(resource: unknown, shouldGenerate: 1): StableRecordIdentifier;
76
+ _getRecordIdentifier(resource: unknown, shouldGenerate: 0): StableRecordIdentifier | undefined;
77
+ /**
78
+ * allows us to peek without generating when needed
79
+ * useful for the "create" case when we need to see if
80
+ * we are accidentally overwritting something
81
+ *
82
+ * @method peekRecordIdentifier
83
+ * @param resource
84
+ * @return {StableRecordIdentifier | undefined}
85
+ * @private
86
+ */
87
+ peekRecordIdentifier(resource: ResourceIdentifierObject | Identifier): StableRecordIdentifier | undefined;
88
+ /**
89
+ Returns the DocumentIdentifier for the given Request, creates one if it does not yet exist.
90
+ Returns `null` if the request does not have a `cacheKey` or `url`.
91
+
92
+ @method getOrCreateDocumentIdentifier
93
+ @param request
94
+ @return {StableDocumentIdentifier | null}
95
+ @public
96
+ */
97
+ getOrCreateDocumentIdentifier(request: ImmutableRequestInfo): StableDocumentIdentifier | null;
98
+ /**
99
+ Returns the Identifier for the given Resource, creates one if it does not yet exist.
100
+
101
+ Specifically this means that we:
102
+
103
+ - validate the `id` `type` and `lid` combo against known identifiers
104
+ - return an object with an `lid` that is stable (repeated calls with the same
105
+ `id` + `type` or `lid` will return the same `lid` value)
106
+ - this referential stability of the object itself is guaranteed
107
+
108
+ @method getOrCreateRecordIdentifier
109
+ @param resource
110
+ @return {StableRecordIdentifier}
111
+ @public
112
+ */
113
+ getOrCreateRecordIdentifier(resource: unknown): StableRecordIdentifier;
114
+ /**
115
+ Returns a new Identifier for the supplied data. Call this method to generate
116
+ an identifier when a new resource is being created local to the client and
117
+ potentially does not have an `id`.
118
+
119
+ Delegates generation to the user supplied `GenerateMethod` if one has been provided
120
+ with the signature `generateMethod({ type }, 'record')`.
121
+
122
+ @method createIdentifierForNewRecord
123
+ @param data
124
+ @return {StableRecordIdentifier}
125
+ @public
126
+ */
127
+ createIdentifierForNewRecord(data: {
128
+ type: string;
129
+ id?: string | null;
130
+ }): StableRecordIdentifier;
131
+ /**
132
+ Provides the opportunity to update secondary lookup tables for existing identifiers
133
+ Called after an identifier created with `createIdentifierForNewRecord` has been
134
+ committed.
135
+
136
+ Assigned `id` to an `Identifier` if `id` has not previously existed; however,
137
+ attempting to change the `id` or calling update without providing an `id` when
138
+ one is missing will throw an error.
139
+
140
+ - sets `id` (if `id` was previously `null`)
141
+ - `lid` and `type` MUST NOT be altered post creation
142
+
143
+ If a merge occurs, it is possible the returned identifier does not match the originally
144
+ provided identifier. In this case the abandoned identifier will go through the usual
145
+ `forgetRecordIdentifier` codepaths.
146
+
147
+ @method updateRecordIdentifier
148
+ @param identifierObject
149
+ @param data
150
+ @return {StableRecordIdentifier}
151
+ @public
152
+ */
153
+ updateRecordIdentifier(identifierObject: RecordIdentifier, data: unknown): StableRecordIdentifier;
154
+ /**
155
+ * @method _mergeRecordIdentifiers
156
+ * @private
157
+ */
158
+ _mergeRecordIdentifiers(keyInfo: KeyInfo, identifier: StableRecordIdentifier, existingIdentifier: StableRecordIdentifier, data: unknown): StableRecordIdentifier;
159
+ /**
160
+ Provides the opportunity to eliminate an identifier from secondary lookup tables
161
+ as well as eliminates it from ember-data's own lookup tables and book keeping.
162
+
163
+ Useful when a record has been deleted and the deletion has been persisted and
164
+ we do not care about the record anymore. Especially useful when an `id` of a
165
+ deleted record might be reused later for a new record.
166
+
167
+ @method forgetRecordIdentifier
168
+ @param identifierObject
169
+ @public
170
+ */
171
+ forgetRecordIdentifier(identifierObject: RecordIdentifier): void;
172
+ destroy(): void;
173
+ }
174
+ export {};
175
+ }
176
+ //# 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":"AAWA,OAAO,EAKL,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAE7B,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AAC,OAAO,EAAE,oBAAoB,GAAG,wBAAwB,GAAG,IAAI;IAyB7F;;;;;;;;;;;;;;MAcE;IACF,2BAA2B,CAAC,QAAQ,EAAE,OAAO,GAAG,sBAAsB;IAItE;;;;;;;;;;;;MAYE;IACF,4BAA4B,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,sBAAsB;IAyBhG;;;;;;;;;;;;;;;;;;;;;MAqBE;IACF,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,GAAG,sBAAsB;IAoEjG;;;OAGG;IACH,uBAAuB,CACrB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,sBAAsB,EAClC,kBAAkB,EAAE,sBAAsB,EAC1C,IAAI,EAAE,OAAO,GACZ,sBAAsB;IAoCzB;;;;;;;;;;;MAWE;IACF,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IA+BhE,OAAO;CAOR"}
@@ -0,0 +1,61 @@
1
+ declare module '@ember-data/store/-private/caches/instance-cache' {
2
+ import type { Cache } from '@warp-drive/core-types/cache';
3
+ import type { StableRecordIdentifier } from '@warp-drive/core-types/identifier';
4
+ import type { Value } from '@warp-drive/core-types/json/raw';
5
+ import type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';
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, Store } from '@ember-data/store/-private/store-service';
11
+ export function peekRecordIdentifier(record: OpaqueRecordInstance): StableRecordIdentifier | undefined;
12
+ /**
13
+ Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)
14
+ assigned to the given record instance.
15
+ ```js
16
+ import { recordIdentifierFor } from "@ember-data/store";
17
+ // ... gain access to a record, for instance with peekRecord or findRecord
18
+ const record = store.peekRecord("user", "1");
19
+ // get the identifier for the record (see docs for StableRecordIdentifier)
20
+ const identifier = recordIdentifierFor(record);
21
+ // access the identifier's properties.
22
+ const { id, type, lid } = identifier;
23
+ ```
24
+ @method recordIdentifierFor
25
+ @public
26
+ @static
27
+ @for @ember-data/store
28
+ @param {Object} record a record instance previously obstained from the store.
29
+ @return {StableRecordIdentifier}
30
+ */
31
+ export function recordIdentifierFor<T extends TypedRecordInstance>(record: T): StableRecordIdentifier<TypeFromInstance<T>>;
32
+ export function recordIdentifierFor(record: OpaqueRecordInstance): StableRecordIdentifier;
33
+ export function setRecordIdentifier(record: OpaqueRecordInstance, identifier: StableRecordIdentifier): void;
34
+ export const StoreMap: Map<unknown, Store>;
35
+ export function storeFor(record: OpaqueRecordInstance): Store | undefined;
36
+ type Caches = {
37
+ record: Map<StableRecordIdentifier, OpaqueRecordInstance>;
38
+ reference: WeakMap<StableRecordIdentifier, RecordReference>;
39
+ };
40
+ export class InstanceCache {
41
+ store: Store;
42
+ cache: Cache;
43
+ _storeWrapper: CacheCapabilitiesManager;
44
+ __cacheManager: CacheManager;
45
+ __instances: Caches;
46
+ constructor(store: Store);
47
+ peek(identifier: StableRecordIdentifier): Cache | OpaqueRecordInstance | undefined;
48
+ getRecord(identifier: StableRecordIdentifier, properties?: CreateRecordProperties): OpaqueRecordInstance;
49
+ getReference(identifier: StableRecordIdentifier): RecordReference;
50
+ recordIsLoaded(identifier: StableRecordIdentifier, filterDeleted?: boolean): boolean;
51
+ disconnect(identifier: StableRecordIdentifier): void;
52
+ unloadRecord(identifier: StableRecordIdentifier): void;
53
+ clear(type?: string): void;
54
+ setRecordId(identifier: StableRecordIdentifier, id: string): void;
55
+ }
56
+ export function resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: StableRecordIdentifier): boolean;
57
+ export function preloadData(store: Store, identifier: StableRecordIdentifier, preload: Record<string, Value>): void;
58
+ export function _clearCaches(): void;
59
+ export {};
60
+ }
61
+ //# 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":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAA4B,MAAM,+BAA+B,CAAC;AAQrH,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,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAoBtE,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,qBAAqE,CAAC;AAE3F,wBAAgB,QAA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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"}