@ama-sdk/core 10.0.0-next.8 → 11.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -31
- package/cjs/clients/api-angular-client.js +6 -2
- package/cjs/clients/api-beacon-client.js +3 -2
- package/cjs/clients/api-fetch-client.js +9 -4
- package/cjs/fwk/Reviver.js +3 -3
- package/cjs/fwk/api.helpers.js +9 -10
- package/cjs/fwk/api.js +2 -2
- package/cjs/fwk/date.js +4 -39
- package/cjs/fwk/errors.js +10 -11
- package/cjs/fwk/index.js +1 -0
- package/cjs/fwk/logger.js +9 -0
- package/cjs/fwk/mocks/alf-mock-adapter.js +1 -8
- package/cjs/fwk/mocks/base-mock-adapter.js +0 -12
- package/cjs/plugins/additional-params/additional-params.request.js +5 -5
- package/cjs/plugins/api-configuration-override/api-configuration-override.request.js +2 -2
- package/cjs/plugins/api-key/api-key.request.js +2 -2
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +77 -105
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +9 -98
- package/cjs/plugins/client-facts/client-facts.request.js +5 -7
- package/cjs/plugins/concurrent/concurrent.fetch.js +2 -2
- package/cjs/plugins/core/plugin.js +1 -3
- package/cjs/plugins/custom-info/custom-info.reply.js +0 -1
- package/cjs/plugins/index.js +0 -21
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +7 -9
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +1 -0
- package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +5 -4
- package/cjs/plugins/mock-intercept/mock-intercept.request.js +3 -3
- package/cjs/plugins/mock-intercept/mock-intercept.spec.js +1 -3
- package/cjs/plugins/perf-metric/perf-metric.fetch.js +2 -5
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +12 -14
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +3 -1
- package/cjs/plugins/retry/retry.fetch.js +2 -3
- package/cjs/plugins/session-id/session-id.request.js +10 -11
- package/cjs/plugins/session-id/session-id.spec.js +12 -8
- package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +2 -4
- package/cjs/plugins/timeout/timeout.fetch.js +75 -15
- package/cjs/plugins/timeout/timeout.spec.js +102 -3
- package/cjs/plugins/url-rewrite/url-rewrite.request.js +2 -2
- package/cjs/plugins/wait-for/wait-for.fetch.js +2 -2
- package/cjs/public_api.js +1 -0
- package/cjs/utils/crypto.js +5 -5
- package/cjs/utils/encoder.js +0 -5
- package/cjs/{plugins/gateway-token → utils}/index.js +5 -2
- package/cjs/utils/json-token.js +11 -13
- package/cjs/utils/json-token.spec.js +4 -2
- package/cjs/utils/mime-types.js +22 -0
- package/cli/clear-index.cjs +25 -0
- package/cli/clear-index.cjs.map +1 -0
- package/cli/clear-index.d.cts +3 -0
- package/cli/clear-index.d.cts.map +1 -0
- package/cli/files-pack.cjs +84 -0
- package/cli/files-pack.cjs.map +1 -0
- package/cli/files-pack.d.cts +3 -0
- package/cli/files-pack.d.cts.map +1 -0
- package/cli/package.json +3 -0
- package/esm2015/clients/api-angular-client.js +6 -2
- package/esm2015/clients/api-beacon-client.js +3 -2
- package/esm2015/clients/api-fetch-client.js +9 -4
- package/esm2015/fwk/Reviver.js +0 -3
- package/esm2015/fwk/api.helpers.js +3 -3
- package/esm2015/fwk/api.interface.js +1 -1
- package/esm2015/fwk/api.js +2 -2
- package/esm2015/fwk/core/api-client.js +0 -1
- package/esm2015/fwk/core/base-api-constructor.js +0 -1
- package/esm2015/fwk/date.js +1 -38
- package/esm2015/fwk/errors.js +2 -3
- package/esm2015/fwk/index.js +1 -0
- package/esm2015/fwk/logger.js +6 -0
- package/esm2015/fwk/mocks/alf-mock-adapter.js +1 -9
- package/esm2015/fwk/mocks/base-mock-adapter.js +0 -12
- package/esm2015/fwk/mocks/encoded-api-request.js +3 -1
- package/esm2015/fwk/mocks/helpers.js +0 -2
- package/esm2015/fwk/mocks/mock-adapter.js +1 -1
- package/esm2015/fwk/mocks/path-object.js +1 -1
- package/esm2015/plugins/additional-params/additional-params.request.js +2 -3
- package/esm2015/plugins/api-configuration-override/api-configuration-override.request.js +2 -3
- package/esm2015/plugins/api-key/api-key.request.js +2 -2
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +84 -118
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +10 -99
- package/esm2015/plugins/client-facts/client-facts.request.js +14 -7
- package/esm2015/plugins/concurrent/concurrent.fetch.js +2 -2
- package/esm2015/plugins/core/fetch-plugin.js +4 -1
- package/esm2015/plugins/core/plugin.js +1 -1
- package/esm2015/plugins/core/reply-plugin.js +4 -1
- package/esm2015/plugins/core/request-plugin.js +4 -1
- package/esm2015/plugins/custom-info/custom-info.reply.js +0 -1
- package/esm2015/plugins/index.js +0 -4
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +3 -7
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +1 -0
- package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +5 -4
- package/esm2015/plugins/mock-intercept/mock-intercept.request.js +3 -3
- package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +1 -3
- package/esm2015/plugins/perf-metric/perf-metric.fetch.js +2 -5
- package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +19 -21
- package/esm2015/plugins/retry/retry.fetch.js +2 -3
- package/esm2015/plugins/session-id/session-id.request.js +10 -11
- package/esm2015/plugins/session-id/session-id.spec.js +12 -8
- package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +10 -10
- package/esm2015/plugins/timeout/timeout.fetch.js +70 -12
- package/esm2015/plugins/timeout/timeout.spec.js +102 -3
- package/esm2015/plugins/url-rewrite/url-rewrite.request.js +2 -2
- package/esm2015/plugins/wait-for/wait-for.fetch.js +4 -3
- package/esm2015/public_api.js +1 -0
- package/esm2015/utils/crypto.js +0 -4
- package/esm2015/utils/encoder.js +0 -5
- package/esm2015/utils/ie11.js +0 -1
- package/esm2015/utils/index.js +5 -0
- package/esm2015/utils/json-token.js +2 -7
- package/esm2015/utils/json-token.spec.js +4 -2
- package/esm2015/utils/mime-types.js +7 -0
- package/package.json +51 -36
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +38 -20
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/schema.json +2 -2
- package/src/clients/api-angular-client.d.ts.map +1 -1
- package/src/clients/api-angular-client.js +3 -2
- package/src/clients/api-angular-client.js.map +1 -1
- package/src/clients/api-beacon-client.d.ts +0 -1
- package/src/clients/api-beacon-client.d.ts.map +1 -1
- package/src/clients/api-beacon-client.js +1 -3
- package/src/clients/api-beacon-client.js.map +1 -1
- package/src/clients/api-fetch-client.d.ts +0 -1
- package/src/clients/api-fetch-client.d.ts.map +1 -1
- package/src/clients/api-fetch-client.js +5 -5
- package/src/clients/api-fetch-client.js.map +1 -1
- package/src/fwk/Reviver.d.ts +0 -3
- package/src/fwk/Reviver.d.ts.map +1 -1
- package/src/fwk/Reviver.js +0 -3
- package/src/fwk/Reviver.js.map +1 -1
- package/src/fwk/api.helpers.d.ts +2 -1
- package/src/fwk/api.helpers.d.ts.map +1 -1
- package/src/fwk/api.helpers.js +2 -1
- package/src/fwk/api.helpers.js.map +1 -1
- package/src/fwk/core/api-client.d.ts +0 -4
- package/src/fwk/core/api-client.d.ts.map +1 -1
- package/src/fwk/core/api-client.js +0 -1
- package/src/fwk/core/api-client.js.map +1 -1
- package/src/fwk/core/base-api-constructor.d.ts +3 -2
- package/src/fwk/core/base-api-constructor.d.ts.map +1 -1
- package/src/fwk/core/base-api-constructor.js +0 -1
- package/src/fwk/core/base-api-constructor.js.map +1 -1
- package/src/fwk/date.d.ts +0 -15
- package/src/fwk/date.d.ts.map +1 -1
- package/src/fwk/date.js +0 -36
- package/src/fwk/date.js.map +1 -1
- package/src/fwk/index.d.ts +1 -0
- package/src/fwk/index.d.ts.map +1 -1
- package/src/fwk/index.js +1 -0
- package/src/fwk/index.js.map +1 -1
- package/src/fwk/logger.d.ts +39 -0
- package/src/fwk/logger.d.ts.map +1 -0
- package/src/fwk/logger.js +2 -0
- package/src/fwk/logger.js.map +1 -0
- package/src/fwk/mocks/alf-mock-adapter.d.ts +0 -1
- package/src/fwk/mocks/alf-mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/alf-mock-adapter.js +0 -7
- package/src/fwk/mocks/alf-mock-adapter.js.map +1 -1
- package/src/fwk/mocks/base-mock-adapter.d.ts +0 -4
- package/src/fwk/mocks/base-mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/base-mock-adapter.js +0 -10
- package/src/fwk/mocks/base-mock-adapter.js.map +1 -1
- package/src/fwk/mocks/helpers.d.ts +0 -2
- package/src/fwk/mocks/helpers.d.ts.map +1 -1
- package/src/fwk/mocks/helpers.js +0 -2
- package/src/fwk/mocks/helpers.js.map +1 -1
- package/src/fwk/mocks/mock-adapter.d.ts +0 -10
- package/src/fwk/mocks/mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/random-mock-adapter.d.ts +1 -1
- package/src/fwk/mocks/random-mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/random-mock-adapter.js.map +1 -1
- package/src/plugins/additional-params/additional-params-sync.request.d.ts +1 -2
- package/src/plugins/additional-params/additional-params-sync.request.d.ts.map +1 -1
- package/src/plugins/additional-params/additional-params-sync.request.js +0 -1
- package/src/plugins/additional-params/additional-params-sync.request.js.map +1 -1
- package/src/plugins/additional-params/additional-params.request.d.ts +1 -3
- package/src/plugins/additional-params/additional-params.request.d.ts.map +1 -1
- package/src/plugins/additional-params/additional-params.request.js +0 -2
- package/src/plugins/additional-params/additional-params.request.js.map +1 -1
- package/src/plugins/api-configuration-override/api-configuration-override.request.d.ts +2 -4
- package/src/plugins/api-configuration-override/api-configuration-override.request.d.ts.map +1 -1
- package/src/plugins/api-configuration-override/api-configuration-override.request.js +0 -2
- package/src/plugins/api-configuration-override/api-configuration-override.request.js.map +1 -1
- package/src/plugins/api-key/api-key.request.d.ts +2 -3
- package/src/plugins/api-key/api-key.request.d.ts.map +1 -1
- package/src/plugins/api-key/api-key.request.js +0 -1
- package/src/plugins/api-key/api-key.request.js.map +1 -1
- package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.d.ts +16 -31
- package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.d.ts.map +1 -1
- package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +20 -61
- package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js.map +1 -1
- package/src/plugins/client-facts/client-facts.request.d.ts +15 -8
- package/src/plugins/client-facts/client-facts.request.d.ts.map +1 -1
- package/src/plugins/client-facts/client-facts.request.js +12 -5
- package/src/plugins/client-facts/client-facts.request.js.map +1 -1
- package/src/plugins/concurrent/concurrent.fetch.d.ts +1 -2
- package/src/plugins/concurrent/concurrent.fetch.d.ts.map +1 -1
- package/src/plugins/concurrent/concurrent.fetch.js +0 -1
- package/src/plugins/concurrent/concurrent.fetch.js.map +1 -1
- package/src/plugins/core/fetch-plugin.d.ts +7 -4
- package/src/plugins/core/fetch-plugin.d.ts.map +1 -1
- package/src/plugins/core/plugin.d.ts +15 -2
- package/src/plugins/core/plugin.d.ts.map +1 -1
- package/src/plugins/core/reply-plugin.d.ts +8 -5
- package/src/plugins/core/reply-plugin.d.ts.map +1 -1
- package/src/plugins/core/request-plugin.d.ts +11 -3
- package/src/plugins/core/request-plugin.d.ts.map +1 -1
- package/src/plugins/custom-info/custom-info.reply.d.ts +1 -3
- package/src/plugins/custom-info/custom-info.reply.d.ts.map +1 -1
- package/src/plugins/custom-info/custom-info.reply.js +0 -2
- package/src/plugins/custom-info/custom-info.reply.js.map +1 -1
- package/src/plugins/exception/exception.reply.d.ts +1 -1
- package/src/plugins/exception/exception.reply.d.ts.map +1 -1
- package/src/plugins/exception/exception.reply.js.map +1 -1
- package/src/plugins/fetch-cache/fetch-cache.request.d.ts +3 -3
- package/src/plugins/fetch-cache/fetch-cache.request.d.ts.map +1 -1
- package/src/plugins/fetch-credentials/fetch-credentials.request.d.ts +1 -1
- package/src/plugins/fetch-credentials/fetch-credentials.request.d.ts.map +1 -1
- package/src/plugins/index.d.ts +0 -4
- package/src/plugins/index.d.ts.map +1 -1
- package/src/plugins/index.js +0 -4
- package/src/plugins/index.js.map +1 -1
- package/src/plugins/json-token/json-token.reply.d.ts +0 -1
- package/src/plugins/json-token/json-token.reply.d.ts.map +1 -1
- package/src/plugins/json-token/json-token.reply.js +0 -1
- package/src/plugins/json-token/json-token.reply.js.map +1 -1
- package/src/plugins/json-token/json-token.request.d.ts +2 -3
- package/src/plugins/json-token/json-token.request.d.ts.map +1 -1
- package/src/plugins/json-token/json-token.request.js +0 -1
- package/src/plugins/json-token/json-token.request.js.map +1 -1
- package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.d.ts +2 -8
- package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.d.ts.map +1 -1
- package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +0 -6
- package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.fetch.d.ts.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.fetch.js +3 -2
- package/src/plugins/mock-intercept/mock-intercept.fetch.js.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.request.d.ts +1 -1
- package/src/plugins/mock-intercept/mock-intercept.request.d.ts.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.request.js +1 -1
- package/src/plugins/mock-intercept/mock-intercept.request.js.map +1 -1
- package/src/plugins/perf-metric/perf-metric.fetch.d.ts +0 -3
- package/src/plugins/perf-metric/perf-metric.fetch.d.ts.map +1 -1
- package/src/plugins/perf-metric/perf-metric.fetch.js +0 -3
- package/src/plugins/perf-metric/perf-metric.fetch.js.map +1 -1
- package/src/plugins/pii-tokenizer/pii-tokenizer.request.d.ts +19 -21
- package/src/plugins/pii-tokenizer/pii-tokenizer.request.d.ts.map +1 -1
- package/src/plugins/pii-tokenizer/pii-tokenizer.request.js +18 -20
- package/src/plugins/pii-tokenizer/pii-tokenizer.request.js.map +1 -1
- package/src/plugins/retry/retry.fetch.d.ts +8 -7
- package/src/plugins/retry/retry.fetch.d.ts.map +1 -1
- package/src/plugins/retry/retry.fetch.js +0 -2
- package/src/plugins/retry/retry.fetch.js.map +1 -1
- package/src/plugins/session-id/session-id.request.d.ts +7 -6
- package/src/plugins/session-id/session-id.request.d.ts.map +1 -1
- package/src/plugins/session-id/session-id.request.js +11 -12
- package/src/plugins/session-id/session-id.request.js.map +1 -1
- package/src/plugins/si-token/si-token.request.d.ts +0 -1
- package/src/plugins/si-token/si-token.request.d.ts.map +1 -1
- package/src/plugins/si-token/si-token.request.js +0 -1
- package/src/plugins/si-token/si-token.request.js.map +1 -1
- package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.d.ts +10 -11
- package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.d.ts.map +1 -1
- package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +8 -9
- package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js.map +1 -1
- package/src/plugins/timeout/timeout.fetch.d.ts +31 -2
- package/src/plugins/timeout/timeout.fetch.d.ts.map +1 -1
- package/src/plugins/timeout/timeout.fetch.js +62 -10
- package/src/plugins/timeout/timeout.fetch.js.map +1 -1
- package/src/plugins/url-rewrite/url-rewrite.request.d.ts +1 -2
- package/src/plugins/url-rewrite/url-rewrite.request.d.ts.map +1 -1
- package/src/plugins/url-rewrite/url-rewrite.request.js +0 -1
- package/src/plugins/url-rewrite/url-rewrite.request.js.map +1 -1
- package/src/plugins/wait-for/wait-for.fetch.d.ts +2 -3
- package/src/plugins/wait-for/wait-for.fetch.d.ts.map +1 -1
- package/src/plugins/wait-for/wait-for.fetch.js +2 -2
- package/src/plugins/wait-for/wait-for.fetch.js.map +1 -1
- package/src/public_api.d.ts +1 -0
- package/src/public_api.d.ts.map +1 -1
- package/src/public_api.js +1 -0
- package/src/public_api.js.map +1 -1
- package/src/utils/crypto.d.ts +0 -4
- package/src/utils/crypto.d.ts.map +1 -1
- package/src/utils/crypto.js +0 -4
- package/src/utils/crypto.js.map +1 -1
- package/src/utils/encoder.d.ts +0 -1
- package/src/utils/encoder.d.ts.map +1 -1
- package/src/utils/encoder.js +0 -5
- package/src/utils/encoder.js.map +1 -1
- package/src/utils/ie11.d.ts +0 -1
- package/src/utils/ie11.d.ts.map +1 -1
- package/src/utils/ie11.js +0 -1
- package/src/utils/ie11.js.map +1 -1
- package/src/utils/index.d.ts +6 -0
- package/src/utils/index.d.ts.map +1 -0
- package/src/utils/index.js +6 -0
- package/src/utils/index.js.map +1 -0
- package/src/utils/json-token.d.ts +0 -3
- package/src/utils/json-token.d.ts.map +1 -1
- package/src/utils/json-token.js +0 -5
- package/src/utils/json-token.js.map +1 -1
- package/src/utils/mime-types.d.ts +7 -0
- package/src/utils/mime-types.d.ts.map +1 -0
- package/src/utils/mime-types.js +9 -0
- package/src/utils/mime-types.js.map +1 -0
- package/cjs/plugins/fetch-options/fetch-options.request.js +0 -87
- package/cjs/plugins/fetch-options/fetch-options.spec.js +0 -280
- package/cjs/plugins/fetch-options/index.js +0 -18
- package/cjs/plugins/gateway-token/gateway-authentication.js +0 -275
- package/cjs/plugins/gateway-token/gateway-token.request.js +0 -388
- package/cjs/plugins/gateway-token/gateway-token.spec.js +0 -360
- package/cjs/plugins/imperva/imperva.fetch.js +0 -307
- package/cjs/plugins/imperva/imperva.spec.js +0 -347
- package/cjs/plugins/imperva/index.js +0 -18
- package/cjs/plugins/public-facts/index.js +0 -18
- package/cjs/plugins/public-facts/public-facts.request.js +0 -101
- package/cjs/plugins/public-facts/public-facts.spec.js +0 -367
- package/esm2015/plugins/fetch-options/fetch-options.request.js +0 -81
- package/esm2015/plugins/fetch-options/fetch-options.spec.js +0 -276
- package/esm2015/plugins/fetch-options/index.js +0 -1
- package/esm2015/plugins/gateway-token/gateway-authentication.js +0 -262
- package/esm2015/plugins/gateway-token/gateway-token.request.js +0 -406
- package/esm2015/plugins/gateway-token/gateway-token.spec.js +0 -356
- package/esm2015/plugins/gateway-token/index.js +0 -2
- package/esm2015/plugins/imperva/imperva.fetch.js +0 -303
- package/esm2015/plugins/imperva/imperva.spec.js +0 -343
- package/esm2015/plugins/imperva/index.js +0 -1
- package/esm2015/plugins/public-facts/index.js +0 -1
- package/esm2015/plugins/public-facts/public-facts.request.js +0 -138
- package/esm2015/plugins/public-facts/public-facts.spec.js +0 -363
- package/src/plugins/fetch-options/fetch-options.request.d.ts +0 -26
- package/src/plugins/fetch-options/fetch-options.request.d.ts.map +0 -1
- package/src/plugins/fetch-options/fetch-options.request.js +0 -22
- package/src/plugins/fetch-options/fetch-options.request.js.map +0 -1
- package/src/plugins/fetch-options/index.d.ts +0 -2
- package/src/plugins/fetch-options/index.d.ts.map +0 -1
- package/src/plugins/fetch-options/index.js +0 -2
- package/src/plugins/fetch-options/index.js.map +0 -1
- package/src/plugins/gateway-token/gateway-authentication.d.ts +0 -105
- package/src/plugins/gateway-token/gateway-authentication.d.ts.map +0 -1
- package/src/plugins/gateway-token/gateway-authentication.js +0 -74
- package/src/plugins/gateway-token/gateway-authentication.js.map +0 -1
- package/src/plugins/gateway-token/gateway-token.request.d.ts +0 -97
- package/src/plugins/gateway-token/gateway-token.request.d.ts.map +0 -1
- package/src/plugins/gateway-token/gateway-token.request.js +0 -127
- package/src/plugins/gateway-token/gateway-token.request.js.map +0 -1
- package/src/plugins/gateway-token/index.d.ts +0 -3
- package/src/plugins/gateway-token/index.d.ts.map +0 -1
- package/src/plugins/gateway-token/index.js +0 -3
- package/src/plugins/gateway-token/index.js.map +0 -1
- package/src/plugins/imperva/imperva.fetch.d.ts +0 -33
- package/src/plugins/imperva/imperva.fetch.d.ts.map +0 -1
- package/src/plugins/imperva/imperva.fetch.js +0 -41
- package/src/plugins/imperva/imperva.fetch.js.map +0 -1
- package/src/plugins/imperva/index.d.ts +0 -2
- package/src/plugins/imperva/index.d.ts.map +0 -1
- package/src/plugins/imperva/index.js +0 -2
- package/src/plugins/imperva/index.js.map +0 -1
- package/src/plugins/public-facts/index.d.ts +0 -2
- package/src/plugins/public-facts/index.d.ts.map +0 -1
- package/src/plugins/public-facts/index.js +0 -2
- package/src/plugins/public-facts/index.js.map +0 -1
- package/src/plugins/public-facts/public-facts.request.d.ts +0 -89
- package/src/plugins/public-facts/public-facts.request.d.ts.map +0 -1
- package/src/plugins/public-facts/public-facts.request.js +0 -62
- package/src/plugins/public-facts/public-facts.request.js.map +0 -1
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
-
try {
|
|
3
|
-
var info = gen[key](arg);
|
|
4
|
-
var value = info.value;
|
|
5
|
-
} catch (error) {
|
|
6
|
-
reject(error);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (info.done) {
|
|
10
|
-
resolve(value);
|
|
11
|
-
} else {
|
|
12
|
-
Promise.resolve(value).then(_next, _throw);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _async_to_generator(fn) {
|
|
16
|
-
return function() {
|
|
17
|
-
var self = this, args = arguments;
|
|
18
|
-
return new Promise(function(resolve, reject) {
|
|
19
|
-
var gen = fn.apply(self, args);
|
|
20
|
-
function _next(value) {
|
|
21
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
-
}
|
|
23
|
-
function _throw(err) {
|
|
24
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
-
}
|
|
26
|
-
_next(undefined);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function _class_call_check(instance, Constructor) {
|
|
31
|
-
if (!(instance instanceof Constructor)) {
|
|
32
|
-
throw new TypeError("Cannot call a class as a function");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function _defineProperties(target, props) {
|
|
36
|
-
for(var i = 0; i < props.length; i++){
|
|
37
|
-
var descriptor = props[i];
|
|
38
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
39
|
-
descriptor.configurable = true;
|
|
40
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
41
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
45
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
46
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
47
|
-
return Constructor;
|
|
48
|
-
}
|
|
49
|
-
function _define_property(obj, key, value) {
|
|
50
|
-
if (key in obj) {
|
|
51
|
-
Object.defineProperty(obj, key, {
|
|
52
|
-
value: value,
|
|
53
|
-
enumerable: true,
|
|
54
|
-
configurable: true,
|
|
55
|
-
writable: true
|
|
56
|
-
});
|
|
57
|
-
} else {
|
|
58
|
-
obj[key] = value;
|
|
59
|
-
}
|
|
60
|
-
return obj;
|
|
61
|
-
}
|
|
62
|
-
function _ts_generator(thisArg, body) {
|
|
63
|
-
var f, y, t, g, _ = {
|
|
64
|
-
label: 0,
|
|
65
|
-
sent: function() {
|
|
66
|
-
if (t[0] & 1) throw t[1];
|
|
67
|
-
return t[1];
|
|
68
|
-
},
|
|
69
|
-
trys: [],
|
|
70
|
-
ops: []
|
|
71
|
-
};
|
|
72
|
-
return(g = {
|
|
73
|
-
next: verb(0),
|
|
74
|
-
"throw": verb(1),
|
|
75
|
-
"return": verb(2)
|
|
76
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
77
|
-
return this;
|
|
78
|
-
}), g);
|
|
79
|
-
function verb(n) {
|
|
80
|
-
return function(v) {
|
|
81
|
-
return step([
|
|
82
|
-
n,
|
|
83
|
-
v
|
|
84
|
-
]);
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function step(op) {
|
|
88
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
89
|
-
while(_)try {
|
|
90
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
91
|
-
if (y = 0, t) op = [
|
|
92
|
-
op[0] & 2,
|
|
93
|
-
t.value
|
|
94
|
-
];
|
|
95
|
-
switch(op[0]){
|
|
96
|
-
case 0:
|
|
97
|
-
case 1:
|
|
98
|
-
t = op;
|
|
99
|
-
break;
|
|
100
|
-
case 4:
|
|
101
|
-
_.label++;
|
|
102
|
-
return {
|
|
103
|
-
value: op[1],
|
|
104
|
-
done: false
|
|
105
|
-
};
|
|
106
|
-
case 5:
|
|
107
|
-
_.label++;
|
|
108
|
-
y = op[1];
|
|
109
|
-
op = [
|
|
110
|
-
0
|
|
111
|
-
];
|
|
112
|
-
continue;
|
|
113
|
-
case 7:
|
|
114
|
-
op = _.ops.pop();
|
|
115
|
-
_.trys.pop();
|
|
116
|
-
continue;
|
|
117
|
-
default:
|
|
118
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
119
|
-
_ = 0;
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
123
|
-
_.label = op[1];
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
127
|
-
_.label = t[1];
|
|
128
|
-
t = op;
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
if (t && _.label < t[2]) {
|
|
132
|
-
_.label = t[2];
|
|
133
|
-
_.ops.push(op);
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
if (t[2]) _.ops.pop();
|
|
137
|
-
_.trys.pop();
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
op = body.call(thisArg, _);
|
|
141
|
-
} catch (e) {
|
|
142
|
-
op = [
|
|
143
|
-
6,
|
|
144
|
-
e
|
|
145
|
-
];
|
|
146
|
-
y = 0;
|
|
147
|
-
} finally{
|
|
148
|
-
f = t = 0;
|
|
149
|
-
}
|
|
150
|
-
if (op[0] & 5) throw op[1];
|
|
151
|
-
return {
|
|
152
|
-
value: op[0] ? op[1] : void 0,
|
|
153
|
-
done: true
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
import { ApiFetchClient } from "../../clients";
|
|
158
|
-
import { AdditionalParamsRequest } from "../additional-params";
|
|
159
|
-
import { ExceptionReply } from "../exception";
|
|
160
|
-
import { FetchCredentialsRequest } from "../fetch-credentials";
|
|
161
|
-
import { Oauth2Api } from "./gateway-authentication";
|
|
162
|
-
/**
|
|
163
|
-
* Plugin to get the gateway access token and save it
|
|
164
|
-
* @deprecated please use AmadeusGatewayTokenRequestPlugin from @ama-sdk/amadeus-gateway-sdk instead, will be removed in v10
|
|
165
|
-
* @example
|
|
166
|
-
* When configuring the ApiManager
|
|
167
|
-
* ```typescript
|
|
168
|
-
* const defaultGatewayAPIConfig = {
|
|
169
|
-
* baseUrl: 'https://my-gateway.com',
|
|
170
|
-
* gatewayClientId: 'RgquoWaPkKmZ7acKUu1A2meEYVo94az7',
|
|
171
|
-
* gatewayClientSecret: 'AdUgFh4hu1dUUIE1'
|
|
172
|
-
* };
|
|
173
|
-
*
|
|
174
|
-
* const gatewayPlugin = new GatewayTokenRequestPlugin(
|
|
175
|
-
* `${defaultGatewayAPIConfig.baseUrl}/v1/security/oauth2`,
|
|
176
|
-
* defaultGatewayAPIConfig.gatewayClientId,
|
|
177
|
-
* defaultGatewayAPIConfig.gatewayClientSecret
|
|
178
|
-
* );
|
|
179
|
-
*
|
|
180
|
-
* // Api which needs the gateway access
|
|
181
|
-
* const myApiConfiguration: ApiConfiguration = {
|
|
182
|
-
* basePath: myBasePath,
|
|
183
|
-
* requestPlugins: [
|
|
184
|
-
* ...
|
|
185
|
-
* gatewayPlugin
|
|
186
|
-
* ...
|
|
187
|
-
* ],
|
|
188
|
-
* replyPlugins: [...]
|
|
189
|
-
* };
|
|
190
|
-
*/ export var GatewayTokenRequestPlugin = /*#__PURE__*/ function() {
|
|
191
|
-
"use strict";
|
|
192
|
-
function GatewayTokenRequestPlugin(gatewayUrl, gatewayClientId, gatewayClientPrivate, basePath, guestOfficeId) {
|
|
193
|
-
var storageTokenKey = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "gateway-auth-tokens";
|
|
194
|
-
_class_call_check(this, GatewayTokenRequestPlugin);
|
|
195
|
-
_define_property(this, "storageTokenKey", void 0);
|
|
196
|
-
/**
|
|
197
|
-
* Default expiration time on the token in seconds
|
|
198
|
-
* Corresponds to 8 hours
|
|
199
|
-
*/ _define_property(this, "DEFAULT_EXPIRATION_TIME_S", void 0);
|
|
200
|
-
/**
|
|
201
|
-
* Buffer time in milliseconds. Allows to regenerate a new token before the expiration of the token.
|
|
202
|
-
* Corresponds to 5 minutes
|
|
203
|
-
*/ _define_property(this, "EXPIRATION_TIME_BUFFER_MS", void 0);
|
|
204
|
-
/**
|
|
205
|
-
* Promise of gateway URL
|
|
206
|
-
*/ _define_property(this, "gatewayUrl", void 0);
|
|
207
|
-
/**
|
|
208
|
-
* Promise of gateway client id
|
|
209
|
-
*/ _define_property(this, "gatewayClientId", void 0);
|
|
210
|
-
/**
|
|
211
|
-
* Promise of gateway client secret
|
|
212
|
-
*/ _define_property(this, "gatewayClientPrivate", void 0);
|
|
213
|
-
/**
|
|
214
|
-
* guestOfficeId is either a method to be ran before each call to the Api Gateway to determine what is the guest
|
|
215
|
-
* office ID to be used, or a Promise of office ID
|
|
216
|
-
*/ _define_property(this, "guestOfficeId", void 0);
|
|
217
|
-
/**
|
|
218
|
-
* Promise of the gateway call
|
|
219
|
-
*/ _define_property(this, "gatewayCallPromise", void 0);
|
|
220
|
-
/** API Client */ _define_property(this, "apiClient", void 0);
|
|
221
|
-
this.storageTokenKey = storageTokenKey;
|
|
222
|
-
this.DEFAULT_EXPIRATION_TIME_S = 28800;
|
|
223
|
-
this.EXPIRATION_TIME_BUFFER_MS = 300000;
|
|
224
|
-
this.gatewayUrl = Promise.resolve(gatewayUrl);
|
|
225
|
-
this.gatewayClientId = Promise.resolve(gatewayClientId);
|
|
226
|
-
this.gatewayClientPrivate = Promise.resolve(gatewayClientPrivate);
|
|
227
|
-
this.guestOfficeId = guestOfficeId;
|
|
228
|
-
this.apiClient = new ApiFetchClient({
|
|
229
|
-
requestPlugins: [
|
|
230
|
-
new FetchCredentialsRequest()
|
|
231
|
-
],
|
|
232
|
-
replyPlugins: [
|
|
233
|
-
new ExceptionReply()
|
|
234
|
-
],
|
|
235
|
-
basePath: basePath
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
_create_class(GatewayTokenRequestPlugin, [
|
|
239
|
-
{
|
|
240
|
-
key: "getStoreAuthHeader",
|
|
241
|
-
value: /**
|
|
242
|
-
* Check if the gateway authorization token is stored and include it in the Authorization header.
|
|
243
|
-
* If it is not stored yet, a call is triggered to the gateway in order to get this authorization token.
|
|
244
|
-
* @param gatewayUrl URL of the gateway
|
|
245
|
-
* @param gatewayClientId Client id related to the gateway client configuration
|
|
246
|
-
* @param gatewayClientPrivate Client private related to the gateway client configuration
|
|
247
|
-
* @param guestOfficeId office ID to be used instead of the default one
|
|
248
|
-
* office ID to be used
|
|
249
|
-
*/ function getStoreAuthHeader(gatewayUrl, gatewayClientId, gatewayClientPrivate, guestOfficeId) {
|
|
250
|
-
var _this = this;
|
|
251
|
-
return _async_to_generator(function() {
|
|
252
|
-
var gatewayApi, storedTokens, storedTokensParsed, officeId, _tmp, key, token, response, e;
|
|
253
|
-
return _ts_generator(this, function(_state) {
|
|
254
|
-
switch(_state.label){
|
|
255
|
-
case 0:
|
|
256
|
-
_this.apiClient.options.basePath = gatewayUrl;
|
|
257
|
-
gatewayApi = new Oauth2Api(_this.apiClient);
|
|
258
|
-
storedTokens = typeof sessionStorage !== "undefined" ? sessionStorage.getItem(_this.storageTokenKey) : null;
|
|
259
|
-
storedTokensParsed = storedTokens ? JSON.parse(storedTokens) : {};
|
|
260
|
-
if (!(typeof guestOfficeId === "function")) return [
|
|
261
|
-
3,
|
|
262
|
-
2
|
|
263
|
-
];
|
|
264
|
-
return [
|
|
265
|
-
4,
|
|
266
|
-
guestOfficeId()
|
|
267
|
-
];
|
|
268
|
-
case 1:
|
|
269
|
-
_tmp = _state.sent();
|
|
270
|
-
return [
|
|
271
|
-
3,
|
|
272
|
-
4
|
|
273
|
-
];
|
|
274
|
-
case 2:
|
|
275
|
-
return [
|
|
276
|
-
4,
|
|
277
|
-
guestOfficeId
|
|
278
|
-
];
|
|
279
|
-
case 3:
|
|
280
|
-
_tmp = _state.sent();
|
|
281
|
-
_state.label = 4;
|
|
282
|
-
case 4:
|
|
283
|
-
officeId = _tmp;
|
|
284
|
-
key = officeId ? "".concat(gatewayClientId, "-").concat(officeId) : "".concat(gatewayClientId, "-default");
|
|
285
|
-
token = storedTokensParsed[key];
|
|
286
|
-
if (!(!token || Date.now() + _this.EXPIRATION_TIME_BUFFER_MS >= token.expiresAt)) return [
|
|
287
|
-
3,
|
|
288
|
-
8
|
|
289
|
-
];
|
|
290
|
-
_state.label = 5;
|
|
291
|
-
case 5:
|
|
292
|
-
_state.trys.push([
|
|
293
|
-
5,
|
|
294
|
-
7,
|
|
295
|
-
,
|
|
296
|
-
8
|
|
297
|
-
]);
|
|
298
|
-
if (!_this.gatewayCallPromise) {
|
|
299
|
-
_this.gatewayCallPromise = gatewayApi.postAccessToken({
|
|
300
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention, camelcase
|
|
301
|
-
bodyToProvide: {
|
|
302
|
-
client_id: gatewayClientId,
|
|
303
|
-
client_secret: gatewayClientPrivate,
|
|
304
|
-
grant_type: "client_credentials",
|
|
305
|
-
guest_office_id: officeId
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
return [
|
|
310
|
-
4,
|
|
311
|
-
_this.gatewayCallPromise
|
|
312
|
-
];
|
|
313
|
-
case 6:
|
|
314
|
-
response = _state.sent();
|
|
315
|
-
_this.gatewayCallPromise = undefined;
|
|
316
|
-
token = {
|
|
317
|
-
token: response.access_token,
|
|
318
|
-
expiresAt: Date.now() + (response.expires_in ? response.expires_in : _this.DEFAULT_EXPIRATION_TIME_S) * 1000
|
|
319
|
-
};
|
|
320
|
-
if (typeof sessionStorage !== "undefined") {
|
|
321
|
-
storedTokensParsed[key] = token;
|
|
322
|
-
sessionStorage.setItem(_this.storageTokenKey, JSON.stringify(storedTokensParsed));
|
|
323
|
-
}
|
|
324
|
-
return [
|
|
325
|
-
3,
|
|
326
|
-
8
|
|
327
|
-
];
|
|
328
|
-
case 7:
|
|
329
|
-
e = _state.sent();
|
|
330
|
-
// eslint-disable-next-line no-console
|
|
331
|
-
console.error("An error occurred when trying to get the gateway authentication token " + e);
|
|
332
|
-
return [
|
|
333
|
-
3,
|
|
334
|
-
8
|
|
335
|
-
];
|
|
336
|
-
case 8:
|
|
337
|
-
if (token) {
|
|
338
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
339
|
-
return [
|
|
340
|
-
2,
|
|
341
|
-
{
|
|
342
|
-
Authorization: "Bearer ".concat(token.token)
|
|
343
|
-
}
|
|
344
|
-
];
|
|
345
|
-
}
|
|
346
|
-
return [
|
|
347
|
-
2,
|
|
348
|
-
{}
|
|
349
|
-
];
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
})();
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
key: "addGatewayToken",
|
|
357
|
-
value: /**
|
|
358
|
-
* Check if the gateway authorization token is stored and include it in the Authorization header.
|
|
359
|
-
* If it is not stored yet, a call is triggered to the gateway in order to get this authorization token.
|
|
360
|
-
* @returns a function that take the actual headers as parameter and return an Promise containing the Authorization header and its value
|
|
361
|
-
*/ function addGatewayToken() {
|
|
362
|
-
var _this = this;
|
|
363
|
-
return function() {
|
|
364
|
-
var _ref = _async_to_generator(function(_headers) {
|
|
365
|
-
var params;
|
|
366
|
-
return _ts_generator(this, function(_state) {
|
|
367
|
-
switch(_state.label){
|
|
368
|
-
case 0:
|
|
369
|
-
return [
|
|
370
|
-
4,
|
|
371
|
-
Promise.all([
|
|
372
|
-
_this.gatewayUrl,
|
|
373
|
-
_this.gatewayClientId,
|
|
374
|
-
_this.gatewayClientPrivate
|
|
375
|
-
])
|
|
376
|
-
];
|
|
377
|
-
case 1:
|
|
378
|
-
params = _state.sent();
|
|
379
|
-
return [
|
|
380
|
-
2,
|
|
381
|
-
_this.getStoreAuthHeader(params[0], params[1], params[2], _this.guestOfficeId)
|
|
382
|
-
];
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
return function(_headers) {
|
|
387
|
-
return _ref.apply(this, arguments);
|
|
388
|
-
};
|
|
389
|
-
}();
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
key: "load",
|
|
394
|
-
value: /**
|
|
395
|
-
* @inheritDoc
|
|
396
|
-
*/ function load() {
|
|
397
|
-
return {
|
|
398
|
-
transform: new AdditionalParamsRequest({
|
|
399
|
-
headers: this.addGatewayToken()
|
|
400
|
-
}).load().transform
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
]);
|
|
405
|
-
return GatewayTokenRequestPlugin;
|
|
406
|
-
}();
|