@coveo/push-api-client 2.6.5 → 2.6.6
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/dist/definitions/{source/catalog.stream.spec.d.ts → help/urlUtils.spec.d.ts} +0 -0
- package/dist/definitions/source/batchUploadDocumentsFromFile.spec.d.ts +1 -0
- package/dist/definitions/source/documentUploader.spec.d.ts +1 -0
- package/dist/definitions/uploadStrategy/fileContainerStrategy.spec.d.ts +1 -0
- package/dist/definitions/uploadStrategy/streamChunkStrategy.spec.d.ts +1 -0
- package/dist/docs/classes/AnySecurityIdentityBuilder.html +4 -4
- package/dist/docs/classes/CatalogSource.html +16 -16
- package/dist/docs/classes/DocumentBuilder.html +28 -28
- package/dist/docs/classes/FieldAnalyser.html +12 -12
- package/dist/docs/classes/GroupSecurityIdentityBuilder.html +5 -5
- package/dist/docs/classes/PushSource.html +24 -24
- package/dist/docs/classes/UserSecurityIdentityBuilder.html +5 -5
- package/dist/docs/classes/VirtualGroupSecurityIdentityBuilder.html +5 -5
- package/dist/docs/classes/errors.FieldTypeInconsistencyError.html +3 -3
- package/dist/docs/classes/errors.InvalidDocument.html +3 -3
- package/dist/docs/classes/errors.InvalidPermanentId.html +3 -3
- package/dist/docs/classes/errors.NotAFileError.html +3 -3
- package/dist/docs/classes/errors.NotAJsonFileError.html +3 -3
- package/dist/docs/classes/errors.PrivilegeError.html +4 -4
- package/dist/docs/classes/errors.UnsupportedAttribute.html +3 -3
- package/dist/docs/classes/errors.UnsupportedFieldError.html +6 -6
- package/dist/docs/enums/PlatformEnvironment.html +5 -5
- package/dist/docs/functions/parseAndGetDocumentBuilderFromJSONDocument.html +1 -1
- package/dist/docs/interfaces/BatchUpdateDocuments.html +3 -3
- package/dist/docs/interfaces/Document.html +14 -14
- package/dist/docs/interfaces/SecurityIdentity.html +4 -4
- package/dist/docs/interfaces/SecurityIdentityBuilder.html +2 -2
- package/dist/docs/interfaces/UploadBatchCallbackData.html +5 -5
- package/dist/docs/modules/errors.html +1 -1
- package/dist/docs/types/BatchUpdateDocumentsFromFiles.html +1 -1
- package/dist/docs/types/CompressionType.html +1 -1
- package/dist/docs/types/FailedUploadCallback.html +1 -1
- package/dist/docs/types/Metadata.html +1 -1
- package/dist/docs/types/MetadataValue.html +1 -1
- package/dist/docs/types/PlatformUrlOptions.html +1 -1
- package/dist/docs/types/SecurityIdentityType.html +1 -1
- package/dist/docs/types/SuccessfulUploadCallback.html +1 -1
- package/dist/docs/types/Transformer.html +1 -1
- package/dist/docs/variables/BuiltInTransformers.html +1 -1
- package/dist/docs/variables/Source.html +1 -1
- package/dist/fieldAnalyser/fieldAnalyser.spec.js +0 -1
- package/dist/fieldAnalyser/fieldAnalyser.spec.js.map +1 -1
- package/dist/fieldAnalyser/fieldsUtils.spec.js +35 -3
- package/dist/fieldAnalyser/fieldsUtils.spec.js.map +1 -1
- package/dist/help/urlUtils.spec.js +42 -0
- package/dist/help/urlUtils.spec.js.map +1 -0
- package/dist/source/batchUploadDocumentsFromFile.spec.js +146 -0
- package/dist/source/batchUploadDocumentsFromFile.spec.js.map +1 -0
- package/dist/source/catalog.spec.js +20 -199
- package/dist/source/catalog.spec.js.map +1 -1
- package/dist/source/documentUploader.spec.js +132 -0
- package/dist/source/documentUploader.spec.js.map +1 -0
- package/dist/source/push.spec.js +118 -269
- package/dist/source/push.spec.js.map +1 -1
- package/dist/uploadStrategy/fileContainerStrategy.spec.js +103 -0
- package/dist/uploadStrategy/fileContainerStrategy.spec.js.map +1 -0
- package/dist/uploadStrategy/streamChunkStrategy.spec.js +106 -0
- package/dist/uploadStrategy/streamChunkStrategy.spec.js.map +1 -0
- package/package.json +1 -1
- package/dist/__stub__/largeDocuments/documentGenerator.js +0 -22
- package/dist/__stub__/largeDocuments/documentGenerator.js.map +0 -1
- package/dist/definitions/__stub__/largeDocuments/documentGenerator.d.ts +0 -12
- package/dist/source/catalog.stream.spec.js +0 -238
- package/dist/source/catalog.stream.spec.js.map +0 -1
@@ -0,0 +1,103 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
jest.mock('axios');
|
4
|
+
jest.mock('../help/fileContainer');
|
5
|
+
const platform_client_1 = require("@coveo/platform-client");
|
6
|
+
const axios_1 = require("axios");
|
7
|
+
const __1 = require("..");
|
8
|
+
const environment_1 = require("../environment");
|
9
|
+
const fileContainer_1 = require("../help/fileContainer");
|
10
|
+
const urlUtils_1 = require("../help/urlUtils");
|
11
|
+
const fileContainerStrategy_1 = require("./fileContainerStrategy");
|
12
|
+
const mockedAxios = jest.mocked(axios_1.default);
|
13
|
+
const mockedPut = jest.fn();
|
14
|
+
const mockedPost = jest.fn();
|
15
|
+
const platformOptions = {
|
16
|
+
region: platform_client_1.Region.US,
|
17
|
+
environment: environment_1.PlatformEnvironment.Prod,
|
18
|
+
};
|
19
|
+
const documentBatch = {
|
20
|
+
addOrUpdate: [
|
21
|
+
new __1.DocumentBuilder('https://foo.com', 'Foo'),
|
22
|
+
new __1.DocumentBuilder('https://bar.com', 'Bar'),
|
23
|
+
],
|
24
|
+
delete: [{ documentId: 'some_id', deleteChildren: false }],
|
25
|
+
};
|
26
|
+
const fileContainerResponse = {
|
27
|
+
uploadUri: 'https://fake.upload.url',
|
28
|
+
fileId: 'file_id',
|
29
|
+
requiredHeaders: { foo: 'bar' },
|
30
|
+
};
|
31
|
+
const doMockAxios = () => {
|
32
|
+
mockedAxios.put = mockedPut;
|
33
|
+
mockedAxios.post = mockedPost;
|
34
|
+
};
|
35
|
+
const doMockFileContainerResponse = () => {
|
36
|
+
mockedPost.mockResolvedValue({ data: fileContainerResponse });
|
37
|
+
};
|
38
|
+
describe('FileContainerStrategy', () => {
|
39
|
+
beforeAll(() => {
|
40
|
+
doMockAxios();
|
41
|
+
});
|
42
|
+
describe.each([
|
43
|
+
{
|
44
|
+
builderClass: urlUtils_1.PushUrlBuilder,
|
45
|
+
pushUrl: 'https://api.cloud.coveo.com/push/v1/organizations/org-id/sources/source-id/documents/batch?fileId=file_id', // note the last part of the url
|
46
|
+
},
|
47
|
+
{
|
48
|
+
builderClass: urlUtils_1.StreamUrlBuilder,
|
49
|
+
pushUrl: 'https://api.cloud.coveo.com/push/v1/organizations/org-id/sources/source-id/stream/update?fileId=file_id', // note the last part of the url
|
50
|
+
},
|
51
|
+
])('when using a $builder', ({ builderClass, pushUrl }) => {
|
52
|
+
let strategy;
|
53
|
+
beforeAll(() => {
|
54
|
+
doMockFileContainerResponse();
|
55
|
+
});
|
56
|
+
beforeEach(async () => {
|
57
|
+
const builder = new builderClass('source-id', 'org-id', platformOptions);
|
58
|
+
strategy = new fileContainerStrategy_1.FileContainerStrategy(builder, {
|
59
|
+
headers: {
|
60
|
+
Accept: 'application/json',
|
61
|
+
Authorization: 'Bearer the_key',
|
62
|
+
'Content-Type': 'application/json',
|
63
|
+
},
|
64
|
+
});
|
65
|
+
await strategy.upload(documentBatch);
|
66
|
+
});
|
67
|
+
it('should create a file container', () => {
|
68
|
+
expect(mockedPost).toHaveBeenCalledTimes(1);
|
69
|
+
expect(mockedPost).toHaveBeenCalledWith('https://api.cloud.coveo.com/push/v1/organizations/org-id/files', {}, {
|
70
|
+
headers: {
|
71
|
+
Accept: 'application/json',
|
72
|
+
Authorization: 'Bearer the_key',
|
73
|
+
'Content-Type': 'application/json',
|
74
|
+
},
|
75
|
+
});
|
76
|
+
});
|
77
|
+
it('should call #uploadContentToFileContainer with file container and batch', () => {
|
78
|
+
expect(fileContainer_1.uploadContentToFileContainer).toHaveBeenCalledTimes(1);
|
79
|
+
expect(fileContainer_1.uploadContentToFileContainer).toHaveBeenCalledWith(fileContainerResponse, {
|
80
|
+
addOrUpdate: expect.arrayContaining([
|
81
|
+
expect.objectContaining({
|
82
|
+
uri: 'https://foo.com',
|
83
|
+
}),
|
84
|
+
expect.objectContaining({
|
85
|
+
uri: 'https://bar.com',
|
86
|
+
}),
|
87
|
+
]),
|
88
|
+
delete: [{ deleteChildren: false, documentId: 'some_id' }],
|
89
|
+
});
|
90
|
+
});
|
91
|
+
it('should push file container content', () => {
|
92
|
+
expect(mockedPut).toHaveBeenCalledTimes(1);
|
93
|
+
expect(mockedPut).toHaveBeenCalledWith(pushUrl, {}, {
|
94
|
+
headers: {
|
95
|
+
Accept: 'application/json',
|
96
|
+
Authorization: 'Bearer the_key',
|
97
|
+
'Content-Type': 'application/json',
|
98
|
+
},
|
99
|
+
});
|
100
|
+
});
|
101
|
+
});
|
102
|
+
});
|
103
|
+
//# sourceMappingURL=fileContainerStrategy.spec.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fileContainerStrategy.spec.js","sourceRoot":"","sources":["../../src/uploadStrategy/fileContainerStrategy.spec.ts"],"names":[],"mappings":";;AAAA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACnB,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AAEnC,4DAA8C;AAC9C,iCAA0B;AAC1B,0BAAmC;AACnC,gDAAmD;AACnD,yDAAmE;AACnE,+CAAkE;AAElE,mEAGiC;AAEjC,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,eAAK,CAAC,CAAC;AACvC,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE7B,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,wBAAM,CAAC,EAAE;IACjB,WAAW,EAAE,iCAAmB,CAAC,IAAI;CACtC,CAAC;AAEF,MAAM,aAAa,GAAyB;IAC1C,WAAW,EAAE;QACX,IAAI,mBAAe,CAAC,iBAAiB,EAAE,KAAK,CAAC;QAC7C,IAAI,mBAAe,CAAC,iBAAiB,EAAE,KAAK,CAAC;KAC9C;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAC,CAAC;CACzD,CAAC;AAEF,MAAM,qBA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L,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1,106 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
jest.mock('axios');
|
4
|
+
jest.mock('../help/fileContainer');
|
5
|
+
const platform_client_1 = require("@coveo/platform-client");
|
6
|
+
const __1 = require("..");
|
7
|
+
const axios_1 = require("axios");
|
8
|
+
const environment_1 = require("../environment");
|
9
|
+
const fileContainer_1 = require("../help/fileContainer");
|
10
|
+
const urlUtils_1 = require("../help/urlUtils");
|
11
|
+
const streamChunkStrategy_1 = require("./streamChunkStrategy");
|
12
|
+
const mockedAxios = jest.mocked(axios_1.default);
|
13
|
+
const mockedPost = jest.fn();
|
14
|
+
const platformOptions = {
|
15
|
+
region: platform_client_1.Region.US,
|
16
|
+
environment: environment_1.PlatformEnvironment.Prod,
|
17
|
+
};
|
18
|
+
const documentBatch = {
|
19
|
+
addOrUpdate: [
|
20
|
+
new __1.DocumentBuilder('https://foo.com', 'Foo'),
|
21
|
+
new __1.DocumentBuilder('https://bar.com', 'Bar'),
|
22
|
+
],
|
23
|
+
delete: [{ documentId: 'some_id', deleteChildren: false }],
|
24
|
+
};
|
25
|
+
const fileContainerResponse = {
|
26
|
+
uploadUri: 'https://fake.upload.url',
|
27
|
+
fileId: 'file_id',
|
28
|
+
requiredHeaders: { foo: 'bar' },
|
29
|
+
};
|
30
|
+
const doMockAxios = () => {
|
31
|
+
mockedAxios.post = mockedPost;
|
32
|
+
};
|
33
|
+
const doAxiosMockFileContainerResponse = () => ({
|
34
|
+
data: fileContainerResponse,
|
35
|
+
});
|
36
|
+
const doAxiosMockOpenStream = () => ({
|
37
|
+
data: {
|
38
|
+
streamId: 'the_stream_id',
|
39
|
+
},
|
40
|
+
});
|
41
|
+
const mockSuccessAxiosCalls = () => {
|
42
|
+
mockedPost.mockImplementation((url) => {
|
43
|
+
if (url.match(/chunk/)) {
|
44
|
+
return doAxiosMockFileContainerResponse();
|
45
|
+
}
|
46
|
+
if (url.match(/stream\/open/)) {
|
47
|
+
return doAxiosMockOpenStream();
|
48
|
+
}
|
49
|
+
return { data: {} };
|
50
|
+
});
|
51
|
+
};
|
52
|
+
describe('StreamChunkStrategy', () => {
|
53
|
+
let strategy;
|
54
|
+
beforeAll(() => {
|
55
|
+
doMockAxios();
|
56
|
+
mockSuccessAxiosCalls();
|
57
|
+
});
|
58
|
+
beforeEach(async () => {
|
59
|
+
const builder = new urlUtils_1.StreamUrlBuilder('source-id', 'org-id', platformOptions);
|
60
|
+
strategy = new streamChunkStrategy_1.StreamChunkStrategy(builder, {
|
61
|
+
headers: {
|
62
|
+
Accept: 'application/json',
|
63
|
+
Authorization: 'Bearer the_key',
|
64
|
+
'Content-Type': 'application/json',
|
65
|
+
},
|
66
|
+
});
|
67
|
+
await strategy.preUpload();
|
68
|
+
await strategy.upload(documentBatch);
|
69
|
+
await strategy.postUpload();
|
70
|
+
});
|
71
|
+
it('should make 3 post calls', () => {
|
72
|
+
expect(mockedPost).toBeCalledTimes(3);
|
73
|
+
});
|
74
|
+
it('should open a stream', () => {
|
75
|
+
expect(mockedPost).toHaveBeenNthCalledWith(1, 'https://api.cloud.coveo.com/push/v1/organizations/org-id/sources/source-id/stream/open', {}, {
|
76
|
+
headers: {
|
77
|
+
Accept: 'application/json',
|
78
|
+
Authorization: 'Bearer the_key',
|
79
|
+
'Content-Type': 'application/json',
|
80
|
+
},
|
81
|
+
});
|
82
|
+
});
|
83
|
+
it('should request a stream chunk', () => {
|
84
|
+
expect(mockedPost).toHaveBeenNthCalledWith(2, 'https://api.cloud.coveo.com/push/v1/organizations/org-id/sources/source-id/stream/the_stream_id/chunk', {}, {
|
85
|
+
headers: {
|
86
|
+
Accept: 'application/json',
|
87
|
+
Authorization: 'Bearer the_key',
|
88
|
+
'Content-Type': 'application/json',
|
89
|
+
},
|
90
|
+
});
|
91
|
+
});
|
92
|
+
it('should close the opened stream', () => {
|
93
|
+
expect(mockedPost).toHaveBeenNthCalledWith(3, 'https://api.cloud.coveo.com/push/v1/organizations/org-id/sources/source-id/stream/the_stream_id/close', {}, {
|
94
|
+
headers: {
|
95
|
+
Accept: 'application/json',
|
96
|
+
Authorization: 'Bearer the_key',
|
97
|
+
'Content-Type': 'application/json',
|
98
|
+
},
|
99
|
+
});
|
100
|
+
});
|
101
|
+
it('should call #uploadContentToFileContainer with file container and batch', () => {
|
102
|
+
expect(fileContainer_1.uploadContentToFileContainer).toHaveBeenCalledTimes(1);
|
103
|
+
expect(fileContainer_1.uploadContentToFileContainer).toHaveBeenCalledWith(fileContainerResponse, documentBatch);
|
104
|
+
});
|
105
|
+
});
|
106
|
+
//# sourceMappingURL=streamChunkStrategy.spec.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"streamChunkStrategy.spec.js","sourceRoot":"","sources":["../../src/uploadStrategy/streamChunkStrategy.spec.ts"],"names":[],"mappings":";;AAAA,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACnB,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AAEnC,4DAA8C;AAC9C,0BAAmC;AACnC,iCAA0B;AAC1B,gDAAmD;AACnD,yDAAmE;AACnE,+CAAkD;AAGlD,+DAA0D;AAE1D,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,eAAK,CAAC,CAAC;AACvC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAE7B,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,wBAAM,CAAC,EAAE;IACjB,WAAW,EAAE,iCAAmB,CAAC,IAAI;CACtC,CAAC;AAEF,MAAM,aAAa,GAAyB;IAC1C,WAAW,EAAE;QACX,IAAI,mBAAe,CAAC,iBAAiB,EAAE,KAAK,CAAC;QAC7C,IAAI,mBAAe,CAAC,iBAAiB,EAAE,KAAK,CAAC;KAC9C;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAE,SAAS,EAAE,cAAc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AAC;IAEH,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QACjF,MAAM,CAAC,4CAA4B,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,CAAC,4CAA4B,CAAC,CAAC,oBAAoB,CACvD,qBAAqB,EACrB,aAAa,CACd,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,22 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.generateBatmans = void 0;
|
4
|
-
const batmanCloner = (id) => ({
|
5
|
-
DocumentId: `https://www.themoviedb.org/movie/${id}`,
|
6
|
-
data: 'Batman (1989) \n Based on the Character created by Bob Kane. \n EXT. CITYSCAPE - NIGHT \n Gotham City. The City of Tomorrow: stark angles, creeping shadows, dense, crowded, as if hell had erupted through the sidewalks. A dangling fat moon shines overhead. \n At the opposite corner of the roof, some fifteen yards away... at the end of a line, a STRANGE BLACK SILHOUETTE is dropping slowly, implacably, into frame...',
|
7
|
-
fileExtension: '.txt',
|
8
|
-
title: 'Batman',
|
9
|
-
year: 1989,
|
10
|
-
date: '1989-06-13T12:00:00.000Z',
|
11
|
-
summary: "The Dark Knight of Gotham City begins his war on crime with his first major enemy being the clownishly homicidal Joker, who has seized control of Gotham's underworld.",
|
12
|
-
tagline: 'Have you ever danced with the devil in the pale moonlight?',
|
13
|
-
actors: ['Jack Nicholson', 'Michael Keaton', 'Kim Basinger'],
|
14
|
-
poster: '//image.tmdb.org/t/p/w185_and_h278_bestv2/kBf3g9crrADGMc2AMAMlLBgSm2h.jpg',
|
15
|
-
});
|
16
|
-
const generateBatmans = (batmanCount) => {
|
17
|
-
return Array(batmanCount)
|
18
|
-
.fill(null)
|
19
|
-
.map((_, idx) => batmanCloner(idx));
|
20
|
-
};
|
21
|
-
exports.generateBatmans = generateBatmans;
|
22
|
-
//# sourceMappingURL=documentGenerator.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"documentGenerator.js","sourceRoot":"","sources":["../../../src/__stub__/largeDocuments/documentGenerator.ts"],"names":[],"mappings":";;;AAAA,MAAM,YAAY,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC;IACpC,UAAU,EAAE,oCAAoC,EAAE,EAAE;IACpD,IAAI,EAAE,qaAAqa;IAC3a,aAAa,EAAE,MAAM;IACrB,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,0BAA0B;IAChC,OAAO,EACL,wKAAwK;IAC1K,OAAO,EAAE,4DAA4D;IACrE,MAAM,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,CAAC;IAC5D,MAAM,EACJ,2EAA2E;CAC9E,CAAC,CAAC;AAEI,MAAM,eAAe,GAAG,CAAC,WAAmB,EAAE,EAAE;IACrD,OAAO,KAAK,CAAC,WAAW,CAAC;SACtB,IAAI,CAAC,IAAI,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AAJW,QAAA,eAAe,mBAI1B"}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
export declare const generateBatmans: (batmanCount: number) => {
|
2
|
-
DocumentId: string;
|
3
|
-
data: string;
|
4
|
-
fileExtension: string;
|
5
|
-
title: string;
|
6
|
-
year: number;
|
7
|
-
date: string;
|
8
|
-
summary: string;
|
9
|
-
tagline: string;
|
10
|
-
actors: string[];
|
11
|
-
poster: string;
|
12
|
-
}[];
|
@@ -1,238 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
/* eslint-disable node/no-unpublished-import */
|
4
|
-
jest.mock('@coveo/platform-client');
|
5
|
-
jest.mock('axios');
|
6
|
-
jest.mock('../fieldAnalyser/fieldAnalyser');
|
7
|
-
const platform_client_1 = require("@coveo/platform-client");
|
8
|
-
const axios_1 = require("axios");
|
9
|
-
const path_1 = require("path");
|
10
|
-
const process_1 = require("process");
|
11
|
-
const catalog_1 = require("./catalog");
|
12
|
-
const __1 = require("..");
|
13
|
-
const documentGenerator_1 = require("../__stub__/largeDocuments/documentGenerator");
|
14
|
-
const fs_1 = require("fs");
|
15
|
-
const mockAxios = axios_1.default;
|
16
|
-
const mockedFieldAnalyser = jest.mocked(__1.FieldAnalyser);
|
17
|
-
const mockedPlatformClient = jest.mocked(platform_client_1.default);
|
18
|
-
const mockCreateSource = jest.fn();
|
19
|
-
const mockCreateField = jest.fn();
|
20
|
-
const mockEvaluate = jest.fn();
|
21
|
-
const mockAnalyserAdd = jest.fn();
|
22
|
-
const mockAnalyserReport = jest.fn();
|
23
|
-
const mockedSuccessCallback = jest.fn();
|
24
|
-
const mockedErrorCallback = jest.fn();
|
25
|
-
const pathToStub = (0, path_1.join)((0, process_1.cwd)(), 'src', '__stub__');
|
26
|
-
const expectedDocumentsHeaders = {
|
27
|
-
headers: {
|
28
|
-
Accept: 'application/json',
|
29
|
-
Authorization: 'Bearer the_key',
|
30
|
-
'Content-Type': 'application/json',
|
31
|
-
},
|
32
|
-
};
|
33
|
-
const doAxiosMockFileContainerResponse = () => ({
|
34
|
-
data: {
|
35
|
-
uploadUri: 'https://fake.upload.url',
|
36
|
-
fileId: 'file_id',
|
37
|
-
requiredHeaders: { foo: 'bar' },
|
38
|
-
},
|
39
|
-
});
|
40
|
-
const doAxiosMockOpenStream = () => ({
|
41
|
-
data: {
|
42
|
-
streamId: 'the_stream_id',
|
43
|
-
},
|
44
|
-
});
|
45
|
-
const doMockAxiosPut = () => {
|
46
|
-
mockAxios.put.mockImplementation(() => Promise.resolve());
|
47
|
-
};
|
48
|
-
const doMockPlatformClient = () => {
|
49
|
-
mockedPlatformClient.mockImplementation(() => ({
|
50
|
-
privilegeEvaluator: { evaluate: mockEvaluate },
|
51
|
-
source: {
|
52
|
-
create: mockCreateSource,
|
53
|
-
},
|
54
|
-
field: {
|
55
|
-
createFields: mockCreateField,
|
56
|
-
},
|
57
|
-
}));
|
58
|
-
};
|
59
|
-
const doMockFieldAnalyser = () => {
|
60
|
-
mockedFieldAnalyser.mockImplementation(() => ({
|
61
|
-
add: mockAnalyserAdd,
|
62
|
-
report: mockAnalyserReport,
|
63
|
-
}));
|
64
|
-
};
|
65
|
-
const mockSuccessAxiosCalls = () => {
|
66
|
-
mockAxios.post.mockImplementation((url) => {
|
67
|
-
if (url.match(/chunk/)) {
|
68
|
-
return Promise.resolve(doAxiosMockFileContainerResponse());
|
69
|
-
}
|
70
|
-
if (url.match(/stream\/open/)) {
|
71
|
-
return Promise.resolve(doAxiosMockOpenStream());
|
72
|
-
}
|
73
|
-
return Promise.resolve({ data: {} });
|
74
|
-
});
|
75
|
-
};
|
76
|
-
const mockFailedChunkAxiosCalls = (err) => {
|
77
|
-
mockAxios.post.mockImplementation((url) => {
|
78
|
-
if (url.match(/chunk/)) {
|
79
|
-
return Promise.reject({ message: err });
|
80
|
-
}
|
81
|
-
if (url.match(/stream\/open/)) {
|
82
|
-
return Promise.resolve(doAxiosMockOpenStream());
|
83
|
-
}
|
84
|
-
return Promise.resolve({ data: {} });
|
85
|
-
});
|
86
|
-
};
|
87
|
-
const basicStreamExpectations = () => {
|
88
|
-
it('should open a stream', async () => {
|
89
|
-
expect(mockAxios.post).toHaveBeenNthCalledWith(1, 'https://api.cloud.coveo.com/push/v1/organizations/the_org/sources/the_id/stream/open', {}, expectedDocumentsHeaders);
|
90
|
-
});
|
91
|
-
it('should request a stream chunk', async () => {
|
92
|
-
expect(mockAxios.post).toHaveBeenNthCalledWith(2, 'https://api.cloud.coveo.com/push/v1/organizations/the_org/sources/the_id/stream/the_stream_id/chunk', {}, expectedDocumentsHeaders);
|
93
|
-
});
|
94
|
-
it('should close a stream', async () => {
|
95
|
-
expect(mockAxios.post).toHaveBeenLastCalledWith('https://api.cloud.coveo.com/push/v1/organizations/the_org/sources/the_id/stream/the_stream_id/close', {}, expectedDocumentsHeaders);
|
96
|
-
});
|
97
|
-
};
|
98
|
-
describe('CatalogSource - Stream', () => {
|
99
|
-
let source;
|
100
|
-
beforeAll(() => {
|
101
|
-
doMockPlatformClient();
|
102
|
-
doMockFieldAnalyser();
|
103
|
-
doMockAxiosPut();
|
104
|
-
});
|
105
|
-
beforeEach(() => {
|
106
|
-
mockEvaluate.mockResolvedValue({ approved: true });
|
107
|
-
source = new catalog_1.CatalogSource('the_key', 'the_org');
|
108
|
-
});
|
109
|
-
describe('when streaming data from a batch', () => {
|
110
|
-
beforeEach(async () => {
|
111
|
-
mockSuccessAxiosCalls();
|
112
|
-
await source.batchStreamDocuments('the_id', {
|
113
|
-
addOrUpdate: [new __1.DocumentBuilder('uri', 'title')],
|
114
|
-
delete: [],
|
115
|
-
}, { createFields: false });
|
116
|
-
});
|
117
|
-
afterAll(() => {
|
118
|
-
mockAxios.post.mockReset();
|
119
|
-
});
|
120
|
-
basicStreamExpectations();
|
121
|
-
});
|
122
|
-
describe('when streaming data from a file', () => {
|
123
|
-
beforeEach(async () => {
|
124
|
-
mockSuccessAxiosCalls();
|
125
|
-
await source
|
126
|
-
.batchStreamDocumentsFromFiles('the_id', [(0, path_1.join)(pathToStub, 'mixdocuments')], { createFields: false })
|
127
|
-
.batch();
|
128
|
-
});
|
129
|
-
afterAll(() => {
|
130
|
-
mockAxios.post.mockReset();
|
131
|
-
});
|
132
|
-
basicStreamExpectations();
|
133
|
-
it('should upload content to stream chunk', async () => {
|
134
|
-
expect(mockAxios.put).toHaveBeenCalledWith('https://fake.upload.url/', expect.objectContaining({
|
135
|
-
addOrUpdate: expect.arrayContaining([
|
136
|
-
expect.objectContaining({
|
137
|
-
documentId: 'https://www.themoviedb.org/movie/268',
|
138
|
-
}),
|
139
|
-
expect.objectContaining({
|
140
|
-
documentId: 'https://www.themoviedb.org/movie/999',
|
141
|
-
}),
|
142
|
-
]),
|
143
|
-
delete: expect.arrayContaining([]),
|
144
|
-
}), {
|
145
|
-
headers: {
|
146
|
-
foo: 'bar',
|
147
|
-
},
|
148
|
-
maxBodyLength: 256e6,
|
149
|
-
});
|
150
|
-
});
|
151
|
-
});
|
152
|
-
describe('when streaming large amount of data', () => {
|
153
|
-
beforeAll(() => {
|
154
|
-
(0, fs_1.mkdirSync)((0, path_1.join)(pathToStub, 'batman_temp_dir'));
|
155
|
-
(0, fs_1.writeFileSync)((0, path_1.join)(pathToStub, 'batman_temp_dir', 'mucho_batmans.json'), JSON.stringify((0, documentGenerator_1.generateBatmans)(10e3), null, 2) // Enough batmans so they can be sent in multiple chunks
|
156
|
-
);
|
157
|
-
});
|
158
|
-
beforeEach(async () => {
|
159
|
-
mockSuccessAxiosCalls();
|
160
|
-
await source
|
161
|
-
.batchStreamDocumentsFromFiles('the_id', [(0, path_1.join)(pathToStub, 'batman_temp_dir', 'mucho_batmans.json')], { createFields: false })
|
162
|
-
.batch();
|
163
|
-
});
|
164
|
-
afterAll(() => {
|
165
|
-
(0, fs_1.rmSync)((0, path_1.join)(pathToStub, 'batman_temp_dir'), {
|
166
|
-
recursive: true,
|
167
|
-
});
|
168
|
-
mockAxios.post.mockReset();
|
169
|
-
});
|
170
|
-
basicStreamExpectations();
|
171
|
-
});
|
172
|
-
describe('when streaming data from local files', () => {
|
173
|
-
beforeEach(async () => {
|
174
|
-
mockSuccessAxiosCalls();
|
175
|
-
});
|
176
|
-
afterAll(() => {
|
177
|
-
mockAxios.post.mockReset();
|
178
|
-
});
|
179
|
-
describe('API call expectations', () => {
|
180
|
-
beforeEach(async () => {
|
181
|
-
mockSuccessAxiosCalls();
|
182
|
-
await source
|
183
|
-
.batchStreamDocumentsFromFiles('the_id', [(0, path_1.join)(pathToStub, 'mixdocuments')], { createFields: false })
|
184
|
-
.batch();
|
185
|
-
});
|
186
|
-
basicStreamExpectations();
|
187
|
-
it('should upload documents from local file', async () => {
|
188
|
-
expect(mockAxios.put).toHaveBeenCalledWith('https://fake.upload.url/', expect.objectContaining({
|
189
|
-
addOrUpdate: expect.arrayContaining([
|
190
|
-
expect.objectContaining({
|
191
|
-
documentId: 'https://www.themoviedb.org/movie/268',
|
192
|
-
}),
|
193
|
-
expect.objectContaining({
|
194
|
-
documentId: 'https://www.themoviedb.org/movie/999',
|
195
|
-
}),
|
196
|
-
]),
|
197
|
-
delete: expect.arrayContaining([]),
|
198
|
-
}), {
|
199
|
-
headers: {
|
200
|
-
foo: 'bar',
|
201
|
-
},
|
202
|
-
maxBodyLength: 256e6,
|
203
|
-
});
|
204
|
-
});
|
205
|
-
});
|
206
|
-
it('should call the callback without error when uploading documents', async () => {
|
207
|
-
await source
|
208
|
-
.batchStreamDocumentsFromFiles('the_id', [(0, path_1.join)(pathToStub, 'mixdocuments')], { createFields: false })
|
209
|
-
.onBatchError(mockedErrorCallback)
|
210
|
-
.batch();
|
211
|
-
expect(mockedErrorCallback).not.toHaveBeenCalled();
|
212
|
-
});
|
213
|
-
it('should only push JSON files', async () => {
|
214
|
-
await source
|
215
|
-
.batchStreamDocumentsFromFiles('the_id', [(0, path_1.join)(pathToStub, 'mixdocuments')], { createFields: false })
|
216
|
-
.onBatchUpload(mockedSuccessCallback)
|
217
|
-
.batch();
|
218
|
-
expect(mockedSuccessCallback).toHaveBeenCalledWith(expect.objectContaining({ files: ['valid.json'] }));
|
219
|
-
});
|
220
|
-
it('should call the errorCallback on a failure from the API', async () => {
|
221
|
-
mockAxios.post.mockReset();
|
222
|
-
mockFailedChunkAxiosCalls('Error Message');
|
223
|
-
await source
|
224
|
-
.batchStreamDocumentsFromFiles('the_id', [(0, path_1.join)(pathToStub, 'mixdocuments')], { createFields: false })
|
225
|
-
.onBatchError(mockedErrorCallback)
|
226
|
-
.batch();
|
227
|
-
expect(mockedErrorCallback).toHaveBeenCalledWith({
|
228
|
-
message: 'Error Message',
|
229
|
-
}, expect.anything());
|
230
|
-
});
|
231
|
-
it('should throw an error if the path is invalid', () => {
|
232
|
-
expect(() => source
|
233
|
-
.batchStreamDocumentsFromFiles('the_id', ['path/to/invalid/document'], { createFields: false })
|
234
|
-
.batch()).rejects.toThrow("no such file or directory, lstat 'path/to/invalid/document'");
|
235
|
-
});
|
236
|
-
});
|
237
|
-
});
|
238
|
-
//# sourceMappingURL=catalog.stream.spec.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"catalog.stream.spec.js","sourceRoot":"","sources":["../../src/source/catalog.stream.spec.ts"],"names":[],"mappings":";;AAAA,+CAA+C;AAC/C,IAAI,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AACpC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACnB,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;AAC5C,4DAAoD;AACpD,iCAA0B;AAC1B,+BAA0B;AAC1B,qCAA4B;AAC5B,uCAAwC;AACxC,0BAAkD;AAClD,oFAA6E;AAC7E,2BAAoD;AACpD,MAAM,SAAS,GAAG,eAAkC,CAAC;AAErD,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAa,CAAC,CAAC;AACvD,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,yBAAc,CAAC,CAAC;AACzD,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACnC,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAClC,MAAM,YAAY,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAC/B,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAClC,MAAM,kBAAkB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACrC,MAAM,qBAAqB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACxC,MAAM,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACtC,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,IAAA,aAAG,GAAE,EAAE,KAAK,EAAE,UAAU,CAAC,CA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