@windmill-labs/shared-utils 1.0.3 → 1.0.12

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.
package/common.d.ts CHANGED
@@ -30,6 +30,7 @@ export interface SchemaProperty {
30
30
  properties?: {
31
31
  [name: string]: SchemaProperty;
32
32
  };
33
+ required?: string[];
33
34
  };
34
35
  min?: number;
35
36
  max?: number;
@@ -42,6 +43,7 @@ export interface SchemaProperty {
42
43
  };
43
44
  required?: string[];
44
45
  showExpr?: string;
46
+ hideWhenChatEnabled?: boolean;
45
47
  password?: boolean;
46
48
  order?: string[];
47
49
  nullable?: boolean;
@@ -52,6 +54,7 @@ export interface SchemaProperty {
52
54
  originalType?: string;
53
55
  disabled?: boolean;
54
56
  'x-no-s3-storage-workspace-warning'?: string;
57
+ 'x-auto-generate'?: boolean;
55
58
  }
56
59
  export interface ModalSchemaProperty {
57
60
  selectedType?: string;
@@ -86,8 +89,8 @@ export declare function modalToSchema(schema: ModalSchemaProperty): SchemaProper
86
89
  export type Schema = {
87
90
  $schema: string | undefined;
88
91
  type: string;
89
- "x-windmill-dyn-select-code"?: string;
90
- "x-windmill-dyn-select-lang"?: ScriptLang;
92
+ 'x-windmill-dyn-select-code'?: string;
93
+ 'x-windmill-dyn-select-lang'?: ScriptLang;
91
94
  properties: {
92
95
  [name: string]: SchemaProperty;
93
96
  };
@@ -4,6 +4,8 @@ import { type ColumnDef } from '../utils';
4
4
  export declare function makeSelectQuery(table: string, columnDefs: ColumnDef[], whereClause: string | undefined, dbType: DbType, options?: {
5
5
  limit?: number;
6
6
  offset?: number;
7
+ }, breakingFeatures?: {
8
+ fixPgIntTypes?: boolean;
7
9
  }): string;
8
10
  export declare function getSelectInput(dbInput: DbInput, table: string | undefined, columnDefs: ColumnDef[], whereClause: string | undefined, options?: {
9
11
  limit?: number;
@@ -1,7 +1,7 @@
1
1
  import type { ScriptLang } from '$lib/gen';
2
2
  import type { SQLSchema } from '$lib/stores';
3
3
  import { type IntrospectionQuery } from 'graphql';
4
- import type { DbType } from '$lib/components/dbTypes';
4
+ import type { DbInput, DbType } from '$lib/components/dbTypes';
5
5
  export declare enum ColumnIdentity {
6
6
  ByDefault = "By Default",
7
7
  Always = "Always",
@@ -15,6 +15,7 @@ export type ColumnMetadata = {
15
15
  isidentity: ColumnIdentity;
16
16
  isnullable: 'YES' | 'NO';
17
17
  isenum: boolean;
18
+ default_constraint_name?: string;
18
19
  };
19
20
  export type TableMetadata = ColumnMetadata[];
20
21
  export type ColumnDef = {
@@ -42,13 +43,14 @@ export type ColumnDef = {
42
43
  defaultValueNull?: boolean;
43
44
  } & ColumnMetadata;
44
45
  export declare function resourceTypeToLang(rt: string): string;
45
- declare const scripts: Record<string, {
46
+ declare const legacyScripts: Record<string, {
46
47
  code: string;
47
48
  lang: string;
48
49
  processingFn?: (any: any) => SQLSchema['schema'];
49
50
  argName: string;
50
51
  }>;
51
- export { scripts };
52
+ declare const scriptsV2: typeof legacyScripts;
53
+ export { legacyScripts, scriptsV2 };
52
54
  export declare function formatSchema(dbSchema: {
53
55
  lang: SQLSchema['lang'];
54
56
  schema: SQLSchema['schema'];
@@ -74,6 +76,7 @@ export declare function formatSchema(dbSchema: {
74
76
  };
75
77
  export declare function formatGraphqlSchema(schema: IntrospectionQuery): string;
76
78
  export declare function buildVisibleFieldList(columnDefs: ColumnDef[], dbType: DbType): string[];
79
+ export declare function renderDbQuotedIdentifier(identifier: string, dbType: DbType): string;
77
80
  export declare function getLanguageByResourceType(name: string): ScriptLang;
78
81
  export declare function buildParameters(columns: Array<{
79
82
  field: string;
@@ -82,3 +85,11 @@ export declare function buildParameters(columns: Array<{
82
85
  export declare function getPrimaryKeys(tableMetadata?: TableMetadata): string[];
83
86
  export declare function dbSupportsSchemas(dbType: DbType): boolean;
84
87
  export declare function datatypeHasLength(datatype: string): boolean;
88
+ export declare function sqlDataTypeToJsTypeHeuristic(datatype: string): string;
89
+ export type DbFeatures = {
90
+ foreignKeys?: boolean;
91
+ primaryKeys?: boolean;
92
+ defaultValues?: boolean;
93
+ defaultToNotNull?: boolean;
94
+ };
95
+ export declare function getDbFeatures(dbInput: DbInput): Required<DbFeatures>;
@@ -1,3 +1,6 @@
1
+ import { type Runnable } from '../inputType';
1
2
  import type { App } from '../types';
3
+ import { type TriggerableV2 } from './commonAppUtils';
2
4
  import type { Policy } from '$lib/gen';
3
5
  export declare function updatePolicy(app: App, currentPolicy: Policy | undefined): Promise<Policy>;
6
+ export declare function processRunnable(id: string, runnable: Runnable, fields: Record<string, any>, app: App): Promise<[string, TriggerableV2] | undefined>;
@@ -16,7 +16,18 @@ export declare function isPartialS3Object(input: unknown): input is {
16
16
  storage?: string;
17
17
  presigned?: string;
18
18
  };
19
- export declare function computeS3ImageViewerPolicy(config: RichConfigurations): {
19
+ export declare function getS3File({ source, storage, presigned, appPath, username, workspace, token, isEditor, configuration }: {
20
+ source: string | undefined;
21
+ storage?: string;
22
+ presigned?: string;
23
+ appPath: string;
24
+ username: string | undefined;
25
+ workspace: string;
26
+ token: string | undefined;
27
+ isEditor: boolean;
28
+ configuration: RichConfigurations;
29
+ }): Promise<string>;
30
+ export declare function computeS3FileViewerPolicy(config: RichConfigurations): {
20
31
  s3_path: string;
21
32
  storage: string | undefined;
22
33
  } | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { IntRange } from '../../../../common';
2
2
  import type { NARROW_GRID_COLUMNS, WIDE_GRID_COLUMNS } from '../../gridUtils';
3
3
  import type { ChartType } from 'chart.js';
4
- import { BarChart4, Binary, FormInput, Inspect, List, Monitor, PieChart, Table2, TextCursorInput, Type, Lock, Calendar, ToggleLeft, GripHorizontal, Code2, SlidersHorizontal, PlusSquare, ListOrdered, BoxSelect, Smile, DollarSign, SeparatorHorizontal, SeparatorVertical, Paperclip, Image, SidebarClose, MapPin, FlipHorizontal, FlipVertical, FileText, AtSignIcon, Split, Download, PanelLeft, PanelTopInactive, Heading1, FileBarChart, Menu, Network, Database, UploadCloud, AlertTriangle, Clock, CalendarClock, AppWindow, PanelTop, RefreshCw, ListCollapse, GalleryThumbnails, Code } from 'lucide-svelte';
4
+ import { BarChart4, Binary, FormInput, Inspect, List, Monitor, PieChart, Table2, TextCursorInput, Type, Lock, Calendar, ToggleLeft, GripHorizontal, Code2, SlidersHorizontal, PlusSquare, ListOrdered, BoxSelect, Smile, DollarSign, SeparatorHorizontal, SeparatorVertical, Paperclip, Image, SidebarClose, MapPin, FlipHorizontal, FlipVertical, FileText, AtSignIcon, Split, Download, PanelLeft, PanelTopInactive, Heading1, FileBarChart, Menu, Network, Database, UploadCloud, AlertTriangle, Clock, CalendarClock, AppWindow, PanelTop, RefreshCw, ListCollapse, GalleryThumbnails, Code, MessageSquare } from 'lucide-svelte';
5
5
  import type { Aligned, BaseAppComponent, ComponentCustomCSS, GridItem, OneOfConfiguration, RichConfiguration, RichConfigurations, StaticRichConfigurations } from '../../types';
6
6
  import type { Size } from '../../svelte-grid/types';
7
7
  import type { AppInputSpec, EvalV2AppInput, InputConnectionEval, ResultAppInput, StaticAppInput, TemplateV2AppInput } from '../../inputType';
@@ -9,7 +9,7 @@ export type BaseComponent<T extends string> = {
9
9
  type: T;
10
10
  };
11
11
  export type RecomputeOthersSource = {
12
- recomputeIds: string[] | undefined;
12
+ recomputeIds?: string[] | undefined;
13
13
  };
14
14
  export type CustomComponentConfig = {
15
15
  name: string;
@@ -123,11 +123,13 @@ export type AggridInfiniteComponentEe = BaseComponent<'aggridinfinitecomponentee
123
123
  onChange?: string[] | undefined;
124
124
  };
125
125
  export type DisplayComponent = BaseComponent<'displaycomponent'>;
126
+ export type ChatComponent = BaseComponent<'chatcomponent'> & RecomputeOthersSource;
126
127
  export type JobIdDisplayComponent = BaseComponent<'jobiddisplaycomponent'>;
127
128
  export type LogComponent = BaseComponent<'logcomponent'>;
128
129
  export type JobIdLogComponent = BaseComponent<'jobidlogcomponent'>;
129
130
  export type FlowStatusComponent = BaseComponent<'flowstatuscomponent'>;
130
131
  export type JobIdFlowStatusComponent = BaseComponent<'jobidflowstatuscomponent'>;
132
+ export type JobProgressBarComponent = BaseComponent<'jobprogressbarcomponent'>;
131
133
  export type ImageComponent = BaseComponent<'imagecomponent'>;
132
134
  export type InputComponent = BaseComponent<'inputcomponent'>;
133
135
  export type SelectComponent = BaseComponent<'selectcomponent'> & RecomputeOthersSource & {
@@ -232,7 +234,7 @@ export type DateSelectComponent = BaseComponent<'dateselectcomponent'> & {
232
234
  onChange?: string[];
233
235
  };
234
236
  export type RecomputeAllComponent = BaseComponent<'recomputeallcomponent'>;
235
- export type TypedComponent = DBExplorerComponent | DisplayComponent | LogComponent | JobIdLogComponent | FlowStatusComponent | JobIdFlowStatusComponent | TextInputComponent | QuillComponent | CodeInputComponent | TextareaInputComponent | PasswordInputComponent | EmailInputComponent | DateInputComponent | NumberInputComponent | CurrencyComponent | SliderComponent | RangeComponent | BarChartComponent | TimeseriesComponent | HtmlComponent | CustomComponent | MarkdownComponent | TableComponent | TextComponent | ButtonComponent | PieChartComponent | ScatterChartComponent | SelectComponent | ResourceSelectComponent | MultiSelectComponent | CheckboxComponent | FormComponent | FormButtonComponent | VegaLiteComponent | PlotlyComponent | TabsComponent | ContainerComponent | ListComponent | IconComponent | HorizontalDividerComponent | VerticalDividerComponent | FileInputComponent | ImageComponent | AggridComponent | AggridComponentEe | DrawerComponent | MapComponent | VerticalSplitPanesComponent | HorizontalSplitPanesComponent | PdfComponent | ModalComponent | StepperComponent | Schemaformcomponent | SelectTabComponent | ConditionalWrapperComponent | SelectStepComponent | DownloadComponent | ChartJsComponent | CarouselListComponent | AccordionListComponent | PlotlyComponentV2 | ChartJsComponentV2 | StatisticCardComponent | MenuComponent | DecisionTreeComponent | S3FileInputComponent | AgChartsComponent | AgChartsComponentEe | AlertComponent | DateSliderComponent | TimeInputComponent | DateTimeInputComponent | AggridInfiniteComponent | AggridInfiniteComponentEe | MultiSelectComponentV2 | NavBarComponent | DateSelectComponent | JobIdDisplayComponent | RecomputeAllComponent | ResourceConnectComponent;
237
+ export type TypedComponent = DBExplorerComponent | DisplayComponent | ChatComponent | LogComponent | JobIdLogComponent | FlowStatusComponent | JobIdFlowStatusComponent | JobProgressBarComponent | TextInputComponent | QuillComponent | CodeInputComponent | TextareaInputComponent | PasswordInputComponent | EmailInputComponent | DateInputComponent | NumberInputComponent | CurrencyComponent | SliderComponent | RangeComponent | BarChartComponent | TimeseriesComponent | HtmlComponent | CustomComponent | MarkdownComponent | TableComponent | TextComponent | ButtonComponent | PieChartComponent | ScatterChartComponent | SelectComponent | ResourceSelectComponent | MultiSelectComponent | CheckboxComponent | FormComponent | FormButtonComponent | VegaLiteComponent | PlotlyComponent | TabsComponent | ContainerComponent | ListComponent | IconComponent | HorizontalDividerComponent | VerticalDividerComponent | FileInputComponent | ImageComponent | AggridComponent | AggridComponentEe | DrawerComponent | MapComponent | VerticalSplitPanesComponent | HorizontalSplitPanesComponent | PdfComponent | ModalComponent | StepperComponent | Schemaformcomponent | SelectTabComponent | ConditionalWrapperComponent | SelectStepComponent | DownloadComponent | ChartJsComponent | CarouselListComponent | AccordionListComponent | PlotlyComponentV2 | ChartJsComponentV2 | StatisticCardComponent | MenuComponent | DecisionTreeComponent | S3FileInputComponent | AgChartsComponent | AgChartsComponentEe | AlertComponent | DateSliderComponent | TimeInputComponent | DateTimeInputComponent | AggridInfiniteComponent | AggridInfiniteComponentEe | MultiSelectComponentV2 | NavBarComponent | DateSelectComponent | JobIdDisplayComponent | RecomputeAllComponent | ResourceConnectComponent;
236
238
  export type AppComponent = BaseAppComponent & TypedComponent;
237
239
  export type AppComponentDimensions = `${IntRange<1, typeof NARROW_GRID_COLUMNS>}:${number}-${IntRange<1, typeof WIDE_GRID_COLUMNS>}:${number}`;
238
240
  export declare function getRecommendedDimensionsByComponent(componentType: AppComponent['type'], column: number): Size;
@@ -258,6 +260,21 @@ export type AppComponentConfig<T extends TypedComponent['type']> = {
258
260
  */
259
261
  initialData: InitialAppComponent;
260
262
  customCss: ComponentCustomCSS<T>;
263
+ /**
264
+ * Optional configuration for runnable inputs validation
265
+ */
266
+ runnableInputsInfo?: {
267
+ /**
268
+ * Function to validate runnable inputs and return a warning if needed
269
+ * @param fields - The fields object from componentInput.fields
270
+ * @returns Warning object with type, title, and message, or undefined if valid
271
+ */
272
+ validate?: (fields: Record<string, any>) => {
273
+ type: 'warning' | 'error' | 'info';
274
+ title: string;
275
+ message: string;
276
+ } | undefined;
277
+ };
261
278
  };
262
279
  export type PresetComponentConfig = {
263
280
  name: string;
@@ -343,6 +360,251 @@ export declare const components: {
343
360
  };
344
361
  };
345
362
  };
363
+ readonly chatcomponent: {
364
+ readonly name: "Chat";
365
+ readonly icon: typeof MessageSquare;
366
+ readonly documentationLink: "https://www.windmill.dev/docs/apps/app_configuration_settings/chat";
367
+ readonly dims: AppComponentDimensions;
368
+ readonly customCss: {
369
+ readonly container: {
370
+ readonly class: "";
371
+ readonly style: "";
372
+ };
373
+ readonly messagesContainer: {
374
+ readonly class: "";
375
+ readonly style: "";
376
+ };
377
+ readonly inputContainer: {
378
+ readonly class: "";
379
+ readonly style: "";
380
+ };
381
+ readonly userMessage: {
382
+ readonly class: "";
383
+ readonly style: "";
384
+ };
385
+ readonly assistantMessage: {
386
+ readonly class: "";
387
+ readonly style: "";
388
+ };
389
+ readonly input: {
390
+ readonly class: "";
391
+ readonly style: "";
392
+ };
393
+ readonly button: {
394
+ readonly class: "";
395
+ readonly style: "";
396
+ };
397
+ };
398
+ readonly runnableInputsInfo: {
399
+ readonly validate: (fields: any) => {
400
+ type: "warning";
401
+ title: string;
402
+ message: string;
403
+ } | undefined;
404
+ };
405
+ readonly initialData: {
406
+ readonly componentInput: {
407
+ readonly type: "runnable";
408
+ readonly fieldType: "any";
409
+ readonly fields: {};
410
+ readonly runnable: undefined;
411
+ };
412
+ readonly recomputeIds: true;
413
+ readonly configuration: {
414
+ readonly placeholder: {
415
+ readonly type: "static";
416
+ readonly fieldType: "text";
417
+ readonly value: "Type a message...";
418
+ };
419
+ readonly onSuccess: {
420
+ readonly type: "oneOf";
421
+ readonly tooltip: "Action to perform on success";
422
+ readonly selected: "none";
423
+ readonly labels: {
424
+ none: string;
425
+ errorOverlay: string;
426
+ gotoUrl: string;
427
+ setTab: string;
428
+ sendToast: string;
429
+ sendErrorToast: string;
430
+ open: string;
431
+ close: string;
432
+ openModal: string;
433
+ closeModal: string;
434
+ clearFiles: string;
435
+ };
436
+ readonly configuration: {
437
+ readonly none: {};
438
+ readonly gotoUrl: {
439
+ readonly url: {
440
+ readonly tooltip: "Go to the given url, absolute or relative";
441
+ readonly fieldType: "text";
442
+ readonly type: "static";
443
+ readonly value: "";
444
+ readonly placeholder: "/apps/get/foo";
445
+ readonly onDemandOnly: true;
446
+ };
447
+ readonly newTab: {
448
+ readonly tooltip: "Open the url in a new tab";
449
+ readonly fieldType: "boolean";
450
+ readonly type: "static";
451
+ readonly value: true;
452
+ };
453
+ };
454
+ readonly setTab: {
455
+ readonly setTab: {
456
+ readonly type: "static";
457
+ readonly value: Array<{
458
+ id: string;
459
+ index: number;
460
+ }>;
461
+ readonly fieldType: "array";
462
+ readonly subFieldType: "tab-select";
463
+ readonly tooltip: "Set the tabs id and index to go to on success";
464
+ readonly onDemandOnly: true;
465
+ };
466
+ };
467
+ readonly sendToast: {
468
+ readonly message: {
469
+ readonly tooltip: "The message of the toast to display";
470
+ readonly fieldType: "text";
471
+ readonly type: "static";
472
+ readonly value: "";
473
+ readonly placeholder: "Hello there";
474
+ readonly onDemandOnly: true;
475
+ };
476
+ };
477
+ readonly openModal: {
478
+ readonly modalId: {
479
+ readonly tooltip: "The id of the modal to open";
480
+ readonly fieldType: "text";
481
+ readonly type: "static";
482
+ readonly value: "";
483
+ readonly deprecated: true;
484
+ };
485
+ };
486
+ readonly closeModal: {
487
+ readonly modalId: {
488
+ readonly tooltip: "The id of the modal to close";
489
+ readonly fieldType: "text";
490
+ readonly type: "static";
491
+ readonly value: "";
492
+ readonly deprecated: true;
493
+ };
494
+ };
495
+ readonly open: {
496
+ readonly id: {
497
+ readonly tooltip: "The id of the modal or the drawer to open";
498
+ readonly fieldType: "text";
499
+ readonly type: "static";
500
+ readonly value: "";
501
+ };
502
+ };
503
+ readonly close: {
504
+ readonly id: {
505
+ readonly tooltip: "The id of the modal or the drawer to close";
506
+ readonly fieldType: "text";
507
+ readonly type: "static";
508
+ readonly value: "";
509
+ };
510
+ };
511
+ readonly clearFiles: {
512
+ readonly id: {
513
+ readonly tooltip: "The id of s3 file input to clear";
514
+ readonly fieldType: "text";
515
+ readonly type: "static";
516
+ readonly value: "";
517
+ };
518
+ };
519
+ };
520
+ };
521
+ readonly onError: {
522
+ readonly type: "oneOf";
523
+ readonly tooltip: "Action to perform on error";
524
+ readonly selected: "errorOverlay";
525
+ readonly labels: {
526
+ none: string;
527
+ errorOverlay: string;
528
+ gotoUrl: string;
529
+ setTab: string;
530
+ sendToast: string;
531
+ sendErrorToast: string;
532
+ open: string;
533
+ close: string;
534
+ openModal: string;
535
+ closeModal: string;
536
+ clearFiles: string;
537
+ };
538
+ readonly configuration: {
539
+ readonly errorOverlay: {};
540
+ readonly gotoUrl: {
541
+ readonly url: {
542
+ readonly tooltip: "Go to the given url, absolute or relative";
543
+ readonly fieldType: "text";
544
+ readonly type: "static";
545
+ readonly value: "";
546
+ readonly placeholder: "/apps/get/foo";
547
+ readonly onDemandOnly: true;
548
+ };
549
+ readonly newTab: {
550
+ readonly tooltip: "Open the url in a new tab";
551
+ readonly fieldType: "boolean";
552
+ readonly type: "static";
553
+ readonly value: true;
554
+ };
555
+ };
556
+ readonly setTab: {
557
+ readonly setTab: {
558
+ readonly type: "static";
559
+ readonly value: Array<{
560
+ id: string;
561
+ index: number;
562
+ }>;
563
+ readonly fieldType: "array";
564
+ readonly subFieldType: "tab-select";
565
+ readonly tooltip: "Set the tabs id and index to go to on error";
566
+ readonly onDemandOnly: true;
567
+ };
568
+ };
569
+ readonly sendErrorToast: {
570
+ readonly message: {
571
+ readonly tooltip: "The message of the toast to display";
572
+ readonly fieldType: "text";
573
+ readonly type: "static";
574
+ readonly value: "An error occurred";
575
+ readonly placeholder: "Hello there";
576
+ readonly onDemandOnly: true;
577
+ };
578
+ readonly appendError: {
579
+ readonly tooltip: "Append the error message to the toast";
580
+ readonly fieldType: "boolean";
581
+ readonly type: "static";
582
+ readonly value: true;
583
+ };
584
+ };
585
+ readonly open: {
586
+ readonly id: {
587
+ readonly tooltip: "The id of the modal or the drawer to open";
588
+ readonly fieldType: "text";
589
+ readonly type: "static";
590
+ readonly value: "";
591
+ readonly noVariablePicker: true;
592
+ };
593
+ };
594
+ readonly close: {
595
+ readonly id: {
596
+ readonly tooltip: "The id of the modal or the drawer to close";
597
+ readonly fieldType: "text";
598
+ readonly type: "static";
599
+ readonly value: "";
600
+ readonly noVariablePicker: true;
601
+ };
602
+ };
603
+ };
604
+ };
605
+ };
606
+ };
607
+ };
346
608
  readonly jobidlogcomponent: {
347
609
  readonly name: "Log by Job Id";
348
610
  readonly icon: typeof Monitor;
@@ -445,6 +707,32 @@ export declare const components: {
445
707
  };
446
708
  };
447
709
  };
710
+ readonly jobprogressbarcomponent: {
711
+ readonly name: "Progress Bar by Job Id";
712
+ readonly icon: typeof Monitor;
713
+ readonly documentationLink: "https://www.windmill.dev/docs/apps/app_configuration_settings/progress_bar";
714
+ readonly dims: AppComponentDimensions;
715
+ readonly customCss: {
716
+ readonly header: {
717
+ readonly class: "";
718
+ readonly style: "";
719
+ };
720
+ readonly container: {
721
+ readonly class: "";
722
+ readonly style: "";
723
+ };
724
+ };
725
+ readonly initialData: {
726
+ readonly configuration: {
727
+ readonly jobId: {
728
+ readonly type: "static";
729
+ readonly fieldType: "text";
730
+ readonly value: "";
731
+ readonly tooltip: "Job id to display progress from";
732
+ };
733
+ };
734
+ };
735
+ };
448
736
  readonly containercomponent: {
449
737
  readonly name: "Container";
450
738
  readonly icon: typeof BoxSelect;
@@ -1076,6 +1364,9 @@ export declare const components: {
1076
1364
  readonly accept: "*";
1077
1365
  readonly convertTo: "base64";
1078
1366
  };
1367
+ readonly fileUploadS3: {
1368
+ readonly accept: "*";
1369
+ };
1079
1370
  readonly placeholder: "Enter URL or upload file (base64)";
1080
1371
  };
1081
1372
  readonly filename: {
@@ -1450,6 +1741,23 @@ export declare const components: {
1450
1741
  };
1451
1742
  };
1452
1743
  };
1744
+ readonly clearFormInputs: {
1745
+ readonly type: "oneOf";
1746
+ readonly tooltip: "When to clear the form inputs";
1747
+ readonly selected: "never";
1748
+ readonly labels: {
1749
+ readonly never: "Never";
1750
+ readonly onSuccess: "On success";
1751
+ readonly onSubmit: "On submit";
1752
+ readonly onError: "On error";
1753
+ };
1754
+ readonly configuration: {
1755
+ readonly never: {};
1756
+ readonly onSuccess: {};
1757
+ readonly onSubmit: {};
1758
+ readonly onError: {};
1759
+ };
1760
+ };
1453
1761
  };
1454
1762
  };
1455
1763
  };
@@ -1790,6 +2098,23 @@ export declare const components: {
1790
2098
  };
1791
2099
  };
1792
2100
  };
2101
+ readonly clearFormInputs: {
2102
+ readonly type: "oneOf";
2103
+ readonly tooltip: "When to clear the form inputs";
2104
+ readonly selected: "never";
2105
+ readonly labels: {
2106
+ readonly never: "Never";
2107
+ readonly onSuccess: "On success";
2108
+ readonly onSubmit: "On submit";
2109
+ readonly onError: "On error";
2110
+ };
2111
+ readonly configuration: {
2112
+ readonly never: {};
2113
+ readonly onSuccess: {};
2114
+ readonly onSubmit: {};
2115
+ readonly onError: {};
2116
+ };
2117
+ };
1793
2118
  readonly disabled: {
1794
2119
  readonly fieldType: "boolean";
1795
2120
  readonly type: "static";
@@ -2840,7 +3165,6 @@ export declare const components: {
2840
3165
  readonly customCss: {
2841
3166
  readonly input: {
2842
3167
  readonly style: "";
2843
- readonly tooltip: "https://github.com/rob-balfre/svelte-select/blob/master/docs/theming_variables.md";
2844
3168
  readonly class: "";
2845
3169
  };
2846
3170
  };
@@ -3866,7 +4190,6 @@ export declare const components: {
3866
4190
  };
3867
4191
  readonly fileUploadS3: {
3868
4192
  readonly accept: "image/*";
3869
- readonly convertTo: "base64";
3870
4193
  };
3871
4194
  };
3872
4195
  readonly sourceKind: {
@@ -4056,6 +4379,9 @@ export declare const components: {
4056
4379
  readonly accept: "application/pdf";
4057
4380
  readonly convertTo: "base64";
4058
4381
  };
4382
+ readonly fileUploadS3: {
4383
+ readonly accept: "application/pdf";
4384
+ };
4059
4385
  readonly placeholder: "Enter URL or upload file (base64)";
4060
4386
  };
4061
4387
  readonly zoom: {
@@ -72,12 +72,14 @@ export type RunnableByPath = {
72
72
  path: string;
73
73
  schema: any;
74
74
  runType: 'script' | 'flow' | 'hubscript';
75
- type: 'runnableByPath';
75
+ type: 'runnableByPath' | 'path';
76
76
  };
77
+ export declare function isRunnableByPath(runnable: Runnable): runnable is RunnableByPath;
78
+ export declare function isRunnableByName(runnable: Runnable): runnable is RunnableByName;
77
79
  export type RunnableByName = {
78
80
  name: string;
79
81
  inlineScript: InlineScript | undefined;
80
- type: 'runnableByName';
82
+ type: 'runnableByName' | 'inline';
81
83
  };
82
84
  export type Runnable = RunnableByPath | RunnableByName | undefined;
83
85
  export type RunnableWithFields = Runnable & {
@@ -1,5 +1,6 @@
1
1
  import type { Schema } from '$lib/common';
2
2
  import type { Preview } from '$lib/gen';
3
+ import type { AssetWithAltAccessType } from '../assets/lib';
3
4
  export type InlineScript = {
4
5
  content: string;
5
6
  language: Preview['language'] | 'frontend';
@@ -16,4 +17,5 @@ export type InlineScript = {
16
17
  key: string;
17
18
  }[];
18
19
  id?: number;
20
+ assets?: AssetWithAltAccessType[];
19
21
  };
@@ -212,6 +212,7 @@ export type AppViewerContext = {
212
212
  invalidate?: (key: string, error: string) => void;
213
213
  validateAll?: () => void;
214
214
  clearFiles?: () => void;
215
+ sendMessage?: (message: string) => void;
215
216
  showToast?: (message: string, error?: boolean) => void;
216
217
  recompute?: () => void;
217
218
  askNewResource?: () => void;
@@ -0,0 +1,25 @@
1
+ import type { AssetKind as _AssetKind, Asset as _Asset, ListAssetsResponse, AssetUsageAccessType, FlowModule, ScriptArgs } from '$lib/gen';
2
+ export type Asset = _Asset;
3
+ export type AssetKind = _AssetKind;
4
+ export type AssetWithAccessType = Asset & {
5
+ access_type?: AssetUsageAccessType;
6
+ };
7
+ export type AssetWithAltAccessType = AssetWithAccessType & {
8
+ alt_access_type?: AssetUsageAccessType;
9
+ };
10
+ export declare function formatAsset(asset: Asset): string;
11
+ export declare function formatShortAssetPath(asset: Asset): string;
12
+ export declare function getAssetUsagePageUri(usage: ListAssetsResponse[number]['usages'][number]): string | undefined;
13
+ export declare function assetEq(a: Asset | undefined, b: Asset | undefined): boolean;
14
+ export declare function assetsEq(a: Asset[], b: Asset[]): boolean;
15
+ export declare function parseAssetFromString(s: string): Asset | undefined;
16
+ export declare function formatAssetKind(asset: {
17
+ kind: AssetKind;
18
+ metadata?: {
19
+ resource_type?: string;
20
+ };
21
+ }): string;
22
+ export declare function formatAssetAccessType(accessType: AssetUsageAccessType | undefined): "?" | "Read" | "Write" | "R/W";
23
+ export declare function getAccessType(asset: AssetWithAltAccessType): AssetUsageAccessType | undefined;
24
+ export declare function getFlowModuleAssets(flowModuleValue: FlowModule, additionalAssetsMap?: Record<string, AssetWithAccessType[]>): AssetWithAccessType[] | undefined;
25
+ export declare function parseInputArgsAssets(args: ScriptArgs): AssetWithAccessType[];
@@ -2,9 +2,12 @@ export type DbInput = {
2
2
  type: 'database';
3
3
  resourceType: DbType;
4
4
  resourcePath: string;
5
+ specificSchema?: string;
6
+ specificTable?: string;
5
7
  } | {
6
8
  type: 'ducklake';
7
9
  ducklake: string;
10
+ specificTable?: string;
8
11
  };
9
12
  export type DbType = (typeof dbTypes)[number];
10
13
  export declare const dbTypes: readonly ["mysql", "ms_sql_server", "postgresql", "snowflake", "bigquery", "duckdb"];