@coveo/push-api-client 3.0.116 → 3.0.122
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/APICore.js +47 -47
- package/dist/APICore.js.map +1 -1
- package/dist/definitions/APICore.d.ts +18 -18
- package/dist/definitions/document.d.ts +124 -124
- package/dist/definitions/documentBuilder.d.ts +168 -168
- package/dist/definitions/documentBuilder.spec.d.ts +1 -1
- package/dist/definitions/environment.d.ts +16 -16
- package/dist/definitions/errors/baseError.d.ts +4 -4
- package/dist/definitions/errors/fieldErrors.d.ts +18 -18
- package/dist/definitions/errors/index.d.ts +3 -3
- package/dist/definitions/errors/privilegeError.d.ts +6 -6
- package/dist/definitions/errors/validatorErrors.d.ts +20 -20
- package/dist/definitions/fieldAnalyser/fieldAnalyser.d.ts +36 -36
- package/dist/definitions/fieldAnalyser/fieldAnalyser.spec.d.ts +1 -1
- package/dist/definitions/fieldAnalyser/fieldStore.d.ts +5 -5
- package/dist/definitions/fieldAnalyser/fieldUtils.d.ts +6 -6
- package/dist/definitions/fieldAnalyser/fieldsUtils.spec.d.ts +1 -1
- package/dist/definitions/fieldAnalyser/inconsistencies.d.ts +5 -5
- package/dist/definitions/fieldAnalyser/inconsistencies.spec.d.ts +1 -1
- package/dist/definitions/fieldAnalyser/typeUtils.d.ts +3 -3
- package/dist/definitions/fieldAnalyser/typeUtils.spec.d.ts +1 -1
- package/dist/definitions/help/file.d.ts +3 -3
- package/dist/definitions/help/file.spec.d.ts +1 -1
- package/dist/definitions/help/fileConsumer.d.ts +31 -31
- package/dist/definitions/help/fileConsumer.spec.d.ts +1 -1
- package/dist/definitions/help/fileContainer.d.ts +8 -8
- package/dist/definitions/help/fileContainer.spec.d.ts +1 -1
- package/dist/definitions/help/function.d.ts +1 -1
- package/dist/definitions/help/generator.d.ts +11 -11
- package/dist/definitions/help/generator.spec.d.ts +1 -1
- package/dist/definitions/help/urlUtils.d.ts +27 -27
- package/dist/definitions/help/urlUtils.spec.d.ts +1 -1
- package/dist/definitions/index.d.ts +14 -14
- package/dist/definitions/interfaces.d.ts +70 -70
- package/dist/definitions/localtest.d.ts +1 -1
- package/dist/definitions/permissionSetBuilder.d.ts +34 -34
- package/dist/definitions/permissionSetBuilder.spec.d.ts +1 -1
- package/dist/definitions/securityIdentityBuilder.d.ts +105 -105
- package/dist/definitions/securityIdentityBuilder.spec.d.ts +1 -1
- package/dist/definitions/source/batchUploadDocumentsFromFile.d.ts +11 -11
- package/dist/definitions/source/batchUploadDocumentsFromFile.spec.d.ts +1 -1
- package/dist/definitions/source/catalog.d.ts +70 -70
- package/dist/definitions/source/catalog.spec.d.ts +1 -1
- package/dist/definitions/source/documentUploader.d.ts +11 -11
- package/dist/definitions/source/documentUploader.spec.d.ts +1 -1
- package/dist/definitions/source/push.d.ts +87 -87
- package/dist/definitions/source/push.spec.d.ts +1 -1
- package/dist/definitions/source/securityIdenty.d.ts +43 -43
- package/dist/definitions/uploadStrategy/fileContainerStrategy.d.ts +23 -23
- package/dist/definitions/uploadStrategy/fileContainerStrategy.spec.d.ts +1 -1
- package/dist/definitions/uploadStrategy/index.d.ts +3 -3
- package/dist/definitions/uploadStrategy/strategy.d.ts +23 -23
- package/dist/definitions/uploadStrategy/streamChunkStrategy.d.ts +28 -28
- package/dist/definitions/uploadStrategy/streamChunkStrategy.spec.d.ts +1 -1
- package/dist/definitions/validation/caseInsensitiveDocument.d.ts +13 -13
- package/dist/definitions/validation/knownKey.d.ts +10 -10
- package/dist/definitions/validation/parseFile.d.ts +4 -4
- package/dist/definitions/validation/parseFile.spec.d.ts +1 -1
- package/dist/definitions/validation/parsePermissions.d.ts +5 -5
- package/dist/definitions/validation/parsePermissions.spec.d.ts +1 -1
- package/dist/definitions/validation/preconditions/apiKeyPrivilege.d.ts +3 -3
- package/dist/definitions/validation/preconditions/apiKeyPrivilege.spec.d.ts +1 -1
- package/dist/definitions/validation/preconditions/platformPrivilege.d.ts +7 -7
- package/dist/definitions/validation/requiredKeyValidator.d.ts +17 -17
- package/dist/definitions/validation/transformers/transformer.d.ts +31 -31
- package/dist/definitions/validation/transformers/transformer.spec.d.ts +1 -1
- package/dist/document.js +2 -2
- package/dist/documentBuilder.js +292 -292
- package/dist/documentBuilder.spec.js +191 -191
- package/dist/environment.js +41 -41
- package/dist/errors/baseError.js +10 -10
- package/dist/errors/fieldErrors.js +42 -42
- package/dist/errors/index.js +19 -19
- package/dist/errors/privilegeError.js +12 -12
- package/dist/errors/validatorErrors.js +40 -40
- package/dist/fieldAnalyser/fieldAnalyser.js +95 -95
- package/dist/fieldAnalyser/fieldAnalyser.spec.js +230 -230
- package/dist/fieldAnalyser/fieldStore.js +21 -21
- package/dist/fieldAnalyser/fieldUtils.js +41 -41
- package/dist/fieldAnalyser/fieldsUtils.spec.js +116 -116
- package/dist/fieldAnalyser/inconsistencies.js +14 -14
- package/dist/fieldAnalyser/inconsistencies.spec.js +40 -40
- package/dist/fieldAnalyser/typeUtils.js +61 -61
- package/dist/fieldAnalyser/typeUtils.spec.js +142 -142
- package/dist/help/file.js +37 -37
- package/dist/help/file.spec.js +67 -67
- package/dist/help/fileConsumer.js +150 -150
- package/dist/help/fileConsumer.spec.js +153 -153
- package/dist/help/fileContainer.js +48 -48
- package/dist/help/fileContainer.spec.js +65 -65
- package/dist/help/function.js +5 -5
- package/dist/help/generator.js +32 -32
- package/dist/help/generator.spec.js +82 -82
- package/dist/help/urlUtils.js +42 -42
- package/dist/help/urlUtils.spec.js +41 -41
- package/dist/index.js +38 -38
- package/dist/interfaces.js +2 -2
- package/dist/localtest.js +55 -55
- package/dist/permissionSetBuilder.js +58 -58
- package/dist/permissionSetBuilder.spec.js +68 -68
- package/dist/securityIdentityBuilder.js +128 -128
- package/dist/securityIdentityBuilder.spec.js +50 -50
- package/dist/source/batchUploadDocumentsFromFile.js +46 -46
- package/dist/source/batchUploadDocumentsFromFile.spec.js +145 -145
- package/dist/source/catalog.js +111 -111
- package/dist/source/catalog.spec.js +64 -64
- package/dist/source/documentUploader.js +45 -45
- package/dist/source/documentUploader.spec.js +118 -118
- package/dist/source/push.js +140 -140
- package/dist/source/push.spec.js +152 -152
- package/dist/source/securityIdenty.js +57 -57
- package/dist/uploadStrategy/fileContainerStrategy.js +32 -32
- package/dist/uploadStrategy/fileContainerStrategy.spec.js +86 -86
- package/dist/uploadStrategy/index.js +19 -19
- package/dist/uploadStrategy/strategy.js +2 -2
- package/dist/uploadStrategy/streamChunkStrategy.js +52 -52
- package/dist/uploadStrategy/streamChunkStrategy.spec.js +77 -77
- package/dist/validation/caseInsensitiveDocument.js +31 -31
- package/dist/validation/knownKey.js +37 -37
- package/dist/validation/parseFile.js +120 -120
- package/dist/validation/parseFile.spec.js +96 -96
- package/dist/validation/parsePermissions.js +118 -118
- package/dist/validation/parsePermissions.spec.js +86 -86
- package/dist/validation/preconditions/apiKeyPrivilege.js +20 -20
- package/dist/validation/preconditions/apiKeyPrivilege.spec.js +66 -66
- package/dist/validation/preconditions/platformPrivilege.js +32 -32
- package/dist/validation/requiredKeyValidator.js +61 -61
- package/dist/validation/transformers/transformer.js +51 -51
- package/dist/validation/transformers/transformer.spec.js +21 -21
- package/package.json +11 -11
@@ -1,11 +1,11 @@
|
|
1
|
-
import PlatformClient from '@coveo/platform-client';
|
2
|
-
import { BatchUpdateDocumentsFromFiles, FailedUploadCallback, SuccessfulUploadCallback } from '../index';
|
3
|
-
import type { UploadStrategy } from '../uploadStrategy';
|
4
|
-
export declare class BatchUploadDocumentsFromFilesReturn {
|
5
|
-
private internalPromise;
|
6
|
-
private consumer;
|
7
|
-
constructor(platformClient: PlatformClient, strategy: UploadStrategy, filesOrDirectories: string[], options: Required<BatchUpdateDocumentsFromFiles>);
|
8
|
-
onBatchUpload(cb: SuccessfulUploadCallback): this;
|
9
|
-
onBatchError(cb: FailedUploadCallback): this;
|
10
|
-
batch(): Promise<void>;
|
11
|
-
}
|
1
|
+
import PlatformClient from '@coveo/platform-client';
|
2
|
+
import { BatchUpdateDocumentsFromFiles, FailedUploadCallback, SuccessfulUploadCallback } from '../index';
|
3
|
+
import type { UploadStrategy } from '../uploadStrategy';
|
4
|
+
export declare class BatchUploadDocumentsFromFilesReturn {
|
5
|
+
private internalPromise;
|
6
|
+
private consumer;
|
7
|
+
constructor(platformClient: PlatformClient, strategy: UploadStrategy, filesOrDirectories: string[], options: Required<BatchUpdateDocumentsFromFiles>);
|
8
|
+
onBatchUpload(cb: SuccessfulUploadCallback): this;
|
9
|
+
onBatchError(cb: FailedUploadCallback): this;
|
10
|
+
batch(): Promise<void>;
|
11
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,70 +1,70 @@
|
|
1
|
-
import 'fetch-undici-polyfill';
|
2
|
-
import { SourceVisibility } from '@coveo/platform-client';
|
3
|
-
import { PlatformUrlOptions } from '../environment';
|
4
|
-
import { SecurityIdentity } from './securityIdenty';
|
5
|
-
import { BatchUpdateDocuments, BatchUpdateDocumentsFromFiles, BatchUpdateDocumentsOptions } from '../interfaces';
|
6
|
-
/**
|
7
|
-
* Manage a catalog source.
|
8
|
-
*
|
9
|
-
* Allows you to create a new catalog source, manage security identities and documents in a Coveo organization.
|
10
|
-
*/
|
11
|
-
export declare class CatalogSource {
|
12
|
-
private apikey;
|
13
|
-
private organizationid;
|
14
|
-
private platformClient;
|
15
|
-
private api;
|
16
|
-
private options;
|
17
|
-
private static defaultOptions;
|
18
|
-
/**
|
19
|
-
* Creates an instance of CatalogSource.
|
20
|
-
* @param {string} apikey An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).
|
21
|
-
* @param {string} organizationid The Coveo Organization identifier.
|
22
|
-
* @param {PlatformUrlOptions} [opts=CatalogSource.defaultOptions]
|
23
|
-
*/
|
24
|
-
constructor(apikey: string, organizationid: string, opts?: PlatformUrlOptions);
|
25
|
-
/**
|
26
|
-
* Create a new catalog source
|
27
|
-
* @param name The name of the source to create.
|
28
|
-
* @param sourceVisibility The security option that should be applied to the content of the source. See [Content Security](https://docs.coveo.com/en/1779).
|
29
|
-
* @returns
|
30
|
-
*/
|
31
|
-
create(name: string, sourceVisibility: SourceVisibility): Promise<{
|
32
|
-
id: string;
|
33
|
-
}>;
|
34
|
-
get identity(): SecurityIdentity;
|
35
|
-
/**
|
36
|
-
* Manage batches of items in a catalog source.
|
37
|
-
* See [Full Document Update](https://docs.coveo.com/en/l62e0540)
|
38
|
-
* @param sourceId
|
39
|
-
* @param batch
|
40
|
-
* @param {BatchUpdateDocumentsOptions}
|
41
|
-
* @returns
|
42
|
-
*/
|
43
|
-
batchUpdateDocuments(sourceId: string, batch: BatchUpdateDocuments, options?: BatchUpdateDocumentsOptions): Promise<import("undici").Response>;
|
44
|
-
/**
|
45
|
-
* Send your catalog data to your catalog source.
|
46
|
-
* See [How to Stream Your Catalog Data to Your Source](https://docs.coveo.com/en/lb4a0344)
|
47
|
-
* @param {string} sourceId
|
48
|
-
* @param {BatchUpdateDocuments} batch
|
49
|
-
* @param {BatchUpdateDocumentsOptions}
|
50
|
-
*/
|
51
|
-
batchStreamDocuments(sourceId: string, batch: BatchUpdateDocuments, options?: BatchUpdateDocumentsOptions): Promise<void>;
|
52
|
-
/**
|
53
|
-
* Manage batches of items in a catalog source from a list of JSON files. See [Full Document Update Source](https://docs.coveo.com/en/l62e0540)
|
54
|
-
* @param {string} sourceId The unique identifier of the target Push source
|
55
|
-
* @param {string[]} filesOrDirectories A list of JSON files or directories (containing JSON files) from which to extract documents.
|
56
|
-
* @param {BatchUpdateDocumentsFromFiles} options
|
57
|
-
*/
|
58
|
-
batchUpdateDocumentsFromFiles(sourceId: string, filesOrDirectories: string[], options?: BatchUpdateDocumentsFromFiles): import("./batchUploadDocumentsFromFile").BatchUploadDocumentsFromFilesReturn;
|
59
|
-
/**
|
60
|
-
* Send your catalog data to your catalog source from a list of JSON files.
|
61
|
-
* See [How to Stream Your Catalog Data to Your Source](https://docs.coveo.com/en/lb4a0344)
|
62
|
-
* @param {string} sourceId The unique identifier of the target Push source
|
63
|
-
* @param {string[]} filesOrDirectories A list of JSON files or directories (containing JSON files) from which to extract documents.
|
64
|
-
* @param {BatchUpdateDocumentsFromFiles} [options]
|
65
|
-
*/
|
66
|
-
batchStreamDocumentsFromFiles(sourceId: string, filesOrDirectories: string[], options?: BatchUpdateDocumentsFromFiles): import("./batchUploadDocumentsFromFile").BatchUploadDocumentsFromFilesReturn;
|
67
|
-
private urlBuilder;
|
68
|
-
private fileContainerStrategy;
|
69
|
-
private streamChunkStrategy;
|
70
|
-
}
|
1
|
+
import 'fetch-undici-polyfill';
|
2
|
+
import { SourceVisibility } from '@coveo/platform-client';
|
3
|
+
import { PlatformUrlOptions } from '../environment';
|
4
|
+
import { SecurityIdentity } from './securityIdenty';
|
5
|
+
import { BatchUpdateDocuments, BatchUpdateDocumentsFromFiles, BatchUpdateDocumentsOptions } from '../interfaces';
|
6
|
+
/**
|
7
|
+
* Manage a catalog source.
|
8
|
+
*
|
9
|
+
* Allows you to create a new catalog source, manage security identities and documents in a Coveo organization.
|
10
|
+
*/
|
11
|
+
export declare class CatalogSource {
|
12
|
+
private apikey;
|
13
|
+
private organizationid;
|
14
|
+
private platformClient;
|
15
|
+
private api;
|
16
|
+
private options;
|
17
|
+
private static defaultOptions;
|
18
|
+
/**
|
19
|
+
* Creates an instance of CatalogSource.
|
20
|
+
* @param {string} apikey An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).
|
21
|
+
* @param {string} organizationid The Coveo Organization identifier.
|
22
|
+
* @param {PlatformUrlOptions} [opts=CatalogSource.defaultOptions]
|
23
|
+
*/
|
24
|
+
constructor(apikey: string, organizationid: string, opts?: PlatformUrlOptions);
|
25
|
+
/**
|
26
|
+
* Create a new catalog source
|
27
|
+
* @param name The name of the source to create.
|
28
|
+
* @param sourceVisibility The security option that should be applied to the content of the source. See [Content Security](https://docs.coveo.com/en/1779).
|
29
|
+
* @returns
|
30
|
+
*/
|
31
|
+
create(name: string, sourceVisibility: SourceVisibility): Promise<{
|
32
|
+
id: string;
|
33
|
+
}>;
|
34
|
+
get identity(): SecurityIdentity;
|
35
|
+
/**
|
36
|
+
* Manage batches of items in a catalog source.
|
37
|
+
* See [Full Document Update](https://docs.coveo.com/en/l62e0540)
|
38
|
+
* @param sourceId
|
39
|
+
* @param batch
|
40
|
+
* @param {BatchUpdateDocumentsOptions}
|
41
|
+
* @returns
|
42
|
+
*/
|
43
|
+
batchUpdateDocuments(sourceId: string, batch: BatchUpdateDocuments, options?: BatchUpdateDocumentsOptions): Promise<import("undici").Response>;
|
44
|
+
/**
|
45
|
+
* Send your catalog data to your catalog source.
|
46
|
+
* See [How to Stream Your Catalog Data to Your Source](https://docs.coveo.com/en/lb4a0344)
|
47
|
+
* @param {string} sourceId
|
48
|
+
* @param {BatchUpdateDocuments} batch
|
49
|
+
* @param {BatchUpdateDocumentsOptions}
|
50
|
+
*/
|
51
|
+
batchStreamDocuments(sourceId: string, batch: BatchUpdateDocuments, options?: BatchUpdateDocumentsOptions): Promise<void>;
|
52
|
+
/**
|
53
|
+
* Manage batches of items in a catalog source from a list of JSON files. See [Full Document Update Source](https://docs.coveo.com/en/l62e0540)
|
54
|
+
* @param {string} sourceId The unique identifier of the target Push source
|
55
|
+
* @param {string[]} filesOrDirectories A list of JSON files or directories (containing JSON files) from which to extract documents.
|
56
|
+
* @param {BatchUpdateDocumentsFromFiles} options
|
57
|
+
*/
|
58
|
+
batchUpdateDocumentsFromFiles(sourceId: string, filesOrDirectories: string[], options?: BatchUpdateDocumentsFromFiles): import("./batchUploadDocumentsFromFile").BatchUploadDocumentsFromFilesReturn;
|
59
|
+
/**
|
60
|
+
* Send your catalog data to your catalog source from a list of JSON files.
|
61
|
+
* See [How to Stream Your Catalog Data to Your Source](https://docs.coveo.com/en/lb4a0344)
|
62
|
+
* @param {string} sourceId The unique identifier of the target Push source
|
63
|
+
* @param {string[]} filesOrDirectories A list of JSON files or directories (containing JSON files) from which to extract documents.
|
64
|
+
* @param {BatchUpdateDocumentsFromFiles} [options]
|
65
|
+
*/
|
66
|
+
batchStreamDocumentsFromFiles(sourceId: string, filesOrDirectories: string[], options?: BatchUpdateDocumentsFromFiles): import("./batchUploadDocumentsFromFile").BatchUploadDocumentsFromFilesReturn;
|
67
|
+
private urlBuilder;
|
68
|
+
private fileContainerStrategy;
|
69
|
+
private streamChunkStrategy;
|
70
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,11 +1,11 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import PlatformClient from '@coveo/platform-client';
|
3
|
-
import type { Response } from 'undici';
|
4
|
-
import { APICore } from '../APICore';
|
5
|
-
import { DocumentBuilder } from '../documentBuilder';
|
6
|
-
import { BatchUpdateDocuments, BatchUpdateDocumentsFromFiles, BatchUpdateDocumentsOptions } from '../interfaces';
|
7
|
-
import { UploadStrategy } from '../uploadStrategy';
|
8
|
-
import { BatchUploadDocumentsFromFilesReturn } from './batchUploadDocumentsFromFile';
|
9
|
-
export declare function uploadDocument(platformClient: PlatformClient, docBuilder: DocumentBuilder, addURL: URL, api: APICore, options?: BatchUpdateDocumentsOptions): Promise<Response>;
|
10
|
-
export declare function uploadBatch(platformClient: PlatformClient, strategy: UploadStrategy, batch: BatchUpdateDocuments, options?: BatchUpdateDocumentsOptions): Promise<Response>;
|
11
|
-
export declare function uploadBatchFromFile(platformClient: PlatformClient, strategy: UploadStrategy, filesOrDirectories: string[], options?: BatchUpdateDocumentsFromFiles): BatchUploadDocumentsFromFilesReturn;
|
1
|
+
/// <reference types="node" />
|
2
|
+
import PlatformClient from '@coveo/platform-client';
|
3
|
+
import type { Response } from 'undici';
|
4
|
+
import { APICore } from '../APICore';
|
5
|
+
import { DocumentBuilder } from '../documentBuilder';
|
6
|
+
import { BatchUpdateDocuments, BatchUpdateDocumentsFromFiles, BatchUpdateDocumentsOptions } from '../interfaces';
|
7
|
+
import { UploadStrategy } from '../uploadStrategy';
|
8
|
+
import { BatchUploadDocumentsFromFilesReturn } from './batchUploadDocumentsFromFile';
|
9
|
+
export declare function uploadDocument(platformClient: PlatformClient, docBuilder: DocumentBuilder, addURL: URL, api: APICore, options?: BatchUpdateDocumentsOptions): Promise<Response>;
|
10
|
+
export declare function uploadBatch(platformClient: PlatformClient, strategy: UploadStrategy, batch: BatchUpdateDocuments, options?: BatchUpdateDocumentsOptions): Promise<Response>;
|
11
|
+
export declare function uploadBatchFromFile(platformClient: PlatformClient, strategy: UploadStrategy, filesOrDirectories: string[], options?: BatchUpdateDocumentsFromFiles): BatchUploadDocumentsFromFilesReturn;
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,87 +1,87 @@
|
|
1
|
-
import 'fetch-undici-polyfill';
|
2
|
-
import { PlatformClient, SourceVisibility } from '@coveo/platform-client';
|
3
|
-
export { SourceVisibility } from '@coveo/platform-client';
|
4
|
-
import { DocumentBuilder } from '../documentBuilder';
|
5
|
-
import { PlatformUrlOptions } from '../environment';
|
6
|
-
import { FieldAnalyser } from '../fieldAnalyser/fieldAnalyser';
|
7
|
-
import { SecurityIdentity } from './securityIdenty';
|
8
|
-
import { BatchUpdateDocuments, BatchUpdateDocumentsFromFiles, BatchUpdateDocumentsOptions } from '../interfaces';
|
9
|
-
export type SourceStatus = 'REBUILD' | 'REFRESH' | 'INCREMENTAL' | 'IDLE';
|
10
|
-
/**
|
11
|
-
* Manage a push source.
|
12
|
-
*
|
13
|
-
* Allows you to create a new push source, manage security identities and documents in a Coveo organization.
|
14
|
-
*/
|
15
|
-
export declare class PushSource {
|
16
|
-
private apikey;
|
17
|
-
private organizationid;
|
18
|
-
platformClient: PlatformClient;
|
19
|
-
private api;
|
20
|
-
private options;
|
21
|
-
private static defaultOptions;
|
22
|
-
/**
|
23
|
-
*
|
24
|
-
* @param apikey An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).
|
25
|
-
* @param organizationid The Coveo Organization identifier.
|
26
|
-
*/
|
27
|
-
constructor(apikey: string, organizationid: string, options?: PlatformUrlOptions);
|
28
|
-
/**
|
29
|
-
* Create a new push source
|
30
|
-
* @param name The name of the source to create.
|
31
|
-
* @param sourceVisibility The security option that should be applied to the content of the source. See [Content Security](https://docs.coveo.com/en/1779).
|
32
|
-
* @returns
|
33
|
-
*/
|
34
|
-
create(name: string, sourceVisibility: SourceVisibility): Promise<{
|
35
|
-
id: string;
|
36
|
-
}>;
|
37
|
-
get identity(): SecurityIdentity;
|
38
|
-
/**
|
39
|
-
* Adds or updates an individual item in a push source. See [Adding a Single Item in a Push Source](https://docs.coveo.com/en/133).
|
40
|
-
* @param sourceID
|
41
|
-
* @param docBuilder
|
42
|
-
* @param {BatchUpdateDocumentsOptions}
|
43
|
-
* @returns
|
44
|
-
*/
|
45
|
-
addOrUpdateDocument(sourceID: string, docBuilder: DocumentBuilder, options?: BatchUpdateDocumentsOptions): Promise<import("undici").Response>;
|
46
|
-
/**
|
47
|
-
* Manage batches of items in a push source. See [Manage Batches of Items in a Push Source](https://docs.coveo.com/en/90)
|
48
|
-
* @param sourceID
|
49
|
-
* @param batch
|
50
|
-
* @returns
|
51
|
-
*/
|
52
|
-
batchUpdateDocuments(sourceID: string, batch: BatchUpdateDocuments, options?: BatchUpdateDocumentsOptions): Promise<import("undici").Response>;
|
53
|
-
/**
|
54
|
-
*
|
55
|
-
* Manage batches of items in a push source from a list of JSON files. See [Manage Batches of Items in a Push Source](https://docs.coveo.com/en/90)
|
56
|
-
* @param {string} sourceID The unique identifier of the target Push source
|
57
|
-
* @param {string[]} filesOrDirectories A list of JSON files or directories (containing JSON files) from which to extract documents.
|
58
|
-
* @param {UploadBatchCallback} callback Callback executed when a batch of documents is either successfully uploaded or when an error occurs during the upload
|
59
|
-
* @param {BatchUpdateDocumentsFromFiles} options
|
60
|
-
*/
|
61
|
-
batchUpdateDocumentsFromFiles(sourceID: string, filesOrDirectories: string[], options?: BatchUpdateDocumentsFromFiles): import("./batchUploadDocumentsFromFile").BatchUploadDocumentsFromFilesReturn;
|
62
|
-
/**
|
63
|
-
* Deletes a specific item from a Push source. Optionally, the child items of that item can also be deleted. See [Deleting an Item in a Push Source](https://docs.coveo.com/en/171).
|
64
|
-
* @param sourceID
|
65
|
-
* @param documentId
|
66
|
-
* @param deleteChildren
|
67
|
-
* @returns
|
68
|
-
*/
|
69
|
-
deleteDocument(sourceID: string, documentId: string, deleteChildren?: boolean): Promise<import("undici").Response>;
|
70
|
-
/**
|
71
|
-
* Deletes all items whose last update was made by a Push API operation whose orderingId is strictly lower than a specified value. See [Deleting Old Items in a Push Source](https://docs.coveo.com/en/131).
|
72
|
-
* @param sourceID
|
73
|
-
* @param olderThan
|
74
|
-
* @returns
|
75
|
-
*/
|
76
|
-
deleteDocumentsOlderThan(sourceID: string, olderThan: Date | string | number): Promise<import("undici").Response>;
|
77
|
-
/**
|
78
|
-
* Set the status of a push source. See [Updating the Status of a Push Source](https://docs.coveo.com/en/35/)
|
79
|
-
* @param sourceID
|
80
|
-
* @param status
|
81
|
-
* @returns {Promise<void>}
|
82
|
-
*/
|
83
|
-
setSourceStatus(sourceID: string, status: SourceStatus): Promise<void>;
|
84
|
-
createFields(analyser: FieldAnalyser): Promise<void>;
|
85
|
-
private urlBuilder;
|
86
|
-
private fileContainerStrategy;
|
87
|
-
}
|
1
|
+
import 'fetch-undici-polyfill';
|
2
|
+
import { PlatformClient, SourceVisibility } from '@coveo/platform-client';
|
3
|
+
export { SourceVisibility } from '@coveo/platform-client';
|
4
|
+
import { DocumentBuilder } from '../documentBuilder';
|
5
|
+
import { PlatformUrlOptions } from '../environment';
|
6
|
+
import { FieldAnalyser } from '../fieldAnalyser/fieldAnalyser';
|
7
|
+
import { SecurityIdentity } from './securityIdenty';
|
8
|
+
import { BatchUpdateDocuments, BatchUpdateDocumentsFromFiles, BatchUpdateDocumentsOptions } from '../interfaces';
|
9
|
+
export type SourceStatus = 'REBUILD' | 'REFRESH' | 'INCREMENTAL' | 'IDLE';
|
10
|
+
/**
|
11
|
+
* Manage a push source.
|
12
|
+
*
|
13
|
+
* Allows you to create a new push source, manage security identities and documents in a Coveo organization.
|
14
|
+
*/
|
15
|
+
export declare class PushSource {
|
16
|
+
private apikey;
|
17
|
+
private organizationid;
|
18
|
+
platformClient: PlatformClient;
|
19
|
+
private api;
|
20
|
+
private options;
|
21
|
+
private static defaultOptions;
|
22
|
+
/**
|
23
|
+
*
|
24
|
+
* @param apikey An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).
|
25
|
+
* @param organizationid The Coveo Organization identifier.
|
26
|
+
*/
|
27
|
+
constructor(apikey: string, organizationid: string, options?: PlatformUrlOptions);
|
28
|
+
/**
|
29
|
+
* Create a new push source
|
30
|
+
* @param name The name of the source to create.
|
31
|
+
* @param sourceVisibility The security option that should be applied to the content of the source. See [Content Security](https://docs.coveo.com/en/1779).
|
32
|
+
* @returns
|
33
|
+
*/
|
34
|
+
create(name: string, sourceVisibility: SourceVisibility): Promise<{
|
35
|
+
id: string;
|
36
|
+
}>;
|
37
|
+
get identity(): SecurityIdentity;
|
38
|
+
/**
|
39
|
+
* Adds or updates an individual item in a push source. See [Adding a Single Item in a Push Source](https://docs.coveo.com/en/133).
|
40
|
+
* @param sourceID
|
41
|
+
* @param docBuilder
|
42
|
+
* @param {BatchUpdateDocumentsOptions}
|
43
|
+
* @returns
|
44
|
+
*/
|
45
|
+
addOrUpdateDocument(sourceID: string, docBuilder: DocumentBuilder, options?: BatchUpdateDocumentsOptions): Promise<import("undici").Response>;
|
46
|
+
/**
|
47
|
+
* Manage batches of items in a push source. See [Manage Batches of Items in a Push Source](https://docs.coveo.com/en/90)
|
48
|
+
* @param sourceID
|
49
|
+
* @param batch
|
50
|
+
* @returns
|
51
|
+
*/
|
52
|
+
batchUpdateDocuments(sourceID: string, batch: BatchUpdateDocuments, options?: BatchUpdateDocumentsOptions): Promise<import("undici").Response>;
|
53
|
+
/**
|
54
|
+
*
|
55
|
+
* Manage batches of items in a push source from a list of JSON files. See [Manage Batches of Items in a Push Source](https://docs.coveo.com/en/90)
|
56
|
+
* @param {string} sourceID The unique identifier of the target Push source
|
57
|
+
* @param {string[]} filesOrDirectories A list of JSON files or directories (containing JSON files) from which to extract documents.
|
58
|
+
* @param {UploadBatchCallback} callback Callback executed when a batch of documents is either successfully uploaded or when an error occurs during the upload
|
59
|
+
* @param {BatchUpdateDocumentsFromFiles} options
|
60
|
+
*/
|
61
|
+
batchUpdateDocumentsFromFiles(sourceID: string, filesOrDirectories: string[], options?: BatchUpdateDocumentsFromFiles): import("./batchUploadDocumentsFromFile").BatchUploadDocumentsFromFilesReturn;
|
62
|
+
/**
|
63
|
+
* Deletes a specific item from a Push source. Optionally, the child items of that item can also be deleted. See [Deleting an Item in a Push Source](https://docs.coveo.com/en/171).
|
64
|
+
* @param sourceID
|
65
|
+
* @param documentId
|
66
|
+
* @param deleteChildren
|
67
|
+
* @returns
|
68
|
+
*/
|
69
|
+
deleteDocument(sourceID: string, documentId: string, deleteChildren?: boolean): Promise<import("undici").Response>;
|
70
|
+
/**
|
71
|
+
* Deletes all items whose last update was made by a Push API operation whose orderingId is strictly lower than a specified value. See [Deleting Old Items in a Push Source](https://docs.coveo.com/en/131).
|
72
|
+
* @param sourceID
|
73
|
+
* @param olderThan
|
74
|
+
* @returns
|
75
|
+
*/
|
76
|
+
deleteDocumentsOlderThan(sourceID: string, olderThan: Date | string | number): Promise<import("undici").Response>;
|
77
|
+
/**
|
78
|
+
* Set the status of a push source. See [Updating the Status of a Push Source](https://docs.coveo.com/en/35/)
|
79
|
+
* @param sourceID
|
80
|
+
* @param status
|
81
|
+
* @returns {Promise<void>}
|
82
|
+
*/
|
83
|
+
setSourceStatus(sourceID: string, status: SourceStatus): Promise<void>;
|
84
|
+
createFields(analyser: FieldAnalyser): Promise<void>;
|
85
|
+
private urlBuilder;
|
86
|
+
private fileContainerStrategy;
|
87
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,43 +1,43 @@
|
|
1
|
-
import 'fetch-undici-polyfill';
|
2
|
-
import { PlatformClient, SecurityIdentityAliasModel, SecurityIdentityBatchConfig, SecurityIdentityDelete, SecurityIdentityDeleteOptions, SecurityIdentityModel } from '@coveo/platform-client';
|
3
|
-
export declare class SecurityIdentity {
|
4
|
-
private platformClient;
|
5
|
-
/**
|
6
|
-
*
|
7
|
-
* @param apikey An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).
|
8
|
-
* @param organizationid The Coveo Organization identifier.
|
9
|
-
*/
|
10
|
-
constructor(platformClient: PlatformClient);
|
11
|
-
/**
|
12
|
-
* Create or update a security identity. See [Adding a Single Security Identity](https://docs.coveo.com/en/167) and [Security Identity Models](https://docs.coveo.com/en/139).
|
13
|
-
* @param securityProviderId
|
14
|
-
* @param securityIdentity
|
15
|
-
* @returns
|
16
|
-
*/
|
17
|
-
createSecurityIdentity(securityProviderId: string, securityIdentity: SecurityIdentityModel): Promise<void>;
|
18
|
-
/**
|
19
|
-
* Create or update a security identity alias. See [Adding a Single Alias](https://docs.coveo.com/en/142) and [User Alias Definition Examples](https://docs.coveo.com/en/46).
|
20
|
-
* @param securityProviderId
|
21
|
-
* @param securityIdentityAlias
|
22
|
-
* @returns
|
23
|
-
*/
|
24
|
-
createOrUpdateSecurityIdentityAlias(securityProviderId: string, securityIdentityAlias: SecurityIdentityAliasModel): Promise<void>;
|
25
|
-
/**
|
26
|
-
* Delete a security identity. See [Disabling a Single Security Identity](https://docs.coveo.com/en/84).
|
27
|
-
* @param securityProviderId
|
28
|
-
* @param securityIdentityToDelete
|
29
|
-
* @returns
|
30
|
-
*/
|
31
|
-
deleteSecurityIdentity(securityProviderId: string, securityIdentityToDelete: SecurityIdentityDelete): Promise<void>;
|
32
|
-
/**
|
33
|
-
* Delete old security identities. See [Disabling Old Security Identities](https://docs.coveo.com/en/33).
|
34
|
-
* @param securityProviderId
|
35
|
-
* @param batchDelete
|
36
|
-
* @returns
|
37
|
-
*/
|
38
|
-
deleteOldSecurityIdentities(securityProviderId: string, batchDelete: SecurityIdentityDeleteOptions): Promise<void>;
|
39
|
-
/**
|
40
|
-
* Manage batches of security identities. See [Manage Batches of Security Identities](https://docs.coveo.com/en/55).
|
41
|
-
*/
|
42
|
-
manageSecurityIdentities(securityProviderId: string, batchConfig: SecurityIdentityBatchConfig): Promise<void>;
|
43
|
-
}
|
1
|
+
import 'fetch-undici-polyfill';
|
2
|
+
import { PlatformClient, SecurityIdentityAliasModel, SecurityIdentityBatchConfig, SecurityIdentityDelete, SecurityIdentityDeleteOptions, SecurityIdentityModel } from '@coveo/platform-client';
|
3
|
+
export declare class SecurityIdentity {
|
4
|
+
private platformClient;
|
5
|
+
/**
|
6
|
+
*
|
7
|
+
* @param apikey An apiKey capable of pushing documents and managing sources in a Coveo organization. See [Manage API Keys](https://docs.coveo.com/en/1718).
|
8
|
+
* @param organizationid The Coveo Organization identifier.
|
9
|
+
*/
|
10
|
+
constructor(platformClient: PlatformClient);
|
11
|
+
/**
|
12
|
+
* Create or update a security identity. See [Adding a Single Security Identity](https://docs.coveo.com/en/167) and [Security Identity Models](https://docs.coveo.com/en/139).
|
13
|
+
* @param securityProviderId
|
14
|
+
* @param securityIdentity
|
15
|
+
* @returns
|
16
|
+
*/
|
17
|
+
createSecurityIdentity(securityProviderId: string, securityIdentity: SecurityIdentityModel): Promise<void>;
|
18
|
+
/**
|
19
|
+
* Create or update a security identity alias. See [Adding a Single Alias](https://docs.coveo.com/en/142) and [User Alias Definition Examples](https://docs.coveo.com/en/46).
|
20
|
+
* @param securityProviderId
|
21
|
+
* @param securityIdentityAlias
|
22
|
+
* @returns
|
23
|
+
*/
|
24
|
+
createOrUpdateSecurityIdentityAlias(securityProviderId: string, securityIdentityAlias: SecurityIdentityAliasModel): Promise<void>;
|
25
|
+
/**
|
26
|
+
* Delete a security identity. See [Disabling a Single Security Identity](https://docs.coveo.com/en/84).
|
27
|
+
* @param securityProviderId
|
28
|
+
* @param securityIdentityToDelete
|
29
|
+
* @returns
|
30
|
+
*/
|
31
|
+
deleteSecurityIdentity(securityProviderId: string, securityIdentityToDelete: SecurityIdentityDelete): Promise<void>;
|
32
|
+
/**
|
33
|
+
* Delete old security identities. See [Disabling Old Security Identities](https://docs.coveo.com/en/33).
|
34
|
+
* @param securityProviderId
|
35
|
+
* @param batchDelete
|
36
|
+
* @returns
|
37
|
+
*/
|
38
|
+
deleteOldSecurityIdentities(securityProviderId: string, batchDelete: SecurityIdentityDeleteOptions): Promise<void>;
|
39
|
+
/**
|
40
|
+
* Manage batches of security identities. See [Manage Batches of Security Identities](https://docs.coveo.com/en/55).
|
41
|
+
*/
|
42
|
+
manageSecurityIdentities(securityProviderId: string, batchConfig: SecurityIdentityBatchConfig): Promise<void>;
|
43
|
+
}
|
@@ -1,23 +1,23 @@
|
|
1
|
-
import { BatchUpdateDocuments } from '../interfaces';
|
2
|
-
import { UploadStrategy } from './strategy';
|
3
|
-
import { URLBuilder } from '../help/urlUtils';
|
4
|
-
import { APICore } from '../APICore';
|
5
|
-
export interface FileContainerResponse {
|
6
|
-
uploadUri: string;
|
7
|
-
fileId: string;
|
8
|
-
requiredHeaders: Record<string, string>;
|
9
|
-
}
|
10
|
-
/**
|
11
|
-
* Upload documents using the [File container](https://docs.coveo.com/en/43/index-content/creating-a-file-container)
|
12
|
-
*
|
13
|
-
* @class FileContainerStrategy
|
14
|
-
* @implements {UploadStrategy}
|
15
|
-
*/
|
16
|
-
export declare class FileContainerStrategy implements UploadStrategy {
|
17
|
-
private urlBuilder;
|
18
|
-
private api;
|
19
|
-
constructor(urlBuilder: URLBuilder, api: APICore);
|
20
|
-
upload(batch: BatchUpdateDocuments): Promise<import("undici").Response>;
|
21
|
-
private createFileContainer;
|
22
|
-
private pushFileContainerContent;
|
23
|
-
}
|
1
|
+
import { BatchUpdateDocuments } from '../interfaces';
|
2
|
+
import { UploadStrategy } from './strategy';
|
3
|
+
import { URLBuilder } from '../help/urlUtils';
|
4
|
+
import { APICore } from '../APICore';
|
5
|
+
export interface FileContainerResponse {
|
6
|
+
uploadUri: string;
|
7
|
+
fileId: string;
|
8
|
+
requiredHeaders: Record<string, string>;
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* Upload documents using the [File container](https://docs.coveo.com/en/43/index-content/creating-a-file-container)
|
12
|
+
*
|
13
|
+
* @class FileContainerStrategy
|
14
|
+
* @implements {UploadStrategy}
|
15
|
+
*/
|
16
|
+
export declare class FileContainerStrategy implements UploadStrategy {
|
17
|
+
private urlBuilder;
|
18
|
+
private api;
|
19
|
+
constructor(urlBuilder: URLBuilder, api: APICore);
|
20
|
+
upload(batch: BatchUpdateDocuments): Promise<import("undici").Response>;
|
21
|
+
private createFileContainer;
|
22
|
+
private pushFileContainerContent;
|
23
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from './fileContainerStrategy';
|
2
|
-
export * from './strategy';
|
3
|
-
export * from './streamChunkStrategy';
|
1
|
+
export * from './fileContainerStrategy';
|
2
|
+
export * from './strategy';
|
3
|
+
export * from './streamChunkStrategy';
|
@@ -1,23 +1,23 @@
|
|
1
|
-
import type { Response } from 'undici';
|
2
|
-
import type { BatchUpdateDocuments } from '../interfaces';
|
3
|
-
export interface UploadStrategy {
|
4
|
-
/**
|
5
|
-
* Upload a batch of documents
|
6
|
-
*
|
7
|
-
* @param {BatchUpdateDocuments} batch
|
8
|
-
*/
|
9
|
-
upload: (batch: BatchUpdateDocuments) => Promise<Response>;
|
10
|
-
/**
|
11
|
-
* Async operation to run before starting the upload
|
12
|
-
* This can be useful if a task should run before the parallel uploads
|
13
|
-
*
|
14
|
-
* @memberof UploadStrategy
|
15
|
-
*/
|
16
|
-
preUpload?: () => Promise<void>;
|
17
|
-
/**
|
18
|
-
* Async operation to run once the batch upload is complete
|
19
|
-
*
|
20
|
-
* @memberof UploadStrategy
|
21
|
-
*/
|
22
|
-
postUpload?: () => Promise<void>;
|
23
|
-
}
|
1
|
+
import type { Response } from 'undici';
|
2
|
+
import type { BatchUpdateDocuments } from '../interfaces';
|
3
|
+
export interface UploadStrategy {
|
4
|
+
/**
|
5
|
+
* Upload a batch of documents
|
6
|
+
*
|
7
|
+
* @param {BatchUpdateDocuments} batch
|
8
|
+
*/
|
9
|
+
upload: (batch: BatchUpdateDocuments) => Promise<Response>;
|
10
|
+
/**
|
11
|
+
* Async operation to run before starting the upload
|
12
|
+
* This can be useful if a task should run before the parallel uploads
|
13
|
+
*
|
14
|
+
* @memberof UploadStrategy
|
15
|
+
*/
|
16
|
+
preUpload?: () => Promise<void>;
|
17
|
+
/**
|
18
|
+
* Async operation to run once the batch upload is complete
|
19
|
+
*
|
20
|
+
* @memberof UploadStrategy
|
21
|
+
*/
|
22
|
+
postUpload?: () => Promise<void>;
|
23
|
+
}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import { BatchUpdateDocuments } from '../interfaces';
|
2
|
-
import { UploadStrategy } from './strategy';
|
3
|
-
import { StreamUrlBuilder } from '../help/urlUtils';
|
4
|
-
import { APICore } from '../APICore';
|
5
|
-
export interface StreamResponse {
|
6
|
-
uploadUri: string;
|
7
|
-
fileId: string;
|
8
|
-
requiredHeaders: Record<string, string>;
|
9
|
-
streamId: string;
|
10
|
-
}
|
11
|
-
/**
|
12
|
-
* Upload documents using the [Stream API](https://docs.coveo.com/en/lb4a0344/coveo-for-commerce/how-to-stream-your-catalog-data-to-your-source)
|
13
|
-
*
|
14
|
-
* @class StreamChunkStrategy
|
15
|
-
* @implements {UploadStrategy}
|
16
|
-
*/
|
17
|
-
export declare class StreamChunkStrategy implements UploadStrategy {
|
18
|
-
private urlBuilder;
|
19
|
-
private api;
|
20
|
-
private _openedStream;
|
21
|
-
constructor(urlBuilder: StreamUrlBuilder, api: APICore);
|
22
|
-
upload(batch: BatchUpdateDocuments): Promise<import("undici").Response>;
|
23
|
-
preUpload(): Promise<void>;
|
24
|
-
postUpload(): Promise<void>;
|
25
|
-
openStream(): Promise<void>;
|
26
|
-
closeOpenedStream(): Promise<unknown>;
|
27
|
-
private requestStreamChunk;
|
28
|
-
}
|
1
|
+
import { BatchUpdateDocuments } from '../interfaces';
|
2
|
+
import { UploadStrategy } from './strategy';
|
3
|
+
import { StreamUrlBuilder } from '../help/urlUtils';
|
4
|
+
import { APICore } from '../APICore';
|
5
|
+
export interface StreamResponse {
|
6
|
+
uploadUri: string;
|
7
|
+
fileId: string;
|
8
|
+
requiredHeaders: Record<string, string>;
|
9
|
+
streamId: string;
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* Upload documents using the [Stream API](https://docs.coveo.com/en/lb4a0344/coveo-for-commerce/how-to-stream-your-catalog-data-to-your-source)
|
13
|
+
*
|
14
|
+
* @class StreamChunkStrategy
|
15
|
+
* @implements {UploadStrategy}
|
16
|
+
*/
|
17
|
+
export declare class StreamChunkStrategy implements UploadStrategy {
|
18
|
+
private urlBuilder;
|
19
|
+
private api;
|
20
|
+
private _openedStream;
|
21
|
+
constructor(urlBuilder: StreamUrlBuilder, api: APICore);
|
22
|
+
upload(batch: BatchUpdateDocuments): Promise<import("undici").Response>;
|
23
|
+
preUpload(): Promise<void>;
|
24
|
+
postUpload(): Promise<void>;
|
25
|
+
openStream(): Promise<void>;
|
26
|
+
closeOpenedStream(): Promise<unknown>;
|
27
|
+
private requestStreamChunk;
|
28
|
+
}
|