@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
@@ -1,275 +0,0 @@
1
- /* eslint-disable no-redeclare */ /* eslint-disable camelcase, @typescript-eslint/naming-convention */ "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- reviveResponse: function() {
13
- return reviveResponse;
14
- },
15
- Oauth2Api: function() {
16
- return Oauth2Api;
17
- }
18
- });
19
- var _index = require("../../fwk/index");
20
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
21
- try {
22
- var info = gen[key](arg);
23
- var value = info.value;
24
- } catch (error) {
25
- reject(error);
26
- return;
27
- }
28
- if (info.done) {
29
- resolve(value);
30
- } else {
31
- Promise.resolve(value).then(_next, _throw);
32
- }
33
- }
34
- function _async_to_generator(fn) {
35
- return function() {
36
- var self = this, args = arguments;
37
- return new Promise(function(resolve, reject) {
38
- var gen = fn.apply(self, args);
39
- function _next(value) {
40
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
41
- }
42
- function _throw(err) {
43
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
44
- }
45
- _next(undefined);
46
- });
47
- };
48
- }
49
- function _class_call_check(instance, Constructor) {
50
- if (!(instance instanceof Constructor)) {
51
- throw new TypeError("Cannot call a class as a function");
52
- }
53
- }
54
- function _defineProperties(target, props) {
55
- for(var i = 0; i < props.length; i++){
56
- var descriptor = props[i];
57
- descriptor.enumerable = descriptor.enumerable || false;
58
- descriptor.configurable = true;
59
- if ("value" in descriptor) descriptor.writable = true;
60
- Object.defineProperty(target, descriptor.key, descriptor);
61
- }
62
- }
63
- function _create_class(Constructor, protoProps, staticProps) {
64
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
65
- if (staticProps) _defineProperties(Constructor, staticProps);
66
- return Constructor;
67
- }
68
- function _define_property(obj, key, value) {
69
- if (key in obj) {
70
- Object.defineProperty(obj, key, {
71
- value: value,
72
- enumerable: true,
73
- configurable: true,
74
- writable: true
75
- });
76
- } else {
77
- obj[key] = value;
78
- }
79
- return obj;
80
- }
81
- function _ts_generator(thisArg, body) {
82
- var f, y, t, g, _ = {
83
- label: 0,
84
- sent: function() {
85
- if (t[0] & 1) throw t[1];
86
- return t[1];
87
- },
88
- trys: [],
89
- ops: []
90
- };
91
- return g = {
92
- next: verb(0),
93
- "throw": verb(1),
94
- "return": verb(2)
95
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
96
- return this;
97
- }), g;
98
- function verb(n) {
99
- return function(v) {
100
- return step([
101
- n,
102
- v
103
- ]);
104
- };
105
- }
106
- function step(op) {
107
- if (f) throw new TypeError("Generator is already executing.");
108
- while(_)try {
109
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
110
- if (y = 0, t) op = [
111
- op[0] & 2,
112
- t.value
113
- ];
114
- switch(op[0]){
115
- case 0:
116
- case 1:
117
- t = op;
118
- break;
119
- case 4:
120
- _.label++;
121
- return {
122
- value: op[1],
123
- done: false
124
- };
125
- case 5:
126
- _.label++;
127
- y = op[1];
128
- op = [
129
- 0
130
- ];
131
- continue;
132
- case 7:
133
- op = _.ops.pop();
134
- _.trys.pop();
135
- continue;
136
- default:
137
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
138
- _ = 0;
139
- continue;
140
- }
141
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
142
- _.label = op[1];
143
- break;
144
- }
145
- if (op[0] === 6 && _.label < t[1]) {
146
- _.label = t[1];
147
- t = op;
148
- break;
149
- }
150
- if (t && _.label < t[2]) {
151
- _.label = t[2];
152
- _.ops.push(op);
153
- break;
154
- }
155
- if (t[2]) _.ops.pop();
156
- _.trys.pop();
157
- continue;
158
- }
159
- op = body.call(thisArg, _);
160
- } catch (e) {
161
- op = [
162
- 6,
163
- e
164
- ];
165
- y = 0;
166
- } finally{
167
- f = t = 0;
168
- }
169
- if (op[0] & 5) throw op[1];
170
- return {
171
- value: op[0] ? op[1] : void 0,
172
- done: true
173
- };
174
- }
175
- }
176
- function reviveResponse(data, _dictionaries) {
177
- if (!data) {
178
- return;
179
- }
180
- return data;
181
- }
182
- var Oauth2Api = /*#__PURE__*/ function() {
183
- "use strict";
184
- function Oauth2Api(apiClient) {
185
- _class_call_check(this, Oauth2Api);
186
- /** @inheritdoc */ _define_property(this, "apiName", Oauth2Api.apiName);
187
- /** @inheritDoc */ _define_property(this, "client", void 0);
188
- this.client = apiClient;
189
- }
190
- _create_class(Oauth2Api, [
191
- {
192
- key: "getAccessTokenInfo",
193
- value: /**
194
- * Retrieve information about a given access token generated using the POST /token operation
195
- * Operation to get information (ie time before expiration, type, status, etc.) about a given access_token generated via the POST /tokens operation.
196
- * The HTTP method to use is GET. All other HTTP methods are forbidden and an exception (ie error 405: Invalid HTTP method) is raised.
197
- * The path parameter to give is a valid access token (this access token can be revoked or expired but need to be created at least).
198
- * If this token is invalid, an exception is raised (ie error 404: Resource not found).
199
- *
200
- * @param data Data to provide to the API call
201
- */ function getAccessTokenInfo(data) {
202
- var _this = this;
203
- return _async_to_generator(function() {
204
- var getParams, headers, basePathUrl, options, url, ret;
205
- return _ts_generator(this, function(_state) {
206
- switch(_state.label){
207
- case 0:
208
- getParams = _this.client.extractQueryParams(data, []);
209
- headers = {};
210
- basePathUrl = "".concat(_this.client.options.basePath, "/token/").concat(data.access_token);
211
- return [
212
- 4,
213
- _this.client.prepareOptions(basePathUrl, "GET", getParams, headers, undefined)
214
- ];
215
- case 1:
216
- options = _state.sent();
217
- url = _this.client.prepareUrl(options.basePath, options.queryParams);
218
- ret = _this.client.processCall(url, options, _index.ApiTypes.DEFAULT, Oauth2Api.apiName, reviveResponse);
219
- return [
220
- 2,
221
- ret
222
- ];
223
- }
224
- });
225
- })();
226
- }
227
- },
228
- {
229
- key: "postAccessToken",
230
- value: /**
231
- * Generate a temporary access token which makes the user able to pass throught authentication policy and consume Amadeus resources in a secure way
232
- * Operation to generate an access token in order to pass throught authentication and then consume Amadeus resources in a secure way.
233
- * The HTTP method to use is POST. All other HTTP methods are forbidden and an exception (ie error 405: Invalid HTTP method) is raised.
234
- * A given body using the x-www-form-urlencoded format is madatory. In this body, client_id (id of the app), client_secret (secret of the app)
235
- * and grant_type are mandatory. If one of these parameters are missing or invalid, an exception (ie error 401: Invalid parameters) is raised.
236
- * The value for grant_type parameter is unique: client_credentials. All others values will raise an exception (ie error 400: Invalid parameters).
237
- *
238
- * @param data Data to provide to the API call
239
- */ function postAccessToken(data) {
240
- var _this = this;
241
- return _async_to_generator(function() {
242
- var getParams, headers, body, basePathUrl, options, url, ret;
243
- return _ts_generator(this, function(_state) {
244
- switch(_state.label){
245
- case 0:
246
- getParams = _this.client.extractQueryParams(data, []);
247
- headers = {
248
- "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
249
- };
250
- body = "".concat(encodeURIComponent("client_id"), "=").concat(encodeURIComponent(data.bodyToProvide.client_id), "&").concat(encodeURIComponent("client_secret"), "=").concat(encodeURIComponent(data.bodyToProvide.client_secret), "&").concat(encodeURIComponent("grant_type"), "=").concat(encodeURIComponent(data.bodyToProvide.grant_type));
251
- if (data.bodyToProvide.guest_office_id) {
252
- body = "".concat(body, "&").concat(encodeURIComponent("guest_office_id"), "=").concat(encodeURIComponent(data.bodyToProvide.guest_office_id));
253
- }
254
- basePathUrl = "".concat(_this.client.options.basePath, "/token");
255
- return [
256
- 4,
257
- _this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || undefined)
258
- ];
259
- case 1:
260
- options = _state.sent();
261
- url = _this.client.prepareUrl(options.basePath, options.queryParams);
262
- ret = _this.client.processCall(url, options, _index.ApiTypes.DEFAULT, Oauth2Api.apiName, reviveResponse);
263
- return [
264
- 2,
265
- ret
266
- ];
267
- }
268
- });
269
- })();
270
- }
271
- }
272
- ]);
273
- return Oauth2Api;
274
- }();
275
- /** Gateway authentication api name */ _define_property(Oauth2Api, "apiName", "Oauth2Api");
@@ -1,388 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "GatewayTokenRequestPlugin", {
6
- enumerable: true,
7
- get: function() {
8
- return GatewayTokenRequestPlugin;
9
- }
10
- });
11
- var _clients = require("../../clients");
12
- var _additionalparams = require("../additional-params");
13
- var _exception = require("../exception");
14
- var _fetchcredentials = require("../fetch-credentials");
15
- var _gatewayauthentication = require("./gateway-authentication");
16
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17
- try {
18
- var info = gen[key](arg);
19
- var value = info.value;
20
- } catch (error) {
21
- reject(error);
22
- return;
23
- }
24
- if (info.done) {
25
- resolve(value);
26
- } else {
27
- Promise.resolve(value).then(_next, _throw);
28
- }
29
- }
30
- function _async_to_generator(fn) {
31
- return function() {
32
- var self = this, args = arguments;
33
- return new Promise(function(resolve, reject) {
34
- var gen = fn.apply(self, args);
35
- function _next(value) {
36
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
37
- }
38
- function _throw(err) {
39
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
40
- }
41
- _next(undefined);
42
- });
43
- };
44
- }
45
- function _class_call_check(instance, Constructor) {
46
- if (!(instance instanceof Constructor)) {
47
- throw new TypeError("Cannot call a class as a function");
48
- }
49
- }
50
- function _defineProperties(target, props) {
51
- for(var i = 0; i < props.length; i++){
52
- var descriptor = props[i];
53
- descriptor.enumerable = descriptor.enumerable || false;
54
- descriptor.configurable = true;
55
- if ("value" in descriptor) descriptor.writable = true;
56
- Object.defineProperty(target, descriptor.key, descriptor);
57
- }
58
- }
59
- function _create_class(Constructor, protoProps, staticProps) {
60
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
61
- if (staticProps) _defineProperties(Constructor, staticProps);
62
- return Constructor;
63
- }
64
- function _define_property(obj, key, value) {
65
- if (key in obj) {
66
- Object.defineProperty(obj, key, {
67
- value: value,
68
- enumerable: true,
69
- configurable: true,
70
- writable: true
71
- });
72
- } else {
73
- obj[key] = value;
74
- }
75
- return obj;
76
- }
77
- function _ts_generator(thisArg, body) {
78
- var f, y, t, g, _ = {
79
- label: 0,
80
- sent: function() {
81
- if (t[0] & 1) throw t[1];
82
- return t[1];
83
- },
84
- trys: [],
85
- ops: []
86
- };
87
- return(g = {
88
- next: verb(0),
89
- "throw": verb(1),
90
- "return": verb(2)
91
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
92
- return this;
93
- }), g);
94
- function verb(n) {
95
- return function(v) {
96
- return step([
97
- n,
98
- v
99
- ]);
100
- };
101
- }
102
- function step(op) {
103
- if (f) throw new TypeError("Generator is already executing.");
104
- while(_)try {
105
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
106
- if (y = 0, t) op = [
107
- op[0] & 2,
108
- t.value
109
- ];
110
- switch(op[0]){
111
- case 0:
112
- case 1:
113
- t = op;
114
- break;
115
- case 4:
116
- _.label++;
117
- return {
118
- value: op[1],
119
- done: false
120
- };
121
- case 5:
122
- _.label++;
123
- y = op[1];
124
- op = [
125
- 0
126
- ];
127
- continue;
128
- case 7:
129
- op = _.ops.pop();
130
- _.trys.pop();
131
- continue;
132
- default:
133
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
134
- _ = 0;
135
- continue;
136
- }
137
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
138
- _.label = op[1];
139
- break;
140
- }
141
- if (op[0] === 6 && _.label < t[1]) {
142
- _.label = t[1];
143
- t = op;
144
- break;
145
- }
146
- if (t && _.label < t[2]) {
147
- _.label = t[2];
148
- _.ops.push(op);
149
- break;
150
- }
151
- if (t[2]) _.ops.pop();
152
- _.trys.pop();
153
- continue;
154
- }
155
- op = body.call(thisArg, _);
156
- } catch (e) {
157
- op = [
158
- 6,
159
- e
160
- ];
161
- y = 0;
162
- } finally{
163
- f = t = 0;
164
- }
165
- if (op[0] & 5) throw op[1];
166
- return {
167
- value: op[0] ? op[1] : void 0,
168
- done: true
169
- };
170
- }
171
- }
172
- var GatewayTokenRequestPlugin = /*#__PURE__*/ function() {
173
- "use strict";
174
- function GatewayTokenRequestPlugin(gatewayUrl, gatewayClientId, gatewayClientPrivate, basePath, guestOfficeId) {
175
- var storageTokenKey = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "gateway-auth-tokens";
176
- _class_call_check(this, GatewayTokenRequestPlugin);
177
- _define_property(this, "storageTokenKey", void 0);
178
- /**
179
- * Default expiration time on the token in seconds
180
- * Corresponds to 8 hours
181
- */ _define_property(this, "DEFAULT_EXPIRATION_TIME_S", void 0);
182
- /**
183
- * Buffer time in milliseconds. Allows to regenerate a new token before the expiration of the token.
184
- * Corresponds to 5 minutes
185
- */ _define_property(this, "EXPIRATION_TIME_BUFFER_MS", void 0);
186
- /**
187
- * Promise of gateway URL
188
- */ _define_property(this, "gatewayUrl", void 0);
189
- /**
190
- * Promise of gateway client id
191
- */ _define_property(this, "gatewayClientId", void 0);
192
- /**
193
- * Promise of gateway client secret
194
- */ _define_property(this, "gatewayClientPrivate", void 0);
195
- /**
196
- * guestOfficeId is either a method to be ran before each call to the Api Gateway to determine what is the guest
197
- * office ID to be used, or a Promise of office ID
198
- */ _define_property(this, "guestOfficeId", void 0);
199
- /**
200
- * Promise of the gateway call
201
- */ _define_property(this, "gatewayCallPromise", void 0);
202
- /** API Client */ _define_property(this, "apiClient", void 0);
203
- this.storageTokenKey = storageTokenKey;
204
- this.DEFAULT_EXPIRATION_TIME_S = 28800;
205
- this.EXPIRATION_TIME_BUFFER_MS = 300000;
206
- this.gatewayUrl = Promise.resolve(gatewayUrl);
207
- this.gatewayClientId = Promise.resolve(gatewayClientId);
208
- this.gatewayClientPrivate = Promise.resolve(gatewayClientPrivate);
209
- this.guestOfficeId = guestOfficeId;
210
- this.apiClient = new _clients.ApiFetchClient({
211
- requestPlugins: [
212
- new _fetchcredentials.FetchCredentialsRequest()
213
- ],
214
- replyPlugins: [
215
- new _exception.ExceptionReply()
216
- ],
217
- basePath: basePath
218
- });
219
- }
220
- _create_class(GatewayTokenRequestPlugin, [
221
- {
222
- key: "getStoreAuthHeader",
223
- value: /**
224
- * Check if the gateway authorization token is stored and include it in the Authorization header.
225
- * If it is not stored yet, a call is triggered to the gateway in order to get this authorization token.
226
- * @param gatewayUrl URL of the gateway
227
- * @param gatewayClientId Client id related to the gateway client configuration
228
- * @param gatewayClientPrivate Client private related to the gateway client configuration
229
- * @param guestOfficeId office ID to be used instead of the default one
230
- * office ID to be used
231
- */ function getStoreAuthHeader(gatewayUrl, gatewayClientId, gatewayClientPrivate, guestOfficeId) {
232
- var _this = this;
233
- return _async_to_generator(function() {
234
- var gatewayApi, storedTokens, storedTokensParsed, officeId, _tmp, key, token, response, e;
235
- return _ts_generator(this, function(_state) {
236
- switch(_state.label){
237
- case 0:
238
- _this.apiClient.options.basePath = gatewayUrl;
239
- gatewayApi = new _gatewayauthentication.Oauth2Api(_this.apiClient);
240
- storedTokens = typeof sessionStorage !== "undefined" ? sessionStorage.getItem(_this.storageTokenKey) : null;
241
- storedTokensParsed = storedTokens ? JSON.parse(storedTokens) : {};
242
- if (!(typeof guestOfficeId === "function")) return [
243
- 3,
244
- 2
245
- ];
246
- return [
247
- 4,
248
- guestOfficeId()
249
- ];
250
- case 1:
251
- _tmp = _state.sent();
252
- return [
253
- 3,
254
- 4
255
- ];
256
- case 2:
257
- return [
258
- 4,
259
- guestOfficeId
260
- ];
261
- case 3:
262
- _tmp = _state.sent();
263
- _state.label = 4;
264
- case 4:
265
- officeId = _tmp;
266
- key = officeId ? "".concat(gatewayClientId, "-").concat(officeId) : "".concat(gatewayClientId, "-default");
267
- token = storedTokensParsed[key];
268
- if (!(!token || Date.now() + _this.EXPIRATION_TIME_BUFFER_MS >= token.expiresAt)) return [
269
- 3,
270
- 8
271
- ];
272
- _state.label = 5;
273
- case 5:
274
- _state.trys.push([
275
- 5,
276
- 7,
277
- ,
278
- 8
279
- ]);
280
- if (!_this.gatewayCallPromise) {
281
- _this.gatewayCallPromise = gatewayApi.postAccessToken({
282
- // eslint-disable-next-line @typescript-eslint/naming-convention, camelcase
283
- bodyToProvide: {
284
- client_id: gatewayClientId,
285
- client_secret: gatewayClientPrivate,
286
- grant_type: "client_credentials",
287
- guest_office_id: officeId
288
- }
289
- });
290
- }
291
- return [
292
- 4,
293
- _this.gatewayCallPromise
294
- ];
295
- case 6:
296
- response = _state.sent();
297
- _this.gatewayCallPromise = undefined;
298
- token = {
299
- token: response.access_token,
300
- expiresAt: Date.now() + (response.expires_in ? response.expires_in : _this.DEFAULT_EXPIRATION_TIME_S) * 1000
301
- };
302
- if (typeof sessionStorage !== "undefined") {
303
- storedTokensParsed[key] = token;
304
- sessionStorage.setItem(_this.storageTokenKey, JSON.stringify(storedTokensParsed));
305
- }
306
- return [
307
- 3,
308
- 8
309
- ];
310
- case 7:
311
- e = _state.sent();
312
- // eslint-disable-next-line no-console
313
- console.error("An error occurred when trying to get the gateway authentication token " + e);
314
- return [
315
- 3,
316
- 8
317
- ];
318
- case 8:
319
- if (token) {
320
- // eslint-disable-next-line @typescript-eslint/naming-convention
321
- return [
322
- 2,
323
- {
324
- Authorization: "Bearer ".concat(token.token)
325
- }
326
- ];
327
- }
328
- return [
329
- 2,
330
- {}
331
- ];
332
- }
333
- });
334
- })();
335
- }
336
- },
337
- {
338
- key: "addGatewayToken",
339
- value: /**
340
- * Check if the gateway authorization token is stored and include it in the Authorization header.
341
- * If it is not stored yet, a call is triggered to the gateway in order to get this authorization token.
342
- * @returns a function that take the actual headers as parameter and return an Promise containing the Authorization header and its value
343
- */ function addGatewayToken() {
344
- var _this = this;
345
- return function() {
346
- var _ref = _async_to_generator(function(_headers) {
347
- var params;
348
- return _ts_generator(this, function(_state) {
349
- switch(_state.label){
350
- case 0:
351
- return [
352
- 4,
353
- Promise.all([
354
- _this.gatewayUrl,
355
- _this.gatewayClientId,
356
- _this.gatewayClientPrivate
357
- ])
358
- ];
359
- case 1:
360
- params = _state.sent();
361
- return [
362
- 2,
363
- _this.getStoreAuthHeader(params[0], params[1], params[2], _this.guestOfficeId)
364
- ];
365
- }
366
- });
367
- });
368
- return function(_headers) {
369
- return _ref.apply(this, arguments);
370
- };
371
- }();
372
- }
373
- },
374
- {
375
- key: "load",
376
- value: /**
377
- * @inheritDoc
378
- */ function load() {
379
- return {
380
- transform: new _additionalparams.AdditionalParamsRequest({
381
- headers: this.addGatewayToken()
382
- }).load().transform
383
- };
384
- }
385
- }
386
- ]);
387
- return GatewayTokenRequestPlugin;
388
- }();