@gzl10/nexus-sdk 0.16.8 → 0.18.0
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/dist/{chunk-E7K3RKDO.js → chunk-WHLUKKQO.js} +43 -42
- package/dist/collection/index.d.ts +2 -2
- package/dist/collection/index.js +1 -1
- package/dist/{entity-Bwf8yboo.d.ts → entity-B5WrLI1H.d.ts} +102 -4
- package/dist/{field-KvvQ9oHe.d.ts → field-Bs1fIux8.d.ts} +15 -2
- package/dist/fields/index.d.ts +44 -44
- package/dist/fields/index.js +1 -1
- package/dist/index.d.ts +16 -9
- package/dist/index.js +14 -2
- package/package.json +1 -1
|
@@ -95,10 +95,10 @@ function useTextField(config) {
|
|
|
95
95
|
validation,
|
|
96
96
|
meta,
|
|
97
97
|
...overrides
|
|
98
|
-
} = config;
|
|
98
|
+
} = config ?? {};
|
|
99
99
|
const min = minLength ?? (required ? 1 : 0);
|
|
100
100
|
return {
|
|
101
|
-
label,
|
|
101
|
+
label: label ?? { en: "Text", es: "Texto" },
|
|
102
102
|
input: "text",
|
|
103
103
|
hint,
|
|
104
104
|
required: required ?? false,
|
|
@@ -136,9 +136,9 @@ function useTextUniqueField(config) {
|
|
|
136
136
|
|
|
137
137
|
// src/fields/color.ts
|
|
138
138
|
function useColorField(config) {
|
|
139
|
-
const { label, hint, defaultValue, placeholder, required, nullable, meta, ...overrides } = config;
|
|
139
|
+
const { label, hint, defaultValue, placeholder, required, nullable, meta, ...overrides } = config ?? {};
|
|
140
140
|
return {
|
|
141
|
-
label,
|
|
141
|
+
label: label ?? { en: "Color", es: "Color" },
|
|
142
142
|
input: "color",
|
|
143
143
|
hint,
|
|
144
144
|
required: required ?? false,
|
|
@@ -188,9 +188,9 @@ function useImageField(config) {
|
|
|
188
188
|
nullable,
|
|
189
189
|
meta,
|
|
190
190
|
...overrides
|
|
191
|
-
} = config;
|
|
191
|
+
} = config ?? {};
|
|
192
192
|
return {
|
|
193
|
-
label,
|
|
193
|
+
label: label ?? { en: "Image", es: "Imagen" },
|
|
194
194
|
input: "image",
|
|
195
195
|
hint,
|
|
196
196
|
required: required ?? false,
|
|
@@ -224,9 +224,9 @@ function useFileField(config) {
|
|
|
224
224
|
nullable,
|
|
225
225
|
meta,
|
|
226
226
|
...overrides
|
|
227
|
-
} = config;
|
|
227
|
+
} = config ?? {};
|
|
228
228
|
return {
|
|
229
|
-
label,
|
|
229
|
+
label: label ?? { en: "File", es: "Archivo" },
|
|
230
230
|
input: "file",
|
|
231
231
|
hint,
|
|
232
232
|
required: required ?? false,
|
|
@@ -262,9 +262,9 @@ function useMultiImageField(config) {
|
|
|
262
262
|
nullable,
|
|
263
263
|
meta,
|
|
264
264
|
...overrides
|
|
265
|
-
} = config;
|
|
265
|
+
} = config ?? {};
|
|
266
266
|
return {
|
|
267
|
-
label,
|
|
267
|
+
label: label ?? { en: "Images", es: "Im\xE1genes" },
|
|
268
268
|
input: "multiimage",
|
|
269
269
|
hint,
|
|
270
270
|
required: required ?? false,
|
|
@@ -301,9 +301,9 @@ function useMultiFileField(config) {
|
|
|
301
301
|
nullable,
|
|
302
302
|
meta,
|
|
303
303
|
...overrides
|
|
304
|
-
} = config;
|
|
304
|
+
} = config ?? {};
|
|
305
305
|
return {
|
|
306
|
-
label,
|
|
306
|
+
label: label ?? { en: "Files", es: "Archivos" },
|
|
307
307
|
input: "multifile",
|
|
308
308
|
hint,
|
|
309
309
|
required: required ?? false,
|
|
@@ -339,9 +339,9 @@ function useUrlField(config) {
|
|
|
339
339
|
placeholder,
|
|
340
340
|
meta,
|
|
341
341
|
...overrides
|
|
342
|
-
} = config;
|
|
342
|
+
} = config ?? {};
|
|
343
343
|
return {
|
|
344
|
-
label,
|
|
344
|
+
label: label ?? { en: "URL", es: "URL" },
|
|
345
345
|
input: "url",
|
|
346
346
|
hint,
|
|
347
347
|
required: required ?? false,
|
|
@@ -372,7 +372,7 @@ function createStaticSelect(config) {
|
|
|
372
372
|
(opt) => typeof opt === "string" ? { value: opt, label: opt } : opt
|
|
373
373
|
);
|
|
374
374
|
return {
|
|
375
|
-
label,
|
|
375
|
+
label: label ?? { en: "Select", es: "Selecci\xF3n" },
|
|
376
376
|
input: "select",
|
|
377
377
|
hint,
|
|
378
378
|
required: required ?? false,
|
|
@@ -412,7 +412,7 @@ function createRelationSelect(config) {
|
|
|
412
412
|
...overrides
|
|
413
413
|
} = config;
|
|
414
414
|
return {
|
|
415
|
-
label,
|
|
415
|
+
label: label ?? { en: "Select", es: "Selecci\xF3n" },
|
|
416
416
|
input: "select",
|
|
417
417
|
hint,
|
|
418
418
|
required: required ?? false,
|
|
@@ -453,7 +453,7 @@ function createMasterSelect(config) {
|
|
|
453
453
|
...overrides
|
|
454
454
|
} = config;
|
|
455
455
|
return {
|
|
456
|
-
label,
|
|
456
|
+
label: label ?? { en: "Select", es: "Selecci\xF3n" },
|
|
457
457
|
input: "select",
|
|
458
458
|
defaultValue,
|
|
459
459
|
hint,
|
|
@@ -487,9 +487,9 @@ function useSelectField(config) {
|
|
|
487
487
|
|
|
488
488
|
// src/fields/textarea.ts
|
|
489
489
|
function useTextareaField(config) {
|
|
490
|
-
const { label, hint, required, nullable, defaultValue, placeholder, meta, ...overrides } = config;
|
|
490
|
+
const { label, hint, required, nullable, defaultValue, placeholder, meta, ...overrides } = config ?? {};
|
|
491
491
|
return {
|
|
492
|
-
label,
|
|
492
|
+
label: label ?? { en: "Text", es: "Texto" },
|
|
493
493
|
input: "textarea",
|
|
494
494
|
hint,
|
|
495
495
|
required: required ?? false,
|
|
@@ -509,9 +509,9 @@ function useTextareaField(config) {
|
|
|
509
509
|
|
|
510
510
|
// src/fields/code.ts
|
|
511
511
|
function useCodeField(config) {
|
|
512
|
-
const { label, hint, required, nullable, defaultValue, language, placeholder, meta, ...overrides } = config;
|
|
512
|
+
const { label, hint, required, nullable, defaultValue, language, placeholder, meta, ...overrides } = config ?? {};
|
|
513
513
|
return {
|
|
514
|
-
label,
|
|
514
|
+
label: label ?? { en: "Code", es: "C\xF3digo" },
|
|
515
515
|
input: "code",
|
|
516
516
|
hint,
|
|
517
517
|
required: required ?? false,
|
|
@@ -529,9 +529,9 @@ function useCodeField(config) {
|
|
|
529
529
|
|
|
530
530
|
// src/fields/json.ts
|
|
531
531
|
function useJsonField(config) {
|
|
532
|
-
const { label, hint, required, nullable, meta, ...overrides } = config;
|
|
532
|
+
const { label, hint, required, nullable, meta, ...overrides } = config ?? {};
|
|
533
533
|
return {
|
|
534
|
-
label,
|
|
534
|
+
label: label ?? { en: "Data", es: "Datos" },
|
|
535
535
|
input: "json",
|
|
536
536
|
hint,
|
|
537
537
|
required: required ?? false,
|
|
@@ -549,9 +549,9 @@ function useJsonField(config) {
|
|
|
549
549
|
|
|
550
550
|
// src/fields/datetime.ts
|
|
551
551
|
function useDatetimeField(config) {
|
|
552
|
-
const { label, hint, required, nullable, meta, ...overrides } = config;
|
|
552
|
+
const { label, hint, required, nullable, meta, ...overrides } = config ?? {};
|
|
553
553
|
return {
|
|
554
|
-
label,
|
|
554
|
+
label: label ?? { en: "Date", es: "Fecha" },
|
|
555
555
|
input: "datetime",
|
|
556
556
|
hint,
|
|
557
557
|
required: required ?? false,
|
|
@@ -568,9 +568,9 @@ function useDatetimeField(config) {
|
|
|
568
568
|
|
|
569
569
|
// src/fields/number.ts
|
|
570
570
|
function useNumberField(config) {
|
|
571
|
-
const { label, hint, required, defaultValue, nullable, validation, meta, ...overrides } = config;
|
|
571
|
+
const { label, hint, required, defaultValue, nullable, validation, meta, ...overrides } = config ?? {};
|
|
572
572
|
return {
|
|
573
|
-
label,
|
|
573
|
+
label: label ?? { en: "Number", es: "N\xFAmero" },
|
|
574
574
|
input: "number",
|
|
575
575
|
hint,
|
|
576
576
|
required: required ?? false,
|
|
@@ -591,9 +591,9 @@ function useNumberField(config) {
|
|
|
591
591
|
|
|
592
592
|
// src/fields/switch.ts
|
|
593
593
|
function useSwitchField(config) {
|
|
594
|
-
const { label, hint, defaultValue = false, meta, ...overrides } = config;
|
|
594
|
+
const { label, hint, defaultValue = false, meta, ...overrides } = config ?? {};
|
|
595
595
|
return {
|
|
596
|
-
label,
|
|
596
|
+
label: label ?? { en: "Switch", es: "Switch" },
|
|
597
597
|
input: "switch",
|
|
598
598
|
hint,
|
|
599
599
|
defaultValue,
|
|
@@ -611,12 +611,13 @@ function useSwitchField(config) {
|
|
|
611
611
|
|
|
612
612
|
// src/fields/localized.ts
|
|
613
613
|
function useLocalizedField(config) {
|
|
614
|
-
const { label, hint, required = true, meta, ...overrides } = config;
|
|
614
|
+
const { label, hint, required = true, meta, ...overrides } = config ?? {};
|
|
615
615
|
return {
|
|
616
|
-
label,
|
|
616
|
+
label: label ?? { en: "Content", es: "Contenido" },
|
|
617
617
|
input: "text",
|
|
618
618
|
hint,
|
|
619
619
|
required,
|
|
620
|
+
defaultValue: {},
|
|
620
621
|
db: {
|
|
621
622
|
type: "json",
|
|
622
623
|
nullable: !required
|
|
@@ -632,9 +633,9 @@ function useLocalizedField(config) {
|
|
|
632
633
|
|
|
633
634
|
// src/fields/icon.ts
|
|
634
635
|
function useIconField(config) {
|
|
635
|
-
const { label, hint, required, size = 100, placeholder, meta, ...overrides } = config;
|
|
636
|
+
const { label, hint, required, size = 100, placeholder, meta, ...overrides } = config ?? {};
|
|
636
637
|
return {
|
|
637
|
-
label,
|
|
638
|
+
label: label ?? { en: "Icon", es: "Icono" },
|
|
638
639
|
input: "icon",
|
|
639
640
|
hint,
|
|
640
641
|
required: required ?? false,
|
|
@@ -653,9 +654,9 @@ function useIconField(config) {
|
|
|
653
654
|
|
|
654
655
|
// src/fields/email.ts
|
|
655
656
|
function useEmailField(config) {
|
|
656
|
-
const { label, hint, required, nullable, unique, placeholder, meta, ...overrides } = config;
|
|
657
|
+
const { label, hint, required, nullable, unique, placeholder, meta, ...overrides } = config ?? {};
|
|
657
658
|
return {
|
|
658
|
-
label,
|
|
659
|
+
label: label ?? { en: "Email", es: "Email" },
|
|
659
660
|
input: "email",
|
|
660
661
|
hint,
|
|
661
662
|
required: required ?? false,
|
|
@@ -679,9 +680,9 @@ function useEmailField(config) {
|
|
|
679
680
|
|
|
680
681
|
// src/fields/checkbox.ts
|
|
681
682
|
function useCheckboxField(config) {
|
|
682
|
-
const { label, hint, defaultValue = false, meta, ...overrides } = config;
|
|
683
|
+
const { label, hint, defaultValue = false, meta, ...overrides } = config ?? {};
|
|
683
684
|
return {
|
|
684
|
-
label,
|
|
685
|
+
label: label ?? { en: "Checkbox", es: "Checkbox" },
|
|
685
686
|
input: "checkbox",
|
|
686
687
|
hint,
|
|
687
688
|
defaultValue,
|
|
@@ -697,9 +698,9 @@ function useCheckboxField(config) {
|
|
|
697
698
|
|
|
698
699
|
// src/fields/password.ts
|
|
699
700
|
function usePasswordField(config) {
|
|
700
|
-
const { label, hint, required, nullable, size = 255, placeholder, validation, meta, ...overrides } = config;
|
|
701
|
+
const { label, hint, required, nullable, size = 255, placeholder, validation, meta, ...overrides } = config ?? {};
|
|
701
702
|
return {
|
|
702
|
-
label,
|
|
703
|
+
label: label ?? { en: "Password", es: "Contrase\xF1a" },
|
|
703
704
|
input: "password",
|
|
704
705
|
hint,
|
|
705
706
|
required: required ?? false,
|
|
@@ -721,9 +722,9 @@ function usePasswordField(config) {
|
|
|
721
722
|
|
|
722
723
|
// src/fields/tags.ts
|
|
723
724
|
function useTagsField(config) {
|
|
724
|
-
const { label, hint, required, nullable, placeholder, validation, options, meta, ...overrides } = config;
|
|
725
|
+
const { label, hint, required, nullable, placeholder, validation, options, meta, ...overrides } = config ?? {};
|
|
725
726
|
return {
|
|
726
|
-
label,
|
|
727
|
+
label: label ?? { en: "Tags", es: "Etiquetas" },
|
|
727
728
|
input: "tags",
|
|
728
729
|
hint,
|
|
729
730
|
required: required ?? false,
|
|
@@ -845,7 +846,7 @@ function useEnabledField(config) {
|
|
|
845
846
|
|
|
846
847
|
// src/fields/public.ts
|
|
847
848
|
function usePublicField(config) {
|
|
848
|
-
const { hint, searchable, meta, ...overrides } = config;
|
|
849
|
+
const { hint, searchable, meta, ...overrides } = config ?? { hint: "" };
|
|
849
850
|
return {
|
|
850
851
|
label: { en: "Public", es: "P\xFAblico" },
|
|
851
852
|
input: "switch",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LocalizedString, b as FieldDefinition } from '../field-
|
|
2
|
-
import {
|
|
1
|
+
import { L as LocalizedString, b as FieldDefinition } from '../field-Bs1fIux8.js';
|
|
2
|
+
import { d as CollectionEntityDefinition, f as DagEntityDefinition, e as EventEntityDefinition, aK as RolePermission } from '../entity-B5WrLI1H.js';
|
|
3
3
|
import 'knex';
|
|
4
4
|
import 'express';
|
|
5
5
|
import 'pino';
|
package/dist/collection/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Knex } from 'knex';
|
|
2
2
|
import { Request, Router, RequestHandler, Response } from 'express';
|
|
3
|
-
import { L as LocalizedString, b as FieldDefinition, E as EntityIndex, F as FieldCondition } from './field-
|
|
3
|
+
import { L as LocalizedString, b as FieldDefinition, j as LocaleConfig, E as EntityIndex, F as FieldCondition } from './field-Bs1fIux8.js';
|
|
4
4
|
import { Logger } from 'pino';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1106,6 +1106,8 @@ interface PluginManifest {
|
|
|
1106
1106
|
icon?: string;
|
|
1107
1107
|
/** Absolute path to plugin image file. Auto-detected from image.png if present. */
|
|
1108
1108
|
image?: string;
|
|
1109
|
+
/** LLM-oriented documentation. Auto-detected from llms.txt if present. */
|
|
1110
|
+
llms?: string;
|
|
1109
1111
|
/** Category for sidebar grouping */
|
|
1110
1112
|
category: Category;
|
|
1111
1113
|
/** Plugin version following SemVer */
|
|
@@ -1383,6 +1385,8 @@ interface DbContext {
|
|
|
1383
1385
|
getPagination: (query?: EntityQuery) => PaginationParamsWithOffset;
|
|
1384
1386
|
buildPaginatedResult: <T>(items: T[], total: number, pagination: PaginationParamsWithOffset) => PaginatedResult<T>;
|
|
1385
1387
|
getKnex: (adapter?: string) => Knex;
|
|
1388
|
+
/** Run full seed for a module (manifest seed + entity auto-seed). Injected from db layer. */
|
|
1389
|
+
seedModule: (mod: ModuleManifest) => Promise<boolean>;
|
|
1386
1390
|
}
|
|
1387
1391
|
/**
|
|
1388
1392
|
* Runtime namespace.
|
|
@@ -1473,6 +1477,8 @@ interface ModuleContext {
|
|
|
1473
1477
|
/** Semantic event API for cross-module communication (notify/query/command). */
|
|
1474
1478
|
events: ContextEvents;
|
|
1475
1479
|
createRouter: () => Router;
|
|
1480
|
+
/** Supported locales for the platform */
|
|
1481
|
+
locales: LocaleConfig[];
|
|
1476
1482
|
}
|
|
1477
1483
|
/**
|
|
1478
1484
|
* HTTP method for custom routes
|
|
@@ -1517,6 +1523,86 @@ interface CustomRouteDefinition {
|
|
|
1517
1523
|
operationId?: string;
|
|
1518
1524
|
tags?: string[];
|
|
1519
1525
|
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Seed context passed to onSeed hook.
|
|
1528
|
+
* Provides typed helpers for seeding data without direct DB access.
|
|
1529
|
+
*
|
|
1530
|
+
* Note: masters.register() is lazy (data flushed after onSeed completes).
|
|
1531
|
+
* All other methods (roles.add, users.add, plugin().entity().upsert, raw) are eager.
|
|
1532
|
+
*/
|
|
1533
|
+
interface SeedContext {
|
|
1534
|
+
/** Register master reference data. Lazy: flushed after onSeed completes. */
|
|
1535
|
+
masters: {
|
|
1536
|
+
register(type: string, entries: Array<{
|
|
1537
|
+
code: string;
|
|
1538
|
+
label: string | {
|
|
1539
|
+
en?: string;
|
|
1540
|
+
es?: string;
|
|
1541
|
+
[key: string]: string | undefined;
|
|
1542
|
+
};
|
|
1543
|
+
order?: number;
|
|
1544
|
+
is_active?: boolean;
|
|
1545
|
+
metadata?: Record<string, unknown>;
|
|
1546
|
+
}>, options?: {
|
|
1547
|
+
seed?: 'if-empty' | 'always';
|
|
1548
|
+
}): void;
|
|
1549
|
+
};
|
|
1550
|
+
/**
|
|
1551
|
+
* Add roles to the system. Eager: inserts immediately. Idempotent by name.
|
|
1552
|
+
*
|
|
1553
|
+
* Optional `permissions` map assigns CASL abilities to the role.
|
|
1554
|
+
* Keys are subject names (case-insensitive: 'masters' = 'Masters').
|
|
1555
|
+
* Values are action arrays.
|
|
1556
|
+
*
|
|
1557
|
+
* Core subjects: Masters, Users, Roles, Auth, Mail, Storage, System.
|
|
1558
|
+
* Plugin subjects: documented in each plugin's llms.txt.
|
|
1559
|
+
*
|
|
1560
|
+
* @example
|
|
1561
|
+
* ```typescript
|
|
1562
|
+
* await seed.roles.add({
|
|
1563
|
+
* name: 'SALES',
|
|
1564
|
+
* description: { en: 'Sales team' },
|
|
1565
|
+
* permissions: {
|
|
1566
|
+
* 'masters': ['read'],
|
|
1567
|
+
* 'contacts': ['read', 'create', 'update'],
|
|
1568
|
+
* }
|
|
1569
|
+
* })
|
|
1570
|
+
* ```
|
|
1571
|
+
*/
|
|
1572
|
+
roles: {
|
|
1573
|
+
add(role: {
|
|
1574
|
+
name: string;
|
|
1575
|
+
description?: string | {
|
|
1576
|
+
en?: string;
|
|
1577
|
+
es?: string;
|
|
1578
|
+
[key: string]: string | undefined;
|
|
1579
|
+
};
|
|
1580
|
+
is_system?: boolean;
|
|
1581
|
+
/** CASL permissions. Keys: subject (case-insensitive). Values: action arrays. */
|
|
1582
|
+
permissions?: Record<string, Array<'read' | 'create' | 'update' | 'delete' | 'manage' | 'execute'>>;
|
|
1583
|
+
}): Promise<void>;
|
|
1584
|
+
};
|
|
1585
|
+
/** Add users to the system. Eager: inserts immediately. Idempotent by email. */
|
|
1586
|
+
users: {
|
|
1587
|
+
add(user: {
|
|
1588
|
+
email: string;
|
|
1589
|
+
password: string;
|
|
1590
|
+
name?: string;
|
|
1591
|
+
type?: 'human' | 'bot' | 'service';
|
|
1592
|
+
roles?: string[];
|
|
1593
|
+
}): Promise<void>;
|
|
1594
|
+
};
|
|
1595
|
+
/** Access plugin entities for seeding. Resolves table prefix automatically. */
|
|
1596
|
+
plugin(name: string): {
|
|
1597
|
+
entity(name: string): {
|
|
1598
|
+
upsert(data: Record<string, unknown>[], options?: {
|
|
1599
|
+
key?: string;
|
|
1600
|
+
}): Promise<number>;
|
|
1601
|
+
};
|
|
1602
|
+
};
|
|
1603
|
+
/** Raw table insert (escape hatch). Returns number of rows inserted. */
|
|
1604
|
+
raw(table: string, data: Record<string, unknown> | Record<string, unknown>[]): Promise<number>;
|
|
1605
|
+
}
|
|
1520
1606
|
|
|
1521
1607
|
/**
|
|
1522
1608
|
* Entity definition types - discriminated union for all entity types
|
|
@@ -1691,10 +1777,16 @@ interface BaseEntityDefinition {
|
|
|
1691
1777
|
order?: number;
|
|
1692
1778
|
/** UI display mode */
|
|
1693
1779
|
displayMode?: DisplayMode;
|
|
1780
|
+
/** Restrict available display modes. If omitted, auto-detected from entity config. */
|
|
1781
|
+
availableDisplayModes?: DisplayMode[];
|
|
1694
1782
|
/** Field name to group by in board/list/masonry displays */
|
|
1695
1783
|
groupBy?: string;
|
|
1696
1784
|
/** Field name for secondary grouping (collapsible) */
|
|
1697
1785
|
subgroupBy?: string;
|
|
1786
|
+
/** Explicit list of fields eligible for grouping. If omitted, auto-detected from field input types. */
|
|
1787
|
+
groupableFields?: string[];
|
|
1788
|
+
/** Subset of groupableFields where drag between board columns is allowed. Default: all groupable. */
|
|
1789
|
+
columnDragFields?: string[];
|
|
1698
1790
|
/** Date field for calendar start (enables calendar display) */
|
|
1699
1791
|
calendarFrom?: string;
|
|
1700
1792
|
/** Date field for calendar end (range display) */
|
|
@@ -1706,6 +1798,8 @@ interface BaseEntityDefinition {
|
|
|
1706
1798
|
};
|
|
1707
1799
|
/** If true, hides from UI sidebar */
|
|
1708
1800
|
hidden?: boolean;
|
|
1801
|
+
/** If false, HTTP routes are not mounted and entity is excluded from frontend DTO. Service, hooks, and CASL still work. Default: true */
|
|
1802
|
+
expose?: boolean;
|
|
1709
1803
|
/** Middleware applied to all routes */
|
|
1710
1804
|
middleware?: (ctx: ModuleContext) => RequestHandler | RequestHandler[];
|
|
1711
1805
|
/** External adapter name for this entity's data source */
|
|
@@ -1719,7 +1813,7 @@ interface BaseEntityDefinition {
|
|
|
1719
1813
|
* Public type exposing the common properties shared by all entity definition types.
|
|
1720
1814
|
* Use this when writing generic code that works with any entity definition.
|
|
1721
1815
|
*/
|
|
1722
|
-
type SharedEntityProperties = Pick<BaseEntityDefinition, 'table' | 'label' | 'labelPlural' | 'icon' | 'fields' | 'casl' | 'public' | 'routePrefix' | 'order' | 'displayMode' | 'groupBy' | 'subgroupBy' | 'calendarFrom' | 'calendarTo' | 'defaultSort' | 'hidden' | 'middleware' | 'adapter' | 'hooks' | 'realtime'>;
|
|
1816
|
+
type SharedEntityProperties = Pick<BaseEntityDefinition, 'table' | 'label' | 'labelPlural' | 'icon' | 'fields' | 'casl' | 'public' | 'routePrefix' | 'order' | 'displayMode' | 'groupBy' | 'subgroupBy' | 'calendarFrom' | 'calendarTo' | 'defaultSort' | 'hidden' | 'expose' | 'middleware' | 'adapter' | 'hooks' | 'realtime'>;
|
|
1723
1817
|
/**
|
|
1724
1818
|
* Collection entity - the most common entity type with full CRUD operations.
|
|
1725
1819
|
*/
|
|
@@ -1762,7 +1856,7 @@ interface CollectionEntityDefinition extends BaseEntityDefinition {
|
|
|
1762
1856
|
* Singleton entity - stores a single record in the shared single_records table.
|
|
1763
1857
|
* When scopeField is set, operates in scoped mode (multiple records keyed by scope).
|
|
1764
1858
|
*/
|
|
1765
|
-
interface SingleEntityDefinition extends Pick<BaseEntityDefinition, 'label' | 'labelPlural' | 'icon' | 'fields' | 'casl' | 'public' | 'routePrefix' | 'order' | 'hidden' | 'hooks' | 'realtime'> {
|
|
1859
|
+
interface SingleEntityDefinition extends Pick<BaseEntityDefinition, 'label' | 'labelPlural' | 'icon' | 'fields' | 'casl' | 'public' | 'routePrefix' | 'order' | 'hidden' | 'expose' | 'hooks' | 'realtime'> {
|
|
1766
1860
|
type: 'single' | 'config';
|
|
1767
1861
|
/** Unique key in single_records table */
|
|
1768
1862
|
key: string;
|
|
@@ -1905,6 +1999,8 @@ interface ComputedEntityDefinition {
|
|
|
1905
1999
|
order: 'asc' | 'desc';
|
|
1906
2000
|
};
|
|
1907
2001
|
hidden?: boolean;
|
|
2002
|
+
/** If false, HTTP routes are not mounted and entity is excluded from frontend DTO. Service, hooks, and CASL still work. Default: true */
|
|
2003
|
+
expose?: boolean;
|
|
1908
2004
|
/** Real-time mode: 'live' pushes recomputed data to subscribed clients */
|
|
1909
2005
|
realtime?: RealtimeMode;
|
|
1910
2006
|
/** Auto-refresh interval in ms. Frontend polls data at this rate when the entity tab is active. */
|
|
@@ -1929,6 +2025,8 @@ interface ViewEntityDefinition {
|
|
|
1929
2025
|
public?: boolean;
|
|
1930
2026
|
routePrefix?: string;
|
|
1931
2027
|
order?: number;
|
|
2028
|
+
/** If false, HTTP routes are not mounted and entity is excluded from frontend DTO. Service, hooks, and CASL still work. Default: true */
|
|
2029
|
+
expose?: boolean;
|
|
1932
2030
|
/** Tables whose changes trigger live push to subscribed clients. Only used when realtime: 'live'. */
|
|
1933
2031
|
liveOn?: string[];
|
|
1934
2032
|
/** Real-time mode: 'live' pushes data to subscribed clients when liveOn tables change */
|
|
@@ -1951,4 +2049,4 @@ type TempEntityDefinition = Omit<CollectionEntityDefinition, 'type'> & {
|
|
|
1951
2049
|
*/
|
|
1952
2050
|
type EntityDefinition = CollectionEntityDefinition | SingleEntityDefinition | ExternalEntityDefinition | VirtualEntityDefinition | ComputedEntityDefinition | ViewEntityDefinition | ReferenceEntityDefinition | TreeEntityDefinition | DagEntityDefinition | EventEntityDefinition;
|
|
1953
2051
|
|
|
1954
|
-
export { type
|
|
2052
|
+
export { type CreateEntityServiceOptions as $, type ActionDefinition as A, type BaseAuthRequest as B, type ConfirmConfig as C, type DisplayMode as D, type EntityType as E, type CacheStats as F, type CaslAction as G, type CategoryMeta as H, type CollectionEntityService as I, type ComputedEntityService as J, type ConfigContext as K, type ConfigEntityDefinition as L, type ModuleContext as M, type ConfigEntityService as N, type ConfirmationType as O, type PostActionPipeline as P, type ContextCrypto as Q, type RealtimeMode as R, type SingleEntityDefinition as S, type TreeEntityDefinition as T, type ContextEvents as U, type ViewEntityDefinition as V, type ContextEventsHub as W, type ContextHelpers as X, type ContextSocket as Y, type CoreContext as Z, type CoreServices as _, type Category as a, type SendMailResult as a$, type CustomRouteDefinition as a0, DEFAULT_TENANT_ID as a1, type DagEntityService as a2, type DatabaseAdapter as a3, type DbContext as a4, type EngineContext as a5, type EntityAction as a6, type EntityCaslConfig as a7, type EntityChangePayload as a8, type EntityController as a9, type PluginConfigSchema as aA, type PluginEnvVar as aB, type PluginManifest as aC, type PluginSetupInfo as aD, type PostAction as aE, type RateLimitOptions as aF, type ReferenceEntityDefinition as aG, type ReferenceEntityService as aH, type RegisterPluginOptions as aI, type RetentionPolicy as aJ, type RolePermission as aK, type RouteParameterDefinition as aL, type RouteResponseDefinition as aM, type RuntimeContext as aN, type SSEHelper as aO, type SSEOptions as aP, type SSESender as aQ, type SchemaAdapter as aR, type SchemaAlterTableBuilder as aS, type SchemaColumnBuilder as aT, type SchemaColumnInfo as aU, type SchemaForeignKeyBuilder as aV, type SchemaTableBuilder as aW, type ScopedCacheManager as aX, type SeedConfig as aY, type SeedContext as aZ, type SendMailOptions as a_, type EntityHandler as aa, type EntityQuery as ab, type EntityRealtimeEmits as ac, type EntityRealtimeEvents as ad, type EntityServiceHooks as ae, type EventEmitterLike as af, type EventEntityService as ag, type ExternalEntityDefinition as ah, type ExternalEntityService as ai, type FilterOperators as aj, type FilterValue as ak, type ForbiddenErrorConstructor as al, type ForbiddenErrorInstance as am, type HttpMethod as an, type LoggerReporter as ao, type ManagedCache as ap, type ModuleAbilities as aq, type ModuleManifest as ar, type ModuleMiddlewares as as, type ModuleRequirements as at, type PageDefinition as au, type PageType as av, type PaginatedResult as aw, type PaginationParams as ax, type PaginationParamsWithOffset as ay, type PluginConfigField as az, type PageDefinitionDTO as b, type ServicesContext as b0, type SharedEntityProperties as b1, type SingleEntityService as b2, type SocketIOBroadcastOperator as b3, type SocketIOServer as b4, type TempEntityDefinition as b5, type TempEntityService as b6, type TempRetentionPolicy as b7, type TreeEntityService as b8, type TreeNode as b9, type TypedEntityQuery as ba, type ValidateSchemas as bb, type ValidationDetail as bc, type ValidationSchema as bd, type ViewEntityService as be, type VirtualEntityDefinition as bf, type VirtualEntityService as bg, type WidgetDefinition as bh, type WidgetLayout as bi, entityRoom as bj, type ComputedEntityDefinition as c, type CollectionEntityDefinition as d, type EventEntityDefinition as e, type DagEntityDefinition as f, type EntityDefinition as g, type AbilityLike as h, type ActionEntityService as i, type ActionInjection as j, type AdaptersContext as k, type AppManifest as l, type AuthRequest as m, type BaseEntityService as n, type BaseMailService as o, type BaseRolesService as p, type BaseUser as q, type BaseUsersService as r, type BatchLogEntry as s, type BatchProgressEvent as t, type BridgeRule as u, type BridgeTarget as v, CATEGORIES as w, CATEGORY_ORDER as x, type CacheManagerContract as y, type CacheOptions as z };
|
|
@@ -15,6 +15,19 @@
|
|
|
15
15
|
type LocalizedString = string | ({
|
|
16
16
|
en: string;
|
|
17
17
|
} & Record<string, string>);
|
|
18
|
+
/** Configuration for a supported locale */
|
|
19
|
+
interface LocaleConfig {
|
|
20
|
+
/** ISO 639-1 code (e.g. 'en', 'es', 'fr') */
|
|
21
|
+
code: string;
|
|
22
|
+
/** Human-readable label (e.g. 'English', 'Español') */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Is this the fallback locale? Only one should be true. Default: false */
|
|
25
|
+
fallback?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Default supported locales — used when no config is provided */
|
|
28
|
+
declare const DEFAULT_LOCALES: LocaleConfig[];
|
|
29
|
+
/** Get the fallback locale code from a locales array */
|
|
30
|
+
declare function getFallbackLocale(locales: LocaleConfig[]): string;
|
|
18
31
|
/**
|
|
19
32
|
* Auth provider information for dynamic login buttons.
|
|
20
33
|
* Plugins register this info so the UI can render buttons without knowing provider details.
|
|
@@ -63,7 +76,7 @@ interface AuthProviderService {
|
|
|
63
76
|
* @param locale - The target locale (e.g., 'en', 'es')
|
|
64
77
|
* @returns The resolved string for the given locale
|
|
65
78
|
*/
|
|
66
|
-
declare function resolveLocalized(value: LocalizedString | undefined, locale: string): string;
|
|
79
|
+
declare function resolveLocalized(value: LocalizedString | undefined, locale: string, fallback?: string): string;
|
|
67
80
|
/**
|
|
68
81
|
* Gets the appropriate label based on count (pluralization).
|
|
69
82
|
* Returns labelPlural for count !== 1, label otherwise.
|
|
@@ -375,4 +388,4 @@ declare function refOptions(module: string, entityOrLabel?: string, labelField?:
|
|
|
375
388
|
labelField: string;
|
|
376
389
|
};
|
|
377
390
|
|
|
378
|
-
export { type AuthProviderInfo as A, type ConditionalBoolean as C,
|
|
391
|
+
export { type AuthProviderInfo as A, type ConditionalBoolean as C, DEFAULT_LOCALES as D, type EntityIndex as E, type FieldCondition as F, type InputType as I, type LocalizedString as L, type FieldMeta as a, type FieldDefinition as b, type AuthProviderService as c, type DbType as d, type FieldDbConfig as e, type FieldOptions as f, type FieldRelation as g, type FieldStorageConfig as h, type FieldValidationConfig as i, type LocaleConfig as j, getCountLabel as k, getFallbackLocale as l, resolveLocalized as m, refOptions as r };
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as FieldDefinition } from '../field-
|
|
1
|
+
import { b as FieldDefinition } from '../field-Bs1fIux8.js';
|
|
2
2
|
import { MasterType } from '../masters/index.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -163,7 +163,7 @@ type FieldOverrides = Partial<Pick<FieldDefinition, 'hidden' | 'disabled' | 'inp
|
|
|
163
163
|
*/
|
|
164
164
|
interface TextFieldConfig {
|
|
165
165
|
/** Field label (localized) */
|
|
166
|
-
label
|
|
166
|
+
label?: string | {
|
|
167
167
|
en: string;
|
|
168
168
|
es?: string;
|
|
169
169
|
};
|
|
@@ -228,7 +228,7 @@ type TextUniqueFieldConfig = Omit<TextFieldConfig, 'unique' | 'index' | 'require
|
|
|
228
228
|
* })
|
|
229
229
|
* ```
|
|
230
230
|
*/
|
|
231
|
-
declare function useTextField(config
|
|
231
|
+
declare function useTextField(config?: TextFieldConfig & FieldOverrides): FieldDefinition;
|
|
232
232
|
/**
|
|
233
233
|
* Create a unique text field (required + unique + index always true).
|
|
234
234
|
*
|
|
@@ -247,7 +247,7 @@ declare function useTextField(config: TextFieldConfig & FieldOverrides): FieldDe
|
|
|
247
247
|
* })
|
|
248
248
|
* ```
|
|
249
249
|
*/
|
|
250
|
-
declare function useTextUniqueField(config
|
|
250
|
+
declare function useTextUniqueField(config?: TextUniqueFieldConfig): FieldDefinition;
|
|
251
251
|
|
|
252
252
|
/**
|
|
253
253
|
* Color Field Factory
|
|
@@ -260,7 +260,7 @@ declare function useTextUniqueField(config: TextUniqueFieldConfig): FieldDefinit
|
|
|
260
260
|
*/
|
|
261
261
|
interface ColorFieldConfig {
|
|
262
262
|
/** Field label (localized) */
|
|
263
|
-
label
|
|
263
|
+
label?: string | {
|
|
264
264
|
en: string;
|
|
265
265
|
es?: string;
|
|
266
266
|
};
|
|
@@ -296,7 +296,7 @@ interface ColorFieldConfig {
|
|
|
296
296
|
* })
|
|
297
297
|
* ```
|
|
298
298
|
*/
|
|
299
|
-
declare function useColorField(config
|
|
299
|
+
declare function useColorField(config?: ColorFieldConfig & FieldOverrides): FieldDefinition;
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
302
|
* Media Field Factories
|
|
@@ -322,7 +322,7 @@ declare function parseFileSize(size: FileSize): number;
|
|
|
322
322
|
*/
|
|
323
323
|
interface ImageFieldConfig {
|
|
324
324
|
/** Field label (localized) */
|
|
325
|
-
label
|
|
325
|
+
label?: string | {
|
|
326
326
|
en: string;
|
|
327
327
|
es?: string;
|
|
328
328
|
};
|
|
@@ -369,13 +369,13 @@ interface ImageFieldConfig {
|
|
|
369
369
|
* })
|
|
370
370
|
* ```
|
|
371
371
|
*/
|
|
372
|
-
declare function useImageField(config
|
|
372
|
+
declare function useImageField(config?: ImageFieldConfig & FieldOverrides): FieldDefinition;
|
|
373
373
|
/**
|
|
374
374
|
* Configuration for file fields.
|
|
375
375
|
*/
|
|
376
376
|
interface FileFieldConfig {
|
|
377
377
|
/** Field label (localized) */
|
|
378
|
-
label
|
|
378
|
+
label?: string | {
|
|
379
379
|
en: string;
|
|
380
380
|
es?: string;
|
|
381
381
|
};
|
|
@@ -430,13 +430,13 @@ interface FileFieldConfig {
|
|
|
430
430
|
* })
|
|
431
431
|
* ```
|
|
432
432
|
*/
|
|
433
|
-
declare function useFileField(config
|
|
433
|
+
declare function useFileField(config?: FileFieldConfig & FieldOverrides): FieldDefinition;
|
|
434
434
|
/**
|
|
435
435
|
* Configuration for multi-image fields (gallery).
|
|
436
436
|
*/
|
|
437
437
|
interface MultiImageFieldConfig {
|
|
438
438
|
/** Field label (localized) */
|
|
439
|
-
label
|
|
439
|
+
label?: string | {
|
|
440
440
|
en: string;
|
|
441
441
|
es?: string;
|
|
442
442
|
};
|
|
@@ -490,13 +490,13 @@ interface MultiImageFieldConfig {
|
|
|
490
490
|
* })
|
|
491
491
|
* ```
|
|
492
492
|
*/
|
|
493
|
-
declare function useMultiImageField(config
|
|
493
|
+
declare function useMultiImageField(config?: MultiImageFieldConfig & FieldOverrides): FieldDefinition;
|
|
494
494
|
/**
|
|
495
495
|
* Configuration for multi-file fields.
|
|
496
496
|
*/
|
|
497
497
|
interface MultiFileFieldConfig {
|
|
498
498
|
/** Field label (localized) */
|
|
499
|
-
label
|
|
499
|
+
label?: string | {
|
|
500
500
|
en: string;
|
|
501
501
|
es?: string;
|
|
502
502
|
};
|
|
@@ -546,7 +546,7 @@ interface MultiFileFieldConfig {
|
|
|
546
546
|
* })
|
|
547
547
|
* ```
|
|
548
548
|
*/
|
|
549
|
-
declare function useMultiFileField(config
|
|
549
|
+
declare function useMultiFileField(config?: MultiFileFieldConfig & FieldOverrides): FieldDefinition;
|
|
550
550
|
|
|
551
551
|
/**
|
|
552
552
|
* URL Field Factory
|
|
@@ -559,7 +559,7 @@ declare function useMultiFileField(config: MultiFileFieldConfig & FieldOverrides
|
|
|
559
559
|
*/
|
|
560
560
|
interface UrlFieldConfig {
|
|
561
561
|
/** Field label (localized) */
|
|
562
|
-
label
|
|
562
|
+
label?: string | {
|
|
563
563
|
en: string;
|
|
564
564
|
es?: string;
|
|
565
565
|
};
|
|
@@ -601,7 +601,7 @@ interface UrlFieldConfig {
|
|
|
601
601
|
* })
|
|
602
602
|
* ```
|
|
603
603
|
*/
|
|
604
|
-
declare function useUrlField(config
|
|
604
|
+
declare function useUrlField(config?: UrlFieldConfig & FieldOverrides): FieldDefinition;
|
|
605
605
|
|
|
606
606
|
/**
|
|
607
607
|
* Select Field Factory
|
|
@@ -626,7 +626,7 @@ interface SelectOption {
|
|
|
626
626
|
*/
|
|
627
627
|
interface StaticSelectConfig {
|
|
628
628
|
/** Field label (localized) */
|
|
629
|
-
label
|
|
629
|
+
label?: string | {
|
|
630
630
|
en: string;
|
|
631
631
|
es?: string;
|
|
632
632
|
};
|
|
@@ -655,7 +655,7 @@ interface StaticSelectConfig {
|
|
|
655
655
|
*/
|
|
656
656
|
interface RelationSelectConfig {
|
|
657
657
|
/** Field label (localized) */
|
|
658
|
-
label
|
|
658
|
+
label?: string | {
|
|
659
659
|
en: string;
|
|
660
660
|
es?: string;
|
|
661
661
|
};
|
|
@@ -693,7 +693,7 @@ interface RelationSelectConfig {
|
|
|
693
693
|
*/
|
|
694
694
|
interface MasterSelectConfig {
|
|
695
695
|
/** Field label (localized) */
|
|
696
|
-
label
|
|
696
|
+
label?: string | {
|
|
697
697
|
en: string;
|
|
698
698
|
es?: string;
|
|
699
699
|
};
|
|
@@ -798,7 +798,7 @@ declare function useSelectField(config: MasterSelectConfig & FieldOverrides): Fi
|
|
|
798
798
|
*/
|
|
799
799
|
interface TextareaFieldConfig {
|
|
800
800
|
/** Field label (localized) */
|
|
801
|
-
label
|
|
801
|
+
label?: string | {
|
|
802
802
|
en: string;
|
|
803
803
|
es?: string;
|
|
804
804
|
};
|
|
@@ -833,7 +833,7 @@ interface TextareaFieldConfig {
|
|
|
833
833
|
* })
|
|
834
834
|
* ```
|
|
835
835
|
*/
|
|
836
|
-
declare function useTextareaField(config
|
|
836
|
+
declare function useTextareaField(config?: TextareaFieldConfig & FieldOverrides): FieldDefinition;
|
|
837
837
|
|
|
838
838
|
/**
|
|
839
839
|
* Code Field Factory
|
|
@@ -846,7 +846,7 @@ declare function useTextareaField(config: TextareaFieldConfig & FieldOverrides):
|
|
|
846
846
|
*/
|
|
847
847
|
interface CodeFieldConfig {
|
|
848
848
|
/** Field label (localized) */
|
|
849
|
-
label
|
|
849
|
+
label?: string | {
|
|
850
850
|
en: string;
|
|
851
851
|
es?: string;
|
|
852
852
|
};
|
|
@@ -885,7 +885,7 @@ interface CodeFieldConfig {
|
|
|
885
885
|
* })
|
|
886
886
|
* ```
|
|
887
887
|
*/
|
|
888
|
-
declare function useCodeField(config
|
|
888
|
+
declare function useCodeField(config?: CodeFieldConfig & FieldOverrides): FieldDefinition;
|
|
889
889
|
|
|
890
890
|
/**
|
|
891
891
|
* JSON Field Factory
|
|
@@ -898,7 +898,7 @@ declare function useCodeField(config: CodeFieldConfig & FieldOverrides): FieldDe
|
|
|
898
898
|
*/
|
|
899
899
|
interface JsonFieldConfig {
|
|
900
900
|
/** Field label (localized) */
|
|
901
|
-
label
|
|
901
|
+
label?: string | {
|
|
902
902
|
en: string;
|
|
903
903
|
es?: string;
|
|
904
904
|
};
|
|
@@ -929,7 +929,7 @@ interface JsonFieldConfig {
|
|
|
929
929
|
* })
|
|
930
930
|
* ```
|
|
931
931
|
*/
|
|
932
|
-
declare function useJsonField(config
|
|
932
|
+
declare function useJsonField(config?: JsonFieldConfig & FieldOverrides): FieldDefinition;
|
|
933
933
|
|
|
934
934
|
/**
|
|
935
935
|
* Datetime Field Factory
|
|
@@ -942,7 +942,7 @@ declare function useJsonField(config: JsonFieldConfig & FieldOverrides): FieldDe
|
|
|
942
942
|
*/
|
|
943
943
|
interface DatetimeFieldConfig {
|
|
944
944
|
/** Field label (localized) */
|
|
945
|
-
label
|
|
945
|
+
label?: string | {
|
|
946
946
|
en: string;
|
|
947
947
|
es?: string;
|
|
948
948
|
};
|
|
@@ -974,7 +974,7 @@ interface DatetimeFieldConfig {
|
|
|
974
974
|
* })
|
|
975
975
|
* ```
|
|
976
976
|
*/
|
|
977
|
-
declare function useDatetimeField(config
|
|
977
|
+
declare function useDatetimeField(config?: DatetimeFieldConfig & FieldOverrides): FieldDefinition;
|
|
978
978
|
|
|
979
979
|
/**
|
|
980
980
|
* Number Field Factory
|
|
@@ -987,7 +987,7 @@ declare function useDatetimeField(config: DatetimeFieldConfig & FieldOverrides):
|
|
|
987
987
|
*/
|
|
988
988
|
interface NumberFieldConfig {
|
|
989
989
|
/** Field label (localized) */
|
|
990
|
-
label
|
|
990
|
+
label?: string | {
|
|
991
991
|
en: string;
|
|
992
992
|
es?: string;
|
|
993
993
|
};
|
|
@@ -1028,7 +1028,7 @@ interface NumberFieldConfig {
|
|
|
1028
1028
|
* })
|
|
1029
1029
|
* ```
|
|
1030
1030
|
*/
|
|
1031
|
-
declare function useNumberField(config
|
|
1031
|
+
declare function useNumberField(config?: NumberFieldConfig & FieldOverrides): FieldDefinition;
|
|
1032
1032
|
|
|
1033
1033
|
/**
|
|
1034
1034
|
* Switch Field Factory
|
|
@@ -1041,7 +1041,7 @@ declare function useNumberField(config: NumberFieldConfig & FieldOverrides): Fie
|
|
|
1041
1041
|
*/
|
|
1042
1042
|
interface SwitchFieldConfig {
|
|
1043
1043
|
/** Field label (localized) */
|
|
1044
|
-
label
|
|
1044
|
+
label?: string | {
|
|
1045
1045
|
en: string;
|
|
1046
1046
|
es?: string;
|
|
1047
1047
|
};
|
|
@@ -1071,7 +1071,7 @@ interface SwitchFieldConfig {
|
|
|
1071
1071
|
* })
|
|
1072
1072
|
* ```
|
|
1073
1073
|
*/
|
|
1074
|
-
declare function useSwitchField(config
|
|
1074
|
+
declare function useSwitchField(config?: SwitchFieldConfig & FieldOverrides): FieldDefinition;
|
|
1075
1075
|
|
|
1076
1076
|
/**
|
|
1077
1077
|
* Localized Field Factory
|
|
@@ -1085,7 +1085,7 @@ declare function useSwitchField(config: SwitchFieldConfig & FieldOverrides): Fie
|
|
|
1085
1085
|
*/
|
|
1086
1086
|
interface LocalizedFieldConfig {
|
|
1087
1087
|
/** Field label (localized) */
|
|
1088
|
-
label
|
|
1088
|
+
label?: string | {
|
|
1089
1089
|
en: string;
|
|
1090
1090
|
es?: string;
|
|
1091
1091
|
};
|
|
@@ -1119,7 +1119,7 @@ interface LocalizedFieldConfig {
|
|
|
1119
1119
|
* })
|
|
1120
1120
|
* ```
|
|
1121
1121
|
*/
|
|
1122
|
-
declare function useLocalizedField(config
|
|
1122
|
+
declare function useLocalizedField(config?: LocalizedFieldConfig & FieldOverrides): FieldDefinition;
|
|
1123
1123
|
|
|
1124
1124
|
/**
|
|
1125
1125
|
* Icon Field Factory
|
|
@@ -1132,7 +1132,7 @@ declare function useLocalizedField(config: LocalizedFieldConfig & FieldOverrides
|
|
|
1132
1132
|
*/
|
|
1133
1133
|
interface IconFieldConfig {
|
|
1134
1134
|
/** Field label (localized) */
|
|
1135
|
-
label
|
|
1135
|
+
label?: string | {
|
|
1136
1136
|
en: string;
|
|
1137
1137
|
es?: string;
|
|
1138
1138
|
};
|
|
@@ -1167,7 +1167,7 @@ interface IconFieldConfig {
|
|
|
1167
1167
|
* })
|
|
1168
1168
|
* ```
|
|
1169
1169
|
*/
|
|
1170
|
-
declare function useIconField(config
|
|
1170
|
+
declare function useIconField(config?: IconFieldConfig & FieldOverrides): FieldDefinition;
|
|
1171
1171
|
|
|
1172
1172
|
/**
|
|
1173
1173
|
* Email Field Factory
|
|
@@ -1180,7 +1180,7 @@ declare function useIconField(config: IconFieldConfig & FieldOverrides): FieldDe
|
|
|
1180
1180
|
*/
|
|
1181
1181
|
interface EmailFieldConfig {
|
|
1182
1182
|
/** Field label (localized) */
|
|
1183
|
-
label
|
|
1183
|
+
label?: string | {
|
|
1184
1184
|
en: string;
|
|
1185
1185
|
es?: string;
|
|
1186
1186
|
};
|
|
@@ -1220,7 +1220,7 @@ interface EmailFieldConfig {
|
|
|
1220
1220
|
* })
|
|
1221
1221
|
* ```
|
|
1222
1222
|
*/
|
|
1223
|
-
declare function useEmailField(config
|
|
1223
|
+
declare function useEmailField(config?: EmailFieldConfig & FieldOverrides): FieldDefinition;
|
|
1224
1224
|
|
|
1225
1225
|
/**
|
|
1226
1226
|
* Checkbox Field Factory
|
|
@@ -1233,7 +1233,7 @@ declare function useEmailField(config: EmailFieldConfig & FieldOverrides): Field
|
|
|
1233
1233
|
*/
|
|
1234
1234
|
interface CheckboxFieldConfig {
|
|
1235
1235
|
/** Field label (localized) */
|
|
1236
|
-
label
|
|
1236
|
+
label?: string | {
|
|
1237
1237
|
en: string;
|
|
1238
1238
|
es?: string;
|
|
1239
1239
|
};
|
|
@@ -1263,7 +1263,7 @@ interface CheckboxFieldConfig {
|
|
|
1263
1263
|
* })
|
|
1264
1264
|
* ```
|
|
1265
1265
|
*/
|
|
1266
|
-
declare function useCheckboxField(config
|
|
1266
|
+
declare function useCheckboxField(config?: CheckboxFieldConfig & FieldOverrides): FieldDefinition;
|
|
1267
1267
|
|
|
1268
1268
|
/**
|
|
1269
1269
|
* Password Field Factory
|
|
@@ -1276,7 +1276,7 @@ declare function useCheckboxField(config: CheckboxFieldConfig & FieldOverrides):
|
|
|
1276
1276
|
*/
|
|
1277
1277
|
interface PasswordFieldConfig {
|
|
1278
1278
|
/** Field label (localized) */
|
|
1279
|
-
label
|
|
1279
|
+
label?: string | {
|
|
1280
1280
|
en: string;
|
|
1281
1281
|
es?: string;
|
|
1282
1282
|
};
|
|
@@ -1321,7 +1321,7 @@ interface PasswordFieldConfig {
|
|
|
1321
1321
|
* })
|
|
1322
1322
|
* ```
|
|
1323
1323
|
*/
|
|
1324
|
-
declare function usePasswordField(config
|
|
1324
|
+
declare function usePasswordField(config?: PasswordFieldConfig & FieldOverrides): FieldDefinition;
|
|
1325
1325
|
|
|
1326
1326
|
/**
|
|
1327
1327
|
* Tags Field Factory
|
|
@@ -1334,7 +1334,7 @@ declare function usePasswordField(config: PasswordFieldConfig & FieldOverrides):
|
|
|
1334
1334
|
*/
|
|
1335
1335
|
interface TagsFieldConfig {
|
|
1336
1336
|
/** Field label (localized) */
|
|
1337
|
-
label
|
|
1337
|
+
label?: string | {
|
|
1338
1338
|
en: string;
|
|
1339
1339
|
es?: string;
|
|
1340
1340
|
};
|
|
@@ -1376,7 +1376,7 @@ interface TagsFieldConfig {
|
|
|
1376
1376
|
* })
|
|
1377
1377
|
* ```
|
|
1378
1378
|
*/
|
|
1379
|
-
declare function useTagsField(config
|
|
1379
|
+
declare function useTagsField(config?: TagsFieldConfig & FieldOverrides): FieldDefinition;
|
|
1380
1380
|
|
|
1381
1381
|
/**
|
|
1382
1382
|
* Name Field Factory
|
|
@@ -1554,7 +1554,7 @@ interface PublicFieldConfig extends FieldOverrides {
|
|
|
1554
1554
|
* })
|
|
1555
1555
|
* ```
|
|
1556
1556
|
*/
|
|
1557
|
-
declare function usePublicField(config
|
|
1557
|
+
declare function usePublicField(config?: PublicFieldConfig): FieldDefinition;
|
|
1558
1558
|
|
|
1559
1559
|
/**
|
|
1560
1560
|
* Expires At Field Factory
|
package/dist/fields/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { Knex } from 'knex';
|
|
|
2
2
|
export { Knex } from 'knex';
|
|
3
3
|
import { Request, Response } from 'express';
|
|
4
4
|
export { CookieOptions, NextFunction, Request, RequestHandler, Response, Router } from 'express';
|
|
5
|
-
import { C as ConfirmConfig, P as PostActionPipeline, E as EntityType, D as DisplayMode, R as RealtimeMode,
|
|
6
|
-
export {
|
|
7
|
-
import { L as LocalizedString,
|
|
8
|
-
export { A as AuthProviderInfo, c as AuthProviderService, C as ConditionalBoolean, D as DbType, E as EntityIndex,
|
|
5
|
+
import { C as ConfirmConfig, P as PostActionPipeline, a as Category, E as EntityType, D as DisplayMode, R as RealtimeMode, b as PageDefinitionDTO, c as ComputedEntityDefinition, d as CollectionEntityDefinition, e as EventEntityDefinition, V as ViewEntityDefinition, T as TreeEntityDefinition, f as DagEntityDefinition, g as EntityDefinition, S as SingleEntityDefinition, A as ActionDefinition, M as ModuleContext } from './entity-B5WrLI1H.js';
|
|
6
|
+
export { h as AbilityLike, i as ActionEntityService, j as ActionInjection, k as AdaptersContext, l as AppManifest, m as AuthRequest, B as BaseAuthRequest, n as BaseEntityService, o as BaseMailService, p as BaseRolesService, q as BaseUser, r as BaseUsersService, s as BatchLogEntry, t as BatchProgressEvent, u as BridgeRule, v as BridgeTarget, w as CATEGORIES, x as CATEGORY_ORDER, y as CacheManagerContract, z as CacheOptions, F as CacheStats, G as CaslAction, H as CategoryMeta, I as CollectionEntityService, J as ComputedEntityService, K as ConfigContext, L as ConfigEntityDefinition, N as ConfigEntityService, O as ConfirmationType, Q as ContextCrypto, U as ContextEvents, W as ContextEventsHub, X as ContextHelpers, Y as ContextSocket, Z as CoreContext, _ as CoreServices, $ as CreateEntityServiceOptions, a0 as CustomRouteDefinition, a1 as DEFAULT_TENANT_ID, a2 as DagEntityService, a3 as DatabaseAdapter, a4 as DbContext, a5 as EngineContext, a6 as EntityAction, a7 as EntityCaslConfig, a8 as EntityChangePayload, a9 as EntityController, aa as EntityHandler, ab as EntityQuery, ac as EntityRealtimeEmits, ad as EntityRealtimeEvents, ae as EntityServiceHooks, af as EventEmitterLike, ag as EventEntityService, ah as ExternalEntityDefinition, ai as ExternalEntityService, aj as FilterOperators, ak as FilterValue, al as ForbiddenErrorConstructor, am as ForbiddenErrorInstance, an as HttpMethod, ao as LoggerReporter, ap as ManagedCache, aq as ModuleAbilities, ar as ModuleManifest, as as ModuleMiddlewares, at as ModuleRequirements, au as PageDefinition, av as PageType, aw as PaginatedResult, ax as PaginationParams, ay as PaginationParamsWithOffset, az as PluginConfigField, aA as PluginConfigSchema, aB as PluginEnvVar, aC as PluginManifest, aD as PluginSetupInfo, aE as PostAction, aF as RateLimitOptions, aG as ReferenceEntityDefinition, aH as ReferenceEntityService, aI as RegisterPluginOptions, aJ as RetentionPolicy, aK as RolePermission, aL as RouteParameterDefinition, aM as RouteResponseDefinition, aN as RuntimeContext, aO as SSEHelper, aP as SSEOptions, aQ as SSESender, aR as SchemaAdapter, aS as SchemaAlterTableBuilder, aT as SchemaColumnBuilder, aU as SchemaColumnInfo, aV as SchemaForeignKeyBuilder, aW as SchemaTableBuilder, aX as ScopedCacheManager, aY as SeedConfig, aZ as SeedContext, a_ as SendMailOptions, a$ as SendMailResult, b0 as ServicesContext, b1 as SharedEntityProperties, b2 as SingleEntityService, b3 as SocketIOBroadcastOperator, b4 as SocketIOServer, b5 as TempEntityDefinition, b6 as TempEntityService, b7 as TempRetentionPolicy, b8 as TreeEntityService, b9 as TreeNode, ba as TypedEntityQuery, bb as ValidateSchemas, bc as ValidationDetail, bd as ValidationSchema, be as ViewEntityService, bf as VirtualEntityDefinition, bg as VirtualEntityService, bh as WidgetDefinition, bi as WidgetLayout, bj as entityRoom } from './entity-B5WrLI1H.js';
|
|
7
|
+
import { L as LocalizedString, F as FieldCondition, I as InputType, a as FieldMeta, b as FieldDefinition } from './field-Bs1fIux8.js';
|
|
8
|
+
export { A as AuthProviderInfo, c as AuthProviderService, C as ConditionalBoolean, D as DEFAULT_LOCALES, d as DbType, E as EntityIndex, e as FieldDbConfig, f as FieldOptions, g as FieldRelation, h as FieldStorageConfig, i as FieldValidationConfig, j as LocaleConfig, k as getCountLabel, l as getFallbackLocale, r as refOptions, m as resolveLocalized } from './field-Bs1fIux8.js';
|
|
9
9
|
import 'pino';
|
|
10
10
|
|
|
11
11
|
/** Webhook configuration record */
|
|
@@ -178,10 +178,9 @@ interface EntityDefinitionDTO {
|
|
|
178
178
|
label: string;
|
|
179
179
|
}>;
|
|
180
180
|
/** Fields eligible for grouping (select, boolean, relation, tags) */
|
|
181
|
-
groupableFields?:
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}>;
|
|
181
|
+
groupableFields?: string[];
|
|
182
|
+
/** Subset of groupableFields where drag between board columns is allowed (default: all) */
|
|
183
|
+
columnDragFields?: string[];
|
|
185
184
|
/** Default groupBy field from entity definition */
|
|
186
185
|
groupBy?: string;
|
|
187
186
|
/** Default subgroupBy field from entity definition */
|
|
@@ -252,6 +251,8 @@ interface PluginDTO {
|
|
|
252
251
|
icon?: string;
|
|
253
252
|
/** URL to plugin image (served by backend) */
|
|
254
253
|
image?: string;
|
|
254
|
+
/** LLM-oriented documentation from llms.txt */
|
|
255
|
+
llms?: string;
|
|
255
256
|
category?: Category;
|
|
256
257
|
version: string;
|
|
257
258
|
description: LocalizedString;
|
|
@@ -334,6 +335,12 @@ interface CapabilitiesDTO {
|
|
|
334
335
|
version: string;
|
|
335
336
|
/** 3-char codes of registered plugins */
|
|
336
337
|
plugins: string[];
|
|
338
|
+
/** Supported locales for the platform */
|
|
339
|
+
locales: Array<{
|
|
340
|
+
code: string;
|
|
341
|
+
label: string;
|
|
342
|
+
fallback?: boolean;
|
|
343
|
+
}>;
|
|
337
344
|
}
|
|
338
345
|
|
|
339
346
|
/** Status of a ticket as seen by the end user */
|
|
@@ -642,7 +649,7 @@ declare function assertAllowedDomain(email: string, allowedDomainsJson: string |
|
|
|
642
649
|
* Official Nexus plugins maintained by the core team.
|
|
643
650
|
* Used by the backend to populate the plugin store.
|
|
644
651
|
*/
|
|
645
|
-
declare const OFFICIAL_PLUGINS: readonly ["@gzl10/nexus-plugin-ai", "@gzl10/nexus-plugin-auth-providers", "@gzl10/nexus-plugin-baserow", "@gzl10/nexus-plugin-charts", "@gzl10/nexus-plugin-cms", "@gzl10/nexus-plugin-compliance", "@gzl10/nexus-plugin-docker", "@gzl10/nexus-plugin-dropbox", "@gzl10/nexus-plugin-google-drive", "@gzl10/nexus-plugin-headscale", "@gzl10/nexus-plugin-importer", "@gzl10/nexus-plugin-links", "@gzl10/nexus-plugin-n8n", "@gzl10/nexus-plugin-notifications", "@gzl10/nexus-plugin-notion", "@gzl10/nexus-plugin-oidc-server", "@gzl10/nexus-plugin-opnsense", "@gzl10/nexus-plugin-plane", "@gzl10/nexus-plugin-prisma", "@gzl10/nexus-plugin-remote", "@gzl10/nexus-plugin-schedules", "@gzl10/nexus-plugin-scim", "@gzl10/nexus-plugin-tags", "@gzl10/nexus-plugin-uptime", "@gzl10/nexus-plugin-webhooks"];
|
|
652
|
+
declare const OFFICIAL_PLUGINS: readonly ["@gzl10/nexus-plugin-ai", "@gzl10/nexus-plugin-auth-providers", "@gzl10/nexus-plugin-baserow", "@gzl10/nexus-plugin-charts", "@gzl10/nexus-plugin-cms", "@gzl10/nexus-plugin-compliance", "@gzl10/nexus-plugin-docker", "@gzl10/nexus-plugin-dropbox", "@gzl10/nexus-plugin-feeds", "@gzl10/nexus-plugin-google-drive", "@gzl10/nexus-plugin-headscale", "@gzl10/nexus-plugin-importer", "@gzl10/nexus-plugin-links", "@gzl10/nexus-plugin-n8n", "@gzl10/nexus-plugin-notifications", "@gzl10/nexus-plugin-notion", "@gzl10/nexus-plugin-oidc-server", "@gzl10/nexus-plugin-opnsense", "@gzl10/nexus-plugin-plane", "@gzl10/nexus-plugin-prisma", "@gzl10/nexus-plugin-remote", "@gzl10/nexus-plugin-schedules", "@gzl10/nexus-plugin-scim", "@gzl10/nexus-plugin-scraper", "@gzl10/nexus-plugin-secrets", "@gzl10/nexus-plugin-tags", "@gzl10/nexus-plugin-uptime", "@gzl10/nexus-plugin-webhooks"];
|
|
646
653
|
type OfficialPluginName = typeof OFFICIAL_PLUGINS[number];
|
|
647
654
|
|
|
648
655
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
// src/types/localization.ts
|
|
2
|
-
|
|
2
|
+
var DEFAULT_LOCALES = [
|
|
3
|
+
{ code: "en", label: "English", fallback: true },
|
|
4
|
+
{ code: "es", label: "Espa\xF1ol" }
|
|
5
|
+
];
|
|
6
|
+
function getFallbackLocale(locales) {
|
|
7
|
+
return locales.find((l) => l.fallback)?.code ?? "en";
|
|
8
|
+
}
|
|
9
|
+
function resolveLocalized(value, locale, fallback = "en") {
|
|
3
10
|
if (!value) return "";
|
|
4
11
|
if (typeof value === "string") return value;
|
|
5
|
-
return value[locale] || value[
|
|
12
|
+
return value[locale] || value[fallback] || Object.values(value)[0] || "";
|
|
6
13
|
}
|
|
7
14
|
function getCountLabel(label, labelPlural, count, locale) {
|
|
8
15
|
const resolved = count === 1 ? label : labelPlural || label;
|
|
@@ -236,6 +243,7 @@ var OFFICIAL_PLUGINS = [
|
|
|
236
243
|
"@gzl10/nexus-plugin-compliance",
|
|
237
244
|
"@gzl10/nexus-plugin-docker",
|
|
238
245
|
"@gzl10/nexus-plugin-dropbox",
|
|
246
|
+
"@gzl10/nexus-plugin-feeds",
|
|
239
247
|
"@gzl10/nexus-plugin-google-drive",
|
|
240
248
|
"@gzl10/nexus-plugin-headscale",
|
|
241
249
|
"@gzl10/nexus-plugin-importer",
|
|
@@ -250,6 +258,8 @@ var OFFICIAL_PLUGINS = [
|
|
|
250
258
|
"@gzl10/nexus-plugin-remote",
|
|
251
259
|
"@gzl10/nexus-plugin-schedules",
|
|
252
260
|
"@gzl10/nexus-plugin-scim",
|
|
261
|
+
"@gzl10/nexus-plugin-scraper",
|
|
262
|
+
"@gzl10/nexus-plugin-secrets",
|
|
253
263
|
"@gzl10/nexus-plugin-tags",
|
|
254
264
|
"@gzl10/nexus-plugin-uptime",
|
|
255
265
|
"@gzl10/nexus-plugin-webhooks"
|
|
@@ -309,6 +319,7 @@ function validateEntityDefinition(def) {
|
|
|
309
319
|
export {
|
|
310
320
|
CATEGORIES,
|
|
311
321
|
CATEGORY_ORDER,
|
|
322
|
+
DEFAULT_LOCALES,
|
|
312
323
|
DEFAULT_TENANT_ID,
|
|
313
324
|
OFFICIAL_PLUGINS,
|
|
314
325
|
assertAllowedDomain,
|
|
@@ -322,6 +333,7 @@ export {
|
|
|
322
333
|
getCountLabel,
|
|
323
334
|
getEntityName,
|
|
324
335
|
getEntitySubject,
|
|
336
|
+
getFallbackLocale,
|
|
325
337
|
getOidcClient,
|
|
326
338
|
hasTable,
|
|
327
339
|
isPersistentEntity,
|