@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.
Files changed (111) hide show
  1. package/cjs/clients/api-angular-client.js +13 -18
  2. package/cjs/clients/api-fetch-client.js +16 -21
  3. package/cjs/fwk/api.helpers.js +11 -11
  4. package/cjs/fwk/date.js +5 -5
  5. package/cjs/fwk/errors.js +7 -7
  6. package/cjs/fwk/mocks/alf-mock-adapter.js +58 -60
  7. package/cjs/fwk/mocks/base-mock-adapter.js +15 -19
  8. package/cjs/fwk/mocks/helpers.js +3 -3
  9. package/cjs/fwk/param-serialization.js +6 -6
  10. package/cjs/fwk/reviver.js +4 -4
  11. package/cjs/plugins/abort/abort.spec.js +83 -81
  12. package/cjs/plugins/additional-params/additional-params.request.js +18 -25
  13. package/cjs/plugins/additional-params/additional-params.spec.js +194 -186
  14. package/cjs/plugins/api-configuration-override/api-configuration-override.request.js +10 -17
  15. package/cjs/plugins/api-configuration-override/api-configuration-override.spec.js +83 -81
  16. package/cjs/plugins/api-key/api-key.request.js +12 -19
  17. package/cjs/plugins/api-key/api-key.spec.js +50 -50
  18. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +25 -36
  19. package/cjs/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +343 -327
  20. package/cjs/plugins/client-facts/client-facts.request.js +18 -25
  21. package/cjs/plugins/client-facts/client-facts.spec.js +218 -208
  22. package/cjs/plugins/concurrent/concurrent.fetch.js +12 -20
  23. package/cjs/plugins/concurrent/concurrent.spec.js +99 -99
  24. package/cjs/plugins/custom-info/custom-info.spec.js +90 -90
  25. package/cjs/plugins/fetch-cache/fetch-cache.spec.js +100 -98
  26. package/cjs/plugins/fetch-credentials/fetch-credentials.spec.js +60 -60
  27. package/cjs/plugins/json-token/json-token.spec.js +109 -107
  28. package/cjs/plugins/keepalive/keepalive.request.js +7 -12
  29. package/cjs/plugins/keepalive/keepalive.spec.js +32 -34
  30. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.helpers.js +11 -23
  31. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +18 -28
  32. package/cjs/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +212 -204
  33. package/cjs/plugins/mock-intercept/mock-intercept.angular.js +94 -100
  34. package/cjs/plugins/mock-intercept/mock-intercept.fetch.js +15 -22
  35. package/cjs/plugins/mock-intercept/mock-intercept.interface.js +3 -3
  36. package/cjs/plugins/mock-intercept/mock-intercept.request.js +12 -19
  37. package/cjs/plugins/mock-intercept/mock-intercept.spec.js +245 -237
  38. package/cjs/plugins/perf-metric/perf-metric.fetch.js +11 -18
  39. package/cjs/plugins/pii-tokenizer/pii-tokenizer.request.js +19 -27
  40. package/cjs/plugins/pii-tokenizer/pii-tokenizer.spec.js +404 -386
  41. package/cjs/plugins/raw-response-info/raw-response-info.spec.js +67 -67
  42. package/cjs/plugins/retry/retry.fetch.js +18 -27
  43. package/cjs/plugins/retry/retry.spec.js +233 -225
  44. package/cjs/plugins/reviver/reviver.spec.js +88 -86
  45. package/cjs/plugins/session-id/session-id.spec.js +98 -94
  46. package/cjs/plugins/si-token/si-token.spec.js +27 -29
  47. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +17 -24
  48. package/cjs/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +199 -191
  49. package/cjs/plugins/timeout/timeout.fetch.js +16 -22
  50. package/cjs/plugins/timeout/timeout.spec.js +211 -205
  51. package/cjs/plugins/url-rewrite/url-rewrite.request.js +9 -16
  52. package/cjs/plugins/url-rewrite/url-rewrite.spec.js +48 -48
  53. package/cjs/plugins/wait-for/wait-for.fetch.js +19 -29
  54. package/cjs/plugins/wait-for/wait-for.spec.js +211 -203
  55. package/cjs/utils/crypto.js +15 -27
  56. package/cjs/utils/generic-api.js +9 -14
  57. package/cjs/utils/json-token.js +19 -26
  58. package/cjs/utils/json-token.spec.js +495 -497
  59. package/cjs/utils/mime-types.js +3 -3
  60. package/esm2015/clients/api-angular-client.js +13 -18
  61. package/esm2015/clients/api-fetch-client.js +16 -21
  62. package/esm2015/fwk/mocks/alf-mock-adapter.js +58 -60
  63. package/esm2015/fwk/mocks/base-mock-adapter.js +15 -19
  64. package/esm2015/plugins/abort/abort.spec.js +83 -81
  65. package/esm2015/plugins/additional-params/additional-params.request.js +15 -22
  66. package/esm2015/plugins/additional-params/additional-params.spec.js +194 -186
  67. package/esm2015/plugins/api-configuration-override/api-configuration-override.request.js +10 -17
  68. package/esm2015/plugins/api-configuration-override/api-configuration-override.spec.js +83 -81
  69. package/esm2015/plugins/api-key/api-key.request.js +12 -19
  70. package/esm2015/plugins/api-key/api-key.spec.js +50 -50
  71. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.request.js +21 -32
  72. package/esm2015/plugins/bot-protection-fingerprint/bot-protection-fingerprint.spec.js +343 -327
  73. package/esm2015/plugins/client-facts/client-facts.request.js +15 -22
  74. package/esm2015/plugins/client-facts/client-facts.spec.js +218 -208
  75. package/esm2015/plugins/concurrent/concurrent.fetch.js +12 -20
  76. package/esm2015/plugins/concurrent/concurrent.spec.js +99 -99
  77. package/esm2015/plugins/custom-info/custom-info.spec.js +90 -90
  78. package/esm2015/plugins/fetch-cache/fetch-cache.spec.js +100 -98
  79. package/esm2015/plugins/fetch-credentials/fetch-credentials.spec.js +60 -60
  80. package/esm2015/plugins/json-token/json-token.spec.js +109 -107
  81. package/esm2015/plugins/keepalive/keepalive.request.js +7 -12
  82. package/esm2015/plugins/keepalive/keepalive.spec.js +32 -34
  83. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.helpers.js +8 -20
  84. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.request.js +18 -28
  85. package/esm2015/plugins/mgw-mdw-auth/mgw-mdw-auth.spec.js +212 -204
  86. package/esm2015/plugins/mock-intercept/mock-intercept.angular.js +94 -100
  87. package/esm2015/plugins/mock-intercept/mock-intercept.fetch.js +15 -22
  88. package/esm2015/plugins/mock-intercept/mock-intercept.request.js +12 -19
  89. package/esm2015/plugins/mock-intercept/mock-intercept.spec.js +245 -237
  90. package/esm2015/plugins/perf-metric/perf-metric.fetch.js +11 -18
  91. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.request.js +15 -23
  92. package/esm2015/plugins/pii-tokenizer/pii-tokenizer.spec.js +404 -386
  93. package/esm2015/plugins/raw-response-info/raw-response-info.spec.js +67 -67
  94. package/esm2015/plugins/retry/retry.fetch.js +18 -27
  95. package/esm2015/plugins/retry/retry.spec.js +233 -225
  96. package/esm2015/plugins/reviver/reviver.spec.js +88 -86
  97. package/esm2015/plugins/session-id/session-id.spec.js +98 -94
  98. package/esm2015/plugins/si-token/si-token.spec.js +27 -29
  99. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.request.js +17 -24
  100. package/esm2015/plugins/simple-api-key-authentication/simple-api-key-authentication.spec.js +199 -191
  101. package/esm2015/plugins/timeout/timeout.fetch.js +13 -19
  102. package/esm2015/plugins/timeout/timeout.spec.js +211 -205
  103. package/esm2015/plugins/url-rewrite/url-rewrite.request.js +9 -16
  104. package/esm2015/plugins/url-rewrite/url-rewrite.spec.js +48 -48
  105. package/esm2015/plugins/wait-for/wait-for.fetch.js +19 -29
  106. package/esm2015/plugins/wait-for/wait-for.spec.js +211 -203
  107. package/esm2015/utils/crypto.js +8 -20
  108. package/esm2015/utils/generic-api.js +9 -14
  109. package/esm2015/utils/json-token.js +10 -17
  110. package/esm2015/utils/json-token.spec.js +495 -497
  111. package/package.json +6 -6
@@ -34,7 +34,7 @@ function _async_to_generator(fn) {
34
34
  };
35
35
  }
36
36
  function _ts_generator(thisArg, body) {
37
- var f, y, t, g, _ = {
37
+ var f, y, t, _ = {
38
38
  label: 0,
39
39
  sent: function() {
40
40
  if (t[0] & 1) throw t[1];
@@ -42,12 +42,8 @@ function _ts_generator(thisArg, body) {
42
42
  },
43
43
  trys: [],
44
44
  ops: []
45
- };
46
- return g = {
47
- next: verb(0),
48
- "throw": verb(1),
49
- "return": verb(2)
50
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
46
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
51
47
  return this;
52
48
  }), g;
53
49
  function verb(n) {
@@ -60,7 +56,7 @@ function _ts_generator(thisArg, body) {
60
56
  }
61
57
  function step(op) {
62
58
  if (f) throw new TypeError("Generator is already executing.");
63
- while(_)try {
59
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
64
60
  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;
65
61
  if (y = 0, t) op = [
66
62
  op[0] & 2,
@@ -130,82 +126,88 @@ function _ts_generator(thisArg, body) {
130
126
  }
131
127
  describe('Reviver Reply Plugin', function() {
132
128
  var reviver = jest.fn();
133
- it('should revive a specific data', /*#__PURE__*/ _async_to_generator(function() {
134
- var plugin, runner, data;
135
- return _ts_generator(this, function(_state) {
136
- switch(_state.label){
137
- case 0:
138
- plugin = new _reviverreply.ReviverReply();
139
- runner = plugin.load({
140
- reviver: reviver,
141
- apiType: _api.ApiTypes.DEFAULT,
142
- response: {}
143
- });
144
- data = {};
145
- return [
146
- 4,
147
- runner.transform(data)
148
- ];
149
- case 1:
150
- _state.sent();
151
- expect(reviver).toHaveBeenCalledWith(data, undefined, expect.any(Object));
152
- return [
153
- 2
154
- ];
155
- }
156
- });
157
- }));
158
- it('should revive a specific data and dictionary', /*#__PURE__*/ _async_to_generator(function() {
159
- var dictionaries, plugin, runner, data;
160
- return _ts_generator(this, function(_state) {
161
- switch(_state.label){
162
- case 0:
163
- dictionaries = {};
164
- plugin = new _reviverreply.ReviverReply();
165
- runner = plugin.load({
166
- reviver: reviver,
167
- apiType: _api.ApiTypes.DEFAULT,
168
- dictionaries: dictionaries,
169
- response: {}
170
- });
171
- data = {};
172
- return [
173
- 4,
174
- runner.transform(data)
175
- ];
176
- case 1:
177
- _state.sent();
178
- expect(reviver).toHaveBeenCalledWith(data, dictionaries, expect.any(Object));
179
- return [
180
- 2
181
- ];
182
- }
183
- });
184
- }));
185
- it('should revive empty object in case of undefined data', /*#__PURE__*/ _async_to_generator(function() {
186
- var dictionaries, plugin, runner, transformedData;
187
- return _ts_generator(this, function(_state) {
188
- switch(_state.label){
189
- case 0:
190
- dictionaries = {};
191
- plugin = new _reviverreply.ReviverReply();
192
- runner = plugin.load({
193
- reviver: reviver,
194
- apiType: _api.ApiTypes.DEFAULT,
195
- dictionaries: dictionaries,
196
- response: {}
197
- });
198
- return [
199
- 4,
200
- runner.transform(undefined)
201
- ];
202
- case 1:
203
- transformedData = _state.sent();
204
- expect(transformedData).toEqual({});
205
- return [
206
- 2
207
- ];
208
- }
209
- });
210
- }));
129
+ it('should revive a specific data', function() {
130
+ return _async_to_generator(function() {
131
+ var plugin, runner, data;
132
+ return _ts_generator(this, function(_state) {
133
+ switch(_state.label){
134
+ case 0:
135
+ plugin = new _reviverreply.ReviverReply();
136
+ runner = plugin.load({
137
+ reviver: reviver,
138
+ apiType: _api.ApiTypes.DEFAULT,
139
+ response: {}
140
+ });
141
+ data = {};
142
+ return [
143
+ 4,
144
+ runner.transform(data)
145
+ ];
146
+ case 1:
147
+ _state.sent();
148
+ expect(reviver).toHaveBeenCalledWith(data, undefined, expect.any(Object));
149
+ return [
150
+ 2
151
+ ];
152
+ }
153
+ });
154
+ })();
155
+ });
156
+ it('should revive a specific data and dictionary', function() {
157
+ return _async_to_generator(function() {
158
+ var dictionaries, plugin, runner, data;
159
+ return _ts_generator(this, function(_state) {
160
+ switch(_state.label){
161
+ case 0:
162
+ dictionaries = {};
163
+ plugin = new _reviverreply.ReviverReply();
164
+ runner = plugin.load({
165
+ reviver: reviver,
166
+ apiType: _api.ApiTypes.DEFAULT,
167
+ dictionaries: dictionaries,
168
+ response: {}
169
+ });
170
+ data = {};
171
+ return [
172
+ 4,
173
+ runner.transform(data)
174
+ ];
175
+ case 1:
176
+ _state.sent();
177
+ expect(reviver).toHaveBeenCalledWith(data, dictionaries, expect.any(Object));
178
+ return [
179
+ 2
180
+ ];
181
+ }
182
+ });
183
+ })();
184
+ });
185
+ it('should revive empty object in case of undefined data', function() {
186
+ return _async_to_generator(function() {
187
+ var dictionaries, plugin, runner, transformedData;
188
+ return _ts_generator(this, function(_state) {
189
+ switch(_state.label){
190
+ case 0:
191
+ dictionaries = {};
192
+ plugin = new _reviverreply.ReviverReply();
193
+ runner = plugin.load({
194
+ reviver: reviver,
195
+ apiType: _api.ApiTypes.DEFAULT,
196
+ dictionaries: dictionaries,
197
+ response: {}
198
+ });
199
+ return [
200
+ 4,
201
+ runner.transform(undefined)
202
+ ];
203
+ case 1:
204
+ transformedData = _state.sent();
205
+ expect(transformedData).toEqual({});
206
+ return [
207
+ 2
208
+ ];
209
+ }
210
+ });
211
+ })();
212
+ });
211
213
  });
@@ -33,7 +33,7 @@ function _async_to_generator(fn) {
33
33
  };
34
34
  }
35
35
  function _ts_generator(thisArg, body) {
36
- var f, y, t, g, _ = {
36
+ var f, y, t, _ = {
37
37
  label: 0,
38
38
  sent: function() {
39
39
  if (t[0] & 1) throw t[1];
@@ -41,12 +41,8 @@ function _ts_generator(thisArg, body) {
41
41
  },
42
42
  trys: [],
43
43
  ops: []
44
- };
45
- return g = {
46
- next: verb(0),
47
- "throw": verb(1),
48
- "return": verb(2)
49
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
44
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
45
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
50
46
  return this;
51
47
  }), g;
52
48
  function verb(n) {
@@ -59,7 +55,7 @@ function _ts_generator(thisArg, body) {
59
55
  }
60
56
  function step(op) {
61
57
  if (f) throw new TypeError("Generator is already executing.");
62
- while(_)try {
58
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
63
59
  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;
64
60
  if (y = 0, t) op = [
65
61
  op[0] & 2,
@@ -138,48 +134,52 @@ describe('Session ID Request Plugin', function() {
138
134
  method: 'get'
139
135
  };
140
136
  });
141
- it('should have the default id to Ama-Client-Ref', /*#__PURE__*/ _async_to_generator(function() {
142
- var plugin, runner, sessionId;
143
- return _ts_generator(this, function(_state) {
144
- switch(_state.label){
145
- case 0:
146
- plugin = new _sessionidrequest.SessionIdRequest();
147
- runner = plugin.load();
148
- sessionId = plugin.sessionId;
149
- return [
150
- 4,
151
- runner.transform(options)
152
- ];
153
- case 1:
154
- _state.sent();
155
- expect(options.headers.get('Ama-Client-Ref')).toContain(sessionId);
156
- return [
157
- 2
158
- ];
159
- }
160
- });
161
- }));
162
- it('should add the session ID to the headers', /*#__PURE__*/ _async_to_generator(function() {
163
- var plugin, runner, sessionId;
164
- return _ts_generator(this, function(_state) {
165
- switch(_state.label){
166
- case 0:
167
- plugin = new _sessionidrequest.SessionIdRequest(TEST_KEY);
168
- runner = plugin.load();
169
- sessionId = plugin.sessionId;
170
- return [
171
- 4,
172
- runner.transform(options)
173
- ];
174
- case 1:
175
- _state.sent();
176
- expect(options.headers.get(TEST_KEY)).toContain(sessionId);
177
- return [
178
- 2
179
- ];
180
- }
181
- });
182
- }));
137
+ it('should have the default id to Ama-Client-Ref', function() {
138
+ return _async_to_generator(function() {
139
+ var plugin, runner, sessionId;
140
+ return _ts_generator(this, function(_state) {
141
+ switch(_state.label){
142
+ case 0:
143
+ plugin = new _sessionidrequest.SessionIdRequest();
144
+ runner = plugin.load();
145
+ sessionId = plugin.sessionId;
146
+ return [
147
+ 4,
148
+ runner.transform(options)
149
+ ];
150
+ case 1:
151
+ _state.sent();
152
+ expect(options.headers.get('Ama-Client-Ref')).toContain(sessionId);
153
+ return [
154
+ 2
155
+ ];
156
+ }
157
+ });
158
+ })();
159
+ });
160
+ it('should add the session ID to the headers', function() {
161
+ return _async_to_generator(function() {
162
+ var plugin, runner, sessionId;
163
+ return _ts_generator(this, function(_state) {
164
+ switch(_state.label){
165
+ case 0:
166
+ plugin = new _sessionidrequest.SessionIdRequest(TEST_KEY);
167
+ runner = plugin.load();
168
+ sessionId = plugin.sessionId;
169
+ return [
170
+ 4,
171
+ runner.transform(options)
172
+ ];
173
+ case 1:
174
+ _state.sent();
175
+ expect(options.headers.get(TEST_KEY)).toContain(sessionId);
176
+ return [
177
+ 2
178
+ ];
179
+ }
180
+ });
181
+ })();
182
+ });
183
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);
@@ -194,48 +194,52 @@ describe('Session ID Request Plugin', function() {
194
194
  plugin2.load();
195
195
  expect(plugin.sessionId).not.toBe(plugin2.sessionId);
196
196
  });
197
- it('should generate a correctly formatted ID', /*#__PURE__*/ _async_to_generator(function() {
198
- var plugin, runner, sessionId;
199
- return _ts_generator(this, function(_state) {
200
- switch(_state.label){
201
- case 0:
202
- plugin = new _sessionidrequest.SessionIdRequest();
203
- runner = plugin.load();
204
- sessionId = plugin.sessionId;
205
- return [
206
- 4,
207
- runner.transform(options)
208
- ];
209
- case 1:
210
- _state.sent();
211
- expect(sessionId).toMatch(/[\dA-Za-z-]{10,48}/);
212
- expect(options.headers.get('Ama-Client-Ref')).toMatch(new RegExp(sessionId + ':[0-9a-zA-Z]{1,10}'));
213
- return [
214
- 2
215
- ];
216
- }
217
- });
218
- }));
219
- it('should be possible to deactivate the request ID part', /*#__PURE__*/ _async_to_generator(function() {
220
- var plugin, runner, sessionId;
221
- return _ts_generator(this, function(_state) {
222
- switch(_state.label){
223
- case 0:
224
- plugin = new _sessionidrequest.SessionIdRequest(TEST_KEY, false);
225
- runner = plugin.load();
226
- sessionId = plugin.sessionId;
227
- return [
228
- 4,
229
- runner.transform(options)
230
- ];
231
- case 1:
232
- _state.sent();
233
- expect(sessionId).toMatch(/[\dA-Za-z-]{10,48}/);
234
- expect(options.headers.get(TEST_KEY)).toEqual(sessionId);
235
- return [
236
- 2
237
- ];
238
- }
239
- });
240
- }));
197
+ it('should generate a correctly formatted ID', function() {
198
+ return _async_to_generator(function() {
199
+ var plugin, runner, sessionId;
200
+ return _ts_generator(this, function(_state) {
201
+ switch(_state.label){
202
+ case 0:
203
+ plugin = new _sessionidrequest.SessionIdRequest();
204
+ runner = plugin.load();
205
+ sessionId = plugin.sessionId;
206
+ return [
207
+ 4,
208
+ runner.transform(options)
209
+ ];
210
+ case 1:
211
+ _state.sent();
212
+ expect(sessionId).toMatch(/[\dA-Za-z-]{10,48}/);
213
+ expect(options.headers.get('Ama-Client-Ref')).toMatch(new RegExp(sessionId + ':[0-9a-zA-Z]{1,10}'));
214
+ return [
215
+ 2
216
+ ];
217
+ }
218
+ });
219
+ })();
220
+ });
221
+ it('should be possible to deactivate the request ID part', function() {
222
+ return _async_to_generator(function() {
223
+ var plugin, runner, sessionId;
224
+ return _ts_generator(this, function(_state) {
225
+ switch(_state.label){
226
+ case 0:
227
+ plugin = new _sessionidrequest.SessionIdRequest(TEST_KEY, false);
228
+ runner = plugin.load();
229
+ sessionId = plugin.sessionId;
230
+ return [
231
+ 4,
232
+ runner.transform(options)
233
+ ];
234
+ case 1:
235
+ _state.sent();
236
+ expect(sessionId).toMatch(/[\dA-Za-z-]{10,48}/);
237
+ expect(options.headers.get(TEST_KEY)).toEqual(sessionId);
238
+ return [
239
+ 2
240
+ ];
241
+ }
242
+ });
243
+ })();
244
+ });
241
245
  });
@@ -33,7 +33,7 @@ function _async_to_generator(fn) {
33
33
  };
34
34
  }
35
35
  function _ts_generator(thisArg, body) {
36
- var f, y, t, g, _ = {
36
+ var f, y, t, _ = {
37
37
  label: 0,
38
38
  sent: function() {
39
39
  if (t[0] & 1) throw t[1];
@@ -41,12 +41,8 @@ function _ts_generator(thisArg, body) {
41
41
  },
42
42
  trys: [],
43
43
  ops: []
44
- };
45
- return g = {
46
- next: verb(0),
47
- "throw": verb(1),
48
- "return": verb(2)
49
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
44
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
45
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
50
46
  return this;
51
47
  }), g;
52
48
  function verb(n) {
@@ -59,7 +55,7 @@ function _ts_generator(thisArg, body) {
59
55
  }
60
56
  function step(op) {
61
57
  if (f) throw new TypeError("Generator is already executing.");
62
- while(_)try {
58
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
63
59
  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;
64
60
  if (y = 0, t) op = [
65
61
  op[0] & 2,
@@ -142,25 +138,27 @@ describe('SI Token Request Plugin', function() {
142
138
  basePath: 'http://test.com/truc'
143
139
  };
144
140
  });
145
- it('should add a specified SI Tokens in query params', /*#__PURE__*/ _async_to_generator(function() {
146
- var plugin, runner, result;
147
- return _ts_generator(this, function(_state) {
148
- switch(_state.label){
149
- case 0:
150
- plugin = new _sitokenrequest.SiTokenRequest('SIToken1', 'SIToken2');
151
- runner = plugin.load();
152
- return [
153
- 4,
154
- runner.transform(options)
155
- ];
156
- case 1:
157
- result = _state.sent();
158
- expect(result.queryParams.SITK).toBe('SIToken1');
159
- expect(result.queryParams.SITK2).toBe('SIToken2');
160
- return [
161
- 2
162
- ];
163
- }
164
- });
165
- }));
141
+ it('should add a specified SI Tokens in query params', function() {
142
+ return _async_to_generator(function() {
143
+ var plugin, runner, result;
144
+ return _ts_generator(this, function(_state) {
145
+ switch(_state.label){
146
+ case 0:
147
+ plugin = new _sitokenrequest.SiTokenRequest('SIToken1', 'SIToken2');
148
+ runner = plugin.load();
149
+ return [
150
+ 4,
151
+ runner.transform(options)
152
+ ];
153
+ case 1:
154
+ result = _state.sent();
155
+ expect(result.queryParams.SITK).toBe('SIToken1');
156
+ expect(result.queryParams.SITK2).toBe('SIToken2');
157
+ return [
158
+ 2
159
+ ];
160
+ }
161
+ });
162
+ })();
163
+ });
166
164
  });
@@ -86,7 +86,7 @@ function _object_spread(target) {
86
86
  return target;
87
87
  }
88
88
  function _ts_generator(thisArg, body) {
89
- var f, y, t, g, _ = {
89
+ var f, y, t, _ = {
90
90
  label: 0,
91
91
  sent: function() {
92
92
  if (t[0] & 1) throw t[1];
@@ -94,12 +94,8 @@ function _ts_generator(thisArg, body) {
94
94
  },
95
95
  trys: [],
96
96
  ops: []
97
- };
98
- return g = {
99
- next: verb(0),
100
- "throw": verb(1),
101
- "return": verb(2)
102
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
97
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
98
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
103
99
  return this;
104
100
  }), g;
105
101
  function verb(n) {
@@ -112,7 +108,7 @@ function _ts_generator(thisArg, body) {
112
108
  }
113
109
  function step(op) {
114
110
  if (f) throw new TypeError("Generator is already executing.");
115
- while(_)try {
111
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
116
112
  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;
117
113
  if (y = 0, t) op = [
118
114
  op[0] & 2,
@@ -221,21 +217,21 @@ var SimpleApiKeyAuthenticationRequest = /*#__PURE__*/ function() {
221
217
  value: function load() {
222
218
  var _this = this;
223
219
  return {
224
- transform: /*#__PURE__*/ function() {
225
- var _ref = _async_to_generator(function(data) {
220
+ transform: function(data) {
221
+ return _async_to_generator(function() {
226
222
  var _, _1, _tmp, _tmp1, officeId, _tmp2;
227
223
  return _ts_generator(this, function(_state) {
228
224
  switch(_state.label){
229
225
  case 0:
230
226
  _1 = (_ = data.headers).set;
231
227
  _tmp = [
232
- _this.options.apiKeyHeader
228
+ this.options.apiKeyHeader
233
229
  ];
234
- if (!(typeof _this.apiKey === 'string')) return [
230
+ if (!(typeof this.apiKey === 'string')) return [
235
231
  3,
236
232
  1
237
233
  ];
238
- _tmp1 = _this.apiKey;
234
+ _tmp1 = this.apiKey;
239
235
  return [
240
236
  3,
241
237
  3
@@ -243,7 +239,7 @@ var SimpleApiKeyAuthenticationRequest = /*#__PURE__*/ function() {
243
239
  case 1:
244
240
  return [
245
241
  4,
246
- _this.apiKey()
242
+ this.apiKey()
247
243
  ];
248
244
  case 2:
249
245
  _tmp1 = _state.sent();
@@ -252,15 +248,15 @@ var SimpleApiKeyAuthenticationRequest = /*#__PURE__*/ function() {
252
248
  _1.apply(_, _tmp.concat([
253
249
  _tmp1
254
250
  ]));
255
- if (!_this.options.officeId) return [
251
+ if (!this.options.officeId) return [
256
252
  3,
257
253
  7
258
254
  ];
259
- if (!(typeof _this.options.officeId === 'string')) return [
255
+ if (!(typeof this.options.officeId === 'string')) return [
260
256
  3,
261
257
  4
262
258
  ];
263
- _tmp2 = _this.options.officeId;
259
+ _tmp2 = this.options.officeId;
264
260
  return [
265
261
  3,
266
262
  6
@@ -268,14 +264,14 @@ var SimpleApiKeyAuthenticationRequest = /*#__PURE__*/ function() {
268
264
  case 4:
269
265
  return [
270
266
  4,
271
- _this.options.officeId()
267
+ this.options.officeId()
272
268
  ];
273
269
  case 5:
274
270
  _tmp2 = _state.sent();
275
271
  _state.label = 6;
276
272
  case 6:
277
273
  officeId = _tmp2;
278
- data.headers.set(_this.options.contextHeader, _this.jwtEncoder({
274
+ data.headers.set(this.options.contextHeader, this.jwtEncoder({
279
275
  oid: officeId
280
276
  }));
281
277
  _state.label = 7;
@@ -286,11 +282,8 @@ var SimpleApiKeyAuthenticationRequest = /*#__PURE__*/ function() {
286
282
  ];
287
283
  }
288
284
  });
289
- });
290
- return function(data) {
291
- return _ref.apply(this, arguments);
292
- };
293
- }()
285
+ }).call(_this);
286
+ }
294
287
  };
295
288
  }
296
289
  }