Skip to content

Commit fc1894a

Browse files
refactor(types): replace Record with mapped types
1 parent 2fd06f7 commit fc1894a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/resources/documents.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export namespace DocumentGetInfoResponse {
153153
| 'parsing_failed'
154154
| 'indexing_failed';
155155

156-
metadata: Record<string, string | Array<string>>;
156+
metadata: { [key: string]: string | Array<string> };
157157

158158
/**
159159
* The number of pages in this document. This will be `null` if the document is
@@ -201,7 +201,7 @@ export interface DocumentGetInfoListResponse {
201201
| 'parsing_failed'
202202
| 'indexing_failed';
203203

204-
metadata: Record<string, string | Array<string>>;
204+
metadata: { [key: string]: string | Array<string> };
205205

206206
/**
207207
* The number of pages in this document. This will be `null` if the document is
@@ -280,7 +280,7 @@ export interface DocumentUpdateParams {
280280
* need to provide the entire metadata object (Both the original fields, and the
281281
* new field).
282282
*/
283-
metadata?: Record<string, string | Array<string>> | null;
283+
metadata?: { [key: string]: string | Array<string> } | null;
284284
}
285285

286286
export interface DocumentDeleteParams {
@@ -331,7 +331,7 @@ export interface DocumentAddParams {
331331
* NOTE: The UTF-8-encoded JSON string must be less than 65536 bytes (Whitespace
332332
* does not count). This limit can be increased upon request.
333333
*/
334-
metadata?: Record<string, string | Array<string>>;
334+
metadata?: { [key: string]: string | Array<string> };
335335

336336
/**
337337
* Setting this property to true will put this endpoint in "upsert" mode: If the

src/resources/queries.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export namespace QueryTopDocumentsResponse {
5454
/**
5555
* The metadata for that document. Will be `None` if `include_metadata` is `False`.
5656
*/
57-
metadata: Record<string, string | Array<string>> | null;
57+
metadata: { [key: string]: string | Array<string> } | null;
5858

5959
/**
6060
* The path of the document.
@@ -145,7 +145,7 @@ export namespace QueryTopSnippetsResponse {
145145
/**
146146
* The metadata for that document. Will be `None` if `include_metadata` is `False`.
147147
*/
148-
metadata: Record<string, string | Array<string>> | null;
148+
metadata: { [key: string]: string | Array<string> } | null;
149149

150150
/**
151151
* The path of the document.
@@ -223,7 +223,7 @@ export interface QueryTopDocumentsParams {
223223
* The query filter to apply. Please read [Metadata Filtering](/metadata-filtering)
224224
* for more information. If not provided, then all documents will be searched.
225225
*/
226-
filter?: Record<string, unknown> | null;
226+
filter?: { [key: string]: unknown } | null;
227227

228228
/**
229229
* Whether or not to include the metadata in the top documents response. If not
@@ -264,7 +264,7 @@ export interface QueryTopPagesParams {
264264
* The query filter to apply. Please read [Metadata Filtering](/metadata-filtering)
265265
* for more information. If not provided, then all documents will be searched.
266266
*/
267-
filter?: Record<string, unknown> | null;
267+
filter?: { [key: string]: unknown } | null;
268268

269269
/**
270270
* If set to true, then the content of all pages will be returned.
@@ -304,7 +304,7 @@ export interface QueryTopSnippetsParams {
304304
* The query filter to apply. Please read [Metadata Filtering](/metadata-filtering)
305305
* for more information. If not provided, then all documents will be searched.
306306
*/
307-
filter?: Record<string, unknown> | null;
307+
filter?: { [key: string]: unknown } | null;
308308

309309
/**
310310
* If true, the `document_results` returns will additionally contain document

0 commit comments

Comments
 (0)