Skip to content
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.2"
".": "0.1.0-alpha.3"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 13
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zeroentropy%2Fzeroentropy-79503f9599a8cf36cc6b746114d49c484fc8615cf4d8ef979dc299a88d3045d0.yml
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/zeroentropy%2Fzeroentropy-99a41bb73e432cb47fe1937219b3c7b109ae534456e8dd019cc00cc1e6018a16.yml
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 0.1.0-alpha.3 (2025-01-28)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/zeroentropy-ai/zeroentropy-node/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)

### Chores

* go live ([#16](https://github.com/zeroentropy-ai/zeroentropy-node/issues/16)) ([78b6967](https://github.com/zeroentropy-ai/zeroentropy-node/commit/78b6967a40788b16bd97cca17cbbb0d567e298e7))
* go live ([#18](https://github.com/zeroentropy-ai/zeroentropy-node/issues/18)) ([a0d2514](https://github.com/zeroentropy-ai/zeroentropy-node/commit/a0d2514ae66f0fc6cde76a6da1d05cab7a13ba19))
* go live ([#19](https://github.com/zeroentropy-ai/zeroentropy-node/issues/19)) ([b0dfe9f](https://github.com/zeroentropy-ai/zeroentropy-node/commit/b0dfe9f277b39876350fe1accee6ec22a9c24e72))
* trigger release process ([b20b8f3](https://github.com/zeroentropy-ai/zeroentropy-node/commit/b20b8f393f4c3697bb1cfdee7f135a2b39407331))

## 0.1.0-alpha.2 (2025-01-18)

Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/zeroentropy-ai/zeroentropy-node/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
Expand Down
12 changes: 12 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Admin

Types:

- <code><a href="./src/resources/admin.ts">AdminCreateOrganizationResponse</a></code>

Methods:

- <code title="post /admin/create-organization">client.admin.<a href="./src/resources/admin.ts">createOrganization</a>({ ...params }) -> AdminCreateOrganizationResponse</code>

# Status

Types:
Expand Down Expand Up @@ -26,6 +36,7 @@ Methods:

Types:

- <code><a href="./src/resources/documents.ts">DocumentUpdateResponse</a></code>
- <code><a href="./src/resources/documents.ts">DocumentDeleteResponse</a></code>
- <code><a href="./src/resources/documents.ts">DocumentAddResponse</a></code>
- <code><a href="./src/resources/documents.ts">DocumentGetInfoResponse</a></code>
Expand All @@ -34,6 +45,7 @@ Types:

Methods:

- <code title="post /documents/update-document">client.documents.<a href="./src/resources/documents.ts">update</a>({ ...params }) -> DocumentUpdateResponse</code>
- <code title="post /documents/delete-document">client.documents.<a href="./src/resources/documents.ts">delete</a>({ ...params }) -> DocumentDeleteResponse</code>
- <code title="post /documents/add-document">client.documents.<a href="./src/resources/documents.ts">add</a>({ ...params }) -> DocumentAddResponse</code>
- <code title="post /documents/get-document-info">client.documents.<a href="./src/resources/documents.ts">getInfo</a>({ ...params }) -> DocumentGetInfoResponse</code>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zeroentropy",
"version": "0.1.0-alpha.2",
"version": "0.1.0-alpha.3",
"description": "The official TypeScript library for the ZeroEntropy API",
"author": "ZeroEntropy <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
13 changes: 13 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as Pagination from './pagination';
import { type GetDocumentInfoListCursorParams, GetDocumentInfoListCursorResponse } from './pagination';
import * as Uploads from './uploads';
import * as API from './resources/index';
import { Admin, AdminCreateOrganizationParams, AdminCreateOrganizationResponse } from './resources/admin';
import {
CollectionAddParams,
CollectionAddResponse,
Expand All @@ -28,6 +29,8 @@ import {
DocumentGetInfoResponse,
DocumentGetPageInfoParams,
DocumentGetPageInfoResponse,
DocumentUpdateParams,
DocumentUpdateResponse,
Documents,
} from './resources/documents';
import { ParserParseDocumentParams, ParserParseDocumentResponse, Parsers } from './resources/parsers';
Expand Down Expand Up @@ -155,6 +158,7 @@ export class ZeroEntropy extends Core.APIClient {
this.apiKey = apiKey;
}

admin: API.Admin = new API.Admin(this);
status: API.Status = new API.Status(this);
collections: API.Collections = new API.Collections(this);
documents: API.Documents = new API.Documents(this);
Expand Down Expand Up @@ -197,6 +201,7 @@ export class ZeroEntropy extends Core.APIClient {
static fileFromPath = Uploads.fileFromPath;
}

ZeroEntropy.Admin = Admin;
ZeroEntropy.Status = Status;
ZeroEntropy.Collections = Collections;
ZeroEntropy.Documents = Documents;
Expand All @@ -213,6 +218,12 @@ export declare namespace ZeroEntropy {
type GetDocumentInfoListCursorResponse as GetDocumentInfoListCursorResponse,
};

export {
Admin as Admin,
type AdminCreateOrganizationResponse as AdminCreateOrganizationResponse,
type AdminCreateOrganizationParams as AdminCreateOrganizationParams,
};

export {
Status as Status,
type StatusGetStatusResponse as StatusGetStatusResponse,
Expand All @@ -231,12 +242,14 @@ export declare namespace ZeroEntropy {

export {
Documents as Documents,
type DocumentUpdateResponse as DocumentUpdateResponse,
type DocumentDeleteResponse as DocumentDeleteResponse,
type DocumentAddResponse as DocumentAddResponse,
type DocumentGetInfoResponse as DocumentGetInfoResponse,
type DocumentGetInfoListResponse as DocumentGetInfoListResponse,
type DocumentGetPageInfoResponse as DocumentGetPageInfoResponse,
DocumentGetInfoListResponsesGetDocumentInfoListCursor as DocumentGetInfoListResponsesGetDocumentInfoListCursor,
type DocumentUpdateParams as DocumentUpdateParams,
type DocumentDeleteParams as DocumentDeleteParams,
type DocumentAddParams as DocumentAddParams,
type DocumentGetInfoParams as DocumentGetInfoParams,
Expand Down
46 changes: 46 additions & 0 deletions src/resources/admin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../resource';
import * as Core from '../core';

export class Admin extends APIResource {
/**
* Creates or updates an organization with the provided organization name. An API
* Key will be returned.
*
* Returns 201 if a new organization was created, 200 if an existing organization
* was found.
*/
createOrganization(
body: AdminCreateOrganizationParams,
options?: Core.RequestOptions,
): Core.APIPromise<AdminCreateOrganizationResponse> {
return this._client.post('/admin/create-organization', { body, ...options });
}
}

export interface AdminCreateOrganizationResponse {
/**
* The API Key for this organization.
*/
api_key: string;

/**
* The name of the organization
*/
organization_name: string;
}

export interface AdminCreateOrganizationParams {
/**
* The orgniazation name to create. Must be unique.
*/
organization_name: string;
}

export declare namespace Admin {
export {
type AdminCreateOrganizationResponse as AdminCreateOrganizationResponse,
type AdminCreateOrganizationParams as AdminCreateOrganizationParams,
};
}
94 changes: 72 additions & 22 deletions src/resources/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ import * as Core from '../core';
import { GetDocumentInfoListCursor, type GetDocumentInfoListCursorParams } from '../pagination';

export class Documents extends APIResource {
/**
* Updates a document. This endpoint is atomic.
*
* The only attribute currently supported for update is `metadata`. This endpoint
* can only be called with a non-null `metadata` if the document status is
* `indexed`.
*
* Sometimes, when updating a document, a new document ID will be assigned and the
* previous will be deleted. For this reason, the previous and the new document ID
* will both be returned in the response. If the document ID was not updated, then
* these two IDs will be identical.
*
* A `404 Not Found` status code will be returned, if the provided collection name
* or document path does not exist.
*/
update(body: DocumentUpdateParams, options?: Core.RequestOptions): Core.APIPromise<DocumentUpdateResponse> {
return this._client.post('/documents/update-document', { body, ...options });
}

/**
* Deletes a document
*
Expand Down Expand Up @@ -86,6 +105,12 @@ export class Documents extends APIResource {

export class DocumentGetInfoListResponsesGetDocumentInfoListCursor extends GetDocumentInfoListCursor<DocumentGetInfoListResponse> {}

export interface DocumentUpdateResponse {
new_id: string;

previous_id: string;
}

export interface DocumentDeleteResponse {
/**
* This string will always be "Success!". This may change in the future.
Expand All @@ -110,7 +135,14 @@ export namespace DocumentGetInfoResponse {

collection_name: string;

index_status: 'parsing_failed' | 'not_parsed' | 'not_indexed' | 'indexing' | 'indexed';
index_status:
| 'not_parsed'
| 'parsing'
| 'not_indexed'
| 'indexing'
| 'indexed'
| 'parsing_failed'
| 'indexing_failed';

metadata: Record<string, string | Array<string>>;

Expand All @@ -135,7 +167,14 @@ export interface DocumentGetInfoListResponse {

collection_name: string;

index_status: 'parsing_failed' | 'not_parsed' | 'not_indexed' | 'indexing' | 'indexed';
index_status:
| 'not_parsed'
| 'parsing'
| 'not_indexed'
| 'indexing'
| 'indexed'
| 'parsing_failed'
| 'indexing_failed';

metadata: Record<string, string | Array<string>>;

Expand All @@ -162,6 +201,14 @@ export namespace DocumentGetPageInfoResponse {
*/
collection_name: string;

/**
* A URL to an image of the page. This field will only be provided if the document
* has finished parsing, and if it is a filetype that is capable of producing
* images (e.g. PDF, DOCX, PPT, etc). In all other cases, this field will be
* `null`.
*/
image_url: string | null;

/**
* The specific page index of this page. Pages are 0-indexed, so that the 1st page
* of a PDF is of page index 0.
Expand All @@ -179,18 +226,30 @@ export namespace DocumentGetPageInfoResponse {
* will be set to `null`.
*/
content?: string | null;

/**
* An image of the page. This will be a base64-encoded string. Currently, this data
* is guaranteed to be a JPEG-encoded image. This field will only be provided if
* `include_image` was set to `true`, and the document has finished parsing. Also,
* the document must be a datatype that supports images (PDF, DOCX, PPT, but not
* .txt). In all other cases, this field will be `null`.
*/
image_base64_data?: string | null;
}
}

export interface DocumentUpdateParams {
/**
* The name of the collection.
*/
collection_name: string;

/**
* The filepath of the document that you are updating. A `404 Not Found` status
* code will be returned if no document with this path was found.
*/
path: string;

/**
* If this field is provided, the given metadata json will replace the document's
* existing metadata json. In other words, if you want to add a new field, you will
* need to provide the entire metadata object (Both the original fields, and the
* new field).
*/
metadata?: Record<string, string | Array<string>> | null;
}

export interface DocumentDeleteParams {
/**
* The name of the collection.
Expand Down Expand Up @@ -343,30 +402,21 @@ export interface DocumentGetPageInfoParams {
* rather than `null`. This string will contain the full contents of the page.
*/
include_content?: boolean;

/**
* If `true`, then the response will have the `image_base64_data` attribute be a
* `string`\*, rather than `null`. This string will contain the image data of the
* document, as a base64-encoded string. Currently, this data is guaranteed to be a
* JPEG-encoded image.
*
* \*Note that the response may still be `null`, if the page has no image data,
* such as if the document was uploaded with raw text rather than as a PDF.
*/
include_image?: boolean;
}

Documents.DocumentGetInfoListResponsesGetDocumentInfoListCursor =
DocumentGetInfoListResponsesGetDocumentInfoListCursor;

export declare namespace Documents {
export {
type DocumentUpdateResponse as DocumentUpdateResponse,
type DocumentDeleteResponse as DocumentDeleteResponse,
type DocumentAddResponse as DocumentAddResponse,
type DocumentGetInfoResponse as DocumentGetInfoResponse,
type DocumentGetInfoListResponse as DocumentGetInfoListResponse,
type DocumentGetPageInfoResponse as DocumentGetPageInfoResponse,
DocumentGetInfoListResponsesGetDocumentInfoListCursor as DocumentGetInfoListResponsesGetDocumentInfoListCursor,
type DocumentUpdateParams as DocumentUpdateParams,
type DocumentDeleteParams as DocumentDeleteParams,
type DocumentAddParams as DocumentAddParams,
type DocumentGetInfoParams as DocumentGetInfoParams,
Expand Down
3 changes: 3 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Admin, type AdminCreateOrganizationResponse, type AdminCreateOrganizationParams } from './admin';
export {
Collections,
type CollectionDeleteResponse,
Expand All @@ -12,11 +13,13 @@ export {
export {
DocumentGetInfoListResponsesGetDocumentInfoListCursor,
Documents,
type DocumentUpdateResponse,
type DocumentDeleteResponse,
type DocumentAddResponse,
type DocumentGetInfoResponse,
type DocumentGetInfoListResponse,
type DocumentGetPageInfoResponse,
type DocumentUpdateParams,
type DocumentDeleteParams,
type DocumentAddParams,
type DocumentGetInfoParams,
Expand Down
Loading
Loading