@botpress/client
Advanced tools
Comparing version 0.15.0 to 0.16.0
@@ -5,3 +5,3 @@ /** | ||
* | ||
* The version of the OpenAPI document: 0.26.2 | ||
* The version of the OpenAPI document: 0.27.7 | ||
* | ||
@@ -8,0 +8,0 @@ * |
import { AxiosInstance } from 'axios'; | ||
import { Configuration, DefaultApiCreateConversationRequest, DefaultApiGetConversationRequest, DefaultApiListConversationsRequest, DefaultApiGetOrCreateConversationRequest, DefaultApiUpdateConversationRequest, DefaultApiDeleteConversationRequest, DefaultApiListParticipantsRequest, DefaultApiAddParticipantRequest, DefaultApiGetParticipantRequest, DefaultApiRemoveParticipantRequest, DefaultApiCreateEventRequest, DefaultApiGetEventRequest, DefaultApiListEventsRequest, DefaultApiCreateMessageRequest, DefaultApiGetOrCreateMessageRequest, DefaultApiGetMessageRequest, DefaultApiUpdateMessageRequest, DefaultApiListMessagesRequest, DefaultApiDeleteMessageRequest, DefaultApiCreateUserRequest, DefaultApiGetUserRequest, DefaultApiListUsersRequest, DefaultApiGetOrCreateUserRequest, DefaultApiUpdateUserRequest, DefaultApiDeleteUserRequest, DefaultApiGetStateRequest, DefaultApiSetStateRequest, DefaultApiGetOrSetStateRequest, DefaultApiPatchStateRequest, DefaultApiCallActionRequest, DefaultApiConfigureIntegrationRequest, DefaultApiGetTaskRequest, DefaultApiCreateTaskRequest, DefaultApiUpdateTaskRequest, DefaultApiDeleteTaskRequest, DefaultApiListTasksRequest, DefaultApiTrackAnalyticsRequest, DefaultApiRunVrlRequest, DefaultApiUpdateAccountRequest, DefaultApiCreatePersonalAccessTokenRequest, DefaultApiDeletePersonalAccessTokenRequest, DefaultApiSetAccountPreferenceRequest, DefaultApiGetAccountPreferenceRequest, DefaultApiListPublicIntegrationsRequest, DefaultApiGetPublicIntegrationByIdRequest, DefaultApiGetPublicIntegrationRequest, DefaultApiCreateBotRequest, DefaultApiUpdateBotRequest, DefaultApiTransferBotRequest, DefaultApiListBotsRequest, DefaultApiGetBotRequest, DefaultApiDeleteBotRequest, DefaultApiGetBotLogsRequest, DefaultApiGetBotWebchatRequest, DefaultApiGetBotAnalyticsRequest, DefaultApiListBotIssuesRequest, DefaultApiDeleteBotIssueRequest, DefaultApiListBotIssueEventsRequest, DefaultApiSetWorkspacePaymentMethodRequest, DefaultApiListWorkspaceInvoicesRequest, DefaultApiGetUpcomingInvoiceRequest, DefaultApiChargeWorkspaceUnpaidInvoicesRequest, DefaultApiCreateWorkspaceRequest, DefaultApiGetPublicWorkspaceRequest, DefaultApiGetWorkspaceRequest, DefaultApiListWorkspaceUsagesRequest, DefaultApiBreakDownWorkspaceUsageByBotRequest, DefaultApiGetWorkspaceQuotaRequest, DefaultApiListWorkspaceQuotasRequest, DefaultApiUpdateWorkspaceRequest, DefaultApiCheckHandleAvailabilityRequest, DefaultApiListWorkspacesRequest, DefaultApiDeleteWorkspaceRequest, DefaultApiGetAuditRecordsRequest, DefaultApiListWorkspaceMembersRequest, DefaultApiDeleteWorkspaceMemberRequest, DefaultApiCreateWorkspaceMemberRequest, DefaultApiUpdateWorkspaceMemberRequest, DefaultApiListIntegrationApiKeysRequest, DefaultApiCreateIntegrationApiKeyRequest, DefaultApiDeleteIntegrationApiKeyRequest, DefaultApiCreateIntegrationRequest, DefaultApiUpdateIntegrationRequest, DefaultApiListIntegrationsRequest, DefaultApiGetIntegrationRequest, DefaultApiGetIntegrationLogsRequest, DefaultApiGetIntegrationByNameRequest, DefaultApiDeleteIntegrationRequest, DefaultApiGetUsageRequest, DefaultApiListUsageHistoryRequest, DefaultApiChangeAISpendQuotaRequest, DefaultApiListActivitiesRequest, DefaultApiIntrospectRequest, DefaultApiCreateFileRequest, DefaultApiDeleteFileRequest, DefaultApiListFilesRequest, DefaultApiGetFileMetadataRequest, DefaultApiGetFileContentRequest, DefaultApiUpdateFileMetadataRequest, DefaultApiSearchFilesRequest, DefaultApiListTablesRequest, DefaultApiGetTableRequest, DefaultApiGetOrCreateTableRequest, DefaultApiCreateTableRequest, DefaultApiDuplicateTableRequest, DefaultApiUpdateTableRequest, DefaultApiRenameTableColumnRequest, DefaultApiDeleteTableRequest, DefaultApiGetTableRowRequest, DefaultApiFindTableRowsRequest, DefaultApiCreateTableRowsRequest, DefaultApiDeleteTableRowsRequest, DefaultApiUpdateTableRowsRequest, DefaultApiUpsertTableRowsRequest } from '.'; | ||
import { Configuration, DefaultApiCreateConversationRequest, DefaultApiGetConversationRequest, DefaultApiListConversationsRequest, DefaultApiGetOrCreateConversationRequest, DefaultApiUpdateConversationRequest, DefaultApiDeleteConversationRequest, DefaultApiListParticipantsRequest, DefaultApiAddParticipantRequest, DefaultApiGetParticipantRequest, DefaultApiRemoveParticipantRequest, DefaultApiCreateEventRequest, DefaultApiGetEventRequest, DefaultApiListEventsRequest, DefaultApiCreateMessageRequest, DefaultApiGetOrCreateMessageRequest, DefaultApiGetMessageRequest, DefaultApiUpdateMessageRequest, DefaultApiListMessagesRequest, DefaultApiDeleteMessageRequest, DefaultApiCreateUserRequest, DefaultApiGetUserRequest, DefaultApiListUsersRequest, DefaultApiGetOrCreateUserRequest, DefaultApiUpdateUserRequest, DefaultApiDeleteUserRequest, DefaultApiGetStateRequest, DefaultApiSetStateRequest, DefaultApiGetOrSetStateRequest, DefaultApiPatchStateRequest, DefaultApiCallActionRequest, DefaultApiConfigureIntegrationRequest, DefaultApiGetTaskRequest, DefaultApiCreateTaskRequest, DefaultApiUpdateTaskRequest, DefaultApiDeleteTaskRequest, DefaultApiListTasksRequest, DefaultApiTrackAnalyticsRequest, DefaultApiRunVrlRequest, DefaultApiUpdateAccountRequest, DefaultApiCreatePersonalAccessTokenRequest, DefaultApiDeletePersonalAccessTokenRequest, DefaultApiSetAccountPreferenceRequest, DefaultApiGetAccountPreferenceRequest, DefaultApiListPublicIntegrationsRequest, DefaultApiGetPublicIntegrationByIdRequest, DefaultApiGetPublicIntegrationRequest, DefaultApiCreateBotRequest, DefaultApiUpdateBotRequest, DefaultApiTransferBotRequest, DefaultApiListBotsRequest, DefaultApiGetBotRequest, DefaultApiDeleteBotRequest, DefaultApiGetBotLogsRequest, DefaultApiGetBotWebchatRequest, DefaultApiGetBotAnalyticsRequest, DefaultApiListBotIssuesRequest, DefaultApiDeleteBotIssueRequest, DefaultApiListBotIssueEventsRequest, DefaultApiSetWorkspacePaymentMethodRequest, DefaultApiListWorkspaceInvoicesRequest, DefaultApiGetUpcomingInvoiceRequest, DefaultApiChargeWorkspaceUnpaidInvoicesRequest, DefaultApiCreateWorkspaceRequest, DefaultApiGetPublicWorkspaceRequest, DefaultApiGetWorkspaceRequest, DefaultApiListWorkspaceUsagesRequest, DefaultApiBreakDownWorkspaceUsageByBotRequest, DefaultApiGetWorkspaceQuotaRequest, DefaultApiListWorkspaceQuotasRequest, DefaultApiUpdateWorkspaceRequest, DefaultApiCheckHandleAvailabilityRequest, DefaultApiListWorkspacesRequest, DefaultApiDeleteWorkspaceRequest, DefaultApiGetAuditRecordsRequest, DefaultApiListWorkspaceMembersRequest, DefaultApiDeleteWorkspaceMemberRequest, DefaultApiCreateWorkspaceMemberRequest, DefaultApiUpdateWorkspaceMemberRequest, DefaultApiListIntegrationApiKeysRequest, DefaultApiCreateIntegrationApiKeyRequest, DefaultApiDeleteIntegrationApiKeyRequest, DefaultApiCreateIntegrationRequest, DefaultApiUpdateIntegrationRequest, DefaultApiListIntegrationsRequest, DefaultApiGetIntegrationRequest, DefaultApiGetIntegrationLogsRequest, DefaultApiGetIntegrationByNameRequest, DefaultApiDeleteIntegrationRequest, DefaultApiGetUsageRequest, DefaultApiListUsageHistoryRequest, DefaultApiChangeAISpendQuotaRequest, DefaultApiListActivitiesRequest, DefaultApiIntrospectRequest, DefaultApiCreateFileRequest, DefaultApiDeleteFileRequest, DefaultApiListFilesRequest, DefaultApiGetFileRequest, DefaultApiUpdateFileRequest, DefaultApiSearchFilesRequest, DefaultApiListTablesRequest, DefaultApiGetTableRequest, DefaultApiGetOrCreateTableRequest, DefaultApiCreateTableRequest, DefaultApiDuplicateTableRequest, DefaultApiUpdateTableRequest, DefaultApiRenameTableColumnRequest, DefaultApiDeleteTableRequest, DefaultApiGetTableRowRequest, DefaultApiFindTableRowsRequest, DefaultApiCreateTableRowsRequest, DefaultApiDeleteTableRowsRequest, DefaultApiUpdateTableRowsRequest, DefaultApiUpsertTableRowsRequest } from '.'; | ||
type SimplifyOptions = { | ||
@@ -123,5 +123,4 @@ deep?: boolean; | ||
listFiles: (props: ListFilesProps) => Promise<import("./api").ListFilesResponse>; | ||
getFileMetadata: (props: GetFileMetadataProps) => Promise<import("./api").GetFileMetadataResponse>; | ||
getFileContent: (props: GetFileContentProps) => Promise<import("./api").GetFileContentResponse>; | ||
updateFileMetadata: ({ id, ...updateFileMetadataBody }: UpdateFileMetadataProps) => Promise<import("./api").UpdateFileMetadataResponse>; | ||
getFile: (props: GetFileProps) => Promise<import("./api").GetFileResponse>; | ||
updateFile: ({ id, ...updateFileBody }: UpdateFileProps) => Promise<import("./api").UpdateFileResponse>; | ||
searchFiles: (props: SearchFilesProps) => Promise<import("./api").SearchFilesResponse>; | ||
@@ -239,5 +238,4 @@ listTables: (props: ListTablesProps) => Promise<import("./api").ListTablesResponse>; | ||
export type ListFilesProps = Merge<DefaultApiListFilesRequest, {}>; | ||
export type GetFileMetadataProps = Merge<DefaultApiGetFileMetadataRequest, {}>; | ||
export type GetFileContentProps = Merge<DefaultApiGetFileContentRequest, {}>; | ||
export type UpdateFileMetadataProps = Merge<Except<DefaultApiUpdateFileMetadataRequest, 'updateFileMetadataBody'>, NonNullable<DefaultApiUpdateFileMetadataRequest['updateFileMetadataBody']>>; | ||
export type GetFileProps = Merge<DefaultApiGetFileRequest, {}>; | ||
export type UpdateFileProps = Merge<Except<DefaultApiUpdateFileRequest, 'updateFileBody'>, NonNullable<DefaultApiUpdateFileRequest['updateFileBody']>>; | ||
export type SearchFilesProps = Merge<DefaultApiSearchFilesRequest, {}>; | ||
@@ -244,0 +242,0 @@ export type ListTablesProps = Merge<DefaultApiListTablesRequest, {}>; |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* The version of the OpenAPI document: 0.26.2 | ||
* The version of the OpenAPI document: 0.27.7 | ||
* | ||
@@ -8,0 +8,0 @@ * |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* The version of the OpenAPI document: 0.26.2 | ||
* The version of the OpenAPI document: 0.27.7 | ||
* | ||
@@ -8,0 +8,0 @@ * |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* The version of the OpenAPI document: 0.26.2 | ||
* The version of the OpenAPI document: 0.27.7 | ||
* | ||
@@ -8,0 +8,0 @@ * |
@@ -0,3 +1,6 @@ | ||
/// <reference types="node" /> | ||
import { AxiosError } from 'axios'; | ||
import { ClientProps, ClientConfig } from './config'; | ||
import { ApiClient as AutoGeneratedClient } from './gen/client'; | ||
import { CreateFileResponse, GetFileResponse } from './gen'; | ||
import { ApiClient as AutoGeneratedClient, CreateFileProps } from './gen/client'; | ||
export { isApiError } from './gen/errors'; | ||
@@ -9,4 +12,25 @@ export * as axios from 'axios'; | ||
readonly config: Readonly<ClientConfig>; | ||
private readonly axiosClient; | ||
constructor(clientProps?: ClientProps); | ||
/** | ||
* Creates and uploads a new file in a single step. Returns an object containing the file metadata and the URL to retrieve the file. | ||
*/ | ||
createAndUploadFile: ({ name, data, index, tags, contentType, accessPolicies, }: Omit<{ | ||
name?: string | undefined; | ||
tags?: { | ||
[key: string]: string; | ||
} | undefined; | ||
size: number; | ||
index?: boolean | undefined; | ||
accessPolicies?: import("./gen").CreateFileBodyAccessPoliciesEnum[] | undefined; | ||
contentType?: string | undefined; | ||
}, "size"> & { | ||
data: Buffer; | ||
}) => Promise<GetFileResponse>; | ||
} | ||
export declare class FileUploadError extends Error { | ||
readonly error: AxiosError; | ||
readonly file: CreateFileResponse['file']; | ||
constructor(message: string, error: AxiosError, file: CreateFileResponse['file']); | ||
} | ||
type Simplify<T> = { | ||
@@ -13,0 +37,0 @@ [KeyType in keyof T]: Simplify<T[KeyType]>; |
{ | ||
"name": "@botpress/client", | ||
"version": "0.15.0", | ||
"version": "0.16.0", | ||
"description": "Botpress Client", | ||
@@ -23,3 +23,4 @@ "main": "./dist/index.cjs", | ||
"test": "pnpm run e2e:test", | ||
"e2e:test": "ts-node -T ./e2e/node.ts && ts-node -T ./e2e/browser" | ||
"test:manual": "vitest tests/manual/file-upload", | ||
"e2e:test": "ts-node -T ./tests/e2e/node.ts && ts-node -T ./tests/e2e/browser" | ||
}, | ||
@@ -32,3 +33,3 @@ "dependencies": { | ||
"devDependencies": { | ||
"@botpress/api": "0.26.2", | ||
"@botpress/api": "0.27.7", | ||
"esbuild": "^0.16.12", | ||
@@ -38,4 +39,5 @@ "lodash": "^4.17.21", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^4.9.4" | ||
"typescript": "^4.9.4", | ||
"vitest": "^0.33.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
4430649
24
16850
7