@gpt-platform/client 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +54 -58
- package/dist/index.d.ts +54 -58
- package/dist/index.js +19 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -48
- package/dist/index.mjs.map +1 -1
- package/llms.txt +0 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2878,44 +2878,6 @@ type NotificationLog = {
|
|
|
2878
2878
|
};
|
|
2879
2879
|
type: string;
|
|
2880
2880
|
};
|
|
2881
|
-
/**
|
|
2882
|
-
* A "Resource object" representing a token
|
|
2883
|
-
*/
|
|
2884
|
-
type Token = {
|
|
2885
|
-
/**
|
|
2886
|
-
* An attributes object for a token
|
|
2887
|
-
*/
|
|
2888
|
-
attributes?: {
|
|
2889
|
-
/**
|
|
2890
|
-
* Field included by default.
|
|
2891
|
-
*/
|
|
2892
|
-
brand?: string | null | unknown;
|
|
2893
|
-
/**
|
|
2894
|
-
* Field included by default.
|
|
2895
|
-
*/
|
|
2896
|
-
exp_month?: number | null | unknown;
|
|
2897
|
-
/**
|
|
2898
|
-
* Field included by default.
|
|
2899
|
-
*/
|
|
2900
|
-
exp_year?: number | null | unknown;
|
|
2901
|
-
/**
|
|
2902
|
-
* Field included by default.
|
|
2903
|
-
*/
|
|
2904
|
-
last4?: string | null | unknown;
|
|
2905
|
-
/**
|
|
2906
|
-
* Field included by default.
|
|
2907
|
-
*/
|
|
2908
|
-
token?: string | null | unknown;
|
|
2909
|
-
};
|
|
2910
|
-
id: string;
|
|
2911
|
-
/**
|
|
2912
|
-
* A relationships object for a token
|
|
2913
|
-
*/
|
|
2914
|
-
relationships?: {
|
|
2915
|
-
[key: string]: never;
|
|
2916
|
-
};
|
|
2917
|
-
type: string;
|
|
2918
|
-
};
|
|
2919
2881
|
/**
|
|
2920
2882
|
* A "Resource object" representing a notification_method
|
|
2921
2883
|
*/
|
|
@@ -3510,13 +3472,17 @@ type Plan = {
|
|
|
3510
3472
|
*/
|
|
3511
3473
|
slug: string;
|
|
3512
3474
|
/**
|
|
3513
|
-
*
|
|
3475
|
+
* Storage included in plan (bytes). Free=1GB, Pro=10GB, Business=50GB, Enterprise=500GB. Field included by default.
|
|
3514
3476
|
*/
|
|
3515
|
-
|
|
3477
|
+
storage_included_bytes: number;
|
|
3516
3478
|
/**
|
|
3517
|
-
* Field included by default.
|
|
3479
|
+
* Hard ceiling in bytes. Prevents runaway bills. nil = unlimited. Field included by default.
|
|
3480
|
+
*/
|
|
3481
|
+
storage_max_bytes?: number | null | unknown;
|
|
3482
|
+
/**
|
|
3483
|
+
* Cents per GB-month overage. Free=0 (hard cap), Pro=25, Business=20, Enterprise=15. Field included by default.
|
|
3518
3484
|
*/
|
|
3519
|
-
|
|
3485
|
+
storage_overage_rate_cents?: number | null | unknown;
|
|
3520
3486
|
/**
|
|
3521
3487
|
* Field included by default.
|
|
3522
3488
|
*/
|
|
@@ -4555,6 +4521,11 @@ type Tenant = {
|
|
|
4555
4521
|
* Field included by default.
|
|
4556
4522
|
*/
|
|
4557
4523
|
slug: string;
|
|
4524
|
+
storage_quota_bytes?: number | null | unknown;
|
|
4525
|
+
/**
|
|
4526
|
+
* Tenant-set overage ceiling in bytes. nil = use plan max. Field included by default.
|
|
4527
|
+
*/
|
|
4528
|
+
storage_spending_cap_bytes?: number | null | unknown;
|
|
4558
4529
|
/**
|
|
4559
4530
|
* Cost in credits for training on a single document. Field included by default.
|
|
4560
4531
|
*/
|
|
@@ -7287,12 +7258,16 @@ type ExtractionDocument = {
|
|
|
7287
7258
|
* Overall classification confidence (0.0 to 1.0). Field included by default.
|
|
7288
7259
|
*/
|
|
7289
7260
|
classification_confidence?: number | null | unknown;
|
|
7261
|
+
/**
|
|
7262
|
+
* Processing stage: queue, active, output, errors
|
|
7263
|
+
*/
|
|
7264
|
+
processing_stage: "queue" | "active" | "output" | "errors" | "unknown";
|
|
7290
7265
|
/**
|
|
7291
7266
|
* Field included by default.
|
|
7292
7267
|
*/
|
|
7293
7268
|
uploaded_at?: string | null | unknown;
|
|
7294
7269
|
/**
|
|
7295
|
-
* Current processing stage
|
|
7270
|
+
* Current processing stage (reads processing_stage attribute). Field included by default.
|
|
7296
7271
|
*/
|
|
7297
7272
|
stage?: string | null | unknown;
|
|
7298
7273
|
/**
|
|
@@ -7303,6 +7278,10 @@ type ExtractionDocument = {
|
|
|
7303
7278
|
* Schema revision number used for extraction. Field included by default.
|
|
7304
7279
|
*/
|
|
7305
7280
|
schema_revision?: number | null | unknown;
|
|
7281
|
+
/**
|
|
7282
|
+
* FK to storage.storage_files — tracks the S3 file via StorageFile
|
|
7283
|
+
*/
|
|
7284
|
+
storage_file_id?: string | null | unknown;
|
|
7306
7285
|
/**
|
|
7307
7286
|
* Credits billed for processing this document. Field included by default.
|
|
7308
7287
|
*/
|
|
@@ -8005,12 +7984,20 @@ declare function createAgentsNamespace(rb: RequestBuilder): {
|
|
|
8005
7984
|
declare class GptClient extends BaseClient {
|
|
8006
7985
|
/** User authentication, profiles, and API key management */
|
|
8007
7986
|
readonly identity: {
|
|
8008
|
-
login: (email: string, password: string, options?: RequestOptions) => Promise<
|
|
8009
|
-
|
|
8010
|
-
|
|
7987
|
+
login: (email: string, password: string, options?: RequestOptions) => Promise<User & {
|
|
7988
|
+
token: string;
|
|
7989
|
+
}>;
|
|
7990
|
+
register: (email: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<User & {
|
|
7991
|
+
token?: string;
|
|
7992
|
+
}>;
|
|
7993
|
+
confirm: (token: string, options?: RequestOptions) => Promise<User & {
|
|
7994
|
+
token?: string;
|
|
7995
|
+
}>;
|
|
8011
7996
|
resendConfirmation: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
8012
7997
|
requestMagicLink: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
8013
|
-
magicLinkLogin: (token: string, options?: RequestOptions) => Promise<
|
|
7998
|
+
magicLinkLogin: (token: string, options?: RequestOptions) => Promise<User & {
|
|
7999
|
+
token?: string;
|
|
8000
|
+
}>;
|
|
8014
8001
|
changePassword: (currentPassword: string, newPassword: string, newPasswordConfirmation: string, options?: RequestOptions) => Promise<User>;
|
|
8015
8002
|
resetPassword: (token: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<User>;
|
|
8016
8003
|
me: (options?: RequestOptions) => Promise<User>;
|
|
@@ -8116,8 +8103,6 @@ declare class GptClient extends BaseClient {
|
|
|
8116
8103
|
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
8117
8104
|
createIsv: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
8118
8105
|
credit: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
8119
|
-
buyStorage: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
8120
|
-
removeStorage: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
8121
8106
|
schedulePurge: (id: string, options?: RequestOptions) => Promise<Tenant>;
|
|
8122
8107
|
documentStats: (tenantId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
8123
8108
|
workspaceStats: (tenantId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
@@ -9148,6 +9133,10 @@ declare class Webhooks {
|
|
|
9148
9133
|
static verify(payload: string, signatureHeader: string, secret: string, options?: WebhookVerifyOptions): Promise<true>;
|
|
9149
9134
|
}
|
|
9150
9135
|
|
|
9136
|
+
type UserWithAuth = User & {
|
|
9137
|
+
token?: string;
|
|
9138
|
+
};
|
|
9139
|
+
|
|
9151
9140
|
declare function createIdentityNamespace(rb: RequestBuilder): {
|
|
9152
9141
|
/**
|
|
9153
9142
|
* Authenticate with email and password to receive an access token.
|
|
@@ -9158,17 +9147,28 @@ declare function createIdentityNamespace(rb: RequestBuilder): {
|
|
|
9158
9147
|
* console.log(token.access_token);
|
|
9159
9148
|
* ```
|
|
9160
9149
|
*/
|
|
9161
|
-
|
|
9150
|
+
/**
|
|
9151
|
+
* Authenticate with email and password to receive an access token.
|
|
9152
|
+
* @example
|
|
9153
|
+
* ```typescript
|
|
9154
|
+
* const client = new GptClient({ apiKey: 'sk_tenant_...' });
|
|
9155
|
+
* const userWithToken = await client.identity.login('user@example.com', 'password123');
|
|
9156
|
+
* console.log(userWithToken.token);
|
|
9157
|
+
* ```
|
|
9158
|
+
*/
|
|
9159
|
+
login: (email: string, password: string, options?: RequestOptions) => Promise<User & {
|
|
9160
|
+
token: string;
|
|
9161
|
+
}>;
|
|
9162
9162
|
/** Register a new user */
|
|
9163
|
-
register: (email: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<
|
|
9163
|
+
register: (email: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<UserWithAuth>;
|
|
9164
9164
|
/** Confirm email with token */
|
|
9165
|
-
confirm: (token: string, options?: RequestOptions) => Promise<
|
|
9165
|
+
confirm: (token: string, options?: RequestOptions) => Promise<UserWithAuth>;
|
|
9166
9166
|
/** Resend confirmation email */
|
|
9167
9167
|
resendConfirmation: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
9168
9168
|
/** Request magic link */
|
|
9169
9169
|
requestMagicLink: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
9170
9170
|
/** Login via magic link token */
|
|
9171
|
-
magicLinkLogin: (token: string, options?: RequestOptions) => Promise<
|
|
9171
|
+
magicLinkLogin: (token: string, options?: RequestOptions) => Promise<UserWithAuth>;
|
|
9172
9172
|
/** Change password */
|
|
9173
9173
|
changePassword: (currentPassword: string, newPassword: string, newPasswordConfirmation: string, options?: RequestOptions) => Promise<User>;
|
|
9174
9174
|
/** Reset password with token */
|
|
@@ -9393,10 +9393,6 @@ declare function createPlatformNamespace(rb: RequestBuilder): {
|
|
|
9393
9393
|
createIsv: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
9394
9394
|
/** Credit a tenant */
|
|
9395
9395
|
credit: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
9396
|
-
/** Buy storage for a tenant */
|
|
9397
|
-
buyStorage: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
9398
|
-
/** Remove storage from a tenant */
|
|
9399
|
-
removeStorage: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
9400
9396
|
/** Schedule a tenant purge */
|
|
9401
9397
|
schedulePurge: (id: string, options?: RequestOptions) => Promise<Tenant>;
|
|
9402
9398
|
/** Get document stats for a tenant */
|
|
@@ -10110,4 +10106,4 @@ type SearchAPI = ReturnType<typeof createSearchNamespace>;
|
|
|
10110
10106
|
type ThreadsAPI = ReturnType<typeof createThreadsNamespace>;
|
|
10111
10107
|
type CommunicationAPI = ReturnType<typeof createCommunicationNamespace>;
|
|
10112
10108
|
|
|
10113
|
-
export { API_KEY_PREFIXES, type AgentCreateRequest, AgentCreateSchema, type AgentImportRequest, AgentImportSchema, type AgentTestInput, AgentTestInputSchema, type AgentUpdateRequest, AgentUpdateSchema, type AgentsAPI, type AiAPI, type AiSearchAdvancedRequest, AiSearchAdvancedSchema, type ApiKeyAllocateRequest, ApiKeyAllocateSchema, type ApiKeyCreateRequest, ApiKeyCreateSchema, type AppInfo, type ApplicationCreateRequest, ApplicationCreateSchema, type ApplicationUpdateRequest, ApplicationUpdateSchema, AuthenticationError, AuthorizationError, type BaseClientConfig, type BeginUploadRequest, BeginUploadSchema, type BillingAPI, BrowserApiKeyError, type BucketCreateRequest, BucketCreateSchema, type BucketUpdateRequest, BucketUpdateSchema, type ChatMessageCreateRequest, ChatMessageCreateSchema, type ChatMessageUpdateRequest, ChatMessageUpdateSchema, type CommunicationAPI, type ConfigCreateRequest, ConfigCreateSchema, type ConfigUpdateRequest, ConfigUpdateSchema, ConflictError, type ConsentRecordCreateRequest, ConsentRecordCreateSchema, type ConversationCreateRequest, ConversationCreateSchema, type ConversationUpdateRequest, ConversationUpdateSchema, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type DocumentUploadBase64Request, DocumentUploadBase64Schema, type DocumentVerificationRequest, DocumentVerificationSchema, type EmailTemplateCreateRequest, EmailTemplateCreateSchema, type EmailTemplateUpdateRequest, EmailTemplateUpdateSchema, type EmbedRequest, EmbedRequestSchema, type ExtractionAPI, type ExtractionBatchCreateRequest, ExtractionBatchCreateSchema, type ExtractionExportCreateRequest, ExtractionExportCreateSchema, type FieldMappingCreateRequest, FieldMappingCreateSchema, type FieldTemplateCreateRequest, FieldTemplateCreateSchema, GptClient, GptCoreError, type GraphNodeCreateRequest, GraphNodeCreateSchema, type IdentityAPI, InsecureConnectionError, type InvitationCreateRequest, InvitationCreateSchema, LOG_LEVELS, type LegalDocumentCreateRequest, LegalDocumentCreateSchema, type LegalDocumentUpdateRequest, LegalDocumentUpdateSchema, type LlmAnalyticsCreateRequest, LlmAnalyticsCreateSchema, type LogLevel, type Logger, type LoginRequest, LoginRequestSchema, type MembershipCreateRequest, MembershipCreateSchema, type MessageCreateRequest, MessageCreateSchema, type MessageSendRequest, MessageSendSchema, type MessageStreamRequest, MessageStreamSchema, NetworkError, NotFoundError, type NotificationMethodCreateRequest, NotificationMethodCreateSchema, type NotificationMethodUpdateRequest, NotificationMethodUpdateSchema, type NotificationPreferenceCreateRequest, NotificationPreferenceCreateSchema, type NotificationPreferenceUpdateRequest, NotificationPreferenceUpdateSchema, type ObjectRegisterRequest, ObjectRegisterSchema, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PlatformAPI, type PresignedDownloadRequest, PresignedDownloadSchema, type PresignedUploadRequest, PresignedUploadSchema, RateLimitError, type RegisterRequest, RegisterRequestSchema, RequestBuilder, type RequestOptions, type ResultRegenerateRequest, ResultRegenerateSchema, type ResultSaveCorrectionsRequest, ResultSaveCorrectionsSchema, type RetryConfig, RetryTimeoutError, type RoleCreateRequest, RoleCreateSchema, type RoleUpdateRequest, RoleUpdateSchema, SDK_VERSION, type SavedSearchCreateRequest, SavedSearchCreateSchema, type SchemaDiscoveryCreateRequest, SchemaDiscoveryCreateSchema, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SearchRequest, SearchRequestSchema, type SecurityConfig, ServerError, type StorageAPI, type StreamMessageChunk, type StreamOptions, type TenantCreateRequest, TenantCreateSchema, type TenantMembershipCreateRequest, TenantMembershipCreateSchema, type TenantMembershipUpdateRequest, TenantMembershipUpdateSchema, type TenantUpdateRequest, TenantUpdateSchema, type ThreadCreateRequest, ThreadCreateSchema, type ThreadMessageStreamRequest, ThreadMessageStreamSchema, type ThreadUpdateRequest, ThreadUpdateSchema, type ThreadsAPI, TimeoutError, type UserAdminUpdateRequest, UserAdminUpdateSchema, type UserProfileCreateRequest, UserProfileCreateSchema, type UserProfileUpdateRequest, UserProfileUpdateSchema, ValidationError, type WalletAddonsRequest, WalletAddonsSchema, type WalletAutoTopUpRequest, WalletAutoTopUpSchema, type WalletCreditsUpdateRequest, WalletCreditsUpdateSchema, type WatcherClaimCreateRequest, WatcherClaimCreateSchema, type WatcherClaimUpdateRequest, WatcherClaimUpdateSchema, type WatcherEventCreateRequest, WatcherEventCreateSchema, type WebhookConfigCreateRequest, WebhookConfigCreateSchema, type WebhookConfigUpdateRequest, WebhookConfigUpdateSchema, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type WebhooksAPI, type WorkspaceCreateRequest, WorkspaceCreateSchema, type WorkspaceMembershipUpdateRequest, WorkspaceMembershipUpdateSchema, type WorkspaceUpdateRequest, WorkspaceUpdateSchema, buildHeaders, buildUserAgent, collectStreamedMessage, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };
|
|
10109
|
+
export { API_KEY_PREFIXES, type AgentCreateRequest, AgentCreateSchema, type AgentImportRequest, AgentImportSchema, type AgentTestInput, AgentTestInputSchema, type AgentUpdateRequest, AgentUpdateSchema, type AgentsAPI, type AiAPI, type AiSearchAdvancedRequest, AiSearchAdvancedSchema, type ApiKey, type ApiKeyAllocateRequest, ApiKeyAllocateSchema, type ApiKeyCreateRequest, ApiKeyCreateSchema, type AppInfo, type ApplicationCreateRequest, ApplicationCreateSchema, type ApplicationUpdateRequest, ApplicationUpdateSchema, AuthenticationError, AuthorizationError, type BaseClientConfig, type BeginUploadRequest, BeginUploadSchema, type BillingAPI, BrowserApiKeyError, type BucketCreateRequest, BucketCreateSchema, type BucketUpdateRequest, BucketUpdateSchema, type ChatMessageCreateRequest, ChatMessageCreateSchema, type ChatMessageUpdateRequest, ChatMessageUpdateSchema, type CommunicationAPI, type ConfigCreateRequest, ConfigCreateSchema, type ConfigUpdateRequest, ConfigUpdateSchema, ConflictError, type ConsentRecordCreateRequest, ConsentRecordCreateSchema, type ConversationCreateRequest, ConversationCreateSchema, type ConversationUpdateRequest, ConversationUpdateSchema, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type DocumentUploadBase64Request, DocumentUploadBase64Schema, type DocumentVerificationRequest, DocumentVerificationSchema, type EmailTemplateCreateRequest, EmailTemplateCreateSchema, type EmailTemplateUpdateRequest, EmailTemplateUpdateSchema, type EmbedRequest, EmbedRequestSchema, type ExtractionAPI, type ExtractionBatchCreateRequest, ExtractionBatchCreateSchema, type ExtractionExportCreateRequest, ExtractionExportCreateSchema, type FieldMappingCreateRequest, FieldMappingCreateSchema, type FieldTemplateCreateRequest, FieldTemplateCreateSchema, GptClient, GptCoreError, type GraphNodeCreateRequest, GraphNodeCreateSchema, type IdentityAPI, InsecureConnectionError, type InvitationCreateRequest, InvitationCreateSchema, LOG_LEVELS, type LegalDocumentCreateRequest, LegalDocumentCreateSchema, type LegalDocumentUpdateRequest, LegalDocumentUpdateSchema, type LlmAnalyticsCreateRequest, LlmAnalyticsCreateSchema, type LogLevel, type Logger, type LoginRequest, LoginRequestSchema, type MembershipCreateRequest, MembershipCreateSchema, type MessageCreateRequest, MessageCreateSchema, type MessageSendRequest, MessageSendSchema, type MessageStreamRequest, MessageStreamSchema, NetworkError, NotFoundError, type NotificationMethodCreateRequest, NotificationMethodCreateSchema, type NotificationMethodUpdateRequest, NotificationMethodUpdateSchema, type NotificationPreferenceCreateRequest, NotificationPreferenceCreateSchema, type NotificationPreferenceUpdateRequest, NotificationPreferenceUpdateSchema, type ObjectRegisterRequest, ObjectRegisterSchema, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PlatformAPI, type PresignedDownloadRequest, PresignedDownloadSchema, type PresignedUploadRequest, PresignedUploadSchema, RateLimitError, type RegisterRequest, RegisterRequestSchema, RequestBuilder, type RequestOptions, type ResultRegenerateRequest, ResultRegenerateSchema, type ResultSaveCorrectionsRequest, ResultSaveCorrectionsSchema, type RetryConfig, RetryTimeoutError, type RoleCreateRequest, RoleCreateSchema, type RoleUpdateRequest, RoleUpdateSchema, SDK_VERSION, type SavedSearchCreateRequest, SavedSearchCreateSchema, type SchemaDiscoveryCreateRequest, SchemaDiscoveryCreateSchema, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SearchRequest, SearchRequestSchema, type SecurityConfig, ServerError, type StorageAPI, type StreamMessageChunk, type StreamOptions, type Tenant, type TenantCreateRequest, TenantCreateSchema, type TenantMembershipCreateRequest, TenantMembershipCreateSchema, type TenantMembershipUpdateRequest, TenantMembershipUpdateSchema, type TenantUpdateRequest, TenantUpdateSchema, type ThreadCreateRequest, ThreadCreateSchema, type ThreadMessageStreamRequest, ThreadMessageStreamSchema, type ThreadUpdateRequest, ThreadUpdateSchema, type ThreadsAPI, TimeoutError, type User, type UserAdminUpdateRequest, UserAdminUpdateSchema, type UserProfileCreateRequest, UserProfileCreateSchema, type UserProfileUpdateRequest, UserProfileUpdateSchema, ValidationError, type WalletAddonsRequest, WalletAddonsSchema, type WalletAutoTopUpRequest, WalletAutoTopUpSchema, type WalletCreditsUpdateRequest, WalletCreditsUpdateSchema, type WatcherClaimCreateRequest, WatcherClaimCreateSchema, type WatcherClaimUpdateRequest, WatcherClaimUpdateSchema, type WatcherEventCreateRequest, WatcherEventCreateSchema, type WebhookConfigCreateRequest, WebhookConfigCreateSchema, type WebhookConfigUpdateRequest, WebhookConfigUpdateSchema, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type WebhooksAPI, type WorkspaceCreateRequest, WorkspaceCreateSchema, type WorkspaceMembershipUpdateRequest, WorkspaceMembershipUpdateSchema, type WorkspaceUpdateRequest, WorkspaceUpdateSchema, buildHeaders, buildUserAgent, collectStreamedMessage, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };
|
package/dist/index.d.ts
CHANGED
|
@@ -2878,44 +2878,6 @@ type NotificationLog = {
|
|
|
2878
2878
|
};
|
|
2879
2879
|
type: string;
|
|
2880
2880
|
};
|
|
2881
|
-
/**
|
|
2882
|
-
* A "Resource object" representing a token
|
|
2883
|
-
*/
|
|
2884
|
-
type Token = {
|
|
2885
|
-
/**
|
|
2886
|
-
* An attributes object for a token
|
|
2887
|
-
*/
|
|
2888
|
-
attributes?: {
|
|
2889
|
-
/**
|
|
2890
|
-
* Field included by default.
|
|
2891
|
-
*/
|
|
2892
|
-
brand?: string | null | unknown;
|
|
2893
|
-
/**
|
|
2894
|
-
* Field included by default.
|
|
2895
|
-
*/
|
|
2896
|
-
exp_month?: number | null | unknown;
|
|
2897
|
-
/**
|
|
2898
|
-
* Field included by default.
|
|
2899
|
-
*/
|
|
2900
|
-
exp_year?: number | null | unknown;
|
|
2901
|
-
/**
|
|
2902
|
-
* Field included by default.
|
|
2903
|
-
*/
|
|
2904
|
-
last4?: string | null | unknown;
|
|
2905
|
-
/**
|
|
2906
|
-
* Field included by default.
|
|
2907
|
-
*/
|
|
2908
|
-
token?: string | null | unknown;
|
|
2909
|
-
};
|
|
2910
|
-
id: string;
|
|
2911
|
-
/**
|
|
2912
|
-
* A relationships object for a token
|
|
2913
|
-
*/
|
|
2914
|
-
relationships?: {
|
|
2915
|
-
[key: string]: never;
|
|
2916
|
-
};
|
|
2917
|
-
type: string;
|
|
2918
|
-
};
|
|
2919
2881
|
/**
|
|
2920
2882
|
* A "Resource object" representing a notification_method
|
|
2921
2883
|
*/
|
|
@@ -3510,13 +3472,17 @@ type Plan = {
|
|
|
3510
3472
|
*/
|
|
3511
3473
|
slug: string;
|
|
3512
3474
|
/**
|
|
3513
|
-
*
|
|
3475
|
+
* Storage included in plan (bytes). Free=1GB, Pro=10GB, Business=50GB, Enterprise=500GB. Field included by default.
|
|
3514
3476
|
*/
|
|
3515
|
-
|
|
3477
|
+
storage_included_bytes: number;
|
|
3516
3478
|
/**
|
|
3517
|
-
* Field included by default.
|
|
3479
|
+
* Hard ceiling in bytes. Prevents runaway bills. nil = unlimited. Field included by default.
|
|
3480
|
+
*/
|
|
3481
|
+
storage_max_bytes?: number | null | unknown;
|
|
3482
|
+
/**
|
|
3483
|
+
* Cents per GB-month overage. Free=0 (hard cap), Pro=25, Business=20, Enterprise=15. Field included by default.
|
|
3518
3484
|
*/
|
|
3519
|
-
|
|
3485
|
+
storage_overage_rate_cents?: number | null | unknown;
|
|
3520
3486
|
/**
|
|
3521
3487
|
* Field included by default.
|
|
3522
3488
|
*/
|
|
@@ -4555,6 +4521,11 @@ type Tenant = {
|
|
|
4555
4521
|
* Field included by default.
|
|
4556
4522
|
*/
|
|
4557
4523
|
slug: string;
|
|
4524
|
+
storage_quota_bytes?: number | null | unknown;
|
|
4525
|
+
/**
|
|
4526
|
+
* Tenant-set overage ceiling in bytes. nil = use plan max. Field included by default.
|
|
4527
|
+
*/
|
|
4528
|
+
storage_spending_cap_bytes?: number | null | unknown;
|
|
4558
4529
|
/**
|
|
4559
4530
|
* Cost in credits for training on a single document. Field included by default.
|
|
4560
4531
|
*/
|
|
@@ -7287,12 +7258,16 @@ type ExtractionDocument = {
|
|
|
7287
7258
|
* Overall classification confidence (0.0 to 1.0). Field included by default.
|
|
7288
7259
|
*/
|
|
7289
7260
|
classification_confidence?: number | null | unknown;
|
|
7261
|
+
/**
|
|
7262
|
+
* Processing stage: queue, active, output, errors
|
|
7263
|
+
*/
|
|
7264
|
+
processing_stage: "queue" | "active" | "output" | "errors" | "unknown";
|
|
7290
7265
|
/**
|
|
7291
7266
|
* Field included by default.
|
|
7292
7267
|
*/
|
|
7293
7268
|
uploaded_at?: string | null | unknown;
|
|
7294
7269
|
/**
|
|
7295
|
-
* Current processing stage
|
|
7270
|
+
* Current processing stage (reads processing_stage attribute). Field included by default.
|
|
7296
7271
|
*/
|
|
7297
7272
|
stage?: string | null | unknown;
|
|
7298
7273
|
/**
|
|
@@ -7303,6 +7278,10 @@ type ExtractionDocument = {
|
|
|
7303
7278
|
* Schema revision number used for extraction. Field included by default.
|
|
7304
7279
|
*/
|
|
7305
7280
|
schema_revision?: number | null | unknown;
|
|
7281
|
+
/**
|
|
7282
|
+
* FK to storage.storage_files — tracks the S3 file via StorageFile
|
|
7283
|
+
*/
|
|
7284
|
+
storage_file_id?: string | null | unknown;
|
|
7306
7285
|
/**
|
|
7307
7286
|
* Credits billed for processing this document. Field included by default.
|
|
7308
7287
|
*/
|
|
@@ -8005,12 +7984,20 @@ declare function createAgentsNamespace(rb: RequestBuilder): {
|
|
|
8005
7984
|
declare class GptClient extends BaseClient {
|
|
8006
7985
|
/** User authentication, profiles, and API key management */
|
|
8007
7986
|
readonly identity: {
|
|
8008
|
-
login: (email: string, password: string, options?: RequestOptions) => Promise<
|
|
8009
|
-
|
|
8010
|
-
|
|
7987
|
+
login: (email: string, password: string, options?: RequestOptions) => Promise<User & {
|
|
7988
|
+
token: string;
|
|
7989
|
+
}>;
|
|
7990
|
+
register: (email: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<User & {
|
|
7991
|
+
token?: string;
|
|
7992
|
+
}>;
|
|
7993
|
+
confirm: (token: string, options?: RequestOptions) => Promise<User & {
|
|
7994
|
+
token?: string;
|
|
7995
|
+
}>;
|
|
8011
7996
|
resendConfirmation: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
8012
7997
|
requestMagicLink: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
8013
|
-
magicLinkLogin: (token: string, options?: RequestOptions) => Promise<
|
|
7998
|
+
magicLinkLogin: (token: string, options?: RequestOptions) => Promise<User & {
|
|
7999
|
+
token?: string;
|
|
8000
|
+
}>;
|
|
8014
8001
|
changePassword: (currentPassword: string, newPassword: string, newPasswordConfirmation: string, options?: RequestOptions) => Promise<User>;
|
|
8015
8002
|
resetPassword: (token: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<User>;
|
|
8016
8003
|
me: (options?: RequestOptions) => Promise<User>;
|
|
@@ -8116,8 +8103,6 @@ declare class GptClient extends BaseClient {
|
|
|
8116
8103
|
delete: (id: string, options?: RequestOptions) => Promise<true>;
|
|
8117
8104
|
createIsv: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
8118
8105
|
credit: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
8119
|
-
buyStorage: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
8120
|
-
removeStorage: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
8121
8106
|
schedulePurge: (id: string, options?: RequestOptions) => Promise<Tenant>;
|
|
8122
8107
|
documentStats: (tenantId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
8123
8108
|
workspaceStats: (tenantId: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
@@ -9148,6 +9133,10 @@ declare class Webhooks {
|
|
|
9148
9133
|
static verify(payload: string, signatureHeader: string, secret: string, options?: WebhookVerifyOptions): Promise<true>;
|
|
9149
9134
|
}
|
|
9150
9135
|
|
|
9136
|
+
type UserWithAuth = User & {
|
|
9137
|
+
token?: string;
|
|
9138
|
+
};
|
|
9139
|
+
|
|
9151
9140
|
declare function createIdentityNamespace(rb: RequestBuilder): {
|
|
9152
9141
|
/**
|
|
9153
9142
|
* Authenticate with email and password to receive an access token.
|
|
@@ -9158,17 +9147,28 @@ declare function createIdentityNamespace(rb: RequestBuilder): {
|
|
|
9158
9147
|
* console.log(token.access_token);
|
|
9159
9148
|
* ```
|
|
9160
9149
|
*/
|
|
9161
|
-
|
|
9150
|
+
/**
|
|
9151
|
+
* Authenticate with email and password to receive an access token.
|
|
9152
|
+
* @example
|
|
9153
|
+
* ```typescript
|
|
9154
|
+
* const client = new GptClient({ apiKey: 'sk_tenant_...' });
|
|
9155
|
+
* const userWithToken = await client.identity.login('user@example.com', 'password123');
|
|
9156
|
+
* console.log(userWithToken.token);
|
|
9157
|
+
* ```
|
|
9158
|
+
*/
|
|
9159
|
+
login: (email: string, password: string, options?: RequestOptions) => Promise<User & {
|
|
9160
|
+
token: string;
|
|
9161
|
+
}>;
|
|
9162
9162
|
/** Register a new user */
|
|
9163
|
-
register: (email: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<
|
|
9163
|
+
register: (email: string, password: string, passwordConfirmation: string, options?: RequestOptions) => Promise<UserWithAuth>;
|
|
9164
9164
|
/** Confirm email with token */
|
|
9165
|
-
confirm: (token: string, options?: RequestOptions) => Promise<
|
|
9165
|
+
confirm: (token: string, options?: RequestOptions) => Promise<UserWithAuth>;
|
|
9166
9166
|
/** Resend confirmation email */
|
|
9167
9167
|
resendConfirmation: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
9168
9168
|
/** Request magic link */
|
|
9169
9169
|
requestMagicLink: (email: string, options?: RequestOptions) => Promise<Record<string, unknown>>;
|
|
9170
9170
|
/** Login via magic link token */
|
|
9171
|
-
magicLinkLogin: (token: string, options?: RequestOptions) => Promise<
|
|
9171
|
+
magicLinkLogin: (token: string, options?: RequestOptions) => Promise<UserWithAuth>;
|
|
9172
9172
|
/** Change password */
|
|
9173
9173
|
changePassword: (currentPassword: string, newPassword: string, newPasswordConfirmation: string, options?: RequestOptions) => Promise<User>;
|
|
9174
9174
|
/** Reset password with token */
|
|
@@ -9393,10 +9393,6 @@ declare function createPlatformNamespace(rb: RequestBuilder): {
|
|
|
9393
9393
|
createIsv: (attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
9394
9394
|
/** Credit a tenant */
|
|
9395
9395
|
credit: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
9396
|
-
/** Buy storage for a tenant */
|
|
9397
|
-
buyStorage: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
9398
|
-
/** Remove storage from a tenant */
|
|
9399
|
-
removeStorage: (id: string, attributes: Record<string, unknown>, options?: RequestOptions) => Promise<Tenant>;
|
|
9400
9396
|
/** Schedule a tenant purge */
|
|
9401
9397
|
schedulePurge: (id: string, options?: RequestOptions) => Promise<Tenant>;
|
|
9402
9398
|
/** Get document stats for a tenant */
|
|
@@ -10110,4 +10106,4 @@ type SearchAPI = ReturnType<typeof createSearchNamespace>;
|
|
|
10110
10106
|
type ThreadsAPI = ReturnType<typeof createThreadsNamespace>;
|
|
10111
10107
|
type CommunicationAPI = ReturnType<typeof createCommunicationNamespace>;
|
|
10112
10108
|
|
|
10113
|
-
export { API_KEY_PREFIXES, type AgentCreateRequest, AgentCreateSchema, type AgentImportRequest, AgentImportSchema, type AgentTestInput, AgentTestInputSchema, type AgentUpdateRequest, AgentUpdateSchema, type AgentsAPI, type AiAPI, type AiSearchAdvancedRequest, AiSearchAdvancedSchema, type ApiKeyAllocateRequest, ApiKeyAllocateSchema, type ApiKeyCreateRequest, ApiKeyCreateSchema, type AppInfo, type ApplicationCreateRequest, ApplicationCreateSchema, type ApplicationUpdateRequest, ApplicationUpdateSchema, AuthenticationError, AuthorizationError, type BaseClientConfig, type BeginUploadRequest, BeginUploadSchema, type BillingAPI, BrowserApiKeyError, type BucketCreateRequest, BucketCreateSchema, type BucketUpdateRequest, BucketUpdateSchema, type ChatMessageCreateRequest, ChatMessageCreateSchema, type ChatMessageUpdateRequest, ChatMessageUpdateSchema, type CommunicationAPI, type ConfigCreateRequest, ConfigCreateSchema, type ConfigUpdateRequest, ConfigUpdateSchema, ConflictError, type ConsentRecordCreateRequest, ConsentRecordCreateSchema, type ConversationCreateRequest, ConversationCreateSchema, type ConversationUpdateRequest, ConversationUpdateSchema, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type DocumentUploadBase64Request, DocumentUploadBase64Schema, type DocumentVerificationRequest, DocumentVerificationSchema, type EmailTemplateCreateRequest, EmailTemplateCreateSchema, type EmailTemplateUpdateRequest, EmailTemplateUpdateSchema, type EmbedRequest, EmbedRequestSchema, type ExtractionAPI, type ExtractionBatchCreateRequest, ExtractionBatchCreateSchema, type ExtractionExportCreateRequest, ExtractionExportCreateSchema, type FieldMappingCreateRequest, FieldMappingCreateSchema, type FieldTemplateCreateRequest, FieldTemplateCreateSchema, GptClient, GptCoreError, type GraphNodeCreateRequest, GraphNodeCreateSchema, type IdentityAPI, InsecureConnectionError, type InvitationCreateRequest, InvitationCreateSchema, LOG_LEVELS, type LegalDocumentCreateRequest, LegalDocumentCreateSchema, type LegalDocumentUpdateRequest, LegalDocumentUpdateSchema, type LlmAnalyticsCreateRequest, LlmAnalyticsCreateSchema, type LogLevel, type Logger, type LoginRequest, LoginRequestSchema, type MembershipCreateRequest, MembershipCreateSchema, type MessageCreateRequest, MessageCreateSchema, type MessageSendRequest, MessageSendSchema, type MessageStreamRequest, MessageStreamSchema, NetworkError, NotFoundError, type NotificationMethodCreateRequest, NotificationMethodCreateSchema, type NotificationMethodUpdateRequest, NotificationMethodUpdateSchema, type NotificationPreferenceCreateRequest, NotificationPreferenceCreateSchema, type NotificationPreferenceUpdateRequest, NotificationPreferenceUpdateSchema, type ObjectRegisterRequest, ObjectRegisterSchema, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PlatformAPI, type PresignedDownloadRequest, PresignedDownloadSchema, type PresignedUploadRequest, PresignedUploadSchema, RateLimitError, type RegisterRequest, RegisterRequestSchema, RequestBuilder, type RequestOptions, type ResultRegenerateRequest, ResultRegenerateSchema, type ResultSaveCorrectionsRequest, ResultSaveCorrectionsSchema, type RetryConfig, RetryTimeoutError, type RoleCreateRequest, RoleCreateSchema, type RoleUpdateRequest, RoleUpdateSchema, SDK_VERSION, type SavedSearchCreateRequest, SavedSearchCreateSchema, type SchemaDiscoveryCreateRequest, SchemaDiscoveryCreateSchema, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SearchRequest, SearchRequestSchema, type SecurityConfig, ServerError, type StorageAPI, type StreamMessageChunk, type StreamOptions, type TenantCreateRequest, TenantCreateSchema, type TenantMembershipCreateRequest, TenantMembershipCreateSchema, type TenantMembershipUpdateRequest, TenantMembershipUpdateSchema, type TenantUpdateRequest, TenantUpdateSchema, type ThreadCreateRequest, ThreadCreateSchema, type ThreadMessageStreamRequest, ThreadMessageStreamSchema, type ThreadUpdateRequest, ThreadUpdateSchema, type ThreadsAPI, TimeoutError, type UserAdminUpdateRequest, UserAdminUpdateSchema, type UserProfileCreateRequest, UserProfileCreateSchema, type UserProfileUpdateRequest, UserProfileUpdateSchema, ValidationError, type WalletAddonsRequest, WalletAddonsSchema, type WalletAutoTopUpRequest, WalletAutoTopUpSchema, type WalletCreditsUpdateRequest, WalletCreditsUpdateSchema, type WatcherClaimCreateRequest, WatcherClaimCreateSchema, type WatcherClaimUpdateRequest, WatcherClaimUpdateSchema, type WatcherEventCreateRequest, WatcherEventCreateSchema, type WebhookConfigCreateRequest, WebhookConfigCreateSchema, type WebhookConfigUpdateRequest, WebhookConfigUpdateSchema, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type WebhooksAPI, type WorkspaceCreateRequest, WorkspaceCreateSchema, type WorkspaceMembershipUpdateRequest, WorkspaceMembershipUpdateSchema, type WorkspaceUpdateRequest, WorkspaceUpdateSchema, buildHeaders, buildUserAgent, collectStreamedMessage, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };
|
|
10109
|
+
export { API_KEY_PREFIXES, type AgentCreateRequest, AgentCreateSchema, type AgentImportRequest, AgentImportSchema, type AgentTestInput, AgentTestInputSchema, type AgentUpdateRequest, AgentUpdateSchema, type AgentsAPI, type AiAPI, type AiSearchAdvancedRequest, AiSearchAdvancedSchema, type ApiKey, type ApiKeyAllocateRequest, ApiKeyAllocateSchema, type ApiKeyCreateRequest, ApiKeyCreateSchema, type AppInfo, type ApplicationCreateRequest, ApplicationCreateSchema, type ApplicationUpdateRequest, ApplicationUpdateSchema, AuthenticationError, AuthorizationError, type BaseClientConfig, type BeginUploadRequest, BeginUploadSchema, type BillingAPI, BrowserApiKeyError, type BucketCreateRequest, BucketCreateSchema, type BucketUpdateRequest, BucketUpdateSchema, type ChatMessageCreateRequest, ChatMessageCreateSchema, type ChatMessageUpdateRequest, ChatMessageUpdateSchema, type CommunicationAPI, type ConfigCreateRequest, ConfigCreateSchema, type ConfigUpdateRequest, ConfigUpdateSchema, ConflictError, type ConsentRecordCreateRequest, ConsentRecordCreateSchema, type ConversationCreateRequest, ConversationCreateSchema, type ConversationUpdateRequest, ConversationUpdateSchema, DEFAULT_API_VERSION, DEFAULT_RETRY_CONFIG, type DocumentUploadBase64Request, DocumentUploadBase64Schema, type DocumentVerificationRequest, DocumentVerificationSchema, type EmailTemplateCreateRequest, EmailTemplateCreateSchema, type EmailTemplateUpdateRequest, EmailTemplateUpdateSchema, type EmbedRequest, EmbedRequestSchema, type ExtractionAPI, type ExtractionBatchCreateRequest, ExtractionBatchCreateSchema, type ExtractionExportCreateRequest, ExtractionExportCreateSchema, type FieldMappingCreateRequest, FieldMappingCreateSchema, type FieldTemplateCreateRequest, FieldTemplateCreateSchema, GptClient, GptCoreError, type GraphNodeCreateRequest, GraphNodeCreateSchema, type IdentityAPI, InsecureConnectionError, type InvitationCreateRequest, InvitationCreateSchema, LOG_LEVELS, type LegalDocumentCreateRequest, LegalDocumentCreateSchema, type LegalDocumentUpdateRequest, LegalDocumentUpdateSchema, type LlmAnalyticsCreateRequest, LlmAnalyticsCreateSchema, type LogLevel, type Logger, type LoginRequest, LoginRequestSchema, type MembershipCreateRequest, MembershipCreateSchema, type MessageCreateRequest, MessageCreateSchema, type MessageSendRequest, MessageSendSchema, type MessageStreamRequest, MessageStreamSchema, NetworkError, NotFoundError, type NotificationMethodCreateRequest, NotificationMethodCreateSchema, type NotificationMethodUpdateRequest, NotificationMethodUpdateSchema, type NotificationPreferenceCreateRequest, NotificationPreferenceCreateSchema, type NotificationPreferenceUpdateRequest, NotificationPreferenceUpdateSchema, type ObjectRegisterRequest, ObjectRegisterSchema, type PaginatedResponse, type PaginationLinks, type PaginationOptions, type PlatformAPI, type PresignedDownloadRequest, PresignedDownloadSchema, type PresignedUploadRequest, PresignedUploadSchema, RateLimitError, type RegisterRequest, RegisterRequestSchema, RequestBuilder, type RequestOptions, type ResultRegenerateRequest, ResultRegenerateSchema, type ResultSaveCorrectionsRequest, ResultSaveCorrectionsSchema, type RetryConfig, RetryTimeoutError, type RoleCreateRequest, RoleCreateSchema, type RoleUpdateRequest, RoleUpdateSchema, SDK_VERSION, type SavedSearchCreateRequest, SavedSearchCreateSchema, type SchemaDiscoveryCreateRequest, SchemaDiscoveryCreateSchema, type SdkErrorEvent, SdkEventEmitter, type SdkEvents, type SdkRequestEvent, type SdkResponseEvent, type SdkRetryEvent, type SearchAPI, type SearchRequest, SearchRequestSchema, type SecurityConfig, ServerError, type StorageAPI, type StreamMessageChunk, type StreamOptions, type Tenant, type TenantCreateRequest, TenantCreateSchema, type TenantMembershipCreateRequest, TenantMembershipCreateSchema, type TenantMembershipUpdateRequest, TenantMembershipUpdateSchema, type TenantUpdateRequest, TenantUpdateSchema, type ThreadCreateRequest, ThreadCreateSchema, type ThreadMessageStreamRequest, ThreadMessageStreamSchema, type ThreadUpdateRequest, ThreadUpdateSchema, type ThreadsAPI, TimeoutError, type User, type UserAdminUpdateRequest, UserAdminUpdateSchema, type UserProfileCreateRequest, UserProfileCreateSchema, type UserProfileUpdateRequest, UserProfileUpdateSchema, ValidationError, type WalletAddonsRequest, WalletAddonsSchema, type WalletAutoTopUpRequest, WalletAutoTopUpSchema, type WalletCreditsUpdateRequest, WalletCreditsUpdateSchema, type WatcherClaimCreateRequest, WatcherClaimCreateSchema, type WatcherClaimUpdateRequest, WatcherClaimUpdateSchema, type WatcherEventCreateRequest, WatcherEventCreateSchema, type WebhookConfigCreateRequest, WebhookConfigCreateSchema, type WebhookConfigUpdateRequest, WebhookConfigUpdateSchema, WebhookSignatureError, type WebhookVerifyOptions, Webhooks, type WebhooksAPI, type WorkspaceCreateRequest, WorkspaceCreateSchema, type WorkspaceMembershipUpdateRequest, WorkspaceMembershipUpdateSchema, type WorkspaceUpdateRequest, WorkspaceUpdateSchema, buildHeaders, buildUserAgent, collectStreamedMessage, handleApiError, isBrowserEnvironment, isSecureUrl, paginateAll, paginateToArray, retryWithBackoff, streamMessage, streamSSE, validateApiKey, withRetry };
|
package/dist/index.js
CHANGED
|
@@ -1360,7 +1360,7 @@ function buildUserAgent(sdkVersion, appInfo) {
|
|
|
1360
1360
|
|
|
1361
1361
|
// src/base-client.ts
|
|
1362
1362
|
var DEFAULT_API_VERSION = "2025-12-03";
|
|
1363
|
-
var SDK_VERSION = "0.1.
|
|
1363
|
+
var SDK_VERSION = "0.1.3";
|
|
1364
1364
|
function generateUUID() {
|
|
1365
1365
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
1366
1366
|
return crypto.randomUUID();
|
|
@@ -1450,7 +1450,7 @@ var BaseClient = class {
|
|
|
1450
1450
|
this.clientInstance = createClient(createConfig(clientConfig));
|
|
1451
1451
|
const userAgent = buildUserAgent(SDK_VERSION, config.appInfo);
|
|
1452
1452
|
const timeout = config.timeout;
|
|
1453
|
-
this.clientInstance.interceptors.request.use((req) => {
|
|
1453
|
+
this.clientInstance.interceptors.request.use(async (req) => {
|
|
1454
1454
|
const requestStartTime = Date.now();
|
|
1455
1455
|
this.requestTimings.set(req, requestStartTime);
|
|
1456
1456
|
const requestUrl = req.url || resolvedBaseUrl || "";
|
|
@@ -1462,10 +1462,7 @@ var BaseClient = class {
|
|
|
1462
1462
|
this.log.warn(message);
|
|
1463
1463
|
}
|
|
1464
1464
|
}
|
|
1465
|
-
req.headers.set(
|
|
1466
|
-
"Accept",
|
|
1467
|
-
`application/vnd.api+json; version=${this.apiVersion}`
|
|
1468
|
-
);
|
|
1465
|
+
req.headers.set("Accept", "application/vnd.api+json");
|
|
1469
1466
|
req.headers.set("Content-Type", "application/vnd.api+json");
|
|
1470
1467
|
if (typeof process !== "undefined") {
|
|
1471
1468
|
req.headers.set("User-Agent", userAgent);
|
|
@@ -3428,15 +3425,6 @@ var postTenants = (options) => (options.client ?? client).post({
|
|
|
3428
3425
|
...options.headers
|
|
3429
3426
|
}
|
|
3430
3427
|
});
|
|
3431
|
-
var postTenantsByIdRemoveStorage = (options) => (options.client ?? client).post({
|
|
3432
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
3433
|
-
url: "/tenants/{id}/remove-storage",
|
|
3434
|
-
...options,
|
|
3435
|
-
headers: {
|
|
3436
|
-
"Content-Type": "application/vnd.api+json",
|
|
3437
|
-
...options.headers
|
|
3438
|
-
}
|
|
3439
|
-
});
|
|
3440
3428
|
var getExtractionSchemaDiscoveriesById = (options) => (options.client ?? client).get({
|
|
3441
3429
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3442
3430
|
url: "/extraction/schema-discoveries/{id}",
|
|
@@ -4204,15 +4192,6 @@ var patchSchedulingEventsById = (options) => (options.client ?? client).patch({
|
|
|
4204
4192
|
...options.headers
|
|
4205
4193
|
}
|
|
4206
4194
|
});
|
|
4207
|
-
var postTenantsByIdBuyStorage = (options) => (options.client ?? client).post({
|
|
4208
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
4209
|
-
url: "/tenants/{id}/buy-storage",
|
|
4210
|
-
...options,
|
|
4211
|
-
headers: {
|
|
4212
|
-
"Content-Type": "application/vnd.api+json",
|
|
4213
|
-
...options.headers
|
|
4214
|
-
}
|
|
4215
|
-
});
|
|
4216
4195
|
var getWorkspaceMemberships = (options) => (options.client ?? client).get({
|
|
4217
4196
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4218
4197
|
url: "/workspace-memberships",
|
|
@@ -5328,6 +5307,15 @@ function createIdentityNamespace(rb) {
|
|
|
5328
5307
|
* console.log(token.access_token);
|
|
5329
5308
|
* ```
|
|
5330
5309
|
*/
|
|
5310
|
+
/**
|
|
5311
|
+
* Authenticate with email and password to receive an access token.
|
|
5312
|
+
* @example
|
|
5313
|
+
* ```typescript
|
|
5314
|
+
* const client = new GptClient({ apiKey: 'sk_tenant_...' });
|
|
5315
|
+
* const userWithToken = await client.identity.login('user@example.com', 'password123');
|
|
5316
|
+
* console.log(userWithToken.token);
|
|
5317
|
+
* ```
|
|
5318
|
+
*/
|
|
5331
5319
|
login: async (email, password, options) => {
|
|
5332
5320
|
LoginRequestSchema.parse({ email, password });
|
|
5333
5321
|
return rb.execute(
|
|
@@ -6178,28 +6166,6 @@ function createPlatformNamespace(rb) {
|
|
|
6178
6166
|
options
|
|
6179
6167
|
);
|
|
6180
6168
|
},
|
|
6181
|
-
/** Buy storage for a tenant */
|
|
6182
|
-
buyStorage: async (id, attributes, options) => {
|
|
6183
|
-
return rb.execute(
|
|
6184
|
-
postTenantsByIdBuyStorage,
|
|
6185
|
-
{
|
|
6186
|
-
path: { id },
|
|
6187
|
-
body: { data: { type: "tenant", attributes } }
|
|
6188
|
-
},
|
|
6189
|
-
options
|
|
6190
|
-
);
|
|
6191
|
-
},
|
|
6192
|
-
/** Remove storage from a tenant */
|
|
6193
|
-
removeStorage: async (id, attributes, options) => {
|
|
6194
|
-
return rb.execute(
|
|
6195
|
-
postTenantsByIdRemoveStorage,
|
|
6196
|
-
{
|
|
6197
|
-
path: { id },
|
|
6198
|
-
body: { data: { type: "tenant", attributes } }
|
|
6199
|
-
},
|
|
6200
|
-
options
|
|
6201
|
-
);
|
|
6202
|
-
},
|
|
6203
6169
|
/** Schedule a tenant purge */
|
|
6204
6170
|
schedulePurge: async (id, options) => {
|
|
6205
6171
|
return rb.execute(
|
|
@@ -11638,7 +11604,7 @@ var RequestBuilder = class {
|
|
|
11638
11604
|
async execute(fn, params, options) {
|
|
11639
11605
|
const headers = buildHeaders(this.getHeaders, options);
|
|
11640
11606
|
try {
|
|
11641
|
-
const
|
|
11607
|
+
const response = await this.requestWithRetry(
|
|
11642
11608
|
() => fn({
|
|
11643
11609
|
client: this.clientInstance,
|
|
11644
11610
|
headers,
|
|
@@ -11646,7 +11612,12 @@ var RequestBuilder = class {
|
|
|
11646
11612
|
...options?.signal && { signal: options.signal }
|
|
11647
11613
|
})
|
|
11648
11614
|
);
|
|
11649
|
-
|
|
11615
|
+
const { data, error } = response;
|
|
11616
|
+
if (error) {
|
|
11617
|
+
throw error;
|
|
11618
|
+
}
|
|
11619
|
+
const innerData = data?.data;
|
|
11620
|
+
return this.unwrap(innerData);
|
|
11650
11621
|
} catch (error) {
|
|
11651
11622
|
throw handleApiError(error);
|
|
11652
11623
|
}
|