@warp-drive/core 5.6.0-alpha.5 → 5.6.0-beta.0
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/README.md +8 -7
- package/cjs-dist/addon-shim.cjs +1 -0
- package/cjs-dist/cjs-set-config.cjs +1 -0
- package/declarations/build-config/babel-macros.d.ts +1 -0
- package/declarations/build-config/canary-features.d.ts +1 -0
- package/declarations/build-config/debugging.d.ts +1 -0
- package/declarations/build-config/deprecations.d.ts +1 -0
- package/declarations/build-config/env.d.ts +1 -0
- package/declarations/build-config/macros.d.ts +1 -0
- package/declarations/build-config.d.ts +1 -0
- package/declarations/configure.d.ts +7 -0
- package/declarations/graph/-private/-diff.d.ts +32 -0
- package/declarations/graph/-private/-edge-definition.d.ts +148 -0
- package/declarations/graph/-private/-state.d.ts +96 -0
- package/declarations/graph/-private/-utils.d.ts +31 -0
- package/declarations/graph/-private/coerce-id.d.ts +10 -0
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +18 -0
- package/declarations/graph/-private/edges/collection.d.ts +39 -0
- package/declarations/graph/-private/edges/implicit.d.ts +43 -0
- package/declarations/graph/-private/edges/resource.d.ts +24 -0
- package/declarations/graph/-private/graph.d.ts +90 -0
- package/declarations/graph/-private/normalize-link.d.ts +8 -0
- package/declarations/graph/-private/operations/add-to-related-records.d.ts +4 -0
- package/declarations/graph/-private/operations/merge-identifier.d.ts +3 -0
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts +4 -0
- package/declarations/graph/-private/operations/replace-related-record.d.ts +3 -0
- package/declarations/graph/-private/operations/replace-related-records.d.ts +62 -0
- package/declarations/graph/-private/operations/update-relationship.d.ts +13 -0
- package/declarations/graph/-private.d.ts +13 -0
- package/declarations/index.d.ts +14 -3
- package/declarations/reactive/-private/document.d.ts +146 -0
- package/declarations/reactive/-private/fields/compute.d.ts +43 -0
- package/declarations/reactive/-private/fields/extension.d.ts +8 -0
- package/declarations/reactive/-private/fields/managed-array.d.ts +22 -0
- package/declarations/reactive/-private/fields/managed-object.d.ts +21 -0
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +19 -0
- package/declarations/reactive/-private/hooks.d.ts +5 -0
- package/declarations/reactive/-private/record.d.ts +64 -0
- package/declarations/reactive/-private/schema.d.ts +271 -0
- package/declarations/reactive/-private/symbols.d.ts +36 -0
- package/declarations/reactive/-private.d.ts +1 -0
- package/declarations/reactive.d.ts +4 -0
- package/declarations/request/-private/context.d.ts +34 -35
- package/declarations/request/-private/debug.d.ts +2 -3
- package/declarations/request/-private/fetch.d.ts +24 -36
- package/declarations/request/-private/future.d.ts +3 -4
- package/declarations/request/-private/manager.d.ts +159 -132
- package/declarations/request/-private/promise-cache.d.ts +21 -13
- package/declarations/request/-private/types.d.ts +124 -123
- package/declarations/request/-private/utils.d.ts +8 -9
- package/declarations/request.d.ts +5 -433
- package/declarations/store/-private/cache-handler/handler.d.ts +62 -0
- package/declarations/store/-private/cache-handler/types.d.ts +98 -0
- package/declarations/store/-private/cache-handler/utils.d.ts +32 -0
- package/declarations/store/-private/caches/cache-utils.d.ts +12 -0
- package/declarations/store/-private/caches/identifier-cache.d.ts +304 -0
- package/declarations/store/-private/caches/instance-cache.d.ts +65 -0
- package/declarations/store/-private/caches/resource-utils.d.ts +9 -0
- package/declarations/store/-private/debug/utils.d.ts +6 -0
- package/declarations/store/-private/default-cache-policy.d.ts +384 -0
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts +159 -0
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +17 -0
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +25 -0
- package/declarations/store/-private/managers/cache-manager.d.ts +443 -0
- package/declarations/store/-private/managers/notification-manager.d.ts +98 -0
- package/declarations/store/-private/managers/record-array-manager.d.ts +97 -0
- package/declarations/store/-private/network/request-cache.d.ts +107 -0
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts +263 -0
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +176 -0
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +169 -0
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +35 -0
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +277 -0
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +261 -0
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +147 -0
- package/declarations/store/-private/record-arrays/many-array.d.ts +197 -0
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +126 -0
- package/declarations/store/-private/store-service.d.ts +1605 -0
- package/declarations/store/-private/utils/coerce-id.d.ts +10 -0
- package/declarations/store/-private/utils/construct-resource.d.ts +6 -0
- package/declarations/store/-private/utils/is-non-empty-string.d.ts +1 -0
- package/declarations/store/-private/utils/normalize-model-name.d.ts +1 -0
- package/declarations/store/-private/utils/uuid-polyfill.d.ts +1 -0
- package/declarations/store/-private.d.ts +31 -0
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +99 -0
- package/declarations/store/-types/q/ds-model.d.ts +21 -0
- package/declarations/store/-types/q/identifier.d.ts +20 -0
- package/declarations/store/-types/q/record-instance.d.ts +23 -0
- package/declarations/store/-types/q/schema-service.d.ts +354 -0
- package/declarations/store/-types/q/store.d.ts +32 -0
- package/declarations/store.d.ts +1 -0
- package/declarations/types/-private.d.ts +16 -8
- package/declarations/types/cache/aliases.d.ts +11 -1
- package/declarations/types/cache/change.d.ts +4 -5
- package/declarations/types/cache/mutations.d.ts +51 -28
- package/declarations/types/cache/operations.d.ts +60 -47
- package/declarations/types/cache/relationship.d.ts +11 -9
- package/declarations/types/cache.d.ts +495 -484
- package/declarations/types/graph.d.ts +31 -40
- package/declarations/types/identifier.d.ts +83 -82
- package/declarations/types/json/raw.d.ts +1 -2
- package/declarations/types/params.d.ts +4 -5
- package/declarations/types/record.d.ts +117 -76
- package/declarations/types/request.d.ts +289 -266
- package/declarations/types/runtime.d.ts +8 -9
- package/declarations/types/schema/concepts.d.ts +19 -13
- package/declarations/types/schema/fields.d.ts +1712 -1741
- package/declarations/types/schema/fields.type-test.d.ts +0 -1
- package/declarations/types/spec/document.d.ts +28 -22
- package/declarations/types/spec/error.d.ts +16 -17
- package/declarations/types/spec/json-api-raw.d.ts +102 -102
- package/declarations/types/symbols.d.ts +74 -75
- package/declarations/types/utils.d.ts +5 -5
- package/declarations/types.d.ts +10 -7
- package/declarations/utils/string.d.ts +48 -0
- package/dist/build-config/babel-macros.js +1 -0
- package/dist/build-config/canary-features.js +1 -0
- package/dist/build-config/debugging.js +1 -0
- package/dist/build-config/deprecations.js +1 -0
- package/dist/build-config/env.js +1 -0
- package/dist/build-config/macros.js +1 -0
- package/dist/build-config.js +1 -0
- package/dist/configure-B48bFHOl.js +181 -0
- package/dist/configure.js +1 -0
- package/dist/{context-DE5sFezZ.js → context-COmAnXUQ.js} +2 -2
- package/dist/graph/-private.js +3372 -0
- package/dist/handler-C2T-IyJK.js +339 -0
- package/dist/index.js +37 -104
- package/dist/reactive/-private.js +1 -0
- package/dist/reactive.js +1988 -0
- package/dist/request-state-CjLph1LP.js +8139 -0
- package/dist/request.js +1 -1
- package/dist/store/-private.js +3 -0
- package/dist/store.js +545 -0
- package/dist/symbols-SIstXMLI.js +44 -0
- package/dist/types/-private.js +3 -3
- package/dist/types/record.js +1 -1
- package/dist/types/request.js +2 -2
- package/dist/types/runtime.js +1 -1
- package/dist/types/schema/fields.js +8 -41
- package/dist/types/symbols.js +3 -3
- package/dist/utils/string.js +92 -0
- package/logos/NCC-1701-a-blue.svg +4 -0
- package/logos/NCC-1701-a-gold.svg +4 -0
- package/logos/NCC-1701-a-gold_100.svg +1 -0
- package/logos/NCC-1701-a-gold_base-64.txt +1 -0
- package/logos/NCC-1701-a.svg +4 -0
- package/logos/README.md +4 -0
- package/logos/docs-badge.svg +2 -0
- package/logos/ember-data-logo-dark.svg +12 -0
- package/logos/ember-data-logo-light.svg +12 -0
- package/logos/github-header.svg +444 -0
- package/logos/social1.png +0 -0
- package/logos/social2.png +0 -0
- package/logos/warp-drive-logo-dark.svg +4 -0
- package/logos/warp-drive-logo-gold.svg +4 -0
- package/package.json +11 -8
- package/declarations/index.d.ts.map +0 -1
- package/declarations/request/-private/context.d.ts.map +0 -1
- package/declarations/request/-private/debug.d.ts.map +0 -1
- package/declarations/request/-private/fetch.d.ts.map +0 -1
- package/declarations/request/-private/future.d.ts.map +0 -1
- package/declarations/request/-private/manager.d.ts.map +0 -1
- package/declarations/request/-private/promise-cache.d.ts.map +0 -1
- package/declarations/request/-private/types.d.ts.map +0 -1
- package/declarations/request/-private/utils.d.ts.map +0 -1
- package/declarations/request.d.ts.map +0 -1
- package/declarations/types/-private.d.ts.map +0 -1
- package/declarations/types/cache/aliases.d.ts.map +0 -1
- package/declarations/types/cache/change.d.ts.map +0 -1
- package/declarations/types/cache/mutations.d.ts.map +0 -1
- package/declarations/types/cache/operations.d.ts.map +0 -1
- package/declarations/types/cache/relationship.d.ts.map +0 -1
- package/declarations/types/cache.d.ts.map +0 -1
- package/declarations/types/graph.d.ts.map +0 -1
- package/declarations/types/identifier.d.ts.map +0 -1
- package/declarations/types/json/raw.d.ts.map +0 -1
- package/declarations/types/params.d.ts.map +0 -1
- package/declarations/types/record.d.ts.map +0 -1
- package/declarations/types/record.type-test.d.ts +0 -2
- package/declarations/types/record.type-test.d.ts.map +0 -1
- package/declarations/types/request.d.ts.map +0 -1
- package/declarations/types/request.type-test.d.ts +0 -2
- package/declarations/types/request.type-test.d.ts.map +0 -1
- package/declarations/types/runtime.d.ts.map +0 -1
- package/declarations/types/schema/concepts.d.ts.map +0 -1
- package/declarations/types/schema/fields.d.ts.map +0 -1
- package/declarations/types/schema/fields.type-test.d.ts.map +0 -1
- package/declarations/types/spec/document.d.ts.map +0 -1
- package/declarations/types/spec/error.d.ts.map +0 -1
- package/declarations/types/spec/json-api-raw.d.ts.map +0 -1
- package/declarations/types/symbols.d.ts.map +0 -1
- package/declarations/types/utils.d.ts.map +0 -1
- package/declarations/types.d.ts.map +0 -1
- package/dist/context-DE5sFezZ.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/request.js.map +0 -1
- package/dist/types/-private.js.map +0 -1
- package/dist/types/cache/aliases.js.map +0 -1
- package/dist/types/cache/change.js.map +0 -1
- package/dist/types/cache/mutations.js.map +0 -1
- package/dist/types/cache/operations.js.map +0 -1
- package/dist/types/cache/relationship.js.map +0 -1
- package/dist/types/cache.js.map +0 -1
- package/dist/types/graph.js.map +0 -1
- package/dist/types/identifier.js.map +0 -1
- package/dist/types/json/raw.js.map +0 -1
- package/dist/types/params.js.map +0 -1
- package/dist/types/record.js.map +0 -1
- package/dist/types/request.js.map +0 -1
- package/dist/types/runtime.js.map +0 -1
- package/dist/types/schema/concepts.js.map +0 -1
- package/dist/types/schema/fields.js.map +0 -1
- package/dist/types/schema/fields.type-test.js.map +0 -1
- package/dist/types/spec/document.js.map +0 -1
- package/dist/types/spec/error.js.map +0 -1
- package/dist/types/spec/json-api-raw.js.map +0 -1
- package/dist/types/symbols.js.map +0 -1
- package/dist/types/utils.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relationship.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/types/cache.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/types/graph.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifier.js","sources":["../../src/types/identifier.ts"],"sourcesContent":["import { DEBUG } from '@warp-drive/build-config/env';\n\n// provided for additional debuggability\nexport const DEBUG_CLIENT_ORIGINATED: unique symbol = Symbol('record-originated-on-client');\nexport const DEBUG_IDENTIFIER_BUCKET: unique symbol = Symbol('identifier-bucket');\nexport const DEBUG_STALE_CACHE_OWNER: unique symbol = Symbol('warpDriveStaleCache');\n\nfunction ProdSymbol<T extends string>(str: T, debugStr: string): T {\n return DEBUG ? (Symbol(debugStr) as unknown as T) : str;\n}\n\n// also present in production\nexport const CACHE_OWNER: '__$co' = ProdSymbol('__$co', 'CACHE_OWNER');\n\nexport type IdentifierBucket = 'record' | 'document';\n\nexport interface Identifier {\n lid: string;\n clientId?: string;\n}\n\nexport interface ExistingRecordIdentifier<T extends string = string> extends Identifier {\n id: string;\n type: T;\n}\n\nexport interface NewRecordIdentifier<T extends string = string> extends Identifier {\n id: string | null;\n type: T;\n}\n\nexport type StableDocumentIdentifier = {\n lid: string;\n};\nexport type RequestKey = StableDocumentIdentifier;\n\n/**\n * An Identifier specific to a record which may or may not\n * be present in the cache.\n *\n * The absence of an `id` DOES NOT indicate that this\n * Identifier is for a new client-created record as it\n * may also indicate that it was generated for a secondary\n * index and the primary `id` index is not yet known.\n *\n * @internal\n */\nexport type RecordIdentifier<T extends string = string> = ExistingRecordIdentifier<T> | NewRecordIdentifier<T>;\n\n/**\n * Used when an Identifier is known to be the stable version\n *\n * @internal\n */\nexport interface StableIdentifier extends Identifier {\n [DEBUG_IDENTIFIER_BUCKET]?: string;\n}\n\n/**\n * Used when a StableRecordIdentifier was not created locally as part\n * of a call to store.createRecord\n *\n * Distinguishing between this Identifier and one for a client created\n * record that was created with an ID is generally speaking not possible\n * at runtime, so anything with an ID typically narrows to this.\n *\n * @internal\n */\nexport interface StableExistingRecordIdentifier<T extends string = string> extends StableIdentifier {\n id: string;\n type: T;\n [DEBUG_CLIENT_ORIGINATED]?: boolean;\n [CACHE_OWNER]: number | undefined;\n [DEBUG_STALE_CACHE_OWNER]?: number | undefined;\n}\n\n/**\n * Used when a StableRecordIdentifier was created locally\n * (by a call to store.createRecord).\n *\n * It is possible in rare circumstances to have a StableRecordIdentifier\n * that is not for a new record but does not have an ID. This would\n * happen if a user intentionally created one for use with a secondary-index\n * prior to the record having been fully loaded.\n *\n * @internal\n */\nexport interface StableNewRecordIdentifier<T extends string = string> extends StableIdentifier {\n id: string | null;\n type: T;\n [DEBUG_CLIENT_ORIGINATED]?: boolean;\n [CACHE_OWNER]: number | undefined;\n [DEBUG_STALE_CACHE_OWNER]?: number | undefined;\n}\n\n/**\n * A referentially stable object with a unique string (lid) that can be used\n * as a reference to data in the cache.\n *\n * Every record instance has a unique identifier, and identifiers may refer\n * to data that has never been loaded (for instance, in an async relationship).\n *\n * @class StableRecordIdentifier\n * @public\n */\n\n/**\n * A string representing a unique identity.\n *\n * @property lid\n * @type {String}\n * @public\n */\n/**\n * the primary resource `type` or `modelName` this identity belongs to.\n *\n * @property type\n * @type {String}\n * @public\n */\n/**\n * the primary id for the record this identity belongs to. `null`\n * if not yet assigned an id.\n *\n * @property id\n * @type {String | null}\n * @public\n */\nexport type StableRecordIdentifier<T extends string = string> =\n | StableExistingRecordIdentifier<T>\n | StableNewRecordIdentifier<T>;\n\nexport type ResourceKey<T extends string = string> = StableRecordIdentifier<T>;\n"],"names":["DEBUG_CLIENT_ORIGINATED","Symbol","DEBUG_IDENTIFIER_BUCKET","DEBUG_STALE_CACHE_OWNER","ProdSymbol","str","debugStr","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","CACHE_OWNER"],"mappings":";;AAEA;MACaA,uBAAsC,GAAGC,MAAM,CAAC,6BAA6B;MAC7EC,uBAAsC,GAAGD,MAAM,CAAC,mBAAmB;MACnEE,uBAAsC,GAAGF,MAAM,CAAC,qBAAqB;AAElF,SAASG,UAAUA,CAAmBC,GAAM,EAAEC,QAAgB,EAAK;AACjE,EAAA,OAAOC,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,IAASV,MAAM,CAACK,QAAQ,CAAC,GAAoBD,GAAG;AACzD;;AAEA;AACO,MAAMO,WAAoB,GAAGR,UAAU,CAAC,OAAO,EAAE,aAAa;;AAwBrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"raw.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/types/params.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"params.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/types/record.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sources":["../../src/types/record.ts"],"sourcesContent":["import type { Type } from './symbols.ts';\n\n/**\n * Records may be anything, They don't even\n * have to be objects.\n *\n * Whatever they are, if they have a Type\n * property, that property will be used by EmberData\n * and WarpDrive to provide better type safety and\n * intellisense.\n *\n * @class TypedRecordInstance\n */\nexport interface TypedRecordInstance {\n /**\n * The type of the resource.\n *\n * This is an optional feature that can be used by\n * record implementations to provide a typescript\n * hint for the type of the resource.\n *\n * When used, EmberData and WarpDrive APIs can\n * take advantage of this to provide better type\n * safety and intellisense.\n *\n * @property [Type]\n * @type {Type}\n * @type {String}\n */\n [Type]: string;\n}\n\n/**\n * A type utility that extracts the Type if available,\n * otherwise it returns never.\n *\n */\nexport type TypeFromInstance<T> = T extends TypedRecordInstance ? T[typeof Type] : never;\n\n/**\n * A type utility that extracts the Type if available,\n * otherwise it returns string\n *\n */\nexport type TypeFromInstanceOrString<T> = T extends TypedRecordInstance ? T[typeof Type] : string;\n\ntype IsUniqueSymbol<T> = T extends `___(unique) Symbol(${string})` ? true : false;\ntype Unpacked<T> = T extends (infer U)[] ? U : T;\ntype NONE = { __NONE: never };\n\ntype __InternalExtract<\n MAX_DEPTH extends _DEPTHCOUNT,\n T extends TypedRecordInstance,\n V extends TypedRecordInstance,\n IncludePrefix extends boolean,\n Ignore,\n Pre extends string,\n DEPTH extends _DEPTHCOUNT,\n> =\n // if we extend T, we return the leaf value\n V extends T\n ? IncludePrefix extends false\n ? V[typeof Type]\n : Pre\n : // else if we are in Ignore we add the lead and exit\n V extends Ignore\n ? IncludePrefix extends false\n ? V[typeof Type]\n : Pre\n : // else if we are at max depth, we return never\n IS_MAX_DEPTH<DEPTH, MAX_DEPTH> extends true\n ? Pre\n : // else add T to Ignore and recurse\n ExtractUnion<MAX_DEPTH, V, IncludePrefix, Ignore | T, Pre, INC_DEPTH<DEPTH>>;\n\ntype __ExtractIfRecord<\n MAX_DEPTH extends _DEPTHCOUNT,\n T extends TypedRecordInstance,\n V,\n IncludePrefix extends boolean,\n Ignore,\n Pre extends string,\n DEPTH extends _DEPTHCOUNT,\n> = V extends TypedRecordInstance ? __InternalExtract<MAX_DEPTH, T, V, IncludePrefix, Ignore, Pre, DEPTH> : never;\n\ntype _ExtractUnion<\n MAX_DEPTH extends _DEPTHCOUNT,\n T extends TypedRecordInstance,\n IncludePrefix extends boolean,\n Ignore,\n Pre,\n DEPTH extends _DEPTHCOUNT,\n> = {\n // for each string key in the record,\n [K in keyof T]: IsUniqueSymbol<K> extends true\n ? never\n : K extends string\n ? // we recursively extract any values that resolve to a TypedRecordInstance\n __ExtractIfRecord<\n MAX_DEPTH,\n T,\n Unpacked<Awaited<T[K]>>,\n IncludePrefix,\n Ignore,\n Pre extends string ? `${Pre}.${K}` : K,\n DEPTH\n >\n : never;\n // then we return any value that is not 'never'\n}[keyof T];\n\n/**\n * A Utility that extracts either resource types or resource paths from a TypedRecordInstance.\n *\n * Its limitations are mostly around its intentional non-recursiveness. It presumes that APIs which\n * implement includes will not allow cyclical include paths, and will collapse includes by type.\n *\n * This follows closer to the JSON:API fields spec than to the includes spec in nature, but in\n * practice it is so impracticle for an API to allow z-algo include paths that this is probably\n * reasonable.\n *\n * We may need to revisit this in the future, opting to either make this restriction optional or\n * to allow for other strategies.\n *\n * There's a 90% chance this particular implementation belongs being in the JSON:API package instead\n * of core-types, but it's here for now.\n *\n */\ntype ExtractUnion<\n MAX_DEPTH extends _DEPTHCOUNT,\n T extends TypedRecordInstance,\n IncludePrefix extends boolean = false,\n Ignore = NONE,\n Pre = NONE,\n DEPTH extends _DEPTHCOUNT = 1,\n> = Exclude<\n IncludePrefix extends true\n ? // if we want to include prefix, we union with the prefix. Outer Exclude will filter any \"NONE\" types\n _ExtractUnion<MAX_DEPTH, T, IncludePrefix, Ignore, Pre, DEPTH> | Pre\n : // Else we just union the types.\n _ExtractUnion<MAX_DEPTH, T, IncludePrefix, Ignore, Pre, DEPTH> | T[typeof Type],\n NONE\n>;\n\ntype _DEPTHCOUNT = 1 | 2 | 3 | 4 | 5;\ntype INC_DEPTH<START extends _DEPTHCOUNT> = START extends 1 ? 2 : START extends 2 ? 3 : START extends 3 ? 4 : 5;\ntype IS_MAX_DEPTH<\n DEPTH extends _DEPTHCOUNT,\n MAX_DEPTH extends _DEPTHCOUNT = DEFAULT_MAX_DEPTH,\n> = DEPTH extends MAX_DEPTH ? true : false;\ntype DEFAULT_MAX_DEPTH = 3;\n/**\n * A utility that provides the union of all ResourceName for all potential\n * includes for the given TypedRecordInstance.\n *\n */\nexport type ExtractSuggestedCacheTypes<\n T extends TypedRecordInstance,\n MAX_DEPTH extends _DEPTHCOUNT = DEFAULT_MAX_DEPTH,\n> = ExtractUnion<MAX_DEPTH, T>; // ToPaths<ExpandIgnore<T, true>, false>;\n\n/**\n * A utility that provides the union type of all valid include paths for the given\n * TypedRecordInstance.\n *\n * Cyclical paths are filtered out.\n *\n */\nexport type Includes<T extends TypedRecordInstance, MAX_DEPTH extends _DEPTHCOUNT = DEFAULT_MAX_DEPTH> = ExtractUnion<\n MAX_DEPTH,\n T,\n true\n>;\n\nexport type OpaqueRecordInstance = unknown;\n\nexport type _StringSatisfiesIncludes<T extends string, SET extends string, FT extends string> = T extends SET\n ? FT\n : T extends `${infer U},${infer V}`\n ? U extends SET\n ? _StringSatisfiesIncludes<V, Exclude<SET, U>, FT>\n : never\n : never;\n\nexport type StringSatisfiesIncludes<T extends string, SET extends string> = _StringSatisfiesIncludes<T, SET, T>;\n\nexport function createIncludeValidator<T extends TypedRecordInstance>() {\n return function validateIncludes<U extends string>(includes: StringSatisfiesIncludes<U, Includes<T>>): U {\n return includes;\n };\n}\n"],"names":["createIncludeValidator","validateIncludes","includes"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAoEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACA;;AAIgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBO,SAASA,sBAAsBA,GAAkC;AACtE,EAAA,OAAO,SAASC,gBAAgBA,CAAmBC,QAAiD,EAAK;AACvG,IAAA,OAAOA,QAAQ;GAChB;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sources":["../../src/types/request.ts"],"sourcesContent":["import { getOrSetGlobal, getOrSetUniversal } from './-private.ts';\nimport type { StableRecordIdentifier } from './identifier.ts';\nimport type { QueryParamsSerializationOptions } from './params.ts';\nimport type { ExtractSuggestedCacheTypes, Includes, TypedRecordInstance, TypeFromInstanceOrString } from './record.ts';\nimport type { ResourceIdentifierObject } from './spec/json-api-raw.ts';\nimport type { RequestSignature } from './symbols.ts';\n\ntype Store = unknown;\n\nexport const SkipCache: '___(unique) Symbol(SkipCache)' = getOrSetUniversal('SkipCache', Symbol.for('wd:skip-cache'));\nexport const EnableHydration: '___(unique) Symbol(EnableHydration)' = getOrSetUniversal(\n 'EnableHydration',\n Symbol.for('wd:enable-hydration')\n);\nexport const IS_FUTURE: '___(unique) Symbol(IS_FUTURE)' = getOrSetGlobal('IS_FUTURE', Symbol('IS_FUTURE'));\nexport const STRUCTURED: '___(unique) Symbol(DOC)' = getOrSetGlobal('DOC', Symbol('DOC'));\n\nexport type HTTPMethod =\n | 'QUERY'\n | 'GET'\n | 'OPTIONS'\n | 'POST'\n | 'PUT'\n | 'PATCH'\n | 'DELETE'\n | 'HEAD'\n | 'CONNECT'\n | 'TRACE';\n\n/**\n * Use these options to adjust CacheHandler behavior for a request.\n *\n */\nexport type CacheOptions<T = unknown> = {\n /**\n * A key that uniquely identifies this request. If not present, the url wil be used\n * as the key for any GET request, while all other requests will not be cached.\n *\n */\n key?: string;\n /**\n * If true, the request will be made even if a cached response is present\n * and not expired.\n *\n */\n reload?: boolean;\n /**\n * If true, and a cached response is present and not expired, the request\n * will be made in the background and the cached response will be returned.\n *\n */\n backgroundReload?: boolean;\n /**\n * Useful for metadata around when to invalidate the cache. Typically used\n * by strategies that invalidate requests by resource type when a new resource\n * of that type has been created. See the CachePolicy implementation\n * provided by `@ember-data/request-utils` for an example.\n *\n * It is recommended to only use this for query/queryRecord requests where\n * new records created later would affect the results, though using it for\n * findRecord requests is also supported if desired where it may be useful\n * when a create may affect the result of a sideloaded relationship.\n *\n * Generally it is better to patch the cache directly for relationship updates\n * than to invalidate findRecord requests for one.\n *\n */\n types?: T extends TypedRecordInstance ? ExtractSuggestedCacheTypes<T>[] : string[];\n\n /**\n * If true, the request will never be handled by the cache-manager and thus\n * will never resolve from cache nor update the cache.\n *\n * Generally this is only used for legacy request that manage resource cache\n * updates in a non-standard way via the LegacyNetworkHandler.\n *\n */\n [SkipCache]?: boolean;\n};\nexport type FindRecordRequestOptions<RT = unknown, T = unknown> = {\n url: string;\n method: 'GET';\n headers: Headers;\n cacheOptions?: CacheOptions<T>;\n op: 'findRecord';\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n [RequestSignature]?: RT;\n};\n\nexport type QueryRequestOptions<RT = unknown, T = unknown> = {\n url: string;\n method: 'GET';\n headers: Headers;\n cacheOptions?: CacheOptions<T>;\n op: 'query';\n [RequestSignature]?: RT;\n};\n\nexport type PostQueryRequestOptions<RT = unknown, T = unknown> = {\n url: string;\n method: 'POST' | 'QUERY';\n headers: Headers;\n body?: string | BodyInit | FormData;\n cacheOptions: CacheOptions<T> & { key: string };\n op: 'query';\n [RequestSignature]?: RT;\n};\n\nexport type DeleteRequestOptions<RT = unknown, T = unknown> = {\n url: string;\n method: 'DELETE';\n headers: Headers;\n op: 'deleteRecord';\n body?: string | BodyInit | FormData;\n data: {\n record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;\n };\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n [RequestSignature]?: RT;\n};\n\ntype ImmutableRequest<T> = Readonly<T> & {\n readonly headers: ImmutableHeaders;\n readonly records: [StableRecordIdentifier];\n};\n\nexport type UpdateRequestOptions<RT = unknown, T = unknown> = {\n url: string;\n method: 'PATCH' | 'PUT';\n headers: Headers;\n op: 'updateRecord';\n body?: string | BodyInit | FormData;\n data: {\n record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;\n };\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n [RequestSignature]?: RT;\n};\n\nexport type CreateRequestOptions<RT = unknown, T = unknown> = {\n url: string;\n method: 'POST';\n headers: Headers;\n op: 'createRecord';\n body?: string | BodyInit | FormData;\n data: {\n record: StableRecordIdentifier<TypeFromInstanceOrString<T>>;\n };\n records: [ResourceIdentifierObject<TypeFromInstanceOrString<T>>];\n [RequestSignature]?: RT;\n};\n\nexport type ImmutableDeleteRequestOptions = ImmutableRequest<DeleteRequestOptions>;\nexport type ImmutableUpdateRequestOptions = ImmutableRequest<UpdateRequestOptions>;\nexport type ImmutableCreateRequestOptions = ImmutableRequest<CreateRequestOptions>;\n\nexport type RemotelyAccessibleIdentifier<T extends string = string> = {\n id: string;\n type: T;\n lid?: string;\n};\n\nexport type ConstrainedRequestOptions = {\n reload?: boolean;\n backgroundReload?: boolean;\n host?: string;\n namespace?: string;\n resourcePath?: string;\n urlParamsSettings?: QueryParamsSerializationOptions;\n};\n\nexport type FindRecordOptions<T = unknown> = ConstrainedRequestOptions & {\n include?: T extends TypedRecordInstance ? Includes<T>[] : string | string[];\n};\n\nexport interface StructuredDataDocument<T> {\n [STRUCTURED]?: true;\n /**\n * @see {@link ImmutableRequestInfo}\n */\n request: ImmutableRequestInfo;\n response: Response | ResponseInfo | null;\n content: T;\n}\nexport interface StructuredErrorDocument<T = unknown> extends Error {\n [STRUCTURED]?: true;\n request: ImmutableRequestInfo;\n response: Response | ResponseInfo | null;\n error: string | object;\n content?: T;\n}\nexport type StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument<T>;\n\n/**\n * JavaScript's native Request class.\n *\n * EmberData provides our own typings due to incompleteness in the native typings.\n *\n */\ninterface Request {\n /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching.\n */\n cache?: RequestCache;\n /** Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.\n */\n credentials?: RequestCredentials;\n /** Returns the kind of resource requested by request, e.g., \"document\" or \"script\".\n */\n destination?: RequestDestination;\n /** Returns a Headers object consisting of the headers associated with request. Note that headers added in the network layer by the user agent will not be accounted for in this object, e.g., the \"Host\" header.\n */\n headers?: Headers;\n /** Returns request's subresource integrity metadata, which is a cryptographic hash of the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]\n */\n integrity?: string;\n /** Returns a boolean indicating whether or not request can outlive the global in which it was created.\n */\n keepalive?: boolean;\n /** Returns request's HTTP method, which is \"GET\" by default.\n */\n method?: HTTPMethod;\n /** Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.\n *\n * `no-cors` is not allowed for streaming request bodies.\n *\n */\n mode?: RequestMode;\n /** Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.\n */\n redirect?: RequestRedirect;\n /** Returns the referrer of request. Its value can be a same-origin URL if explicitly set in init, the empty string to indicate no referrer, and \"about:client\" when defaulting to the global's default. This is used during fetching to determine the value of the `Referer` header of the request being made.\n */\n referrer?: string;\n /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer.\n */\n referrerPolicy?: ReferrerPolicy;\n /** Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.\n */\n signal?: AbortSignal;\n /** Returns the URL of request as a string.\n */\n url?: string;\n /** Any body that you want to add to your request. Note that a GET or HEAD request may not have a body.\n */\n body?: BodyInit | null;\n\n /**\n * When sending a ReadableStream as the body of a request, 'half' must be\n * specified.\n *\n * [Half Duplex Further Reading](https://developer.chrome.com/docs/capabilities/web-apis/fetch-streaming-requests#half_duplex)\n *\n */\n duplex?: 'half';\n}\n\nexport interface ImmutableHeaders extends Headers {\n clone?(): Headers;\n toJSON(): [string, string][];\n}\n\n/**\n * Extends JavaScript's native {@link Request} object with additional\n * properties specific to the RequestManager's capabilities.\n *\n */\nexport interface RequestInfo<RT = unknown, T = unknown> extends Request {\n /**\n * If provided, used instead of the AbortController auto-configured for each request by the RequestManager\n *\n */\n controller?: AbortController;\n\n /**\n * @see {@link CacheOptions}\n */\n cacheOptions?: CacheOptions<T>;\n store?: Store;\n\n op?: string;\n\n /**\n * The identifiers of the primary resources involved in the request\n * (if any). This may be used by handlers to perform transactional\n * operations on the store.\n *\n */\n records?: StableRecordIdentifier[];\n\n disableTestWaiter?: boolean;\n /**\n * data that a handler should convert into\n * the query (GET) or body (POST).\n *\n * Note: It is recommended that builders set query params\n * and body directly in most scenarios.\n *\n */\n data?: Record<string, unknown>;\n /**\n * options specifically intended for handlers\n * to utilize to process the request\n *\n */\n options?: Record<string, unknown>;\n\n [RequestSignature]?: RT;\n\n [EnableHydration]?: boolean;\n}\n\n/**\n * Immutable version of {@link RequestInfo}. This is what is passed to handlers.\n *\n */\nexport type ImmutableRequestInfo<RT = unknown, T = unknown> = Readonly<Omit<RequestInfo<RT, T>, 'controller'>> & {\n readonly cacheOptions?: Readonly<CacheOptions<T>>;\n readonly headers?: ImmutableHeaders;\n readonly data?: Readonly<Record<string, unknown>>;\n readonly options?: Readonly<Record<string, unknown>>;\n\n /** Whether the request body has been read.\n */\n readonly bodyUsed?: boolean;\n};\n\nexport interface ResponseInfo {\n readonly headers: ImmutableHeaders; // to do, maybe not this?\n readonly ok: boolean;\n readonly redirected: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly type: ResponseType;\n readonly url: string;\n}\n\nexport interface RequestContext {\n /**\n * @see {@link ImmutableRequestInfo}\n */\n request: ImmutableRequestInfo;\n id: number;\n\n setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;\n setResponse(response: Response | ResponseInfo | null): void;\n}\n\nexport function withBrand<T>(obj: RequestInfo): RequestInfo<T> & { [RequestSignature]: T } {\n return obj as RequestInfo<T> & {\n [RequestSignature]: T;\n };\n}\n"],"names":["SkipCache","getOrSetUniversal","Symbol","for","EnableHydration","IS_FUTURE","getOrSetGlobal","STRUCTURED","withBrand","obj"],"mappings":";;AASaA,MAAAA,SAA0C,GAAGC,iBAAiB,CAAC,WAAW,EAAEC,MAAM,CAACC,GAAG,CAAC,eAAe,CAAC;AACvGC,MAAAA,eAAsD,GAAGH,iBAAiB,CACrF,iBAAiB,EACjBC,MAAM,CAACC,GAAG,CAAC,qBAAqB,CAClC;AACO,MAAME,SAA0C,GAAGC,cAAc,CAAC,WAAW,EAAEJ,MAAM,CAAC,WAAW,CAAC;AAClG,MAAMK,UAAqC,GAAGD,cAAc,CAAC,KAAK,EAAEJ,MAAM,CAAC,KAAK,CAAC;;AAcxF;AACA;AACA;AACA;;AAiKA;AACA;AACA;AACA;AACA;AACA;;AA+DA;AACA;AACA;AACA;AACA;;AA8CA;AACA;AACA;AACA;;AAiCO,SAASM,SAASA,CAAIC,GAAgB,EAA8C;AACzF,EAAA,OAAOA,GAAG;AAGZ;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sources":["../../src/types/runtime.ts"],"sourcesContent":["import type { LOG_CONFIG } from '@warp-drive/build-config/-private/utils/logging';\n\nimport { getOrSetUniversal } from './-private.ts';\n\nconst RuntimeConfig: { debug: Partial<LOG_CONFIG> } = getOrSetUniversal('WarpDriveRuntimeConfig', {\n debug: {},\n});\n\nfunction trySessionStorage() {\n // This works even when sessionStorage is not available.\n // See https://github.com/emberjs/data/issues/9784\n try {\n return globalThis.sessionStorage;\n } catch {\n return undefined;\n }\n}\n\nconst storage = trySessionStorage();\nconst settings = storage?.getItem('WarpDriveRuntimeConfig');\nif (settings) {\n Object.assign(RuntimeConfig, JSON.parse(settings));\n}\n\nexport function getRuntimeConfig(): typeof RuntimeConfig {\n return RuntimeConfig;\n}\n\n/**\n * Upserts the specified logging configuration into the runtime\n * config.\n *\n * globalThis.setWarpDriveLogging({ LOG_CACHE: true } });\n *\n */\nexport function setLogging(config: Partial<LOG_CONFIG>): void {\n Object.assign(RuntimeConfig.debug, config);\n storage?.setItem('WarpDriveRuntimeConfig', JSON.stringify(RuntimeConfig));\n}\n"],"names":["RuntimeConfig","getOrSetUniversal","debug","trySessionStorage","globalThis","sessionStorage","undefined","storage","settings","getItem","Object","assign","JSON","parse","getRuntimeConfig","setLogging","config","setItem","stringify"],"mappings":";;AAIA,MAAMA,aAA6C,GAAGC,iBAAiB,CAAC,wBAAwB,EAAE;AAChGC,EAAAA,KAAK,EAAE;AACT,CAAC,CAAC;AAEF,SAASC,iBAAiBA,GAAG;AAC3B;AACA;EACA,IAAI;IACF,OAAOC,UAAU,CAACC,cAAc;AAClC,GAAC,CAAC,MAAM;AACN,IAAA,OAAOC,SAAS;AAClB;AACF;AAEA,MAAMC,OAAO,GAAGJ,iBAAiB,EAAE;AACnC,MAAMK,QAAQ,GAAGD,OAAO,EAAEE,OAAO,CAAC,wBAAwB,CAAC;AAC3D,IAAID,QAAQ,EAAE;EACZE,MAAM,CAACC,MAAM,CAACX,aAAa,EAAEY,IAAI,CAACC,KAAK,CAACL,QAAQ,CAAC,CAAC;AACpD;AAEO,SAASM,gBAAgBA,GAAyB;AACvD,EAAA,OAAOd,aAAa;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASe,UAAUA,CAACC,MAA2B,EAAQ;EAC5DN,MAAM,CAACC,MAAM,CAACX,aAAa,CAACE,KAAK,EAAEc,MAAM,CAAC;EAC1CT,OAAO,EAAEU,OAAO,CAAC,wBAAwB,EAAEL,IAAI,CAACM,SAAS,CAAClB,aAAa,CAAC,CAAC;AAC3E;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"concepts.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sources":["../../../src/types/schema/fields.ts"],"sourcesContent":["import type { ObjectValue, PrimitiveValue } from '../json/raw.ts';\n\n/**\n * A generic \"field\" that can be used to define\n * primitive value fields.\n *\n * Replaces \"attribute\" for primitive value fields.\n * Can also be used to eject from deep-tracking of\n * objects or arrays.\n *\n * A major difference between \"field\" and \"attribute\"\n * is that \"type\" points to a legacy transform on\n * \"attribute\" that a serializer *might* use, while\n * \"type\" points to a new-style transform on \"field\"\n * that a record implmentation *must* use.\n *\n * @class (Type) GenericField\n * @public\n */\nexport interface GenericField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'field'}\n * @public\n */\n kind: 'field';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * the name of the transform to use, if any\n *\n * @property type\n * @type {String | undefined}\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * AliasFields may utilize a transform, specified by type,\n * to pre/post process the field.\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @class (Type) LegacyAliasField\n * @public\n */\nexport interface LegacyAliasField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'alias'}\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @property type\n * @type {null}\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @property options\n * @type {GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | LegacyAttributeField | LegacyBelongsToField | LegacyHasManyField}\n * @public\n */\n options:\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n // | ResourceField\n // | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * AliasFields may utilize a transform, specified by type,\n * to pre/post process the field.\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @class (Type) PolarisAliasField\n * @public\n */\nexport interface PolarisAliasField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'alias'}\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @property type\n * @type {null}\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @property options\n * @type {GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField | LinksModeBelongsToField | LinksModeHasManyField}\n * @public\n */\n options:\n | GenericField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n // | ResourceField\n // | CollectionField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n}\n\n/**\n * A field that can be used to alias one key to another\n * key present in the cache version of the resource.\n *\n * Unlike DerivedField, an AliasField may write to its\n * source when a record is in an editable mode.\n *\n * AliasFields may utilize a transform, specified by type,\n * to pre/post process the field.\n *\n * An AliasField may also specify a `kind` via options.\n * `kind` may be any other valid field kind other than\n *\n * - `@hash`\n * - `@id`\n * - `@local`\n * - `derived`\n *\n * This allows an AliasField to rename any field in the cache.\n *\n * Alias fields are generally intended to be used to support migrating\n * between different schemas, though there are times where they are useful\n * as a form of advanced derivation when used with a transform. For instance,\n * an AliasField could be used to expose both a string and a Date version of the\n * same field, with both being capable of being written to.\n *\n * @class (Type) ObjectAliasField\n * @public\n */\nexport interface ObjectAliasField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'alias'}\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @property type\n * @type {null}\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\n * @property options\n * @type {GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField}\n * @public\n */\n options: GenericField | ObjectField | SchemaObjectField | ArrayField | SchemaArrayField;\n}\n\n/**\n * Represents a field whose value is the primary\n * key of the resource.\n *\n * This allows any field to serve as the primary\n * key while still being able to drive identity\n * needs within the system.\n *\n * This is useful for resources that use for instance\n * 'uuid', 'urn' or 'entityUrn' or 'primaryKey' as their\n * primary key field instead of 'id'.\n *\n * @class (Type) IdentityField\n * @public\n */\nexport interface IdentityField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'@id'}\n * @public\n */\n kind: '@id';\n\n /**\n * The name of the field that serves as the\n * primary key for the resource.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n}\n\n/**\n * Represents a specialized field whose computed value\n * will be used as the primary key of a schema-object\n * for serializability and comparison purposes.\n *\n * This field functions similarly to derived fields in that\n * it is non-settable, derived state but differs in that\n * it is only able to compute off of cache state and is given\n * no access to a record instance.\n *\n * This means that if a hashing function wants to compute its value\n * taking into account transformations and derivations it must\n * perform those itself.\n *\n * A schema-array can declare its \"key\" value to be `@hash` if\n * a schema-object has such a field.\n *\n * Only one hash field is permittable per schema-object, and\n * it should be placed in the `ResourceSchema`'s `@id` field\n * in place of an `IdentityField`.\n *\n * @class (Type) HashField\n * @public\n */\nexport interface HashField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'@hash'}\n * @public\n */\n kind: '@hash';\n\n /**\n * The name of the field that serves as the\n * hash for the resource.\n *\n * Only required if access to this value by\n * the UI is desired, it can be `null` otherwise.\n *\n * @property name\n * @type {String | null}\n * @public\n */\n name: string | null;\n\n /**\n * The name of a function to run to compute the hash.\n * The function will only have access to the cached\n * data for the record.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Any options that should be provided to the hash\n * function.\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * Represents a field whose value is a local\n * value that is not stored in the cache, nor\n * is it sent to the server.\n *\n * Local fields can be written to, and their\n * value is both memoized and reactive (though\n * not deep-tracked).\n *\n * Because their state is not derived from the cache\n * data or the server, they represent a divorced\n * uncanonical source of state.\n *\n * For this reason Local fields should be used sparingly.\n *\n * Currently, while we document this feature here,\n * only allow our own SchemaRecord default fields to\n * utilize them and the feature should be considered private.\n *\n * Example use cases that drove the creation of local\n * fields are states like `isDestroying` and `isDestroyed`\n * which are specific to a record instance but not\n * stored in the cache. We wanted to be able to drive\n * these fields from schema the same as all other fields.\n *\n * Don't make us regret this decision.\n *\n * @class (Type) LocalField\n * @public\n */\nexport interface LocalField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'@local'}\n * @public\n */\n kind: '@local';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n /**\n * Not currently utilized, we are considering\n * allowing transforms to operate on local fields\n *\n * @property type\n * @type {String | undefined}\n * @public\n */\n type?: string;\n\n /**\n * Options for the field.\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: { defaultValue?: PrimitiveValue };\n}\n\n/**\n * Represents a field whose value is an object\n * with keys pointing to values that are primitive\n * values.\n *\n * If values of the keys are not primitives, or\n * if the key/value pairs have well-defined shape,\n * use 'schema-object' instead.\n *\n * @class (Type) ObjectField\n * @public\n */\nexport interface ObjectField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'object'}\n * @public\n */\n kind: 'object';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of a transform to pass the entire object\n * through before displaying or serializing it.\n *\n * @property type\n * @type {String | undefined}\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * Represents a field whose value is an object\n * with a well-defined structure described by\n * a non-resource schema.\n *\n * If the object's structure is not well-defined,\n * use 'object' instead.\n *\n * @class (Type) SchemaObjectField\n * @public\n */\nexport interface SchemaObjectField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'schema-object'}\n * @public\n */\n kind: 'schema-object';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of the ObjectSchema that describes the\n * structure of the object.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options for configuring the behavior of the\n * SchemaObject.\n *\n * - `polymorphic` : Whether this SchemaObject is Polymorphic.\n * - `type` : If the SchemaObject is Polymorphic, the key on the raw cache data to use as the \"resource-type\" value for the schema-object.\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: {\n /**\n * Whether this SchemaObject is Polymorphic.\n *\n * If the SchemaObject is polymorphic, `options.type` must also be supplied.\n *\n */\n polymorphic?: boolean;\n\n /**\n * If the SchemaObject is Polymorphic, the key on the raw cache data to use\n * as the \"resource-type\" value for the schema-object.\n *\n * Defaults to \"type\".\n *\n */\n type?: string;\n };\n}\n\n/**\n * Represents a field whose value is an array\n * of primitive values.\n *\n * If the array's elements are not primitive\n * values, use 'schema-array' instead.\n *\n * @class (Type) ArrayField\n * @public\n */\nexport interface ArrayField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'array'}\n * @public\n */\n kind: 'array';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of a transform to pass each item\n * in the array through before displaying or\n * or serializing it.\n *\n * @property type\n * @type {String | undefined}\n * @public\n */\n type?: string;\n\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * Represents a field whose value is an array\n * of objects with a well-defined structure\n * described by a non-resource schema.\n *\n * If the array's elements are not well-defined,\n * use 'array' instead.\n *\n * @class (Type) SchemaArrayField\n * @public\n */\nexport interface SchemaArrayField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'schema-array'}\n * @public\n */\n kind: 'schema-array';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of the ObjectSchema that describes the\n * structure of the objects in the array.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options for configuring the behavior of the\n * SchemaArray.\n *\n * - `key`\n *\n * Configures how the SchemaArray determines whether an object in the cache is the same\n * as an object previously used to instantiate one of the schema-objects it contains.\n *\n * The default is `'@identity'`.\n *\n * Valid options are:\n *\n * - `'@identity'` (default) : the cached object's referential identity will be used.\n * This may result in significant instability when resource data is updated from the API\n * - `'@index'` : the cached object's index in the array will be used.\n * This is only a good choice for arrays that rarely if ever change membership\n * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for\n * The contained schema-object and use the computed result to determine and compare identity.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values. The field value should be unique enough to guarantee two schema-objects\n * of the same type will not collide.\n *\n * - `polymorphic` : Whether this SchemaArray is Polymorphic.\n * - `type` : If the SchemaArray is Polymorphic, the key on the raw cache data to use as the \"resource-type\" value for the schema-object.\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: {\n /**\n * Configures how the SchemaArray determines whether\n * an object in the cache is the same as an object\n * previously used to instantiate one of the schema-objects\n * it contains.\n *\n * The default is `'@identity'`.\n *\n * Valid options are:\n *\n * - `'@identity'` (default) : the cached object's referential identity will be used.\n * This may result in significant instability when resource data is updated from the API\n * - `'@index'` : the cached object's index in the array will be used.\n * This is only a good choice for arrays that rarely if ever change membership\n * - `'@hash'` : will lookup the `@hash` function supplied in the ResourceSchema for\n * The contained schema-object and use the computed result to determine and compare identity.\n * - \\<field-name> (string) : the name of a field to use as the key, only GenericFields (kind `field`)\n * Are valid field names for this purpose. The cache state without transforms applied will be\n * used when comparing values. The field value should be unique enough to guarantee two schema-objects\n * of the same type will not collide.\n *\n */\n key?: '@identity' | '@index' | '@hash' | string;\n\n /**\n * Whether this SchemaArray is Polymorphic.\n *\n * If the SchemaArray is polymorphic, `options.type` must also be supplied.\n *\n */\n polymorphic?: boolean;\n\n /**\n * If the SchemaArray is Polymorphic, the key on the raw cache data to use\n * as the \"resource-type\" value for the schema-object.\n *\n * Defaults to \"type\".\n *\n */\n type?: string;\n };\n}\n\n/**\n * Represents a field whose value is derived\n * from other fields in the schema.\n *\n * The value is read-only, and is not stored\n * in the cache, nor is it sent to the server.\n *\n * Usage of derived fields should be minimized\n * to scenarios where the derivation is known\n * to be safe. For instance, derivations that\n * required fields that are not always loaded\n * or that require access to related resources\n * that may not be loaded should be avoided.\n *\n * @class (Type) DerivedField\n * @public\n */\nexport interface DerivedField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'derived'}\n * @public\n */\n kind: 'derived';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of the derivation to use.\n *\n * Derivations are functions that take the\n * record, options, and the name of the field\n * as arguments, and return the derived value.\n *\n * Derivations are memoized, and are only\n * recomputed when the fields they depend on\n * change.\n *\n * Derivations are not stored in the cache,\n * and are not sent to the server.\n *\n * Derivation functions must be explicitly\n * registered with the schema service.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options to pass to the derivation, if any\n *\n * Must comply to the specific derivation's\n * options schema.\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: ObjectValue;\n}\n\n/**\n * Represents a field that is a reference to\n * another resource.\n *\n * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED\n * BY SchemaRecord\n *\n * @class (Type) ResourceField\n * @public\n */\nexport interface ResourceField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'resource'}\n * @public\n */\n kind: 'resource';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options for resources are optional. If\n * not present, all options are presumed\n * to be falsey\n *\n * @property options\n * @type {ObjectValue | undefined}\n * @public\n */\n options?: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain a link\n * that can be used to fetch the related\n * resource when needed.\n *\n */\n async?: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n */\n inverse?: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n */\n polymorphic?: boolean;\n };\n}\n\n/**\n * Represents a field that is a reference to\n * a collection of other resources, potentially\n * paginate.\n *\n * SUPPORT FOR THIS FEATURE IS NOT YET IMPLEMENTED\n * BY SchemaRecord\n *\n * @class (Type) CollectionField\n * @public\n */\nexport interface CollectionField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'collection'}\n * @public\n */\n kind: 'collection';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options for resources are optional. If\n * not present, all options are presumed\n * to be falsey\n *\n */\n options?: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * that can be used to fetch the related\n * resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * When true, it is expected that the relationship\n * is paginated. If the relationship is not paginated,\n * then the cache data for \"page 1\" would contain the\n * full list of pointers, and loading \"page 1\" would\n * load all related resources.\n *\n */\n async?: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n */\n inverse?: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n */\n polymorphic?: boolean;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n * > It cannot be used with PolarisMode\n *\n * A generic \"field\" that can be used to define\n * primitive value fields.\n *\n * If the field points to an object or array,\n * it will not be deep-tracked.\n *\n * Transforms when defined are legacy transforms\n * that a serializer *might* use, but their usage\n * is not guaranteed.\n *\n * @class (Type) LegacyAttributeField\n * @public\n */\nexport interface LegacyAttributeField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'attribute'}\n * @public\n */\n kind: 'attribute';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n /**\n * The name of the transform to use, if any\n *\n * @property type\n * @type {String | undefined | null}\n * @public\n */\n type?: string | null;\n /**\n * Options to pass to the transform, if any\n *\n * Must comply to the specific transform's options\n * schema.\n *\n */\n options?: ObjectValue;\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * another resource.\n *\n * This is the legacy version of the `ResourceField`.\n *\n * @class (Type) LegacyBelongsToField\n * @public\n */\nexport interface LegacyBelongsToField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'belongsTo'}\n * @public\n */\n kind: 'belongsTo';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain a link\n * or a pointer that can be used to fetch\n * the related resource when needed.\n *\n * Pointers are highly discouraged.\n *\n */\n async: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * will be expected to already have all their data. When reloading a sync relationship\n * you would be expected to have a `related link` available from a prior relationship\n * payload e.g.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriend: {\n * links: { related: \"/users/1/bestFriend\" },\n * data: { type: 'user', id: '1' },\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n */\n linksMode?: true;\n\n /**\n * When omitted, the cache data for this field will\n * clear local state of all changes except for the\n * addition of records still in the \"new\" state any\n * time the remote data for this field is updated.\n *\n * When set to `false`, the cache data for this field\n * will instead intelligently commit any changes from\n * local state that are present in the remote data,\n * leaving any remaining changes in local state still.\n *\n */\n resetOnRemoteUpdate?: false;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * another resource.\n *\n * This is the legacy version of the `ResourceField`.\n *\n * @class (Type) LinksModeBelongsToField\n * @public\n */\nexport interface LinksModeBelongsToField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'belongsTo'}\n * @public\n */\n kind: 'belongsTo';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * The name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * MUST be false for PolarisMode + LinksMode\n *\n */\n async: false;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * MUST be true for PolarisMode + LinksMode\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * will be expected to already have all their data. When reloading a sync relationship\n * you would be expected to have a `related link` available from a prior relationship\n * payload e.g.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriend: {\n * links: { related: \"/users/1/bestFriend\" },\n * data: { type: 'user', id: '1' },\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * Activating LinksMode will *also* deactivate the deprecated\n * `resetOnRemoteUpdate` behavior for this field.\n *\n * This means that when new remote state is received, the cache\n * will intelligently commit any changes from local state that\n * are present in the remote data for this field, leaving any remaining\n * changes in local state still.\n *\n * Previously, the cache would clear local state of all changes\n * except for the addition of records still in the \"new\" state any\n * time the remote data for this field was updated.\n *\n */\n linksMode: true;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * a collection of other resources.\n *\n * This is the legacy version of the `CollectionField`.\n *\n * @class (Type) LegacyHasManyField\n * @public\n */\nexport interface LegacyHasManyField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'hasMany'}\n * @public\n */\n kind: 'hasMany';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * the name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * or pointers that can be used to fetch\n * the related resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * hasMany relationships do not support pagination.\n *\n */\n async: boolean;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * will be expected to already have all their data. When reloading a sync relationship\n * you would be expected to have a `related link` available from a prior relationship\n * payload e.g.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriends: {\n * links: { related: \"/users/1/bestFriends\" },\n * data: [ { type: 'user', id: '1' } ],\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n */\n linksMode?: true;\n\n /**\n * When omitted, the cache data for this field will\n * clear local state of all changes except for the\n * addition of records still in the \"new\" state any\n * time the remote data for this field is updated.\n *\n * When set to `false`, the cache data for this field\n * will instead intelligently commit any changes from\n * local state that are present in the remote data,\n * leaving any remaining changes in local state still.\n *\n */\n resetOnRemoteUpdate?: false;\n };\n}\n\n/**\n * > [!CAUTION]\n * > This Field is LEGACY\n *\n * Represents a field that is a reference to\n * a collection of other resources.\n *\n * This is the legacy version of the `CollectionField`.\n *\n * @class (Type) LinksModeHasManyField\n * @public\n */\nexport interface LinksModeHasManyField {\n /**\n * The kind of field this is.\n *\n * @property kind\n * @type {'hasMany'}\n * @public\n */\n kind: 'hasMany';\n\n /**\n * The name of the field.\n *\n * @property name\n * @type {String}\n * @public\n */\n name: string;\n\n /**\n * the name of the resource that this field\n * refers to. In the case of a polymorphic\n * relationship, this should be the trait\n * or abstract type.\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * MUST be false for PolarisMode + LinksMode\n *\n * If true, it is expected that the cache\n * data for this field will contain links\n * or pointers that can be used to fetch\n * the related resources when needed.\n *\n * When false, it is expected that all related\n * resources are loaded together with this resource,\n * and that the cache data for this field will\n * contain the full list of pointers.\n *\n * hasMany relationships do not support pagination.\n *\n */\n async: false;\n\n /**\n * The name of the inverse field on the\n * related resource that points back to\n * this field on this resource to form a\n * bidirectional relationship.\n *\n * If null, the relationship is unidirectional.\n *\n */\n inverse: string | null;\n\n /**\n * If this field is satisfying a polymorphic\n * relationship on another resource, then this\n * should be set to the trait or abstract type\n * that this resource implements.\n *\n */\n as?: string;\n\n /**\n * Whether this field is a polymorphic relationship,\n * meaning that it can point to multiple types of\n * resources so long as they implement the trait\n * or abstract type specified in `type`.\n *\n */\n polymorphic?: boolean;\n\n /**\n * Whether this field should ever make use of the legacy support infra\n * from @ember-data/model and the LegacyNetworkMiddleware for adapters and serializers.\n *\n * MUST be true for PolarisMode + LinksMode\n *\n * When true, none of the legacy support will be utilized. Sync relationships\n * will be expected to already have all their data. When reloading a sync relationship\n * you would be expected to have a `related link` available from a prior relationship\n * payload e.g.\n *\n * ```ts\n * {\n * data: {\n * type: 'user',\n * id: '2',\n * attributes: { name: 'Chris' },\n * relationships: {\n * bestFriends: {\n * links: { related: \"/users/1/bestFriends\" },\n * data: [ { type: 'user', id: '1' } ],\n * }\n * }\n * },\n * included: [\n * { type: 'user', id: '1', attributes: { name: 'Krystan' } }\n * ]\n * }\n * ```\n *\n * Async relationships will be loaded via their link if needed.\n *\n * Activating LinksMode will *also* deactivate the deprecated\n * `resetOnRemoteUpdate` behavior for this field.\n *\n * This means that when new remote state is received, the cache\n * will intelligently commit any changes from local state that\n * are present in the remote data for this field, leaving any remaining\n * changes in local state still.\n *\n * Previously, the cache would clear local state of all changes\n * except for the addition of records still in the \"new\" state any\n * time the remote data for this field was updated.\n *\n */\n linksMode: true;\n };\n}\n\n/**\n * A union of all possible LegacyMode field schemas.\n *\n * Available field schemas are:\n *\n * - {@link GenericField}\n * - {@link LegacyAliasField}\n * - {@link LocalField}\n * - {@link ObjectField}\n * - {@link SchemaObjectField}\n * - {@link ArrayField}\n * - {@link SchemaArrayField}\n * - {@link DerivedField}\n * - {@link ResourceField | ResourceField (not yet implemented)}\n * - {@link CollectionField | CollectionField (not yet implemented)}\n * - {@link LegacyAttributeField}\n * - {@link LegacyBelongsToField}\n * - {@link LegacyHasManyField}\n *\n * @class (Type) LegacyModeFieldSchema\n * @public\n */\nexport type LegacyModeFieldSchema =\n | GenericField\n | LegacyAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n // | ResourceField // not yet implemented\n // | CollectionField // not yet implemented\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField;\n\n/**\n * A union of all possible PolarisMode field schemas.\n *\n * Available field schemas are:\n *\n * - {@link GenericField}\n * - {@link PolarisAliasField}\n * - {@link LocalField}\n * - {@link ObjectField}\n * - {@link SchemaObjectField}\n * - {@link ArrayField}\n * - {@link SchemaArrayField}\n * - {@link DerivedField}\n * - {@link ResourceField | ResourceField (not yet implemented)}\n * - {@link CollectionField | CollectionField (not yet implemented)}\n * - {@link LinksModeBelongsToField}\n * - {@link LinksModeHasManyField}\n *\n * @class (Type) PolarisModeFieldSchema\n * @public\n */\nexport type PolarisModeFieldSchema =\n | GenericField\n | PolarisAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n // | ResourceField\n // | CollectionField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all possible LegacyMode and PolarisMode\n * field schemas.\n *\n * You likely will want to use PolarisModeFieldSchema,\n * LegacyModeFieldSchema, or ObjectFieldSchema instead\n * as appropriate as they are more specific and will\n * provide better guidance around what is valid.\n *\n * @class (Type) FieldSchema\n * @public\n */\nexport type FieldSchema =\n | GenericField\n | LegacyAliasField\n | PolarisAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField\n | ResourceField\n | CollectionField\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n\n/**\n * A union of all possible field schemas that can be\n * used in an ObjectSchema.\n *\n * @class (Type) ObjectFieldSchema\n * @public\n */\nexport type ObjectFieldSchema =\n | GenericField\n | ObjectAliasField\n | LocalField\n | ObjectField\n | SchemaObjectField\n | ArrayField\n | SchemaArrayField\n | DerivedField;\n\n/**\n * Represents a schema for a primary resource in PolarisMode.\n *\n * Primary resources are objects with a unique identity of their\n * own which may allow them to appear in relationships, or in multiple\n * response documents.\n *\n * @class (Type) PolarisResourceSchema\n * @public\n */\nexport interface PolarisResourceSchema {\n legacy?: false;\n\n /**\n * For primary resources, this should be an IdentityField\n *\n * for schema-objects, this should be either a HashField or null\n *\n * @property identity\n * @type {IdentityField}\n * @public\n */\n identity: IdentityField;\n\n /**\n * The name of the schema\n *\n * For cacheable resources, this should be the\n * primary resource type.\n *\n * For object schemas, this should be the name\n * of the object schema.\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\n * @property fields\n * @type {PolarisModeFieldSchema[]}\n * @public\n */\n fields: PolarisModeFieldSchema[];\n\n /**\n * A list of traits that this resource implements. The fields for these\n * traits should still be defined in the fields array.\n *\n * Each trait should be a string that matches the `type` of another\n * resource schema. The trait can be abstract and reference a resource\n * type that is never defined as a schema.\n *\n * @property traits\n * @type {String[]}\n * @public\n */\n traits?: string[];\n}\n\n/**\n * Represents a schema for a primary resource in LegacyMode\n *\n * Primary resources are objects with a unique identity of their\n * own which may allow them to appear in relationships, or in multiple\n * response documents.\n *\n * @class (Type) LegacyResourceSchema\n * @public\n */\nexport interface LegacyResourceSchema {\n /**\n * A flag indicating that this is a legacy resource schema\n *\n * @property legacy\n * @type {true}\n * @public\n */\n legacy: true;\n\n /**\n * This should be an IdentityField.\n *\n * To maximize compatibility with Model where `id` was the\n * name of the identity field, we recommend using `{ kind: '@id', name: 'id' }`\n * for records in legacy mode, but this is not required.\n *\n * @property identity\n * @type {IdentityField}\n * @public\n */\n identity: IdentityField;\n\n /**\n * The name of the schema\n *\n * For cacheable resources, this should be the\n * primary resource type.\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\n * @property fields\n * @type {LegacyModeFieldSchema[]}\n * @public\n */\n fields: LegacyModeFieldSchema[];\n\n /**\n * A list of traits that this resource implements. The fields for these\n * traits should still be defined in the fields array.\n *\n * Each trait should be a string that matches the `type` of another\n * resource schema. The trait can be abstract and reference a resource\n * type that is never defined as a schema.\n *\n * @property traits\n * @type {String[]}\n * @public\n */\n traits?: string[];\n}\n\n/**\n * A type which represents a valid JSON schema\n * definition for either a PolarisMode or a\n * LegacyMode resource.\n *\n * Note, this is separate from the type returned\n * by the SchemaService which provides fields as a Map\n * instead of as an Array.\n *\n */\nexport type ResourceSchema = PolarisResourceSchema | LegacyResourceSchema;\n\n/**\n * Represents a schema for an object that is not\n * a primary resource (has no unique identity of its own).\n *\n * ObjectSchemas may not currently contain relationships.\n *\n * @class (Type) ObjectSchema\n * @public\n */\nexport interface ObjectSchema {\n /**\n * Either a HashField from which to calculate an identity or null\n *\n * In the case of `null`, the object's identity will be based\n * on the referential identity of the object in the cache itself\n * when an identity is needed.\n *\n * @property identity\n * @type {HashField | null}\n * @public\n */\n identity: HashField | null;\n\n /**\n * The name of the schema\n *\n * The names of object and resource schemas share\n * a single namespace and must not conflict.\n *\n * We recommend a naming convention for object schemas\n * such as below for ensuring uniqueness:\n *\n * - for globally shared objects: The pattern `$field:${KlassName}` e.g. `$field:AddressObject`\n * - for resource-specific objects: The pattern `$${ResourceKlassName}:$field:${KlassName}` e.g. `$User:$field:ReusableAddress`\n * - for inline objects: The pattern `$${ResourceKlassName}.${fieldPath}:$field:anonymous` e.g. `$User.shippingAddress:$field:anonymous`\n *\n * @property type\n * @type {String}\n * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the object\n *\n * @property fields\n * @type {ObjectFieldSchema[]}\n * @public\n */\n fields: ObjectFieldSchema[];\n}\n\nexport type Schema = ResourceSchema | ObjectSchema;\n\n/**\n * A no-op type utility that enables type-checking resource schema\n * definitions.\n *\n * Will return the passed in schema.\n *\n * This will not validate relationship inverses or related types,\n * as doing so would require a full schema graph to be passed in\n * and no cycles in the graph to be present.\n *\n * @param {ResourceSchema} schema\n * @return {ResourceSchema} the passed in schema\n * @public\n */\nexport function resourceSchema<T extends LegacyResourceSchema | PolarisResourceSchema>(\n schema: LegacyResourceSchema | PolarisResourceSchema\n): T {\n return schema as T;\n}\n\n/**\n * A no-op type utility that enables type-checking object schema\n * definitions.\n *\n * Will return the passed in schema.\n *\n * @param {ObjectSchema} schema\n * @return {ObjectSchema} the passed in schema\n * @public\n */\nexport function objectSchema<T extends ObjectSchema>(schema: T): T {\n return schema;\n}\n\n/**\n * A type utility to narrow a schema to a ResourceSchema\n *\n * @param schema\n * @return {Boolean}\n * @public\n */\nexport function isResourceSchema(schema: ResourceSchema | ObjectSchema): schema is ResourceSchema {\n return schema?.identity?.kind === '@id';\n}\n\n/**\n * A type utility to narrow a schema to LegacyResourceSchema\n *\n * @param schema\n * @return {Boolean}\n * @public\n */\nexport function isLegacyResourceSchema(schema: ResourceSchema | ObjectSchema): schema is LegacyResourceSchema {\n return isResourceSchema(schema) && schema.legacy === true;\n}\n\nexport type LegacyField =\n | LegacyAttributeField\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\nexport type LegacyRelationshipField =\n | LegacyBelongsToField\n | LegacyHasManyField\n | LinksModeBelongsToField\n | LinksModeHasManyField;\n"],"names":["resourceSchema","schema","objectSchema","isResourceSchema","identity","kind","isLegacyResourceSchema","legacy"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAyGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAwDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAcA,CAC5BC,MAAoD,EACjD;AACH,EAAA,OAAOA,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAyBD,MAAS,EAAK;AACjE,EAAA,OAAOA,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,gBAAgBA,CAACF,MAAqC,EAA4B;AAChG,EAAA,OAAOA,MAAM,EAAEG,QAAQ,EAAEC,IAAI,KAAK,KAAK;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CAACL,MAAqC,EAAkC;EAC5G,OAAOE,gBAAgB,CAACF,MAAM,CAAC,IAAIA,MAAM,CAACM,MAAM,KAAK,IAAI;AAC3D;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fields.type-test.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-api-raw.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.js","sources":["../../src/types/symbols.ts"],"sourcesContent":["import { getOrSetGlobal } from './-private.ts';\n\nexport const RecordStore: '___(unique) Symbol(Store)' = getOrSetGlobal('Store', Symbol('Store'));\n\n/**\n * Symbol for the name of a resource, transformation\n * or derivation.\n *\n * ### With Resources\n *\n * This is an optional feature that can be used by\n * record implementations to provide a typescript\n * hint for the type of the resource.\n *\n * When used, EmberData and WarpDrive APIs can\n * take advantage of this to provide better type\n * safety and intellisense.\n *\n * ### With Derivations\n *\n * Required for derivations registered with\n * `store.registerDerivation(derivation)`.\n *\n * ```ts\n * function concat(record: object, options: ObjectValue | null, prop: string): string {}\n * concat[Name] = 'concat';\n * ```\n *\n * ### With Transforms\n *\n * Required for new-style transformations registered\n * with `store.registerTransform(transform)`.\n *\n * For legacy transforms, if not used,\n * `attr<Transform>('name')` will allow any string name.\n * `attr('name')` will always allow any string name.\n *\n * If used, `attr<Transform>('name')` will enforce\n * that the name is the same as the transform name.\n *\n * @type {Symbol}\n */\nexport const Type: '___(unique) Symbol($type)' = getOrSetGlobal('$type', Symbol('$type'));\n\n/**\n * Symbol for the type of a resource.\n *\n * This is an optional feature that can be used by\n * record implementations to provide a typescript\n * hint for the type of the resource.\n *\n * When used, EmberData and WarpDrive APIs can\n * take advantage of this to provide better type\n * safety and intellisense.\n *\n * @type {Symbol}\n */\nexport const ResourceType: '___(unique) Symbol($type)' = Type;\n\n/**\n * Symbol for the name of a transform.\n *\n * This is an optional feature that can be used by\n * transform implementations to provide a typescript\n * hint for the name of the transform.\n *\n * If not used, `attr<Transform>('name')` will\n * allow any string name. `attr('name')` will always\n * allow any string name.\n *\n * If used, `attr<Transform>('name')` will enforce\n * that the name is the same as the transform name.\n *\n * @type {Symbol}\n */\nexport const TransformName: '___(unique) Symbol($type)' = Type;\n\n/**\n * Symbol for use by builders to indicate the return type\n * generic to use for store.request()\n *\n * @type {Symbol}\n */\nexport const RequestSignature: '___(unique) Symbol(RequestSignature)' = getOrSetGlobal(\n 'RequestSignature',\n Symbol('RequestSignature')\n);\n"],"names":["RecordStore","getOrSetGlobal","Symbol","Type","ResourceType","TransformName","RequestSignature"],"mappings":";;AAEO,MAAMA,WAAwC,GAAGC,cAAc,CAAC,OAAO,EAAEC,MAAM,CAAC,OAAO,CAAC;;AAE/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,IAAiC,GAAGF,cAAc,CAAC,OAAO,EAAEC,MAAM,CAAC,OAAO,CAAC;;AAExF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,YAAyC,GAAGD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,aAA0C,GAAGF;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,gBAAwD,GAAGL,cAAc,CACpF,kBAAkB,EAClBC,MAAM,CAAC,kBAAkB,CAC3B;;;;"}
|
package/dist/types/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|