@botpress/client 0.38.2 → 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
  }
@@ -13956,6 +13969,7 @@ declare const codes: {
13956
13969
  readonly HTTP_STATUS_CONFLICT: 409;
13957
13970
  readonly HTTP_STATUS_PAYLOAD_TOO_LARGE: 413;
13958
13971
  readonly HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: 415;
13972
+ readonly HTTP_STATUS_DEPENDENCY_FAILED: 424;
13959
13973
  readonly HTTP_STATUS_TOO_MANY_REQUESTS: 429;
13960
13974
  readonly HTTP_STATUS_INTERNAL_SERVER_ERROR: 500;
13961
13975
  readonly HTTP_STATUS_NOT_IMPLEMENTED: 501;
@@ -13971,14 +13985,16 @@ declare abstract class BaseApiError<Code extends ErrorCode, Type extends string,
13971
13985
  readonly message: string;
13972
13986
  readonly error?: Error | undefined;
13973
13987
  readonly id?: string | undefined;
13988
+ readonly metadata?: Record<string, unknown> | undefined;
13974
13989
  readonly isApiError = true;
13975
- 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);
13976
13991
  format(): string;
13977
13992
  toJSON(): {
13978
13993
  id: string | undefined;
13979
13994
  code: Code;
13980
13995
  type: Type;
13981
13996
  message: string;
13997
+ metadata: Record<string, unknown> | undefined;
13982
13998
  };
13983
13999
  static generateId(): string;
13984
14000
  private static getPrefix;
@@ -13989,178 +14005,171 @@ type UnknownType = 'Unknown';
13989
14005
  * An unknown error occurred
13990
14006
  */
13991
14007
  declare class UnknownError extends BaseApiError<500, UnknownType, 'An unknown error occurred'> {
13992
- constructor(message: string, error?: Error, id?: string);
14008
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
13993
14009
  }
13994
14010
  type InternalType = 'Internal';
13995
14011
  /**
13996
14012
  * An internal error occurred
13997
14013
  */
13998
14014
  declare class InternalError extends BaseApiError<500, InternalType, 'An internal error occurred'> {
13999
- constructor(message: string, error?: Error, id?: string);
14015
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14000
14016
  }
14001
14017
  type UnauthorizedType = 'Unauthorized';
14002
14018
  /**
14003
14019
  * The request requires to be authenticated.
14004
14020
  */
14005
14021
  declare class UnauthorizedError extends BaseApiError<401, UnauthorizedType, 'The request requires to be authenticated.'> {
14006
- constructor(message: string, error?: Error, id?: string);
14022
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14007
14023
  }
14008
14024
  type ForbiddenType = 'Forbidden';
14009
14025
  /**
14010
14026
  * The requested action can\'t be peform by this resource.
14011
14027
  */
14012
14028
  declare class ForbiddenError extends BaseApiError<403, ForbiddenType, 'The requested action can\'t be peform by this resource.'> {
14013
- constructor(message: string, error?: Error, id?: string);
14029
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14014
14030
  }
14015
14031
  type PayloadTooLargeType = 'PayloadTooLarge';
14016
14032
  /**
14017
14033
  * The request payload is too large.
14018
14034
  */
14019
14035
  declare class PayloadTooLargeError extends BaseApiError<413, PayloadTooLargeType, 'The request payload is too large.'> {
14020
- constructor(message: string, error?: Error, id?: string);
14036
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14021
14037
  }
14022
14038
  type InvalidPayloadType = 'InvalidPayload';
14023
14039
  /**
14024
14040
  * The request payload is invalid.
14025
14041
  */
14026
14042
  declare class InvalidPayloadError extends BaseApiError<400, InvalidPayloadType, 'The request payload is invalid.'> {
14027
- constructor(message: string, error?: Error, id?: string);
14043
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14028
14044
  }
14029
14045
  type UnsupportedMediaTypeType = 'UnsupportedMediaType';
14030
14046
  /**
14031
14047
  * The request is invalid because the content-type is not supported.
14032
14048
  */
14033
14049
  declare class UnsupportedMediaTypeError extends BaseApiError<415, UnsupportedMediaTypeType, 'The request is invalid because the content-type is not supported.'> {
14034
- constructor(message: string, error?: Error, id?: string);
14050
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14035
14051
  }
14036
14052
  type MethodNotFoundType = 'MethodNotFound';
14037
14053
  /**
14038
14054
  * The requested method does not exist.
14039
14055
  */
14040
14056
  declare class MethodNotFoundError extends BaseApiError<405, MethodNotFoundType, 'The requested method does not exist.'> {
14041
- constructor(message: string, error?: Error, id?: string);
14057
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14042
14058
  }
14043
14059
  type ResourceNotFoundType = 'ResourceNotFound';
14044
14060
  /**
14045
14061
  * The requested resource does not exist.
14046
14062
  */
14047
14063
  declare class ResourceNotFoundError extends BaseApiError<404, ResourceNotFoundType, 'The requested resource does not exist.'> {
14048
- constructor(message: string, error?: Error, id?: string);
14064
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14049
14065
  }
14050
14066
  type InvalidJsonSchemaType = 'InvalidJsonSchema';
14051
14067
  /**
14052
14068
  * The provided JSON schema is invalid.
14053
14069
  */
14054
14070
  declare class InvalidJsonSchemaError extends BaseApiError<400, InvalidJsonSchemaType, 'The provided JSON schema is invalid.'> {
14055
- constructor(message: string, error?: Error, id?: string);
14071
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14056
14072
  }
14057
14073
  type InvalidDataFormatType = 'InvalidDataFormat';
14058
14074
  /**
14059
14075
  * The provided data doesn\'t respect the provided JSON schema.
14060
14076
  */
14061
14077
  declare class InvalidDataFormatError extends BaseApiError<400, InvalidDataFormatType, 'The provided data doesn\'t respect the provided JSON schema.'> {
14062
- constructor(message: string, error?: Error, id?: string);
14078
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14063
14079
  }
14064
14080
  type InvalidIdentifierType = 'InvalidIdentifier';
14065
14081
  /**
14066
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.
14067
14083
  */
14068
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.'> {
14069
- constructor(message: string, error?: Error, id?: string);
14085
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14070
14086
  }
14071
14087
  type RelationConflictType = 'RelationConflict';
14072
14088
  /**
14073
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.
14074
14090
  */
14075
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.'> {
14076
- constructor(message: string, error?: Error, id?: string);
14092
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14077
14093
  }
14078
14094
  type ReferenceConstraintType = 'ReferenceConstraint';
14079
14095
  /**
14080
14096
  * The resource cannot be deleted because it\'s referenced by another resource
14081
14097
  */
14082
14098
  declare class ReferenceConstraintError extends BaseApiError<409, ReferenceConstraintType, 'The resource cannot be deleted because it\'s referenced by another resource'> {
14083
- constructor(message: string, error?: Error, id?: string);
14099
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14084
14100
  }
14085
14101
  type ResourceLockedConflictType = 'ResourceLockedConflict';
14086
14102
  /**
14087
14103
  * The resource is current locked and cannot be operated on until the lock is released.
14088
14104
  */
14089
14105
  declare class ResourceLockedConflictError extends BaseApiError<409, ResourceLockedConflictType, 'The resource is current locked and cannot be operated on until the lock is released.'> {
14090
- constructor(message: string, error?: Error, id?: string);
14106
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14091
14107
  }
14092
14108
  type ReferenceNotFoundType = 'ReferenceNotFound';
14093
14109
  /**
14094
14110
  * The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.
14095
14111
  */
14096
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.'> {
14097
- constructor(message: string, error?: Error, id?: string);
14113
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14098
14114
  }
14099
14115
  type InvalidQueryType = 'InvalidQuery';
14100
14116
  /**
14101
14117
  * The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.
14102
14118
  */
14103
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.'> {
14104
- constructor(message: string, error?: Error, id?: string);
14120
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14105
14121
  }
14106
14122
  type RuntimeType = 'Runtime';
14107
14123
  /**
14108
14124
  * An error happened during the execution of a runtime (bot or integration).
14109
14125
  */
14110
14126
  declare class RuntimeError extends BaseApiError<400, RuntimeType, 'An error happened during the execution of a runtime (bot or integration).'> {
14111
- constructor(message: string, error?: Error, id?: string);
14127
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14112
14128
  }
14113
14129
  type AlreadyExistsType = 'AlreadyExists';
14114
14130
  /**
14115
14131
  * The record attempted to be created already exists.
14116
14132
  */
14117
14133
  declare class AlreadyExistsError extends BaseApiError<409, AlreadyExistsType, 'The record attempted to be created already exists.'> {
14118
- constructor(message: string, error?: Error, id?: string);
14134
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14119
14135
  }
14120
14136
  type RateLimitedType = 'RateLimited';
14121
14137
  /**
14122
14138
  * The request has been rate limited.
14123
14139
  */
14124
14140
  declare class RateLimitedError extends BaseApiError<429, RateLimitedType, 'The request has been rate limited.'> {
14125
- constructor(message: string, error?: Error, id?: string);
14141
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14126
14142
  }
14127
14143
  type PaymentRequiredType = 'PaymentRequired';
14128
14144
  /**
14129
14145
  * A payment is required to perform this request.
14130
14146
  */
14131
14147
  declare class PaymentRequiredError extends BaseApiError<402, PaymentRequiredType, 'A payment is required to perform this request.'> {
14132
- constructor(message: string, error?: Error, id?: string);
14148
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14133
14149
  }
14134
14150
  type QuotaExceededType = 'QuotaExceeded';
14135
14151
  /**
14136
14152
  * The request exceeds the allowed quota. Quotas are a soft limit that can be increased.
14137
14153
  */
14138
14154
  declare class QuotaExceededError extends BaseApiError<403, QuotaExceededType, 'The request exceeds the allowed quota. Quotas are a soft limit that can be increased.'> {
14139
- constructor(message: string, error?: Error, id?: string);
14155
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14140
14156
  }
14141
14157
  type LimitExceededType = 'LimitExceeded';
14142
14158
  /**
14143
14159
  * The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.
14144
14160
  */
14145
14161
  declare class LimitExceededError extends BaseApiError<413, LimitExceededType, 'The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.'> {
14146
- constructor(message: string, error?: Error, id?: string);
14162
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14147
14163
  }
14148
14164
  type BreakingChangesType = 'BreakingChanges';
14149
14165
  /**
14150
14166
  * Request payload contains breaking changes which is not allowed for this resource without a version increment.
14151
14167
  */
14152
14168
  declare class BreakingChangesError extends BaseApiError<400, BreakingChangesType, 'Request payload contains breaking changes which is not allowed for this resource without a version increment.'> {
14153
- constructor(message: string, error?: Error, id?: string);
14154
- }
14155
- type UpstreamProviderType = 'UpstreamProvider';
14156
- /**
14157
- * The upstream provider returned an error or is currently unavailable.
14158
- */
14159
- declare class UpstreamProviderError extends BaseApiError<502, UpstreamProviderType, 'The upstream provider returned an error or is currently unavailable.'> {
14160
- constructor(message: string, error?: Error, id?: string);
14169
+ constructor(message: string, error?: Error, id?: string, metadata?: Record<string, unknown>);
14161
14170
  }
14162
- 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';
14163
- 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;
14164
14173
  declare const errorFrom: (err: unknown) => ApiError;
14165
14174
 
14166
14175
  declare class UploadFileError extends Error {
@@ -14404,4 +14413,4 @@ declare class Client extends Client$1 implements IClient {
14404
14413
  readonly uploadFile: ({ key, index, tags, contentType, accessPolicies, content, url, indexing, expiresAt, publicContentImmediatelyAccessible, }: ClientInputs["uploadFile"]) => Promise<ClientOutputs["uploadFile"]>;
14405
14414
  }
14406
14415
 
14407
- 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 };