@ama-sdk/core 12.1.8 → 12.1.11
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 +13 -18
- package/cjs/clients/api-fetch-client.js +16 -21
- package/cjs/fwk/api.helpers.js +11 -11
- package/cjs/fwk/date.js +5 -5
- package/cjs/fwk/errors.js +7 -7
- package/cjs/fwk/mocks/alf-mock-adapter.js +58 -60
- package/cjs/fwk/mocks/base-mock-adapter.js +15 -19
- package/cjs/fwk/mocks/helpers.js +3 -3
- package/cjs/fwk/param-serialization.js +6 -6
- package/cjs/fwk/reviver.js +4 -4
- package/cjs/plugins/abort/abort.spec.js +83 -81
- package/cjs/plugins/additional-params/additional-params.request.js +18 -25
- package/cjs/plugins/additional-params/additional-params.spec.js +194 -186
- package/cjs/plugins/api-configuration-override/api-configuration-override.request.js +10 -17
- package/cjs/plugins/api-configuration-override/api-configuration-override.spec.js +83 -81
- package/cjs/plugins/api-key/api-key.request.js +12 -19
- package/cjs/plugins/api-key/api-key.spec.js +50 -50
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +25 -36
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +343 -327
- package/cjs/plugins/client-facts/client-facts.request.js +18 -25
- package/cjs/plugins/client-facts/client-facts.spec.js +218 -208
- package/cjs/plugins/concurrent/concurrent.fetch.js +12 -20
- package/cjs/plugins/concurrent/concurrent.spec.js +99 -99
- package/cjs/plugins/custom-info/custom-info.spec.js +90 -90
- package/cjs/plugins/fetch-cache/fetch-cache.spec.js +100 -98
- package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +60 -60
- package/cjs/plugins/json-token/json-token.spec.js +109 -107
- package/cjs/plugins/keepalive/keepalive.request.js +7 -12
- package/cjs/plugins/keepalive/keepalive.spec.js +32 -34
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.helpers.js +11 -23
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +18 -28
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +212 -204
- package/cjs/plugins/mock-intercept/mock-intercept.angular.js +94 -100
- package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +15 -22
- package/cjs/plugins/mock-intercept/mock-intercept.interface.js +3 -3
- package/cjs/plugins/mock-intercept/mock-intercept.request.js +12 -19
- package/cjs/plugins/mock-intercept/mock-intercept.spec.js +245 -237
- package/cjs/plugins/perf-metric/perf-metric.fetch.js +11 -18
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +19 -27
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +404 -386
- package/cjs/plugins/raw-response-info/raw-response-info.spec.js +67 -67
- package/cjs/plugins/retry/retry.fetch.js +18 -27
- package/cjs/plugins/retry/retry.spec.js +233 -225
- package/cjs/plugins/reviver/reviver.spec.js +88 -86
- package/cjs/plugins/session-id/session-id.spec.js +98 -94
- package/cjs/plugins/si-token/si-token.spec.js +27 -29
- package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +17 -24
- package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +199 -191
- package/cjs/plugins/timeout/timeout.fetch.js +16 -22
- package/cjs/plugins/timeout/timeout.spec.js +211 -205
- package/cjs/plugins/url-rewrite/url-rewrite.request.js +9 -16
- package/cjs/plugins/url-rewrite/url-rewrite.spec.js +48 -48
- package/cjs/plugins/wait-for/wait-for.fetch.js +19 -29
- package/cjs/plugins/wait-for/wait-for.spec.js +211 -203
- package/cjs/utils/crypto.js +15 -27
- package/cjs/utils/generic-api.js +9 -14
- package/cjs/utils/json-token.js +19 -26
- package/cjs/utils/json-token.spec.js +495 -497
- package/cjs/utils/mime-types.js +3 -3
- package/esm2015/clients/api-angular-client.js +13 -18
- package/esm2015/clients/api-fetch-client.js +16 -21
- package/esm2015/fwk/mocks/alf-mock-adapter.js +58 -60
- package/esm2015/fwk/mocks/base-mock-adapter.js +15 -19
- package/esm2015/plugins/abort/abort.spec.js +83 -81
- package/esm2015/plugins/additional-params/additional-params.request.js +15 -22
- package/esm2015/plugins/additional-params/additional-params.spec.js +194 -186
- package/esm2015/plugins/api-configuration-override/api-configuration-override.request.js +10 -17
- package/esm2015/plugins/api-configuration-override/api-configuration-override.spec.js +83 -81
- package/esm2015/plugins/api-key/api-key.request.js +12 -19
- package/esm2015/plugins/api-key/api-key.spec.js +50 -50
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +21 -32
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +343 -327
- package/esm2015/plugins/client-facts/client-facts.request.js +15 -22
- package/esm2015/plugins/client-facts/client-facts.spec.js +218 -208
- package/esm2015/plugins/concurrent/concurrent.fetch.js +12 -20
- package/esm2015/plugins/concurrent/concurrent.spec.js +99 -99
- package/esm2015/plugins/custom-info/custom-info.spec.js +90 -90
- package/esm2015/plugins/fetch-cache/fetch-cache.spec.js +100 -98
- package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +60 -60
- package/esm2015/plugins/json-token/json-token.spec.js +109 -107
- package/esm2015/plugins/keepalive/keepalive.request.js +7 -12
- package/esm2015/plugins/keepalive/keepalive.spec.js +32 -34
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.helpers.js +8 -20
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +18 -28
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +212 -204
- package/esm2015/plugins/mock-intercept/mock-intercept.angular.js +94 -100
- package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +15 -22
- package/esm2015/plugins/mock-intercept/mock-intercept.request.js +12 -19
- package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +245 -237
- package/esm2015/plugins/perf-metric/perf-metric.fetch.js +11 -18
- package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +15 -23
- package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +404 -386
- package/esm2015/plugins/raw-response-info/raw-response-info.spec.js +67 -67
- package/esm2015/plugins/retry/retry.fetch.js +18 -27
- package/esm2015/plugins/retry/retry.spec.js +233 -225
- package/esm2015/plugins/reviver/reviver.spec.js +88 -86
- package/esm2015/plugins/session-id/session-id.spec.js +98 -94
- package/esm2015/plugins/si-token/si-token.spec.js +27 -29
- package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +17 -24
- package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +199 -191
- package/esm2015/plugins/timeout/timeout.fetch.js +13 -19
- package/esm2015/plugins/timeout/timeout.spec.js +211 -205
- package/esm2015/plugins/url-rewrite/url-rewrite.request.js +9 -16
- package/esm2015/plugins/url-rewrite/url-rewrite.spec.js +48 -48
- package/esm2015/plugins/wait-for/wait-for.fetch.js +19 -29
- package/esm2015/plugins/wait-for/wait-for.spec.js +211 -203
- package/esm2015/utils/crypto.js +8 -20
- package/esm2015/utils/generic-api.js +9 -14
- package/esm2015/utils/json-token.js +10 -17
- package/esm2015/utils/json-token.spec.js +495 -497
- package/package.json +6 -6
|
@@ -75,7 +75,7 @@ function _object_spread(target) {
|
|
|
75
75
|
return target;
|
|
76
76
|
}
|
|
77
77
|
function _ts_generator(thisArg, body) {
|
|
78
|
-
var f, y, t,
|
|
78
|
+
var f, y, t, _ = {
|
|
79
79
|
label: 0,
|
|
80
80
|
sent: function() {
|
|
81
81
|
if (t[0] & 1) throw t[1];
|
|
@@ -83,12 +83,8 @@ function _ts_generator(thisArg, body) {
|
|
|
83
83
|
},
|
|
84
84
|
trys: [],
|
|
85
85
|
ops: []
|
|
86
|
-
};
|
|
87
|
-
return g = {
|
|
88
|
-
next: verb(0),
|
|
89
|
-
"throw": verb(1),
|
|
90
|
-
"return": verb(2)
|
|
91
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
86
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
87
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
92
88
|
return this;
|
|
93
89
|
}), g;
|
|
94
90
|
function verb(n) {
|
|
@@ -101,7 +97,7 @@ function _ts_generator(thisArg, body) {
|
|
|
101
97
|
}
|
|
102
98
|
function step(op) {
|
|
103
99
|
if (f) throw new TypeError("Generator is already executing.");
|
|
104
|
-
while(_)try {
|
|
100
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
105
101
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
106
102
|
if (y = 0, t) op = [
|
|
107
103
|
op[0] & 2,
|
|
@@ -299,7 +295,6 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
299
295
|
* @param requestOptions Request options to generate the token
|
|
300
296
|
* @param logger Logger (optional, fallback to console logger if undefined)
|
|
301
297
|
*/ function appendEncodedToken(requestOptions, logger) {
|
|
302
|
-
var _this = this;
|
|
303
298
|
return _async_to_generator(function() {
|
|
304
299
|
var e;
|
|
305
300
|
return _ts_generator(this, function(_state) {
|
|
@@ -313,7 +308,7 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
313
308
|
]);
|
|
314
309
|
return [
|
|
315
310
|
4,
|
|
316
|
-
|
|
311
|
+
this.tokenEncoder(requestOptions.tokenizedOptions.values)
|
|
317
312
|
];
|
|
318
313
|
case 1:
|
|
319
314
|
return [
|
|
@@ -322,7 +317,7 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
322
317
|
];
|
|
323
318
|
case 2:
|
|
324
319
|
e = _state.sent();
|
|
325
|
-
if (
|
|
320
|
+
if (this.silent) {
|
|
326
321
|
(logger || console).error('Couldn\'t encode the token', e);
|
|
327
322
|
} else {
|
|
328
323
|
throw new Error('Couldn\'t encode the token');
|
|
@@ -337,7 +332,7 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
337
332
|
];
|
|
338
333
|
}
|
|
339
334
|
});
|
|
340
|
-
})();
|
|
335
|
+
}).call(this);
|
|
341
336
|
}
|
|
342
337
|
},
|
|
343
338
|
{
|
|
@@ -345,8 +340,8 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
345
340
|
value: /** @inheritdoc */ function load(context) {
|
|
346
341
|
var _this = this;
|
|
347
342
|
return {
|
|
348
|
-
transform:
|
|
349
|
-
|
|
343
|
+
transform: function(data) {
|
|
344
|
+
return _async_to_generator(function() {
|
|
350
345
|
var _data_metadata, _data_metadata_deepLinkOptions, token, challengeAnswers, token1;
|
|
351
346
|
return _ts_generator(this, function(_state) {
|
|
352
347
|
switch(_state.label){
|
|
@@ -356,9 +351,9 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
356
351
|
1
|
|
357
352
|
];
|
|
358
353
|
_data_metadata_deepLinkOptions = data.metadata.deepLinkOptions, token = _data_metadata_deepLinkOptions.token, challengeAnswers = _data_metadata_deepLinkOptions.challengeAnswers;
|
|
359
|
-
data.headers.append(
|
|
354
|
+
data.headers.append(this.tokensHeader, token);
|
|
360
355
|
if (challengeAnswers) {
|
|
361
|
-
data.headers.append(
|
|
356
|
+
data.headers.append(this.challengeHeader, JSON.stringify(challengeAnswers));
|
|
362
357
|
}
|
|
363
358
|
return [
|
|
364
359
|
3,
|
|
@@ -383,12 +378,12 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
383
378
|
data.queryParams = _object_spread({}, data.queryParams, data.tokenizedOptions.queryParams);
|
|
384
379
|
return [
|
|
385
380
|
4,
|
|
386
|
-
|
|
381
|
+
this.appendEncodedToken(data, context === null || context === void 0 ? void 0 : context.logger)
|
|
387
382
|
];
|
|
388
383
|
case 3:
|
|
389
384
|
token1 = _state.sent();
|
|
390
385
|
if (token1) {
|
|
391
|
-
data.headers.append(
|
|
386
|
+
data.headers.append(this.tokensHeader, token1);
|
|
392
387
|
}
|
|
393
388
|
_state.label = 4;
|
|
394
389
|
case 4:
|
|
@@ -398,11 +393,8 @@ import { createJweEncoder, createJwtEncoder } from '../../utils/json-token';
|
|
|
398
393
|
];
|
|
399
394
|
}
|
|
400
395
|
});
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
return _ref.apply(this, arguments);
|
|
404
|
-
};
|
|
405
|
-
}()
|
|
396
|
+
}).call(_this);
|
|
397
|
+
}
|
|
406
398
|
};
|
|
407
399
|
}
|
|
408
400
|
}
|