@unito/integration-sdk 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -28,7 +28,7 @@ describe('Provider', () => {
|
|
|
28
28
|
});
|
|
29
29
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
30
30
|
const actualResponse = await provider.get('/endpoint', {
|
|
31
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
31
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
32
32
|
logger: logger,
|
|
33
33
|
signal: new AbortController().signal,
|
|
34
34
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -57,7 +57,7 @@ describe('Provider', () => {
|
|
|
57
57
|
});
|
|
58
58
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
59
59
|
const actualResponse = await provider.get('/endpoint', {
|
|
60
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
60
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
61
61
|
logger: logger,
|
|
62
62
|
signal: new AbortController().signal,
|
|
63
63
|
additionnalheaders: { 'X-Additional-Header': 'value1', Accept: 'text/html; charset=UTF-8' },
|
|
@@ -86,7 +86,7 @@ describe('Provider', () => {
|
|
|
86
86
|
});
|
|
87
87
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
88
88
|
const actualResponse = await provider.get('/endpoint', {
|
|
89
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
89
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
90
90
|
logger: logger,
|
|
91
91
|
signal: new AbortController().signal,
|
|
92
92
|
additionnalheaders: { 'X-Additional-Header': 'value1', Accept: 'application/schema+json; charset=UTF-8' },
|
|
@@ -115,7 +115,7 @@ describe('Provider', () => {
|
|
|
115
115
|
});
|
|
116
116
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
117
117
|
const actualResponse = await provider.get('/endpoint', {
|
|
118
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
118
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
119
119
|
logger: logger,
|
|
120
120
|
signal: new AbortController().signal,
|
|
121
121
|
additionnalheaders: { 'X-Additional-Header': 'value1', Accept: 'application/swagger+json; charset=UTF-8' },
|
|
@@ -144,7 +144,7 @@ describe('Provider', () => {
|
|
|
144
144
|
});
|
|
145
145
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
146
146
|
const actualResponse = await provider.get('/endpoint', {
|
|
147
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
147
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
148
148
|
logger: logger,
|
|
149
149
|
signal: new AbortController().signal,
|
|
150
150
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -173,7 +173,7 @@ describe('Provider', () => {
|
|
|
173
173
|
});
|
|
174
174
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
175
175
|
const providerResponse = await provider.streamingGet('/endpoint/123', {
|
|
176
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
176
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
177
177
|
logger: logger,
|
|
178
178
|
signal: new AbortController().signal,
|
|
179
179
|
additionnalheaders: {
|
|
@@ -192,7 +192,7 @@ describe('Provider', () => {
|
|
|
192
192
|
});
|
|
193
193
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
194
194
|
const actualResponse = await provider.get('https://my-cdn.my-domain.com/file.png', {
|
|
195
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
195
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
196
196
|
logger: logger,
|
|
197
197
|
signal: new AbortController().signal,
|
|
198
198
|
});
|
|
@@ -221,7 +221,7 @@ describe('Provider', () => {
|
|
|
221
221
|
const actualResponse = await provider.post('/endpoint', {
|
|
222
222
|
data: 'createdItemInfo',
|
|
223
223
|
}, {
|
|
224
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
224
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
225
225
|
logger: logger,
|
|
226
226
|
signal: new AbortController().signal,
|
|
227
227
|
additionnalheaders: { 'Content-Type': 'application/x-www-form-urlencoded', 'X-Additional-Header': 'value1' },
|
|
@@ -254,7 +254,7 @@ describe('Provider', () => {
|
|
|
254
254
|
{ data: '1', data2: '2' },
|
|
255
255
|
{ data: '3', data2: '4' },
|
|
256
256
|
], {
|
|
257
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
257
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
258
258
|
logger: logger,
|
|
259
259
|
signal: new AbortController().signal,
|
|
260
260
|
additionnalheaders: { 'Content-Type': 'application/json-patch+json', 'X-Additional-Header': 'value1' },
|
|
@@ -287,7 +287,7 @@ describe('Provider', () => {
|
|
|
287
287
|
const actualResponse = await provider.put('endpoint/123', {
|
|
288
288
|
data: 'updatedItemInfo',
|
|
289
289
|
}, {
|
|
290
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
290
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
291
291
|
logger: logger,
|
|
292
292
|
signal: new AbortController().signal,
|
|
293
293
|
additionnalheaders: { 'X-Additional-Header': 'value1', 'Content-Type': 'application/json' },
|
|
@@ -319,7 +319,7 @@ describe('Provider', () => {
|
|
|
319
319
|
const buffer = Buffer.from('binary data content');
|
|
320
320
|
// What matters is that the body of put is a buffer
|
|
321
321
|
const actualResponse = await provider.putBuffer('endpoint/123', buffer, {
|
|
322
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
322
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
323
323
|
logger: logger,
|
|
324
324
|
signal: new AbortController().signal,
|
|
325
325
|
additionnalheaders: { 'X-Additional-Header': 'value1', 'Content-Type': 'application/octet-stream' },
|
|
@@ -351,7 +351,7 @@ describe('Provider', () => {
|
|
|
351
351
|
const actualResponse = await provider.patch('/endpoint/123', {
|
|
352
352
|
data: 'updatedItemInfo',
|
|
353
353
|
}, {
|
|
354
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
354
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
355
355
|
logger: logger,
|
|
356
356
|
signal: new AbortController().signal,
|
|
357
357
|
queryParams: { param1: 'value1', param2: 'value2' },
|
|
@@ -382,7 +382,7 @@ describe('Provider', () => {
|
|
|
382
382
|
});
|
|
383
383
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
384
384
|
const actualResponse = await provider.delete('/endpoint/123', {
|
|
385
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
385
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
386
386
|
logger: logger,
|
|
387
387
|
signal: new AbortController().signal,
|
|
388
388
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -424,7 +424,7 @@ describe('Provider', () => {
|
|
|
424
424
|
});
|
|
425
425
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
426
426
|
const options = {
|
|
427
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
427
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
428
428
|
logger: logger,
|
|
429
429
|
signal: new AbortController().signal,
|
|
430
430
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -470,7 +470,7 @@ describe('Provider', () => {
|
|
|
470
470
|
});
|
|
471
471
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
472
472
|
const options = {
|
|
473
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
473
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
474
474
|
logger: logger,
|
|
475
475
|
signal: new AbortController().signal,
|
|
476
476
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -511,7 +511,7 @@ describe('Provider', () => {
|
|
|
511
511
|
});
|
|
512
512
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
513
513
|
const options = {
|
|
514
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
514
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
515
515
|
logger: logger,
|
|
516
516
|
signal: new AbortController().signal,
|
|
517
517
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -547,7 +547,7 @@ describe('Provider', () => {
|
|
|
547
547
|
});
|
|
548
548
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
549
549
|
const options = {
|
|
550
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
550
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
551
551
|
logger: logger,
|
|
552
552
|
signal: new AbortController().signal,
|
|
553
553
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -569,7 +569,7 @@ describe('Provider', () => {
|
|
|
569
569
|
});
|
|
570
570
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
571
571
|
const providerResponse = await provider.get('/endpoint/123', {
|
|
572
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
572
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
573
573
|
logger: logger,
|
|
574
574
|
signal: new AbortController().signal,
|
|
575
575
|
});
|
|
@@ -583,7 +583,7 @@ describe('Provider', () => {
|
|
|
583
583
|
});
|
|
584
584
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
585
585
|
const providerResponse = await provider.get('/endpoint/123', {
|
|
586
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
586
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
587
587
|
logger: logger,
|
|
588
588
|
signal: new AbortController().signal,
|
|
589
589
|
});
|
|
@@ -597,7 +597,7 @@ describe('Provider', () => {
|
|
|
597
597
|
});
|
|
598
598
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
599
599
|
const providerResponse = await provider.streamingGet('/endpoint/123', {
|
|
600
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
600
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
601
601
|
logger: logger,
|
|
602
602
|
signal: new AbortController().signal,
|
|
603
603
|
});
|
|
@@ -611,7 +611,7 @@ describe('Provider', () => {
|
|
|
611
611
|
});
|
|
612
612
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
613
613
|
const providerResponse = await provider.post('/endpoint/123', {}, {
|
|
614
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
614
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
615
615
|
logger: logger,
|
|
616
616
|
signal: new AbortController().signal,
|
|
617
617
|
});
|
|
@@ -629,7 +629,7 @@ describe('Provider', () => {
|
|
|
629
629
|
let error;
|
|
630
630
|
try {
|
|
631
631
|
await provider.get('/endpoint/123', {
|
|
632
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
632
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
633
633
|
logger: logger,
|
|
634
634
|
signal: new AbortController().signal,
|
|
635
635
|
});
|
|
@@ -649,7 +649,7 @@ describe('Provider', () => {
|
|
|
649
649
|
let error;
|
|
650
650
|
try {
|
|
651
651
|
await provider.get('/endpoint/123', {
|
|
652
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
652
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
653
653
|
logger: logger,
|
|
654
654
|
signal: new AbortController().signal,
|
|
655
655
|
});
|
|
@@ -668,7 +668,7 @@ describe('Provider', () => {
|
|
|
668
668
|
let error;
|
|
669
669
|
try {
|
|
670
670
|
await provider.get('/endpoint/123', {
|
|
671
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
671
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
672
672
|
signal: new AbortController().signal,
|
|
673
673
|
logger: logger,
|
|
674
674
|
});
|
|
@@ -688,7 +688,7 @@ describe('Provider', () => {
|
|
|
688
688
|
let error;
|
|
689
689
|
try {
|
|
690
690
|
await provider.get('/endpoint/123', {
|
|
691
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
691
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
692
692
|
signal: new AbortController().signal,
|
|
693
693
|
logger: logger,
|
|
694
694
|
});
|
|
@@ -708,7 +708,7 @@ describe('Provider', () => {
|
|
|
708
708
|
let error;
|
|
709
709
|
try {
|
|
710
710
|
await provider.get('/endpoint/123', {
|
|
711
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
711
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
712
712
|
signal: new AbortController().signal,
|
|
713
713
|
logger: logger,
|
|
714
714
|
});
|
|
@@ -726,7 +726,7 @@ describe('Provider', () => {
|
|
|
726
726
|
let error;
|
|
727
727
|
try {
|
|
728
728
|
await provider.get('/endpoint/123', {
|
|
729
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
729
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
730
730
|
signal: new AbortController().signal,
|
|
731
731
|
logger: logger,
|
|
732
732
|
});
|
|
@@ -750,7 +750,7 @@ describe('Provider', () => {
|
|
|
750
750
|
let error;
|
|
751
751
|
try {
|
|
752
752
|
await provider.get('/endpoint/123', {
|
|
753
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
753
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
754
754
|
signal: new AbortController().signal,
|
|
755
755
|
logger: logger,
|
|
756
756
|
});
|
package/package.json
CHANGED
|
@@ -10,7 +10,12 @@ declare global {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export type Credentials = {
|
|
13
|
+
export type Credentials = {
|
|
14
|
+
accessToken?: string;
|
|
15
|
+
unitoCredentialId: string;
|
|
16
|
+
unitoUserId?: string;
|
|
17
|
+
[keys: string]: unknown;
|
|
18
|
+
};
|
|
14
19
|
|
|
15
20
|
const CREDENTIALS_HEADER = 'X-Unito-Credentials';
|
|
16
21
|
|
|
@@ -35,7 +35,7 @@ describe('Provider', () => {
|
|
|
35
35
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
36
36
|
|
|
37
37
|
const actualResponse = await provider.get('/endpoint', {
|
|
38
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
38
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
39
39
|
logger: logger,
|
|
40
40
|
signal: new AbortController().signal,
|
|
41
41
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -68,7 +68,7 @@ describe('Provider', () => {
|
|
|
68
68
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
69
69
|
|
|
70
70
|
const actualResponse = await provider.get('/endpoint', {
|
|
71
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
71
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
72
72
|
logger: logger,
|
|
73
73
|
signal: new AbortController().signal,
|
|
74
74
|
additionnalheaders: { 'X-Additional-Header': 'value1', Accept: 'text/html; charset=UTF-8' },
|
|
@@ -103,7 +103,7 @@ describe('Provider', () => {
|
|
|
103
103
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
104
104
|
|
|
105
105
|
const actualResponse = await provider.get('/endpoint', {
|
|
106
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
106
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
107
107
|
logger: logger,
|
|
108
108
|
signal: new AbortController().signal,
|
|
109
109
|
additionnalheaders: { 'X-Additional-Header': 'value1', Accept: 'application/schema+json; charset=UTF-8' },
|
|
@@ -138,7 +138,7 @@ describe('Provider', () => {
|
|
|
138
138
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
139
139
|
|
|
140
140
|
const actualResponse = await provider.get('/endpoint', {
|
|
141
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
141
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
142
142
|
logger: logger,
|
|
143
143
|
signal: new AbortController().signal,
|
|
144
144
|
additionnalheaders: { 'X-Additional-Header': 'value1', Accept: 'application/swagger+json; charset=UTF-8' },
|
|
@@ -173,7 +173,7 @@ describe('Provider', () => {
|
|
|
173
173
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
174
174
|
|
|
175
175
|
const actualResponse = await provider.get('/endpoint', {
|
|
176
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
176
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
177
177
|
logger: logger,
|
|
178
178
|
signal: new AbortController().signal,
|
|
179
179
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -208,7 +208,7 @@ describe('Provider', () => {
|
|
|
208
208
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
209
209
|
|
|
210
210
|
const providerResponse = await provider.streamingGet('/endpoint/123', {
|
|
211
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
211
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
212
212
|
logger: logger,
|
|
213
213
|
signal: new AbortController().signal,
|
|
214
214
|
additionnalheaders: {
|
|
@@ -231,7 +231,7 @@ describe('Provider', () => {
|
|
|
231
231
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
232
232
|
|
|
233
233
|
const actualResponse = await provider.get('https://my-cdn.my-domain.com/file.png', {
|
|
234
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
234
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
235
235
|
logger: logger,
|
|
236
236
|
signal: new AbortController().signal,
|
|
237
237
|
});
|
|
@@ -267,7 +267,7 @@ describe('Provider', () => {
|
|
|
267
267
|
data: 'createdItemInfo',
|
|
268
268
|
},
|
|
269
269
|
{
|
|
270
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
270
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
271
271
|
logger: logger,
|
|
272
272
|
signal: new AbortController().signal,
|
|
273
273
|
additionnalheaders: { 'Content-Type': 'application/x-www-form-urlencoded', 'X-Additional-Header': 'value1' },
|
|
@@ -308,7 +308,7 @@ describe('Provider', () => {
|
|
|
308
308
|
{ data: '3', data2: '4' },
|
|
309
309
|
],
|
|
310
310
|
{
|
|
311
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
311
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
312
312
|
logger: logger,
|
|
313
313
|
signal: new AbortController().signal,
|
|
314
314
|
additionnalheaders: { 'Content-Type': 'application/json-patch+json', 'X-Additional-Header': 'value1' },
|
|
@@ -349,7 +349,7 @@ describe('Provider', () => {
|
|
|
349
349
|
data: 'updatedItemInfo',
|
|
350
350
|
},
|
|
351
351
|
{
|
|
352
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
352
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
353
353
|
logger: logger,
|
|
354
354
|
signal: new AbortController().signal,
|
|
355
355
|
additionnalheaders: { 'X-Additional-Header': 'value1', 'Content-Type': 'application/json' },
|
|
@@ -387,7 +387,7 @@ describe('Provider', () => {
|
|
|
387
387
|
|
|
388
388
|
// What matters is that the body of put is a buffer
|
|
389
389
|
const actualResponse = await provider.putBuffer('endpoint/123', buffer, {
|
|
390
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
390
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
391
391
|
logger: logger,
|
|
392
392
|
signal: new AbortController().signal,
|
|
393
393
|
additionnalheaders: { 'X-Additional-Header': 'value1', 'Content-Type': 'application/octet-stream' },
|
|
@@ -426,7 +426,7 @@ describe('Provider', () => {
|
|
|
426
426
|
data: 'updatedItemInfo',
|
|
427
427
|
},
|
|
428
428
|
{
|
|
429
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
429
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
430
430
|
logger: logger,
|
|
431
431
|
signal: new AbortController().signal,
|
|
432
432
|
queryParams: { param1: 'value1', param2: 'value2' },
|
|
@@ -462,7 +462,7 @@ describe('Provider', () => {
|
|
|
462
462
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
463
463
|
|
|
464
464
|
const actualResponse = await provider.delete('/endpoint/123', {
|
|
465
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
465
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
466
466
|
logger: logger,
|
|
467
467
|
signal: new AbortController().signal,
|
|
468
468
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -510,7 +510,7 @@ describe('Provider', () => {
|
|
|
510
510
|
const fetchMock = context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
511
511
|
|
|
512
512
|
const options = {
|
|
513
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
513
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
514
514
|
logger: logger,
|
|
515
515
|
signal: new AbortController().signal,
|
|
516
516
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -563,7 +563,7 @@ describe('Provider', () => {
|
|
|
563
563
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
564
564
|
|
|
565
565
|
const options = {
|
|
566
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
566
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
567
567
|
logger: logger,
|
|
568
568
|
signal: new AbortController().signal,
|
|
569
569
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -610,7 +610,7 @@ describe('Provider', () => {
|
|
|
610
610
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
611
611
|
|
|
612
612
|
const options = {
|
|
613
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
613
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
614
614
|
logger: logger,
|
|
615
615
|
signal: new AbortController().signal,
|
|
616
616
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -651,7 +651,7 @@ describe('Provider', () => {
|
|
|
651
651
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
652
652
|
|
|
653
653
|
const options = {
|
|
654
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
654
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
655
655
|
logger: logger,
|
|
656
656
|
signal: new AbortController().signal,
|
|
657
657
|
additionnalheaders: { 'X-Additional-Header': 'value1' },
|
|
@@ -677,7 +677,7 @@ describe('Provider', () => {
|
|
|
677
677
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
678
678
|
|
|
679
679
|
const providerResponse = await provider.get<{ validJson: boolean }>('/endpoint/123', {
|
|
680
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
680
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
681
681
|
logger: logger,
|
|
682
682
|
signal: new AbortController().signal,
|
|
683
683
|
});
|
|
@@ -695,7 +695,7 @@ describe('Provider', () => {
|
|
|
695
695
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
696
696
|
|
|
697
697
|
const providerResponse = await provider.get<{ validJson: boolean }>('/endpoint/123', {
|
|
698
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
698
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
699
699
|
logger: logger,
|
|
700
700
|
signal: new AbortController().signal,
|
|
701
701
|
});
|
|
@@ -713,7 +713,7 @@ describe('Provider', () => {
|
|
|
713
713
|
context.mock.method(global, 'fetch', () => Promise.resolve(response));
|
|
714
714
|
|
|
715
715
|
const providerResponse = await provider.streamingGet('/endpoint/123', {
|
|
716
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
716
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
717
717
|
logger: logger,
|
|
718
718
|
signal: new AbortController().signal,
|
|
719
719
|
});
|
|
@@ -734,7 +734,7 @@ describe('Provider', () => {
|
|
|
734
734
|
'/endpoint/123',
|
|
735
735
|
{},
|
|
736
736
|
{
|
|
737
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
737
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
738
738
|
logger: logger,
|
|
739
739
|
signal: new AbortController().signal,
|
|
740
740
|
},
|
|
@@ -758,7 +758,7 @@ describe('Provider', () => {
|
|
|
758
758
|
|
|
759
759
|
try {
|
|
760
760
|
await provider.get('/endpoint/123', {
|
|
761
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
761
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
762
762
|
logger: logger,
|
|
763
763
|
signal: new AbortController().signal,
|
|
764
764
|
});
|
|
@@ -782,7 +782,7 @@ describe('Provider', () => {
|
|
|
782
782
|
|
|
783
783
|
try {
|
|
784
784
|
await provider.get('/endpoint/123', {
|
|
785
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
785
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
786
786
|
logger: logger,
|
|
787
787
|
signal: new AbortController().signal,
|
|
788
788
|
});
|
|
@@ -805,7 +805,7 @@ describe('Provider', () => {
|
|
|
805
805
|
|
|
806
806
|
try {
|
|
807
807
|
await provider.get('/endpoint/123', {
|
|
808
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
808
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
809
809
|
signal: new AbortController().signal,
|
|
810
810
|
logger: logger,
|
|
811
811
|
});
|
|
@@ -828,7 +828,7 @@ describe('Provider', () => {
|
|
|
828
828
|
|
|
829
829
|
try {
|
|
830
830
|
await provider.get('/endpoint/123', {
|
|
831
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
831
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
832
832
|
signal: new AbortController().signal,
|
|
833
833
|
logger: logger,
|
|
834
834
|
});
|
|
@@ -851,7 +851,7 @@ describe('Provider', () => {
|
|
|
851
851
|
|
|
852
852
|
try {
|
|
853
853
|
await provider.get('/endpoint/123', {
|
|
854
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
854
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
855
855
|
signal: new AbortController().signal,
|
|
856
856
|
logger: logger,
|
|
857
857
|
});
|
|
@@ -872,7 +872,7 @@ describe('Provider', () => {
|
|
|
872
872
|
|
|
873
873
|
try {
|
|
874
874
|
await provider.get('/endpoint/123', {
|
|
875
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
875
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
876
876
|
signal: new AbortController().signal,
|
|
877
877
|
logger: logger,
|
|
878
878
|
});
|
|
@@ -900,7 +900,7 @@ describe('Provider', () => {
|
|
|
900
900
|
|
|
901
901
|
try {
|
|
902
902
|
await provider.get('/endpoint/123', {
|
|
903
|
-
credentials: { apiKey: 'apikey#1111' },
|
|
903
|
+
credentials: { apiKey: 'apikey#1111', unitoCredentialId: '123' },
|
|
904
904
|
signal: new AbortController().signal,
|
|
905
905
|
logger: logger,
|
|
906
906
|
});
|