@botpress/client 0.39.0 → 0.40.0

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.ts CHANGED
@@ -5034,6 +5034,10 @@ interface GetBotLogsRequestHeaders {
5034
5034
  interface GetBotLogsRequestQuery {
5035
5035
  timeStart: string;
5036
5036
  timeEnd: string;
5037
+ level?: string;
5038
+ userId?: string;
5039
+ workflowId?: string;
5040
+ conversationId?: string;
5037
5041
  nextToken?: string;
5038
5042
  }
5039
5043
  interface GetBotLogsRequestParams {
@@ -5047,6 +5051,9 @@ interface GetBotLogsResponse {
5047
5051
  timestamp: string;
5048
5052
  level: string;
5049
5053
  message: string;
5054
+ workflowId?: string;
5055
+ userId?: string;
5056
+ conversationId?: string;
5050
5057
  }[];
5051
5058
  nextToken?: string;
5052
5059
  }
@@ -7713,6 +7720,9 @@ interface GetIntegrationLogsRequestHeaders {
7713
7720
  interface GetIntegrationLogsRequestQuery {
7714
7721
  timeStart: string;
7715
7722
  timeEnd: string;
7723
+ level?: string;
7724
+ userId?: string;
7725
+ conversationId?: string;
7716
7726
  nextToken?: string;
7717
7727
  }
7718
7728
  interface GetIntegrationLogsRequestParams {
@@ -7726,6 +7736,9 @@ interface GetIntegrationLogsResponse {
7726
7736
  timestamp: string;
7727
7737
  level: string;
7728
7738
  message: string;
7739
+ workflowId?: string;
7740
+ userId?: string;
7741
+ conversationId?: string;
7729
7742
  }[];
7730
7743
  nextToken?: string;
7731
7744
  }
@@ -13972,14 +13985,16 @@ declare abstract class BaseApiError<Code extends ErrorCode, Type extends string,
13972
13985
  readonly message: string;
13973
13986
  readonly error?: Error | undefined;
13974
13987
  readonly id?: string | undefined;
13988
+ readonly metadata?: Record<string, unknown> | undefined;
13975
13989
  readonly isApiError = true;
13976
- constructor(code: Code, description: Description, type: Type, message: string, error?: Error | undefined, id?: string | undefined);
13990
+ constructor(code: Code, description: Description, type: Type, message: string, error?: Error | undefined, id?: string | undefined, metadata?: Record<string, unknown> | undefined);
13977
13991
  format(): string;
13978
13992
  toJSON(): {
13979
13993
  id: string | undefined;
13980
13994
  code: Code;
13981
13995
  type: Type;
13982
13996
  message: string;
13997
+ metadata: Record<string, unknown> | undefined;
13983
13998
  };
13984
13999
  static generateId(): string;
13985
14000
  private static getPrefix;
@@ -13990,178 +14005,171 @@ type UnknownType = 'Unknown';
13990
14005
  * An unknown error occurred
13991
14006
  */
13992
14007
  declare class UnknownError extends BaseApiError<500, UnknownType, 'An unknown error occurred'> {
13993
- constructor(message: string, error?: Error, id?: string);
14008
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
13994
14009
  }
13995
14010
  type InternalType = 'Internal';
13996
14011
  /**
13997
14012
  * An internal error occurred
13998
14013
  */
13999
14014
  declare class InternalError extends BaseApiError<500, InternalType, 'An internal error occurred'> {
14000
- constructor(message: string, error?: Error, id?: string);
14015
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14001
14016
  }
14002
14017
  type UnauthorizedType = 'Unauthorized';
14003
14018
  /**
14004
14019
  * The request requires to be authenticated.
14005
14020
  */
14006
14021
  declare class UnauthorizedError extends BaseApiError<401, UnauthorizedType, 'The request requires to be authenticated.'> {
14007
- constructor(message: string, error?: Error, id?: string);
14022
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14008
14023
  }
14009
14024
  type ForbiddenType = 'Forbidden';
14010
14025
  /**
14011
14026
  * The requested action can\'t be peform by this resource.
14012
14027
  */
14013
14028
  declare class ForbiddenError extends BaseApiError<403, ForbiddenType, 'The requested action can\'t be peform by this resource.'> {
14014
- constructor(message: string, error?: Error, id?: string);
14029
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14015
14030
  }
14016
14031
  type PayloadTooLargeType = 'PayloadTooLarge';
14017
14032
  /**
14018
14033
  * The request payload is too large.
14019
14034
  */
14020
14035
  declare class PayloadTooLargeError extends BaseApiError<413, PayloadTooLargeType, 'The request payload is too large.'> {
14021
- constructor(message: string, error?: Error, id?: string);
14036
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14022
14037
  }
14023
14038
  type InvalidPayloadType = 'InvalidPayload';
14024
14039
  /**
14025
14040
  * The request payload is invalid.
14026
14041
  */
14027
14042
  declare class InvalidPayloadError extends BaseApiError<400, InvalidPayloadType, 'The request payload is invalid.'> {
14028
- constructor(message: string, error?: Error, id?: string);
14043
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14029
14044
  }
14030
14045
  type UnsupportedMediaTypeType = 'UnsupportedMediaType';
14031
14046
  /**
14032
14047
  * The request is invalid because the content-type is not supported.
14033
14048
  */
14034
14049
  declare class UnsupportedMediaTypeError extends BaseApiError<415, UnsupportedMediaTypeType, 'The request is invalid because the content-type is not supported.'> {
14035
- constructor(message: string, error?: Error, id?: string);
14050
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14036
14051
  }
14037
14052
  type MethodNotFoundType = 'MethodNotFound';
14038
14053
  /**
14039
14054
  * The requested method does not exist.
14040
14055
  */
14041
14056
  declare class MethodNotFoundError extends BaseApiError<405, MethodNotFoundType, 'The requested method does not exist.'> {
14042
- constructor(message: string, error?: Error, id?: string);
14057
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14043
14058
  }
14044
14059
  type ResourceNotFoundType = 'ResourceNotFound';
14045
14060
  /**
14046
14061
  * The requested resource does not exist.
14047
14062
  */
14048
14063
  declare class ResourceNotFoundError extends BaseApiError<404, ResourceNotFoundType, 'The requested resource does not exist.'> {
14049
- constructor(message: string, error?: Error, id?: string);
14064
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14050
14065
  }
14051
14066
  type InvalidJsonSchemaType = 'InvalidJsonSchema';
14052
14067
  /**
14053
14068
  * The provided JSON schema is invalid.
14054
14069
  */
14055
14070
  declare class InvalidJsonSchemaError extends BaseApiError<400, InvalidJsonSchemaType, 'The provided JSON schema is invalid.'> {
14056
- constructor(message: string, error?: Error, id?: string);
14071
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14057
14072
  }
14058
14073
  type InvalidDataFormatType = 'InvalidDataFormat';
14059
14074
  /**
14060
14075
  * The provided data doesn\'t respect the provided JSON schema.
14061
14076
  */
14062
14077
  declare class InvalidDataFormatError extends BaseApiError<400, InvalidDataFormatType, 'The provided data doesn\'t respect the provided JSON schema.'> {
14063
- constructor(message: string, error?: Error, id?: string);
14078
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14064
14079
  }
14065
14080
  type InvalidIdentifierType = 'InvalidIdentifier';
14066
14081
  /**
14067
14082
  * The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.
14068
14083
  */
14069
14084
  declare class InvalidIdentifierError extends BaseApiError<400, InvalidIdentifierType, 'The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.'> {
14070
- constructor(message: string, error?: Error, id?: string);
14085
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14071
14086
  }
14072
14087
  type RelationConflictType = 'RelationConflict';
14073
14088
  /**
14074
14089
  * The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren\'t linked together.
14075
14090
  */
14076
14091
  declare class RelationConflictError extends BaseApiError<409, RelationConflictType, 'The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren\'t linked together.'> {
14077
- constructor(message: string, error?: Error, id?: string);
14092
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14078
14093
  }
14079
14094
  type ReferenceConstraintType = 'ReferenceConstraint';
14080
14095
  /**
14081
14096
  * The resource cannot be deleted because it\'s referenced by another resource
14082
14097
  */
14083
14098
  declare class ReferenceConstraintError extends BaseApiError<409, ReferenceConstraintType, 'The resource cannot be deleted because it\'s referenced by another resource'> {
14084
- constructor(message: string, error?: Error, id?: string);
14099
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14085
14100
  }
14086
14101
  type ResourceLockedConflictType = 'ResourceLockedConflict';
14087
14102
  /**
14088
14103
  * The resource is current locked and cannot be operated on until the lock is released.
14089
14104
  */
14090
14105
  declare class ResourceLockedConflictError extends BaseApiError<409, ResourceLockedConflictType, 'The resource is current locked and cannot be operated on until the lock is released.'> {
14091
- constructor(message: string, error?: Error, id?: string);
14106
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14092
14107
  }
14093
14108
  type ReferenceNotFoundType = 'ReferenceNotFound';
14094
14109
  /**
14095
14110
  * The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.
14096
14111
  */
14097
14112
  declare class ReferenceNotFoundError extends BaseApiError<400, ReferenceNotFoundType, 'The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.'> {
14098
- constructor(message: string, error?: Error, id?: string);
14113
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14099
14114
  }
14100
14115
  type InvalidQueryType = 'InvalidQuery';
14101
14116
  /**
14102
14117
  * The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.
14103
14118
  */
14104
14119
  declare class InvalidQueryError extends BaseApiError<400, InvalidQueryType, 'The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.'> {
14105
- constructor(message: string, error?: Error, id?: string);
14120
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14106
14121
  }
14107
14122
  type RuntimeType = 'Runtime';
14108
14123
  /**
14109
14124
  * An error happened during the execution of a runtime (bot or integration).
14110
14125
  */
14111
14126
  declare class RuntimeError extends BaseApiError<400, RuntimeType, 'An error happened during the execution of a runtime (bot or integration).'> {
14112
- constructor(message: string, error?: Error, id?: string);
14127
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14113
14128
  }
14114
14129
  type AlreadyExistsType = 'AlreadyExists';
14115
14130
  /**
14116
14131
  * The record attempted to be created already exists.
14117
14132
  */
14118
14133
  declare class AlreadyExistsError extends BaseApiError<409, AlreadyExistsType, 'The record attempted to be created already exists.'> {
14119
- constructor(message: string, error?: Error, id?: string);
14134
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14120
14135
  }
14121
14136
  type RateLimitedType = 'RateLimited';
14122
14137
  /**
14123
14138
  * The request has been rate limited.
14124
14139
  */
14125
14140
  declare class RateLimitedError extends BaseApiError<429, RateLimitedType, 'The request has been rate limited.'> {
14126
- constructor(message: string, error?: Error, id?: string);
14141
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14127
14142
  }
14128
14143
  type PaymentRequiredType = 'PaymentRequired';
14129
14144
  /**
14130
14145
  * A payment is required to perform this request.
14131
14146
  */
14132
14147
  declare class PaymentRequiredError extends BaseApiError<402, PaymentRequiredType, 'A payment is required to perform this request.'> {
14133
- constructor(message: string, error?: Error, id?: string);
14148
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14134
14149
  }
14135
14150
  type QuotaExceededType = 'QuotaExceeded';
14136
14151
  /**
14137
14152
  * The request exceeds the allowed quota. Quotas are a soft limit that can be increased.
14138
14153
  */
14139
14154
  declare class QuotaExceededError extends BaseApiError<403, QuotaExceededType, 'The request exceeds the allowed quota. Quotas are a soft limit that can be increased.'> {
14140
- constructor(message: string, error?: Error, id?: string);
14155
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14141
14156
  }
14142
14157
  type LimitExceededType = 'LimitExceeded';
14143
14158
  /**
14144
14159
  * The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.
14145
14160
  */
14146
14161
  declare class LimitExceededError extends BaseApiError<413, LimitExceededType, 'The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.'> {
14147
- constructor(message: string, error?: Error, id?: string);
14162
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14148
14163
  }
14149
14164
  type BreakingChangesType = 'BreakingChanges';
14150
14165
  /**
14151
14166
  * Request payload contains breaking changes which is not allowed for this resource without a version increment.
14152
14167
  */
14153
14168
  declare class BreakingChangesError extends BaseApiError<400, BreakingChangesType, 'Request payload contains breaking changes which is not allowed for this resource without a version increment.'> {
14154
- constructor(message: string, error?: Error, id?: string);
14155
- }
14156
- type UpstreamProviderType = 'UpstreamProvider';
14157
- /**
14158
- * The upstream provider returned an error or is currently unavailable.
14159
- */
14160
- declare class UpstreamProviderError extends BaseApiError<424, UpstreamProviderType, 'The upstream provider returned an error or is currently unavailable.'> {
14161
- constructor(message: string, error?: Error, id?: string);
14169
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14162
14170
  }
14163
- type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceConstraint' | 'ResourceLockedConflict' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime' | 'AlreadyExists' | 'RateLimited' | 'PaymentRequired' | 'QuotaExceeded' | 'LimitExceeded' | 'BreakingChanges' | 'UpstreamProvider';
14164
- type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceConstraintError | ResourceLockedConflictError | ReferenceNotFoundError | InvalidQueryError | RuntimeError | AlreadyExistsError | RateLimitedError | PaymentRequiredError | QuotaExceededError | LimitExceededError | BreakingChangesError | UpstreamProviderError;
14171
+ type ErrorType = 'Unknown' | 'Internal' | 'Unauthorized' | 'Forbidden' | 'PayloadTooLarge' | 'InvalidPayload' | 'UnsupportedMediaType' | 'MethodNotFound' | 'ResourceNotFound' | 'InvalidJsonSchema' | 'InvalidDataFormat' | 'InvalidIdentifier' | 'RelationConflict' | 'ReferenceConstraint' | 'ResourceLockedConflict' | 'ReferenceNotFound' | 'InvalidQuery' | 'Runtime' | 'AlreadyExists' | 'RateLimited' | 'PaymentRequired' | 'QuotaExceeded' | 'LimitExceeded' | 'BreakingChanges';
14172
+ type ApiError = UnknownError | InternalError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | InvalidPayloadError | UnsupportedMediaTypeError | MethodNotFoundError | ResourceNotFoundError | InvalidJsonSchemaError | InvalidDataFormatError | InvalidIdentifierError | RelationConflictError | ReferenceConstraintError | ResourceLockedConflictError | ReferenceNotFoundError | InvalidQueryError | RuntimeError | AlreadyExistsError | RateLimitedError | PaymentRequiredError | QuotaExceededError | LimitExceededError | BreakingChangesError;
14165
14173
  declare const errorFrom: (err: unknown) => ApiError;
14166
14174
 
14167
14175
  declare class UploadFileError extends Error {
@@ -14405,4 +14413,4 @@ declare class Client extends Client$1 implements IClient {
14405
14413
  readonly uploadFile: ({ key, index, tags, contentType, accessPolicies, content, url, indexing, expiresAt, publicContentImmediatelyAccessible, }: ClientInputs["uploadFile"]) => Promise<ClientOutputs["uploadFile"]>;
14406
14414
  }
14407
14415
 
14408
- export { type Account, AlreadyExistsError, type ApiError, type Bot, BreakingChangesError, Client, type ClientConfig, type ClientInputs, type ClientOutputs, type ClientParams, type ClientProps, type ClientReturn, type Column, type Conversation, type ErrorType, type Event, type File, ForbiddenError, type IClient, type Integration, type Interface, InternalError, InvalidDataFormatError, InvalidIdentifierError, InvalidJsonSchemaError, InvalidPayloadError, InvalidQueryError, type Issue, type IssueEvent, LimitExceededError, type Message, MethodNotFoundError, type Operation, PayloadTooLargeError, PaymentRequiredError, type Plugin, QuotaExceededError, RateLimitedError, ReferenceConstraintError, ReferenceNotFoundError, RelationConflictError, ResourceLockedConflictError, ResourceNotFoundError, type RetryConfig, type Row, RuntimeError, type State, type Table, UnauthorizedError, UnknownError, UnsupportedMediaTypeError, UploadFileError, UpstreamProviderError, type Usage, type User, type Workflow, type Workspace, type WorkspaceMember, errorFrom, isApiError };
14416
+ export { type Account, AlreadyExistsError, type ApiError, type Bot, BreakingChangesError, Client, type ClientConfig, type ClientInputs, type ClientOutputs, type ClientParams, type ClientProps, type ClientReturn, type Column, type Conversation, type ErrorType, type Event, type File, ForbiddenError, type IClient, type Integration, type Interface, InternalError, InvalidDataFormatError, InvalidIdentifierError, InvalidJsonSchemaError, InvalidPayloadError, InvalidQueryError, type Issue, type IssueEvent, LimitExceededError, type Message, MethodNotFoundError, type Operation, PayloadTooLargeError, PaymentRequiredError, type Plugin, QuotaExceededError, RateLimitedError, ReferenceConstraintError, ReferenceNotFoundError, RelationConflictError, ResourceLockedConflictError, ResourceNotFoundError, type RetryConfig, type Row, RuntimeError, type State, type Table, UnauthorizedError, UnknownError, UnsupportedMediaTypeError, UploadFileError, type Usage, type User, type Workflow, type Workspace, type WorkspaceMember, errorFrom, isApiError };