@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,168 +1,168 @@
|
|
1
|
-
import { CompressionType, Document, Metadata, MetadataValue } from './document';
|
2
|
-
import { Transformer } from './validation/transformers/transformer';
|
3
|
-
import { PermissionSetBuilder } from './permissionSetBuilder';
|
4
|
-
/**
|
5
|
-
* Utility class to build a {@link Document}.
|
6
|
-
*/
|
7
|
-
export declare class DocumentBuilder {
|
8
|
-
private uri;
|
9
|
-
private doc;
|
10
|
-
private permissions;
|
11
|
-
/**
|
12
|
-
*
|
13
|
-
* @param uri The URI of the document. See {@link Document.uri}
|
14
|
-
* @param title The title of the document. See {@link Document.title}
|
15
|
-
*/
|
16
|
-
constructor(uri: string, title: string);
|
17
|
-
/**
|
18
|
-
* Set the data of the document. See {@link Document.data}
|
19
|
-
* @param data
|
20
|
-
* @returns
|
21
|
-
*/
|
22
|
-
withData(data: string): this;
|
23
|
-
/**
|
24
|
-
* Set the date of the document. See {@link Document.date}
|
25
|
-
* @param date
|
26
|
-
* @returns
|
27
|
-
*/
|
28
|
-
withDate(date: Date | string | number): this;
|
29
|
-
/**
|
30
|
-
* Set the modified date of the document. See {@link Document.modifiedDate}
|
31
|
-
* @param date
|
32
|
-
* @returns
|
33
|
-
*/
|
34
|
-
withModifiedDate(date: Date | string | number): this;
|
35
|
-
/**
|
36
|
-
* Set the permanentID of the document. See {@link Document.permanentId}
|
37
|
-
* @param permanentID
|
38
|
-
* @returns
|
39
|
-
*/
|
40
|
-
withPermanentId(permanentID: string): this;
|
41
|
-
/**
|
42
|
-
* Set the base64 encoded, compressed binary data of the document. See {@link Document.compressedBinaryData}
|
43
|
-
* @param data
|
44
|
-
* @param compressionType
|
45
|
-
* @returns
|
46
|
-
*/
|
47
|
-
withCompressedBinaryData(data: string, compressionType: CompressionType): this;
|
48
|
-
/**
|
49
|
-
* Set the file extension on the document. See {@link Document.fileExtension}
|
50
|
-
* @param extension
|
51
|
-
* @returns
|
52
|
-
*/
|
53
|
-
withFileExtension(extension: string): this;
|
54
|
-
/**
|
55
|
-
* Set the parentID on the document. See {@link Document.parentId}
|
56
|
-
* @param id
|
57
|
-
* @returns
|
58
|
-
*/
|
59
|
-
withParentID(id: string): this;
|
60
|
-
/**
|
61
|
-
* Set the clickableURI on the document. See {@link Document.clickableUri}
|
62
|
-
* @param clickURI
|
63
|
-
* @returns
|
64
|
-
*/
|
65
|
-
withClickableUri(clickURI: string): this;
|
66
|
-
/**
|
67
|
-
* Set the author on the document. See {@link Document.author}
|
68
|
-
* @param author
|
69
|
-
* @returns
|
70
|
-
*/
|
71
|
-
withAuthor(author: string): this;
|
72
|
-
/**
|
73
|
-
* Add a single metadata key and value pair on the document. See {@link Document.metadata}
|
74
|
-
* @param {string} key
|
75
|
-
* @param {MetadataValue} value
|
76
|
-
* @param {Transformer} [metadataKeyTransformer=BuiltInTransformers.identity] The {@link Transformer} to apply to the metadata key.
|
77
|
-
* If not specified, no transformation will be applied to the metadata key.
|
78
|
-
*
|
79
|
-
* For a list of built-in transformers, use {@link BuiltInTransformers}.
|
80
|
-
* @returns
|
81
|
-
*/
|
82
|
-
withMetadataValue(key: string, value: MetadataValue, keyTransformer?: Transformer): this;
|
83
|
-
/**
|
84
|
-
* Set metadata on the document. See {@link Document.metadata}
|
85
|
-
* @param {Metadata} metadata
|
86
|
-
* @param {Transformer} [metadataKeyTransformer=BuiltInTransformers.identity] The {@link Transformer} to apply to all the document metadata keys.
|
87
|
-
* If not specified, no transformation will be applied to the metadata keys.
|
88
|
-
*
|
89
|
-
* For a list of built-in transformers, use {@link BuiltInTransformers}.
|
90
|
-
* @returns
|
91
|
-
*/
|
92
|
-
withMetadata(metadata: Metadata, metadataKeyTransformer?: Transformer): this;
|
93
|
-
/**
|
94
|
-
* Set a permission set on the document
|
95
|
-
* Multiple permission sets can be combined.
|
96
|
-
*
|
97
|
-
* See [Simple Permission Model Definition Examples](https://docs.coveo.com/en/107)
|
98
|
-
*/
|
99
|
-
withPermissionSet(permissionSetBuilder: PermissionSetBuilder): this;
|
100
|
-
/**
|
101
|
-
* Set a permission level on the document
|
102
|
-
* Multiple permission levels can be added to the document. In this case, the order at which this method is called will influence the permission hierarchy.
|
103
|
-
*
|
104
|
-
* Consider the following example:
|
105
|
-
* ```
|
106
|
-
* doc.withPermissionLevel('level1', [setA])
|
107
|
-
* .withPermissionLevel('level2', [setB, setC])
|
108
|
-
* ```
|
109
|
-
*
|
110
|
-
* Permission sets from level1 (`setA`) will supersed the ones from level2 (`setB` and `setC`).
|
111
|
-
*
|
112
|
-
* See [Complex Permission Model Definition](https://docs.coveo.com/en/25/index-content/complex-permission-model-definition-example)
|
113
|
-
*/
|
114
|
-
withPermissionLevel(permissionLevelName: string, permissionSetBuilders: PermissionSetBuilder[]): this;
|
115
|
-
build(): Document;
|
116
|
-
/**
|
117
|
-
* Marshal the document into a JSON format accepted by the push API.
|
118
|
-
* @returns
|
119
|
-
*/
|
120
|
-
marshal(): {
|
121
|
-
documentId: string;
|
122
|
-
permissions?: (import("@coveo/platform-client").PermissionSet | import("@coveo/platform-client").PermissionLevel)[] | undefined;
|
123
|
-
compressedBinaryData?: {
|
124
|
-
compressionType: CompressionType;
|
125
|
-
data: string;
|
126
|
-
} | undefined;
|
127
|
-
compressionType?: undefined;
|
128
|
-
title: string;
|
129
|
-
clickableUri?: string | undefined;
|
130
|
-
author?: string | undefined; /**
|
131
|
-
* Set the data of the document. See {@link Document.data}
|
132
|
-
* @param data
|
133
|
-
* @returns
|
134
|
-
*/
|
135
|
-
date?: string | undefined;
|
136
|
-
modifiedDate?: string | undefined;
|
137
|
-
parentId?: string | undefined;
|
138
|
-
data?: string | undefined;
|
139
|
-
fileExtension?: string | undefined;
|
140
|
-
permanentid: string | undefined;
|
141
|
-
} | {
|
142
|
-
documentId: string;
|
143
|
-
permissions?: (import("@coveo/platform-client").PermissionSet | import("@coveo/platform-client").PermissionLevel)[] | undefined;
|
144
|
-
compressedBinaryData: string;
|
145
|
-
compressionType: CompressionType;
|
146
|
-
title: string;
|
147
|
-
clickableUri?: string | undefined;
|
148
|
-
author?: string | undefined; /**
|
149
|
-
* Set the data of the document. See {@link Document.data}
|
150
|
-
* @param data
|
151
|
-
* @returns
|
152
|
-
*/
|
153
|
-
date?: string | undefined;
|
154
|
-
modifiedDate?: string | undefined;
|
155
|
-
parentId?: string | undefined;
|
156
|
-
data?: string | undefined;
|
157
|
-
fileExtension?: string | undefined;
|
158
|
-
permanentid: string | undefined;
|
159
|
-
};
|
160
|
-
private marshalDocumentId;
|
161
|
-
private marshalMetadata;
|
162
|
-
private marshalCompressedBinaryData;
|
163
|
-
private marshalPermissions;
|
164
|
-
private validateAndFillMissing;
|
165
|
-
private generatePermanentId;
|
166
|
-
private validateDateAndReturnValidDate;
|
167
|
-
private validateCompressedBinaryData;
|
168
|
-
}
|
1
|
+
import { CompressionType, Document, Metadata, MetadataValue } from './document';
|
2
|
+
import { Transformer } from './validation/transformers/transformer';
|
3
|
+
import { PermissionSetBuilder } from './permissionSetBuilder';
|
4
|
+
/**
|
5
|
+
* Utility class to build a {@link Document}.
|
6
|
+
*/
|
7
|
+
export declare class DocumentBuilder {
|
8
|
+
private uri;
|
9
|
+
private doc;
|
10
|
+
private permissions;
|
11
|
+
/**
|
12
|
+
*
|
13
|
+
* @param uri The URI of the document. See {@link Document.uri}
|
14
|
+
* @param title The title of the document. See {@link Document.title}
|
15
|
+
*/
|
16
|
+
constructor(uri: string, title: string);
|
17
|
+
/**
|
18
|
+
* Set the data of the document. See {@link Document.data}
|
19
|
+
* @param data
|
20
|
+
* @returns
|
21
|
+
*/
|
22
|
+
withData(data: string): this;
|
23
|
+
/**
|
24
|
+
* Set the date of the document. See {@link Document.date}
|
25
|
+
* @param date
|
26
|
+
* @returns
|
27
|
+
*/
|
28
|
+
withDate(date: Date | string | number): this;
|
29
|
+
/**
|
30
|
+
* Set the modified date of the document. See {@link Document.modifiedDate}
|
31
|
+
* @param date
|
32
|
+
* @returns
|
33
|
+
*/
|
34
|
+
withModifiedDate(date: Date | string | number): this;
|
35
|
+
/**
|
36
|
+
* Set the permanentID of the document. See {@link Document.permanentId}
|
37
|
+
* @param permanentID
|
38
|
+
* @returns
|
39
|
+
*/
|
40
|
+
withPermanentId(permanentID: string): this;
|
41
|
+
/**
|
42
|
+
* Set the base64 encoded, compressed binary data of the document. See {@link Document.compressedBinaryData}
|
43
|
+
* @param data
|
44
|
+
* @param compressionType
|
45
|
+
* @returns
|
46
|
+
*/
|
47
|
+
withCompressedBinaryData(data: string, compressionType: CompressionType): this;
|
48
|
+
/**
|
49
|
+
* Set the file extension on the document. See {@link Document.fileExtension}
|
50
|
+
* @param extension
|
51
|
+
* @returns
|
52
|
+
*/
|
53
|
+
withFileExtension(extension: string): this;
|
54
|
+
/**
|
55
|
+
* Set the parentID on the document. See {@link Document.parentId}
|
56
|
+
* @param id
|
57
|
+
* @returns
|
58
|
+
*/
|
59
|
+
withParentID(id: string): this;
|
60
|
+
/**
|
61
|
+
* Set the clickableURI on the document. See {@link Document.clickableUri}
|
62
|
+
* @param clickURI
|
63
|
+
* @returns
|
64
|
+
*/
|
65
|
+
withClickableUri(clickURI: string): this;
|
66
|
+
/**
|
67
|
+
* Set the author on the document. See {@link Document.author}
|
68
|
+
* @param author
|
69
|
+
* @returns
|
70
|
+
*/
|
71
|
+
withAuthor(author: string): this;
|
72
|
+
/**
|
73
|
+
* Add a single metadata key and value pair on the document. See {@link Document.metadata}
|
74
|
+
* @param {string} key
|
75
|
+
* @param {MetadataValue} value
|
76
|
+
* @param {Transformer} [metadataKeyTransformer=BuiltInTransformers.identity] The {@link Transformer} to apply to the metadata key.
|
77
|
+
* If not specified, no transformation will be applied to the metadata key.
|
78
|
+
*
|
79
|
+
* For a list of built-in transformers, use {@link BuiltInTransformers}.
|
80
|
+
* @returns
|
81
|
+
*/
|
82
|
+
withMetadataValue(key: string, value: MetadataValue, keyTransformer?: Transformer): this;
|
83
|
+
/**
|
84
|
+
* Set metadata on the document. See {@link Document.metadata}
|
85
|
+
* @param {Metadata} metadata
|
86
|
+
* @param {Transformer} [metadataKeyTransformer=BuiltInTransformers.identity] The {@link Transformer} to apply to all the document metadata keys.
|
87
|
+
* If not specified, no transformation will be applied to the metadata keys.
|
88
|
+
*
|
89
|
+
* For a list of built-in transformers, use {@link BuiltInTransformers}.
|
90
|
+
* @returns
|
91
|
+
*/
|
92
|
+
withMetadata(metadata: Metadata, metadataKeyTransformer?: Transformer): this;
|
93
|
+
/**
|
94
|
+
* Set a permission set on the document
|
95
|
+
* Multiple permission sets can be combined.
|
96
|
+
*
|
97
|
+
* See [Simple Permission Model Definition Examples](https://docs.coveo.com/en/107)
|
98
|
+
*/
|
99
|
+
withPermissionSet(permissionSetBuilder: PermissionSetBuilder): this;
|
100
|
+
/**
|
101
|
+
* Set a permission level on the document
|
102
|
+
* Multiple permission levels can be added to the document. In this case, the order at which this method is called will influence the permission hierarchy.
|
103
|
+
*
|
104
|
+
* Consider the following example:
|
105
|
+
* ```
|
106
|
+
* doc.withPermissionLevel('level1', [setA])
|
107
|
+
* .withPermissionLevel('level2', [setB, setC])
|
108
|
+
* ```
|
109
|
+
*
|
110
|
+
* Permission sets from level1 (`setA`) will supersed the ones from level2 (`setB` and `setC`).
|
111
|
+
*
|
112
|
+
* See [Complex Permission Model Definition](https://docs.coveo.com/en/25/index-content/complex-permission-model-definition-example)
|
113
|
+
*/
|
114
|
+
withPermissionLevel(permissionLevelName: string, permissionSetBuilders: PermissionSetBuilder[]): this;
|
115
|
+
build(): Document;
|
116
|
+
/**
|
117
|
+
* Marshal the document into a JSON format accepted by the push API.
|
118
|
+
* @returns
|
119
|
+
*/
|
120
|
+
marshal(): {
|
121
|
+
documentId: string;
|
122
|
+
permissions?: (import("@coveo/platform-client").PermissionSet | import("@coveo/platform-client").PermissionLevel)[] | undefined;
|
123
|
+
compressedBinaryData?: {
|
124
|
+
compressionType: CompressionType;
|
125
|
+
data: string;
|
126
|
+
} | undefined;
|
127
|
+
compressionType?: undefined;
|
128
|
+
title: string;
|
129
|
+
clickableUri?: string | undefined;
|
130
|
+
author?: string | undefined; /**
|
131
|
+
* Set the data of the document. See {@link Document.data}
|
132
|
+
* @param data
|
133
|
+
* @returns
|
134
|
+
*/
|
135
|
+
date?: string | undefined;
|
136
|
+
modifiedDate?: string | undefined;
|
137
|
+
parentId?: string | undefined;
|
138
|
+
data?: string | undefined;
|
139
|
+
fileExtension?: string | undefined;
|
140
|
+
permanentid: string | undefined;
|
141
|
+
} | {
|
142
|
+
documentId: string;
|
143
|
+
permissions?: (import("@coveo/platform-client").PermissionSet | import("@coveo/platform-client").PermissionLevel)[] | undefined;
|
144
|
+
compressedBinaryData: string;
|
145
|
+
compressionType: CompressionType;
|
146
|
+
title: string;
|
147
|
+
clickableUri?: string | undefined;
|
148
|
+
author?: string | undefined; /**
|
149
|
+
* Set the data of the document. See {@link Document.data}
|
150
|
+
* @param data
|
151
|
+
* @returns
|
152
|
+
*/
|
153
|
+
date?: string | undefined;
|
154
|
+
modifiedDate?: string | undefined;
|
155
|
+
parentId?: string | undefined;
|
156
|
+
data?: string | undefined;
|
157
|
+
fileExtension?: string | undefined;
|
158
|
+
permanentid: string | undefined;
|
159
|
+
};
|
160
|
+
private marshalDocumentId;
|
161
|
+
private marshalMetadata;
|
162
|
+
private marshalCompressedBinaryData;
|
163
|
+
private marshalPermissions;
|
164
|
+
private validateAndFillMissing;
|
165
|
+
private generatePermanentId;
|
166
|
+
private validateDateAndReturnValidDate;
|
167
|
+
private validateCompressedBinaryData;
|
168
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { Region, Environment } from '@coveo/platform-client';
|
2
|
-
export { Region } from '@coveo/platform-client';
|
3
|
-
export declare enum PlatformEnvironment {
|
4
|
-
Dev = "dev",
|
5
|
-
Stg = "stg",
|
6
|
-
Hipaa = "hipaa",
|
7
|
-
Prod = "prod"
|
8
|
-
}
|
9
|
-
export declare const DEFAULT_ENVIRONMENT: PlatformEnvironment.Prod;
|
10
|
-
export declare const DEFAULT_REGION: Region.US;
|
11
|
-
export type PlatformUrlOptions = {
|
12
|
-
environment?: PlatformEnvironment;
|
13
|
-
region?: Region;
|
14
|
-
};
|
15
|
-
export declare function platformUrl(options?: PlatformUrlOptions): string;
|
16
|
-
export declare function castEnvironmentToPlatformClient(e: PlatformEnvironment): Environment;
|
1
|
+
import { Region, Environment } from '@coveo/platform-client';
|
2
|
+
export { Region } from '@coveo/platform-client';
|
3
|
+
export declare enum PlatformEnvironment {
|
4
|
+
Dev = "dev",
|
5
|
+
Stg = "stg",
|
6
|
+
Hipaa = "hipaa",
|
7
|
+
Prod = "prod"
|
8
|
+
}
|
9
|
+
export declare const DEFAULT_ENVIRONMENT: PlatformEnvironment.Prod;
|
10
|
+
export declare const DEFAULT_REGION: Region.US;
|
11
|
+
export type PlatformUrlOptions = {
|
12
|
+
environment?: PlatformEnvironment;
|
13
|
+
region?: Region;
|
14
|
+
};
|
15
|
+
export declare function platformUrl(options?: PlatformUrlOptions): string;
|
16
|
+
export declare function castEnvironmentToPlatformClient(e: PlatformEnvironment): Environment;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export declare abstract class PushApiClientBaseError extends Error {
|
2
|
-
name: string;
|
3
|
-
constructor(message?: string);
|
4
|
-
}
|
1
|
+
export declare abstract class PushApiClientBaseError extends Error {
|
2
|
+
name: string;
|
3
|
+
constructor(message?: string);
|
4
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import { FieldModel } from '@coveo/platform-client';
|
2
|
-
import { Inconsistencies } from '../fieldAnalyser/inconsistencies';
|
3
|
-
import { PushApiClientBaseError } from './baseError';
|
4
|
-
export declare class FieldTypeInconsistencyError extends PushApiClientBaseError {
|
5
|
-
name: string;
|
6
|
-
constructor(inconsitencies: Inconsistencies);
|
7
|
-
}
|
8
|
-
export declare class InvalidPermanentId extends PushApiClientBaseError {
|
9
|
-
name: string;
|
10
|
-
constructor(field: FieldModel);
|
11
|
-
}
|
12
|
-
export declare class UnsupportedFieldError extends PushApiClientBaseError {
|
13
|
-
name: string;
|
14
|
-
static emptyFieldNameReplacer: string;
|
15
|
-
readonly unsupportedFields: [string, string][];
|
16
|
-
constructor(...unsupportedFields: [string, string][]);
|
17
|
-
private get formattedFieldList();
|
18
|
-
}
|
1
|
+
import { FieldModel } from '@coveo/platform-client';
|
2
|
+
import { Inconsistencies } from '../fieldAnalyser/inconsistencies';
|
3
|
+
import { PushApiClientBaseError } from './baseError';
|
4
|
+
export declare class FieldTypeInconsistencyError extends PushApiClientBaseError {
|
5
|
+
name: string;
|
6
|
+
constructor(inconsitencies: Inconsistencies);
|
7
|
+
}
|
8
|
+
export declare class InvalidPermanentId extends PushApiClientBaseError {
|
9
|
+
name: string;
|
10
|
+
constructor(field: FieldModel);
|
11
|
+
}
|
12
|
+
export declare class UnsupportedFieldError extends PushApiClientBaseError {
|
13
|
+
name: string;
|
14
|
+
static emptyFieldNameReplacer: string;
|
15
|
+
readonly unsupportedFields: [string, string][];
|
16
|
+
constructor(...unsupportedFields: [string, string][]);
|
17
|
+
private get formattedFieldList();
|
18
|
+
}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from './fieldErrors';
|
2
|
-
export * from './privilegeError';
|
3
|
-
export * from './validatorErrors';
|
1
|
+
export * from './fieldErrors';
|
2
|
+
export * from './privilegeError';
|
3
|
+
export * from './validatorErrors';
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { PushApiClientBaseError } from './baseError';
|
2
|
-
export declare class PrivilegeError extends PushApiClientBaseError {
|
3
|
-
message: string;
|
4
|
-
name: string;
|
5
|
-
constructor(message: string);
|
6
|
-
}
|
1
|
+
import { PushApiClientBaseError } from './baseError';
|
2
|
+
export declare class PrivilegeError extends PushApiClientBaseError {
|
3
|
+
message: string;
|
4
|
+
name: string;
|
5
|
+
constructor(message: string);
|
6
|
+
}
|
@@ -1,20 +1,20 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import { PrimitivesValues } from '@coveo/bueno';
|
3
|
-
import { PathLike } from 'fs';
|
4
|
-
import { PushApiClientBaseError } from './baseError';
|
5
|
-
export declare class NotAFileError extends PushApiClientBaseError {
|
6
|
-
name: string;
|
7
|
-
constructor(p: PathLike);
|
8
|
-
}
|
9
|
-
export declare class NotAJsonFileError extends PushApiClientBaseError {
|
10
|
-
name: string;
|
11
|
-
constructor(p: PathLike);
|
12
|
-
}
|
13
|
-
export declare class InvalidDocument extends PushApiClientBaseError {
|
14
|
-
name: string;
|
15
|
-
constructor(p: PathLike, doc: Record<string, PrimitivesValues>, explanation: string);
|
16
|
-
}
|
17
|
-
export declare class UnsupportedAttribute extends PushApiClientBaseError {
|
18
|
-
name: string;
|
19
|
-
constructor(p: PathLike, unsupported: string);
|
20
|
-
}
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { PrimitivesValues } from '@coveo/bueno';
|
3
|
+
import { PathLike } from 'fs';
|
4
|
+
import { PushApiClientBaseError } from './baseError';
|
5
|
+
export declare class NotAFileError extends PushApiClientBaseError {
|
6
|
+
name: string;
|
7
|
+
constructor(p: PathLike);
|
8
|
+
}
|
9
|
+
export declare class NotAJsonFileError extends PushApiClientBaseError {
|
10
|
+
name: string;
|
11
|
+
constructor(p: PathLike);
|
12
|
+
}
|
13
|
+
export declare class InvalidDocument extends PushApiClientBaseError {
|
14
|
+
name: string;
|
15
|
+
constructor(p: PathLike, doc: Record<string, PrimitivesValues>, explanation: string);
|
16
|
+
}
|
17
|
+
export declare class UnsupportedAttribute extends PushApiClientBaseError {
|
18
|
+
name: string;
|
19
|
+
constructor(p: PathLike, unsupported: string);
|
20
|
+
}
|
@@ -1,36 +1,36 @@
|
|
1
|
-
import PlatformClient, { FieldModel } from '@coveo/platform-client';
|
2
|
-
import { DocumentBuilder } from '..';
|
3
|
-
import { Inconsistencies } from './inconsistencies';
|
4
|
-
export type FieldAnalyserReport = {
|
5
|
-
fields: FieldModel[];
|
6
|
-
inconsistencies: Inconsistencies;
|
7
|
-
};
|
8
|
-
/**
|
9
|
-
* Analyse documents to detect type inconsistencies and missing fields in your index.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
export declare class FieldAnalyser {
|
13
|
-
private platformClient;
|
14
|
-
private inconsistencies;
|
15
|
-
private missingFields;
|
16
|
-
private existingFields;
|
17
|
-
constructor(platformClient: PlatformClient);
|
18
|
-
/**
|
19
|
-
* Adds a batch of document builders to the analyser to extract all the missing fields that need to be created in the organization.
|
20
|
-
* This method can be called as many time as needed as it will take into consideration document builders previously added.
|
21
|
-
*
|
22
|
-
* @param {DocumentBuilder[]} batch
|
23
|
-
* @return {*}
|
24
|
-
*/
|
25
|
-
add(batch: DocumentBuilder[]): Promise<this>;
|
26
|
-
/**
|
27
|
-
* Returns the analyser report containing the fields to create as well as the type inconsistencies in the documents
|
28
|
-
*
|
29
|
-
* @return {*} {FieldAnalyserReport}
|
30
|
-
*/
|
31
|
-
report(): FieldAnalyserReport;
|
32
|
-
private removeInconsistentFields;
|
33
|
-
private storeMetadata;
|
34
|
-
private ensureExistingFields;
|
35
|
-
private ensurePermanentId;
|
36
|
-
}
|
1
|
+
import PlatformClient, { FieldModel } from '@coveo/platform-client';
|
2
|
+
import { DocumentBuilder } from '..';
|
3
|
+
import { Inconsistencies } from './inconsistencies';
|
4
|
+
export type FieldAnalyserReport = {
|
5
|
+
fields: FieldModel[];
|
6
|
+
inconsistencies: Inconsistencies;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Analyse documents to detect type inconsistencies and missing fields in your index.
|
10
|
+
*
|
11
|
+
*/
|
12
|
+
export declare class FieldAnalyser {
|
13
|
+
private platformClient;
|
14
|
+
private inconsistencies;
|
15
|
+
private missingFields;
|
16
|
+
private existingFields;
|
17
|
+
constructor(platformClient: PlatformClient);
|
18
|
+
/**
|
19
|
+
* Adds a batch of document builders to the analyser to extract all the missing fields that need to be created in the organization.
|
20
|
+
* This method can be called as many time as needed as it will take into consideration document builders previously added.
|
21
|
+
*
|
22
|
+
* @param {DocumentBuilder[]} batch
|
23
|
+
* @return {*}
|
24
|
+
*/
|
25
|
+
add(batch: DocumentBuilder[]): Promise<this>;
|
26
|
+
/**
|
27
|
+
* Returns the analyser report containing the fields to create as well as the type inconsistencies in the documents
|
28
|
+
*
|
29
|
+
* @return {*} {FieldAnalyserReport}
|
30
|
+
*/
|
31
|
+
report(): FieldAnalyserReport;
|
32
|
+
private removeInconsistentFields;
|
33
|
+
private storeMetadata;
|
34
|
+
private ensureExistingFields;
|
35
|
+
private ensurePermanentId;
|
36
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { FieldModel, FieldTypes } from '@coveo/platform-client';
|
2
|
-
export declare class FieldStore extends Map<string, FieldTypes> {
|
3
|
-
concat(fieldBuilder: FieldStore): void;
|
4
|
-
marshal(): FieldModel[];
|
5
|
-
}
|
1
|
+
import { FieldModel, FieldTypes } from '@coveo/platform-client';
|
2
|
+
export declare class FieldStore extends Map<string, FieldTypes> {
|
3
|
+
concat(fieldBuilder: FieldStore): void;
|
4
|
+
marshal(): FieldModel[];
|
5
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import PlatformClient, { FieldModel } from '@coveo/platform-client';
|
2
|
-
import type { FieldAnalyserReport } from './fieldAnalyser';
|
3
|
-
export declare const listAllFieldsFromOrg: (client: PlatformClient, page?: number, fields?: FieldModel[]) => Promise<FieldModel[]>;
|
4
|
-
export declare const createFields: (client: PlatformClient, fields: FieldModel[], fieldBatch?: number) => Promise<void>;
|
5
|
-
export declare const createFieldsFromReport: (client: PlatformClient, report: FieldAnalyserReport) => Promise<void>;
|
6
|
-
export declare const isFieldNameValid: (fieldName: string) => boolean;
|
1
|
+
import PlatformClient, { FieldModel } from '@coveo/platform-client';
|
2
|
+
import type { FieldAnalyserReport } from './fieldAnalyser';
|
3
|
+
export declare const listAllFieldsFromOrg: (client: PlatformClient, page?: number, fields?: FieldModel[]) => Promise<FieldModel[]>;
|
4
|
+
export declare const createFields: (client: PlatformClient, fields: FieldModel[], fieldBatch?: number) => Promise<void>;
|
5
|
+
export declare const createFieldsFromReport: (client: PlatformClient, report: FieldAnalyserReport) => Promise<void>;
|
6
|
+
export declare const isFieldNameValid: (fieldName: string) => boolean;
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { FieldTypes } from '@coveo/platform-client';
|
2
|
-
export declare class Inconsistencies extends Map<string, Set<FieldTypes>> {
|
3
|
-
constructor();
|
4
|
-
add(fieldName: string, types: FieldTypes[]): this;
|
5
|
-
}
|
1
|
+
import { FieldTypes } from '@coveo/platform-client';
|
2
|
+
export declare class Inconsistencies extends Map<string, Set<FieldTypes>> {
|
3
|
+
constructor();
|
4
|
+
add(fieldName: string, types: FieldTypes[]): this;
|
5
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { FieldTypes } from '@coveo/platform-client';
|
2
|
-
export declare function getMostEnglobingType(possibleType1: FieldTypes, possibleType2: FieldTypes, acceptedTypeEvolution?: FieldTypes[]): FieldTypes | null;
|
3
|
-
export declare function getGuessedTypeFromValue(obj: unknown): FieldTypes;
|
1
|
+
import { FieldTypes } from '@coveo/platform-client';
|
2
|
+
export declare function getMostEnglobingType(possibleType1: FieldTypes, possibleType2: FieldTypes, acceptedTypeEvolution?: FieldTypes[]): FieldTypes | null;
|
3
|
+
export declare function getGuessedTypeFromValue(obj: unknown): FieldTypes;
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { PathLike } from 'fs';
|
2
|
-
export declare const isJsonFile: (documentPath: PathLike) => boolean;
|
3
|
-
export declare const getAllJsonFilesFromEntries: (filesOrDirectories: string[], fileNames?: string[]) => string[];
|
1
|
+
import { PathLike } from 'fs';
|
2
|
+
export declare const isJsonFile: (documentPath: PathLike) => boolean;
|
3
|
+
export declare const getAllJsonFilesFromEntries: (filesOrDirectories: string[], fileNames?: string[]) => string[];
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|