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

chore: fix upload endpoint #48

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "getindexify",
"version": "0.0.66",
"version": "0.0.67",
"description": "This is the TypeScript client for interacting with the Indexify service.",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
18 changes: 11 additions & 7 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,18 +406,22 @@ class IndexifyClient {
formData,
{
params: { id: newContentId },
headers: { "Content-Type": "multipart/form-data" }
headers: {
"Content-Type": "multipart/form-data",
"accept": "*/*"
}
}
);

contentId = response.data.content_id;
}
contentId = response.data.content_id || newContentId;

if (contentId) {
return contentId;
}

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

return contentId;
throw new Error("No content ID was retrieved from the extraction process");
}

async getExtractionGraphs(): Promise<ExtractionGraph[]> {
Expand Down Expand Up @@ -473,7 +477,7 @@ class IndexifyClient {
for (const contentId of ids) {
try {
const response = await this.client.get(
`namespaces/${this.namespace}/content/${contentId}/wait`
`/content/${contentId}/wait`
);

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