@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,97 +0,0 @@
|
|
|
1
|
-
import { PluginRunner, RequestOptions, RequestPlugin } from '../core';
|
|
2
|
-
/**
|
|
3
|
-
* Plugin to get the gateway access token and save it
|
|
4
|
-
* @deprecated please use AmadeusGatewayTokenRequestPlugin from @ama-sdk/amadeus-gateway-sdk instead, will be removed in v10
|
|
5
|
-
* @example
|
|
6
|
-
* When configuring the ApiManager
|
|
7
|
-
* ```typescript
|
|
8
|
-
* const defaultGatewayAPIConfig = {
|
|
9
|
-
* baseUrl: 'https://my-gateway.com',
|
|
10
|
-
* gatewayClientId: 'RgquoWaPkKmZ7acKUu1A2meEYVo94az7',
|
|
11
|
-
* gatewayClientSecret: 'AdUgFh4hu1dUUIE1'
|
|
12
|
-
* };
|
|
13
|
-
*
|
|
14
|
-
* const gatewayPlugin = new GatewayTokenRequestPlugin(
|
|
15
|
-
* `${defaultGatewayAPIConfig.baseUrl}/v1/security/oauth2`,
|
|
16
|
-
* defaultGatewayAPIConfig.gatewayClientId,
|
|
17
|
-
* defaultGatewayAPIConfig.gatewayClientSecret
|
|
18
|
-
* );
|
|
19
|
-
*
|
|
20
|
-
* // Api which needs the gateway access
|
|
21
|
-
* const myApiConfiguration: ApiConfiguration = {
|
|
22
|
-
* basePath: myBasePath,
|
|
23
|
-
* requestPlugins: [
|
|
24
|
-
* ...
|
|
25
|
-
* gatewayPlugin
|
|
26
|
-
* ...
|
|
27
|
-
* ],
|
|
28
|
-
* replyPlugins: [...]
|
|
29
|
-
* };
|
|
30
|
-
*/
|
|
31
|
-
export declare class GatewayTokenRequestPlugin implements RequestPlugin {
|
|
32
|
-
private storageTokenKey;
|
|
33
|
-
/**
|
|
34
|
-
* Default expiration time on the token in seconds
|
|
35
|
-
* Corresponds to 8 hours
|
|
36
|
-
*/
|
|
37
|
-
private readonly DEFAULT_EXPIRATION_TIME_S;
|
|
38
|
-
/**
|
|
39
|
-
* Buffer time in milliseconds. Allows to regenerate a new token before the expiration of the token.
|
|
40
|
-
* Corresponds to 5 minutes
|
|
41
|
-
*/
|
|
42
|
-
private readonly EXPIRATION_TIME_BUFFER_MS;
|
|
43
|
-
/**
|
|
44
|
-
* Promise of gateway URL
|
|
45
|
-
*/
|
|
46
|
-
private gatewayUrl;
|
|
47
|
-
/**
|
|
48
|
-
* Promise of gateway client id
|
|
49
|
-
*/
|
|
50
|
-
private gatewayClientId;
|
|
51
|
-
/**
|
|
52
|
-
* Promise of gateway client secret
|
|
53
|
-
*/
|
|
54
|
-
private gatewayClientPrivate;
|
|
55
|
-
/**
|
|
56
|
-
* guestOfficeId is either a method to be ran before each call to the Api Gateway to determine what is the guest
|
|
57
|
-
* office ID to be used, or a Promise of office ID
|
|
58
|
-
*/
|
|
59
|
-
private guestOfficeId;
|
|
60
|
-
/**
|
|
61
|
-
* Promise of the gateway call
|
|
62
|
-
*/
|
|
63
|
-
private gatewayCallPromise?;
|
|
64
|
-
/** API Client */
|
|
65
|
-
private apiClient;
|
|
66
|
-
/**
|
|
67
|
-
* Initialize your plugin
|
|
68
|
-
* @param gatewayUrl The URL of the gateway
|
|
69
|
-
* @param gatewayClientId The client id to authenticate to the gateway
|
|
70
|
-
* @param gatewayClientPrivate The client private to authenticate to the gateway
|
|
71
|
-
* @param basePath API Gateway base path (when targeting a proxy or middleware)
|
|
72
|
-
* @param guestOfficeId used to override the default office ID
|
|
73
|
-
* @param storageTokenKey
|
|
74
|
-
*/
|
|
75
|
-
constructor(gatewayUrl: string | Promise<string>, gatewayClientId: string | Promise<string>, gatewayClientPrivate: string | Promise<string>, basePath: string, guestOfficeId?: (() => Promise<string | undefined>) | Promise<string | undefined> | string, storageTokenKey?: string);
|
|
76
|
-
/**
|
|
77
|
-
* Check if the gateway authorization token is stored and include it in the Authorization header.
|
|
78
|
-
* If it is not stored yet, a call is triggered to the gateway in order to get this authorization token.
|
|
79
|
-
* @param gatewayUrl URL of the gateway
|
|
80
|
-
* @param gatewayClientId Client id related to the gateway client configuration
|
|
81
|
-
* @param gatewayClientPrivate Client private related to the gateway client configuration
|
|
82
|
-
* @param guestOfficeId office ID to be used instead of the default one
|
|
83
|
-
* office ID to be used
|
|
84
|
-
*/
|
|
85
|
-
private getStoreAuthHeader;
|
|
86
|
-
/**
|
|
87
|
-
* Check if the gateway authorization token is stored and include it in the Authorization header.
|
|
88
|
-
* If it is not stored yet, a call is triggered to the gateway in order to get this authorization token.
|
|
89
|
-
* @returns a function that take the actual headers as parameter and return an Promise containing the Authorization header and its value
|
|
90
|
-
*/
|
|
91
|
-
private addGatewayToken;
|
|
92
|
-
/**
|
|
93
|
-
* @inheritDoc
|
|
94
|
-
*/
|
|
95
|
-
load(): PluginRunner<RequestOptions, RequestOptions>;
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=gateway-token.request.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-token.request.d.ts","sourceRoot":"","sources":["../../../../src/plugins/gateway-token/gateway-token.request.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AAKpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,yBAA0B,YAAW,aAAa;IAyD3D,OAAO,CAAC,eAAe;IAxDzB;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAiB;IAE3D;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAkB;IAE5D;;OAEG;IACH,OAAO,CAAC,UAAU,CAAkB;IAEpC;;OAEG;IACH,OAAO,CAAC,eAAe,CAAkB;IAEzC;;OAEG;IACH,OAAO,CAAC,oBAAoB,CAAkB;IAE9C;;;OAGG;IACH,OAAO,CAAC,aAAa,CAAyF;IAE9G;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAAC,CAAoB;IAE/C,iBAAiB;IACjB,OAAO,CAAC,SAAS,CAAY;IAE7B;;;;;;;;OAQG;gBAED,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EACpC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EACzC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAC9C,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,EAClF,eAAe,GAAE,MAA8B;IASzD;;;;;;;;OAQG;YACW,kBAAkB;IA2ChC;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAOvB;;OAEG;IACI,IAAI,IAAI,YAAY,CAAC,cAAc,EAAE,cAAc,CAAC;CAK5D"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { ApiFetchClient } from '../../clients';
|
|
2
|
-
import { AdditionalParamsRequest } from '../additional-params';
|
|
3
|
-
import { ExceptionReply } from '../exception';
|
|
4
|
-
import { FetchCredentialsRequest } from '../fetch-credentials';
|
|
5
|
-
import { Oauth2Api } from './gateway-authentication';
|
|
6
|
-
/**
|
|
7
|
-
* Plugin to get the gateway access token and save it
|
|
8
|
-
* @deprecated please use AmadeusGatewayTokenRequestPlugin from @ama-sdk/amadeus-gateway-sdk instead, will be removed in v10
|
|
9
|
-
* @example
|
|
10
|
-
* When configuring the ApiManager
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const defaultGatewayAPIConfig = {
|
|
13
|
-
* baseUrl: 'https://my-gateway.com',
|
|
14
|
-
* gatewayClientId: 'RgquoWaPkKmZ7acKUu1A2meEYVo94az7',
|
|
15
|
-
* gatewayClientSecret: 'AdUgFh4hu1dUUIE1'
|
|
16
|
-
* };
|
|
17
|
-
*
|
|
18
|
-
* const gatewayPlugin = new GatewayTokenRequestPlugin(
|
|
19
|
-
* `${defaultGatewayAPIConfig.baseUrl}/v1/security/oauth2`,
|
|
20
|
-
* defaultGatewayAPIConfig.gatewayClientId,
|
|
21
|
-
* defaultGatewayAPIConfig.gatewayClientSecret
|
|
22
|
-
* );
|
|
23
|
-
*
|
|
24
|
-
* // Api which needs the gateway access
|
|
25
|
-
* const myApiConfiguration: ApiConfiguration = {
|
|
26
|
-
* basePath: myBasePath,
|
|
27
|
-
* requestPlugins: [
|
|
28
|
-
* ...
|
|
29
|
-
* gatewayPlugin
|
|
30
|
-
* ...
|
|
31
|
-
* ],
|
|
32
|
-
* replyPlugins: [...]
|
|
33
|
-
* };
|
|
34
|
-
*/
|
|
35
|
-
export class GatewayTokenRequestPlugin {
|
|
36
|
-
/**
|
|
37
|
-
* Initialize your plugin
|
|
38
|
-
* @param gatewayUrl The URL of the gateway
|
|
39
|
-
* @param gatewayClientId The client id to authenticate to the gateway
|
|
40
|
-
* @param gatewayClientPrivate The client private to authenticate to the gateway
|
|
41
|
-
* @param basePath API Gateway base path (when targeting a proxy or middleware)
|
|
42
|
-
* @param guestOfficeId used to override the default office ID
|
|
43
|
-
* @param storageTokenKey
|
|
44
|
-
*/
|
|
45
|
-
constructor(gatewayUrl, gatewayClientId, gatewayClientPrivate, basePath, guestOfficeId, storageTokenKey = 'gateway-auth-tokens') {
|
|
46
|
-
this.storageTokenKey = storageTokenKey;
|
|
47
|
-
/**
|
|
48
|
-
* Default expiration time on the token in seconds
|
|
49
|
-
* Corresponds to 8 hours
|
|
50
|
-
*/
|
|
51
|
-
this.DEFAULT_EXPIRATION_TIME_S = 28800;
|
|
52
|
-
/**
|
|
53
|
-
* Buffer time in milliseconds. Allows to regenerate a new token before the expiration of the token.
|
|
54
|
-
* Corresponds to 5 minutes
|
|
55
|
-
*/
|
|
56
|
-
this.EXPIRATION_TIME_BUFFER_MS = 300000;
|
|
57
|
-
this.gatewayUrl = Promise.resolve(gatewayUrl);
|
|
58
|
-
this.gatewayClientId = Promise.resolve(gatewayClientId);
|
|
59
|
-
this.gatewayClientPrivate = Promise.resolve(gatewayClientPrivate);
|
|
60
|
-
this.guestOfficeId = guestOfficeId;
|
|
61
|
-
this.apiClient = new ApiFetchClient({ requestPlugins: [new FetchCredentialsRequest()], replyPlugins: [new ExceptionReply()], basePath });
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Check if the gateway authorization token is stored and include it in the Authorization header.
|
|
65
|
-
* If it is not stored yet, a call is triggered to the gateway in order to get this authorization token.
|
|
66
|
-
* @param gatewayUrl URL of the gateway
|
|
67
|
-
* @param gatewayClientId Client id related to the gateway client configuration
|
|
68
|
-
* @param gatewayClientPrivate Client private related to the gateway client configuration
|
|
69
|
-
* @param guestOfficeId office ID to be used instead of the default one
|
|
70
|
-
* office ID to be used
|
|
71
|
-
*/
|
|
72
|
-
async getStoreAuthHeader(gatewayUrl, gatewayClientId, gatewayClientPrivate, guestOfficeId) {
|
|
73
|
-
this.apiClient.options.basePath = gatewayUrl;
|
|
74
|
-
const gatewayApi = new Oauth2Api(this.apiClient);
|
|
75
|
-
const storedTokens = typeof sessionStorage !== 'undefined' ? sessionStorage.getItem(this.storageTokenKey) : null;
|
|
76
|
-
const storedTokensParsed = storedTokens ? JSON.parse(storedTokens) : {};
|
|
77
|
-
const officeId = typeof guestOfficeId === 'function' ? await guestOfficeId() : await guestOfficeId;
|
|
78
|
-
const key = officeId ? `${gatewayClientId}-${officeId}` : `${gatewayClientId}-default`;
|
|
79
|
-
let token = storedTokensParsed[key];
|
|
80
|
-
if (!token || Date.now() + this.EXPIRATION_TIME_BUFFER_MS >= token.expiresAt) {
|
|
81
|
-
try {
|
|
82
|
-
if (!this.gatewayCallPromise) {
|
|
83
|
-
this.gatewayCallPromise = gatewayApi.postAccessToken({
|
|
84
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention, camelcase
|
|
85
|
-
bodyToProvide: { client_id: gatewayClientId, client_secret: gatewayClientPrivate, grant_type: 'client_credentials', guest_office_id: officeId }
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
const response = await this.gatewayCallPromise;
|
|
89
|
-
this.gatewayCallPromise = undefined;
|
|
90
|
-
token = { token: response.access_token, expiresAt: Date.now() + (response.expires_in ? response.expires_in : this.DEFAULT_EXPIRATION_TIME_S) * 1000 };
|
|
91
|
-
if (typeof sessionStorage !== 'undefined') {
|
|
92
|
-
storedTokensParsed[key] = token;
|
|
93
|
-
sessionStorage.setItem(this.storageTokenKey, JSON.stringify(storedTokensParsed));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
catch (e) {
|
|
97
|
-
// eslint-disable-next-line no-console
|
|
98
|
-
console.error('An error occurred when trying to get the gateway authentication token ' + e);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (token) {
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
103
|
-
return { Authorization: `Bearer ${token.token}` };
|
|
104
|
-
}
|
|
105
|
-
return {};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Check if the gateway authorization token is stored and include it in the Authorization header.
|
|
109
|
-
* If it is not stored yet, a call is triggered to the gateway in order to get this authorization token.
|
|
110
|
-
* @returns a function that take the actual headers as parameter and return an Promise containing the Authorization header and its value
|
|
111
|
-
*/
|
|
112
|
-
addGatewayToken() {
|
|
113
|
-
return async (_headers) => {
|
|
114
|
-
const params = await Promise.all([this.gatewayUrl, this.gatewayClientId, this.gatewayClientPrivate]);
|
|
115
|
-
return this.getStoreAuthHeader(params[0], params[1], params[2], this.guestOfficeId);
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* @inheritDoc
|
|
120
|
-
*/
|
|
121
|
-
load() {
|
|
122
|
-
return {
|
|
123
|
-
transform: new AdditionalParamsRequest({ headers: this.addGatewayToken() }).load().transform
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
//# sourceMappingURL=gateway-token.request.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-token.request.js","sourceRoot":"","sources":["../../../../src/plugins/gateway-token/gateway-token.request.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/gateway-token/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/gateway-token/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { WaitForFetch } from '../wait-for';
|
|
2
|
-
/**
|
|
3
|
-
* Options of the ImpervaFetch plugin
|
|
4
|
-
*/
|
|
5
|
-
export interface ImpervaFetchOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Amount of milliseconds to wait between two tries. Default: 250
|
|
8
|
-
*/
|
|
9
|
-
delayBetweenTriesInMilliseconds: number;
|
|
10
|
-
/**
|
|
11
|
-
* Maximum number of tries before giving up. Default: 4
|
|
12
|
-
*/
|
|
13
|
-
maximumTries: number;
|
|
14
|
-
/**
|
|
15
|
-
* If the cookie wasn't found after all the tries, should the call go through. Default: true
|
|
16
|
-
*/
|
|
17
|
-
allowCallOnTimeout: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* The name of the cookie to check the presence of. Default: reese84
|
|
20
|
-
*/
|
|
21
|
-
cookieName: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Plugin that waits for a specific cookie to be present in the document before sending any call.
|
|
25
|
-
* Designed specifically for Imperva implementations, can also be used with any cookie as long as they can be accessed
|
|
26
|
-
* from javascript (not HostOnly)
|
|
27
|
-
*
|
|
28
|
-
* @deprecated use the BotProtectionFingerprintRequest plug-in instead, will be removed in v10
|
|
29
|
-
*/
|
|
30
|
-
export declare class ImpervaFetch extends WaitForFetch {
|
|
31
|
-
constructor(customOptions: Partial<ImpervaFetchOptions>);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=imperva.fetch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imperva.fetch.d.ts","sourceRoot":"","sources":["../../../../src/plugins/imperva/imperva.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAC,MAAM,aAAa,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,+BAA+B,EAAE,MAAM,CAAC;IAExC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AA+BD;;;;;;GAMG;AACH,qBAAa,YAAa,SAAQ,YAAY;gBAEhC,aAAa,EAAE,OAAO,CAAC,mBAAmB,CAAC;CAKxD"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { WaitForFetch } from '../wait-for';
|
|
2
|
-
/** Options default values */
|
|
3
|
-
const defaultOptions = {
|
|
4
|
-
allowCallOnTimeout: true,
|
|
5
|
-
delayBetweenTriesInMilliseconds: 250,
|
|
6
|
-
maximumTries: 4,
|
|
7
|
-
cookieName: 'reese84'
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Creates a CanStartConditionFunction with respect to the given ImpervaFetchOptions
|
|
11
|
-
*
|
|
12
|
-
* @param options
|
|
13
|
-
*/
|
|
14
|
-
const startConditionFactory = (options) => {
|
|
15
|
-
const cookieRegExp = new RegExp(`\\b${options.cookieName}=`);
|
|
16
|
-
return async () => {
|
|
17
|
-
for (let i = options.maximumTries - 1; i >= 0; i--) {
|
|
18
|
-
if (cookieRegExp.test(document.cookie)) {
|
|
19
|
-
return { result: true };
|
|
20
|
-
}
|
|
21
|
-
if (i > 0) {
|
|
22
|
-
await new Promise((resolve) => setTimeout(resolve, options.delayBetweenTriesInMilliseconds));
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return { result: options.allowCallOnTimeout };
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Plugin that waits for a specific cookie to be present in the document before sending any call.
|
|
30
|
-
* Designed specifically for Imperva implementations, can also be used with any cookie as long as they can be accessed
|
|
31
|
-
* from javascript (not HostOnly)
|
|
32
|
-
*
|
|
33
|
-
* @deprecated use the BotProtectionFingerprintRequest plug-in instead, will be removed in v10
|
|
34
|
-
*/
|
|
35
|
-
export class ImpervaFetch extends WaitForFetch {
|
|
36
|
-
constructor(customOptions) {
|
|
37
|
-
const options = { ...defaultOptions, ...customOptions };
|
|
38
|
-
super(startConditionFactory(options));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=imperva.fetch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imperva.fetch.js","sourceRoot":"","sources":["../../../../src/plugins/imperva/imperva.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAC,MAAM,aAAa,CAAC;AA2BpE,6BAA6B;AAC7B,MAAM,cAAc,GAAwB;IAC1C,kBAAkB,EAAE,IAAI;IACxB,+BAA+B,EAAE,GAAG;IACpC,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,SAAS;CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,qBAAqB,GAAgE,CAAC,OAAO,EAAE,EAAE;IACrG,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,MAAM,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC;IAE7D,OAAO,KAAK,IAAI,EAAE;QAChB,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAClD,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBACtC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;aACzB;YACD,IAAI,CAAC,GAAG,CAAC,EAAE;gBACT,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,+BAA+B,CAAC,CAAC,CAAC;aAC9F;SACF;QACD,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAChD,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;IAE5C,YAAY,aAA2C;QACrD,MAAM,OAAO,GAAG,EAAC,GAAG,cAAc,EAAE,GAAG,aAAa,EAAC,CAAC;QAEtD,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/imperva/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/imperva/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/public-facts/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/public-facts/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { ClientFactsFactory, createJwtFactsEncoder as clientFactsPluginCreateJwtFactsEncoder, PublicFacts as ClientFactsPluginPublicFacts, ClientFactsRequestPlugin, ClientFactsRequestPluginOptions } from '../client-facts/client-facts.request';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated use PublicFacts from client-facts plugin instead, will be removed in v10
|
|
4
|
-
*
|
|
5
|
-
* Type that represent PublicFacts.
|
|
6
|
-
* Even though the type itself is permissive to mirror what the backend accepts, it is strongly recommended to extend
|
|
7
|
-
* it from an application in order to type it with the facts expected by the rules setup for that application.
|
|
8
|
-
* @example
|
|
9
|
-
* interface BookingPublicFacts extends PublicFacts {
|
|
10
|
-
* fact1: string;
|
|
11
|
-
* fact2: string;
|
|
12
|
-
* }
|
|
13
|
-
*/
|
|
14
|
-
export type PublicFacts = ClientFactsPluginPublicFacts;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated use ClientFactsFactory from client-facts plugin instead, will be removed in v10
|
|
17
|
-
*
|
|
18
|
-
* Factory function that receives the RequestOptions object in order to have a fine granularity to return
|
|
19
|
-
* specific facts only on certain entry points.
|
|
20
|
-
*/
|
|
21
|
-
export type PublicFactsFactory<T extends PublicFacts = PublicFacts> = ClientFactsFactory<T>;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated use ClientFactsRequestPluginOptions from client-facts plugin instead, will be removed in v10
|
|
24
|
-
*
|
|
25
|
-
* Options of the PublicFacts request plugin
|
|
26
|
-
*/
|
|
27
|
-
export interface PublicFactsRequestPluginOptions<T extends PublicFacts = PublicFacts> extends ClientFactsRequestPluginOptions<T> {
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated use createJwtFactsEncoder fromn client-facts plugin instead, will be removed in v10
|
|
31
|
-
*
|
|
32
|
-
* Creates a JWT encoding function which transforms the provided Facts as a unsecured JWT format https://tools.ietf.org/html/rfc7519#section-6
|
|
33
|
-
*/
|
|
34
|
-
export declare const createJwtFactsEncoder: typeof clientFactsPluginCreateJwtFactsEncoder;
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated use ClientFactsPlugin instead, will be removed in v10
|
|
37
|
-
*
|
|
38
|
-
* Plugin to manage Public facts send to the API.
|
|
39
|
-
* Facts are represented as an object of strings or numbers.
|
|
40
|
-
*
|
|
41
|
-
* The plugin allows to define two layers of facts:
|
|
42
|
-
* - Global: synchronous map of facts sent with every request
|
|
43
|
-
* - Request: function that is called with all the request information where you can return specific facts for every request
|
|
44
|
-
* If both are defined for a request, the priority is given to request specific facts.
|
|
45
|
-
*
|
|
46
|
-
* Facts are stringified and encoded in base64 and are added to every requests as a Header that is configurable.
|
|
47
|
-
* @example only global facts
|
|
48
|
-
* const publicFactsPlugin = new PublicFactsRequestPlugin<BookingPublicFacts>({
|
|
49
|
-
* initialGlobalFacts: {
|
|
50
|
-
* country: 'FRA'
|
|
51
|
-
* }
|
|
52
|
-
* });
|
|
53
|
-
* @example request facts
|
|
54
|
-
* const publicFactsPlugin = new PublicFactsRequestPlugin<BookingPublicFacts>({
|
|
55
|
-
* factsFactory: (request) => {
|
|
56
|
-
* if (request.basePath.includes('/order/')) {
|
|
57
|
-
* return {
|
|
58
|
-
* specificFact: 'foo'
|
|
59
|
-
* };
|
|
60
|
-
* }
|
|
61
|
-
* return {};
|
|
62
|
-
* }
|
|
63
|
-
* });
|
|
64
|
-
* @example global facts based on Store value
|
|
65
|
-
* const publicFactsPlugin = new PublicFactsRequestPlugin<BookingPublicFacts>({});
|
|
66
|
-
*
|
|
67
|
-
* store.pipe(
|
|
68
|
-
* select(selectOrderEntity)
|
|
69
|
-
* ).subscribe((order) => {
|
|
70
|
-
* const facts = getFactsFromOrder(order);
|
|
71
|
-
* publicFactsPlugin.setGlobalFacts(facts);
|
|
72
|
-
* });
|
|
73
|
-
* @example request facts based on Store value
|
|
74
|
-
* const publicFactsPlugin = new PublicFactsRequestPlugin<BookingPublicFacts>({
|
|
75
|
-
* factsFactory: (request) => {
|
|
76
|
-
* if (request.basePath.includes('/order/') && request.method !== 'GET') {
|
|
77
|
-
* return store.pipe(
|
|
78
|
-
* select(selectOrderEntity),
|
|
79
|
-
* take(1),
|
|
80
|
-
* map(getFactsFromOrder)
|
|
81
|
-
* ).toPromise();
|
|
82
|
-
* }
|
|
83
|
-
* return {};
|
|
84
|
-
* }
|
|
85
|
-
* });
|
|
86
|
-
*/
|
|
87
|
-
export declare class PublicFactsRequestPlugin<T extends PublicFacts = PublicFacts> extends ClientFactsRequestPlugin<T> {
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=public-facts.request.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-facts.request.d.ts","sourceRoot":"","sources":["../../../../src/plugins/public-facts/public-facts.request.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,IAAI,sCAAsC,EAC/D,WAAW,IAAI,4BAA4B,EAC3C,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GAAG,4BAA4B,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE5F;;;;GAIG;AACH,MAAM,WAAW,+BAA+B,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,+BAA+B,CAAC,CAAC,CAAC;CAAG;AAEnI;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,+CAAyC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,qBAAa,wBAAwB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,wBAAwB,CAAC,CAAC,CAAC;CAAG"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { createJwtFactsEncoder as clientFactsPluginCreateJwtFactsEncoder, ClientFactsRequestPlugin } from '../client-facts/client-facts.request';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated use createJwtFactsEncoder fromn client-facts plugin instead, will be removed in v10
|
|
4
|
-
*
|
|
5
|
-
* Creates a JWT encoding function which transforms the provided Facts as a unsecured JWT format https://tools.ietf.org/html/rfc7519#section-6
|
|
6
|
-
*/
|
|
7
|
-
export const createJwtFactsEncoder = clientFactsPluginCreateJwtFactsEncoder;
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated use ClientFactsPlugin instead, will be removed in v10
|
|
10
|
-
*
|
|
11
|
-
* Plugin to manage Public facts send to the API.
|
|
12
|
-
* Facts are represented as an object of strings or numbers.
|
|
13
|
-
*
|
|
14
|
-
* The plugin allows to define two layers of facts:
|
|
15
|
-
* - Global: synchronous map of facts sent with every request
|
|
16
|
-
* - Request: function that is called with all the request information where you can return specific facts for every request
|
|
17
|
-
* If both are defined for a request, the priority is given to request specific facts.
|
|
18
|
-
*
|
|
19
|
-
* Facts are stringified and encoded in base64 and are added to every requests as a Header that is configurable.
|
|
20
|
-
* @example only global facts
|
|
21
|
-
* const publicFactsPlugin = new PublicFactsRequestPlugin<BookingPublicFacts>({
|
|
22
|
-
* initialGlobalFacts: {
|
|
23
|
-
* country: 'FRA'
|
|
24
|
-
* }
|
|
25
|
-
* });
|
|
26
|
-
* @example request facts
|
|
27
|
-
* const publicFactsPlugin = new PublicFactsRequestPlugin<BookingPublicFacts>({
|
|
28
|
-
* factsFactory: (request) => {
|
|
29
|
-
* if (request.basePath.includes('/order/')) {
|
|
30
|
-
* return {
|
|
31
|
-
* specificFact: 'foo'
|
|
32
|
-
* };
|
|
33
|
-
* }
|
|
34
|
-
* return {};
|
|
35
|
-
* }
|
|
36
|
-
* });
|
|
37
|
-
* @example global facts based on Store value
|
|
38
|
-
* const publicFactsPlugin = new PublicFactsRequestPlugin<BookingPublicFacts>({});
|
|
39
|
-
*
|
|
40
|
-
* store.pipe(
|
|
41
|
-
* select(selectOrderEntity)
|
|
42
|
-
* ).subscribe((order) => {
|
|
43
|
-
* const facts = getFactsFromOrder(order);
|
|
44
|
-
* publicFactsPlugin.setGlobalFacts(facts);
|
|
45
|
-
* });
|
|
46
|
-
* @example request facts based on Store value
|
|
47
|
-
* const publicFactsPlugin = new PublicFactsRequestPlugin<BookingPublicFacts>({
|
|
48
|
-
* factsFactory: (request) => {
|
|
49
|
-
* if (request.basePath.includes('/order/') && request.method !== 'GET') {
|
|
50
|
-
* return store.pipe(
|
|
51
|
-
* select(selectOrderEntity),
|
|
52
|
-
* take(1),
|
|
53
|
-
* map(getFactsFromOrder)
|
|
54
|
-
* ).toPromise();
|
|
55
|
-
* }
|
|
56
|
-
* return {};
|
|
57
|
-
* }
|
|
58
|
-
* });
|
|
59
|
-
*/
|
|
60
|
-
export class PublicFactsRequestPlugin extends ClientFactsRequestPlugin {
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=public-facts.request.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-facts.request.js","sourceRoot":"","sources":["../../../../src/plugins/public-facts/public-facts.request.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,IAAI,sCAAsC,EAE/D,wBAAwB,EAEzB,MAAM,sCAAsC,CAAC;AA+B9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,OAAO,wBAA8D,SAAQ,wBAA2B;CAAG"}
|