@ama-sdk/core 14.0.0-next.1 → 14.0.0-next.3

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 (340) hide show
  1. package/README.md +5 -5
  2. package/cjs/fwk/index.js +4 -3
  3. package/cjs/fwk/param-serialization.spec.js +1 -1
  4. package/cjs/fwk/server.js +90 -0
  5. package/cjs/fwk/server.spec.js +270 -0
  6. package/cjs/plugins/additional-params/{additional-params.request.js → additional-params-request.js} +1 -1
  7. package/cjs/plugins/additional-params/{additional-params-sync.request.js → additional-params-sync-request.js} +2 -2
  8. package/cjs/plugins/additional-params/additional-params.spec.js +2 -2
  9. package/cjs/plugins/additional-params/index.js +2 -2
  10. package/cjs/plugins/api-configuration-override/api-configuration-override.spec.js +1 -1
  11. package/cjs/plugins/api-configuration-override/index.js +1 -1
  12. package/cjs/plugins/api-key/api-key.spec.js +1 -1
  13. package/cjs/plugins/api-key/index.js +1 -1
  14. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +1 -1
  15. package/cjs/plugins/bot-protection-fingerprint/index.js +1 -1
  16. package/cjs/plugins/client-facts/client-facts.spec.js +1 -1
  17. package/cjs/plugins/client-facts/index.js +1 -1
  18. package/cjs/plugins/custom-info/custom-info.spec.js +1 -1
  19. package/cjs/plugins/custom-info/index.js +1 -1
  20. package/cjs/plugins/exception/exception.spec.js +1 -1
  21. package/cjs/plugins/exception/index.js +1 -1
  22. package/cjs/plugins/fetch-cache/fetch-cache.spec.js +1 -1
  23. package/cjs/plugins/fetch-cache/index.js +1 -1
  24. package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +1 -1
  25. package/cjs/plugins/fetch-credentials/index.js +1 -1
  26. package/cjs/plugins/json-token/index.js +2 -2
  27. package/cjs/plugins/json-token/json-token.spec.js +2 -2
  28. package/cjs/plugins/mgw-mdw-auth/index.js +1 -1
  29. package/cjs/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.js → mgw-mdw-auth-request.js} +1 -1
  30. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +2 -2
  31. package/cjs/plugins/mock-intercept/index.js +2 -2
  32. package/cjs/plugins/mock-intercept/{mock-intercept.request.js → mock-intercept-request.js} +1 -1
  33. package/cjs/plugins/mock-intercept/mock-intercept.spec.js +2 -2
  34. package/cjs/plugins/open-telemetry/traceparent/index.js +2 -2
  35. package/cjs/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.spec.js → open-telemetry-traceparent-reply.spec.js} +1 -1
  36. package/cjs/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.spec.js → open-telemetry-traceparent-request.spec.js} +1 -1
  37. package/cjs/plugins/pii-tokenizer/index.js +1 -1
  38. package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +1 -1
  39. package/cjs/plugins/raw-response-info/index.js +1 -1
  40. package/cjs/plugins/raw-response-info/raw-response-info.spec.js +1 -1
  41. package/cjs/plugins/reviver/index.js +1 -1
  42. package/cjs/plugins/reviver/reviver.spec.js +1 -1
  43. package/cjs/plugins/session-id/index.js +1 -1
  44. package/cjs/plugins/session-id/session-id.spec.js +1 -1
  45. package/cjs/plugins/si-token/index.js +1 -1
  46. package/cjs/plugins/si-token/si-token.spec.js +1 -1
  47. package/cjs/plugins/simple-api-key-authentication/index.js +1 -1
  48. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +1 -1
  49. package/cjs/plugins/url-rewrite/index.js +1 -1
  50. package/cjs/plugins/url-rewrite/url-rewrite.spec.js +1 -1
  51. package/cjs/utils/encoder.js +6 -6
  52. package/cjs/utils/perf/index.js +1 -1
  53. package/cjs/utils/perf/{perf-metric.serivce.spec.js → perf-metric.spec.js} +2 -2
  54. package/esm2015/fwk/index.js +4 -3
  55. package/esm2015/fwk/param-serialization.spec.js +1 -1
  56. package/esm2015/fwk/server.js +86 -0
  57. package/esm2015/fwk/server.spec.js +266 -0
  58. package/esm2015/plugins/additional-params/{additional-params.request.js → additional-params-request.js} +1 -1
  59. package/esm2015/plugins/additional-params/{additional-params-sync.request.js → additional-params-sync-request.js} +2 -2
  60. package/esm2015/plugins/additional-params/additional-params.spec.js +2 -2
  61. package/esm2015/plugins/additional-params/index.js +2 -2
  62. package/esm2015/plugins/api-configuration-override/api-configuration-override.spec.js +1 -1
  63. package/esm2015/plugins/api-configuration-override/index.js +1 -1
  64. package/esm2015/plugins/api-key/api-key.spec.js +1 -1
  65. package/esm2015/plugins/api-key/index.js +1 -1
  66. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +1 -1
  67. package/esm2015/plugins/bot-protection-fingerprint/index.js +1 -1
  68. package/esm2015/plugins/client-facts/client-facts.spec.js +1 -1
  69. package/esm2015/plugins/client-facts/index.js +1 -1
  70. package/esm2015/plugins/custom-info/custom-info.spec.js +1 -1
  71. package/esm2015/plugins/custom-info/index.js +1 -1
  72. package/esm2015/plugins/exception/exception.spec.js +1 -1
  73. package/esm2015/plugins/exception/index.js +1 -1
  74. package/esm2015/plugins/fetch-cache/fetch-cache.spec.js +1 -1
  75. package/esm2015/plugins/fetch-cache/index.js +1 -1
  76. package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +1 -1
  77. package/esm2015/plugins/fetch-credentials/index.js +1 -1
  78. package/esm2015/plugins/json-token/index.js +2 -2
  79. package/esm2015/plugins/json-token/json-token.spec.js +2 -2
  80. package/esm2015/plugins/mgw-mdw-auth/index.js +1 -1
  81. package/esm2015/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.js → mgw-mdw-auth-helpers.js} +5 -5
  82. package/esm2015/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.js → mgw-mdw-auth-request.js} +1 -1
  83. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +2 -2
  84. package/esm2015/plugins/mock-intercept/index.js +2 -2
  85. package/esm2015/plugins/mock-intercept/{mock-intercept.request.js → mock-intercept-request.js} +1 -1
  86. package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +2 -2
  87. package/esm2015/plugins/open-telemetry/traceparent/index.js +2 -2
  88. package/esm2015/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.spec.js → open-telemetry-traceparent-reply.spec.js} +1 -1
  89. package/esm2015/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.spec.js → open-telemetry-traceparent-request.spec.js} +1 -1
  90. package/esm2015/plugins/pii-tokenizer/index.js +1 -1
  91. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +1 -1
  92. package/esm2015/plugins/raw-response-info/index.js +1 -1
  93. package/esm2015/plugins/raw-response-info/raw-response-info.spec.js +1 -1
  94. package/esm2015/plugins/reviver/index.js +1 -1
  95. package/esm2015/plugins/reviver/reviver.spec.js +1 -1
  96. package/esm2015/plugins/session-id/index.js +1 -1
  97. package/esm2015/plugins/session-id/session-id.spec.js +1 -1
  98. package/esm2015/plugins/si-token/index.js +1 -1
  99. package/esm2015/plugins/si-token/si-token.spec.js +1 -1
  100. package/esm2015/plugins/simple-api-key-authentication/index.js +1 -1
  101. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +1 -1
  102. package/esm2015/plugins/url-rewrite/index.js +1 -1
  103. package/esm2015/plugins/url-rewrite/url-rewrite.spec.js +1 -1
  104. package/esm2015/utils/encoder.js +6 -6
  105. package/esm2015/utils/perf/index.js +1 -1
  106. package/esm2015/utils/perf/{perf-metric.serivce.spec.js → perf-metric.spec.js} +1 -1
  107. package/package.json +30 -33
  108. package/src/fwk/{api.helpers.d.ts → api-helpers.d.ts} +1 -1
  109. package/src/fwk/{api.helpers.d.ts.map → api-helpers.d.ts.map} +1 -1
  110. package/src/fwk/{api.helpers.js → api-helpers.js} +1 -1
  111. package/src/fwk/{api.helpers.js.map → api-helpers.js.map} +1 -1
  112. package/src/fwk/{api.interface.d.ts → api-interface.d.ts} +1 -1
  113. package/src/fwk/{api.interface.d.ts.map → api-interface.d.ts.map} +1 -1
  114. package/src/fwk/api-interface.js +2 -0
  115. package/src/fwk/api-interface.js.map +1 -0
  116. package/src/fwk/core/api-client.d.ts +1 -1
  117. package/src/fwk/core/base-api-constructor.d.ts +24 -3
  118. package/src/fwk/core/base-api-constructor.d.ts.map +1 -1
  119. package/src/fwk/core/base-api-constructor.js.map +1 -1
  120. package/src/fwk/{ignore-enum.type.d.ts → ignore-enum-type.d.ts} +1 -1
  121. package/src/fwk/{ignore-enum.type.d.ts.map → ignore-enum-type.d.ts.map} +1 -1
  122. package/src/fwk/ignore-enum-type.js +2 -0
  123. package/src/fwk/ignore-enum-type.js.map +1 -0
  124. package/src/fwk/index.d.ts +4 -3
  125. package/src/fwk/index.d.ts.map +1 -1
  126. package/src/fwk/index.js +4 -3
  127. package/src/fwk/index.js.map +1 -1
  128. package/src/fwk/server.d.ts +29 -0
  129. package/src/fwk/server.d.ts.map +1 -0
  130. package/src/fwk/server.js +38 -0
  131. package/src/fwk/server.js.map +1 -0
  132. package/src/plugins/additional-params/{additional-params.request.d.ts → additional-params-request.d.ts} +1 -1
  133. package/src/plugins/additional-params/{additional-params.request.d.ts.map → additional-params-request.d.ts.map} +1 -1
  134. package/src/plugins/additional-params/{additional-params.request.js → additional-params-request.js} +2 -2
  135. package/src/plugins/additional-params/{additional-params.request.js.map → additional-params-request.js.map} +1 -1
  136. package/src/plugins/additional-params/{additional-params-sync.request.d.ts → additional-params-sync-request.d.ts} +1 -1
  137. package/src/plugins/additional-params/{additional-params-sync.request.d.ts.map → additional-params-sync-request.d.ts.map} +1 -1
  138. package/src/plugins/additional-params/{additional-params-sync.request.js → additional-params-sync-request.js} +3 -3
  139. package/src/plugins/additional-params/{additional-params-sync.request.js.map → additional-params-sync-request.js.map} +1 -1
  140. package/src/plugins/additional-params/index.d.ts +2 -2
  141. package/src/plugins/additional-params/index.js +2 -2
  142. package/src/plugins/api-configuration-override/{api-configuration-override.request.d.ts → api-configuration-override-request.d.ts} +1 -1
  143. package/src/plugins/api-configuration-override/{api-configuration-override.request.d.ts.map → api-configuration-override-request.d.ts.map} +1 -1
  144. package/src/plugins/api-configuration-override/{api-configuration-override.request.js → api-configuration-override-request.js} +1 -1
  145. package/src/plugins/api-configuration-override/{api-configuration-override.request.js.map → api-configuration-override-request.js.map} +1 -1
  146. package/src/plugins/api-configuration-override/index.d.ts +1 -1
  147. package/src/plugins/api-configuration-override/index.js +1 -1
  148. package/src/plugins/api-key/{api-key.request.d.ts → api-key-request.d.ts} +1 -1
  149. package/src/plugins/api-key/{api-key.request.d.ts.map → api-key-request.d.ts.map} +1 -1
  150. package/src/plugins/api-key/{api-key.request.js → api-key-request.js} +1 -1
  151. package/src/plugins/api-key/{api-key.request.js.map → api-key-request.js.map} +1 -1
  152. package/src/plugins/api-key/index.d.ts +1 -1
  153. package/src/plugins/api-key/index.js +1 -1
  154. package/src/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.d.ts → bot-protection-fingerprint-request.d.ts} +1 -1
  155. package/src/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.d.ts.map → bot-protection-fingerprint-request.d.ts.map} +1 -1
  156. package/src/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.js → bot-protection-fingerprint-request.js} +1 -1
  157. package/src/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.js.map → bot-protection-fingerprint-request.js.map} +1 -1
  158. package/src/plugins/bot-protection-fingerprint/index.d.ts +1 -1
  159. package/src/plugins/bot-protection-fingerprint/index.js +1 -1
  160. package/src/plugins/client-facts/{client-facts.request.d.ts → client-facts-request.d.ts} +1 -1
  161. package/src/plugins/client-facts/{client-facts.request.d.ts.map → client-facts-request.d.ts.map} +1 -1
  162. package/src/plugins/client-facts/{client-facts.request.js → client-facts-request.js} +1 -1
  163. package/src/plugins/client-facts/{client-facts.request.js.map → client-facts-request.js.map} +1 -1
  164. package/src/plugins/client-facts/index.d.ts +1 -1
  165. package/src/plugins/client-facts/index.js +1 -1
  166. package/src/plugins/custom-info/{custom-info.reply.d.ts → custom-info-reply.d.ts} +1 -1
  167. package/src/plugins/custom-info/{custom-info.reply.d.ts.map → custom-info-reply.d.ts.map} +1 -1
  168. package/src/plugins/custom-info/{custom-info.reply.js → custom-info-reply.js} +1 -1
  169. package/src/plugins/custom-info/{custom-info.reply.js.map → custom-info-reply.js.map} +1 -1
  170. package/src/plugins/custom-info/index.d.ts +1 -1
  171. package/src/plugins/custom-info/index.js +1 -1
  172. package/src/plugins/exception/{exception.reply.d.ts → exception-reply.d.ts} +1 -1
  173. package/src/plugins/exception/{exception.reply.d.ts.map → exception-reply.d.ts.map} +1 -1
  174. package/src/plugins/exception/{exception.reply.js → exception-reply.js} +1 -1
  175. package/src/plugins/exception/{exception.reply.js.map → exception-reply.js.map} +1 -1
  176. package/src/plugins/exception/index.d.ts +1 -1
  177. package/src/plugins/exception/index.js +1 -1
  178. package/src/plugins/fetch-cache/{fetch-cache.request.d.ts → fetch-cache-request.d.ts} +1 -1
  179. package/src/plugins/fetch-cache/{fetch-cache.request.d.ts.map → fetch-cache-request.d.ts.map} +1 -1
  180. package/src/plugins/fetch-cache/{fetch-cache.request.js → fetch-cache-request.js} +1 -1
  181. package/src/plugins/fetch-cache/{fetch-cache.request.js.map → fetch-cache-request.js.map} +1 -1
  182. package/src/plugins/fetch-cache/index.d.ts +1 -1
  183. package/src/plugins/fetch-cache/index.js +1 -1
  184. package/src/plugins/fetch-credentials/{fetch-credentials.request.d.ts → fetch-credentials-request.d.ts} +1 -1
  185. package/src/plugins/fetch-credentials/{fetch-credentials.request.d.ts.map → fetch-credentials-request.d.ts.map} +1 -1
  186. package/src/plugins/fetch-credentials/{fetch-credentials.request.js → fetch-credentials-request.js} +1 -1
  187. package/src/plugins/fetch-credentials/{fetch-credentials.request.js.map → fetch-credentials-request.js.map} +1 -1
  188. package/src/plugins/fetch-credentials/index.d.ts +1 -1
  189. package/src/plugins/fetch-credentials/index.js +1 -1
  190. package/src/plugins/json-token/index.d.ts +2 -2
  191. package/src/plugins/json-token/index.js +2 -2
  192. package/src/plugins/json-token/{json-token.reply.d.ts → json-token-reply.d.ts} +1 -1
  193. package/src/plugins/json-token/{json-token.reply.d.ts.map → json-token-reply.d.ts.map} +1 -1
  194. package/src/plugins/json-token/{json-token.reply.js → json-token-reply.js} +1 -1
  195. package/src/plugins/json-token/{json-token.reply.js.map → json-token-reply.js.map} +1 -1
  196. package/src/plugins/json-token/{json-token.request.d.ts → json-token-request.d.ts} +1 -1
  197. package/src/plugins/json-token/{json-token.request.d.ts.map → json-token-request.d.ts.map} +1 -1
  198. package/src/plugins/json-token/{json-token.request.js → json-token-request.js} +1 -1
  199. package/src/plugins/json-token/{json-token.request.js.map → json-token-request.js.map} +1 -1
  200. package/src/plugins/mgw-mdw-auth/index.d.ts +1 -1
  201. package/src/plugins/mgw-mdw-auth/index.js +1 -1
  202. package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.d.ts → mgw-mdw-auth-helpers.d.ts} +1 -1
  203. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth-helpers.d.ts.map +1 -0
  204. package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.js → mgw-mdw-auth-helpers.js} +1 -1
  205. package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.js.map → mgw-mdw-auth-helpers.js.map} +1 -1
  206. package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.d.ts → mgw-mdw-auth-request.d.ts} +1 -1
  207. package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.d.ts.map → mgw-mdw-auth-request.d.ts.map} +1 -1
  208. package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.js → mgw-mdw-auth-request.js} +2 -2
  209. package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.js.map → mgw-mdw-auth-request.js.map} +1 -1
  210. package/src/plugins/mock-intercept/index.d.ts +2 -2
  211. package/src/plugins/mock-intercept/index.js +2 -2
  212. package/src/plugins/mock-intercept/{mock-intercept.interface.d.ts → mock-intercept-interface.d.ts} +1 -1
  213. package/src/plugins/mock-intercept/{mock-intercept.interface.d.ts.map → mock-intercept-interface.d.ts.map} +1 -1
  214. package/src/plugins/mock-intercept/{mock-intercept.interface.js → mock-intercept-interface.js} +1 -1
  215. package/src/plugins/mock-intercept/mock-intercept-interface.js.map +1 -0
  216. package/src/plugins/mock-intercept/{mock-intercept.request.d.ts → mock-intercept-request.d.ts} +2 -2
  217. package/src/plugins/mock-intercept/{mock-intercept.request.d.ts.map → mock-intercept-request.d.ts.map} +1 -1
  218. package/src/plugins/mock-intercept/{mock-intercept.request.js → mock-intercept-request.js} +2 -2
  219. package/src/plugins/mock-intercept/{mock-intercept.request.js.map → mock-intercept-request.js.map} +1 -1
  220. package/src/plugins/open-telemetry/traceparent/index.d.ts +2 -2
  221. package/src/plugins/open-telemetry/traceparent/index.js +2 -2
  222. package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.d.ts → open-telemetry-traceparent-reply.d.ts} +1 -1
  223. package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.d.ts.map → open-telemetry-traceparent-reply.d.ts.map} +1 -1
  224. package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.js → open-telemetry-traceparent-reply.js} +1 -1
  225. package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.js.map → open-telemetry-traceparent-reply.js.map} +1 -1
  226. package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.d.ts → open-telemetry-traceparent-request.d.ts} +1 -1
  227. package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.d.ts.map → open-telemetry-traceparent-request.d.ts.map} +1 -1
  228. package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.js → open-telemetry-traceparent-request.js} +1 -1
  229. package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.js.map → open-telemetry-traceparent-request.js.map} +1 -1
  230. package/src/plugins/pii-tokenizer/index.d.ts +1 -1
  231. package/src/plugins/pii-tokenizer/index.js +1 -1
  232. package/src/plugins/pii-tokenizer/{pii-tokenizer.request.d.ts → pii-tokenizer-request.d.ts} +1 -1
  233. package/src/plugins/pii-tokenizer/{pii-tokenizer.request.d.ts.map → pii-tokenizer-request.d.ts.map} +1 -1
  234. package/src/plugins/pii-tokenizer/{pii-tokenizer.request.js → pii-tokenizer-request.js} +1 -1
  235. package/src/plugins/pii-tokenizer/{pii-tokenizer.request.js.map → pii-tokenizer-request.js.map} +1 -1
  236. package/src/plugins/raw-response-info/index.d.ts +1 -1
  237. package/src/plugins/raw-response-info/index.js +1 -1
  238. package/src/plugins/raw-response-info/{raw-response-info.reply.d.ts → raw-response-info-reply.d.ts} +1 -1
  239. package/src/plugins/raw-response-info/{raw-response-info.reply.d.ts.map → raw-response-info-reply.d.ts.map} +1 -1
  240. package/src/plugins/raw-response-info/{raw-response-info.reply.js → raw-response-info-reply.js} +1 -1
  241. package/src/plugins/raw-response-info/{raw-response-info.reply.js.map → raw-response-info-reply.js.map} +1 -1
  242. package/src/plugins/reviver/index.d.ts +1 -1
  243. package/src/plugins/reviver/index.js +1 -1
  244. package/src/plugins/reviver/{reviver.reply.d.ts → reviver-reply.d.ts} +1 -1
  245. package/src/plugins/reviver/{reviver.reply.d.ts.map → reviver-reply.d.ts.map} +1 -1
  246. package/src/plugins/reviver/{reviver.reply.js → reviver-reply.js} +1 -1
  247. package/src/plugins/reviver/{reviver.reply.js.map → reviver-reply.js.map} +1 -1
  248. package/src/plugins/session-id/index.d.ts +1 -1
  249. package/src/plugins/session-id/index.js +1 -1
  250. package/src/plugins/session-id/{session-id.request.d.ts → session-id-request.d.ts} +1 -1
  251. package/src/plugins/session-id/{session-id.request.d.ts.map → session-id-request.d.ts.map} +1 -1
  252. package/src/plugins/session-id/{session-id.request.js → session-id-request.js} +1 -1
  253. package/src/plugins/session-id/{session-id.request.js.map → session-id-request.js.map} +1 -1
  254. package/src/plugins/si-token/index.d.ts +1 -1
  255. package/src/plugins/si-token/index.js +1 -1
  256. package/src/plugins/si-token/{si-token.request.d.ts → si-token-request.d.ts} +1 -1
  257. package/src/plugins/si-token/{si-token.request.d.ts.map → si-token-request.d.ts.map} +1 -1
  258. package/src/plugins/si-token/{si-token.request.js → si-token-request.js} +1 -1
  259. package/src/plugins/si-token/{si-token.request.js.map → si-token-request.js.map} +1 -1
  260. package/src/plugins/simple-api-key-authentication/index.d.ts +1 -1
  261. package/src/plugins/simple-api-key-authentication/index.js +1 -1
  262. package/src/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.d.ts → simple-api-key-authentication-request.d.ts} +1 -1
  263. package/src/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.d.ts.map → simple-api-key-authentication-request.d.ts.map} +1 -1
  264. package/src/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.js → simple-api-key-authentication-request.js} +1 -1
  265. package/src/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.js.map → simple-api-key-authentication-request.js.map} +1 -1
  266. package/src/plugins/url-rewrite/index.d.ts +1 -1
  267. package/src/plugins/url-rewrite/index.js +1 -1
  268. package/src/plugins/url-rewrite/{url-rewrite.request.d.ts → url-rewrite-request.d.ts} +1 -1
  269. package/src/plugins/url-rewrite/{url-rewrite.request.d.ts.map → url-rewrite-request.d.ts.map} +1 -1
  270. package/src/plugins/url-rewrite/{url-rewrite.request.js → url-rewrite-request.js} +1 -1
  271. package/src/plugins/url-rewrite/{url-rewrite.request.js.map → url-rewrite-request.js.map} +1 -1
  272. package/src/utils/perf/index.d.ts +1 -1
  273. package/src/utils/perf/index.d.ts.map +1 -1
  274. package/src/utils/perf/index.js +1 -1
  275. package/src/utils/perf/index.js.map +1 -1
  276. package/src/utils/perf/{perf-metric.service.d.ts → perf-metric.d.ts} +1 -1
  277. package/src/utils/perf/perf-metric.d.ts.map +1 -0
  278. package/src/utils/perf/{perf-metric.service.js → perf-metric.js} +1 -1
  279. package/src/utils/perf/perf-metric.js.map +1 -0
  280. package/schematics/ng-add/index.js.map +0 -1
  281. package/schematics/ng-add/schema.js.map +0 -1
  282. package/src/fwk/api.interface.js +0 -2
  283. package/src/fwk/api.interface.js.map +0 -1
  284. package/src/fwk/ignore-enum.type.js +0 -2
  285. package/src/fwk/ignore-enum.type.js.map +0 -1
  286. package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.helpers.d.ts.map +0 -1
  287. package/src/plugins/mock-intercept/mock-intercept.interface.js.map +0 -1
  288. package/src/utils/perf/perf-metric.service.d.ts.map +0 -1
  289. package/src/utils/perf/perf-metric.service.js.map +0 -1
  290. /package/cjs/fwk/{api.helpers.js → api-helpers.js} +0 -0
  291. /package/cjs/fwk/{api.helper.spec.js → api-helpers.spec.js} +0 -0
  292. /package/cjs/fwk/{api.interface.js → api-interface.js} +0 -0
  293. /package/cjs/fwk/{ignore-enum.type.js → ignore-enum-type.js} +0 -0
  294. /package/cjs/plugins/api-configuration-override/{api-configuration-override.request.js → api-configuration-override-request.js} +0 -0
  295. /package/cjs/plugins/api-key/{api-key.request.js → api-key-request.js} +0 -0
  296. /package/cjs/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.js → bot-protection-fingerprint-request.js} +0 -0
  297. /package/cjs/plugins/client-facts/{client-facts.request.js → client-facts-request.js} +0 -0
  298. /package/cjs/plugins/custom-info/{custom-info.reply.js → custom-info-reply.js} +0 -0
  299. /package/cjs/plugins/exception/{exception.reply.js → exception-reply.js} +0 -0
  300. /package/cjs/plugins/fetch-cache/{fetch-cache.request.js → fetch-cache-request.js} +0 -0
  301. /package/cjs/plugins/fetch-credentials/{fetch-credentials.request.js → fetch-credentials-request.js} +0 -0
  302. /package/cjs/plugins/json-token/{json-token.reply.js → json-token-reply.js} +0 -0
  303. /package/cjs/plugins/json-token/{json-token.request.js → json-token-request.js} +0 -0
  304. /package/cjs/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.js → mgw-mdw-auth-helpers.js} +0 -0
  305. /package/cjs/plugins/mock-intercept/{mock-intercept.interface.js → mock-intercept-interface.js} +0 -0
  306. /package/cjs/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.js → open-telemetry-traceparent-reply.js} +0 -0
  307. /package/cjs/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.js → open-telemetry-traceparent-request.js} +0 -0
  308. /package/cjs/plugins/pii-tokenizer/{pii-tokenizer.request.js → pii-tokenizer-request.js} +0 -0
  309. /package/cjs/plugins/raw-response-info/{raw-response-info.reply.js → raw-response-info-reply.js} +0 -0
  310. /package/cjs/plugins/reviver/{reviver.reply.js → reviver-reply.js} +0 -0
  311. /package/cjs/plugins/session-id/{session-id.request.js → session-id-request.js} +0 -0
  312. /package/cjs/plugins/si-token/{si-token.request.js → si-token-request.js} +0 -0
  313. /package/cjs/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.js → simple-api-key-authentication-request.js} +0 -0
  314. /package/cjs/plugins/url-rewrite/{url-rewrite.request.js → url-rewrite-request.js} +0 -0
  315. /package/cjs/utils/perf/{perf-metric.service.js → perf-metric.js} +0 -0
  316. /package/esm2015/fwk/{api.helpers.js → api-helpers.js} +0 -0
  317. /package/esm2015/fwk/{api.helper.spec.js → api-helpers.spec.js} +0 -0
  318. /package/esm2015/fwk/{api.interface.js → api-interface.js} +0 -0
  319. /package/esm2015/fwk/{ignore-enum.type.js → ignore-enum-type.js} +0 -0
  320. /package/esm2015/plugins/api-configuration-override/{api-configuration-override.request.js → api-configuration-override-request.js} +0 -0
  321. /package/esm2015/plugins/api-key/{api-key.request.js → api-key-request.js} +0 -0
  322. /package/esm2015/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.js → bot-protection-fingerprint-request.js} +0 -0
  323. /package/esm2015/plugins/client-facts/{client-facts.request.js → client-facts-request.js} +0 -0
  324. /package/esm2015/plugins/custom-info/{custom-info.reply.js → custom-info-reply.js} +0 -0
  325. /package/esm2015/plugins/exception/{exception.reply.js → exception-reply.js} +0 -0
  326. /package/esm2015/plugins/fetch-cache/{fetch-cache.request.js → fetch-cache-request.js} +0 -0
  327. /package/esm2015/plugins/fetch-credentials/{fetch-credentials.request.js → fetch-credentials-request.js} +0 -0
  328. /package/esm2015/plugins/json-token/{json-token.reply.js → json-token-reply.js} +0 -0
  329. /package/esm2015/plugins/json-token/{json-token.request.js → json-token-request.js} +0 -0
  330. /package/esm2015/plugins/mock-intercept/{mock-intercept.interface.js → mock-intercept-interface.js} +0 -0
  331. /package/esm2015/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.js → open-telemetry-traceparent-reply.js} +0 -0
  332. /package/esm2015/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.js → open-telemetry-traceparent-request.js} +0 -0
  333. /package/esm2015/plugins/pii-tokenizer/{pii-tokenizer.request.js → pii-tokenizer-request.js} +0 -0
  334. /package/esm2015/plugins/raw-response-info/{raw-response-info.reply.js → raw-response-info-reply.js} +0 -0
  335. /package/esm2015/plugins/reviver/{reviver.reply.js → reviver-reply.js} +0 -0
  336. /package/esm2015/plugins/session-id/{session-id.request.js → session-id-request.js} +0 -0
  337. /package/esm2015/plugins/si-token/{si-token.request.js → si-token-request.js} +0 -0
  338. /package/esm2015/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.js → simple-api-key-authentication-request.js} +0 -0
  339. /package/esm2015/plugins/url-rewrite/{url-rewrite.request.js → url-rewrite-request.js} +0 -0
  340. /package/esm2015/utils/perf/{perf-metric.service.js → perf-metric.js} +0 -0
package/README.md CHANGED
@@ -35,11 +35,11 @@ Please refer to the [ama-sdk-schematics](../schematics/README.md) package for ge
35
35
  The **API Clients** are mandatory to the SDK to indicate the service that should be used by the SDK to process the calls.
36
36
  A list of API Clients are provided by this package:
37
37
 
38
- | API Client | Import | Description |
39
- | ---------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
40
- | ApiFetchClient | [@ama-sdk/client-fetch](https://npmjs.com/package/@ama-sdk/client-fetch) | Default API Client based on the browser FetchApi |
41
- | ApiBeaconClient | @ama-sdk/core | API Client based on the browser BeaconApi, it is processing synchronous call |
42
- | ApiAngularClient | @ama-sdk/core/clients/api-angular-client | API Client using the HttpClient exposed by the `@angular/common` package |
38
+ | API Client | Import | Description |
39
+ | ---------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
40
+ | ApiFetchClient | [@ama-sdk/client-fetch](https://npmjs.com/package/@ama-sdk/client-fetch) | Default API Client based on the browser FetchApi |
41
+ | ApiBeaconClient | [@ama-sdk/beacon-fetch](https://npmjs.com/package/@ama-sdk/beacon-fetch) | API Client based on the browser BeaconApi, it is processing synchronous call |
42
+ | ApiAngularClient | [@ama-sdk/api-angular-client](https://npmjs.com/package/@ama-sdk/angular-fetch) | API Client using the HttpClient exposed by the `@angular/common` package |
43
43
 
44
44
  ### Logs
45
45
 
package/cjs/fwk/index.js CHANGED
@@ -3,16 +3,17 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  _export_star(require("./api"), exports);
6
- _export_star(require("./api.helpers"), exports);
7
- _export_star(require("./api.interface"), exports);
6
+ _export_star(require("./api-helpers"), exports);
7
+ _export_star(require("./api-interface"), exports);
8
8
  _export_star(require("./core/index"), exports);
9
9
  _export_star(require("./date"), exports);
10
10
  _export_star(require("./errors"), exports);
11
- _export_star(require("./ignore-enum.type"), exports);
11
+ _export_star(require("./ignore-enum-type"), exports);
12
12
  _export_star(require("./logger"), exports);
13
13
  _export_star(require("./mocks/index"), exports);
14
14
  _export_star(require("./param-serialization"), exports);
15
15
  _export_star(require("./reviver"), exports);
16
+ _export_star(require("./server"), exports);
16
17
  function _export_star(from, to) {
17
18
  Object.keys(from).forEach(function(k) {
18
19
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _apihelpers = require("./api.helpers");
5
+ var _apihelpers = require("./api-helpers");
6
6
  var _date = require("./date");
7
7
  var _paramserialization = require("./param-serialization");
8
8
  describe('Serialize parameters', function() {
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "selectServerBasePath", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return selectServerBasePath;
9
+ }
10
+ });
11
+ function _array_like_to_array(arr, len) {
12
+ if (len == null || len > arr.length) len = arr.length;
13
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
14
+ return arr2;
15
+ }
16
+ function _array_with_holes(arr) {
17
+ if (Array.isArray(arr)) return arr;
18
+ }
19
+ function _iterable_to_array_limit(arr, i) {
20
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
21
+ if (_i == null) return;
22
+ var _arr = [];
23
+ var _n = true;
24
+ var _d = false;
25
+ var _s, _e;
26
+ try {
27
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
28
+ _arr.push(_s.value);
29
+ if (i && _arr.length === i) break;
30
+ }
31
+ } catch (err) {
32
+ _d = true;
33
+ _e = err;
34
+ } finally{
35
+ try {
36
+ if (!_n && _i["return"] != null) _i["return"]();
37
+ } finally{
38
+ if (_d) throw _e;
39
+ }
40
+ }
41
+ return _arr;
42
+ }
43
+ function _non_iterable_rest() {
44
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
45
+ }
46
+ function _sliced_to_array(arr, i) {
47
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
48
+ }
49
+ function _unsupported_iterable_to_array(o, minLen) {
50
+ if (!o) return;
51
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
52
+ var n = Object.prototype.toString.call(o).slice(8, -1);
53
+ if (n === "Object" && o.constructor) n = o.constructor.name;
54
+ if (n === "Map" || n === "Set") return Array.from(n);
55
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
56
+ }
57
+ var selectServerBasePath = function(clientServerConfigurations, servers, logger) {
58
+ var basePath = clientServerConfigurations.basePath, server = clientServerConfigurations.server, defaultBasePath = clientServerConfigurations.defaultBasePath;
59
+ if (basePath) {
60
+ var _logger_debug;
61
+ logger === null || logger === void 0 ? void 0 : (_logger_debug = logger.debug) === null || _logger_debug === void 0 ? void 0 : _logger_debug.call(logger, 'Using basePath from client configuration');
62
+ return basePath;
63
+ }
64
+ if (!servers || servers.length === 0) {
65
+ var _logger_debug1;
66
+ logger === null || logger === void 0 ? void 0 : (_logger_debug1 = logger.debug) === null || _logger_debug1 === void 0 ? void 0 : _logger_debug1.call(logger, 'No server configuration provided and no server defined in the API, using default basePath "'.concat(defaultBasePath || '', '"'));
67
+ return defaultBasePath || '';
68
+ }
69
+ var matchingServer = servers === null || servers === void 0 ? void 0 : servers[(server === null || server === void 0 ? void 0 : server.index) || 0];
70
+ if (!matchingServer) {
71
+ var _logger_warn;
72
+ logger === null || logger === void 0 ? void 0 : (_logger_warn = logger.warn) === null || _logger_warn === void 0 ? void 0 : _logger_warn.call(logger, 'No server matching at index "'.concat((server === null || server === void 0 ? void 0 : server.index) || 0, '" has been found in the API, using the first server'));
73
+ matchingServer = servers[0];
74
+ }
75
+ return Object.entries(matchingServer.variables || {}).reduce(function(acc, param) {
76
+ var _param = _sliced_to_array(param, 2), variableName = _param[0], variable = _param[1];
77
+ var _server_variables;
78
+ var _server_variables_variableName;
79
+ var variableValue = (_server_variables_variableName = server === null || server === void 0 ? void 0 : (_server_variables = server.variables) === null || _server_variables === void 0 ? void 0 : _server_variables[variableName]) !== null && _server_variables_variableName !== void 0 ? _server_variables_variableName : variable.defaultValue;
80
+ if (variableValue === undefined) {
81
+ logger === null || logger === void 0 ? void 0 : logger.warn('No value provided for server variable "'.concat(variableName, '", using empty string as default'));
82
+ variableValue = '';
83
+ }
84
+ if (variable.enumValues && variable.enumValues.length > 0 && variableValue && !variable.enumValues.includes(variableValue)) {
85
+ logger === null || logger === void 0 ? void 0 : logger.warn('Value "'.concat(variableValue, '" provided for server variable "').concat(variableName, '" is not in the allowed enum [').concat(variable.enumValues.join(', '), "]") + ', using value "'.concat(variable.defaultValue || variable.enumValues[0], '" instead'));
86
+ variableValue = variable.defaultValue || variable.enumValues[0];
87
+ }
88
+ return acc.replaceAll("{".concat(variableName, "}"), variableValue);
89
+ }, matchingServer.url);
90
+ };
@@ -0,0 +1,270 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ var _server = require("./server");
6
+ describe('selectServerBasePath', function() {
7
+ var mockLogger;
8
+ beforeEach(function() {
9
+ mockLogger = {
10
+ log: jest.fn(),
11
+ debug: jest.fn(),
12
+ info: jest.fn(),
13
+ warn: jest.fn(),
14
+ error: jest.fn()
15
+ };
16
+ });
17
+ describe('when clientServerConfigurations has basePath', function() {
18
+ it('should return the basePath from client configurations', function() {
19
+ var clientConfig = {
20
+ basePath: 'https://api.example.com/v1'
21
+ };
22
+ var result = (0, _server.selectServerBasePath)(clientConfig);
23
+ expect(result).toBe('https://api.example.com/v1');
24
+ });
25
+ it('should return the basePath from client configurations even when servers are provided', function() {
26
+ var clientConfig = {
27
+ basePath: 'https://api.example.com/v1'
28
+ };
29
+ var servers = [
30
+ {
31
+ url: 'https://other.example.com'
32
+ }
33
+ ];
34
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
35
+ expect(result).toBe('https://api.example.com/v1');
36
+ });
37
+ });
38
+ describe('when clientServerConfigurations has no basePath', function() {
39
+ it('should return the first server URL when servers are provided', function() {
40
+ var clientConfig = {};
41
+ var servers = [
42
+ {
43
+ url: 'https://server1.example.com'
44
+ },
45
+ {
46
+ url: 'https://server2.example.com'
47
+ }
48
+ ];
49
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
50
+ expect(result).toBe('https://server1.example.com');
51
+ });
52
+ it('should handle server with variables', function() {
53
+ var clientConfig = {};
54
+ var servers = [
55
+ {
56
+ url: 'https://{environment}.example.com/{version}',
57
+ variables: {
58
+ environment: {
59
+ defaultValue: 'api',
60
+ enumValues: [
61
+ 'api',
62
+ 'staging',
63
+ 'dev'
64
+ ]
65
+ },
66
+ version: {
67
+ defaultValue: 'v1'
68
+ }
69
+ }
70
+ }
71
+ ];
72
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
73
+ expect(result).toBe('https://api.example.com/v1');
74
+ });
75
+ it('should handle server with custom variable values', function() {
76
+ var clientConfig = {};
77
+ var servers = [
78
+ {
79
+ url: 'https://{environment}.example.com/{version}',
80
+ variables: {
81
+ environment: {
82
+ defaultValue: 'api',
83
+ enumValues: [
84
+ 'api',
85
+ 'staging',
86
+ 'dev'
87
+ ]
88
+ },
89
+ version: {
90
+ defaultValue: 'v1'
91
+ }
92
+ }
93
+ }
94
+ ];
95
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
96
+ expect(result).toBe('https://api.example.com/v1');
97
+ });
98
+ it('should return empty string when no servers are provided', function() {
99
+ var clientConfig = {};
100
+ var result = (0, _server.selectServerBasePath)(clientConfig);
101
+ expect(result).toBe('');
102
+ });
103
+ it('should return empty string when servers array is empty', function() {
104
+ var clientConfig = {};
105
+ var servers = [];
106
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
107
+ expect(result).toBe('');
108
+ });
109
+ it('should default the basePath when no server available in the specification', function() {
110
+ var clientConfig = {
111
+ server: {
112
+ index: 1
113
+ },
114
+ defaultBasePath: 'https://api.example.com/v1'
115
+ };
116
+ var servers = [];
117
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
118
+ expect(result).toBe('https://api.example.com/v1');
119
+ });
120
+ });
121
+ describe('error handling', function() {
122
+ it('should log warnings when server variables are missing defaults', function() {
123
+ var clientConfig = {};
124
+ var servers = [
125
+ {
126
+ url: 'https://{environment}.example.com',
127
+ variables: {
128
+ environment: {
129
+ enumValues: [
130
+ 'api',
131
+ 'staging'
132
+ ]
133
+ }
134
+ }
135
+ }
136
+ ];
137
+ (0, _server.selectServerBasePath)(clientConfig, servers, mockLogger);
138
+ expect(mockLogger.warn).toHaveBeenCalledWith('No value provided for server variable "environment", using empty string as default');
139
+ });
140
+ it('should log warnings when server variable value is not in enum', function() {
141
+ var clientConfig = {
142
+ server: {
143
+ variables: {
144
+ environment: 'prod'
145
+ }
146
+ }
147
+ };
148
+ var servers = [
149
+ {
150
+ url: 'https://{environment}.example.com',
151
+ variables: {
152
+ environment: {
153
+ defaultValue: 'production',
154
+ enumValues: [
155
+ 'development',
156
+ 'staging',
157
+ 'production'
158
+ ]
159
+ }
160
+ }
161
+ }
162
+ ];
163
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers, mockLogger);
164
+ expect(mockLogger.warn).toHaveBeenCalledWith('Value "prod" provided for server variable "environment" is not in the allowed enum [development, staging, production], using value "production" instead');
165
+ expect(result).toBe('https://production.example.com');
166
+ });
167
+ it('should log warning when no matching server index is found', function() {
168
+ var clientConfig = {
169
+ server: {
170
+ index: 5
171
+ }
172
+ };
173
+ var servers = [
174
+ {
175
+ url: 'https://server1.example.com'
176
+ },
177
+ {
178
+ url: 'https://server2.example.com'
179
+ }
180
+ ];
181
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers, mockLogger);
182
+ expect(mockLogger.warn).toHaveBeenCalledWith('No server matching at index "5" has been found in the API, using the first server');
183
+ expect(result).toBe('https://server1.example.com');
184
+ });
185
+ });
186
+ describe('with logger', function() {
187
+ it('should log debug information about server selection', function() {
188
+ var clientConfig = {
189
+ basePath: 'https://api.example.com/v1'
190
+ };
191
+ (0, _server.selectServerBasePath)(clientConfig, undefined, mockLogger);
192
+ expect(mockLogger.debug).toHaveBeenCalledWith('Using basePath from client configuration');
193
+ });
194
+ it('should log when using fallback to default base url', function() {
195
+ var clientConfig = {
196
+ defaultBasePath: 'https://fallback.example.com'
197
+ };
198
+ var servers = [];
199
+ (0, _server.selectServerBasePath)(clientConfig, servers, mockLogger);
200
+ expect(mockLogger.debug).toHaveBeenCalledWith('No server configuration provided and no server defined in the API, using default basePath "https://fallback.example.com"');
201
+ });
202
+ });
203
+ describe('edge cases', function() {
204
+ it('should handle servers with empty URL', function() {
205
+ var clientConfig = {};
206
+ var servers = [
207
+ {
208
+ url: ''
209
+ },
210
+ {
211
+ url: 'https://valid.example.com'
212
+ }
213
+ ];
214
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
215
+ expect(result).toBe('');
216
+ });
217
+ it('should handle basePath with trailing slash normalization', function() {
218
+ var clientConfig = {
219
+ basePath: 'https://api.example.com/v1/'
220
+ };
221
+ var result = (0, _server.selectServerBasePath)(clientConfig);
222
+ // Depends on implementation - might normalize trailing slash
223
+ expect(result).toMatch(/^https:\/\/api\.example\.com\/v1\/?$/);
224
+ });
225
+ it('should handle complex server variable substitution', function() {
226
+ var clientConfig = {};
227
+ var servers = [
228
+ {
229
+ url: '{protocol}://{host}:{port}/{basePath}',
230
+ variables: {
231
+ protocol: {
232
+ defaultValue: 'https'
233
+ },
234
+ host: {
235
+ defaultValue: 'api.example.com'
236
+ },
237
+ port: {
238
+ defaultValue: '443'
239
+ },
240
+ basePath: {
241
+ defaultValue: 'v1'
242
+ }
243
+ }
244
+ }
245
+ ];
246
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
247
+ expect(result).toBe('https://api.example.com:443/v1');
248
+ });
249
+ it('should handle server variables with enum validation', function() {
250
+ var clientConfig = {};
251
+ var servers = [
252
+ {
253
+ url: 'https://{environment}.example.com',
254
+ variables: {
255
+ environment: {
256
+ defaultValue: 'production',
257
+ enumValues: [
258
+ 'development',
259
+ 'staging',
260
+ 'production'
261
+ ]
262
+ }
263
+ }
264
+ }
265
+ ];
266
+ var result = (0, _server.selectServerBasePath)(clientConfig, servers);
267
+ expect(result).toBe('https://production.example.com');
268
+ });
269
+ });
270
+ });
@@ -16,7 +16,7 @@ _export(exports, {
16
16
  return isStringOrUndefined;
17
17
  }
18
18
  });
19
- var _apihelpers = require("../../fwk/api.helpers");
19
+ var _apihelpers = require("../../fwk/api-helpers");
20
20
  var _paramserialization = require("../../fwk/param-serialization");
21
21
  function _array_like_to_array(arr, len) {
22
22
  if (len == null || len > arr.length) len = arr.length;
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "AdditionalParamsSyncRequest", {
8
8
  return AdditionalParamsSyncRequest;
9
9
  }
10
10
  });
11
- var _apihelpers = require("../../fwk/api.helpers");
11
+ var _apihelpers = require("../../fwk/api-helpers");
12
12
  var _paramserialization = require("../../fwk/param-serialization");
13
- var _additionalparamsrequest = require("./additional-params.request");
13
+ var _additionalparamsrequest = require("./additional-params-request");
14
14
  function _array_like_to_array(arr, len) {
15
15
  if (len == null || len > arr.length) len = arr.length;
16
16
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _additionalparamssyncrequest = require("./additional-params-sync.request");
6
- var _additionalparamsrequest = require("./additional-params.request");
5
+ var _additionalparamsrequest = require("./additional-params-request");
6
+ var _additionalparamssyncrequest = require("./additional-params-sync-request");
7
7
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8
8
  try {
9
9
  var info = gen[key](arg);
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./additional-params-sync.request"), exports);
6
- _export_star(require("./additional-params.request"), exports);
5
+ _export_star(require("./additional-params-sync-request"), exports);
6
+ _export_star(require("./additional-params-request"), exports);
7
7
  function _export_star(from, to) {
8
8
  Object.keys(from).forEach(function(k) {
9
9
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _apiconfigurationoverriderequest = require("./api-configuration-override.request");
5
+ var _apiconfigurationoverriderequest = require("./api-configuration-override-request");
6
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
7
  try {
8
8
  var info = gen[key](arg);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./api-configuration-override.request"), exports);
5
+ _export_star(require("./api-configuration-override-request"), exports);
6
6
  function _export_star(from, to) {
7
7
  Object.keys(from).forEach(function(k) {
8
8
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _apikeyrequest = require("./api-key.request");
5
+ var _apikeyrequest = require("./api-key-request");
6
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
7
  try {
8
8
  var info = gen[key](arg);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./api-key.request"), exports);
5
+ _export_star(require("./api-key-request"), exports);
6
6
  function _export_star(from, to) {
7
7
  Object.keys(from).forEach(function(k) {
8
8
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _botprotectionfingerprintrequest = require("./bot-protection-fingerprint.request");
5
+ var _botprotectionfingerprintrequest = require("./bot-protection-fingerprint-request");
6
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
7
  try {
8
8
  var info = gen[key](arg);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./bot-protection-fingerprint.request"), exports);
5
+ _export_star(require("./bot-protection-fingerprint-request"), exports);
6
6
  function _export_star(from, to) {
7
7
  Object.keys(from).forEach(function(k) {
8
8
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _clientfactsrequest = require("./client-facts.request");
5
+ var _clientfactsrequest = require("./client-facts-request");
6
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
7
  try {
8
8
  var info = gen[key](arg);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./client-facts.request"), exports);
5
+ _export_star(require("./client-facts-request"), exports);
6
6
  function _export_star(from, to) {
7
7
  Object.keys(from).forEach(function(k) {
8
8
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  var _api = require("../../fwk/api");
6
- var _custominforeply = require("./custom-info.reply");
6
+ var _custominforeply = require("./custom-info-reply");
7
7
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8
8
  try {
9
9
  var info = gen[key](arg);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./custom-info.reply"), exports);
5
+ _export_star(require("./custom-info-reply"), exports);
6
6
  function _export_star(from, to) {
7
7
  Object.keys(from).forEach(function(k) {
8
8
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  var _api = require("../../fwk/api");
6
6
  var _errors = require("../../fwk/errors");
7
- var _exceptionreply = require("./exception.reply");
7
+ var _exceptionreply = require("./exception-reply");
8
8
  function _define_property(obj, key, value) {
9
9
  if (key in obj) {
10
10
  Object.defineProperty(obj, key, {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./exception.reply"), exports);
5
+ _export_star(require("./exception-reply"), exports);
6
6
  function _export_star(from, to) {
7
7
  Object.keys(from).forEach(function(k) {
8
8
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _fetchcacherequest = require("./fetch-cache.request");
5
+ var _fetchcacherequest = require("./fetch-cache-request");
6
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
7
  try {
8
8
  var info = gen[key](arg);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./fetch-cache.request"), exports);
5
+ _export_star(require("./fetch-cache-request"), exports);
6
6
  function _export_star(from, to) {
7
7
  Object.keys(from).forEach(function(k) {
8
8
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- var _fetchcredentialsrequest = require("./fetch-credentials.request");
5
+ var _fetchcredentialsrequest = require("./fetch-credentials-request");
6
6
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
7
7
  try {
8
8
  var info = gen[key](arg);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./fetch-credentials.request"), exports);
5
+ _export_star(require("./fetch-credentials-request"), exports);
6
6
  function _export_star(from, to) {
7
7
  Object.keys(from).forEach(function(k) {
8
8
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- _export_star(require("./json-token.reply"), exports);
6
- _export_star(require("./json-token.request"), exports);
5
+ _export_star(require("./json-token-reply"), exports);
6
+ _export_star(require("./json-token-request"), exports);
7
7
  function _export_star(from, to) {
8
8
  Object.keys(from).forEach(function(k) {
9
9
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  var _api = require("../../fwk/api");
6
- var _jsontokenreply = require("./json-token.reply");
7
- var _jsontokenrequest = require("./json-token.request");
6
+ var _jsontokenreply = require("./json-token-reply");
7
+ var _jsontokenrequest = require("./json-token-request");
8
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
9
9
  try {
10
10
  var info = gen[key](arg);