@agility/content-fetch 2.0.0-rc1 → 2.0.0-rc11

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.
Files changed (303) hide show
  1. package/.jsdoc.json +28 -28
  2. package/.yarn/cache/@babel-code-frame-npm-7.22.10-bc14e2ec1b-89a06534ad.zip +0 -0
  3. package/.yarn/cache/{@babel-core-npm-7.22.9-509b29c82e-7bf069aece.zip → @babel-core-npm-7.22.10-54c0aaa674-cc4efa0920.zip} +0 -0
  4. package/.yarn/cache/{@babel-generator-npm-7.22.9-d9fccf9328-7c9d2c58b8.zip → @babel-generator-npm-7.22.10-1a9a2f9e75-59a79730ab.zip} +0 -0
  5. package/.yarn/cache/{@babel-helper-compilation-targets-npm-7.22.9-b4473889ca-ea0006c6a9.zip → @babel-helper-compilation-targets-npm-7.22.10-20c2c02a4f-f6f1896816.zip} +0 -0
  6. package/.yarn/cache/{@babel-helpers-npm-7.22.6-8e54464b9e-5c1f33241f.zip → @babel-helpers-npm-7.22.10-83a2c2542a-3b1219e362.zip} +0 -0
  7. package/.yarn/cache/@babel-highlight-npm-7.22.10-cea13c397b-f714a1e1a7.zip +0 -0
  8. package/.yarn/cache/@babel-parser-npm-7.22.10-a7c9b29e4f-af51567b7d.zip +0 -0
  9. package/.yarn/cache/@babel-traverse-npm-7.22.10-9eaf5a4899-9f7b358563.zip +0 -0
  10. package/.yarn/cache/@dabh-diagnostics-npm-2.0.3-0f2cd64f24-4879600c55.zip +0 -0
  11. package/.yarn/cache/@esbuild-win32-x64-npm-0.19.2-faf4190546-8.zip +0 -0
  12. package/.yarn/cache/{@jridgewell-resolve-uri-npm-3.1.0-6ff2351e61-b5ceaaf9a1.zip → @jridgewell-resolve-uri-npm-3.1.1-aa2de3f210-f5b441fe79.zip} +0 -0
  13. package/.yarn/cache/{@jridgewell-trace-mapping-npm-0.3.18-cd96571385-0572669f85.zip → @jridgewell-trace-mapping-npm-0.3.19-9aa1a7e2fd-956a6f0f6f.zip} +0 -0
  14. package/.yarn/cache/@types-node-npm-18.17.5-e736eb2acc-b8c658a992.zip +0 -0
  15. package/.yarn/cache/{@types-node-npm-20.4.5-7555fad0d4-36a0304a8d.zip → @types-node-npm-20.5.0-ea170d5dd7-659bc5fc93.zip} +0 -0
  16. package/.yarn/cache/@types-triple-beam-npm-1.3.2-e1699700a8-dd7b4a563f.zip +0 -0
  17. package/.yarn/cache/agentkeepalive-npm-4.5.0-f237b580b2-13278cd5b1.zip +0 -0
  18. package/.yarn/cache/args-npm-5.0.3-ec59f35e6d-ac39e65609.zip +0 -0
  19. package/.yarn/cache/async-npm-3.2.4-aba13508f9-43d07459a4.zip +0 -0
  20. package/.yarn/cache/{cacache-npm-17.1.3-f75f768a29-385756781e.zip → cacache-npm-17.1.4-51ef53d0a8-b7751df756.zip} +0 -0
  21. package/.yarn/cache/camelcase-npm-5.0.0-c808398846-8bfe920e04.zip +0 -0
  22. package/.yarn/cache/caniuse-lite-npm-1.0.30001520-83db97126d-59991ad8f3.zip +0 -0
  23. package/.yarn/cache/color-npm-3.2.1-568cf1014f-f81220e8b7.zip +0 -0
  24. package/.yarn/cache/color-string-npm-1.9.1-dc020e56be-c13fe7cff7.zip +0 -0
  25. package/.yarn/cache/colorspace-npm-1.1.4-f01655548a-bb3934ef3c.zip +0 -0
  26. package/.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-ab8c07884e.zip +0 -0
  27. package/.yarn/cache/detect-file-npm-1.0.0-a22ca7c5b6-1861e41461.zip +0 -0
  28. package/.yarn/cache/{electron-to-chromium-npm-1.4.481-eaa539b254-52b7e8d7ae.zip → electron-to-chromium-npm-1.4.491-7541a41cd5-8d96c720c8.zip} +0 -0
  29. package/.yarn/cache/enabled-npm-2.0.0-bf5d96c9d8-9d256d89f4.zip +0 -0
  30. package/.yarn/cache/esbuild-npm-0.19.2-84addf679d-f9ad8ad4f0.zip +0 -0
  31. package/.yarn/cache/expand-tilde-npm-2.0.2-a4020a62f5-2efe6ed407.zip +0 -0
  32. package/.yarn/cache/fecha-npm-4.2.3-75248da3fd-f94e2fb3ac.zip +0 -0
  33. package/.yarn/cache/find-node-modules-npm-2.1.3-431b2c5604-4b8a194ffd.zip +0 -0
  34. package/.yarn/cache/findup-sync-npm-4.0.0-3884c677a0-94131e1107.zip +0 -0
  35. package/.yarn/cache/fn.name-npm-1.1.0-b472333184-e357144f48.zip +0 -0
  36. package/.yarn/cache/{fs-minipass-npm-3.0.2-a27ef235f5-e9cc0e1f2d.zip → fs-minipass-npm-3.0.3-d148d6ac19-8722a41109.zip} +0 -0
  37. package/.yarn/cache/global-modules-npm-1.0.0-70c522e57a-10be68796c.zip +0 -0
  38. package/.yarn/cache/global-prefix-npm-1.0.2-a96996834b-061b43470f.zip +0 -0
  39. package/.yarn/cache/homedir-polyfill-npm-1.0.3-da1a29ce00-18dd4db870.zip +0 -0
  40. package/.yarn/cache/ini-npm-1.3.8-fb5040b4c0-dfd98b0ca3.zip +0 -0
  41. package/.yarn/cache/is-arrayish-npm-0.3.2-f856180f79-977e64f54d.zip +0 -0
  42. package/.yarn/cache/is-core-module-npm-2.13.0-e444c50225-053ab101fb.zip +0 -0
  43. package/.yarn/cache/is-extglob-npm-2.1.1-0870ea68b5-df033653d0.zip +0 -0
  44. package/.yarn/cache/is-glob-npm-4.0.3-cb87bf1bdb-d381c1319f.zip +0 -0
  45. package/.yarn/cache/is-windows-npm-1.0.2-898cd6f3d7-438b7e5265.zip +0 -0
  46. package/.yarn/cache/{jackspeak-npm-2.2.2-374ca454fe-7b1468dd91.zip → jackspeak-npm-2.2.3-bcc5afec11-8add557045.zip} +0 -0
  47. package/.yarn/cache/kuler-npm-2.0.0-19e74c9695-9e10b5a165.zip +0 -0
  48. package/.yarn/cache/leven-npm-2.1.0-19f0a16606-f7b4a01b15.zip +0 -0
  49. package/.yarn/cache/logform-npm-2.5.1-06017d630d-08fdf03be5.zip +0 -0
  50. package/.yarn/cache/lru-cache-npm-10.0.1-0e1abf4c13-06f8d0e1ce.zip +0 -0
  51. package/.yarn/cache/merge-npm-2.1.1-90e7307c49-9c36b0e25a.zip +0 -0
  52. package/.yarn/cache/minimist-npm-1.2.8-d7af7b1dce-75a6d645fb.zip +0 -0
  53. package/.yarn/cache/{minipass-fetch-npm-3.0.3-2c4966d142-af5ab2552a.zip → minipass-fetch-npm-3.0.4-200ac7c66d-af7aad15d5.zip} +0 -0
  54. package/.yarn/cache/minipass-npm-7.0.3-3b57909ee9-6f1614f5b5.zip +0 -0
  55. package/.yarn/cache/mri-npm-1.1.4-d22a399f26-e65b9aed3b.zip +0 -0
  56. package/.yarn/cache/npm-dts-npm-1.3.12-c921cfddec-3897533c49.zip +0 -0
  57. package/.yarn/cache/npm-path-npm-2.0.4-fda8ca6d1d-3dfe24d9bb.zip +0 -0
  58. package/.yarn/cache/npm-run-npm-5.0.1-ba4f9faa65-1c6e171bf0.zip +0 -0
  59. package/.yarn/cache/npm-which-npm-3.0.1-2951392327-fba4864161.zip +0 -0
  60. package/.yarn/cache/one-time-npm-1.0.0-aeaad5e524-fd008d7e99.zip +0 -0
  61. package/.yarn/cache/parse-passwd-npm-1.0.0-ace6effa1d-4e55e0231d.zip +0 -0
  62. package/.yarn/cache/protochain-npm-1.0.5-ca0a4ef353-81f417e4f5.zip +0 -0
  63. package/.yarn/cache/resolve-dir-npm-1.0.1-0a95903c18-ef736b8ed6.zip +0 -0
  64. package/.yarn/cache/{resolve-npm-1.22.2-9d9621a4ae-7e5df75796.zip → resolve-npm-1.22.4-faa4f32bdd-23f25174c2.zip} +0 -0
  65. package/.yarn/cache/{resolve-patch-f4c4056507-66cc788f13.zip → resolve-patch-efbbaf0edd-c45f2545fd.zip} +0 -0
  66. package/.yarn/cache/rimraf-npm-5.0.1-26fb251a1d-bafce85391.zip +0 -0
  67. package/.yarn/cache/safe-stable-stringify-npm-2.4.3-d895741b40-3aeb644497.zip +0 -0
  68. package/.yarn/cache/serializerr-npm-1.0.3-844e49be0c-20fdf7a7e3.zip +0 -0
  69. package/.yarn/cache/simple-swizzle-npm-0.2.2-8dee37fad1-a7f3f2ab5c.zip +0 -0
  70. package/.yarn/cache/{ssri-npm-10.0.4-f583dafaf3-fb14da9f8a.zip → ssri-npm-10.0.5-1a7557d04d-0a31b65f21.zip} +0 -0
  71. package/.yarn/cache/stack-trace-npm-0.0.10-9460b173e1-473036ad32.zip +0 -0
  72. package/.yarn/cache/text-hex-npm-1.0.0-22389e4d56-1138f68adc.zip +0 -0
  73. package/.yarn/cache/tmp-npm-0.2.1-a9c8d9c0ca-8b12146541.zip +0 -0
  74. package/.yarn/cache/triple-beam-npm-1.4.1-d21ba5346a-2e881a3e8e.zip +0 -0
  75. package/.yarn/cache/which-npm-1.3.1-f0ebb8bdd8-f2e185c624.zip +0 -0
  76. package/.yarn/cache/winston-npm-3.7.2-5336ad5eff-f1f1a860d2.zip +0 -0
  77. package/.yarn/cache/winston-transport-npm-4.5.0-e10bfb2169-a56e5678a8.zip +0 -0
  78. package/.yarn/install-state.gz +0 -0
  79. package/LICENSE +21 -21
  80. package/README.md +108 -108
  81. package/build.js +26 -0
  82. package/dist/api-client.d.ts +1 -1
  83. package/dist/browser.js +2061 -0
  84. package/dist/index.d.ts +8 -11
  85. package/dist/node.js +13065 -0
  86. package/dist/types/ContentZone.d.ts +1 -0
  87. package/dist/types/Page.d.ts +1 -1
  88. package/jest.config.js +5 -5
  89. package/package.json +57 -50
  90. package/tsconfig.json +14 -14
  91. package/.nyc_output/713b1ec2-05ec-4b67-8061-b6cad0a45ad5.json +0 -1
  92. package/.yarn/cache/@babel-code-frame-npm-7.22.5-b36f88d6f9-cfe804f518.zip +0 -0
  93. package/.yarn/cache/@babel-highlight-npm-7.22.5-3182ccc1fe-f61ae6de6e.zip +0 -0
  94. package/.yarn/cache/@babel-parser-npm-7.22.7-7fbdf28552-02209ddbd4.zip +0 -0
  95. package/.yarn/cache/@babel-traverse-npm-7.22.8-98fbaaf7d8-a381369bc3.zip +0 -0
  96. package/.yarn/cache/@babel-types-npm-7.22.5-d1e4264bef-c13a9c1dc7.zip +0 -0
  97. package/.yarn/cache/@isaacs-string-locale-compare-npm-1.1.0-3911094464-7287da5d11.zip +0 -0
  98. package/.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.14-f5f0630788-61100637b6.zip +0 -0
  99. package/.yarn/cache/@npmcli-arborist-npm-6.3.0-9d3adbe1f6-4f59d5408c.zip +0 -0
  100. package/.yarn/cache/@npmcli-config-npm-6.2.1-4191bac29e-8c8d47f900.zip +0 -0
  101. package/.yarn/cache/@npmcli-disparity-colors-npm-3.0.0-9fe9301a52-49320c6927.zip +0 -0
  102. package/.yarn/cache/@npmcli-git-npm-4.1.0-f7322fced9-37efb92659.zip +0 -0
  103. package/.yarn/cache/@npmcli-installed-package-contents-npm-2.0.2-99564e3824-60789d5ed2.zip +0 -0
  104. package/.yarn/cache/@npmcli-map-workspaces-npm-3.0.4-b07359726d-99607dbc50.zip +0 -0
  105. package/.yarn/cache/@npmcli-metavuln-calculator-npm-5.0.1-b28e316793-cd08ad9cc4.zip +0 -0
  106. package/.yarn/cache/@npmcli-name-from-folder-npm-2.0.0-18e2dba870-fb3ef891aa.zip +0 -0
  107. package/.yarn/cache/@npmcli-node-gyp-npm-3.0.0-b160a0116c-fe3802b813.zip +0 -0
  108. package/.yarn/cache/@npmcli-package-json-npm-4.0.1-8fba8ea1a2-699b80a72f.zip +0 -0
  109. package/.yarn/cache/@npmcli-promise-spawn-npm-6.0.2-c9941b207c-aa725780c1.zip +0 -0
  110. package/.yarn/cache/@npmcli-query-npm-3.0.0-53c05bcb30-90fca7edd5.zip +0 -0
  111. package/.yarn/cache/@npmcli-run-script-npm-6.0.2-6a98dec431-7a671d7dbe.zip +0 -0
  112. package/.yarn/cache/@sigstore-bundle-npm-1.0.0-6224fc68db-9902b9fcd2.zip +0 -0
  113. package/.yarn/cache/@sigstore-protobuf-specs-npm-0.2.0-93c8e6c759-6b7c5d3612.zip +0 -0
  114. package/.yarn/cache/@sigstore-tuf-npm-1.0.3-9a2b6b14aa-0a32594b73.zip +0 -0
  115. package/.yarn/cache/@tufjs-canonical-json-npm-1.0.0-66d27d850f-9ff3bcd129.zip +0 -0
  116. package/.yarn/cache/@tufjs-models-npm-1.0.4-a1dddaf561-b489baa854.zip +0 -0
  117. package/.yarn/cache/@types-node-npm-18.11.9-d21dd6ec05-cc0aae109e.zip +0 -0
  118. package/.yarn/cache/abbrev-npm-2.0.0-0eb38a17e5-0e994ad2aa.zip +0 -0
  119. package/.yarn/cache/abort-controller-npm-3.0.0-2f3a9a2bcb-170bdba9b4.zip +0 -0
  120. package/.yarn/cache/agentkeepalive-npm-4.3.0-ac3d8e6807-982453aa44.zip +0 -0
  121. package/.yarn/cache/archy-npm-1.0.0-7db8bfdc3b-504ae7af65.zip +0 -0
  122. package/.yarn/cache/are-we-there-yet-npm-4.0.1-734c8e8dce-16871ee259.zip +0 -0
  123. package/.yarn/cache/axios-cache-adapter-npm-2.7.3-26c357b785-ff44bee6a2.zip +0 -0
  124. package/.yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip +0 -0
  125. package/.yarn/cache/bin-links-npm-4.0.2-592819adbc-6f83e73100.zip +0 -0
  126. package/.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip +0 -0
  127. package/.yarn/cache/buffer-npm-6.0.3-cd90dfedfe-5ad23293d9.zip +0 -0
  128. package/.yarn/cache/builtins-npm-5.0.1-6d4820dd76-66d204657f.zip +0 -0
  129. package/.yarn/cache/cache-control-esm-npm-1.0.0-ee383a8c40-4f8c8399f2.zip +0 -0
  130. package/.yarn/cache/caniuse-lite-npm-1.0.30001518-2e4e82df98-1b63272f6e.zip +0 -0
  131. package/.yarn/cache/chalk-npm-5.3.0-d181999efb-623922e077.zip +0 -0
  132. package/.yarn/cache/charenc-npm-0.0.2-aca0c2f207-81dcadbe57.zip +0 -0
  133. package/.yarn/cache/cidr-regex-npm-3.1.1-a5f3c156e7-ef9306d086.zip +0 -0
  134. package/.yarn/cache/cli-columns-npm-4.0.0-7c43bbe435-fa1a3a7f4e.zip +0 -0
  135. package/.yarn/cache/cli-table3-npm-0.6.3-1dca7f9152-09897f6846.zip +0 -0
  136. package/.yarn/cache/clone-npm-1.0.4-a610fcbcf9-d06418b733.zip +0 -0
  137. package/.yarn/cache/cmd-shim-npm-6.0.1-87ebf774a0-359006b3a5.zip +0 -0
  138. package/.yarn/cache/columnify-npm-1.6.0-aa925d932b-0d59002361.zip +0 -0
  139. package/.yarn/cache/common-ancestor-path-npm-1.0.1-27534e68da-1d2e418606.zip +0 -0
  140. package/.yarn/cache/crypt-npm-0.0.2-033627d94f-baf4c7bbe0.zip +0 -0
  141. package/.yarn/cache/cssesc-npm-3.0.0-15ec56f86f-f8c4ababff.zip +0 -0
  142. package/.yarn/cache/defaults-npm-1.0.4-f3fbaf2528-3a88b7a587.zip +0 -0
  143. package/.yarn/cache/depd-npm-2.0.0-b6c51a4b43-abbe19c768.zip +0 -0
  144. package/.yarn/cache/diff-npm-5.1.0-d24d222280-c7bf0df7c9.zip +0 -0
  145. package/.yarn/cache/event-target-shim-npm-5.0.1-cb48709025-1ffe3bb22a.zip +0 -0
  146. package/.yarn/cache/events-npm-3.3.0-c280bc7e48-f6f487ad21.zip +0 -0
  147. package/.yarn/cache/fastest-levenshtein-npm-1.0.16-192d328856-a78d44285c.zip +0 -0
  148. package/.yarn/cache/fsevents-patch-2882183fbf-8.zip +0 -0
  149. package/.yarn/cache/gauge-npm-5.0.1-69ab73de36-09b1eb8d8c.zip +0 -0
  150. package/.yarn/cache/hosted-git-info-npm-6.1.1-d57807f6a5-fcd3ca2eaa.zip +0 -0
  151. package/.yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-5144c0c981.zip +0 -0
  152. package/.yarn/cache/ignore-walk-npm-6.0.3-ebca6b06c4-d8ba534beb.zip +0 -0
  153. package/.yarn/cache/ini-npm-4.1.1-01c2cbda7b-0e59095540.zip +0 -0
  154. package/.yarn/cache/init-package-json-npm-5.0.0-0656c8f580-ad601c717d.zip +0 -0
  155. package/.yarn/cache/install-npm-0.13.0-53f6b8981f-645bad1253.zip +0 -0
  156. package/.yarn/cache/ip-regex-npm-4.3.0-4ac12c6be9-7ff904b891.zip +0 -0
  157. package/.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-4a186d995d.zip +0 -0
  158. package/.yarn/cache/is-cidr-npm-4.0.2-74bbb734d3-ee6e670e65.zip +0 -0
  159. package/.yarn/cache/is-core-module-npm-2.12.1-ce74e89160-f04ea30533.zip +0 -0
  160. package/.yarn/cache/json-parse-even-better-errors-npm-3.0.0-3675833c0a-f1970b5220.zip +0 -0
  161. package/.yarn/cache/json-stringify-nice-npm-1.1.4-0b0ddb188b-6ddf781148.zip +0 -0
  162. package/.yarn/cache/jsonparse-npm-1.3.1-b6fde74828-6514a7be46.zip +0 -0
  163. package/.yarn/cache/just-diff-apply-npm-5.5.0-04951e29f4-ed6bbd5978.zip +0 -0
  164. package/.yarn/cache/just-diff-npm-6.0.2-f73771d84e-1a0c7524f6.zip +0 -0
  165. package/.yarn/cache/libnpmaccess-npm-7.0.2-57b91bfda5-73d49f3939.zip +0 -0
  166. package/.yarn/cache/libnpmdiff-npm-5.0.19-26809d318b-47835abc81.zip +0 -0
  167. package/.yarn/cache/libnpmexec-npm-6.0.3-9bfdfc5775-c9c92dc29a.zip +0 -0
  168. package/.yarn/cache/libnpmfund-npm-4.0.19-742ff1c9b5-77905879f7.zip +0 -0
  169. package/.yarn/cache/libnpmhook-npm-9.0.3-1ed2368ed2-535ecefa22.zip +0 -0
  170. package/.yarn/cache/libnpmorg-npm-5.0.4-8ff49f84d5-4e170ba145.zip +0 -0
  171. package/.yarn/cache/libnpmpack-npm-5.0.19-fad75068a8-d164d61383.zip +0 -0
  172. package/.yarn/cache/libnpmpublish-npm-7.5.0-e0dfdc81a9-feb99876be.zip +0 -0
  173. package/.yarn/cache/libnpmsearch-npm-6.0.2-664c687722-7a62e5cb1c.zip +0 -0
  174. package/.yarn/cache/libnpmteam-npm-5.0.3-1e0a2afab9-a39ccdb4a6.zip +0 -0
  175. package/.yarn/cache/libnpmversion-npm-4.0.2-257501dd35-4666db4671.zip +0 -0
  176. package/.yarn/cache/lru-cache-npm-10.0.0-256d74bb20-18f101675f.zip +0 -0
  177. package/.yarn/cache/md5-npm-2.3.0-86c49d3915-a63cacf401.zip +0 -0
  178. package/.yarn/cache/minipass-json-stream-npm-1.0.1-96490706d6-791b696a27.zip +0 -0
  179. package/.yarn/cache/minipass-npm-7.0.2-baa42a5a34-46776de732.zip +0 -0
  180. package/.yarn/cache/mute-stream-npm-1.0.0-b6e846d471-36fc968b0e.zip +0 -0
  181. package/.yarn/cache/nopt-npm-7.2.0-dd734b678d-a9c0f57fb8.zip +0 -0
  182. package/.yarn/cache/normalize-package-data-npm-5.0.0-6327e2af68-a459f05eaf.zip +0 -0
  183. package/.yarn/cache/npm-audit-report-npm-5.0.0-b0af56272d-a18f16f514.zip +0 -0
  184. package/.yarn/cache/npm-bundled-npm-3.0.0-0b3c5ee4f3-110859c2d6.zip +0 -0
  185. package/.yarn/cache/npm-install-checks-npm-6.1.1-e05db36ccf-8fb3ed05cf.zip +0 -0
  186. package/.yarn/cache/npm-normalize-package-bin-npm-3.0.1-6c120b50f7-de416d720a.zip +0 -0
  187. package/.yarn/cache/npm-npm-9.8.1-c06ac946c2-d3f12cd0c0.zip +0 -0
  188. package/.yarn/cache/npm-package-arg-npm-10.1.0-e9f0aaa69d-8fe4b6a742.zip +0 -0
  189. package/.yarn/cache/npm-packlist-npm-7.0.4-1c0b919056-5ffa1f8f0b.zip +0 -0
  190. package/.yarn/cache/npm-pick-manifest-npm-8.0.2-ec194cb513-c9f71b5735.zip +0 -0
  191. package/.yarn/cache/npm-profile-npm-7.0.1-73c58f96b1-c78d2e6394.zip +0 -0
  192. package/.yarn/cache/npm-registry-fetch-npm-14.0.5-6b3e6c0dd0-c636496429.zip +0 -0
  193. package/.yarn/cache/npm-user-validate-npm-2.0.0-2fa10ebf8a-52c0c64cb2.zip +0 -0
  194. package/.yarn/cache/npmlog-npm-7.0.1-a0f355f530-caabeb1f55.zip +0 -0
  195. package/.yarn/cache/pacote-npm-15.2.0-b9ed3321e9-c731572be2.zip +0 -0
  196. package/.yarn/cache/parse-conflict-json-npm-3.0.1-9455a1ad04-d8d2656bc0.zip +0 -0
  197. package/.yarn/cache/postcss-selector-parser-npm-6.0.13-f732d92326-f89163338a.zip +0 -0
  198. package/.yarn/cache/proc-log-npm-3.0.0-a8c21c2f0f-02b64e1b39.zip +0 -0
  199. package/.yarn/cache/process-npm-0.11.10-aeb3b641ae-bfcce49814.zip +0 -0
  200. package/.yarn/cache/promise-all-reject-late-npm-1.0.1-19ba0dce9c-d7d61ac412.zip +0 -0
  201. package/.yarn/cache/promise-call-limit-npm-1.0.2-2a84fbc485-d0664dd295.zip +0 -0
  202. package/.yarn/cache/promise-inflight-npm-1.0.1-5bb925afac-2274948309.zip +0 -0
  203. package/.yarn/cache/promzard-npm-1.0.0-a0d17e2d53-c069488271.zip +0 -0
  204. package/.yarn/cache/qrcode-terminal-npm-0.12.0-f81f8a6a67-51638d11d0.zip +0 -0
  205. package/.yarn/cache/read-cmd-shim-npm-4.0.0-2339b15fb0-2fb5a8a389.zip +0 -0
  206. package/.yarn/cache/read-npm-2.1.0-0e0cb8a375-e745999138.zip +0 -0
  207. package/.yarn/cache/read-package-json-fast-npm-3.0.2-1232471a07-8d406869f0.zip +0 -0
  208. package/.yarn/cache/read-package-json-npm-6.0.4-bf5c705b94-ce40c46712.zip +0 -0
  209. package/.yarn/cache/readable-stream-npm-4.4.2-ac0d67d9ca-6f4063763d.zip +0 -0
  210. package/.yarn/cache/sigstore-npm-1.8.0-c7dd60d00a-9886278224.zip +0 -0
  211. package/.yarn/cache/spdx-correct-npm-3.2.0-ffae008484-e9ae98d22f.zip +0 -0
  212. package/.yarn/cache/spdx-exceptions-npm-2.3.0-2b68dad75a-cb69a26fa3.zip +0 -0
  213. package/.yarn/cache/spdx-expression-parse-npm-3.0.1-b718cbb35a-a1c6e104a2.zip +0 -0
  214. package/.yarn/cache/spdx-license-ids-npm-3.0.13-928dd45e3f-3469d85c65.zip +0 -0
  215. package/.yarn/cache/supports-color-npm-9.4.0-a415f39758-cb8ff8daea.zip +0 -0
  216. package/.yarn/cache/text-table-npm-0.2.0-d92a778b59-b6937a38c8.zip +0 -0
  217. package/.yarn/cache/tiny-relative-date-npm-1.3.0-4737b1ee94-82a1fa2f3b.zip +0 -0
  218. package/.yarn/cache/treeverse-npm-3.0.0-6c6d119afd-73168d9887.zip +0 -0
  219. package/.yarn/cache/tuf-js-npm-1.1.7-045f70823d-089fc0dabe.zip +0 -0
  220. package/.yarn/cache/validate-npm-package-license-npm-3.0.4-7af8adc7a8-35703ac889.zip +0 -0
  221. package/.yarn/cache/validate-npm-package-name-npm-5.0.0-fc061c1b84-5342a99498.zip +0 -0
  222. package/.yarn/cache/walk-up-path-npm-3.0.1-67ab100d5d-9ffca02fe3.zip +0 -0
  223. package/.yarn/cache/wcwidth-npm-1.0.1-05fa596453-814e9d1ddc.zip +0 -0
  224. package/.yarn/cache/which-npm-3.0.1-b2b0f09ace-adf720fe9d.zip +0 -0
  225. package/.yarn/cache/write-file-atomic-npm-5.0.1-52283db6ee-8dbb0e2512.zip +0 -0
  226. package/coverage/base.css +0 -223
  227. package/coverage/block-navigation.js +0 -79
  228. package/coverage/index.html +0 -123
  229. package/coverage/prettify.css +0 -1
  230. package/coverage/prettify.js +0 -2
  231. package/coverage/sort-arrow-sprite.png +0 -0
  232. package/coverage/sorter.js +0 -170
  233. package/coverage/src/api-client.js.html +0 -549
  234. package/coverage/src/content-fetch.js.html +0 -336
  235. package/coverage/src/index.html +0 -123
  236. package/coverage/src/methods/getContentItem.js.html +0 -285
  237. package/coverage/src/methods/getContentList.js.html +0 -486
  238. package/coverage/src/methods/getGallery.js.html +0 -243
  239. package/coverage/src/methods/getPage.js.html +0 -273
  240. package/coverage/src/methods/getSitemapFlat.js.html +0 -240
  241. package/coverage/src/methods/getSitemapNested.js.html +0 -231
  242. package/coverage/src/methods/getSyncContent.js.html +0 -258
  243. package/coverage/src/methods/getSyncPages.js.html +0 -258
  244. package/coverage/src/methods/getUrlRedirections.js.html +0 -339
  245. package/coverage/src/methods/index.html +0 -201
  246. package/coverage/src/methods/syncContentItems.js.html +0 -186
  247. package/coverage/src/methods/syncPageItems.js.html +0 -186
  248. package/coverage/src/types/FilterLogicOperator.js.html +0 -129
  249. package/coverage/src/types/FilterOperator.js.html +0 -156
  250. package/coverage/src/types/SortDirection.js.html +0 -129
  251. package/coverage/src/types/index.html +0 -123
  252. package/coverage/src/utils.js.html +0 -330
  253. package/dist/agility-content-fetch.browser.js +0 -420
  254. package/dist/agility-content-fetch.node.js +0 -10978
  255. package/dist/api-client.js +0 -316
  256. package/dist/index.js +0 -7
  257. package/dist/methods/getContentItem.js +0 -49
  258. package/dist/methods/getContentList.js +0 -94
  259. package/dist/methods/getGallery.js +0 -39
  260. package/dist/methods/getPage.js +0 -47
  261. package/dist/methods/getSitemapFlat.js +0 -26
  262. package/dist/methods/getSitemapNested.js +0 -23
  263. package/dist/methods/getSyncContent.js +0 -26
  264. package/dist/methods/getSyncPages.js +0 -26
  265. package/dist/methods/getUrlRedirections.js +0 -50
  266. package/dist/types/Client.js +0 -2
  267. package/dist/types/Config.js +0 -2
  268. package/dist/types/ContentItem.js +0 -2
  269. package/dist/types/ContentList.js +0 -9
  270. package/dist/types/ContentZone.js +0 -2
  271. package/dist/types/EnvConfig.js +0 -2
  272. package/dist/types/Filter.js +0 -10
  273. package/dist/types/FilterLogicOperator.js +0 -13
  274. package/dist/types/FilterOperator.js +0 -30
  275. package/dist/types/Gallery.js +0 -12
  276. package/dist/types/MediaItem.js +0 -13
  277. package/dist/types/MediaItemMetaData.js +0 -12
  278. package/dist/types/Page.js +0 -20
  279. package/dist/types/SEO.js +0 -11
  280. package/dist/types/SitemapFlat.js +0 -10
  281. package/dist/types/SitemapFlatItem.js +0 -17
  282. package/dist/types/SitemapNested.js +0 -7
  283. package/dist/types/SitemapNestedItem.js +0 -2
  284. package/dist/types/SitemapVisibility.js +0 -9
  285. package/dist/types/SortDirection.js +0 -13
  286. package/dist/types/SyncContent.js +0 -9
  287. package/dist/types/SyncPages.js +0 -9
  288. package/dist/types/SystemProperties.js +0 -11
  289. package/dist/types/UrlRedirection.js +0 -11
  290. package/dist/types/UrlRedirectionResponse.js +0 -9
  291. package/dist/types/index.js +0 -10
  292. package/dist/utils.js +0 -81
  293. package/test/apiClients.config.ts +0 -50
  294. package/test/getApi.tests.ts +0 -153
  295. package/test/getContentItem.tests.ts +0 -103
  296. package/test/getContentList.tests.ts +0 -251
  297. package/test/getGallery.tests.ts +0 -22
  298. package/test/getPage.tests.ts +0 -39
  299. package/test/getSitemapFlat.tests.ts +0 -30
  300. package/test/getSitemapNested.tests.ts +0 -30
  301. package/test/getSyncContentItems.tests.ts +0 -25
  302. package/test/getSyncPageItems.tests.ts +0 -27
  303. package/test/getUrlRedirections.tests.ts +0 -40
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var utils_1 = require("../utils");
4
- function getUrlRedirections(requestParams) {
5
- validateRequestParams(requestParams);
6
- var url = "";
7
- if (requestParams.lastAccessDate) {
8
- if (!requestParams.lastAccessDate.toISOString) {
9
- requestParams.lastAccessDate = new Date(requestParams.lastAccessDate);
10
- }
11
- url = "/?lastAccessDate=".concat(requestParams.lastAccessDate.toISOString());
12
- }
13
- var req = {
14
- url: url,
15
- method: 'get',
16
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, 'urlredirection'),
17
- headers: (0, utils_1.buildAuthHeader)(this.config),
18
- params: {}
19
- };
20
- var self = this;
21
- var promise = new Promise(function (resolve, reject) {
22
- self.makeRequest(req)
23
- .then(function (data) {
24
- if (data == undefined || !data) {
25
- reject(new Error("The URL redirections could not be retrieved."));
26
- }
27
- else {
28
- resolve(data);
29
- }
30
- })
31
- .catch(function (error) {
32
- reject(error);
33
- });
34
- });
35
- return promise;
36
- }
37
- function validateRequestParams(requestParams) {
38
- if (requestParams.lastAccessDate) {
39
- if (!requestParams.lastAccessDate.toISOString) {
40
- var dt = new Date(requestParams.lastAccessDate);
41
- if (isNaN(dt.getTime())) {
42
- throw new TypeError('You must include a valid Datetime for the lastAccessDate.');
43
- }
44
- }
45
- }
46
- else {
47
- return;
48
- }
49
- }
50
- exports.default = getUrlRedirections;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a **Content List** in the CMS.
4
- * @typedef ContentList
5
- * @memberof AgilityFetch.Types
6
- * @property {Array.<AgilityFetch.Types.ContentItem>} items - The paginated array of items returned by the request. Default *take* is **10** unless otherwise specified (Maximum allowed it **250**)
7
- * @property {number} totalCount - The total amount of items in the list. Use this along with *skip* and *take* for pagination.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a **Filter** for filtering lists.
4
- * @typedef Filter
5
- * @memberof AgilityFetch.Types
6
- * @property {string} property - The property to filter the request on.
7
- * @property {AgilityFetch.Types.FilterOperator} operator - The operator to use for the filter.
8
- * @property {string} value - The value to compare for the property.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a FilterLogicOperator - Refer to {@link AgilityFetch.Types.FilterLogicOperators} Enum for available Logic Operators.
4
- * @typedef {string} FilterLogicOperator
5
- * @memberOf AgilityFetch.Types
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.FilterLogicOperators = void 0;
9
- var FilterLogicOperators;
10
- (function (FilterLogicOperators) {
11
- FilterLogicOperators["AND"] = "AND";
12
- FilterLogicOperators["OR"] = "OR";
13
- })(FilterLogicOperators || (exports.FilterLogicOperators = FilterLogicOperators = {}));
@@ -1,30 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a FilterOperator - Refer to {@link AgilityFetch.Types.FilterOperators} Enum for available Operators.
4
- * @typedef {string} FilterOperator
5
- * @memberOf AgilityFetch.Types
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- /**
9
- * Enum of FilterOperators.
10
- * @enum {FilterOperator} FilterOperators
11
- * @memberOf AgilityFetch.Types
12
- * @readonly
13
- */
14
- var FilterOperators = {
15
- /** Equal To */
16
- EQUAL_TO: "eq",
17
- /** Not Equal To */
18
- NOT_EQUAL_TO: "ne",
19
- /** Less Than */
20
- LESS_THAN: "lt",
21
- /** Less Than or Equal To */
22
- LESS_THAN_OR_EQUAL_TO: "lte",
23
- /** Greater Than */
24
- GREATER_THAN: "gt",
25
- /** Greater Than or Equal To */
26
- GREATER_THAN_OR_EQUAL_TO: "gte",
27
- /** Like (string only) */
28
- LIKE: "like"
29
- };
30
- exports.default = FilterOperators;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a **Gallery** in the CMS
4
- * @typedef Gallery
5
- * @memberof AgilityFetch.Types
6
- * @property {number} galleryID - The unique ID of the gallery.
7
- * @property {string} name - The name of the gallery.
8
- * @property {string} description - The description of the gallery.
9
- * @property {number} count - The count of media items in the gallery.
10
- * @property {Array<AgilityFetch.Types.MediaItem>} media - Array of media items in the gallery.
11
- */
12
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a **MediaItem** in the CMS
4
- * @typedef MediaItem
5
- * @memberof AgilityFetch.Types
6
- * @property {number} mediaID - The unique ID of the media item.
7
- * @property {string} fileName - The file name of the media item.
8
- * @property {string} url - The url of the media item.
9
- * @property {number} size - The size of the media item in bytes.
10
- * @property {date} modifiedOn - The last modified date and time of the media item.
11
- * @property {AgilityFetch.Types.MediaItemMetaData} metaData - Meta data for the media item.
12
- */
13
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a **MediaItemMetaData** in the CMS
4
- * @typedef MediaItemMetaData
5
- * @memberof AgilityFetch.Types
6
- * @property {string} Title - The title meta data of the media item.
7
- * @property {string} Description - The description meta data of the media item.
8
- * @property {string} LinkUrl - The link url meta data of the media item.
9
- * @property {string} pixelHeight - The height in pixels of the media item.
10
- * @property {string} pixelWidth - The width in pixels of the media item.
11
- */
12
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,20 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a **Page** in the CMS.
4
- * @typedef Page
5
- * @memberof AgilityFetch.Types
6
- * @property {number} pageID - The unique ID of the page in this language.
7
- * @property {string} name - The friendly url slug for the page - this is used to make up the URL.
8
- * @property {string} path - The url path for this page.
9
- * @property {string} title - The page title for the page, used for SEO and appears in the browser bar/tab.
10
- * @property {string} menuText - And alternate text field, often used in dynamic menu generation.
11
- * @property {string} pageType - The type of page. Valid values include *static*, *dynamic*, *dynamic_node*, *link*, and *folder*.
12
- * @property {string} templateName - The name of the Page Template this page uses.
13
- * @property {boolean} securePage - This value represents whether this page should be secured within the website.
14
- * @property {AgilityFetch.Types.SystemProperties} properties The system properties of this page item.
15
- * @property {Object.<string, AgilityFetch.Types.ContentZone>} zones - Contains a dictionary of content zones for this page and the modules in each zone.
16
- * @property {string} [redirectUrl] - If this page is a *link*, then this property will show the intended destination redirect.
17
- * @property {number} [dynamicItemContentID] - If this page is a dynamic page, then this property will show the associated contentID of the dynamic content item.
18
- * @property {AgilityFetch.Types.SitemapVisibility} visible - Object that contains properties pertaining to the intended visibility of this page for seo and menus.
19
- */
20
- Object.defineProperty(exports, "__esModule", { value: true });
package/dist/types/SEO.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines the SEO properties for a content item.
4
- * @interface SEOProperties
5
- * @property {string} metaDescription - The meta description for the content item.
6
- * @property {string} metaKeywords - The meta keywords for the content item.
7
- * @property {string} metaHTML - The meta HTML for the content item.
8
- * @property {boolean} menuVisible - Whether the content item should be visible in the menu.
9
- * @property {boolean} sitemapVisible - Whether the content item should be visible in the sitemap.
10
- */
11
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // Define the SitemapFlatItem interface if necessary
4
- // interface SitemapFlatItem {
5
- // // Define properties of AgilityFetch.Types.SitemapFlatItem if needed
6
- // // For example:
7
- // pageID: number;
8
- // title: string;
9
- // // ... other properties
10
- // }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- /**
3
- * Represents an item in a sitemap response
4
- * @typedef {Object} SitemapFlatItem
5
- * @memberof AgilityFetch.Types
6
- * @property {number} pageID - The unique ID of the page in Agility in this language.
7
- * @property {string} title - A human-friendly title for the page, typically used for SEO and displayed in the browser tab/bar.
8
- * @property {string} name - The URL friendly name of the page.
9
- * @property {string} path - The URL path of the page.
10
- * @property {string} menuText - An alternate page title, often used when generating dynamic menus.
11
- * @property {string} pageType - Describes what type of page this is - values include *static*, *dynamic*, *dynamic_node*, *folder*, and *link*
12
- * @property {AgilityFetch.Types.SystemProperties} properties - The system properties of this page item.
13
- * @property {string} [redirectUrl] - If this page is a *link*, then this property will show the intended destination redirect.
14
- * @property {number} [dynamicItemContentID] - If this page is a dynamic page, then this property will show the associated contentID of the dynamic content item.
15
- * @property {AgilityFetch.Types.SitemapVisibility} visible - Object that contains properties pertaining to the intended visibility of this page for seo and menus.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- "use strict";
2
- /**
3
- * A dictionary/map of all page routes. The key of this dictionary is the page path for a page.
4
- * @typedef {Array.<AgilityFetch.Types.SitemapNestedItem>} SitemapNested - The array of pages for the sitemap.
5
- * @memberof AgilityFetch.Types
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a page's visibility.
4
- * @typedef SitemapVisibility
5
- * @memberof AgilityFetch.Types
6
- * @property {boolean} menu - If set to true, this page should be hidden from menus.
7
- * @property {boolean} sitemap - If set to true, this page should be hidden from the sitemap and not accessible by robots.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines a Sort Direction - Refer to {@link AgilityFetch.Types.SortDirections} Enum for available Sort Directions.
4
- * @typedef {string} SortDirection
5
- * @memberOf AgilityFetch.Types
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.SortDirections = void 0;
9
- var SortDirections;
10
- (function (SortDirections) {
11
- SortDirections["ASC"] = "asc";
12
- SortDirections["DESC"] = "desc";
13
- })(SortDirections || (exports.SortDirections = SortDirections = {}));
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines **Sync Content** response.
4
- * @typedef SyncContent
5
- * @memberof AgilityFetch.Types
6
- * @property {number} syncToken - The sync token to be used in the next call as a continuation token for syncing content. If this is empty, you are up to date.
7
- * @property {Array.<AgilityFetch.Types.ContentItem>} items - The paginated array of items returned by the request.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines **Sync Pages** response.
4
- * @typedef SyncPages
5
- * @memberof AgilityFetch.Types
6
- * @property {number} syncToken - The sync token to be used in the next call as a continuation token for syncing content. If this is empty, you are up to date.
7
- * @property {Array.<AgilityFetch.Types.Page>} items - The paginated array of items returned by the request.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines the common **System Properties** of pages and content items in the CMS.
4
- * @typedef SystemProperties
5
- * @memberof AgilityFetch.Types
6
- * @property {datetime} created - The date/time this item was created.
7
- * @property {datetime} modified - The date/time this item was last modified.
8
- * @property {number} state - The **state** of this content item. **1** = *Staging*, **2** = *Published*, **3** = *Deleted*, **4** = *Approved*, **5** = *AwaitingApproval*, **6** = *Declined*, **7** = *Unpublished*
9
- * @property {number} versionID - The unique versionID of this content item.
10
- */
11
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines **URL Redirection** .
4
- * @typedef URLRedirection
5
- * @memberof AgilityFetch.Types
6
- * @property {Number} id - The id of this URL Redirection
7
- * @property {String} originUrl - The URL to redirect from
8
- * @property {String} destinationUrl - The URL to redirect to
9
- * @property {Number} statusCode - Either a 301 or 302 status code for the redirect
10
- */
11
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- "use strict";
2
- /**
3
- * Defines **URL Redirection** response.
4
- * @typedef URLRedirectionResponse
5
- * @memberof AgilityFetch.Types
6
- * @property {Array} syncToken - The sync token to be used in the next call as a continuation token for syncing content. If this is empty, you are up to date.
7
- * @property {Array.<AgilityFetch.Types.Page>} items - The paginated array of items returned by the request.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FilterLogicOperators = exports.FilterOperators = void 0;
7
- var FilterOperator_1 = __importDefault(require("./FilterOperator"));
8
- exports.FilterOperators = FilterOperator_1.default;
9
- var FilterLogicOperator_1 = require("./FilterLogicOperator");
10
- Object.defineProperty(exports, "FilterLogicOperators", { enumerable: true, get: function () { return FilterLogicOperator_1.FilterLogicOperators; } });
package/dist/utils.js DELETED
@@ -1,81 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.logDebug = exports.logError = exports.isHttps = exports.buildRequestUrlPath = exports.buildAuthHeader = exports.buildPathUrl = void 0;
15
- function logError(consoleMessage) {
16
- console.error('\x1b[41m%s\x1b[0m', consoleMessage);
17
- }
18
- exports.logError = logError;
19
- function logDebug(consoleMessage) {
20
- console.log('\x1b[33m%s\x1b[0m', consoleMessage);
21
- }
22
- exports.logDebug = logDebug;
23
- function buildRequestUrlPath(config, locale) {
24
- var apiFetchOrPreview = '';
25
- if (config.isPreview === true || config.isPreview === 'true') {
26
- apiFetchOrPreview = 'preview';
27
- }
28
- else {
29
- apiFetchOrPreview = 'fetch';
30
- }
31
- var urlPath = "".concat(config.baseUrl, "/").concat(apiFetchOrPreview, "/").concat(locale);
32
- return urlPath;
33
- }
34
- exports.buildRequestUrlPath = buildRequestUrlPath;
35
- function buildPathUrl(contentType, referenceName, skip, take, sort, direction, filters, filtersLogicOperator, contentLinkDepth, expandAllContentLinks) {
36
- var url = "/".concat(contentType, "/").concat(referenceName, "?contentLinkDepth=").concat(contentLinkDepth, "&");
37
- filtersLogicOperator = filtersLogicOperator ? " ".concat(filtersLogicOperator, " ") : ' AND ';
38
- if (sort) {
39
- url += "sort=".concat(sort, "&");
40
- if (direction) {
41
- url += "direction=".concat(direction, "&");
42
- }
43
- }
44
- if (skip) {
45
- url += "skip=".concat(skip, "&");
46
- }
47
- if (take) {
48
- url += "take=".concat(take, "&");
49
- }
50
- if (filters && filters.length > 0) {
51
- url += 'filter=';
52
- for (var i = 0; i < filters.length; i++) {
53
- var filter = filters[i];
54
- url += "".concat(filter.property, "[").concat(filter.operator, "]").concat(filter.value) + (i < filters.length - 1 ? filtersLogicOperator : '');
55
- }
56
- url += '&';
57
- }
58
- if (expandAllContentLinks) {
59
- url += "expandAllContentLinks=".concat(expandAllContentLinks, "&");
60
- }
61
- return url;
62
- }
63
- exports.buildPathUrl = buildPathUrl;
64
- function buildAuthHeader(config) {
65
- var defaultAuthHeaders = {
66
- APIKey: config.apiKey,
67
- Guid: ''
68
- };
69
- if (config.requiresGuidInHeaders) {
70
- defaultAuthHeaders.Guid = config.guid;
71
- }
72
- return __assign(__assign({}, defaultAuthHeaders), config.headers);
73
- }
74
- exports.buildAuthHeader = buildAuthHeader;
75
- function isHttps(url) {
76
- if (!url.toLowerCase().startsWith('https://')) {
77
- return false;
78
- }
79
- return true;
80
- }
81
- exports.isHttps = isHttps;
@@ -1,50 +0,0 @@
1
- import agilityFetch from '../src/index';
2
-
3
- // Agility Instance = 'Headless Integration Testing' [Dev]
4
- const guid = 'c741222b-1080-45f6-9a7f-982381c5a485';
5
- const apiKeyFetch = 'UnitTestsFetch.2ace650991363fbcffa6776d411d1b0d616b8e3424ce842b81cba7af0039197e';
6
- const apiKeyPreview = 'UnitTestsPreview.69e6bca345ced0b7ca5ab358b351ea5c870790a5945c25d749a865332906b124';
7
-
8
-
9
- export function createApiClient() {
10
- console.log(`Creating API Client for ${guid}`);
11
- var api = agilityFetch.getApi({
12
- guid: guid,
13
- apiKey: apiKeyFetch,
14
- baseUrl: `https://api-dev.aglty.io/${guid}`
15
- });
16
- return api;
17
- }
18
-
19
- export function createApiClientWithNewCdn() {
20
- console.log(`Creating API Client for ${guid}`);
21
- var api = agilityFetch.getApi({
22
- guid: '2b64a4d8-d',
23
- apiKey: 'JSSDK.e27e61f56d4c9b58ab98961aaf86a0d3c544dfe7d0eb385ece42123dad5d1af7'
24
- });
25
- return api;
26
- }
27
-
28
- export function createCachedApiClient() {
29
- console.log(`Creating API Client for ${guid}`);
30
- var api = agilityFetch.getApi({
31
- guid: guid,
32
- apiKey: apiKeyFetch,
33
- caching: {
34
- maxAge: 5 * 60 * 1000 //==5mins
35
- },
36
- baseUrl: `https://api-dev.aglty.io/${guid}`
37
- });
38
- return api;
39
- }
40
-
41
- export function createPreviewApiClient() {
42
- console.log(`Creating API Client for ${guid}`);
43
- var api = agilityFetch.getApi({
44
- guid: guid,
45
- apiKey: apiKeyPreview,
46
- isPreview: true,
47
- baseUrl: `https://api-dev.aglty.io/${guid}`
48
- });
49
- return api;
50
- }
@@ -1,153 +0,0 @@
1
- import agilityFetch from '../src/index';
2
-
3
- //This is a synchronous test
4
- describe('getApi:', function() {
5
-
6
- jest.setTimeout(120000);
7
-
8
- it('should return an api client object with required params', () => {
9
- const api = agilityFetch.getApi({
10
- guid: 'some-guid',
11
- apiKey: 'some-access-token'
12
- });
13
- expect(typeof api).toBe("object");
14
- });
15
-
16
- it('should return an api client object in preview mode', () => {
17
- const api = agilityFetch.getApi({
18
- guid: 'some-guid',
19
- apiKey: 'some-access-token',
20
- isPreview: true
21
- });
22
- expect(api.config.isPreview).toBe(true);
23
- });
24
-
25
- it('should contain method for getContentItem', function(done) {
26
- const api = agilityFetch.getApi({
27
- guid: 'some-guid',
28
- apiKey: 'some-access-token'
29
- });
30
- expect(typeof(api.getContentItem)).toBe("function");
31
- done();
32
- })
33
-
34
- it('should contain method for getContentList', function(done) {
35
- const api = agilityFetch.getApi({
36
- guid: 'some-guid',
37
- apiKey: 'some-access-token'
38
- });
39
- expect(typeof(api.getContentList)).toBe("function");
40
- done();
41
- })
42
-
43
- it('should contain method for getPage', function(done) {
44
- const api = agilityFetch.getApi({
45
- guid: 'some-guid',
46
- apiKey: 'some-access-token'
47
- });
48
- expect(typeof(api.getPage)).toBe("function");
49
- done();
50
- })
51
-
52
- it('should contain method for getSitemapFlat', function(done) {
53
- const api = agilityFetch.getApi({
54
- guid: 'some-guid',
55
- apiKey: 'some-access-token'
56
- });
57
- expect(typeof(api.getSitemapFlat)).toBe("function");
58
- done();
59
- })
60
-
61
- it('should contain method for getSitemapNested', function(done) {
62
- const api = agilityFetch.getApi({
63
- guid: 'some-guid',
64
- apiKey: 'some-access-token'
65
- });
66
- expect(typeof(api.getSitemapNested)).toBe("function");
67
- done();
68
- })
69
-
70
- it('should return an api client with the baseUrl overidden if passed-in correctly as params', function(done) {
71
- const baseUrl = 'https://fake-url.agilitycms.com';
72
- const api = agilityFetch.getApi({
73
- guid: 'some-guid',
74
- apiKey: 'some-access-token',
75
- baseUrl: baseUrl
76
- });
77
- expect(api.config.baseUrl).toBe(baseUrl);
78
- done();
79
- });
80
-
81
- it('should return an api client with new stackpath baseUrl based on canada', function(done) {
82
- const baseUrl = 'https://api-ca.aglty.io/some-guid-c';
83
- const api = agilityFetch.getApi({
84
- guid: 'some-guid-c',
85
- apiKey: 'some-access-token',
86
- baseUrl: null
87
- });
88
- expect(api.config.baseUrl).toBe(baseUrl);
89
- done();
90
- });
91
-
92
- it('should return an api client with new stackpath baseUrl based on usa', function(done) {
93
- const baseUrl = 'https://api.aglty.io/some-guid-u';
94
- const api = agilityFetch.getApi({
95
- guid: 'some-guid-u',
96
- apiKey: 'some-access-token',
97
- baseUrl: null
98
- });
99
- expect(api.config.baseUrl).toBe(baseUrl);
100
- done();
101
- });
102
-
103
- it('should return an api client with new stackpath baseUrl based on dev', function(done) {
104
- const baseUrl = 'https://api-dev.aglty.io/some-guid-d';
105
- const api = agilityFetch.getApi({
106
- guid: 'some-guid-d',
107
- apiKey: 'some-access-token',
108
- baseUrl: null
109
- });
110
- expect(api.config.baseUrl).toBe(baseUrl);
111
- done();
112
- });
113
-
114
- it('should return an api client with legacy stackpath baseUrl', function(done) {
115
- const baseUrl = 'https://some-guid-api.agilitycms.cloud';
116
- const api = agilityFetch.getApi({
117
- guid: 'some-guid',
118
- apiKey: 'some-access-token',
119
- baseUrl: null
120
- });
121
- expect(api.config.baseUrl).toBe(baseUrl);
122
- done();
123
- });
124
-
125
- // TESTING EXCEPTIONS ----------------------------------------------------
126
-
127
- it('should throw an error if guid is not passed-in', () => {
128
- expect(() => {
129
- agilityFetch.getApi({
130
- apiKey: 'some-access-token'
131
- });
132
- }).toThrow(TypeError);
133
- });
134
-
135
- it('should throw an error if apiKey is not passed-in', () => {
136
- expect(() => {
137
- agilityFetch.getApi({
138
- guid: 'some-guid',
139
- });
140
- }).toThrow(TypeError);
141
- });
142
-
143
- it('should throw an error if baseUrl is passed-in and does not start with "https"', () => {
144
- expect(() => {
145
- agilityFetch.getApi({
146
- guid: 'some-guid',
147
- apiKey: 'some-access-token',
148
- baseUrl: 'http://insecuresite.com'
149
- });
150
- }).toThrow(TypeError);
151
- });
152
-
153
- });