@ember-data/legacy-compat 5.4.0-alpha.74 → 5.4.0-alpha.76

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/dist/builders.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { SkipCache } from '@warp-drive/core-types/request';
2
2
  import { deprecate } from '@ember/debug';
3
- import { dasherize } from '@ember/string';
3
+ import { dasherize } from '@ember-data/request-utils/string';
4
4
  import { macroCondition, getGlobalConfig } from '@embroider/macros';
5
5
  import { ensureStringId, constructResource } from '@ember-data/store/-private';
6
6
  import { storeFor, recordIdentifierFor } from '@ember-data/store';
@@ -1 +1 @@
1
- {"version":3,"file":"builders.js","sources":["../src/builders/utils.ts","../src/builders/find-all.ts","../src/builders/find-record.ts","../src/builders/query.ts","../src/builders/save-record.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\nimport { dasherize } from '@ember/string';\n\nimport { DEPRECATE_NON_STRICT_TYPES } from '@warp-drive/build-config/deprecations';\nimport type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';\n\nexport function isMaybeIdentifier(\n maybeIdentifier: string | ResourceIdentifierObject\n): maybeIdentifier is ResourceIdentifierObject {\n return Boolean(\n maybeIdentifier !== null &&\n typeof maybeIdentifier === 'object' &&\n (('id' in maybeIdentifier && 'type' in maybeIdentifier && maybeIdentifier.id && maybeIdentifier.type) ||\n maybeIdentifier.lid)\n );\n}\n\nexport function normalizeModelName(type: string): string {\n if (DEPRECATE_NON_STRICT_TYPES) {\n const result = dasherize(type);\n\n deprecate(\n `The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`,\n result === type,\n {\n id: 'ember-data:deprecate-non-strict-types',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '5.3',\n enabled: '5.3',\n },\n }\n );\n\n return result;\n }\n\n return type;\n}\n","/**\n * @module @ember-data/legacy-compat/builders\n */\nimport type { StoreRequestInput } from '@ember-data/store';\nimport type { FindAllOptions } from '@ember-data/store/types';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';\nimport { SkipCache } from '@warp-drive/core-types/request';\nimport type { RequestSignature } from '@warp-drive/core-types/symbols';\n\nimport { normalizeModelName } from './utils';\n\ntype FindAllRequestInput<T extends string = string, RT = unknown[]> = StoreRequestInput & {\n op: 'findAll';\n data: {\n type: T;\n options: FindAllBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype FindAllBuilderOptions = FindAllOptions;\n\n/**\n This function builds a request config to perform a `findAll` request for the given type.\n When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.\n Additionally, it takes the same options as `store.findAll`.\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method findAll\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {string} type the name of the resource\n @param {object} query a query to be used by the adapter\n @param {FindAllBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.findAll\n @return {FindAllRequestInput} request config\n*/\nexport function findAllBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n options?: FindAllBuilderOptions\n): FindAllRequestInput<TypeFromInstance<T>, T[]>;\nexport function findAllBuilder(type: string, options?: FindAllBuilderOptions): FindAllRequestInput;\nexport function findAllBuilder(type: string, options: FindAllBuilderOptions = {}): FindAllRequestInput {\n assert(`You need to pass a model name to the findAll builder`, type);\n assert(\n `Model name passed to the findAll builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'findAll',\n data: {\n type: normalizeModelName(type),\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","/**\n * @module @ember-data/legacy-compat/builders\n */\nimport type { StoreRequestInput } from '@ember-data/store';\nimport { constructResource, ensureStringId } from '@ember-data/store/-private';\nimport type { BaseFinderOptions, FindRecordOptions } from '@ember-data/store/types';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';\nimport { SkipCache } from '@warp-drive/core-types/request';\nimport type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';\nimport type { RequestSignature } from '@warp-drive/core-types/symbols';\n\nimport { isMaybeIdentifier, normalizeModelName } from './utils';\n\ntype FindRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'findRecord';\n data: {\n record: ResourceIdentifierObject<T>;\n options: FindRecordBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype FindRecordBuilderOptions = Omit<FindRecordOptions, 'preload'>;\n\n/**\n This function builds a request config to find the record for a given identifier or type and id combination.\n When passed to `store.request`, this config will result in the same behavior as a `store.findRecord` request.\n Additionally, it takes the same options as `store.findRecord`, with the exception of `preload` (which is unsupported).\n\n **Example 1**\n\n ```ts\n import { findRecord } from '@ember-data/legacy-compat/builders';\n const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));\n ```\n\n **Example 2**\n\n `findRecord` can be called with a single identifier argument instead of the combination\n of `type` (modelName) and `id` as separate arguments. You may recognize this combo as\n the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)\n\n ```ts\n import { findRecord } from '@ember-data/legacy-compat/builders';\n const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));\n ```\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method findRecord\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {string|object} type - either a string representing the name of the resource or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record\n @param {string|number|object} id - optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved\n @param {FindRecordBuilderOptions} [options] - if the first param is a string this will be the optional options for the request. See examples for available options.\n @return {FindRecordRequestInput} request config\n*/\nexport function findRecordBuilder<T extends TypedRecordInstance>(\n resource: TypeFromInstance<T>,\n id: string,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput<TypeFromInstance<T>, T>;\nexport function findRecordBuilder(\n resource: string,\n id: string,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput;\nexport function findRecordBuilder<T extends TypedRecordInstance>(\n resource: ResourceIdentifierObject<TypeFromInstance<T>>,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput<TypeFromInstance<T>, T>;\nexport function findRecordBuilder(\n resource: ResourceIdentifierObject,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput;\nexport function findRecordBuilder(\n resource: string | ResourceIdentifierObject,\n idOrOptions?: string | FindRecordBuilderOptions,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput {\n assert(\n `You need to pass a modelName or resource identifier as the first argument to the findRecord builder`,\n resource\n );\n if (isMaybeIdentifier(resource)) {\n options = idOrOptions as BaseFinderOptions | undefined;\n } else {\n assert(\n `You need to pass a modelName or resource identifier as the first argument to the findRecord builder (passed ${resource})`,\n typeof resource === 'string'\n );\n const type = normalizeModelName(resource);\n const normalizedId = ensureStringId(idOrOptions as string | number);\n resource = constructResource(type, normalizedId);\n }\n\n options = options || {};\n\n assert('findRecord builder does not support options.preload', !(options as FindRecordOptions).preload);\n\n return {\n op: 'findRecord' as const,\n data: {\n record: resource,\n options,\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","/**\n * @module @ember-data/legacy-compat/builders\n */\nimport type { StoreRequestInput } from '@ember-data/store';\nimport type { QueryOptions } from '@ember-data/store/types';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';\nimport { SkipCache } from '@warp-drive/core-types/request';\nimport type { RequestSignature } from '@warp-drive/core-types/symbols';\n\nimport { normalizeModelName } from './utils';\n\ntype QueryRequestInput<T extends string = string, RT = unknown[]> = StoreRequestInput & {\n op: 'query';\n data: {\n type: T;\n query: Record<string, unknown>;\n options: QueryBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype QueryBuilderOptions = QueryOptions;\n\n/**\n This function builds a request config for a given type and query object.\n When passed to `store.request`, this config will result in the same behavior as a `store.query` request.\n Additionally, it takes the same options as `store.query`.\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method query\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {string} type the name of the resource\n @param {object} query a query to be used by the adapter\n @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query\n @return {QueryRequestInput} request config\n*/\nexport function queryBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRequestInput<TypeFromInstance<T>, T[]>;\nexport function queryBuilder(\n type: string,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRequestInput;\nexport function queryBuilder(\n type: string,\n query: Record<string, unknown>,\n options: QueryBuilderOptions = {}\n): QueryRequestInput {\n assert(`You need to pass a model name to the query builder`, type);\n assert(`You need to pass a query hash to the query builder`, query);\n assert(\n `Model name passed to the query builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'query' as const,\n data: {\n type: normalizeModelName(type),\n query,\n options: options,\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n\ntype QueryRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'queryRecord';\n data: {\n type: T;\n query: Record<string, unknown>;\n options: QueryBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\n/**\n This function builds a request config for a given type and query object.\n When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.\n Additionally, it takes the same options as `store.queryRecord`.\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method queryRecord\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {string} type the name of the resource\n @param {object} query a query to be used by the adapter\n @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query\n @return {QueryRecordRequestInput} request config\n*/\nexport function queryRecordBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput<TypeFromInstance<T>, T | null>;\nexport function queryRecordBuilder(\n type: string,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput;\nexport function queryRecordBuilder(\n type: string,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput {\n assert(`You need to pass a model name to the queryRecord builder`, type);\n assert(`You need to pass a query hash to the queryRecord builder`, query);\n assert(\n `Model name passed to the queryRecord builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'queryRecord',\n data: {\n type: normalizeModelName(type),\n query,\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","/**\n * @module @ember-data/legacy-compat/builders\n */\nimport { recordIdentifierFor, storeFor, type StoreRequestInput } from '@ember-data/store';\nimport type { InstanceCache } from '@ember-data/store/-private';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { Cache } from '@warp-drive/core-types/cache';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';\nimport { SkipCache } from '@warp-drive/core-types/request';\nimport type { RequestSignature } from '@warp-drive/core-types/symbols';\n\ntype SaveRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'createRecord' | 'deleteRecord' | 'updateRecord';\n data: {\n record: StableRecordIdentifier<T>;\n options: SaveRecordBuilderOptions;\n };\n records: [StableRecordIdentifier<T>];\n [RequestSignature]?: RT;\n};\n\ntype SaveRecordBuilderOptions = Record<string, unknown>;\n\nfunction _resourceIsFullDeleted(identifier: StableRecordIdentifier, cache: Cache): boolean {\n return cache.isDeletionCommitted(identifier) || (cache.isNew(identifier) && cache.isDeleted(identifier));\n}\n\nfunction resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: StableRecordIdentifier): boolean {\n const cache = instanceCache.cache;\n return !cache || _resourceIsFullDeleted(identifier, cache);\n}\n\n/**\n This function builds a request config for saving the given record (e.g. creating, updating, or deleting the record).\n When passed to `store.request`, this config will result in the same behavior as a legacy `store.saveRecord` request.\n Additionally, it takes the same options as `store.saveRecord`.\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method saveRecord\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {object} record a record to save\n @param {SaveRecordBuilderOptions} options optional, may include `adapterOptions` hash which will be passed to adapter.saveRecord\n @return {SaveRecordRequestInput} request config\n*/\nexport function saveRecordBuilder<T extends TypedRecordInstance>(\n record: T,\n options: Record<string, unknown> = {}\n): SaveRecordRequestInput<TypeFromInstance<T>, T> {\n const store = storeFor(record);\n assert(`Unable to initiate save for a record in a disconnected state`, store);\n const identifier = recordIdentifierFor<T>(record);\n\n if (!identifier) {\n // this commonly means we're disconnected\n // but just in case we throw here to prevent bad things.\n throw new Error(`Record Is Disconnected`);\n }\n assert(\n `Cannot initiate a save request for an unloaded record: ${identifier.lid}`,\n store._instanceCache.recordIsLoaded(identifier)\n );\n if (resourceIsFullyDeleted(store._instanceCache, identifier)) {\n throw new Error('cannot build saveRecord request for deleted record');\n }\n\n if (!options) {\n options = {};\n }\n let operation: 'createRecord' | 'deleteRecord' | 'updateRecord' = 'updateRecord';\n\n const cache = store.cache;\n if (cache.isNew(identifier)) {\n operation = 'createRecord';\n } else if (cache.isDeleted(identifier)) {\n operation = 'deleteRecord';\n }\n\n return {\n op: operation,\n data: {\n options,\n record: identifier,\n },\n records: [identifier],\n cacheOptions: { [SkipCache]: true },\n };\n}\n"],"names":["isMaybeIdentifier","maybeIdentifier","Boolean","id","type","lid","normalizeModelName","macroCondition","getGlobalConfig","WarpDrive","deprecations","DEPRECATE_NON_STRICT_TYPES","result","dasherize","deprecate","until","for","since","available","enabled","findAllBuilder","options","env","DEBUG","test","Error","op","data","cacheOptions","SkipCache","findRecordBuilder","resource","idOrOptions","normalizedId","ensureStringId","constructResource","preload","record","queryBuilder","query","queryRecordBuilder","_resourceIsFullDeleted","identifier","cache","isDeletionCommitted","isNew","isDeleted","resourceIsFullyDeleted","instanceCache","saveRecordBuilder","store","storeFor","recordIdentifierFor","_instanceCache","recordIsLoaded","operation","records"],"mappings":";;;;;;;AAMO,SAASA,iBAAiBA,CAC/BC,eAAkD,EACL;AAC7C,EAAA,OAAOC,OAAO,CACZD,eAAe,KAAK,IAAI,IACtB,OAAOA,eAAe,KAAK,QAAQ,KACjC,IAAI,IAAIA,eAAe,IAAI,MAAM,IAAIA,eAAe,IAAIA,eAAe,CAACE,EAAE,IAAIF,eAAe,CAACG,IAAI,IAClGH,eAAe,CAACI,GAAG,CACzB,CAAC,CAAA;AACH,CAAA;AAEO,SAASC,kBAAkBA,CAACF,IAAY,EAAU;EACvD,IAAAG,cAAA,CAAAC,eAAA,EAAA,CAAAC,SAAA,CAAAC,YAAA,CAAAC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AA,CAAA;EAEjD,IAAIK,sBAAsB,CAACG,KAAK,CAACG,cAAc,EAAEX,UAAU,CAAC,EAAE;AAC5D,IAAA,MAAM,IAAIjB,KAAK,CAAC,oDAAoD,CAAC,CAAA;AACvE,GAAA;EAEA,IAAI,CAACJ,OAAO,EAAE;IACZA,OAAO,GAAG,EAAE,CAAA;AACd,GAAA;EACA,IAAIkC,SAA2D,GAAG,cAAc,CAAA;AAEhF,EAAA,MAAMZ,KAAK,GAAGO,KAAK,CAACP,KAAK,CAAA;AACzB,EAAA,IAAIA,KAAK,CAACE,KAAK,CAACH,UAAU,CAAC,EAAE;AAC3Ba,IAAAA,SAAS,GAAG,cAAc,CAAA;GAC3B,MAAM,IAAIZ,KAAK,CAACG,SAAS,CAACJ,UAAU,CAAC,EAAE;AACtCa,IAAAA,SAAS,GAAG,cAAc,CAAA;AAC5B,GAAA;EAEA,OAAO;AACL7B,IAAAA,EAAE,EAAE6B,SAAS;AACb5B,IAAAA,IAAI,EAAE;MACJN,OAAO;AACPgB,MAAAA,MAAM,EAAEK,UAAAA;KACT;IACDc,OAAO,EAAE,CAACd,UAAU,CAAC;AACrBd,IAAAA,YAAY,EAAE;AAAE,MAAA,CAACC,SAAS,GAAG,IAAA;AAAK,KAAA;GACnC,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"builders.js","sources":["../src/builders/utils.ts","../src/builders/find-all.ts","../src/builders/find-record.ts","../src/builders/query.ts","../src/builders/save-record.ts"],"sourcesContent":["import { deprecate } from '@ember/debug';\n\nimport { dasherize } from '@ember-data/request-utils/string';\nimport { DEPRECATE_NON_STRICT_TYPES } from '@warp-drive/build-config/deprecations';\nimport type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';\n\nexport function isMaybeIdentifier(\n maybeIdentifier: string | ResourceIdentifierObject\n): maybeIdentifier is ResourceIdentifierObject {\n return Boolean(\n maybeIdentifier !== null &&\n typeof maybeIdentifier === 'object' &&\n (('id' in maybeIdentifier && 'type' in maybeIdentifier && maybeIdentifier.id && maybeIdentifier.type) ||\n maybeIdentifier.lid)\n );\n}\n\nexport function normalizeModelName(type: string): string {\n if (DEPRECATE_NON_STRICT_TYPES) {\n const result = dasherize(type);\n\n deprecate(\n `The resource type '${type}' is not normalized. Update your application code to use '${result}' instead of '${type}'.`,\n result === type,\n {\n id: 'ember-data:deprecate-non-strict-types',\n until: '6.0',\n for: 'ember-data',\n since: {\n available: '5.3',\n enabled: '5.3',\n },\n }\n );\n\n return result;\n }\n\n return type;\n}\n","/**\n * @module @ember-data/legacy-compat/builders\n */\nimport type { StoreRequestInput } from '@ember-data/store';\nimport type { FindAllOptions } from '@ember-data/store/types';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';\nimport { SkipCache } from '@warp-drive/core-types/request';\nimport type { RequestSignature } from '@warp-drive/core-types/symbols';\n\nimport { normalizeModelName } from './utils';\n\ntype FindAllRequestInput<T extends string = string, RT = unknown[]> = StoreRequestInput & {\n op: 'findAll';\n data: {\n type: T;\n options: FindAllBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype FindAllBuilderOptions = FindAllOptions;\n\n/**\n This function builds a request config to perform a `findAll` request for the given type.\n When passed to `store.request`, this config will result in the same behavior as a `store.findAll` request.\n Additionally, it takes the same options as `store.findAll`.\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method findAll\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {string} type the name of the resource\n @param {object} query a query to be used by the adapter\n @param {FindAllBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.findAll\n @return {FindAllRequestInput} request config\n*/\nexport function findAllBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n options?: FindAllBuilderOptions\n): FindAllRequestInput<TypeFromInstance<T>, T[]>;\nexport function findAllBuilder(type: string, options?: FindAllBuilderOptions): FindAllRequestInput;\nexport function findAllBuilder(type: string, options: FindAllBuilderOptions = {}): FindAllRequestInput {\n assert(`You need to pass a model name to the findAll builder`, type);\n assert(\n `Model name passed to the findAll builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'findAll',\n data: {\n type: normalizeModelName(type),\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","/**\n * @module @ember-data/legacy-compat/builders\n */\nimport type { StoreRequestInput } from '@ember-data/store';\nimport { constructResource, ensureStringId } from '@ember-data/store/-private';\nimport type { BaseFinderOptions, FindRecordOptions } from '@ember-data/store/types';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';\nimport { SkipCache } from '@warp-drive/core-types/request';\nimport type { ResourceIdentifierObject } from '@warp-drive/core-types/spec/json-api-raw';\nimport type { RequestSignature } from '@warp-drive/core-types/symbols';\n\nimport { isMaybeIdentifier, normalizeModelName } from './utils';\n\ntype FindRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'findRecord';\n data: {\n record: ResourceIdentifierObject<T>;\n options: FindRecordBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype FindRecordBuilderOptions = Omit<FindRecordOptions, 'preload'>;\n\n/**\n This function builds a request config to find the record for a given identifier or type and id combination.\n When passed to `store.request`, this config will result in the same behavior as a `store.findRecord` request.\n Additionally, it takes the same options as `store.findRecord`, with the exception of `preload` (which is unsupported).\n\n **Example 1**\n\n ```ts\n import { findRecord } from '@ember-data/legacy-compat/builders';\n const { content: post } = await store.request<Post>(findRecord<Post>('post', '1'));\n ```\n\n **Example 2**\n\n `findRecord` can be called with a single identifier argument instead of the combination\n of `type` (modelName) and `id` as separate arguments. You may recognize this combo as\n the typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)\n\n ```ts\n import { findRecord } from '@ember-data/legacy-compat/builders';\n const { content: post } = await store.request<Post>(findRecord<Post>({ type: 'post', id }));\n ```\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method findRecord\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {string|object} type - either a string representing the name of the resource or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record\n @param {string|number|object} id - optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved\n @param {FindRecordBuilderOptions} [options] - if the first param is a string this will be the optional options for the request. See examples for available options.\n @return {FindRecordRequestInput} request config\n*/\nexport function findRecordBuilder<T extends TypedRecordInstance>(\n resource: TypeFromInstance<T>,\n id: string,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput<TypeFromInstance<T>, T>;\nexport function findRecordBuilder(\n resource: string,\n id: string,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput;\nexport function findRecordBuilder<T extends TypedRecordInstance>(\n resource: ResourceIdentifierObject<TypeFromInstance<T>>,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput<TypeFromInstance<T>, T>;\nexport function findRecordBuilder(\n resource: ResourceIdentifierObject,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput;\nexport function findRecordBuilder(\n resource: string | ResourceIdentifierObject,\n idOrOptions?: string | FindRecordBuilderOptions,\n options?: FindRecordBuilderOptions\n): FindRecordRequestInput {\n assert(\n `You need to pass a modelName or resource identifier as the first argument to the findRecord builder`,\n resource\n );\n if (isMaybeIdentifier(resource)) {\n options = idOrOptions as BaseFinderOptions | undefined;\n } else {\n assert(\n `You need to pass a modelName or resource identifier as the first argument to the findRecord builder (passed ${resource})`,\n typeof resource === 'string'\n );\n const type = normalizeModelName(resource);\n const normalizedId = ensureStringId(idOrOptions as string | number);\n resource = constructResource(type, normalizedId);\n }\n\n options = options || {};\n\n assert('findRecord builder does not support options.preload', !(options as FindRecordOptions).preload);\n\n return {\n op: 'findRecord' as const,\n data: {\n record: resource,\n options,\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","/**\n * @module @ember-data/legacy-compat/builders\n */\nimport type { StoreRequestInput } from '@ember-data/store';\nimport type { QueryOptions } from '@ember-data/store/types';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';\nimport { SkipCache } from '@warp-drive/core-types/request';\nimport type { RequestSignature } from '@warp-drive/core-types/symbols';\n\nimport { normalizeModelName } from './utils';\n\ntype QueryRequestInput<T extends string = string, RT = unknown[]> = StoreRequestInput & {\n op: 'query';\n data: {\n type: T;\n query: Record<string, unknown>;\n options: QueryBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\ntype QueryBuilderOptions = QueryOptions;\n\n/**\n This function builds a request config for a given type and query object.\n When passed to `store.request`, this config will result in the same behavior as a `store.query` request.\n Additionally, it takes the same options as `store.query`.\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method query\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {string} type the name of the resource\n @param {object} query a query to be used by the adapter\n @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query\n @return {QueryRequestInput} request config\n*/\nexport function queryBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRequestInput<TypeFromInstance<T>, T[]>;\nexport function queryBuilder(\n type: string,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRequestInput;\nexport function queryBuilder(\n type: string,\n query: Record<string, unknown>,\n options: QueryBuilderOptions = {}\n): QueryRequestInput {\n assert(`You need to pass a model name to the query builder`, type);\n assert(`You need to pass a query hash to the query builder`, query);\n assert(\n `Model name passed to the query builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'query' as const,\n data: {\n type: normalizeModelName(type),\n query,\n options: options,\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n\ntype QueryRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'queryRecord';\n data: {\n type: T;\n query: Record<string, unknown>;\n options: QueryBuilderOptions;\n };\n [RequestSignature]?: RT;\n};\n\n/**\n This function builds a request config for a given type and query object.\n When passed to `store.request`, this config will result in the same behavior as a `store.queryRecord` request.\n Additionally, it takes the same options as `store.queryRecord`.\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method queryRecord\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {string} type the name of the resource\n @param {object} query a query to be used by the adapter\n @param {QueryBuilderOptions} [options] optional, may include `adapterOptions` hash which will be passed to adapter.query\n @return {QueryRecordRequestInput} request config\n*/\nexport function queryRecordBuilder<T extends TypedRecordInstance>(\n type: TypeFromInstance<T>,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput<TypeFromInstance<T>, T | null>;\nexport function queryRecordBuilder(\n type: string,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput;\nexport function queryRecordBuilder(\n type: string,\n query: Record<string, unknown>,\n options?: QueryBuilderOptions\n): QueryRecordRequestInput {\n assert(`You need to pass a model name to the queryRecord builder`, type);\n assert(`You need to pass a query hash to the queryRecord builder`, query);\n assert(\n `Model name passed to the queryRecord builder must be a dasherized string instead of ${type}`,\n typeof type === 'string'\n );\n\n return {\n op: 'queryRecord',\n data: {\n type: normalizeModelName(type),\n query,\n options: options || {},\n },\n cacheOptions: { [SkipCache]: true },\n };\n}\n","/**\n * @module @ember-data/legacy-compat/builders\n */\nimport { recordIdentifierFor, storeFor, type StoreRequestInput } from '@ember-data/store';\nimport type { InstanceCache } from '@ember-data/store/-private';\nimport { assert } from '@warp-drive/build-config/macros';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\nimport type { Cache } from '@warp-drive/core-types/cache';\nimport type { TypedRecordInstance, TypeFromInstance } from '@warp-drive/core-types/record';\nimport { SkipCache } from '@warp-drive/core-types/request';\nimport type { RequestSignature } from '@warp-drive/core-types/symbols';\n\ntype SaveRecordRequestInput<T extends string = string, RT = unknown> = StoreRequestInput & {\n op: 'createRecord' | 'deleteRecord' | 'updateRecord';\n data: {\n record: StableRecordIdentifier<T>;\n options: SaveRecordBuilderOptions;\n };\n records: [StableRecordIdentifier<T>];\n [RequestSignature]?: RT;\n};\n\ntype SaveRecordBuilderOptions = Record<string, unknown>;\n\nfunction _resourceIsFullDeleted(identifier: StableRecordIdentifier, cache: Cache): boolean {\n return cache.isDeletionCommitted(identifier) || (cache.isNew(identifier) && cache.isDeleted(identifier));\n}\n\nfunction resourceIsFullyDeleted(instanceCache: InstanceCache, identifier: StableRecordIdentifier): boolean {\n const cache = instanceCache.cache;\n return !cache || _resourceIsFullDeleted(identifier, cache);\n}\n\n/**\n This function builds a request config for saving the given record (e.g. creating, updating, or deleting the record).\n When passed to `store.request`, this config will result in the same behavior as a legacy `store.saveRecord` request.\n Additionally, it takes the same options as `store.saveRecord`.\n\n All `@ember-data/legacy-compat` builders exist to enable you to migrate your codebase to using the correct syntax for `store.request` while temporarily preserving legacy behaviors.\n This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.\n To that end, these builders are deprecated and will be removed in a future version of Ember Data.\n\n @method saveRecord\n @deprecated\n @public\n @static\n @for @ember-data/legacy-compat/builders\n @param {object} record a record to save\n @param {SaveRecordBuilderOptions} options optional, may include `adapterOptions` hash which will be passed to adapter.saveRecord\n @return {SaveRecordRequestInput} request config\n*/\nexport function saveRecordBuilder<T extends TypedRecordInstance>(\n record: T,\n options: Record<string, unknown> = {}\n): SaveRecordRequestInput<TypeFromInstance<T>, T> {\n const store = storeFor(record);\n assert(`Unable to initiate save for a record in a disconnected state`, store);\n const identifier = recordIdentifierFor<T>(record);\n\n if (!identifier) {\n // this commonly means we're disconnected\n // but just in case we throw here to prevent bad things.\n throw new Error(`Record Is Disconnected`);\n }\n assert(\n `Cannot initiate a save request for an unloaded record: ${identifier.lid}`,\n store._instanceCache.recordIsLoaded(identifier)\n );\n if (resourceIsFullyDeleted(store._instanceCache, identifier)) {\n throw new Error('cannot build saveRecord request for deleted record');\n }\n\n if (!options) {\n options = {};\n }\n let operation: 'createRecord' | 'deleteRecord' | 'updateRecord' = 'updateRecord';\n\n const cache = store.cache;\n if (cache.isNew(identifier)) {\n operation = 'createRecord';\n } else if (cache.isDeleted(identifier)) {\n operation = 'deleteRecord';\n }\n\n return {\n op: operation,\n data: {\n options,\n record: identifier,\n },\n records: [identifier],\n cacheOptions: { [SkipCache]: true },\n };\n}\n"],"names":["isMaybeIdentifier","maybeIdentifier","Boolean","id","type","lid","normalizeModelName","macroCondition","getGlobalConfig","WarpDrive","deprecations","DEPRECATE_NON_STRICT_TYPES","result","dasherize","deprecate","until","for","since","available","enabled","findAllBuilder","options","env","DEBUG","test","Error","op","data","cacheOptions","SkipCache","findRecordBuilder","resource","idOrOptions","normalizedId","ensureStringId","constructResource","preload","record","queryBuilder","query","queryRecordBuilder","_resourceIsFullDeleted","identifier","cache","isDeletionCommitted","isNew","isDeleted","resourceIsFullyDeleted","instanceCache","saveRecordBuilder","store","storeFor","recordIdentifierFor","_instanceCache","recordIsLoaded","operation","records"],"mappings":";;;;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@
1
- import { dasherize } from '@ember/string';
2
- import { macroCondition, dependencySatisfies, importSync, getGlobalConfig } from '@embroider/macros';
1
+ import { singularize, dasherize } from '@ember-data/request-utils/string';
2
+ import { macroCondition, getGlobalConfig } from '@embroider/macros';
3
3
 
4
4
  /**
5
5
  Utilities for helping to migrate to stricter
@@ -9,10 +9,6 @@ import { macroCondition, dependencySatisfies, importSync, getGlobalConfig } from
9
9
  @main @ember-data/legacy-compat/utils
10
10
  @deprecated
11
11
  */
12
- let singularize;
13
- if (macroCondition(dependencySatisfies('ember-inflector', '*'))) {
14
- singularize = importSync('ember-inflector').singularize;
15
- }
16
12
  let MismatchReporter = function () {};
17
13
 
18
14
  // TODO: @runspired This pattern prevents AssertFn from being removed in production builds
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["/**\n Utilities for helping to migrate to stricter\n and more consistent use of IDs and types.\n\n @module @ember-data/legacy-compat/utils\n @main @ember-data/legacy-compat/utils\n @deprecated\n*/\nimport { dasherize } from '@ember/string';\n\nimport { dependencySatisfies, importSync, macroCondition } from '@embroider/macros';\n\nimport { assert } from '@warp-drive/build-config/macros';\n\ninterface AssertFunc {\n (desc: string, condition: unknown): asserts condition;\n (desc: string): never;\n}\n\ntype Reporter = (type: 'formatted-id' | 'formatted-type', actual: unknown, expected: unknown) => void;\ntype Normalizer = (type: string) => string;\nlet singularize: (str: string) => string;\nif (macroCondition(dependencySatisfies('ember-inflector', '*'))) {\n singularize = (importSync('ember-inflector') as typeof import('ember-inflector')).singularize;\n}\n\nlet MismatchReporter: Reporter = function () {};\n\n// TODO: @runspired This pattern prevents AssertFn from being removed in production builds\n// but we should enable that if we can.\nlet _AssertFn: (message: string, condition: unknown) => void = function () {};\nconst AssertFn: AssertFunc = ((message: string, condition: unknown) => {\n if (!condition) {\n _AssertFn(message, condition);\n }\n assert(message, condition);\n}) as unknown as AssertFunc;\nlet NormalizedType: Normalizer = (str: string) => {\n return singularize(dasherize(str));\n};\n\n/**\n * Configure a function to be called when an id or type\n * changes during normalization. This is useful for instrumenting\n * to discover places where usage in the app is not consistent.\n *\n * @method configureMismatchReporter\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a mismatch-type ('formatted-id' | 'formatted-type'), actual, and expected value\n * @public\n * @static\n */\nexport function configureMismatchReporter(fn: Reporter): void {\n MismatchReporter = fn;\n}\n\n/**\n * Configure a function to be called when an id or type\n * fails validation. This is useful for instrumenting\n * to discover places where usage in the app is not consistent.\n *\n * @method configureAssertFn\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a message and a condition\n * @public\n * @static\n */\nexport function configureAssertFn(fn: (message: string, condition: unknown) => void): void {\n _AssertFn = fn;\n}\n\n/**\n * Configure a function to be called to normalize\n * a resource type string. Used by both formattedType\n * and isEquivType to ensure consistent normalization\n * during comparison.\n *\n * If validation fails or the type turns out be unnormalized\n * the configured mismatch reporter and assert functions will\n * be called.\n *\n * @method configureTypeNormalization\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a string and returns a string\n * @public\n * @static\n */\nexport function configureTypeNormalization(fn: (type: string) => string): void {\n NormalizedType = fn;\n}\n\nconst NORMALIZED_TYPES = new Map<string, string>();\n\n/**\n * Converts a potentially unnormalized type into the format expected\n * by our EmberData Cache. Currently this is singular-dasherized.\n *\n * you should not rely on this function to give you an exact format\n * for display purposes. Formatting for display should be handled\n * differently if the exact format matters.\n *\n * Asserts invalid types (undefined, null, '') in dev.\n *\n * **Usage**\n *\n * ```js\n * import formattedType from 'soxhub-client/helpers/formatted-type';\n *\n * formattedType('post'); // => 'post'\n * formattedType('posts'); // => 'post'\n * formattedType('Posts'); // => 'post'\n * formattedType('post-comment'); // => 'post-comment'\n * formattedType('post-comments'); // => 'post-comment'\n * formattedType('post_comment'); // => 'post-comment'\n * formattedType('postComment'); // => 'post-comment'\n * formattedType('PostComment'); // => 'post-comment'\n * ```\n *\n * @method formattedType\n * @for @ember-data/legacy-compat/utils\n * @param {string} type the potentially un-normalized type\n * @return {string} the normalized type\n * @public\n * @static\n */\nexport function formattedType<T extends string>(type: T | string): T {\n AssertFn('formattedType: type must not be null', type !== null);\n AssertFn('formattedType: type must not be undefined', type !== undefined);\n AssertFn('formattedType: type must be a string', typeof type === 'string');\n AssertFn('formattedType: type must not be empty', type.length > 0);\n let normalized = NORMALIZED_TYPES.get(type);\n\n if (normalized === undefined) {\n normalized = NormalizedType(type);\n NORMALIZED_TYPES.set(type, normalized);\n }\n\n if (normalized !== type) {\n MismatchReporter('formatted-type', type, normalized);\n }\n\n return normalized as T;\n}\n\n/**\n * Format an id to the format expected by the EmberData Cache.\n * Currently this means that id should be `string | null`.\n *\n * Asserts invalid IDs (undefined, '', 0, '0') in dev.\n *\n * **Usage**\n *\n * ```js\n * import formattedId from 'client/utils/formatted-id';\n *\n * formattedId('1'); // => '1'\n * formattedId(1); // => '1'\n * formattedId(null); // => null\n *\t```\n *\n * @method formattedId\n * @for @ember-data/legacy-compat/utils\n * @param {string | number | null} id the potentially un-normalized id\n * @return {string | null} the normalized id\n * @public\n * @static\n */\nexport function formattedId(id: string | number): string;\nexport function formattedId(id: null): null;\nexport function formattedId(id: string | number | null): string | null;\nexport function formattedId(id: string | number | null): string | null {\n AssertFn('formattedId: id must not be undefined', id !== undefined);\n AssertFn(\n 'formattedId: id must be a number, string or null',\n typeof id === 'number' || typeof id === 'string' || id === null\n );\n AssertFn(\n 'formattedId: id must not be empty',\n typeof id === 'number' || id === null || (typeof id === 'string' && id.length > 0)\n );\n AssertFn('formattedId: id must not be 0', id !== '0' && id !== 0);\n\n const formatted = id === null ? null : String(id);\n if (formatted !== id) {\n MismatchReporter('formatted-id', id, formatted);\n }\n return id === null ? null : String(id);\n}\n\nexport function expectId(id: string | number): string;\nexport function expectId(id: null): never;\nexport function expectId(id: string | number | null): string {\n AssertFn('expectId: id must not be null', id !== null);\n\n return formattedId(id);\n}\n\n/**\n * Compares two types for strict equality, converting them to\n * the format expected by the EmberData Cache to ensure\n * differences in format are accounted for in the comparison.\n *\n * Asserts when expected or actual are invalid types in dev.\n * Expected may never be null.\n *\n * ```js\n * isEquivType('posts', 'post'); // true\n * isEquivType('post', 'post'); // true\n * isEquivType('posts', 'posts'); // true\n * isEquivType('post-comment', 'postComment'); // true\n * isEquivType('post-comment', 'PostComment'); // true\n * isEquivType('post-comment', 'post_comment'); // true\n * isEquivType('post-comment', 'post-comment'); // true\n * isEquivType('post-comment', 'post'); // false\n * isEquivType('posts', null); // false\n * ```\n *\n * @method isEquivType\n * @for @ember-data/legacy-compat/utils\n * @param {string} expected a potentially unnormalized type to match against\n * @param {string} actual a potentially unnormalized type to match against\n * @return {boolean} true if the types are equivalent\n * @public\n * @static\n */\nexport function isEquivType(expected: string, actual: string): boolean {\n AssertFn('isEquivType: Expected type must not be null', expected !== null);\n AssertFn('isEquivType: Expected type must not be undefined', expected !== undefined);\n AssertFn('isEquivType: Expected type must be a string', typeof expected === 'string');\n AssertFn('isEquivType: Expected type must not be empty', expected.length > 0);\n\n AssertFn('isEquivType: Actual type must not be null', actual !== null);\n AssertFn('isEquivType: Actual type must not be undefined', actual !== undefined);\n AssertFn('isEquivType: Actual type must be a string', typeof actual === 'string');\n AssertFn('isEquivType: Actual type must not be empty', actual.length > 0);\n\n return expected === actual || formattedType(expected) === formattedType(actual);\n}\n\n/**\n * Compares two IDs for strict equality, converting them to\n * the format expected by the EmberData Cache to ensure\n * differences in format are accounted for in the comparison.\n *\n * Asserts when expected or actual are invalid IDs in dev.\n * Expected may never be null.\n *\n * ```js\n * isEquivId('1', 1); // true\n * isEquivId('2', '2'); // true\n * isEquivId(3, '3'); // true\n * isEquivId(4, '3'); // false\n * isEquivId(1, null); // false\n * ```\n *\n * @method isEquivId\n * @for @ember-data/legacy-compat/utils\n * @param {string | number} expected a potentially un-normalized id to match against\n * @param {string | number} actual a potentially un-normalized id to match against\n * @return {boolean} true if the ids are equivalent\n * @public\n * @static\n */\nexport function isEquivId(expected: string | number, actual: string | number | null): boolean {\n AssertFn('isEquivId: Expected id must not be null', expected !== null);\n AssertFn('isEquivId: Expected id must not be undefined', expected !== undefined);\n AssertFn(\n 'isEquivId: Expected id must be a number or string',\n typeof expected === 'number' || typeof expected === 'string'\n );\n AssertFn(\n 'isEquivId: Expected id must not be empty',\n typeof expected === 'number' || (typeof expected === 'string' && expected.length > 0)\n );\n AssertFn('isEquivId: Expected id must not be 0', expected !== '0' && expected !== 0);\n\n AssertFn('isEquivId: Actual id must not be undefined', actual !== undefined);\n AssertFn(\n 'isEquivId: Actual id must be a number, string or null',\n typeof actual === 'number' || typeof actual === 'string' || actual === null\n );\n AssertFn(\n 'isEquivId: Actual id must not be empty',\n actual === null || typeof actual === 'number' || (typeof actual === 'string' && actual.length > 0)\n );\n AssertFn('isEquivId: Actual id must not be 0', actual !== '0' && actual !== 0);\n\n return expected === actual || formattedId(expected) === formattedId(actual);\n}\n"],"names":["singularize","macroCondition","dependencySatisfies","importSync","MismatchReporter","_AssertFn","AssertFn","message","condition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","NormalizedType","str","dasherize","configureMismatchReporter","fn","configureAssertFn","configureTypeNormalization","NORMALIZED_TYPES","Map","formattedType","type","undefined","length","normalized","get","set","formattedId","id","formatted","String","expectId","isEquivType","expected","actual","isEquivId"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcA,IAAIA,WAAoC,CAAA;AACxC,IAAIC,cAAc,CAACC,mBAAmB,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,EAAE;AAC/DF,EAAAA,WAAW,GAAIG,UAAU,CAAC,iBAAiB,CAAC,CAAsCH,WAAW,CAAA;AAC/F,CAAA;AAEA,IAAII,gBAA0B,GAAG,YAAY,EAAE,CAAA;;AAE/C;AACA;AACA,IAAIC,SAAwD,GAAG,YAAY,EAAE,CAAA;AAC7E,MAAMC,QAAoB,GAAIA,CAACC,OAAe,EAAEC,SAAkB,KAAK;EACrE,IAAI,CAACA,SA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AC,CAAA;EACDhC,QAAQ,CACN,wCAAwC,EACxCgC,MAAM,KAAK,IAAI,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAK,OAAOA,MAAM,KAAK,QAAQ,IAAIA,MAAM,CAACX,MAAM,GAAG,CAClG,CAAC,CAAA;EACDrB,QAAQ,CAAC,oCAAoC,EAAEgC,MAAM,KAAK,GAAG,IAAIA,MAAM,KAAK,CAAC,CAAC,CAAA;AAE9E,EAAA,OAAOD,QAAQ,KAAKC,MAAM,IAAIP,WAAW,CAACM,QAAQ,CAAC,KAAKN,WAAW,CAACO,MAAM,CAAC,CAAA;AAC7E;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["/**\n Utilities for helping to migrate to stricter\n and more consistent use of IDs and types.\n\n @module @ember-data/legacy-compat/utils\n @main @ember-data/legacy-compat/utils\n @deprecated\n*/\nimport { dasherize, singularize } from '@ember-data/request-utils/string';\nimport { assert } from '@warp-drive/build-config/macros';\n\ninterface AssertFunc {\n (desc: string, condition: unknown): asserts condition;\n (desc: string): never;\n}\n\ntype Reporter = (type: 'formatted-id' | 'formatted-type', actual: unknown, expected: unknown) => void;\ntype Normalizer = (type: string) => string;\n\nlet MismatchReporter: Reporter = function () {};\n\n// TODO: @runspired This pattern prevents AssertFn from being removed in production builds\n// but we should enable that if we can.\nlet _AssertFn: (message: string, condition: unknown) => void = function () {};\nconst AssertFn: AssertFunc = ((message: string, condition: unknown) => {\n if (!condition) {\n _AssertFn(message, condition);\n }\n assert(message, condition);\n}) as unknown as AssertFunc;\nlet NormalizedType: Normalizer = (str: string) => {\n return singularize(dasherize(str));\n};\n\n/**\n * Configure a function to be called when an id or type\n * changes during normalization. This is useful for instrumenting\n * to discover places where usage in the app is not consistent.\n *\n * @method configureMismatchReporter\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a mismatch-type ('formatted-id' | 'formatted-type'), actual, and expected value\n * @public\n * @static\n */\nexport function configureMismatchReporter(fn: Reporter): void {\n MismatchReporter = fn;\n}\n\n/**\n * Configure a function to be called when an id or type\n * fails validation. This is useful for instrumenting\n * to discover places where usage in the app is not consistent.\n *\n * @method configureAssertFn\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a message and a condition\n * @public\n * @static\n */\nexport function configureAssertFn(fn: (message: string, condition: unknown) => void): void {\n _AssertFn = fn;\n}\n\n/**\n * Configure a function to be called to normalize\n * a resource type string. Used by both formattedType\n * and isEquivType to ensure consistent normalization\n * during comparison.\n *\n * If validation fails or the type turns out be unnormalized\n * the configured mismatch reporter and assert functions will\n * be called.\n *\n * @method configureTypeNormalization\n * @for @ember-data/legacy-compat/utils\n * @param method a function which takes a string and returns a string\n * @public\n * @static\n */\nexport function configureTypeNormalization(fn: (type: string) => string): void {\n NormalizedType = fn;\n}\n\nconst NORMALIZED_TYPES = new Map<string, string>();\n\n/**\n * Converts a potentially unnormalized type into the format expected\n * by our EmberData Cache. Currently this is singular-dasherized.\n *\n * you should not rely on this function to give you an exact format\n * for display purposes. Formatting for display should be handled\n * differently if the exact format matters.\n *\n * Asserts invalid types (undefined, null, '') in dev.\n *\n * **Usage**\n *\n * ```js\n * import formattedType from 'soxhub-client/helpers/formatted-type';\n *\n * formattedType('post'); // => 'post'\n * formattedType('posts'); // => 'post'\n * formattedType('Posts'); // => 'post'\n * formattedType('post-comment'); // => 'post-comment'\n * formattedType('post-comments'); // => 'post-comment'\n * formattedType('post_comment'); // => 'post-comment'\n * formattedType('postComment'); // => 'post-comment'\n * formattedType('PostComment'); // => 'post-comment'\n * ```\n *\n * @method formattedType\n * @for @ember-data/legacy-compat/utils\n * @param {string} type the potentially un-normalized type\n * @return {string} the normalized type\n * @public\n * @static\n */\nexport function formattedType<T extends string>(type: T | string): T {\n AssertFn('formattedType: type must not be null', type !== null);\n AssertFn('formattedType: type must not be undefined', type !== undefined);\n AssertFn('formattedType: type must be a string', typeof type === 'string');\n AssertFn('formattedType: type must not be empty', type.length > 0);\n let normalized = NORMALIZED_TYPES.get(type);\n\n if (normalized === undefined) {\n normalized = NormalizedType(type);\n NORMALIZED_TYPES.set(type, normalized);\n }\n\n if (normalized !== type) {\n MismatchReporter('formatted-type', type, normalized);\n }\n\n return normalized as T;\n}\n\n/**\n * Format an id to the format expected by the EmberData Cache.\n * Currently this means that id should be `string | null`.\n *\n * Asserts invalid IDs (undefined, '', 0, '0') in dev.\n *\n * **Usage**\n *\n * ```js\n * import formattedId from 'client/utils/formatted-id';\n *\n * formattedId('1'); // => '1'\n * formattedId(1); // => '1'\n * formattedId(null); // => null\n *\t```\n *\n * @method formattedId\n * @for @ember-data/legacy-compat/utils\n * @param {string | number | null} id the potentially un-normalized id\n * @return {string | null} the normalized id\n * @public\n * @static\n */\nexport function formattedId(id: string | number): string;\nexport function formattedId(id: null): null;\nexport function formattedId(id: string | number | null): string | null;\nexport function formattedId(id: string | number | null): string | null {\n AssertFn('formattedId: id must not be undefined', id !== undefined);\n AssertFn(\n 'formattedId: id must be a number, string or null',\n typeof id === 'number' || typeof id === 'string' || id === null\n );\n AssertFn(\n 'formattedId: id must not be empty',\n typeof id === 'number' || id === null || (typeof id === 'string' && id.length > 0)\n );\n AssertFn('formattedId: id must not be 0', id !== '0' && id !== 0);\n\n const formatted = id === null ? null : String(id);\n if (formatted !== id) {\n MismatchReporter('formatted-id', id, formatted);\n }\n return id === null ? null : String(id);\n}\n\nexport function expectId(id: string | number): string;\nexport function expectId(id: null): never;\nexport function expectId(id: string | number | null): string {\n AssertFn('expectId: id must not be null', id !== null);\n\n return formattedId(id);\n}\n\n/**\n * Compares two types for strict equality, converting them to\n * the format expected by the EmberData Cache to ensure\n * differences in format are accounted for in the comparison.\n *\n * Asserts when expected or actual are invalid types in dev.\n * Expected may never be null.\n *\n * ```js\n * isEquivType('posts', 'post'); // true\n * isEquivType('post', 'post'); // true\n * isEquivType('posts', 'posts'); // true\n * isEquivType('post-comment', 'postComment'); // true\n * isEquivType('post-comment', 'PostComment'); // true\n * isEquivType('post-comment', 'post_comment'); // true\n * isEquivType('post-comment', 'post-comment'); // true\n * isEquivType('post-comment', 'post'); // false\n * isEquivType('posts', null); // false\n * ```\n *\n * @method isEquivType\n * @for @ember-data/legacy-compat/utils\n * @param {string} expected a potentially unnormalized type to match against\n * @param {string} actual a potentially unnormalized type to match against\n * @return {boolean} true if the types are equivalent\n * @public\n * @static\n */\nexport function isEquivType(expected: string, actual: string): boolean {\n AssertFn('isEquivType: Expected type must not be null', expected !== null);\n AssertFn('isEquivType: Expected type must not be undefined', expected !== undefined);\n AssertFn('isEquivType: Expected type must be a string', typeof expected === 'string');\n AssertFn('isEquivType: Expected type must not be empty', expected.length > 0);\n\n AssertFn('isEquivType: Actual type must not be null', actual !== null);\n AssertFn('isEquivType: Actual type must not be undefined', actual !== undefined);\n AssertFn('isEquivType: Actual type must be a string', typeof actual === 'string');\n AssertFn('isEquivType: Actual type must not be empty', actual.length > 0);\n\n return expected === actual || formattedType(expected) === formattedType(actual);\n}\n\n/**\n * Compares two IDs for strict equality, converting them to\n * the format expected by the EmberData Cache to ensure\n * differences in format are accounted for in the comparison.\n *\n * Asserts when expected or actual are invalid IDs in dev.\n * Expected may never be null.\n *\n * ```js\n * isEquivId('1', 1); // true\n * isEquivId('2', '2'); // true\n * isEquivId(3, '3'); // true\n * isEquivId(4, '3'); // false\n * isEquivId(1, null); // false\n * ```\n *\n * @method isEquivId\n * @for @ember-data/legacy-compat/utils\n * @param {string | number} expected a potentially un-normalized id to match against\n * @param {string | number} actual a potentially un-normalized id to match against\n * @return {boolean} true if the ids are equivalent\n * @public\n * @static\n */\nexport function isEquivId(expected: string | number, actual: string | number | null): boolean {\n AssertFn('isEquivId: Expected id must not be null', expected !== null);\n AssertFn('isEquivId: Expected id must not be undefined', expected !== undefined);\n AssertFn(\n 'isEquivId: Expected id must be a number or string',\n typeof expected === 'number' || typeof expected === 'string'\n );\n AssertFn(\n 'isEquivId: Expected id must not be empty',\n typeof expected === 'number' || (typeof expected === 'string' && expected.length > 0)\n );\n AssertFn('isEquivId: Expected id must not be 0', expected !== '0' && expected !== 0);\n\n AssertFn('isEquivId: Actual id must not be undefined', actual !== undefined);\n AssertFn(\n 'isEquivId: Actual id must be a number, string or null',\n typeof actual === 'number' || typeof actual === 'string' || actual === null\n );\n AssertFn(\n 'isEquivId: Actual id must not be empty',\n actual === null || typeof actual === 'number' || (typeof actual === 'string' && actual.length > 0)\n );\n AssertFn('isEquivId: Actual id must not be 0', actual !== '0' && actual !== 0);\n\n return expected === actual || formattedId(expected) === formattedId(actual);\n}\n"],"names":["MismatchReporter","_AssertFn","AssertFn","message","condition","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","test","Error","NormalizedType","str","singularize","dasherize","configureMismatchReporter","fn","configureAssertFn","configureTypeNormalization","NORMALIZED_TYPES","Map","formattedType","type","undefined","length","normalized","get","set","formattedId","id","formatted","String","expectId","isEquivType","expected","actual","isEquivId"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYA,IAAIA,gBAA0B,GAAG,YAAY,EAAE,CAAA;;AAE/C;AACA;AACA,IAAIC,SAAwD,GAAG,YAAY,EAAE,CAAA;AAC7E,MAAMC,QAAoB,GAAIA,CAACC,OAAe,EAAEC,SAAkB,KAAK;EACrE,IAAI,CAACA,SAAS,EAAE;AACdH,IAAAA,SAAS,CAACE,OAAO,EAAEC,SAAS,CAAC,CAAA;AAC/B,GAAA;EACAC,cAAA,CAAAC,eAAA,EAAAC,CAAAA,SAAA,CAAAC,GAAA,CAAAC,KAAA,CAAA,GAAA,CAAAC,IAAA,IAAA;AAAA,IAAA,IAAA,CAAAA,IAAA,EAAA;MAAA,MAAAC,IAAAA,KAAA,CAAOR,OAAO,CAAA,CAAA;AAAA,KAAA;AAAA,GAAA,EAAEC,SAAS,CAAA,GAAA,EAAA,CAAA;AAC3B,CAA2B,CAAA;AAC3B,IAAIQ,cAA0B,GAAIC,GAAW,IAAK;AAChD,EAAA,OAAOC,WAAW,CAACC,SAAS,CAACF,GAAG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"@ember-data/legacy-compat",
3
3
  "description": "Compatibility Shims for Older EmberData",
4
- "version": "5.4.0-alpha.74",
4
+ "version": "5.4.0-alpha.76",
5
5
  "license": "MIT",
6
6
  "author": "Chris Thoburn <runspired@users.noreply.github.com>",
7
7
  "repository": {
@@ -63,15 +63,9 @@
63
63
  "@warp-drive/core-types": {
64
64
  "injected": true
65
65
  },
66
- "ember-inflector": {
67
- "injected": true
68
- },
69
66
  "@ember-data/tracking": {
70
67
  "injected": true
71
68
  },
72
- "@ember/string": {
73
- "injected": true
74
- },
75
69
  "@ember-data/request-utils": {
76
70
  "injected": true
77
71
  },
@@ -85,42 +79,36 @@
85
79
  },
86
80
  "@ember-data/json-api": {
87
81
  "optional": true
88
- },
89
- "ember-inflector": {
90
- "optional": true
91
82
  }
92
83
  },
93
84
  "dependencies": {
94
85
  "@embroider/macros": "^1.16.1",
95
- "@warp-drive/build-config": "0.0.0-alpha.11"
86
+ "@warp-drive/build-config": "0.0.0-alpha.13"
96
87
  },
97
88
  "peerDependencies": {
98
- "@ember-data/graph": "5.4.0-alpha.74",
99
- "@ember-data/json-api": "5.4.0-alpha.74",
100
- "@ember-data/request": "5.4.0-alpha.74",
101
- "@ember-data/store": "5.4.0-alpha.74",
102
- "@ember/string": "^3.1.1",
89
+ "@ember-data/graph": "5.4.0-alpha.76",
90
+ "@ember-data/json-api": "5.4.0-alpha.76",
91
+ "@ember-data/request": "5.4.0-alpha.76",
92
+ "@ember-data/request-utils": "5.4.0-alpha.76",
93
+ "@ember-data/store": "5.4.0-alpha.76",
103
94
  "@ember/test-waiters": "^3.1.0",
104
- "ember-inflector": "^4.0.2",
105
- "@warp-drive/core-types": "0.0.0-alpha.60"
95
+ "@warp-drive/core-types": "0.0.0-alpha.62"
106
96
  },
107
97
  "devDependencies": {
108
98
  "@babel/core": "^7.24.5",
109
99
  "@babel/plugin-transform-typescript": "^7.24.5",
110
100
  "@babel/preset-env": "^7.24.5",
111
101
  "@babel/preset-typescript": "^7.24.1",
112
- "@ember-data/graph": "5.4.0-alpha.74",
113
- "@ember-data/json-api": "5.4.0-alpha.74",
114
- "@ember-data/request": "5.4.0-alpha.74",
115
- "@ember-data/request-utils": "5.4.0-alpha.74",
116
- "@ember-data/store": "5.4.0-alpha.74",
117
- "@ember-data/tracking": "5.4.0-alpha.74",
102
+ "@ember-data/graph": "5.4.0-alpha.76",
103
+ "@ember-data/json-api": "5.4.0-alpha.76",
104
+ "@ember-data/request": "5.4.0-alpha.76",
105
+ "@ember-data/request-utils": "5.4.0-alpha.76",
106
+ "@ember-data/store": "5.4.0-alpha.76",
107
+ "@ember-data/tracking": "5.4.0-alpha.76",
118
108
  "@ember/test-waiters": "^3.1.0",
119
- "@ember/string": "^3.1.1",
120
109
  "@glimmer/component": "^1.1.2",
121
- "@warp-drive/core-types": "0.0.0-alpha.60",
122
- "@warp-drive/internal-config": "5.4.0-alpha.74",
123
- "ember-inflector": "^4.0.2",
110
+ "@warp-drive/core-types": "0.0.0-alpha.62",
111
+ "@warp-drive/internal-config": "5.4.0-alpha.76",
124
112
  "ember-source": "~5.8.0",
125
113
  "pnpm-sync-dependencies-meta-injected": "0.0.14",
126
114
  "typescript": "^5.4.5",
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAmBA,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;AAsBtG;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAE5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAEzF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,C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