@ama-sdk/core 11.6.0-prerelease.2 → 11.6.0-prerelease.21
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/cjs/clients/api-angular-client.js +12 -4
- package/cjs/clients/api-beacon-client.js +1 -2
- package/cjs/clients/api-fetch-client.js +15 -24
- package/cjs/fwk/api.helper.spec.js +1 -1
- package/cjs/fwk/api.helpers.js +20 -24
- package/cjs/fwk/core/api-client.js +2 -1
- package/cjs/fwk/core/index.js +1 -1
- package/cjs/fwk/date.js +26 -27
- package/cjs/fwk/date.spec.js +4 -2
- package/cjs/fwk/ignore-enum.type.js +1 -2
- package/cjs/fwk/index.js +1 -1
- package/cjs/fwk/mocks/alf-mock-adapter.js +7 -6
- package/cjs/fwk/mocks/base-mock-adapter.js +3 -3
- package/cjs/fwk/mocks/helpers.js +15 -7
- package/cjs/fwk/mocks/index.js +3 -3
- package/cjs/fwk/{Reviver.js → reviver.js} +1 -2
- package/cjs/fwk/reviver.spec.js +9 -9
- package/cjs/plugins/additional-params/index.js +1 -1
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +3 -3
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +7 -10
- package/cjs/plugins/client-facts/client-facts.request.js +5 -5
- package/cjs/plugins/concurrent/concurrent.fetch.js +5 -9
- package/cjs/plugins/core/index.js +2 -2
- package/cjs/plugins/custom-info/custom-info.reply.js +2 -2
- package/cjs/plugins/exception/exception.spec.js +1 -1
- package/cjs/plugins/fetch-cache/fetch-cache.request.js +1 -1
- package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +4 -4
- package/cjs/plugins/json-token/json-token.reply.js +6 -6
- package/cjs/plugins/json-token/json-token.request.js +1 -1
- package/cjs/plugins/json-token/json-token.spec.js +7 -9
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +0 -2
- package/cjs/plugins/mock-intercept/index.js +1 -1
- package/cjs/plugins/mock-intercept/mock-intercept.angular.js +4 -4
- package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +0 -2
- package/cjs/plugins/mock-intercept/mock-intercept.spec.js +5 -4
- package/cjs/plugins/perf-metric/perf-metric.fetch.js +10 -2
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +5 -11
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +5 -6
- package/cjs/plugins/retry/retry.fetch.js +17 -32
- package/cjs/plugins/retry/retry.spec.js +4 -4
- package/cjs/plugins/session-id/session-id.request.js +4 -4
- package/cjs/plugins/session-id/session-id.spec.js +2 -2
- package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +1 -1
- package/cjs/plugins/timeout/timeout.fetch.js +14 -6
- package/cjs/plugins/wait-for/wait-for.fetch.js +3 -3
- package/cjs/plugins/wait-for/wait-for.spec.js +1 -1
- package/cjs/utils/crypto.js +7 -7
- package/cjs/utils/encoder.js +9 -17
- package/cjs/utils/generic-api.js +1 -2
- package/cjs/utils/ie11.js +1 -0
- package/cjs/utils/index.js +1 -1
- package/cjs/utils/json-token.js +7 -7
- package/cjs/utils/json-token.spec.js +14 -11
- package/cjs/utils/mime-types.js +1 -1
- package/esm2015/clients/api-angular-client.js +12 -4
- package/esm2015/clients/api-beacon-client.js +1 -2
- package/esm2015/clients/api-fetch-client.js +15 -24
- package/esm2015/fwk/api.helper.spec.js +1 -1
- package/esm2015/fwk/api.helpers.js +24 -30
- package/esm2015/fwk/core/api-client.js +2 -1
- package/esm2015/fwk/core/index.js +1 -1
- package/esm2015/fwk/date.js +30 -29
- package/esm2015/fwk/date.spec.js +4 -2
- package/esm2015/fwk/ignore-enum.type.js +1 -2
- package/esm2015/fwk/index.js +1 -1
- package/esm2015/fwk/mocks/alf-mock-adapter.js +7 -6
- package/esm2015/fwk/mocks/base-mock-adapter.js +3 -3
- package/esm2015/fwk/mocks/helpers.js +15 -7
- package/esm2015/fwk/mocks/index.js +3 -3
- package/esm2015/fwk/{Reviver.js → reviver.js} +2 -2
- package/esm2015/fwk/reviver.spec.js +1 -1
- package/esm2015/plugins/additional-params/index.js +1 -1
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +3 -3
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +7 -10
- package/esm2015/plugins/client-facts/client-facts.request.js +5 -5
- package/esm2015/plugins/concurrent/concurrent.fetch.js +5 -9
- package/esm2015/plugins/core/index.js +2 -2
- package/esm2015/plugins/custom-info/custom-info.reply.js +2 -2
- package/esm2015/plugins/exception/exception.spec.js +1 -1
- package/esm2015/plugins/fetch-cache/fetch-cache.request.js +1 -1
- package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +4 -4
- package/esm2015/plugins/json-token/json-token.reply.js +6 -6
- package/esm2015/plugins/json-token/json-token.request.js +1 -1
- package/esm2015/plugins/json-token/json-token.spec.js +7 -9
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +0 -2
- package/esm2015/plugins/mock-intercept/index.js +1 -1
- package/esm2015/plugins/mock-intercept/mock-intercept.angular.js +4 -4
- package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +0 -2
- package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +5 -4
- package/esm2015/plugins/perf-metric/perf-metric.fetch.js +10 -2
- package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +5 -11
- package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +5 -6
- package/esm2015/plugins/retry/retry.fetch.js +17 -32
- package/esm2015/plugins/retry/retry.spec.js +4 -4
- package/esm2015/plugins/session-id/session-id.request.js +4 -4
- package/esm2015/plugins/session-id/session-id.spec.js +2 -2
- package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +1 -1
- package/esm2015/plugins/timeout/timeout.fetch.js +15 -8
- package/esm2015/plugins/wait-for/wait-for.fetch.js +3 -3
- package/esm2015/plugins/wait-for/wait-for.spec.js +1 -1
- package/esm2015/utils/crypto.js +7 -7
- package/esm2015/utils/encoder.js +9 -17
- package/esm2015/utils/generic-api.js +1 -2
- package/esm2015/utils/ie11.js +1 -0
- package/esm2015/utils/index.js +1 -1
- package/esm2015/utils/json-token.js +7 -7
- package/esm2015/utils/json-token.spec.js +8 -10
- package/esm2015/utils/mime-types.js +1 -1
- package/package.json +19 -13
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +24 -26
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/src/clients/api-angular-client.d.ts +2 -2
- package/src/clients/api-angular-client.d.ts.map +1 -1
- package/src/clients/api-angular-client.js +11 -9
- package/src/clients/api-angular-client.js.map +1 -1
- package/src/clients/api-beacon-client.d.ts +1 -1
- package/src/clients/api-beacon-client.d.ts.map +1 -1
- package/src/clients/api-beacon-client.js +2 -3
- package/src/clients/api-beacon-client.js.map +1 -1
- package/src/clients/api-fetch-client.d.ts +2 -2
- package/src/clients/api-fetch-client.d.ts.map +1 -1
- package/src/clients/api-fetch-client.js +14 -21
- package/src/clients/api-fetch-client.js.map +1 -1
- package/src/fwk/api.helpers.d.ts +6 -8
- package/src/fwk/api.helpers.d.ts.map +1 -1
- package/src/fwk/api.helpers.js +22 -31
- package/src/fwk/api.helpers.js.map +1 -1
- package/src/fwk/api.interface.d.ts.map +1 -1
- package/src/fwk/core/api-client.d.ts +3 -3
- package/src/fwk/core/api-client.d.ts.map +1 -1
- package/src/fwk/core/api-client.js +8 -7
- package/src/fwk/core/api-client.js.map +1 -1
- package/src/fwk/core/base-api-constructor.d.ts +1 -1
- package/src/fwk/core/base-api-constructor.d.ts.map +1 -1
- package/src/fwk/core/base-api-constructor.js.map +1 -1
- package/src/fwk/core/index.d.ts +1 -1
- package/src/fwk/core/index.d.ts.map +1 -1
- package/src/fwk/core/index.js +1 -1
- package/src/fwk/core/index.js.map +1 -1
- package/src/fwk/date.d.ts +6 -18
- package/src/fwk/date.d.ts.map +1 -1
- package/src/fwk/date.js +25 -28
- package/src/fwk/date.js.map +1 -1
- package/src/fwk/errors.d.ts.map +1 -1
- package/src/fwk/errors.js.map +1 -1
- package/src/fwk/ignore-enum.type.d.ts.map +1 -1
- package/src/fwk/index.d.ts +1 -1
- package/src/fwk/index.js +1 -1
- package/src/fwk/mocks/alf-mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/alf-mock-adapter.js +11 -10
- package/src/fwk/mocks/alf-mock-adapter.js.map +1 -1
- package/src/fwk/mocks/base-mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/base-mock-adapter.js +4 -4
- package/src/fwk/mocks/base-mock-adapter.js.map +1 -1
- package/src/fwk/mocks/encoded-api-request.d.ts +1 -1
- package/src/fwk/mocks/encoded-api-request.d.ts.map +1 -1
- package/src/fwk/mocks/helpers.d.ts.map +1 -1
- package/src/fwk/mocks/helpers.js +8 -7
- package/src/fwk/mocks/helpers.js.map +1 -1
- package/src/fwk/mocks/index.d.ts +3 -3
- package/src/fwk/mocks/index.d.ts.map +1 -1
- package/src/fwk/mocks/index.js +3 -3
- package/src/fwk/mocks/index.js.map +1 -1
- package/src/fwk/mocks/mock-adapter.d.ts +1 -1
- package/src/fwk/mocks/mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/path-object.d.ts.map +1 -1
- package/src/fwk/mocks/random-mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/random-mock-adapter.js +1 -1
- package/src/fwk/mocks/random-mock-adapter.js.map +1 -1
- package/src/fwk/mocks/sequential-mock-adapter.d.ts.map +1 -1
- package/src/fwk/mocks/sequential-mock-adapter.js +1 -1
- package/src/fwk/mocks/sequential-mock-adapter.js.map +1 -1
- package/src/fwk/{Reviver.d.ts → reviver.d.ts} +2 -1
- package/src/fwk/reviver.d.ts.map +1 -0
- package/src/fwk/{Reviver.js → reviver.js} +3 -3
- package/src/fwk/reviver.js.map +1 -0
- package/src/plugins/abort/abort.fetch.d.ts.map +1 -1
- package/src/plugins/abort/abort.fetch.js.map +1 -1
- package/src/plugins/additional-params/additional-params-sync.request.d.ts.map +1 -1
- package/src/plugins/additional-params/additional-params-sync.request.js +1 -1
- package/src/plugins/additional-params/additional-params-sync.request.js.map +1 -1
- package/src/plugins/additional-params/additional-params.request.d.ts.map +1 -1
- package/src/plugins/additional-params/additional-params.request.js.map +1 -1
- package/src/plugins/additional-params/index.d.ts +1 -1
- package/src/plugins/additional-params/index.d.ts.map +1 -1
- package/src/plugins/additional-params/index.js +1 -1
- package/src/plugins/additional-params/index.js.map +1 -1
- 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.map +1 -1
- package/src/plugins/api-key/api-key.request.d.ts.map +1 -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 +10 -10
- 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 +5 -5
- package/src/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js.map +1 -1
- package/src/plugins/client-facts/client-facts.request.d.ts +1 -1
- package/src/plugins/client-facts/client-facts.request.d.ts.map +1 -1
- package/src/plugins/client-facts/client-facts.request.js +5 -5
- package/src/plugins/client-facts/client-facts.request.js.map +1 -1
- package/src/plugins/concurrent/concurrent.fetch.d.ts.map +1 -1
- package/src/plugins/concurrent/concurrent.fetch.js +1 -6
- package/src/plugins/concurrent/concurrent.fetch.js.map +1 -1
- package/src/plugins/core/angular-plugin.d.ts +1 -1
- package/src/plugins/core/angular-plugin.d.ts.map +1 -1
- package/src/plugins/core/fetch-plugin.d.ts.map +1 -1
- package/src/plugins/core/index.d.ts +2 -2
- package/src/plugins/core/index.d.ts.map +1 -1
- package/src/plugins/core/index.js +2 -2
- package/src/plugins/core/index.js.map +1 -1
- package/src/plugins/core/plugin.d.ts.map +1 -1
- package/src/plugins/core/reply-plugin.d.ts +1 -1
- package/src/plugins/core/reply-plugin.d.ts.map +1 -1
- package/src/plugins/core/request-plugin.d.ts.map +1 -1
- package/src/plugins/custom-info/custom-info.reply.d.ts.map +1 -1
- package/src/plugins/custom-info/custom-info.reply.js +1 -1
- package/src/plugins/custom-info/custom-info.reply.js.map +1 -1
- package/src/plugins/exception/exception.reply.d.ts +1 -0
- package/src/plugins/exception/exception.reply.d.ts.map +1 -1
- package/src/plugins/exception/exception.reply.js +6 -5
- package/src/plugins/exception/exception.reply.js.map +1 -1
- package/src/plugins/fetch-cache/fetch-cache.request.d.ts.map +1 -1
- package/src/plugins/fetch-cache/fetch-cache.request.js +3 -3
- package/src/plugins/fetch-cache/fetch-cache.request.js.map +1 -1
- package/src/plugins/fetch-credentials/fetch-credentials.request.d.ts.map +1 -1
- package/src/plugins/fetch-credentials/fetch-credentials.request.js.map +1 -1
- package/src/plugins/json-token/json-token.reply.d.ts.map +1 -1
- package/src/plugins/json-token/json-token.reply.js +6 -6
- package/src/plugins/json-token/json-token.reply.js.map +1 -1
- package/src/plugins/json-token/json-token.request.d.ts.map +1 -1
- package/src/plugins/json-token/json-token.request.js +1 -1
- package/src/plugins/json-token/json-token.request.js.map +1 -1
- package/src/plugins/keepalive/keepalive.request.d.ts.map +1 -1
- package/src/plugins/keepalive/keepalive.request.js +1 -1
- package/src/plugins/keepalive/keepalive.request.js.map +1 -1
- 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 +3 -3
- package/src/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js.map +1 -1
- package/src/plugins/mock-intercept/index.d.ts +1 -1
- package/src/plugins/mock-intercept/index.d.ts.map +1 -1
- package/src/plugins/mock-intercept/index.js +1 -1
- package/src/plugins/mock-intercept/index.js.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.angular.d.ts +1 -1
- package/src/plugins/mock-intercept/mock-intercept.angular.d.ts.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.angular.js +15 -11
- package/src/plugins/mock-intercept/mock-intercept.angular.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 +4 -6
- package/src/plugins/mock-intercept/mock-intercept.fetch.js.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.interface.d.ts +1 -1
- package/src/plugins/mock-intercept/mock-intercept.interface.d.ts.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.interface.js.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.request.d.ts.map +1 -1
- package/src/plugins/mock-intercept/mock-intercept.request.js +4 -3
- package/src/plugins/mock-intercept/mock-intercept.request.js.map +1 -1
- package/src/plugins/perf-metric/perf-metric.fetch.d.ts.map +1 -1
- package/src/plugins/perf-metric/perf-metric.fetch.js +4 -3
- package/src/plugins/perf-metric/perf-metric.fetch.js.map +1 -1
- package/src/plugins/pii-tokenizer/pii-tokenizer.request.d.ts.map +1 -1
- package/src/plugins/pii-tokenizer/pii-tokenizer.request.js +5 -10
- package/src/plugins/pii-tokenizer/pii-tokenizer.request.js.map +1 -1
- package/src/plugins/raw-response-info/raw-response-info.reply.d.ts +0 -1
- package/src/plugins/raw-response-info/raw-response-info.reply.d.ts.map +1 -1
- package/src/plugins/raw-response-info/raw-response-info.reply.js +0 -1
- package/src/plugins/raw-response-info/raw-response-info.reply.js.map +1 -1
- package/src/plugins/retry/retry.fetch.d.ts.map +1 -1
- package/src/plugins/retry/retry.fetch.js +5 -4
- package/src/plugins/retry/retry.fetch.js.map +1 -1
- package/src/plugins/reviver/reviver.reply.d.ts +1 -1
- package/src/plugins/reviver/reviver.reply.d.ts.map +1 -1
- package/src/plugins/reviver/reviver.reply.js.map +1 -1
- package/src/plugins/session-id/session-id.request.d.ts +1 -1
- package/src/plugins/session-id/session-id.request.d.ts.map +1 -1
- package/src/plugins/session-id/session-id.request.js +5 -3
- package/src/plugins/session-id/session-id.request.js.map +1 -1
- package/src/plugins/si-token/si-token.request.d.ts.map +1 -1
- package/src/plugins/si-token/si-token.request.js +1 -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.map +1 -1
- package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +1 -1
- package/src/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js.map +1 -1
- package/src/plugins/timeout/timeout.fetch.d.ts +1 -2
- package/src/plugins/timeout/timeout.fetch.d.ts.map +1 -1
- package/src/plugins/timeout/timeout.fetch.js +14 -12
- package/src/plugins/timeout/timeout.fetch.js.map +1 -1
- package/src/plugins/url-rewrite/url-rewrite.request.d.ts.map +1 -1
- package/src/plugins/url-rewrite/url-rewrite.request.js.map +1 -1
- 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/utils/crypto.d.ts.map +1 -1
- package/src/utils/crypto.js +7 -7
- package/src/utils/crypto.js.map +1 -1
- package/src/utils/encoder.d.ts +1 -1
- package/src/utils/encoder.d.ts.map +1 -1
- package/src/utils/encoder.js +22 -28
- package/src/utils/encoder.js.map +1 -1
- package/src/utils/generic-api.d.ts +1 -2
- package/src/utils/generic-api.d.ts.map +1 -1
- package/src/utils/generic-api.js +3 -6
- package/src/utils/generic-api.js.map +1 -1
- package/src/utils/ie11.d.ts.map +1 -1
- package/src/utils/ie11.js +1 -0
- package/src/utils/ie11.js.map +1 -1
- package/src/utils/index.d.ts +1 -1
- package/src/utils/index.d.ts.map +1 -1
- package/src/utils/index.js +1 -1
- package/src/utils/index.js.map +1 -1
- package/src/utils/json-token.d.ts.map +1 -1
- package/src/utils/json-token.js +12 -12
- package/src/utils/json-token.js.map +1 -1
- package/src/utils/mime-types.d.ts.map +1 -1
- package/src/utils/mime-types.js +1 -1
- package/src/utils/mime-types.js.map +1 -1
- package/src/fwk/Reviver.d.ts.map +0 -1
- package/src/fwk/Reviver.js.map +0 -1
|
@@ -170,15 +170,15 @@ function _ts_generator(thisArg, body) {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
import { createJwtEncoder } from '../../utils/json-token';
|
|
173
|
+
var jwtPayload = function(data) {
|
|
174
|
+
return _object_spread({
|
|
175
|
+
sub: 'fact'
|
|
176
|
+
}, data);
|
|
177
|
+
};
|
|
173
178
|
/**
|
|
174
179
|
* Creates a JWT encoding function which transforms the provided Facts as a unsecured JWT format https://tools.ietf.org/html/rfc7519#section-6
|
|
175
180
|
*/ export function createJwtFactsEncoder() {
|
|
176
181
|
var jwtEncoder = createJwtEncoder();
|
|
177
|
-
var jwtPayload = function(data) {
|
|
178
|
-
return _object_spread({
|
|
179
|
-
sub: 'fact'
|
|
180
|
-
}, data);
|
|
181
|
-
};
|
|
182
182
|
return function(data) {
|
|
183
183
|
return jwtEncoder(jwtPayload(data));
|
|
184
184
|
};
|
|
@@ -182,7 +182,7 @@ function _ts_generator(thisArg, body) {
|
|
|
182
182
|
value: /**
|
|
183
183
|
* Unstack and resolve the promise stopping the call to start
|
|
184
184
|
*/ function unstackResolve() {
|
|
185
|
-
if (this.canStart() && this.waitingResolvers.length) {
|
|
185
|
+
if (this.canStart() && this.waitingResolvers.length > 0) {
|
|
186
186
|
this.waitingResolvers.shift()(true);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -201,7 +201,7 @@ function _ts_generator(thisArg, body) {
|
|
|
201
201
|
},
|
|
202
202
|
transform: /*#__PURE__*/ function() {
|
|
203
203
|
var _ref = _async_to_generator(function(fetchCall) {
|
|
204
|
-
var fetchResponse
|
|
204
|
+
var fetchResponse;
|
|
205
205
|
return _ts_generator(this, function(_state) {
|
|
206
206
|
switch(_state.label){
|
|
207
207
|
case 0:
|
|
@@ -210,9 +210,9 @@ function _ts_generator(thisArg, body) {
|
|
|
210
210
|
case 1:
|
|
211
211
|
_state.trys.push([
|
|
212
212
|
1,
|
|
213
|
+
,
|
|
213
214
|
3,
|
|
214
|
-
4
|
|
215
|
-
5
|
|
215
|
+
4
|
|
216
216
|
]);
|
|
217
217
|
return [
|
|
218
218
|
4,
|
|
@@ -225,10 +225,6 @@ function _ts_generator(thisArg, body) {
|
|
|
225
225
|
fetchResponse
|
|
226
226
|
];
|
|
227
227
|
case 3:
|
|
228
|
-
e = _state.sent();
|
|
229
|
-
throw e;
|
|
230
|
-
case 4:
|
|
231
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
232
228
|
_this1.pool = _this1.pool.filter(function(call) {
|
|
233
229
|
return call !== fetchCall;
|
|
234
230
|
});
|
|
@@ -237,7 +233,7 @@ function _ts_generator(thisArg, body) {
|
|
|
237
233
|
return [
|
|
238
234
|
7
|
|
239
235
|
];
|
|
240
|
-
case
|
|
236
|
+
case 4:
|
|
241
237
|
return [
|
|
242
238
|
2
|
|
243
239
|
];
|
|
@@ -45,8 +45,7 @@ function _define_property(obj, key, value) {
|
|
|
45
45
|
value: /**
|
|
46
46
|
* Checks if the reply has a customInfo node
|
|
47
47
|
* @param reply
|
|
48
|
-
*/
|
|
49
|
-
function hasCustomInfo(reply) {
|
|
48
|
+
*/ function hasCustomInfo(reply) {
|
|
50
49
|
return !!(reply && reply.customInfo);
|
|
51
50
|
}
|
|
52
51
|
},
|
|
@@ -57,6 +56,7 @@ function _define_property(obj, key, value) {
|
|
|
57
56
|
return {
|
|
58
57
|
transform: function(data) {
|
|
59
58
|
return Object.assign(data || Object.assign({}, data), {
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- explicit `any`
|
|
60
60
|
customInfo: data && data.customInfo ? Object.assign(data.customInfo, _this.customInfo) : _this.customInfo
|
|
61
61
|
});
|
|
62
62
|
}
|
|
@@ -93,7 +93,7 @@ function _object_spread_props(target, source) {
|
|
|
93
93
|
*/ _define_property(this, "shouldAddCacheControlHeaders", void 0);
|
|
94
94
|
this.fetchCache = fetchCache;
|
|
95
95
|
this.cacheControl = cacheControl;
|
|
96
|
-
this.shouldAddCacheControlHeaders = typeof shouldAddCacheControlHeaders
|
|
96
|
+
this.shouldAddCacheControlHeaders = typeof shouldAddCacheControlHeaders === 'undefined' ? typeof fetch === 'undefined' || fetch.polyfill : shouldAddCacheControlHeaders;
|
|
97
97
|
}
|
|
98
98
|
_create_class(FetchCacheRequest, [
|
|
99
99
|
{
|
|
@@ -130,7 +130,7 @@ describe('Fetch API credentials Request Plugin', function() {
|
|
|
130
130
|
method: 'get'
|
|
131
131
|
};
|
|
132
132
|
it('credentials should be set to same-origin by default', /*#__PURE__*/ _async_to_generator(function() {
|
|
133
|
-
var plugin, runner, cred;
|
|
133
|
+
var plugin, runner, _ref, cred;
|
|
134
134
|
return _ts_generator(this, function(_state) {
|
|
135
135
|
switch(_state.label){
|
|
136
136
|
case 0:
|
|
@@ -147,7 +147,7 @@ describe('Fetch API credentials Request Plugin', function() {
|
|
|
147
147
|
plugin.load().transform(options)
|
|
148
148
|
];
|
|
149
149
|
case 2:
|
|
150
|
-
|
|
150
|
+
_ref = _state.sent(), cred = _ref.credentials;
|
|
151
151
|
expect(cred).toBe('same-origin');
|
|
152
152
|
return [
|
|
153
153
|
2
|
|
@@ -156,7 +156,7 @@ describe('Fetch API credentials Request Plugin', function() {
|
|
|
156
156
|
});
|
|
157
157
|
}));
|
|
158
158
|
it('credentials should be set correctly', /*#__PURE__*/ _async_to_generator(function() {
|
|
159
|
-
var plugin, runner, cred;
|
|
159
|
+
var plugin, runner, _ref, cred;
|
|
160
160
|
return _ts_generator(this, function(_state) {
|
|
161
161
|
switch(_state.label){
|
|
162
162
|
case 0:
|
|
@@ -173,7 +173,7 @@ describe('Fetch API credentials Request Plugin', function() {
|
|
|
173
173
|
plugin.load().transform(options)
|
|
174
174
|
];
|
|
175
175
|
case 2:
|
|
176
|
-
|
|
176
|
+
_ref = _state.sent(), cred = _ref.credentials;
|
|
177
177
|
expect(cred).toBe('include');
|
|
178
178
|
return [
|
|
179
179
|
2
|
|
@@ -54,16 +54,16 @@ function _define_property(obj, key, value) {
|
|
|
54
54
|
}
|
|
55
55
|
if (context.response.headers.has('Authorization')) {
|
|
56
56
|
var token = context.response.headers.get('Authorization');
|
|
57
|
-
if (typeof sessionStorage
|
|
58
|
-
sessionStorage.setItem(_this.storageTokenKey, token);
|
|
59
|
-
} else {
|
|
57
|
+
if (typeof sessionStorage === 'undefined') {
|
|
60
58
|
_this.sharedMemory[_this.storageTokenKey] = token;
|
|
59
|
+
} else {
|
|
60
|
+
sessionStorage.setItem(_this.storageTokenKey, token);
|
|
61
61
|
}
|
|
62
62
|
} else {
|
|
63
|
-
if (typeof sessionStorage
|
|
64
|
-
sessionStorage.removeItem(_this.storageTokenKey);
|
|
65
|
-
} else {
|
|
63
|
+
if (typeof sessionStorage === 'undefined') {
|
|
66
64
|
_this.sharedMemory[_this.storageTokenKey] = undefined;
|
|
65
|
+
} else {
|
|
66
|
+
sessionStorage.removeItem(_this.storageTokenKey);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
return data;
|
|
@@ -50,7 +50,7 @@ function _define_property(obj, key, value) {
|
|
|
50
50
|
return {
|
|
51
51
|
transform: function(data) {
|
|
52
52
|
// Handle Authorization Tokens
|
|
53
|
-
var token = typeof sessionStorage
|
|
53
|
+
var token = typeof sessionStorage === 'undefined' ? _this.sharedMemory[_this.storageTokenKey] : sessionStorage.getItem(_this.storageTokenKey);
|
|
54
54
|
if (token) {
|
|
55
55
|
data.credentials = 'same-origin';
|
|
56
56
|
data.headers.append('Authorization', token);
|
|
@@ -165,8 +165,8 @@ describe('Json Token', function() {
|
|
|
165
165
|
case 1:
|
|
166
166
|
result = _state.sent();
|
|
167
167
|
if (typeof window !== 'undefined' && typeof window.sessionStorage !== 'undefined') {
|
|
168
|
-
expect(window.sessionStorage.getItem).toHaveBeenCalledWith(tokenKey);
|
|
169
|
-
}
|
|
168
|
+
/* eslint-disable jest/no-conditional-expect -- the same condition is verified above to set up the checked spy */ expect(window.sessionStorage.getItem).toHaveBeenCalledWith(tokenKey);
|
|
169
|
+
/* eslint-enable jest/no-conditional-expect */ }
|
|
170
170
|
expect(result.credentials).toBe('same-origin');
|
|
171
171
|
expect(result.headers.get('Authorization')).toBe(tokenValue);
|
|
172
172
|
return [
|
|
@@ -195,8 +195,8 @@ describe('Json Token', function() {
|
|
|
195
195
|
case 1:
|
|
196
196
|
result = _state.sent();
|
|
197
197
|
if (typeof window !== 'undefined' && typeof window.sessionStorage !== 'undefined') {
|
|
198
|
-
expect(window.sessionStorage.getItem).toHaveBeenCalledWith(tokenKey);
|
|
199
|
-
}
|
|
198
|
+
/* eslint-disable jest/no-conditional-expect -- the same condition is verified above to set up the checked spy */ expect(window.sessionStorage.getItem).toHaveBeenCalledWith(tokenKey);
|
|
199
|
+
/* eslint-enable jest/no-conditional-expect */ }
|
|
200
200
|
expect(result.credentials).toBeUndefined();
|
|
201
201
|
expect(result.headers.get('Authorization')).toBeNull();
|
|
202
202
|
return [
|
|
@@ -220,7 +220,6 @@ describe('Json Token', function() {
|
|
|
220
220
|
runner = plugin.load({
|
|
221
221
|
reviver: reviver,
|
|
222
222
|
apiType: ApiTypes.DEFAULT,
|
|
223
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
224
223
|
response: {
|
|
225
224
|
headers: new Headers({
|
|
226
225
|
Authorization: tokenValue
|
|
@@ -238,10 +237,9 @@ describe('Json Token', function() {
|
|
|
238
237
|
case 1:
|
|
239
238
|
_state.sent();
|
|
240
239
|
if (typeof window !== 'undefined' && typeof window.sessionStorage !== 'undefined') {
|
|
241
|
-
expect(window.sessionStorage.setItem).toHaveBeenCalledWith(tokenKey, tokenValue);
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
240
|
+
/* eslint-disable jest/no-conditional-expect -- the same condition is verified above to set up the checked spy */ expect(window.sessionStorage.setItem).toHaveBeenCalledWith(tokenKey, tokenValue);
|
|
241
|
+
/* eslint-enable jest/no-conditional-expect */ }
|
|
242
|
+
expect(memory.testToken).toBe(tokenValue);
|
|
245
243
|
return [
|
|
246
244
|
2
|
|
247
245
|
];
|
|
@@ -322,7 +322,6 @@ describe('JSON auth token request plugin', function() {
|
|
|
322
322
|
];
|
|
323
323
|
case 3:
|
|
324
324
|
secretKey = _state.sent();
|
|
325
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
326
325
|
message = "".concat(base64UrlEncoder(JSON.stringify(header)), ".").concat(base64UrlEncoder(JSON.stringify(payload)));
|
|
327
326
|
return [
|
|
328
327
|
4,
|
|
@@ -371,7 +370,6 @@ describe('JSON auth token request plugin', function() {
|
|
|
371
370
|
];
|
|
372
371
|
case 3:
|
|
373
372
|
secretKey = _state.sent();
|
|
374
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
375
373
|
message = "".concat(base64UrlEncoder(JSON.stringify(header)), ".").concat(base64UrlEncoder(JSON.stringify(payload)));
|
|
376
374
|
return [
|
|
377
375
|
4,
|
|
@@ -200,10 +200,10 @@ function _ts_generator(thisArg, body) {
|
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
+
import { HttpResponse } from '@angular/common/http';
|
|
203
204
|
import { delay, from, mergeMap } from 'rxjs';
|
|
204
205
|
import { CUSTOM_MOCK_OPERATION_ID_HEADER } from './mock-intercept.interface';
|
|
205
206
|
import { MockInterceptRequest } from './mock-intercept.request';
|
|
206
|
-
import { HttpResponse } from '@angular/common/http';
|
|
207
207
|
/**
|
|
208
208
|
* Plugin to mock and intercept the call of SDK
|
|
209
209
|
*
|
|
@@ -242,7 +242,7 @@ import { HttpResponse } from '@angular/common/http';
|
|
|
242
242
|
case 1:
|
|
243
243
|
_state.sent();
|
|
244
244
|
originalCall = call;
|
|
245
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- type of options is explicitly `any`
|
|
246
246
|
if (!context.options.headers || !_instanceof(context.options.headers, Headers) || !context.options.headers.has(CUSTOM_MOCK_OPERATION_ID_HEADER)) {
|
|
247
247
|
return [
|
|
248
248
|
2,
|
|
@@ -278,7 +278,7 @@ import { HttpResponse } from '@angular/common/http';
|
|
|
278
278
|
originalCall = originalCall.pipe(delay(delayTime));
|
|
279
279
|
_state.label = 5;
|
|
280
280
|
case 5:
|
|
281
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
281
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- type of options is explicitly `any`
|
|
282
282
|
operationId = context.options.headers.get(CUSTOM_MOCK_OPERATION_ID_HEADER);
|
|
283
283
|
try {
|
|
284
284
|
mock = _this1.options.adapter.getLatestMock(operationId);
|
|
@@ -313,7 +313,7 @@ import { HttpResponse } from '@angular/common/http';
|
|
|
313
313
|
];
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
|
-
});
|
|
316
|
+
/* eslint-enable-next-line @typescript-eslint/no-unsafe-assignment */ });
|
|
317
317
|
return function(res) {
|
|
318
318
|
return _ref.apply(this, arguments);
|
|
319
319
|
};
|
|
@@ -200,7 +200,6 @@ import { MockInterceptRequest } from './mock-intercept.request';
|
|
|
200
200
|
case 1:
|
|
201
201
|
_state.sent();
|
|
202
202
|
responsePromise = fetchCall;
|
|
203
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
204
203
|
if (!context.options.headers || !_instanceof(context.options.headers, Headers) || !context.options.headers.has(CUSTOM_MOCK_OPERATION_ID_HEADER)) {
|
|
205
204
|
return [
|
|
206
205
|
2,
|
|
@@ -243,7 +242,6 @@ import { MockInterceptRequest } from './mock-intercept.request';
|
|
|
243
242
|
});
|
|
244
243
|
_state.label = 6;
|
|
245
244
|
case 6:
|
|
246
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
247
245
|
operationId = context.options.headers.get(CUSTOM_MOCK_OPERATION_ID_HEADER);
|
|
248
246
|
try {
|
|
249
247
|
mock = _this.options.adapter.getLatestMock(operationId);
|
|
@@ -234,7 +234,7 @@ describe('Mock intercept', function() {
|
|
|
234
234
|
});
|
|
235
235
|
}));
|
|
236
236
|
it('should intercept the request', /*#__PURE__*/ _async_to_generator(function() {
|
|
237
|
-
var plugin, originalRequest, loaded, transformed, res;
|
|
237
|
+
var plugin, originalRequest, loaded, transformed, res, text;
|
|
238
238
|
return _ts_generator(this, function(_state) {
|
|
239
239
|
switch(_state.label){
|
|
240
240
|
case 0:
|
|
@@ -261,14 +261,15 @@ describe('Mock intercept', function() {
|
|
|
261
261
|
fetch(transformed.basePath, transformed)
|
|
262
262
|
];
|
|
263
263
|
case 2:
|
|
264
|
+
res = _state.sent();
|
|
264
265
|
return [
|
|
265
266
|
4,
|
|
266
|
-
|
|
267
|
+
res.text()
|
|
267
268
|
];
|
|
268
269
|
case 3:
|
|
269
|
-
|
|
270
|
+
text = _state.sent();
|
|
270
271
|
expect(getMockSpy).toHaveBeenCalled();
|
|
271
|
-
expect(
|
|
272
|
+
expect(text).toBe(JSON.stringify(testMock.mockData));
|
|
272
273
|
expect(initializeSpy).toHaveBeenCalled();
|
|
273
274
|
return [
|
|
274
275
|
2
|
|
@@ -59,6 +59,13 @@ function _define_property(obj, key, value) {
|
|
|
59
59
|
}
|
|
60
60
|
return obj;
|
|
61
61
|
}
|
|
62
|
+
function _instanceof(left, right) {
|
|
63
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
64
|
+
return !!right[Symbol.hasInstance](left);
|
|
65
|
+
} else {
|
|
66
|
+
return left instanceof right;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
62
69
|
function _object_spread(target) {
|
|
63
70
|
for(var i = 1; i < arguments.length; i++){
|
|
64
71
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -229,7 +236,7 @@ import { v4 } from 'uuid';
|
|
|
229
236
|
return "sdk:".concat(status, ":").concat(markId);
|
|
230
237
|
});
|
|
231
238
|
this.getPerformanceTag = (options === null || options === void 0 ? void 0 : options.getPerformanceTag) || this.getPerformanceTag;
|
|
232
|
-
this.performance = (options === null || options === void 0 ? void 0 : options.performance) || (typeof window
|
|
239
|
+
this.performance = (options === null || options === void 0 ? void 0 : options.performance) || (typeof window === 'undefined' ? undefined : window.performance);
|
|
233
240
|
this.onMarkComplete = options ? options.onMarkComplete : this.onMarkComplete;
|
|
234
241
|
this.onMarkError = options ? options.onMarkError : this.onMarkError;
|
|
235
242
|
this.onMarkOpen = options ? options.onMarkOpen : this.onMarkOpen;
|
|
@@ -343,7 +350,8 @@ import { v4 } from 'uuid';
|
|
|
343
350
|
];
|
|
344
351
|
case 3:
|
|
345
352
|
exception = _state.sent();
|
|
346
|
-
|
|
353
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access -- type is explicitly `any`
|
|
354
|
+
_this.closeMarkWithError(markId, _instanceof(exception, Error) ? exception : new Error(exception.toString()));
|
|
347
355
|
throw exception;
|
|
348
356
|
case 4:
|
|
349
357
|
return [
|
|
@@ -184,7 +184,6 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
184
184
|
iat: timestamp,
|
|
185
185
|
exp: timestamp + expirationDelay,
|
|
186
186
|
iss: applicationId,
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
188
187
|
'ama-tokens': values
|
|
189
188
|
};
|
|
190
189
|
};
|
|
@@ -211,7 +210,6 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
211
210
|
iat: timestamp,
|
|
212
211
|
exp: timestamp + expirationDelay,
|
|
213
212
|
iss: applicationId,
|
|
214
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
215
213
|
'ama-tokens': values
|
|
216
214
|
};
|
|
217
215
|
};
|
|
@@ -288,14 +286,10 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
288
286
|
this.tokensHeader = options.headerName || 'ama-client-facts';
|
|
289
287
|
this.challengeHeader = options.challengeHeaderName || 'ama-client-facts-challenge';
|
|
290
288
|
this.silent = options.silent || false;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
], options.useHeaderAsAdditionalAuthenticatedData);
|
|
296
|
-
} else {
|
|
297
|
-
this.tokenEncoder = createJwtPiiEncoder(options.applicationId, options.expirationDelay);
|
|
298
|
-
}
|
|
289
|
+
this.tokenEncoder = options.key ? createJwePiiEncoder(options.applicationId, options.expirationDelay, options.key, options.publicProperties || [
|
|
290
|
+
'iss',
|
|
291
|
+
'sub'
|
|
292
|
+
], options.useHeaderAsAdditionalAuthenticatedData) : createJwtPiiEncoder(options.applicationId, options.expirationDelay);
|
|
299
293
|
}
|
|
300
294
|
_create_class(PiiTokenizerRequest, [
|
|
301
295
|
{
|
|
@@ -329,7 +323,7 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
329
323
|
case 2:
|
|
330
324
|
e = _state.sent();
|
|
331
325
|
if (_this.silent) {
|
|
332
|
-
(logger || console).error('Couldn\'t encode the token');
|
|
326
|
+
(logger || console).error('Couldn\'t encode the token', e);
|
|
333
327
|
} else {
|
|
334
328
|
throw new Error('Couldn\'t encode the token');
|
|
335
329
|
}
|
|
@@ -276,7 +276,7 @@ describe('Tokenizer Request Plugin', function() {
|
|
|
276
276
|
expect(result.queryParams.classicParam).toEqual('classicParamValue');
|
|
277
277
|
expect(result.queryParams.sensitiveParam).toEqual('sensitiveParamValue');
|
|
278
278
|
expect(result.headers.get('ama-client-facts')).toBeNull();
|
|
279
|
-
// eslint-disable-next-line no-console
|
|
279
|
+
// eslint-disable-next-line no-console -- not calling console.error but expect if it has been called or not
|
|
280
280
|
expect(console.error).toHaveBeenCalled();
|
|
281
281
|
return [
|
|
282
282
|
2
|
|
@@ -307,7 +307,7 @@ describe('Tokenizer Request Plugin', function() {
|
|
|
307
307
|
expect(result.queryParams.classicParam).toEqual('classicParamValue');
|
|
308
308
|
expect(result.queryParams.sensitiveParam).toEqual('sensitiveParamValue');
|
|
309
309
|
expect(result.headers.get('ama-client-facts')).toBeNull();
|
|
310
|
-
// eslint-disable-next-line no-console
|
|
310
|
+
// eslint-disable-next-line no-console -- not calling console.error but expect if it has been called or not
|
|
311
311
|
expect(console.error).not.toHaveBeenCalled();
|
|
312
312
|
return [
|
|
313
313
|
2
|
|
@@ -373,7 +373,6 @@ describe('Tokenizer Request Plugin', function() {
|
|
|
373
373
|
case 1:
|
|
374
374
|
result = _state.sent();
|
|
375
375
|
expectedJwePayload = {
|
|
376
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
377
376
|
'ama-tokens': {
|
|
378
377
|
$pathParamToken$: 'pathParamValue',
|
|
379
378
|
$sensitiveParamToken$: 'sensitiveParamValue'
|
|
@@ -422,7 +421,7 @@ describe('Tokenizer Request Plugin', function() {
|
|
|
422
421
|
case 1:
|
|
423
422
|
_state.sent();
|
|
424
423
|
expect(mockJweEncoder).toHaveBeenCalled();
|
|
425
|
-
// eslint-disable-next-line no-console
|
|
424
|
+
// eslint-disable-next-line no-console -- not calling console.error but expect if it has been called or not
|
|
426
425
|
expect(console.error).not.toHaveBeenCalled();
|
|
427
426
|
return [
|
|
428
427
|
2
|
|
@@ -458,7 +457,7 @@ describe('Tokenizer Request Plugin', function() {
|
|
|
458
457
|
case 1:
|
|
459
458
|
_state.sent();
|
|
460
459
|
expect(mockJweEncoder).toHaveBeenCalled();
|
|
461
|
-
// eslint-disable-next-line no-console
|
|
460
|
+
// eslint-disable-next-line no-console -- not calling console.error but expect if it has been called or not
|
|
462
461
|
expect(console.error).toHaveBeenCalled();
|
|
463
462
|
return [
|
|
464
463
|
2
|
|
@@ -501,7 +500,7 @@ describe('Tokenizer Request Plugin', function() {
|
|
|
501
500
|
expect(result.queryParams.classicParam).toEqual('classicParamValue');
|
|
502
501
|
expect(result.queryParams.sensitiveParam).toEqual('$sensitiveParamToken$');
|
|
503
502
|
expect(result.headers.get('ama-client-facts')).toEqual('myDeepLinkToken');
|
|
504
|
-
// eslint-disable-next-line no-console
|
|
503
|
+
// eslint-disable-next-line no-console -- not calling console.error but expect if it has been called or not
|
|
505
504
|
expect(console.error).not.toHaveBeenCalled();
|
|
506
505
|
return [
|
|
507
506
|
2
|
|
@@ -217,38 +217,23 @@ import { CanceledCallError } from '../../fwk/errors';
|
|
|
217
217
|
value: function delay(countDown) {
|
|
218
218
|
var _this = this;
|
|
219
219
|
return _async_to_generator(function() {
|
|
220
|
+
var time;
|
|
220
221
|
return _ts_generator(this, function(_state) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
];
|
|
237
|
-
case 1:
|
|
238
|
-
return [
|
|
239
|
-
2,
|
|
240
|
-
setTimeout.apply(void 0, _tmp.concat([
|
|
241
|
-
_state.sent()
|
|
242
|
-
]))
|
|
243
|
-
];
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
return function(resolve) {
|
|
248
|
-
return _ref.apply(this, arguments);
|
|
249
|
-
};
|
|
250
|
-
}())
|
|
251
|
-
];
|
|
222
|
+
switch(_state.label){
|
|
223
|
+
case 0:
|
|
224
|
+
return [
|
|
225
|
+
4,
|
|
226
|
+
_this.sleepBetweenRetry(countDown)
|
|
227
|
+
];
|
|
228
|
+
case 1:
|
|
229
|
+
time = _state.sent();
|
|
230
|
+
return [
|
|
231
|
+
2,
|
|
232
|
+
new Promise(function(resolve) {
|
|
233
|
+
return setTimeout(resolve, time);
|
|
234
|
+
})
|
|
235
|
+
];
|
|
236
|
+
}
|
|
252
237
|
});
|
|
253
238
|
})();
|
|
254
239
|
}
|
|
@@ -331,7 +316,7 @@ import { CanceledCallError } from '../../fwk/errors';
|
|
|
331
316
|
];
|
|
332
317
|
return [
|
|
333
318
|
4,
|
|
334
|
-
_this.condition(context, undefined, e)
|
|
319
|
+
_this.condition(context, undefined, _instanceof(e, Error) ? e : new Error(e.toString()))
|
|
335
320
|
];
|
|
336
321
|
case 5:
|
|
337
322
|
conditionResult1 = _state.sent();
|
|
@@ -202,10 +202,10 @@ describe('Retry Fetch Plugin', function() {
|
|
|
202
202
|
fetchPlugins: runners
|
|
203
203
|
});
|
|
204
204
|
runners.push(runner);
|
|
205
|
-
call = Promise.reject({
|
|
205
|
+
call = Promise.reject(new Error(JSON.stringify({
|
|
206
206
|
text: 'test',
|
|
207
207
|
ok: true
|
|
208
|
-
});
|
|
208
|
+
})));
|
|
209
209
|
callback = jest.fn();
|
|
210
210
|
runner.transform(call).catch(callback);
|
|
211
211
|
return [
|
|
@@ -238,10 +238,10 @@ describe('Retry Fetch Plugin', function() {
|
|
|
238
238
|
fetchPlugins: runners
|
|
239
239
|
});
|
|
240
240
|
runners.push(runner);
|
|
241
|
-
call = Promise.reject({
|
|
241
|
+
call = Promise.reject(new Error(JSON.stringify({
|
|
242
242
|
text: 'test',
|
|
243
243
|
ok: true
|
|
244
|
-
});
|
|
244
|
+
})));
|
|
245
245
|
callback = jest.fn();
|
|
246
246
|
runner.transform(call).catch(callback);
|
|
247
247
|
return [
|
|
@@ -64,9 +64,9 @@ import { v4 } from 'uuid';
|
|
|
64
64
|
{
|
|
65
65
|
key: "logSessionId",
|
|
66
66
|
value: function logSessionId(sessionId, date, logger) {
|
|
67
|
-
((logger === null || logger === void 0 ? void 0 : logger.info) || (logger === null || logger === void 0 ? void 0 : logger.log) || console.info).bind(logger || console)('Your debug ID associated to the header "'.concat(this.sessionIdHeader, '" is: ').concat(sessionId, "."));
|
|
67
|
+
/* eslint-disable no-console -- console are default value */ ((logger === null || logger === void 0 ? void 0 : logger.info) || (logger === null || logger === void 0 ? void 0 : logger.log) || console.info).bind(logger || console)('Your debug ID associated to the header "'.concat(this.sessionIdHeader, '" is: ').concat(sessionId, "."));
|
|
68
68
|
((logger === null || logger === void 0 ? void 0 : logger.info) || (logger === null || logger === void 0 ? void 0 : logger.log) || console.info).bind(logger || console)("Generated at: ".concat(date));
|
|
69
|
-
}
|
|
69
|
+
/* eslint-enable no-console */ }
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
key: "load",
|
|
@@ -126,12 +126,12 @@ import { v4 } from 'uuid';
|
|
|
126
126
|
* Generates a request ID.
|
|
127
127
|
*/ function generateRequestId() {
|
|
128
128
|
var requestCountKey = this.sessionIdHeader + '-Request-Count';
|
|
129
|
-
var requestCount = NaN;
|
|
129
|
+
var requestCount = Number.NaN;
|
|
130
130
|
// Check if we already have a request count in the shared memory or session storage
|
|
131
131
|
if (SessionIdRequest.sharedMemory[requestCountKey] !== undefined) {
|
|
132
132
|
requestCount = SessionIdRequest.sharedMemory[requestCountKey];
|
|
133
133
|
} else if (typeof sessionStorage !== 'undefined') {
|
|
134
|
-
requestCount = +(sessionStorage.getItem(requestCountKey) || NaN);
|
|
134
|
+
requestCount = +(sessionStorage.getItem(requestCountKey) || Number.NaN);
|
|
135
135
|
}
|
|
136
136
|
// If the request count is not defined yet or if it has been corrupted somehow, we start at 0.
|
|
137
137
|
requestCount = requestCount + 1 || 0;
|
|
@@ -204,7 +204,7 @@ describe('Session ID Request Plugin', function() {
|
|
|
204
204
|
];
|
|
205
205
|
case 1:
|
|
206
206
|
_state.sent();
|
|
207
|
-
expect(sessionId).toMatch(/[
|
|
207
|
+
expect(sessionId).toMatch(/[\dA-Za-z-]{10,48}/);
|
|
208
208
|
expect(options.headers.get('Ama-Client-Ref')).toMatch(new RegExp(sessionId + ':[0-9a-zA-Z]{1,10}'));
|
|
209
209
|
return [
|
|
210
210
|
2
|
|
@@ -226,7 +226,7 @@ describe('Session ID Request Plugin', function() {
|
|
|
226
226
|
];
|
|
227
227
|
case 1:
|
|
228
228
|
_state.sent();
|
|
229
|
-
expect(sessionId).toMatch(/[
|
|
229
|
+
expect(sessionId).toMatch(/[\dA-Za-z-]{10,48}/);
|
|
230
230
|
expect(options.headers.get(TEST_KEY)).toEqual(sessionId);
|
|
231
231
|
return [
|
|
232
232
|
2
|
|
@@ -122,8 +122,8 @@ function _ts_generator(thisArg, body) {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
import { SimpleApiKeyAuthenticationRequest } from './simple-api-key-authentication.request';
|
|
126
125
|
import { createBase64UrlDecoder } from '../../utils/json-token';
|
|
126
|
+
import { SimpleApiKeyAuthenticationRequest } from './simple-api-key-authentication.request';
|
|
127
127
|
var base64UrlDecoder = createBase64UrlDecoder();
|
|
128
128
|
function getJWTPayload(jwt) {
|
|
129
129
|
return JSON.parse(base64UrlDecoder(jwt.split('.')[1]));
|