@budibase/pro 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.
@@ -0,0 +1 @@
1
+ export * from "./tableGeneration";
@@ -0,0 +1,27 @@
1
+ import { Table } from "@budibase/types";
2
+ import { TableSchemaFromAI } from "../types";
3
+ interface Delegates {
4
+ generateTablesDelegate: (tables: TableSchemaFromAI[]) => Promise<{
5
+ id: string;
6
+ name: string;
7
+ }[]>;
8
+ getTablesDelegate: (tableIds: string[]) => Promise<Table[]>;
9
+ generateDataDelegate: (data: Record<string, Record<string, any>[]>, userId: string, tables: Record<string, Table>) => Promise<void>;
10
+ }
11
+ export declare class TableGeneration {
12
+ private llm;
13
+ private addData;
14
+ private userId;
15
+ private delegates;
16
+ private constructor();
17
+ static init(delegates: Delegates): Promise<TableGeneration>;
18
+ withData(fromUserId: string): this;
19
+ generate(userPrompt: string): Promise<{
20
+ id: string;
21
+ name: string;
22
+ }[]>;
23
+ private generateTables;
24
+ private generateAIColumns;
25
+ private generateData;
26
+ }
27
+ export {};
@@ -1,6 +1,8 @@
1
+ import { parseResponseFormat } from "./models/openai";
1
2
  export { getLLM, getLLMConfig } from "./llm";
3
+ export * from "./prompts";
4
+ export * from "./generators";
2
5
  export * from "./structuredOutputs";
3
- import { parseResponseFormat } from "./models/openai";
4
6
  export declare const openai: {
5
7
  parseResponseFormat: typeof parseResponseFormat;
6
8
  };
@@ -1,10 +1,12 @@
1
+ import { z } from "zod";
2
+ import openai from "openai";
1
3
  import { EnrichedBinding, Snippet, ChatCompletionRequest, Message, ResponseFormat } from "@budibase/types";
2
4
  export declare class Prompt {
3
5
  messages: Message[];
4
6
  private _responseFormat?;
5
7
  constructor(messages: Message[]);
6
8
  get responseFormat(): ResponseFormat | undefined;
7
- format(format: ResponseFormat): this;
9
+ format(format: "text" | "json" | openai.ResponseFormatJSONSchema | z.ZodType): this;
8
10
  user(content: string): this;
9
11
  system(content: string): this;
10
12
  static user(content: string): Prompt;
@@ -21,3 +23,6 @@ export declare function translate(text: string, language: string): Prompt;
21
23
  export declare function sentimentAnalysis(text: string): Prompt;
22
24
  export declare function searchWeb(text: string): Prompt;
23
25
  export declare function generateJs(bindings: EnrichedBinding[], snippets: Snippet[]): Prompt;
26
+ export declare function generateTables(): Prompt;
27
+ export declare function generateAIColumns(): Prompt;
28
+ export declare function generateData(): Prompt;
@@ -1,6 +1,3 @@
1
- import { z } from "zod";
2
- import { StructuredOutput } from "@budibase/types";
3
- export declare const structuredOutputs: Record<StructuredOutput, {
4
- key: string;
5
- validator: z.AnyZodObject;
6
- }>;
1
+ export * from "./mappers";
2
+ export * from "./tables";
3
+ export * from "./tableData";
@@ -0,0 +1 @@
1
+ export * from "./tables";
@@ -0,0 +1,3 @@
1
+ import { AIColumnSchemas, GenerationStructure } from "../tables";
2
+ import { TableSchemaFromAI } from "../../types";
3
+ export declare function aiTableResponseToTableSchema(structure: GenerationStructure, aiColumns: AIColumnSchemas): TableSchemaFromAI[];
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ import { Table } from "@budibase/types";
3
+ export declare function tableDataStructuredOutput(tables: Table[]): z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
@@ -0,0 +1,592 @@
1
+ import { AIFieldMetadata, AttachmentSubType, FieldType, JsonFieldSubType, RelationshipType } from "@budibase/types";
2
+ import { z } from "zod";
3
+ export declare const generationStructure: z.ZodObject<{
4
+ tables: z.ZodArray<z.ZodObject<{
5
+ name: z.ZodString;
6
+ schema: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
7
+ name: z.ZodString;
8
+ }, {
9
+ type: z.ZodEnum<[FieldType.STRING, FieldType.NUMBER, FieldType.BOOLEAN, FieldType.LONGFORM]>;
10
+ constraints: z.ZodOptional<z.ZodObject<{
11
+ presence: z.ZodBoolean;
12
+ }, "strip", z.ZodTypeAny, {
13
+ presence: boolean;
14
+ }, {
15
+ presence: boolean;
16
+ }>>;
17
+ }>, "strip", z.ZodTypeAny, {
18
+ name: string;
19
+ type: FieldType.STRING | FieldType.LONGFORM | FieldType.NUMBER | FieldType.BOOLEAN;
20
+ constraints?: {
21
+ presence: boolean;
22
+ } | undefined;
23
+ }, {
24
+ name: string;
25
+ type: FieldType.STRING | FieldType.LONGFORM | FieldType.NUMBER | FieldType.BOOLEAN;
26
+ constraints?: {
27
+ presence: boolean;
28
+ } | undefined;
29
+ }>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
30
+ name: z.ZodString;
31
+ }, {
32
+ type: z.ZodLiteral<FieldType.LINK>;
33
+ tableId: z.ZodString;
34
+ reverseFieldName: z.ZodString;
35
+ relationshipId: z.ZodString;
36
+ }>, {
37
+ relationshipType: z.ZodEnum<[RelationshipType.MANY_TO_ONE]>;
38
+ }>, "strip", z.ZodTypeAny, {
39
+ name: string;
40
+ type: FieldType.LINK;
41
+ tableId: string;
42
+ reverseFieldName: string;
43
+ relationshipId: string;
44
+ relationshipType: RelationshipType.MANY_TO_ONE;
45
+ }, {
46
+ name: string;
47
+ type: FieldType.LINK;
48
+ tableId: string;
49
+ reverseFieldName: string;
50
+ relationshipId: string;
51
+ relationshipType: RelationshipType.MANY_TO_ONE;
52
+ }>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
53
+ name: z.ZodString;
54
+ }, {
55
+ type: z.ZodLiteral<FieldType.LINK>;
56
+ tableId: z.ZodString;
57
+ reverseFieldName: z.ZodString;
58
+ relationshipId: z.ZodString;
59
+ }>, {
60
+ relationshipType: z.ZodEnum<[RelationshipType.ONE_TO_MANY]>;
61
+ }>, "strip", z.ZodTypeAny, {
62
+ name: string;
63
+ type: FieldType.LINK;
64
+ tableId: string;
65
+ reverseFieldName: string;
66
+ relationshipId: string;
67
+ relationshipType: RelationshipType.ONE_TO_MANY;
68
+ }, {
69
+ name: string;
70
+ type: FieldType.LINK;
71
+ tableId: string;
72
+ reverseFieldName: string;
73
+ relationshipId: string;
74
+ relationshipType: RelationshipType.ONE_TO_MANY;
75
+ }>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
76
+ name: z.ZodString;
77
+ }, {
78
+ type: z.ZodLiteral<FieldType.LINK>;
79
+ tableId: z.ZodString;
80
+ reverseFieldName: z.ZodString;
81
+ relationshipId: z.ZodString;
82
+ }>, {
83
+ relationshipType: z.ZodEnum<[RelationshipType.MANY_TO_MANY]>;
84
+ }>, "strip", z.ZodTypeAny, {
85
+ name: string;
86
+ type: FieldType.LINK;
87
+ tableId: string;
88
+ reverseFieldName: string;
89
+ relationshipId: string;
90
+ relationshipType: RelationshipType.MANY_TO_MANY;
91
+ }, {
92
+ name: string;
93
+ type: FieldType.LINK;
94
+ tableId: string;
95
+ reverseFieldName: string;
96
+ relationshipId: string;
97
+ relationshipType: RelationshipType.MANY_TO_MANY;
98
+ }>, z.ZodObject<z.objectUtil.extendShape<{
99
+ name: z.ZodString;
100
+ }, {
101
+ type: z.ZodLiteral<FieldType.OPTIONS>;
102
+ constraints: z.ZodObject<{
103
+ inclusion: z.ZodArray<z.ZodString, "many">;
104
+ presence: z.ZodBoolean;
105
+ }, "strip", z.ZodTypeAny, {
106
+ presence: boolean;
107
+ inclusion: string[];
108
+ }, {
109
+ presence: boolean;
110
+ inclusion: string[];
111
+ }>;
112
+ }>, "strip", z.ZodTypeAny, {
113
+ name: string;
114
+ type: FieldType.OPTIONS;
115
+ constraints: {
116
+ presence: boolean;
117
+ inclusion: string[];
118
+ };
119
+ }, {
120
+ name: string;
121
+ type: FieldType.OPTIONS;
122
+ constraints: {
123
+ presence: boolean;
124
+ inclusion: string[];
125
+ };
126
+ }>, z.ZodObject<z.objectUtil.extendShape<{
127
+ name: z.ZodString;
128
+ }, {
129
+ type: z.ZodLiteral<FieldType.ARRAY>;
130
+ constraints: z.ZodObject<{
131
+ inclusion: z.ZodArray<z.ZodString, "many">;
132
+ presence: z.ZodBoolean;
133
+ type: z.ZodLiteral<JsonFieldSubType>;
134
+ }, "strip", z.ZodTypeAny, {
135
+ type: JsonFieldSubType;
136
+ presence: boolean;
137
+ inclusion: string[];
138
+ }, {
139
+ type: JsonFieldSubType;
140
+ presence: boolean;
141
+ inclusion: string[];
142
+ }>;
143
+ }>, "strip", z.ZodTypeAny, {
144
+ name: string;
145
+ type: FieldType.ARRAY;
146
+ constraints: {
147
+ type: JsonFieldSubType;
148
+ presence: boolean;
149
+ inclusion: string[];
150
+ };
151
+ }, {
152
+ name: string;
153
+ type: FieldType.ARRAY;
154
+ constraints: {
155
+ type: JsonFieldSubType;
156
+ presence: boolean;
157
+ inclusion: string[];
158
+ };
159
+ }>, z.ZodObject<z.objectUtil.extendShape<{
160
+ name: z.ZodString;
161
+ }, {
162
+ type: z.ZodLiteral<FieldType.FORMULA>;
163
+ formula: z.ZodString;
164
+ responseType: z.ZodEnum<[FieldType.STRING, FieldType.NUMBER, FieldType.BOOLEAN, FieldType.DATETIME]>;
165
+ }>, "strip", z.ZodTypeAny, {
166
+ name: string;
167
+ type: FieldType.FORMULA;
168
+ formula: string;
169
+ responseType: FieldType.STRING | FieldType.NUMBER | FieldType.BOOLEAN | FieldType.DATETIME;
170
+ }, {
171
+ name: string;
172
+ type: FieldType.FORMULA;
173
+ formula: string;
174
+ responseType: FieldType.STRING | FieldType.NUMBER | FieldType.BOOLEAN | FieldType.DATETIME;
175
+ }>, z.ZodObject<z.objectUtil.extendShape<{
176
+ name: z.ZodString;
177
+ }, {
178
+ type: z.ZodLiteral<FieldType.DATETIME>;
179
+ ignoreTimezones: z.ZodBoolean;
180
+ }>, "strip", z.ZodTypeAny, {
181
+ name: string;
182
+ type: FieldType.DATETIME;
183
+ ignoreTimezones: boolean;
184
+ }, {
185
+ name: string;
186
+ type: FieldType.DATETIME;
187
+ ignoreTimezones: boolean;
188
+ }>, z.ZodObject<z.objectUtil.extendShape<{
189
+ name: z.ZodString;
190
+ }, {
191
+ type: z.ZodLiteral<FieldType.DATETIME>;
192
+ ignoreTimezones: z.ZodBoolean;
193
+ timeOnly: z.ZodLiteral<true>;
194
+ }>, "strip", z.ZodTypeAny, {
195
+ name: string;
196
+ type: FieldType.DATETIME;
197
+ ignoreTimezones: boolean;
198
+ timeOnly: true;
199
+ }, {
200
+ name: string;
201
+ type: FieldType.DATETIME;
202
+ ignoreTimezones: boolean;
203
+ timeOnly: true;
204
+ }>, z.ZodObject<z.objectUtil.extendShape<{
205
+ name: z.ZodString;
206
+ }, {
207
+ type: z.ZodLiteral<FieldType.DATETIME>;
208
+ ignoreTimezones: z.ZodBoolean;
209
+ dateOnly: z.ZodLiteral<true>;
210
+ }>, "strip", z.ZodTypeAny, {
211
+ name: string;
212
+ type: FieldType.DATETIME;
213
+ ignoreTimezones: boolean;
214
+ dateOnly: true;
215
+ }, {
216
+ name: string;
217
+ type: FieldType.DATETIME;
218
+ ignoreTimezones: boolean;
219
+ dateOnly: true;
220
+ }>, z.ZodObject<z.objectUtil.extendShape<{
221
+ name: z.ZodString;
222
+ }, {
223
+ type: z.ZodLiteral<FieldType.ATTACHMENT_SINGLE>;
224
+ subtype: z.ZodLiteral<AttachmentSubType>;
225
+ }>, "strip", z.ZodTypeAny, {
226
+ name: string;
227
+ type: FieldType.ATTACHMENT_SINGLE;
228
+ subtype: AttachmentSubType;
229
+ }, {
230
+ name: string;
231
+ type: FieldType.ATTACHMENT_SINGLE;
232
+ subtype: AttachmentSubType;
233
+ }>, z.ZodObject<z.objectUtil.extendShape<{
234
+ name: z.ZodString;
235
+ }, {
236
+ type: z.ZodLiteral<FieldType.ATTACHMENT_SINGLE>;
237
+ }>, "strip", z.ZodTypeAny, {
238
+ name: string;
239
+ type: FieldType.ATTACHMENT_SINGLE;
240
+ }, {
241
+ name: string;
242
+ type: FieldType.ATTACHMENT_SINGLE;
243
+ }>, z.ZodObject<z.objectUtil.extendShape<{
244
+ name: z.ZodString;
245
+ }, {
246
+ type: z.ZodLiteral<FieldType.ATTACHMENTS>;
247
+ subtype: z.ZodLiteral<AttachmentSubType>;
248
+ }>, "strip", z.ZodTypeAny, {
249
+ name: string;
250
+ type: FieldType.ATTACHMENTS;
251
+ subtype: AttachmentSubType;
252
+ }, {
253
+ name: string;
254
+ type: FieldType.ATTACHMENTS;
255
+ subtype: AttachmentSubType;
256
+ }>, z.ZodObject<z.objectUtil.extendShape<{
257
+ name: z.ZodString;
258
+ }, {
259
+ type: z.ZodLiteral<FieldType.ATTACHMENTS>;
260
+ }>, "strip", z.ZodTypeAny, {
261
+ name: string;
262
+ type: FieldType.ATTACHMENTS;
263
+ }, {
264
+ name: string;
265
+ type: FieldType.ATTACHMENTS;
266
+ }>]>, "many">;
267
+ primaryDisplay: z.ZodString;
268
+ }, "strip", z.ZodTypeAny, {
269
+ name: string;
270
+ schema: ({
271
+ name: string;
272
+ type: FieldType.STRING | FieldType.LONGFORM | FieldType.NUMBER | FieldType.BOOLEAN;
273
+ constraints?: {
274
+ presence: boolean;
275
+ } | undefined;
276
+ } | {
277
+ name: string;
278
+ type: FieldType.LINK;
279
+ tableId: string;
280
+ reverseFieldName: string;
281
+ relationshipId: string;
282
+ relationshipType: RelationshipType.MANY_TO_ONE;
283
+ } | {
284
+ name: string;
285
+ type: FieldType.LINK;
286
+ tableId: string;
287
+ reverseFieldName: string;
288
+ relationshipId: string;
289
+ relationshipType: RelationshipType.ONE_TO_MANY;
290
+ } | {
291
+ name: string;
292
+ type: FieldType.LINK;
293
+ tableId: string;
294
+ reverseFieldName: string;
295
+ relationshipId: string;
296
+ relationshipType: RelationshipType.MANY_TO_MANY;
297
+ } | {
298
+ name: string;
299
+ type: FieldType.OPTIONS;
300
+ constraints: {
301
+ presence: boolean;
302
+ inclusion: string[];
303
+ };
304
+ } | {
305
+ name: string;
306
+ type: FieldType.ARRAY;
307
+ constraints: {
308
+ type: JsonFieldSubType;
309
+ presence: boolean;
310
+ inclusion: string[];
311
+ };
312
+ } | {
313
+ name: string;
314
+ type: FieldType.FORMULA;
315
+ formula: string;
316
+ responseType: FieldType.STRING | FieldType.NUMBER | FieldType.BOOLEAN | FieldType.DATETIME;
317
+ } | {
318
+ name: string;
319
+ type: FieldType.DATETIME;
320
+ ignoreTimezones: boolean;
321
+ } | {
322
+ name: string;
323
+ type: FieldType.DATETIME;
324
+ ignoreTimezones: boolean;
325
+ timeOnly: true;
326
+ } | {
327
+ name: string;
328
+ type: FieldType.DATETIME;
329
+ ignoreTimezones: boolean;
330
+ dateOnly: true;
331
+ } | {
332
+ name: string;
333
+ type: FieldType.ATTACHMENT_SINGLE;
334
+ subtype: AttachmentSubType;
335
+ } | {
336
+ name: string;
337
+ type: FieldType.ATTACHMENT_SINGLE;
338
+ } | {
339
+ name: string;
340
+ type: FieldType.ATTACHMENTS;
341
+ subtype: AttachmentSubType;
342
+ } | {
343
+ name: string;
344
+ type: FieldType.ATTACHMENTS;
345
+ })[];
346
+ primaryDisplay: string;
347
+ }, {
348
+ name: string;
349
+ schema: ({
350
+ name: string;
351
+ type: FieldType.STRING | FieldType.LONGFORM | FieldType.NUMBER | FieldType.BOOLEAN;
352
+ constraints?: {
353
+ presence: boolean;
354
+ } | undefined;
355
+ } | {
356
+ name: string;
357
+ type: FieldType.LINK;
358
+ tableId: string;
359
+ reverseFieldName: string;
360
+ relationshipId: string;
361
+ relationshipType: RelationshipType.MANY_TO_ONE;
362
+ } | {
363
+ name: string;
364
+ type: FieldType.LINK;
365
+ tableId: string;
366
+ reverseFieldName: string;
367
+ relationshipId: string;
368
+ relationshipType: RelationshipType.ONE_TO_MANY;
369
+ } | {
370
+ name: string;
371
+ type: FieldType.LINK;
372
+ tableId: string;
373
+ reverseFieldName: string;
374
+ relationshipId: string;
375
+ relationshipType: RelationshipType.MANY_TO_MANY;
376
+ } | {
377
+ name: string;
378
+ type: FieldType.OPTIONS;
379
+ constraints: {
380
+ presence: boolean;
381
+ inclusion: string[];
382
+ };
383
+ } | {
384
+ name: string;
385
+ type: FieldType.ARRAY;
386
+ constraints: {
387
+ type: JsonFieldSubType;
388
+ presence: boolean;
389
+ inclusion: string[];
390
+ };
391
+ } | {
392
+ name: string;
393
+ type: FieldType.FORMULA;
394
+ formula: string;
395
+ responseType: FieldType.STRING | FieldType.NUMBER | FieldType.BOOLEAN | FieldType.DATETIME;
396
+ } | {
397
+ name: string;
398
+ type: FieldType.DATETIME;
399
+ ignoreTimezones: boolean;
400
+ } | {
401
+ name: string;
402
+ type: FieldType.DATETIME;
403
+ ignoreTimezones: boolean;
404
+ timeOnly: true;
405
+ } | {
406
+ name: string;
407
+ type: FieldType.DATETIME;
408
+ ignoreTimezones: boolean;
409
+ dateOnly: true;
410
+ } | {
411
+ name: string;
412
+ type: FieldType.ATTACHMENT_SINGLE;
413
+ subtype: AttachmentSubType;
414
+ } | {
415
+ name: string;
416
+ type: FieldType.ATTACHMENT_SINGLE;
417
+ } | {
418
+ name: string;
419
+ type: FieldType.ATTACHMENTS;
420
+ subtype: AttachmentSubType;
421
+ } | {
422
+ name: string;
423
+ type: FieldType.ATTACHMENTS;
424
+ })[];
425
+ primaryDisplay: string;
426
+ }>, "many">;
427
+ }, "strip", z.ZodTypeAny, {
428
+ tables: {
429
+ name: string;
430
+ schema: ({
431
+ name: string;
432
+ type: FieldType.STRING | FieldType.LONGFORM | FieldType.NUMBER | FieldType.BOOLEAN;
433
+ constraints?: {
434
+ presence: boolean;
435
+ } | undefined;
436
+ } | {
437
+ name: string;
438
+ type: FieldType.LINK;
439
+ tableId: string;
440
+ reverseFieldName: string;
441
+ relationshipId: string;
442
+ relationshipType: RelationshipType.MANY_TO_ONE;
443
+ } | {
444
+ name: string;
445
+ type: FieldType.LINK;
446
+ tableId: string;
447
+ reverseFieldName: string;
448
+ relationshipId: string;
449
+ relationshipType: RelationshipType.ONE_TO_MANY;
450
+ } | {
451
+ name: string;
452
+ type: FieldType.LINK;
453
+ tableId: string;
454
+ reverseFieldName: string;
455
+ relationshipId: string;
456
+ relationshipType: RelationshipType.MANY_TO_MANY;
457
+ } | {
458
+ name: string;
459
+ type: FieldType.OPTIONS;
460
+ constraints: {
461
+ presence: boolean;
462
+ inclusion: string[];
463
+ };
464
+ } | {
465
+ name: string;
466
+ type: FieldType.ARRAY;
467
+ constraints: {
468
+ type: JsonFieldSubType;
469
+ presence: boolean;
470
+ inclusion: string[];
471
+ };
472
+ } | {
473
+ name: string;
474
+ type: FieldType.FORMULA;
475
+ formula: string;
476
+ responseType: FieldType.STRING | FieldType.NUMBER | FieldType.BOOLEAN | FieldType.DATETIME;
477
+ } | {
478
+ name: string;
479
+ type: FieldType.DATETIME;
480
+ ignoreTimezones: boolean;
481
+ } | {
482
+ name: string;
483
+ type: FieldType.DATETIME;
484
+ ignoreTimezones: boolean;
485
+ timeOnly: true;
486
+ } | {
487
+ name: string;
488
+ type: FieldType.DATETIME;
489
+ ignoreTimezones: boolean;
490
+ dateOnly: true;
491
+ } | {
492
+ name: string;
493
+ type: FieldType.ATTACHMENT_SINGLE;
494
+ subtype: AttachmentSubType;
495
+ } | {
496
+ name: string;
497
+ type: FieldType.ATTACHMENT_SINGLE;
498
+ } | {
499
+ name: string;
500
+ type: FieldType.ATTACHMENTS;
501
+ subtype: AttachmentSubType;
502
+ } | {
503
+ name: string;
504
+ type: FieldType.ATTACHMENTS;
505
+ })[];
506
+ primaryDisplay: string;
507
+ }[];
508
+ }, {
509
+ tables: {
510
+ name: string;
511
+ schema: ({
512
+ name: string;
513
+ type: FieldType.STRING | FieldType.LONGFORM | FieldType.NUMBER | FieldType.BOOLEAN;
514
+ constraints?: {
515
+ presence: boolean;
516
+ } | undefined;
517
+ } | {
518
+ name: string;
519
+ type: FieldType.LINK;
520
+ tableId: string;
521
+ reverseFieldName: string;
522
+ relationshipId: string;
523
+ relationshipType: RelationshipType.MANY_TO_ONE;
524
+ } | {
525
+ name: string;
526
+ type: FieldType.LINK;
527
+ tableId: string;
528
+ reverseFieldName: string;
529
+ relationshipId: string;
530
+ relationshipType: RelationshipType.ONE_TO_MANY;
531
+ } | {
532
+ name: string;
533
+ type: FieldType.LINK;
534
+ tableId: string;
535
+ reverseFieldName: string;
536
+ relationshipId: string;
537
+ relationshipType: RelationshipType.MANY_TO_MANY;
538
+ } | {
539
+ name: string;
540
+ type: FieldType.OPTIONS;
541
+ constraints: {
542
+ presence: boolean;
543
+ inclusion: string[];
544
+ };
545
+ } | {
546
+ name: string;
547
+ type: FieldType.ARRAY;
548
+ constraints: {
549
+ type: JsonFieldSubType;
550
+ presence: boolean;
551
+ inclusion: string[];
552
+ };
553
+ } | {
554
+ name: string;
555
+ type: FieldType.FORMULA;
556
+ formula: string;
557
+ responseType: FieldType.STRING | FieldType.NUMBER | FieldType.BOOLEAN | FieldType.DATETIME;
558
+ } | {
559
+ name: string;
560
+ type: FieldType.DATETIME;
561
+ ignoreTimezones: boolean;
562
+ } | {
563
+ name: string;
564
+ type: FieldType.DATETIME;
565
+ ignoreTimezones: boolean;
566
+ timeOnly: true;
567
+ } | {
568
+ name: string;
569
+ type: FieldType.DATETIME;
570
+ ignoreTimezones: boolean;
571
+ dateOnly: true;
572
+ } | {
573
+ name: string;
574
+ type: FieldType.ATTACHMENT_SINGLE;
575
+ subtype: AttachmentSubType;
576
+ } | {
577
+ name: string;
578
+ type: FieldType.ATTACHMENT_SINGLE;
579
+ } | {
580
+ name: string;
581
+ type: FieldType.ATTACHMENTS;
582
+ subtype: AttachmentSubType;
583
+ } | {
584
+ name: string;
585
+ type: FieldType.ATTACHMENTS;
586
+ })[];
587
+ primaryDisplay: string;
588
+ }[];
589
+ }>;
590
+ export type GenerationStructure = z.infer<typeof generationStructure>;
591
+ export declare function aiColumnSchemas(schema: GenerationStructure): z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
592
+ export type AIColumnSchemas = Record<string, AIFieldMetadata[]>;
@@ -0,0 +1 @@
1
+ export * from "./table";
@@ -0,0 +1,2 @@
1
+ import { Table, WithRequired } from "@budibase/types";
2
+ export type TableSchemaFromAI = WithRequired<Pick<Table, "name" | "primaryDisplay" | "schema">, "primaryDisplay">;