@botpress/api 0.15.9 → 0.15.11

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: {
@@ -1438,8 +1438,7 @@ export declare const state: {
1438
1438
  additionalProperties: true;
1439
1439
  };
1440
1440
  result: {
1441
- type: "object";
1442
- additionalProperties: true;
1441
+ nullable: true;
1443
1442
  };
1444
1443
  };
1445
1444
  required: string[];
@@ -1613,6 +1612,74 @@ export declare const state: {
1613
1612
  };
1614
1613
  };
1615
1614
  };
1615
+ setAccountPreference: {
1616
+ name: string;
1617
+ description: string;
1618
+ method: "post";
1619
+ path: string;
1620
+ section: "account";
1621
+ disableDefaultParameters: {
1622
+ "x-workspace-id": boolean;
1623
+ };
1624
+ parameters: {
1625
+ key: {
1626
+ type: "string";
1627
+ description: string;
1628
+ in: "path";
1629
+ };
1630
+ };
1631
+ requestBody: {
1632
+ description: string;
1633
+ schema: {
1634
+ type: "object";
1635
+ properties: {
1636
+ value: {
1637
+ nullable: true;
1638
+ };
1639
+ };
1640
+ title: string;
1641
+ additionalProperties: false;
1642
+ };
1643
+ };
1644
+ response: {
1645
+ description: string;
1646
+ schema: {
1647
+ type: "object";
1648
+ title: string;
1649
+ additionalProperties: false;
1650
+ };
1651
+ };
1652
+ };
1653
+ getAccountPreference: {
1654
+ name: string;
1655
+ description: string;
1656
+ method: "get";
1657
+ path: string;
1658
+ section: "account";
1659
+ disableDefaultParameters: {
1660
+ "x-workspace-id": boolean;
1661
+ };
1662
+ parameters: {
1663
+ key: {
1664
+ type: "string";
1665
+ description: string;
1666
+ in: "path";
1667
+ };
1668
+ };
1669
+ response: {
1670
+ description: string;
1671
+ schema: {
1672
+ type: "object";
1673
+ properties: {
1674
+ value: {
1675
+ nullable: true;
1676
+ };
1677
+ };
1678
+ title: string;
1679
+ additionalProperties: false;
1680
+ };
1681
+ };
1682
+ };
1616
1683
  listPublicIntegrations: {
1617
1684
  name: string;
1618
1685
  description: string;
@@ -2066,6 +2133,10 @@ export declare const state: {
2066
2133
  blocked: {
2067
2134
  type: "boolean";
2068
2135
  };
2136
+ alwaysAlive: {
2137
+ type: "boolean";
2138
+ description: string;
2139
+ };
2069
2140
  user: {
2070
2141
  type: "object";
2071
2142
  properties: {
@@ -2273,10 +2344,6 @@ export declare const state: {
2273
2344
  };
2274
2345
  description: string;
2275
2346
  };
2276
- alwaysAlive: {
2277
- type: "boolean";
2278
- description: string;
2279
- };
2280
2347
  };
2281
2348
  title: string;
2282
2349
  additionalProperties: false;
@@ -4376,6 +4443,13 @@ export declare const state: {
4376
4443
  };
4377
4444
  additionalProperties: false;
4378
4445
  };
4446
+ secrets: {
4447
+ type: "object";
4448
+ additionalProperties: {
4449
+ type: "string";
4450
+ };
4451
+ description: string;
4452
+ };
4379
4453
  code: {
4380
4454
  type: "string";
4381
4455
  description: string;
@@ -4738,6 +4812,14 @@ export declare const state: {
4738
4812
  };
4739
4813
  additionalProperties: false;
4740
4814
  };
4815
+ secrets: {
4816
+ type: "object";
4817
+ additionalProperties: {
4818
+ type: "string";
4819
+ nullable: true;
4820
+ };
4821
+ description: string;
4822
+ };
4741
4823
  code: {
4742
4824
  type: "string";
4743
4825
  description: string;
@@ -5427,6 +5509,7 @@ export declare const state: {
5427
5509
  configureIntegrationBody: true;
5428
5510
  runVrlBody: true;
5429
5511
  createPersonalAccessTokenBody: true;
5512
+ setAccountPreferenceBody: true;
5430
5513
  createBotBody: true;
5431
5514
  updateBotBody: true;
5432
5515
  transferBotBody: true;
@@ -5479,6 +5562,8 @@ export declare const state: {
5479
5562
  listPersonalAccessTokensResponse: true;
5480
5563
  createPersonalAccessTokenResponse: true;
5481
5564
  deletePersonalAccessTokenResponse: true;
5565
+ setAccountPreferenceResponse: true;
5566
+ getAccountPreferenceResponse: true;
5482
5567
  listPublicIntegrationsResponse: true;
5483
5568
  getPublicIntegrationByIdResponse: true;
5484
5569
  getPublicIntegrationResponse: true;
@@ -5546,6 +5631,9 @@ export declare const state: {
5546
5631
  Message: true;
5547
5632
  State: true;
5548
5633
  File: true;
5634
+ Table: true;
5635
+ Column: true;
5636
+ Row: true;
5549
5637
  };
5550
5638
  };
5551
5639
  schemas: {
@@ -6241,6 +6329,13 @@ export declare const state: {
6241
6329
  type: "string";
6242
6330
  description: string;
6243
6331
  };
6332
+ secrets: {
6333
+ type: "array";
6334
+ items: {
6335
+ type: "string";
6336
+ };
6337
+ description: string;
6338
+ };
6244
6339
  };
6245
6340
  required: string[];
6246
6341
  additionalProperties: false;
@@ -6750,6 +6845,161 @@ export declare const state: {
6750
6845
  additionalProperties: false;
6751
6846
  };
6752
6847
  };
6848
+ Table: {
6849
+ section: "tables";
6850
+ schema: {
6851
+ type: "object";
6852
+ properties: {
6853
+ id: {
6854
+ type: "string";
6855
+ description: string;
6856
+ };
6857
+ name: {
6858
+ type: "string";
6859
+ description: string;
6860
+ };
6861
+ factor: {
6862
+ default: number;
6863
+ type: "number";
6864
+ minimum: number;
6865
+ maximum: number;
6866
+ description: string;
6867
+ };
6868
+ columns: {
6869
+ type: "array";
6870
+ items: {
6871
+ type: "object";
6872
+ properties: {
6873
+ id: {
6874
+ type: "string";
6875
+ description: string;
6876
+ };
6877
+ name: {
6878
+ type: "string";
6879
+ minLength: number;
6880
+ maxLength: number;
6881
+ description: string;
6882
+ };
6883
+ description: {
6884
+ type: "string";
6885
+ description: string;
6886
+ };
6887
+ searchable: {
6888
+ type: "boolean";
6889
+ description: string;
6890
+ };
6891
+ type: {
6892
+ type: "string";
6893
+ enum: string[];
6894
+ description: string;
6895
+ };
6896
+ typings: {
6897
+ type: "string";
6898
+ description: string;
6899
+ };
6900
+ schema: {
6901
+ type: "object";
6902
+ properties: {};
6903
+ additionalProperties: true;
6904
+ };
6905
+ };
6906
+ required: string[];
6907
+ };
6908
+ maxItems: number;
6909
+ description: string;
6910
+ };
6911
+ schema: {
6912
+ type: "object";
6913
+ additionalProperties: true;
6914
+ description: string;
6915
+ };
6916
+ tags: {
6917
+ type: "object";
6918
+ additionalProperties: {
6919
+ type: "string";
6920
+ };
6921
+ description: string;
6922
+ };
6923
+ createdAt: {
6924
+ type: "string";
6925
+ description: string;
6926
+ };
6927
+ updatedAt: {
6928
+ type: "string";
6929
+ description: string;
6930
+ };
6931
+ };
6932
+ required: string[];
6933
+ additionalProperties: false;
6934
+ };
6935
+ };
6936
+ Column: {
6937
+ section: "tables";
6938
+ schema: {
6939
+ type: "object";
6940
+ properties: {
6941
+ id: {
6942
+ type: "string";
6943
+ description: string;
6944
+ };
6945
+ name: {
6946
+ type: "string";
6947
+ minLength: number;
6948
+ maxLength: number;
6949
+ description: string;
6950
+ };
6951
+ description: {
6952
+ type: "string";
6953
+ description: string;
6954
+ };
6955
+ searchable: {
6956
+ type: "boolean";
6957
+ description: string;
6958
+ };
6959
+ type: {
6960
+ type: "string";
6961
+ enum: string[];
6962
+ description: string;
6963
+ };
6964
+ typings: {
6965
+ type: "string";
6966
+ description: string;
6967
+ };
6968
+ schema: {
6969
+ type: "object";
6970
+ additionalProperties: true;
6971
+ };
6972
+ };
6973
+ required: string[];
6974
+ additionalProperties: false;
6975
+ };
6976
+ };
6977
+ Row: {
6978
+ section: "tables";
6979
+ schema: {
6980
+ type: "object";
6981
+ properties: {
6982
+ id: {
6983
+ type: "number";
6984
+ description: string;
6985
+ };
6986
+ createdAt: {
6987
+ type: "string";
6988
+ description: string;
6989
+ };
6990
+ updatedAt: {
6991
+ type: "string";
6992
+ description: string;
6993
+ };
6994
+ similarity: {
6995
+ type: "number";
6996
+ description: string;
6997
+ };
6998
+ };
6999
+ required: string[];
7000
+ additionalProperties: true;
7001
+ };
7002
+ };
6753
7003
  };
6754
7004
  sections: ({
6755
7005
  description: string;
@@ -6847,6 +7097,12 @@ export declare const state: {
6847
7097
  name: "helper";
6848
7098
  operations: string[];
6849
7099
  schema?: undefined;
7100
+ } | {
7101
+ title: string;
7102
+ description: string;
7103
+ name: "tables";
7104
+ operations: never[];
7105
+ schema: string;
6850
7106
  })[];
6851
7107
  options: {
6852
7108
  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.11",
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."}]}