@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,316 +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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || function (mod) {
30
- if (mod && mod.__esModule) return mod;
31
- var result = {};
32
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
- __setModuleDefault(result, mod);
34
- return result;
35
- };
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- var __generator = (this && this.__generator) || function (thisArg, body) {
46
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
- function verb(n) { return function (v) { return step([n, v]); }; }
49
- function step(op) {
50
- if (f) throw new TypeError("Generator is already executing.");
51
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
53
- if (y = 0, t) op = [op[0] & 2, t.value];
54
- switch (op[0]) {
55
- case 0: case 1: t = op; break;
56
- case 4: _.label++; return { value: op[1], done: false };
57
- case 5: _.label++; y = op[1]; op = [0]; continue;
58
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
- default:
60
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
- if (t[2]) _.ops.pop();
65
- _.trys.pop(); continue;
66
- }
67
- op = body.call(thisArg, _);
68
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
- }
71
- };
72
- var __importDefault = (this && this.__importDefault) || function (mod) {
73
- return (mod && mod.__esModule) ? mod : { "default": mod };
74
- };
75
- Object.defineProperty(exports, "__esModule", { value: true });
76
- var axios_1 = __importDefault(require("axios"));
77
- var axios_cache_adapter_1 = require("axios-cache-adapter");
78
- var getSitemapFlat_1 = __importDefault(require("./methods/getSitemapFlat"));
79
- var getSitemapNested_1 = __importDefault(require("./methods/getSitemapNested"));
80
- var getContentItem_1 = __importDefault(require("./methods/getContentItem"));
81
- var getContentList_1 = __importDefault(require("./methods/getContentList"));
82
- var getPage_1 = __importDefault(require("./methods/getPage"));
83
- var getGallery_1 = __importDefault(require("./methods/getGallery"));
84
- var getUrlRedirections_1 = __importDefault(require("./methods/getUrlRedirections"));
85
- var getSyncContent_1 = __importDefault(require("./methods/getSyncContent"));
86
- var getSyncPages_1 = __importDefault(require("./methods/getSyncPages"));
87
- var utils_1 = require("./utils");
88
- var utils_2 = require("./utils");
89
- var types = __importStar(require("./types"));
90
- /**
91
- * How to create an instance of an an API client for the Agility Content Fetch REST API.
92
- * @func
93
- * @name getApi
94
- * @memberof AgilityFetch
95
- * @param {Object} config - API intialization params.
96
- * @param {string} config.guid - The guid that represents your instance.
97
- * @param {string} config.apiKey - The secret token that represents your application.
98
- * @param {boolean} [config.isPreview] - If your access token is for preview, then set this to true.
99
- * @param {Object} [config.caching] - Optional Caching options. Caching is disabled by default.
100
- * @param {number} [config.caching.maxAge] - In miliseconds. Default value is *0* (disabled). Recommeded value is *180000* (3 mins). Requests are cached in memory only (node or browser).
101
- * @param {string} [config.baseUrl] - Optionally override the default API Base Url.
102
- * @return {AgilityFetch.Client}
103
- * @example
104
- *
105
- * import agility from '@agility/content-fetch'
106
- *
107
- * const api = agility.getApi({
108
- * guid: '191309ca-e675-4be2-bb29-351879528707',
109
- * apiKey: 'aGd13M.fa30c36e553a36f871860407e902da9a7375322457acd6bcda038e60af699411',
110
- * isPreview: false
111
- * });
112
- */
113
- var defaultConfig = {
114
- baseUrl: null,
115
- isPreview: false,
116
- guid: null,
117
- apiKey: null,
118
- locale: null,
119
- headers: {},
120
- requiresGuidInHeaders: false,
121
- debug: false,
122
- caching: {
123
- maxAge: 0 //caching disabled by default
124
- }
125
- };
126
- function buildEnvConfig() {
127
- var envConfig = {
128
- baseUrl: null,
129
- isPreview: false,
130
- guid: null,
131
- apiKey: null
132
- };
133
- if (process && process.env) {
134
- var env = process.env;
135
- if (env.AGILITY_BASEURL) {
136
- envConfig.baseUrl = env.AGILITY_BASEURL;
137
- }
138
- if (env.AGILITY_GUID) {
139
- envConfig.guid = env.AGILITY_GUID;
140
- }
141
- if (env.AGILITY_APIKEY) {
142
- envConfig.apiKey = env.AGILITY_APIKEY;
143
- }
144
- envConfig.isPreview = env.AGILITY_ISPREVIEW === 'true';
145
- }
146
- return envConfig;
147
- }
148
- function buildBaseUrl(guid) {
149
- var baseUrlSuffixes = {
150
- u: '',
151
- c: '-ca',
152
- e: '-eu',
153
- a: '-aus',
154
- d: '-dev'
155
- };
156
- var suffix = guid.substr(guid.length - 2, 2);
157
- var env = suffix.substr(1);
158
- // New format of guid
159
- if (suffix.startsWith('-') && baseUrlSuffixes.hasOwnProperty(env)) {
160
- return "https://api".concat(baseUrlSuffixes[env], ".aglty.io/").concat(guid);
161
- }
162
- else {
163
- //use default url
164
- return "https://".concat(guid, "-api.agilitycms.cloud");
165
- }
166
- }
167
- function validateConfigParams(configParams) {
168
- if (!configParams.guid || configParams.guid.length == 0) {
169
- throw new TypeError('You must provide an guid.');
170
- }
171
- else if (!configParams.apiKey || configParams.apiKey.length == 0) {
172
- throw new TypeError('You must provide an access token.');
173
- }
174
- else if (configParams.caching && isNaN(configParams.caching.maxAge)) {
175
- throw new TypeError('When specifying a cache maxAge, you must set a number value in miliseconds, i.e. 180000 (3 mins).');
176
- }
177
- else if (configParams.baseUrl && !(0, utils_2.isHttps)(configParams.baseUrl)) {
178
- throw new TypeError("When specifying a baseUrl (".concat(configParams.baseUrl, "), it must be over HTTPs."));
179
- }
180
- else {
181
- return;
182
- }
183
- }
184
- var ApiClient = /** @class */ (function () {
185
- function ApiClient(userConfig) {
186
- this.types = types;
187
- var envConfig = buildEnvConfig();
188
- //merge our config - user values will override our defaults
189
- var config = __assign(__assign(__assign({}, defaultConfig), envConfig), userConfig);
190
- //compute the base Url
191
- if (!config.baseUrl) {
192
- config.baseUrl = buildBaseUrl((config === null || config === void 0 ? void 0 : config.guid) || '');
193
- }
194
- else {
195
- //we are using a custom url, make sure we include the guid in the headers
196
- config.requiresGuidInHeaders = true;
197
- }
198
- this.config = config;
199
- var adapter = undefined;
200
- //should we turn on caching?
201
- if (config.caching.maxAge > 0) {
202
- var cache = (0, axios_cache_adapter_1.setupCache)({
203
- maxAge: config.caching.maxAge,
204
- exclude: { query: false }
205
- });
206
- adapter = cache.adapter;
207
- }
208
- this._api = axios_1.default.create({
209
- adapter: adapter,
210
- });
211
- }
212
- ApiClient.prototype.getContentItem = function (params) {
213
- return __awaiter(this, void 0, void 0, function () {
214
- return __generator(this, function (_a) {
215
- return [2 /*return*/, getContentItem_1.default.call(this, params)];
216
- });
217
- });
218
- };
219
- ApiClient.prototype.getContentList = function (params) {
220
- return __awaiter(this, void 0, void 0, function () {
221
- return __generator(this, function (_a) {
222
- return [2 /*return*/, getContentList_1.default.call(this, params)];
223
- });
224
- });
225
- };
226
- ApiClient.prototype.getGallery = function (params) {
227
- return __awaiter(this, void 0, void 0, function () {
228
- return __generator(this, function (_a) {
229
- return [2 /*return*/, getGallery_1.default.call(this, params)];
230
- });
231
- });
232
- };
233
- ApiClient.prototype.getPage = function (params) {
234
- return __awaiter(this, void 0, void 0, function () {
235
- return __generator(this, function (_a) {
236
- return [2 /*return*/, getPage_1.default.call(this, params)];
237
- });
238
- });
239
- };
240
- ApiClient.prototype.getSitemapFlat = function (params) {
241
- return __awaiter(this, void 0, void 0, function () {
242
- return __generator(this, function (_a) {
243
- return [2 /*return*/, getSitemapFlat_1.default.call(this, params)];
244
- });
245
- });
246
- };
247
- ApiClient.prototype.getSitemapNested = function (params) {
248
- return __awaiter(this, void 0, void 0, function () {
249
- return __generator(this, function (_a) {
250
- return [2 /*return*/, getSitemapNested_1.default.call(this, params)];
251
- });
252
- });
253
- };
254
- ApiClient.prototype.getUrlRedirections = function (params) {
255
- return __awaiter(this, void 0, void 0, function () {
256
- return __generator(this, function (_a) {
257
- return [2 /*return*/, getUrlRedirections_1.default.call(this, params)];
258
- });
259
- });
260
- };
261
- ApiClient.prototype.getSyncContent = function (params) {
262
- return __awaiter(this, void 0, void 0, function () {
263
- return __generator(this, function (_a) {
264
- return [2 /*return*/, getSyncContent_1.default.call(this, params)];
265
- });
266
- });
267
- };
268
- ApiClient.prototype.getSyncPages = function (params) {
269
- return __awaiter(this, void 0, void 0, function () {
270
- return __generator(this, function (_a) {
271
- return [2 /*return*/, getSyncPages_1.default.call(this, params)];
272
- });
273
- });
274
- };
275
- //the function that actually makes ALL our requests
276
- ApiClient.prototype.makeRequest = function (reqConfig) {
277
- return __awaiter(this, void 0, void 0, function () {
278
- var response, data, error_1;
279
- return __generator(this, function (_a) {
280
- switch (_a.label) {
281
- case 0:
282
- if (this.config.debug) {
283
- (0, utils_1.logDebug)("AgilityCMS Fetch API LOG: ".concat(reqConfig.baseURL).concat(reqConfig.url));
284
- }
285
- _a.label = 1;
286
- case 1:
287
- _a.trys.push([1, 4, , 5]);
288
- return [4 /*yield*/, this._api(reqConfig)];
289
- case 2:
290
- response = _a.sent();
291
- data = response.data;
292
- //if our response is from cache, inject that property in the data response
293
- if (response.request.fromCache) {
294
- data['fromCache'] = true;
295
- }
296
- if (this.config.debug) {
297
- data['agilityResponseHeaders'] = response.headers;
298
- }
299
- return [4 /*yield*/, data];
300
- case 3: return [2 /*return*/, _a.sent()];
301
- case 4:
302
- error_1 = _a.sent();
303
- (0, utils_1.logError)("AgilityCMS Fetch API ERROR: Request failed for ".concat(reqConfig.baseURL).concat(reqConfig.url, " ... ").concat(error_1, " ... Does the item exist?"));
304
- return [3 /*break*/, 5];
305
- case 5: return [2 /*return*/];
306
- }
307
- });
308
- });
309
- };
310
- return ApiClient;
311
- }());
312
- function getApi(config) {
313
- validateConfigParams(config);
314
- return new ApiClient(config);
315
- }
316
- exports.default = getApi;
package/dist/index.js DELETED
@@ -1,7 +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
- var api_client_1 = __importDefault(require("./api-client"));
7
- exports.default = { getApi: api_client_1.default };
@@ -1,49 +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
- var utils_1 = require("../utils");
15
- var defaultParams = {
16
- contentLinkDepth: 1,
17
- expandAllContentLinks: false
18
- };
19
- function getContentItem(requestParams) {
20
- validateRequestParams(requestParams);
21
- //merge default params with request params
22
- requestParams = __assign(__assign({}, defaultParams), requestParams);
23
- var req = {
24
- url: "/item/".concat(requestParams.contentID, "?contentLinkDepth=").concat(requestParams.contentLinkDepth, "&expandAllContentLinks=").concat(requestParams.expandAllContentLinks),
25
- method: 'get',
26
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, requestParams.locale ? requestParams.locale : requestParams.languageCode),
27
- headers: (0, utils_1.buildAuthHeader)(this.config),
28
- params: {}
29
- };
30
- return this.makeRequest(req);
31
- }
32
- function validateRequestParams(requestParams) {
33
- if (!requestParams.languageCode && !requestParams.locale) {
34
- throw new TypeError('You must include a locale in your request params.');
35
- }
36
- else if (!requestParams.contentID) {
37
- throw new TypeError('You must include a contentID number in your request params.');
38
- }
39
- else if (requestParams.contentLinkDepth && (isNaN(requestParams.contentLinkDepth) || requestParams.contentLinkDepth < 0)) {
40
- throw new TypeError('When specifying contentLinkDepth, it must be a number greater than 0.');
41
- }
42
- else if (requestParams.expandAllContentLinks && typeof requestParams.expandAllContentLinks !== 'boolean') {
43
- throw new TypeError('ExpandAllContentLinks parameter must be a value of true or false');
44
- }
45
- else {
46
- return;
47
- }
48
- }
49
- exports.default = getContentItem;
@@ -1,94 +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
- var utils_1 = require("../utils");
15
- function getContentList(requestParams) {
16
- validateRequestParams(requestParams);
17
- requestParams.referenceName = sanitizeReferenceName(requestParams.referenceName);
18
- //merge default params with request params
19
- requestParams = __assign(__assign({}, defaultParams), requestParams);
20
- var req = {
21
- url: (0, utils_1.buildPathUrl)("list", requestParams.referenceName, requestParams.skip, requestParams.take, requestParams.sort, requestParams.direction, requestParams.filters, requestParams.filtersLogicOperator, requestParams.contentLinkDepth, requestParams.expandAllContentLinks),
22
- method: 'get',
23
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, requestParams.locale ? requestParams.locale : requestParams.languageCode),
24
- headers: (0, utils_1.buildAuthHeader)(this.config),
25
- params: {}
26
- };
27
- return this.makeRequest(req);
28
- }
29
- function sanitizeReferenceName(referenceName) {
30
- return referenceName.toLowerCase();
31
- }
32
- function validateRequestParams(requestParams) {
33
- if (!requestParams.languageCode && !requestParams.locale) {
34
- throw new TypeError('You must include a locale in your request params.');
35
- }
36
- else if (!requestParams.referenceName) {
37
- //must have a referenceName
38
- throw new TypeError('You must include a content referenceName in your request params.');
39
- }
40
- else if (requestParams.take && isNaN(requestParams.take)) {
41
- //take parameter must be a number
42
- throw new TypeError('Take parameter must be a number.');
43
- }
44
- else if ((requestParams.take || requestParams.take == 0) && !isNaN(requestParams.take) && requestParams.take < 1) {
45
- //take parameter must be greater than 0
46
- throw new TypeError('Take parameter must be greater than 0.');
47
- }
48
- else if (requestParams.take && !isNaN(requestParams.take) && requestParams.take > 250) {
49
- //take parameter cannot be greater than 250
50
- throw new TypeError('Take parameter must be 250 or less.');
51
- }
52
- else if (requestParams.skip && isNaN(requestParams.skip)) {
53
- //skip parameter must be a number
54
- throw new TypeError('Skip parameter must be a number.');
55
- }
56
- else if (requestParams.skip && !isNaN(requestParams.skip) && requestParams.skip < 0) {
57
- //skip parameter must be a number greater than 0
58
- throw new TypeError('Skip parameter must be 0 or greater');
59
- }
60
- else if (requestParams.direction && (requestParams.direction !== 'desc' && requestParams.direction !== 'asc')) {
61
- //check if the request direction parameter is valid
62
- throw new TypeError('Direction parameter must have a value of "asc" or "desc"');
63
- }
64
- else if (requestParams.filters && requestParams.filters.length > 0) {
65
- //check if the request direction parameter is valid
66
- for (var i = 0; i < requestParams.filters.length; i++) {
67
- var filter = requestParams.filters[i];
68
- if (!filter.hasOwnProperty('property')) {
69
- throw new TypeError(JSON.stringify(filter) + " does not contain 'property'.");
70
- }
71
- else if (!filter.hasOwnProperty('operator')) {
72
- throw new TypeError(JSON.stringify(filter) + " does not contain 'operator'.");
73
- }
74
- else if (!filter.hasOwnProperty('value')) {
75
- throw new TypeError(JSON.stringify(filter) + " does not contain 'value'.");
76
- }
77
- if (['eq', 'ne', 'gt', 'gte', 'lt', 'lte', 'like'].indexOf(filter.operator.toLowerCase()) < 0) {
78
- throw new TypeError(JSON.stringify(filter) + "Operator must be one of ['eq','ne','gt','gte','lt','lte','like'].");
79
- }
80
- }
81
- }
82
- else if (requestParams.filtersLogicOperator && requestParams.filtersLogicOperator.toLowerCase() !== 'and' && requestParams.filtersLogicOperator.toLowerCase() !== 'or') {
83
- throw new TypeError('FiltersLogicOperator parameter must have a value of "AND" or "OR"');
84
- }
85
- else if (requestParams.expandAllContentLinks && typeof requestParams.expandAllContentLinks !== 'boolean') {
86
- throw new TypeError('ExpandAllContentLinks parameter must be a value of true or false');
87
- }
88
- return true;
89
- }
90
- var defaultParams = {
91
- contentLinkDepth: 1,
92
- expandAllContentLinks: false
93
- };
94
- exports.default = getContentList;
@@ -1,39 +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
- var utils_1 = require("../utils");
15
- function getGallery(requestParams) {
16
- validateRequestParams(requestParams);
17
- //merge default params with request params
18
- requestParams = __assign(__assign({}, defaultParams), requestParams);
19
- var req = {
20
- url: "/".concat(requestParams.galleryID),
21
- method: 'get',
22
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, 'gallery'),
23
- headers: (0, utils_1.buildAuthHeader)(this.config),
24
- params: {}
25
- };
26
- return this.makeRequest(req);
27
- }
28
- function validateRequestParams(requestParams) {
29
- if (!requestParams.galleryID) {
30
- throw new TypeError('You must include a galleryID number in your request params.');
31
- }
32
- else {
33
- return;
34
- }
35
- }
36
- var defaultParams = {
37
- contentLinkDepth: 1
38
- };
39
- exports.default = getGallery;
@@ -1,47 +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
- var utils_1 = require("../utils");
15
- function getPage(requestParams) {
16
- validateRequestParams(requestParams);
17
- //merge default params with request params
18
- requestParams = __assign(__assign({}, defaultParams), requestParams);
19
- var req = {
20
- url: "/page/".concat(requestParams.pageID, "?contentLinkDepth=").concat(requestParams.contentLinkDepth, "&expandAllContentLinks=").concat(requestParams.expandAllContentLinks),
21
- method: 'get',
22
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, requestParams.locale || requestParams.languageCode),
23
- headers: (0, utils_1.buildAuthHeader)(this.config),
24
- params: {}
25
- };
26
- console.log(req, 'hellooo');
27
- return this.makeRequest(req);
28
- }
29
- function validateRequestParams(requestParams) {
30
- if (!requestParams.languageCode && !requestParams.locale) {
31
- throw new TypeError('You must include a locale in your request params.');
32
- }
33
- else if (!requestParams.pageID) {
34
- throw new TypeError('You must include a pageID in your request params.');
35
- }
36
- else if (requestParams.expandAllContentLinks && typeof requestParams.expandAllContentLinks !== 'boolean') {
37
- throw new TypeError('ExpandAllContentLinks parameter must be a value of true or false');
38
- }
39
- else {
40
- return;
41
- }
42
- }
43
- var defaultParams = {
44
- contentLinkDepth: 2,
45
- expandAllContentLinks: true
46
- };
47
- exports.default = getPage;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var utils_1 = require("../utils");
4
- function getSitemapFlat(requestParams) {
5
- validateRequestParams(requestParams);
6
- var req = {
7
- url: "/sitemap/flat/".concat(requestParams.channelName),
8
- method: 'get',
9
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, requestParams.locale || requestParams.languageCode),
10
- headers: (0, utils_1.buildAuthHeader)(this.config),
11
- params: {}
12
- };
13
- return this.makeRequest(req);
14
- }
15
- function validateRequestParams(requestParams) {
16
- if (!requestParams.languageCode && !requestParams.locale) {
17
- throw new TypeError('You must include a locale in your request params.');
18
- }
19
- else if (!requestParams.channelName) {
20
- throw new TypeError('You must include a channelName in your request params.');
21
- }
22
- else {
23
- return;
24
- }
25
- }
26
- exports.default = getSitemapFlat;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var utils_1 = require("../utils");
4
- function getSitemapNested(requestParams) {
5
- validateRequestParams(requestParams);
6
- var req = {
7
- url: "/sitemap/nested/".concat(requestParams.channelName),
8
- method: 'get',
9
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, requestParams.locale || requestParams.languageCode),
10
- headers: (0, utils_1.buildAuthHeader)(this.config),
11
- params: {}
12
- };
13
- return this.makeRequest(req);
14
- }
15
- function validateRequestParams(requestParams) {
16
- if (!requestParams.languageCode && !requestParams.locale) {
17
- throw new TypeError('You must include a locale in your request params.');
18
- }
19
- else if (!requestParams.channelName) {
20
- throw new TypeError('You must include a channelName in your request params.');
21
- }
22
- }
23
- exports.default = getSitemapNested;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var utils_1 = require("../utils");
4
- function getSyncContent(requestParams) {
5
- validateRequestParams(requestParams);
6
- var req = {
7
- url: "/sync/items?pageSize=".concat(requestParams.pageSize, "&syncToken=").concat(requestParams.syncToken),
8
- method: 'get',
9
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, requestParams.locale || requestParams.languageCode),
10
- headers: (0, utils_1.buildAuthHeader)(this.config),
11
- params: {}
12
- };
13
- return this.makeRequest(req);
14
- }
15
- function validateRequestParams(requestParams) {
16
- if (!requestParams.languageCode && !requestParams.locale) {
17
- throw new TypeError('You must include a locale in your request params.');
18
- }
19
- else if (requestParams.syncToken == undefined || requestParams.syncToken == null) {
20
- throw new TypeError('You must include a syncToken value your request params. Use zero (0) to start a new sync.');
21
- }
22
- else {
23
- return;
24
- }
25
- }
26
- exports.default = getSyncContent;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var utils_1 = require("../utils");
4
- function getSyncPages(requestParams) {
5
- validateRequestParams(requestParams);
6
- var req = {
7
- url: "/sync/pages?pageSize=".concat(requestParams.pageSize, "&syncToken=").concat(requestParams.syncToken),
8
- method: 'get',
9
- baseURL: (0, utils_1.buildRequestUrlPath)(this.config, requestParams.locale || requestParams.languageCode),
10
- headers: (0, utils_1.buildAuthHeader)(this.config),
11
- params: {}
12
- };
13
- return this.makeRequest(req);
14
- }
15
- function validateRequestParams(requestParams) {
16
- if (!requestParams.languageCode && !requestParams.locale) {
17
- throw new TypeError('You must include a locale in your request params.');
18
- }
19
- else if (requestParams.syncToken == undefined || requestParams.syncToken == null) {
20
- throw new TypeError('You must include a syncToken value your request params. Use zero (0) to start a new sync.');
21
- }
22
- else {
23
- return;
24
- }
25
- }
26
- exports.default = getSyncPages;