@ama-sdk/core 10.3.0-prerelease.9 → 10.3.0-rc.1
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 +36 -18
- package/cjs/clients/api-beacon-client.js +61 -19
- package/cjs/clients/api-fetch-client.js +60 -18
- package/cjs/fwk/api.helper.spec.js +20 -20
- package/cjs/fwk/api.helpers.js +14 -14
- package/cjs/fwk/core/api-client.js +1 -1
- package/cjs/fwk/core/base-api-constructor.js +1 -1
- package/cjs/fwk/date.js +9 -9
- package/cjs/fwk/date.spec.js +25 -25
- package/cjs/fwk/errors.js +3 -3
- package/cjs/fwk/mocks/alf-mock-adapter.js +4 -4
- package/cjs/fwk/mocks/base-mock-adapter.js +2 -2
- package/cjs/fwk/mocks/helpers.js +3 -3
- package/cjs/fwk/reviver.spec.js +19 -19
- package/cjs/plugins/additional-params/additional-params-sync.request.js +2 -2
- package/cjs/plugins/additional-params/additional-params.request.js +3 -3
- package/cjs/plugins/additional-params/additional-params.spec.js +30 -30
- package/cjs/plugins/api-configuration-override/api-configuration-override.request.js +2 -2
- package/cjs/plugins/api-configuration-override/api-configuration-override.spec.js +13 -13
- package/cjs/plugins/api-key/api-key.request.js +2 -2
- package/cjs/plugins/api-key/api-key.spec.js +11 -11
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +5 -5
- package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +33 -33
- package/cjs/plugins/client-facts/client-facts.request.js +3 -3
- package/cjs/plugins/client-facts/client-facts.spec.js +27 -27
- package/cjs/plugins/concurrent/concurrent.spec.js +4 -4
- package/cjs/plugins/custom-info/custom-info.spec.js +15 -15
- package/cjs/plugins/exception/exception.reply.js +2 -2
- package/cjs/plugins/exception/exception.spec.js +15 -15
- package/cjs/plugins/fetch-cache/fetch-cache.request.js +4 -4
- package/cjs/plugins/fetch-cache/fetch-cache.spec.js +20 -20
- package/cjs/plugins/fetch-credentials/fetch-credentials.request.js +1 -1
- package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +8 -8
- package/cjs/plugins/json-token/json-token.reply.js +5 -5
- package/cjs/plugins/json-token/json-token.request.js +4 -4
- package/cjs/plugins/json-token/json-token.spec.js +24 -24
- package/cjs/plugins/keepalive/keepalive.request.js +2 -2
- package/cjs/plugins/keepalive/keepalive.spec.js +4 -4
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +11 -11
- package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +25 -25
- package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +3 -3
- package/cjs/plugins/mock-intercept/mock-intercept.interface.js +2 -2
- package/cjs/plugins/mock-intercept/mock-intercept.request.js +3 -3
- package/cjs/plugins/mock-intercept/mock-intercept.spec.js +28 -28
- package/cjs/plugins/perf-metric/perf-metric.fetch.js +1 -1
- package/cjs/plugins/perf-metric/perf-metric.probe.spec.js +9 -9
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +11 -11
- package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +94 -94
- package/cjs/plugins/raw-response-info/raw-response-info.spec.js +12 -12
- package/cjs/plugins/retry/retry.spec.js +20 -20
- package/cjs/plugins/reviver/reviver.spec.js +4 -4
- package/cjs/plugins/session-id/session-id.request.js +6 -6
- package/cjs/plugins/session-id/session-id.spec.js +13 -13
- package/cjs/plugins/si-token/si-token.spec.js +9 -9
- package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +4 -4
- package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +44 -44
- package/cjs/plugins/timeout/timeout.fetch.js +11 -11
- package/cjs/plugins/timeout/timeout.spec.js +13 -13
- package/cjs/plugins/url-rewrite/url-rewrite.spec.js +9 -9
- package/cjs/plugins/wait-for/wait-for.spec.js +9 -9
- package/cjs/utils/crypto.js +14 -14
- package/cjs/utils/generic-api.js +253 -0
- package/cjs/utils/index.js +1 -0
- package/cjs/utils/json-token.js +30 -30
- package/cjs/utils/json-token.spec.js +31 -31
- package/cli/clear-index.cjs.map +1 -0
- package/cli/files-pack.cjs.map +1 -0
- package/esm2015/clients/api-angular-client.js +40 -22
- package/esm2015/clients/api-beacon-client.js +62 -20
- package/esm2015/clients/api-fetch-client.js +64 -22
- package/esm2015/clients/index.js +2 -2
- package/esm2015/fwk/api.helper.spec.js +21 -21
- package/esm2015/fwk/api.helpers.js +14 -14
- package/esm2015/fwk/core/api-client.js +1 -1
- package/esm2015/fwk/core/base-api-constructor.js +1 -1
- package/esm2015/fwk/core/index.js +2 -2
- package/esm2015/fwk/date.js +9 -9
- package/esm2015/fwk/date.spec.js +26 -26
- package/esm2015/fwk/errors.js +3 -3
- package/esm2015/fwk/index.js +10 -10
- package/esm2015/fwk/mocks/alf-mock-adapter.js +6 -6
- package/esm2015/fwk/mocks/base-mock-adapter.js +3 -3
- package/esm2015/fwk/mocks/helpers.js +3 -3
- package/esm2015/fwk/mocks/index.js +10 -10
- package/esm2015/fwk/mocks/random-mock-adapter.js +1 -1
- package/esm2015/fwk/mocks/sequential-mock-adapter.js +1 -1
- package/esm2015/fwk/reviver.spec.js +20 -20
- package/esm2015/plugins/additional-params/additional-params-sync.request.js +3 -3
- package/esm2015/plugins/additional-params/additional-params.request.js +3 -3
- package/esm2015/plugins/additional-params/additional-params.spec.js +32 -32
- package/esm2015/plugins/additional-params/index.js +2 -2
- package/esm2015/plugins/api-configuration-override/api-configuration-override.request.js +2 -2
- package/esm2015/plugins/api-configuration-override/api-configuration-override.spec.js +14 -14
- package/esm2015/plugins/api-configuration-override/index.js +1 -1
- package/esm2015/plugins/api-key/api-key.request.js +2 -2
- package/esm2015/plugins/api-key/api-key.spec.js +12 -12
- package/esm2015/plugins/api-key/index.js +1 -1
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +5 -5
- package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +34 -34
- package/esm2015/plugins/bot-protection-fingerprint/index.js +1 -1
- package/esm2015/plugins/client-facts/client-facts.request.js +4 -4
- package/esm2015/plugins/client-facts/client-facts.spec.js +28 -28
- package/esm2015/plugins/client-facts/index.js +1 -1
- package/esm2015/plugins/concurrent/concurrent.spec.js +5 -5
- package/esm2015/plugins/concurrent/index.js +1 -1
- package/esm2015/plugins/core/index.js +4 -4
- package/esm2015/plugins/custom-info/custom-info.spec.js +17 -17
- package/esm2015/plugins/custom-info/index.js +1 -1
- package/esm2015/plugins/exception/exception.reply.js +4 -4
- package/esm2015/plugins/exception/exception.spec.js +18 -18
- package/esm2015/plugins/exception/index.js +1 -1
- package/esm2015/plugins/fetch-cache/fetch-cache.request.js +4 -4
- package/esm2015/plugins/fetch-cache/fetch-cache.spec.js +21 -21
- package/esm2015/plugins/fetch-cache/index.js +1 -1
- package/esm2015/plugins/fetch-credentials/fetch-credentials.request.js +1 -1
- package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +9 -9
- package/esm2015/plugins/fetch-credentials/index.js +1 -1
- package/esm2015/plugins/index.js +25 -25
- package/esm2015/plugins/json-token/index.js +2 -2
- package/esm2015/plugins/json-token/json-token.reply.js +5 -5
- package/esm2015/plugins/json-token/json-token.request.js +4 -4
- package/esm2015/plugins/json-token/json-token.spec.js +27 -27
- package/esm2015/plugins/keepalive/index.js +1 -1
- package/esm2015/plugins/keepalive/keepalive.request.js +2 -2
- package/esm2015/plugins/keepalive/keepalive.spec.js +5 -5
- package/esm2015/plugins/mgw-mdw-auth/index.js +1 -1
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +13 -13
- package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +27 -27
- package/esm2015/plugins/mock-intercept/index.js +2 -2
- package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +5 -5
- package/esm2015/plugins/mock-intercept/mock-intercept.interface.js +2 -2
- package/esm2015/plugins/mock-intercept/mock-intercept.request.js +4 -4
- package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +32 -32
- package/esm2015/plugins/perf-metric/index.js +1 -1
- package/esm2015/plugins/perf-metric/perf-metric.fetch.js +2 -2
- package/esm2015/plugins/perf-metric/perf-metric.probe.spec.js +10 -10
- package/esm2015/plugins/pii-tokenizer/index.js +1 -1
- package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +12 -12
- package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +96 -96
- package/esm2015/plugins/raw-response-info/index.js +1 -1
- package/esm2015/plugins/raw-response-info/raw-response-info.spec.js +14 -14
- package/esm2015/plugins/retry/index.js +1 -1
- package/esm2015/plugins/retry/retry.fetch.js +1 -1
- package/esm2015/plugins/retry/retry.spec.js +21 -21
- package/esm2015/plugins/reviver/index.js +1 -1
- package/esm2015/plugins/reviver/reviver.spec.js +6 -6
- package/esm2015/plugins/session-id/index.js +1 -1
- package/esm2015/plugins/session-id/session-id.request.js +7 -7
- package/esm2015/plugins/session-id/session-id.spec.js +14 -14
- package/esm2015/plugins/si-token/index.js +1 -1
- package/esm2015/plugins/si-token/si-token.request.js +1 -1
- package/esm2015/plugins/si-token/si-token.spec.js +10 -10
- package/esm2015/plugins/simple-api-key-authentication/index.js +1 -1
- package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +5 -5
- package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +46 -46
- package/esm2015/plugins/timeout/index.js +1 -1
- package/esm2015/plugins/timeout/timeout.fetch.js +12 -12
- package/esm2015/plugins/timeout/timeout.spec.js +15 -15
- package/esm2015/plugins/url-rewrite/index.js +1 -1
- package/esm2015/plugins/url-rewrite/url-rewrite.spec.js +10 -10
- package/esm2015/plugins/wait-for/index.js +1 -1
- package/esm2015/plugins/wait-for/wait-for.spec.js +10 -10
- package/esm2015/public_api.js +4 -4
- package/esm2015/utils/crypto.js +15 -15
- package/esm2015/utils/generic-api.js +245 -0
- package/esm2015/utils/index.js +6 -5
- package/esm2015/utils/json-token.js +32 -32
- package/esm2015/utils/json-token.spec.js +32 -32
- package/package.json +7 -7
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/src/clients/api-angular-client.d.ts +6 -3
- package/src/clients/api-angular-client.d.ts.map +1 -1
- package/src/clients/api-angular-client.js +23 -11
- package/src/clients/api-angular-client.js.map +1 -1
- package/src/clients/api-beacon-client.d.ts +7 -5
- package/src/clients/api-beacon-client.d.ts.map +1 -1
- package/src/clients/api-beacon-client.js +22 -14
- package/src/clients/api-beacon-client.js.map +1 -1
- package/src/clients/api-fetch-client.d.ts +5 -3
- package/src/clients/api-fetch-client.d.ts.map +1 -1
- package/src/clients/api-fetch-client.js +22 -11
- package/src/clients/api-fetch-client.js.map +1 -1
- package/src/fwk/api.helpers.d.ts +1 -1
- package/src/fwk/api.helpers.d.ts.map +1 -1
- package/src/fwk/api.helpers.js +1 -1
- package/src/fwk/api.helpers.js.map +1 -1
- package/src/fwk/core/api-client.d.ts +36 -1
- package/src/fwk/core/api-client.d.ts.map +1 -1
- package/src/fwk/core/api-client.js.map +1 -1
- package/src/plugins/core/plugin.d.ts +6 -1
- package/src/plugins/core/plugin.d.ts.map +1 -1
- package/src/plugins/core/reply-plugin.d.ts +0 -2
- package/src/plugins/core/reply-plugin.d.ts.map +1 -1
- package/src/utils/generic-api.d.ts +39 -0
- package/src/utils/generic-api.d.ts.map +1 -0
- package/src/utils/generic-api.js +43 -0
- package/src/utils/generic-api.js.map +1 -0
- package/src/utils/index.d.ts +1 -0
- package/src/utils/index.d.ts.map +1 -1
- package/src/utils/index.js +1 -0
- package/src/utils/index.js.map +1 -1
|
@@ -127,8 +127,8 @@ function _ts_generator(thisArg, body) {
|
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
describe(
|
|
131
|
-
it(
|
|
130
|
+
describe('Retry Fetch Plugin', function() {
|
|
131
|
+
it('should not retry on success', /*#__PURE__*/ _async_to_generator(function() {
|
|
132
132
|
var condition, plugin, runner, call, res, ret;
|
|
133
133
|
return _ts_generator(this, function(_state) {
|
|
134
134
|
switch(_state.label){
|
|
@@ -136,11 +136,11 @@ describe("Retry Fetch Plugin", function() {
|
|
|
136
136
|
condition = jest.fn().mockReturnValue(true);
|
|
137
137
|
plugin = new _retryfetch.RetryFetch(1, condition);
|
|
138
138
|
runner = plugin.load({
|
|
139
|
-
url:
|
|
139
|
+
url: 'http://www.test.com',
|
|
140
140
|
fetchPlugins: []
|
|
141
141
|
});
|
|
142
142
|
call = Promise.resolve({
|
|
143
|
-
text:
|
|
143
|
+
text: 'test',
|
|
144
144
|
ok: true
|
|
145
145
|
});
|
|
146
146
|
res = runner.transform(call);
|
|
@@ -152,7 +152,7 @@ describe("Retry Fetch Plugin", function() {
|
|
|
152
152
|
case 1:
|
|
153
153
|
ret = _state.sent();
|
|
154
154
|
expect(ret).toEqual({
|
|
155
|
-
text:
|
|
155
|
+
text: 'test',
|
|
156
156
|
ok: true
|
|
157
157
|
});
|
|
158
158
|
return [
|
|
@@ -161,7 +161,7 @@ describe("Retry Fetch Plugin", function() {
|
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
}));
|
|
164
|
-
it(
|
|
164
|
+
it('should not retry if refused by the condition', /*#__PURE__*/ _async_to_generator(function() {
|
|
165
165
|
var conditionFalsy, plugin, runner, call, res;
|
|
166
166
|
return _ts_generator(this, function(_state) {
|
|
167
167
|
switch(_state.label){
|
|
@@ -169,11 +169,11 @@ describe("Retry Fetch Plugin", function() {
|
|
|
169
169
|
conditionFalsy = jest.fn().mockReturnValue(false);
|
|
170
170
|
plugin = new _retryfetch.RetryFetch(3, conditionFalsy);
|
|
171
171
|
runner = plugin.load({
|
|
172
|
-
url:
|
|
172
|
+
url: 'http://www.test.com',
|
|
173
173
|
fetchPlugins: []
|
|
174
174
|
});
|
|
175
175
|
call = Promise.resolve({
|
|
176
|
-
text:
|
|
176
|
+
text: 'test',
|
|
177
177
|
ok: false,
|
|
178
178
|
clone: function() {
|
|
179
179
|
return {};
|
|
@@ -193,7 +193,7 @@ describe("Retry Fetch Plugin", function() {
|
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
}));
|
|
196
|
-
it(
|
|
196
|
+
it('should retry on fetch rejection', /*#__PURE__*/ _async_to_generator(function() {
|
|
197
197
|
var condition, plugin, runners, runner, call, callback;
|
|
198
198
|
return _ts_generator(this, function(_state) {
|
|
199
199
|
switch(_state.label){
|
|
@@ -202,12 +202,12 @@ describe("Retry Fetch Plugin", function() {
|
|
|
202
202
|
plugin = new _retryfetch.RetryFetch(2, condition);
|
|
203
203
|
runners = [];
|
|
204
204
|
runner = plugin.load({
|
|
205
|
-
url:
|
|
205
|
+
url: 'not an url',
|
|
206
206
|
fetchPlugins: runners
|
|
207
207
|
});
|
|
208
208
|
runners.push(runner);
|
|
209
209
|
call = Promise.reject({
|
|
210
|
-
text:
|
|
210
|
+
text: 'test',
|
|
211
211
|
ok: true
|
|
212
212
|
});
|
|
213
213
|
callback = jest.fn();
|
|
@@ -226,7 +226,7 @@ describe("Retry Fetch Plugin", function() {
|
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
}));
|
|
229
|
-
it(
|
|
229
|
+
it('should retry on fetch rejection with wait', /*#__PURE__*/ _async_to_generator(function() {
|
|
230
230
|
var condition, delay, plugin, runners, runner, call, callback;
|
|
231
231
|
return _ts_generator(this, function(_state) {
|
|
232
232
|
switch(_state.label){
|
|
@@ -238,12 +238,12 @@ describe("Retry Fetch Plugin", function() {
|
|
|
238
238
|
});
|
|
239
239
|
runners = [];
|
|
240
240
|
runner = plugin.load({
|
|
241
|
-
url:
|
|
241
|
+
url: 'not an url',
|
|
242
242
|
fetchPlugins: runners
|
|
243
243
|
});
|
|
244
244
|
runners.push(runner);
|
|
245
245
|
call = Promise.reject({
|
|
246
|
-
text:
|
|
246
|
+
text: 'test',
|
|
247
247
|
ok: true
|
|
248
248
|
});
|
|
249
249
|
callback = jest.fn();
|
|
@@ -269,7 +269,7 @@ describe("Retry Fetch Plugin", function() {
|
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
271
|
}));
|
|
272
|
-
it(
|
|
272
|
+
it('should retry on not ok call', /*#__PURE__*/ _async_to_generator(function() {
|
|
273
273
|
var condition, plugin, runners, runner, call, callback;
|
|
274
274
|
return _ts_generator(this, function(_state) {
|
|
275
275
|
switch(_state.label){
|
|
@@ -278,12 +278,12 @@ describe("Retry Fetch Plugin", function() {
|
|
|
278
278
|
plugin = new _retryfetch.RetryFetch(3, condition);
|
|
279
279
|
runners = [];
|
|
280
280
|
runner = plugin.load({
|
|
281
|
-
url:
|
|
281
|
+
url: 'not an url',
|
|
282
282
|
fetchPlugins: runners
|
|
283
283
|
});
|
|
284
284
|
runners.push(runner);
|
|
285
285
|
call = Promise.resolve({
|
|
286
|
-
text:
|
|
286
|
+
text: 'test',
|
|
287
287
|
ok: false
|
|
288
288
|
});
|
|
289
289
|
callback = jest.fn();
|
|
@@ -302,7 +302,7 @@ describe("Retry Fetch Plugin", function() {
|
|
|
302
302
|
}
|
|
303
303
|
});
|
|
304
304
|
}));
|
|
305
|
-
it(
|
|
305
|
+
it('should retry on not ok call with wait', /*#__PURE__*/ _async_to_generator(function() {
|
|
306
306
|
var condition, delay, plugin, runners, runner, call, callback;
|
|
307
307
|
return _ts_generator(this, function(_state) {
|
|
308
308
|
switch(_state.label){
|
|
@@ -314,12 +314,12 @@ describe("Retry Fetch Plugin", function() {
|
|
|
314
314
|
});
|
|
315
315
|
runners = [];
|
|
316
316
|
runner = plugin.load({
|
|
317
|
-
url:
|
|
317
|
+
url: 'not an url',
|
|
318
318
|
fetchPlugins: runners
|
|
319
319
|
});
|
|
320
320
|
runners.push(runner);
|
|
321
321
|
call = Promise.resolve({
|
|
322
|
-
text:
|
|
322
|
+
text: 'test',
|
|
323
323
|
ok: false
|
|
324
324
|
});
|
|
325
325
|
callback = jest.fn();
|
|
@@ -128,9 +128,9 @@ function _ts_generator(thisArg, body) {
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
describe(
|
|
131
|
+
describe('Reviver Reply Plugin', function() {
|
|
132
132
|
var reviver = jest.fn();
|
|
133
|
-
it(
|
|
133
|
+
it('should revive a specific data', /*#__PURE__*/ _async_to_generator(function() {
|
|
134
134
|
var plugin, runner, data;
|
|
135
135
|
return _ts_generator(this, function(_state) {
|
|
136
136
|
switch(_state.label){
|
|
@@ -155,7 +155,7 @@ describe("Reviver Reply Plugin", function() {
|
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
157
|
}));
|
|
158
|
-
it(
|
|
158
|
+
it('should revive a specific data and dictionary', /*#__PURE__*/ _async_to_generator(function() {
|
|
159
159
|
var dictionaries, plugin, runner, data;
|
|
160
160
|
return _ts_generator(this, function(_state) {
|
|
161
161
|
switch(_state.label){
|
|
@@ -182,7 +182,7 @@ describe("Reviver Reply Plugin", function() {
|
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
184
|
}));
|
|
185
|
-
it(
|
|
185
|
+
it('should revive empty object in case of undefined data', /*#__PURE__*/ _async_to_generator(function() {
|
|
186
186
|
var dictionaries, plugin, runner, transformedData;
|
|
187
187
|
return _ts_generator(this, function(_state) {
|
|
188
188
|
switch(_state.label){
|
|
@@ -44,7 +44,7 @@ function _define_property(obj, key, value) {
|
|
|
44
44
|
var SessionIdRequest = /*#__PURE__*/ function() {
|
|
45
45
|
"use strict";
|
|
46
46
|
function SessionIdRequest() {
|
|
47
|
-
var sessionIdHeader = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
47
|
+
var sessionIdHeader = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'Ama-Client-Ref', activateRequestId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
48
48
|
_class_call_check(this, SessionIdRequest);
|
|
49
49
|
/**
|
|
50
50
|
* The request header in which the ID will be added. Use the same in multiple APIs if you want to aggregate logs
|
|
@@ -92,7 +92,7 @@ var SessionIdRequest = /*#__PURE__*/ function() {
|
|
|
92
92
|
return SessionIdRequest.sharedMemory[this.sessionIdHeader];
|
|
93
93
|
}
|
|
94
94
|
// if not, check if we have one in session storage
|
|
95
|
-
if (typeof sessionStorage !==
|
|
95
|
+
if (typeof sessionStorage !== 'undefined') {
|
|
96
96
|
var sessionIdObjectFromStorage = sessionStorage.getItem(this.sessionIdHeader);
|
|
97
97
|
if (sessionIdObjectFromStorage) {
|
|
98
98
|
try {
|
|
@@ -111,7 +111,7 @@ var SessionIdRequest = /*#__PURE__*/ function() {
|
|
|
111
111
|
this.logSessionId(sessionId, generatedTime, logger);
|
|
112
112
|
// and store it
|
|
113
113
|
SessionIdRequest.sharedMemory[this.sessionIdHeader] = sessionId;
|
|
114
|
-
if (typeof sessionStorage !==
|
|
114
|
+
if (typeof sessionStorage !== 'undefined') {
|
|
115
115
|
sessionStorage.setItem(this.sessionIdHeader, JSON.stringify({
|
|
116
116
|
id: sessionId,
|
|
117
117
|
generatedTime: generatedTime
|
|
@@ -125,19 +125,19 @@ var SessionIdRequest = /*#__PURE__*/ function() {
|
|
|
125
125
|
value: /**
|
|
126
126
|
* Generates a request ID.
|
|
127
127
|
*/ function generateRequestId() {
|
|
128
|
-
var requestCountKey = this.sessionIdHeader +
|
|
128
|
+
var requestCountKey = this.sessionIdHeader + '-Request-Count';
|
|
129
129
|
var requestCount = 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
|
-
} else if (typeof sessionStorage !==
|
|
133
|
+
} else if (typeof sessionStorage !== 'undefined') {
|
|
134
134
|
requestCount = +(sessionStorage.getItem(requestCountKey) || 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;
|
|
138
138
|
// Store the new request count
|
|
139
139
|
SessionIdRequest.sharedMemory[requestCountKey] = requestCount;
|
|
140
|
-
if (typeof sessionStorage !==
|
|
140
|
+
if (typeof sessionStorage !== 'undefined') {
|
|
141
141
|
sessionStorage.setItem(requestCountKey, requestCount.toString());
|
|
142
142
|
}
|
|
143
143
|
return requestCount.toString(36);
|
|
@@ -127,18 +127,18 @@ function _ts_generator(thisArg, body) {
|
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
describe(
|
|
130
|
+
describe('Session ID Request Plugin', function() {
|
|
131
131
|
var options;
|
|
132
|
-
var TEST_KEY =
|
|
133
|
-
var TEST_KEY2 =
|
|
132
|
+
var TEST_KEY = 'testKey';
|
|
133
|
+
var TEST_KEY2 = 'testKey2';
|
|
134
134
|
beforeEach(function() {
|
|
135
135
|
options = {
|
|
136
136
|
headers: new Headers(),
|
|
137
|
-
basePath:
|
|
138
|
-
method:
|
|
137
|
+
basePath: 'http://test.com/truc',
|
|
138
|
+
method: 'get'
|
|
139
139
|
};
|
|
140
140
|
});
|
|
141
|
-
it(
|
|
141
|
+
it('should have the default id to Ama-Client-Ref', /*#__PURE__*/ _async_to_generator(function() {
|
|
142
142
|
var plugin, runner, sessionId;
|
|
143
143
|
return _ts_generator(this, function(_state) {
|
|
144
144
|
switch(_state.label){
|
|
@@ -152,14 +152,14 @@ describe("Session ID Request Plugin", function() {
|
|
|
152
152
|
];
|
|
153
153
|
case 1:
|
|
154
154
|
_state.sent();
|
|
155
|
-
expect(options.headers.get(
|
|
155
|
+
expect(options.headers.get('Ama-Client-Ref')).toContain(sessionId);
|
|
156
156
|
return [
|
|
157
157
|
2
|
|
158
158
|
];
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
}));
|
|
162
|
-
it(
|
|
162
|
+
it('should add the session ID to the headers', /*#__PURE__*/ _async_to_generator(function() {
|
|
163
163
|
var plugin, runner, sessionId;
|
|
164
164
|
return _ts_generator(this, function(_state) {
|
|
165
165
|
switch(_state.label){
|
|
@@ -180,21 +180,21 @@ describe("Session ID Request Plugin", function() {
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
}));
|
|
183
|
-
it(
|
|
183
|
+
it('second plugin with same header should use the ID that\'s already in memory', function() {
|
|
184
184
|
var plugin = new _sessionidrequest.SessionIdRequest(TEST_KEY);
|
|
185
185
|
var plugin2 = new _sessionidrequest.SessionIdRequest(TEST_KEY);
|
|
186
186
|
plugin.load();
|
|
187
187
|
plugin2.load();
|
|
188
188
|
expect(plugin.sessionId).toBe(plugin2.sessionId);
|
|
189
189
|
});
|
|
190
|
-
it(
|
|
190
|
+
it('second plugin with different header should generate a new session ID', function() {
|
|
191
191
|
var plugin = new _sessionidrequest.SessionIdRequest(TEST_KEY);
|
|
192
192
|
var plugin2 = new _sessionidrequest.SessionIdRequest(TEST_KEY2);
|
|
193
193
|
plugin.load();
|
|
194
194
|
plugin2.load();
|
|
195
195
|
expect(plugin.sessionId).not.toBe(plugin2.sessionId);
|
|
196
196
|
});
|
|
197
|
-
it(
|
|
197
|
+
it('should generate a correctly formatted ID', /*#__PURE__*/ _async_to_generator(function() {
|
|
198
198
|
var plugin, runner, sessionId;
|
|
199
199
|
return _ts_generator(this, function(_state) {
|
|
200
200
|
switch(_state.label){
|
|
@@ -209,14 +209,14 @@ describe("Session ID Request Plugin", function() {
|
|
|
209
209
|
case 1:
|
|
210
210
|
_state.sent();
|
|
211
211
|
expect(sessionId).toMatch(/[a-zA-Z0-9-]{10,48}/);
|
|
212
|
-
expect(options.headers.get(
|
|
212
|
+
expect(options.headers.get('Ama-Client-Ref')).toMatch(new RegExp(sessionId + ':[0-9a-zA-Z]{1,10}'));
|
|
213
213
|
return [
|
|
214
214
|
2
|
|
215
215
|
];
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
218
|
}));
|
|
219
|
-
it(
|
|
219
|
+
it('should be possible to deactivate the request ID part', /*#__PURE__*/ _async_to_generator(function() {
|
|
220
220
|
var plugin, runner, sessionId;
|
|
221
221
|
return _ts_generator(this, function(_state) {
|
|
222
222
|
switch(_state.label){
|
|
@@ -127,27 +127,27 @@ function _ts_generator(thisArg, body) {
|
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
describe(
|
|
130
|
+
describe('SI Token Request Plugin', function() {
|
|
131
131
|
var defaultGetParams = {
|
|
132
|
-
defaultTest:
|
|
132
|
+
defaultTest: 'ok'
|
|
133
133
|
};
|
|
134
|
-
var defaultBody =
|
|
134
|
+
var defaultBody = 'default';
|
|
135
135
|
var options;
|
|
136
136
|
beforeEach(function() {
|
|
137
137
|
options = {
|
|
138
|
-
method:
|
|
138
|
+
method: 'get',
|
|
139
139
|
queryParams: defaultGetParams,
|
|
140
140
|
headers: new Headers(),
|
|
141
141
|
body: defaultBody,
|
|
142
|
-
basePath:
|
|
142
|
+
basePath: 'http://test.com/truc'
|
|
143
143
|
};
|
|
144
144
|
});
|
|
145
|
-
it(
|
|
145
|
+
it('should add a specified SI Tokens in query params', /*#__PURE__*/ _async_to_generator(function() {
|
|
146
146
|
var plugin, runner, result;
|
|
147
147
|
return _ts_generator(this, function(_state) {
|
|
148
148
|
switch(_state.label){
|
|
149
149
|
case 0:
|
|
150
|
-
plugin = new _sitokenrequest.SiTokenRequest(
|
|
150
|
+
plugin = new _sitokenrequest.SiTokenRequest('SIToken1', 'SIToken2');
|
|
151
151
|
runner = plugin.load();
|
|
152
152
|
return [
|
|
153
153
|
4,
|
|
@@ -155,8 +155,8 @@ describe("SI Token Request Plugin", function() {
|
|
|
155
155
|
];
|
|
156
156
|
case 1:
|
|
157
157
|
result = _state.sent();
|
|
158
|
-
expect(result.queryParams.SITK).toBe(
|
|
159
|
-
expect(result.queryParams.SITK2).toBe(
|
|
158
|
+
expect(result.queryParams.SITK).toBe('SIToken1');
|
|
159
|
+
expect(result.queryParams.SITK2).toBe('SIToken2');
|
|
160
160
|
return [
|
|
161
161
|
2
|
|
162
162
|
];
|
|
@@ -183,8 +183,8 @@ function _ts_generator(thisArg, body) {
|
|
|
183
183
|
/**
|
|
184
184
|
* Default values of optional parameters
|
|
185
185
|
*/ var DEFAULT_OPTION = {
|
|
186
|
-
apiKeyHeader:
|
|
187
|
-
contextHeader:
|
|
186
|
+
apiKeyHeader: 'x-api-key',
|
|
187
|
+
contextHeader: 'ama-ctx'
|
|
188
188
|
};
|
|
189
189
|
var SimpleApiKeyAuthenticationRequest = /*#__PURE__*/ function() {
|
|
190
190
|
"use strict";
|
|
@@ -231,7 +231,7 @@ var SimpleApiKeyAuthenticationRequest = /*#__PURE__*/ function() {
|
|
|
231
231
|
_tmp = [
|
|
232
232
|
_this.options.apiKeyHeader
|
|
233
233
|
];
|
|
234
|
-
if (!(typeof _this.apiKey ===
|
|
234
|
+
if (!(typeof _this.apiKey === 'string')) return [
|
|
235
235
|
3,
|
|
236
236
|
1
|
|
237
237
|
];
|
|
@@ -256,7 +256,7 @@ var SimpleApiKeyAuthenticationRequest = /*#__PURE__*/ function() {
|
|
|
256
256
|
3,
|
|
257
257
|
7
|
|
258
258
|
];
|
|
259
|
-
if (!(typeof _this.options.officeId ===
|
|
259
|
+
if (!(typeof _this.options.officeId === 'string')) return [
|
|
260
260
|
3,
|
|
261
261
|
4
|
|
262
262
|
];
|
|
@@ -130,7 +130,7 @@ function _ts_generator(thisArg, body) {
|
|
|
130
130
|
}
|
|
131
131
|
var base64UrlDecoder = (0, _jsontoken.createBase64UrlDecoder)();
|
|
132
132
|
function getJWTPayload(jwt) {
|
|
133
|
-
return JSON.parse(base64UrlDecoder(jwt.split(
|
|
133
|
+
return JSON.parse(base64UrlDecoder(jwt.split('.')[1]));
|
|
134
134
|
}
|
|
135
135
|
function returnInSequence() {
|
|
136
136
|
for(var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++){
|
|
@@ -141,22 +141,22 @@ function returnInSequence() {
|
|
|
141
141
|
return values[index++];
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
describe(
|
|
144
|
+
describe('Api Key Request Plugin', function() {
|
|
145
145
|
var options;
|
|
146
146
|
beforeEach(function() {
|
|
147
147
|
var headers = new Headers();
|
|
148
148
|
options = {
|
|
149
149
|
headers: headers,
|
|
150
|
-
basePath:
|
|
151
|
-
method:
|
|
150
|
+
basePath: 'http://test.com',
|
|
151
|
+
method: 'get'
|
|
152
152
|
};
|
|
153
153
|
});
|
|
154
|
-
it(
|
|
154
|
+
it('Static API key should be added to the default header.', /*#__PURE__*/ _async_to_generator(function() {
|
|
155
155
|
var plugin, runner;
|
|
156
156
|
return _ts_generator(this, function(_state) {
|
|
157
157
|
switch(_state.label){
|
|
158
158
|
case 0:
|
|
159
|
-
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(
|
|
159
|
+
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key');
|
|
160
160
|
runner = plugin.load();
|
|
161
161
|
return [
|
|
162
162
|
4,
|
|
@@ -164,20 +164,20 @@ describe("Api Key Request Plugin", function() {
|
|
|
164
164
|
];
|
|
165
165
|
case 1:
|
|
166
166
|
_state.sent();
|
|
167
|
-
expect(options.headers.get(
|
|
167
|
+
expect(options.headers.get('x-api-key')).toBe('key');
|
|
168
168
|
return [
|
|
169
169
|
2
|
|
170
170
|
];
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
}));
|
|
174
|
-
it(
|
|
174
|
+
it('Static API key should be added to the specified header.', /*#__PURE__*/ _async_to_generator(function() {
|
|
175
175
|
var plugin, runner;
|
|
176
176
|
return _ts_generator(this, function(_state) {
|
|
177
177
|
switch(_state.label){
|
|
178
178
|
case 0:
|
|
179
|
-
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(
|
|
180
|
-
apiKeyHeader:
|
|
179
|
+
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key', {
|
|
180
|
+
apiKeyHeader: 'custom-header'
|
|
181
181
|
});
|
|
182
182
|
runner = plugin.load();
|
|
183
183
|
return [
|
|
@@ -186,21 +186,21 @@ describe("Api Key Request Plugin", function() {
|
|
|
186
186
|
];
|
|
187
187
|
case 1:
|
|
188
188
|
_state.sent();
|
|
189
|
-
expect(options.headers.get(
|
|
190
|
-
expect(options.headers.get(
|
|
189
|
+
expect(options.headers.get('custom-header')).toBe('key');
|
|
190
|
+
expect(options.headers.get('x-api-key')).toBeNull();
|
|
191
191
|
return [
|
|
192
192
|
2
|
|
193
193
|
];
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
}));
|
|
197
|
-
it(
|
|
197
|
+
it('Static OID override should compute the right ama-ctx', /*#__PURE__*/ _async_to_generator(function() {
|
|
198
198
|
var plugin, runner, amaCtx;
|
|
199
199
|
return _ts_generator(this, function(_state) {
|
|
200
200
|
switch(_state.label){
|
|
201
201
|
case 0:
|
|
202
|
-
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(
|
|
203
|
-
officeId:
|
|
202
|
+
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key', {
|
|
203
|
+
officeId: 'TESTOID'
|
|
204
204
|
});
|
|
205
205
|
runner = plugin.load();
|
|
206
206
|
return [
|
|
@@ -209,10 +209,10 @@ describe("Api Key Request Plugin", function() {
|
|
|
209
209
|
];
|
|
210
210
|
case 1:
|
|
211
211
|
_state.sent();
|
|
212
|
-
amaCtx = options.headers.get(
|
|
212
|
+
amaCtx = options.headers.get('ama-ctx');
|
|
213
213
|
expect(amaCtx).toBeDefined();
|
|
214
214
|
expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
|
|
215
|
-
oid:
|
|
215
|
+
oid: 'TESTOID'
|
|
216
216
|
}));
|
|
217
217
|
return [
|
|
218
218
|
2
|
|
@@ -220,13 +220,13 @@ describe("Api Key Request Plugin", function() {
|
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
222
|
}));
|
|
223
|
-
it(
|
|
223
|
+
it('API key and OID as functions that return strings should result in the right headers', /*#__PURE__*/ _async_to_generator(function() {
|
|
224
224
|
var plugin, runner, amaCtx;
|
|
225
225
|
return _ts_generator(this, function(_state) {
|
|
226
226
|
switch(_state.label){
|
|
227
227
|
case 0:
|
|
228
|
-
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(returnInSequence(
|
|
229
|
-
officeId: returnInSequence(
|
|
228
|
+
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(returnInSequence('key', 'secondKey'), {
|
|
229
|
+
officeId: returnInSequence('TESTOID', 'SECONDOID')
|
|
230
230
|
});
|
|
231
231
|
runner = plugin.load();
|
|
232
232
|
return [
|
|
@@ -235,11 +235,11 @@ describe("Api Key Request Plugin", function() {
|
|
|
235
235
|
];
|
|
236
236
|
case 1:
|
|
237
237
|
_state.sent();
|
|
238
|
-
amaCtx = options.headers.get(
|
|
239
|
-
expect(options.headers.get(
|
|
238
|
+
amaCtx = options.headers.get('ama-ctx');
|
|
239
|
+
expect(options.headers.get('x-api-key')).toBe('key');
|
|
240
240
|
expect(amaCtx).toBeDefined();
|
|
241
241
|
expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
|
|
242
|
-
oid:
|
|
242
|
+
oid: 'TESTOID'
|
|
243
243
|
}));
|
|
244
244
|
return [
|
|
245
245
|
4,
|
|
@@ -247,11 +247,11 @@ describe("Api Key Request Plugin", function() {
|
|
|
247
247
|
];
|
|
248
248
|
case 2:
|
|
249
249
|
_state.sent();
|
|
250
|
-
amaCtx = options.headers.get(
|
|
251
|
-
expect(options.headers.get(
|
|
250
|
+
amaCtx = options.headers.get('ama-ctx');
|
|
251
|
+
expect(options.headers.get('x-api-key')).toBe('secondKey');
|
|
252
252
|
expect(amaCtx).toBeDefined();
|
|
253
253
|
expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
|
|
254
|
-
oid:
|
|
254
|
+
oid: 'SECONDOID'
|
|
255
255
|
}));
|
|
256
256
|
return [
|
|
257
257
|
2
|
|
@@ -259,13 +259,13 @@ describe("Api Key Request Plugin", function() {
|
|
|
259
259
|
}
|
|
260
260
|
});
|
|
261
261
|
}));
|
|
262
|
-
it(
|
|
262
|
+
it('API key and OID as functions that return promises should result in the right headers', /*#__PURE__*/ _async_to_generator(function() {
|
|
263
263
|
var plugin, runner, amaCtx;
|
|
264
264
|
return _ts_generator(this, function(_state) {
|
|
265
265
|
switch(_state.label){
|
|
266
266
|
case 0:
|
|
267
|
-
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(returnInSequence(Promise.resolve(
|
|
268
|
-
officeId: returnInSequence(Promise.resolve(
|
|
267
|
+
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(returnInSequence(Promise.resolve('key'), Promise.resolve('secondKey')), {
|
|
268
|
+
officeId: returnInSequence(Promise.resolve('TESTOID'), Promise.resolve('SECONDOID'))
|
|
269
269
|
});
|
|
270
270
|
runner = plugin.load();
|
|
271
271
|
return [
|
|
@@ -274,11 +274,11 @@ describe("Api Key Request Plugin", function() {
|
|
|
274
274
|
];
|
|
275
275
|
case 1:
|
|
276
276
|
_state.sent();
|
|
277
|
-
amaCtx = options.headers.get(
|
|
278
|
-
expect(options.headers.get(
|
|
277
|
+
amaCtx = options.headers.get('ama-ctx');
|
|
278
|
+
expect(options.headers.get('x-api-key')).toBe('key');
|
|
279
279
|
expect(amaCtx).toBeDefined();
|
|
280
280
|
expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
|
|
281
|
-
oid:
|
|
281
|
+
oid: 'TESTOID'
|
|
282
282
|
}));
|
|
283
283
|
return [
|
|
284
284
|
4,
|
|
@@ -286,11 +286,11 @@ describe("Api Key Request Plugin", function() {
|
|
|
286
286
|
];
|
|
287
287
|
case 2:
|
|
288
288
|
_state.sent();
|
|
289
|
-
amaCtx = options.headers.get(
|
|
290
|
-
expect(options.headers.get(
|
|
289
|
+
amaCtx = options.headers.get('ama-ctx');
|
|
290
|
+
expect(options.headers.get('x-api-key')).toBe('secondKey');
|
|
291
291
|
expect(amaCtx).toBeDefined();
|
|
292
292
|
expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
|
|
293
|
-
oid:
|
|
293
|
+
oid: 'SECONDOID'
|
|
294
294
|
}));
|
|
295
295
|
return [
|
|
296
296
|
2
|
|
@@ -298,12 +298,12 @@ describe("Api Key Request Plugin", function() {
|
|
|
298
298
|
}
|
|
299
299
|
});
|
|
300
300
|
}));
|
|
301
|
-
it(
|
|
301
|
+
it('Setting API key and OID using the setters should result in the right headers', /*#__PURE__*/ _async_to_generator(function() {
|
|
302
302
|
var plugin, runner, amaCtx;
|
|
303
303
|
return _ts_generator(this, function(_state) {
|
|
304
304
|
switch(_state.label){
|
|
305
305
|
case 0:
|
|
306
|
-
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest(
|
|
306
|
+
plugin = new _simpleapikeyauthenticationrequest.SimpleApiKeyAuthenticationRequest('key');
|
|
307
307
|
runner = plugin.load();
|
|
308
308
|
return [
|
|
309
309
|
4,
|
|
@@ -311,22 +311,22 @@ describe("Api Key Request Plugin", function() {
|
|
|
311
311
|
];
|
|
312
312
|
case 1:
|
|
313
313
|
_state.sent();
|
|
314
|
-
amaCtx = options.headers.get(
|
|
315
|
-
expect(options.headers.get(
|
|
314
|
+
amaCtx = options.headers.get('ama-ctx');
|
|
315
|
+
expect(options.headers.get('x-api-key')).toBe('key');
|
|
316
316
|
expect(amaCtx).toBeNull();
|
|
317
|
-
plugin.setApiKey(
|
|
318
|
-
plugin.setOfficeId(
|
|
317
|
+
plugin.setApiKey('secondApiKey');
|
|
318
|
+
plugin.setOfficeId('OID');
|
|
319
319
|
return [
|
|
320
320
|
4,
|
|
321
321
|
runner.transform(options)
|
|
322
322
|
];
|
|
323
323
|
case 2:
|
|
324
324
|
_state.sent();
|
|
325
|
-
amaCtx = options.headers.get(
|
|
326
|
-
expect(options.headers.get(
|
|
325
|
+
amaCtx = options.headers.get('ama-ctx');
|
|
326
|
+
expect(options.headers.get('x-api-key')).toBe('secondApiKey');
|
|
327
327
|
expect(amaCtx).toBeDefined();
|
|
328
328
|
expect(getJWTPayload(amaCtx)).toEqual(expect.objectContaining({
|
|
329
|
-
oid:
|
|
329
|
+
oid: 'OID'
|
|
330
330
|
}));
|
|
331
331
|
return [
|
|
332
332
|
2
|