@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
|
@@ -9,20 +9,14 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
-
impervaProtectionRetrieverFactory: function() {
|
|
16
|
-
return impervaProtectionRetrieverFactory;
|
|
12
|
+
BotProtectionFingerprintRequest: function() {
|
|
13
|
+
return BotProtectionFingerprintRequest;
|
|
17
14
|
},
|
|
18
15
|
akamaiTelemetryRetrieverFactory: function() {
|
|
19
16
|
return akamaiTelemetryRetrieverFactory;
|
|
20
17
|
},
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
BotProtectionFingerprintRequest: function() {
|
|
25
|
-
return BotProtectionFingerprintRequest;
|
|
18
|
+
impervaProtectionRetrieverFactory: function() {
|
|
19
|
+
return impervaProtectionRetrieverFactory;
|
|
26
20
|
}
|
|
27
21
|
});
|
|
28
22
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -96,13 +90,13 @@ function _ts_generator(thisArg, body) {
|
|
|
96
90
|
trys: [],
|
|
97
91
|
ops: []
|
|
98
92
|
};
|
|
99
|
-
return
|
|
93
|
+
return g = {
|
|
100
94
|
next: verb(0),
|
|
101
95
|
"throw": verb(1),
|
|
102
96
|
"return": verb(2)
|
|
103
97
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
104
98
|
return this;
|
|
105
|
-
}), g
|
|
99
|
+
}), g;
|
|
106
100
|
function verb(n) {
|
|
107
101
|
return function(v) {
|
|
108
102
|
return step([
|
|
@@ -181,18 +175,6 @@ function _ts_generator(thisArg, body) {
|
|
|
181
175
|
};
|
|
182
176
|
}
|
|
183
177
|
}
|
|
184
|
-
function cookieRetrieverFactory(cookieName) {
|
|
185
|
-
var cookieRegExp = new RegExp("(?:^|;)\\s*".concat(cookieName, "\\s*=\\s*([^;]+)"));
|
|
186
|
-
return function() {
|
|
187
|
-
if (typeof document === "undefined") {
|
|
188
|
-
throw new Error('[SDK][Plug-in][BotProtectionFingerprintRequest] Trying to use cookieRetrieverFactory but "document" is not defined.');
|
|
189
|
-
}
|
|
190
|
-
var cookieMatcher = document.cookie && document.cookie.match(cookieRegExp);
|
|
191
|
-
if (cookieMatcher) {
|
|
192
|
-
return cookieMatcher[cookieMatcher.length - 1];
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
178
|
function impervaProtectionRetrieverFactory(protectionTimeout, tokenTimeout) {
|
|
197
179
|
var protection;
|
|
198
180
|
if (typeof window === "undefined") {
|
|
@@ -210,68 +192,73 @@ function impervaProtectionRetrieverFactory(protectionTimeout, tokenTimeout) {
|
|
|
210
192
|
};
|
|
211
193
|
});
|
|
212
194
|
};
|
|
213
|
-
return
|
|
214
|
-
var
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
195
|
+
return function() {
|
|
196
|
+
var _ref = _async_to_generator(function(logger) {
|
|
197
|
+
var e, e1;
|
|
198
|
+
return _ts_generator(this, function(_state) {
|
|
199
|
+
switch(_state.label){
|
|
200
|
+
case 0:
|
|
201
|
+
if (!!protection) return [
|
|
202
|
+
3,
|
|
203
|
+
4
|
|
204
|
+
];
|
|
205
|
+
_state.label = 1;
|
|
206
|
+
case 1:
|
|
207
|
+
_state.trys.push([
|
|
208
|
+
1,
|
|
209
|
+
3,
|
|
210
|
+
,
|
|
211
|
+
4
|
|
212
|
+
]);
|
|
213
|
+
return [
|
|
214
|
+
4,
|
|
215
|
+
getProtection()
|
|
216
|
+
];
|
|
217
|
+
case 2:
|
|
218
|
+
protection = _state.sent();
|
|
219
|
+
return [
|
|
220
|
+
3,
|
|
221
|
+
4
|
|
222
|
+
];
|
|
223
|
+
case 3:
|
|
224
|
+
e = _state.sent();
|
|
225
|
+
(logger || console).error(e);
|
|
226
|
+
return [
|
|
227
|
+
2
|
|
228
|
+
];
|
|
229
|
+
case 4:
|
|
230
|
+
_state.trys.push([
|
|
231
|
+
4,
|
|
232
|
+
6,
|
|
233
|
+
,
|
|
234
|
+
7
|
|
235
|
+
]);
|
|
236
|
+
return [
|
|
237
|
+
4,
|
|
238
|
+
protection.token(tokenTimeout)
|
|
239
|
+
];
|
|
240
|
+
case 5:
|
|
241
|
+
return [
|
|
242
|
+
2,
|
|
243
|
+
_state.sent()
|
|
244
|
+
];
|
|
245
|
+
case 6:
|
|
246
|
+
e1 = _state.sent();
|
|
247
|
+
(logger || console).error("[SDK][Plug-in][BotProtectionFingerprintRequest] Timeout: no Token was received in time.");
|
|
248
|
+
return [
|
|
249
|
+
2
|
|
250
|
+
];
|
|
251
|
+
case 7:
|
|
252
|
+
return [
|
|
253
|
+
2
|
|
254
|
+
];
|
|
255
|
+
}
|
|
256
|
+
});
|
|
273
257
|
});
|
|
274
|
-
|
|
258
|
+
return function(logger) {
|
|
259
|
+
return _ref.apply(this, arguments);
|
|
260
|
+
};
|
|
261
|
+
}();
|
|
275
262
|
}
|
|
276
263
|
function akamaiTelemetryRetrieverFactory(bmakOpt) {
|
|
277
264
|
var bmak = bmakOpt || (typeof window !== "undefined" ? window.bmak : undefined);
|
|
@@ -282,21 +269,6 @@ function akamaiTelemetryRetrieverFactory(bmakOpt) {
|
|
|
282
269
|
return bmak.get_telemetry();
|
|
283
270
|
};
|
|
284
271
|
}
|
|
285
|
-
function impervaLocalStorageRetrieverFactory(storageKey) {
|
|
286
|
-
var ignoreExpired = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
287
|
-
return function() {
|
|
288
|
-
if (typeof localStorage === "undefined") {
|
|
289
|
-
throw new Error("[SDK][Plug-in][BotProtectionFingerprintRequest] Trying to use localStorageRetrieverFactory but localStorage is not defined.");
|
|
290
|
-
}
|
|
291
|
-
var storedFingerprint = localStorage.getItem(storageKey);
|
|
292
|
-
try {
|
|
293
|
-
var parsedFingerprint = storedFingerprint && JSON.parse(storedFingerprint);
|
|
294
|
-
if (parsedFingerprint && (ignoreExpired || parsedFingerprint.renewTime && parsedFingerprint.renewTime >= Date.now())) {
|
|
295
|
-
return parsedFingerprint.token;
|
|
296
|
-
}
|
|
297
|
-
} catch (e) {}
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
272
|
var BotProtectionFingerprintRequest = /*#__PURE__*/ function() {
|
|
301
273
|
"use strict";
|
|
302
274
|
function BotProtectionFingerprintRequest(options) {
|
|
@@ -317,7 +289,7 @@ var BotProtectionFingerprintRequest = /*#__PURE__*/ function() {
|
|
|
317
289
|
* configured in the BotProtectionFingerprintPollerOptions.
|
|
318
290
|
*
|
|
319
291
|
* If pollOnlyOnce is set to true, the poller won't be executed again after it has been fully executed once.
|
|
320
|
-
*/ function waitForFingerprint() {
|
|
292
|
+
*/ function waitForFingerprint(logger) {
|
|
321
293
|
var _this = this;
|
|
322
294
|
return _async_to_generator(function() {
|
|
323
295
|
var pollerOptions, i, fingerprint;
|
|
@@ -328,7 +300,7 @@ var BotProtectionFingerprintRequest = /*#__PURE__*/ function() {
|
|
|
328
300
|
if (pollerOptions === undefined || _this.options.pollOnlyOnce !== false && _this.hasPolled) {
|
|
329
301
|
return [
|
|
330
302
|
2,
|
|
331
|
-
_this.options.fingerprintRetriever()
|
|
303
|
+
_this.options.fingerprintRetriever(logger)
|
|
332
304
|
];
|
|
333
305
|
}
|
|
334
306
|
i = pollerOptions.maximumTries - 1;
|
|
@@ -340,7 +312,7 @@ var BotProtectionFingerprintRequest = /*#__PURE__*/ function() {
|
|
|
340
312
|
];
|
|
341
313
|
return [
|
|
342
314
|
4,
|
|
343
|
-
_this.options.fingerprintRetriever()
|
|
315
|
+
_this.options.fingerprintRetriever(logger)
|
|
344
316
|
];
|
|
345
317
|
case 2:
|
|
346
318
|
fingerprint = _state.sent();
|
|
@@ -382,7 +354,7 @@ var BotProtectionFingerprintRequest = /*#__PURE__*/ function() {
|
|
|
382
354
|
},
|
|
383
355
|
{
|
|
384
356
|
key: "load",
|
|
385
|
-
value: function load() {
|
|
357
|
+
value: /** @inheritdoc */ function load(context) {
|
|
386
358
|
var _this = this;
|
|
387
359
|
return {
|
|
388
360
|
transform: function() {
|
|
@@ -393,7 +365,7 @@ var BotProtectionFingerprintRequest = /*#__PURE__*/ function() {
|
|
|
393
365
|
case 0:
|
|
394
366
|
return [
|
|
395
367
|
4,
|
|
396
|
-
_this.waitForFingerprint()
|
|
368
|
+
_this.waitForFingerprint(context === null || context === void 0 ? void 0 : context.logger)
|
|
397
369
|
];
|
|
398
370
|
case 1:
|
|
399
371
|
fingerprint = _state.sent();
|
|
@@ -156,7 +156,7 @@ describe("BotProtectionFingerprint", function() {
|
|
|
156
156
|
});
|
|
157
157
|
};
|
|
158
158
|
beforeEach(function() {
|
|
159
|
-
consoleMock = jest.spyOn(console, "
|
|
159
|
+
consoleMock = jest.spyOn(console, "error").mockImplementation();
|
|
160
160
|
windowBackup = global.window;
|
|
161
161
|
// eslint-disable-next-line no-global-assign
|
|
162
162
|
global.window = {};
|
|
@@ -188,7 +188,8 @@ describe("BotProtectionFingerprint", function() {
|
|
|
188
188
|
expect.apply(void 0, [
|
|
189
189
|
_state.sent()
|
|
190
190
|
]).toBeUndefined();
|
|
191
|
-
|
|
191
|
+
// eslint-disable-next-line no-console
|
|
192
|
+
expect(console.error).toHaveBeenCalledTimes(1);
|
|
192
193
|
return [
|
|
193
194
|
2
|
|
194
195
|
];
|
|
@@ -216,7 +217,8 @@ describe("BotProtectionFingerprint", function() {
|
|
|
216
217
|
expect.apply(void 0, [
|
|
217
218
|
_state.sent()
|
|
218
219
|
]).toBeUndefined();
|
|
219
|
-
|
|
220
|
+
// eslint-disable-next-line no-console
|
|
221
|
+
expect(console.error).toHaveBeenCalledTimes(1);
|
|
220
222
|
return [
|
|
221
223
|
2
|
|
222
224
|
];
|
|
@@ -244,7 +246,8 @@ describe("BotProtectionFingerprint", function() {
|
|
|
244
246
|
expect.apply(void 0, [
|
|
245
247
|
_state.sent()
|
|
246
248
|
]).toBeUndefined();
|
|
247
|
-
|
|
249
|
+
// eslint-disable-next-line no-console
|
|
250
|
+
expect(console.error).toHaveBeenCalledTimes(1);
|
|
248
251
|
return [
|
|
249
252
|
2
|
|
250
253
|
];
|
|
@@ -288,7 +291,8 @@ describe("BotProtectionFingerprint", function() {
|
|
|
288
291
|
expect.apply(void 0, [
|
|
289
292
|
_state.sent()
|
|
290
293
|
]).toBe(tokenValue);
|
|
291
|
-
|
|
294
|
+
// eslint-disable-next-line no-console
|
|
295
|
+
expect(console.error).not.toHaveBeenCalled();
|
|
292
296
|
return [
|
|
293
297
|
2
|
|
294
298
|
];
|
|
@@ -296,99 +300,6 @@ describe("BotProtectionFingerprint", function() {
|
|
|
296
300
|
});
|
|
297
301
|
}));
|
|
298
302
|
});
|
|
299
|
-
describe("cookieRetrieverFactory", function() {
|
|
300
|
-
var documentBackup;
|
|
301
|
-
var cookieName = "test1";
|
|
302
|
-
var cookieValue = "value1";
|
|
303
|
-
var cookieName2 = "test2";
|
|
304
|
-
var cookieValue2 = "value2";
|
|
305
|
-
var fullCookie = "".concat(cookieName, "=").concat(cookieValue);
|
|
306
|
-
var fullCookie2 = "".concat(cookieName2, "=").concat(cookieValue2);
|
|
307
|
-
var retriever = (0, _botprotectionfingerprintrequest.cookieRetrieverFactory)(cookieName);
|
|
308
|
-
var retriever2 = (0, _botprotectionfingerprintrequest.cookieRetrieverFactory)(cookieName2);
|
|
309
|
-
beforeEach(function() {
|
|
310
|
-
documentBackup = global.document;
|
|
311
|
-
global.document = {};
|
|
312
|
-
});
|
|
313
|
-
afterEach(function() {
|
|
314
|
-
global.document = documentBackup;
|
|
315
|
-
});
|
|
316
|
-
it("Should throw if document is not defined.", function() {
|
|
317
|
-
global.document = undefined;
|
|
318
|
-
expect(retriever).toThrow();
|
|
319
|
-
});
|
|
320
|
-
it("Should return undefined if no cookies are there.", function() {
|
|
321
|
-
expect(retriever()).not.toBeDefined();
|
|
322
|
-
});
|
|
323
|
-
it("Should return undefined if cookies are there but not the one specified.", function() {
|
|
324
|
-
global.document.cookie = fullCookie2;
|
|
325
|
-
expect(retriever()).not.toBeDefined();
|
|
326
|
-
});
|
|
327
|
-
it("Should return the value of the cookie with the name specified when present.", function() {
|
|
328
|
-
global.document.cookie = "".concat(fullCookie, "; ").concat(fullCookie2);
|
|
329
|
-
expect(retriever()).toBe(cookieValue);
|
|
330
|
-
expect(retriever2()).toBe(cookieValue2);
|
|
331
|
-
global.document.cookie = "".concat(fullCookie2, "; ").concat(fullCookie);
|
|
332
|
-
expect(retriever()).toBe(cookieValue);
|
|
333
|
-
expect(retriever2()).toBe(cookieValue2);
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
describe("impervaLocalStorageRetrieverFactory", function() {
|
|
337
|
-
var localStorageBackup;
|
|
338
|
-
var localStorageValue;
|
|
339
|
-
var localStorageMock = {
|
|
340
|
-
getItem: function(key) {
|
|
341
|
-
return localStorageValue[key];
|
|
342
|
-
},
|
|
343
|
-
setItem: function(key, value) {
|
|
344
|
-
return localStorageValue[key] = value;
|
|
345
|
-
}
|
|
346
|
-
};
|
|
347
|
-
var storageKey = "fingerprint";
|
|
348
|
-
var validEntry = {
|
|
349
|
-
token: "testtoken",
|
|
350
|
-
renewTime: Date.now() + 1000 * 60 * 60
|
|
351
|
-
};
|
|
352
|
-
var expiredEntry = {
|
|
353
|
-
token: "testtoken",
|
|
354
|
-
renewTime: Date.now() - 1
|
|
355
|
-
};
|
|
356
|
-
var retriever = (0, _botprotectionfingerprintrequest.impervaLocalStorageRetrieverFactory)(storageKey);
|
|
357
|
-
var retrieverIgnoreExpired = (0, _botprotectionfingerprintrequest.impervaLocalStorageRetrieverFactory)(storageKey, true);
|
|
358
|
-
beforeEach(function() {
|
|
359
|
-
localStorageValue = {};
|
|
360
|
-
localStorageBackup = global.localStorage;
|
|
361
|
-
global.localStorage = localStorageMock;
|
|
362
|
-
});
|
|
363
|
-
afterEach(function() {
|
|
364
|
-
global.localStorage = localStorageBackup;
|
|
365
|
-
});
|
|
366
|
-
it("Should throw if localStorage is not defined.", function() {
|
|
367
|
-
global.localStorage = undefined;
|
|
368
|
-
expect(retriever).toThrow();
|
|
369
|
-
});
|
|
370
|
-
it("Should return undefined if the storage doesn't contain the specified key.", function() {
|
|
371
|
-
expect(retriever()).not.toBeDefined();
|
|
372
|
-
});
|
|
373
|
-
it("Should return undefined if the storage contains a malformed entry.", function() {
|
|
374
|
-
localStorageMock.setItem(storageKey, "malformed json");
|
|
375
|
-
expect(retriever()).not.toBeDefined();
|
|
376
|
-
localStorageMock.setItem(storageKey, '{"random": "property"}');
|
|
377
|
-
expect(retriever()).not.toBeDefined();
|
|
378
|
-
});
|
|
379
|
-
it("Should return the stored token if still valid", function() {
|
|
380
|
-
localStorageMock.setItem(storageKey, JSON.stringify(validEntry));
|
|
381
|
-
expect(retriever()).toBe(validEntry.token);
|
|
382
|
-
});
|
|
383
|
-
it("Should return undefined by default if the stored token has expired", function() {
|
|
384
|
-
localStorageMock.setItem(storageKey, JSON.stringify(expiredEntry));
|
|
385
|
-
expect(retriever()).not.toBeDefined();
|
|
386
|
-
});
|
|
387
|
-
it("Should return expired token if configured to do so.", function() {
|
|
388
|
-
localStorageMock.setItem(storageKey, JSON.stringify(expiredEntry));
|
|
389
|
-
expect(retrieverIgnoreExpired()).toBe(expiredEntry.token);
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
303
|
describe("akamaiTelemetryRetrieverFactory", function() {
|
|
393
304
|
it("Should return undefined if bmak object doesn't exist.", function() {
|
|
394
305
|
expect((0, _botprotectionfingerprintrequest.akamaiTelemetryRetrieverFactory)()()).toBeUndefined();
|
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
createJwtFactsEncoder: function() {
|
|
13
|
-
return createJwtFactsEncoder;
|
|
14
|
-
},
|
|
15
12
|
ClientFactsRequestPlugin: function() {
|
|
16
13
|
return ClientFactsRequestPlugin;
|
|
14
|
+
},
|
|
15
|
+
createJwtFactsEncoder: function() {
|
|
16
|
+
return createJwtFactsEncoder;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
var _jsontoken = require("../../utils/json-token");
|
|
@@ -103,13 +103,13 @@ function _ts_generator(thisArg, body) {
|
|
|
103
103
|
trys: [],
|
|
104
104
|
ops: []
|
|
105
105
|
};
|
|
106
|
-
return
|
|
106
|
+
return g = {
|
|
107
107
|
next: verb(0),
|
|
108
108
|
"throw": verb(1),
|
|
109
109
|
"return": verb(2)
|
|
110
110
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
111
111
|
return this;
|
|
112
|
-
}), g
|
|
112
|
+
}), g;
|
|
113
113
|
function verb(n) {
|
|
114
114
|
return function(v) {
|
|
115
115
|
return step([
|
|
@@ -218,7 +218,6 @@ var ClientFactsRequestPlugin = /*#__PURE__*/ function() {
|
|
|
218
218
|
key: "setGlobalFacts",
|
|
219
219
|
value: /**
|
|
220
220
|
* Change the value of the global facts
|
|
221
|
-
*
|
|
222
221
|
* @param facts
|
|
223
222
|
*/ function setGlobalFacts(facts) {
|
|
224
223
|
this.globalFacts = facts;
|
|
@@ -228,7 +227,6 @@ var ClientFactsRequestPlugin = /*#__PURE__*/ function() {
|
|
|
228
227
|
key: "setPrivateFacts",
|
|
229
228
|
value: /**
|
|
230
229
|
* Change the value of the private facts
|
|
231
|
-
*
|
|
232
230
|
* @param facts
|
|
233
231
|
*/ function setPrivateFacts(facts) {
|
|
234
232
|
this.privateFacts = facts;
|
|
@@ -79,13 +79,13 @@ function _ts_generator(thisArg, body) {
|
|
|
79
79
|
trys: [],
|
|
80
80
|
ops: []
|
|
81
81
|
};
|
|
82
|
-
return
|
|
82
|
+
return g = {
|
|
83
83
|
next: verb(0),
|
|
84
84
|
"throw": verb(1),
|
|
85
85
|
"return": verb(2)
|
|
86
86
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
87
87
|
return this;
|
|
88
|
-
}), g
|
|
88
|
+
}), g;
|
|
89
89
|
function verb(n) {
|
|
90
90
|
return function(v) {
|
|
91
91
|
return step([
|
package/cjs/plugins/index.js
CHANGED
|
@@ -2,23 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
PublicFactsRequestPlugin: function() {
|
|
13
|
-
return _index.PublicFactsRequestPlugin;
|
|
14
|
-
},
|
|
15
|
-
PublicFactsRequestPluginOptions: function() {
|
|
16
|
-
return _index.PublicFactsRequestPluginOptions;
|
|
17
|
-
},
|
|
18
|
-
PublicFactsFactory: function() {
|
|
19
|
-
return _index.PublicFactsFactory;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
5
|
_export_star(require("./additional-params/index"), exports);
|
|
23
6
|
_export_star(require("./api-configuration-override/index"), exports);
|
|
24
7
|
_export_star(require("./api-key/index"), exports);
|
|
@@ -30,15 +13,11 @@ _export_star(require("./custom-info/index"), exports);
|
|
|
30
13
|
_export_star(require("./exception/index"), exports);
|
|
31
14
|
_export_star(require("./fetch-cache/index"), exports);
|
|
32
15
|
_export_star(require("./fetch-credentials/index"), exports);
|
|
33
|
-
_export_star(require("./fetch-options/index"), exports);
|
|
34
|
-
_export_star(require("./gateway-token/index"), exports);
|
|
35
|
-
_export_star(require("./imperva/index"), exports);
|
|
36
16
|
_export_star(require("./json-token/index"), exports);
|
|
37
17
|
_export_star(require("./keepalive/index"), exports);
|
|
38
18
|
_export_star(require("./mock-intercept/index"), exports);
|
|
39
19
|
_export_star(require("./perf-metric/index"), exports);
|
|
40
20
|
_export_star(require("./pii-tokenizer/index"), exports);
|
|
41
|
-
var _index = require("./public-facts/index");
|
|
42
21
|
_export_star(require("./raw-response-info/index"), exports);
|
|
43
22
|
_export_star(require("./retry/index"), exports);
|
|
44
23
|
_export_star(require("./reviver/index"), exports);
|
|
@@ -9,14 +9,14 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
MicroGatewayMiddlewareAuthenticationRequest: function() {
|
|
13
|
+
return MicroGatewayMiddlewareAuthenticationRequest;
|
|
14
14
|
},
|
|
15
15
|
hmacSHA256: function() {
|
|
16
16
|
return hmacSHA256;
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
return
|
|
18
|
+
sha256: function() {
|
|
19
|
+
return sha256;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
var _uuid = require("uuid");
|
|
@@ -93,13 +93,13 @@ function _ts_generator(thisArg, body) {
|
|
|
93
93
|
trys: [],
|
|
94
94
|
ops: []
|
|
95
95
|
};
|
|
96
|
-
return
|
|
96
|
+
return g = {
|
|
97
97
|
next: verb(0),
|
|
98
98
|
"throw": verb(1),
|
|
99
99
|
"return": verb(2)
|
|
100
100
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
101
101
|
return this;
|
|
102
|
-
}), g
|
|
102
|
+
}), g;
|
|
103
103
|
function verb(n) {
|
|
104
104
|
return function(v) {
|
|
105
105
|
return step([
|
|
@@ -297,7 +297,6 @@ var MicroGatewayMiddlewareAuthenticationRequest = /*#__PURE__*/ function() {
|
|
|
297
297
|
key: "generateMicroGatewayAuthenticationSignatureKey",
|
|
298
298
|
value: /**
|
|
299
299
|
* Computes the key used to sign the JWS
|
|
300
|
-
*
|
|
301
300
|
* @param payload JWT payload
|
|
302
301
|
* @param basePath Resource path
|
|
303
302
|
*/ function generateMicroGatewayAuthenticationSignatureKey(payload, basePath) {
|
|
@@ -327,7 +326,6 @@ var MicroGatewayMiddlewareAuthenticationRequest = /*#__PURE__*/ function() {
|
|
|
327
326
|
key: "sign",
|
|
328
327
|
value: /**
|
|
329
328
|
* Generates the signed JWT based on provided payload and secret key
|
|
330
|
-
*
|
|
331
329
|
* @param payload JWT payload
|
|
332
330
|
* @param secretKey secret key used to generate the signature
|
|
333
331
|
*/ function sign(payload, secretKey) {
|
|
@@ -340,7 +338,6 @@ var MicroGatewayMiddlewareAuthenticationRequest = /*#__PURE__*/ function() {
|
|
|
340
338
|
key: "generateJWS",
|
|
341
339
|
value: /**
|
|
342
340
|
* Generates a signed Json Web Token
|
|
343
|
-
*
|
|
344
341
|
* @param path Resource path
|
|
345
342
|
*/ function generateJWS(path) {
|
|
346
343
|
var _this = this;
|
|
@@ -376,6 +373,7 @@ var MicroGatewayMiddlewareAuthenticationRequest = /*#__PURE__*/ function() {
|
|
|
376
373
|
return _ts_generator(this, function(_state) {
|
|
377
374
|
switch(_state.label){
|
|
378
375
|
case 0:
|
|
376
|
+
// Handle Authorization Tokens
|
|
379
377
|
url = new URL(data.basePath);
|
|
380
378
|
return [
|
|
381
379
|
4,
|
|
@@ -317,6 +317,7 @@ describe("JSON auth token request plugin", function() {
|
|
|
317
317
|
];
|
|
318
318
|
case 3:
|
|
319
319
|
secretKey = _state.sent();
|
|
320
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
320
321
|
message = "".concat(base64UrlEncoder(JSON.stringify(header)), ".").concat(base64UrlEncoder(JSON.stringify(payload)));
|
|
321
322
|
signCheck = base64UrlEncoder((0, _mgwmdwauthrequest.hmacSHA256)(message, secretKey));
|
|
322
323
|
expect(signature).toEqual(signCheck);
|
|
@@ -88,13 +88,13 @@ function _ts_generator(thisArg, body) {
|
|
|
88
88
|
trys: [],
|
|
89
89
|
ops: []
|
|
90
90
|
};
|
|
91
|
-
return
|
|
91
|
+
return g = {
|
|
92
92
|
next: verb(0),
|
|
93
93
|
"throw": verb(1),
|
|
94
94
|
"return": verb(2)
|
|
95
95
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
96
96
|
return this;
|
|
97
|
-
}), g
|
|
97
|
+
}), g;
|
|
98
98
|
function verb(n) {
|
|
99
99
|
return function(v) {
|
|
100
100
|
return step([
|
|
@@ -204,6 +204,7 @@ var MockInterceptFetch = /*#__PURE__*/ function() {
|
|
|
204
204
|
case 1:
|
|
205
205
|
_state.sent();
|
|
206
206
|
responsePromise = fetchCall;
|
|
207
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
207
208
|
if (!context.options.headers || !_instanceof(context.options.headers, Headers) || !context.options.headers.has(_mockinterceptinterface.CUSTOM_MOCK_OPERATION_ID_HEADER)) {
|
|
208
209
|
return [
|
|
209
210
|
2,
|
|
@@ -246,6 +247,7 @@ var MockInterceptFetch = /*#__PURE__*/ function() {
|
|
|
246
247
|
});
|
|
247
248
|
_state.label = 6;
|
|
248
249
|
case 6:
|
|
250
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
249
251
|
operationId = context.options.headers.get(_mockinterceptinterface.CUSTOM_MOCK_OPERATION_ID_HEADER);
|
|
250
252
|
try {
|
|
251
253
|
mock = _this.options.adapter.getLatestMock(operationId);
|
|
@@ -263,8 +265,7 @@ var MockInterceptFetch = /*#__PURE__*/ function() {
|
|
|
263
265
|
})
|
|
264
266
|
];
|
|
265
267
|
} catch (e) {
|
|
266
|
-
|
|
267
|
-
console.error("Failed to retrieve the latest mock for Operation ID ".concat(operationId, ", fallback to default mock"));
|
|
268
|
+
(context.logger || console).error("Failed to retrieve the latest mock for Operation ID ".concat(operationId, ", fallback to default mock"));
|
|
268
269
|
return [
|
|
269
270
|
2,
|
|
270
271
|
responsePromise
|