@ama-sdk/core 11.0.0-next.0 → 11.0.0-next.1

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 (268) hide show
  1. package/README.md +4 -1
  2. package/cjs/clients/api-angular-client.js +45 -23
  3. package/cjs/clients/api-beacon-client.js +64 -20
  4. package/cjs/clients/api-fetch-client.js +66 -21
  5. package/cjs/fwk/Reviver.js +7 -7
  6. package/cjs/fwk/api.helper.spec.js +20 -20
  7. package/cjs/fwk/api.helpers.js +14 -14
  8. package/cjs/fwk/core/api-client.js +1 -1
  9. package/cjs/fwk/core/base-api-constructor.js +1 -1
  10. package/cjs/fwk/date.js +9 -9
  11. package/cjs/fwk/date.spec.js +25 -25
  12. package/cjs/fwk/errors.js +3 -3
  13. package/cjs/fwk/mocks/alf-mock-adapter.js +4 -4
  14. package/cjs/fwk/mocks/base-mock-adapter.js +2 -2
  15. package/cjs/fwk/mocks/helpers.js +3 -3
  16. package/cjs/fwk/reviver.spec.js +46 -10
  17. package/cjs/plugins/additional-params/additional-params-sync.request.js +2 -2
  18. package/cjs/plugins/additional-params/additional-params.request.js +3 -3
  19. package/cjs/plugins/additional-params/additional-params.spec.js +30 -30
  20. package/cjs/plugins/api-configuration-override/api-configuration-override.request.js +2 -2
  21. package/cjs/plugins/api-configuration-override/api-configuration-override.spec.js +13 -13
  22. package/cjs/plugins/api-key/api-key.request.js +2 -2
  23. package/cjs/plugins/api-key/api-key.spec.js +11 -11
  24. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +6 -5
  25. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +33 -33
  26. package/cjs/plugins/client-facts/client-facts.request.js +3 -3
  27. package/cjs/plugins/client-facts/client-facts.spec.js +27 -27
  28. package/cjs/plugins/concurrent/concurrent.fetch.js +1 -0
  29. package/cjs/plugins/concurrent/concurrent.spec.js +4 -4
  30. package/cjs/plugins/custom-info/custom-info.spec.js +15 -15
  31. package/cjs/plugins/exception/exception.reply.js +2 -2
  32. package/cjs/plugins/exception/exception.spec.js +15 -15
  33. package/cjs/plugins/fetch-cache/fetch-cache.request.js +4 -4
  34. package/cjs/plugins/fetch-cache/fetch-cache.spec.js +20 -20
  35. package/cjs/plugins/fetch-credentials/fetch-credentials.request.js +1 -1
  36. package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +8 -8
  37. package/cjs/plugins/json-token/json-token.reply.js +5 -5
  38. package/cjs/plugins/json-token/json-token.request.js +4 -4
  39. package/cjs/plugins/json-token/json-token.spec.js +24 -24
  40. package/cjs/plugins/keepalive/keepalive.request.js +2 -2
  41. package/cjs/plugins/keepalive/keepalive.spec.js +4 -4
  42. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +32 -40
  43. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +30 -26
  44. package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +3 -3
  45. package/cjs/plugins/mock-intercept/mock-intercept.interface.js +2 -2
  46. package/cjs/plugins/mock-intercept/mock-intercept.request.js +3 -3
  47. package/cjs/plugins/mock-intercept/mock-intercept.spec.js +28 -28
  48. package/cjs/plugins/perf-metric/perf-metric.fetch.js +1 -1
  49. package/cjs/plugins/perf-metric/perf-metric.probe.spec.js +9 -9
  50. package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +11 -11
  51. package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +94 -94
  52. package/cjs/plugins/raw-response-info/raw-response-info.spec.js +12 -12
  53. package/cjs/plugins/retry/retry.spec.js +20 -20
  54. package/cjs/plugins/reviver/reviver.reply.js +35 -2
  55. package/cjs/plugins/reviver/reviver.spec.js +6 -6
  56. package/cjs/plugins/session-id/session-id.request.js +7 -6
  57. package/cjs/plugins/session-id/session-id.spec.js +13 -13
  58. package/cjs/plugins/si-token/si-token.spec.js +9 -9
  59. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +4 -4
  60. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +44 -44
  61. package/cjs/plugins/timeout/timeout.fetch.js +12 -10
  62. package/cjs/plugins/timeout/timeout.spec.js +13 -13
  63. package/cjs/plugins/url-rewrite/url-rewrite.spec.js +9 -9
  64. package/cjs/plugins/wait-for/wait-for.spec.js +9 -9
  65. package/cjs/utils/crypto.js +14 -14
  66. package/cjs/utils/generic-api.js +253 -0
  67. package/cjs/utils/index.js +1 -0
  68. package/cjs/utils/json-token.js +30 -30
  69. package/cjs/utils/json-token.spec.js +31 -31
  70. package/cli/files-pack.cjs +12 -12
  71. package/cli/files-pack.cjs.map +1 -1
  72. package/esm2015/clients/api-angular-client.js +49 -27
  73. package/esm2015/clients/api-beacon-client.js +65 -21
  74. package/esm2015/clients/api-fetch-client.js +70 -25
  75. package/esm2015/clients/index.js +2 -2
  76. package/esm2015/fwk/Reviver.js +10 -7
  77. package/esm2015/fwk/api.helper.spec.js +21 -21
  78. package/esm2015/fwk/api.helpers.js +14 -14
  79. package/esm2015/fwk/core/api-client.js +1 -1
  80. package/esm2015/fwk/core/base-api-constructor.js +1 -1
  81. package/esm2015/fwk/core/index.js +2 -2
  82. package/esm2015/fwk/date.js +9 -9
  83. package/esm2015/fwk/date.spec.js +26 -26
  84. package/esm2015/fwk/errors.js +3 -3
  85. package/esm2015/fwk/index.js +10 -10
  86. package/esm2015/fwk/mocks/alf-mock-adapter.js +6 -6
  87. package/esm2015/fwk/mocks/base-mock-adapter.js +3 -3
  88. package/esm2015/fwk/mocks/helpers.js +3 -3
  89. package/esm2015/fwk/mocks/index.js +10 -10
  90. package/esm2015/fwk/mocks/random-mock-adapter.js +1 -1
  91. package/esm2015/fwk/mocks/sequential-mock-adapter.js +1 -1
  92. package/esm2015/fwk/reviver.spec.js +47 -11
  93. package/esm2015/plugins/additional-params/additional-params-sync.request.js +3 -3
  94. package/esm2015/plugins/additional-params/additional-params.request.js +3 -3
  95. package/esm2015/plugins/additional-params/additional-params.spec.js +32 -32
  96. package/esm2015/plugins/additional-params/index.js +2 -2
  97. package/esm2015/plugins/api-configuration-override/api-configuration-override.request.js +2 -2
  98. package/esm2015/plugins/api-configuration-override/api-configuration-override.spec.js +14 -14
  99. package/esm2015/plugins/api-configuration-override/index.js +1 -1
  100. package/esm2015/plugins/api-key/api-key.request.js +2 -2
  101. package/esm2015/plugins/api-key/api-key.spec.js +12 -12
  102. package/esm2015/plugins/api-key/index.js +1 -1
  103. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +6 -6
  104. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +34 -34
  105. package/esm2015/plugins/bot-protection-fingerprint/index.js +1 -1
  106. package/esm2015/plugins/client-facts/client-facts.request.js +4 -4
  107. package/esm2015/plugins/client-facts/client-facts.spec.js +28 -28
  108. package/esm2015/plugins/client-facts/index.js +1 -1
  109. package/esm2015/plugins/concurrent/concurrent.fetch.js +1 -0
  110. package/esm2015/plugins/concurrent/concurrent.spec.js +5 -5
  111. package/esm2015/plugins/concurrent/index.js +1 -1
  112. package/esm2015/plugins/core/index.js +4 -4
  113. package/esm2015/plugins/custom-info/custom-info.spec.js +17 -17
  114. package/esm2015/plugins/custom-info/index.js +1 -1
  115. package/esm2015/plugins/exception/exception.reply.js +4 -4
  116. package/esm2015/plugins/exception/exception.spec.js +18 -18
  117. package/esm2015/plugins/exception/index.js +1 -1
  118. package/esm2015/plugins/fetch-cache/fetch-cache.request.js +4 -4
  119. package/esm2015/plugins/fetch-cache/fetch-cache.spec.js +21 -21
  120. package/esm2015/plugins/fetch-cache/index.js +1 -1
  121. package/esm2015/plugins/fetch-credentials/fetch-credentials.request.js +1 -1
  122. package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +9 -9
  123. package/esm2015/plugins/fetch-credentials/index.js +1 -1
  124. package/esm2015/plugins/index.js +25 -25
  125. package/esm2015/plugins/json-token/index.js +2 -2
  126. package/esm2015/plugins/json-token/json-token.reply.js +5 -5
  127. package/esm2015/plugins/json-token/json-token.request.js +4 -4
  128. package/esm2015/plugins/json-token/json-token.spec.js +27 -27
  129. package/esm2015/plugins/keepalive/index.js +1 -1
  130. package/esm2015/plugins/keepalive/keepalive.request.js +2 -2
  131. package/esm2015/plugins/keepalive/keepalive.spec.js +5 -5
  132. package/esm2015/plugins/mgw-mdw-auth/index.js +1 -1
  133. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +34 -42
  134. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +32 -28
  135. package/esm2015/plugins/mock-intercept/index.js +2 -2
  136. package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +5 -5
  137. package/esm2015/plugins/mock-intercept/mock-intercept.interface.js +2 -2
  138. package/esm2015/plugins/mock-intercept/mock-intercept.request.js +4 -4
  139. package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +32 -32
  140. package/esm2015/plugins/perf-metric/index.js +1 -1
  141. package/esm2015/plugins/perf-metric/perf-metric.fetch.js +2 -2
  142. package/esm2015/plugins/perf-metric/perf-metric.probe.spec.js +10 -10
  143. package/esm2015/plugins/pii-tokenizer/index.js +1 -1
  144. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +12 -12
  145. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +96 -96
  146. package/esm2015/plugins/raw-response-info/index.js +1 -1
  147. package/esm2015/plugins/raw-response-info/raw-response-info.spec.js +14 -14
  148. package/esm2015/plugins/retry/index.js +1 -1
  149. package/esm2015/plugins/retry/retry.fetch.js +1 -1
  150. package/esm2015/plugins/retry/retry.spec.js +21 -21
  151. package/esm2015/plugins/reviver/index.js +1 -1
  152. package/esm2015/plugins/reviver/reviver.reply.js +35 -2
  153. package/esm2015/plugins/reviver/reviver.spec.js +8 -8
  154. package/esm2015/plugins/session-id/index.js +1 -1
  155. package/esm2015/plugins/session-id/session-id.request.js +8 -7
  156. package/esm2015/plugins/session-id/session-id.spec.js +14 -14
  157. package/esm2015/plugins/si-token/index.js +1 -1
  158. package/esm2015/plugins/si-token/si-token.request.js +1 -1
  159. package/esm2015/plugins/si-token/si-token.spec.js +10 -10
  160. package/esm2015/plugins/simple-api-key-authentication/index.js +1 -1
  161. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +5 -5
  162. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +46 -46
  163. package/esm2015/plugins/timeout/index.js +1 -1
  164. package/esm2015/plugins/timeout/timeout.fetch.js +13 -11
  165. package/esm2015/plugins/timeout/timeout.spec.js +15 -15
  166. package/esm2015/plugins/url-rewrite/index.js +1 -1
  167. package/esm2015/plugins/url-rewrite/url-rewrite.spec.js +10 -10
  168. package/esm2015/plugins/wait-for/index.js +1 -1
  169. package/esm2015/plugins/wait-for/wait-for.spec.js +10 -10
  170. package/esm2015/public_api.js +4 -4
  171. package/esm2015/utils/crypto.js +15 -15
  172. package/esm2015/utils/generic-api.js +245 -0
  173. package/esm2015/utils/index.js +6 -5
  174. package/esm2015/utils/json-token.js +32 -32
  175. package/esm2015/utils/json-token.spec.js +32 -32
  176. package/package.json +67 -40
  177. package/schematics/ng-add/index.d.ts +4 -2
  178. package/schematics/ng-add/index.d.ts.map +1 -1
  179. package/schematics/ng-add/index.js +58 -40
  180. package/schematics/ng-add/index.js.map +1 -1
  181. package/src/clients/api-angular-client.d.ts +6 -3
  182. package/src/clients/api-angular-client.d.ts.map +1 -1
  183. package/src/clients/api-angular-client.js +31 -16
  184. package/src/clients/api-angular-client.js.map +1 -1
  185. package/src/clients/api-beacon-client.d.ts +7 -5
  186. package/src/clients/api-beacon-client.d.ts.map +1 -1
  187. package/src/clients/api-beacon-client.js +24 -14
  188. package/src/clients/api-beacon-client.js.map +1 -1
  189. package/src/clients/api-fetch-client.d.ts +5 -3
  190. package/src/clients/api-fetch-client.d.ts.map +1 -1
  191. package/src/clients/api-fetch-client.js +26 -14
  192. package/src/clients/api-fetch-client.js.map +1 -1
  193. package/src/fwk/Reviver.d.ts +16 -4
  194. package/src/fwk/Reviver.d.ts.map +1 -1
  195. package/src/fwk/Reviver.js +9 -6
  196. package/src/fwk/Reviver.js.map +1 -1
  197. package/src/fwk/api.helpers.d.ts +1 -1
  198. package/src/fwk/api.helpers.d.ts.map +1 -1
  199. package/src/fwk/api.helpers.js +1 -1
  200. package/src/fwk/api.helpers.js.map +1 -1
  201. package/src/fwk/core/api-client.d.ts +36 -1
  202. package/src/fwk/core/api-client.d.ts.map +1 -1
  203. package/src/fwk/core/api-client.js.map +1 -1
  204. package/src/fwk/date.js.map +1 -1
  205. package/src/fwk/mocks/alf-mock-adapter.js.map +1 -1
  206. package/src/fwk/mocks/base-mock-adapter.js.map +1 -1
  207. package/src/fwk/mocks/helpers.js.map +1 -1
  208. package/src/fwk/mocks/random-mock-adapter.js.map +1 -1
  209. package/src/fwk/mocks/sequential-mock-adapter.js.map +1 -1
  210. package/src/plugins/additional-params/additional-params-sync.request.js.map +1 -1
  211. package/src/plugins/additional-params/additional-params.request.js.map +1 -1
  212. package/src/plugins/api-configuration-override/api-configuration-override.request.js.map +1 -1
  213. package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.d.ts +1 -1
  214. package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.d.ts.map +1 -1
  215. package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +1 -1
  216. package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js.map +1 -1
  217. package/src/plugins/client-facts/client-facts.request.js.map +1 -1
  218. package/src/plugins/concurrent/concurrent.fetch.d.ts.map +1 -1
  219. package/src/plugins/concurrent/concurrent.fetch.js +1 -0
  220. package/src/plugins/concurrent/concurrent.fetch.js.map +1 -1
  221. package/src/plugins/core/plugin.d.ts +6 -1
  222. package/src/plugins/core/plugin.d.ts.map +1 -1
  223. package/src/plugins/core/reply-plugin.d.ts +0 -2
  224. package/src/plugins/core/reply-plugin.d.ts.map +1 -1
  225. package/src/plugins/core/request-plugin.d.ts +2 -0
  226. package/src/plugins/core/request-plugin.d.ts.map +1 -1
  227. package/src/plugins/exception/exception.reply.js.map +1 -1
  228. package/src/plugins/fetch-cache/fetch-cache.request.js.map +1 -1
  229. package/src/plugins/json-token/json-token.reply.js.map +1 -1
  230. package/src/plugins/json-token/json-token.request.js.map +1 -1
  231. package/src/plugins/keepalive/keepalive.request.js.map +1 -1
  232. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.d.ts +2 -2
  233. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.d.ts.map +1 -1
  234. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +26 -28
  235. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js.map +1 -1
  236. package/src/plugins/mock-intercept/mock-intercept.fetch.js.map +1 -1
  237. package/src/plugins/mock-intercept/mock-intercept.request.js.map +1 -1
  238. package/src/plugins/perf-metric/perf-metric.fetch.js.map +1 -1
  239. package/src/plugins/pii-tokenizer/pii-tokenizer.request.d.ts.map +1 -1
  240. package/src/plugins/pii-tokenizer/pii-tokenizer.request.js.map +1 -1
  241. package/src/plugins/raw-response-info/raw-response-info.reply.js.map +1 -1
  242. package/src/plugins/retry/retry.fetch.js.map +1 -1
  243. package/src/plugins/reviver/reviver.reply.d.ts +7 -0
  244. package/src/plugins/reviver/reviver.reply.d.ts.map +1 -1
  245. package/src/plugins/reviver/reviver.reply.js +12 -1
  246. package/src/plugins/reviver/reviver.reply.js.map +1 -1
  247. package/src/plugins/session-id/session-id.request.d.ts +1 -0
  248. package/src/plugins/session-id/session-id.request.d.ts.map +1 -1
  249. package/src/plugins/session-id/session-id.request.js +1 -0
  250. package/src/plugins/session-id/session-id.request.js.map +1 -1
  251. package/src/plugins/si-token/si-token.request.js.map +1 -1
  252. package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js.map +1 -1
  253. package/src/plugins/timeout/timeout.fetch.d.ts.map +1 -1
  254. package/src/plugins/timeout/timeout.fetch.js +2 -0
  255. package/src/plugins/timeout/timeout.fetch.js.map +1 -1
  256. package/src/plugins/wait-for/wait-for.fetch.js.map +1 -1
  257. package/src/utils/crypto.js.map +1 -1
  258. package/src/utils/encoder.js.map +1 -1
  259. package/src/utils/generic-api.d.ts +39 -0
  260. package/src/utils/generic-api.d.ts.map +1 -0
  261. package/src/utils/generic-api.js +43 -0
  262. package/src/utils/generic-api.js.map +1 -0
  263. package/src/utils/index.d.ts +1 -0
  264. package/src/utils/index.d.ts.map +1 -1
  265. package/src/utils/index.js +1 -0
  266. package/src/utils/index.js.map +1 -1
  267. package/src/utils/json-token.d.ts.map +1 -1
  268. package/src/utils/json-token.js.map +1 -1
@@ -108,25 +108,25 @@ function _unsupported_iterable_to_array(o, minLen) {
108
108
  function prepareUrl(url) {
109
109
  var queryParameters = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
110
110
  var queryPart = Object.keys(queryParameters).filter(function(name) {
111
- return typeof queryParameters[name] !== "undefined";
111
+ return typeof queryParameters[name] !== 'undefined';
112
112
  }).map(function(name) {
113
113
  return "".concat(name, "=").concat(queryParameters[name]);
114
- }).join("&");
115
- var paramsPrefix = url.indexOf("?") > -1 ? "&" : "?";
116
- return url + (!queryPart ? "" : paramsPrefix + queryPart);
114
+ }).join('&');
115
+ var paramsPrefix = url.indexOf('?') > -1 ? '&' : '?';
116
+ return url + (!queryPart ? '' : paramsPrefix + queryPart);
117
117
  }
118
118
  function extractQueryParams(data, names) {
119
119
  return names.filter(function(name) {
120
- return typeof data[name] !== "undefined" && data[name] !== null;
120
+ return typeof data[name] !== 'undefined' && data[name] !== null;
121
121
  }).reduce(function(acc, name) {
122
122
  var prop = data[name];
123
- acc[name] = typeof prop.toJSON === "function" ? prop.toJSON() : prop.toString();
123
+ acc[name] = typeof prop.toJSON === 'function' ? prop.toJSON() : prop.toString();
124
124
  return acc;
125
125
  }, {});
126
126
  }
127
127
  function filterUndefinedValues(object) {
128
- return Object.keys(object).filter(function(objectKey) {
129
- return typeof object[objectKey] !== "undefined";
128
+ return !object ? {} : Object.keys(object).filter(function(objectKey) {
129
+ return typeof object[objectKey] !== 'undefined';
130
130
  }).reduce(function(acc, objectKey) {
131
131
  acc[objectKey] = object[objectKey];
132
132
  return acc;
@@ -134,7 +134,7 @@ function filterUndefinedValues(object) {
134
134
  }
135
135
  function processFormData(data, type) {
136
136
  var encodedData;
137
- /* eslint-disable guard-for-in */ if (type === "multipart/form-data") {
137
+ /* eslint-disable guard-for-in */ if (type === 'multipart/form-data') {
138
138
  var formData = new FormData();
139
139
  for(var i in data){
140
140
  formData.append(i, data[i]);
@@ -145,7 +145,7 @@ function processFormData(data, type) {
145
145
  for(var i1 in data){
146
146
  formData1.push("".concat(i1, "=").concat(encodeURIComponent(data[i1])));
147
147
  }
148
- encodedData = formData1.join("&");
148
+ encodedData = formData1.join('&');
149
149
  }
150
150
  /* eslint-enable guard-for-in */ return encodedData;
151
151
  }
@@ -180,12 +180,12 @@ endpoint) {
180
180
  disableFallback: false,
181
181
  log: console.error
182
182
  };
183
- var logPrefix = "API status code error for ".concat(endpoint || "unknown", " endpoint");
183
+ var logPrefix = "API status code error for ".concat(endpoint || 'unknown', " endpoint");
184
184
  var logMsg = options.log || function() {};
185
185
  if (!response || !response.ok) {
186
186
  return undefined;
187
187
  }
188
- if (typeof revivers === "function" || typeof revivers === "undefined") {
188
+ if (typeof revivers === 'function' || typeof revivers === 'undefined') {
189
189
  return revivers;
190
190
  }
191
191
  if (response.status && revivers[response.status]) {
@@ -211,7 +211,7 @@ endpoint) {
211
211
  statusCode: Number.MAX_SAFE_INTEGER,
212
212
  reviver: undefined
213
213
  });
214
- var fallbackLog = Number.MAX_SAFE_INTEGER !== fallback.statusCode ? "Fallback to ".concat(fallback.statusCode, "'s reviver") : "No fallback found";
215
- logMsg("".concat(logPrefix, " - Unknown ").concat(response.status || "undefined", " code returned by the API - ").concat(fallbackLog));
214
+ var fallbackLog = Number.MAX_SAFE_INTEGER !== fallback.statusCode ? "Fallback to ".concat(fallback.statusCode, "'s reviver") : 'No fallback found';
215
+ logMsg("".concat(logPrefix, " - Unknown ").concat(response.status || 'undefined', " code returned by the API - ").concat(fallbackLog));
216
216
  return fallback.reviver;
217
217
  }
@@ -9,5 +9,5 @@ Object.defineProperty(exports, "isApiClient", {
9
9
  }
10
10
  });
11
11
  function isApiClient(client) {
12
- return client && !!client.options && typeof client.extractQueryParams === "function" && typeof client.prepareOptions === "function" && typeof client.prepareUrl === "function" && typeof client.processFormData === "function" && typeof client.processCall === "function";
12
+ return client && !!client.options && typeof client.extractQueryParams === 'function' && typeof client.prepareOptions === 'function' && typeof client.prepareUrl === 'function' && typeof client.processFormData === 'function' && typeof client.processCall === 'function';
13
13
  }
@@ -9,5 +9,5 @@ Object.defineProperty(exports, "isConstructorObject", {
9
9
  }
10
10
  });
11
11
  function isConstructorObject(args) {
12
- return !!args && args.length === 1 && !!args[0] && typeof args[0] === "object";
12
+ return !!args && args.length === 1 && !!args[0] && typeof args[0] === 'object';
13
13
  }
package/cjs/fwk/date.js CHANGED
@@ -189,7 +189,7 @@ var _NativeDateClass = Date;
189
189
  function pad(val) {
190
190
  var digits = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2;
191
191
  var str = "".concat(val);
192
- return "0".repeat(Math.max(0, digits - str.length)) + str;
192
+ return '0'.repeat(Math.max(0, digits - str.length)) + str;
193
193
  }
194
194
  var CommonDate = /*#__PURE__*/ function(Date1) {
195
195
  "use strict";
@@ -201,15 +201,15 @@ var CommonDate = /*#__PURE__*/ function(Date1) {
201
201
  }
202
202
  _class_call_check(this, CommonDate);
203
203
  if (args) {
204
- if (typeof args[0] === "string") {
205
- var idxT = args[0].lastIndexOf("T");
204
+ if (typeof args[0] === 'string') {
205
+ var idxT = args[0].lastIndexOf('T');
206
206
  // TZD = time zone designator (Z or +hh:mm or -hh:mm)
207
- var idx = args[0].lastIndexOf("Z");
207
+ var idx = args[0].lastIndexOf('Z');
208
208
  if (idx < 0) {
209
- idx = args[0].lastIndexOf("+");
209
+ idx = args[0].lastIndexOf('+');
210
210
  }
211
211
  if (idx < 0 && idxT > 0) {
212
- var relativeIdx = args[0].substring(idxT).lastIndexOf("-");
212
+ var relativeIdx = args[0].substring(idxT).lastIndexOf('-');
213
213
  idx = relativeIdx > 0 ? relativeIdx + idxT : relativeIdx;
214
214
  }
215
215
  if (idx > 0) {
@@ -217,7 +217,7 @@ var CommonDate = /*#__PURE__*/ function(Date1) {
217
217
  }
218
218
  var TIME_ZONE_OFFSET = _construct(Date, _to_consumable_array(args)).getTimezoneOffset();
219
219
  if (idxT > 0) {
220
- args[0] += "".concat(TIME_ZONE_OFFSET < 0 ? "+" : "-").concat(pad(Math.floor(Math.abs(TIME_ZONE_OFFSET / 60))), ":").concat(pad(Math.abs(TIME_ZONE_OFFSET % 60)));
220
+ args[0] += "".concat(TIME_ZONE_OFFSET < 0 ? '+' : '-').concat(pad(Math.floor(Math.abs(TIME_ZONE_OFFSET / 60))), ":").concat(pad(Math.abs(TIME_ZONE_OFFSET % 60)));
221
221
  }
222
222
  } else if (_instanceof(args[0], CommonDate)) {
223
223
  args[0] = args[0];
@@ -241,7 +241,7 @@ var CommonDate = /*#__PURE__*/ function(Date1) {
241
241
  }(_wrap_native_super(Date));
242
242
  var utils;
243
243
  (function(utils) {
244
- "use strict";
244
+ 'use strict';
245
245
  var _$Date = /*#__PURE__*/ function(CommonDate) {
246
246
  _inherits(Date1, CommonDate);
247
247
  var _super = _create_super(Date1);
@@ -250,7 +250,7 @@ var utils;
250
250
  args[_key] = arguments[_key];
251
251
  }
252
252
  _class_call_check(this, Date1);
253
- if (args && typeof args[0] === "string" && args[0].lastIndexOf("T") < 0) {
253
+ if (args && typeof args[0] === 'string' && args[0].lastIndexOf('T') < 0) {
254
254
  args[0] = "".concat(args[0], "T00:00:00Z");
255
255
  } else if (_instanceof(args[0], _NativeDateClass)) {
256
256
  args[0] = "".concat(args[0].getFullYear(), "-").concat(pad(args[0].getMonth() + 1), "-").concat(pad(args[0].getDate()), "T00:00:00Z");
@@ -3,50 +3,50 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  var _date = require("./date");
6
- describe("DateTime", function() {
7
- it("should support timestamp", function() {
6
+ describe('DateTime', function() {
7
+ it('should support timestamp', function() {
8
8
  var ts = new Date().getTime();
9
9
  var dateUtils = new _date.utils.DateTime(ts);
10
10
  expect(dateUtils.getTime()).toEqual(ts);
11
11
  });
12
- it("should support DateTime Utils", function() {
12
+ it('should support DateTime Utils', function() {
13
13
  var originalDate = new _date.utils.DateTime(new Date());
14
14
  expect(new _date.utils.DateTime(originalDate)).toEqual(originalDate);
15
15
  });
16
- it("should support a copy constructor", function() {
16
+ it('should support a copy constructor', function() {
17
17
  var originalDate = new _date.utils.DateTime(new Date());
18
18
  expect(new _date.utils.DateTime(originalDate)).toEqual(originalDate);
19
19
  });
20
- it("should support json conversions", function() {
20
+ it('should support json conversions', function() {
21
21
  var originalDate = new _date.utils.DateTime(new Date());
22
22
  var jsonDate = JSON.parse(JSON.stringify(originalDate));
23
23
  expect(new _date.utils.DateTime(jsonDate)).toEqual(originalDate);
24
24
  });
25
- it("should support date without time", function() {
26
- var date1 = "1988-06-07";
25
+ it('should support date without time', function() {
26
+ var date1 = '1988-06-07';
27
27
  var dateCompare = new Date(date1);
28
28
  expect(new _date.utils.DateTime(date1)).toEqual(dateCompare);
29
29
  });
30
- it("should support datetime without timezone", function() {
31
- var date1 = "2015-03-25T12:00:00Z";
32
- var dateCompare = new Date("2015-03-25");
30
+ it('should support datetime without timezone', function() {
31
+ var date1 = '2015-03-25T12:00:00Z';
32
+ var dateCompare = new Date('2015-03-25');
33
33
  dateCompare.setHours(12);
34
34
  dateCompare.setMinutes(0);
35
35
  var dateUtils = new _date.utils.DateTime(date1);
36
36
  expect(dateUtils).toEqual(dateCompare);
37
37
  });
38
- it("should ignore timezone of datetime", function() {
39
- var date1 = "2015-03-25T12:00:00-02:00";
40
- var date2 = "2015-03-25T12:00:00+05:00";
41
- var dateCompare = new Date("2015-03-25T12:00:00Z");
38
+ it('should ignore timezone of datetime', function() {
39
+ var date1 = '2015-03-25T12:00:00-02:00';
40
+ var date2 = '2015-03-25T12:00:00+05:00';
41
+ var dateCompare = new Date('2015-03-25T12:00:00Z');
42
42
  dateCompare.setHours(12);
43
43
  dateCompare.setMinutes(0);
44
44
  expect(new _date.utils.DateTime(date1)).toEqual(dateCompare);
45
45
  expect(new _date.utils.DateTime(date2)).toEqual(dateCompare);
46
46
  });
47
- it("should handle daylight change", function() {
48
- var dateStr1 = "2017-03-23T12:00:00Z";
49
- var dateStr2 = "2017-04-01T12:00:00Z";
47
+ it('should handle daylight change', function() {
48
+ var dateStr1 = '2017-03-23T12:00:00Z';
49
+ var dateStr2 = '2017-04-01T12:00:00Z';
50
50
  var date1 = new _date.utils.DateTime(dateStr1);
51
51
  var date2 = new _date.utils.DateTime(dateStr2);
52
52
  var compareDate1 = new Date(dateStr1);
@@ -54,28 +54,28 @@ describe("DateTime", function() {
54
54
  expect(date1.getTimezoneOffset() - date2.getTimezoneOffset()).toBe(compareDate1.getTimezoneOffset() - compareDate2.getTimezoneOffset());
55
55
  });
56
56
  });
57
- describe("Date", function() {
58
- it("should support timestamp", function() {
57
+ describe('Date', function() {
58
+ it('should support timestamp', function() {
59
59
  var ts = new Date().getTime();
60
60
  var dateUtils = new _date.utils.Date(ts);
61
61
  expect(dateUtils.getTime()).toEqual(ts);
62
62
  });
63
- it("should support Date Utils", function() {
63
+ it('should support Date Utils', function() {
64
64
  var originalDate = new _date.utils.Date(new Date());
65
65
  expect(new _date.utils.Date(originalDate)).toEqual(originalDate);
66
66
  });
67
- it("should support a copy constructor", function() {
67
+ it('should support a copy constructor', function() {
68
68
  var originalDate = new _date.utils.Date(new Date());
69
69
  expect(new _date.utils.Date(originalDate)).toEqual(originalDate);
70
70
  });
71
- it("should support json conversions", function() {
71
+ it('should support json conversions', function() {
72
72
  var originalDate = new _date.utils.Date(new Date());
73
73
  var jsonDate = JSON.parse(JSON.stringify(originalDate));
74
74
  expect(new _date.utils.Date(jsonDate)).toEqual(originalDate);
75
75
  });
76
- it("should be converted to a Js DateTime", function() {
77
- var date1 = "1988-06-07";
78
- var dateCompare = new _date.utils.DateTime("1988-06-07T00:00:00Z");
76
+ it('should be converted to a Js DateTime', function() {
77
+ var date1 = '1988-06-07';
78
+ var dateCompare = new _date.utils.DateTime('1988-06-07T00:00:00Z');
79
79
  expect(new _date.utils.Date(date1)).toEqual(dateCompare);
80
80
  });
81
81
  });
package/cjs/fwk/errors.js CHANGED
@@ -167,9 +167,9 @@ var GenericError = /*#__PURE__*/ function(Error1) {
167
167
  function GenericError(message, context) {
168
168
  _class_call_check(this, GenericError);
169
169
  var httpRegexp = /^https?:\/\//;
170
- var baseUrl = (context === null || context === void 0 ? void 0 : context.url) ? context.url.replace(httpRegexp, "") : "unknown";
171
- var origin = (context === null || context === void 0 ? void 0 : context.origin) ? context.origin.replace(httpRegexp, "") : "unknown";
172
- 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));
170
+ var baseUrl = (context === null || context === void 0 ? void 0 : context.url) ? context.url.replace(httpRegexp, '') : 'unknown';
171
+ var origin = (context === null || context === void 0 ? void 0 : context.origin) ? context.origin.replace(httpRegexp, '') : 'unknown';
172
+ 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));
173
173
  }
174
174
  return GenericError;
175
175
  }(_wrap_native_super(Error));
@@ -220,7 +220,7 @@ function _ts_generator(thisArg, body) {
220
220
  if (match && match[1] && match[2]) {
221
221
  // the match looks like this 1ASIUAIRFAC/v2/shopping/carts/19DXNCKB931CYX3S?refresh=true
222
222
  // so we remove the SAP information at the beginning and URL parameters at the end if any
223
- var requestUrl = match[2].substring(match[2].indexOf("/"), match[2].indexOf("?") > -1 ? match[2].indexOf("?") : match[2].length);
223
+ var requestUrl = match[2].substring(match[2].indexOf('/'), match[2].indexOf('?') > -1 ? match[2].indexOf('?') : match[2].length);
224
224
  var method = match[1];
225
225
  var pathObject = (0, _helpers.getPath)(requestUrl, operationAdapter, method);
226
226
  if (pathObject) {
@@ -247,7 +247,7 @@ function _ts_generator(thisArg, body) {
247
247
  * @returns JSON data that can be either the request or the response
248
248
  */ function getData(log) {
249
249
  var match = log.match(requestResponseJsonRegexp);
250
- return match && match[1] || "";
250
+ return match && match[1] || '';
251
251
  }
252
252
  /**
253
253
  * Retrieve path from logPath and parse it to find all the calls.
@@ -327,7 +327,7 @@ function _ts_generator(thisArg, body) {
327
327
  mockMap[alfCall.operationId] = [];
328
328
  }
329
329
  mockMap[alfCall.operationId].push({
330
- mockData: alfCall.response ? JSON.parse(alfCall.response) : ""
330
+ mockData: alfCall.response ? JSON.parse(alfCall.response) : ''
331
331
  });
332
332
  return mockMap;
333
333
  }, {});
@@ -355,7 +355,7 @@ function getAlfMockAdapter(binFilePath, operationAdapter) {
355
355
  ];
356
356
  case 2:
357
357
  content = _state.sent();
358
- if (!(typeof operationAdapter === "function")) return [
358
+ if (!(typeof operationAdapter === 'function')) return [
359
359
  3,
360
360
  4
361
361
  ];
@@ -174,7 +174,7 @@ var BaseMockAdapter = /*#__PURE__*/ function() {
174
174
  _define_property(this, "mockFactory", void 0);
175
175
  this.pathObjects = pathObjects;
176
176
  this.mocks = {};
177
- if (typeof mockMap !== "function") {
177
+ if (typeof mockMap !== 'function') {
178
178
  this.mocks = mockMap;
179
179
  } else {
180
180
  this.mockFactory = mockMap;
@@ -205,7 +205,7 @@ var BaseMockAdapter = /*#__PURE__*/ function() {
205
205
  return _ts_generator(this, function(_state) {
206
206
  switch(_state.label){
207
207
  case 0:
208
- if (!(typeof _this.pathObjects === "function")) return [
208
+ if (!(typeof _this.pathObjects === 'function')) return [
209
209
  3,
210
210
  2
211
211
  ];
@@ -27,7 +27,7 @@ function getOperationId(pathObject, method) {
27
27
  return operation.operationId || "".concat(pathObject.path, "_").concat(lcMethod);
28
28
  }
29
29
  function getPath(requestUrl, pathObjects, method) {
30
- var pathName = new URL(requestUrl, requestUrl.startsWith("/") ? "http://example.com" : undefined).pathname;
30
+ var pathName = new URL(requestUrl, requestUrl.startsWith('/') ? 'http://example.com' : undefined).pathname;
31
31
  if (!pathName) {
32
32
  throw new Error("Couldn't parse url ".concat(requestUrl));
33
33
  }
@@ -36,7 +36,7 @@ function getPath(requestUrl, pathObjects, method) {
36
36
  if (pathObject.regexp.test(pathName)) {
37
37
  newMatches.push({
38
38
  index: index,
39
- segments: pathObject.path.split("/"),
39
+ segments: pathObject.path.split('/'),
40
40
  methods: pathObject.operations.map(function(operation) {
41
41
  return operation.method;
42
42
  })
@@ -49,7 +49,7 @@ function getPath(requestUrl, pathObjects, method) {
49
49
  while(matches.length > 1){
50
50
  matches = matches.reduce(function(newMatches, match) {
51
51
  var newIndex = match.segments.findIndex(function(segment) {
52
- return segment.startsWith("{") && segment.endsWith("}");
52
+ return segment.startsWith('{') && segment.endsWith('}');
53
53
  }, lastIndex + 1);
54
54
  // Complete static match so use some value that can't be exceeded
55
55
  if (newIndex === -1) {
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  var _Reviver = require("./Reviver");
6
- describe("Revivers :", function() {
7
- it("reviveDictionarizedArray", function() {
6
+ describe('Revivers :', function() {
7
+ it('reviveDictionarizedArray', function() {
8
8
  var dictionary = {
9
9
  id1: {
10
- p1: "v1"
10
+ p1: 'v1'
11
11
  },
12
12
  id2: {
13
- p2: "v2"
13
+ p2: 'v2'
14
14
  }
15
15
  };
16
16
  expect((0, _Reviver.reviveDictionarizedArray)(undefined, {}, function(data) {
@@ -20,8 +20,8 @@ describe("Revivers :", function() {
20
20
  return data;
21
21
  })).toEqual({});
22
22
  expect((0, _Reviver.reviveDictionarizedArray)([
23
- "id1",
24
- "id2"
23
+ 'id1',
24
+ 'id2'
25
25
  ], {}, function(data) {
26
26
  return data;
27
27
  })).toEqual({
@@ -32,16 +32,52 @@ describe("Revivers :", function() {
32
32
  return data;
33
33
  })).toEqual({});
34
34
  var result = (0, _Reviver.reviveDictionarizedArray)([
35
- "id1",
36
- "id2"
35
+ 'id1',
36
+ 'id2'
37
37
  ], dictionary, function(data) {
38
38
  return data;
39
39
  });
40
40
  expect(result.id1).toEqual({
41
- p1: "v1"
41
+ p1: 'v1'
42
42
  });
43
43
  expect(result.id2).toEqual({
44
- p2: "v2"
44
+ p2: 'v2'
45
45
  });
46
46
  });
47
+ it('should reviveArray propagate the options', function() {
48
+ var reviver = jest.fn();
49
+ var options = {
50
+ logger: jest.fn()
51
+ };
52
+ (0, _Reviver.reviveArray)([
53
+ 1
54
+ ], null, reviver, options);
55
+ expect(reviver).toHaveBeenCalledWith(1, null, options);
56
+ });
57
+ it('should reviveDictionarizedArray propagate the options', function() {
58
+ var reviver = jest.fn();
59
+ var options = {
60
+ logger: jest.fn()
61
+ };
62
+ var dictionary = {
63
+ key: 'test'
64
+ };
65
+ (0, _Reviver.reviveDictionarizedArray)([
66
+ 'key'
67
+ ], dictionary, reviver, options);
68
+ expect(reviver).toHaveBeenCalledWith('test', dictionary, options);
69
+ });
70
+ it('should reviveMap propagate the options', function() {
71
+ var reviver = jest.fn();
72
+ var options = {
73
+ logger: jest.fn()
74
+ };
75
+ var dictionary = {
76
+ key: 'test'
77
+ };
78
+ (0, _Reviver.reviveMap)([
79
+ 'key'
80
+ ], dictionary, reviver, options);
81
+ expect(reviver).toHaveBeenCalledWith('key', dictionary, options);
82
+ });
47
83
  });
@@ -70,8 +70,8 @@ var AdditionalParamsSyncRequest = /*#__PURE__*/ function() {
70
70
  var _this = this;
71
71
  return {
72
72
  transform: function(data) {
73
- var queryParams = typeof _this.additionalParams.queryParams === "function" ? _this.additionalParams.queryParams(data.queryParams) : _this.additionalParams.queryParams;
74
- var headers = typeof _this.additionalParams.headers === "function" ? _this.additionalParams.headers(data.headers) : _this.additionalParams.headers;
73
+ var queryParams = typeof _this.additionalParams.queryParams === 'function' ? _this.additionalParams.queryParams(data.queryParams) : _this.additionalParams.queryParams;
74
+ var headers = typeof _this.additionalParams.headers === 'function' ? _this.additionalParams.headers(data.headers) : _this.additionalParams.headers;
75
75
  var body = _this.additionalParams.body && (0, _additionalparamsrequest.isStringOrUndefined)(data.body) ? _this.additionalParams.body(data.body) : undefined;
76
76
  if (queryParams) {
77
77
  data.queryParams = _object_spread({}, data.queryParams, queryParams);
@@ -193,7 +193,7 @@ function _ts_generator(thisArg, body) {
193
193
  }
194
194
  function isStringOrUndefined(value) {
195
195
  var type = typeof value === "undefined" ? "undefined" : _type_of(value);
196
- return type === "undefined" || type === "string";
196
+ return type === 'undefined' || type === 'string';
197
197
  }
198
198
  var AdditionalParamsRequest = /*#__PURE__*/ function() {
199
199
  "use strict";
@@ -214,7 +214,7 @@ var AdditionalParamsRequest = /*#__PURE__*/ function() {
214
214
  return _ts_generator(this, function(_state) {
215
215
  switch(_state.label){
216
216
  case 0:
217
- if (!(typeof _this.additionalParams.queryParams === "function")) return [
217
+ if (!(typeof _this.additionalParams.queryParams === 'function')) return [
218
218
  3,
219
219
  2
220
220
  ];
@@ -233,7 +233,7 @@ var AdditionalParamsRequest = /*#__PURE__*/ function() {
233
233
  _state.label = 3;
234
234
  case 3:
235
235
  queryParams = _tmp;
236
- if (!(typeof _this.additionalParams.headers === "function")) return [
236
+ if (!(typeof _this.additionalParams.headers === 'function')) return [
237
237
  3,
238
238
  5
239
239
  ];
@@ -128,33 +128,33 @@ function _ts_generator(thisArg, body) {
128
128
  };
129
129
  }
130
130
  }
131
- describe("Additional Params Request Plugin", function() {
131
+ describe('Additional Params Request Plugin', function() {
132
132
  var additionalGetParams = jest.fn().mockReturnValue({
133
- test: "ok"
133
+ test: 'ok'
134
134
  });
135
- var additionalBody = jest.fn().mockReturnValue("newBody");
135
+ var additionalBody = jest.fn().mockReturnValue('newBody');
136
136
  var defaultGetParams = {
137
- defaultTest: "ok"
137
+ defaultTest: 'ok'
138
138
  };
139
- var defaultBody = "default";
139
+ var defaultBody = 'default';
140
140
  var options;
141
141
  beforeEach(function() {
142
142
  options = {
143
- method: "get",
143
+ method: 'get',
144
144
  queryParams: defaultGetParams,
145
145
  headers: new Headers(),
146
146
  body: defaultBody,
147
- basePath: "http://test.com/truc"
147
+ basePath: 'http://test.com/truc'
148
148
  };
149
149
  });
150
- it("should add a specified query param", /*#__PURE__*/ _async_to_generator(function() {
150
+ it('should add a specified query param', /*#__PURE__*/ _async_to_generator(function() {
151
151
  var plugin, runner, result;
152
152
  return _ts_generator(this, function(_state) {
153
153
  switch(_state.label){
154
154
  case 0:
155
155
  plugin = new _additionalparamsrequest.AdditionalParamsRequest({
156
156
  queryParams: {
157
- test: "ok"
157
+ test: 'ok'
158
158
  }
159
159
  });
160
160
  runner = plugin.load();
@@ -164,14 +164,14 @@ describe("Additional Params Request Plugin", function() {
164
164
  ];
165
165
  case 1:
166
166
  result = _state.sent();
167
- expect(result.queryParams.test).toBe("ok");
167
+ expect(result.queryParams.test).toBe('ok');
168
168
  return [
169
169
  2
170
170
  ];
171
171
  }
172
172
  });
173
173
  }));
174
- it("should add the query params returned by a function", /*#__PURE__*/ _async_to_generator(function() {
174
+ it('should add the query params returned by a function', /*#__PURE__*/ _async_to_generator(function() {
175
175
  var plugin, runner, result;
176
176
  return _ts_generator(this, function(_state) {
177
177
  switch(_state.label){
@@ -187,14 +187,14 @@ describe("Additional Params Request Plugin", function() {
187
187
  case 1:
188
188
  result = _state.sent();
189
189
  expect(additionalGetParams).toHaveBeenCalledWith(defaultGetParams);
190
- expect(result.queryParams.test).toBe("ok");
190
+ expect(result.queryParams.test).toBe('ok');
191
191
  return [
192
192
  2
193
193
  ];
194
194
  }
195
195
  });
196
196
  }));
197
- it("should modify body", /*#__PURE__*/ _async_to_generator(function() {
197
+ it('should modify body', /*#__PURE__*/ _async_to_generator(function() {
198
198
  var plugin, runner, result;
199
199
  return _ts_generator(this, function(_state) {
200
200
  switch(_state.label){
@@ -210,9 +210,9 @@ describe("Additional Params Request Plugin", function() {
210
210
  case 1:
211
211
  result = _state.sent();
212
212
  expect(result.queryParams.test).toBeUndefined();
213
- expect(result.queryParams.defaultTest).toBe("ok");
213
+ expect(result.queryParams.defaultTest).toBe('ok');
214
214
  expect(additionalBody).toHaveBeenCalledWith(defaultBody);
215
- expect(result.body).toBe("newBody");
215
+ expect(result.body).toBe('newBody');
216
216
  return [
217
217
  2
218
218
  ];
@@ -220,53 +220,53 @@ describe("Additional Params Request Plugin", function() {
220
220
  });
221
221
  }));
222
222
  });
223
- describe("Additional Params Request Sync Plugin", function() {
223
+ describe('Additional Params Request Sync Plugin', function() {
224
224
  var additionalGetParams = jest.fn().mockReturnValue({
225
- test: "ok"
225
+ test: 'ok'
226
226
  });
227
- var additionalBody = jest.fn().mockReturnValue("newBody");
227
+ var additionalBody = jest.fn().mockReturnValue('newBody');
228
228
  var defaultGetParams = {
229
- defaultTest: "ok"
229
+ defaultTest: 'ok'
230
230
  };
231
- var defaultBody = "default";
231
+ var defaultBody = 'default';
232
232
  var options;
233
233
  beforeEach(function() {
234
234
  options = {
235
- method: "get",
235
+ method: 'get',
236
236
  queryParams: defaultGetParams,
237
237
  headers: new Headers(),
238
238
  body: defaultBody,
239
- basePath: "http://test.com/truc"
239
+ basePath: 'http://test.com/truc'
240
240
  };
241
241
  });
242
- it("should add a specified query param", function() {
242
+ it('should add a specified query param', function() {
243
243
  var plugin = new _additionalparamssyncrequest.AdditionalParamsSyncRequest({
244
244
  queryParams: {
245
- test: "ok"
245
+ test: 'ok'
246
246
  }
247
247
  });
248
248
  var runner = plugin.load();
249
249
  var result = runner.transform(options);
250
- expect(result.queryParams.test).toBe("ok");
250
+ expect(result.queryParams.test).toBe('ok');
251
251
  });
252
- it("should add the query params returned by a function", function() {
252
+ it('should add the query params returned by a function', function() {
253
253
  var plugin = new _additionalparamssyncrequest.AdditionalParamsSyncRequest({
254
254
  queryParams: additionalGetParams
255
255
  });
256
256
  var runner = plugin.load();
257
257
  var result = runner.transform(options);
258
258
  expect(additionalGetParams).toHaveBeenCalledWith(defaultGetParams);
259
- expect(result.queryParams.test).toBe("ok");
259
+ expect(result.queryParams.test).toBe('ok');
260
260
  });
261
- it("should modify body", function() {
261
+ it('should modify body', function() {
262
262
  var plugin = new _additionalparamssyncrequest.AdditionalParamsSyncRequest({
263
263
  body: additionalBody
264
264
  });
265
265
  var runner = plugin.load();
266
266
  var result = runner.transform(options);
267
267
  expect(result.queryParams.test).toBeUndefined();
268
- expect(result.queryParams.defaultTest).toBe("ok");
268
+ expect(result.queryParams.defaultTest).toBe('ok');
269
269
  expect(additionalBody).toHaveBeenCalledWith(defaultBody);
270
- expect(result.body).toBe("newBody");
270
+ expect(result.body).toBe('newBody');
271
271
  });
272
272
  });