Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9713fd5

Browse files
authoredApr 29, 2024
add optional id param to ingestRemoteFile (#23)
1 parent 12f530a commit 9713fd5

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed
 

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "getindexify",
3-
"version": "0.0.29",
3+
"version": "0.0.30",
44
"description": "This is the TypeScript client for interacting with the Indexify service.",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

‎src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,14 @@ class IndexifyClient {
360360
async ingestRemoteFile(
361361
url: string,
362362
mime_type: string,
363-
labels: Record<string, string>
363+
labels: Record<string, string>,
364+
id?: string
364365
): Promise<AxiosResponse> {
365366
const resp = await this.client.post("ingest_remote_file", {
366367
url,
367368
mime_type,
368369
labels,
370+
id,
369371
});
370372
return resp;
371373
}

‎src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export interface ITask {
8080
export interface IDocument {
8181
text: string;
8282
labels: Record<string, string>;
83+
id?: string;
8384
}
8485

8586
export interface ISearchIndexResponse {

‎tests/client.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ test("Get Extraction Policies", async () => {
163163
expect(policies.length).toBe(1);
164164
});
165165

166+
test("Ingest remote url", async () => {
167+
const client = await IndexifyClient.createClient();
168+
await client.ingestRemoteFile(
169+
"https://gif-search.diptanu-6d5.workers.dev/OlG-5EjOENZLvlxHcXXmT.gif",
170+
"image/gif",
171+
{},
172+
"5EjOENZLvlxHcXXmT"
173+
);
174+
});
175+
166176
// test.only("MTLS", async () => {
167177
// const fs = require("fs")
168178
// const https = require("https")

0 commit comments

Comments
 (0)
This repository has been archived.