@warp-drive/core 5.7.0-alpha.2 → 5.7.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/reactive/-private/default-mode.d.ts +71 -0
- package/declarations/reactive/-private/fields/get-field-key.d.ts +8 -0
- package/declarations/reactive/-private/fields/managed-array.d.ts +3 -5
- package/declarations/reactive/-private/fields/managed-object.d.ts +5 -3
- package/declarations/reactive/-private/kind/alias-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/array-field.d.ts +9 -0
- package/declarations/reactive/-private/kind/attribute-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/belongs-to-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/collection-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/derived-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/generic-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/has-many-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/hash-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/identity-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/local-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/object-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/resource-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/schema-array-field.d.ts +4 -0
- package/declarations/reactive/-private/kind/schema-object-field.d.ts +4 -0
- package/declarations/reactive/-private/record.d.ts +2 -4
- package/declarations/reactive/-private/schema.d.ts +5 -1
- package/declarations/store/-types/q/schema-service.d.ts +19 -31
- package/declarations/types/schema/fields.d.ts +309 -3
- package/dist/graph/-private.js +1 -1
- package/dist/{handler-D2jjnIA-.js → handler-Gm-q2q05.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/reactive.js +1000 -530
- package/dist/{request-state-CejVJgdj.js → request-state-Bj0zUw2r.js} +5 -0
- package/dist/store/-private.js +2 -2
- package/dist/types/-private.js +1 -1
- package/dist/types/schema/fields.js +13 -0
- package/package.json +3 -3
- package/declarations/reactive/-private/fields/compute.d.ts +0 -43
|
@@ -6412,6 +6412,7 @@ function assertNoDuplicates(collection, target, callback, reason) {
|
|
|
6412
6412
|
}
|
|
6413
6413
|
}
|
|
6414
6414
|
function mutateAddToRelatedRecords(collection, operationInfo, _SIGNAL) {
|
|
6415
|
+
// FIXME field needs to use sourceKey
|
|
6415
6416
|
mutate(collection, {
|
|
6416
6417
|
op: 'add',
|
|
6417
6418
|
record: collection.identifier,
|
|
@@ -6420,6 +6421,7 @@ function mutateAddToRelatedRecords(collection, operationInfo, _SIGNAL) {
|
|
|
6420
6421
|
}, _SIGNAL);
|
|
6421
6422
|
}
|
|
6422
6423
|
function mutateRemoveFromRelatedRecords(collection, operationInfo, _SIGNAL) {
|
|
6424
|
+
// FIXME field needs to use sourceKey
|
|
6423
6425
|
mutate(collection, {
|
|
6424
6426
|
op: 'remove',
|
|
6425
6427
|
record: collection.identifier,
|
|
@@ -6428,6 +6430,7 @@ function mutateRemoveFromRelatedRecords(collection, operationInfo, _SIGNAL) {
|
|
|
6428
6430
|
}, _SIGNAL);
|
|
6429
6431
|
}
|
|
6430
6432
|
function mutateReplaceRelatedRecord(collection, operationInfo, _SIGNAL) {
|
|
6433
|
+
// FIXME field needs to use sourceKey
|
|
6431
6434
|
mutate(collection, {
|
|
6432
6435
|
op: 'replaceRelatedRecord',
|
|
6433
6436
|
record: collection.identifier,
|
|
@@ -6436,6 +6439,7 @@ function mutateReplaceRelatedRecord(collection, operationInfo, _SIGNAL) {
|
|
|
6436
6439
|
}, _SIGNAL);
|
|
6437
6440
|
}
|
|
6438
6441
|
function mutateReplaceRelatedRecords(collection, value, _SIGNAL) {
|
|
6442
|
+
// FIXME field needs to use sourceKey
|
|
6439
6443
|
mutate(collection, {
|
|
6440
6444
|
op: 'replaceRelatedRecords',
|
|
6441
6445
|
record: collection.identifier,
|
|
@@ -6444,6 +6448,7 @@ function mutateReplaceRelatedRecords(collection, value, _SIGNAL) {
|
|
|
6444
6448
|
}, _SIGNAL);
|
|
6445
6449
|
}
|
|
6446
6450
|
function mutateSortRelatedRecords(collection, value, _SIGNAL) {
|
|
6451
|
+
// FIXME field needs to use sourceKey
|
|
6447
6452
|
mutate(collection, {
|
|
6448
6453
|
op: 'sortRelatedRecords',
|
|
6449
6454
|
record: collection.identifier,
|
package/dist/store/-private.js
CHANGED
|
@@ -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, 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-
|
|
2
|
-
export { C as CacheHandler } from "../handler-
|
|
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-Bj0zUw2r.js";
|
|
2
|
+
export { C as CacheHandler } from "../handler-Gm-q2q05.js";
|
|
3
3
|
export { A as ARRAY_SIGNAL, O as OBJECT_SIGNAL, c as createMemo, w as waitFor } from "../configure-B48bFHOl.js";
|
package/dist/types/-private.js
CHANGED
|
@@ -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.
|
|
3
|
+
const version = "5.7.0-alpha.4";
|
|
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
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* A generic "field" that can be used to define
|
|
3
5
|
* primitive value fields.
|
|
@@ -374,6 +376,17 @@
|
|
|
374
376
|
* @public
|
|
375
377
|
*/
|
|
376
378
|
|
|
379
|
+
/**
|
|
380
|
+
* A union of all possible LegacyMode and PolarisMode
|
|
381
|
+
* field schemas that represent data that could be in
|
|
382
|
+
* the cache.
|
|
383
|
+
*
|
|
384
|
+
* In other words this will not include types like alias
|
|
385
|
+
* fields, local fields, or derived fields.
|
|
386
|
+
*
|
|
387
|
+
* @public
|
|
388
|
+
*/
|
|
389
|
+
|
|
377
390
|
/**
|
|
378
391
|
* A union of all possible field schemas that can be
|
|
379
392
|
* used in an ObjectSchema.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warp-drive/core",
|
|
3
|
-
"version": "5.7.0-alpha.
|
|
3
|
+
"version": "5.7.0-alpha.4",
|
|
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.
|
|
40
|
+
"@warp-drive/build-config": "5.7.0-alpha.4"
|
|
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.
|
|
46
|
+
"@warp-drive/internal-config": "5.7.0-alpha.4",
|
|
47
47
|
"decorator-transforms": "^2.3.0",
|
|
48
48
|
"ember-source": "~6.3.0",
|
|
49
49
|
"expect-type": "^1.2.1",
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { Store, StoreRequestInput } from "../../../index.js";
|
|
2
|
-
import type { Future } from "../../../request.js";
|
|
3
|
-
import { RelatedCollection as ManyArray } from "../../../store/-private.js";
|
|
4
|
-
import type { Cache } from "../../../types/cache.js";
|
|
5
|
-
import type { StableRecordIdentifier } from "../../../types/identifier.js";
|
|
6
|
-
import type { ArrayField, DerivedField, FieldSchema, GenericField, LegacyHasManyField, LocalField, ObjectField, SchemaArrayField, SchemaObjectField } from "../../../types/schema/fields.js";
|
|
7
|
-
import type { Links } from "../../../types/spec/json-api-raw.js";
|
|
8
|
-
import { RecordStore } from "../../../types/symbols.js";
|
|
9
|
-
import { ReactiveResource } from "../record.js";
|
|
10
|
-
import type { SchemaService } from "../schema.js";
|
|
11
|
-
import { Parent } from "../symbols.js";
|
|
12
|
-
import { ManagedArray } from "./managed-array.js";
|
|
13
|
-
import { ManagedObject } from "./managed-object.js";
|
|
14
|
-
export declare const ManagedArrayMap: Map<ReactiveResource, Map<string, ManagedArray | ManyArray>>;
|
|
15
|
-
export declare const ManagedObjectMap: Map<ReactiveResource, Map<string, ManagedObject | ReactiveResource>>;
|
|
16
|
-
export declare function computeLocal(record: typeof Proxy<ReactiveResource>, field: LocalField, prop: string): unknown;
|
|
17
|
-
export declare function peekManagedArray(record: ReactiveResource, field: FieldSchema): ManyArray | ManagedArray | undefined;
|
|
18
|
-
export declare function peekManagedObject(record: ReactiveResource, field: ObjectField): ManagedObject | undefined;
|
|
19
|
-
export declare function peekManagedObject(record: ReactiveResource, field: SchemaObjectField): ReactiveResource | undefined;
|
|
20
|
-
export declare function computeField(schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: GenericField, prop: string | string[], editable: boolean): unknown;
|
|
21
|
-
export declare function computeArray(store: Store, schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: ArrayField | SchemaArrayField, path: string[], editable: boolean, legacy: boolean): ManagedArray | null;
|
|
22
|
-
export declare function computeObject(schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: ObjectField, path: string[], editable: boolean, legacy: boolean): ManagedObject | null;
|
|
23
|
-
export declare function computeSchemaObject(store: Store, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: SchemaObjectField, path: string[], legacy: boolean, editable: boolean): ReactiveResource | null;
|
|
24
|
-
export declare function computeAttribute(cache: Cache, identifier: StableRecordIdentifier, prop: string, editable: boolean): unknown;
|
|
25
|
-
export declare function computeDerivation(schema: SchemaService, record: ReactiveResource, identifier: StableRecordIdentifier, field: DerivedField, prop: string): unknown;
|
|
26
|
-
interface ResourceRelationship<T extends ReactiveResource = ReactiveResource> {
|
|
27
|
-
lid: string;
|
|
28
|
-
[Parent]: ReactiveResource;
|
|
29
|
-
[RecordStore]: Store;
|
|
30
|
-
name: string;
|
|
31
|
-
data: T | null;
|
|
32
|
-
links: Links;
|
|
33
|
-
meta: Record<string, unknown>;
|
|
34
|
-
}
|
|
35
|
-
// TODO probably this should just be a Document
|
|
36
|
-
// but its separate until we work out the lid situation
|
|
37
|
-
declare class ResourceRelationship<T extends ReactiveResource = ReactiveResource> {
|
|
38
|
-
constructor(store: Store, cache: Cache, parent: ReactiveResource, identifier: StableRecordIdentifier, field: FieldSchema, name: string, editable: boolean);
|
|
39
|
-
fetch(options?: StoreRequestInput<T, T>): Future<T>;
|
|
40
|
-
}
|
|
41
|
-
export declare function computeResource<T extends ReactiveResource>(store: Store, cache: Cache, parent: ReactiveResource, identifier: StableRecordIdentifier, field: FieldSchema, prop: string, editable: boolean): ResourceRelationship<T>;
|
|
42
|
-
export declare function computeHasMany(store: Store, schema: SchemaService, cache: Cache, record: ReactiveResource, identifier: StableRecordIdentifier, field: LegacyHasManyField, path: string[], editable: boolean, legacy: boolean): ManyArray | null;
|
|
43
|
-
export {};
|