@nice2dev/ui 1.4.5 → 1.4.7

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/dist/{NiceDataGrid-mrnaLHQk.cjs → NiceDataGrid-D3qRQSjy.cjs} +1 -1
  3. package/dist/NiceForm-BWb4LTQJ.cjs +1 -0
  4. package/dist/{NiceHtmlEditor-C1OVtLQ6.cjs → NiceHtmlEditor-BzECmDO3.cjs} +1 -1
  5. package/dist/{NiceMention-tgJKS8PH.cjs → NiceMention-CYRqPKGU.cjs} +19 -19
  6. package/dist/NiceModuleLifecyclePanel-CiYbPcHV.cjs +1 -0
  7. package/dist/{NicePagination-D7XxeNFz.cjs → NicePagination-BAxwqeEd.cjs} +1 -1
  8. package/dist/{NicePivotGrid-Cnkr9WkC.cjs → NicePivotGrid-Cxu5PECg.cjs} +1 -1
  9. package/dist/{NiceSavedQueryPanel-U1-yaw-Q.cjs → NiceSavedQueryPanel-BSZhE-_l.cjs} +6 -6
  10. package/dist/{NiceScheduler-Boo-D1S-.cjs → NiceScheduler-BqYiHPvz.cjs} +1 -1
  11. package/dist/{core-lazy-C_qnVGxE.cjs → core-lazy-BQexApr7.cjs} +1 -1
  12. package/dist/data.cjs +1 -1
  13. package/dist/database/NiceDataSourceEditor.mjs +370 -0
  14. package/dist/database/NiceQueryDesigner.mjs +958 -0
  15. package/dist/database/moduleDataSource.mjs +151 -0
  16. package/dist/database/queryDesign.mjs +396 -0
  17. package/dist/database/queryDesignerPanels.mjs +1214 -0
  18. package/dist/database/querySql.mjs +481 -0
  19. package/dist/editors.cjs +1 -1
  20. package/dist/index.cjs +188 -181
  21. package/dist/index.d.ts +674 -0
  22. package/dist/index.mjs +774 -720
  23. package/dist/lazy.cjs +1 -1
  24. package/dist/navigation.cjs +1 -1
  25. package/dist/no-code/NiceNoCodeScriptEditor.mjs +584 -0
  26. package/dist/no-code/noCodeScript.mjs +326 -0
  27. package/dist/no-code-B1jzfUF5.cjs +331 -0
  28. package/dist/no-code.cjs +1 -1
  29. package/dist/no-code.d.ts +177 -0
  30. package/dist/no-code.mjs +26 -16
  31. package/dist/style.css +2 -2
  32. package/package.json +4 -4
  33. package/dist/NiceForm-O3sv-DNX.cjs +0 -1
  34. package/dist/NiceModuleLifecyclePanel-DKlqKPy2.cjs +0 -1
  35. package/dist/NiceSelect-BNPXs6FQ.cjs +0 -1
  36. package/dist/no-code-B3BHeyG-.cjs +0 -331
package/dist/index.d.ts CHANGED
@@ -862,6 +862,12 @@ export declare function addMenuGroup(menu: readonly NiceMenuBuilderItem[], label
862
862
  id: string;
863
863
  };
864
864
 
865
+ /**
866
+ * The query with a related table added and joined: many-to-one comes in as one nested object,
867
+ * one-to-many as a nested list — the shape a print of a record with its lines needs.
868
+ */
869
+ export declare function addRelatedTable(model: NiceQueryModel, related: NiceRelatedTable): NiceQueryModel;
870
+
865
871
  /** Address field definition within a NiceAddressInput. */
866
872
  export declare interface AddressValue {
867
873
  street?: string;
@@ -873,6 +879,24 @@ export declare interface AddressValue {
873
879
  country?: string;
874
880
  }
875
881
 
882
+ /**
883
+ * The query with a table added — a table already in it comes again under a new alias (Customer,
884
+ * Customer2…), so the same table can be joined twice (billing and shipping address). Placed right
885
+ * of the others unless a position is given.
886
+ */
887
+ export declare function addTableInstance(model: NiceQueryModel, table: NiceDataSourceSchemaTable, options?: {
888
+ position?: {
889
+ x: number;
890
+ y: number;
891
+ };
892
+ select?: 'all' | 'none' | string[];
893
+ /** The name it goes by (made unique); default: its own, numbered when taken. */
894
+ alias?: string;
895
+ }): {
896
+ model: NiceQueryModel;
897
+ tableId: string;
898
+ };
899
+
876
900
  declare interface AgentMetrics {
877
901
  agentId: string;
878
902
  openTickets: number;
@@ -1226,6 +1250,12 @@ export declare interface AspectRatioPreset {
1226
1250
  ratio?: number;
1227
1251
  }
1228
1252
 
1253
+ /**
1254
+ * The rows of a plan put together: `rowsOf(list)` gives the rows a list's query returned (for the
1255
+ * parent keys of the rows above it). Helper columns (`__key1`, `__parent`) do not stay.
1256
+ */
1257
+ export declare function assembleQueryRows(plan: Pick<NiceQueryPlan, 'lists'>, mainRows: readonly Row[], rowsOf: (list: NiceQueryListPlan) => readonly Row[]): Row[];
1258
+
1229
1259
  declare interface Assertion {
1230
1260
  matcher: AssertionMatcher;
1231
1261
  expected?: unknown;
@@ -2969,6 +2999,9 @@ declare interface ComputedField {
2969
2999
 
2970
3000
  declare type ConditionOperator = '=' | '!=' | '>' | '<' | '>=' | '<=' | 'LIKE' | 'NOT LIKE' | 'IN' | 'NOT IN' | 'IS NULL' | 'IS NOT NULL' | 'BETWEEN';
2971
3001
 
3002
+ /** The legacy flat conditions as a filter group (AND / OR as typed between them). */
3003
+ export declare function conditionsToFilter(conditions: readonly QueryCondition[]): NiceQueryFilterGroup;
3004
+
2972
3005
  /**
2973
3006
  * Confidence band configuration.
2974
3007
  */
@@ -3503,6 +3536,9 @@ export declare type DataType = 'string' | 'number' | 'boolean' | 'date' | 'datet
3503
3536
 
3504
3537
  declare type DataType_2 = 'string' | 'number' | 'boolean' | 'date' | 'array' | 'object' | 'any';
3505
3538
 
3539
+ /** A date cut down to its year, quarter, month or day (for grouping). */
3540
+ export declare function datePartSql(expr: string, part: NiceDatePart, d: NiceSqlDialect): string;
3541
+
3506
3542
  export declare interface DecisionTable {
3507
3543
  id: string;
3508
3544
  name: string;
@@ -3630,6 +3666,15 @@ export { deserializeTheme }
3630
3666
 
3631
3667
  export declare function deserializeView(json: string): NiceViewDefinition;
3632
3668
 
3669
+ /** The width and row height of a table card on the canvas (the join lines are drawn from them). */
3670
+ export declare const DESIGN_CARD: {
3671
+ readonly width: 220;
3672
+ readonly header: 34;
3673
+ readonly row: 24;
3674
+ readonly gapX: 60;
3675
+ readonly gapY: 40;
3676
+ };
3677
+
3633
3678
  declare interface DesignState {
3634
3679
  components: ComponentInstance[];
3635
3680
  layout: LayoutConfig;
@@ -4347,6 +4392,12 @@ export declare const EMOJI_DATA: Emoji[];
4347
4392
 
4348
4393
  export declare type EmojiCategory = 'recent' | 'smileys' | 'people' | 'animals' | 'food' | 'travel' | 'activities' | 'objects' | 'symbols' | 'flags';
4349
4394
 
4395
+ /** An empty filter group. */
4396
+ export declare const emptyFilterGroup: (logic?: "AND" | "OR") => NiceQueryFilterGroup;
4397
+
4398
+ /** An empty query. */
4399
+ export declare function emptyQueryDesign(): NiceQueryModel;
4400
+
4350
4401
  /** Encoding preset (speed vs quality) */
4351
4402
  export declare type EncodingPreset = 'ultrafast' | 'superfast' | 'veryfast' | 'faster' | 'fast' | 'medium' | 'slow' | 'slower' | 'veryslow' | 'placebo';
4352
4403
 
@@ -4793,6 +4844,12 @@ declare interface ESLintRuleContext {
4793
4844
  };
4794
4845
  }
4795
4846
 
4847
+ /**
4848
+ * The value of an expression in a scope. Throws on a syntax error. A text template — an expression
4849
+ * that is a single string with `{{path}}` in it — fills each `{{…}}` with that path's value.
4850
+ */
4851
+ export declare function evaluateNoCodeExpression(source: string, scope: Record<string, unknown>): unknown;
4852
+
4796
4853
  export { evaluateValidation }
4797
4854
 
4798
4855
  export { evaluateValidationRule }
@@ -5442,6 +5499,9 @@ export declare interface FreehandAnnotation extends AnnotationBase {
5442
5499
  }[];
5443
5500
  }
5444
5501
 
5502
+ /** A function of a computed column, written for the database. */
5503
+ export declare function functionSql(fn: string, args: string[], d: NiceSqlDialect): string;
5504
+
5445
5505
  export declare interface FuzzyMatch {
5446
5506
  score: number;
5447
5507
  indices: number[];
@@ -5544,6 +5604,9 @@ export declare function generateMermaidSyntax(schema: DiagramSchema): string;
5544
5604
 
5545
5605
  export { generatePaletteFromColor }
5546
5606
 
5607
+ /** The main query's SQL (what a data source keeps in `sql`). */
5608
+ export declare function generateQuerySql(model: NiceQueryModel, options?: NiceQuerySqlOptions): string;
5609
+
5547
5610
  /** Generate Dart RBAC constants from RBAC policy. */
5548
5611
  export declare function generateRbacDart(policy: NiceRbacPolicy): NiceGeneratedFile;
5549
5612
 
@@ -6249,6 +6312,12 @@ export declare interface InvoiceTotals {
6249
6312
  /** Check if a user can perform an action on a resource. Deny overrides allow. */
6250
6313
  export declare function isAllowed(resolved: NiceResolvedPermissions, resource: string, action: RbacAction): boolean;
6251
6314
 
6315
+ /**
6316
+ * Whether a stored value is a data source the editor can keep as it is: a key, a known kind and
6317
+ * that kind's fields in their types. Anything else stays raw.
6318
+ */
6319
+ export declare function isModuleDataSource(v: unknown): v is NiceModuleDataSource;
6320
+
6252
6321
  export { isRecordValid }
6253
6322
 
6254
6323
  /** Whether the node with `id` is somewhere below the node with `ancestorId` (not itself). */
@@ -7165,6 +7234,24 @@ declare interface ModuleContextMenuItem<T = any> {
7165
7234
  onClick?: (row: T) => void;
7166
7235
  }
7167
7236
 
7237
+ /**
7238
+ * The columns a source gives: a query's columns (outputColumns), the SQL's declared columns, the
7239
+ * first source of a union, the static columns (or the keys of the rows).
7240
+ */
7241
+ export declare function moduleDataSourceColumns(def: NiceModuleDataSource, ctx?: NiceDataSourceColumnContext, seen?: ReadonlySet<string>): NiceDataSourceColumn[];
7242
+
7243
+ /** The keys a source reads from (a union's sources; a query's tables of schema `source`). */
7244
+ export declare function moduleDataSourceDependencies(def: NiceModuleDataSource): string[];
7245
+
7246
+ /**
7247
+ * The parameters a source takes: declared ones, plus those its query uses or `@name` / `{{name}}`
7248
+ * in its SQL.
7249
+ */
7250
+ export declare function moduleDataSourceParameters(def: NiceModuleDataSource): NiceDataSourceParameter[];
7251
+
7252
+ /** A source as a table another source's query can pick and join (its schema: `source`). */
7253
+ export declare function moduleDataSourceTable(def: NiceModuleDataSource, ctx?: NiceDataSourceColumnContext): NiceDataSourceSchemaTable;
7254
+
7168
7255
  /** Empty state configuration. */
7169
7256
  declare interface ModuleEmptyState {
7170
7257
  icon?: React.ReactNode;
@@ -7351,10 +7438,25 @@ export declare interface NavbarBreadcrumb {
7351
7438
  onClick?: () => void;
7352
7439
  }
7353
7440
 
7441
+ /**
7442
+ * Where a table's columns land in the result: `[]` — the row itself; `['Customer']` — the nested
7443
+ * object or list a join puts it in (the path goes down through joins nested in nested ones).
7444
+ */
7445
+ export declare function nestPathOf(model: NiceQueryModel, tableId: string): string[];
7446
+
7354
7447
  export declare type NetworkNodeCategory = 'router' | 'switch' | 'access-point' | 'server' | 'workstation' | 'printer' | 'camera' | 'iot' | 'unknown';
7355
7448
 
7356
7449
  export declare type NetworkNodeStatus = 'online' | 'offline' | 'warning';
7357
7450
 
7451
+ /** A new, empty source of a kind (its key and label kept when switching an existing one). */
7452
+ export declare function newModuleDataSource(kind: NiceModuleDataSourceKind, key: string, base?: {
7453
+ label?: string;
7454
+ description?: string;
7455
+ }): NiceModuleDataSource;
7456
+
7457
+ /** A new step of a type, with empty settings. */
7458
+ export declare function newNoCodeStep(type: StepType): NiceNoCodeStep;
7459
+
7358
7460
  /** Tiny non-cryptographic id generator suitable for UI-only records. */
7359
7461
  export declare function newRecipeId(prefix?: string): string;
7360
7462
 
@@ -7378,6 +7480,18 @@ export { NICE_INTENT_EVENT }
7378
7480
 
7379
7481
  export { NICE_INTENTS }
7380
7482
 
7483
+ /** The kinds, in the order the editor offers them. */
7484
+ export declare const NICE_MODULE_DATA_SOURCE_KINDS: readonly NiceModuleDataSourceKind[];
7485
+
7486
+ /** The kinds of step, in the order the editor offers them. */
7487
+ export declare const NICE_NO_CODE_STEP_TYPES: readonly ["read", "filter", "map", "aggregate", "set", "if", "forEach", "write", "callScript", "return"];
7488
+
7489
+ export declare const NICE_QUERY_OPERATORS: readonly NiceQueryOperatorDef[];
7490
+
7491
+ export declare const NICE_SQL_DIALECTS: readonly NiceSqlDialect[];
7492
+
7493
+ export declare const NICE_SQL_FUNCTIONS: readonly NiceSqlFunctionDef[];
7494
+
7381
7495
  export { NICE_THEME_ARCHIVE }
7382
7496
 
7383
7497
  /** The archived themes in categories, as the catalog had them before 1.4.0. */
@@ -10376,6 +10490,12 @@ export declare interface NiceColumnChooserProps {
10376
10490
  'data-testid'?: string;
10377
10491
  }
10378
10492
 
10493
+ /** Which columns a bulk pick takes. */
10494
+ export declare type NiceColumnPick = 'all' | 'none' | 'invert' | 'keys' | NiceValueType | {
10495
+ names: string[];
10496
+ selected: boolean;
10497
+ };
10498
+
10379
10499
  export declare interface NiceColumnState {
10380
10500
  field: string;
10381
10501
  visible: boolean;
@@ -11924,6 +12044,21 @@ export declare interface NiceDataSourceBuilderProps extends NiceBaseProps {
11924
12044
  tutorial?: NiceComponentTutorial;
11925
12045
  }
11926
12046
 
12047
+ /** A column a source gives. */
12048
+ export declare interface NiceDataSourceColumn {
12049
+ name: string;
12050
+ /** `string`, `number`, `decimal`, `date`, `boolean`, `guid`… */
12051
+ dataType?: string;
12052
+ }
12053
+
12054
+ /** What a source's columns depend on: the entities it reads and the other sources. */
12055
+ export declare interface NiceDataSourceColumnContext {
12056
+ /** Entity tables (this module's and the modules' it depends on). */
12057
+ schemas?: readonly NiceDataSourceSchemaTable[];
12058
+ /** The module's other sources, by key. */
12059
+ sources?: ReadonlyArray<NiceModuleDataSource>;
12060
+ }
12061
+
11927
12062
  export { NiceDataSourceConfig }
11928
12063
 
11929
12064
  /** A reusable, serializable data source (maps to a view-standard `query` source). */
@@ -11934,27 +12069,94 @@ export declare interface NiceDataSourceDef {
11934
12069
  query: NiceQueryModel;
11935
12070
  /** Generated SQL view (read-only artifact derived from `query`). */
11936
12071
  sql: string;
12072
+ description?: string;
12073
+ /**
12074
+ * What it returns (1.4.7): rows of plain columns (`flat`), records with their nested parts
12075
+ * (`list`, default) or one record (`object`, e.g. WHERE Id = @id).
12076
+ */
12077
+ shape?: NiceDataSourceShape;
12078
+ /** The database `sql` is written for (1.4.7; default PostgreSQL). */
12079
+ dialect?: NiceSqlDialect;
12080
+ /** Values the caller gives (`@id`, `@from`) — 1.4.7. */
12081
+ parameters?: NiceDataSourceParameter[];
12082
+ }
12083
+
12084
+ /**
12085
+ * The editor of one module data source, switched by its kind; the rows it gives on Preview.
12086
+ */
12087
+ export declare function NiceDataSourceEditor({ value, defaultValue, onChange, schemas, extraSchemas, sources, kinds, dialects, onPreview, readOnly, height, className, style, id, 'data-testid': dataTestId, }: NiceDataSourceEditorProps): default_2.ReactElement;
12088
+
12089
+ /** Props for the {@link NiceDataSourceEditor} component. */
12090
+ export declare interface NiceDataSourceEditorProps extends NiceBaseProps {
12091
+ /** The data source — **controlled**. Omit it to let the editor keep its own copy. */
12092
+ value?: NiceModuleDataSource;
12093
+ /** The data source at first in the uncontrolled mode. Default: an empty query. */
12094
+ defaultValue?: NiceModuleDataSource;
12095
+ onChange?: (def: NiceModuleDataSource) => void;
12096
+ /** This module's entity tables. */
12097
+ schemas?: NiceDataSourceSchemaTable[];
12098
+ /**
12099
+ * Entity tables of the modules this one depends on (their `schema`: the module) — a query joins
12100
+ * them like its own.
12101
+ */
12102
+ extraSchemas?: NiceDataSourceSchemaTable[];
12103
+ /** The module's other sources: tables of a query, members of a union. */
12104
+ sources?: NiceModuleDataSource[];
12105
+ /** The kinds offered. Default: all four. */
12106
+ kinds?: NiceModuleDataSourceKind[];
12107
+ /** SQL dialects offered for SQL text. Default: portable, PostgreSQL, SQL Server, MySQL, SQLite, Oracle. */
12108
+ dialects?: string[];
12109
+ /** Runs the source with parameter values: with it, Preview shows its first rows. */
12110
+ onPreview?: (def: NiceModuleDataSource, params: Record<string, string>) => Promise<ReadonlyArray<Record<string, unknown>>>;
12111
+ readOnly?: boolean;
12112
+ /** Height of the query designer. Default `640`. */
12113
+ height?: number | string;
11937
12114
  }
11938
12115
 
11939
12116
  export { NiceDataSourceEventMap }
11940
12117
 
12118
+ /** A parameter of a source (`@status`, `{{status}}`). */
12119
+ export declare interface NiceDataSourceParameter {
12120
+ name: string;
12121
+ dataType?: string;
12122
+ /** Its value when the caller gives none (text, as typed). */
12123
+ defaultValue?: string;
12124
+ required?: boolean;
12125
+ }
12126
+
11941
12127
  /** A table the host exposes from a connected database schema. */
11942
12128
  export declare interface NiceDataSourceSchemaTable {
11943
12129
  name: string;
11944
12130
  schema?: string;
12131
+ /** The entity the table stores, when its name is not the table's (1.4.7: entity data sources). */
12132
+ entity?: string;
11945
12133
  columns: Array<{
11946
12134
  name: string;
11947
12135
  dataType: string;
11948
12136
  isPrimaryKey?: boolean;
11949
12137
  isForeignKey?: boolean;
12138
+ /** The table and column a foreign key points at (1.4.7: the designer offers the join). */
12139
+ references?: {
12140
+ table: string;
12141
+ column: string;
12142
+ schema?: string;
12143
+ };
11950
12144
  }>;
12145
+ /** What the table is for, shown in the designer's browser (1.4.7). */
12146
+ description?: string;
11951
12147
  }
11952
12148
 
12149
+ /** What a data source returns: plain rows, records with nested parts, or one record. */
12150
+ export declare type NiceDataSourceShape = 'flat' | 'list' | 'object';
12151
+
11953
12152
  export { NiceDataSourceState }
11954
12153
 
11955
12154
  /** Predefined date-format presets. */
11956
12155
  declare type NiceDateFormatPreset = 'date-local' | 'date-utc' | 'datetime-local' | 'datetime-utc' | 'month-local' | 'month-utc' | 'week' | 'time';
11957
12156
 
12157
+ /** A date grouped by part of it. */
12158
+ export declare type NiceDatePart = 'year' | 'quarter' | 'month' | 'day';
12159
+
11958
12160
  export declare const NiceDateRangeBox: default_2.FC<NiceDateRangeBoxProps>;
11959
12161
 
11960
12162
  /** Props for the {@link NiceDateRangeBox} component — a pair of date pickers for selecting a date range. */
@@ -15240,6 +15442,16 @@ export declare interface NiceInvoiceLineEditorProps extends NiceFormFieldProps {
15240
15442
  tutorial?: NiceComponentTutorial;
15241
15443
  }
15242
15444
 
15445
+ /** How a joined table appears in the result. */
15446
+ export declare type NiceJoinNesting = 'flat' | 'object' | 'list';
15447
+
15448
+ /** A join the designer can offer: a foreign key between two tables of the query. */
15449
+ export declare interface NiceJoinSuggestion {
15450
+ join: Omit<QueryJoin, 'id'>;
15451
+ /** `Order.CustomerId = Customer.Id`. */
15452
+ label: string;
15453
+ }
15454
+
15243
15455
  declare interface NiceJSONOptions extends NiceExportOptions {
15244
15456
  /** Pretty print JSON */
15245
15457
  pretty?: boolean;
@@ -17119,6 +17331,19 @@ export declare interface NiceModeSelectorProps extends NiceBaseProps {
17119
17331
 
17120
17332
  export declare type NiceModuleAction = 'activate' | 'deactivate' | 'install' | 'uninstall' | 'update';
17121
17333
 
17334
+ /** A data source of a module. A plain `NiceDataSourceDef` (a visual query) is one. */
17335
+ export declare type NiceModuleDataSource = NiceDataSourceDef | NiceSqlDataSourceDef | NiceUnionDataSourceDef | NiceStaticDataSourceDef;
17336
+
17337
+ /** What every kind carries. */
17338
+ declare interface NiceModuleDataSourceBase {
17339
+ key: string;
17340
+ label?: string;
17341
+ description?: string;
17342
+ }
17343
+
17344
+ /** The kinds of a module data source. */
17345
+ export declare type NiceModuleDataSourceKind = 'query' | 'sql' | 'union' | 'static';
17346
+
17122
17347
  /** Dependency on another module. */
17123
17348
  export declare interface NiceModuleDependency {
17124
17349
  /** Module id of the dependency. */
@@ -18136,6 +18361,152 @@ declare interface NiceNetworkNodePort {
18136
18361
  state: string;
18137
18362
  }
18138
18363
 
18364
+ /**
18365
+ * No-code scripts (1.4.6, R43 — documentation/PLAN.md §2: "skrypty… przede wszystkim no code operujące
18366
+ * na źródłach danych"): a script is a list of steps — read rows from a data source, filter, map,
18367
+ * aggregate, set variables, branch, loop, write rows, call another script, return a value — run by
18368
+ * {@link runNoCodeScript} against the host's data through a small I/O adapter. React-free.
18369
+ *
18370
+ * Values in steps are expressions of a tiny, safe language (no `eval`): numbers, `'strings'`,
18371
+ * `true` / `false` / `null`, variable paths (`order.total`, `rows.length`; inside a row step the
18372
+ * row's fields by name), `+ - * /`, comparisons, `&& || !`, parentheses — and text templates
18373
+ * (`'Hello {{customer.name}}'`).
18374
+ */
18375
+ /** A condition on a value: `field op value` (all conditions of a list must hold). */
18376
+ export declare interface NiceNoCodeCondition {
18377
+ /** A path into the row (or, outside a row step, into the variables). */
18378
+ field: string;
18379
+ op: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'empty' | 'notEmpty';
18380
+ /** An expression. Not used by `empty` / `notEmpty`. */
18381
+ value?: string;
18382
+ }
18383
+
18384
+ /** How a script reaches the host's data. */
18385
+ export declare interface NiceNoCodeIo {
18386
+ read(source: string): Promise<ReadonlyArray<Record<string, unknown>>>;
18387
+ write?(target: string, rows: ReadonlyArray<Record<string, unknown>>, mode: 'insert' | 'update' | 'upsert' | 'delete'): Promise<void>;
18388
+ callScript?(name: string, args: Record<string, unknown>): Promise<unknown>;
18389
+ }
18390
+
18391
+ /** A problem found in a script. */
18392
+ export declare interface NiceNoCodeIssue {
18393
+ stepId?: string;
18394
+ message: string;
18395
+ }
18396
+
18397
+ /** What a run gives back: the returned value, the variables at the end, the steps it went through. */
18398
+ export declare interface NiceNoCodeRunResult {
18399
+ value: unknown;
18400
+ variables: Record<string, unknown>;
18401
+ /** Step ids in the order they ran (a loop's steps once per row). */
18402
+ trace: string[];
18403
+ }
18404
+
18405
+ /** A no-code script: its parameters and its steps. */
18406
+ export declare interface NiceNoCodeScript {
18407
+ parameters?: Array<{
18408
+ name: string;
18409
+ type?: string;
18410
+ description?: string;
18411
+ }>;
18412
+ steps: NiceNoCodeStep[];
18413
+ }
18414
+
18415
+ /**
18416
+ * {@link NiceNoCodeScriptEditor} — the steps of a no-code script, nested, with the picked step's
18417
+ * settings beside them and the script's problems marked.
18418
+ */
18419
+ export declare const NiceNoCodeScriptEditor: default_2.FC<NiceNoCodeScriptEditorProps>;
18420
+
18421
+ /** Props for the {@link NiceNoCodeScriptEditor} component. */
18422
+ export declare interface NiceNoCodeScriptEditorProps extends NiceBaseProps {
18423
+ /** The script — **controlled**. Omit it to let the editor keep its own copy. */
18424
+ value?: NiceNoCodeScript;
18425
+ /** The script at first in the uncontrolled mode. Default: no steps. */
18426
+ defaultValue?: NiceNoCodeScript;
18427
+ onChange?: (script: NiceNoCodeScript) => void;
18428
+ /** Data source keys offered by `read` and `write` steps. */
18429
+ dataSources?: string[];
18430
+ /** Script names offered by `callScript` steps. */
18431
+ scripts?: string[];
18432
+ /** The host's data: with it a Run button runs the script and shows its result. */
18433
+ io?: NiceNoCodeIo;
18434
+ readOnly?: boolean;
18435
+ }
18436
+
18437
+ /** One step of a no-code script. Each has an `id`, unique in the script. */
18438
+ export declare type NiceNoCodeStep = {
18439
+ id: string;
18440
+ type: 'read';
18441
+ /** The data source's key. */
18442
+ source: string;
18443
+ where?: NiceNoCodeCondition[];
18444
+ /** The variable the rows go to. */
18445
+ into: string;
18446
+ } | {
18447
+ id: string;
18448
+ type: 'filter';
18449
+ from: string;
18450
+ where: NiceNoCodeCondition[];
18451
+ into: string;
18452
+ } | {
18453
+ id: string;
18454
+ type: 'map';
18455
+ from: string;
18456
+ /** Each target field and its expression over the row. */
18457
+ fields: Array<{
18458
+ target: string;
18459
+ expression: string;
18460
+ }>;
18461
+ into: string;
18462
+ } | {
18463
+ id: string;
18464
+ type: 'aggregate';
18465
+ from: string;
18466
+ groupBy?: string[];
18467
+ measures: Array<{
18468
+ name: string;
18469
+ op: 'count' | 'sum' | 'avg' | 'min' | 'max';
18470
+ field?: string;
18471
+ }>;
18472
+ into: string;
18473
+ } | {
18474
+ id: string;
18475
+ type: 'set';
18476
+ variable: string;
18477
+ expression: string;
18478
+ } | {
18479
+ id: string;
18480
+ type: 'if';
18481
+ when: NiceNoCodeCondition[];
18482
+ then: NiceNoCodeStep[];
18483
+ else?: NiceNoCodeStep[];
18484
+ } | {
18485
+ id: string;
18486
+ type: 'forEach';
18487
+ from: string;
18488
+ as: string;
18489
+ steps: NiceNoCodeStep[];
18490
+ } | {
18491
+ id: string;
18492
+ type: 'write';
18493
+ /** The data source or entity written to. */
18494
+ target: string;
18495
+ from: string;
18496
+ mode?: 'insert' | 'update' | 'upsert' | 'delete';
18497
+ } | {
18498
+ id: string;
18499
+ type: 'callScript';
18500
+ script: string;
18501
+ /** Argument name → expression. */
18502
+ args?: Record<string, string>;
18503
+ into?: string;
18504
+ } | {
18505
+ id: string;
18506
+ type: 'return';
18507
+ expression: string;
18508
+ };
18509
+
18139
18510
  export declare interface NiceNotificationCategory {
18140
18511
  id: string;
18141
18512
  name: string;
@@ -18562,6 +18933,22 @@ export declare interface NiceOTPInputProps extends Omit<NiceStandardProps, 'erro
18562
18933
 
18563
18934
  export declare type NiceOTPInputType = 'number' | 'text';
18564
18935
 
18936
+ /** A column of the result. */
18937
+ export declare interface NiceOutputColumn {
18938
+ /** `t:<tableId>:<column>` or `c:<computedId>`. */
18939
+ key: string;
18940
+ tableId?: string;
18941
+ column?: string;
18942
+ computedId?: string;
18943
+ /** Its name in the result (unique within its nested part). */
18944
+ name: string;
18945
+ dataType?: string;
18946
+ aggregate?: AggregateFunction_2;
18947
+ /** The nested part it is in (see {@link nestPathOf}). */
18948
+ path: string[];
18949
+ order: number;
18950
+ }
18951
+
18565
18952
  /**
18566
18953
  * NicePageBuilder - Drag-drop page builder with responsive layouts
18567
18954
  *
@@ -19608,6 +19995,80 @@ export declare interface NiceQRCodeProps extends NiceStandardProps {
19608
19995
  /** Reed-Solomon error correction level for QR codes. */
19609
19996
  export declare type NiceQRErrorCorrection = 'L' | 'M' | 'Q' | 'H';
19610
19997
 
19998
+ /** A column worked out with a function. */
19999
+ export declare interface NiceQueryComputed {
20000
+ id: string;
20001
+ alias: string;
20002
+ fn: NiceSqlFunctionId;
20003
+ args: NiceQueryOperand[];
20004
+ selected: boolean;
20005
+ aggregate?: AggregateFunction_2;
20006
+ order?: number;
20007
+ }
20008
+
20009
+ /**
20010
+ * The data source designer: browse, pick, join, filter, total and shape — the SQL is written for
20011
+ * you, for the database you choose.
20012
+ */
20013
+ export declare function NiceQueryDesigner({ value, defaultValue, onChange, schemas, extraSchemas, sources, dialects, onPreview, readOnly, height, className, style, id, 'data-testid': dataTestId, }: NiceQueryDesignerProps): default_2.ReactElement;
20014
+
20015
+ /** Props for the {@link NiceQueryDesigner} component. */
20016
+ export declare interface NiceQueryDesignerProps extends NiceBaseProps {
20017
+ /** The data source — **controlled**. Omit it to let the designer keep its own copy. */
20018
+ value?: NiceDataSourceDef;
20019
+ /** The data source at first in the uncontrolled mode. Default: an empty query. */
20020
+ defaultValue?: NiceDataSourceDef;
20021
+ /** Called on every change, with the SQL written again for its database. */
20022
+ onChange?: (def: NiceDataSourceDef) => void;
20023
+ /** The tables of the module (or of the connected database). */
20024
+ schemas?: NiceDataSourceSchemaTable[];
20025
+ /** Tables of the modules this one depends on — `schema`: the module; joined like its own. */
20026
+ extraSchemas?: NiceDataSourceSchemaTable[];
20027
+ /** The module's other data sources: tables a query can read and join. */
20028
+ sources?: NiceModuleDataSource[];
20029
+ /** The databases offered. Default: all five. */
20030
+ dialects?: NiceSqlDialect[];
20031
+ /** Runs the source with parameter values: with it, the Preview tab shows its rows. */
20032
+ onPreview?: (def: NiceDataSourceDef, params: Record<string, string>) => Promise<ReadonlyArray<Record<string, unknown>>>;
20033
+ readOnly?: boolean;
20034
+ /** Height of the designer. Default `640`. */
20035
+ height?: number | string;
20036
+ }
20037
+
20038
+ /** Rules and groups joined by AND or OR — `not` turns the group round. */
20039
+ export declare interface NiceQueryFilterGroup {
20040
+ kind: 'group';
20041
+ id: string;
20042
+ logic: 'AND' | 'OR';
20043
+ not?: boolean;
20044
+ items: NiceQueryFilterNode[];
20045
+ }
20046
+
20047
+ export declare type NiceQueryFilterNode = NiceQueryFilterRule | NiceQueryFilterGroup;
20048
+
20049
+ /** One comparison of a filter. */
20050
+ export declare interface NiceQueryFilterRule {
20051
+ kind: 'rule';
20052
+ id: string;
20053
+ left: NiceQueryOperand;
20054
+ operator: NiceQueryOperator;
20055
+ right?: NiceQueryOperand;
20056
+ /** The upper bound of `between`. */
20057
+ right2?: NiceQueryOperand;
20058
+ }
20059
+
20060
+ /** The query of one nested list of a plan. */
20061
+ export declare interface NiceQueryListPlan {
20062
+ /** Where the list goes in its parent's row (`['Lines']`, `['Customer', 'Addresses']`). */
20063
+ path: string[];
20064
+ /** The column of the parent's row its key is in. */
20065
+ parentKey: string;
20066
+ /** Reads the children of the keys given as `parentKeys`; their parent's key is in `__parent`. */
20067
+ sql: string;
20068
+ columns: NiceOutputColumn[];
20069
+ lists: NiceQueryListPlan[];
20070
+ }
20071
+
19611
20072
  /** The visual query model owned by the builder. */
19612
20073
  export declare interface NiceQueryModel {
19613
20074
  tables: QueryTable[];
@@ -19618,6 +20079,62 @@ export declare interface NiceQueryModel {
19618
20079
  distinct: boolean;
19619
20080
  limit?: number;
19620
20081
  offset?: number;
20082
+ /** The WHERE as a tree of groups and rules (1.4.7); when present it replaces `conditions`. */
20083
+ filter?: NiceQueryFilterGroup;
20084
+ /** Conditions on the totals of a grouped query — HAVING (1.4.7). */
20085
+ having?: NiceQueryFilterGroup;
20086
+ /** Columns worked out with a function (1.4.7). */
20087
+ computed?: NiceQueryComputed[];
20088
+ }
20089
+
20090
+ /** A side of a rule, an argument of a function. */
20091
+ export declare type NiceQueryOperand = {
20092
+ kind: 'column';
20093
+ tableId: string;
20094
+ column: string;
20095
+ aggregate?: AggregateFunction_2;
20096
+ } | {
20097
+ kind: 'computed';
20098
+ id: string;
20099
+ } | {
20100
+ kind: 'value';
20101
+ value: string;
20102
+ } | {
20103
+ kind: 'values';
20104
+ values: string[];
20105
+ } | {
20106
+ kind: 'parameter';
20107
+ name: string;
20108
+ };
20109
+
20110
+ /** A comparison, in words a layman picks ("contains", "in the last … days"). */
20111
+ export declare type NiceQueryOperator = 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'in' | 'notIn' | 'between' | 'isEmpty' | 'isNotEmpty' | 'isTrue' | 'isFalse' | 'today' | 'lastDays' | 'nextDays' | 'thisMonth' | 'thisYear';
20112
+
20113
+ /** What an operator needs on its right, and the values it fits. */
20114
+ export declare interface NiceQueryOperatorDef {
20115
+ id: NiceQueryOperator;
20116
+ /** `none`, one value, two (between), a list, a number of days. */
20117
+ takes: 'none' | 'one' | 'two' | 'list' | 'days';
20118
+ fits: readonly NiceValueType[];
20119
+ }
20120
+
20121
+ /** A query as SQL: the main query and the queries of its nested lists. */
20122
+ export declare interface NiceQueryPlan {
20123
+ sql: string;
20124
+ /** The parameters the SQL takes (`parentKeys` of the lists aside). */
20125
+ parameters: string[];
20126
+ columns: NiceOutputColumn[];
20127
+ lists: NiceQueryListPlan[];
20128
+ }
20129
+
20130
+ /** How to write the SQL. */
20131
+ export declare interface NiceQuerySqlOptions {
20132
+ /** Default `postgresql`. */
20133
+ dialect?: NiceSqlDialect;
20134
+ /** `object` reads one record; `flat` puts every joined table in the row. Default `list`. */
20135
+ shape?: NiceDataSourceShape;
20136
+ /** The SQL of the module's other sources, by key: a table of schema `source` reads it. */
20137
+ sources?: Readonly<Record<string, string>>;
19621
20138
  }
19622
20139
 
19623
20140
  /**
@@ -20248,6 +20765,17 @@ export declare interface NiceRegistryEntry {
20248
20765
  icon?: string;
20249
20766
  }
20250
20767
 
20768
+ /** A table related to one of the query's tables, by a foreign key either way. */
20769
+ export declare interface NiceRelatedTable {
20770
+ fromTableId: string;
20771
+ table: NiceDataSourceSchemaTable;
20772
+ /** The join that brings it in (its right table: the related one, added). */
20773
+ fromColumn: string;
20774
+ toColumn: string;
20775
+ /** `out`: the query's table points at it (many-to-one); `in`: it points at the query's table. */
20776
+ direction: 'out' | 'in';
20777
+ }
20778
+
20251
20779
  export declare const NiceReportBuilder: default_2.FC<ReportBuilderProps>;
20252
20780
 
20253
20781
  export { NiceRequestDeduplicator }
@@ -22518,6 +23046,33 @@ export declare interface NiceSpreadsheetSheet {
22518
23046
  columnFilters?: Record<number, string>;
22519
23047
  }
22520
23048
 
23049
+ /** SQL text run in the module's database (a view the installer creates, or a query). */
23050
+ export declare interface NiceSqlDataSourceDef extends NiceModuleDataSourceBase {
23051
+ kind: 'sql';
23052
+ /** `postgresql`, `sqlserver`, `mysql`, `sqlite` — or none for portable SQL. */
23053
+ dialect?: string;
23054
+ sql: string;
23055
+ parameters?: NiceDataSourceParameter[];
23056
+ /** The columns the SQL returns (so views and other sources can bind to them before a run). */
23057
+ columns?: NiceDataSourceColumn[];
23058
+ }
23059
+
23060
+ /** The databases the designer writes SQL for. */
23061
+ export declare type NiceSqlDialect = 'postgresql' | 'sqlserver' | 'mysql' | 'sqlite' | 'oracle';
23062
+
23063
+ export declare interface NiceSqlFunctionDef {
23064
+ id: NiceSqlFunctionId;
23065
+ group: 'text' | 'number' | 'date' | 'other';
23066
+ /** The arguments, by what they hold. */
23067
+ args: readonly NiceValueType[];
23068
+ /** More arguments of the last type may follow (concat, coalesce). */
23069
+ variadic?: boolean;
23070
+ result: NiceValueType;
23071
+ }
23072
+
23073
+ /** The functions a computed column offers, in groups a layman finds them in. */
23074
+ export declare type NiceSqlFunctionId = 'upper' | 'lower' | 'trim' | 'concat' | 'left' | 'length' | 'replace' | 'round' | 'abs' | 'floor' | 'ceil' | 'add' | 'subtract' | 'multiply' | 'divide' | 'year' | 'month' | 'day' | 'date' | 'daysBetween' | 'now' | 'coalesce';
23075
+
22521
23076
  export { NiceSqlWhere }
22522
23077
 
22523
23078
  export { NiceSSEConfig }
@@ -22603,6 +23158,13 @@ export { NiceStateIO }
22603
23158
 
22604
23159
  export { NiceStateSnapshot }
22605
23160
 
23161
+ /** Fixed rows kept in the module (choices, a lookup table). */
23162
+ export declare interface NiceStaticDataSourceDef extends NiceModuleDataSourceBase {
23163
+ kind: 'static';
23164
+ columns?: NiceDataSourceColumn[];
23165
+ rows: Array<Record<string, unknown>>;
23166
+ }
23167
+
22606
23168
  /**
22607
23169
  * Renders a single KPI tile: title, big value with optional pre/suffix,
22608
23170
  * and an arrow-coloured trend chip. Locale-aware number formatting via
@@ -25054,6 +25616,15 @@ export declare interface NiceUndoProviderProps<T = unknown> {
25054
25616
  maxHistory?: number;
25055
25617
  }
25056
25618
 
25619
+ /** The rows of other sources, one after another. */
25620
+ export declare interface NiceUnionDataSourceDef extends NiceModuleDataSourceBase {
25621
+ kind: 'union';
25622
+ /** The keys of the sources, in order. */
25623
+ sources: string[];
25624
+ /** Drop rows that repeat (SQL `UNION` rather than `UNION ALL`). */
25625
+ distinct?: boolean;
25626
+ }
25627
+
25057
25628
  export declare const NiceUpdatePrompt: default_2.ForwardRefExoticComponent<NiceUpdatePromptProps & default_2.RefAttributes<HTMLDivElement>> & {
25058
25629
  displayName: string;
25059
25630
  };
@@ -25318,6 +25889,9 @@ export declare interface NiceValidatorProps extends NiceBaseProps {
25318
25889
  validateOnChange?: boolean;
25319
25890
  }
25320
25891
 
25892
+ /** What a value is, for the operators and functions that fit it. */
25893
+ export declare type NiceValueType = 'text' | 'number' | 'date' | 'boolean' | 'any';
25894
+
25321
25895
  export { NiceVariant }
25322
25896
 
25323
25897
  export declare const NiceVectorMap: default_2.FC<NiceVectorMapProps>;
@@ -26442,6 +27016,12 @@ declare interface NiceXLSXOptions extends NiceExportOptions {
26442
27016
  }>;
26443
27017
  }
26444
27018
 
27019
+ /** Whether every condition holds for `row` (its fields), with `scope` for the values' expressions. */
27020
+ export declare function noCodeConditionsHold(conditions: readonly NiceNoCodeCondition[] | undefined, row: Record<string, unknown>, scope: Record<string, unknown>): boolean;
27021
+
27022
+ /** The value at a dotted path (`order.lines.length`), or undefined. */
27023
+ export declare function noCodePath(scope: Record<string, unknown>, path: string): unknown;
27024
+
26445
27025
  /**
26446
27026
  * Node shape types
26447
27027
  */
@@ -26598,9 +27178,18 @@ export declare interface OpenAPISpec {
26598
27178
  };
26599
27179
  }
26600
27180
 
27181
+ /** The operators that fit a value. */
27182
+ export declare function operatorsFor(type: NiceValueType): NiceQueryOperatorDef[];
27183
+
26601
27184
  /** Moves the node with `id` out of its parent, right after it; a root stays. */
26602
27185
  export declare function outdentTreeNode<T>(tree: readonly T[], id: string, options?: TreeEditOptions): T[];
26603
27186
 
27187
+ /**
27188
+ * The columns of the result, in order: picked table columns and computed ones. A name taken twice
27189
+ * in the same part gets its table's handle in front (`Customer_Name`).
27190
+ */
27191
+ export declare function outputColumns(model: NiceQueryModel): NiceOutputColumn[];
27192
+
26604
27193
  /** Overlay position */
26605
27194
  export declare type OverlayPosition = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
26606
27195
 
@@ -26693,6 +27282,12 @@ declare interface ParamDefinition {
26693
27282
  validation?: ValidationRule_2[];
26694
27283
  }
26695
27284
 
27285
+ /** The column a list's rows carry their parent's key in. */
27286
+ export declare const PARENT_KEY_COLUMN = "__parent";
27287
+
27288
+ /** The name of the parameter a list's query reads its parent keys from. */
27289
+ export declare const PARENT_KEYS_PARAMETER = "parentKeys";
27290
+
26696
27291
  /** Parse CLI argv for adapter generation */
26697
27292
  export declare function parseAdapterCLIArgs(argv: string[]): AdapterCLIArgs;
26698
27293
 
@@ -26816,6 +27411,9 @@ export declare interface Person {
26816
27411
  metadata?: Record<string, any>;
26817
27412
  }
26818
27413
 
27414
+ /** The query with columns picked in bulk — of one table, or of every table when none is given. */
27415
+ export declare function pickColumns(model: NiceQueryModel, pick: NiceColumnPick, tableId?: string): NiceQueryModel;
27416
+
26819
27417
  export { PinchGesture }
26820
27418
 
26821
27419
  declare interface Pipeline {
@@ -26977,6 +27575,12 @@ declare interface PlacedComponent {
26977
27575
  props: Record<string, unknown>;
26978
27576
  }
26979
27577
 
27578
+ /** A query as SQL: the main query and one query per nested list. */
27579
+ export declare function planQuerySql(model: NiceQueryModel, options?: NiceQuerySqlOptions): NiceQueryPlan;
27580
+
27581
+ /** A plan's SQL in one text: the main query, then each list's under a comment naming it. */
27582
+ export declare function planSqlText(plan: NiceQueryPlan): string;
27583
+
26980
27584
  /** Platform connection config */
26981
27585
  export declare interface PlatformConnection {
26982
27586
  id: string;
@@ -27216,6 +27820,8 @@ declare interface QueryColumn {
27216
27820
  selected: boolean;
27217
27821
  alias?: string;
27218
27822
  aggregate?: AggregateFunction_2;
27823
+ /** Its place among the output columns (1.4.7; default: table by table, as listed). */
27824
+ order?: number;
27219
27825
  }
27220
27826
 
27221
27827
  declare interface QueryCondition {
@@ -27232,6 +27838,8 @@ declare interface QueryCondition {
27232
27838
  declare interface QueryGroupBy {
27233
27839
  tableId: string;
27234
27840
  column: string;
27841
+ /** Group a date by its year, quarter, month or day (1.4.7). */
27842
+ datePart?: 'year' | 'quarter' | 'month' | 'day';
27235
27843
  }
27236
27844
 
27237
27845
  declare interface QueryJoin {
@@ -27241,8 +27849,23 @@ declare interface QueryJoin {
27241
27849
  leftColumn: string;
27242
27850
  rightTableId: string;
27243
27851
  rightColumn: string;
27852
+ /** More column pairs the rows match on (1.4.7, the data source designer). */
27853
+ pairs?: Array<{
27854
+ leftColumn: string;
27855
+ rightColumn: string;
27856
+ }>;
27857
+ /**
27858
+ * How the right table appears in the result (1.4.7): its columns in the row (`flat`, default),
27859
+ * one nested object (`object` — many-to-one), or a nested list (`list` — one-to-many).
27860
+ */
27861
+ nest?: 'flat' | 'object' | 'list';
27862
+ /** The property a nested table is put under (default: its alias or name). */
27863
+ as?: string;
27244
27864
  }
27245
27865
 
27866
+ /** The parameters a query uses: in its filter, its HAVING and its computed columns. */
27867
+ export declare function queryParameterNames(model: NiceQueryModel): string[];
27868
+
27246
27869
  declare interface QuerySort {
27247
27870
  id: string;
27248
27871
  tableId: string;
@@ -27284,6 +27907,12 @@ declare interface QuickFilter<T = any> {
27284
27907
  color?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'secondary';
27285
27908
  }
27286
27909
 
27910
+ /**
27911
+ * A name as the database writes it — always quoted: PostgreSQL folds an unquoted `AgroWindow` to
27912
+ * `agrowindow` (OmniVerk creates its tables quoted), and `Order`, `User`, `Group` are reserved.
27913
+ */
27914
+ export declare function quoteSqlName(name: string, dialect?: NiceSqlDialect): string;
27915
+
27287
27916
  export { RADIUS_VALUES }
27288
27917
 
27289
27918
  export { RadiusVariant }
@@ -27568,6 +28197,9 @@ declare interface ReferenceLine {
27568
28197
  dashArray?: string;
27569
28198
  }
27570
28199
 
28200
+ /** Tables a foreign key relates to a table of the query — what "Add related" offers. */
28201
+ export declare function relatedTables(model: NiceQueryModel, tableId: string, schemas: readonly NiceDataSourceSchemaTable[]): NiceRelatedTable[];
28202
+
27571
28203
  /**
27572
28204
  * Takes out the pages `pageIds` (also ones the catalog no longer has). A page with items below it
27573
28205
  * stays as their group; groups recreated from the catalog that are left empty go too.
@@ -27580,6 +28212,9 @@ export declare function removeRole(roles: readonly NiceRoleDef[], users: readonl
27580
28212
  users: NiceRoleUser[];
27581
28213
  };
27582
28214
 
28215
+ /** The query without a table, its joins, its sorts, groups and the rules that read it. */
28216
+ export declare function removeTable(model: NiceQueryModel, tableId: string): NiceQueryModel;
28217
+
27583
28218
  export { removeTheme }
27584
28219
 
27585
28220
  /** Removes the node with `id` and its subtree. */
@@ -27810,8 +28445,13 @@ export declare function roleInheritanceCycles(roles: readonly NiceRoleDef[]): st
27810
28445
 
27811
28446
  export declare type RoomGridLayout = 'grid' | 'list';
27812
28447
 
28448
+ /** The table a query starts FROM: the first one no join brings in. */
28449
+ export declare function rootTableId(model: NiceQueryModel): string | undefined;
28450
+
27813
28451
  export { RovingFocusControls }
27814
28452
 
28453
+ declare type Row = Record<string, unknown>;
28454
+
27815
28455
  /**
27816
28456
  * Row render context.
27817
28457
  */
@@ -27965,6 +28605,14 @@ export declare function runCLI(argv: string[]): Promise<string>;
27965
28605
  */
27966
28606
  export declare function runContractTests(contracts: NiceApiContract[], config: NiceContractTestConfig): Promise<NiceContractReport>;
27967
28607
 
28608
+ /**
28609
+ * Runs a script: its steps in order over `variables` (the arguments), reading and writing through
28610
+ * `io`. Stops at a `return` step (its value is the result) or after `maxSteps` (a loop gone wrong).
28611
+ */
28612
+ export declare function runNoCodeScript(script: NiceNoCodeScript, io: NiceNoCodeIo, args?: Record<string, unknown>, options?: {
28613
+ maxSteps?: number;
28614
+ }): Promise<NiceNoCodeRunResult>;
28615
+
27968
28616
  declare type RunStatus = 'queued' | 'in_progress' | 'completed' | 'failed' | 'cancelled' | 'waiting' | 'skipped';
27969
28617
 
27970
28618
  export { SafeAreaInsets }
@@ -29132,6 +29780,15 @@ export declare interface SpriteSheetSettings {
29132
29780
  quality: number;
29133
29781
  }
29134
29782
 
29783
+ /**
29784
+ * The data sources every table has without anyone writing them (1.4.7): all its rows
29785
+ * (`{Entity}All`, every column) and one row by its key (`{Entity}ById`, WHERE Id = @id, one
29786
+ * record). Shown beside a module's own sources, not edited — duplicated to start one.
29787
+ */
29788
+ export declare function standardDataSources(tables: readonly NiceDataSourceSchemaTable[], options?: {
29789
+ dialect?: NiceSqlDialect;
29790
+ }): NiceDataSourceDef[];
29791
+
29135
29792
  export declare interface StandardEntity {
29136
29793
  id: string;
29137
29794
  name: string;
@@ -29189,6 +29846,8 @@ declare interface StateSlice {
29189
29846
  computed?: ComputedField[];
29190
29847
  }
29191
29848
 
29849
+ declare type StepType = NiceNoCodeStep['type'];
29850
+
29192
29851
  export { StorageAdapter }
29193
29852
 
29194
29853
  export { StorageAuditResult }
@@ -29401,6 +30060,12 @@ declare interface SuggestionFactor {
29401
30060
  entryValue?: string;
29402
30061
  }
29403
30062
 
30063
+ /**
30064
+ * Joins the query lacks between its tables: a column whose foreign key points at another table of
30065
+ * the query, or named after it (`CustomerId` and `Customer.Id`). Each pair once.
30066
+ */
30067
+ export declare function suggestJoins(model: NiceQueryModel, schemas: readonly NiceDataSourceSchemaTable[]): NiceJoinSuggestion[];
30068
+
29404
30069
  /** Swap event types. */
29405
30070
  export declare type SwapEventType = 'swap-start' | 'swap-success' | 'swap-error' | 'swap-rollback';
29406
30071
 
@@ -30531,6 +31196,9 @@ export declare interface UndoEntry<T = unknown> {
30531
31196
  groupId?: string;
30532
31197
  }
30533
31198
 
31199
+ /** The node of a filter tree with an id, its group, and the tree with a node replaced. */
31200
+ export declare function updateFilterNode(group: NiceQueryFilterGroup, id: string, fn: (node: NiceQueryFilterNode) => NiceQueryFilterNode | null): NiceQueryFilterGroup;
31201
+
30534
31202
  /** Update operation types */
30535
31203
  export declare type UpdateOperation = 'insert' | 'update' | 'delete' | 'upsert';
30536
31204
 
@@ -31495,6 +32163,9 @@ export declare function validateDoc(doc: unknown): string[];
31495
32163
  /** Validate a module manifest and return error messages. */
31496
32164
  export declare function validateModuleManifest(m: NiceModuleManifest): string[];
31497
32165
 
32166
+ /** The script's problems: missing names, duplicate ids, expressions that do not parse. */
32167
+ export declare function validateNoCodeScript(script: NiceNoCodeScript): NiceNoCodeIssue[];
32168
+
31498
32169
  /** Validate an RBAC policy for structural issues. */
31499
32170
  export declare function validateRbacPolicy(policy: NiceRbacPolicy): string[];
31500
32171
 
@@ -31541,6 +32212,9 @@ export { ValidationSeverity }
31541
32212
 
31542
32213
  declare type ValidationType = 'required' | 'type' | 'min' | 'max' | 'pattern' | 'enum' | 'custom';
31543
32214
 
32215
+ /** What a column's data type holds. */
32216
+ export declare function valueTypeOf(dataType: string | undefined): NiceValueType;
32217
+
31544
32218
  export { VARIANT_PRESETS }
31545
32219
 
31546
32220
  /** Author/User information */