Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Commit 9fec1fe

Browse files
Merge pull request #48 from tensorlakeai/feat/fix-upload
chore: fix upload endpoint
2 parents 33e482b + 24cab9f commit 9fec1fe

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "getindexify",
3-
"version": "0.0.66",
3+
"version": "0.0.67",
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

+11-7
Original file line numberDiff line numberDiff line change
@@ -406,18 +406,22 @@ class IndexifyClient {
406406
formData,
407407
{
408408
params: { id: newContentId },
409-
headers: { "Content-Type": "multipart/form-data" }
409+
headers: {
410+
"Content-Type": "multipart/form-data",
411+
"accept": "*/*"
412+
}
410413
}
411414
);
412415

413-
contentId = response.data.content_id;
414-
}
416+
contentId = response.data.content_id || newContentId;
417+
418+
if (contentId) {
419+
return contentId;
420+
}
415421

416-
if (!contentId) {
417-
throw new Error("No content ID was retrieved from the extraction process");
418422
}
419423

420-
return contentId;
424+
throw new Error("No content ID was retrieved from the extraction process");
421425
}
422426

423427
async getExtractionGraphs(): Promise<ExtractionGraph[]> {
@@ -473,7 +477,7 @@ class IndexifyClient {
473477
for (const contentId of ids) {
474478
try {
475479
const response = await this.client.get(
476-
`namespaces/${this.namespace}/content/${contentId}/wait`
480+
`/content/${contentId}/wait`
477481
);
478482

479483
console.log("Extraction completed for content id: ", contentId);

0 commit comments

Comments
 (0)