@ember-data/request-utils 5.4.0-alpha.9 → 5.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/addon/index.js CHANGED
@@ -58,11 +58,11 @@ let CONFIG = {
58
58
  * This method may be called as many times as needed
59
59
  *
60
60
  * ```ts
61
- type BuildURLConfig = {
62
- host: string;
63
- namespace: string'
64
- }
65
- ```
61
+ * type BuildURLConfig = {
62
+ * host: string;
63
+ * namespace: string'
64
+ * }
65
+ * ```
66
66
  *
67
67
  * @method setBuildURLConfig
68
68
  * @static
@@ -166,7 +166,7 @@ function handleInclude(include) {
166
166
  }
167
167
 
168
168
  /**
169
- * filter out keys of an object that have falsey values or point to empty arrays
169
+ * filter out keys of an object that have falsy values or point to empty arrays
170
170
  * returning a new object with only those keys that have truthy values / non-empty arrays
171
171
  *
172
172
  * @method filterEmpty
@@ -180,7 +180,8 @@ function filterEmpty(source) {
180
180
  const result = {};
181
181
  for (const key in source) {
182
182
  const value = source[key];
183
- if (value) {
183
+ // Allow `0` and `false` but filter falsy values that indicate "empty"
184
+ if (value !== undefined && value !== null && value !== '') {
184
185
  if (!Array.isArray(value) || value.length > 0) {
185
186
  result[key] = source[key];
186
187
  }
@@ -296,44 +297,48 @@ const NUMERIC_KEYS = new Set(['max-age', 's-maxage', 'stale-if-error', 'stale-wh
296
297
  /**
297
298
  * Parses a string Cache-Control header value into an object with the following structure:
298
299
  *
299
- ```ts
300
- interface CacheControlValue {
301
- immutable?: boolean;
302
- 'max-age'?: number;
303
- 'must-revalidate'?: boolean;
304
- 'must-understand'?: boolean;
305
- 'no-cache'?: boolean;
306
- 'no-store'?: boolean;
307
- 'no-transform'?: boolean;
308
- 'only-if-cached'?: boolean;
309
- private?: boolean;
310
- 'proxy-revalidate'?: boolean;
311
- public?: boolean;
312
- 's-maxage'?: number;
313
- 'stale-if-error'?: number;
314
- 'stale-while-revalidate'?: number;
315
- }
316
- ```
317
-
318
- * @method parseCacheControl
319
- * @static
320
- * @public
321
- * @for @ember-data/request-utils
322
- * @param {string} header
323
- * @returns {CacheControlValue}
300
+ * ```ts
301
+ * interface CacheControlValue {
302
+ * immutable?: boolean;
303
+ * 'max-age'?: number;
304
+ * 'must-revalidate'?: boolean;
305
+ * 'must-understand'?: boolean;
306
+ * 'no-cache'?: boolean;
307
+ * 'no-store'?: boolean;
308
+ * 'no-transform'?: boolean;
309
+ * 'only-if-cached'?: boolean;
310
+ * private?: boolean;
311
+ * 'proxy-revalidate'?: boolean;
312
+ * public?: boolean;
313
+ * 's-maxage'?: number;
314
+ * 'stale-if-error'?: number;
315
+ * 'stale-while-revalidate'?: number;
316
+ * }
317
+ * ```
318
+ * @method parseCacheControl
319
+ * @static
320
+ * @public
321
+ * @for @ember-data/request-utils
322
+ * @param {string} header
323
+ * @returns {CacheControlValue}
324
324
  */
325
325
  function parseCacheControl(header) {
326
326
  let key = '';
327
327
  let value = '';
328
328
  let isParsingKey = true;
329
329
  let cacheControlValue = {};
330
+ function parseCacheControlValue(stringToParse) {
331
+ const parsedValue = Number.parseInt(stringToParse);
332
+ assert(`Invalid Cache-Control value, expected a number but got - ${stringToParse}`, !Number.isNaN(parsedValue));
333
+ return parsedValue;
334
+ }
330
335
  for (let i = 0; i < header.length; i++) {
331
336
  let char = header.charAt(i);
332
337
  if (char === ',') {
333
338
  assert(`Invalid Cache-Control value, expected a value`, !isParsingKey || !NUMERIC_KEYS.has(key));
334
339
  assert(`Invalid Cache-Control value, expected a value after "=" but got ","`, i === 0 || header.charAt(i - 1) !== '=');
335
340
  isParsingKey = true;
336
- cacheControlValue[key] = NUMERIC_KEYS.has(key) ? Number.parseInt(value) : true;
341
+ cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;
337
342
  key = '';
338
343
  value = '';
339
344
  continue;
@@ -348,7 +353,7 @@ function parseCacheControl(header) {
348
353
  value += char;
349
354
  }
350
355
  if (i === header.length - 1) {
351
- cacheControlValue[key] = NUMERIC_KEYS.has(key) ? Number.parseInt(value) : true;
356
+ cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;
352
357
  }
353
358
  }
354
359
  return cacheControlValue;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { assert } from '@ember/debug';\n\nimport type Store from '@ember-data/store';\nimport { StableDocumentIdentifier } from '@ember-data/types/cache/identifier';\n\n/**\n * Simple utility function to assist in url building,\n * query params, and other common request operations.\n *\n * These primitives may be used directly or composed\n * by request builders to provide a consistent interface\n * for building requests.\n *\n * For instance:\n *\n * ```ts\n * import { buildBaseURL, buildQueryParams } from '@ember-data/request-utils';\n *\n * const baseURL = buildBaseURL({\n * host: 'https://api.example.com',\n * namespace: 'api/v1',\n * resourcePath: 'emberDevelopers',\n * op: 'query',\n * identifier: { type: 'ember-developer' }\n * });\n * const url = `${baseURL}?${buildQueryParams({ name: 'Chris', include:['pets'] })}`;\n * // => 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris'\n * ```\n *\n * This is useful, but not as useful as the REST request builder for query which is sugar\n * over this (and more!):\n *\n * ```ts\n * import { query } from '@ember-data/rest/request';\n *\n * const options = query('ember-developer', { name: 'Chris', include:['pets'] });\n * // => { url: 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris' }\n * // Note: options will also include other request options like headers, method, etc.\n * ```\n *\n * @module @ember-data/request-utils\n * @main @ember-data/request-utils\n * @public\n */\n\n// prevents the final constructed object from needing to add\n// host and namespace which are provided by the final consuming\n// class to the prototype which can result in overwrite errors\n\ninterface BuildURLConfig {\n host: string | null;\n namespace: string | null;\n}\n\nlet CONFIG: BuildURLConfig = {\n host: '',\n namespace: '',\n};\n\n/**\n * Sets the global configuration for `buildBaseURL`\n * for host and namespace values for the application.\n *\n * These values may still be overridden by passing\n * them to buildBaseURL directly.\n *\n * This method may be called as many times as needed\n *\n * ```ts\n type BuildURLConfig = {\n host: string;\n namespace: string'\n }\n ```\n *\n * @method setBuildURLConfig\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {BuildURLConfig} config\n * @returns void\n */\nexport function setBuildURLConfig(config: BuildURLConfig) {\n CONFIG = config;\n}\n\nexport interface FindRecordUrlOptions {\n op: 'findRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface QueryUrlOptions {\n op: 'query';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindManyUrlOptions {\n op: 'findMany';\n identifiers: { type: string; id: string }[];\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\nexport interface FindRelatedCollectionUrlOptions {\n op: 'findRelatedCollection';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindRelatedResourceUrlOptions {\n op: 'findRelatedRecord';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface CreateRecordUrlOptions {\n op: 'createRecord';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface UpdateRecordUrlOptions {\n op: 'updateRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface DeleteRecordUrlOptions {\n op: 'deleteRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport type UrlOptions =\n | FindRecordUrlOptions\n | QueryUrlOptions\n | FindManyUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | CreateRecordUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions;\n\nconst OPERATIONS_WITH_PRIMARY_RECORDS = new Set([\n 'findRecord',\n 'findRelatedRecord',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n]);\n\nfunction isOperationWithPrimaryRecord(\n options: UrlOptions\n): options is\n | FindRecordUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions {\n return OPERATIONS_WITH_PRIMARY_RECORDS.has(options.op);\n}\n\nfunction resourcePathForType(options: UrlOptions): string {\n return options.op === 'findMany' ? options.identifiers[0].type : options.identifier.type;\n}\n\n/**\n * Builds a URL for a request based on the provided options.\n * Does not include support for building query params (see `buildQueryParams`)\n * so that it may be composed cleanly with other query-params strategies.\n *\n * Usage:\n *\n * ```ts\n * import { buildBaseURL } from '@ember-data/request-utils';\n *\n * const url = buildBaseURL({\n * host: 'https://api.example.com',\n * namespace: 'api/v1',\n * resourcePath: 'emberDevelopers',\n * op: 'query',\n * identifier: { type: 'ember-developer' }\n * });\n *\n * // => 'https://api.example.com/api/v1/emberDevelopers'\n * ```\n *\n * On the surface this may seem like a lot of work to do something simple, but\n * it is designed to be composable with other utilities and interfaces that the\n * average product engineer will never need to see or use.\n *\n * A few notes:\n *\n * - `resourcePath` is optional, but if it is not provided, `identifier.type` will be used.\n * - `host` and `namespace` are optional, but if they are not provided, the values globally\n * configured via `setBuildURLConfig` will be used.\n * - `op` is required and must be one of the following:\n * - 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'\n * - Depending on the value of `op`, `identifier` or `identifiers` will be required.\n *\n * @method buildBaseURL\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param urlOptions\n * @returns string\n */\nexport function buildBaseURL(urlOptions: UrlOptions): string {\n const options = Object.assign(\n {\n host: CONFIG.host,\n namespace: CONFIG.namespace,\n },\n urlOptions\n );\n assert(\n `buildBaseURL: You must pass \\`op\\` as part of options`,\n typeof options.op === 'string' && options.op.length > 0\n );\n assert(\n `buildBaseURL: You must pass \\`identifier\\` as part of options`,\n options.op === 'findMany' || (options.identifier && typeof options.identifier === 'object')\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n options.op !== 'findMany' ||\n (options.identifiers &&\n Array.isArray(options.identifiers) &&\n options.identifiers.length > 0 &&\n options.identifiers.every((i) => i && typeof i === 'object'))\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'id'`,\n !isOperationWithPrimaryRecord(options) ||\n (typeof options.identifier.id === 'string' && options.identifier.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n options.op !== 'findMany' || options.identifiers.every((i) => typeof i.id === 'string' && i.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'type'`,\n options.op === 'findMany' || (typeof options.identifier.type === 'string' && options.identifier.type.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifiers\\` as part of options, expected 'type'`,\n options.op !== 'findMany' ||\n (typeof options.identifiers[0].type === 'string' && options.identifiers[0].type.length > 0)\n );\n\n // prettier-ignore\n const idPath: string =\n isOperationWithPrimaryRecord(options) ? encodeURIComponent(options.identifier.id)\n : '';\n const resourcePath = options.resourcePath || resourcePathForType(options);\n const { host, namespace } = options;\n const fieldPath = 'fieldPath' in options ? options.fieldPath : '';\n\n assert(\n `buildBaseURL: You tried to build a ${String(\n (options as { op: string }).op\n )} request to ${resourcePath} but op must be one of \"${[\n 'findRecord',\n 'findRelatedRecord',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n 'createRecord',\n 'query',\n 'findMany',\n ].join('\",\"')}\".`,\n [\n 'findRecord',\n 'query',\n 'findMany',\n 'findRelatedCollection',\n 'findRelatedRecord',\n 'createRecord',\n 'updateRecord',\n 'deleteRecord',\n ].includes(options.op)\n );\n\n assert(`buildBaseURL: host must NOT end with '/', received '${host}'`, host === '/' || !host.endsWith('/'));\n assert(`buildBaseURL: namespace must NOT start with '/', received '${namespace}'`, !namespace.startsWith('/'));\n assert(`buildBaseURL: namespace must NOT end with '/', received '${namespace}'`, !namespace.endsWith('/'));\n assert(\n `buildBaseURL: resourcePath must NOT start with '/', received '${resourcePath}'`,\n !resourcePath.startsWith('/')\n );\n assert(`buildBaseURL: resourcePath must NOT end with '/', received '${resourcePath}'`, !resourcePath.endsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT start with '/', received '${fieldPath}'`, !fieldPath.startsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT end with '/', received '${fieldPath}'`, !fieldPath.endsWith('/'));\n assert(`buildBaseURL: idPath must NOT start with '/', received '${idPath}'`, !idPath.startsWith('/'));\n assert(`buildBaseURL: idPath must NOT end with '/', received '${idPath}'`, !idPath.endsWith('/'));\n\n const url = [host === '/' ? '' : host, namespace, resourcePath, idPath, fieldPath].filter(Boolean).join('/');\n return host ? url : `/${url}`;\n}\n\ntype SerializablePrimitive = string | number | boolean | null;\ntype Serializable = SerializablePrimitive | SerializablePrimitive[];\nexport type QueryParamsSerializationOptions = {\n arrayFormat?: 'bracket' | 'indices' | 'repeat' | 'comma';\n};\nexport type QueryParamsSource = Record<string, Serializable> | URLSearchParams;\n\nconst DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS: QueryParamsSerializationOptions = {\n arrayFormat: 'comma',\n};\n\nfunction handleInclude(include: string | string[]): string[] {\n assert(\n `Expected include to be a string or array, got ${typeof include}`,\n typeof include === 'string' || Array.isArray(include)\n );\n return typeof include === 'string' ? include.split(',') : include;\n}\n\n/**\n * filter out keys of an object that have falsey values or point to empty arrays\n * returning a new object with only those keys that have truthy values / non-empty arrays\n *\n * @method filterEmpty\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {Record<string, Serializable>} source object to filter keys with empty values from\n * @returns {Record<string, Serializable>} A new object with the keys that contained empty values removed\n */\nexport function filterEmpty(source: Record<string, Serializable>): Record<string, Serializable> {\n const result: Record<string, Serializable> = {};\n for (const key in source) {\n const value = source[key];\n if (value) {\n if (!Array.isArray(value) || value.length > 0) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n\n/**\n * Sorts query params by both key and value returning a new URLSearchParams\n * object with the keys inserted in sorted order.\n *\n * Treats `included` specially, splicing it into an array if it is a string and sorting the array.\n *\n * Options:\n * - arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n *\n * 'bracket': appends [] to the key for every value e.g. `&ids[]=1&ids[]=2`\n * 'indices': appends [i] to the key for every value e.g. `&ids[0]=1&ids[1]=2`\n * 'repeat': appends the key for every value e.g. `&ids=1&ids=2`\n * 'comma' (default): appends the key once with a comma separated list of values e.g. `&ids=1,2`\n *\n * @method sortQueryParams\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {URLSearchParams | object} params\n * @param {object} options\n * @returns {URLSearchParams} A URLSearchParams with keys inserted in sorted order\n */\nexport function sortQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): URLSearchParams {\n options = Object.assign({}, DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS, options);\n const paramsIsObject = !(params instanceof URLSearchParams);\n const urlParams = new URLSearchParams();\n const dictionaryParams: Record<string, Serializable> = paramsIsObject ? params : {};\n\n if (!paramsIsObject) {\n params.forEach((value, key) => {\n const hasExisting = key in dictionaryParams;\n if (!hasExisting) {\n dictionaryParams[key] = value;\n } else {\n const existingValue = dictionaryParams[key];\n if (Array.isArray(existingValue)) {\n existingValue.push(value);\n } else {\n dictionaryParams[key] = [existingValue, value];\n }\n }\n });\n }\n\n if ('include' in dictionaryParams) {\n dictionaryParams.include = handleInclude(dictionaryParams.include as string | string[]);\n }\n\n const sortedKeys = Object.keys(dictionaryParams).sort();\n sortedKeys.forEach((key) => {\n const value = dictionaryParams[key];\n if (Array.isArray(value)) {\n value.sort();\n switch (options!.arrayFormat) {\n case 'indices':\n value.forEach((v, i) => {\n urlParams.append(`${key}[${i}]`, String(v));\n });\n return;\n case 'bracket':\n value.forEach((v) => {\n urlParams.append(`${key}[]`, String(v));\n });\n return;\n case 'repeat':\n value.forEach((v) => {\n urlParams.append(key, String(v));\n });\n return;\n case 'comma':\n default:\n urlParams.append(key, value.join(','));\n return;\n }\n } else {\n urlParams.append(key, String(value));\n }\n });\n\n return urlParams;\n}\n\n/**\n * Sorts query params by both key and value, returning a query params string\n *\n * Treats `included` specially, splicing it into an array if it is a string and sorting the array.\n *\n * Options:\n * - arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n *\n * 'bracket': appends [] to the key for every value e.g. `ids[]=1&ids[]=2`\n * 'indices': appends [i] to the key for every value e.g. `ids[0]=1&ids[1]=2`\n * 'repeat': appends the key for every value e.g. `ids=1&ids=2`\n * 'comma' (default): appends the key once with a comma separated list of values e.g. `ids=1,2`\n *\n * @method sortQueryParams\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {URLSearchParams | object} params\n * @param {object} [options]\n * @returns {string} A sorted query params string without the leading `?`\n */\nexport function buildQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): string {\n return sortQueryParams(params, options).toString();\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\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 * @method parseCacheControl\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {string} header\n * @returns {CacheControlValue}\n */\nexport function parseCacheControl(header: string): CacheControlValue {\n let key = '';\n let value = '';\n let isParsingKey = true;\n let cacheControlValue: CacheControlValue = {};\n\n for (let i = 0; i < header.length; i++) {\n let 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 cacheControlValue[key] = NUMERIC_KEYS.has(key) ? Number.parseInt(value) : true;\n key = '';\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 cacheControlValue[key] = NUMERIC_KEYS.has(key) ? Number.parseInt(value) : true;\n }\n }\n\n return cacheControlValue;\n}\n\nfunction isStale(headers: Headers, expirationTime: number): boolean {\n // const age = headers.get('age');\n // const cacheControl = parseCacheControl(headers.get('cache-control') || '');\n // const expires = headers.get('expires');\n // const lastModified = headers.get('last-modified');\n const date = headers.get('date');\n\n if (!date) {\n return true;\n }\n\n const time = new Date(date).getTime();\n const now = Date.now();\n const deadline = time + expirationTime;\n\n const result = now > deadline;\n\n return result;\n}\n\nexport type LifetimesConfig = { apiCacheSoftExpires: number; apiCacheHardExpires: number };\n\n/**\n * A basic LifetimesService 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 * 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 `@ember-data/request/fetch` will automatically\n * add the `date` header to responses if it is not present.\n *\n * Usage:\n *\n * ```ts\n * import { LifetimesService } from '@ember-data/request-utils';\n * import DataStore from '@ember-data/store';\n *\n * // ...\n *\n * export class Store extends DataStore {\n * constructor(args) {\n * super(args);\n * this.lifetimes = new LifetimesService(this, { apiCacheSoftExpires: 30_000, apiCacheHardExpires: 60_000 });\n * }\n * }\n * ```\n *\n * @class LifetimesService\n * @public\n * @module @ember-data/request-utils\n */\n// TODO this doesn't get documented correctly on the website because it shares a class name\n// with the interface expected by the Store service\nexport class LifetimesService {\n declare store: Store;\n declare config: LifetimesConfig;\n constructor(store: Store, config: LifetimesConfig) {\n this.store = store;\n this.config = config;\n }\n\n isHardExpired(identifier: StableDocumentIdentifier): boolean {\n const cached = this.store.cache.peekRequest(identifier);\n return !cached || !cached.response || isStale(cached.response.headers, this.config.apiCacheHardExpires);\n }\n isSoftExpired(identifier: StableDocumentIdentifier): boolean {\n const cached = this.store.cache.peekRequest(identifier);\n return !cached || !cached.response || isStale(cached.response.headers, this.config.apiCacheSoftExpires);\n }\n}\n"],"names":["CONFIG","host","namespace","setBuildURLConfig","config","OPERATIONS_WITH_PRIMARY_RECORDS","Set","isOperationWithPrimaryRecord","options","has","op","resourcePathForType","identifiers","type","identifier","buildBaseURL","urlOptions","Object","assign","assert","length","Array","isArray","every","i","id","idPath","encodeURIComponent","resourcePath","fieldPath","String","join","includes","endsWith","startsWith","url","filter","Boolean","DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS","arrayFormat","handleInclude","include","split","filterEmpty","source","result","key","value","sortQueryParams","params","paramsIsObject","URLSearchParams","urlParams","dictionaryParams","forEach","hasExisting","existingValue","push","sortedKeys","keys","sort","v","append","buildQueryParams","toString","NUMERIC_KEYS","parseCacheControl","header","isParsingKey","cacheControlValue","char","charAt","Number","parseInt","isStale","headers","expirationTime","date","get","time","Date","getTime","now","deadline","LifetimesService","constructor","store","isHardExpired","cached","cache","peekRequest","response","apiCacheHardExpires","isSoftExpired","apiCacheSoftExpires"],"mappings":";;AAKA;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;AACA;;AAEA;AACA;AACA;AAOA,IAAIA,MAAsB,GAAG;AAC3BC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,SAAS,EAAE,EAAA;AACb,CAAC,CAAA;;AAED;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,MAAsB,EAAE;AACxDJ,EAAAA,MAAM,GAAGI,MAAM,CAAA;AACjB,CAAA;AA6EA,MAAMC,+BAA+B,GAAG,IAAIC,GAAG,CAAC,CAC9C,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,CACf,CAAC,CAAA;AAEF,SAASC,4BAA4BA,CACnCC,OAAmB,EAMM;AACzB,EAAA,OAAOH,+BAA+B,CAACI,GAAG,CAACD,OAAO,CAACE,EAAE,CAAC,CAAA;AACxD,CAAA;AAEA,SAASC,mBAAmBA,CAACH,OAAmB,EAAU;AACxD,EAAA,OAAOA,OAAO,CAACE,EAAE,KAAK,UAAU,GAAGF,OAAO,CAACI,WAAW,CAAC,CAAC,CAAC,CAACC,IAAI,GAAGL,OAAO,CAACM,UAAU,CAACD,IAAI,CAAA;AAC1F,CAAA;;AAEA;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;AACA;AACA;AACA;AACO,SAASE,YAAYA,CAACC,UAAsB,EAAU;AAC3D,EAAA,MAAMR,OAAO,GAAGS,MAAM,CAACC,MAAM,CAC3B;IACEjB,IAAI,EAAED,MAAM,CAACC,IAAI;IACjBC,SAAS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ACG,KAAK,CAACC,WAAW,CAAC5E,UAAU,CAAC,CAAA;IACvD,OAAO,CAAC0E,MAAM,IAAI,CAACA,MAAM,CAACG,QAAQ,IAAIjB,OAAO,CAACc,MAAM,CAACG,QAAQ,CAAChB,OAAO,EAAE,IAAI,CAACvE,MAAM,CAAC0F,mBAAmB,CAAC,CAAA;AACzG,GAAA;AACF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { assert } from '@ember/debug';\n\nimport type Store from '@ember-data/store';\nimport { StableDocumentIdentifier } from '@ember-data/types/cache/identifier';\n\n/**\n * Simple utility function to assist in url building,\n * query params, and other common request operations.\n *\n * These primitives may be used directly or composed\n * by request builders to provide a consistent interface\n * for building requests.\n *\n * For instance:\n *\n * ```ts\n * import { buildBaseURL, buildQueryParams } from '@ember-data/request-utils';\n *\n * const baseURL = buildBaseURL({\n * host: 'https://api.example.com',\n * namespace: 'api/v1',\n * resourcePath: 'emberDevelopers',\n * op: 'query',\n * identifier: { type: 'ember-developer' }\n * });\n * const url = `${baseURL}?${buildQueryParams({ name: 'Chris', include:['pets'] })}`;\n * // => 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris'\n * ```\n *\n * This is useful, but not as useful as the REST request builder for query which is sugar\n * over this (and more!):\n *\n * ```ts\n * import { query } from '@ember-data/rest/request';\n *\n * const options = query('ember-developer', { name: 'Chris', include:['pets'] });\n * // => { url: 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris' }\n * // Note: options will also include other request options like headers, method, etc.\n * ```\n *\n * @module @ember-data/request-utils\n * @main @ember-data/request-utils\n * @public\n */\n\n// prevents the final constructed object from needing to add\n// host and namespace which are provided by the final consuming\n// class to the prototype which can result in overwrite errors\n\ninterface BuildURLConfig {\n host: string | null;\n namespace: string | null;\n}\n\nlet CONFIG: BuildURLConfig = {\n host: '',\n namespace: '',\n};\n\n/**\n * Sets the global configuration for `buildBaseURL`\n * for host and namespace values for the application.\n *\n * These values may still be overridden by passing\n * them to buildBaseURL directly.\n *\n * This method may be called as many times as needed\n *\n * ```ts\n * type BuildURLConfig = {\n * host: string;\n * namespace: string'\n * }\n * ```\n *\n * @method setBuildURLConfig\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {BuildURLConfig} config\n * @returns void\n */\nexport function setBuildURLConfig(config: BuildURLConfig) {\n CONFIG = config;\n}\n\nexport interface FindRecordUrlOptions {\n op: 'findRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface QueryUrlOptions {\n op: 'query';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindManyUrlOptions {\n op: 'findMany';\n identifiers: { type: string; id: string }[];\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\nexport interface FindRelatedCollectionUrlOptions {\n op: 'findRelatedCollection';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface FindRelatedResourceUrlOptions {\n op: 'findRelatedRecord';\n identifier: { type: string; id: string };\n fieldPath: string;\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface CreateRecordUrlOptions {\n op: 'createRecord';\n identifier: { type: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface UpdateRecordUrlOptions {\n op: 'updateRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport interface DeleteRecordUrlOptions {\n op: 'deleteRecord';\n identifier: { type: string; id: string };\n resourcePath?: string;\n host?: string;\n namespace?: string;\n}\n\nexport type UrlOptions =\n | FindRecordUrlOptions\n | QueryUrlOptions\n | FindManyUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | CreateRecordUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions;\n\nconst OPERATIONS_WITH_PRIMARY_RECORDS = new Set([\n 'findRecord',\n 'findRelatedRecord',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n]);\n\nfunction isOperationWithPrimaryRecord(\n options: UrlOptions\n): options is\n | FindRecordUrlOptions\n | FindRelatedCollectionUrlOptions\n | FindRelatedResourceUrlOptions\n | UpdateRecordUrlOptions\n | DeleteRecordUrlOptions {\n return OPERATIONS_WITH_PRIMARY_RECORDS.has(options.op);\n}\n\nfunction resourcePathForType(options: UrlOptions): string {\n return options.op === 'findMany' ? options.identifiers[0].type : options.identifier.type;\n}\n\n/**\n * Builds a URL for a request based on the provided options.\n * Does not include support for building query params (see `buildQueryParams`)\n * so that it may be composed cleanly with other query-params strategies.\n *\n * Usage:\n *\n * ```ts\n * import { buildBaseURL } from '@ember-data/request-utils';\n *\n * const url = buildBaseURL({\n * host: 'https://api.example.com',\n * namespace: 'api/v1',\n * resourcePath: 'emberDevelopers',\n * op: 'query',\n * identifier: { type: 'ember-developer' }\n * });\n *\n * // => 'https://api.example.com/api/v1/emberDevelopers'\n * ```\n *\n * On the surface this may seem like a lot of work to do something simple, but\n * it is designed to be composable with other utilities and interfaces that the\n * average product engineer will never need to see or use.\n *\n * A few notes:\n *\n * - `resourcePath` is optional, but if it is not provided, `identifier.type` will be used.\n * - `host` and `namespace` are optional, but if they are not provided, the values globally\n * configured via `setBuildURLConfig` will be used.\n * - `op` is required and must be one of the following:\n * - 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'\n * - Depending on the value of `op`, `identifier` or `identifiers` will be required.\n *\n * @method buildBaseURL\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param urlOptions\n * @returns string\n */\nexport function buildBaseURL(urlOptions: UrlOptions): string {\n const options = Object.assign(\n {\n host: CONFIG.host,\n namespace: CONFIG.namespace,\n },\n urlOptions\n );\n assert(\n `buildBaseURL: You must pass \\`op\\` as part of options`,\n typeof options.op === 'string' && options.op.length > 0\n );\n assert(\n `buildBaseURL: You must pass \\`identifier\\` as part of options`,\n options.op === 'findMany' || (options.identifier && typeof options.identifier === 'object')\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n options.op !== 'findMany' ||\n (options.identifiers &&\n Array.isArray(options.identifiers) &&\n options.identifiers.length > 0 &&\n options.identifiers.every((i) => i && typeof i === 'object'))\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'id'`,\n !isOperationWithPrimaryRecord(options) ||\n (typeof options.identifier.id === 'string' && options.identifier.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass \\`identifiers\\` as part of options`,\n options.op !== 'findMany' || options.identifiers.every((i) => typeof i.id === 'string' && i.id.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifier\\` as part of options, expected 'type'`,\n options.op === 'findMany' || (typeof options.identifier.type === 'string' && options.identifier.type.length > 0)\n );\n assert(\n `buildBaseURL: You must pass valid \\`identifiers\\` as part of options, expected 'type'`,\n options.op !== 'findMany' ||\n (typeof options.identifiers[0].type === 'string' && options.identifiers[0].type.length > 0)\n );\n\n // prettier-ignore\n const idPath: string =\n isOperationWithPrimaryRecord(options) ? encodeURIComponent(options.identifier.id)\n : '';\n const resourcePath = options.resourcePath || resourcePathForType(options);\n const { host, namespace } = options;\n const fieldPath = 'fieldPath' in options ? options.fieldPath : '';\n\n assert(\n `buildBaseURL: You tried to build a ${String(\n (options as { op: string }).op\n )} request to ${resourcePath} but op must be one of \"${[\n 'findRecord',\n 'findRelatedRecord',\n 'findRelatedCollection',\n 'updateRecord',\n 'deleteRecord',\n 'createRecord',\n 'query',\n 'findMany',\n ].join('\",\"')}\".`,\n [\n 'findRecord',\n 'query',\n 'findMany',\n 'findRelatedCollection',\n 'findRelatedRecord',\n 'createRecord',\n 'updateRecord',\n 'deleteRecord',\n ].includes(options.op)\n );\n\n assert(`buildBaseURL: host must NOT end with '/', received '${host}'`, host === '/' || !host.endsWith('/'));\n assert(`buildBaseURL: namespace must NOT start with '/', received '${namespace}'`, !namespace.startsWith('/'));\n assert(`buildBaseURL: namespace must NOT end with '/', received '${namespace}'`, !namespace.endsWith('/'));\n assert(\n `buildBaseURL: resourcePath must NOT start with '/', received '${resourcePath}'`,\n !resourcePath.startsWith('/')\n );\n assert(`buildBaseURL: resourcePath must NOT end with '/', received '${resourcePath}'`, !resourcePath.endsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT start with '/', received '${fieldPath}'`, !fieldPath.startsWith('/'));\n assert(`buildBaseURL: fieldPath must NOT end with '/', received '${fieldPath}'`, !fieldPath.endsWith('/'));\n assert(`buildBaseURL: idPath must NOT start with '/', received '${idPath}'`, !idPath.startsWith('/'));\n assert(`buildBaseURL: idPath must NOT end with '/', received '${idPath}'`, !idPath.endsWith('/'));\n\n const url = [host === '/' ? '' : host, namespace, resourcePath, idPath, fieldPath].filter(Boolean).join('/');\n return host ? url : `/${url}`;\n}\n\ntype SerializablePrimitive = string | number | boolean | null;\ntype Serializable = SerializablePrimitive | SerializablePrimitive[];\nexport type QueryParamsSerializationOptions = {\n arrayFormat?: 'bracket' | 'indices' | 'repeat' | 'comma';\n};\nexport type QueryParamsSource = Record<string, Serializable> | URLSearchParams;\n\nconst DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS: QueryParamsSerializationOptions = {\n arrayFormat: 'comma',\n};\n\nfunction handleInclude(include: string | string[]): string[] {\n assert(\n `Expected include to be a string or array, got ${typeof include}`,\n typeof include === 'string' || Array.isArray(include)\n );\n return typeof include === 'string' ? include.split(',') : include;\n}\n\n/**\n * filter out keys of an object that have falsy values or point to empty arrays\n * returning a new object with only those keys that have truthy values / non-empty arrays\n *\n * @method filterEmpty\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {Record<string, Serializable>} source object to filter keys with empty values from\n * @returns {Record<string, Serializable>} A new object with the keys that contained empty values removed\n */\nexport function filterEmpty(source: Record<string, Serializable>): Record<string, Serializable> {\n const result: Record<string, Serializable> = {};\n for (const key in source) {\n const value = source[key];\n // Allow `0` and `false` but filter falsy values that indicate \"empty\"\n if (value !== undefined && value !== null && value !== '') {\n if (!Array.isArray(value) || value.length > 0) {\n result[key] = source[key];\n }\n }\n }\n return result;\n}\n\n/**\n * Sorts query params by both key and value returning a new URLSearchParams\n * object with the keys inserted in sorted order.\n *\n * Treats `included` specially, splicing it into an array if it is a string and sorting the array.\n *\n * Options:\n * - arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n *\n * 'bracket': appends [] to the key for every value e.g. `&ids[]=1&ids[]=2`\n * 'indices': appends [i] to the key for every value e.g. `&ids[0]=1&ids[1]=2`\n * 'repeat': appends the key for every value e.g. `&ids=1&ids=2`\n * 'comma' (default): appends the key once with a comma separated list of values e.g. `&ids=1,2`\n *\n * @method sortQueryParams\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {URLSearchParams | object} params\n * @param {object} options\n * @returns {URLSearchParams} A URLSearchParams with keys inserted in sorted order\n */\nexport function sortQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): URLSearchParams {\n options = Object.assign({}, DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS, options);\n const paramsIsObject = !(params instanceof URLSearchParams);\n const urlParams = new URLSearchParams();\n const dictionaryParams: Record<string, Serializable> = paramsIsObject ? params : {};\n\n if (!paramsIsObject) {\n params.forEach((value, key) => {\n const hasExisting = key in dictionaryParams;\n if (!hasExisting) {\n dictionaryParams[key] = value;\n } else {\n const existingValue = dictionaryParams[key];\n if (Array.isArray(existingValue)) {\n existingValue.push(value);\n } else {\n dictionaryParams[key] = [existingValue, value];\n }\n }\n });\n }\n\n if ('include' in dictionaryParams) {\n dictionaryParams.include = handleInclude(dictionaryParams.include as string | string[]);\n }\n\n const sortedKeys = Object.keys(dictionaryParams).sort();\n sortedKeys.forEach((key) => {\n const value = dictionaryParams[key];\n if (Array.isArray(value)) {\n value.sort();\n switch (options!.arrayFormat) {\n case 'indices':\n value.forEach((v, i) => {\n urlParams.append(`${key}[${i}]`, String(v));\n });\n return;\n case 'bracket':\n value.forEach((v) => {\n urlParams.append(`${key}[]`, String(v));\n });\n return;\n case 'repeat':\n value.forEach((v) => {\n urlParams.append(key, String(v));\n });\n return;\n case 'comma':\n default:\n urlParams.append(key, value.join(','));\n return;\n }\n } else {\n urlParams.append(key, String(value));\n }\n });\n\n return urlParams;\n}\n\n/**\n * Sorts query params by both key and value, returning a query params string\n *\n * Treats `included` specially, splicing it into an array if it is a string and sorting the array.\n *\n * Options:\n * - arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n *\n * 'bracket': appends [] to the key for every value e.g. `ids[]=1&ids[]=2`\n * 'indices': appends [i] to the key for every value e.g. `ids[0]=1&ids[1]=2`\n * 'repeat': appends the key for every value e.g. `ids=1&ids=2`\n * 'comma' (default): appends the key once with a comma separated list of values e.g. `ids=1,2`\n *\n * @method sortQueryParams\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {URLSearchParams | object} params\n * @param {object} [options]\n * @returns {string} A sorted query params string without the leading `?`\n */\nexport function buildQueryParams(params: QueryParamsSource, options?: QueryParamsSerializationOptions): string {\n return sortQueryParams(params, options).toString();\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\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 * @method parseCacheControl\n * @static\n * @public\n * @for @ember-data/request-utils\n * @param {string} header\n * @returns {CacheControlValue}\n */\nexport function parseCacheControl(header: string): CacheControlValue {\n let key = '';\n let value = '';\n let isParsingKey = true;\n let cacheControlValue: CacheControlValue = {};\n\n function 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 return parsedValue;\n }\n\n for (let i = 0; i < header.length; i++) {\n let 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 cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;\n key = '';\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 cacheControlValue[key] = NUMERIC_KEYS.has(key) ? parseCacheControlValue(value) : true;\n }\n }\n\n return cacheControlValue;\n}\n\nfunction isStale(headers: Headers, expirationTime: number): boolean {\n // const age = headers.get('age');\n // const cacheControl = parseCacheControl(headers.get('cache-control') || '');\n // const expires = headers.get('expires');\n // const lastModified = headers.get('last-modified');\n const date = headers.get('date');\n\n if (!date) {\n return true;\n }\n\n const time = new Date(date).getTime();\n const now = Date.now();\n const deadline = time + expirationTime;\n\n const result = now > deadline;\n\n return result;\n}\n\nexport type LifetimesConfig = { apiCacheSoftExpires: number; apiCacheHardExpires: number };\n\n/**\n * A basic LifetimesService 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 * 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 `@ember-data/request/fetch` will automatically\n * add the `date` header to responses if it is not present.\n *\n * Usage:\n *\n * ```ts\n * import { LifetimesService } from '@ember-data/request-utils';\n * import DataStore from '@ember-data/store';\n *\n * // ...\n *\n * export class Store extends DataStore {\n * constructor(args) {\n * super(args);\n * this.lifetimes = new LifetimesService(this, { apiCacheSoftExpires: 30_000, apiCacheHardExpires: 60_000 });\n * }\n * }\n * ```\n *\n * @class LifetimesService\n * @public\n * @module @ember-data/request-utils\n */\n// TODO this doesn't get documented correctly on the website because it shares a class name\n// with the interface expected by the Store service\nexport class LifetimesService {\n declare store: Store;\n declare config: LifetimesConfig;\n constructor(store: Store, config: LifetimesConfig) {\n this.store = store;\n this.config = config;\n }\n\n isHardExpired(identifier: StableDocumentIdentifier): boolean {\n const cached = this.store.cache.peekRequest(identifier);\n return !cached || !cached.response || isStale(cached.response.headers, this.config.apiCacheHardExpires);\n }\n isSoftExpired(identifier: StableDocumentIdentifier): boolean {\n const cached = this.store.cache.peekRequest(identifier);\n return !cached || !cached.response || isStale(cached.response.headers, this.config.apiCacheSoftExpires);\n }\n}\n"],"names":["CONFIG","host","namespace","setBuildURLConfig","config","OPERATIONS_WITH_PRIMARY_RECORDS","Set","isOperationWithPrimaryRecord","options","has","op","resourcePathForType","identifiers","type","identifier","buildBaseURL","urlOptions","Object","assign","assert","length","Array","isArray","every","i","id","idPath","encodeURIComponent","resourcePath","fieldPath","String","join","includes","endsWith","startsWith","url","filter","Boolean","DEFAULT_QUERY_PARAMS_SERIALIZATION_OPTIONS","arrayFormat","handleInclude","include","split","filterEmpty","source","result","key","value","undefined","sortQueryParams","params","paramsIsObject","URLSearchParams","urlParams","dictionaryParams","forEach","hasExisting","existingValue","push","sortedKeys","keys","sort","v","append","buildQueryParams","toString","NUMERIC_KEYS","parseCacheControl","header","isParsingKey","cacheControlValue","parseCacheControlValue","stringToParse","parsedValue","Number","parseInt","isNaN","char","charAt","isStale","headers","expirationTime","date","get","time","Date","getTime","now","deadline","LifetimesService","constructor","store","isHardExpired","cached","cache","peekRequest","response","apiCacheHardExpires","isSoftExpired","apiCacheSoftExpires"],"mappings":";;AAKA;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;AACA;;AAEA;AACA;AACA;AAOA,IAAIA,MAAsB,GAAG;AAC3BC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,SAAS,EAAE,EAAA;AACb,CAAC,CAAA;;AAED;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,MAAsB,EAAE;AACxDJ,EAAAA,MAAM,GAAGI,MAAM,CAAA;AACjB,CAAA;AA6EA,MAAMC,+BAA+B,GAAG,IAAIC,GAAG,CAAC,CAC9C,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,cAAc,CACf,CAAC,CAAA;AAEF,SAASC,4BAA4BA,CACnCC,OAAmB,EAMM;AACzB,EAAA,OAAOH,+BAA+B,CAACI,GAAG,CAACD,OAAO,CAACE,EAAE,CAAC,CAAA;AACxD,CAAA;AAEA,SAASC,mBAAmBA,CAACH,OAAmB,EAAU;AACxD,EAAA,OAAOA,OAAO,CAACE,EAAE,KAAK,UAAU,GAAGF,OAAO,CAACI,WAAW,CAAC,CAAC,CAAC,CAACC,IAAI,GAAGL,OAAO,CAACM,UAAU,CAACD,IAAI,CAAA;AAC1F,CAAA;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM4C,gBAAgB,CAAC;AAG5BC,EAAAA,WAAWA,CAACC,KAAY,EAAEvF,MAAuB,EAAE;IACjD,IAAI,CAACuF,KAAK,GAAGA,KAAK,CAAA;IAClB,IAAI,CAACvF,MAAM,GAAGA,MAAM,CAAA;AACtB,GAAA;EAEAwF,aAAaA,CAAC9E,UAAoC,EAAW;IAC3D,MAAM+E,MAAM,GAAG,IAAI,CAACF,KAAK,CAACG,KAAK,CAACC,WAAW,CAACjF,UAAU,CAAC,CAAA;IACvD,OAAO,CAAC+E,MAAM,IAAI,CAACA,MAAM,CAACG,QAAQ,IAAIjB,OAAO,CAACc,MAAM,CAACG,QAAQ,CAAChB,OAAO,EAAE,IAAI,CAAC5E,MAAM,CAAC6F,mBAAmB,CAAC,CAAA;AACzG,GAAA;EACAC,aAAaA,CAACpF,UAAoC,EAAW;IAC3D,MAAM+E,MAAM,GAAG,IAAI,CAACF,KAAK,CAACG,KAAK,CAACC,WAAW,CAACjF,UAAU,CAAC,CAAA;IACvD,OAAO,CAAC+E,MAAM,IAAI,CAACA,MAAM,CAACG,QAAQ,IAAIjB,OAAO,CAACc,MAAM,CAACG,QAAQ,CAAChB,OAAO,EAAE,IAAI,CAAC5E,MAAM,CAAC+F,mBAAmB,CAAC,CAAA;AACzG,GAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ember-data/request-utils",
3
3
  "description": "Request Building Utilities for use with EmberData",
4
- "version": "5.4.0-alpha.9",
4
+ "version": "5.4.0-beta.1",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "author": "Chris Thoburn <runspired@users.noreply.github.com>",
@@ -38,19 +38,19 @@
38
38
  "version": 1
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/cli": "^7.22.10",
42
- "@babel/core": "^7.22.11",
43
- "@babel/plugin-proposal-decorators": "^7.22.10",
41
+ "@babel/cli": "^7.22.15",
42
+ "@babel/core": "^7.22.20",
43
+ "@babel/plugin-proposal-decorators": "^7.22.15",
44
44
  "@babel/plugin-transform-class-properties": "^7.22.5",
45
- "@babel/plugin-transform-runtime": "^7.22.10",
46
- "@babel/plugin-transform-typescript": "^7.22.11",
47
- "@babel/preset-env": "^7.22.14",
48
- "@babel/preset-typescript": "^7.22.11",
49
- "@babel/runtime": "^7.22.11",
45
+ "@babel/plugin-transform-runtime": "^7.22.15",
46
+ "@babel/plugin-transform-typescript": "^7.22.15",
47
+ "@babel/preset-env": "^7.22.20",
48
+ "@babel/preset-typescript": "^7.22.15",
49
+ "@babel/runtime": "^7.22.15",
50
50
  "@embroider/addon-dev": "^4.1.0",
51
51
  "@rollup/plugin-babel": "^6.0.3",
52
52
  "@rollup/plugin-node-resolve": "^15.2.1",
53
- "rollup": "^3.28.1",
53
+ "rollup": "^3.29.3",
54
54
  "tslib": "^2.6.2",
55
55
  "typescript": "^5.2.2",
56
56
  "walk-sync": "^3.0.0"