@warp-drive/core 5.7.0-alpha.0 → 5.7.0-alpha.1

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.
@@ -1,3 +1,3 @@
1
- export { C as CollectionRecordArray, D as DISPOSE, I as LiveArray, M as MUTATE, R as RecordArrayManager, l as RelatedCollection, d as SOURCE, A as Signals, S as Store, j as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, b as coerceId, c as constructResource, G as consumeInternalSignal, t as createRequestSubscription, z as defineNonEnumerableSignal, y as defineSignal, e as ensureStringId, x as entangleSignal, f as fastPush, w as gate, H as getOrCreateInternalSignal, q as getPromiseState, u as getRequestState, a as isDocumentIdentifier, i as isStableIdentifier, m as log, o as logGroup, v as memoized, F as notifyInternalSignal, p as peekCache, B as peekInternalSignal, r as recordIdentifierFor, g as removeRecordDataFor, k as setCacheFor, h as setRecordIdentifier, s as storeFor, E as withSignalStore } from "../request-state-CjLph1LP.js";
2
- export { C as CacheHandler } from "../handler-C2T-IyJK.js";
1
+ export { C as CollectionRecordArray, D as DISPOSE, I as LiveArray, M as MUTATE, R as RecordArrayManager, l as RelatedCollection, d as SOURCE, B as Signals, S as Store, j as StoreMap, _ as _clearCaches, n as _deprecatingNormalize, b as coerceId, c as constructResource, H as consumeInternalSignal, t as createRequestSubscription, z as defineGate, A as defineNonEnumerableSignal, y as defineSignal, e as ensureStringId, x as entangleSignal, f as fastPush, w as gate, J as getOrCreateInternalSignal, q as getPromiseState, u as getRequestState, a as isDocumentIdentifier, i as isStableIdentifier, m as log, o as logGroup, v as memoized, G as notifyInternalSignal, p as peekCache, E as peekInternalSignal, r as recordIdentifierFor, g as removeRecordDataFor, k as setCacheFor, h as setRecordIdentifier, s as storeFor, F as withSignalStore } from "../request-state-CejVJgdj.js";
2
+ export { C as CacheHandler } from "../handler-D2jjnIA-.js";
3
3
  export { A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, c as createMemo, w as waitFor } from "../configure-B48bFHOl.js";
@@ -1,6 +1,6 @@
1
1
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
2
2
  const name = "@warp-drive/core";
3
- const version = "5.7.0-alpha.0";
3
+ const version = "5.7.0-alpha.1";
4
4
 
5
5
  // in testing mode, we utilize globals to ensure only one copy exists of
6
6
  // these maps, due to bugs in ember-auto-import
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warp-drive/core",
3
- "version": "5.7.0-alpha.0",
3
+ "version": "5.7.0-alpha.1",
4
4
  "description": "Core package for WarpDrive | All the Universal Basics",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -37,13 +37,13 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@embroider/macros": "^1.16.12",
40
- "@warp-drive/build-config": "5.7.0-alpha.0"
40
+ "@warp-drive/build-config": "5.7.0-alpha.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/core": "^7.26.10",
44
44
  "@babel/plugin-transform-typescript": "^7.27.0",
45
45
  "@babel/preset-typescript": "^7.27.0",
46
- "@warp-drive/internal-config": "5.7.0-alpha.0",
46
+ "@warp-drive/internal-config": "5.7.0-alpha.1",
47
47
  "decorator-transforms": "^2.3.0",
48
48
  "ember-source": "~6.3.0",
49
49
  "expect-type": "^1.2.1",
@@ -1,159 +0,0 @@
1
- import type { StableRecordIdentifier } from "../../../types/identifier.js";
2
- import type { SingleResourceDocument } from "../../../types/spec/json-api-raw.js";
3
- import type { OpaqueRecordInstance } from "../../-types/q/record-instance.js";
4
- import type { Store } from "../store-service.js";
5
- /**
6
- A `RecordReference` is a low-level API that allows users and
7
- addon authors to perform meta-operations on a record.
8
-
9
- @hideconstructor
10
- @public
11
- */
12
- export default class RecordReference {
13
- private store;
14
- // unsubscribe token given to us by the notification manager
15
- private ___token;
16
- private ___identifier;
17
- private _ref;
18
- constructor(store: Store, identifier: StableRecordIdentifier);
19
- /** @internal */
20
- destroy(): void;
21
- get type(): string;
22
- /**
23
- The `id` of the record that this reference refers to.
24
-
25
- Together, the `type` and `id` properties form a composite key for
26
- the identity map.
27
-
28
- Example
29
-
30
- ```javascript
31
- let userRef = store.getReference('user', 1);
32
-
33
- userRef.id(); // '1'
34
- ```
35
-
36
- @public
37
- */
38
- id(): string | null;
39
- /**
40
- The `identifier` of the record that this reference refers to.
41
-
42
- Together, the `type` and `id` properties form a composite key for
43
- the identity map.
44
-
45
- Example
46
-
47
- ```javascript
48
- let userRef = store.getReference('user', 1);
49
-
50
- userRef.identifier(); // '1'
51
- ```
52
-
53
- @public
54
- */
55
- identifier(): StableRecordIdentifier;
56
- /**
57
- How the reference will be looked up when it is loaded. Currently
58
- this always returns `identity` to signify that a record will be
59
- loaded by its `type` and `id`.
60
-
61
- Example
62
-
63
- ```javascript
64
- const userRef = store.getReference('user', 1);
65
-
66
- userRef.remoteType(); // 'identity'
67
- ```
68
-
69
- @public
70
- */
71
- remoteType(): "identity";
72
- /**
73
- This API allows you to provide a reference with new data. The
74
- simplest usage of this API is similar to `store.push`: you provide a
75
- normalized hash of data and the object represented by the reference
76
- will update.
77
-
78
- If you pass a promise to `push`, Ember Data will not ask the adapter
79
- for the data if another attempt to fetch it is made in the
80
- interim. When the promise resolves, the underlying object is updated
81
- with the new data, and the promise returned by *this function* is resolved
82
- with that object.
83
-
84
- For example, `recordReference.push(promise)` will be resolved with a
85
- record.
86
-
87
- Example
88
-
89
- ```javascript
90
- let userRef = store.getReference('user', 1);
91
-
92
- // provide data for reference
93
- userRef.push({
94
- data: {
95
- id: "1",
96
- type: "user",
97
- attributes: {
98
- username: "@user"
99
- }
100
- }
101
- }).then(function(user) {
102
- userRef.value() === user;
103
- });
104
- ```
105
-
106
- @public
107
- @param objectOrPromise a JSON:API ResourceDocument or a promise resolving to one
108
- @return a promise for the value (record or relationship)
109
- */
110
- push(objectOrPromise: SingleResourceDocument | Promise<SingleResourceDocument>): Promise<OpaqueRecordInstance>;
111
- /**
112
- If the entity referred to by the reference is already loaded, it is
113
- present as `reference.value`. Otherwise the value returned by this function
114
- is `null`.
115
-
116
- Example
117
-
118
- ```javascript
119
- let userRef = store.getReference('user', 1);
120
-
121
- userRef.value(); // user
122
- ```
123
-
124
- @public
125
- */
126
- value(): OpaqueRecordInstance | null;
127
- /**
128
- Triggers a fetch for the backing entity based on its `remoteType`
129
- (see `remoteType` definitions per reference type).
130
-
131
- Example
132
-
133
- ```javascript
134
- let userRef = store.getReference('user', 1);
135
-
136
- // load user (via store.find)
137
- userRef.load().then(...)
138
- ```
139
-
140
- @public
141
- */
142
- load(): Promise<OpaqueRecordInstance>;
143
- /**
144
- Reloads the record if it is already loaded. If the record is not
145
- loaded it will load the record via `store.findRecord`
146
-
147
- Example
148
-
149
- ```javascript
150
- let userRef = store.getReference('user', 1);
151
-
152
- // or trigger a reload
153
- userRef.reload().then(...)
154
- ```
155
-
156
- @public
157
- */
158
- reload(): Promise<OpaqueRecordInstance>;
159
- }
@@ -1,17 +0,0 @@
1
- import type { TypedRecordInstance, TypeFromInstance } from "../../../types/record.js";
2
- import type { LegacyAttributeField, LegacyRelationshipField } from "../../../types/schema/fields.js";
3
- import type { KeyOrString, ModelSchema } from "../../-types/q/ds-model.js";
4
- import type { Store } from "../store-service.js";
5
- export declare function getShimClass<T>(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string): ShimModelClass<T>;
6
- // Mimics the static apis of @ember-data/model
7
- export default class ShimModelClass<T = unknown> implements ModelSchema<T> {
8
- private __store;
9
- modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
10
- constructor(store: Store, modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string);
11
- get fields(): Map<KeyOrString<T>, "attribute" | "belongsTo" | "hasMany">;
12
- get attributes(): Map<KeyOrString<T>, LegacyAttributeField>;
13
- get relationshipsByName(): Map<KeyOrString<T>, LegacyRelationshipField>;
14
- eachAttribute<K extends KeyOrString<T>>(callback: (key: K, attribute: LegacyAttributeField) => void, binding?: T): void;
15
- eachRelationship<K extends KeyOrString<T>>(callback: (key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
16
- eachTransformedAttribute<K extends KeyOrString<T>>(callback: (key: K, type: string | null) => void, binding?: T): void;
17
- }
@@ -1,21 +0,0 @@
1
- import type { TypedRecordInstance, TypeFromInstance } from "../../../types/record.js";
2
- import type { LegacyAttributeField, LegacyRelationshipField } from "../../../types/schema/fields.js";
3
- export type KeyOrString<T> = keyof T & string extends never ? string : keyof T & string;
4
- /**
5
- * Minimum subset of static schema methods and properties on the
6
- * "model" class.
7
- *
8
- * Only used when using the legacy schema-service implementation
9
- * for @ember-data/model or when wrapping schema for legacy
10
- * Adapters/Serializers.
11
- *
12
- */
13
- export interface ModelSchema<T = unknown> {
14
- modelName: T extends TypedRecordInstance ? TypeFromInstance<T> : string;
15
- fields: Map<KeyOrString<T>, "attribute" | "belongsTo" | "hasMany">;
16
- attributes: Map<KeyOrString<T>, LegacyAttributeField>;
17
- relationshipsByName: Map<KeyOrString<T>, LegacyRelationshipField>;
18
- eachAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, attribute: LegacyAttributeField) => void, binding?: T): void;
19
- eachRelationship<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, relationship: LegacyRelationshipField) => void, binding?: T): void;
20
- eachTransformedAttribute<K extends KeyOrString<T>>(callback: (this: ModelSchema<T>, key: K, type: string | null) => void, binding?: T): void;
21
- }