@ama-sdk/core 10.0.0-next.8 → 11.0.0-next.0

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 (366) hide show
  1. package/README.md +51 -31
  2. package/cjs/clients/api-angular-client.js +6 -2
  3. package/cjs/clients/api-beacon-client.js +3 -2
  4. package/cjs/clients/api-fetch-client.js +9 -4
  5. package/cjs/fwk/Reviver.js +3 -3
  6. package/cjs/fwk/api.helpers.js +9 -10
  7. package/cjs/fwk/api.js +2 -2
  8. package/cjs/fwk/date.js +4 -39
  9. package/cjs/fwk/errors.js +10 -11
  10. package/cjs/fwk/index.js +1 -0
  11. package/cjs/fwk/logger.js +9 -0
  12. package/cjs/fwk/mocks/alf-mock-adapter.js +1 -8
  13. package/cjs/fwk/mocks/base-mock-adapter.js +0 -12
  14. package/cjs/plugins/additional-params/additional-params.request.js +5 -5
  15. package/cjs/plugins/api-configuration-override/api-configuration-override.request.js +2 -2
  16. package/cjs/plugins/api-key/api-key.request.js +2 -2
  17. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +77 -105
  18. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +9 -98
  19. package/cjs/plugins/client-facts/client-facts.request.js +5 -7
  20. package/cjs/plugins/concurrent/concurrent.fetch.js +2 -2
  21. package/cjs/plugins/core/plugin.js +1 -3
  22. package/cjs/plugins/custom-info/custom-info.reply.js +0 -1
  23. package/cjs/plugins/index.js +0 -21
  24. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +7 -9
  25. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +1 -0
  26. package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +5 -4
  27. package/cjs/plugins/mock-intercept/mock-intercept.request.js +3 -3
  28. package/cjs/plugins/mock-intercept/mock-intercept.spec.js +1 -3
  29. package/cjs/plugins/perf-metric/perf-metric.fetch.js +2 -5
  30. package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +12 -14
  31. package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +3 -1
  32. package/cjs/plugins/retry/retry.fetch.js +2 -3
  33. package/cjs/plugins/session-id/session-id.request.js +10 -11
  34. package/cjs/plugins/session-id/session-id.spec.js +12 -8
  35. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +2 -4
  36. package/cjs/plugins/timeout/timeout.fetch.js +75 -15
  37. package/cjs/plugins/timeout/timeout.spec.js +102 -3
  38. package/cjs/plugins/url-rewrite/url-rewrite.request.js +2 -2
  39. package/cjs/plugins/wait-for/wait-for.fetch.js +2 -2
  40. package/cjs/public_api.js +1 -0
  41. package/cjs/utils/crypto.js +5 -5
  42. package/cjs/utils/encoder.js +0 -5
  43. package/cjs/{plugins/gateway-token → utils}/index.js +5 -2
  44. package/cjs/utils/json-token.js +11 -13
  45. package/cjs/utils/json-token.spec.js +4 -2
  46. package/cjs/utils/mime-types.js +22 -0
  47. package/cli/clear-index.cjs +25 -0
  48. package/cli/clear-index.cjs.map +1 -0
  49. package/cli/clear-index.d.cts +3 -0
  50. package/cli/clear-index.d.cts.map +1 -0
  51. package/cli/files-pack.cjs +84 -0
  52. package/cli/files-pack.cjs.map +1 -0
  53. package/cli/files-pack.d.cts +3 -0
  54. package/cli/files-pack.d.cts.map +1 -0
  55. package/cli/package.json +3 -0
  56. package/esm2015/clients/api-angular-client.js +6 -2
  57. package/esm2015/clients/api-beacon-client.js +3 -2
  58. package/esm2015/clients/api-fetch-client.js +9 -4
  59. package/esm2015/fwk/Reviver.js +0 -3
  60. package/esm2015/fwk/api.helpers.js +3 -3
  61. package/esm2015/fwk/api.interface.js +1 -1
  62. package/esm2015/fwk/api.js +2 -2
  63. package/esm2015/fwk/core/api-client.js +0 -1
  64. package/esm2015/fwk/core/base-api-constructor.js +0 -1
  65. package/esm2015/fwk/date.js +1 -38
  66. package/esm2015/fwk/errors.js +2 -3
  67. package/esm2015/fwk/index.js +1 -0
  68. package/esm2015/fwk/logger.js +6 -0
  69. package/esm2015/fwk/mocks/alf-mock-adapter.js +1 -9
  70. package/esm2015/fwk/mocks/base-mock-adapter.js +0 -12
  71. package/esm2015/fwk/mocks/encoded-api-request.js +3 -1
  72. package/esm2015/fwk/mocks/helpers.js +0 -2
  73. package/esm2015/fwk/mocks/mock-adapter.js +1 -1
  74. package/esm2015/fwk/mocks/path-object.js +1 -1
  75. package/esm2015/plugins/additional-params/additional-params.request.js +2 -3
  76. package/esm2015/plugins/api-configuration-override/api-configuration-override.request.js +2 -3
  77. package/esm2015/plugins/api-key/api-key.request.js +2 -2
  78. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +84 -118
  79. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +10 -99
  80. package/esm2015/plugins/client-facts/client-facts.request.js +14 -7
  81. package/esm2015/plugins/concurrent/concurrent.fetch.js +2 -2
  82. package/esm2015/plugins/core/fetch-plugin.js +4 -1
  83. package/esm2015/plugins/core/plugin.js +1 -1
  84. package/esm2015/plugins/core/reply-plugin.js +4 -1
  85. package/esm2015/plugins/core/request-plugin.js +4 -1
  86. package/esm2015/plugins/custom-info/custom-info.reply.js +0 -1
  87. package/esm2015/plugins/index.js +0 -4
  88. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +3 -7
  89. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +1 -0
  90. package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +5 -4
  91. package/esm2015/plugins/mock-intercept/mock-intercept.request.js +3 -3
  92. package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +1 -3
  93. package/esm2015/plugins/perf-metric/perf-metric.fetch.js +2 -5
  94. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +19 -21
  95. package/esm2015/plugins/retry/retry.fetch.js +2 -3
  96. package/esm2015/plugins/session-id/session-id.request.js +10 -11
  97. package/esm2015/plugins/session-id/session-id.spec.js +12 -8
  98. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +10 -10
  99. package/esm2015/plugins/timeout/timeout.fetch.js +70 -12
  100. package/esm2015/plugins/timeout/timeout.spec.js +102 -3
  101. package/esm2015/plugins/url-rewrite/url-rewrite.request.js +2 -2
  102. package/esm2015/plugins/wait-for/wait-for.fetch.js +4 -3
  103. package/esm2015/public_api.js +1 -0
  104. package/esm2015/utils/crypto.js +0 -4
  105. package/esm2015/utils/encoder.js +0 -5
  106. package/esm2015/utils/ie11.js +0 -1
  107. package/esm2015/utils/index.js +5 -0
  108. package/esm2015/utils/json-token.js +2 -7
  109. package/esm2015/utils/json-token.spec.js +4 -2
  110. package/esm2015/utils/mime-types.js +7 -0
  111. package/package.json +51 -36
  112. package/schematics/ng-add/index.d.ts.map +1 -1
  113. package/schematics/ng-add/index.js +38 -20
  114. package/schematics/ng-add/index.js.map +1 -1
  115. package/schematics/ng-add/schema.json +2 -2
  116. package/src/clients/api-angular-client.d.ts.map +1 -1
  117. package/src/clients/api-angular-client.js +3 -2
  118. package/src/clients/api-angular-client.js.map +1 -1
  119. package/src/clients/api-beacon-client.d.ts +0 -1
  120. package/src/clients/api-beacon-client.d.ts.map +1 -1
  121. package/src/clients/api-beacon-client.js +1 -3
  122. package/src/clients/api-beacon-client.js.map +1 -1
  123. package/src/clients/api-fetch-client.d.ts +0 -1
  124. package/src/clients/api-fetch-client.d.ts.map +1 -1
  125. package/src/clients/api-fetch-client.js +5 -5
  126. package/src/clients/api-fetch-client.js.map +1 -1
  127. package/src/fwk/Reviver.d.ts +0 -3
  128. package/src/fwk/Reviver.d.ts.map +1 -1
  129. package/src/fwk/Reviver.js +0 -3
  130. package/src/fwk/Reviver.js.map +1 -1
  131. package/src/fwk/api.helpers.d.ts +2 -1
  132. package/src/fwk/api.helpers.d.ts.map +1 -1
  133. package/src/fwk/api.helpers.js +2 -1
  134. package/src/fwk/api.helpers.js.map +1 -1
  135. package/src/fwk/core/api-client.d.ts +0 -4
  136. package/src/fwk/core/api-client.d.ts.map +1 -1
  137. package/src/fwk/core/api-client.js +0 -1
  138. package/src/fwk/core/api-client.js.map +1 -1
  139. package/src/fwk/core/base-api-constructor.d.ts +3 -2
  140. package/src/fwk/core/base-api-constructor.d.ts.map +1 -1
  141. package/src/fwk/core/base-api-constructor.js +0 -1
  142. package/src/fwk/core/base-api-constructor.js.map +1 -1
  143. package/src/fwk/date.d.ts +0 -15
  144. package/src/fwk/date.d.ts.map +1 -1
  145. package/src/fwk/date.js +0 -36
  146. package/src/fwk/date.js.map +1 -1
  147. package/src/fwk/index.d.ts +1 -0
  148. package/src/fwk/index.d.ts.map +1 -1
  149. package/src/fwk/index.js +1 -0
  150. package/src/fwk/index.js.map +1 -1
  151. package/src/fwk/logger.d.ts +39 -0
  152. package/src/fwk/logger.d.ts.map +1 -0
  153. package/src/fwk/logger.js +2 -0
  154. package/src/fwk/logger.js.map +1 -0
  155. package/src/fwk/mocks/alf-mock-adapter.d.ts +0 -1
  156. package/src/fwk/mocks/alf-mock-adapter.d.ts.map +1 -1
  157. package/src/fwk/mocks/alf-mock-adapter.js +0 -7
  158. package/src/fwk/mocks/alf-mock-adapter.js.map +1 -1
  159. package/src/fwk/mocks/base-mock-adapter.d.ts +0 -4
  160. package/src/fwk/mocks/base-mock-adapter.d.ts.map +1 -1
  161. package/src/fwk/mocks/base-mock-adapter.js +0 -10
  162. package/src/fwk/mocks/base-mock-adapter.js.map +1 -1
  163. package/src/fwk/mocks/helpers.d.ts +0 -2
  164. package/src/fwk/mocks/helpers.d.ts.map +1 -1
  165. package/src/fwk/mocks/helpers.js +0 -2
  166. package/src/fwk/mocks/helpers.js.map +1 -1
  167. package/src/fwk/mocks/mock-adapter.d.ts +0 -10
  168. package/src/fwk/mocks/mock-adapter.d.ts.map +1 -1
  169. package/src/fwk/mocks/random-mock-adapter.d.ts +1 -1
  170. package/src/fwk/mocks/random-mock-adapter.d.ts.map +1 -1
  171. package/src/fwk/mocks/random-mock-adapter.js.map +1 -1
  172. package/src/plugins/additional-params/additional-params-sync.request.d.ts +1 -2
  173. package/src/plugins/additional-params/additional-params-sync.request.d.ts.map +1 -1
  174. package/src/plugins/additional-params/additional-params-sync.request.js +0 -1
  175. package/src/plugins/additional-params/additional-params-sync.request.js.map +1 -1
  176. package/src/plugins/additional-params/additional-params.request.d.ts +1 -3
  177. package/src/plugins/additional-params/additional-params.request.d.ts.map +1 -1
  178. package/src/plugins/additional-params/additional-params.request.js +0 -2
  179. package/src/plugins/additional-params/additional-params.request.js.map +1 -1
  180. package/src/plugins/api-configuration-override/api-configuration-override.request.d.ts +2 -4
  181. package/src/plugins/api-configuration-override/api-configuration-override.request.d.ts.map +1 -1
  182. package/src/plugins/api-configuration-override/api-configuration-override.request.js +0 -2
  183. package/src/plugins/api-configuration-override/api-configuration-override.request.js.map +1 -1
  184. package/src/plugins/api-key/api-key.request.d.ts +2 -3
  185. package/src/plugins/api-key/api-key.request.d.ts.map +1 -1
  186. package/src/plugins/api-key/api-key.request.js +0 -1
  187. package/src/plugins/api-key/api-key.request.js.map +1 -1
  188. package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.d.ts +16 -31
  189. package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.d.ts.map +1 -1
  190. package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +20 -61
  191. package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js.map +1 -1
  192. package/src/plugins/client-facts/client-facts.request.d.ts +15 -8
  193. package/src/plugins/client-facts/client-facts.request.d.ts.map +1 -1
  194. package/src/plugins/client-facts/client-facts.request.js +12 -5
  195. package/src/plugins/client-facts/client-facts.request.js.map +1 -1
  196. package/src/plugins/concurrent/concurrent.fetch.d.ts +1 -2
  197. package/src/plugins/concurrent/concurrent.fetch.d.ts.map +1 -1
  198. package/src/plugins/concurrent/concurrent.fetch.js +0 -1
  199. package/src/plugins/concurrent/concurrent.fetch.js.map +1 -1
  200. package/src/plugins/core/fetch-plugin.d.ts +7 -4
  201. package/src/plugins/core/fetch-plugin.d.ts.map +1 -1
  202. package/src/plugins/core/plugin.d.ts +15 -2
  203. package/src/plugins/core/plugin.d.ts.map +1 -1
  204. package/src/plugins/core/reply-plugin.d.ts +8 -5
  205. package/src/plugins/core/reply-plugin.d.ts.map +1 -1
  206. package/src/plugins/core/request-plugin.d.ts +11 -3
  207. package/src/plugins/core/request-plugin.d.ts.map +1 -1
  208. package/src/plugins/custom-info/custom-info.reply.d.ts +1 -3
  209. package/src/plugins/custom-info/custom-info.reply.d.ts.map +1 -1
  210. package/src/plugins/custom-info/custom-info.reply.js +0 -2
  211. package/src/plugins/custom-info/custom-info.reply.js.map +1 -1
  212. package/src/plugins/exception/exception.reply.d.ts +1 -1
  213. package/src/plugins/exception/exception.reply.d.ts.map +1 -1
  214. package/src/plugins/exception/exception.reply.js.map +1 -1
  215. package/src/plugins/fetch-cache/fetch-cache.request.d.ts +3 -3
  216. package/src/plugins/fetch-cache/fetch-cache.request.d.ts.map +1 -1
  217. package/src/plugins/fetch-credentials/fetch-credentials.request.d.ts +1 -1
  218. package/src/plugins/fetch-credentials/fetch-credentials.request.d.ts.map +1 -1
  219. package/src/plugins/index.d.ts +0 -4
  220. package/src/plugins/index.d.ts.map +1 -1
  221. package/src/plugins/index.js +0 -4
  222. package/src/plugins/index.js.map +1 -1
  223. package/src/plugins/json-token/json-token.reply.d.ts +0 -1
  224. package/src/plugins/json-token/json-token.reply.d.ts.map +1 -1
  225. package/src/plugins/json-token/json-token.reply.js +0 -1
  226. package/src/plugins/json-token/json-token.reply.js.map +1 -1
  227. package/src/plugins/json-token/json-token.request.d.ts +2 -3
  228. package/src/plugins/json-token/json-token.request.d.ts.map +1 -1
  229. package/src/plugins/json-token/json-token.request.js +0 -1
  230. package/src/plugins/json-token/json-token.request.js.map +1 -1
  231. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.d.ts +2 -8
  232. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.d.ts.map +1 -1
  233. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +0 -6
  234. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js.map +1 -1
  235. package/src/plugins/mock-intercept/mock-intercept.fetch.d.ts.map +1 -1
  236. package/src/plugins/mock-intercept/mock-intercept.fetch.js +3 -2
  237. package/src/plugins/mock-intercept/mock-intercept.fetch.js.map +1 -1
  238. package/src/plugins/mock-intercept/mock-intercept.request.d.ts +1 -1
  239. package/src/plugins/mock-intercept/mock-intercept.request.d.ts.map +1 -1
  240. package/src/plugins/mock-intercept/mock-intercept.request.js +1 -1
  241. package/src/plugins/mock-intercept/mock-intercept.request.js.map +1 -1
  242. package/src/plugins/perf-metric/perf-metric.fetch.d.ts +0 -3
  243. package/src/plugins/perf-metric/perf-metric.fetch.d.ts.map +1 -1
  244. package/src/plugins/perf-metric/perf-metric.fetch.js +0 -3
  245. package/src/plugins/perf-metric/perf-metric.fetch.js.map +1 -1
  246. package/src/plugins/pii-tokenizer/pii-tokenizer.request.d.ts +19 -21
  247. package/src/plugins/pii-tokenizer/pii-tokenizer.request.d.ts.map +1 -1
  248. package/src/plugins/pii-tokenizer/pii-tokenizer.request.js +18 -20
  249. package/src/plugins/pii-tokenizer/pii-tokenizer.request.js.map +1 -1
  250. package/src/plugins/retry/retry.fetch.d.ts +8 -7
  251. package/src/plugins/retry/retry.fetch.d.ts.map +1 -1
  252. package/src/plugins/retry/retry.fetch.js +0 -2
  253. package/src/plugins/retry/retry.fetch.js.map +1 -1
  254. package/src/plugins/session-id/session-id.request.d.ts +7 -6
  255. package/src/plugins/session-id/session-id.request.d.ts.map +1 -1
  256. package/src/plugins/session-id/session-id.request.js +11 -12
  257. package/src/plugins/session-id/session-id.request.js.map +1 -1
  258. package/src/plugins/si-token/si-token.request.d.ts +0 -1
  259. package/src/plugins/si-token/si-token.request.d.ts.map +1 -1
  260. package/src/plugins/si-token/si-token.request.js +0 -1
  261. package/src/plugins/si-token/si-token.request.js.map +1 -1
  262. package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.d.ts +10 -11
  263. package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.d.ts.map +1 -1
  264. package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +8 -9
  265. package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js.map +1 -1
  266. package/src/plugins/timeout/timeout.fetch.d.ts +31 -2
  267. package/src/plugins/timeout/timeout.fetch.d.ts.map +1 -1
  268. package/src/plugins/timeout/timeout.fetch.js +62 -10
  269. package/src/plugins/timeout/timeout.fetch.js.map +1 -1
  270. package/src/plugins/url-rewrite/url-rewrite.request.d.ts +1 -2
  271. package/src/plugins/url-rewrite/url-rewrite.request.d.ts.map +1 -1
  272. package/src/plugins/url-rewrite/url-rewrite.request.js +0 -1
  273. package/src/plugins/url-rewrite/url-rewrite.request.js.map +1 -1
  274. package/src/plugins/wait-for/wait-for.fetch.d.ts +2 -3
  275. package/src/plugins/wait-for/wait-for.fetch.d.ts.map +1 -1
  276. package/src/plugins/wait-for/wait-for.fetch.js +2 -2
  277. package/src/plugins/wait-for/wait-for.fetch.js.map +1 -1
  278. package/src/public_api.d.ts +1 -0
  279. package/src/public_api.d.ts.map +1 -1
  280. package/src/public_api.js +1 -0
  281. package/src/public_api.js.map +1 -1
  282. package/src/utils/crypto.d.ts +0 -4
  283. package/src/utils/crypto.d.ts.map +1 -1
  284. package/src/utils/crypto.js +0 -4
  285. package/src/utils/crypto.js.map +1 -1
  286. package/src/utils/encoder.d.ts +0 -1
  287. package/src/utils/encoder.d.ts.map +1 -1
  288. package/src/utils/encoder.js +0 -5
  289. package/src/utils/encoder.js.map +1 -1
  290. package/src/utils/ie11.d.ts +0 -1
  291. package/src/utils/ie11.d.ts.map +1 -1
  292. package/src/utils/ie11.js +0 -1
  293. package/src/utils/ie11.js.map +1 -1
  294. package/src/utils/index.d.ts +6 -0
  295. package/src/utils/index.d.ts.map +1 -0
  296. package/src/utils/index.js +6 -0
  297. package/src/utils/index.js.map +1 -0
  298. package/src/utils/json-token.d.ts +0 -3
  299. package/src/utils/json-token.d.ts.map +1 -1
  300. package/src/utils/json-token.js +0 -5
  301. package/src/utils/json-token.js.map +1 -1
  302. package/src/utils/mime-types.d.ts +7 -0
  303. package/src/utils/mime-types.d.ts.map +1 -0
  304. package/src/utils/mime-types.js +9 -0
  305. package/src/utils/mime-types.js.map +1 -0
  306. package/cjs/plugins/fetch-options/fetch-options.request.js +0 -87
  307. package/cjs/plugins/fetch-options/fetch-options.spec.js +0 -280
  308. package/cjs/plugins/fetch-options/index.js +0 -18
  309. package/cjs/plugins/gateway-token/gateway-authentication.js +0 -275
  310. package/cjs/plugins/gateway-token/gateway-token.request.js +0 -388
  311. package/cjs/plugins/gateway-token/gateway-token.spec.js +0 -360
  312. package/cjs/plugins/imperva/imperva.fetch.js +0 -307
  313. package/cjs/plugins/imperva/imperva.spec.js +0 -347
  314. package/cjs/plugins/imperva/index.js +0 -18
  315. package/cjs/plugins/public-facts/index.js +0 -18
  316. package/cjs/plugins/public-facts/public-facts.request.js +0 -101
  317. package/cjs/plugins/public-facts/public-facts.spec.js +0 -367
  318. package/esm2015/plugins/fetch-options/fetch-options.request.js +0 -81
  319. package/esm2015/plugins/fetch-options/fetch-options.spec.js +0 -276
  320. package/esm2015/plugins/fetch-options/index.js +0 -1
  321. package/esm2015/plugins/gateway-token/gateway-authentication.js +0 -262
  322. package/esm2015/plugins/gateway-token/gateway-token.request.js +0 -406
  323. package/esm2015/plugins/gateway-token/gateway-token.spec.js +0 -356
  324. package/esm2015/plugins/gateway-token/index.js +0 -2
  325. package/esm2015/plugins/imperva/imperva.fetch.js +0 -303
  326. package/esm2015/plugins/imperva/imperva.spec.js +0 -343
  327. package/esm2015/plugins/imperva/index.js +0 -1
  328. package/esm2015/plugins/public-facts/index.js +0 -1
  329. package/esm2015/plugins/public-facts/public-facts.request.js +0 -138
  330. package/esm2015/plugins/public-facts/public-facts.spec.js +0 -363
  331. package/src/plugins/fetch-options/fetch-options.request.d.ts +0 -26
  332. package/src/plugins/fetch-options/fetch-options.request.d.ts.map +0 -1
  333. package/src/plugins/fetch-options/fetch-options.request.js +0 -22
  334. package/src/plugins/fetch-options/fetch-options.request.js.map +0 -1
  335. package/src/plugins/fetch-options/index.d.ts +0 -2
  336. package/src/plugins/fetch-options/index.d.ts.map +0 -1
  337. package/src/plugins/fetch-options/index.js +0 -2
  338. package/src/plugins/fetch-options/index.js.map +0 -1
  339. package/src/plugins/gateway-token/gateway-authentication.d.ts +0 -105
  340. package/src/plugins/gateway-token/gateway-authentication.d.ts.map +0 -1
  341. package/src/plugins/gateway-token/gateway-authentication.js +0 -74
  342. package/src/plugins/gateway-token/gateway-authentication.js.map +0 -1
  343. package/src/plugins/gateway-token/gateway-token.request.d.ts +0 -97
  344. package/src/plugins/gateway-token/gateway-token.request.d.ts.map +0 -1
  345. package/src/plugins/gateway-token/gateway-token.request.js +0 -127
  346. package/src/plugins/gateway-token/gateway-token.request.js.map +0 -1
  347. package/src/plugins/gateway-token/index.d.ts +0 -3
  348. package/src/plugins/gateway-token/index.d.ts.map +0 -1
  349. package/src/plugins/gateway-token/index.js +0 -3
  350. package/src/plugins/gateway-token/index.js.map +0 -1
  351. package/src/plugins/imperva/imperva.fetch.d.ts +0 -33
  352. package/src/plugins/imperva/imperva.fetch.d.ts.map +0 -1
  353. package/src/plugins/imperva/imperva.fetch.js +0 -41
  354. package/src/plugins/imperva/imperva.fetch.js.map +0 -1
  355. package/src/plugins/imperva/index.d.ts +0 -2
  356. package/src/plugins/imperva/index.d.ts.map +0 -1
  357. package/src/plugins/imperva/index.js +0 -2
  358. package/src/plugins/imperva/index.js.map +0 -1
  359. package/src/plugins/public-facts/index.d.ts +0 -2
  360. package/src/plugins/public-facts/index.d.ts.map +0 -1
  361. package/src/plugins/public-facts/index.js +0 -2
  362. package/src/plugins/public-facts/index.js.map +0 -1
  363. package/src/plugins/public-facts/public-facts.request.d.ts +0 -89
  364. package/src/plugins/public-facts/public-facts.request.d.ts.map +0 -1
  365. package/src/plugins/public-facts/public-facts.request.js +0 -62
  366. package/src/plugins/public-facts/public-facts.request.js.map +0 -1
@@ -138,10 +138,9 @@ function _create_super(Derived) {
138
138
  var _super = _create_super(GenericError);
139
139
  function GenericError(message, context) {
140
140
  _class_call_check(this, GenericError);
141
- var _context, _context1;
142
141
  var httpRegexp = /^https?:\/\//;
143
- var baseUrl = ((_context = context) === null || _context === void 0 ? void 0 : _context.url) ? context.url.replace(httpRegexp, "") : "unknown";
144
- var origin = ((_context1 = context) === null || _context1 === void 0 ? void 0 : _context1.origin) ? context.origin.replace(httpRegexp, "") : "unknown";
142
+ var baseUrl = (context === null || context === void 0 ? void 0 : context.url) ? context.url.replace(httpRegexp, "") : "unknown";
143
+ var origin = (context === null || context === void 0 ? void 0 : context.origin) ? context.origin.replace(httpRegexp, "") : "unknown";
145
144
  return _super.call(this, context ? "[SDK] [apiName: ".concat(context.apiName || "unknown", "] [operationId: ").concat(context.operationId || "unknown", "] [baseUrl: ").concat(baseUrl, "] [origin: ").concat(origin, "] [errorType: SDK] ").concat(message) : "[SDK] ".concat(message));
146
145
  }
147
146
  return GenericError;
@@ -5,5 +5,6 @@ export * from "./core/index";
5
5
  export * from "./date";
6
6
  export * from "./errors";
7
7
  export * from "./ignore-enum.type";
8
+ export * from "./logger";
8
9
  export * from "./mocks/index";
9
10
  export * from "./Reviver";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Logger Client interface.
3
+ *
4
+ * Duplicate from [@o3r/core]{@link https://github.com/AmadeusITGroup/otter/blob/main/packages/%40o3r/core/src/log/logger.ts}
5
+ * All modifications should be made in both interfaces
6
+ */ export { };
@@ -193,7 +193,6 @@ import { SequentialMockAdapter } from "./sequential-mock-adapter";
193
193
  */ var requestResponseJsonRegexp = RegExp(/(^{.*}$)/m);
194
194
  /**
195
195
  * Split the logs
196
- *
197
196
  * @param log alf log
198
197
  * @returns an array containing one message each
199
198
  */ function splitCalls(log) {
@@ -201,7 +200,6 @@ import { SequentialMockAdapter } from "./sequential-mock-adapter";
201
200
  }
202
201
  /**
203
202
  * Get AlfCall corresponding to this log if it is a request received by the SI
204
- *
205
203
  * @param log alf log
206
204
  * @param corrId correlationId
207
205
  * @param operationAdapter operation adapter to bind each request with its operationId
@@ -227,7 +225,6 @@ import { SequentialMockAdapter } from "./sequential-mock-adapter";
227
225
  }
228
226
  /**
229
227
  * Returns true if log is detected as a HTTP response
230
- *
231
228
  * @param log alf log
232
229
  * @returns true if found
233
230
  */ function isResponse(log) {
@@ -236,7 +233,6 @@ import { SequentialMockAdapter } from "./sequential-mock-adapter";
236
233
  }
237
234
  /**
238
235
  * Return JSON data found
239
- *
240
236
  * @param log alf log
241
237
  * @returns JSON data that can be either the request or the response
242
238
  */ function getData(log) {
@@ -247,7 +243,6 @@ import { SequentialMockAdapter } from "./sequential-mock-adapter";
247
243
  * Retrieve path from logPath and parse it to find all the calls.
248
244
  * If the logs file contains more than one entry point this methods will separate them in Steps.
249
245
  * First call will represent the request and last call the response.
250
- *
251
246
  * @param log Content of the alf logs
252
247
  * @param operationAdapter operation adapter to bind each request/response with its operationId
253
248
  * @returns an array of AlfCall found in the logs
@@ -260,10 +255,9 @@ import { SequentialMockAdapter } from "./sequential-mock-adapter";
260
255
  try {
261
256
  var _loop = function() {
262
257
  var callMatch = _step.value;
263
- var _match;
264
258
  // we look for corrID to be able to match request and response
265
259
  var match = callMatch.match(correlationIdRegex);
266
- var corrId = (_match = match) === null || _match === void 0 ? void 0 : _match[1];
260
+ var corrId = match === null || match === void 0 ? void 0 : match[1];
267
261
  if (!corrId) {
268
262
  // without correlationId it will be impossible to match the response with the request
269
263
  return "continue";
@@ -309,7 +303,6 @@ import { SequentialMockAdapter } from "./sequential-mock-adapter";
309
303
  }
310
304
  /**
311
305
  * Build the actual mock map corresponding to these alfCalls
312
- *
313
306
  * @param log Content of the alf logs
314
307
  * @param operationAdapter operation adapter to bind each request/response with its operationId
315
308
  * @returns mock map, key is the operation id, value is an array of the API replies
@@ -332,7 +325,6 @@ import { SequentialMockAdapter } from "./sequential-mock-adapter";
332
325
  }
333
326
  /**
334
327
  * Get the mock adapter corresponding to the logs retrieved from ALF
335
- *
336
328
  * @param binFilePath the path to the file containing the logs downloaded from Alf in .bin format
337
329
  * @param operationAdapter an array of PathObject or a function that returns an array of PathObject or a Promise that resolves to an array of PathObject, to map request with their operationId
338
330
  * @returns a sequential mock adapter containing each response found in Alf
@@ -186,18 +186,6 @@ import { getOperationId, getPath } from "./helpers";
186
186
  return id;
187
187
  }
188
188
  },
189
- {
190
- key: "getOperationId",
191
- value: /**
192
- * @inheritDoc
193
- */ function getOperationId(request) {
194
- if (typeof this.pathObjects === "function") {
195
- throw new Error("The pathObjects argument must be of type PathObject[]");
196
- }
197
- var object = getPath(request.basePath, this.pathObjects, request.method);
198
- return this.extractOperationIdFromPath(request, object);
199
- }
200
- },
201
189
  {
202
190
  key: "retrieveOperationId",
203
191
  value: /**
@@ -1 +1,3 @@
1
- export { };
1
+ /**
2
+ * Defines an API request encoded
3
+ */ export { };
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Gets an operation ID from a path object and HTTP method
3
- *
4
3
  * @param pathObject the path object to check on
5
4
  * @param method the HTTP method
6
5
  */ export function getOperationId(pathObject, method) {
@@ -15,7 +14,6 @@
15
14
  }
16
15
  /**
17
16
  * Gets a PathObject from a requested URL
18
- *
19
17
  * @param requestUrl the URL string
20
18
  * @param pathObjects the list of available path objects
21
19
  * @param method the optional HTTP method used in case of several matches
@@ -1 +1 @@
1
- export { };
1
+ /** Describes an adapter for mocking */ export { };
@@ -1 +1 @@
1
- export { };
1
+ /** Describes a path on the swagger specification */ export { };
@@ -88,13 +88,13 @@ function _ts_generator(thisArg, body) {
88
88
  trys: [],
89
89
  ops: []
90
90
  };
91
- return(g = {
91
+ return g = {
92
92
  next: verb(0),
93
93
  "throw": verb(1),
94
94
  "return": verb(2)
95
95
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
96
96
  return this;
97
- }), g);
97
+ }), g;
98
98
  function verb(n) {
99
99
  return function(v) {
100
100
  return step([
@@ -176,7 +176,6 @@ function _ts_generator(thisArg, body) {
176
176
  /**
177
177
  * Check if the value is a string or undefined.
178
178
  * Used to determine the request body type at runtime.
179
- *
180
179
  * @param value
181
180
  */ export function isStringOrUndefined(value) {
182
181
  var type = typeof value === "undefined" ? "undefined" : _type_of(value);
@@ -69,13 +69,13 @@ function _ts_generator(thisArg, body) {
69
69
  trys: [],
70
70
  ops: []
71
71
  };
72
- return(g = {
72
+ return g = {
73
73
  next: verb(0),
74
74
  "throw": verb(1),
75
75
  "return": verb(2)
76
76
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
77
77
  return this;
78
- }), g);
78
+ }), g;
79
79
  function verb(n) {
80
80
  return function(v) {
81
81
  return step([
@@ -157,7 +157,6 @@ function _ts_generator(thisArg, body) {
157
157
  /**
158
158
  * The purpose of this plugin is to allow to send an encrypted JWT which overrides the configuration used by Digital Commerce.
159
159
  * The plugin takes an already encoded JWT (JWS) and add it in an instance of `ama-client-facts` header.
160
- *
161
160
  * @note this is the default value for the header name. It can be customized at plugin initialization time.
162
161
  */ export var ApiConfigurationOverride = /*#__PURE__*/ function() {
163
162
  "use strict";
@@ -69,13 +69,13 @@ function _ts_generator(thisArg, body) {
69
69
  trys: [],
70
70
  ops: []
71
71
  };
72
- return(g = {
72
+ return g = {
73
73
  next: verb(0),
74
74
  "throw": verb(1),
75
75
  "return": verb(2)
76
76
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
77
77
  return this;
78
- }), g);
78
+ }), g;
79
79
  function verb(n) {
80
80
  return function(v) {
81
81
  return step([
@@ -69,13 +69,13 @@ function _ts_generator(thisArg, body) {
69
69
  trys: [],
70
70
  ops: []
71
71
  };
72
- return(g = {
72
+ return g = {
73
73
  next: verb(0),
74
74
  "throw": verb(1),
75
75
  "return": verb(2)
76
76
  }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
77
77
  return this;
78
- }), g);
78
+ }), g;
79
79
  function verb(n) {
80
80
  return function(v) {
81
81
  return step([
@@ -154,29 +154,10 @@ function _ts_generator(thisArg, body) {
154
154
  };
155
155
  }
156
156
  }
157
- /**
158
- * Implementation of a retriever based on a cookie.
159
- * Creates a reused RegExp based on the cookieName and tries to extract its value from document.cookie.
160
- *
161
- * @param cookieName Name of the cookie to search for
162
- * @deprecated Imperva integration should rely on the latest impervaProtectionRetrieverFactory
163
- */ export function cookieRetrieverFactory(cookieName) {
164
- var cookieRegExp = new RegExp("(?:^|;)\\s*".concat(cookieName, "\\s*=\\s*([^;]+)"));
165
- return function() {
166
- if (typeof document === "undefined") {
167
- throw new Error('[SDK][Plug-in][BotProtectionFingerprintRequest] Trying to use cookieRetrieverFactory but "document" is not defined.');
168
- }
169
- var cookieMatcher = document.cookie && document.cookie.match(cookieRegExp);
170
- if (cookieMatcher) {
171
- return cookieMatcher[cookieMatcher.length - 1];
172
- }
173
- };
174
- }
175
157
  /**
176
158
  * Implementation based on Imperva's SPA integration feature developed for Amadeus.
177
159
  * This relies on a custom window property protectionLoaded that we feed with a callback that Imperva calls when the ABP script is loaded or when the callback is attached.
178
160
  * This callback is called with the Protection object used internally by the ABP that exposes a __token()__ function that returns a Promise of the most up-to-date token.
179
- *
180
161
  * @param protectionTimeout How long the retrieve will wait for the onProtectionLoaded event to be fired
181
162
  * @param tokenTimeout How long the ABP script will wait for a new token before rejecting the promise
182
163
  */ export function impervaProtectionRetrieverFactory(protectionTimeout, tokenTimeout) {
@@ -196,73 +177,77 @@ function _ts_generator(thisArg, body) {
196
177
  };
197
178
  });
198
179
  };
199
- return /*#__PURE__*/ _async_to_generator(function() {
200
- var e, e1;
201
- return _ts_generator(this, function(_state) {
202
- switch(_state.label){
203
- case 0:
204
- if (!!protection) return [
205
- 3,
206
- 4
207
- ];
208
- _state.label = 1;
209
- case 1:
210
- _state.trys.push([
211
- 1,
212
- 3,
213
- ,
214
- 4
215
- ]);
216
- return [
217
- 4,
218
- getProtection()
219
- ];
220
- case 2:
221
- protection = _state.sent();
222
- return [
223
- 3,
224
- 4
225
- ];
226
- case 3:
227
- e = _state.sent();
228
- console.warn(e);
229
- return [
230
- 2
231
- ];
232
- case 4:
233
- _state.trys.push([
234
- 4,
235
- 6,
236
- ,
237
- 7
238
- ]);
239
- return [
240
- 4,
241
- protection.token(tokenTimeout)
242
- ];
243
- case 5:
244
- return [
245
- 2,
246
- _state.sent()
247
- ];
248
- case 6:
249
- e1 = _state.sent();
250
- console.warn("[SDK][Plug-in][BotProtectionFingerprintRequest] Timeout: no Token was received in time.");
251
- return [
252
- 2
253
- ];
254
- case 7:
255
- return [
256
- 2
257
- ];
258
- }
180
+ return function() {
181
+ var _ref = _async_to_generator(function(logger) {
182
+ var e, e1;
183
+ return _ts_generator(this, function(_state) {
184
+ switch(_state.label){
185
+ case 0:
186
+ if (!!protection) return [
187
+ 3,
188
+ 4
189
+ ];
190
+ _state.label = 1;
191
+ case 1:
192
+ _state.trys.push([
193
+ 1,
194
+ 3,
195
+ ,
196
+ 4
197
+ ]);
198
+ return [
199
+ 4,
200
+ getProtection()
201
+ ];
202
+ case 2:
203
+ protection = _state.sent();
204
+ return [
205
+ 3,
206
+ 4
207
+ ];
208
+ case 3:
209
+ e = _state.sent();
210
+ (logger || console).error(e);
211
+ return [
212
+ 2
213
+ ];
214
+ case 4:
215
+ _state.trys.push([
216
+ 4,
217
+ 6,
218
+ ,
219
+ 7
220
+ ]);
221
+ return [
222
+ 4,
223
+ protection.token(tokenTimeout)
224
+ ];
225
+ case 5:
226
+ return [
227
+ 2,
228
+ _state.sent()
229
+ ];
230
+ case 6:
231
+ e1 = _state.sent();
232
+ (logger || console).error("[SDK][Plug-in][BotProtectionFingerprintRequest] Timeout: no Token was received in time.");
233
+ return [
234
+ 2
235
+ ];
236
+ case 7:
237
+ return [
238
+ 2
239
+ ];
240
+ }
241
+ });
259
242
  });
260
- });
243
+ return function(logger) {
244
+ return _ref.apply(this, arguments);
245
+ };
246
+ }();
261
247
  }
262
248
  /**
263
249
  * Implementation of a retriever for Akamai based on bmak object from window or as parameter.
264
250
  * Will return the telemetry, or undefined if bmak object is not found
265
- *
266
251
  * @param bmakOpt BMak object from Akamai. Default to `window.bmak` on browser if not provided.
267
252
  */ export function akamaiTelemetryRetrieverFactory(bmakOpt) {
268
253
  var bmak = bmakOpt || (typeof window !== "undefined" ? window.bmak : undefined);
@@ -273,37 +258,15 @@ function _ts_generator(thisArg, body) {
273
258
  return bmak.get_telemetry();
274
259
  };
275
260
  }
276
- /**
277
- * Implementation of a retriever based on the way Imperva stores the fingerprint information in localStorage.
278
- * Since it contains the expiry time of the fingerprint we are able to ignore it if it has to be recomputed.
279
- *
280
- * @param storageKey The name of the property in local storage where the fingerprint is saved
281
- * @param ignoreExpired Return the fingerprint even if it is expired. Default: false
282
- * @deprecated Imperva integration should rely on the latest impervaProtectionRetrieverFactory
283
- */ export function impervaLocalStorageRetrieverFactory(storageKey) {
284
- var ignoreExpired = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
285
- return function() {
286
- if (typeof localStorage === "undefined") {
287
- throw new Error("[SDK][Plug-in][BotProtectionFingerprintRequest] Trying to use localStorageRetrieverFactory but localStorage is not defined.");
288
- }
289
- var storedFingerprint = localStorage.getItem(storageKey);
290
- try {
291
- var parsedFingerprint = storedFingerprint && JSON.parse(storedFingerprint);
292
- if (parsedFingerprint && (ignoreExpired || parsedFingerprint.renewTime && parsedFingerprint.renewTime >= Date.now())) {
293
- return parsedFingerprint.token;
294
- }
295
- } catch (e) {}
296
- };
297
- }
298
261
  /**
299
262
  * Plug-in that allows to interact with Anti-Bot protection tools fingerprint like following:
300
- * - Wait for the fingerprint to be present in the document before sending any call
301
- * - Forward the fingerprint in a chosen request header with all the calls
263
+ * - Wait for the fingerprint to be present in the document before sending any call
264
+ * - Forward the fingerprint in a chosen request header with all the calls
302
265
  *
303
266
  * This plugin is modular and must be instantiated with the logic that retrieves the fingerprint value, also called {@link BotProtectionFingerprintRetriever}.
304
267
  * This file exports two factories of {@link BotProtectionFingerprintRetriever} to cover our two most common usecases:
305
- * - Imperva ABP
306
- * - Akamai telemetry
268
+ * - Imperva ABP
269
+ * - Akamai telemetry
307
270
  * But you can also provide your own logic.
308
271
  *
309
272
  * In case this logic is unpredictable or subject to race conditions, you can configure a poller that will retry a maximum of N times every X milliseconds.
@@ -315,9 +278,8 @@ function _ts_generator(thisArg, body) {
315
278
  * authentication calls also contain the fingerprint.
316
279
  * You can reuse the same instance that you give to the SDK, or create a simpler instance without a poller in case you
317
280
  * make sure to load this plug-in before the AmadeusGatewayTokenRequestPlugin.
318
- *
319
281
  * @example Reusing the same instance
320
- *
282
+ * ```typescript
321
283
  * export function apiFactory(eventTrackService: EventTrackService): ApiManager {
322
284
  * const botProtection = new BotProtectionFingerprintRequest({
323
285
  * destinationHeaderName: 'X-D-Token',
@@ -343,18 +305,22 @@ function _ts_generator(thisArg, body) {
343
305
  * LoggingApi: {basePath: '/api'}
344
306
  * });
345
307
  * }
308
+ * ```
346
309
  * @example Using a custom FingerprintRetriever
347
- *
310
+ * ```typescript
348
311
  * const botProtection = new BotProtectionFingerprintRequest({
349
312
  * destinationHeaderName: 'X-D-Token',
350
313
  * fingerprintRetriever: () => 'test'
351
314
  * });
352
- * @example For akamai
315
+ * ```
353
316
  *
317
+ * @example For akamai
318
+ * ```typescript
354
319
  * const botProtection = new BotProtectionFingerprintRequest({
355
320
  * destinationHeaderName: 'Akamai-BM-Telemetry',
356
321
  * fingerprintRetriever: akamaiTelemetryRetrieverFactory()
357
322
  * });
323
+ * ```
358
324
  */ export var BotProtectionFingerprintRequest = /*#__PURE__*/ function() {
359
325
  "use strict";
360
326
  function BotProtectionFingerprintRequest(options) {
@@ -375,7 +341,7 @@ function _ts_generator(thisArg, body) {
375
341
  * configured in the BotProtectionFingerprintPollerOptions.
376
342
  *
377
343
  * If pollOnlyOnce is set to true, the poller won't be executed again after it has been fully executed once.
378
- */ function waitForFingerprint() {
344
+ */ function waitForFingerprint(logger) {
379
345
  var _this = this;
380
346
  return _async_to_generator(function() {
381
347
  var pollerOptions, i, fingerprint;
@@ -386,7 +352,7 @@ function _ts_generator(thisArg, body) {
386
352
  if (pollerOptions === undefined || _this.options.pollOnlyOnce !== false && _this.hasPolled) {
387
353
  return [
388
354
  2,
389
- _this.options.fingerprintRetriever()
355
+ _this.options.fingerprintRetriever(logger)
390
356
  ];
391
357
  }
392
358
  i = pollerOptions.maximumTries - 1;
@@ -398,7 +364,7 @@ function _ts_generator(thisArg, body) {
398
364
  ];
399
365
  return [
400
366
  4,
401
- _this.options.fingerprintRetriever()
367
+ _this.options.fingerprintRetriever(logger)
402
368
  ];
403
369
  case 2:
404
370
  fingerprint = _state.sent();
@@ -440,7 +406,7 @@ function _ts_generator(thisArg, body) {
440
406
  },
441
407
  {
442
408
  key: "load",
443
- value: function load() {
409
+ value: /** @inheritdoc */ function load(context) {
444
410
  var _this = this;
445
411
  return {
446
412
  transform: function() {
@@ -451,7 +417,7 @@ function _ts_generator(thisArg, body) {
451
417
  case 0:
452
418
  return [
453
419
  4,
454
- _this.waitForFingerprint()
420
+ _this.waitForFingerprint(context === null || context === void 0 ? void 0 : context.logger)
455
421
  ];
456
422
  case 1:
457
423
  fingerprint = _state.sent();