@segment/public-api-sdk-typescript 74.0.1-b970 → 74.0.1-b988
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/api/profilesSyncApi.ts
CHANGED
|
@@ -116,7 +116,7 @@ export class ProfilesSyncApi {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* Creates a new Profiles Warehouse. • When called, this endpoint may generate the `Profiles Sync Warehouse Created` event in the [audit trail](/tag/Audit-Trail).
|
|
119
|
+
* Creates a new Profiles Warehouse. <div style=\"background-color: #e8f4fd; border: 1px solid #90caf9; border-radius: 6px; padding: 16px; margin: 16px 0; color: #0d47a1; line-height: 1.5;\"> <ul style=\"margin: 0; padding-left: 20px; font-size: 13px;\"> <li style=\"margin-bottom: 6px;\"><strong>WARN</strong>: Please be careful to not use this API to link multiple Warehouses to a single Space. This is not officially supported. Although the Warehouse will be linked, it won\'t show up on the UI and can lead to various other unforeseen issues.</li> </ul> </div> • When called, this endpoint may generate the `Profiles Sync Warehouse Created` event in the [audit trail](/tag/Audit-Trail).
|
|
120
120
|
* @summary Create Profiles Warehouse
|
|
121
121
|
* @param spaceId
|
|
122
122
|
* @param CreateProfilesWarehouseAlphaInput
|
package/dist/tests/smoke.test.js
CHANGED
|
@@ -49,12 +49,32 @@ function makeServer(response, statusCode) {
|
|
|
49
49
|
return __generator(this, function (_a) {
|
|
50
50
|
return [2, new Promise(function (resolve, reject) {
|
|
51
51
|
server = http_1.default.createServer(function (req, res) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
var body = '';
|
|
53
|
+
req.on('data', function (chunk) {
|
|
54
|
+
body += chunk;
|
|
55
|
+
});
|
|
56
|
+
req.on('end', function () {
|
|
57
|
+
var headers = {};
|
|
58
|
+
for (var _i = 0, _a = [
|
|
59
|
+
'accept',
|
|
60
|
+
'authorization',
|
|
61
|
+
'content-type',
|
|
62
|
+
]; _i < _a.length; _i++) {
|
|
63
|
+
var name_1 = _a[_i];
|
|
64
|
+
if (name_1 in req.headers)
|
|
65
|
+
headers[name_1] = req.headers[name_1];
|
|
66
|
+
}
|
|
67
|
+
expect({
|
|
68
|
+
method: req.method,
|
|
69
|
+
url: req.url,
|
|
70
|
+
headers: headers,
|
|
71
|
+
body: body,
|
|
72
|
+
}).toMatchSnapshot();
|
|
73
|
+
res.writeHead(statusCode, {
|
|
74
|
+
'Content-Type': 'application/json',
|
|
75
|
+
});
|
|
76
|
+
res.end(JSON.stringify(response));
|
|
55
77
|
});
|
|
56
|
-
res.writeHead(statusCode, { 'Content-Type': 'application/json' });
|
|
57
|
-
res.end(JSON.stringify(response));
|
|
58
78
|
});
|
|
59
79
|
server.on('error', reject);
|
|
60
80
|
var port = 52338;
|
|
@@ -68,6 +88,10 @@ function makeServer(response, statusCode) {
|
|
|
68
88
|
});
|
|
69
89
|
});
|
|
70
90
|
}
|
|
91
|
+
function dropConnectionHeaders(resp) {
|
|
92
|
+
delete resp.response.headers['connection'];
|
|
93
|
+
delete resp.response.headers['keep-alive'];
|
|
94
|
+
}
|
|
71
95
|
describe('Smoke tests', function () {
|
|
72
96
|
afterEach(function () {
|
|
73
97
|
if (server.listening) {
|
|
@@ -117,6 +141,7 @@ describe('Smoke tests', function () {
|
|
|
117
141
|
})];
|
|
118
142
|
case 2:
|
|
119
143
|
resp = _a.sent();
|
|
144
|
+
dropConnectionHeaders(resp);
|
|
120
145
|
expect(resp).toMatchSnapshot({
|
|
121
146
|
response: {
|
|
122
147
|
headers: {
|
|
@@ -169,6 +194,7 @@ describe('Smoke tests', function () {
|
|
|
169
194
|
return [4, mockedRead.getSource('source-id')];
|
|
170
195
|
case 2:
|
|
171
196
|
resp = _a.sent();
|
|
197
|
+
dropConnectionHeaders(resp);
|
|
172
198
|
expect(resp).toMatchSnapshot({
|
|
173
199
|
response: {
|
|
174
200
|
headers: {
|
|
@@ -227,6 +253,7 @@ describe('Smoke tests', function () {
|
|
|
227
253
|
return [4, mockedList.listSources({ count: 1 })];
|
|
228
254
|
case 2:
|
|
229
255
|
resp = _a.sent();
|
|
256
|
+
dropConnectionHeaders(resp);
|
|
230
257
|
expect(resp).toMatchSnapshot({
|
|
231
258
|
response: {
|
|
232
259
|
headers: {
|
|
@@ -281,6 +308,7 @@ describe('Smoke tests', function () {
|
|
|
281
308
|
})];
|
|
282
309
|
case 2:
|
|
283
310
|
resp = _a.sent();
|
|
311
|
+
dropConnectionHeaders(resp);
|
|
284
312
|
expect(resp).toMatchSnapshot({
|
|
285
313
|
response: {
|
|
286
314
|
headers: {
|
|
@@ -307,6 +335,7 @@ describe('Smoke tests', function () {
|
|
|
307
335
|
return [4, mockedDelete.deleteSource('my-source')];
|
|
308
336
|
case 2:
|
|
309
337
|
resp = _a.sent();
|
|
338
|
+
dropConnectionHeaders(resp);
|
|
310
339
|
expect(resp).toMatchSnapshot({
|
|
311
340
|
response: {
|
|
312
341
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoke.test.js","sourceRoot":"","sources":["../../tests/smoke.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,oCAAyC;AACzC,IAAM,UAAU,GAAG,oBAAoB,CAAC;AAGxC,IAAI,MAAM,GAAG,cAAI,CAAC,YAAY,EAAE,CAAC;AAEjC,SAAe,UAAU,CACrB,QAAa,EACb,UAAgB;IAAhB,2BAAA,EAAA,gBAAgB;;;YAEhB,WAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;oBAC/B,MAAM,GAAG,cAAI,CAAC,YAAY,CAAC,UAAU,GAAG,EAAE,GAAG;wBACzC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"smoke.test.js","sourceRoot":"","sources":["../../tests/smoke.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,oCAAy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AW;gCACjB,OAAO,EAAE,iCAAiC;gCAC1C,IAAI,EAAE,IAAI;6BACb;yBACJ;qBACJ,EACD,GAAG,CACN,EAAA;;oBAXK,YAAY,GAAG,SAWpB;oBAEK,IAAI,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;oBAE9C,WAAM,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,EAAA;;oBAA5C,SAA4C,CAAC;;;;SAChD,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,86 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Smoke tests parses errors correctly 1`] = `
|
|
4
4
|
{
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"_events": {
|
|
8
|
-
"end": [Function],
|
|
9
|
-
},
|
|
10
|
-
"_eventsCount": 1,
|
|
11
|
-
"_maxListeners": undefined,
|
|
12
|
-
"_readableState": ReadableState {
|
|
13
|
-
"autoDestroy": true,
|
|
14
|
-
"awaitDrainWriters": null,
|
|
15
|
-
"buffer": BufferList {
|
|
16
|
-
"head": null,
|
|
17
|
-
"length": 0,
|
|
18
|
-
"tail": null,
|
|
19
|
-
},
|
|
20
|
-
"closeEmitted": false,
|
|
21
|
-
"closed": false,
|
|
22
|
-
"constructed": true,
|
|
23
|
-
"dataEmitted": false,
|
|
24
|
-
"decoder": null,
|
|
25
|
-
"defaultEncoding": "utf8",
|
|
26
|
-
"destroyed": false,
|
|
27
|
-
"emitClose": true,
|
|
28
|
-
"emittedReadable": false,
|
|
29
|
-
"encoding": null,
|
|
30
|
-
"endEmitted": false,
|
|
31
|
-
"ended": false,
|
|
32
|
-
"errorEmitted": false,
|
|
33
|
-
"errored": null,
|
|
34
|
-
"flowing": null,
|
|
35
|
-
"highWaterMark": 16384,
|
|
36
|
-
"length": 0,
|
|
37
|
-
"multiAwaitDrain": false,
|
|
38
|
-
"needReadable": false,
|
|
39
|
-
"objectMode": false,
|
|
40
|
-
"pipes": [],
|
|
41
|
-
"readableListening": false,
|
|
42
|
-
"reading": false,
|
|
43
|
-
"readingMore": true,
|
|
44
|
-
"resumeScheduled": false,
|
|
45
|
-
"sync": true,
|
|
46
|
-
Symbol(kPaused): null,
|
|
47
|
-
},
|
|
48
|
-
"aborted": false,
|
|
49
|
-
"client": Any<Object>,
|
|
50
|
-
"complete": false,
|
|
51
|
-
"httpVersion": "1.1",
|
|
52
|
-
"httpVersionMajor": 1,
|
|
53
|
-
"httpVersionMinor": 1,
|
|
54
|
-
"method": "DELETE",
|
|
55
|
-
"rawHeaders": [
|
|
56
|
-
"Accept",
|
|
57
|
-
"application/json",
|
|
58
|
-
"Authorization",
|
|
59
|
-
"Bearer 1ba60ccaae1c1a5230",
|
|
60
|
-
"host",
|
|
61
|
-
"localhost:52338",
|
|
62
|
-
"content-length",
|
|
63
|
-
"0",
|
|
64
|
-
"Connection",
|
|
65
|
-
"close",
|
|
66
|
-
],
|
|
67
|
-
"rawTrailers": [],
|
|
68
|
-
"socket": Any<Object>,
|
|
69
|
-
"statusCode": null,
|
|
70
|
-
"statusMessage": null,
|
|
71
|
-
"upgrade": false,
|
|
72
|
-
"url": "/sources/404",
|
|
73
|
-
Symbol(kCapture): false,
|
|
74
|
-
Symbol(kHeaders): {
|
|
5
|
+
"body": "",
|
|
6
|
+
"headers": {
|
|
75
7
|
"accept": "application/json",
|
|
76
8
|
"authorization": "Bearer 1ba60ccaae1c1a5230",
|
|
77
|
-
"connection": "close",
|
|
78
|
-
"content-length": "0",
|
|
79
|
-
"host": "localhost:52338",
|
|
80
9
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Symbol(kTrailersCount): 0,
|
|
84
|
-
Symbol(RequestTimeout): undefined,
|
|
10
|
+
"method": "DELETE",
|
|
11
|
+
"url": "/sources/404",
|
|
85
12
|
}
|
|
86
13
|
`;
|
|
87
14
|
|
|
@@ -89,89 +16,14 @@ exports[`Smoke tests parses errors correctly 2`] = `[HttpError: HTTP request fai
|
|
|
89
16
|
|
|
90
17
|
exports[`Smoke tests sends correct request and parses response for create 1`] = `
|
|
91
18
|
{
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"_events": {
|
|
95
|
-
"end": [Function],
|
|
96
|
-
},
|
|
97
|
-
"_eventsCount": 1,
|
|
98
|
-
"_maxListeners": undefined,
|
|
99
|
-
"_readableState": ReadableState {
|
|
100
|
-
"autoDestroy": true,
|
|
101
|
-
"awaitDrainWriters": null,
|
|
102
|
-
"buffer": BufferList {
|
|
103
|
-
"head": null,
|
|
104
|
-
"length": 0,
|
|
105
|
-
"tail": null,
|
|
106
|
-
},
|
|
107
|
-
"closeEmitted": false,
|
|
108
|
-
"closed": false,
|
|
109
|
-
"constructed": true,
|
|
110
|
-
"dataEmitted": false,
|
|
111
|
-
"decoder": null,
|
|
112
|
-
"defaultEncoding": "utf8",
|
|
113
|
-
"destroyed": false,
|
|
114
|
-
"emitClose": true,
|
|
115
|
-
"emittedReadable": false,
|
|
116
|
-
"encoding": null,
|
|
117
|
-
"endEmitted": false,
|
|
118
|
-
"ended": false,
|
|
119
|
-
"errorEmitted": false,
|
|
120
|
-
"errored": null,
|
|
121
|
-
"flowing": null,
|
|
122
|
-
"highWaterMark": 16384,
|
|
123
|
-
"length": 0,
|
|
124
|
-
"multiAwaitDrain": false,
|
|
125
|
-
"needReadable": false,
|
|
126
|
-
"objectMode": false,
|
|
127
|
-
"pipes": [],
|
|
128
|
-
"readableListening": false,
|
|
129
|
-
"reading": false,
|
|
130
|
-
"readingMore": true,
|
|
131
|
-
"resumeScheduled": false,
|
|
132
|
-
"sync": true,
|
|
133
|
-
Symbol(kPaused): null,
|
|
134
|
-
},
|
|
135
|
-
"aborted": false,
|
|
136
|
-
"client": Any<Object>,
|
|
137
|
-
"complete": false,
|
|
138
|
-
"httpVersion": "1.1",
|
|
139
|
-
"httpVersionMajor": 1,
|
|
140
|
-
"httpVersionMinor": 1,
|
|
141
|
-
"method": "POST",
|
|
142
|
-
"rawHeaders": [
|
|
143
|
-
"Accept",
|
|
144
|
-
"application/json",
|
|
145
|
-
"Authorization",
|
|
146
|
-
"Bearer 1ba60ccaae1c1a5230",
|
|
147
|
-
"host",
|
|
148
|
-
"localhost:52338",
|
|
149
|
-
"content-type",
|
|
150
|
-
"application/json",
|
|
151
|
-
"content-length",
|
|
152
|
-
"66",
|
|
153
|
-
"Connection",
|
|
154
|
-
"close",
|
|
155
|
-
],
|
|
156
|
-
"rawTrailers": [],
|
|
157
|
-
"socket": Any<Object>,
|
|
158
|
-
"statusCode": null,
|
|
159
|
-
"statusMessage": null,
|
|
160
|
-
"upgrade": false,
|
|
161
|
-
"url": "/sources",
|
|
162
|
-
Symbol(kCapture): false,
|
|
163
|
-
Symbol(kHeaders): {
|
|
19
|
+
"body": "{"slug":"my-test-source","enabled":true,"metadataId":"IqDTy1TpoU"}",
|
|
20
|
+
"headers": {
|
|
164
21
|
"accept": "application/json",
|
|
165
22
|
"authorization": "Bearer 1ba60ccaae1c1a5230",
|
|
166
|
-
"connection": "close",
|
|
167
|
-
"content-length": "66",
|
|
168
23
|
"content-type": "application/json",
|
|
169
|
-
"host": "localhost:52338",
|
|
170
24
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
Symbol(kTrailersCount): 0,
|
|
174
|
-
Symbol(RequestTimeout): undefined,
|
|
25
|
+
"method": "POST",
|
|
26
|
+
"url": "/sources",
|
|
175
27
|
}
|
|
176
28
|
`;
|
|
177
29
|
|
|
@@ -247,7 +99,6 @@ exports[`Smoke tests sends correct request and parses response for create 2`] =
|
|
|
247
99
|
},
|
|
248
100
|
},
|
|
249
101
|
"headers": {
|
|
250
|
-
"connection": "close",
|
|
251
102
|
"content-type": "application/json",
|
|
252
103
|
"date": Any<String>,
|
|
253
104
|
"transfer-encoding": "chunked",
|
|
@@ -264,86 +115,13 @@ exports[`Smoke tests sends correct request and parses response for create 2`] =
|
|
|
264
115
|
|
|
265
116
|
exports[`Smoke tests sends correct request and parses response for delete 1`] = `
|
|
266
117
|
{
|
|
267
|
-
"
|
|
268
|
-
"
|
|
269
|
-
"_events": {
|
|
270
|
-
"end": [Function],
|
|
271
|
-
},
|
|
272
|
-
"_eventsCount": 1,
|
|
273
|
-
"_maxListeners": undefined,
|
|
274
|
-
"_readableState": ReadableState {
|
|
275
|
-
"autoDestroy": true,
|
|
276
|
-
"awaitDrainWriters": null,
|
|
277
|
-
"buffer": BufferList {
|
|
278
|
-
"head": null,
|
|
279
|
-
"length": 0,
|
|
280
|
-
"tail": null,
|
|
281
|
-
},
|
|
282
|
-
"closeEmitted": false,
|
|
283
|
-
"closed": false,
|
|
284
|
-
"constructed": true,
|
|
285
|
-
"dataEmitted": false,
|
|
286
|
-
"decoder": null,
|
|
287
|
-
"defaultEncoding": "utf8",
|
|
288
|
-
"destroyed": false,
|
|
289
|
-
"emitClose": true,
|
|
290
|
-
"emittedReadable": false,
|
|
291
|
-
"encoding": null,
|
|
292
|
-
"endEmitted": false,
|
|
293
|
-
"ended": false,
|
|
294
|
-
"errorEmitted": false,
|
|
295
|
-
"errored": null,
|
|
296
|
-
"flowing": null,
|
|
297
|
-
"highWaterMark": 16384,
|
|
298
|
-
"length": 0,
|
|
299
|
-
"multiAwaitDrain": false,
|
|
300
|
-
"needReadable": false,
|
|
301
|
-
"objectMode": false,
|
|
302
|
-
"pipes": [],
|
|
303
|
-
"readableListening": false,
|
|
304
|
-
"reading": false,
|
|
305
|
-
"readingMore": true,
|
|
306
|
-
"resumeScheduled": false,
|
|
307
|
-
"sync": true,
|
|
308
|
-
Symbol(kPaused): null,
|
|
309
|
-
},
|
|
310
|
-
"aborted": false,
|
|
311
|
-
"client": Any<Object>,
|
|
312
|
-
"complete": false,
|
|
313
|
-
"httpVersion": "1.1",
|
|
314
|
-
"httpVersionMajor": 1,
|
|
315
|
-
"httpVersionMinor": 1,
|
|
316
|
-
"method": "DELETE",
|
|
317
|
-
"rawHeaders": [
|
|
318
|
-
"Accept",
|
|
319
|
-
"application/json",
|
|
320
|
-
"Authorization",
|
|
321
|
-
"Bearer 1ba60ccaae1c1a5230",
|
|
322
|
-
"host",
|
|
323
|
-
"localhost:52338",
|
|
324
|
-
"content-length",
|
|
325
|
-
"0",
|
|
326
|
-
"Connection",
|
|
327
|
-
"close",
|
|
328
|
-
],
|
|
329
|
-
"rawTrailers": [],
|
|
330
|
-
"socket": Any<Object>,
|
|
331
|
-
"statusCode": null,
|
|
332
|
-
"statusMessage": null,
|
|
333
|
-
"upgrade": false,
|
|
334
|
-
"url": "/sources/my-source",
|
|
335
|
-
Symbol(kCapture): false,
|
|
336
|
-
Symbol(kHeaders): {
|
|
118
|
+
"body": "",
|
|
119
|
+
"headers": {
|
|
337
120
|
"accept": "application/json",
|
|
338
121
|
"authorization": "Bearer 1ba60ccaae1c1a5230",
|
|
339
|
-
"connection": "close",
|
|
340
|
-
"content-length": "0",
|
|
341
|
-
"host": "localhost:52338",
|
|
342
122
|
},
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
Symbol(kTrailersCount): 0,
|
|
346
|
-
Symbol(RequestTimeout): undefined,
|
|
123
|
+
"method": "DELETE",
|
|
124
|
+
"url": "/sources/my-source",
|
|
347
125
|
}
|
|
348
126
|
`;
|
|
349
127
|
|
|
@@ -361,7 +139,6 @@ exports[`Smoke tests sends correct request and parses response for delete 2`] =
|
|
|
361
139
|
},
|
|
362
140
|
},
|
|
363
141
|
"headers": {
|
|
364
|
-
"connection": "close",
|
|
365
142
|
"content-type": "application/json",
|
|
366
143
|
"date": Any<String>,
|
|
367
144
|
"transfer-encoding": "chunked",
|
|
@@ -378,83 +155,13 @@ exports[`Smoke tests sends correct request and parses response for delete 2`] =
|
|
|
378
155
|
|
|
379
156
|
exports[`Smoke tests sends correct request and parses response for list 1`] = `
|
|
380
157
|
{
|
|
381
|
-
"
|
|
382
|
-
"
|
|
383
|
-
"_events": {
|
|
384
|
-
"end": [Function],
|
|
385
|
-
},
|
|
386
|
-
"_eventsCount": 1,
|
|
387
|
-
"_maxListeners": undefined,
|
|
388
|
-
"_readableState": ReadableState {
|
|
389
|
-
"autoDestroy": true,
|
|
390
|
-
"awaitDrainWriters": null,
|
|
391
|
-
"buffer": BufferList {
|
|
392
|
-
"head": null,
|
|
393
|
-
"length": 0,
|
|
394
|
-
"tail": null,
|
|
395
|
-
},
|
|
396
|
-
"closeEmitted": false,
|
|
397
|
-
"closed": false,
|
|
398
|
-
"constructed": true,
|
|
399
|
-
"dataEmitted": false,
|
|
400
|
-
"decoder": null,
|
|
401
|
-
"defaultEncoding": "utf8",
|
|
402
|
-
"destroyed": false,
|
|
403
|
-
"emitClose": true,
|
|
404
|
-
"emittedReadable": false,
|
|
405
|
-
"encoding": null,
|
|
406
|
-
"endEmitted": false,
|
|
407
|
-
"ended": false,
|
|
408
|
-
"errorEmitted": false,
|
|
409
|
-
"errored": null,
|
|
410
|
-
"flowing": null,
|
|
411
|
-
"highWaterMark": 16384,
|
|
412
|
-
"length": 0,
|
|
413
|
-
"multiAwaitDrain": false,
|
|
414
|
-
"needReadable": false,
|
|
415
|
-
"objectMode": false,
|
|
416
|
-
"pipes": [],
|
|
417
|
-
"readableListening": false,
|
|
418
|
-
"reading": false,
|
|
419
|
-
"readingMore": true,
|
|
420
|
-
"resumeScheduled": false,
|
|
421
|
-
"sync": true,
|
|
422
|
-
Symbol(kPaused): null,
|
|
423
|
-
},
|
|
424
|
-
"aborted": false,
|
|
425
|
-
"client": Any<Object>,
|
|
426
|
-
"complete": false,
|
|
427
|
-
"httpVersion": "1.1",
|
|
428
|
-
"httpVersionMajor": 1,
|
|
429
|
-
"httpVersionMinor": 1,
|
|
430
|
-
"method": "GET",
|
|
431
|
-
"rawHeaders": [
|
|
432
|
-
"Accept",
|
|
433
|
-
"application/json",
|
|
434
|
-
"Authorization",
|
|
435
|
-
"Bearer 1ba60ccaae1c1a5230",
|
|
436
|
-
"host",
|
|
437
|
-
"localhost:52338",
|
|
438
|
-
"Connection",
|
|
439
|
-
"close",
|
|
440
|
-
],
|
|
441
|
-
"rawTrailers": [],
|
|
442
|
-
"socket": Any<Object>,
|
|
443
|
-
"statusCode": null,
|
|
444
|
-
"statusMessage": null,
|
|
445
|
-
"upgrade": false,
|
|
446
|
-
"url": "/sources?pagination%5Bcount%5D=1",
|
|
447
|
-
Symbol(kCapture): false,
|
|
448
|
-
Symbol(kHeaders): {
|
|
158
|
+
"body": "",
|
|
159
|
+
"headers": {
|
|
449
160
|
"accept": "application/json",
|
|
450
161
|
"authorization": "Bearer 1ba60ccaae1c1a5230",
|
|
451
|
-
"connection": "close",
|
|
452
|
-
"host": "localhost:52338",
|
|
453
162
|
},
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
Symbol(kTrailersCount): 0,
|
|
457
|
-
Symbol(RequestTimeout): undefined,
|
|
163
|
+
"method": "GET",
|
|
164
|
+
"url": "/sources?pagination%5Bcount%5D=1",
|
|
458
165
|
}
|
|
459
166
|
`;
|
|
460
167
|
|
|
@@ -545,7 +252,6 @@ exports[`Smoke tests sends correct request and parses response for list 2`] = `
|
|
|
545
252
|
},
|
|
546
253
|
},
|
|
547
254
|
"headers": {
|
|
548
|
-
"connection": "close",
|
|
549
255
|
"content-type": "application/json",
|
|
550
256
|
"date": Any<String>,
|
|
551
257
|
"transfer-encoding": "chunked",
|
|
@@ -562,83 +268,13 @@ exports[`Smoke tests sends correct request and parses response for list 2`] = `
|
|
|
562
268
|
|
|
563
269
|
exports[`Smoke tests sends correct request and parses response for read 1`] = `
|
|
564
270
|
{
|
|
565
|
-
"
|
|
566
|
-
"
|
|
567
|
-
"_events": {
|
|
568
|
-
"end": [Function],
|
|
569
|
-
},
|
|
570
|
-
"_eventsCount": 1,
|
|
571
|
-
"_maxListeners": undefined,
|
|
572
|
-
"_readableState": ReadableState {
|
|
573
|
-
"autoDestroy": true,
|
|
574
|
-
"awaitDrainWriters": null,
|
|
575
|
-
"buffer": BufferList {
|
|
576
|
-
"head": null,
|
|
577
|
-
"length": 0,
|
|
578
|
-
"tail": null,
|
|
579
|
-
},
|
|
580
|
-
"closeEmitted": false,
|
|
581
|
-
"closed": false,
|
|
582
|
-
"constructed": true,
|
|
583
|
-
"dataEmitted": false,
|
|
584
|
-
"decoder": null,
|
|
585
|
-
"defaultEncoding": "utf8",
|
|
586
|
-
"destroyed": false,
|
|
587
|
-
"emitClose": true,
|
|
588
|
-
"emittedReadable": false,
|
|
589
|
-
"encoding": null,
|
|
590
|
-
"endEmitted": false,
|
|
591
|
-
"ended": false,
|
|
592
|
-
"errorEmitted": false,
|
|
593
|
-
"errored": null,
|
|
594
|
-
"flowing": null,
|
|
595
|
-
"highWaterMark": 16384,
|
|
596
|
-
"length": 0,
|
|
597
|
-
"multiAwaitDrain": false,
|
|
598
|
-
"needReadable": false,
|
|
599
|
-
"objectMode": false,
|
|
600
|
-
"pipes": [],
|
|
601
|
-
"readableListening": false,
|
|
602
|
-
"reading": false,
|
|
603
|
-
"readingMore": true,
|
|
604
|
-
"resumeScheduled": false,
|
|
605
|
-
"sync": true,
|
|
606
|
-
Symbol(kPaused): null,
|
|
607
|
-
},
|
|
608
|
-
"aborted": false,
|
|
609
|
-
"client": Any<Object>,
|
|
610
|
-
"complete": false,
|
|
611
|
-
"httpVersion": "1.1",
|
|
612
|
-
"httpVersionMajor": 1,
|
|
613
|
-
"httpVersionMinor": 1,
|
|
614
|
-
"method": "GET",
|
|
615
|
-
"rawHeaders": [
|
|
616
|
-
"Accept",
|
|
617
|
-
"application/json",
|
|
618
|
-
"Authorization",
|
|
619
|
-
"Bearer 1ba60ccaae1c1a5230",
|
|
620
|
-
"host",
|
|
621
|
-
"localhost:52338",
|
|
622
|
-
"Connection",
|
|
623
|
-
"close",
|
|
624
|
-
],
|
|
625
|
-
"rawTrailers": [],
|
|
626
|
-
"socket": Any<Object>,
|
|
627
|
-
"statusCode": null,
|
|
628
|
-
"statusMessage": null,
|
|
629
|
-
"upgrade": false,
|
|
630
|
-
"url": "/sources/source-id",
|
|
631
|
-
Symbol(kCapture): false,
|
|
632
|
-
Symbol(kHeaders): {
|
|
271
|
+
"body": "",
|
|
272
|
+
"headers": {
|
|
633
273
|
"accept": "application/json",
|
|
634
274
|
"authorization": "Bearer 1ba60ccaae1c1a5230",
|
|
635
|
-
"connection": "close",
|
|
636
|
-
"host": "localhost:52338",
|
|
637
275
|
},
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
Symbol(kTrailersCount): 0,
|
|
641
|
-
Symbol(RequestTimeout): undefined,
|
|
276
|
+
"method": "GET",
|
|
277
|
+
"url": "/sources/source-id",
|
|
642
278
|
}
|
|
643
279
|
`;
|
|
644
280
|
|
|
@@ -716,7 +352,6 @@ exports[`Smoke tests sends correct request and parses response for read 2`] = `
|
|
|
716
352
|
},
|
|
717
353
|
},
|
|
718
354
|
"headers": {
|
|
719
|
-
"connection": "close",
|
|
720
355
|
"content-type": "application/json",
|
|
721
356
|
"date": Any<String>,
|
|
722
357
|
"transfer-encoding": "chunked",
|
|
@@ -733,89 +368,14 @@ exports[`Smoke tests sends correct request and parses response for read 2`] = `
|
|
|
733
368
|
|
|
734
369
|
exports[`Smoke tests sends correct request and parses response for update 1`] = `
|
|
735
370
|
{
|
|
736
|
-
"
|
|
737
|
-
"
|
|
738
|
-
"_events": {
|
|
739
|
-
"end": [Function],
|
|
740
|
-
},
|
|
741
|
-
"_eventsCount": 1,
|
|
742
|
-
"_maxListeners": undefined,
|
|
743
|
-
"_readableState": ReadableState {
|
|
744
|
-
"autoDestroy": true,
|
|
745
|
-
"awaitDrainWriters": null,
|
|
746
|
-
"buffer": BufferList {
|
|
747
|
-
"head": null,
|
|
748
|
-
"length": 0,
|
|
749
|
-
"tail": null,
|
|
750
|
-
},
|
|
751
|
-
"closeEmitted": false,
|
|
752
|
-
"closed": false,
|
|
753
|
-
"constructed": true,
|
|
754
|
-
"dataEmitted": false,
|
|
755
|
-
"decoder": null,
|
|
756
|
-
"defaultEncoding": "utf8",
|
|
757
|
-
"destroyed": false,
|
|
758
|
-
"emitClose": true,
|
|
759
|
-
"emittedReadable": false,
|
|
760
|
-
"encoding": null,
|
|
761
|
-
"endEmitted": false,
|
|
762
|
-
"ended": false,
|
|
763
|
-
"errorEmitted": false,
|
|
764
|
-
"errored": null,
|
|
765
|
-
"flowing": null,
|
|
766
|
-
"highWaterMark": 16384,
|
|
767
|
-
"length": 0,
|
|
768
|
-
"multiAwaitDrain": false,
|
|
769
|
-
"needReadable": false,
|
|
770
|
-
"objectMode": false,
|
|
771
|
-
"pipes": [],
|
|
772
|
-
"readableListening": false,
|
|
773
|
-
"reading": false,
|
|
774
|
-
"readingMore": true,
|
|
775
|
-
"resumeScheduled": false,
|
|
776
|
-
"sync": true,
|
|
777
|
-
Symbol(kPaused): null,
|
|
778
|
-
},
|
|
779
|
-
"aborted": false,
|
|
780
|
-
"client": Any<Object>,
|
|
781
|
-
"complete": false,
|
|
782
|
-
"httpVersion": "1.1",
|
|
783
|
-
"httpVersionMajor": 1,
|
|
784
|
-
"httpVersionMinor": 1,
|
|
785
|
-
"method": "PATCH",
|
|
786
|
-
"rawHeaders": [
|
|
787
|
-
"Accept",
|
|
788
|
-
"application/json",
|
|
789
|
-
"Authorization",
|
|
790
|
-
"Bearer 1ba60ccaae1c1a5230",
|
|
791
|
-
"host",
|
|
792
|
-
"localhost:52338",
|
|
793
|
-
"content-type",
|
|
794
|
-
"application/json",
|
|
795
|
-
"content-length",
|
|
796
|
-
"44",
|
|
797
|
-
"Connection",
|
|
798
|
-
"close",
|
|
799
|
-
],
|
|
800
|
-
"rawTrailers": [],
|
|
801
|
-
"socket": Any<Object>,
|
|
802
|
-
"statusCode": null,
|
|
803
|
-
"statusMessage": null,
|
|
804
|
-
"upgrade": false,
|
|
805
|
-
"url": "/sources/source-id",
|
|
806
|
-
Symbol(kCapture): false,
|
|
807
|
-
Symbol(kHeaders): {
|
|
371
|
+
"body": "{"name":"My updated source","enabled":false}",
|
|
372
|
+
"headers": {
|
|
808
373
|
"accept": "application/json",
|
|
809
374
|
"authorization": "Bearer 1ba60ccaae1c1a5230",
|
|
810
|
-
"connection": "close",
|
|
811
|
-
"content-length": "44",
|
|
812
375
|
"content-type": "application/json",
|
|
813
|
-
"host": "localhost:52338",
|
|
814
376
|
},
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
Symbol(kTrailersCount): 0,
|
|
818
|
-
Symbol(RequestTimeout): undefined,
|
|
377
|
+
"method": "PATCH",
|
|
378
|
+
"url": "/sources/source-id",
|
|
819
379
|
}
|
|
820
380
|
`;
|
|
821
381
|
|
|
@@ -891,7 +451,6 @@ exports[`Smoke tests sends correct request and parses response for update 2`] =
|
|
|
891
451
|
},
|
|
892
452
|
},
|
|
893
453
|
"headers": {
|
|
894
|
-
"connection": "close",
|
|
895
454
|
"content-type": "application/json",
|
|
896
455
|
"date": Any<String>,
|
|
897
456
|
"transfer-encoding": "chunked",
|
package/tests/smoke.test.ts
CHANGED
|
@@ -11,12 +11,35 @@ async function makeServer(
|
|
|
11
11
|
): Promise<SourcesApi> {
|
|
12
12
|
return new Promise((resolve, reject) => {
|
|
13
13
|
server = http.createServer(function (req, res) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
let body = '';
|
|
15
|
+
req.on('data', (chunk) => {
|
|
16
|
+
body += chunk;
|
|
17
|
+
});
|
|
18
|
+
req.on('end', () => {
|
|
19
|
+
// Snapshot only the parts of the request the SDK controls. Serializing the whole IncomingMessage
|
|
20
|
+
// captures Node's stream internals (e.g. highWaterMark), and Node adds headers such as `connection`
|
|
21
|
+
// and `host` itself, so both change between Node versions and environments. The body covers what
|
|
22
|
+
// `content-length` used to.
|
|
23
|
+
const headers: Record<string, string | string[] | undefined> =
|
|
24
|
+
{};
|
|
25
|
+
for (const name of [
|
|
26
|
+
'accept',
|
|
27
|
+
'authorization',
|
|
28
|
+
'content-type',
|
|
29
|
+
]) {
|
|
30
|
+
if (name in req.headers) headers[name] = req.headers[name];
|
|
31
|
+
}
|
|
32
|
+
expect({
|
|
33
|
+
method: req.method,
|
|
34
|
+
url: req.url,
|
|
35
|
+
headers,
|
|
36
|
+
body,
|
|
37
|
+
}).toMatchSnapshot();
|
|
38
|
+
res.writeHead(statusCode, {
|
|
39
|
+
'Content-Type': 'application/json',
|
|
40
|
+
});
|
|
41
|
+
res.end(JSON.stringify(response));
|
|
17
42
|
});
|
|
18
|
-
res.writeHead(statusCode, { 'Content-Type': 'application/json' });
|
|
19
|
-
res.end(JSON.stringify(response));
|
|
20
43
|
});
|
|
21
44
|
|
|
22
45
|
server.on('error', reject);
|
|
@@ -30,6 +53,12 @@ async function makeServer(
|
|
|
30
53
|
});
|
|
31
54
|
});
|
|
32
55
|
}
|
|
56
|
+
// Node 19 made keep-alive the default for the HTTP client, which adds these response headers on newer Node only.
|
|
57
|
+
function dropConnectionHeaders(resp: any): void {
|
|
58
|
+
delete resp.response.headers['connection'];
|
|
59
|
+
delete resp.response.headers['keep-alive'];
|
|
60
|
+
}
|
|
61
|
+
|
|
33
62
|
describe('Smoke tests', () => {
|
|
34
63
|
afterEach(() => {
|
|
35
64
|
if (server.listening) {
|
|
@@ -77,6 +106,7 @@ describe('Smoke tests', () => {
|
|
|
77
106
|
slug: 'my-test-source',
|
|
78
107
|
});
|
|
79
108
|
|
|
109
|
+
dropConnectionHeaders(resp);
|
|
80
110
|
expect(resp).toMatchSnapshot({
|
|
81
111
|
response: {
|
|
82
112
|
headers: {
|
|
@@ -124,6 +154,7 @@ describe('Smoke tests', () => {
|
|
|
124
154
|
|
|
125
155
|
const resp = await mockedRead.getSource('source-id');
|
|
126
156
|
|
|
157
|
+
dropConnectionHeaders(resp);
|
|
127
158
|
expect(resp).toMatchSnapshot({
|
|
128
159
|
response: {
|
|
129
160
|
headers: {
|
|
@@ -177,6 +208,7 @@ describe('Smoke tests', () => {
|
|
|
177
208
|
|
|
178
209
|
const resp = await mockedList.listSources({ count: 1 });
|
|
179
210
|
|
|
211
|
+
dropConnectionHeaders(resp);
|
|
180
212
|
expect(resp).toMatchSnapshot({
|
|
181
213
|
response: {
|
|
182
214
|
headers: {
|
|
@@ -226,6 +258,7 @@ describe('Smoke tests', () => {
|
|
|
226
258
|
enabled: false,
|
|
227
259
|
});
|
|
228
260
|
|
|
261
|
+
dropConnectionHeaders(resp);
|
|
229
262
|
expect(resp).toMatchSnapshot({
|
|
230
263
|
response: {
|
|
231
264
|
headers: {
|
|
@@ -245,6 +278,7 @@ describe('Smoke tests', () => {
|
|
|
245
278
|
|
|
246
279
|
const resp = await mockedDelete.deleteSource('my-source');
|
|
247
280
|
|
|
281
|
+
dropConnectionHeaders(resp);
|
|
248
282
|
expect(resp).toMatchSnapshot({
|
|
249
283
|
response: {
|
|
250
284
|
headers: {
|