@coveo/push-api-client 3.0.122 → 3.0.124

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 (129) hide show
  1. package/dist/APICore.js +47 -47
  2. package/dist/definitions/APICore.d.ts +18 -18
  3. package/dist/definitions/document.d.ts +124 -124
  4. package/dist/definitions/documentBuilder.d.ts +168 -168
  5. package/dist/definitions/documentBuilder.spec.d.ts +1 -1
  6. package/dist/definitions/environment.d.ts +16 -16
  7. package/dist/definitions/errors/baseError.d.ts +4 -4
  8. package/dist/definitions/errors/fieldErrors.d.ts +18 -18
  9. package/dist/definitions/errors/index.d.ts +3 -3
  10. package/dist/definitions/errors/privilegeError.d.ts +6 -6
  11. package/dist/definitions/errors/validatorErrors.d.ts +20 -20
  12. package/dist/definitions/fieldAnalyser/fieldAnalyser.d.ts +36 -36
  13. package/dist/definitions/fieldAnalyser/fieldAnalyser.spec.d.ts +1 -1
  14. package/dist/definitions/fieldAnalyser/fieldStore.d.ts +5 -5
  15. package/dist/definitions/fieldAnalyser/fieldUtils.d.ts +6 -6
  16. package/dist/definitions/fieldAnalyser/fieldsUtils.spec.d.ts +1 -1
  17. package/dist/definitions/fieldAnalyser/inconsistencies.d.ts +5 -5
  18. package/dist/definitions/fieldAnalyser/inconsistencies.spec.d.ts +1 -1
  19. package/dist/definitions/fieldAnalyser/typeUtils.d.ts +3 -3
  20. package/dist/definitions/fieldAnalyser/typeUtils.spec.d.ts +1 -1
  21. package/dist/definitions/help/file.d.ts +3 -3
  22. package/dist/definitions/help/file.spec.d.ts +1 -1
  23. package/dist/definitions/help/fileConsumer.d.ts +31 -31
  24. package/dist/definitions/help/fileConsumer.spec.d.ts +1 -1
  25. package/dist/definitions/help/fileContainer.d.ts +8 -8
  26. package/dist/definitions/help/fileContainer.spec.d.ts +1 -1
  27. package/dist/definitions/help/function.d.ts +1 -1
  28. package/dist/definitions/help/generator.d.ts +11 -11
  29. package/dist/definitions/help/generator.spec.d.ts +1 -1
  30. package/dist/definitions/help/urlUtils.d.ts +27 -27
  31. package/dist/definitions/help/urlUtils.spec.d.ts +1 -1
  32. package/dist/definitions/index.d.ts +14 -14
  33. package/dist/definitions/interfaces.d.ts +70 -70
  34. package/dist/definitions/localtest.d.ts +1 -1
  35. package/dist/definitions/permissionSetBuilder.d.ts +34 -34
  36. package/dist/definitions/permissionSetBuilder.spec.d.ts +1 -1
  37. package/dist/definitions/securityIdentityBuilder.d.ts +105 -105
  38. package/dist/definitions/securityIdentityBuilder.spec.d.ts +1 -1
  39. package/dist/definitions/source/batchUploadDocumentsFromFile.d.ts +11 -11
  40. package/dist/definitions/source/batchUploadDocumentsFromFile.spec.d.ts +1 -1
  41. package/dist/definitions/source/catalog.d.ts +70 -70
  42. package/dist/definitions/source/catalog.spec.d.ts +1 -1
  43. package/dist/definitions/source/documentUploader.d.ts +11 -11
  44. package/dist/definitions/source/documentUploader.spec.d.ts +1 -1
  45. package/dist/definitions/source/push.d.ts +87 -87
  46. package/dist/definitions/source/push.spec.d.ts +1 -1
  47. package/dist/definitions/source/securityIdenty.d.ts +43 -43
  48. package/dist/definitions/uploadStrategy/fileContainerStrategy.d.ts +23 -23
  49. package/dist/definitions/uploadStrategy/fileContainerStrategy.spec.d.ts +1 -1
  50. package/dist/definitions/uploadStrategy/index.d.ts +3 -3
  51. package/dist/definitions/uploadStrategy/strategy.d.ts +23 -23
  52. package/dist/definitions/uploadStrategy/streamChunkStrategy.d.ts +28 -28
  53. package/dist/definitions/uploadStrategy/streamChunkStrategy.spec.d.ts +1 -1
  54. package/dist/definitions/validation/caseInsensitiveDocument.d.ts +13 -13
  55. package/dist/definitions/validation/knownKey.d.ts +10 -10
  56. package/dist/definitions/validation/parseFile.d.ts +4 -4
  57. package/dist/definitions/validation/parseFile.spec.d.ts +1 -1
  58. package/dist/definitions/validation/parsePermissions.d.ts +5 -5
  59. package/dist/definitions/validation/parsePermissions.spec.d.ts +1 -1
  60. package/dist/definitions/validation/preconditions/apiKeyPrivilege.d.ts +3 -3
  61. package/dist/definitions/validation/preconditions/apiKeyPrivilege.spec.d.ts +1 -1
  62. package/dist/definitions/validation/preconditions/platformPrivilege.d.ts +7 -7
  63. package/dist/definitions/validation/requiredKeyValidator.d.ts +17 -17
  64. package/dist/definitions/validation/transformers/transformer.d.ts +31 -31
  65. package/dist/definitions/validation/transformers/transformer.spec.d.ts +1 -1
  66. package/dist/document.js +2 -2
  67. package/dist/documentBuilder.js +292 -292
  68. package/dist/documentBuilder.spec.js +191 -191
  69. package/dist/environment.js +41 -41
  70. package/dist/errors/baseError.js +10 -10
  71. package/dist/errors/fieldErrors.js +42 -42
  72. package/dist/errors/index.js +19 -19
  73. package/dist/errors/privilegeError.js +12 -12
  74. package/dist/errors/validatorErrors.js +40 -40
  75. package/dist/fieldAnalyser/fieldAnalyser.js +95 -95
  76. package/dist/fieldAnalyser/fieldAnalyser.spec.js +230 -230
  77. package/dist/fieldAnalyser/fieldStore.js +21 -21
  78. package/dist/fieldAnalyser/fieldUtils.js +41 -41
  79. package/dist/fieldAnalyser/fieldsUtils.spec.js +116 -116
  80. package/dist/fieldAnalyser/inconsistencies.js +14 -14
  81. package/dist/fieldAnalyser/inconsistencies.spec.js +40 -40
  82. package/dist/fieldAnalyser/typeUtils.js +61 -61
  83. package/dist/fieldAnalyser/typeUtils.spec.js +142 -142
  84. package/dist/help/file.js +37 -37
  85. package/dist/help/file.spec.js +67 -67
  86. package/dist/help/fileConsumer.js +150 -150
  87. package/dist/help/fileConsumer.spec.js +153 -153
  88. package/dist/help/fileContainer.js +48 -48
  89. package/dist/help/fileContainer.spec.js +65 -65
  90. package/dist/help/function.js +5 -5
  91. package/dist/help/generator.js +32 -32
  92. package/dist/help/generator.spec.js +82 -82
  93. package/dist/help/urlUtils.js +42 -42
  94. package/dist/help/urlUtils.spec.js +41 -41
  95. package/dist/index.js +38 -38
  96. package/dist/interfaces.js +2 -2
  97. package/dist/localtest.js +55 -55
  98. package/dist/permissionSetBuilder.js +58 -58
  99. package/dist/permissionSetBuilder.spec.js +68 -68
  100. package/dist/securityIdentityBuilder.js +128 -128
  101. package/dist/securityIdentityBuilder.spec.js +50 -50
  102. package/dist/source/batchUploadDocumentsFromFile.js +46 -46
  103. package/dist/source/batchUploadDocumentsFromFile.spec.js +145 -145
  104. package/dist/source/catalog.js +111 -111
  105. package/dist/source/catalog.spec.js +64 -64
  106. package/dist/source/documentUploader.js +45 -45
  107. package/dist/source/documentUploader.spec.js +118 -118
  108. package/dist/source/push.js +140 -140
  109. package/dist/source/push.spec.js +152 -152
  110. package/dist/source/securityIdenty.js +57 -57
  111. package/dist/uploadStrategy/fileContainerStrategy.js +32 -32
  112. package/dist/uploadStrategy/fileContainerStrategy.spec.js +86 -86
  113. package/dist/uploadStrategy/index.js +19 -19
  114. package/dist/uploadStrategy/strategy.js +2 -2
  115. package/dist/uploadStrategy/streamChunkStrategy.js +52 -52
  116. package/dist/uploadStrategy/streamChunkStrategy.spec.js +77 -77
  117. package/dist/validation/caseInsensitiveDocument.js +31 -31
  118. package/dist/validation/knownKey.js +37 -37
  119. package/dist/validation/parseFile.js +120 -120
  120. package/dist/validation/parseFile.spec.js +96 -96
  121. package/dist/validation/parsePermissions.js +118 -118
  122. package/dist/validation/parsePermissions.spec.js +86 -86
  123. package/dist/validation/preconditions/apiKeyPrivilege.js +20 -20
  124. package/dist/validation/preconditions/apiKeyPrivilege.spec.js +66 -66
  125. package/dist/validation/preconditions/platformPrivilege.js +32 -32
  126. package/dist/validation/requiredKeyValidator.js +61 -61
  127. package/dist/validation/transformers/transformer.js +51 -51
  128. package/dist/validation/transformers/transformer.spec.js +21 -21
  129. package/package.json +4 -4
@@ -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 {};