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

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 (296) 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.0-2341ee400c-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-axios-npm-0.14.0-42f41917ea-12a230b940.zip +0 -0
  15. package/.yarn/cache/@types-node-npm-18.17.4-7b6cd3731e-d4c458202d.zip +0 -0
  16. package/.yarn/cache/{@types-node-npm-20.4.5-7555fad0d4-36a0304a8d.zip → @types-node-npm-20.4.9-c55842c502-504e3da962.zip} +0 -0
  17. package/.yarn/cache/@types-triple-beam-npm-1.3.2-e1699700a8-dd7b4a563f.zip +0 -0
  18. package/.yarn/cache/agentkeepalive-npm-4.5.0-f237b580b2-13278cd5b1.zip +0 -0
  19. package/.yarn/cache/args-npm-5.0.3-ec59f35e6d-ac39e65609.zip +0 -0
  20. package/.yarn/cache/async-npm-3.2.4-aba13508f9-43d07459a4.zip +0 -0
  21. package/.yarn/cache/axios-npm-1.4.0-4d7ce8ca3e-7fb6a4313b.zip +0 -0
  22. package/.yarn/cache/camelcase-npm-5.0.0-c808398846-8bfe920e04.zip +0 -0
  23. package/.yarn/cache/caniuse-lite-npm-1.0.30001519-1d6b5bc825-66085133ed.zip +0 -0
  24. package/.yarn/cache/color-npm-3.2.1-568cf1014f-f81220e8b7.zip +0 -0
  25. package/.yarn/cache/color-string-npm-1.9.1-dc020e56be-c13fe7cff7.zip +0 -0
  26. package/.yarn/cache/colorspace-npm-1.1.4-f01655548a-bb3934ef3c.zip +0 -0
  27. package/.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-ab8c07884e.zip +0 -0
  28. package/.yarn/cache/detect-file-npm-1.0.0-a22ca7c5b6-1861e41461.zip +0 -0
  29. package/.yarn/cache/{electron-to-chromium-npm-1.4.481-eaa539b254-52b7e8d7ae.zip → electron-to-chromium-npm-1.4.488-9c254135e9-431c100e01.zip} +0 -0
  30. package/.yarn/cache/enabled-npm-2.0.0-bf5d96c9d8-9d256d89f4.zip +0 -0
  31. package/.yarn/cache/esbuild-npm-0.19.0-1a8543a0f4-77ef2e57a9.zip +0 -0
  32. package/.yarn/cache/expand-tilde-npm-2.0.2-a4020a62f5-2efe6ed407.zip +0 -0
  33. package/.yarn/cache/fecha-npm-4.2.3-75248da3fd-f94e2fb3ac.zip +0 -0
  34. package/.yarn/cache/find-node-modules-npm-2.1.3-431b2c5604-4b8a194ffd.zip +0 -0
  35. package/.yarn/cache/findup-sync-npm-4.0.0-3884c677a0-94131e1107.zip +0 -0
  36. package/.yarn/cache/fn.name-npm-1.1.0-b472333184-e357144f48.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/kuler-npm-2.0.0-19e74c9695-9e10b5a165.zip +0 -0
  47. package/.yarn/cache/leven-npm-2.1.0-19f0a16606-f7b4a01b15.zip +0 -0
  48. package/.yarn/cache/logform-npm-2.5.1-06017d630d-08fdf03be5.zip +0 -0
  49. package/.yarn/cache/merge-npm-2.1.1-90e7307c49-9c36b0e25a.zip +0 -0
  50. package/.yarn/cache/minimist-npm-1.2.8-d7af7b1dce-75a6d645fb.zip +0 -0
  51. package/.yarn/cache/mri-npm-1.1.4-d22a399f26-e65b9aed3b.zip +0 -0
  52. package/.yarn/cache/npm-dts-npm-1.3.12-c921cfddec-3897533c49.zip +0 -0
  53. package/.yarn/cache/npm-path-npm-2.0.4-fda8ca6d1d-3dfe24d9bb.zip +0 -0
  54. package/.yarn/cache/npm-run-npm-5.0.1-ba4f9faa65-1c6e171bf0.zip +0 -0
  55. package/.yarn/cache/npm-which-npm-3.0.1-2951392327-fba4864161.zip +0 -0
  56. package/.yarn/cache/one-time-npm-1.0.0-aeaad5e524-fd008d7e99.zip +0 -0
  57. package/.yarn/cache/parse-passwd-npm-1.0.0-ace6effa1d-4e55e0231d.zip +0 -0
  58. package/.yarn/cache/protochain-npm-1.0.5-ca0a4ef353-81f417e4f5.zip +0 -0
  59. package/.yarn/cache/proxy-from-env-npm-1.1.0-c13d07f26b-ed7fcc2ba0.zip +0 -0
  60. package/.yarn/cache/resolve-dir-npm-1.0.1-0a95903c18-ef736b8ed6.zip +0 -0
  61. package/.yarn/cache/{resolve-npm-1.22.2-9d9621a4ae-7e5df75796.zip → resolve-npm-1.22.4-faa4f32bdd-23f25174c2.zip} +0 -0
  62. package/.yarn/cache/{resolve-patch-f4c4056507-66cc788f13.zip → resolve-patch-efbbaf0edd-c45f2545fd.zip} +0 -0
  63. package/.yarn/cache/rimraf-npm-5.0.1-26fb251a1d-bafce85391.zip +0 -0
  64. package/.yarn/cache/safe-stable-stringify-npm-2.4.3-d895741b40-3aeb644497.zip +0 -0
  65. package/.yarn/cache/serializerr-npm-1.0.3-844e49be0c-20fdf7a7e3.zip +0 -0
  66. package/.yarn/cache/simple-swizzle-npm-0.2.2-8dee37fad1-a7f3f2ab5c.zip +0 -0
  67. package/.yarn/cache/stack-trace-npm-0.0.10-9460b173e1-473036ad32.zip +0 -0
  68. package/.yarn/cache/text-hex-npm-1.0.0-22389e4d56-1138f68adc.zip +0 -0
  69. package/.yarn/cache/tmp-npm-0.2.1-a9c8d9c0ca-8b12146541.zip +0 -0
  70. package/.yarn/cache/triple-beam-npm-1.4.1-d21ba5346a-2e881a3e8e.zip +0 -0
  71. package/.yarn/cache/which-npm-1.3.1-f0ebb8bdd8-f2e185c624.zip +0 -0
  72. package/.yarn/cache/winston-npm-3.7.2-5336ad5eff-f1f1a860d2.zip +0 -0
  73. package/.yarn/cache/winston-transport-npm-4.5.0-e10bfb2169-a56e5678a8.zip +0 -0
  74. package/.yarn/install-state.gz +0 -0
  75. package/LICENSE +21 -21
  76. package/README.md +108 -108
  77. package/build.js +26 -0
  78. package/dist/browser.js +2057 -0
  79. package/dist/index.d.ts +7 -10
  80. package/dist/node.js +13061 -0
  81. package/dist/types/ContentZone.d.ts +1 -0
  82. package/dist/types/Page.d.ts +1 -1
  83. package/jest.config.js +5 -5
  84. package/package.json +57 -50
  85. package/tsconfig.json +14 -14
  86. package/.nyc_output/713b1ec2-05ec-4b67-8061-b6cad0a45ad5.json +0 -1
  87. package/.yarn/cache/@babel-code-frame-npm-7.22.5-b36f88d6f9-cfe804f518.zip +0 -0
  88. package/.yarn/cache/@babel-highlight-npm-7.22.5-3182ccc1fe-f61ae6de6e.zip +0 -0
  89. package/.yarn/cache/@babel-parser-npm-7.22.7-7fbdf28552-02209ddbd4.zip +0 -0
  90. package/.yarn/cache/@babel-traverse-npm-7.22.8-98fbaaf7d8-a381369bc3.zip +0 -0
  91. package/.yarn/cache/@babel-types-npm-7.22.5-d1e4264bef-c13a9c1dc7.zip +0 -0
  92. package/.yarn/cache/@isaacs-string-locale-compare-npm-1.1.0-3911094464-7287da5d11.zip +0 -0
  93. package/.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.14-f5f0630788-61100637b6.zip +0 -0
  94. package/.yarn/cache/@npmcli-arborist-npm-6.3.0-9d3adbe1f6-4f59d5408c.zip +0 -0
  95. package/.yarn/cache/@npmcli-config-npm-6.2.1-4191bac29e-8c8d47f900.zip +0 -0
  96. package/.yarn/cache/@npmcli-disparity-colors-npm-3.0.0-9fe9301a52-49320c6927.zip +0 -0
  97. package/.yarn/cache/@npmcli-git-npm-4.1.0-f7322fced9-37efb92659.zip +0 -0
  98. package/.yarn/cache/@npmcli-installed-package-contents-npm-2.0.2-99564e3824-60789d5ed2.zip +0 -0
  99. package/.yarn/cache/@npmcli-map-workspaces-npm-3.0.4-b07359726d-99607dbc50.zip +0 -0
  100. package/.yarn/cache/@npmcli-metavuln-calculator-npm-5.0.1-b28e316793-cd08ad9cc4.zip +0 -0
  101. package/.yarn/cache/@npmcli-name-from-folder-npm-2.0.0-18e2dba870-fb3ef891aa.zip +0 -0
  102. package/.yarn/cache/@npmcli-node-gyp-npm-3.0.0-b160a0116c-fe3802b813.zip +0 -0
  103. package/.yarn/cache/@npmcli-package-json-npm-4.0.1-8fba8ea1a2-699b80a72f.zip +0 -0
  104. package/.yarn/cache/@npmcli-promise-spawn-npm-6.0.2-c9941b207c-aa725780c1.zip +0 -0
  105. package/.yarn/cache/@npmcli-query-npm-3.0.0-53c05bcb30-90fca7edd5.zip +0 -0
  106. package/.yarn/cache/@npmcli-run-script-npm-6.0.2-6a98dec431-7a671d7dbe.zip +0 -0
  107. package/.yarn/cache/@sigstore-bundle-npm-1.0.0-6224fc68db-9902b9fcd2.zip +0 -0
  108. package/.yarn/cache/@sigstore-protobuf-specs-npm-0.2.0-93c8e6c759-6b7c5d3612.zip +0 -0
  109. package/.yarn/cache/@sigstore-tuf-npm-1.0.3-9a2b6b14aa-0a32594b73.zip +0 -0
  110. package/.yarn/cache/@tufjs-canonical-json-npm-1.0.0-66d27d850f-9ff3bcd129.zip +0 -0
  111. package/.yarn/cache/@tufjs-models-npm-1.0.4-a1dddaf561-b489baa854.zip +0 -0
  112. package/.yarn/cache/@types-node-npm-18.11.9-d21dd6ec05-cc0aae109e.zip +0 -0
  113. package/.yarn/cache/abbrev-npm-2.0.0-0eb38a17e5-0e994ad2aa.zip +0 -0
  114. package/.yarn/cache/abort-controller-npm-3.0.0-2f3a9a2bcb-170bdba9b4.zip +0 -0
  115. package/.yarn/cache/agentkeepalive-npm-4.3.0-ac3d8e6807-982453aa44.zip +0 -0
  116. package/.yarn/cache/archy-npm-1.0.0-7db8bfdc3b-504ae7af65.zip +0 -0
  117. package/.yarn/cache/are-we-there-yet-npm-4.0.1-734c8e8dce-16871ee259.zip +0 -0
  118. package/.yarn/cache/axios-cache-adapter-npm-2.7.3-26c357b785-ff44bee6a2.zip +0 -0
  119. package/.yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip +0 -0
  120. package/.yarn/cache/bin-links-npm-4.0.2-592819adbc-6f83e73100.zip +0 -0
  121. package/.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip +0 -0
  122. package/.yarn/cache/buffer-npm-6.0.3-cd90dfedfe-5ad23293d9.zip +0 -0
  123. package/.yarn/cache/builtins-npm-5.0.1-6d4820dd76-66d204657f.zip +0 -0
  124. package/.yarn/cache/cache-control-esm-npm-1.0.0-ee383a8c40-4f8c8399f2.zip +0 -0
  125. package/.yarn/cache/caniuse-lite-npm-1.0.30001518-2e4e82df98-1b63272f6e.zip +0 -0
  126. package/.yarn/cache/chalk-npm-5.3.0-d181999efb-623922e077.zip +0 -0
  127. package/.yarn/cache/charenc-npm-0.0.2-aca0c2f207-81dcadbe57.zip +0 -0
  128. package/.yarn/cache/cidr-regex-npm-3.1.1-a5f3c156e7-ef9306d086.zip +0 -0
  129. package/.yarn/cache/cli-columns-npm-4.0.0-7c43bbe435-fa1a3a7f4e.zip +0 -0
  130. package/.yarn/cache/cli-table3-npm-0.6.3-1dca7f9152-09897f6846.zip +0 -0
  131. package/.yarn/cache/clone-npm-1.0.4-a610fcbcf9-d06418b733.zip +0 -0
  132. package/.yarn/cache/cmd-shim-npm-6.0.1-87ebf774a0-359006b3a5.zip +0 -0
  133. package/.yarn/cache/columnify-npm-1.6.0-aa925d932b-0d59002361.zip +0 -0
  134. package/.yarn/cache/common-ancestor-path-npm-1.0.1-27534e68da-1d2e418606.zip +0 -0
  135. package/.yarn/cache/crypt-npm-0.0.2-033627d94f-baf4c7bbe0.zip +0 -0
  136. package/.yarn/cache/cssesc-npm-3.0.0-15ec56f86f-f8c4ababff.zip +0 -0
  137. package/.yarn/cache/defaults-npm-1.0.4-f3fbaf2528-3a88b7a587.zip +0 -0
  138. package/.yarn/cache/depd-npm-2.0.0-b6c51a4b43-abbe19c768.zip +0 -0
  139. package/.yarn/cache/diff-npm-5.1.0-d24d222280-c7bf0df7c9.zip +0 -0
  140. package/.yarn/cache/event-target-shim-npm-5.0.1-cb48709025-1ffe3bb22a.zip +0 -0
  141. package/.yarn/cache/events-npm-3.3.0-c280bc7e48-f6f487ad21.zip +0 -0
  142. package/.yarn/cache/fastest-levenshtein-npm-1.0.16-192d328856-a78d44285c.zip +0 -0
  143. package/.yarn/cache/fsevents-patch-2882183fbf-8.zip +0 -0
  144. package/.yarn/cache/gauge-npm-5.0.1-69ab73de36-09b1eb8d8c.zip +0 -0
  145. package/.yarn/cache/hosted-git-info-npm-6.1.1-d57807f6a5-fcd3ca2eaa.zip +0 -0
  146. package/.yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-5144c0c981.zip +0 -0
  147. package/.yarn/cache/ignore-walk-npm-6.0.3-ebca6b06c4-d8ba534beb.zip +0 -0
  148. package/.yarn/cache/ini-npm-4.1.1-01c2cbda7b-0e59095540.zip +0 -0
  149. package/.yarn/cache/init-package-json-npm-5.0.0-0656c8f580-ad601c717d.zip +0 -0
  150. package/.yarn/cache/install-npm-0.13.0-53f6b8981f-645bad1253.zip +0 -0
  151. package/.yarn/cache/ip-regex-npm-4.3.0-4ac12c6be9-7ff904b891.zip +0 -0
  152. package/.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-4a186d995d.zip +0 -0
  153. package/.yarn/cache/is-cidr-npm-4.0.2-74bbb734d3-ee6e670e65.zip +0 -0
  154. package/.yarn/cache/is-core-module-npm-2.12.1-ce74e89160-f04ea30533.zip +0 -0
  155. package/.yarn/cache/json-parse-even-better-errors-npm-3.0.0-3675833c0a-f1970b5220.zip +0 -0
  156. package/.yarn/cache/json-stringify-nice-npm-1.1.4-0b0ddb188b-6ddf781148.zip +0 -0
  157. package/.yarn/cache/jsonparse-npm-1.3.1-b6fde74828-6514a7be46.zip +0 -0
  158. package/.yarn/cache/just-diff-apply-npm-5.5.0-04951e29f4-ed6bbd5978.zip +0 -0
  159. package/.yarn/cache/just-diff-npm-6.0.2-f73771d84e-1a0c7524f6.zip +0 -0
  160. package/.yarn/cache/libnpmaccess-npm-7.0.2-57b91bfda5-73d49f3939.zip +0 -0
  161. package/.yarn/cache/libnpmdiff-npm-5.0.19-26809d318b-47835abc81.zip +0 -0
  162. package/.yarn/cache/libnpmexec-npm-6.0.3-9bfdfc5775-c9c92dc29a.zip +0 -0
  163. package/.yarn/cache/libnpmfund-npm-4.0.19-742ff1c9b5-77905879f7.zip +0 -0
  164. package/.yarn/cache/libnpmhook-npm-9.0.3-1ed2368ed2-535ecefa22.zip +0 -0
  165. package/.yarn/cache/libnpmorg-npm-5.0.4-8ff49f84d5-4e170ba145.zip +0 -0
  166. package/.yarn/cache/libnpmpack-npm-5.0.19-fad75068a8-d164d61383.zip +0 -0
  167. package/.yarn/cache/libnpmpublish-npm-7.5.0-e0dfdc81a9-feb99876be.zip +0 -0
  168. package/.yarn/cache/libnpmsearch-npm-6.0.2-664c687722-7a62e5cb1c.zip +0 -0
  169. package/.yarn/cache/libnpmteam-npm-5.0.3-1e0a2afab9-a39ccdb4a6.zip +0 -0
  170. package/.yarn/cache/libnpmversion-npm-4.0.2-257501dd35-4666db4671.zip +0 -0
  171. package/.yarn/cache/md5-npm-2.3.0-86c49d3915-a63cacf401.zip +0 -0
  172. package/.yarn/cache/minipass-json-stream-npm-1.0.1-96490706d6-791b696a27.zip +0 -0
  173. package/.yarn/cache/mute-stream-npm-1.0.0-b6e846d471-36fc968b0e.zip +0 -0
  174. package/.yarn/cache/nopt-npm-7.2.0-dd734b678d-a9c0f57fb8.zip +0 -0
  175. package/.yarn/cache/normalize-package-data-npm-5.0.0-6327e2af68-a459f05eaf.zip +0 -0
  176. package/.yarn/cache/npm-audit-report-npm-5.0.0-b0af56272d-a18f16f514.zip +0 -0
  177. package/.yarn/cache/npm-bundled-npm-3.0.0-0b3c5ee4f3-110859c2d6.zip +0 -0
  178. package/.yarn/cache/npm-install-checks-npm-6.1.1-e05db36ccf-8fb3ed05cf.zip +0 -0
  179. package/.yarn/cache/npm-normalize-package-bin-npm-3.0.1-6c120b50f7-de416d720a.zip +0 -0
  180. package/.yarn/cache/npm-npm-9.8.1-c06ac946c2-d3f12cd0c0.zip +0 -0
  181. package/.yarn/cache/npm-package-arg-npm-10.1.0-e9f0aaa69d-8fe4b6a742.zip +0 -0
  182. package/.yarn/cache/npm-packlist-npm-7.0.4-1c0b919056-5ffa1f8f0b.zip +0 -0
  183. package/.yarn/cache/npm-pick-manifest-npm-8.0.2-ec194cb513-c9f71b5735.zip +0 -0
  184. package/.yarn/cache/npm-profile-npm-7.0.1-73c58f96b1-c78d2e6394.zip +0 -0
  185. package/.yarn/cache/npm-registry-fetch-npm-14.0.5-6b3e6c0dd0-c636496429.zip +0 -0
  186. package/.yarn/cache/npm-user-validate-npm-2.0.0-2fa10ebf8a-52c0c64cb2.zip +0 -0
  187. package/.yarn/cache/npmlog-npm-7.0.1-a0f355f530-caabeb1f55.zip +0 -0
  188. package/.yarn/cache/pacote-npm-15.2.0-b9ed3321e9-c731572be2.zip +0 -0
  189. package/.yarn/cache/parse-conflict-json-npm-3.0.1-9455a1ad04-d8d2656bc0.zip +0 -0
  190. package/.yarn/cache/postcss-selector-parser-npm-6.0.13-f732d92326-f89163338a.zip +0 -0
  191. package/.yarn/cache/proc-log-npm-3.0.0-a8c21c2f0f-02b64e1b39.zip +0 -0
  192. package/.yarn/cache/process-npm-0.11.10-aeb3b641ae-bfcce49814.zip +0 -0
  193. package/.yarn/cache/promise-all-reject-late-npm-1.0.1-19ba0dce9c-d7d61ac412.zip +0 -0
  194. package/.yarn/cache/promise-call-limit-npm-1.0.2-2a84fbc485-d0664dd295.zip +0 -0
  195. package/.yarn/cache/promise-inflight-npm-1.0.1-5bb925afac-2274948309.zip +0 -0
  196. package/.yarn/cache/promzard-npm-1.0.0-a0d17e2d53-c069488271.zip +0 -0
  197. package/.yarn/cache/qrcode-terminal-npm-0.12.0-f81f8a6a67-51638d11d0.zip +0 -0
  198. package/.yarn/cache/read-cmd-shim-npm-4.0.0-2339b15fb0-2fb5a8a389.zip +0 -0
  199. package/.yarn/cache/read-npm-2.1.0-0e0cb8a375-e745999138.zip +0 -0
  200. package/.yarn/cache/read-package-json-fast-npm-3.0.2-1232471a07-8d406869f0.zip +0 -0
  201. package/.yarn/cache/read-package-json-npm-6.0.4-bf5c705b94-ce40c46712.zip +0 -0
  202. package/.yarn/cache/readable-stream-npm-4.4.2-ac0d67d9ca-6f4063763d.zip +0 -0
  203. package/.yarn/cache/sigstore-npm-1.8.0-c7dd60d00a-9886278224.zip +0 -0
  204. package/.yarn/cache/spdx-correct-npm-3.2.0-ffae008484-e9ae98d22f.zip +0 -0
  205. package/.yarn/cache/spdx-exceptions-npm-2.3.0-2b68dad75a-cb69a26fa3.zip +0 -0
  206. package/.yarn/cache/spdx-expression-parse-npm-3.0.1-b718cbb35a-a1c6e104a2.zip +0 -0
  207. package/.yarn/cache/spdx-license-ids-npm-3.0.13-928dd45e3f-3469d85c65.zip +0 -0
  208. package/.yarn/cache/supports-color-npm-9.4.0-a415f39758-cb8ff8daea.zip +0 -0
  209. package/.yarn/cache/text-table-npm-0.2.0-d92a778b59-b6937a38c8.zip +0 -0
  210. package/.yarn/cache/tiny-relative-date-npm-1.3.0-4737b1ee94-82a1fa2f3b.zip +0 -0
  211. package/.yarn/cache/treeverse-npm-3.0.0-6c6d119afd-73168d9887.zip +0 -0
  212. package/.yarn/cache/tuf-js-npm-1.1.7-045f70823d-089fc0dabe.zip +0 -0
  213. package/.yarn/cache/validate-npm-package-license-npm-3.0.4-7af8adc7a8-35703ac889.zip +0 -0
  214. package/.yarn/cache/validate-npm-package-name-npm-5.0.0-fc061c1b84-5342a99498.zip +0 -0
  215. package/.yarn/cache/walk-up-path-npm-3.0.1-67ab100d5d-9ffca02fe3.zip +0 -0
  216. package/.yarn/cache/wcwidth-npm-1.0.1-05fa596453-814e9d1ddc.zip +0 -0
  217. package/.yarn/cache/which-npm-3.0.1-b2b0f09ace-adf720fe9d.zip +0 -0
  218. package/.yarn/cache/write-file-atomic-npm-5.0.1-52283db6ee-8dbb0e2512.zip +0 -0
  219. package/coverage/base.css +0 -223
  220. package/coverage/block-navigation.js +0 -79
  221. package/coverage/index.html +0 -123
  222. package/coverage/prettify.css +0 -1
  223. package/coverage/prettify.js +0 -2
  224. package/coverage/sort-arrow-sprite.png +0 -0
  225. package/coverage/sorter.js +0 -170
  226. package/coverage/src/api-client.js.html +0 -549
  227. package/coverage/src/content-fetch.js.html +0 -336
  228. package/coverage/src/index.html +0 -123
  229. package/coverage/src/methods/getContentItem.js.html +0 -285
  230. package/coverage/src/methods/getContentList.js.html +0 -486
  231. package/coverage/src/methods/getGallery.js.html +0 -243
  232. package/coverage/src/methods/getPage.js.html +0 -273
  233. package/coverage/src/methods/getSitemapFlat.js.html +0 -240
  234. package/coverage/src/methods/getSitemapNested.js.html +0 -231
  235. package/coverage/src/methods/getSyncContent.js.html +0 -258
  236. package/coverage/src/methods/getSyncPages.js.html +0 -258
  237. package/coverage/src/methods/getUrlRedirections.js.html +0 -339
  238. package/coverage/src/methods/index.html +0 -201
  239. package/coverage/src/methods/syncContentItems.js.html +0 -186
  240. package/coverage/src/methods/syncPageItems.js.html +0 -186
  241. package/coverage/src/types/FilterLogicOperator.js.html +0 -129
  242. package/coverage/src/types/FilterOperator.js.html +0 -156
  243. package/coverage/src/types/SortDirection.js.html +0 -129
  244. package/coverage/src/types/index.html +0 -123
  245. package/coverage/src/utils.js.html +0 -330
  246. package/dist/agility-content-fetch.browser.js +0 -420
  247. package/dist/agility-content-fetch.node.js +0 -10978
  248. package/dist/api-client.js +0 -316
  249. package/dist/index.js +0 -7
  250. package/dist/methods/getContentItem.js +0 -49
  251. package/dist/methods/getContentList.js +0 -94
  252. package/dist/methods/getGallery.js +0 -39
  253. package/dist/methods/getPage.js +0 -47
  254. package/dist/methods/getSitemapFlat.js +0 -26
  255. package/dist/methods/getSitemapNested.js +0 -23
  256. package/dist/methods/getSyncContent.js +0 -26
  257. package/dist/methods/getSyncPages.js +0 -26
  258. package/dist/methods/getUrlRedirections.js +0 -50
  259. package/dist/types/Client.js +0 -2
  260. package/dist/types/Config.js +0 -2
  261. package/dist/types/ContentItem.js +0 -2
  262. package/dist/types/ContentList.js +0 -9
  263. package/dist/types/ContentZone.js +0 -2
  264. package/dist/types/EnvConfig.js +0 -2
  265. package/dist/types/Filter.js +0 -10
  266. package/dist/types/FilterLogicOperator.js +0 -13
  267. package/dist/types/FilterOperator.js +0 -30
  268. package/dist/types/Gallery.js +0 -12
  269. package/dist/types/MediaItem.js +0 -13
  270. package/dist/types/MediaItemMetaData.js +0 -12
  271. package/dist/types/Page.js +0 -20
  272. package/dist/types/SEO.js +0 -11
  273. package/dist/types/SitemapFlat.js +0 -10
  274. package/dist/types/SitemapFlatItem.js +0 -17
  275. package/dist/types/SitemapNested.js +0 -7
  276. package/dist/types/SitemapNestedItem.js +0 -2
  277. package/dist/types/SitemapVisibility.js +0 -9
  278. package/dist/types/SortDirection.js +0 -13
  279. package/dist/types/SyncContent.js +0 -9
  280. package/dist/types/SyncPages.js +0 -9
  281. package/dist/types/SystemProperties.js +0 -11
  282. package/dist/types/UrlRedirection.js +0 -11
  283. package/dist/types/UrlRedirectionResponse.js +0 -9
  284. package/dist/types/index.js +0 -10
  285. package/dist/utils.js +0 -81
  286. package/test/apiClients.config.ts +0 -50
  287. package/test/getApi.tests.ts +0 -153
  288. package/test/getContentItem.tests.ts +0 -103
  289. package/test/getContentList.tests.ts +0 -251
  290. package/test/getGallery.tests.ts +0 -22
  291. package/test/getPage.tests.ts +0 -39
  292. package/test/getSitemapFlat.tests.ts +0 -30
  293. package/test/getSitemapNested.tests.ts +0 -30
  294. package/test/getSyncContentItems.tests.ts +0 -25
  295. package/test/getSyncPageItems.tests.ts +0 -27
  296. package/test/getUrlRedirections.tests.ts +0 -40
@@ -0,0 +1,2057 @@
1
+ (() => {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+
32
+ // node_modules/axios/lib/helpers/bind.js
33
+ var require_bind = __commonJS({
34
+ "node_modules/axios/lib/helpers/bind.js"(exports, module) {
35
+ "use strict";
36
+ module.exports = function bind(fn, thisArg) {
37
+ return function wrap() {
38
+ var args = new Array(arguments.length);
39
+ for (var i = 0; i < args.length; i++) {
40
+ args[i] = arguments[i];
41
+ }
42
+ return fn.apply(thisArg, args);
43
+ };
44
+ };
45
+ }
46
+ });
47
+
48
+ // node_modules/axios/lib/utils.js
49
+ var require_utils = __commonJS({
50
+ "node_modules/axios/lib/utils.js"(exports, module) {
51
+ "use strict";
52
+ var bind = require_bind();
53
+ var toString = Object.prototype.toString;
54
+ var kindOf = function(cache) {
55
+ return function(thing) {
56
+ var str = toString.call(thing);
57
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
58
+ };
59
+ }(/* @__PURE__ */ Object.create(null));
60
+ function kindOfTest(type) {
61
+ type = type.toLowerCase();
62
+ return function isKindOf(thing) {
63
+ return kindOf(thing) === type;
64
+ };
65
+ }
66
+ function isArray(val) {
67
+ return Array.isArray(val);
68
+ }
69
+ function isUndefined(val) {
70
+ return typeof val === "undefined";
71
+ }
72
+ function isBuffer(val) {
73
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
74
+ }
75
+ var isArrayBuffer = kindOfTest("ArrayBuffer");
76
+ function isArrayBufferView(val) {
77
+ var result;
78
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
79
+ result = ArrayBuffer.isView(val);
80
+ } else {
81
+ result = val && val.buffer && isArrayBuffer(val.buffer);
82
+ }
83
+ return result;
84
+ }
85
+ function isString(val) {
86
+ return typeof val === "string";
87
+ }
88
+ function isNumber(val) {
89
+ return typeof val === "number";
90
+ }
91
+ function isObject(val) {
92
+ return val !== null && typeof val === "object";
93
+ }
94
+ function isPlainObject(val) {
95
+ if (kindOf(val) !== "object") {
96
+ return false;
97
+ }
98
+ var prototype = Object.getPrototypeOf(val);
99
+ return prototype === null || prototype === Object.prototype;
100
+ }
101
+ var isDate = kindOfTest("Date");
102
+ var isFile = kindOfTest("File");
103
+ var isBlob = kindOfTest("Blob");
104
+ var isFileList = kindOfTest("FileList");
105
+ function isFunction(val) {
106
+ return toString.call(val) === "[object Function]";
107
+ }
108
+ function isStream(val) {
109
+ return isObject(val) && isFunction(val.pipe);
110
+ }
111
+ function isFormData(thing) {
112
+ var pattern = "[object FormData]";
113
+ return thing && (typeof FormData === "function" && thing instanceof FormData || toString.call(thing) === pattern || isFunction(thing.toString) && thing.toString() === pattern);
114
+ }
115
+ var isURLSearchParams = kindOfTest("URLSearchParams");
116
+ function trim(str) {
117
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
118
+ }
119
+ function isStandardBrowserEnv() {
120
+ if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
121
+ return false;
122
+ }
123
+ return typeof window !== "undefined" && typeof document !== "undefined";
124
+ }
125
+ function forEach(obj, fn) {
126
+ if (obj === null || typeof obj === "undefined") {
127
+ return;
128
+ }
129
+ if (typeof obj !== "object") {
130
+ obj = [obj];
131
+ }
132
+ if (isArray(obj)) {
133
+ for (var i = 0, l = obj.length; i < l; i++) {
134
+ fn.call(null, obj[i], i, obj);
135
+ }
136
+ } else {
137
+ for (var key in obj) {
138
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
139
+ fn.call(null, obj[key], key, obj);
140
+ }
141
+ }
142
+ }
143
+ }
144
+ function merge() {
145
+ var result = {};
146
+ function assignValue(val, key) {
147
+ if (isPlainObject(result[key]) && isPlainObject(val)) {
148
+ result[key] = merge(result[key], val);
149
+ } else if (isPlainObject(val)) {
150
+ result[key] = merge({}, val);
151
+ } else if (isArray(val)) {
152
+ result[key] = val.slice();
153
+ } else {
154
+ result[key] = val;
155
+ }
156
+ }
157
+ for (var i = 0, l = arguments.length; i < l; i++) {
158
+ forEach(arguments[i], assignValue);
159
+ }
160
+ return result;
161
+ }
162
+ function extend(a, b, thisArg) {
163
+ forEach(b, function assignValue(val, key) {
164
+ if (thisArg && typeof val === "function") {
165
+ a[key] = bind(val, thisArg);
166
+ } else {
167
+ a[key] = val;
168
+ }
169
+ });
170
+ return a;
171
+ }
172
+ function stripBOM(content) {
173
+ if (content.charCodeAt(0) === 65279) {
174
+ content = content.slice(1);
175
+ }
176
+ return content;
177
+ }
178
+ function inherits(constructor, superConstructor, props, descriptors) {
179
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
180
+ constructor.prototype.constructor = constructor;
181
+ props && Object.assign(constructor.prototype, props);
182
+ }
183
+ function toFlatObject(sourceObj, destObj, filter) {
184
+ var props;
185
+ var i;
186
+ var prop;
187
+ var merged = {};
188
+ destObj = destObj || {};
189
+ do {
190
+ props = Object.getOwnPropertyNames(sourceObj);
191
+ i = props.length;
192
+ while (i-- > 0) {
193
+ prop = props[i];
194
+ if (!merged[prop]) {
195
+ destObj[prop] = sourceObj[prop];
196
+ merged[prop] = true;
197
+ }
198
+ }
199
+ sourceObj = Object.getPrototypeOf(sourceObj);
200
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
201
+ return destObj;
202
+ }
203
+ function endsWith(str, searchString, position) {
204
+ str = String(str);
205
+ if (position === void 0 || position > str.length) {
206
+ position = str.length;
207
+ }
208
+ position -= searchString.length;
209
+ var lastIndex = str.indexOf(searchString, position);
210
+ return lastIndex !== -1 && lastIndex === position;
211
+ }
212
+ function toArray(thing) {
213
+ if (!thing)
214
+ return null;
215
+ var i = thing.length;
216
+ if (isUndefined(i))
217
+ return null;
218
+ var arr = new Array(i);
219
+ while (i-- > 0) {
220
+ arr[i] = thing[i];
221
+ }
222
+ return arr;
223
+ }
224
+ var isTypedArray = function(TypedArray) {
225
+ return function(thing) {
226
+ return TypedArray && thing instanceof TypedArray;
227
+ };
228
+ }(typeof Uint8Array !== "undefined" && Object.getPrototypeOf(Uint8Array));
229
+ module.exports = {
230
+ isArray,
231
+ isArrayBuffer,
232
+ isBuffer,
233
+ isFormData,
234
+ isArrayBufferView,
235
+ isString,
236
+ isNumber,
237
+ isObject,
238
+ isPlainObject,
239
+ isUndefined,
240
+ isDate,
241
+ isFile,
242
+ isBlob,
243
+ isFunction,
244
+ isStream,
245
+ isURLSearchParams,
246
+ isStandardBrowserEnv,
247
+ forEach,
248
+ merge,
249
+ extend,
250
+ trim,
251
+ stripBOM,
252
+ inherits,
253
+ toFlatObject,
254
+ kindOf,
255
+ kindOfTest,
256
+ endsWith,
257
+ toArray,
258
+ isTypedArray,
259
+ isFileList
260
+ };
261
+ }
262
+ });
263
+
264
+ // node_modules/axios/lib/helpers/buildURL.js
265
+ var require_buildURL = __commonJS({
266
+ "node_modules/axios/lib/helpers/buildURL.js"(exports, module) {
267
+ "use strict";
268
+ var utils = require_utils();
269
+ function encode(val) {
270
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
271
+ }
272
+ module.exports = function buildURL(url, params, paramsSerializer) {
273
+ if (!params) {
274
+ return url;
275
+ }
276
+ var serializedParams;
277
+ if (paramsSerializer) {
278
+ serializedParams = paramsSerializer(params);
279
+ } else if (utils.isURLSearchParams(params)) {
280
+ serializedParams = params.toString();
281
+ } else {
282
+ var parts = [];
283
+ utils.forEach(params, function serialize(val, key) {
284
+ if (val === null || typeof val === "undefined") {
285
+ return;
286
+ }
287
+ if (utils.isArray(val)) {
288
+ key = key + "[]";
289
+ } else {
290
+ val = [val];
291
+ }
292
+ utils.forEach(val, function parseValue(v) {
293
+ if (utils.isDate(v)) {
294
+ v = v.toISOString();
295
+ } else if (utils.isObject(v)) {
296
+ v = JSON.stringify(v);
297
+ }
298
+ parts.push(encode(key) + "=" + encode(v));
299
+ });
300
+ });
301
+ serializedParams = parts.join("&");
302
+ }
303
+ if (serializedParams) {
304
+ var hashmarkIndex = url.indexOf("#");
305
+ if (hashmarkIndex !== -1) {
306
+ url = url.slice(0, hashmarkIndex);
307
+ }
308
+ url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
309
+ }
310
+ return url;
311
+ };
312
+ }
313
+ });
314
+
315
+ // node_modules/axios/lib/core/InterceptorManager.js
316
+ var require_InterceptorManager = __commonJS({
317
+ "node_modules/axios/lib/core/InterceptorManager.js"(exports, module) {
318
+ "use strict";
319
+ var utils = require_utils();
320
+ function InterceptorManager() {
321
+ this.handlers = [];
322
+ }
323
+ InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
324
+ this.handlers.push({
325
+ fulfilled,
326
+ rejected,
327
+ synchronous: options ? options.synchronous : false,
328
+ runWhen: options ? options.runWhen : null
329
+ });
330
+ return this.handlers.length - 1;
331
+ };
332
+ InterceptorManager.prototype.eject = function eject(id) {
333
+ if (this.handlers[id]) {
334
+ this.handlers[id] = null;
335
+ }
336
+ };
337
+ InterceptorManager.prototype.forEach = function forEach(fn) {
338
+ utils.forEach(this.handlers, function forEachHandler(h) {
339
+ if (h !== null) {
340
+ fn(h);
341
+ }
342
+ });
343
+ };
344
+ module.exports = InterceptorManager;
345
+ }
346
+ });
347
+
348
+ // node_modules/axios/lib/helpers/normalizeHeaderName.js
349
+ var require_normalizeHeaderName = __commonJS({
350
+ "node_modules/axios/lib/helpers/normalizeHeaderName.js"(exports, module) {
351
+ "use strict";
352
+ var utils = require_utils();
353
+ module.exports = function normalizeHeaderName(headers, normalizedName) {
354
+ utils.forEach(headers, function processHeader(value, name) {
355
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
356
+ headers[normalizedName] = value;
357
+ delete headers[name];
358
+ }
359
+ });
360
+ };
361
+ }
362
+ });
363
+
364
+ // node_modules/axios/lib/core/AxiosError.js
365
+ var require_AxiosError = __commonJS({
366
+ "node_modules/axios/lib/core/AxiosError.js"(exports, module) {
367
+ "use strict";
368
+ var utils = require_utils();
369
+ function AxiosError(message, code, config, request, response) {
370
+ Error.call(this);
371
+ this.message = message;
372
+ this.name = "AxiosError";
373
+ code && (this.code = code);
374
+ config && (this.config = config);
375
+ request && (this.request = request);
376
+ response && (this.response = response);
377
+ }
378
+ utils.inherits(AxiosError, Error, {
379
+ toJSON: function toJSON() {
380
+ return {
381
+ // Standard
382
+ message: this.message,
383
+ name: this.name,
384
+ // Microsoft
385
+ description: this.description,
386
+ number: this.number,
387
+ // Mozilla
388
+ fileName: this.fileName,
389
+ lineNumber: this.lineNumber,
390
+ columnNumber: this.columnNumber,
391
+ stack: this.stack,
392
+ // Axios
393
+ config: this.config,
394
+ code: this.code,
395
+ status: this.response && this.response.status ? this.response.status : null
396
+ };
397
+ }
398
+ });
399
+ var prototype = AxiosError.prototype;
400
+ var descriptors = {};
401
+ [
402
+ "ERR_BAD_OPTION_VALUE",
403
+ "ERR_BAD_OPTION",
404
+ "ECONNABORTED",
405
+ "ETIMEDOUT",
406
+ "ERR_NETWORK",
407
+ "ERR_FR_TOO_MANY_REDIRECTS",
408
+ "ERR_DEPRECATED",
409
+ "ERR_BAD_RESPONSE",
410
+ "ERR_BAD_REQUEST",
411
+ "ERR_CANCELED"
412
+ // eslint-disable-next-line func-names
413
+ ].forEach(function(code) {
414
+ descriptors[code] = { value: code };
415
+ });
416
+ Object.defineProperties(AxiosError, descriptors);
417
+ Object.defineProperty(prototype, "isAxiosError", { value: true });
418
+ AxiosError.from = function(error, code, config, request, response, customProps) {
419
+ var axiosError = Object.create(prototype);
420
+ utils.toFlatObject(error, axiosError, function filter(obj) {
421
+ return obj !== Error.prototype;
422
+ });
423
+ AxiosError.call(axiosError, error.message, code, config, request, response);
424
+ axiosError.name = error.name;
425
+ customProps && Object.assign(axiosError, customProps);
426
+ return axiosError;
427
+ };
428
+ module.exports = AxiosError;
429
+ }
430
+ });
431
+
432
+ // node_modules/axios/lib/defaults/transitional.js
433
+ var require_transitional = __commonJS({
434
+ "node_modules/axios/lib/defaults/transitional.js"(exports, module) {
435
+ "use strict";
436
+ module.exports = {
437
+ silentJSONParsing: true,
438
+ forcedJSONParsing: true,
439
+ clarifyTimeoutError: false
440
+ };
441
+ }
442
+ });
443
+
444
+ // node_modules/axios/lib/helpers/toFormData.js
445
+ var require_toFormData = __commonJS({
446
+ "node_modules/axios/lib/helpers/toFormData.js"(exports, module) {
447
+ "use strict";
448
+ var utils = require_utils();
449
+ function toFormData(obj, formData) {
450
+ formData = formData || new FormData();
451
+ var stack = [];
452
+ function convertValue(value) {
453
+ if (value === null)
454
+ return "";
455
+ if (utils.isDate(value)) {
456
+ return value.toISOString();
457
+ }
458
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
459
+ return typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
460
+ }
461
+ return value;
462
+ }
463
+ function build(data, parentKey) {
464
+ if (utils.isPlainObject(data) || utils.isArray(data)) {
465
+ if (stack.indexOf(data) !== -1) {
466
+ throw Error("Circular reference detected in " + parentKey);
467
+ }
468
+ stack.push(data);
469
+ utils.forEach(data, function each(value, key) {
470
+ if (utils.isUndefined(value))
471
+ return;
472
+ var fullKey = parentKey ? parentKey + "." + key : key;
473
+ var arr;
474
+ if (value && !parentKey && typeof value === "object") {
475
+ if (utils.endsWith(key, "{}")) {
476
+ value = JSON.stringify(value);
477
+ } else if (utils.endsWith(key, "[]") && (arr = utils.toArray(value))) {
478
+ arr.forEach(function(el) {
479
+ !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
480
+ });
481
+ return;
482
+ }
483
+ }
484
+ build(value, fullKey);
485
+ });
486
+ stack.pop();
487
+ } else {
488
+ formData.append(parentKey, convertValue(data));
489
+ }
490
+ }
491
+ build(obj);
492
+ return formData;
493
+ }
494
+ module.exports = toFormData;
495
+ }
496
+ });
497
+
498
+ // node_modules/axios/lib/core/settle.js
499
+ var require_settle = __commonJS({
500
+ "node_modules/axios/lib/core/settle.js"(exports, module) {
501
+ "use strict";
502
+ var AxiosError = require_AxiosError();
503
+ module.exports = function settle(resolve, reject, response) {
504
+ var validateStatus = response.config.validateStatus;
505
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
506
+ resolve(response);
507
+ } else {
508
+ reject(new AxiosError(
509
+ "Request failed with status code " + response.status,
510
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
511
+ response.config,
512
+ response.request,
513
+ response
514
+ ));
515
+ }
516
+ };
517
+ }
518
+ });
519
+
520
+ // node_modules/axios/lib/helpers/cookies.js
521
+ var require_cookies = __commonJS({
522
+ "node_modules/axios/lib/helpers/cookies.js"(exports, module) {
523
+ "use strict";
524
+ var utils = require_utils();
525
+ module.exports = utils.isStandardBrowserEnv() ? (
526
+ // Standard browser envs support document.cookie
527
+ function standardBrowserEnv() {
528
+ return {
529
+ write: function write(name, value, expires, path, domain, secure) {
530
+ var cookie = [];
531
+ cookie.push(name + "=" + encodeURIComponent(value));
532
+ if (utils.isNumber(expires)) {
533
+ cookie.push("expires=" + new Date(expires).toGMTString());
534
+ }
535
+ if (utils.isString(path)) {
536
+ cookie.push("path=" + path);
537
+ }
538
+ if (utils.isString(domain)) {
539
+ cookie.push("domain=" + domain);
540
+ }
541
+ if (secure === true) {
542
+ cookie.push("secure");
543
+ }
544
+ document.cookie = cookie.join("; ");
545
+ },
546
+ read: function read(name) {
547
+ var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
548
+ return match ? decodeURIComponent(match[3]) : null;
549
+ },
550
+ remove: function remove(name) {
551
+ this.write(name, "", Date.now() - 864e5);
552
+ }
553
+ };
554
+ }()
555
+ ) : (
556
+ // Non standard browser env (web workers, react-native) lack needed support.
557
+ function nonStandardBrowserEnv() {
558
+ return {
559
+ write: function write() {
560
+ },
561
+ read: function read() {
562
+ return null;
563
+ },
564
+ remove: function remove() {
565
+ }
566
+ };
567
+ }()
568
+ );
569
+ }
570
+ });
571
+
572
+ // node_modules/axios/lib/helpers/isAbsoluteURL.js
573
+ var require_isAbsoluteURL = __commonJS({
574
+ "node_modules/axios/lib/helpers/isAbsoluteURL.js"(exports, module) {
575
+ "use strict";
576
+ module.exports = function isAbsoluteURL(url) {
577
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
578
+ };
579
+ }
580
+ });
581
+
582
+ // node_modules/axios/lib/helpers/combineURLs.js
583
+ var require_combineURLs = __commonJS({
584
+ "node_modules/axios/lib/helpers/combineURLs.js"(exports, module) {
585
+ "use strict";
586
+ module.exports = function combineURLs(baseURL, relativeURL) {
587
+ return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
588
+ };
589
+ }
590
+ });
591
+
592
+ // node_modules/axios/lib/core/buildFullPath.js
593
+ var require_buildFullPath = __commonJS({
594
+ "node_modules/axios/lib/core/buildFullPath.js"(exports, module) {
595
+ "use strict";
596
+ var isAbsoluteURL = require_isAbsoluteURL();
597
+ var combineURLs = require_combineURLs();
598
+ module.exports = function buildFullPath(baseURL, requestedURL) {
599
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
600
+ return combineURLs(baseURL, requestedURL);
601
+ }
602
+ return requestedURL;
603
+ };
604
+ }
605
+ });
606
+
607
+ // node_modules/axios/lib/helpers/parseHeaders.js
608
+ var require_parseHeaders = __commonJS({
609
+ "node_modules/axios/lib/helpers/parseHeaders.js"(exports, module) {
610
+ "use strict";
611
+ var utils = require_utils();
612
+ var ignoreDuplicateOf = [
613
+ "age",
614
+ "authorization",
615
+ "content-length",
616
+ "content-type",
617
+ "etag",
618
+ "expires",
619
+ "from",
620
+ "host",
621
+ "if-modified-since",
622
+ "if-unmodified-since",
623
+ "last-modified",
624
+ "location",
625
+ "max-forwards",
626
+ "proxy-authorization",
627
+ "referer",
628
+ "retry-after",
629
+ "user-agent"
630
+ ];
631
+ module.exports = function parseHeaders(headers) {
632
+ var parsed = {};
633
+ var key;
634
+ var val;
635
+ var i;
636
+ if (!headers) {
637
+ return parsed;
638
+ }
639
+ utils.forEach(headers.split("\n"), function parser(line) {
640
+ i = line.indexOf(":");
641
+ key = utils.trim(line.substr(0, i)).toLowerCase();
642
+ val = utils.trim(line.substr(i + 1));
643
+ if (key) {
644
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
645
+ return;
646
+ }
647
+ if (key === "set-cookie") {
648
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
649
+ } else {
650
+ parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
651
+ }
652
+ }
653
+ });
654
+ return parsed;
655
+ };
656
+ }
657
+ });
658
+
659
+ // node_modules/axios/lib/helpers/isURLSameOrigin.js
660
+ var require_isURLSameOrigin = __commonJS({
661
+ "node_modules/axios/lib/helpers/isURLSameOrigin.js"(exports, module) {
662
+ "use strict";
663
+ var utils = require_utils();
664
+ module.exports = utils.isStandardBrowserEnv() ? (
665
+ // Standard browser envs have full support of the APIs needed to test
666
+ // whether the request URL is of the same origin as current location.
667
+ function standardBrowserEnv() {
668
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
669
+ var urlParsingNode = document.createElement("a");
670
+ var originURL;
671
+ function resolveURL(url) {
672
+ var href = url;
673
+ if (msie) {
674
+ urlParsingNode.setAttribute("href", href);
675
+ href = urlParsingNode.href;
676
+ }
677
+ urlParsingNode.setAttribute("href", href);
678
+ return {
679
+ href: urlParsingNode.href,
680
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
681
+ host: urlParsingNode.host,
682
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
683
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
684
+ hostname: urlParsingNode.hostname,
685
+ port: urlParsingNode.port,
686
+ pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
687
+ };
688
+ }
689
+ originURL = resolveURL(window.location.href);
690
+ return function isURLSameOrigin(requestURL) {
691
+ var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
692
+ return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
693
+ };
694
+ }()
695
+ ) : (
696
+ // Non standard browser envs (web workers, react-native) lack needed support.
697
+ function nonStandardBrowserEnv() {
698
+ return function isURLSameOrigin() {
699
+ return true;
700
+ };
701
+ }()
702
+ );
703
+ }
704
+ });
705
+
706
+ // node_modules/axios/lib/cancel/CanceledError.js
707
+ var require_CanceledError = __commonJS({
708
+ "node_modules/axios/lib/cancel/CanceledError.js"(exports, module) {
709
+ "use strict";
710
+ var AxiosError = require_AxiosError();
711
+ var utils = require_utils();
712
+ function CanceledError(message) {
713
+ AxiosError.call(this, message == null ? "canceled" : message, AxiosError.ERR_CANCELED);
714
+ this.name = "CanceledError";
715
+ }
716
+ utils.inherits(CanceledError, AxiosError, {
717
+ __CANCEL__: true
718
+ });
719
+ module.exports = CanceledError;
720
+ }
721
+ });
722
+
723
+ // node_modules/axios/lib/helpers/parseProtocol.js
724
+ var require_parseProtocol = __commonJS({
725
+ "node_modules/axios/lib/helpers/parseProtocol.js"(exports, module) {
726
+ "use strict";
727
+ module.exports = function parseProtocol(url) {
728
+ var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
729
+ return match && match[1] || "";
730
+ };
731
+ }
732
+ });
733
+
734
+ // node_modules/axios/lib/adapters/xhr.js
735
+ var require_xhr = __commonJS({
736
+ "node_modules/axios/lib/adapters/xhr.js"(exports, module) {
737
+ "use strict";
738
+ var utils = require_utils();
739
+ var settle = require_settle();
740
+ var cookies = require_cookies();
741
+ var buildURL = require_buildURL();
742
+ var buildFullPath = require_buildFullPath();
743
+ var parseHeaders = require_parseHeaders();
744
+ var isURLSameOrigin = require_isURLSameOrigin();
745
+ var transitionalDefaults = require_transitional();
746
+ var AxiosError = require_AxiosError();
747
+ var CanceledError = require_CanceledError();
748
+ var parseProtocol = require_parseProtocol();
749
+ module.exports = function xhrAdapter(config) {
750
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
751
+ var requestData = config.data;
752
+ var requestHeaders = config.headers;
753
+ var responseType = config.responseType;
754
+ var onCanceled;
755
+ function done() {
756
+ if (config.cancelToken) {
757
+ config.cancelToken.unsubscribe(onCanceled);
758
+ }
759
+ if (config.signal) {
760
+ config.signal.removeEventListener("abort", onCanceled);
761
+ }
762
+ }
763
+ if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
764
+ delete requestHeaders["Content-Type"];
765
+ }
766
+ var request = new XMLHttpRequest();
767
+ if (config.auth) {
768
+ var username = config.auth.username || "";
769
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
770
+ requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
771
+ }
772
+ var fullPath = buildFullPath(config.baseURL, config.url);
773
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
774
+ request.timeout = config.timeout;
775
+ function onloadend() {
776
+ if (!request) {
777
+ return;
778
+ }
779
+ var responseHeaders = "getAllResponseHeaders" in request ? parseHeaders(request.getAllResponseHeaders()) : null;
780
+ var responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
781
+ var response = {
782
+ data: responseData,
783
+ status: request.status,
784
+ statusText: request.statusText,
785
+ headers: responseHeaders,
786
+ config,
787
+ request
788
+ };
789
+ settle(function _resolve(value) {
790
+ resolve(value);
791
+ done();
792
+ }, function _reject(err) {
793
+ reject(err);
794
+ done();
795
+ }, response);
796
+ request = null;
797
+ }
798
+ if ("onloadend" in request) {
799
+ request.onloadend = onloadend;
800
+ } else {
801
+ request.onreadystatechange = function handleLoad() {
802
+ if (!request || request.readyState !== 4) {
803
+ return;
804
+ }
805
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
806
+ return;
807
+ }
808
+ setTimeout(onloadend);
809
+ };
810
+ }
811
+ request.onabort = function handleAbort() {
812
+ if (!request) {
813
+ return;
814
+ }
815
+ reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request));
816
+ request = null;
817
+ };
818
+ request.onerror = function handleError() {
819
+ reject(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, request));
820
+ request = null;
821
+ };
822
+ request.ontimeout = function handleTimeout() {
823
+ var timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
824
+ var transitional = config.transitional || transitionalDefaults;
825
+ if (config.timeoutErrorMessage) {
826
+ timeoutErrorMessage = config.timeoutErrorMessage;
827
+ }
828
+ reject(new AxiosError(
829
+ timeoutErrorMessage,
830
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
831
+ config,
832
+ request
833
+ ));
834
+ request = null;
835
+ };
836
+ if (utils.isStandardBrowserEnv()) {
837
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : void 0;
838
+ if (xsrfValue) {
839
+ requestHeaders[config.xsrfHeaderName] = xsrfValue;
840
+ }
841
+ }
842
+ if ("setRequestHeader" in request) {
843
+ utils.forEach(requestHeaders, function setRequestHeader(val, key) {
844
+ if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
845
+ delete requestHeaders[key];
846
+ } else {
847
+ request.setRequestHeader(key, val);
848
+ }
849
+ });
850
+ }
851
+ if (!utils.isUndefined(config.withCredentials)) {
852
+ request.withCredentials = !!config.withCredentials;
853
+ }
854
+ if (responseType && responseType !== "json") {
855
+ request.responseType = config.responseType;
856
+ }
857
+ if (typeof config.onDownloadProgress === "function") {
858
+ request.addEventListener("progress", config.onDownloadProgress);
859
+ }
860
+ if (typeof config.onUploadProgress === "function" && request.upload) {
861
+ request.upload.addEventListener("progress", config.onUploadProgress);
862
+ }
863
+ if (config.cancelToken || config.signal) {
864
+ onCanceled = function(cancel) {
865
+ if (!request) {
866
+ return;
867
+ }
868
+ reject(!cancel || cancel && cancel.type ? new CanceledError() : cancel);
869
+ request.abort();
870
+ request = null;
871
+ };
872
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
873
+ if (config.signal) {
874
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
875
+ }
876
+ }
877
+ if (!requestData) {
878
+ requestData = null;
879
+ }
880
+ var protocol = parseProtocol(fullPath);
881
+ if (protocol && ["http", "https", "file"].indexOf(protocol) === -1) {
882
+ reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config));
883
+ return;
884
+ }
885
+ request.send(requestData);
886
+ });
887
+ };
888
+ }
889
+ });
890
+
891
+ // node_modules/axios/lib/helpers/null.js
892
+ var require_null = __commonJS({
893
+ "node_modules/axios/lib/helpers/null.js"(exports, module) {
894
+ module.exports = null;
895
+ }
896
+ });
897
+
898
+ // node_modules/axios/lib/defaults/index.js
899
+ var require_defaults = __commonJS({
900
+ "node_modules/axios/lib/defaults/index.js"(exports, module) {
901
+ "use strict";
902
+ var utils = require_utils();
903
+ var normalizeHeaderName = require_normalizeHeaderName();
904
+ var AxiosError = require_AxiosError();
905
+ var transitionalDefaults = require_transitional();
906
+ var toFormData = require_toFormData();
907
+ var DEFAULT_CONTENT_TYPE = {
908
+ "Content-Type": "application/x-www-form-urlencoded"
909
+ };
910
+ function setContentTypeIfUnset(headers, value) {
911
+ if (!utils.isUndefined(headers) && utils.isUndefined(headers["Content-Type"])) {
912
+ headers["Content-Type"] = value;
913
+ }
914
+ }
915
+ function getDefaultAdapter() {
916
+ var adapter;
917
+ if (typeof XMLHttpRequest !== "undefined") {
918
+ adapter = require_xhr();
919
+ } else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
920
+ adapter = require_xhr();
921
+ }
922
+ return adapter;
923
+ }
924
+ function stringifySafely(rawValue, parser, encoder) {
925
+ if (utils.isString(rawValue)) {
926
+ try {
927
+ (parser || JSON.parse)(rawValue);
928
+ return utils.trim(rawValue);
929
+ } catch (e) {
930
+ if (e.name !== "SyntaxError") {
931
+ throw e;
932
+ }
933
+ }
934
+ }
935
+ return (encoder || JSON.stringify)(rawValue);
936
+ }
937
+ var defaults = {
938
+ transitional: transitionalDefaults,
939
+ adapter: getDefaultAdapter(),
940
+ transformRequest: [function transformRequest(data, headers) {
941
+ normalizeHeaderName(headers, "Accept");
942
+ normalizeHeaderName(headers, "Content-Type");
943
+ if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
944
+ return data;
945
+ }
946
+ if (utils.isArrayBufferView(data)) {
947
+ return data.buffer;
948
+ }
949
+ if (utils.isURLSearchParams(data)) {
950
+ setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
951
+ return data.toString();
952
+ }
953
+ var isObjectPayload = utils.isObject(data);
954
+ var contentType = headers && headers["Content-Type"];
955
+ var isFileList;
956
+ if ((isFileList = utils.isFileList(data)) || isObjectPayload && contentType === "multipart/form-data") {
957
+ var _FormData = this.env && this.env.FormData;
958
+ return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData());
959
+ } else if (isObjectPayload || contentType === "application/json") {
960
+ setContentTypeIfUnset(headers, "application/json");
961
+ return stringifySafely(data);
962
+ }
963
+ return data;
964
+ }],
965
+ transformResponse: [function transformResponse(data) {
966
+ var transitional = this.transitional || defaults.transitional;
967
+ var silentJSONParsing = transitional && transitional.silentJSONParsing;
968
+ var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
969
+ var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
970
+ if (strictJSONParsing || forcedJSONParsing && utils.isString(data) && data.length) {
971
+ try {
972
+ return JSON.parse(data);
973
+ } catch (e) {
974
+ if (strictJSONParsing) {
975
+ if (e.name === "SyntaxError") {
976
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
977
+ }
978
+ throw e;
979
+ }
980
+ }
981
+ }
982
+ return data;
983
+ }],
984
+ /**
985
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
986
+ * timeout is not created.
987
+ */
988
+ timeout: 0,
989
+ xsrfCookieName: "XSRF-TOKEN",
990
+ xsrfHeaderName: "X-XSRF-TOKEN",
991
+ maxContentLength: -1,
992
+ maxBodyLength: -1,
993
+ env: {
994
+ FormData: require_null()
995
+ },
996
+ validateStatus: function validateStatus(status) {
997
+ return status >= 200 && status < 300;
998
+ },
999
+ headers: {
1000
+ common: {
1001
+ "Accept": "application/json, text/plain, */*"
1002
+ }
1003
+ }
1004
+ };
1005
+ utils.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
1006
+ defaults.headers[method] = {};
1007
+ });
1008
+ utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
1009
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
1010
+ });
1011
+ module.exports = defaults;
1012
+ }
1013
+ });
1014
+
1015
+ // node_modules/axios/lib/core/transformData.js
1016
+ var require_transformData = __commonJS({
1017
+ "node_modules/axios/lib/core/transformData.js"(exports, module) {
1018
+ "use strict";
1019
+ var utils = require_utils();
1020
+ var defaults = require_defaults();
1021
+ module.exports = function transformData(data, headers, fns) {
1022
+ var context = this || defaults;
1023
+ utils.forEach(fns, function transform(fn) {
1024
+ data = fn.call(context, data, headers);
1025
+ });
1026
+ return data;
1027
+ };
1028
+ }
1029
+ });
1030
+
1031
+ // node_modules/axios/lib/cancel/isCancel.js
1032
+ var require_isCancel = __commonJS({
1033
+ "node_modules/axios/lib/cancel/isCancel.js"(exports, module) {
1034
+ "use strict";
1035
+ module.exports = function isCancel(value) {
1036
+ return !!(value && value.__CANCEL__);
1037
+ };
1038
+ }
1039
+ });
1040
+
1041
+ // node_modules/axios/lib/core/dispatchRequest.js
1042
+ var require_dispatchRequest = __commonJS({
1043
+ "node_modules/axios/lib/core/dispatchRequest.js"(exports, module) {
1044
+ "use strict";
1045
+ var utils = require_utils();
1046
+ var transformData = require_transformData();
1047
+ var isCancel = require_isCancel();
1048
+ var defaults = require_defaults();
1049
+ var CanceledError = require_CanceledError();
1050
+ function throwIfCancellationRequested(config) {
1051
+ if (config.cancelToken) {
1052
+ config.cancelToken.throwIfRequested();
1053
+ }
1054
+ if (config.signal && config.signal.aborted) {
1055
+ throw new CanceledError();
1056
+ }
1057
+ }
1058
+ module.exports = function dispatchRequest(config) {
1059
+ throwIfCancellationRequested(config);
1060
+ config.headers = config.headers || {};
1061
+ config.data = transformData.call(
1062
+ config,
1063
+ config.data,
1064
+ config.headers,
1065
+ config.transformRequest
1066
+ );
1067
+ config.headers = utils.merge(
1068
+ config.headers.common || {},
1069
+ config.headers[config.method] || {},
1070
+ config.headers
1071
+ );
1072
+ utils.forEach(
1073
+ ["delete", "get", "head", "post", "put", "patch", "common"],
1074
+ function cleanHeaderConfig(method) {
1075
+ delete config.headers[method];
1076
+ }
1077
+ );
1078
+ var adapter = config.adapter || defaults.adapter;
1079
+ return adapter(config).then(function onAdapterResolution(response) {
1080
+ throwIfCancellationRequested(config);
1081
+ response.data = transformData.call(
1082
+ config,
1083
+ response.data,
1084
+ response.headers,
1085
+ config.transformResponse
1086
+ );
1087
+ return response;
1088
+ }, function onAdapterRejection(reason) {
1089
+ if (!isCancel(reason)) {
1090
+ throwIfCancellationRequested(config);
1091
+ if (reason && reason.response) {
1092
+ reason.response.data = transformData.call(
1093
+ config,
1094
+ reason.response.data,
1095
+ reason.response.headers,
1096
+ config.transformResponse
1097
+ );
1098
+ }
1099
+ }
1100
+ return Promise.reject(reason);
1101
+ });
1102
+ };
1103
+ }
1104
+ });
1105
+
1106
+ // node_modules/axios/lib/core/mergeConfig.js
1107
+ var require_mergeConfig = __commonJS({
1108
+ "node_modules/axios/lib/core/mergeConfig.js"(exports, module) {
1109
+ "use strict";
1110
+ var utils = require_utils();
1111
+ module.exports = function mergeConfig(config1, config2) {
1112
+ config2 = config2 || {};
1113
+ var config = {};
1114
+ function getMergedValue(target, source) {
1115
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
1116
+ return utils.merge(target, source);
1117
+ } else if (utils.isPlainObject(source)) {
1118
+ return utils.merge({}, source);
1119
+ } else if (utils.isArray(source)) {
1120
+ return source.slice();
1121
+ }
1122
+ return source;
1123
+ }
1124
+ function mergeDeepProperties(prop) {
1125
+ if (!utils.isUndefined(config2[prop])) {
1126
+ return getMergedValue(config1[prop], config2[prop]);
1127
+ } else if (!utils.isUndefined(config1[prop])) {
1128
+ return getMergedValue(void 0, config1[prop]);
1129
+ }
1130
+ }
1131
+ function valueFromConfig2(prop) {
1132
+ if (!utils.isUndefined(config2[prop])) {
1133
+ return getMergedValue(void 0, config2[prop]);
1134
+ }
1135
+ }
1136
+ function defaultToConfig2(prop) {
1137
+ if (!utils.isUndefined(config2[prop])) {
1138
+ return getMergedValue(void 0, config2[prop]);
1139
+ } else if (!utils.isUndefined(config1[prop])) {
1140
+ return getMergedValue(void 0, config1[prop]);
1141
+ }
1142
+ }
1143
+ function mergeDirectKeys(prop) {
1144
+ if (prop in config2) {
1145
+ return getMergedValue(config1[prop], config2[prop]);
1146
+ } else if (prop in config1) {
1147
+ return getMergedValue(void 0, config1[prop]);
1148
+ }
1149
+ }
1150
+ var mergeMap = {
1151
+ "url": valueFromConfig2,
1152
+ "method": valueFromConfig2,
1153
+ "data": valueFromConfig2,
1154
+ "baseURL": defaultToConfig2,
1155
+ "transformRequest": defaultToConfig2,
1156
+ "transformResponse": defaultToConfig2,
1157
+ "paramsSerializer": defaultToConfig2,
1158
+ "timeout": defaultToConfig2,
1159
+ "timeoutMessage": defaultToConfig2,
1160
+ "withCredentials": defaultToConfig2,
1161
+ "adapter": defaultToConfig2,
1162
+ "responseType": defaultToConfig2,
1163
+ "xsrfCookieName": defaultToConfig2,
1164
+ "xsrfHeaderName": defaultToConfig2,
1165
+ "onUploadProgress": defaultToConfig2,
1166
+ "onDownloadProgress": defaultToConfig2,
1167
+ "decompress": defaultToConfig2,
1168
+ "maxContentLength": defaultToConfig2,
1169
+ "maxBodyLength": defaultToConfig2,
1170
+ "beforeRedirect": defaultToConfig2,
1171
+ "transport": defaultToConfig2,
1172
+ "httpAgent": defaultToConfig2,
1173
+ "httpsAgent": defaultToConfig2,
1174
+ "cancelToken": defaultToConfig2,
1175
+ "socketPath": defaultToConfig2,
1176
+ "responseEncoding": defaultToConfig2,
1177
+ "validateStatus": mergeDirectKeys
1178
+ };
1179
+ utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
1180
+ var merge = mergeMap[prop] || mergeDeepProperties;
1181
+ var configValue = merge(prop);
1182
+ utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
1183
+ });
1184
+ return config;
1185
+ };
1186
+ }
1187
+ });
1188
+
1189
+ // node_modules/axios/lib/env/data.js
1190
+ var require_data = __commonJS({
1191
+ "node_modules/axios/lib/env/data.js"(exports, module) {
1192
+ module.exports = {
1193
+ "version": "0.27.2"
1194
+ };
1195
+ }
1196
+ });
1197
+
1198
+ // node_modules/axios/lib/helpers/validator.js
1199
+ var require_validator = __commonJS({
1200
+ "node_modules/axios/lib/helpers/validator.js"(exports, module) {
1201
+ "use strict";
1202
+ var VERSION = require_data().version;
1203
+ var AxiosError = require_AxiosError();
1204
+ var validators = {};
1205
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
1206
+ validators[type] = function validator(thing) {
1207
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
1208
+ };
1209
+ });
1210
+ var deprecatedWarnings = {};
1211
+ validators.transitional = function transitional(validator, version, message) {
1212
+ function formatMessage(opt, desc) {
1213
+ return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
1214
+ }
1215
+ return function(value, opt, opts) {
1216
+ if (validator === false) {
1217
+ throw new AxiosError(
1218
+ formatMessage(opt, " has been removed" + (version ? " in " + version : "")),
1219
+ AxiosError.ERR_DEPRECATED
1220
+ );
1221
+ }
1222
+ if (version && !deprecatedWarnings[opt]) {
1223
+ deprecatedWarnings[opt] = true;
1224
+ console.warn(
1225
+ formatMessage(
1226
+ opt,
1227
+ " has been deprecated since v" + version + " and will be removed in the near future"
1228
+ )
1229
+ );
1230
+ }
1231
+ return validator ? validator(value, opt, opts) : true;
1232
+ };
1233
+ };
1234
+ function assertOptions(options, schema, allowUnknown) {
1235
+ if (typeof options !== "object") {
1236
+ throw new AxiosError("options must be an object", AxiosError.ERR_BAD_OPTION_VALUE);
1237
+ }
1238
+ var keys = Object.keys(options);
1239
+ var i = keys.length;
1240
+ while (i-- > 0) {
1241
+ var opt = keys[i];
1242
+ var validator = schema[opt];
1243
+ if (validator) {
1244
+ var value = options[opt];
1245
+ var result = value === void 0 || validator(value, opt, options);
1246
+ if (result !== true) {
1247
+ throw new AxiosError("option " + opt + " must be " + result, AxiosError.ERR_BAD_OPTION_VALUE);
1248
+ }
1249
+ continue;
1250
+ }
1251
+ if (allowUnknown !== true) {
1252
+ throw new AxiosError("Unknown option " + opt, AxiosError.ERR_BAD_OPTION);
1253
+ }
1254
+ }
1255
+ }
1256
+ module.exports = {
1257
+ assertOptions,
1258
+ validators
1259
+ };
1260
+ }
1261
+ });
1262
+
1263
+ // node_modules/axios/lib/core/Axios.js
1264
+ var require_Axios = __commonJS({
1265
+ "node_modules/axios/lib/core/Axios.js"(exports, module) {
1266
+ "use strict";
1267
+ var utils = require_utils();
1268
+ var buildURL = require_buildURL();
1269
+ var InterceptorManager = require_InterceptorManager();
1270
+ var dispatchRequest = require_dispatchRequest();
1271
+ var mergeConfig = require_mergeConfig();
1272
+ var buildFullPath = require_buildFullPath();
1273
+ var validator = require_validator();
1274
+ var validators = validator.validators;
1275
+ function Axios(instanceConfig) {
1276
+ this.defaults = instanceConfig;
1277
+ this.interceptors = {
1278
+ request: new InterceptorManager(),
1279
+ response: new InterceptorManager()
1280
+ };
1281
+ }
1282
+ Axios.prototype.request = function request(configOrUrl, config) {
1283
+ if (typeof configOrUrl === "string") {
1284
+ config = config || {};
1285
+ config.url = configOrUrl;
1286
+ } else {
1287
+ config = configOrUrl || {};
1288
+ }
1289
+ config = mergeConfig(this.defaults, config);
1290
+ if (config.method) {
1291
+ config.method = config.method.toLowerCase();
1292
+ } else if (this.defaults.method) {
1293
+ config.method = this.defaults.method.toLowerCase();
1294
+ } else {
1295
+ config.method = "get";
1296
+ }
1297
+ var transitional = config.transitional;
1298
+ if (transitional !== void 0) {
1299
+ validator.assertOptions(transitional, {
1300
+ silentJSONParsing: validators.transitional(validators.boolean),
1301
+ forcedJSONParsing: validators.transitional(validators.boolean),
1302
+ clarifyTimeoutError: validators.transitional(validators.boolean)
1303
+ }, false);
1304
+ }
1305
+ var requestInterceptorChain = [];
1306
+ var synchronousRequestInterceptors = true;
1307
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
1308
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
1309
+ return;
1310
+ }
1311
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
1312
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
1313
+ });
1314
+ var responseInterceptorChain = [];
1315
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
1316
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
1317
+ });
1318
+ var promise;
1319
+ if (!synchronousRequestInterceptors) {
1320
+ var chain = [dispatchRequest, void 0];
1321
+ Array.prototype.unshift.apply(chain, requestInterceptorChain);
1322
+ chain = chain.concat(responseInterceptorChain);
1323
+ promise = Promise.resolve(config);
1324
+ while (chain.length) {
1325
+ promise = promise.then(chain.shift(), chain.shift());
1326
+ }
1327
+ return promise;
1328
+ }
1329
+ var newConfig = config;
1330
+ while (requestInterceptorChain.length) {
1331
+ var onFulfilled = requestInterceptorChain.shift();
1332
+ var onRejected = requestInterceptorChain.shift();
1333
+ try {
1334
+ newConfig = onFulfilled(newConfig);
1335
+ } catch (error) {
1336
+ onRejected(error);
1337
+ break;
1338
+ }
1339
+ }
1340
+ try {
1341
+ promise = dispatchRequest(newConfig);
1342
+ } catch (error) {
1343
+ return Promise.reject(error);
1344
+ }
1345
+ while (responseInterceptorChain.length) {
1346
+ promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
1347
+ }
1348
+ return promise;
1349
+ };
1350
+ Axios.prototype.getUri = function getUri(config) {
1351
+ config = mergeConfig(this.defaults, config);
1352
+ var fullPath = buildFullPath(config.baseURL, config.url);
1353
+ return buildURL(fullPath, config.params, config.paramsSerializer);
1354
+ };
1355
+ utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
1356
+ Axios.prototype[method] = function(url, config) {
1357
+ return this.request(mergeConfig(config || {}, {
1358
+ method,
1359
+ url,
1360
+ data: (config || {}).data
1361
+ }));
1362
+ };
1363
+ });
1364
+ utils.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
1365
+ function generateHTTPMethod(isForm) {
1366
+ return function httpMethod(url, data, config) {
1367
+ return this.request(mergeConfig(config || {}, {
1368
+ method,
1369
+ headers: isForm ? {
1370
+ "Content-Type": "multipart/form-data"
1371
+ } : {},
1372
+ url,
1373
+ data
1374
+ }));
1375
+ };
1376
+ }
1377
+ Axios.prototype[method] = generateHTTPMethod();
1378
+ Axios.prototype[method + "Form"] = generateHTTPMethod(true);
1379
+ });
1380
+ module.exports = Axios;
1381
+ }
1382
+ });
1383
+
1384
+ // node_modules/axios/lib/cancel/CancelToken.js
1385
+ var require_CancelToken = __commonJS({
1386
+ "node_modules/axios/lib/cancel/CancelToken.js"(exports, module) {
1387
+ "use strict";
1388
+ var CanceledError = require_CanceledError();
1389
+ function CancelToken(executor) {
1390
+ if (typeof executor !== "function") {
1391
+ throw new TypeError("executor must be a function.");
1392
+ }
1393
+ var resolvePromise;
1394
+ this.promise = new Promise(function promiseExecutor(resolve) {
1395
+ resolvePromise = resolve;
1396
+ });
1397
+ var token = this;
1398
+ this.promise.then(function(cancel) {
1399
+ if (!token._listeners)
1400
+ return;
1401
+ var i;
1402
+ var l = token._listeners.length;
1403
+ for (i = 0; i < l; i++) {
1404
+ token._listeners[i](cancel);
1405
+ }
1406
+ token._listeners = null;
1407
+ });
1408
+ this.promise.then = function(onfulfilled) {
1409
+ var _resolve;
1410
+ var promise = new Promise(function(resolve) {
1411
+ token.subscribe(resolve);
1412
+ _resolve = resolve;
1413
+ }).then(onfulfilled);
1414
+ promise.cancel = function reject() {
1415
+ token.unsubscribe(_resolve);
1416
+ };
1417
+ return promise;
1418
+ };
1419
+ executor(function cancel(message) {
1420
+ if (token.reason) {
1421
+ return;
1422
+ }
1423
+ token.reason = new CanceledError(message);
1424
+ resolvePromise(token.reason);
1425
+ });
1426
+ }
1427
+ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
1428
+ if (this.reason) {
1429
+ throw this.reason;
1430
+ }
1431
+ };
1432
+ CancelToken.prototype.subscribe = function subscribe(listener) {
1433
+ if (this.reason) {
1434
+ listener(this.reason);
1435
+ return;
1436
+ }
1437
+ if (this._listeners) {
1438
+ this._listeners.push(listener);
1439
+ } else {
1440
+ this._listeners = [listener];
1441
+ }
1442
+ };
1443
+ CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
1444
+ if (!this._listeners) {
1445
+ return;
1446
+ }
1447
+ var index = this._listeners.indexOf(listener);
1448
+ if (index !== -1) {
1449
+ this._listeners.splice(index, 1);
1450
+ }
1451
+ };
1452
+ CancelToken.source = function source() {
1453
+ var cancel;
1454
+ var token = new CancelToken(function executor(c) {
1455
+ cancel = c;
1456
+ });
1457
+ return {
1458
+ token,
1459
+ cancel
1460
+ };
1461
+ };
1462
+ module.exports = CancelToken;
1463
+ }
1464
+ });
1465
+
1466
+ // node_modules/axios/lib/helpers/spread.js
1467
+ var require_spread = __commonJS({
1468
+ "node_modules/axios/lib/helpers/spread.js"(exports, module) {
1469
+ "use strict";
1470
+ module.exports = function spread(callback) {
1471
+ return function wrap(arr) {
1472
+ return callback.apply(null, arr);
1473
+ };
1474
+ };
1475
+ }
1476
+ });
1477
+
1478
+ // node_modules/axios/lib/helpers/isAxiosError.js
1479
+ var require_isAxiosError = __commonJS({
1480
+ "node_modules/axios/lib/helpers/isAxiosError.js"(exports, module) {
1481
+ "use strict";
1482
+ var utils = require_utils();
1483
+ module.exports = function isAxiosError(payload) {
1484
+ return utils.isObject(payload) && payload.isAxiosError === true;
1485
+ };
1486
+ }
1487
+ });
1488
+
1489
+ // node_modules/axios/lib/axios.js
1490
+ var require_axios = __commonJS({
1491
+ "node_modules/axios/lib/axios.js"(exports, module) {
1492
+ "use strict";
1493
+ var utils = require_utils();
1494
+ var bind = require_bind();
1495
+ var Axios = require_Axios();
1496
+ var mergeConfig = require_mergeConfig();
1497
+ var defaults = require_defaults();
1498
+ function createInstance(defaultConfig2) {
1499
+ var context = new Axios(defaultConfig2);
1500
+ var instance = bind(Axios.prototype.request, context);
1501
+ utils.extend(instance, Axios.prototype, context);
1502
+ utils.extend(instance, context);
1503
+ instance.create = function create(instanceConfig) {
1504
+ return createInstance(mergeConfig(defaultConfig2, instanceConfig));
1505
+ };
1506
+ return instance;
1507
+ }
1508
+ var axios2 = createInstance(defaults);
1509
+ axios2.Axios = Axios;
1510
+ axios2.CanceledError = require_CanceledError();
1511
+ axios2.CancelToken = require_CancelToken();
1512
+ axios2.isCancel = require_isCancel();
1513
+ axios2.VERSION = require_data().version;
1514
+ axios2.toFormData = require_toFormData();
1515
+ axios2.AxiosError = require_AxiosError();
1516
+ axios2.Cancel = axios2.CanceledError;
1517
+ axios2.all = function all(promises) {
1518
+ return Promise.all(promises);
1519
+ };
1520
+ axios2.spread = require_spread();
1521
+ axios2.isAxiosError = require_isAxiosError();
1522
+ module.exports = axios2;
1523
+ module.exports.default = axios2;
1524
+ }
1525
+ });
1526
+
1527
+ // node_modules/axios/index.js
1528
+ var require_axios2 = __commonJS({
1529
+ "node_modules/axios/index.js"(exports, module) {
1530
+ module.exports = require_axios();
1531
+ }
1532
+ });
1533
+
1534
+ // src/api-client.ts
1535
+ var import_axios = __toESM(require_axios2());
1536
+
1537
+ // src/utils.ts
1538
+ function logError(consoleMessage) {
1539
+ console.error("\x1B[41m%s\x1B[0m", consoleMessage);
1540
+ }
1541
+ function logDebug(consoleMessage) {
1542
+ console.log("\x1B[33m%s\x1B[0m", consoleMessage);
1543
+ }
1544
+ function buildRequestUrlPath(config, locale) {
1545
+ let apiFetchOrPreview = "";
1546
+ if (config.isPreview === true || config.isPreview === "true") {
1547
+ apiFetchOrPreview = "preview";
1548
+ } else {
1549
+ apiFetchOrPreview = "fetch";
1550
+ }
1551
+ let urlPath = `${config.baseUrl}/${apiFetchOrPreview}/${locale}`;
1552
+ return urlPath;
1553
+ }
1554
+ function buildPathUrl(contentType, referenceName, skip, take, sort, direction, filters, filtersLogicOperator, contentLinkDepth, expandAllContentLinks) {
1555
+ let url = `/${contentType}/${referenceName}?contentLinkDepth=${contentLinkDepth}&`;
1556
+ filtersLogicOperator = filtersLogicOperator ? ` ${filtersLogicOperator} ` : " AND ";
1557
+ if (sort) {
1558
+ url += `sort=${sort}&`;
1559
+ if (direction) {
1560
+ url += `direction=${direction}&`;
1561
+ }
1562
+ }
1563
+ if (skip) {
1564
+ url += `skip=${skip}&`;
1565
+ }
1566
+ if (take) {
1567
+ url += `take=${take}&`;
1568
+ }
1569
+ if (filters && filters.length > 0) {
1570
+ url += "filter=";
1571
+ for (let i = 0; i < filters.length; i++) {
1572
+ let filter = filters[i];
1573
+ url += `${filter.property}[${filter.operator}]${filter.value}` + (i < filters.length - 1 ? filtersLogicOperator : "");
1574
+ }
1575
+ url += "&";
1576
+ }
1577
+ if (expandAllContentLinks) {
1578
+ url += `expandAllContentLinks=${expandAllContentLinks}&`;
1579
+ }
1580
+ return url;
1581
+ }
1582
+ function buildAuthHeader(config) {
1583
+ let defaultAuthHeaders = {
1584
+ APIKey: config.apiKey,
1585
+ Guid: ""
1586
+ };
1587
+ if (config.requiresGuidInHeaders) {
1588
+ defaultAuthHeaders.Guid = config.guid;
1589
+ }
1590
+ return {
1591
+ ...defaultAuthHeaders,
1592
+ ...config.headers
1593
+ };
1594
+ }
1595
+ function isHttps(url) {
1596
+ if (!url.toLowerCase().startsWith("https://")) {
1597
+ return false;
1598
+ }
1599
+ return true;
1600
+ }
1601
+
1602
+ // src/methods/getSitemapFlat.ts
1603
+ function getSitemapFlat(requestParams) {
1604
+ validateRequestParams(requestParams);
1605
+ const req = {
1606
+ url: `/sitemap/flat/${requestParams.channelName}`,
1607
+ method: "get",
1608
+ baseURL: buildRequestUrlPath(this.config, requestParams.locale || requestParams.languageCode),
1609
+ headers: buildAuthHeader(this.config),
1610
+ params: {}
1611
+ };
1612
+ return this.makeRequest(req);
1613
+ }
1614
+ function validateRequestParams(requestParams) {
1615
+ if (!requestParams.languageCode && !requestParams.locale) {
1616
+ throw new TypeError("You must include a locale in your request params.");
1617
+ } else if (!requestParams.channelName) {
1618
+ throw new TypeError("You must include a channelName in your request params.");
1619
+ } else {
1620
+ return;
1621
+ }
1622
+ }
1623
+ var getSitemapFlat_default = getSitemapFlat;
1624
+
1625
+ // src/methods/getSitemapNested.ts
1626
+ function getSitemapNested(requestParams) {
1627
+ validateRequestParams2(requestParams);
1628
+ const req = {
1629
+ url: `/sitemap/nested/${requestParams.channelName}`,
1630
+ method: "get",
1631
+ baseURL: buildRequestUrlPath(this.config, requestParams.locale || requestParams.languageCode),
1632
+ headers: buildAuthHeader(this.config),
1633
+ params: {}
1634
+ };
1635
+ return this.makeRequest(req);
1636
+ }
1637
+ function validateRequestParams2(requestParams) {
1638
+ if (!requestParams.languageCode && !requestParams.locale) {
1639
+ throw new TypeError("You must include a locale in your request params.");
1640
+ } else if (!requestParams.channelName) {
1641
+ throw new TypeError("You must include a channelName in your request params.");
1642
+ }
1643
+ }
1644
+ var getSitemapNested_default = getSitemapNested;
1645
+
1646
+ // src/methods/getContentItem.ts
1647
+ var defaultParams = {
1648
+ contentLinkDepth: 1,
1649
+ expandAllContentLinks: false
1650
+ };
1651
+ function getContentItem(requestParams) {
1652
+ validateRequestParams3(requestParams);
1653
+ requestParams = { ...defaultParams, ...requestParams };
1654
+ const req = {
1655
+ url: `/item/${requestParams.contentID}?contentLinkDepth=${requestParams.contentLinkDepth}&expandAllContentLinks=${requestParams.expandAllContentLinks}`,
1656
+ method: "get",
1657
+ baseURL: buildRequestUrlPath(this.config, requestParams.locale ? requestParams.locale : requestParams.languageCode),
1658
+ headers: buildAuthHeader(this.config),
1659
+ params: {}
1660
+ };
1661
+ return this.makeRequest(req);
1662
+ }
1663
+ function validateRequestParams3(requestParams) {
1664
+ if (!requestParams.languageCode && !requestParams.locale) {
1665
+ throw new TypeError("You must include a locale in your request params.");
1666
+ } else if (!requestParams.contentID) {
1667
+ throw new TypeError("You must include a contentID number in your request params.");
1668
+ } else if (requestParams.contentLinkDepth && (isNaN(requestParams.contentLinkDepth) || requestParams.contentLinkDepth < 0)) {
1669
+ throw new TypeError("When specifying contentLinkDepth, it must be a number greater than 0.");
1670
+ } else if (requestParams.expandAllContentLinks && typeof requestParams.expandAllContentLinks !== "boolean") {
1671
+ throw new TypeError("ExpandAllContentLinks parameter must be a value of true or false");
1672
+ } else {
1673
+ return;
1674
+ }
1675
+ }
1676
+ var getContentItem_default = getContentItem;
1677
+
1678
+ // src/methods/getContentList.ts
1679
+ function getContentList(requestParams) {
1680
+ validateRequestParams4(requestParams);
1681
+ requestParams.referenceName = sanitizeReferenceName(requestParams.referenceName);
1682
+ requestParams = { ...defaultParams2, ...requestParams };
1683
+ const req = {
1684
+ url: buildPathUrl("list", requestParams.referenceName, requestParams.skip, requestParams.take, requestParams.sort, requestParams.direction, requestParams.filters, requestParams.filtersLogicOperator, requestParams.contentLinkDepth, requestParams.expandAllContentLinks),
1685
+ method: "get",
1686
+ baseURL: buildRequestUrlPath(this.config, requestParams.locale ? requestParams.locale : requestParams.languageCode),
1687
+ headers: buildAuthHeader(this.config),
1688
+ params: {}
1689
+ };
1690
+ return this.makeRequest(req);
1691
+ }
1692
+ function sanitizeReferenceName(referenceName) {
1693
+ return referenceName.toLowerCase();
1694
+ }
1695
+ function validateRequestParams4(requestParams) {
1696
+ if (!requestParams.languageCode && !requestParams.locale) {
1697
+ throw new TypeError("You must include a locale in your request params.");
1698
+ } else if (!requestParams.referenceName) {
1699
+ throw new TypeError("You must include a content referenceName in your request params.");
1700
+ } else if (requestParams.take && isNaN(requestParams.take)) {
1701
+ throw new TypeError("Take parameter must be a number.");
1702
+ } else if ((requestParams.take || requestParams.take == 0) && !isNaN(requestParams.take) && requestParams.take < 1) {
1703
+ throw new TypeError("Take parameter must be greater than 0.");
1704
+ } else if (requestParams.take && !isNaN(requestParams.take) && requestParams.take > 250) {
1705
+ throw new TypeError("Take parameter must be 250 or less.");
1706
+ } else if (requestParams.skip && isNaN(requestParams.skip)) {
1707
+ throw new TypeError("Skip parameter must be a number.");
1708
+ } else if (requestParams.skip && !isNaN(requestParams.skip) && requestParams.skip < 0) {
1709
+ throw new TypeError("Skip parameter must be 0 or greater");
1710
+ } else if (requestParams.direction && (requestParams.direction !== "desc" && requestParams.direction !== "asc")) {
1711
+ throw new TypeError('Direction parameter must have a value of "asc" or "desc"');
1712
+ } else if (requestParams.filters && requestParams.filters.length > 0) {
1713
+ for (let i = 0; i < requestParams.filters.length; i++) {
1714
+ let filter = requestParams.filters[i];
1715
+ if (!filter.hasOwnProperty("property")) {
1716
+ throw new TypeError(JSON.stringify(filter) + " does not contain 'property'.");
1717
+ } else if (!filter.hasOwnProperty("operator")) {
1718
+ throw new TypeError(JSON.stringify(filter) + " does not contain 'operator'.");
1719
+ } else if (!filter.hasOwnProperty("value")) {
1720
+ throw new TypeError(JSON.stringify(filter) + " does not contain 'value'.");
1721
+ }
1722
+ if (["eq", "ne", "gt", "gte", "lt", "lte", "like"].indexOf(filter.operator.toLowerCase()) < 0) {
1723
+ throw new TypeError(JSON.stringify(filter) + "Operator must be one of ['eq','ne','gt','gte','lt','lte','like'].");
1724
+ }
1725
+ }
1726
+ } else if (requestParams.filtersLogicOperator && requestParams.filtersLogicOperator.toLowerCase() !== "and" && requestParams.filtersLogicOperator.toLowerCase() !== "or") {
1727
+ throw new TypeError('FiltersLogicOperator parameter must have a value of "AND" or "OR"');
1728
+ } else if (requestParams.expandAllContentLinks && typeof requestParams.expandAllContentLinks !== "boolean") {
1729
+ throw new TypeError("ExpandAllContentLinks parameter must be a value of true or false");
1730
+ }
1731
+ return true;
1732
+ }
1733
+ var defaultParams2 = {
1734
+ contentLinkDepth: 1,
1735
+ expandAllContentLinks: false
1736
+ };
1737
+ var getContentList_default = getContentList;
1738
+
1739
+ // src/methods/getPage.ts
1740
+ function getPage(requestParams) {
1741
+ validateRequestParams5(requestParams);
1742
+ requestParams = { ...defaultParams3, ...requestParams };
1743
+ const req = {
1744
+ url: `/page/${requestParams.pageID}?contentLinkDepth=${requestParams.contentLinkDepth}&expandAllContentLinks=${requestParams.expandAllContentLinks}`,
1745
+ method: "get",
1746
+ baseURL: buildRequestUrlPath(this.config, requestParams.locale || requestParams.languageCode),
1747
+ headers: buildAuthHeader(this.config),
1748
+ params: {}
1749
+ };
1750
+ console.log(req, "hellooo");
1751
+ return this.makeRequest(req);
1752
+ }
1753
+ function validateRequestParams5(requestParams) {
1754
+ if (!requestParams.languageCode && !requestParams.locale) {
1755
+ throw new TypeError("You must include a locale in your request params.");
1756
+ } else if (!requestParams.pageID) {
1757
+ throw new TypeError("You must include a pageID in your request params.");
1758
+ } else if (requestParams.expandAllContentLinks && typeof requestParams.expandAllContentLinks !== "boolean") {
1759
+ throw new TypeError("ExpandAllContentLinks parameter must be a value of true or false");
1760
+ } else {
1761
+ return;
1762
+ }
1763
+ }
1764
+ var defaultParams3 = {
1765
+ contentLinkDepth: 2,
1766
+ expandAllContentLinks: true
1767
+ };
1768
+ var getPage_default = getPage;
1769
+
1770
+ // src/methods/getGallery.ts
1771
+ function getGallery(requestParams) {
1772
+ validateRequestParams6(requestParams);
1773
+ requestParams = { ...defaultParams4, ...requestParams };
1774
+ const req = {
1775
+ url: `/${requestParams.galleryID}`,
1776
+ method: "get",
1777
+ baseURL: buildRequestUrlPath(this.config, "gallery"),
1778
+ headers: buildAuthHeader(this.config),
1779
+ params: {}
1780
+ };
1781
+ return this.makeRequest(req);
1782
+ }
1783
+ function validateRequestParams6(requestParams) {
1784
+ if (!requestParams.galleryID) {
1785
+ throw new TypeError("You must include a galleryID number in your request params.");
1786
+ } else {
1787
+ return;
1788
+ }
1789
+ }
1790
+ var defaultParams4 = {
1791
+ contentLinkDepth: 1
1792
+ };
1793
+ var getGallery_default = getGallery;
1794
+
1795
+ // src/methods/getUrlRedirections.ts
1796
+ function getUrlRedirections(requestParams) {
1797
+ validateRequestParams7(requestParams);
1798
+ let url = "";
1799
+ if (requestParams.lastAccessDate) {
1800
+ if (!requestParams.lastAccessDate.toISOString) {
1801
+ requestParams.lastAccessDate = new Date(requestParams.lastAccessDate);
1802
+ }
1803
+ url = `/?lastAccessDate=${requestParams.lastAccessDate.toISOString()}`;
1804
+ }
1805
+ const req = {
1806
+ url,
1807
+ method: "get",
1808
+ baseURL: buildRequestUrlPath(this.config, "urlredirection"),
1809
+ headers: buildAuthHeader(this.config),
1810
+ params: {}
1811
+ };
1812
+ const self = this;
1813
+ let promise = new Promise(function(resolve, reject) {
1814
+ self.makeRequest(req).then((data) => {
1815
+ if (data == void 0 || !data) {
1816
+ reject(new Error("The URL redirections could not be retrieved."));
1817
+ } else {
1818
+ resolve(data);
1819
+ }
1820
+ }).catch(
1821
+ (error) => {
1822
+ reject(error);
1823
+ }
1824
+ );
1825
+ });
1826
+ return promise;
1827
+ }
1828
+ function validateRequestParams7(requestParams) {
1829
+ if (requestParams.lastAccessDate) {
1830
+ if (!requestParams.lastAccessDate.toISOString) {
1831
+ let dt = new Date(requestParams.lastAccessDate);
1832
+ if (isNaN(dt.getTime())) {
1833
+ throw new TypeError("You must include a valid Datetime for the lastAccessDate.");
1834
+ }
1835
+ }
1836
+ } else {
1837
+ return;
1838
+ }
1839
+ }
1840
+ var getUrlRedirections_default = getUrlRedirections;
1841
+
1842
+ // src/methods/getSyncContent.ts
1843
+ function getSyncContent(requestParams) {
1844
+ validateRequestParams8(requestParams);
1845
+ const req = {
1846
+ url: `/sync/items?pageSize=${requestParams.pageSize}&syncToken=${requestParams.syncToken}`,
1847
+ method: "get",
1848
+ baseURL: buildRequestUrlPath(this.config, requestParams.locale || requestParams.languageCode),
1849
+ headers: buildAuthHeader(this.config),
1850
+ params: {}
1851
+ };
1852
+ return this.makeRequest(req);
1853
+ }
1854
+ function validateRequestParams8(requestParams) {
1855
+ if (!requestParams.languageCode && !requestParams.locale) {
1856
+ throw new TypeError("You must include a locale in your request params.");
1857
+ } else if (requestParams.syncToken == void 0 || requestParams.syncToken == null) {
1858
+ throw new TypeError("You must include a syncToken value your request params. Use zero (0) to start a new sync.");
1859
+ } else {
1860
+ return;
1861
+ }
1862
+ }
1863
+ var getSyncContent_default = getSyncContent;
1864
+
1865
+ // src/methods/getSyncPages.ts
1866
+ function getSyncPages(requestParams) {
1867
+ validateRequestParams9(requestParams);
1868
+ const req = {
1869
+ url: `/sync/pages?pageSize=${requestParams.pageSize}&syncToken=${requestParams.syncToken}`,
1870
+ method: "get",
1871
+ baseURL: buildRequestUrlPath(this.config, requestParams.locale || requestParams.languageCode),
1872
+ headers: buildAuthHeader(this.config),
1873
+ params: {}
1874
+ };
1875
+ return this.makeRequest(req);
1876
+ }
1877
+ function validateRequestParams9(requestParams) {
1878
+ if (!requestParams.languageCode && !requestParams.locale) {
1879
+ throw new TypeError("You must include a locale in your request params.");
1880
+ } else if (requestParams.syncToken == void 0 || requestParams.syncToken == null) {
1881
+ throw new TypeError("You must include a syncToken value your request params. Use zero (0) to start a new sync.");
1882
+ } else {
1883
+ return;
1884
+ }
1885
+ }
1886
+ var getSyncPages_default = getSyncPages;
1887
+
1888
+ // src/types/index.ts
1889
+ var types_exports = {};
1890
+ __export(types_exports, {
1891
+ FilterLogicOperators: () => FilterLogicOperators,
1892
+ FilterOperators: () => FilterOperator_default
1893
+ });
1894
+
1895
+ // src/types/FilterOperator.ts
1896
+ var FilterOperators = {
1897
+ /** Equal To */
1898
+ EQUAL_TO: "eq",
1899
+ /** Not Equal To */
1900
+ NOT_EQUAL_TO: "ne",
1901
+ /** Less Than */
1902
+ LESS_THAN: "lt",
1903
+ /** Less Than or Equal To */
1904
+ LESS_THAN_OR_EQUAL_TO: "lte",
1905
+ /** Greater Than */
1906
+ GREATER_THAN: "gt",
1907
+ /** Greater Than or Equal To */
1908
+ GREATER_THAN_OR_EQUAL_TO: "gte",
1909
+ /** Like (string only) */
1910
+ LIKE: "like"
1911
+ };
1912
+ var FilterOperator_default = FilterOperators;
1913
+
1914
+ // src/types/FilterLogicOperator.ts
1915
+ var FilterLogicOperators = /* @__PURE__ */ ((FilterLogicOperators2) => {
1916
+ FilterLogicOperators2["AND"] = "AND";
1917
+ FilterLogicOperators2["OR"] = "OR";
1918
+ return FilterLogicOperators2;
1919
+ })(FilterLogicOperators || {});
1920
+
1921
+ // src/api-client.ts
1922
+ var defaultConfig = {
1923
+ baseUrl: null,
1924
+ isPreview: false,
1925
+ guid: null,
1926
+ apiKey: null,
1927
+ locale: null,
1928
+ headers: {},
1929
+ requiresGuidInHeaders: false,
1930
+ debug: false,
1931
+ caching: {
1932
+ maxAge: 0
1933
+ //caching disabled by default
1934
+ }
1935
+ };
1936
+ function buildEnvConfig() {
1937
+ const envConfig = {
1938
+ baseUrl: null,
1939
+ isPreview: false,
1940
+ guid: null,
1941
+ apiKey: null
1942
+ };
1943
+ if (process && process.env) {
1944
+ let env = process.env;
1945
+ if (env.AGILITY_BASEURL) {
1946
+ envConfig.baseUrl = env.AGILITY_BASEURL;
1947
+ }
1948
+ if (env.AGILITY_GUID) {
1949
+ envConfig.guid = env.AGILITY_GUID;
1950
+ }
1951
+ if (env.AGILITY_APIKEY) {
1952
+ envConfig.apiKey = env.AGILITY_APIKEY;
1953
+ }
1954
+ envConfig.isPreview = env.AGILITY_ISPREVIEW === "true";
1955
+ }
1956
+ return envConfig;
1957
+ }
1958
+ function buildBaseUrl(guid) {
1959
+ let baseUrlSuffixes = {
1960
+ u: "",
1961
+ c: "-ca",
1962
+ e: "-eu",
1963
+ a: "-aus",
1964
+ d: "-dev"
1965
+ };
1966
+ let suffix = guid.substr(guid.length - 2, 2);
1967
+ let env = suffix.substr(1);
1968
+ if (suffix.startsWith("-") && baseUrlSuffixes.hasOwnProperty(env)) {
1969
+ return `https://api${baseUrlSuffixes[env]}.aglty.io/${guid}`;
1970
+ } else {
1971
+ return `https://${guid}-api.agilitycms.cloud`;
1972
+ }
1973
+ }
1974
+ function validateConfigParams(configParams) {
1975
+ if (!configParams.guid || configParams.guid.length == 0) {
1976
+ throw new TypeError("You must provide an guid.");
1977
+ } else if (!configParams.apiKey || configParams.apiKey.length == 0) {
1978
+ throw new TypeError("You must provide an access token.");
1979
+ } else if (configParams.caching && isNaN(configParams.caching.maxAge)) {
1980
+ throw new TypeError("When specifying a cache maxAge, you must set a number value in miliseconds, i.e. 180000 (3 mins).");
1981
+ } else if (configParams.baseUrl && !isHttps(configParams.baseUrl)) {
1982
+ throw new TypeError(`When specifying a baseUrl (${configParams.baseUrl}), it must be over HTTPs.`);
1983
+ } else {
1984
+ return;
1985
+ }
1986
+ }
1987
+ var ApiClient = class {
1988
+ constructor(userConfig) {
1989
+ this.types = types_exports;
1990
+ const envConfig = buildEnvConfig();
1991
+ let config = {
1992
+ ...defaultConfig,
1993
+ ...envConfig,
1994
+ ...userConfig
1995
+ };
1996
+ if (!config.baseUrl) {
1997
+ config.baseUrl = buildBaseUrl(config?.guid || "");
1998
+ } else {
1999
+ config.requiresGuidInHeaders = true;
2000
+ }
2001
+ this.config = config;
2002
+ let adapter = void 0;
2003
+ this._api = import_axios.default.create();
2004
+ }
2005
+ async getContentItem(params) {
2006
+ return getContentItem_default.call(this, params);
2007
+ }
2008
+ async getContentList(params) {
2009
+ return getContentList_default.call(this, params);
2010
+ }
2011
+ async getGallery(params) {
2012
+ return getGallery_default.call(this, params);
2013
+ }
2014
+ async getPage(params) {
2015
+ return getPage_default.call(this, params);
2016
+ }
2017
+ async getSitemapFlat(params) {
2018
+ return getSitemapFlat_default.call(this, params);
2019
+ }
2020
+ async getSitemapNested(params) {
2021
+ return getSitemapNested_default.call(this, params);
2022
+ }
2023
+ async getUrlRedirections(params) {
2024
+ return getUrlRedirections_default.call(this, params);
2025
+ }
2026
+ async getSyncContent(params) {
2027
+ return getSyncContent_default.call(this, params);
2028
+ }
2029
+ async getSyncPages(params) {
2030
+ return getSyncPages_default.call(this, params);
2031
+ }
2032
+ //the function that actually makes ALL our requests
2033
+ async makeRequest(reqConfig) {
2034
+ if (this.config.debug) {
2035
+ logDebug(`AgilityCMS Fetch API LOG: ${reqConfig.baseURL}${reqConfig.url}`);
2036
+ }
2037
+ try {
2038
+ const response = await this._api(reqConfig);
2039
+ let data = response.data;
2040
+ if (response.request.fromCache) {
2041
+ data["fromCache"] = true;
2042
+ }
2043
+ if (this.config.debug) {
2044
+ data["agilityResponseHeaders"] = response.headers;
2045
+ }
2046
+ return await data;
2047
+ } catch (error) {
2048
+ logError(`AgilityCMS Fetch API ERROR: Request failed for ${reqConfig.baseURL}${reqConfig.url} ... ${error} ... Does the item exist?`);
2049
+ }
2050
+ }
2051
+ };
2052
+ function getApi(config) {
2053
+ validateConfigParams(config);
2054
+ return new ApiClient(config);
2055
+ }
2056
+ var api_client_default = getApi;
2057
+ })();