@botpress/api 0.15.8 → 0.15.10

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.
@@ -1,5 +1,5 @@
1
1
  import * as opapi from "@bpinternal/opapi";
2
- export type State = opapi.State<"Bot" | "Integration" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "User" | "Conversation" | "Event" | "Message" | "State" | "File", never, "user" | "conversation" | "event" | "message" | "file" | "state" | "hub" | "action" | "bot" | "integration" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas" | "helper">;
2
+ export type State = opapi.State<"Bot" | "Integration" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "User" | "Conversation" | "Event" | "Message" | "State" | "File" | "Table" | "Column" | "Row", never, "user" | "conversation" | "event" | "message" | "file" | "state" | "hub" | "action" | "bot" | "integration" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas" | "helper" | "tables">;
3
3
  export declare const state: {
4
4
  operations: {
5
5
  createConversation: {
@@ -1613,6 +1613,74 @@ export declare const state: {
1613
1613
  };
1614
1614
  };
1615
1615
  };
1616
+ setAccountPreference: {
1617
+ name: string;
1618
+ description: string;
1619
+ method: "post";
1620
+ path: string;
1621
+ section: "account";
1622
+ disableDefaultParameters: {
1623
+ "x-workspace-id": boolean;
1624
+ };
1625
+ parameters: {
1626
+ key: {
1627
+ type: "string";
1628
+ description: string;
1629
+ in: "path";
1630
+ };
1631
+ };
1632
+ requestBody: {
1633
+ description: string;
1634
+ schema: {
1635
+ type: "object";
1636
+ properties: {
1637
+ value: {
1638
+ nullable: true;
1639
+ };
1640
+ };
1641
+ title: string;
1642
+ additionalProperties: false;
1643
+ };
1644
+ };
1645
+ response: {
1646
+ description: string;
1647
+ schema: {
1648
+ type: "object";
1649
+ title: string;
1650
+ additionalProperties: false;
1651
+ };
1652
+ };
1653
+ };
1654
+ getAccountPreference: {
1655
+ name: string;
1656
+ description: string;
1657
+ method: "get";
1658
+ path: string;
1659
+ section: "account";
1660
+ disableDefaultParameters: {
1661
+ "x-workspace-id": boolean;
1662
+ };
1663
+ parameters: {
1664
+ key: {
1665
+ type: "string";
1666
+ description: string;
1667
+ in: "path";
1668
+ };
1669
+ };
1670
+ response: {
1671
+ description: string;
1672
+ schema: {
1673
+ type: "object";
1674
+ properties: {
1675
+ value: {
1676
+ nullable: true;
1677
+ };
1678
+ };
1679
+ title: string;
1680
+ additionalProperties: false;
1681
+ };
1682
+ };
1683
+ };
1616
1684
  listPublicIntegrations: {
1617
1685
  name: string;
1618
1686
  description: string;
@@ -2066,6 +2134,10 @@ export declare const state: {
2066
2134
  blocked: {
2067
2135
  type: "boolean";
2068
2136
  };
2137
+ alwaysAlive: {
2138
+ type: "boolean";
2139
+ description: string;
2140
+ };
2069
2141
  user: {
2070
2142
  type: "object";
2071
2143
  properties: {
@@ -4372,6 +4444,13 @@ export declare const state: {
4372
4444
  };
4373
4445
  additionalProperties: false;
4374
4446
  };
4447
+ secrets: {
4448
+ type: "object";
4449
+ additionalProperties: {
4450
+ type: "string";
4451
+ };
4452
+ description: string;
4453
+ };
4375
4454
  code: {
4376
4455
  type: "string";
4377
4456
  description: string;
@@ -4734,6 +4813,14 @@ export declare const state: {
4734
4813
  };
4735
4814
  additionalProperties: false;
4736
4815
  };
4816
+ secrets: {
4817
+ type: "object";
4818
+ additionalProperties: {
4819
+ type: "string";
4820
+ nullable: true;
4821
+ };
4822
+ description: string;
4823
+ };
4737
4824
  code: {
4738
4825
  type: "string";
4739
4826
  description: string;
@@ -5423,6 +5510,7 @@ export declare const state: {
5423
5510
  configureIntegrationBody: true;
5424
5511
  runVrlBody: true;
5425
5512
  createPersonalAccessTokenBody: true;
5513
+ setAccountPreferenceBody: true;
5426
5514
  createBotBody: true;
5427
5515
  updateBotBody: true;
5428
5516
  transferBotBody: true;
@@ -5475,6 +5563,8 @@ export declare const state: {
5475
5563
  listPersonalAccessTokensResponse: true;
5476
5564
  createPersonalAccessTokenResponse: true;
5477
5565
  deletePersonalAccessTokenResponse: true;
5566
+ setAccountPreferenceResponse: true;
5567
+ getAccountPreferenceResponse: true;
5478
5568
  listPublicIntegrationsResponse: true;
5479
5569
  getPublicIntegrationByIdResponse: true;
5480
5570
  getPublicIntegrationResponse: true;
@@ -5542,6 +5632,9 @@ export declare const state: {
5542
5632
  Message: true;
5543
5633
  State: true;
5544
5634
  File: true;
5635
+ Table: true;
5636
+ Column: true;
5637
+ Row: true;
5545
5638
  };
5546
5639
  };
5547
5640
  schemas: {
@@ -5858,6 +5951,15 @@ export declare const state: {
5858
5951
  type: "string";
5859
5952
  description: string;
5860
5953
  };
5954
+ alwaysAlive: {
5955
+ type: "boolean";
5956
+ description: string;
5957
+ };
5958
+ status: {
5959
+ type: "string";
5960
+ enum: string[];
5961
+ description: string;
5962
+ };
5861
5963
  medias: {
5862
5964
  type: "array";
5863
5965
  items: {
@@ -6228,6 +6330,13 @@ export declare const state: {
6228
6330
  type: "string";
6229
6331
  description: string;
6230
6332
  };
6333
+ secrets: {
6334
+ type: "array";
6335
+ items: {
6336
+ type: "string";
6337
+ };
6338
+ description: string;
6339
+ };
6231
6340
  };
6232
6341
  required: string[];
6233
6342
  additionalProperties: false;
@@ -6737,6 +6846,132 @@ export declare const state: {
6737
6846
  additionalProperties: false;
6738
6847
  };
6739
6848
  };
6849
+ Table: {
6850
+ section: "tables";
6851
+ schema: {
6852
+ type: "object";
6853
+ properties: {
6854
+ id: {
6855
+ type: "string";
6856
+ description: string;
6857
+ };
6858
+ name: {
6859
+ type: "string";
6860
+ description: string;
6861
+ };
6862
+ factor: {
6863
+ default: number;
6864
+ type: "number";
6865
+ minimum: number;
6866
+ maximum: number;
6867
+ description: string;
6868
+ };
6869
+ columns: {
6870
+ type: "array";
6871
+ items: {
6872
+ type: "object";
6873
+ properties: {
6874
+ id: {
6875
+ type: "string";
6876
+ description: string;
6877
+ };
6878
+ name: {
6879
+ type: "string";
6880
+ minLength: number;
6881
+ maxLength: number;
6882
+ description: string;
6883
+ };
6884
+ description: {
6885
+ type: "string";
6886
+ description: string;
6887
+ };
6888
+ searchable: {
6889
+ type: "boolean";
6890
+ description: string;
6891
+ };
6892
+ type: {
6893
+ type: "string";
6894
+ enum: string[];
6895
+ description: string;
6896
+ };
6897
+ typings: {
6898
+ type: "string";
6899
+ description: string;
6900
+ };
6901
+ };
6902
+ required: string[];
6903
+ };
6904
+ maxItems: number;
6905
+ description: string;
6906
+ };
6907
+ };
6908
+ required: string[];
6909
+ additionalProperties: false;
6910
+ };
6911
+ };
6912
+ Column: {
6913
+ section: "tables";
6914
+ schema: {
6915
+ type: "object";
6916
+ properties: {
6917
+ id: {
6918
+ type: "string";
6919
+ description: string;
6920
+ };
6921
+ name: {
6922
+ type: "string";
6923
+ minLength: number;
6924
+ maxLength: number;
6925
+ description: string;
6926
+ };
6927
+ description: {
6928
+ type: "string";
6929
+ description: string;
6930
+ };
6931
+ searchable: {
6932
+ type: "boolean";
6933
+ description: string;
6934
+ };
6935
+ type: {
6936
+ type: "string";
6937
+ enum: string[];
6938
+ description: string;
6939
+ };
6940
+ typings: {
6941
+ type: "string";
6942
+ description: string;
6943
+ };
6944
+ };
6945
+ required: string[];
6946
+ additionalProperties: false;
6947
+ };
6948
+ };
6949
+ Row: {
6950
+ section: "tables";
6951
+ schema: {
6952
+ type: "object";
6953
+ properties: {
6954
+ id: {
6955
+ type: "number";
6956
+ description: string;
6957
+ };
6958
+ createdAt: {
6959
+ type: "string";
6960
+ description: string;
6961
+ };
6962
+ updatedAt: {
6963
+ type: "string";
6964
+ description: string;
6965
+ };
6966
+ similarity: {
6967
+ type: "number";
6968
+ description: string;
6969
+ };
6970
+ };
6971
+ required: string[];
6972
+ additionalProperties: true;
6973
+ };
6974
+ };
6740
6975
  };
6741
6976
  sections: ({
6742
6977
  description: string;
@@ -6834,6 +7069,12 @@ export declare const state: {
6834
7069
  name: "helper";
6835
7070
  operations: string[];
6836
7071
  schema?: undefined;
7072
+ } | {
7073
+ title: string;
7074
+ description: string;
7075
+ name: "tables";
7076
+ operations: never[];
7077
+ schema: string;
6837
7078
  })[];
6838
7079
  options: {
6839
7080
  allowUnions: false;
@@ -1,7 +1,7 @@
1
1
  export * from './gen/state';
2
2
  export declare const api: {
3
- getModelRef: (name: "Bot" | "Integration" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "User" | "Conversation" | "Event" | "Message" | "State" | "File") => import("@bpinternal/opapi").OpenApiZodAny;
4
- addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-workspace-id", "user" | "conversation" | "event" | "message" | "file" | "state" | "hub" | "action" | "bot" | "integration" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas" | "helper", Path, "zod-schema">) => void;
3
+ getModelRef: (name: "Bot" | "Integration" | "Workspace" | "WorkspaceMember" | "Account" | "Usage" | "Issue" | "IssueEvent" | "User" | "Conversation" | "Event" | "Message" | "State" | "File" | "Table" | "Column" | "Row") => import("@bpinternal/opapi").OpenApiZodAny;
4
+ addOperation: <Path extends string>(operationProps: import("@bpinternal/opapi").Operation<"x-workspace-id", "user" | "conversation" | "event" | "message" | "file" | "state" | "hub" | "action" | "bot" | "integration" | "workspace" | "workspaceMember" | "account" | "usage" | "quotas" | "helper" | "tables", Path, "zod-schema">) => void;
5
5
  exportClient: (dir: string | undefined, openapiGeneratorEndpoint: string, postProcessors?: import("@bpinternal/opapi").OpenApiPostProcessors | undefined) => Promise<void>;
6
6
  exportTypesBySection: (dir?: string | undefined) => Promise<void>;
7
7
  exportServer: (dir: string | undefined, useExpressTypes: boolean) => Promise<void>;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@botpress/api",
3
- "version": "0.15.8",
3
+ "version": "0.15.10",
4
4
  "main": "dist/index.js",
5
- "types": "dist/index.d.ts",
5
+ "types": "dist/src/index.d.ts",
6
6
  "scripts": {
7
7
  "openapi": "es-node openapi/generator.ts && pnpm run build",
8
8
  "openapi:lint": "spectral lint --fail-severity warn --ruleset ../../.spectral.yaml src/gen/openapi.json",
@@ -17,9 +17,10 @@
17
17
  "@botpress/cloud-manager": "*",
18
18
  "@botpress/common": "*",
19
19
  "@botpress/storage": "*",
20
+ "@bpinternal/tables-api": "*",
20
21
  "esb-node": "0.0.1",
21
22
  "esbuild": "^0.16.10",
22
- "zod": "^3.20.6"
23
+ "zod": "^3.22.4"
23
24
  },
24
25
  "dependencies": {
25
26
  "@bpinternal/opapi": "0.6.3"
@@ -1 +1 @@
1
- {"sections":[{"description":"","title":"User","name":"user","operations":["createUser","getUser","listUsers","getOrCreateUser","updateUser","deleteUser"],"schema":"User"},{"description":"","title":"Conversation","name":"conversation","operations":["createConversation","getConversation","listConversations","getOrCreateConversation","updateConversation","deleteConversation","listParticipants","addParticipant","getParticipant","removeParticipant"],"schema":"Conversation"},{"description":"","title":"Event","name":"event","operations":["createEvent","getEvent","listEvents"],"schema":"Event"},{"description":"","title":"Message","name":"message","operations":["createMessage","getOrCreateMessage","getMessage","updateMessage","listMessages","deleteMessage"],"schema":"Message"},{"description":"","title":"File","name":"file","operations":["createFile","getFile","downloadFile","deleteFile","listFiles"],"schema":"File"},{"description":"","title":"State","name":"state","operations":["getState","setState","patchState"],"schema":"State"},{"title":"Hub","description":"","name":"hub","operations":["listPublicIntegrations","getPublicIntegrationById","getPublicIntegration"]},{"description":"","title":"Action","name":"action","operations":["callAction"]},{"title":"Bot","description":"","name":"bot","operations":["createBot","updateBot","transferBot","listBots","getBot","deleteBot","getBotLogs","getBotWebchat","getBotAnalytics","listBotIssues","deleteBotIssue","listBotIssueEvents"],"schema":"Bot"},{"title":"Integration","description":"","name":"integration","operations":["createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration"],"schema":"Integration"},{"title":"Workspace","description":"","name":"workspace","operations":["getWorkspaceBillingDetails","setWorkspacePaymentMethod","listWorkspaceInvoices","chargeWorkspaceUnpaidInvoices","createWorkspace","getWorkspace","listWorkspaceUsages","breakDownWorkspaceUsageByBot","getAllWorkspaceQuotaCompletion","getWorkspaceQuota","listWorkspaceQuotas","updateWorkspace","listWorkspaces","changeWorkspacePlan","deleteWorkspace","getAuditRecords"],"schema":"Workspace"},{"title":"Workspace Member","description":"","name":"workspaceMember","operations":["listWorkspaceMembers","deleteWorkspaceMember","createWorkspaceMember","updateWorkspaceMember"],"schema":"WorkspaceMember"},{"title":"Account","description":"","name":"account","operations":["getAccount","listPersonalAccessTokens","createPersonalAccessToken","deletePersonalAccessToken"],"schema":"Account"},{"title":"Usage","description":"","name":"usage","operations":["getUsage"],"schema":"Usage"},{"title":"Quotas","description":"","name":"quotas","operations":["changeAISpendQuota"]},{"title":"Helper","description":"","name":"helper","operations":["runVrl"]}],"errors":[{"status":500,"type":"Unknown","description":"An unknown error occurred"},{"status":500,"type":"Internal","description":"An internal error occurred"},{"status":401,"type":"Unauthorized","description":"The request requires to be authenticated."},{"status":403,"type":"Forbidden","description":"The requested action can't be peform by this resource."},{"status":413,"type":"PayloadTooLarge","description":"The request payload is too large."},{"status":400,"type":"InvalidPayload","description":"The request payload is invalid."},{"status":415,"type":"UnsupportedMediaType","description":"The request is invalid because the content-type is not supported."},{"status":405,"type":"MethodNotFound","description":"The requested method does not exist."},{"status":404,"type":"ResourceNotFound","description":"The requested resource does not exist."},{"status":400,"type":"InvalidJsonSchema","description":"The provided JSON schema is invalid."},{"status":400,"type":"InvalidDataFormat","description":"The provided data doesn't respect the provided JSON schema."},{"status":400,"type":"InvalidIdentifier","description":"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."},{"status":409,"type":"RelationConflict","description":"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together."},{"status":400,"type":"ReferenceNotFound","description":"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request."},{"status":400,"type":"InvalidQuery","description":"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource."},{"status":400,"type":"Runtime","description":"An error happened during the execution of a runtime (bot or integration)."},{"status":409,"type":"AlreadyExists","description":"The record attempted to be created already exists."},{"status":429,"type":"RateLimited","description":"The request has been rate limited."},{"status":402,"type":"PaymentRequired","description":"A payment is required to perform this request."},{"status":403,"type":"QuotaExceeded","description":"The request exceeds the allowed quota. Quotas are a soft limit that can be increased."},{"status":413,"type":"LimitExceeded","description":"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased."}]}
1
+ {"sections":[{"description":"","title":"User","name":"user","operations":["createUser","getUser","listUsers","getOrCreateUser","updateUser","deleteUser"],"schema":"User"},{"description":"","title":"Conversation","name":"conversation","operations":["createConversation","getConversation","listConversations","getOrCreateConversation","updateConversation","deleteConversation","listParticipants","addParticipant","getParticipant","removeParticipant"],"schema":"Conversation"},{"description":"","title":"Event","name":"event","operations":["createEvent","getEvent","listEvents"],"schema":"Event"},{"description":"","title":"Message","name":"message","operations":["createMessage","getOrCreateMessage","getMessage","updateMessage","listMessages","deleteMessage"],"schema":"Message"},{"description":"","title":"File","name":"file","operations":["createFile","getFile","downloadFile","deleteFile","listFiles"],"schema":"File"},{"description":"","title":"State","name":"state","operations":["getState","setState","patchState"],"schema":"State"},{"title":"Hub","description":"","name":"hub","operations":["listPublicIntegrations","getPublicIntegrationById","getPublicIntegration"]},{"description":"","title":"Action","name":"action","operations":["callAction"]},{"title":"Bot","description":"","name":"bot","operations":["createBot","updateBot","transferBot","listBots","getBot","deleteBot","getBotLogs","getBotWebchat","getBotAnalytics","listBotIssues","deleteBotIssue","listBotIssueEvents"],"schema":"Bot"},{"title":"Integration","description":"","name":"integration","operations":["createIntegration","updateIntegration","listIntegrations","getIntegration","getIntegrationLogs","getIntegrationByName","deleteIntegration"],"schema":"Integration"},{"title":"Workspace","description":"","name":"workspace","operations":["getWorkspaceBillingDetails","setWorkspacePaymentMethod","listWorkspaceInvoices","chargeWorkspaceUnpaidInvoices","createWorkspace","getWorkspace","listWorkspaceUsages","breakDownWorkspaceUsageByBot","getAllWorkspaceQuotaCompletion","getWorkspaceQuota","listWorkspaceQuotas","updateWorkspace","listWorkspaces","changeWorkspacePlan","deleteWorkspace","getAuditRecords"],"schema":"Workspace"},{"title":"Workspace Member","description":"","name":"workspaceMember","operations":["listWorkspaceMembers","deleteWorkspaceMember","createWorkspaceMember","updateWorkspaceMember"],"schema":"WorkspaceMember"},{"title":"Account","description":"","name":"account","operations":["getAccount","listPersonalAccessTokens","createPersonalAccessToken","deletePersonalAccessToken","setAccountPreference","getAccountPreference"],"schema":"Account"},{"title":"Usage","description":"","name":"usage","operations":["getUsage"],"schema":"Usage"},{"title":"Quotas","description":"","name":"quotas","operations":["changeAISpendQuota"]},{"title":"Helper","description":"","name":"helper","operations":["runVrl"]},{"title":"Tables","description":"Operations related to table management.","name":"tables","operations":[],"schema":"Table"}],"errors":[{"status":500,"type":"Unknown","description":"An unknown error occurred"},{"status":500,"type":"Internal","description":"An internal error occurred"},{"status":401,"type":"Unauthorized","description":"The request requires to be authenticated."},{"status":403,"type":"Forbidden","description":"The requested action can't be peform by this resource."},{"status":413,"type":"PayloadTooLarge","description":"The request payload is too large."},{"status":400,"type":"InvalidPayload","description":"The request payload is invalid."},{"status":415,"type":"UnsupportedMediaType","description":"The request is invalid because the content-type is not supported."},{"status":405,"type":"MethodNotFound","description":"The requested method does not exist."},{"status":404,"type":"ResourceNotFound","description":"The requested resource does not exist."},{"status":400,"type":"InvalidJsonSchema","description":"The provided JSON schema is invalid."},{"status":400,"type":"InvalidDataFormat","description":"The provided data doesn't respect the provided JSON schema."},{"status":400,"type":"InvalidIdentifier","description":"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."},{"status":409,"type":"RelationConflict","description":"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together."},{"status":400,"type":"ReferenceNotFound","description":"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request."},{"status":400,"type":"InvalidQuery","description":"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource."},{"status":400,"type":"Runtime","description":"An error happened during the execution of a runtime (bot or integration)."},{"status":409,"type":"AlreadyExists","description":"The record attempted to be created already exists."},{"status":429,"type":"RateLimited","description":"The request has been rate limited."},{"status":402,"type":"PaymentRequired","description":"A payment is required to perform this request."},{"status":403,"type":"QuotaExceeded","description":"The request exceeds the allowed quota. Quotas are a soft limit that can be increased."},{"status":413,"type":"LimitExceeded","description":"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased."}]}