@windmill-labs/shared-utils 1.0.1 → 1.0.3
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/assets/tokens/colorTokensConfig.d.ts +2 -0
- package/base.d.ts +1 -0
- package/cloud.d.ts +1 -0
- package/common.d.ts +108 -0
- package/components/apps/components/display/dbtable/queries/count.d.ts +5 -0
- package/components/apps/components/display/dbtable/queries/delete.d.ts +5 -0
- package/components/apps/components/display/dbtable/queries/insert.d.ts +5 -0
- package/components/apps/components/display/dbtable/queries/select.d.ts +11 -0
- package/components/apps/components/display/dbtable/queries/update.d.ts +11 -0
- package/components/apps/components/display/dbtable/utils.d.ts +84 -0
- package/components/apps/editor/appPolicy.d.ts +3 -0
- package/components/apps/editor/appUtilsCore.d.ts +7 -0
- package/components/apps/editor/appUtilsS3.d.ts +22 -0
- package/components/apps/editor/commonAppUtils.d.ts +10 -0
- package/components/apps/editor/component/components.d.ts +5045 -0
- package/components/apps/editor/component/default-codes.d.ts +3 -0
- package/components/apps/editor/component/index.d.ts +3 -0
- package/components/apps/editor/component/sets.d.ts +7 -0
- package/components/apps/editor/componentsPanel/componentDefaultProps.d.ts +3 -0
- package/components/apps/gridUtils.d.ts +14 -0
- package/components/apps/inputType.d.ts +176 -0
- package/components/apps/rx.d.ts +29 -0
- package/components/apps/sharedTypes.d.ts +19 -0
- package/components/apps/types.d.ts +273 -0
- package/components/common/alert/model.d.ts +2 -0
- package/components/common/badge/model.d.ts +8 -0
- package/components/common/button/model.d.ts +45 -0
- package/components/common/fileInput/model.d.ts +1 -0
- package/components/common/index.d.ts +24 -0
- package/components/common/skeleton/model.d.ts +21 -0
- package/components/dbTypes.d.ts +11 -0
- package/components/diff_drawer.d.ts +26 -0
- package/components/ducklake.d.ts +1 -0
- package/components/flows/scheduleUtils.d.ts +7 -0
- package/components/random_positive_adjetive.d.ts +1 -0
- package/components/raw_apps/utils.d.ts +15 -0
- package/components/triggers/email/utils.d.ts +4 -0
- package/components/triggers/gcp/utils.d.ts +2 -0
- package/components/triggers/http/utils.d.ts +11 -0
- package/components/triggers/kafka/utils.d.ts +2 -0
- package/components/triggers/mqtt/utils.d.ts +2 -0
- package/components/triggers/nats/utils.d.ts +2 -0
- package/components/triggers/postgres/utils.d.ts +8 -0
- package/components/triggers/sqs/utils.d.ts +2 -0
- package/components/triggers/triggers.svelte.d.ts +32 -0
- package/components/triggers/utils.d.ts +81 -0
- package/components/triggers/websocket/utils.d.ts +2 -0
- package/components/triggers.d.ts +20 -0
- package/gen/core/ApiError.d.ts +10 -0
- package/gen/core/ApiRequestOptions.d.ts +13 -0
- package/gen/core/ApiResult.d.ts +7 -0
- package/gen/core/CancelablePromise.d.ts +26 -0
- package/gen/core/OpenAPI.d.ts +27 -0
- package/gen/core/request.d.ts +29 -0
- package/gen/index.d.ts +6 -0
- package/gen/schemas.gen.d.ts +6192 -0
- package/gen/services.gen.d.ts +5735 -0
- package/gen/types.gen.d.ts +20116 -0
- package/history.svelte.d.ts +9 -0
- package/hub.d.ts +48 -0
- package/lib.d.ts +3 -0
- package/lib.es.js +70 -3
- package/package.json +1 -1
- package/schema.d.ts +3 -0
- package/stores.d.ts +96 -0
- package/svelte5Utils.svelte.d.ts +49 -0
- package/toast.d.ts +8 -0
- package/utils.d.ts +250 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AppComponent } from '.';
|
|
2
|
+
export declare function defaultCode(component: string, language: string): string | undefined;
|
|
3
|
+
export declare const DEFAULT_CODES: Partial<Record<AppComponent['type'], Partial<Record<'deno' | 'python3' | 'go' | 'bash' | 'pgsql' | 'mysql' | 'postgresql' | 'snowflake' | 'mssql' | 'bigquery' | 'oracledb', string>>>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentSet } from '../../types';
|
|
2
|
+
export declare const COMPONENT_SETS: readonly [ComponentSet, ComponentSet, ComponentSet, ComponentSet, ComponentSet, ComponentSet, ComponentSet];
|
|
3
|
+
export declare const DEPRECATED_COMPONENTS: {
|
|
4
|
+
tablecomponent: string;
|
|
5
|
+
chartjscomponent: string;
|
|
6
|
+
multiselectcomponent: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { GridItem } from './types';
|
|
2
|
+
type ColumnConfiguration = [number, number][];
|
|
3
|
+
declare const Breakpoints: {
|
|
4
|
+
sm: number;
|
|
5
|
+
lg: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const moveMode: import("svelte/store").Writable<"move" | "insert">;
|
|
8
|
+
declare const WIDE_GRID_COLUMNS: 12;
|
|
9
|
+
declare const NARROW_GRID_COLUMNS: 3;
|
|
10
|
+
declare const columnConfiguration: ColumnConfiguration;
|
|
11
|
+
declare const gridColumns: number[];
|
|
12
|
+
declare function toggleFixed(component: GridItem): GridItem;
|
|
13
|
+
declare function isFixed(component: GridItem): boolean;
|
|
14
|
+
export { gridColumns, WIDE_GRID_COLUMNS, NARROW_GRID_COLUMNS, columnConfiguration, Breakpoints, toggleFixed, isFixed };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { ReadFileAs } from '../common/fileInput/model';
|
|
2
|
+
import type { DecisionTreeNode, TypedComponent } from './editor/component';
|
|
3
|
+
import type { InlineScript } from './sharedTypes';
|
|
4
|
+
export type { InlineScript } from './sharedTypes';
|
|
5
|
+
export type InputType = 'integer' | 'text' | 'textarea' | 'template' | 'number' | 'boolean' | 'select' | 'icon-select' | 'color' | 'date' | 'time' | 'datetime' | 'object' | 'array' | 'any' | 'labeledresource' | 'labeledselect' | 'tab-select' | 'schema' | 'ag-grid' | 'table-column' | 'plotly' | 'chartjs' | 'DecisionTreeNode' | 'ag-chart' | 'resource' | 'db-explorer' | 'db-table' | 's3' | 'number-tuple' | 'postgres' | 'mysql' | 'ms_sql_server' | 'snowflake' | 'snowflake_oauth' | 'bigquery' | 'oracledb' | 'ducklake' | 'app-path';
|
|
6
|
+
export type InputConnection = {
|
|
7
|
+
componentType?: TypedComponent['type'];
|
|
8
|
+
componentId: string;
|
|
9
|
+
path: string;
|
|
10
|
+
};
|
|
11
|
+
export type InputConnectionEval = {
|
|
12
|
+
componentId: string;
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
export type ConnectedInput = {
|
|
16
|
+
type: 'connected';
|
|
17
|
+
connection: InputConnection | undefined;
|
|
18
|
+
allowUserResources?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type UserInput<U> = {
|
|
21
|
+
type: 'user';
|
|
22
|
+
value: U | undefined;
|
|
23
|
+
allowUserResources?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type UploadInput = {
|
|
26
|
+
type: 'upload';
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
29
|
+
export type UploadS3Input = {
|
|
30
|
+
type: 'uploadS3';
|
|
31
|
+
value: any;
|
|
32
|
+
};
|
|
33
|
+
export type FileUploadData = {
|
|
34
|
+
name: string;
|
|
35
|
+
size: number;
|
|
36
|
+
progress: number;
|
|
37
|
+
cancelled?: boolean;
|
|
38
|
+
errorMessage?: string;
|
|
39
|
+
path?: string;
|
|
40
|
+
file?: File;
|
|
41
|
+
};
|
|
42
|
+
export type EvalInput = {
|
|
43
|
+
type: 'eval';
|
|
44
|
+
expr: string;
|
|
45
|
+
};
|
|
46
|
+
export type EvalInputV2 = {
|
|
47
|
+
type: 'evalv2';
|
|
48
|
+
expr: string;
|
|
49
|
+
connections: InputConnectionEval[];
|
|
50
|
+
onDemandOnly?: boolean;
|
|
51
|
+
allowUserResources?: boolean;
|
|
52
|
+
};
|
|
53
|
+
export type RowInput = {
|
|
54
|
+
type: 'row';
|
|
55
|
+
column: string;
|
|
56
|
+
};
|
|
57
|
+
export type StaticInput<U> = {
|
|
58
|
+
value: U | undefined;
|
|
59
|
+
type: 'static';
|
|
60
|
+
};
|
|
61
|
+
export type TemplateInput = {
|
|
62
|
+
eval: string;
|
|
63
|
+
type: 'template';
|
|
64
|
+
};
|
|
65
|
+
export type TemplateV2Input = {
|
|
66
|
+
eval: string;
|
|
67
|
+
type: 'templatev2';
|
|
68
|
+
connections: InputConnectionEval[];
|
|
69
|
+
};
|
|
70
|
+
export type RunnableByPath = {
|
|
71
|
+
name: string;
|
|
72
|
+
path: string;
|
|
73
|
+
schema: any;
|
|
74
|
+
runType: 'script' | 'flow' | 'hubscript';
|
|
75
|
+
type: 'runnableByPath';
|
|
76
|
+
};
|
|
77
|
+
export type RunnableByName = {
|
|
78
|
+
name: string;
|
|
79
|
+
inlineScript: InlineScript | undefined;
|
|
80
|
+
type: 'runnableByName';
|
|
81
|
+
};
|
|
82
|
+
export type Runnable = RunnableByPath | RunnableByName | undefined;
|
|
83
|
+
export type RunnableWithFields = Runnable & {
|
|
84
|
+
fields?: Record<string, StaticAppInput | UserAppInput>;
|
|
85
|
+
};
|
|
86
|
+
export type ResultInput = {
|
|
87
|
+
runnable: Runnable;
|
|
88
|
+
transformer?: InlineScript & {
|
|
89
|
+
language: 'frontend';
|
|
90
|
+
};
|
|
91
|
+
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
92
|
+
type: 'runnable';
|
|
93
|
+
value?: any;
|
|
94
|
+
doNotRecomputeOnInputChanged?: boolean;
|
|
95
|
+
recomputeOnInputChanged?: boolean;
|
|
96
|
+
autoRefresh?: boolean;
|
|
97
|
+
hideRefreshButton?: boolean;
|
|
98
|
+
};
|
|
99
|
+
export type AppInputSpec<T extends InputType, U, V extends InputType = never> = (StaticInput<U> | ConnectedInput | UserInput<U> | RowInput | EvalInput | EvalInputV2 | UploadInput | UploadS3Input | ResultInput | TemplateInput | TemplateV2Input) & InputConfiguration<T, V>;
|
|
100
|
+
type InputConfiguration<T extends InputType, V extends InputType> = {
|
|
101
|
+
fieldType: T;
|
|
102
|
+
subFieldType?: V;
|
|
103
|
+
format?: string | undefined;
|
|
104
|
+
loading?: boolean;
|
|
105
|
+
fileUpload?: {
|
|
106
|
+
/** Use `*` to accept anything. */
|
|
107
|
+
accept: string;
|
|
108
|
+
/**
|
|
109
|
+
* Controls if user is allowed to select multiple files.
|
|
110
|
+
* @default false
|
|
111
|
+
*/
|
|
112
|
+
multiple?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Controls if the uploaded file(s) will be converted or not.
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
convertTo?: ReadFileAs;
|
|
118
|
+
};
|
|
119
|
+
fileUploadS3?: {
|
|
120
|
+
accept: string;
|
|
121
|
+
multiple?: boolean;
|
|
122
|
+
};
|
|
123
|
+
noStatic?: boolean;
|
|
124
|
+
onDemandOnly?: boolean;
|
|
125
|
+
hideRefreshButton?: boolean;
|
|
126
|
+
};
|
|
127
|
+
export type StaticOptions = {
|
|
128
|
+
selectOptions: readonly string[] | readonly {
|
|
129
|
+
value: string;
|
|
130
|
+
label: string;
|
|
131
|
+
}[];
|
|
132
|
+
};
|
|
133
|
+
export type AppInput = AppInputSpec<'text', string> | AppInputSpec<'textarea', string> | AppInputSpec<'template', string> | AppInputSpec<'number', number> | AppInputSpec<'boolean', boolean> | AppInputSpec<'date', string> | AppInputSpec<'time', string> | AppInputSpec<'datetime', string> | AppInputSpec<'any', any> | AppInputSpec<'object', Record<string | number, any>> | AppInputSpec<'object', string> | (AppInputSpec<'select', string, 'db-table'> & StaticOptions) | AppInputSpec<'icon-select', string> | AppInputSpec<'color', string> | AppInputSpec<'array', string[], 'text'> | AppInputSpec<'array', string[], 'textarea'> | AppInputSpec<'array', number[], 'number'> | AppInputSpec<'array', boolean[], 'boolean'> | AppInputSpec<'array', string[], 'date'> | AppInputSpec<'array', string[], 'time'> | AppInputSpec<'array', string[], 'datetime'> | AppInputSpec<'array', object[], 'object'> | (AppInputSpec<'array', string[], 'select'> & StaticOptions) | AppInputSpec<'array', object[], 'labeledresource'> | AppInputSpec<'array', (object | string)[], 'labeledselect'> | AppInputSpec<'labeledselect', object> | AppInputSpec<'labeledresource', object> | AppInputSpec<'array', object[], 'tab-select'> | AppInputSpec<'schema', object> | AppInputSpec<'array', object[], 'ag-grid'> | AppInputSpec<'array', object[], 'db-explorer'> | AppInputSpec<'array', object[], 'table-column'> | AppInputSpec<'array', object[], 'plotly'> | AppInputSpec<'array', object[], 'chartjs'> | AppInputSpec<'array', DecisionTreeNode, 'DecisionTreeNode'> | AppInputSpec<'array', object[], 'ag-chart'> | AppInputSpec<'resource', string> | AppInputSpec<'resource', string, 's3'> | AppInputSpec<'resource', string, 'postgres'> | AppInputSpec<'resource', string, 'mysql'> | AppInputSpec<'resource', string, 'ms_sql_server'> | AppInputSpec<'resource', string, 'snowflake'> | AppInputSpec<'resource', string, 'snowflake_oauth'> | AppInputSpec<'resource', string, 'bigquery'> | AppInputSpec<'resource', string, 'oracledb'> | AppInputSpec<'ducklake', string, 'ducklake'> | AppInputSpec<'array', object[], 'number-tuple'> | AppInputSpec<'app-path', string>;
|
|
134
|
+
export type RowAppInput = Extract<AppInput, {
|
|
135
|
+
type: 'row';
|
|
136
|
+
}>;
|
|
137
|
+
export type StaticAppInput = Extract<AppInput, {
|
|
138
|
+
type: 'static';
|
|
139
|
+
}>;
|
|
140
|
+
export type ConnectedAppInput = Extract<AppInput, {
|
|
141
|
+
type: 'connected';
|
|
142
|
+
}>;
|
|
143
|
+
export type UserAppInput = Extract<AppInput, {
|
|
144
|
+
type: 'user';
|
|
145
|
+
}>;
|
|
146
|
+
export type ResultAppInput = Extract<AppInput, {
|
|
147
|
+
type: 'runnable';
|
|
148
|
+
}>;
|
|
149
|
+
export type EvalAppInput = Extract<AppInput, {
|
|
150
|
+
type: 'eval';
|
|
151
|
+
}>;
|
|
152
|
+
export type EvalV2AppInput = Extract<AppInput, {
|
|
153
|
+
type: 'evalv2';
|
|
154
|
+
}>;
|
|
155
|
+
export type StaticAppInputOnDemand = Extract<StaticAppInput, {
|
|
156
|
+
onDemandOnly: true;
|
|
157
|
+
}>;
|
|
158
|
+
export type TemplateV2AppInput = Extract<AppInput, {
|
|
159
|
+
type: 'templatev2';
|
|
160
|
+
}>;
|
|
161
|
+
export type UploadAppInput = Extract<AppInput, {
|
|
162
|
+
type: 'upload';
|
|
163
|
+
}>;
|
|
164
|
+
export type UploadS3AppInput = Extract<AppInput, {
|
|
165
|
+
type: 'uploadS3';
|
|
166
|
+
}>;
|
|
167
|
+
export type RichAppInput = AppInput | {
|
|
168
|
+
type: 'oneOf';
|
|
169
|
+
oneOf: string[];
|
|
170
|
+
configuration: Record<string, AppInput>;
|
|
171
|
+
} | {
|
|
172
|
+
type: 'group';
|
|
173
|
+
title: string;
|
|
174
|
+
configuration: Record<string, AppInput>;
|
|
175
|
+
};
|
|
176
|
+
export type AppInputs = Record<string, AppInput>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { InputConnectionEval } from './inputType';
|
|
2
|
+
import { type Writable } from 'svelte/store';
|
|
3
|
+
export interface Subscriber<T> {
|
|
4
|
+
id?: string;
|
|
5
|
+
next(v: T, force?: boolean): void;
|
|
6
|
+
}
|
|
7
|
+
export interface Observable<T> {
|
|
8
|
+
subscribe(x: Subscriber<T>, previousValue: T): () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface Output<T> extends Observable<T> {
|
|
11
|
+
set(x: T, force?: boolean): void;
|
|
12
|
+
peak(): T | any | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface Input<T> extends Subscriber<T> {
|
|
15
|
+
peak(): T | any | undefined;
|
|
16
|
+
}
|
|
17
|
+
export type World = {
|
|
18
|
+
outputsById: Record<string, Record<string, Output<any>>>;
|
|
19
|
+
connect: <T>(connection: InputConnectionEval, next: (x: T, force?: boolean) => void, id: string, previousValue: any) => Input<T>;
|
|
20
|
+
stateId: Writable<number>;
|
|
21
|
+
newOutput: <T>(id: string, name: string, previousValue: T) => Output<T>;
|
|
22
|
+
};
|
|
23
|
+
export declare function buildWorld(context: Record<string, any>): Writable<World>;
|
|
24
|
+
export declare function buildObservableWorld(): {
|
|
25
|
+
connect: <T>(connection: InputConnectionEval, next: (x: T) => void, id: string, previousValue: T) => Input<T>;
|
|
26
|
+
newOutput: <T>(id: string, name: string, state: Writable<number>, previousValue: T) => Output<T>;
|
|
27
|
+
};
|
|
28
|
+
export declare function cachedInput<T>(nextParam: (x: T, force?: boolean) => void, id?: string): Input<T>;
|
|
29
|
+
export declare function settableOutput<T>(state: Writable<number>, previousValue: T): Output<T>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Schema } from '$lib/common';
|
|
2
|
+
import type { Preview } from '$lib/gen';
|
|
3
|
+
export type InlineScript = {
|
|
4
|
+
content: string;
|
|
5
|
+
language: Preview['language'] | 'frontend';
|
|
6
|
+
path?: string;
|
|
7
|
+
schema?: Schema;
|
|
8
|
+
lock?: string;
|
|
9
|
+
cache_ttl?: number;
|
|
10
|
+
refreshOn?: {
|
|
11
|
+
id: string;
|
|
12
|
+
key: string;
|
|
13
|
+
}[];
|
|
14
|
+
suggestedRefreshOn?: {
|
|
15
|
+
id: string;
|
|
16
|
+
key: string;
|
|
17
|
+
}[];
|
|
18
|
+
id?: number;
|
|
19
|
+
};
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import type { Policy } from '$lib/gen';
|
|
2
|
+
import type { History } from '$lib/history.svelte';
|
|
3
|
+
import type { Writable } from 'svelte/store';
|
|
4
|
+
import type { AppComponent, PresetComponentConfig, RecomputeOthersSource, components } from './editor/component/components';
|
|
5
|
+
import type { AppInput, ConnectedAppInput, ConnectedInput, EvalAppInput, EvalV2AppInput, InlineScript, InputConnection, ResultAppInput, RowAppInput, Runnable, StaticAppInput, TemplateV2AppInput, UploadAppInput, UploadS3AppInput, UserAppInput } from './inputType';
|
|
6
|
+
import type { World } from './rx';
|
|
7
|
+
import type { FilledItem } from './svelte-grid/types';
|
|
8
|
+
export type HorizontalAlignment = 'left' | 'center' | 'right';
|
|
9
|
+
export type VerticalAlignment = 'top' | 'center' | 'bottom';
|
|
10
|
+
export type Aligned = {
|
|
11
|
+
horizontalAlignment: HorizontalAlignment;
|
|
12
|
+
verticalAlignment: VerticalAlignment;
|
|
13
|
+
};
|
|
14
|
+
export interface GeneralAppInput {
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
customTitle?: string;
|
|
18
|
+
}
|
|
19
|
+
export type ComponentCssProperty = {
|
|
20
|
+
class?: string;
|
|
21
|
+
style?: string;
|
|
22
|
+
evalClass?: RichConfiguration;
|
|
23
|
+
};
|
|
24
|
+
export type ComponentCustomCSS<T extends keyof typeof components> = Partial<(typeof components)[T]['customCss']>;
|
|
25
|
+
export type Configuration = StaticAppInput | ConnectedAppInput | UserAppInput | RowAppInput | EvalAppInput | EvalV2AppInput | UploadAppInput | UploadS3AppInput | ResultAppInput | TemplateV2AppInput;
|
|
26
|
+
export type StaticConfiguration = GeneralAppInput & StaticAppInput;
|
|
27
|
+
export type OneOfRichConfiguration<T> = {
|
|
28
|
+
type: 'oneOf';
|
|
29
|
+
selected: string;
|
|
30
|
+
tooltip?: string;
|
|
31
|
+
labels?: Record<string, string>;
|
|
32
|
+
configuration: Record<string, Record<string, T>>;
|
|
33
|
+
};
|
|
34
|
+
export type OneOfConfiguration = OneOfRichConfiguration<GeneralAppInput & (StaticAppInput | EvalAppInput | EvalV2AppInput)>;
|
|
35
|
+
export type RichConfigurationT<T> = (T & {
|
|
36
|
+
type: AppInput['type'];
|
|
37
|
+
}) | OneOfRichConfiguration<T>;
|
|
38
|
+
export type RichConfiguration = RichConfigurationT<Configuration>;
|
|
39
|
+
export type RichConfigurations = Record<string, RichConfiguration>;
|
|
40
|
+
export type StaticRichConfigurations = Record<string, RichConfigurationT<GeneralAppInput & (StaticAppInput | EvalAppInput | EvalV2AppInput)>>;
|
|
41
|
+
export interface BaseAppComponent extends Partial<Aligned> {
|
|
42
|
+
id: ComponentID;
|
|
43
|
+
componentInput: AppInput | undefined;
|
|
44
|
+
configuration: RichConfigurations;
|
|
45
|
+
customCss?: Record<string, ComponentCssProperty>;
|
|
46
|
+
numberOfSubgrids?: number;
|
|
47
|
+
}
|
|
48
|
+
export type ComponentSet = {
|
|
49
|
+
title: string;
|
|
50
|
+
components: Readonly<AppComponent['type'][]>;
|
|
51
|
+
presets?: Readonly<PresetComponentConfig['type'][]> | undefined;
|
|
52
|
+
};
|
|
53
|
+
type SectionID = string;
|
|
54
|
+
export type AppSection = {
|
|
55
|
+
components: AppComponent[];
|
|
56
|
+
id: SectionID;
|
|
57
|
+
};
|
|
58
|
+
export type GridItem = FilledItem<AppComponent>;
|
|
59
|
+
export type AppCssItemName = 'viewer' | 'grid' | AppComponent['type'];
|
|
60
|
+
export type HiddenRunnable = {
|
|
61
|
+
name: string;
|
|
62
|
+
transformer?: InlineScript & {
|
|
63
|
+
language: 'frontend';
|
|
64
|
+
};
|
|
65
|
+
fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>;
|
|
66
|
+
autoRefresh?: boolean;
|
|
67
|
+
doNotRecomputeOnInputChanged?: boolean;
|
|
68
|
+
recomputeOnInputChanged?: boolean;
|
|
69
|
+
noBackendValue?: any;
|
|
70
|
+
hidden?: boolean;
|
|
71
|
+
} & Runnable & RecomputeOthersSource;
|
|
72
|
+
export type AppTheme = {
|
|
73
|
+
type: 'path';
|
|
74
|
+
path: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: 'inlined';
|
|
77
|
+
css: string;
|
|
78
|
+
};
|
|
79
|
+
import type { DiffDrawerI } from '$lib/components/diff_drawer';
|
|
80
|
+
export interface AppEditorProps {
|
|
81
|
+
app: App;
|
|
82
|
+
path: string;
|
|
83
|
+
policy: Policy;
|
|
84
|
+
summary: string;
|
|
85
|
+
fromHub?: boolean;
|
|
86
|
+
diffDrawer?: DiffDrawerI | undefined;
|
|
87
|
+
savedApp?: {
|
|
88
|
+
value: App;
|
|
89
|
+
draft?: any;
|
|
90
|
+
path: string;
|
|
91
|
+
summary: string;
|
|
92
|
+
policy: any;
|
|
93
|
+
draft_only?: boolean;
|
|
94
|
+
custom_path?: string;
|
|
95
|
+
} | undefined;
|
|
96
|
+
version?: number | undefined;
|
|
97
|
+
newApp?: boolean;
|
|
98
|
+
newPath?: string | undefined;
|
|
99
|
+
replaceStateFn?: (path: string) => void;
|
|
100
|
+
gotoFn?: (path: string, opt?: Record<string, any> | undefined) => void;
|
|
101
|
+
unsavedConfirmationModal?: import('svelte').Snippet<[any]>;
|
|
102
|
+
onSavedNewAppPath?: (path: string) => void;
|
|
103
|
+
}
|
|
104
|
+
export type App = {
|
|
105
|
+
grid: GridItem[];
|
|
106
|
+
darkMode?: boolean;
|
|
107
|
+
fullscreen: boolean;
|
|
108
|
+
norefreshbar?: boolean;
|
|
109
|
+
unusedInlineScripts: Array<{
|
|
110
|
+
name: string;
|
|
111
|
+
inlineScript: InlineScript;
|
|
112
|
+
}>;
|
|
113
|
+
hiddenInlineScripts: Array<HiddenRunnable>;
|
|
114
|
+
css?: Partial<Record<AppCssItemName, Record<string, ComponentCssProperty>>>;
|
|
115
|
+
subgrids?: Record<string, GridItem[]>;
|
|
116
|
+
theme: AppTheme | undefined;
|
|
117
|
+
lazyInitRequire?: string[] | undefined;
|
|
118
|
+
eagerRendering?: boolean | undefined;
|
|
119
|
+
hideLegacyTopBar?: boolean | undefined;
|
|
120
|
+
mobileViewOnSmallerScreens?: boolean | undefined;
|
|
121
|
+
version?: number;
|
|
122
|
+
};
|
|
123
|
+
export type ConnectingInput = {
|
|
124
|
+
opened: boolean;
|
|
125
|
+
input?: ConnectedInput;
|
|
126
|
+
sourceName?: string;
|
|
127
|
+
hoveredComponent: string | undefined;
|
|
128
|
+
onConnect?: ((connection: InputConnection) => void) | undefined;
|
|
129
|
+
};
|
|
130
|
+
export interface CancelablePromise<T> extends Promise<T> {
|
|
131
|
+
cancel: () => void;
|
|
132
|
+
}
|
|
133
|
+
export type ListContext = Writable<{
|
|
134
|
+
index: number;
|
|
135
|
+
value: any;
|
|
136
|
+
disabled: boolean;
|
|
137
|
+
}>;
|
|
138
|
+
export type ListInputs = {
|
|
139
|
+
set: (id: string, value: any) => void;
|
|
140
|
+
remove: (id: string) => void;
|
|
141
|
+
};
|
|
142
|
+
export type GroupContext = {
|
|
143
|
+
id: string;
|
|
144
|
+
context: Writable<Record<string, any>>;
|
|
145
|
+
};
|
|
146
|
+
export type JobById = {
|
|
147
|
+
job: string;
|
|
148
|
+
component: string;
|
|
149
|
+
result?: any;
|
|
150
|
+
error?: any;
|
|
151
|
+
transformer?: {
|
|
152
|
+
result?: any;
|
|
153
|
+
error?: string;
|
|
154
|
+
};
|
|
155
|
+
created_at?: number;
|
|
156
|
+
started_at?: number;
|
|
157
|
+
duration_ms?: number;
|
|
158
|
+
};
|
|
159
|
+
export type AppViewerContext = {
|
|
160
|
+
worldStore: Writable<World>;
|
|
161
|
+
app: Writable<App>;
|
|
162
|
+
summary: Writable<string>;
|
|
163
|
+
initialized: Writable<{
|
|
164
|
+
initializedComponents: string[];
|
|
165
|
+
initialized: boolean;
|
|
166
|
+
runnableInitialized: Record<string, any>;
|
|
167
|
+
}>;
|
|
168
|
+
selectedComponent: Writable<string[] | undefined>;
|
|
169
|
+
mode: Writable<EditorMode>;
|
|
170
|
+
connectingInput: Writable<ConnectingInput>;
|
|
171
|
+
breakpoint: Writable<EditorBreakpoint>;
|
|
172
|
+
bgRuns: Writable<string[]>;
|
|
173
|
+
runnableComponents: Writable<Record<string, {
|
|
174
|
+
autoRefresh: boolean;
|
|
175
|
+
refreshOnStart?: boolean;
|
|
176
|
+
cb: ((inlineScript?: InlineScript, setRunnableJob?: boolean) => CancelablePromise<void>)[];
|
|
177
|
+
}>>;
|
|
178
|
+
staticExporter: Writable<Record<string, () => any>>;
|
|
179
|
+
appPath: Writable<string>;
|
|
180
|
+
workspace: string;
|
|
181
|
+
onchange: (() => void) | undefined;
|
|
182
|
+
isEditor: boolean;
|
|
183
|
+
jobs: Writable<string[]>;
|
|
184
|
+
jobsById: Writable<Record<string, JobById>>;
|
|
185
|
+
noBackend: boolean;
|
|
186
|
+
errorByComponent: Writable<Record<string, {
|
|
187
|
+
id?: string;
|
|
188
|
+
error: string;
|
|
189
|
+
}>>;
|
|
190
|
+
openDebugRun: Writable<((jobID: string) => void) | undefined>;
|
|
191
|
+
focusedGrid: Writable<FocusedGrid | undefined>;
|
|
192
|
+
stateId: Writable<number>;
|
|
193
|
+
parentWidth: Writable<number>;
|
|
194
|
+
state: Writable<Record<string, any>>;
|
|
195
|
+
componentControl: Writable<Record<string, {
|
|
196
|
+
left?: () => boolean;
|
|
197
|
+
right?: (skipTableActions?: boolean | undefined) => string | boolean;
|
|
198
|
+
setTab?: (index: number) => void;
|
|
199
|
+
agGrid?: {
|
|
200
|
+
api: any;
|
|
201
|
+
columnApi: any;
|
|
202
|
+
};
|
|
203
|
+
setCode?: (value: string) => void;
|
|
204
|
+
onDelete?: () => void;
|
|
205
|
+
setValue?: (value: any) => void;
|
|
206
|
+
setSelectedIndex?: (index: number) => void;
|
|
207
|
+
openModal?: () => void;
|
|
208
|
+
closeModal?: () => void;
|
|
209
|
+
open?: () => void;
|
|
210
|
+
close?: () => void;
|
|
211
|
+
validate?: (key: string) => void;
|
|
212
|
+
invalidate?: (key: string, error: string) => void;
|
|
213
|
+
validateAll?: () => void;
|
|
214
|
+
clearFiles?: () => void;
|
|
215
|
+
showToast?: (message: string, error?: boolean) => void;
|
|
216
|
+
recompute?: () => void;
|
|
217
|
+
askNewResource?: () => void;
|
|
218
|
+
setGroupValue?: (key: string, value: any) => void;
|
|
219
|
+
}>>;
|
|
220
|
+
hoverStore: Writable<string | undefined>;
|
|
221
|
+
allIdsInPath: Writable<string[]>;
|
|
222
|
+
darkMode: Writable<boolean>;
|
|
223
|
+
cssEditorOpen: Writable<boolean>;
|
|
224
|
+
previewTheme: Writable<string | undefined>;
|
|
225
|
+
debuggingComponents: Writable<Record<string, number>>;
|
|
226
|
+
replaceStateFn?: ((url: string) => void) | undefined;
|
|
227
|
+
gotoFn?: ((url: string, opt?: Record<string, any> | undefined) => void) | undefined;
|
|
228
|
+
policy: Policy;
|
|
229
|
+
recomputeAllContext: Writable<{
|
|
230
|
+
onRefresh?: (excludeId?: string) => void;
|
|
231
|
+
componentNumber?: number | undefined;
|
|
232
|
+
interval?: number | undefined;
|
|
233
|
+
refreshing?: string[] | undefined;
|
|
234
|
+
setInter?: (interval: number) => void | undefined;
|
|
235
|
+
progress?: number | undefined;
|
|
236
|
+
loading?: boolean | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
panzoomActive: Writable<boolean>;
|
|
239
|
+
};
|
|
240
|
+
export type AppEditorContext = {
|
|
241
|
+
yTop: Writable<number>;
|
|
242
|
+
runnableJobEditorPanel: Writable<{
|
|
243
|
+
focused: boolean;
|
|
244
|
+
jobs: Record<string, string>;
|
|
245
|
+
frontendJobs: Record<string, any>;
|
|
246
|
+
width: number;
|
|
247
|
+
}>;
|
|
248
|
+
evalPreview: Writable<Record<string, any>>;
|
|
249
|
+
componentActive: Writable<boolean>;
|
|
250
|
+
dndItem: Writable<Record<string, (x: number, y: number, topY: number) => void>>;
|
|
251
|
+
refreshComponents: Writable<(() => void) | undefined>;
|
|
252
|
+
history: History<App> | undefined;
|
|
253
|
+
pickVariableCallback: Writable<((path: string) => void) | undefined>;
|
|
254
|
+
selectedComponentInEditor: Writable<string | undefined>;
|
|
255
|
+
movingcomponents: Writable<string[] | undefined>;
|
|
256
|
+
jobsDrawerOpen: Writable<boolean>;
|
|
257
|
+
scale: Writable<number>;
|
|
258
|
+
stylePanel: () => any;
|
|
259
|
+
};
|
|
260
|
+
export type FocusedGrid = {
|
|
261
|
+
parentComponentId: string;
|
|
262
|
+
subGridIndex: number;
|
|
263
|
+
};
|
|
264
|
+
export type EditorMode = 'dnd' | 'preview';
|
|
265
|
+
export type EditorBreakpoint = 'sm' | 'lg';
|
|
266
|
+
export declare const IS_APP_PUBLIC_CONTEXT_KEY: "isAppPublicContext";
|
|
267
|
+
type ComponentID = string;
|
|
268
|
+
export type ContextPanelContext = {
|
|
269
|
+
search: Writable<string>;
|
|
270
|
+
manuallyOpened: Writable<Record<string, boolean>>;
|
|
271
|
+
hasResult: Writable<Record<string, boolean>>;
|
|
272
|
+
};
|
|
273
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type BaseColor = 'blue' | 'gray' | 'red' | 'green' | 'yellow' | 'indigo' | 'orange' | 'violet';
|
|
2
|
+
export declare const ColorModifier = "dark-";
|
|
3
|
+
export type BadgeColor = BaseColor | 'transparent' | `${typeof ColorModifier}${BaseColor}`;
|
|
4
|
+
export interface BadgeIconProps {
|
|
5
|
+
position?: 'left' | 'right';
|
|
6
|
+
icon: any;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { IconType } from '$lib/utils';
|
|
2
|
+
export declare const BUTTON_COLORS: readonly ["blue", "red", "dark", "light", "green", "gray", "none", "marine", "nord"];
|
|
3
|
+
export declare namespace ButtonType {
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `UnifiedSize` instead
|
|
6
|
+
*/
|
|
7
|
+
type Size = 'xs3' | 'xs2' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
+
type UnifiedSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
9
|
+
type ExtendedSize = 'xs2' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `Variant` instead
|
|
12
|
+
*/
|
|
13
|
+
type Color = 'blue' | 'red' | 'dark' | 'light' | 'green' | 'gray' | 'none' | 'marine' | 'nord';
|
|
14
|
+
type Variant = 'contained' | 'border' | 'divider' | 'accent-secondary' | 'accent' | 'default' | 'subtle';
|
|
15
|
+
type Target = '_self' | '_blank';
|
|
16
|
+
type Element = HTMLButtonElement | HTMLAnchorElement;
|
|
17
|
+
interface Icon {
|
|
18
|
+
icon?: IconType | undefined;
|
|
19
|
+
classes?: string;
|
|
20
|
+
faIcon?: any | undefined;
|
|
21
|
+
props?: any;
|
|
22
|
+
}
|
|
23
|
+
const FontSizeClasses: Record<ButtonType.Size, string>;
|
|
24
|
+
const SpacingClasses: Record<ButtonType.Size, Record<'contained' | 'border' | 'divider', string>>;
|
|
25
|
+
interface ItemProps {
|
|
26
|
+
size: Size;
|
|
27
|
+
color: Color;
|
|
28
|
+
}
|
|
29
|
+
const ColorVariants: Record<ButtonType.Color, Record<'contained' | 'border' | 'divider', string>>;
|
|
30
|
+
const VariantStyles: Record<'accent-secondary' | 'accent' | 'default' | 'subtle', string>;
|
|
31
|
+
const DestructiveVariantStyles: Record<'accent-secondary' | 'accent' | 'default' | 'subtle', string>;
|
|
32
|
+
const VariantSpacingClasses: Record<ButtonType.Size, string>;
|
|
33
|
+
const IconOnlyVariantSpacingClasses: Record<ButtonType.Size, string>;
|
|
34
|
+
const UnifiedSizingClasses: Record<ButtonType.UnifiedSize, string>;
|
|
35
|
+
const UnifiedIconOnlySizingClasses: Record<ButtonType.UnifiedSize, string>;
|
|
36
|
+
const UnifiedMinHeightClasses: Record<ButtonType.UnifiedSize, string>;
|
|
37
|
+
const UnifiedHeightClasses: Record<ButtonType.UnifiedSize, string>;
|
|
38
|
+
const UnifiedIconSizes: Record<ButtonType.UnifiedSize, number>;
|
|
39
|
+
const UnifiedFontSizes: Record<ButtonType.UnifiedSize, string>;
|
|
40
|
+
const ExtendedSizingClasses: Record<ButtonType.ExtendedSize, string>;
|
|
41
|
+
const ExtendedIconOnlySizingClasses: Record<ButtonType.ExtendedSize, string>;
|
|
42
|
+
const ExtendedHeightClasses: Record<ButtonType.ExtendedSize, string>;
|
|
43
|
+
const ExtendedIconSizes: Record<ButtonType.ExtendedSize, number>;
|
|
44
|
+
const ExtendedFontSizeClasses: Record<ButtonType.ExtendedSize, string>;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ReadFileAs = 'buffer' | 'binary' | 'base64' | 'text';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { default as ActionRow } from './actionRow/ActionRow.svelte';
|
|
2
|
+
export { default as Alert } from './alert/Alert.svelte';
|
|
3
|
+
export { default as Badge } from './badge/Badge.svelte';
|
|
4
|
+
export { default as Button } from './button/Button.svelte';
|
|
5
|
+
export { default as UndoRedo } from './button/UndoRedo.svelte';
|
|
6
|
+
export { default as ClearableInput } from './clearableInput/ClearableInput.svelte';
|
|
7
|
+
export { default as Drawer } from './drawer/Drawer.svelte';
|
|
8
|
+
export { default as DrawerContent } from './drawer/DrawerContent.svelte';
|
|
9
|
+
export { default as Kbd } from './kbd/Kbd.svelte';
|
|
10
|
+
export { default as Menu } from './menu/Menu.svelte';
|
|
11
|
+
export { default as MenuItem } from './menu/MenuItem.svelte';
|
|
12
|
+
export { default as SecondsInput } from './seconds/SecondsInput.svelte';
|
|
13
|
+
export { default as Skeleton } from './skeleton/Skeleton.svelte';
|
|
14
|
+
export { default as Tab } from './tabs/Tab.svelte';
|
|
15
|
+
export { default as TabContent } from './tabs/TabContent.svelte';
|
|
16
|
+
export { default as Tabs } from './tabs/Tabs.svelte';
|
|
17
|
+
export { default as Breadcrumb } from './breadcrumb/Breadcrumb.svelte';
|
|
18
|
+
export { default as FileInput } from './fileInput/FileInput.svelte';
|
|
19
|
+
export { default as Section } from '../Section.svelte';
|
|
20
|
+
export { default as Url } from './Url.svelte';
|
|
21
|
+
export * from './alert/model';
|
|
22
|
+
export * from './badge/model';
|
|
23
|
+
export * from './button/model';
|
|
24
|
+
export * from './skeleton/model';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const HEIGHT_UNIT: 16;
|
|
2
|
+
export type SkeletonLayout = (SkeletonGap | SkeletonRow)[];
|
|
3
|
+
/** **Gap**: number of height units. *(1 unit = 16px)* */
|
|
4
|
+
export type SkeletonGap = number;
|
|
5
|
+
export type SkeletonRow = SkeletonElement[] | ISkeletonRow;
|
|
6
|
+
export interface ISkeletonRow {
|
|
7
|
+
/** Number of elements in the row.
|
|
8
|
+
* All elements will have the same width and height of the row. */
|
|
9
|
+
elements: number;
|
|
10
|
+
/** **Height**: number of height units. *(1 unit = 16px)* */
|
|
11
|
+
h: number;
|
|
12
|
+
}
|
|
13
|
+
export type SkeletonElement = number | ISkeletonElement;
|
|
14
|
+
export interface ISkeletonElement {
|
|
15
|
+
/** **Height**: number of height units. *(1 unit = 16px)* */
|
|
16
|
+
h: number;
|
|
17
|
+
/** **Width**: percentage of the row width. *(80 means 80%)* */
|
|
18
|
+
w: number;
|
|
19
|
+
/** **Min Width**: minimum width in pixels. */
|
|
20
|
+
minW?: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type DbInput = {
|
|
2
|
+
type: 'database';
|
|
3
|
+
resourceType: DbType;
|
|
4
|
+
resourcePath: string;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'ducklake';
|
|
7
|
+
ducklake: string;
|
|
8
|
+
};
|
|
9
|
+
export type DbType = (typeof dbTypes)[number];
|
|
10
|
+
export declare const dbTypes: readonly ["mysql", "ms_sql_server", "postgresql", "snowflake", "bigquery", "duckdb"];
|
|
11
|
+
export declare const isDbType: (str?: string) => str is DbType;
|