Skip to content

Commit

Permalink
Merge pull request #48 from tensorlakeai/feat/fix-upload
Browse files Browse the repository at this point in the history
chore: fix upload endpoint
  • Loading branch information
adithyaakrishna authored Aug 2, 2024
2 parents 33e482b + 24cab9f commit 9fec1fe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
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

0 comments on commit 9fec1fe

Please sign in to comment.