@warp-drive/core 5.6.0-alpha.15 → 5.6.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/build-config/babel-macros.d.ts +1 -2
- package/declarations/build-config/canary-features.d.ts +1 -2
- package/declarations/build-config/debugging.d.ts +1 -2
- package/declarations/build-config/deprecations.d.ts +1 -2
- package/declarations/build-config/env.d.ts +1 -2
- package/declarations/build-config/macros.d.ts +1 -2
- package/declarations/build-config.d.ts +1 -2
- package/declarations/configure.d.ts +6 -7
- package/declarations/graph/-private/-diff.d.ts +21 -22
- package/declarations/graph/-private/-edge-definition.d.ts +134 -135
- package/declarations/graph/-private/-state.d.ts +93 -7
- package/declarations/graph/-private/-utils.d.ts +18 -13
- package/declarations/graph/-private/coerce-id.d.ts +6 -1
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts +15 -4
- package/declarations/graph/-private/edges/collection.d.ts +35 -36
- package/declarations/graph/-private/edges/implicit.d.ts +28 -29
- package/declarations/graph/-private/edges/resource.d.ts +19 -20
- package/declarations/graph/-private/graph.d.ts +83 -48
- package/declarations/graph/-private/normalize-link.d.ts +7 -2
- package/declarations/graph/-private/operations/add-to-related-records.d.ts +3 -4
- package/declarations/graph/-private/operations/merge-identifier.d.ts +2 -3
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts +3 -4
- package/declarations/graph/-private/operations/replace-related-record.d.ts +2 -3
- package/declarations/graph/-private/operations/replace-related-records.d.ts +58 -4
- package/declarations/graph/-private/operations/update-relationship.d.ts +11 -9
- package/declarations/graph/-private.d.ts +9 -10
- package/declarations/index.d.ts +11 -12
- package/declarations/reactive/-private/document.d.ts +143 -144
- package/declarations/reactive/-private/fields/compute.d.ts +31 -28
- package/declarations/reactive/-private/fields/extension.d.ts +2 -3
- package/declarations/reactive/-private/fields/managed-array.d.ts +19 -20
- package/declarations/reactive/-private/fields/managed-object.d.ts +16 -16
- package/declarations/reactive/-private/fields/many-array-manager.d.ts +15 -16
- package/declarations/reactive/-private/hooks.d.ts +3 -4
- package/declarations/reactive/-private/record.d.ts +61 -59
- package/declarations/reactive/-private/schema.d.ts +242 -224
- package/declarations/reactive/-private/symbols.d.ts +26 -1
- package/declarations/reactive/-private.d.ts +1 -2
- package/declarations/reactive.d.ts +4 -5
- 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 +23 -24
- package/declarations/request/-private/future.d.ts +3 -4
- package/declarations/request/-private/manager.d.ts +159 -157
- package/declarations/request/-private/promise-cache.d.ts +21 -13
- package/declarations/request/-private/types.d.ts +124 -124
- package/declarations/request/-private/utils.d.ts +8 -9
- package/declarations/request.d.ts +5 -6
- package/declarations/store/-private/cache-handler/handler.d.ts +57 -52
- package/declarations/store/-private/cache-handler/types.d.ts +95 -96
- package/declarations/store/-private/cache-handler/utils.d.ts +16 -16
- package/declarations/store/-private/caches/cache-utils.d.ts +7 -4
- package/declarations/store/-private/caches/identifier-cache.d.ts +234 -246
- package/declarations/store/-private/caches/instance-cache.d.ts +47 -47
- package/declarations/store/-private/caches/resource-utils.d.ts +3 -4
- package/declarations/store/-private/debug/utils.d.ts +6 -7
- package/declarations/store/-private/default-cache-policy.d.ts +362 -361
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts +154 -159
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts +14 -14
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts +21 -22
- package/declarations/store/-private/managers/cache-manager.d.ts +440 -425
- package/declarations/store/-private/managers/notification-manager.d.ts +88 -83
- package/declarations/store/-private/managers/record-array-manager.d.ts +89 -90
- package/declarations/store/-private/network/request-cache.d.ts +86 -83
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts +252 -244
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts +154 -155
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts +148 -149
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts +28 -23
- package/declarations/store/-private/new-core-tmp/request-state.d.ts +263 -241
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts +253 -223
- package/declarations/store/-private/record-arrays/identifier-array.d.ts +125 -121
- package/declarations/store/-private/record-arrays/many-array.d.ts +180 -184
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts +120 -110
- package/declarations/store/-private/store-service.d.ts +1594 -1586
- package/declarations/store/-private/utils/coerce-id.d.ts +6 -1
- package/declarations/store/-private/utils/construct-resource.d.ts +1 -2
- package/declarations/store/-private/utils/is-non-empty-string.d.ts +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts +0 -1
- package/declarations/store/-private.d.ts +31 -28
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts +96 -97
- package/declarations/store/-types/q/ds-model.d.ts +17 -18
- package/declarations/store/-types/q/identifier.d.ts +11 -12
- package/declarations/store/-types/q/record-instance.d.ts +16 -17
- package/declarations/store/-types/q/schema-service.d.ts +346 -343
- package/declarations/store/-types/q/store.d.ts +25 -28
- package/declarations/store.d.ts +1 -2
- 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 -32
- 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 -1713
- 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 -11
- package/declarations/utils/string.d.ts +43 -40
- package/dist/graph/-private.js +1 -1
- package/dist/{handler-D1C3Innj.js → handler-C2T-IyJK.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.js +42 -73
- package/dist/{request-state-CCOJIj5i.js → request-state-CjLph1LP.js} +275 -261
- package/dist/store/-private.js +2 -2
- package/dist/{symbols-epHW0Vm9.js → symbols-SIstXMLI.js} +1 -1
- package/dist/types/-private.js +1 -1
- package/package.json +4 -4
- package/declarations/build-config/babel-macros.d.ts.map +0 -1
- package/declarations/build-config/canary-features.d.ts.map +0 -1
- package/declarations/build-config/debugging.d.ts.map +0 -1
- package/declarations/build-config/deprecations.d.ts.map +0 -1
- package/declarations/build-config/env.d.ts.map +0 -1
- package/declarations/build-config/macros.d.ts.map +0 -1
- package/declarations/build-config.d.ts.map +0 -1
- package/declarations/configure.d.ts.map +0 -1
- package/declarations/graph/-private/-diff.d.ts.map +0 -1
- package/declarations/graph/-private/-edge-definition.d.ts.map +0 -1
- package/declarations/graph/-private/-state.d.ts.map +0 -1
- package/declarations/graph/-private/-utils.d.ts.map +0 -1
- package/declarations/graph/-private/coerce-id.d.ts.map +0 -1
- package/declarations/graph/-private/debug/assert-polymorphic-type.d.ts.map +0 -1
- package/declarations/graph/-private/edges/collection.d.ts.map +0 -1
- package/declarations/graph/-private/edges/implicit.d.ts.map +0 -1
- package/declarations/graph/-private/edges/resource.d.ts.map +0 -1
- package/declarations/graph/-private/graph.d.ts.map +0 -1
- package/declarations/graph/-private/normalize-link.d.ts.map +0 -1
- package/declarations/graph/-private/operations/add-to-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/merge-identifier.d.ts.map +0 -1
- package/declarations/graph/-private/operations/remove-from-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/replace-related-record.d.ts.map +0 -1
- package/declarations/graph/-private/operations/replace-related-records.d.ts.map +0 -1
- package/declarations/graph/-private/operations/update-relationship.d.ts.map +0 -1
- package/declarations/graph/-private.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/reactive/-private/document.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/compute.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/extension.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/managed-array.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/managed-object.d.ts.map +0 -1
- package/declarations/reactive/-private/fields/many-array-manager.d.ts.map +0 -1
- package/declarations/reactive/-private/hooks.d.ts.map +0 -1
- package/declarations/reactive/-private/record.d.ts.map +0 -1
- package/declarations/reactive/-private/schema.d.ts.map +0 -1
- package/declarations/reactive/-private/symbols.d.ts.map +0 -1
- package/declarations/reactive/-private.d.ts.map +0 -1
- package/declarations/reactive.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/store/-private/cache-handler/handler.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/types.d.ts.map +0 -1
- package/declarations/store/-private/cache-handler/utils.d.ts.map +0 -1
- package/declarations/store/-private/caches/cache-utils.d.ts.map +0 -1
- package/declarations/store/-private/caches/identifier-cache.d.ts.map +0 -1
- package/declarations/store/-private/caches/instance-cache.d.ts.map +0 -1
- package/declarations/store/-private/caches/resource-utils.d.ts.map +0 -1
- package/declarations/store/-private/debug/utils.d.ts.map +0 -1
- package/declarations/store/-private/default-cache-policy.d.ts.map +0 -1
- package/declarations/store/-private/legacy-model-support/record-reference.d.ts.map +0 -1
- package/declarations/store/-private/legacy-model-support/shim-model-class.d.ts.map +0 -1
- package/declarations/store/-private/managers/cache-capabilities-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/cache-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/notification-manager.d.ts.map +0 -1
- package/declarations/store/-private/managers/record-array-manager.d.ts.map +0 -1
- package/declarations/store/-private/network/request-cache.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/promise-state.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/configure.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/internal.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/reactivity/signal.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/request-state.d.ts.map +0 -1
- package/declarations/store/-private/new-core-tmp/request-subscription.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/identifier-array.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/many-array.d.ts.map +0 -1
- package/declarations/store/-private/record-arrays/native-proxy-type-fix.d.ts.map +0 -1
- package/declarations/store/-private/store-service.d.ts.map +0 -1
- package/declarations/store/-private/store-service.type-test.d.ts +0 -2
- package/declarations/store/-private/store-service.type-test.d.ts.map +0 -1
- package/declarations/store/-private/utils/coerce-id.d.ts.map +0 -1
- package/declarations/store/-private/utils/construct-resource.d.ts.map +0 -1
- package/declarations/store/-private/utils/is-non-empty-string.d.ts.map +0 -1
- package/declarations/store/-private/utils/normalize-model-name.d.ts.map +0 -1
- package/declarations/store/-private/utils/uuid-polyfill.d.ts.map +0 -1
- package/declarations/store/-private.d.ts.map +0 -1
- package/declarations/store/-types/q/cache-capabilities-manager.d.ts.map +0 -1
- package/declarations/store/-types/q/ds-model.d.ts.map +0 -1
- package/declarations/store/-types/q/identifier.d.ts.map +0 -1
- package/declarations/store/-types/q/promise-proxies.d.ts +0 -2
- package/declarations/store/-types/q/promise-proxies.d.ts.map +0 -1
- package/declarations/store/-types/q/record-data-json-api.d.ts +0 -31
- package/declarations/store/-types/q/record-data-json-api.d.ts.map +0 -1
- package/declarations/store/-types/q/record-instance.d.ts.map +0 -1
- package/declarations/store/-types/q/schema-service.d.ts.map +0 -1
- package/declarations/store/-types/q/store.d.ts.map +0 -1
- package/declarations/store.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/declarations/utils/string.d.ts.map +0 -1
- package/dist/build-config/babel-macros.js.map +0 -1
- package/dist/build-config/canary-features.js.map +0 -1
- package/dist/build-config/debugging.js.map +0 -1
- package/dist/build-config/deprecations.js.map +0 -1
- package/dist/build-config/env.js.map +0 -1
- package/dist/build-config/macros.js.map +0 -1
- package/dist/build-config.js.map +0 -1
- package/dist/configure-B48bFHOl.js.map +0 -1
- package/dist/configure.js.map +0 -1
- package/dist/context-COmAnXUQ.js.map +0 -1
- package/dist/graph/-private.js.map +0 -1
- package/dist/handler-D1C3Innj.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/reactive/-private.js.map +0 -1
- package/dist/reactive.js.map +0 -1
- package/dist/request-state-CCOJIj5i.js.map +0 -1
- package/dist/request.js.map +0 -1
- package/dist/store/-private.js.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/symbols-epHW0Vm9.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
- package/dist/utils/string.js.map +0 -1
package/dist/request.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"-private.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/store.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sources":["../src/store/-private/default-cache-policy.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { LOG_CACHE_POLICY } from '@warp-drive/core/build-config/debugging';\nimport { TESTING } from '@warp-drive/core/build-config/env';\nimport { assert } from '@warp-drive/core/build-config/macros';\nimport type { Cache } from '@warp-drive/core/types/cache';\nimport type { StableDocumentIdentifier, StableRecordIdentifier } from '@warp-drive/core/types/identifier';\nimport type { ImmutableRequestInfo, ResponseInfo, StructuredDocument } from '@warp-drive/core/types/request';\nimport type { ResourceDocument } from '@warp-drive/core/types/spec/document';\n\nimport { LRUCache } from '../../utils/string';\n\ntype UnsubscribeToken = object;\ntype CacheOperation = 'added' | 'removed' | 'updated' | 'state';\ntype DocumentCacheOperation = 'invalidated' | 'added' | 'removed' | 'updated' | 'state';\n\nexport interface NotificationCallback {\n (identifier: StableRecordIdentifier, notificationType: 'attributes' | 'relationships', key?: string): void;\n (identifier: StableRecordIdentifier, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;\n // (identifier: StableRecordIdentifier, notificationType: NotificationType, key?: string): void;\n}\n\ninterface ResourceOperationCallback {\n // resource updates\n (identifier: StableRecordIdentifier, notificationType: CacheOperation): void;\n}\n\ninterface DocumentOperationCallback {\n // document updates\n (identifier: StableDocumentIdentifier, notificationType: DocumentCacheOperation): void;\n}\n\ntype NotificationManager = {\n subscribe(identifier: StableRecordIdentifier, callback: NotificationCallback): UnsubscribeToken;\n subscribe(identifier: 'resource', callback: ResourceOperationCallback): UnsubscribeToken;\n subscribe(identifier: 'document' | StableDocumentIdentifier, callback: DocumentOperationCallback): UnsubscribeToken;\n\n notify(identifier: StableRecordIdentifier, value: 'attributes' | 'relationships', key?: string): boolean;\n notify(identifier: StableRecordIdentifier, value: 'errors' | 'meta' | 'identity' | 'state'): boolean;\n notify(identifier: StableRecordIdentifier, value: CacheOperation): boolean;\n notify(identifier: StableDocumentIdentifier, value: DocumentCacheOperation): boolean;\n};\n\ntype Store = {\n cache: Cache;\n notifications: NotificationManager;\n};\n\nexport interface CacheControlValue {\n immutable?: boolean;\n 'max-age'?: number;\n 'must-revalidate'?: boolean;\n 'must-understand'?: boolean;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'no-transform'?: boolean;\n 'only-if-cached'?: boolean;\n private?: boolean;\n 'proxy-revalidate'?: boolean;\n public?: boolean;\n 's-maxage'?: number;\n 'stale-if-error'?: number;\n 'stale-while-revalidate'?: number;\n}\n\ntype CacheControlKey = keyof CacheControlValue;\n\nconst NUMERIC_KEYS = new Set(['max-age', 's-maxage', 'stale-if-error', 'stale-while-revalidate']);\n\n/**\n * Parses a string Cache-Control header value into an object with the following structure:\n *\n * ```ts\n * interface CacheControlValue {\n * immutable?: boolean;\n * 'max-age'?: number;\n * 'must-revalidate'?: boolean;\n * 'must-understand'?: boolean;\n * 'no-cache'?: boolean;\n * 'no-store'?: boolean;\n * 'no-transform'?: boolean;\n * 'only-if-cached'?: boolean;\n * private?: boolean;\n * 'proxy-revalidate'?: boolean;\n * public?: boolean;\n * 's-maxage'?: number;\n * 'stale-if-error'?: number;\n * 'stale-while-revalidate'?: number;\n * }\n * ```\n *\n * @public\n * @param {String} header\n * @return {CacheControlValue}\n */\nexport function parseCacheControl(header: string): CacheControlValue {\n return CACHE_CONTROL_CACHE.get(header);\n}\n\nconst CACHE_CONTROL_CACHE = new LRUCache((header: string) => {\n let key: CacheControlKey = '' as CacheControlKey;\n let value = '';\n let isParsingKey = true;\n const cacheControlValue: CacheControlValue = {};\n\n for (let i = 0; i < header.length; i++) {\n const char = header.charAt(i);\n if (char === ',') {\n assert(`Invalid Cache-Control value, expected a value`, !isParsingKey || !NUMERIC_KEYS.has(key));\n assert(\n `Invalid Cache-Control value, expected a value after \"=\" but got \",\"`,\n i === 0 || header.charAt(i - 1) !== '='\n );\n isParsingKey = true;\n // @ts-expect-error TS incorrectly thinks that optional keys must have a type that includes undefined\n cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;\n key = '' as CacheControlKey;\n value = '';\n continue;\n } else if (char === '=') {\n assert(`Invalid Cache-Control value, expected a value after \"=\"`, i + 1 !== header.length);\n isParsingKey = false;\n } else if (char === ' ' || char === `\\t` || char === `\\n`) {\n continue;\n } else if (isParsingKey) {\n key += char;\n } else {\n value += char;\n }\n\n if (i === header.length - 1) {\n // @ts-expect-error TS incorrectly thinks that optional keys must have a type that includes undefined\n cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;\n }\n }\n\n return cacheControlValue;\n}, 200);\n\nfunction parseCacheControlValue(stringToParse: string): number {\n const parsedValue = Number.parseInt(stringToParse);\n assert(`Invalid Cache-Control value, expected a number but got - ${stringToParse}`, !Number.isNaN(parsedValue));\n assert(`Invalid Cache-Control value, expected a number greater than 0 but got - ${stringToParse}`, parsedValue >= 0);\n if (Number.isNaN(parsedValue) || parsedValue < 0) {\n return 0;\n }\n\n return parsedValue;\n}\n\nfunction isExpired(\n identifier: StableDocumentIdentifier,\n request: StructuredDocument<ResourceDocument>,\n config: PolicyConfig\n): boolean {\n const { constraints } = config;\n\n if (constraints?.isExpired) {\n const result = constraints.isExpired(request);\n if (result !== null) {\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(\n `CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because constraints.isExpired returned ${result}`\n );\n }\n return result;\n }\n }\n\n const { headers } = request.response!;\n\n if (!headers) {\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(`CachePolicy: ${identifier.lid} is EXPIRED because no headers were provided`);\n }\n\n // if we have no headers then both the headers based expiration\n // and the time based expiration will be considered expired\n return true;\n }\n\n // check for X-WarpDrive-Expires\n const now = Date.now();\n const date = headers.get('Date');\n\n if (constraints?.headers) {\n if (constraints.headers['X-WarpDrive-Expires']) {\n const xWarpDriveExpires = headers.get('X-WarpDrive-Expires');\n if (xWarpDriveExpires) {\n const expirationTime = new Date(xWarpDriveExpires).getTime();\n const result = now >= expirationTime;\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(\n `CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by X-WarpDrive-Expires header is ${result ? 'in the past' : 'in the future'}`\n );\n }\n return result;\n }\n }\n\n // check for Cache-Control\n if (constraints.headers['Cache-Control']) {\n const cacheControl = headers.get('Cache-Control');\n const age = headers.get('Age');\n\n if (cacheControl && age && date) {\n const cacheControlValue = parseCacheControl(cacheControl);\n\n // max-age and s-maxage are stored in\n const maxAge = cacheControlValue['max-age'] || cacheControlValue['s-maxage'];\n\n if (maxAge) {\n // age is stored in seconds\n const ageValue = parseInt(age, 10);\n assert(`Invalid Cache-Control value, expected a number but got - ${age}`, !Number.isNaN(ageValue));\n assert(`Invalid Cache-Control value, expected a number greater than 0 but got - ${age}`, ageValue >= 0);\n\n if (!Number.isNaN(ageValue) && ageValue >= 0) {\n const dateValue = new Date(date).getTime();\n const expirationTime = dateValue + (maxAge - ageValue) * 1000;\n const result = now >= expirationTime;\n\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(\n `CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by Cache-Control header is ${result ? 'in the past' : 'in the future'}`\n );\n }\n\n return result;\n }\n }\n }\n }\n\n // check for Expires\n if (constraints.headers.Expires) {\n const expires = headers.get('Expires');\n if (expires) {\n const expirationTime = new Date(expires).getTime();\n const result = now >= expirationTime;\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(\n `CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the time set by Expires header is ${result ? 'in the past' : 'in the future'}`\n );\n }\n return result;\n }\n }\n }\n\n // check for Date\n if (!date) {\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(`CachePolicy: ${identifier.lid} is EXPIRED because no Date header was provided`);\n }\n return true;\n }\n\n let expirationTime = config.apiCacheHardExpires;\n if (TESTING) {\n if (!config.disableTestOptimization) {\n expirationTime = config.apiCacheSoftExpires;\n }\n }\n\n const time = new Date(date).getTime();\n const deadline = time + expirationTime;\n const result = now >= deadline;\n\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(\n `CachePolicy: ${identifier.lid} is ${result ? 'EXPIRED' : 'NOT expired'} because the apiCacheHardExpires time since the response's Date header is ${result ? 'in the past' : 'in the future'}`\n );\n }\n\n return result;\n}\n\n/**\n * The configuration options for the {@link DefaultCachePolicy}\n *\n * ```ts\n * import { DefaultCachePolicy } from '@warp-drive/core/store';\n *\n * new DefaultCachePolicy({\n * // ... PolicyConfig Settings ... //\n * });\n * ```\n *\n */\nexport type PolicyConfig = {\n /**\n * the number of milliseconds after which a request is considered\n * stale. If a request is issued again after this time, the request\n * will respond from cache immediately while a background request\n * is made to update the cache.\n *\n * This is calculated against the `date` header of the response.\n *\n * If your API does not provide a `date` header, the `Fetch` handler\n * provided by `@warp-drive/core` will automatically add\n * it to responses if it is not present. Responses without a `date`\n * header will be considered stale immediately.\n *\n */\n apiCacheSoftExpires: number;\n /**\n * the number of milliseconds after which a request is considered\n * expired and should be re-fetched. If a request is issued again\n * after this time, the request will disregard the cache and\n * wait for a fresh response from the API.\n *\n * This is calculated against the `date` header of the response.\n *\n * If your API does not provide a `date` header, the `Fetch` handler\n * provided by `@warp-drive/core` will automatically add\n * it to responses if it is not present. Responses without a `date`\n * header will be considered hard expired immediately.\n *\n */\n apiCacheHardExpires: number;\n /**\n * In Testing environments, the `apiCacheSoftExpires` will always be `false`\n * and `apiCacheHardExpires` will use the `apiCacheSoftExpires` value.\n *\n * This helps reduce flakiness and produce predictably rendered results in test suites.\n *\n * Requests that specifically set `cacheOptions.backgroundReload = true` will\n * still be background reloaded in tests.\n *\n * This behavior can be opted out of by setting this value to `true`.\n *\n */\n disableTestOptimization?: boolean;\n\n /**\n * In addition to the simple time-based expiration strategy, CachePolicy\n * supports various common server-supplied expiration strategies via\n * headers, as well as custom expiration strategies via the `isExpired`\n * function.\n *\n * Requests will be validated for expiration against these constraints.\n * If any of these constraints are not met, the request will be considered\n * expired. If all constraints are met, the request will be considered\n * valid and the time based expiration strategy will NOT be used.\n *\n * Meeting a constraint means BOTH that the properties the constraint\n * requires are present AND that the expiration time indicated by those\n * properties has not been exceeded.\n *\n * In other words, if the properties for a constraint are not present,\n * this does not count either as meeting or as not meeting the constraint,\n * the constraint simply does not apply.\n *\n * The `isExpired` function is called with the request and should return\n * `true` if the request is expired, `false` if it is not expired, and\n * `null` if the expiration status is unknown.\n *\n * In order constraints are checked:\n *\n * - isExpired function\n * - ↳ (if null) X-WarpDrive-Expires header\n * - ↳ (if null) Cache-Control header\n * - ↳ (if null) Expires header\n *\n */\n constraints?: {\n /**\n * Headers that should be checked for expiration.\n *\n */\n headers?: {\n /**\n * Whether the `Cache-Control` header should be checked for expiration.\n * If `true`, then the `max-age` and `s-maxage` directives are used alongside\n * the `Age` and `Date` headers to determine if the expiration time has passed.\n *\n * Other directives are ignored.\n *\n * 'Cache-Control' will take precedence over 'Expires' if both are present\n * and both configured to be checked.\n *\n */\n 'Cache-Control'?: boolean;\n\n /**\n * Whether the `Expires` header should be checked for expiration.\n *\n * If `true`, then the `Expires` header is used to caclulate the expiration time\n * and determine if the expiration time has passed.\n *\n * 'Cache-Control' will take precedence over 'Expires' if both are present.\n *\n */\n Expires?: boolean;\n\n /**\n * Whether the `X-WarpDrive-Expires` header should be checked for expiration.\n *\n * If `true`, then the `X-WarpDrive-Expires` header is used to caclulate the expiration time\n * and determine if the expiration time has passed.\n *\n * This header will take precedence over 'Cache-Control' and 'Expires' if all three are present.\n *\n * The header's value should be a [UTC date string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString).\n *\n */\n 'X-WarpDrive-Expires'?: boolean;\n };\n\n /**\n * A function that should be called to determine if the request is expired.\n *\n * If present, this function will be called with the request and should return\n * `true` if the request is expired, `false` if it is not expired, and\n * `null` if the expiration status is unknown.\n *\n * If the function does not return `null`,\n *\n */\n isExpired?: (request: StructuredDocument<ResourceDocument>) => boolean | null;\n };\n};\n\n/**\n * A basic CachePolicy that can be added to the Store service.\n *\n * Determines staleness based on time since the request was last received from the API\n * using the `date` header.\n *\n * Determines expiration based on configured constraints as well as a time based\n * expiration strategy based on the `date` header.\n *\n * In order expiration is determined by:\n *\n * - Is explicitly invalidated\n * - ↳ (if null) isExpired function \\<IF Constraint Active>\n * - ↳ (if null) X-WarpDrive-Expires header \\<IF Constraint Active>\n * - ↳ (if null) Cache-Control header \\<IF Constraint Active>\n * - ↳ (if null) Expires header \\<IF Constraint Active>\n * - ↳ (if null) Date header + apiCacheHardExpires \\< current time\n *\n * Invalidates any request for which `cacheOptions.types` was provided when a createRecord\n * request for that type is successful.\n *\n * For this to work, the `createRecord` request must include the `cacheOptions.types` array\n * with the types that should be invalidated, or its request should specify the identifiers\n * of the records that are being created via `records`. Providing both is valid.\n *\n * > [!NOTE]\n * > only requests that had specified `cacheOptions.types` and occurred prior to the\n * > createRecord request will be invalidated. This means that a given request should always\n * > specify the types that would invalidate it to opt into this behavior. Abstracting this\n * > behavior via builders is recommended to ensure consistency.\n *\n * This allows the Store's CacheHandler to determine if a request is expired and\n * should be refetched upon next request.\n *\n * The `Fetch` handler provided by `@warp-drive/core` will automatically\n * add the `date` header to responses if it is not present.\n *\n * > [!NOTE]\n * > Date headers do not have millisecond precision, so expiration times should\n * > generally be larger than 1000ms.\n *\n * Usage:\n *\n * ```ts\n * import { Store } from '@warp-drive/core';\n * import { DefaultCachePolicy } from '@warp-drive/core/store';\n *\n * export class AppStore extends Store {\n * lifetimes = new DefaultCachePolicy({\n * apiCacheSoftExpires: 30_000,\n * apiCacheHardExpires: 60_000\n * });\n * }\n * ```\n *\n * In Testing environments, the `apiCacheSoftExpires` will always be `false`\n * and `apiCacheHardExpires` will use the `apiCacheSoftExpires` value.\n *\n * This helps reduce flakiness and produce predictably rendered results in test suites.\n *\n * Requests that specifically set `cacheOptions.backgroundReload = true` will\n * still be background reloaded in tests.\n *\n * This behavior can be opted out of by setting `disableTestOptimization = true`\n * in the policy config.\n *\n * @public\n */\nexport class DefaultCachePolicy {\n declare config: PolicyConfig;\n declare _stores: WeakMap<\n Store,\n { invalidated: Set<StableDocumentIdentifier>; types: Map<string, Set<StableDocumentIdentifier>> }\n >;\n\n _getStore(store: Store): {\n invalidated: Set<StableDocumentIdentifier>;\n types: Map<string, Set<StableDocumentIdentifier>>;\n } {\n let set = this._stores.get(store);\n if (!set) {\n set = { invalidated: new Set(), types: new Map() };\n this._stores.set(store, set);\n }\n return set;\n }\n\n constructor(config: PolicyConfig) {\n this._stores = new WeakMap();\n\n const _config = arguments.length === 1 ? config : (arguments[1] as unknown as PolicyConfig);\n deprecate(\n `Passing a Store to the CachePolicy is deprecated, please pass only a config instead.`,\n arguments.length === 1,\n {\n id: 'ember-data:request-utils:lifetimes-service-store-arg',\n since: {\n enabled: '5.4',\n available: '4.13',\n },\n for: '@ember-data/request-utils',\n until: '6.0',\n }\n );\n assert(`You must pass a config to the CachePolicy`, _config);\n assert(`You must pass a apiCacheSoftExpires to the CachePolicy`, typeof _config.apiCacheSoftExpires === 'number');\n assert(`You must pass a apiCacheHardExpires to the CachePolicy`, typeof _config.apiCacheHardExpires === 'number');\n this.config = _config;\n }\n\n /**\n * Invalidate a request by its identifier for a given store instance.\n *\n * While the store argument may seem redundant, the CachePolicy\n * is designed to be shared across multiple stores / forks\n * of the store.\n *\n * ```ts\n * store.lifetimes.invalidateRequest(store, identifier);\n * ```\n *\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n */\n invalidateRequest(identifier: StableDocumentIdentifier, store: Store): void {\n this._getStore(store).invalidated.add(identifier);\n }\n\n /**\n * Invalidate all requests associated to a specific type\n * for a given store instance.\n *\n * While the store argument may seem redundant, the CachePolicy\n * is designed to be shared across multiple stores / forks\n * of the store.\n *\n * This invalidation is done automatically when using this service\n * for both the CacheHandler and the LegacyNetworkHandler.\n *\n * ```ts\n * store.lifetimes.invalidateRequestsForType(store, 'person');\n * ```\n *\n * @public\n * @param {String} type\n * @param {Store} store\n */\n invalidateRequestsForType(type: string, store: Store): void {\n const storeCache = this._getStore(store);\n const set = storeCache.types.get(type);\n const notifications = store.notifications;\n\n if (set) {\n // TODO batch notifications\n set.forEach((id) => {\n storeCache.invalidated.add(id);\n notifications.notify(id, 'invalidated');\n });\n }\n }\n\n /**\n * Invoked when a request has been fulfilled from the configured request handlers.\n * This is invoked by the CacheHandler for both foreground and background requests\n * once the cache has been updated.\n *\n * Note, this is invoked by the CacheHandler regardless of whether\n * the request has a cache-key.\n *\n * This method should not be invoked directly by consumers.\n *\n * @public\n * @param {ImmutableRequestInfo} request\n * @param {ImmutableResponse} response\n * @param {Store} store\n * @param {StableDocumentIdentifier | null} identifier\n * @return {void}\n */\n didRequest(\n request: ImmutableRequestInfo,\n response: Response | ResponseInfo | null,\n identifier: StableDocumentIdentifier | null,\n store: Store\n ): void {\n // if this is a successful createRecord request, invalidate the cacheKey for the type\n if (request.op === 'createRecord') {\n const statusNumber = response?.status ?? 0;\n if (statusNumber >= 200 && statusNumber < 400) {\n const types = new Set(request.records?.map((r) => r.type));\n const additionalTypes = request.cacheOptions?.types;\n additionalTypes?.forEach((type) => {\n types.add(type);\n });\n\n types.forEach((type) => {\n this.invalidateRequestsForType(type, store);\n });\n }\n\n // add this document's cacheKey to a map for all associated types\n // it is recommended to only use this for queries\n } else if (identifier && request.cacheOptions?.types?.length) {\n const storeCache = this._getStore(store);\n request.cacheOptions?.types.forEach((type) => {\n const set = storeCache.types.get(type);\n if (set) {\n set.add(identifier);\n storeCache.invalidated.delete(identifier);\n } else {\n storeCache.types.set(type, new Set([identifier]));\n }\n });\n }\n }\n\n /**\n * Invoked to determine if the request may be fulfilled from cache\n * if possible.\n *\n * Note, this is only invoked by the CacheHandler if the request has\n * a cache-key.\n *\n * If no cache entry is found or the entry is hard expired,\n * the request will be fulfilled from the configured request handlers\n * and the cache will be updated before returning the response.\n *\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n * @return {Boolean} true if the request is considered hard expired\n */\n isHardExpired(identifier: StableDocumentIdentifier, store: Store): boolean {\n // if we are explicitly invalidated, we are hard expired\n const storeCache = this._getStore(store);\n if (storeCache.invalidated.has(identifier)) {\n return true;\n }\n const cache = store.cache;\n const cached = cache.peekRequest(identifier);\n\n if (!cached?.response) {\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(`CachePolicy: ${identifier.lid} is EXPIRED because no cache entry was found`);\n }\n return true;\n }\n\n return isExpired(identifier, cached, this.config);\n }\n\n /**\n * Invoked if `isHardExpired` is false to determine if the request\n * should be update behind the scenes if cache data is already available.\n *\n * Note, this is only invoked by the CacheHandler if the request has\n * a cache-key.\n *\n * If true, the request will be fulfilled from cache while a backgrounded\n * request is made to update the cache via the configured request handlers.\n *\n * @public\n * @param {StableDocumentIdentifier} identifier\n * @param {Store} store\n * @return {Boolean} true if the request is considered soft expired\n */\n isSoftExpired(identifier: StableDocumentIdentifier, store: Store): boolean {\n if (TESTING) {\n if (!this.config.disableTestOptimization) {\n return false;\n }\n }\n const cache = store.cache;\n const cached = cache.peekRequest(identifier);\n\n if (cached?.response) {\n const date = cached.response.headers.get('date');\n\n if (!date) {\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(`CachePolicy: ${identifier.lid} is STALE because no date header was found`);\n }\n return true;\n } else {\n const time = new Date(date).getTime();\n const now = Date.now();\n const deadline = time + this.config.apiCacheSoftExpires;\n const result = now >= deadline;\n\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(\n `CachePolicy: ${identifier.lid} is ${result ? 'STALE' : 'NOT stale'}. Expiration time: ${deadline}, now: ${now}`\n );\n }\n\n return result;\n }\n }\n\n if (LOG_CACHE_POLICY) {\n // eslint-disable-next-line no-console\n console.log(`CachePolicy: ${identifier.lid} is STALE because no cache entry was found`);\n }\n\n return true;\n }\n}\n"],"names":["NUMERIC_KEYS","Set","parseCacheControl","header","CACHE_CONTROL_CACHE","get","LRUCache","key","value","isParsingKey","cacheControlValue","i","length","char","charAt","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","has","parseCacheControlValue","stringToParse","parsedValue","Number","parseInt","isNaN","isExpired","identifier","request","config","constraints","result","activeLogging","LOG_CACHE_POLICY","debug","globalThis","getWarpDriveRuntimeConfig","console","log","lid","headers","response","now","Date","date","xWarpDriveExpires","expirationTime","getTime","cacheControl","age","maxAge","ageValue","dateValue","Expires","expires","apiCacheHardExpires","TESTING","disableTestOptimization","apiCacheSoftExpires","time","deadline","DefaultCachePolicy","_getStore","store","set","_stores","invalidated","types","Map","constructor","WeakMap","_config","arguments","deprecate","id","since","enabled","available","for","until","invalidateRequest","add","invalidateRequestsForType","type","storeCache","notifications","forEach","notify","didRequest","op","statusNumber","status","records","map","r","additionalTypes","cacheOptions","delete","isHardExpired","cache","cached","peekRequest","isSoftExpired"],"mappings":";;;;AAmEA,MAAMA,YAAY,GAAG,IAAIC,GAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,wBAAwB,CAAC,CAAC;;AAEjG;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,SAASC,iBAAiBA,CAACC,MAAc,EAAqB;AACnE,EAAA,OAAOC,mBAAmB,CAACC,GAAG,CAACF,MAAM,CAAC;AACxC;AAEA,MAAMC,mBAAmB,GAAG,IAAIE,QAAQ,CAAEH,MAAc,IAAK;EAC3D,IAAII,GAAoB,GAAG,EAAqB;EAChD,IAAIC,KAAK,GAA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ED,QAAA,OAAOX,MAAM;AACf;AACF;IAEA,IAAAnB,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAkB,aAAA,CAAAC,gBAAA,CAAA,EAAA;AAAA,MAAA,IAAApB,eAAA,EAAA,CAAAC,SAAA,CAAAoB,KAAA,CAAAD,gBAAA,IAAAE,UAAA,CAAAC,yBAAA,EAAA,CAAAF,KAAA,CAAAD,gBAAA,EAAsB;AACpB;QACAI,OAAO,CAACC,GAAG,CAAC,CAAA,aAAA,EAAgBX,UAAU,CAACY,GAAG,4CAA4C,CAAC;AACzF;AAAC;AAED,IAAA,OAAO,IAAI;AACb;AACF;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbols-epHW0Vm9.js","sources":["../src/reactive/-private/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '../../types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE = getOrSetGlobal('SOURCE', Symbol('#source'));\nexport const MUTATE = getOrSetGlobal('MUTATE', Symbol('#update'));\n\nexport const Destroy = getOrSetGlobal('Destroy', Symbol('Destroy'));\nexport const Identifier = getOrSetGlobal('Identifier', Symbol('Identifier'));\nexport const Editable = getOrSetGlobal('Editable', Symbol('Editable'));\nexport const Parent = getOrSetGlobal('Parent', Symbol('Parent'));\nexport const Checkout = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Legacy = getOrSetGlobal('Legacy', Symbol('Legacy'));\n\nexport const EmbeddedPath = getOrSetGlobal('EmbeddedPath', Symbol('EmbeddedPath'));\nexport const EmbeddedField = getOrSetGlobal('EmbeddedField', Symbol('EmbeddedField'));\n"],"names":["SOURCE","getOrSetGlobal","Symbol","Destroy","Identifier","Editable","Parent","Checkout","Legacy","EmbeddedPath","EmbeddedField"],"mappings":";;AAAA;AACA;AACA;;;AAIA;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;;AAEO,MAAMA,MAAM,GAAGC,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,SAAS,CAAC;AAC1CD,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,SAAS,CAAC;AAEzD,MAAMC,OAAO,GAAGF,cAAc,CAAC,SAAS,EAAEC,MAAM,CAAC,SAAS,CAAC;AAC3D,MAAME,UAAU,GAAGH,cAAc,CAAC,YAAY,EAAEC,MAAM,CAAC,YAAY,CAAC;AACpE,MAAMG,QAAQ,GAAGJ,cAAc,CAAC,UAAU,EAAEC,MAAM,CAAC,UAAU,CAAC;AAC9D,MAAMI,MAAM,GAAGL,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,QAAQ,CAAC;AACxD,MAAMK,QAAQ,GAAGN,cAAc,CAAC,UAAU,EAAEC,MAAM,CAAC,UAAU,CAAC;AAC9D,MAAMM,MAAM,GAAGP,cAAc,CAAC,QAAQ,EAAEC,MAAM,CAAC,QAAQ,CAAC;AAExD,MAAMO,YAAY,GAAGR,cAAc,CAAC,cAAc,EAAEC,MAAM,CAAC,cAAc,CAAC;AAC1E,MAAMQ,aAAa,GAAGT,cAAc,CAAC,eAAe,EAAEC,MAAM,CAAC,eAAe,CAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"-private.js","sources":["../../src/types/-private.ts"],"sourcesContent":["// in testing mode, we utilize globals to ensure only one copy exists of\n// these maps, due to bugs in ember-auto-import\nimport { DEBUG, TESTING } from '@warp-drive/core/build-config/env';\n\nimport { name, version } from '../../package.json';\n\ntype UniversalTransientKey =\n // @ember-data/request\n 'REQ_ID';\n\ntype UniversalKey =\n | `(transient) ${UniversalTransientKey}`\n // @ember-data/request\n | 'RequestMap'\n | 'PromiseCache'\n | 'RequestCache'\n // @warp-drive/core-types/request\n | 'SkipCache'\n | 'EnableHydration'\n // @warp-drive/core-types/runtime\n | 'WarpDriveRuntimeConfig';\n\ntype TransientKey =\n // @ember-data/graph\n | 'transactionRef'\n // @ember-data/store\n | 'configuredGenerationMethod'\n | 'configuredUpdateMethod'\n | 'configuredForgetMethod'\n | 'configuredResetMethod'\n | 'configuredKeyInfoMethod'\n | 'signalHooks';\n\ntype GlobalKey =\n | `(transient) ${TransientKey}`\n // @ember-data/adapter\n | 'AdapterError'\n | 'InvalidError'\n | 'TimeoutError'\n | 'AbortError'\n | 'UnauthorizedError'\n | 'ForbiddenError'\n | 'NotFoundError'\n | 'ConflictError'\n | 'ServerError'\n // @ember-data/store/reactivity\n | '#{}'\n | '#[]'\n | 'Signals'\n // @ember-data/store LegacySupport\n | 'AvailableShims'\n // @ember-data/store RecordArrayManager\n | 'FAKE_ARR'\n // @ember-data/store IdentifierArray\n | '#source'\n | '#update'\n | '#notify'\n | 'IS_COLLECTION'\n // @ember-data/store RequestCache\n | 'Touching'\n | 'RequestPromise'\n // @ember-data/legacy-compat FetchManager\n | 'SaveOp'\n // @ember-data/model\n | 'LEGACY_SUPPORT'\n | 'LegacySupport'\n // @ember-data/graph\n | 'Graphs'\n // @ember-data/request\n | 'IS_FROZEN'\n | 'IS_CACHE_HANDLER'\n // @ember-data/request-utils\n | 'CONFIG'\n // @ember-data/store IdentityCache\n | 'DEBUG_MAP'\n | 'IDENTIFIERS'\n | 'DOCUMENTS'\n // @ember-data/store InstanceCache\n | 'CacheForIdentifierCache'\n | 'RecordCache'\n | 'StoreMap'\n // @warp-drive/core-types/symbols\n | 'Store'\n | '$type'\n | 'TransformName'\n | 'RequestSignature'\n // @warp-drive/core-types/request\n | 'IS_FUTURE'\n | 'DOC'\n // @warp-drive/schema-record\n | 'ManagedArrayMap'\n | 'ManagedObjectMap'\n | 'Support'\n | 'SOURCE'\n | 'MUTATE'\n | 'Destroy'\n | 'Identifier'\n | 'Editable'\n | 'EmbeddedPath'\n | 'EmbeddedField'\n | 'Parent'\n | 'Checkout'\n | 'Legacy';\n\ntype ModuleScopedCaches = Record<GlobalKey, unknown>;\n\nconst GlobalRef = globalThis as unknown as Record<\n string,\n {\n __warpDrive_ModuleScopedCaches?: ModuleScopedCaches;\n __warpDrive_hasOtherCopy?: boolean;\n __version: string;\n }\n> & {\n __warpDrive_universalCache: Record<UniversalKey, unknown>;\n};\nconst UniversalCache = (GlobalRef.__warpDrive_universalCache =\n GlobalRef.__warpDrive_universalCache ?? ({} as Record<UniversalKey, unknown>));\n\n// in order to support mirror packages, we ensure that each\n// unique package name has its own global cache\nGlobalRef[name] = GlobalRef[name] ?? { __version: version };\nconst GlobalSink = GlobalRef[name];\n\nif (DEBUG) {\n if (GlobalSink.__version !== version) {\n throw new Error('Multiple versions of WarpDrive detected, the application will malfunction.');\n }\n}\n\nconst ModuleScopedCaches = GlobalSink.__warpDrive_ModuleScopedCaches ?? ({} as ModuleScopedCaches);\nif (TESTING) {\n if (!GlobalSink.__warpDrive_ModuleScopedCaches) {\n GlobalSink.__warpDrive_ModuleScopedCaches = ModuleScopedCaches;\n } else {\n // eslint-disable-next-line no-console\n console.warn(`\nMultiple copies of WarpDrive have been detected. This may be due to a bug in ember-auto-import\n in which test assets get their own copy of some v2-addons. This can cause the application to\n malfunction as each copy will maintain its own separate state.`);\n }\n} else {\n if (GlobalSink.__warpDrive_hasOtherCopy) {\n throw new Error('Multiple copies of WarpDrive detected, the application will malfunction.');\n }\n GlobalSink.__warpDrive_hasOtherCopy = true;\n}\n\ntype UniqueSymbol<T extends string> = `___(unique) Symbol(${T})`;\ntype UniqueSymbolOr<T, K extends string> = T extends symbol ? UniqueSymbol<K> : T;\n\nexport function getOrSetGlobal<T, K extends GlobalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = ModuleScopedCaches[key];\n if (existing === undefined) {\n return (ModuleScopedCaches[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\nexport function peekTransient<T>(key: TransientKey): T | null {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] as T) ?? null;\n}\n\nexport function setTransient<T>(key: TransientKey, value: T): T {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] = value);\n}\n\nexport function getOrSetUniversal<T, K extends UniversalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = UniversalCache[key];\n if (existing === undefined) {\n return (UniversalCache[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\nexport function peekUniversalTransient<T>(key: UniversalTransientKey): T | null {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] as T) ?? null;\n}\n\nexport function setUniversalTransient<T>(key: UniversalTransientKey, value: T): T {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] = value);\n}\n"],"names":["GlobalRef","globalThis","UniversalCache","__warpDrive_universalCache","name","__version","version","GlobalSink","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","Error","ModuleScopedCaches","__warpDrive_ModuleScopedCaches","TESTING","console","warn","__warpDrive_hasOtherCopy","getOrSetGlobal","key","value","existing","undefined","peekTransient","globalKey","setTransient","getOrSetUniversal","peekUniversalTransient","setUniversalTransient"],"mappings":";;;;;AAAA;AACA;;AAyGA,MAAMA,SAAS,GAAGC,UASjB;AACD,MAAMC,cAAc,GAAIF,SAAS,CAACG,0BAA0B,GAC1DH,SAAS,CAACG,0BAA0B,IAAK,EAAqC;;AAEhF;AACA;AACAH,SAAS,CAACI,IAAI,CAAC,GAAGJ,SAAS,CAACI,IAAI,CAAC,IAAI;AAAEC,EAAAA,SAAS,EAAEC;AAAQ,CAAC;AAC3D,MAAMC,UAAU,GAAGP,SAAS,CAACI,IAAI,CAAC;AAElC,IAAAI,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAW,EAAA;AACT,EAAA,IAAIL,UAAU,CAACF,SAAS,KAAKC,OAAO,EAAE;AACpC,IAAA,MAAM,IAAIO,KAAK,CAAC,4EAA4E,CAAC;AAC/F;AACF;AAEA,MAAMC,kBAAkB,GAAGP,UAAU,CAACQ,8BAA8B,IAAK,EAAyB;AAClG,IAAAP,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,GAAA,CAAAK,OAAA,CAAa,EAAA;AACX,EAAA,IAAI,CAACT,UAAU,CAACQ,8BAA8B,EAAE;IAC9CR,UAAU,CAACQ,8BAA8B,GAAGD,kBAAkB;AAChE,GAAC,MAAM;AACL;IACAG,OAAO,CAACC,IAAI,CAAC;AACjB;AACA;AACA,gEAAA,CAAiE,CAAC;AAChE;AACF,CAAC,MAAM;EACL,IAAIX,UAAU,CAACY,wBAAwB,EAAE;AACvC,IAAA,MAAM,IAAIN,KAAK,CAAC,0EAA0E,CAAC;AAC7F;EACAN,UAAU,CAAC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sBA,CAAIR,GAA0B,EAAY;AAC9E,EAAA,MAAMK,SAAiD,GAAG,CAAeL,YAAAA,EAAAA,GAAG,CAAE,CAAA;AAC9E,EAAA,OAAQnB,cAAc,CAACwB,SAAS,CAAC,IAAU,IAAI;AACjD;AAEO,SAASI,qBAAqBA,CAAIT,GAA0B,EAAEC,KAAQ,EAAK;AAChF,EAAA,MAAMI,SAAiD,GAAG,CAAeL,YAAAA,EAAAA,GAAG,CAAE,CAAA;AAC9E,EAAA,OAAQnB,cAAc,CAACwB,SAAS,CAAC,GAAGJ,KAAK;AAC3C;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aliases.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"change.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -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/core/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 WarpDrive\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, 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 * WarpDrive 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, Value } 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 * @public\n */\nexport interface GenericField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'field';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * the name of the transform to use, if any\n *\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 * @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 raw data for the field.~~ (not yet implemented)\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 * @public\n */\nexport interface LegacyAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\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 raw data for the field.~~ (not yet implemented)\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 * @public\n */\nexport interface PolarisAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\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 * @public\n */\nexport interface ObjectAliasField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'alias';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * Always null (for now)\n *\n * @public\n */\n type: null; // should always be null\n\n /**\n * The field def for which this is an alias.\n *\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 * @public\n */\nexport interface IdentityField {\n /**\n * The kind of field this is.\n *\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 * @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 * @public\n */\nexport interface HashField {\n /**\n * The kind of field this is.\n *\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 * @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 * @public\n */\n type: string;\n\n /**\n * Any options that should be provided to the hash\n * function.\n *\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 ReactiveResource 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 * @public\n */\nexport interface LocalField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: '@local';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n /**\n * Not currently utilized, we are considering\n * allowing transforms to operate on local fields\n *\n * @public\n */\n type?: string;\n\n /**\n * Options for the field.\n *\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 * @public\n */\nexport interface ObjectField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'object';\n\n /**\n * The name of the field.\n *\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 * @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 * @public\n */\n options?: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousObjectExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\n [key: string]: Value | undefined;\n };\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 * @public\n */\nexport interface SchemaObjectField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'schema-object';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n\n /**\n * The name of the ObjectSchema that describes the\n * structure of the object.\n *\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 * @public\n */\n options?: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousObjectExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\n /**\n * Whether this SchemaObject is Polymorphic.\n *\n * If the SchemaObject is polymorphic, `options.type` must also be supplied.\n *\n * @public\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 * @public\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 * @public\n */\nexport interface ArrayField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'array';\n\n /**\n * The name of the field.\n *\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 * @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 * @public\n */\n options?: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousArrayExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n\n [key: string]: Value | undefined;\n };\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 * @public\n */\nexport interface SchemaArrayField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'schema-array';\n\n /**\n * The name of the field.\n *\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 * @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 * @public\n */\n options?: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousArrayExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousObjectExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\n\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 * @public\n */\nexport interface DerivedField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'derived';\n\n /**\n * The name of the field.\n *\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 * @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 * @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 ReactiveResource\n *\n * @public\n */\nexport interface ResourceField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'resource';\n\n /**\n * The name of the field.\n *\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 * @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 * @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 * @public\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 * @public\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 * @public\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 * @public\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 ReactiveResource\n *\n * @public\n */\nexport interface CollectionField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'collection';\n\n /**\n * The name of the field.\n *\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 * @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 * @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 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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\n */\nexport interface LegacyAttributeField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'attribute';\n\n /**\n * The name of the field.\n *\n * @public\n */\n name: string;\n /**\n * The name of the transform to use, if any\n *\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 * @public\n */\nexport interface LegacyBelongsToField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'belongsTo';\n\n /**\n * The name of the field.\n *\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 * @public\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\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 * or a pointer that can be used to fetch\n * the related resource when needed.\n *\n * Pointers are highly discouraged.\n *\n * @public\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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\n */\nexport interface LinksModeBelongsToField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'belongsTo';\n\n /**\n * The name of the field.\n *\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 * @public\n */\n type: string;\n\n /**\n * Options for belongsTo are mandatory.\n *\n * @public\n */\n options: {\n /**\n * Whether the relationship is async\n *\n * MUST be false for PolarisMode + LinksMode\n *\n * @public\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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\n */\nexport interface LegacyHasManyField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'hasMany';\n\n /**\n * The name of the field.\n *\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 * @public\n */\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n * @public\n */\n options: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousArrayExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\n\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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\n */\nexport interface LinksModeHasManyField {\n /**\n * The kind of field this is.\n *\n * @public\n */\n kind: 'hasMany';\n\n /**\n * The name of the field.\n *\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 * @public\n */\n type: string;\n\n /**\n * Options for hasMany are mandatory.\n *\n * @public\n */\n options: {\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this array is allowed to use.\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousArrayExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to arrays to support migrating away from deprecated behaviors\n * such as Ember's \"ArrayLike\" and FragmentArray from ember-data-model-fragments\n */\n arrayExtensions?: string[];\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 * @public\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 * @public\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 * @public\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 * @public\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 * @public\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 * @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 * @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 * @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 * @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 * @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 * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\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 * @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 * @public\n */\nexport interface LegacyResourceSchema {\n /**\n * A flag indicating that this is a legacy resource schema\n *\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 * @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 * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the resource\n *\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 * @public\n */\n traits?: string[];\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this resource should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousObjectExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: 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 * @public\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 * @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 * @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 * @public\n */\n type: string;\n\n /**\n * The fields that make up the shape of the object\n *\n * @public\n */\n fields: ObjectFieldSchema[];\n\n /**\n * ::: warning ⚠️ Dangerous Feature Ahead\n * :::\n *\n * Configures which extensions this object should use.\n *\n * Extensions are registered with the store's schema service\n * via {@link SchemaService.registerDangerousObjectExtension}\n *\n * Extensions should only be used for temporary enhancements\n * to objects to support migrating away from deprecated patterns\n * like custom getters, computeds, and methods\n */\n objectExtensions?: string[];\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 * @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 * @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 * @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 * @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;;AAkCA;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;;AAyCA;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;;AAwCA;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;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsCA;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;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA6HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoJA;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;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA0DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA2EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuDA;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;AACO,SAASC,YAAYA,CAAyBD,MAAS,EAAK;AACjE,EAAA,OAAOA,MAAM;AACf;;AAEA;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;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/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/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":""}
|
package/dist/utils/string.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sources":["../../src/utils/string.ts"],"sourcesContent":["import { DEBUG } from '@warp-drive/core/build-config/env';\n\nconst DEFAULT_MAX_CACHE_SIZE = 10_000;\n\n/**\n * An LRUCache implementation with upsert semantics.\n *\n * This implementation is *not* generic, but focuses on\n * performance tuning for the string transformation cases\n * where the key maps to the value very simply.\n *\n * It takes a work function that should generate a new value\n * for a given key when called. It will be called when the key\n * is not found in the cache.\n *\n * It keeps track of the number of hits, misses, and ejections\n * in DEBUG envs, which is useful for tuning the cache size.\n *\n * This is an internal utility class for use by this module\n * and by `@warp-drive/utilities/string`. It is not intended\n * for use outside of these modules at this time.\n *\n * @internal\n */\nexport class LRUCache<T, V> {\n declare size: number;\n declare state: Map<T, V>;\n declare doWork: (k: T) => V;\n\n // debug stats\n declare _hits: number;\n declare _misses: number;\n declare _ejected: number;\n\n constructor(doWork: (k: T) => V, size?: number) {\n this.size = size || DEFAULT_MAX_CACHE_SIZE;\n this.state = new Map();\n this.doWork = doWork;\n\n if (DEBUG) {\n this._hits = 0;\n this._misses = 0;\n this._ejected = 0;\n }\n }\n\n get(key: T) {\n const value = this.state.get(key);\n if (value) {\n if (DEBUG) {\n this._hits++;\n }\n this.state.delete(key);\n this.state.set(key, value);\n return value;\n }\n if (DEBUG) {\n this._misses++;\n }\n\n const newValue = this.doWork(key);\n this.set(key, newValue);\n return newValue;\n }\n\n set(key: T, value: V) {\n if (this.state.size === this.size) {\n for (const [k] of this.state) {\n if (DEBUG) {\n this._ejected++;\n }\n this.state.delete(k);\n break;\n }\n }\n this.state.set(key, value);\n }\n\n clear() {\n this.state.clear();\n if (DEBUG) {\n this._hits = 0;\n this._misses = 0;\n this._ejected = 0;\n }\n }\n}\n\nconst STRING_DASHERIZE_REGEXP = /[ _]/g;\nconst STRING_DECAMELIZE_REGEXP = /([a-z\\d])([A-Z])/g;\nexport const STRING_DASHERIZE_CACHE = new LRUCache<string, string>((key: string) =>\n key.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase().replace(STRING_DASHERIZE_REGEXP, '-')\n);\n\n/**\n * This is an internal utility function that converts a string\n * to a dasherized format. Library consumers should use the\n * re-exported version from `@warp-drive/utilities/string` instead.\n *\n * This version is only in this location to support a deprecated\n * behavior in the core package and will be removed in a future.\n *\n * @internal\n */\nexport function dasherize(str: string): string {\n return STRING_DASHERIZE_CACHE.get(str);\n}\n"],"names":["DEFAULT_MAX_CACHE_SIZE","LRUCache","constructor","doWork","size","state","Map","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","_hits","_misses","_ejected","get","key","value","delete","set","newValue","k","clear","STRING_DASHERIZE_REGEXP","STRING_DECAMELIZE_REGEXP","STRING_DASHERIZE_CACHE","replace","toLowerCase","dasherize","str"],"mappings":";;AAEA,MAAMA,sBAAsB,GAAG,MAAM;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,QAAQ,CAAO;AAK1B;;AAKAC,EAAAA,WAAWA,CAACC,MAAmB,EAAEC,IAAa,EAAE;AAC9C,IAAA,IAAI,CAACA,IAAI,GAAGA,IAAI,IAAIJ,sBAAsB;AAC1C,IAAA,IAAI,CAACK,KAAK,GAAG,IAAIC,GAAG,EAAE;IACtB,IAAI,CAACH,MAAM,GAAGA,MAAM;IAEpB,IAAAI,cAAA,CAAAC,e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