@botpress/api 0.15.9 → 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: {
@@ -2273,10 +2345,6 @@ export declare const state: {
2273
2345
  };
2274
2346
  description: string;
2275
2347
  };
2276
- alwaysAlive: {
2277
- type: "boolean";
2278
- description: string;
2279
- };
2280
2348
  };
2281
2349
  title: string;
2282
2350
  additionalProperties: false;
@@ -4376,6 +4444,13 @@ export declare const state: {
4376
4444
  };
4377
4445
  additionalProperties: false;
4378
4446
  };
4447
+ secrets: {
4448
+ type: "object";
4449
+ additionalProperties: {
4450
+ type: "string";
4451
+ };
4452
+ description: string;
4453
+ };
4379
4454
  code: {
4380
4455
  type: "string";
4381
4456
  description: string;
@@ -4738,6 +4813,14 @@ export declare const state: {
4738
4813
  };
4739
4814
  additionalProperties: false;
4740
4815
  };
4816
+ secrets: {
4817
+ type: "object";
4818
+ additionalProperties: {
4819
+ type: "string";
4820
+ nullable: true;
4821
+ };
4822
+ description: string;
4823
+ };
4741
4824
  code: {
4742
4825
  type: "string";
4743
4826
  description: string;
@@ -5427,6 +5510,7 @@ export declare const state: {
5427
5510
  configureIntegrationBody: true;
5428
5511
  runVrlBody: true;
5429
5512
  createPersonalAccessTokenBody: true;
5513
+ setAccountPreferenceBody: true;
5430
5514
  createBotBody: true;
5431
5515
  updateBotBody: true;
5432
5516
  transferBotBody: true;
@@ -5479,6 +5563,8 @@ export declare const state: {
5479
5563
  listPersonalAccessTokensResponse: true;
5480
5564
  createPersonalAccessTokenResponse: true;
5481
5565
  deletePersonalAccessTokenResponse: true;
5566
+ setAccountPreferenceResponse: true;
5567
+ getAccountPreferenceResponse: true;
5482
5568
  listPublicIntegrationsResponse: true;
5483
5569
  getPublicIntegrationByIdResponse: true;
5484
5570
  getPublicIntegrationResponse: true;
@@ -5546,6 +5632,9 @@ export declare const state: {
5546
5632
  Message: true;
5547
5633
  State: true;
5548
5634
  File: true;
5635
+ Table: true;
5636
+ Column: true;
5637
+ Row: true;
5549
5638
  };
5550
5639
  };
5551
5640
  schemas: {
@@ -6241,6 +6330,13 @@ export declare const state: {
6241
6330
  type: "string";
6242
6331
  description: string;
6243
6332
  };
6333
+ secrets: {
6334
+ type: "array";
6335
+ items: {
6336
+ type: "string";
6337
+ };
6338
+ description: string;
6339
+ };
6244
6340
  };
6245
6341
  required: string[];
6246
6342
  additionalProperties: false;
@@ -6750,6 +6846,132 @@ export declare const state: {
6750
6846
  additionalProperties: false;
6751
6847
  };
6752
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
+ };
6753
6975
  };
6754
6976
  sections: ({
6755
6977
  description: string;
@@ -6847,6 +7069,12 @@ export declare const state: {
6847
7069
  name: "helper";
6848
7070
  operations: string[];
6849
7071
  schema?: undefined;
7072
+ } | {
7073
+ title: string;
7074
+ description: string;
7075
+ name: "tables";
7076
+ operations: never[];
7077
+ schema: string;
6850
7078
  })[];
6851
7079
  options: {
6852
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.9",
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."}]}