@ama-sdk/core 14.0.0-next.2 → 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.
- package/README.md +5 -5
- package/cjs/fwk/index.js +4 -3
- package/cjs/fwk/param-serialization.spec.js +1 -1
- package/cjs/fwk/server.js +90 -0
- package/cjs/fwk/server.spec.js +270 -0
- package/cjs/plugins/additional-params/{additional-params.request.js → additional-params-request.js} +1 -1
- package/cjs/plugins/additional-params/{additional-params-sync.request.js → additional-params-sync-request.js} +2 -2
- package/cjs/plugins/additional-params/additional-params.spec.js +2 -2
- package/cjs/plugins/additional-params/index.js +2 -2
- package/cjs/plugins/api-configuration-override/api-configuration-override.spec.js +1 -1
- package/cjs/plugins/api-configuration-override/index.js +1 -1
- package/cjs/plugins/api-key/api-key.spec.js +1 -1
- package/cjs/plugins/api-key/index.js +1 -1
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +1 -1
- package/cjs/plugins/bot-protection-fingerprint/index.js +1 -1
- package/cjs/plugins/client-facts/client-facts.spec.js +1 -1
- package/cjs/plugins/client-facts/index.js +1 -1
- package/cjs/plugins/custom-info/custom-info.spec.js +1 -1
- package/cjs/plugins/custom-info/index.js +1 -1
- package/cjs/plugins/exception/exception.spec.js +1 -1
- package/cjs/plugins/exception/index.js +1 -1
- package/cjs/plugins/fetch-cache/fetch-cache.spec.js +1 -1
- package/cjs/plugins/fetch-cache/index.js +1 -1
- package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +1 -1
- package/cjs/plugins/fetch-credentials/index.js +1 -1
- package/cjs/plugins/json-token/index.js +2 -2
- package/cjs/plugins/json-token/json-token.spec.js +2 -2
- package/cjs/plugins/mgw-mdw-auth/index.js +1 -1
- package/cjs/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.js → mgw-mdw-auth-request.js} +1 -1
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +2 -2
- package/cjs/plugins/mock-intercept/index.js +2 -2
- package/cjs/plugins/mock-intercept/{mock-intercept.request.js → mock-intercept-request.js} +1 -1
- package/cjs/plugins/mock-intercept/mock-intercept.spec.js +2 -2
- package/cjs/plugins/open-telemetry/traceparent/index.js +2 -2
- package/cjs/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.spec.js → open-telemetry-traceparent-reply.spec.js} +1 -1
- package/cjs/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.spec.js → open-telemetry-traceparent-request.spec.js} +1 -1
- package/cjs/plugins/pii-tokenizer/index.js +1 -1
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +1 -1
- package/cjs/plugins/raw-response-info/index.js +1 -1
- package/cjs/plugins/raw-response-info/raw-response-info.spec.js +1 -1
- package/cjs/plugins/reviver/index.js +1 -1
- package/cjs/plugins/reviver/reviver.spec.js +1 -1
- package/cjs/plugins/session-id/index.js +1 -1
- package/cjs/plugins/session-id/session-id.spec.js +1 -1
- package/cjs/plugins/si-token/index.js +1 -1
- package/cjs/plugins/si-token/si-token.spec.js +1 -1
- package/cjs/plugins/simple-api-key-authentication/index.js +1 -1
- package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +1 -1
- package/cjs/plugins/url-rewrite/index.js +1 -1
- package/cjs/plugins/url-rewrite/url-rewrite.spec.js +1 -1
- package/cjs/utils/encoder.js +6 -6
- package/cjs/utils/perf/index.js +1 -1
- package/cjs/utils/perf/{perf-metric.serivce.spec.js → perf-metric.spec.js} +2 -2
- package/esm2015/fwk/index.js +4 -3
- package/esm2015/fwk/param-serialization.spec.js +1 -1
- package/esm2015/fwk/server.js +86 -0
- package/esm2015/fwk/server.spec.js +266 -0
- package/esm2015/plugins/additional-params/{additional-params.request.js → additional-params-request.js} +1 -1
- package/esm2015/plugins/additional-params/{additional-params-sync.request.js → additional-params-sync-request.js} +2 -2
- package/esm2015/plugins/additional-params/additional-params.spec.js +2 -2
- package/esm2015/plugins/additional-params/index.js +2 -2
- package/esm2015/plugins/api-configuration-override/api-configuration-override.spec.js +1 -1
- package/esm2015/plugins/api-configuration-override/index.js +1 -1
- package/esm2015/plugins/api-key/api-key.spec.js +1 -1
- package/esm2015/plugins/api-key/index.js +1 -1
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +1 -1
- package/esm2015/plugins/bot-protection-fingerprint/index.js +1 -1
- package/esm2015/plugins/client-facts/client-facts.spec.js +1 -1
- package/esm2015/plugins/client-facts/index.js +1 -1
- package/esm2015/plugins/custom-info/custom-info.spec.js +1 -1
- package/esm2015/plugins/custom-info/index.js +1 -1
- package/esm2015/plugins/exception/exception.spec.js +1 -1
- package/esm2015/plugins/exception/index.js +1 -1
- package/esm2015/plugins/fetch-cache/fetch-cache.spec.js +1 -1
- package/esm2015/plugins/fetch-cache/index.js +1 -1
- package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +1 -1
- package/esm2015/plugins/fetch-credentials/index.js +1 -1
- package/esm2015/plugins/json-token/index.js +2 -2
- package/esm2015/plugins/json-token/json-token.spec.js +2 -2
- package/esm2015/plugins/mgw-mdw-auth/index.js +1 -1
- package/esm2015/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.js → mgw-mdw-auth-helpers.js} +5 -5
- package/esm2015/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.js → mgw-mdw-auth-request.js} +1 -1
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +2 -2
- package/esm2015/plugins/mock-intercept/index.js +2 -2
- package/esm2015/plugins/mock-intercept/{mock-intercept.request.js → mock-intercept-request.js} +1 -1
- package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +2 -2
- package/esm2015/plugins/open-telemetry/traceparent/index.js +2 -2
- package/esm2015/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.spec.js → open-telemetry-traceparent-reply.spec.js} +1 -1
- package/esm2015/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.spec.js → open-telemetry-traceparent-request.spec.js} +1 -1
- package/esm2015/plugins/pii-tokenizer/index.js +1 -1
- package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +1 -1
- package/esm2015/plugins/raw-response-info/index.js +1 -1
- package/esm2015/plugins/raw-response-info/raw-response-info.spec.js +1 -1
- package/esm2015/plugins/reviver/index.js +1 -1
- package/esm2015/plugins/reviver/reviver.spec.js +1 -1
- package/esm2015/plugins/session-id/index.js +1 -1
- package/esm2015/plugins/session-id/session-id.spec.js +1 -1
- package/esm2015/plugins/si-token/index.js +1 -1
- package/esm2015/plugins/si-token/si-token.spec.js +1 -1
- package/esm2015/plugins/simple-api-key-authentication/index.js +1 -1
- package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +1 -1
- package/esm2015/plugins/url-rewrite/index.js +1 -1
- package/esm2015/plugins/url-rewrite/url-rewrite.spec.js +1 -1
- package/esm2015/utils/encoder.js +6 -6
- package/esm2015/utils/perf/index.js +1 -1
- package/esm2015/utils/perf/{perf-metric.serivce.spec.js → perf-metric.spec.js} +1 -1
- package/package.json +30 -33
- package/src/fwk/{api.helpers.d.ts → api-helpers.d.ts} +1 -1
- package/src/fwk/{api.helpers.d.ts.map → api-helpers.d.ts.map} +1 -1
- package/src/fwk/{api.helpers.js → api-helpers.js} +1 -1
- package/src/fwk/{api.helpers.js.map → api-helpers.js.map} +1 -1
- package/src/fwk/{api.interface.d.ts → api-interface.d.ts} +1 -1
- package/src/fwk/{api.interface.d.ts.map → api-interface.d.ts.map} +1 -1
- package/src/fwk/api-interface.js +2 -0
- package/src/fwk/api-interface.js.map +1 -0
- package/src/fwk/core/api-client.d.ts +1 -1
- package/src/fwk/core/base-api-constructor.d.ts +24 -3
- package/src/fwk/core/base-api-constructor.d.ts.map +1 -1
- package/src/fwk/core/base-api-constructor.js.map +1 -1
- package/src/fwk/{ignore-enum.type.d.ts → ignore-enum-type.d.ts} +1 -1
- package/src/fwk/{ignore-enum.type.d.ts.map → ignore-enum-type.d.ts.map} +1 -1
- package/src/fwk/ignore-enum-type.js +2 -0
- package/src/fwk/ignore-enum-type.js.map +1 -0
- package/src/fwk/index.d.ts +4 -3
- package/src/fwk/index.d.ts.map +1 -1
- package/src/fwk/index.js +4 -3
- package/src/fwk/index.js.map +1 -1
- package/src/fwk/server.d.ts +29 -0
- package/src/fwk/server.d.ts.map +1 -0
- package/src/fwk/server.js +38 -0
- package/src/fwk/server.js.map +1 -0
- package/src/plugins/additional-params/{additional-params.request.d.ts → additional-params-request.d.ts} +1 -1
- package/src/plugins/additional-params/{additional-params.request.d.ts.map → additional-params-request.d.ts.map} +1 -1
- package/src/plugins/additional-params/{additional-params.request.js → additional-params-request.js} +2 -2
- package/src/plugins/additional-params/{additional-params.request.js.map → additional-params-request.js.map} +1 -1
- package/src/plugins/additional-params/{additional-params-sync.request.d.ts → additional-params-sync-request.d.ts} +1 -1
- package/src/plugins/additional-params/{additional-params-sync.request.d.ts.map → additional-params-sync-request.d.ts.map} +1 -1
- package/src/plugins/additional-params/{additional-params-sync.request.js → additional-params-sync-request.js} +3 -3
- package/src/plugins/additional-params/{additional-params-sync.request.js.map → additional-params-sync-request.js.map} +1 -1
- package/src/plugins/additional-params/index.d.ts +2 -2
- package/src/plugins/additional-params/index.js +2 -2
- package/src/plugins/api-configuration-override/{api-configuration-override.request.d.ts → api-configuration-override-request.d.ts} +1 -1
- package/src/plugins/api-configuration-override/{api-configuration-override.request.d.ts.map → api-configuration-override-request.d.ts.map} +1 -1
- package/src/plugins/api-configuration-override/{api-configuration-override.request.js → api-configuration-override-request.js} +1 -1
- package/src/plugins/api-configuration-override/{api-configuration-override.request.js.map → api-configuration-override-request.js.map} +1 -1
- package/src/plugins/api-configuration-override/index.d.ts +1 -1
- package/src/plugins/api-configuration-override/index.js +1 -1
- package/src/plugins/api-key/{api-key.request.d.ts → api-key-request.d.ts} +1 -1
- package/src/plugins/api-key/{api-key.request.d.ts.map → api-key-request.d.ts.map} +1 -1
- package/src/plugins/api-key/{api-key.request.js → api-key-request.js} +1 -1
- package/src/plugins/api-key/{api-key.request.js.map → api-key-request.js.map} +1 -1
- package/src/plugins/api-key/index.d.ts +1 -1
- package/src/plugins/api-key/index.js +1 -1
- package/src/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.d.ts → bot-protection-fingerprint-request.d.ts} +1 -1
- package/src/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.d.ts.map → bot-protection-fingerprint-request.d.ts.map} +1 -1
- package/src/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.js → bot-protection-fingerprint-request.js} +1 -1
- package/src/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.js.map → bot-protection-fingerprint-request.js.map} +1 -1
- package/src/plugins/bot-protection-fingerprint/index.d.ts +1 -1
- package/src/plugins/bot-protection-fingerprint/index.js +1 -1
- package/src/plugins/client-facts/{client-facts.request.d.ts → client-facts-request.d.ts} +1 -1
- package/src/plugins/client-facts/{client-facts.request.d.ts.map → client-facts-request.d.ts.map} +1 -1
- package/src/plugins/client-facts/{client-facts.request.js → client-facts-request.js} +1 -1
- package/src/plugins/client-facts/{client-facts.request.js.map → client-facts-request.js.map} +1 -1
- package/src/plugins/client-facts/index.d.ts +1 -1
- package/src/plugins/client-facts/index.js +1 -1
- package/src/plugins/custom-info/{custom-info.reply.d.ts → custom-info-reply.d.ts} +1 -1
- package/src/plugins/custom-info/{custom-info.reply.d.ts.map → custom-info-reply.d.ts.map} +1 -1
- package/src/plugins/custom-info/{custom-info.reply.js → custom-info-reply.js} +1 -1
- package/src/plugins/custom-info/{custom-info.reply.js.map → custom-info-reply.js.map} +1 -1
- package/src/plugins/custom-info/index.d.ts +1 -1
- package/src/plugins/custom-info/index.js +1 -1
- package/src/plugins/exception/{exception.reply.d.ts → exception-reply.d.ts} +1 -1
- package/src/plugins/exception/{exception.reply.d.ts.map → exception-reply.d.ts.map} +1 -1
- package/src/plugins/exception/{exception.reply.js → exception-reply.js} +1 -1
- package/src/plugins/exception/{exception.reply.js.map → exception-reply.js.map} +1 -1
- package/src/plugins/exception/index.d.ts +1 -1
- package/src/plugins/exception/index.js +1 -1
- package/src/plugins/fetch-cache/{fetch-cache.request.d.ts → fetch-cache-request.d.ts} +1 -1
- package/src/plugins/fetch-cache/{fetch-cache.request.d.ts.map → fetch-cache-request.d.ts.map} +1 -1
- package/src/plugins/fetch-cache/{fetch-cache.request.js → fetch-cache-request.js} +1 -1
- package/src/plugins/fetch-cache/{fetch-cache.request.js.map → fetch-cache-request.js.map} +1 -1
- package/src/plugins/fetch-cache/index.d.ts +1 -1
- package/src/plugins/fetch-cache/index.js +1 -1
- package/src/plugins/fetch-credentials/{fetch-credentials.request.d.ts → fetch-credentials-request.d.ts} +1 -1
- package/src/plugins/fetch-credentials/{fetch-credentials.request.d.ts.map → fetch-credentials-request.d.ts.map} +1 -1
- package/src/plugins/fetch-credentials/{fetch-credentials.request.js → fetch-credentials-request.js} +1 -1
- package/src/plugins/fetch-credentials/{fetch-credentials.request.js.map → fetch-credentials-request.js.map} +1 -1
- package/src/plugins/fetch-credentials/index.d.ts +1 -1
- package/src/plugins/fetch-credentials/index.js +1 -1
- package/src/plugins/json-token/index.d.ts +2 -2
- package/src/plugins/json-token/index.js +2 -2
- package/src/plugins/json-token/{json-token.reply.d.ts → json-token-reply.d.ts} +1 -1
- package/src/plugins/json-token/{json-token.reply.d.ts.map → json-token-reply.d.ts.map} +1 -1
- package/src/plugins/json-token/{json-token.reply.js → json-token-reply.js} +1 -1
- package/src/plugins/json-token/{json-token.reply.js.map → json-token-reply.js.map} +1 -1
- package/src/plugins/json-token/{json-token.request.d.ts → json-token-request.d.ts} +1 -1
- package/src/plugins/json-token/{json-token.request.d.ts.map → json-token-request.d.ts.map} +1 -1
- package/src/plugins/json-token/{json-token.request.js → json-token-request.js} +1 -1
- package/src/plugins/json-token/{json-token.request.js.map → json-token-request.js.map} +1 -1
- package/src/plugins/mgw-mdw-auth/index.d.ts +1 -1
- package/src/plugins/mgw-mdw-auth/index.js +1 -1
- package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.d.ts → mgw-mdw-auth-helpers.d.ts} +1 -1
- package/src/plugins/mgw-mdw-auth/mgw-mdw-auth-helpers.d.ts.map +1 -0
- package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.js → mgw-mdw-auth-helpers.js} +1 -1
- package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.js.map → mgw-mdw-auth-helpers.js.map} +1 -1
- package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.d.ts → mgw-mdw-auth-request.d.ts} +1 -1
- package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.d.ts.map → mgw-mdw-auth-request.d.ts.map} +1 -1
- package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.js → mgw-mdw-auth-request.js} +2 -2
- package/src/plugins/mgw-mdw-auth/{mgw-mdw-auth.request.js.map → mgw-mdw-auth-request.js.map} +1 -1
- package/src/plugins/mock-intercept/index.d.ts +2 -2
- package/src/plugins/mock-intercept/index.js +2 -2
- package/src/plugins/mock-intercept/{mock-intercept.interface.d.ts → mock-intercept-interface.d.ts} +1 -1
- package/src/plugins/mock-intercept/{mock-intercept.interface.d.ts.map → mock-intercept-interface.d.ts.map} +1 -1
- package/src/plugins/mock-intercept/{mock-intercept.interface.js → mock-intercept-interface.js} +1 -1
- package/src/plugins/mock-intercept/mock-intercept-interface.js.map +1 -0
- package/src/plugins/mock-intercept/{mock-intercept.request.d.ts → mock-intercept-request.d.ts} +2 -2
- package/src/plugins/mock-intercept/{mock-intercept.request.d.ts.map → mock-intercept-request.d.ts.map} +1 -1
- package/src/plugins/mock-intercept/{mock-intercept.request.js → mock-intercept-request.js} +2 -2
- package/src/plugins/mock-intercept/{mock-intercept.request.js.map → mock-intercept-request.js.map} +1 -1
- package/src/plugins/open-telemetry/traceparent/index.d.ts +2 -2
- package/src/plugins/open-telemetry/traceparent/index.js +2 -2
- package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.d.ts → open-telemetry-traceparent-reply.d.ts} +1 -1
- package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.d.ts.map → open-telemetry-traceparent-reply.d.ts.map} +1 -1
- package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.js → open-telemetry-traceparent-reply.js} +1 -1
- package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.js.map → open-telemetry-traceparent-reply.js.map} +1 -1
- package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.d.ts → open-telemetry-traceparent-request.d.ts} +1 -1
- package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.d.ts.map → open-telemetry-traceparent-request.d.ts.map} +1 -1
- package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.js → open-telemetry-traceparent-request.js} +1 -1
- package/src/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.js.map → open-telemetry-traceparent-request.js.map} +1 -1
- package/src/plugins/pii-tokenizer/index.d.ts +1 -1
- package/src/plugins/pii-tokenizer/index.js +1 -1
- package/src/plugins/pii-tokenizer/{pii-tokenizer.request.d.ts → pii-tokenizer-request.d.ts} +1 -1
- package/src/plugins/pii-tokenizer/{pii-tokenizer.request.d.ts.map → pii-tokenizer-request.d.ts.map} +1 -1
- package/src/plugins/pii-tokenizer/{pii-tokenizer.request.js → pii-tokenizer-request.js} +1 -1
- package/src/plugins/pii-tokenizer/{pii-tokenizer.request.js.map → pii-tokenizer-request.js.map} +1 -1
- package/src/plugins/raw-response-info/index.d.ts +1 -1
- package/src/plugins/raw-response-info/index.js +1 -1
- package/src/plugins/raw-response-info/{raw-response-info.reply.d.ts → raw-response-info-reply.d.ts} +1 -1
- package/src/plugins/raw-response-info/{raw-response-info.reply.d.ts.map → raw-response-info-reply.d.ts.map} +1 -1
- package/src/plugins/raw-response-info/{raw-response-info.reply.js → raw-response-info-reply.js} +1 -1
- package/src/plugins/raw-response-info/{raw-response-info.reply.js.map → raw-response-info-reply.js.map} +1 -1
- package/src/plugins/reviver/index.d.ts +1 -1
- package/src/plugins/reviver/index.js +1 -1
- package/src/plugins/reviver/{reviver.reply.d.ts → reviver-reply.d.ts} +1 -1
- package/src/plugins/reviver/{reviver.reply.d.ts.map → reviver-reply.d.ts.map} +1 -1
- package/src/plugins/reviver/{reviver.reply.js → reviver-reply.js} +1 -1
- package/src/plugins/reviver/{reviver.reply.js.map → reviver-reply.js.map} +1 -1
- package/src/plugins/session-id/index.d.ts +1 -1
- package/src/plugins/session-id/index.js +1 -1
- package/src/plugins/session-id/{session-id.request.d.ts → session-id-request.d.ts} +1 -1
- package/src/plugins/session-id/{session-id.request.d.ts.map → session-id-request.d.ts.map} +1 -1
- package/src/plugins/session-id/{session-id.request.js → session-id-request.js} +1 -1
- package/src/plugins/session-id/{session-id.request.js.map → session-id-request.js.map} +1 -1
- package/src/plugins/si-token/index.d.ts +1 -1
- package/src/plugins/si-token/index.js +1 -1
- package/src/plugins/si-token/{si-token.request.d.ts → si-token-request.d.ts} +1 -1
- package/src/plugins/si-token/{si-token.request.d.ts.map → si-token-request.d.ts.map} +1 -1
- package/src/plugins/si-token/{si-token.request.js → si-token-request.js} +1 -1
- package/src/plugins/si-token/{si-token.request.js.map → si-token-request.js.map} +1 -1
- package/src/plugins/simple-api-key-authentication/index.d.ts +1 -1
- package/src/plugins/simple-api-key-authentication/index.js +1 -1
- package/src/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.d.ts → simple-api-key-authentication-request.d.ts} +1 -1
- 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
- package/src/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.js → simple-api-key-authentication-request.js} +1 -1
- package/src/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.js.map → simple-api-key-authentication-request.js.map} +1 -1
- package/src/plugins/url-rewrite/index.d.ts +1 -1
- package/src/plugins/url-rewrite/index.js +1 -1
- package/src/plugins/url-rewrite/{url-rewrite.request.d.ts → url-rewrite-request.d.ts} +1 -1
- package/src/plugins/url-rewrite/{url-rewrite.request.d.ts.map → url-rewrite-request.d.ts.map} +1 -1
- package/src/plugins/url-rewrite/{url-rewrite.request.js → url-rewrite-request.js} +1 -1
- package/src/plugins/url-rewrite/{url-rewrite.request.js.map → url-rewrite-request.js.map} +1 -1
- package/src/utils/perf/index.d.ts +1 -1
- package/src/utils/perf/index.d.ts.map +1 -1
- package/src/utils/perf/index.js +1 -1
- package/src/utils/perf/index.js.map +1 -1
- package/src/utils/perf/{perf-metric.service.d.ts → perf-metric.d.ts} +1 -1
- package/src/utils/perf/perf-metric.d.ts.map +1 -0
- package/src/utils/perf/{perf-metric.service.js → perf-metric.js} +1 -1
- package/src/utils/perf/perf-metric.js.map +1 -0
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/schema.js.map +0 -1
- package/src/fwk/api.interface.js +0 -2
- package/src/fwk/api.interface.js.map +0 -1
- package/src/fwk/ignore-enum.type.js +0 -2
- package/src/fwk/ignore-enum.type.js.map +0 -1
- package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.helpers.d.ts.map +0 -1
- package/src/plugins/mock-intercept/mock-intercept.interface.js.map +0 -1
- package/src/utils/perf/perf-metric.service.d.ts.map +0 -1
- package/src/utils/perf/perf-metric.service.js.map +0 -1
- /package/cjs/fwk/{api.helpers.js → api-helpers.js} +0 -0
- /package/cjs/fwk/{api.helper.spec.js → api-helpers.spec.js} +0 -0
- /package/cjs/fwk/{api.interface.js → api-interface.js} +0 -0
- /package/cjs/fwk/{ignore-enum.type.js → ignore-enum-type.js} +0 -0
- /package/cjs/plugins/api-configuration-override/{api-configuration-override.request.js → api-configuration-override-request.js} +0 -0
- /package/cjs/plugins/api-key/{api-key.request.js → api-key-request.js} +0 -0
- /package/cjs/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.js → bot-protection-fingerprint-request.js} +0 -0
- /package/cjs/plugins/client-facts/{client-facts.request.js → client-facts-request.js} +0 -0
- /package/cjs/plugins/custom-info/{custom-info.reply.js → custom-info-reply.js} +0 -0
- /package/cjs/plugins/exception/{exception.reply.js → exception-reply.js} +0 -0
- /package/cjs/plugins/fetch-cache/{fetch-cache.request.js → fetch-cache-request.js} +0 -0
- /package/cjs/plugins/fetch-credentials/{fetch-credentials.request.js → fetch-credentials-request.js} +0 -0
- /package/cjs/plugins/json-token/{json-token.reply.js → json-token-reply.js} +0 -0
- /package/cjs/plugins/json-token/{json-token.request.js → json-token-request.js} +0 -0
- /package/cjs/plugins/mgw-mdw-auth/{mgw-mdw-auth.helpers.js → mgw-mdw-auth-helpers.js} +0 -0
- /package/cjs/plugins/mock-intercept/{mock-intercept.interface.js → mock-intercept-interface.js} +0 -0
- /package/cjs/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.js → open-telemetry-traceparent-reply.js} +0 -0
- /package/cjs/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.js → open-telemetry-traceparent-request.js} +0 -0
- /package/cjs/plugins/pii-tokenizer/{pii-tokenizer.request.js → pii-tokenizer-request.js} +0 -0
- /package/cjs/plugins/raw-response-info/{raw-response-info.reply.js → raw-response-info-reply.js} +0 -0
- /package/cjs/plugins/reviver/{reviver.reply.js → reviver-reply.js} +0 -0
- /package/cjs/plugins/session-id/{session-id.request.js → session-id-request.js} +0 -0
- /package/cjs/plugins/si-token/{si-token.request.js → si-token-request.js} +0 -0
- /package/cjs/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.js → simple-api-key-authentication-request.js} +0 -0
- /package/cjs/plugins/url-rewrite/{url-rewrite.request.js → url-rewrite-request.js} +0 -0
- /package/cjs/utils/perf/{perf-metric.service.js → perf-metric.js} +0 -0
- /package/esm2015/fwk/{api.helpers.js → api-helpers.js} +0 -0
- /package/esm2015/fwk/{api.helper.spec.js → api-helpers.spec.js} +0 -0
- /package/esm2015/fwk/{api.interface.js → api-interface.js} +0 -0
- /package/esm2015/fwk/{ignore-enum.type.js → ignore-enum-type.js} +0 -0
- /package/esm2015/plugins/api-configuration-override/{api-configuration-override.request.js → api-configuration-override-request.js} +0 -0
- /package/esm2015/plugins/api-key/{api-key.request.js → api-key-request.js} +0 -0
- /package/esm2015/plugins/bot-protection-fingerprint/{bot-protection-fingerprint.request.js → bot-protection-fingerprint-request.js} +0 -0
- /package/esm2015/plugins/client-facts/{client-facts.request.js → client-facts-request.js} +0 -0
- /package/esm2015/plugins/custom-info/{custom-info.reply.js → custom-info-reply.js} +0 -0
- /package/esm2015/plugins/exception/{exception.reply.js → exception-reply.js} +0 -0
- /package/esm2015/plugins/fetch-cache/{fetch-cache.request.js → fetch-cache-request.js} +0 -0
- /package/esm2015/plugins/fetch-credentials/{fetch-credentials.request.js → fetch-credentials-request.js} +0 -0
- /package/esm2015/plugins/json-token/{json-token.reply.js → json-token-reply.js} +0 -0
- /package/esm2015/plugins/json-token/{json-token.request.js → json-token-request.js} +0 -0
- /package/esm2015/plugins/mock-intercept/{mock-intercept.interface.js → mock-intercept-interface.js} +0 -0
- /package/esm2015/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.reply.js → open-telemetry-traceparent-reply.js} +0 -0
- /package/esm2015/plugins/open-telemetry/traceparent/{open-telemetry.traceparent.request.js → open-telemetry-traceparent-request.js} +0 -0
- /package/esm2015/plugins/pii-tokenizer/{pii-tokenizer.request.js → pii-tokenizer-request.js} +0 -0
- /package/esm2015/plugins/raw-response-info/{raw-response-info.reply.js → raw-response-info-reply.js} +0 -0
- /package/esm2015/plugins/reviver/{reviver.reply.js → reviver-reply.js} +0 -0
- /package/esm2015/plugins/session-id/{session-id.request.js → session-id-request.js} +0 -0
- /package/esm2015/plugins/si-token/{si-token.request.js → si-token-request.js} +0 -0
- /package/esm2015/plugins/simple-api-key-authentication/{simple-api-key-authentication.request.js → simple-api-key-authentication-request.js} +0 -0
- /package/esm2015/plugins/url-rewrite/{url-rewrite.request.js → url-rewrite-request.js} +0 -0
- /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
|
|
39
|
-
| ---------------- |
|
|
40
|
-
| ApiFetchClient | [@ama-sdk/client-fetch](https://npmjs.com/package/@ama-sdk/client-fetch)
|
|
41
|
-
| ApiBeaconClient | @ama-sdk/
|
|
42
|
-
| ApiAngularClient | @ama-sdk/
|
|
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
|
|
7
|
-
_export_star(require("./api
|
|
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
|
|
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
|
|
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
|
+
});
|
package/cjs/plugins/additional-params/{additional-params.request.js → additional-params-request.js}
RENAMED
|
@@ -16,7 +16,7 @@ _export(exports, {
|
|
|
16
16
|
return isStringOrUndefined;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
var _apihelpers = require("../../fwk/api
|
|
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
|
|
11
|
+
var _apihelpers = require("../../fwk/api-helpers");
|
|
12
12
|
var _paramserialization = require("../../fwk/param-serialization");
|
|
13
|
-
var _additionalparamsrequest = require("./additional-params
|
|
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
|
|
6
|
-
var
|
|
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
|
|
6
|
-
_export_star(require("./additional-params
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
6
|
-
_export_star(require("./json-token
|
|
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
|
|
7
|
-
var _jsontokenrequest = require("./json-token
|
|
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);
|