{"_id":"@abcnews/terminus-fetch","_rev":"46-d8082cc0b4c5dc529c276d84bceae008","name":"@abcnews/terminus-fetch","dist-tags":{"latest":"7.1.0"},"versions":{"5.0.0":{"name":"@abcnews/terminus-fetch","version":"5.0.0","license":"MIT","_id":"@abcnews/terminus-fetch@5.0.0","maintainers":[{"name":"phocks","email":"phocks@gmail.com"},{"name":"andrewkesper","email":"andy@andrewkesper.com"},{"name":"drzax","email":"simon@elvery.net"},{"name":"colingourlay","email":"colin@colin-gourlay.com"}],"contributors":[{"name":"Colin Gourlay","email":"Gourlay.Colin@abc.net.au"}],"homepage":"https://github.com/abcnews/terminus-fetch#readme","bugs":{"url":"https://github.com/abcnews/terminus-fetch/issues"},"dist":{"shasum":"a19fd869eb68cbf74182ad0c687ac90526255908","tarball":"https://registry.npmjs.org/@abcnews/terminus-fetch/-/terminus-fetch-5.0.0.tgz","fileCount":17,"integrity":"sha512-LXgbGWfxLy5lKoVRxh+F9csbNQ/48xV2fqJl1+d5w/gHCSz17ujjZlSg+/Bvsvi19sdnSFbi3HzHZYHS4tf6wg==","signatures":[{"sig":"MEYCIQChj7tx93F8sQRQTpY3wdBz4fBUqRftEBrt9QRG2LR8QgIhANlAE726T96zqsJTXccCuRLyIEuwvZnS6AIsu1DSAcD1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118249,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjj/A3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo61g/+Lt+oE6XR94Szz4IUb2zQ/fv1HqWjAUkdVmifioj2NHD4+czh\r\nV/6KoJG9MLWWQcyPCujhHtvDFekfJfFYuabZunyc4PDBweNlPEjNIKd/rDf2\r\nWaFvOxO5ZqzdxIyIPEcMLuGA61kTuIo9CB91jLlFve9+4tOkZsfdm7/2bQKK\r\nHTsP18hfAx517VfMtf1Gv++VU70lhRb+e/dpCgLEB4QwnmyUeIsRUuktXvPk\r\nxDp0Y9sg7QRfJ6lAzEuju8hh3x5Le9jPDskksmgOPqw2ieI8LdBRMGVotU3N\r\nDnTkpB1+cI9FDCnla3pdrJsfPIAquqtmQUPBqttQVe/sfvgShJmrenmXACxt\r\nI+m49Ui8lS6PHpzcCVsNFHvsg9dLaxH3sp6UZY7l4SCHtkH2Et3RfhTyUvpx\r\nXW+A3Rd/X47ehp5PdKFUss5MwlbY6g2edtVkCg7Azd13nYZaK6AfVVu4Nk6Z\r\nHy5U6Y5OB3JywVBeRY3B36VTi+GFXt8NVv0iGr72TeOKFFn/VxutmoP0QuLt\r\n8JwS2PKj6epODg+Vh/fJawBHdvgtZurYOAHkg4h1pojkcIPjED/EVCptRWej\r\nQsY4TmeELluDwDhaH6erVTxkTQJ6TjTT53bboPCJXVabkg0/p2Tic5M1GjUC\r\ngaSwqpjGC+rLNs1de6wD+A0J4IVq9aVmmUo=\r\n=9qjp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","alias":{"lib":"./src/index"},"husky":{"hooks":{"pre-commit":"tsdx lint src"}},"types":"dist/index.d.ts","module":"dist/terminus-fetch.esm.js","gitHead":"d4a74272be9d538a067c4b92238177403d34b897","scripts":{"lint":"tsdx lint src","test":"tsdx test","build":"tsdx build","start":"tsdx watch","example":"parcel serve example/index.html --out-dir example/dist","release":"np","prepublishOnly":"npm run build"},"_npmUser":{"name":"colingourlay","email":"colin@colin-gourlay.com"},"repository":{"url":"git+https://github.com/abcnews/terminus-fetch.git","type":"git"},"_npmVersion":"8.19.2","description":"Grab a document from the Preview / Live Terminus content API, based on the current execution domain","directories":{},"_nodeVersion":"18.11.0","dependencies":{"@abcnews/env-utils":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^7.4.0","tsdx":"^0.14.1","husky":"^5.1.3","tslib":"^2.1.0","rollup":"^2.40.0","typescript":"^4.2.2","@babel/core":"^7.13.8","@types/node":"^18.11.10","parcel-bundler":"^1.12.4"},"_npmOperationalInternal":{"tmp":"tmp/terminus-fetch_5.0.0_1670377527038_0.5672580721418128","host":"s3://npm-registry-packages"}},"6.0.0":{"name":"@abcnews/terminus-fetch","version":"6.0.0","license":"MIT","_id":"@abcnews/terminus-fetch@6.0.0","maintainers":[{"name":"ashkyd","email":"ash@kyd.com.au"},{"name":"jtfell","email":"hi@jtfell.com"},{"name":"phocks","email":"phocks@gmail.com"},{"name":"andrewkesper","email":"andy@andrewkesper.com"},{"name":"drzax","email":"simon@elvery.net"}],"contributors":[{"name":"Colin Gourlay","email":"Gourlay.Colin@abc.net.au"}],"homepage":"https://github.com/abcnews/terminus-fetch#readme","bugs":{"url":"https://github.com/abcnews/terminus-fetch/issues"},"dist":{"shasum":"779d46683c9a1aa8aaf993e9c24ad93dad017e0c","tarball":"https://registry.npmjs.org/@abcnews/terminus-fetch/-/terminus-fetch-6.0.0.tgz","fileCount":9,"integrity":"sha512-iH7WgZTQJ4180ZdZvoQXOy1AxLSAo3RblCO1Rf30iyb1X7bIvxRcJcEzNkD4GfJfnSt95BWDTkr6HsnOGswh5w==","signatures":[{"sig":"MEYCIQCB8oXz17jcBm8KXKJyp7Z/y/FQRFX7aIC9nTWlOD/G/QIhAOlgMR7RnrUCscqstrqFXrnwh7ta97A6iysqJUZzbdEi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59885},"main":"dist/index.js","alias":{"lib":"./src/index"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"gitHead":"d2bd33e3ab22472f65fe4c8e2e7ccfdb81519377","scripts":{"lint":"eslint src","size":"npm run build && size-limit","test":"jest --coverage","build":"tsup src/index.ts --dts --sourcemap --format esm,cjs","start":"tsup src/index.ts --dts --sourcemap --format esm,cjs --watch","prepare":"husky install","release":"np","prepublishOnly":"npm run build"},"_npmUser":{"name":"drzax","email":"simon@elvery.net"},"repository":{"url":"git+https://github.com/abcnews/terminus-fetch.git","type":"git"},"size-limit":[{"path":"dist/index.mjs","limit":"3 KB"},{"path":"dist/index.js","limit":"4 KB"}],"_npmVersion":"9.6.7","description":"Grab a document from the Preview / Live Terminus content API, based on the current execution domain","directories":{},"_nodeVersion":"20.3.0","dependencies":{"@abcnews/env-utils":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^8.0.4","jest":"^29.7.0","tsup":"^7.3.0","husky":"^8.0.3","tslib":"^2.1.0","eslint":"^8.53.0","ts-jest":"^29.1.1","size-limit":"^11.0.0","typescript":"^5.2.2","@types/jest":"^29.5.8","@types/node":"^18.11.10","jest-environment-jsdom":"^29.7.0","@size-limit/preset-small-lib":"^11.0.0","@typescript-eslint/eslint-plugin":"^6.11.0"},"_npmOperationalInternal":{"tmp":"tmp/terminus-fetch_6.0.0_1700203759563_0.8021772619992047","host":"s3://npm-registry-packages"}},"6.0.1":{"name":"@abcnews/terminus-fetch","version":"6.0.1","license":"MIT","_id":"@abcnews/terminus-fetch@6.0.1","maintainers":[{"name":"ashkyd","email":"ash@kyd.com.au"},{"name":"jtfell","email":"hi@jtfell.com"},{"name":"phocks","email":"phocks@gmail.com"},{"name":"andrewkesper","email":"andy@andrewkesper.com"},{"name":"drzax","email":"simon@elvery.net"}],"contributors":[{"name":"Colin Gourlay","email":"Gourlay.Colin@abc.net.au"}],"homepage":"https://github.com/abcnews/terminus-fetch#readme","bugs":{"url":"https://github.com/abcnews/terminus-fetch/issues"},"dist":{"shasum":"eb44fa5019a8d8c6db47b62e0d1dc7e6112649dc","tarball":"https://registry.npmjs.org/@abcnews/terminus-fetch/-/terminus-fetch-6.0.1.tgz","fileCount":9,"integrity":"sha512-Zo63eMF/Y+RFLSXX40MFjdWoY8952X4yRhEnZUAEQAI80CDd6QuybyiEd6jmN9LsZ+ND17z+QzHMoZNggMdTPQ==","signatures":[{"sig":"MEYCIQDbgdqnQD4Jtm8BB2NBR+mELHjtueYUyuuqrHa4KGisnwIhAM/v8HLrv49RFKJFqBMlqjtgCgwLkjq7nj0n9Gzfgxux","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":59953},"main":"dist/index.js","alias":{"lib":"./src/index"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"gitHead":"9f4189b9a9cfb048524cc3cf8f3570ef0836529b","scripts":{"lint":"eslint src","size":"npm run build && size-limit","test":"jest --coverage","build":"tsup src/index.ts --dts --sourcemap --format esm,cjs","start":"tsup src/index.ts --dts --sourcemap --format esm,cjs --watch","prepare":"husky","release":"np","prepublishOnly":"npm run build"},"_npmUser":{"name":"drzax","email":"simon@elvery.net"},"repository":{"url":"git+https://github.com/abcnews/terminus-fetch.git","type":"git"},"size-limit":[{"path":"dist/index.mjs","limit":"3 KB"},{"path":"dist/index.js","limit":"4 KB"}],"_npmVersion":"10.5.0","description":"Grab a document from the Preview / Live Terminus content API, based on the current execution domain","directories":{},"_nodeVersion":"21.7.1","dependencies":{"@abcnews/env-utils":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^10.0.2","jest":"^29.7.0","tsup":"^8.0.2","husky":"^9.0.11","tslib":"^2.1.0","eslint":"^8.53.0","ts-jest":"^29.1.1","size-limit":"^11.0.0","typescript":"^5.2.2","@types/jest":"^29.5.8","@types/node":"^20.12.4","jest-environment-jsdom":"^29.7.0","@size-limit/preset-small-lib":"^11.0.0","@typescript-eslint/eslint-plugin":"^7.5.0"},"_npmOperationalInternal":{"tmp":"tmp/terminus-fetch_6.0.1_1712204738726_0.36000397817547314","host":"s3://npm-registry-packages"}},"7.0.0":{"name":"@abcnews/terminus-fetch","version":"7.0.0","license":"MIT","_id":"@abcnews/terminus-fetch@7.0.0","maintainers":[{"name":"ashkyd","email":"ash@kyd.com.au"},{"name":"jtfell","email":"hi@jtfell.com"},{"name":"phocks","email":"phocks@gmail.com"},{"name":"andrewkesper","email":"andy@andrewkesper.com"},{"name":"drzax","email":"simon@elvery.net"}],"contributors":[{"name":"Colin Gourlay","email":"Gourlay.Colin@abc.net.au"}],"homepage":"https://github.com/abcnews/terminus-fetch#readme","bugs":{"url":"https://github.com/abcnews/terminus-fetch/issues"},"dist":{"shasum":"c42da556be005d39eb1a08da502b110401a93acd","tarball":"https://registry.npmjs.org/@abcnews/terminus-fetch/-/terminus-fetch-7.0.0.tgz","fileCount":9,"integrity":"sha512-8mXsd79cfcjg0kqHlxw8xUn0GGuyZQcSHwbxjGVOetA7XU7W+7ne3DTRWIsNrtqbB7CtUT7KswkQC4iuqI1eoA==","signatures":[{"sig":"MEUCIQC/45HoqkgoxwPhv+LvKkOzUc4RUkb9slauRrShEiIP8gIgRk3uw6HJ5dy1yO2xSJKJY3YU2o+nBobWt9hsuvQMdLc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53104},"main":"dist/index.js","alias":{"lib":"./src/index"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=18"},"gitHead":"9862d8cfd09428f7d079991e72036ec3bb0805ea","scripts":{"lint":"eslint src","size":"npm run build && size-limit","test":"jest --coverage","build":"tsup src/index.ts --dts --sourcemap --format esm,cjs","start":"tsup src/index.ts --dts --sourcemap --format esm,cjs --watch","prepare":"husky","release":"np","prepublishOnly":"npm run build"},"_npmUser":{"name":"drzax","email":"simon@elvery.net"},"repository":{"url":"git+https://github.com/abcnews/terminus-fetch.git","type":"git"},"size-limit":[{"path":"dist/index.mjs","limit":"3 KB"},{"path":"dist/index.js","limit":"4 KB"}],"_npmVersion":"10.8.2","description":"Grab a document from the Preview / Live Terminus content API, based on the current execution domain","directories":{},"_nodeVersion":"22.8.0","dependencies":{"@abcnews/env-utils":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^10.0.2","jest":"^29.7.0","tsup":"^8.0.2","husky":"^9.0.11","tslib":"^2.1.0","eslint":"^8.53.0","ts-jest":"^29.1.1","size-limit":"^11.0.0","typescript":"^5.2.2","@types/jest":"^29.5.8","@types/node":"^20.12.4","jest-environment-jsdom":"^29.7.0","@size-limit/preset-small-lib":"^11.0.0","@typescript-eslint/eslint-plugin":"^7.5.0"},"_npmOperationalInternal":{"tmp":"tmp/terminus-fetch_7.0.0_1728263228276_0.8832443085532091","host":"s3://npm-registry-packages"}},"7.1.0":{"name":"@abcnews/terminus-fetch","version":"7.1.0","description":"Grab a document from the Preview / Live Terminus content API, based on the current execution domain","license":"MIT","engines":{"node":">=18"},"contributors":[{"name":"Colin Gourlay","email":"Gourlay.Colin@abc.net.au"}],"repository":{"type":"git","url":"git+https://github.com/abcnews/terminus-fetch.git"},"bugs":{"url":"https://github.com/abcnews/terminus-fetch/issues"},"main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","alias":{"lib":"./src/index"},"size-limit":[{"path":"dist/index.mjs","limit":"3 KB"},{"path":"dist/index.js","limit":"4 KB"}],"husky":{"hooks":{"pre-commit":"npm run lint"}},"publishConfig":{"access":"public"},"scripts":{"start":"tsup src/index.ts --dts --sourcemap --format esm,cjs --watch","build":"tsup src/index.ts --dts --sourcemap --format esm,cjs","test":"jest --coverage","lint":"eslint src","prepare":"husky","size":"npm run build && size-limit","prepublishOnly":"npm run build","release":"np"},"devDependencies":{"@size-limit/preset-small-lib":"^11.0.0","@types/jest":"^29.5.8","@types/node":"^20.12.4","@typescript-eslint/eslint-plugin":"^7.5.0","eslint":"^8.53.0","husky":"^9.0.11","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","np":"^10.0.2","size-limit":"^11.0.0","ts-jest":"^29.1.1","tslib":"^2.1.0","tsup":"^8.0.2","typescript":"^5.2.2"},"dependencies":{"@abcnews/env-utils":"^3.0.0"},"gitHead":"309b43989d2193c3838f40d304706c81d8969e6a","_id":"@abcnews/terminus-fetch@7.1.0","homepage":"https://github.com/abcnews/terminus-fetch#readme","_nodeVersion":"24.14.1","_npmVersion":"11.12.1","dist":{"integrity":"sha512-pak+Tbz1fGJ5Bm1ocI0rSrkzjZQKdM41uiniAOuNp+q3FeWJl7cUddIbihcZ3ucZqZ55s/Ds+DOatZDn3JL7cQ==","shasum":"167319c10dd9e1abe6bfffb251a12bf4d41da1f3","tarball":"https://registry.npmjs.org/@abcnews/terminus-fetch/-/terminus-fetch-7.1.0.tgz","fileCount":9,"unpackedSize":54558,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICP0BVOVZhSTYMgMQ9SWB9IWslM4+gMWGVmhkBE4txAfAiBiKRZocaDdKJOVjf2hdU9aEpUrNpRZzSZGxq0sW1gTYQ=="}]},"_npmUser":{"name":"ashkyd","email":"ash@kyd.com.au"},"directories":{},"maintainers":[{"name":"drzax","email":"simon@elvery.net"},{"name":"andrewkesper","email":"andy@andrewkesper.com"},{"name":"phocks","email":"phocks@gmail.com"},{"name":"jtfell","email":"hi@jtfell.com"},{"name":"ashkyd","email":"ash@kyd.com.au"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/terminus-fetch_7.1.0_1787200223481_0.17824213111580445"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-11T06:19:51.682Z","modified":"2026-08-20T04:30:23.846Z","1.0.0":"2019-07-11T06:19:51.892Z","1.1.0":"2019-07-11T23:15:15.423Z","1.2.0":"2019-07-12T00:38:17.419Z","1.2.1":"2019-07-12T01:35:03.805Z","1.3.0":"2019-08-12T01:00:06.584Z","1.4.0":"2019-08-12T05:04:38.471Z","2.0.0":"2020-02-26T00:54:24.561Z","2.1.0":"2020-12-15T03:20:17.924Z","2.1.1":"2021-01-12T05:28:28.581Z","2.1.2":"2021-02-19T03:29:19.395Z","2.1.3":"2021-02-19T03:35:58.831Z","3.0.0":"2021-03-02T04:40:36.579Z","3.1.0":"2021-03-03T03:01:42.811Z","4.0.0":"2021-03-08T00:32:22.991Z","4.0.1":"2021-03-22T05:56:36.076Z","5.0.0":"2022-12-07T01:45:27.198Z","6.0.0":"2023-11-17T06:49:19.751Z","6.0.1":"2024-04-04T04:25:38.907Z","7.0.0":"2024-10-07T01:07:08.494Z","7.1.0":"2026-08-20T04:30:23.659Z"},"bugs":{"url":"https://github.com/abcnews/terminus-fetch/issues"},"license":"MIT","homepage":"https://github.com/abcnews/terminus-fetch#readme","repository":{"type":"git","url":"git+https://github.com/abcnews/terminus-fetch.git"},"description":"Grab a document from the Preview / Live Terminus content API, based on the current execution domain","contributors":[{"name":"Colin Gourlay","email":"Gourlay.Colin@abc.net.au"}],"maintainers":[{"name":"drzax","email":"simon@elvery.net"},{"name":"andrewkesper","email":"andy@andrewkesper.com"},{"name":"phocks","email":"phocks@gmail.com"},{"name":"jtfell","email":"hi@jtfell.com"},{"name":"ashkyd","email":"ash@kyd.com.au"}],"readme":"# @abcnews/terminus-fetch\n\nFetch one or more documents from the Preview / Live Terminus content API, based on the current execution domain\n\n```sh\n$ npm i @abcnews/terminus-fetch\n```\n\n## Usage\n\nTo use this library, you must have a Terminus API key, and expose it on the enviromnent variable `TERMINUS_FETCH_API_KEY`. For `@abcnews/aunty`-based projects, we currently recommend placing it in a `.env` file in your project directory, so that it is bundled with your app.\n\n```js\nimport { fetchOne, search } from '@abcnews/terminus-fetch';\n\n// By default, we assume you want an Article document from Core Media so you can pass a CMID:\n\nfetchOne(10736062).then(console.log);\n// > { id: 10736062, docType: \"Article\", contentSource: \"coremedia\", ... }\n\n// ...or you can pass an options object to override the defaults (see API below):\n\nfetchOne({ id: 10734902, type: 'video' }).then(console.log);\n// > {id: 10734902, docType: \"Video\", contentSource: \"coremedia\", ... }\n\n// Searching is also supported:\n\nsearch({ limit: 3, doctype: 'image' })).then(console.log);\n// > [\n//     { id: 11405582, docType: \"Image\", contentSource: \"coremedia\", ... },\n//     { id: 11404970, docType: \"Image\", contentSource: \"coremedia\", ... },\n//     { id: 11405258, docType: \"Image\", contentSource: \"coremedia\", ... }\n//   ]\n\n// ...for all sources...:\n\nsearch({ limit: 1, source: 'mapi', service: 'triplej'})\n  .then(docs => {\n    console.log(docs);\n    // > [\n    //     { id: \"maaYa1B4YP\", docType: \"Artist\", ... },\n    //     { id: \"mpr9PpbkRd\", docType: \"Play\", ... },\n    //     { id: \"mtOKj2DbNK\", docType: \"Recording\", ... },\n    //     { id: \"mrDXgzL4Ry\", docType: \"Release\", ... }\n    //   ]\n  })\n  .catch(err => console.error(err));\n```\n\nIf your project's JS is currently executing in a page on a preview domain, requests will be made to Preview Terminus, otherwise they'll be made to Live Terminus.\n\nIf you want to direct a single request to Live Terminus, regardless of the current execution domain, pass `force: \"live\"` as an option.\n\nIf you want to direct a single request to Preview Terminus, regardless of the current execution domain, pass `force: \"preview\"` as an option.\n\nIf you want only need a document's metadata (e.g. an article without full text content), pass `isTeasable: true` as an option and the document will be fetched from the `/teasablecontent/` API, instead of the `/content/` API.\n\n## API\n\n### `fetchOne`\n\n```ts\ndeclare function fetchOne(\n  options:\n    | string\n    | number\n    | {\n        source?: string;\n        type?: string;\n        id?: string | number;\n        force?: 'preview' | 'live';\n        isTeasable?: string;\n      }\n): Promise<TerminusDocument>;\n```\n\nIf the `done` callback is omitted then the return value will be a Promise.\n\n#### Default options\n\n```js\n{\n  source: 'coremedia',\n  type: 'article',\n}\n```\n\n### `search`\n\n```ts\ndeclare function search(\n  options: {\n    source?: string;\n    force?: \"preview\" | \"live\";\n    ...searchParams: Object;\n  }\n): Promise<TerminusDocument[]>;\n```\n\n...where your `searchParams` are additional properties on your `options` object, to query the API.\n\nFor example, if you wanted the last 20 images added to Core Media, your `searchParams` would be:\n\n```js\n{\n  limit: 20,\n  doctype: 'image'\n}\n```\n\n#### Default options\n\nThese are the same as `fetchOne`, only split across two options arguments.\n\n### `getImages`\n\nThis takes an image document returned from terminus (Image, ImageProxy or CustomImage doctypes) and returns\na normalised object including available image renditions.\n\n```ts\ndeclare function getImages(doc: any, targetWidths?: number[]): ImageData;\n```\n\n#### `targetWidths` argument (optional)\n\nThere is no guarantee that the returned object will contain the widths requested using the `targetWidths` argument. Consumers of this library should always check the result to see if they got what they wanted and behave accordingly.\n\nDefault for this argument is: `[160, 240, 480, 700, 940, 1400, 2150]`\n\n_Note:_ There is no guarantee about which aspect ratios are available for a given image.\n\n#### Returned object\n\nThe results have the following type:\n\n```ts\ndeclare type ImageData = {\n  cmid: string;\n  title?: string;\n  alt?: string;\n  caption?: string;\n  attribution?: string;\n  canonicalURL: string;\n  defaultRatio?: string;\n  renditions: ImageRendition[];\n};\ndeclare type ImageRendition = {\n  width: number;\n  height: number;\n  ratio: string;\n  url: string;\n  isUndersizedBinary: boolean;\n};\n```\n\nThere are a couple of gotchas in here related to image proxies. The `cmid` and `canonicalURL` properties will be those of the proxy, not the target image.\n\nIt's possible that the binary URL a rendition points to is actually smaller than the dimensions in the object. This is because small originals are never upscaled by the image resizer, but can still be requested. This situation is flagged by the `isUndersizedBinary` property.\n\n### Releasing\n\n`npm run release` will handle version bumping, git pushing and npm publication for you.\n\n## Authors\n\n- Colin Gourlay ([Gourlay.Colin@abc.net.au](mailto:Gourlay.Colin@abc.net.au))\n","readmeFilename":"README.md"}