@coveo/push-api-client 3.0.117 → 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
package/dist/APICore.js
CHANGED
@@ -1,48 +1,48 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.APICore = void 0;
|
4
|
-
const exponential_backoff_1 = require("exponential-backoff");
|
5
|
-
class APICore {
|
6
|
-
constructor(accessToken) {
|
7
|
-
this.accessToken = accessToken;
|
8
|
-
}
|
9
|
-
async request(url, config) {
|
10
|
-
const req = async () => {
|
11
|
-
const response = await fetch(url, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, this.requestHeaders), config.headers) }));
|
12
|
-
return response;
|
13
|
-
};
|
14
|
-
return (0, exponential_backoff_1.backOff)(req, {
|
15
|
-
retry: (res) => this.isThrottled(res.status),
|
16
|
-
});
|
17
|
-
}
|
18
|
-
async requestJson(url, config) {
|
19
|
-
return (await this.request(url, config)).json();
|
20
|
-
}
|
21
|
-
async post(url, data = {}) {
|
22
|
-
return this.requestJson(url, { body: JSON.stringify(data), method: 'post' });
|
23
|
-
}
|
24
|
-
async put(url, data = {}, parse = true) {
|
25
|
-
return this.selectRequester(parse)(url, {
|
26
|
-
body: JSON.stringify(data),
|
27
|
-
method: 'put',
|
28
|
-
});
|
29
|
-
}
|
30
|
-
selectRequester(parse) {
|
31
|
-
return parse ? this.requestJson : this.request;
|
32
|
-
}
|
33
|
-
async delete(url, parse = true) {
|
34
|
-
return this.selectRequester(parse)(url, { method: 'delete' });
|
35
|
-
}
|
36
|
-
get requestHeaders() {
|
37
|
-
const authorizationHeader = {
|
38
|
-
Authorization: `Bearer ${this.accessToken}`,
|
39
|
-
};
|
40
|
-
const documentsRequestHeaders = Object.assign(Object.assign({}, authorizationHeader), { 'Content-Type': 'application/json', Accept: 'application/json' });
|
41
|
-
return documentsRequestHeaders;
|
42
|
-
}
|
43
|
-
isThrottled(status) {
|
44
|
-
return status === 429;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
exports.APICore = APICore;
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.APICore = void 0;
|
4
|
+
const exponential_backoff_1 = require("exponential-backoff");
|
5
|
+
class APICore {
|
6
|
+
constructor(accessToken) {
|
7
|
+
this.accessToken = accessToken;
|
8
|
+
}
|
9
|
+
async request(url, config) {
|
10
|
+
const req = async () => {
|
11
|
+
const response = await fetch(url, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, this.requestHeaders), config.headers) }));
|
12
|
+
return response;
|
13
|
+
};
|
14
|
+
return (0, exponential_backoff_1.backOff)(req, {
|
15
|
+
retry: (res) => this.isThrottled(res.status),
|
16
|
+
});
|
17
|
+
}
|
18
|
+
async requestJson(url, config) {
|
19
|
+
return (await this.request(url, config)).json();
|
20
|
+
}
|
21
|
+
async post(url, data = {}) {
|
22
|
+
return this.requestJson(url, { body: JSON.stringify(data), method: 'post' });
|
23
|
+
}
|
24
|
+
async put(url, data = {}, parse = true) {
|
25
|
+
return this.selectRequester(parse)(url, {
|
26
|
+
body: JSON.stringify(data),
|
27
|
+
method: 'put',
|
28
|
+
});
|
29
|
+
}
|
30
|
+
selectRequester(parse) {
|
31
|
+
return (parse ? this.requestJson : this.request).bind(this);
|
32
|
+
}
|
33
|
+
async delete(url, parse = true) {
|
34
|
+
return this.selectRequester(parse)(url, { method: 'delete' });
|
35
|
+
}
|
36
|
+
get requestHeaders() {
|
37
|
+
const authorizationHeader = {
|
38
|
+
Authorization: `Bearer ${this.accessToken}`,
|
39
|
+
};
|
40
|
+
const documentsRequestHeaders = Object.assign(Object.assign({}, authorizationHeader), { 'Content-Type': 'application/json', Accept: 'application/json' });
|
41
|
+
return documentsRequestHeaders;
|
42
|
+
}
|
43
|
+
isThrottled(status) {
|
44
|
+
return status === 429;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
exports.APICore = APICore;
|
48
48
|
//# sourceMappingURL=APICore.js.map
|
package/dist/APICore.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"APICore.js","sourceRoot":"","sources":["../src/APICore.ts"],"names":[],"mappings":";;;AAAA,6DAA4C;AAE5C,MAAa,OAAO;IAClB,YAA2B,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;IAAG,CAAC;IAE1C,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,MAAmB;QACpD,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;YACrB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,kCAC3B,MAAM,KACT,OAAO,kCAAM,IAAI,CAAC,cAAc,GAAK,MAAM,CAAC,OAAO,KACnD,CAAC;YACH,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC;QAEF,OAAO,IAAA,6BAAO,EAAC,GAAG,EAAE;YAClB,KAAK,EAAE,CAAC,GAAa,EAAE,EAAE,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AAM,mBAAmB,GAAG;YAC1B,aAAa,EAAE,UAAU,IAAI,CAAC,WAAW,EAAE;SAC5C,CAAC;QAEF,MAAM,uBAAuB,mCACxB,mBAAmB,KACtB,cAAc,EAAE,kBAAkB,EAClC,MAAM,EAAE,kBAAkB,GAC3B,CAAC;QAEF,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAEO,WAAW,CAAC,MAAc;QAChC,OAAO,MAAM,KAAK,GAAG,CAAC;IACxB,CAAC;CACF;AAhED,0BAgEC"}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import type { Response } from 'undici';
|
2
|
-
export declare class APICore {
|
3
|
-
private accessToken;
|
4
|
-
constructor(accessToken: string);
|
5
|
-
private request;
|
6
|
-
private requestJson;
|
7
|
-
post<T>(url: string, data?: unknown): Promise<T>;
|
8
|
-
put<T>(url: string): Promise<T>;
|
9
|
-
put<T>(url: string, data: unknown): Promise<T>;
|
10
|
-
put<T>(url: string, data: unknown, parse: true): Promise<T>;
|
11
|
-
put(url: string, data: unknown, parse: false): Promise<Response>;
|
12
|
-
private selectRequester;
|
13
|
-
delete<T>(url: string): Promise<T>;
|
14
|
-
delete(url: string, parse: false): Promise<Response>;
|
15
|
-
delete<T>(url: string, parse: true): Promise<T>;
|
16
|
-
private get requestHeaders();
|
17
|
-
private isThrottled;
|
18
|
-
}
|
1
|
+
import type { Response } from 'undici';
|
2
|
+
export declare class APICore {
|
3
|
+
private accessToken;
|
4
|
+
constructor(accessToken: string);
|
5
|
+
private request;
|
6
|
+
private requestJson;
|
7
|
+
post<T>(url: string, data?: unknown): Promise<T>;
|
8
|
+
put<T>(url: string): Promise<T>;
|
9
|
+
put<T>(url: string, data: unknown): Promise<T>;
|
10
|
+
put<T>(url: string, data: unknown, parse: true): Promise<T>;
|
11
|
+
put(url: string, data: unknown, parse: false): Promise<Response>;
|
12
|
+
private selectRequester;
|
13
|
+
delete<T>(url: string): Promise<T>;
|
14
|
+
delete(url: string, parse: false): Promise<Response>;
|
15
|
+
delete<T>(url: string, parse: true): Promise<T>;
|
16
|
+
private get requestHeaders();
|
17
|
+
private isThrottled;
|
18
|
+
}
|
@@ -1,124 +1,124 @@
|
|
1
|
-
import { PermissionLevel, PermissionSet } from '@coveo/platform-client';
|
2
|
-
type BaseMetadataValue = string | string[] | number | number[] | boolean;
|
3
|
-
type DictionaryMetadataValue = Record<string, BaseMetadataValue>;
|
4
|
-
export type MetadataValue = BaseMetadataValue | DictionaryMetadataValue;
|
5
|
-
export type Metadata = Record<string, MetadataValue>;
|
6
|
-
/**
|
7
|
-
* The compression type that was applied to your compressed document.
|
8
|
-
*/
|
9
|
-
export type CompressionType = 'UNCOMPRESSED' | 'DEFLATE' | 'GZIP' | 'LZMA' | 'ZLIB';
|
10
|
-
/**
|
11
|
-
* A Coveo document.
|
12
|
-
*/
|
13
|
-
export interface Document {
|
14
|
-
/**
|
15
|
-
* The Uniform Resource Identifier (URI) that uniquely identifies the document in a Coveo index.
|
16
|
-
*
|
17
|
-
* Examples:
|
18
|
-
* - `http://www.example.com/`
|
19
|
-
* - `file://folder/text.txt`
|
20
|
-
*/
|
21
|
-
uri: string;
|
22
|
-
/**
|
23
|
-
* The title of the document.
|
24
|
-
*/
|
25
|
-
title: string;
|
26
|
-
/**
|
27
|
-
* The clickable URI associated with the document.
|
28
|
-
*/
|
29
|
-
clickableUri?: string;
|
30
|
-
/**
|
31
|
-
* The author of the document.
|
32
|
-
*/
|
33
|
-
author?: string;
|
34
|
-
/**
|
35
|
-
* The date of the document, represented as an ISO string.
|
36
|
-
*
|
37
|
-
* Optional, will default to indexation date.
|
38
|
-
*/
|
39
|
-
date?: string;
|
40
|
-
/**
|
41
|
-
* The modified date of the document, represented as an ISO string.
|
42
|
-
*
|
43
|
-
* Optional, will default to indexation date.
|
44
|
-
*/
|
45
|
-
modifiedDate?: string;
|
46
|
-
/**
|
47
|
-
* The permanent identifier of a document that does not change over time.
|
48
|
-
*
|
49
|
-
* Optional, will be derived from the document URI.
|
50
|
-
*/
|
51
|
-
permanentId?: string;
|
52
|
-
/**
|
53
|
-
* The unique identifier (URI) of the parent item.
|
54
|
-
*
|
55
|
-
* Specifying a value for this key creates a relationship between the attachment item (child) and its parent item.
|
56
|
-
*
|
57
|
-
* This value also ensures that a parent and all of its attachments will be routed in the same index slice.
|
58
|
-
*/
|
59
|
-
parentId?: string;
|
60
|
-
/**
|
61
|
-
* The textual (non-binary) content of the item.
|
62
|
-
*
|
63
|
-
* Whenever you're pushing a compressed binary item (such as XML/HTML, PDF, Word, or binary), you should use the CompressedBinaryData or CompressedBinaryDataFileId attribute instead, depending on the content size.
|
64
|
-
*
|
65
|
-
* Accepts 5 MB or less of uncompressed textual data.
|
66
|
-
*
|
67
|
-
* See https://docs.coveo.com/en/73 for more information.
|
68
|
-
*
|
69
|
-
* Example: `This is a simple string that will be used for searchability as well as to generate excerpt and summaries for the document.`
|
70
|
-
*/
|
71
|
-
data?: string;
|
72
|
-
/**
|
73
|
-
* The original binary item content, compressed using one of the supported compression types (Deflate, GZip, LZMA, Uncompressed, or ZLib), and then Base64 encoded.
|
74
|
-
*
|
75
|
-
* You can use this parameter when you're pushing a compressed binary item (such as XML/HTML, PDF, Word, or binary) whose size is less than 5 MB.
|
76
|
-
*
|
77
|
-
* Whenever you're pushing an item whose size is 5 MB or more, use the CompressedBinaryDataFileIdproperty instead.
|
78
|
-
*
|
79
|
-
* If you're pushing less than 5 MB of textual (non-binary) content, you can use the data property instead.
|
80
|
-
*
|
81
|
-
* See https://docs.coveo.com/en/73 for more information.
|
82
|
-
*/
|
83
|
-
compressedBinaryData?: {
|
84
|
-
/**
|
85
|
-
* The compression type that was applied to your document.
|
86
|
-
*/
|
87
|
-
compressionType: CompressionType;
|
88
|
-
/**
|
89
|
-
* The base64 encoded binary data.
|
90
|
-
*
|
91
|
-
* Example: `eJxzrUjMLchJBQAK4ALN`
|
92
|
-
*/
|
93
|
-
data: string;
|
94
|
-
};
|
95
|
-
/**
|
96
|
-
* The metadata key-value pairs for a given document.
|
97
|
-
*
|
98
|
-
* Each metadata in the document must be unique.
|
99
|
-
*
|
100
|
-
* Metadata are case-insensitive (e.g., the Push API considers mykey, MyKey, myKey, MYKEY, etc. as identical).
|
101
|
-
*
|
102
|
-
* See https://docs.coveo.com/en/115 for more information.
|
103
|
-
*/
|
104
|
-
metadata?: Metadata;
|
105
|
-
/**
|
106
|
-
* The list of permission sets for this item.
|
107
|
-
*
|
108
|
-
* This is useful when item based security is required (i.e., when security isn't configured at the source level).
|
109
|
-
*
|
110
|
-
* See https://docs.coveo.com/en/107 for more information.
|
111
|
-
*/
|
112
|
-
permissions?: Array<PermissionSet | PermissionLevel>;
|
113
|
-
/**
|
114
|
-
* The file extension of the data you're pushing.
|
115
|
-
*
|
116
|
-
* This is useful when pushing a compressed item. The converter uses this information to identify how to correctly process the item.
|
117
|
-
*
|
118
|
-
* Values must include the preceding . character.
|
119
|
-
*
|
120
|
-
* Example: `.html`
|
121
|
-
*/
|
122
|
-
fileExtension?: string;
|
123
|
-
}
|
124
|
-
export {};
|
1
|
+
import { PermissionLevel, PermissionSet } from '@coveo/platform-client';
|
2
|
+
type BaseMetadataValue = string | string[] | number | number[] | boolean;
|
3
|
+
type DictionaryMetadataValue = Record<string, BaseMetadataValue>;
|
4
|
+
export type MetadataValue = BaseMetadataValue | DictionaryMetadataValue;
|
5
|
+
export type Metadata = Record<string, MetadataValue>;
|
6
|
+
/**
|
7
|
+
* The compression type that was applied to your compressed document.
|
8
|
+
*/
|
9
|
+
export type CompressionType = 'UNCOMPRESSED' | 'DEFLATE' | 'GZIP' | 'LZMA' | 'ZLIB';
|
10
|
+
/**
|
11
|
+
* A Coveo document.
|
12
|
+
*/
|
13
|
+
export interface Document {
|
14
|
+
/**
|
15
|
+
* The Uniform Resource Identifier (URI) that uniquely identifies the document in a Coveo index.
|
16
|
+
*
|
17
|
+
* Examples:
|
18
|
+
* - `http://www.example.com/`
|
19
|
+
* - `file://folder/text.txt`
|
20
|
+
*/
|
21
|
+
uri: string;
|
22
|
+
/**
|
23
|
+
* The title of the document.
|
24
|
+
*/
|
25
|
+
title: string;
|
26
|
+
/**
|
27
|
+
* The clickable URI associated with the document.
|
28
|
+
*/
|
29
|
+
clickableUri?: string;
|
30
|
+
/**
|
31
|
+
* The author of the document.
|
32
|
+
*/
|
33
|
+
author?: string;
|
34
|
+
/**
|
35
|
+
* The date of the document, represented as an ISO string.
|
36
|
+
*
|
37
|
+
* Optional, will default to indexation date.
|
38
|
+
*/
|
39
|
+
date?: string;
|
40
|
+
/**
|
41
|
+
* The modified date of the document, represented as an ISO string.
|
42
|
+
*
|
43
|
+
* Optional, will default to indexation date.
|
44
|
+
*/
|
45
|
+
modifiedDate?: string;
|
46
|
+
/**
|
47
|
+
* The permanent identifier of a document that does not change over time.
|
48
|
+
*
|
49
|
+
* Optional, will be derived from the document URI.
|
50
|
+
*/
|
51
|
+
permanentId?: string;
|
52
|
+
/**
|
53
|
+
* The unique identifier (URI) of the parent item.
|
54
|
+
*
|
55
|
+
* Specifying a value for this key creates a relationship between the attachment item (child) and its parent item.
|
56
|
+
*
|
57
|
+
* This value also ensures that a parent and all of its attachments will be routed in the same index slice.
|
58
|
+
*/
|
59
|
+
parentId?: string;
|
60
|
+
/**
|
61
|
+
* The textual (non-binary) content of the item.
|
62
|
+
*
|
63
|
+
* Whenever you're pushing a compressed binary item (such as XML/HTML, PDF, Word, or binary), you should use the CompressedBinaryData or CompressedBinaryDataFileId attribute instead, depending on the content size.
|
64
|
+
*
|
65
|
+
* Accepts 5 MB or less of uncompressed textual data.
|
66
|
+
*
|
67
|
+
* See https://docs.coveo.com/en/73 for more information.
|
68
|
+
*
|
69
|
+
* Example: `This is a simple string that will be used for searchability as well as to generate excerpt and summaries for the document.`
|
70
|
+
*/
|
71
|
+
data?: string;
|
72
|
+
/**
|
73
|
+
* The original binary item content, compressed using one of the supported compression types (Deflate, GZip, LZMA, Uncompressed, or ZLib), and then Base64 encoded.
|
74
|
+
*
|
75
|
+
* You can use this parameter when you're pushing a compressed binary item (such as XML/HTML, PDF, Word, or binary) whose size is less than 5 MB.
|
76
|
+
*
|
77
|
+
* Whenever you're pushing an item whose size is 5 MB or more, use the CompressedBinaryDataFileIdproperty instead.
|
78
|
+
*
|
79
|
+
* If you're pushing less than 5 MB of textual (non-binary) content, you can use the data property instead.
|
80
|
+
*
|
81
|
+
* See https://docs.coveo.com/en/73 for more information.
|
82
|
+
*/
|
83
|
+
compressedBinaryData?: {
|
84
|
+
/**
|
85
|
+
* The compression type that was applied to your document.
|
86
|
+
*/
|
87
|
+
compressionType: CompressionType;
|
88
|
+
/**
|
89
|
+
* The base64 encoded binary data.
|
90
|
+
*
|
91
|
+
* Example: `eJxzrUjMLchJBQAK4ALN`
|
92
|
+
*/
|
93
|
+
data: string;
|
94
|
+
};
|
95
|
+
/**
|
96
|
+
* The metadata key-value pairs for a given document.
|
97
|
+
*
|
98
|
+
* Each metadata in the document must be unique.
|
99
|
+
*
|
100
|
+
* Metadata are case-insensitive (e.g., the Push API considers mykey, MyKey, myKey, MYKEY, etc. as identical).
|
101
|
+
*
|
102
|
+
* See https://docs.coveo.com/en/115 for more information.
|
103
|
+
*/
|
104
|
+
metadata?: Metadata;
|
105
|
+
/**
|
106
|
+
* The list of permission sets for this item.
|
107
|
+
*
|
108
|
+
* This is useful when item based security is required (i.e., when security isn't configured at the source level).
|
109
|
+
*
|
110
|
+
* See https://docs.coveo.com/en/107 for more information.
|
111
|
+
*/
|
112
|
+
permissions?: Array<PermissionSet | PermissionLevel>;
|
113
|
+
/**
|
114
|
+
* The file extension of the data you're pushing.
|
115
|
+
*
|
116
|
+
* This is useful when pushing a compressed item. The converter uses this information to identify how to correctly process the item.
|
117
|
+
*
|
118
|
+
* Values must include the preceding . character.
|
119
|
+
*
|
120
|
+
* Example: `.html`
|
121
|
+
*/
|
122
|
+
fileExtension?: string;
|
123
|
+
}
|
124
|
+
export {};
|