@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.
Files changed (130) hide show
  1. package/dist/APICore.js +47 -47
  2. package/dist/APICore.js.map +1 -1
  3. package/dist/definitions/APICore.d.ts +18 -18
  4. package/dist/definitions/document.d.ts +124 -124
  5. package/dist/definitions/documentBuilder.d.ts +168 -168
  6. package/dist/definitions/documentBuilder.spec.d.ts +1 -1
  7. package/dist/definitions/environment.d.ts +16 -16
  8. package/dist/definitions/errors/baseError.d.ts +4 -4
  9. package/dist/definitions/errors/fieldErrors.d.ts +18 -18
  10. package/dist/definitions/errors/index.d.ts +3 -3
  11. package/dist/definitions/errors/privilegeError.d.ts +6 -6
  12. package/dist/definitions/errors/validatorErrors.d.ts +20 -20
  13. package/dist/definitions/fieldAnalyser/fieldAnalyser.d.ts +36 -36
  14. package/dist/definitions/fieldAnalyser/fieldAnalyser.spec.d.ts +1 -1
  15. package/dist/definitions/fieldAnalyser/fieldStore.d.ts +5 -5
  16. package/dist/definitions/fieldAnalyser/fieldUtils.d.ts +6 -6
  17. package/dist/definitions/fieldAnalyser/fieldsUtils.spec.d.ts +1 -1
  18. package/dist/definitions/fieldAnalyser/inconsistencies.d.ts +5 -5
  19. package/dist/definitions/fieldAnalyser/inconsistencies.spec.d.ts +1 -1
  20. package/dist/definitions/fieldAnalyser/typeUtils.d.ts +3 -3
  21. package/dist/definitions/fieldAnalyser/typeUtils.spec.d.ts +1 -1
  22. package/dist/definitions/help/file.d.ts +3 -3
  23. package/dist/definitions/help/file.spec.d.ts +1 -1
  24. package/dist/definitions/help/fileConsumer.d.ts +31 -31
  25. package/dist/definitions/help/fileConsumer.spec.d.ts +1 -1
  26. package/dist/definitions/help/fileContainer.d.ts +8 -8
  27. package/dist/definitions/help/fileContainer.spec.d.ts +1 -1
  28. package/dist/definitions/help/function.d.ts +1 -1
  29. package/dist/definitions/help/generator.d.ts +11 -11
  30. package/dist/definitions/help/generator.spec.d.ts +1 -1
  31. package/dist/definitions/help/urlUtils.d.ts +27 -27
  32. package/dist/definitions/help/urlUtils.spec.d.ts +1 -1
  33. package/dist/definitions/index.d.ts +14 -14
  34. package/dist/definitions/interfaces.d.ts +70 -70
  35. package/dist/definitions/localtest.d.ts +1 -1
  36. package/dist/definitions/permissionSetBuilder.d.ts +34 -34
  37. package/dist/definitions/permissionSetBuilder.spec.d.ts +1 -1
  38. package/dist/definitions/securityIdentityBuilder.d.ts +105 -105
  39. package/dist/definitions/securityIdentityBuilder.spec.d.ts +1 -1
  40. package/dist/definitions/source/batchUploadDocumentsFromFile.d.ts +11 -11
  41. package/dist/definitions/source/batchUploadDocumentsFromFile.spec.d.ts +1 -1
  42. package/dist/definitions/source/catalog.d.ts +70 -70
  43. package/dist/definitions/source/catalog.spec.d.ts +1 -1
  44. package/dist/definitions/source/documentUploader.d.ts +11 -11
  45. package/dist/definitions/source/documentUploader.spec.d.ts +1 -1
  46. package/dist/definitions/source/push.d.ts +87 -87
  47. package/dist/definitions/source/push.spec.d.ts +1 -1
  48. package/dist/definitions/source/securityIdenty.d.ts +43 -43
  49. package/dist/definitions/uploadStrategy/fileContainerStrategy.d.ts +23 -23
  50. package/dist/definitions/uploadStrategy/fileContainerStrategy.spec.d.ts +1 -1
  51. package/dist/definitions/uploadStrategy/index.d.ts +3 -3
  52. package/dist/definitions/uploadStrategy/strategy.d.ts +23 -23
  53. package/dist/definitions/uploadStrategy/streamChunkStrategy.d.ts +28 -28
  54. package/dist/definitions/uploadStrategy/streamChunkStrategy.spec.d.ts +1 -1
  55. package/dist/definitions/validation/caseInsensitiveDocument.d.ts +13 -13
  56. package/dist/definitions/validation/knownKey.d.ts +10 -10
  57. package/dist/definitions/validation/parseFile.d.ts +4 -4
  58. package/dist/definitions/validation/parseFile.spec.d.ts +1 -1
  59. package/dist/definitions/validation/parsePermissions.d.ts +5 -5
  60. package/dist/definitions/validation/parsePermissions.spec.d.ts +1 -1
  61. package/dist/definitions/validation/preconditions/apiKeyPrivilege.d.ts +3 -3
  62. package/dist/definitions/validation/preconditions/apiKeyPrivilege.spec.d.ts +1 -1
  63. package/dist/definitions/validation/preconditions/platformPrivilege.d.ts +7 -7
  64. package/dist/definitions/validation/requiredKeyValidator.d.ts +17 -17
  65. package/dist/definitions/validation/transformers/transformer.d.ts +31 -31
  66. package/dist/definitions/validation/transformers/transformer.spec.d.ts +1 -1
  67. package/dist/document.js +2 -2
  68. package/dist/documentBuilder.js +292 -292
  69. package/dist/documentBuilder.spec.js +191 -191
  70. package/dist/environment.js +41 -41
  71. package/dist/errors/baseError.js +10 -10
  72. package/dist/errors/fieldErrors.js +42 -42
  73. package/dist/errors/index.js +19 -19
  74. package/dist/errors/privilegeError.js +12 -12
  75. package/dist/errors/validatorErrors.js +40 -40
  76. package/dist/fieldAnalyser/fieldAnalyser.js +95 -95
  77. package/dist/fieldAnalyser/fieldAnalyser.spec.js +230 -230
  78. package/dist/fieldAnalyser/fieldStore.js +21 -21
  79. package/dist/fieldAnalyser/fieldUtils.js +41 -41
  80. package/dist/fieldAnalyser/fieldsUtils.spec.js +116 -116
  81. package/dist/fieldAnalyser/inconsistencies.js +14 -14
  82. package/dist/fieldAnalyser/inconsistencies.spec.js +40 -40
  83. package/dist/fieldAnalyser/typeUtils.js +61 -61
  84. package/dist/fieldAnalyser/typeUtils.spec.js +142 -142
  85. package/dist/help/file.js +37 -37
  86. package/dist/help/file.spec.js +67 -67
  87. package/dist/help/fileConsumer.js +150 -150
  88. package/dist/help/fileConsumer.spec.js +153 -153
  89. package/dist/help/fileContainer.js +48 -48
  90. package/dist/help/fileContainer.spec.js +65 -65
  91. package/dist/help/function.js +5 -5
  92. package/dist/help/generator.js +32 -32
  93. package/dist/help/generator.spec.js +82 -82
  94. package/dist/help/urlUtils.js +42 -42
  95. package/dist/help/urlUtils.spec.js +41 -41
  96. package/dist/index.js +38 -38
  97. package/dist/interfaces.js +2 -2
  98. package/dist/localtest.js +55 -55
  99. package/dist/permissionSetBuilder.js +58 -58
  100. package/dist/permissionSetBuilder.spec.js +68 -68
  101. package/dist/securityIdentityBuilder.js +128 -128
  102. package/dist/securityIdentityBuilder.spec.js +50 -50
  103. package/dist/source/batchUploadDocumentsFromFile.js +46 -46
  104. package/dist/source/batchUploadDocumentsFromFile.spec.js +145 -145
  105. package/dist/source/catalog.js +111 -111
  106. package/dist/source/catalog.spec.js +64 -64
  107. package/dist/source/documentUploader.js +45 -45
  108. package/dist/source/documentUploader.spec.js +118 -118
  109. package/dist/source/push.js +140 -140
  110. package/dist/source/push.spec.js +152 -152
  111. package/dist/source/securityIdenty.js +57 -57
  112. package/dist/uploadStrategy/fileContainerStrategy.js +32 -32
  113. package/dist/uploadStrategy/fileContainerStrategy.spec.js +86 -86
  114. package/dist/uploadStrategy/index.js +19 -19
  115. package/dist/uploadStrategy/strategy.js +2 -2
  116. package/dist/uploadStrategy/streamChunkStrategy.js +52 -52
  117. package/dist/uploadStrategy/streamChunkStrategy.spec.js +77 -77
  118. package/dist/validation/caseInsensitiveDocument.js +31 -31
  119. package/dist/validation/knownKey.js +37 -37
  120. package/dist/validation/parseFile.js +120 -120
  121. package/dist/validation/parseFile.spec.js +96 -96
  122. package/dist/validation/parsePermissions.js +118 -118
  123. package/dist/validation/parsePermissions.spec.js +86 -86
  124. package/dist/validation/preconditions/apiKeyPrivilege.js +20 -20
  125. package/dist/validation/preconditions/apiKeyPrivilege.spec.js +66 -66
  126. package/dist/validation/preconditions/platformPrivilege.js +32 -32
  127. package/dist/validation/requiredKeyValidator.js +61 -61
  128. package/dist/validation/transformers/transformer.js +51 -51
  129. package/dist/validation/transformers/transformer.spec.js +21 -21
  130. package/package.json +11 -11
@@ -1,31 +1,31 @@
1
- import { BatchUpdateDocuments, UploadBatchCallbackData, ConcurrentProcessing, ParseDocumentOptions } from '../interfaces';
2
- import type { Response } from 'undici';
3
- export type SuccessfulUploadCallback = (data: UploadBatchCallbackData) => void;
4
- export type FailedUploadCallback = (err: unknown, value: UploadBatchCallbackData) => void;
5
- /**
6
- * Util class to help injesting documents through a list of files and uploading generated document batches.
7
- */
8
- export declare class FileConsumer {
9
- private upload;
10
- private processingConfig;
11
- private static maxContentLength;
12
- private _totalDocumentCount?;
13
- private _remainingDocumentCount?;
14
- private cbSuccess;
15
- private cbFail;
16
- /**
17
- * Creates an instance of FileConsumer.
18
- * @param {(batch: BatchUpdateDocuments) => Promise<Response>} upload the upload operation to apply to every document batch
19
- * @param {Required<ConcurrentProcessing>} processingConfig
20
- */
21
- constructor(upload: (batch: BatchUpdateDocuments) => Promise<Response>, processingConfig: Required<ConcurrentProcessing>);
22
- consume(files: string[], options?: ParseDocumentOptions): Promise<void>;
23
- onSuccess(callback: SuccessfulUploadCallback): void;
24
- onError(callback: FailedUploadCallback): void;
25
- private splitByChunkAndUpload;
26
- set expectedDocumentCount(count: number);
27
- private getRemainingDocumentCount;
28
- private uploadBatch;
29
- private getProgress;
30
- private get accumulator();
31
- }
1
+ import { BatchUpdateDocuments, UploadBatchCallbackData, ConcurrentProcessing, ParseDocumentOptions } from '../interfaces';
2
+ import type { Response } from 'undici';
3
+ export type SuccessfulUploadCallback = (data: UploadBatchCallbackData) => void;
4
+ export type FailedUploadCallback = (err: unknown, value: UploadBatchCallbackData) => void;
5
+ /**
6
+ * Util class to help injesting documents through a list of files and uploading generated document batches.
7
+ */
8
+ export declare class FileConsumer {
9
+ private upload;
10
+ private processingConfig;
11
+ private static maxContentLength;
12
+ private _totalDocumentCount?;
13
+ private _remainingDocumentCount?;
14
+ private cbSuccess;
15
+ private cbFail;
16
+ /**
17
+ * Creates an instance of FileConsumer.
18
+ * @param {(batch: BatchUpdateDocuments) => Promise<Response>} upload the upload operation to apply to every document batch
19
+ * @param {Required<ConcurrentProcessing>} processingConfig
20
+ */
21
+ constructor(upload: (batch: BatchUpdateDocuments) => Promise<Response>, processingConfig: Required<ConcurrentProcessing>);
22
+ consume(files: string[], options?: ParseDocumentOptions): Promise<void>;
23
+ onSuccess(callback: SuccessfulUploadCallback): void;
24
+ onError(callback: FailedUploadCallback): void;
25
+ private splitByChunkAndUpload;
26
+ set expectedDocumentCount(count: number);
27
+ private getRemainingDocumentCount;
28
+ private uploadBatch;
29
+ private getProgress;
30
+ private get accumulator();
31
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,8 +1,8 @@
1
- import type { Response } from 'undici';
2
- import { BatchUpdateDocuments } from '../interfaces';
3
- export interface FileContainerResponse {
4
- uploadUri: string;
5
- fileId: string;
6
- requiredHeaders: Record<string, string>;
7
- }
8
- export declare const uploadContentToFileContainer: (fileContainer: FileContainerResponse, batch: BatchUpdateDocuments) => Promise<Response>;
1
+ import type { Response } from 'undici';
2
+ import { BatchUpdateDocuments } from '../interfaces';
3
+ export interface FileContainerResponse {
4
+ uploadUri: string;
5
+ fileId: string;
6
+ requiredHeaders: Record<string, string>;
7
+ }
8
+ export declare const uploadContentToFileContainer: (fileContainer: FileContainerResponse, batch: BatchUpdateDocuments) => Promise<Response>;
@@ -1 +1 @@
1
- import 'fetch-undici-polyfill';
1
+ import 'fetch-undici-polyfill';
@@ -1 +1 @@
1
- export declare const noop: () => void;
1
+ export declare const noop: () => void;
@@ -1,11 +1,11 @@
1
- type PromiseGenerator<T> = Generator<Promise<T>, void, unknown> | AsyncGenerator<T, void, unknown>;
2
- /**
3
- * Consumes a generator or an async generator function concurrently
4
- *
5
- * @template T
6
- * @param {() => PromiseGenerator<T>} generator The generator function to consume.
7
- * @param {number} maxConcurrent The number of maximum concurrent workers.
8
- * @param {(worker: number, promiseValue: Awaited<T>) => void} [callback] A callback function that runs after each iteration of the iterator. It takes in argument the promise resolved value as well as the worker (ID) assigned to fulfill that promise.
9
- */
10
- export declare const consumeGenerator: <T>(generator: () => PromiseGenerator<T>, maxConcurrent: number, callback?: ((worker: number, promiseValue: Awaited<T>) => void) | undefined) => Promise<(void | Awaited<T>)[]>;
11
- export {};
1
+ type PromiseGenerator<T> = Generator<Promise<T>, void, unknown> | AsyncGenerator<T, void, unknown>;
2
+ /**
3
+ * Consumes a generator or an async generator function concurrently
4
+ *
5
+ * @template T
6
+ * @param {() => PromiseGenerator<T>} generator The generator function to consume.
7
+ * @param {number} maxConcurrent The number of maximum concurrent workers.
8
+ * @param {(worker: number, promiseValue: Awaited<T>) => void} [callback] A callback function that runs after each iteration of the iterator. It takes in argument the promise resolved value as well as the worker (ID) assigned to fulfill that promise.
9
+ */
10
+ export declare const consumeGenerator: <T>(generator: () => PromiseGenerator<T>, maxConcurrent: number, callback?: ((worker: number, promiseValue: Awaited<T>) => void) | undefined) => Promise<(void | Awaited<T>)[]>;
11
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,27 +1,27 @@
1
- /// <reference types="node" />
2
- import { PlatformUrlOptions } from '..';
3
- export interface URLBuilder {
4
- baseAPIURLForUpdate: URL;
5
- fileContainerUrl: URL;
6
- }
7
- declare abstract class BaseUrlBuilder {
8
- private organizationId;
9
- private options;
10
- protected constructor(organizationId: string, options: Required<PlatformUrlOptions>);
11
- protected get platformURL(): string;
12
- get fileContainerUrl(): import("url").URL;
13
- abstract get baseAPIURLForUpdate(): URL;
14
- }
15
- export declare class PushUrlBuilder extends BaseUrlBuilder implements URLBuilder {
16
- private sourceId;
17
- constructor(sourceId: string, organizationId: string, options: Required<PlatformUrlOptions>);
18
- get baseURL(): import("url").URL;
19
- get baseAPIURLForUpdate(): import("url").URL;
20
- }
21
- export declare class StreamUrlBuilder extends BaseUrlBuilder implements URLBuilder {
22
- private sourceId;
23
- constructor(sourceId: string, organizationId: string, options: Required<PlatformUrlOptions>);
24
- get baseStreamURL(): import("url").URL;
25
- get baseAPIURLForUpdate(): import("url").URL;
26
- }
27
- export {};
1
+ /// <reference types="node" />
2
+ import { PlatformUrlOptions } from '..';
3
+ export interface URLBuilder {
4
+ baseAPIURLForUpdate: URL;
5
+ fileContainerUrl: URL;
6
+ }
7
+ declare abstract class BaseUrlBuilder {
8
+ private organizationId;
9
+ private options;
10
+ protected constructor(organizationId: string, options: Required<PlatformUrlOptions>);
11
+ protected get platformURL(): string;
12
+ get fileContainerUrl(): import("url").URL;
13
+ abstract get baseAPIURLForUpdate(): URL;
14
+ }
15
+ export declare class PushUrlBuilder extends BaseUrlBuilder implements URLBuilder {
16
+ private sourceId;
17
+ constructor(sourceId: string, organizationId: string, options: Required<PlatformUrlOptions>);
18
+ get baseURL(): import("url").URL;
19
+ get baseAPIURLForUpdate(): import("url").URL;
20
+ }
21
+ export declare class StreamUrlBuilder extends BaseUrlBuilder implements URLBuilder {
22
+ private sourceId;
23
+ constructor(sourceId: string, organizationId: string, options: Required<PlatformUrlOptions>);
24
+ get baseStreamURL(): import("url").URL;
25
+ get baseAPIURLForUpdate(): import("url").URL;
26
+ }
27
+ export {};
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,14 +1,14 @@
1
- export * from './document';
2
- export * from './validation/transformers/transformer';
3
- export * as errors from './errors';
4
- export { PushSource } from './source/push';
5
- export { CatalogSource } from './source/catalog';
6
- export { SuccessfulUploadCallback, FailedUploadCallback, } from './help/fileConsumer';
7
- export { UploadBatchCallbackData, BatchUpdateDocuments, BatchUpdateDocumentsFromFiles, } from './interfaces';
8
- export { FieldAnalyser } from './fieldAnalyser/fieldAnalyser';
9
- export { DocumentBuilder } from './documentBuilder';
10
- export * from './securityIdentityBuilder';
11
- export { PlatformEnvironment, Region, PlatformUrlOptions } from './environment';
12
- export { SourceVisibility } from '@coveo/platform-client';
13
- export { PermissionSetBuilder } from './permissionSetBuilder';
14
- export { parseAndGetDocumentBuilderFromJSONDocument } from './validation/parseFile';
1
+ export * from './document';
2
+ export * from './validation/transformers/transformer';
3
+ export * as errors from './errors';
4
+ export { PushSource } from './source/push';
5
+ export { CatalogSource } from './source/catalog';
6
+ export { SuccessfulUploadCallback, FailedUploadCallback, } from './help/fileConsumer';
7
+ export { UploadBatchCallbackData, BatchUpdateDocuments, BatchUpdateDocumentsFromFiles, } from './interfaces';
8
+ export { FieldAnalyser } from './fieldAnalyser/fieldAnalyser';
9
+ export { DocumentBuilder } from './documentBuilder';
10
+ export * from './securityIdentityBuilder';
11
+ export { PlatformEnvironment, Region, PlatformUrlOptions } from './environment';
12
+ export { SourceVisibility } from '@coveo/platform-client';
13
+ export { PermissionSetBuilder } from './permissionSetBuilder';
14
+ export { parseAndGetDocumentBuilderFromJSONDocument } from './validation/parseFile';
@@ -1,70 +1,70 @@
1
- /// <reference types="node" />
2
- import type { Response } from 'undici';
3
- import { PathLike } from 'fs';
4
- import type { DocumentBuilder } from './documentBuilder';
5
- import type { Transformer } from './validation/transformers/transformer';
6
- export interface BatchUpdateDocuments {
7
- addOrUpdate: DocumentBuilder[];
8
- delete: {
9
- documentId: string;
10
- deleteChildren: boolean;
11
- }[];
12
- }
13
- /**
14
- * @param {number} remainingDocumentCount Number of remaining documents to upload. This value decreases each time a new batch is uploaded
15
- * @param {number} totalDocumentCount Total number documents to upload
16
- */
17
- export interface UploadProgress {
18
- remainingDocumentCount: number;
19
- totalDocumentCount: number;
20
- }
21
- /**
22
- *
23
- * @param {string[]} files Files from which the documentBuilders were generated
24
- * @param {DocumentBuilder[]} batch List of the uploaded DocumentBuilders
25
- * @param {UploadProgress} progress Progress of the upload process
26
- * @param {Response} res fetch response
27
- */
28
- export interface UploadBatchCallbackData {
29
- files: string[];
30
- batch: DocumentBuilder[];
31
- progress?: UploadProgress;
32
- res?: Response;
33
- }
34
- export interface BatchUpdateDocumentsOptions {
35
- /**
36
- * Whether to create the missing fields required in the index based on the document batch metadata.
37
- *
38
- * Make sure your API key is granted the privilege to EDIT fields before using this option.
39
- * See https://docs.coveo.com/en/1707#fields-domain
40
- *
41
- * @default true
42
- */
43
- createFields?: boolean;
44
- }
45
- export interface ParseDocumentOptions {
46
- /**
47
- * The {@link Transformer} to apply to the fields found in the parsed documents.
48
- * If not specified, no transformation will be applied to the field names.
49
- * A Transformer is useful to prevent getting errors whenever some of field names contain special characters or any other element not supported by the Platform.
50
- *
51
- * For a list of built-in transformers, use {@link BuiltInTransformers}.
52
- *
53
- * @default BuiltInTransformers.identity
54
- */
55
- fieldNameTransformer?: Transformer;
56
- /**
57
- * Callback to execute everytime a new {@link DocumentBuilder} is created
58
- */
59
- callback?: (docBuilder: DocumentBuilder, documentPath: PathLike) => void;
60
- }
61
- export interface ConcurrentProcessing {
62
- /**
63
- * The maximum number of requests to send concurrently to the Coveo platform.
64
- * Increasing this value will increase the speed at which documents are pushed but will also consume more memory.
65
- *
66
- * @default 10
67
- */
68
- maxConcurrent?: number;
69
- }
70
- export type BatchUpdateDocumentsFromFiles = BatchUpdateDocumentsOptions & ConcurrentProcessing & ParseDocumentOptions;
1
+ /// <reference types="node" />
2
+ import type { Response } from 'undici';
3
+ import { PathLike } from 'fs';
4
+ import type { DocumentBuilder } from './documentBuilder';
5
+ import type { Transformer } from './validation/transformers/transformer';
6
+ export interface BatchUpdateDocuments {
7
+ addOrUpdate: DocumentBuilder[];
8
+ delete: {
9
+ documentId: string;
10
+ deleteChildren: boolean;
11
+ }[];
12
+ }
13
+ /**
14
+ * @param {number} remainingDocumentCount Number of remaining documents to upload. This value decreases each time a new batch is uploaded
15
+ * @param {number} totalDocumentCount Total number documents to upload
16
+ */
17
+ export interface UploadProgress {
18
+ remainingDocumentCount: number;
19
+ totalDocumentCount: number;
20
+ }
21
+ /**
22
+ *
23
+ * @param {string[]} files Files from which the documentBuilders were generated
24
+ * @param {DocumentBuilder[]} batch List of the uploaded DocumentBuilders
25
+ * @param {UploadProgress} progress Progress of the upload process
26
+ * @param {Response} res fetch response
27
+ */
28
+ export interface UploadBatchCallbackData {
29
+ files: string[];
30
+ batch: DocumentBuilder[];
31
+ progress?: UploadProgress;
32
+ res?: Response;
33
+ }
34
+ export interface BatchUpdateDocumentsOptions {
35
+ /**
36
+ * Whether to create the missing fields required in the index based on the document batch metadata.
37
+ *
38
+ * Make sure your API key is granted the privilege to EDIT fields before using this option.
39
+ * See https://docs.coveo.com/en/1707#fields-domain
40
+ *
41
+ * @default true
42
+ */
43
+ createFields?: boolean;
44
+ }
45
+ export interface ParseDocumentOptions {
46
+ /**
47
+ * The {@link Transformer} to apply to the fields found in the parsed documents.
48
+ * If not specified, no transformation will be applied to the field names.
49
+ * A Transformer is useful to prevent getting errors whenever some of field names contain special characters or any other element not supported by the Platform.
50
+ *
51
+ * For a list of built-in transformers, use {@link BuiltInTransformers}.
52
+ *
53
+ * @default BuiltInTransformers.identity
54
+ */
55
+ fieldNameTransformer?: Transformer;
56
+ /**
57
+ * Callback to execute everytime a new {@link DocumentBuilder} is created
58
+ */
59
+ callback?: (docBuilder: DocumentBuilder, documentPath: PathLike) => void;
60
+ }
61
+ export interface ConcurrentProcessing {
62
+ /**
63
+ * The maximum number of requests to send concurrently to the Coveo platform.
64
+ * Increasing this value will increase the speed at which documents are pushed but will also consume more memory.
65
+ *
66
+ * @default 10
67
+ */
68
+ maxConcurrent?: number;
69
+ }
70
+ export type BatchUpdateDocumentsFromFiles = BatchUpdateDocumentsOptions & ConcurrentProcessing & ParseDocumentOptions;
@@ -1 +1 @@
1
- import 'dotenv/config';
1
+ import 'dotenv/config';
@@ -1,34 +1,34 @@
1
- import { PermissionSet } from '@coveo/platform-client';
2
- import { SecurityIdentityBuilder } from './securityIdentityBuilder';
3
- export type PermissionSection = keyof Pick<PermissionSet, 'allowedPermissions' | 'deniedPermissions'>;
4
- export declare class PermissionSetBuilder {
5
- private permissionSet;
6
- /**
7
- * Builds a Permission Set Model
8
- *
9
- * See[Simple Permission Model Definition](https://docs.coveo.com/en/107/index-content/simple-permission-model-definition-examples)
10
- * @param {boolean} allowAnonymous Whether to allow anonymous users in this permission set
11
- */
12
- constructor(allowAnonymous: boolean);
13
- /**
14
- * Set allowed identities on the document. See {@link PermissionSet}
15
- *
16
- * When the {@link PermissionsSetBuilder} class is instanciated with `allowAnonymous` property set to `true`, calling this method is redundant, and can therefore be omitted.
17
- * @param securityIdentityBuilder The allowed security identities to add to the permission set
18
- * @returns
19
- */
20
- withAllowedPermissions(securityIdentityBuilder: SecurityIdentityBuilder): this;
21
- /**
22
- * Set denied identities on the document. See {@link PermissionSet}
23
- *
24
- * @param securityIdentityBuilder The denied security identities to add to the permission set
25
- * @returns
26
- */
27
- withDeniedPermissions(securityIdentityBuilder: SecurityIdentityBuilder): this;
28
- /**
29
- * Build and return the security identity or identities.
30
- * @returns
31
- */
32
- build(): PermissionSet;
33
- private setPermission;
34
- }
1
+ import { PermissionSet } from '@coveo/platform-client';
2
+ import { SecurityIdentityBuilder } from './securityIdentityBuilder';
3
+ export type PermissionSection = keyof Pick<PermissionSet, 'allowedPermissions' | 'deniedPermissions'>;
4
+ export declare class PermissionSetBuilder {
5
+ private permissionSet;
6
+ /**
7
+ * Builds a Permission Set Model
8
+ *
9
+ * See[Simple Permission Model Definition](https://docs.coveo.com/en/107/index-content/simple-permission-model-definition-examples)
10
+ * @param {boolean} allowAnonymous Whether to allow anonymous users in this permission set
11
+ */
12
+ constructor(allowAnonymous: boolean);
13
+ /**
14
+ * Set allowed identities on the document. See {@link PermissionSet}
15
+ *
16
+ * When the {@link PermissionsSetBuilder} class is instanciated with `allowAnonymous` property set to `true`, calling this method is redundant, and can therefore be omitted.
17
+ * @param securityIdentityBuilder The allowed security identities to add to the permission set
18
+ * @returns
19
+ */
20
+ withAllowedPermissions(securityIdentityBuilder: SecurityIdentityBuilder): this;
21
+ /**
22
+ * Set denied identities on the document. See {@link PermissionSet}
23
+ *
24
+ * @param securityIdentityBuilder The denied security identities to add to the permission set
25
+ * @returns
26
+ */
27
+ withDeniedPermissions(securityIdentityBuilder: SecurityIdentityBuilder): this;
28
+ /**
29
+ * Build and return the security identity or identities.
30
+ * @returns
31
+ */
32
+ build(): PermissionSet;
33
+ private setPermission;
34
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,105 +1,105 @@
1
- import { Permission, PermissionIdentityType } from '@coveo/platform-client';
2
- /**
3
- * Build a security identity. See {@link Permission}.
4
- */
5
- export interface SecurityIdentityBuilder {
6
- build(): Permission | Permission[];
7
- }
8
- /**
9
- * Build any {@link PermissionIdentityType}.
10
- *
11
- * Instead of using this class directly, use one of:
12
- * - {@link UserSecurityIdentityBuilder}
13
- * - {@link GroupSecurityIdentityBuilder}
14
- * - {@link VirtualGroupSecurityIdentityBuilder}
15
- */
16
- export declare class AnySecurityIdentityBuilder implements SecurityIdentityBuilder {
17
- private securityIdentity;
18
- /**
19
- * @param identityType The type of the identity.
20
- * Valid values:
21
- * - `UNKNOWN`
22
- * - `USER` : Defines a single user.
23
- * - `GROUP` : Defines an existing group of identities within the indexed system. Individual members of this group can be of any valid identity Type (USER, GROUP, or VIRTUAL_GROUP).
24
- * - `VIRTUAL_GROUP` : Defines a group that doesn't exist within the indexed system. Mechanically, a `VIRTUAL_GROUP` is identical to a `GROUP`.
25
- *
26
- * @param identity The name of the security identity.
27
- * Examples:
28
- * - `asmith@example.com`
29
- * - `SampleTeam2`
30
- *
31
- * @param securityProvider The security identity provider through which the security identity is updated. Defaults to the first security identity provider associated with the target source.
32
- */
33
- constructor(identityType: PermissionIdentityType, identity: string, securityProvider?: string);
34
- /**
35
- * Build and return the security identity.
36
- * @returns
37
- */
38
- build(): Permission;
39
- }
40
- /**
41
- * Build a security identity of type `USER`.
42
- *
43
- * Typically used in conjunction with {@link PermissionSetBuilder.withAllowedPermissions} or {@link PermissionSetBuilder.withDeniedPermissions}.
44
- *
45
- * See {@link Permission}.
46
- */
47
- export declare class UserSecurityIdentityBuilder implements SecurityIdentityBuilder {
48
- private user;
49
- private securityProvider;
50
- /**
51
- * Pass either a single user, or an array of user to create multiple identities.
52
- * @param {(string | string[])} user The user identity or identities
53
- * @param {string} [securityProvider='Email Security Provider'] The security identity provider through which the security identity is updated. Defaults to the first security identity provider associated with the target source.
54
- */
55
- constructor(user: string | string[], securityProvider?: string);
56
- /**
57
- * Build and return the security identity or identities.
58
- * @returns
59
- */
60
- build(): Permission | Permission[];
61
- }
62
- /**
63
- * Build a security identity of type `GROUP`.
64
- *
65
- * Typically used in conjunction with {@link PermissionSetBuilder.withAllowedPermissions} or {@link PermissionSetBuilder.withDeniedPermissions}.
66
- *
67
- * See {@link Permission}.
68
- */
69
- export declare class GroupSecurityIdentityBuilder implements SecurityIdentityBuilder {
70
- private group;
71
- private securityProvider?;
72
- /**
73
- * Pass either a single `group`, or an array of `group` to create multiple identities.
74
- * @param {(string | string[])} group
75
- * @param {string} [securityProvider] The security identity provider through which the security identity is updated. Defaults to the first security identity provider associated with the target source.
76
- */
77
- constructor(group: string | string[], securityProvider?: string | undefined);
78
- /**
79
- * Build and return the security identity or identities.
80
- * @returns
81
- */
82
- build(): Permission | Permission[];
83
- }
84
- /**
85
- * Build a security identity of type `VIRTUAL_GROUP`.
86
- *
87
- * Typically used in conjunction with {@link PermissionSetBuilder.withAllowedPermissions} or {@link PermissionSetBuilder.withDeniedPermissions}.
88
- *
89
- * See {@link Permission}.
90
- */
91
- export declare class VirtualGroupSecurityIdentityBuilder implements SecurityIdentityBuilder {
92
- private virtualGroup;
93
- private securityProvider?;
94
- /**
95
- * Pass either a single `virtualGroup`, or an array of `virtualGroup` to create multiple identities.
96
- * @param {(string | string[])} virtualGroup
97
- * @param {string} [securityProvider] The security identity provider through which the security identity is updated. Defaults to the first security identity provider associated with the target source.
98
- */
99
- constructor(virtualGroup: string | string[], securityProvider?: string | undefined);
100
- /**
101
- * Build and return the security identity or identities.
102
- * @returns
103
- */
104
- build(): Permission | Permission[];
105
- }
1
+ import { Permission, PermissionIdentityType } from '@coveo/platform-client';
2
+ /**
3
+ * Build a security identity. See {@link Permission}.
4
+ */
5
+ export interface SecurityIdentityBuilder {
6
+ build(): Permission | Permission[];
7
+ }
8
+ /**
9
+ * Build any {@link PermissionIdentityType}.
10
+ *
11
+ * Instead of using this class directly, use one of:
12
+ * - {@link UserSecurityIdentityBuilder}
13
+ * - {@link GroupSecurityIdentityBuilder}
14
+ * - {@link VirtualGroupSecurityIdentityBuilder}
15
+ */
16
+ export declare class AnySecurityIdentityBuilder implements SecurityIdentityBuilder {
17
+ private securityIdentity;
18
+ /**
19
+ * @param identityType The type of the identity.
20
+ * Valid values:
21
+ * - `UNKNOWN`
22
+ * - `USER` : Defines a single user.
23
+ * - `GROUP` : Defines an existing group of identities within the indexed system. Individual members of this group can be of any valid identity Type (USER, GROUP, or VIRTUAL_GROUP).
24
+ * - `VIRTUAL_GROUP` : Defines a group that doesn't exist within the indexed system. Mechanically, a `VIRTUAL_GROUP` is identical to a `GROUP`.
25
+ *
26
+ * @param identity The name of the security identity.
27
+ * Examples:
28
+ * - `asmith@example.com`
29
+ * - `SampleTeam2`
30
+ *
31
+ * @param securityProvider The security identity provider through which the security identity is updated. Defaults to the first security identity provider associated with the target source.
32
+ */
33
+ constructor(identityType: PermissionIdentityType, identity: string, securityProvider?: string);
34
+ /**
35
+ * Build and return the security identity.
36
+ * @returns
37
+ */
38
+ build(): Permission;
39
+ }
40
+ /**
41
+ * Build a security identity of type `USER`.
42
+ *
43
+ * Typically used in conjunction with {@link PermissionSetBuilder.withAllowedPermissions} or {@link PermissionSetBuilder.withDeniedPermissions}.
44
+ *
45
+ * See {@link Permission}.
46
+ */
47
+ export declare class UserSecurityIdentityBuilder implements SecurityIdentityBuilder {
48
+ private user;
49
+ private securityProvider;
50
+ /**
51
+ * Pass either a single user, or an array of user to create multiple identities.
52
+ * @param {(string | string[])} user The user identity or identities
53
+ * @param {string} [securityProvider='Email Security Provider'] The security identity provider through which the security identity is updated. Defaults to the first security identity provider associated with the target source.
54
+ */
55
+ constructor(user: string | string[], securityProvider?: string);
56
+ /**
57
+ * Build and return the security identity or identities.
58
+ * @returns
59
+ */
60
+ build(): Permission | Permission[];
61
+ }
62
+ /**
63
+ * Build a security identity of type `GROUP`.
64
+ *
65
+ * Typically used in conjunction with {@link PermissionSetBuilder.withAllowedPermissions} or {@link PermissionSetBuilder.withDeniedPermissions}.
66
+ *
67
+ * See {@link Permission}.
68
+ */
69
+ export declare class GroupSecurityIdentityBuilder implements SecurityIdentityBuilder {
70
+ private group;
71
+ private securityProvider?;
72
+ /**
73
+ * Pass either a single `group`, or an array of `group` to create multiple identities.
74
+ * @param {(string | string[])} group
75
+ * @param {string} [securityProvider] The security identity provider through which the security identity is updated. Defaults to the first security identity provider associated with the target source.
76
+ */
77
+ constructor(group: string | string[], securityProvider?: string | undefined);
78
+ /**
79
+ * Build and return the security identity or identities.
80
+ * @returns
81
+ */
82
+ build(): Permission | Permission[];
83
+ }
84
+ /**
85
+ * Build a security identity of type `VIRTUAL_GROUP`.
86
+ *
87
+ * Typically used in conjunction with {@link PermissionSetBuilder.withAllowedPermissions} or {@link PermissionSetBuilder.withDeniedPermissions}.
88
+ *
89
+ * See {@link Permission}.
90
+ */
91
+ export declare class VirtualGroupSecurityIdentityBuilder implements SecurityIdentityBuilder {
92
+ private virtualGroup;
93
+ private securityProvider?;
94
+ /**
95
+ * Pass either a single `virtualGroup`, or an array of `virtualGroup` to create multiple identities.
96
+ * @param {(string | string[])} virtualGroup
97
+ * @param {string} [securityProvider] The security identity provider through which the security identity is updated. Defaults to the first security identity provider associated with the target source.
98
+ */
99
+ constructor(virtualGroup: string | string[], securityProvider?: string | undefined);
100
+ /**
101
+ * Build and return the security identity or identities.
102
+ * @returns
103
+ */
104
+ build(): Permission | Permission[];
105
+ }
@@ -1 +1 @@
1
- export {};
1
+ export {};