@budibase/types 3.9.2 → 3.9.4

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,11 +1,10 @@
1
+ import openai from "openai";
1
2
  import { EnrichedBinding } from "../../ui";
2
3
  export interface Message {
3
4
  role: "system" | "user";
4
5
  content: string;
5
6
  }
6
- export declare enum StructuredOutput {
7
- }
8
- export type ResponseFormat = "text" | "json" | StructuredOutput;
7
+ export type ResponseFormat = "text" | "json" | openai.ResponseFormatJSONSchema;
9
8
  export interface ChatCompletionRequest {
10
9
  messages: Message[];
11
10
  format?: ResponseFormat;
@@ -27,3 +26,12 @@ export interface GenerateCronRequest {
27
26
  export interface GenerateCronResponse {
28
27
  message?: string;
29
28
  }
29
+ export interface GenerateTablesRequest {
30
+ prompt: string;
31
+ }
32
+ export interface GenerateTablesResponse {
33
+ createdTables: {
34
+ id: string;
35
+ name: string;
36
+ }[];
37
+ }
@@ -49,28 +49,6 @@ export interface CloudAccount extends Account {
49
49
  password?: string;
50
50
  budibaseUserId: string;
51
51
  }
52
- export interface TenantDetail {
53
- id: string;
54
- name: string;
55
- hosting: Hosting;
56
- installation?: {
57
- id: string;
58
- version: string;
59
- };
60
- license?: {
61
- key: string;
62
- session?: string;
63
- };
64
- }
65
- export interface AccountDetail {
66
- id: string;
67
- email: string;
68
- name: string;
69
- displayName: string;
70
- customerId: string | null;
71
- createdAt: Date;
72
- tenants: TenantDetail[];
73
- }
74
52
  export declare const isCloudAccount: (account: Account) => account is CloudAccount;
75
53
  export declare const isSelfHostAccount: (account: Account) => boolean;
76
54
  export declare const isSSOAccount: (account: Account) => account is SSOAccount;
@@ -7,7 +7,7 @@ export declare enum RelationshipType {
7
7
  export declare enum AutoReason {
8
8
  FOREIGN_KEY = "foreign_key"
9
9
  }
10
- export type FieldSubType = AutoFieldSubType | JsonFieldSubType | BBReferenceFieldSubType;
10
+ export type FieldSubType = AutoFieldSubType | JsonFieldSubType | BBReferenceFieldSubType | AttachmentSubType;
11
11
  export declare enum AutoFieldSubType {
12
12
  CREATED_BY = "createdBy",
13
13
  CREATED_AT = "createdAt",
@@ -28,4 +28,7 @@ export declare enum BBReferenceFieldSubType {
28
28
  /** @deprecated this should not be used anymore, left here in order to support the existing usages */
29
29
  USERS = "users"
30
30
  }
31
+ export declare enum AttachmentSubType {
32
+ IMAGE = "image"
33
+ }
31
34
  export type SupportedSqlTypes = FieldType.STRING | FieldType.BARCODEQR | FieldType.LONGFORM | FieldType.OPTIONS | FieldType.DATETIME | FieldType.NUMBER | FieldType.BOOLEAN | FieldType.FORMULA | FieldType.BIGINT | FieldType.BB_REFERENCE | FieldType.BB_REFERENCE_SINGLE | FieldType.LINK | FieldType.ARRAY;
@@ -1,5 +1,5 @@
1
1
  import { FieldType, FormulaResponseType } from "../row";
2
- import { AutoFieldSubType, AutoReason, BBReferenceFieldSubType, FormulaType, JsonFieldSubType, RelationshipType } from "./constants";
2
+ import { AttachmentSubType, AutoFieldSubType, AutoReason, BBReferenceFieldSubType, FormulaType, JsonFieldSubType, RelationshipType } from "./constants";
3
3
  import { AIOperationEnum } from "../../../sdk/ai";
4
4
  export interface UIFieldMetadata {
5
5
  order?: number;
@@ -102,8 +102,13 @@ export interface BBReferenceSingleFieldMetadata extends Omit<BaseFieldSchema, "s
102
102
  subtype: Exclude<BBReferenceFieldSubType, BBReferenceFieldSubType.USERS>;
103
103
  default?: string;
104
104
  }
105
- export interface AttachmentFieldMetadata extends BaseFieldSchema {
105
+ export interface AttachmentFieldMetadata extends Omit<BaseFieldSchema, "subtype"> {
106
106
  type: FieldType.ATTACHMENTS;
107
+ subtype?: AttachmentSubType;
108
+ }
109
+ export interface SingleAttachmentFieldMetadata extends Omit<BaseFieldSchema, "subtype"> {
110
+ type: FieldType.ATTACHMENT_SINGLE;
111
+ subtype?: AttachmentSubType;
107
112
  }
108
113
  export interface FieldConstraints {
109
114
  type?: string;
@@ -159,11 +164,12 @@ export interface BaseFieldSchema extends UIFieldMetadata {
159
164
  autoReason?: AutoReason.FOREIGN_KEY;
160
165
  subtype?: never;
161
166
  nestedJSON?: boolean;
167
+ aiGenerated?: boolean;
162
168
  }
163
169
  interface OtherFieldMetadata extends BaseFieldSchema {
164
170
  type: Exclude<FieldType, FieldType.DATETIME | FieldType.LINK | FieldType.AUTO | FieldType.FORMULA | FieldType.AI | FieldType.NUMBER | FieldType.LONGFORM | FieldType.BB_REFERENCE | FieldType.BB_REFERENCE_SINGLE | FieldType.ATTACHMENTS | FieldType.STRING | FieldType.ARRAY | FieldType.OPTIONS | FieldType.BOOLEAN | FieldType.BIGINT | FieldType.JSON>;
165
171
  }
166
- export type FieldSchema = OtherFieldMetadata | DateFieldMetadata | RelationshipFieldMetadata | AutoColumnFieldMetadata | FormulaFieldMetadata | AIFieldMetadata | NumberFieldMetadata | LongFormFieldMetadata | StringFieldMetadata | BBReferenceFieldMetadata | JsonFieldMetadata | AttachmentFieldMetadata | BBReferenceSingleFieldMetadata | ArrayFieldMetadata | OptionsFieldMetadata | BooleanFieldMetadata | BigIntFieldMetadata;
172
+ export type FieldSchema = OtherFieldMetadata | DateFieldMetadata | RelationshipFieldMetadata | AutoColumnFieldMetadata | FormulaFieldMetadata | AIFieldMetadata | NumberFieldMetadata | LongFormFieldMetadata | StringFieldMetadata | BBReferenceFieldMetadata | JsonFieldMetadata | AttachmentFieldMetadata | SingleAttachmentFieldMetadata | BBReferenceSingleFieldMetadata | ArrayFieldMetadata | OptionsFieldMetadata | BooleanFieldMetadata | BigIntFieldMetadata;
167
173
  export interface TableSchema {
168
174
  [key: string]: FieldSchema;
169
175
  }
@@ -27,6 +27,7 @@ export interface Table extends Document {
27
27
  };
28
28
  created?: boolean;
29
29
  rowHeight?: number;
30
+ aiGenerated?: boolean;
30
31
  }
31
32
  export interface TableRequest extends Table {
32
33
  _rename?: RenameColumn;