@gzl10/nexus-sdk 0.19.1 → 0.21.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.
@@ -182,7 +182,7 @@ function useImageField(config) {
182
182
  accept = "image/*",
183
183
  maxSize = "1MB",
184
184
  folder,
185
- isPublic,
185
+ visibility,
186
186
  dedupe,
187
187
  required,
188
188
  nullable,
@@ -202,7 +202,7 @@ function useImageField(config) {
202
202
  accept,
203
203
  maxSize: parseFileSize(maxSize),
204
204
  folder,
205
- isPublic,
205
+ visibility,
206
206
  dedupe
207
207
  },
208
208
  meta: {
@@ -218,7 +218,7 @@ function useFileField(config) {
218
218
  accept = "*/*",
219
219
  maxSize = "10MB",
220
220
  folder,
221
- isPublic,
221
+ visibility,
222
222
  dedupe,
223
223
  required,
224
224
  nullable,
@@ -238,7 +238,7 @@ function useFileField(config) {
238
238
  accept,
239
239
  maxSize: parseFileSize(maxSize),
240
240
  folder,
241
- isPublic,
241
+ visibility,
242
242
  dedupe
243
243
  },
244
244
  meta: {
@@ -255,7 +255,7 @@ function useMultiImageField(config) {
255
255
  maxSize = "1MB",
256
256
  maxFiles = 10,
257
257
  folder,
258
- isPublic,
258
+ visibility,
259
259
  dedupe,
260
260
  thumbnails,
261
261
  required,
@@ -277,7 +277,7 @@ function useMultiImageField(config) {
277
277
  maxSize: parseFileSize(maxSize),
278
278
  maxFiles,
279
279
  folder,
280
- isPublic,
280
+ visibility,
281
281
  dedupe,
282
282
  thumbnails
283
283
  },
@@ -295,7 +295,7 @@ function useMultiFileField(config) {
295
295
  maxSize = "10MB",
296
296
  maxFiles = 10,
297
297
  folder,
298
- isPublic,
298
+ visibility,
299
299
  dedupe,
300
300
  required,
301
301
  nullable,
@@ -316,7 +316,7 @@ function useMultiFileField(config) {
316
316
  maxSize: parseFileSize(maxSize),
317
317
  maxFiles,
318
318
  folder,
319
- isPublic,
319
+ visibility,
320
320
  dedupe
321
321
  },
322
322
  meta: {
@@ -740,6 +740,19 @@ function useTagsField(config) {
740
740
  };
741
741
  }
742
742
 
743
+ // src/fields/attachments.ts
744
+ function useAttachmentsField(config) {
745
+ const { label, hint, accept, maxFiles, ...overrides } = config ?? {};
746
+ return {
747
+ label: label ?? { en: "Attachments", es: "Adjuntos" },
748
+ input: "attachments",
749
+ hint,
750
+ storage: accept || maxFiles ? { accept, maxFiles } : void 0,
751
+ meta: { showInDisplay: true, showInForm: true },
752
+ ...overrides
753
+ };
754
+ }
755
+
743
756
  // src/fields/name.ts
744
757
  function useNameField(config) {
745
758
  const {
@@ -977,6 +990,7 @@ export {
977
990
  useCheckboxField,
978
991
  usePasswordField,
979
992
  useTagsField,
993
+ useAttachmentsField,
980
994
  useNameField,
981
995
  useDescriptionField,
982
996
  useMetadataField,
@@ -1,5 +1,5 @@
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-1_53kUfz.js';
1
+ import { L as LocalizedString, b as FieldDefinition } from '../field-C8Z1keXe.js';
2
+ import { d as CollectionEntityDefinition, f as DagEntityDefinition, e as EventEntityDefinition, aN as RolePermission } from '../entity-DurRjSbT.js';
3
3
  import 'knex';
4
4
  import 'express';
5
5
  import 'pino';
@@ -67,7 +67,7 @@ type EntityFactory<T> = (config?: CollectionEntityConfig) => T;
67
67
 
68
68
  /**
69
69
  * Default CASL permissions for polymorphic entities.
70
- * - All users can read
70
+ * - All authenticated users can read
71
71
  * - Authenticated users can create (own)
72
72
  * - Users can update/delete their own records
73
73
  * - Admins can manage all
@@ -17,11 +17,11 @@ import {
17
17
  useTextareaField,
18
18
  useUrlField,
19
19
  userIdField
20
- } from "../chunk-WHLUKKQO.js";
20
+ } from "../chunk-ZWGEZMYN.js";
21
21
 
22
22
  // src/collection/helpers.ts
23
23
  var polymorphicCaslPermissions = {
24
- "*": { actions: ["read"] },
24
+ "@": { actions: ["read"] },
25
25
  USER: {
26
26
  actions: ["create", "update", "delete"],
27
27
  conditions: { user_id: "${user.id}" }
@@ -215,9 +215,9 @@ var createAttachmentsEntity = createEntityFactory(
215
215
 
216
216
  // src/collection/polymorphic/tags.entity.ts
217
217
  var DEFAULT_TABLE3 = "tags";
218
- var DEFAULT_SUBJECT3 = "NxTag";
218
+ var DEFAULT_SUBJECT3 = "TaxonomyTag";
219
219
  var tagsCaslPermissions = {
220
- "*": { actions: ["read"] },
220
+ "@": { actions: ["read"] },
221
221
  USER: { actions: ["create"] },
222
222
  ADMIN: { actions: ["manage"] }
223
223
  };
@@ -303,7 +303,7 @@ var tagEntitiesEntity = {
303
303
  { columns: ["entity_type", "entity_id"] }
304
304
  ],
305
305
  casl: {
306
- subject: "NxTagEntity",
306
+ subject: "TaxonomyPolymorphicTag",
307
307
  permissions: tagsCaslPermissions
308
308
  }
309
309
  };
@@ -425,7 +425,7 @@ var createFavoritesEntity = createEntityFactory(
425
425
  var DEFAULT_TABLE6 = "ratings";
426
426
  var DEFAULT_SUBJECT6 = "NxRating";
427
427
  var ratingsCaslPermissions = {
428
- "*": { actions: ["read"] },
428
+ "@": { actions: ["read"] },
429
429
  USER: {
430
430
  actions: ["create", "update", "delete"],
431
431
  conditions: { user_id: "${user.id}" }
@@ -488,7 +488,7 @@ var createRatingsEntity = createEntityFactory(
488
488
  var DEFAULT_TABLE7 = "reactions";
489
489
  var DEFAULT_SUBJECT7 = "NxReaction";
490
490
  var reactionsCaslPermissions = {
491
- "*": { actions: ["read"] },
491
+ "@": { actions: ["read"] },
492
492
  USER: {
493
493
  actions: ["create", "delete"],
494
494
  conditions: { user_id: "${user.id}" }
@@ -622,7 +622,7 @@ var createMentionsEntity = createEntityFactory(
622
622
  var DEFAULT_TABLE9 = "options";
623
623
  var DEFAULT_SUBJECT9 = "NxOption";
624
624
  var optionsCaslPermissions = {
625
- "*": { actions: ["read"] },
625
+ "@": { actions: ["read"] },
626
626
  ADMIN: { actions: ["manage"] }
627
627
  };
628
628
  var OPTION_GROUPS = {
@@ -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, j as LocaleConfig, E as EntityIndex, F as FieldCondition } from './field-Bs1fIux8.js';
3
+ import { L as LocalizedString, b as FieldDefinition, j as LocaleConfig, E as EntityIndex, F as FieldCondition } from './field-C8Z1keXe.js';
4
4
  import { Logger } from 'pino';
5
5
 
6
6
  /**
@@ -193,7 +193,12 @@ interface RolePermission {
193
193
  interface EntityCaslConfig {
194
194
  /** CASL subject name. Default: inferred from table */
195
195
  subject?: string;
196
- /** Role-based permissions. Keys are role names or '*' wildcard */
196
+ /**
197
+ * Role-based permissions.
198
+ * Keys are role names or special wildcards:
199
+ * - `'*'` — all users including anonymous (unauthenticated)
200
+ * - `'@'` — all authenticated users (any role, but NOT anonymous)
201
+ */
197
202
  permissions?: Record<string, RolePermission | RolePermission[]>;
198
203
  /** Fields excluded from 'read' permission unless explicitly granted */
199
204
  sensitiveFields?: string[];
@@ -303,11 +308,11 @@ type FilterValue = string | number | boolean | null | unknown[] | FilterOperator
303
308
  interface EntityQuery {
304
309
  page?: number;
305
310
  limit?: number;
306
- /** Override default max limit (default: 100). Useful for trees, exports, or entities needing larger pages */
307
- maxLimit?: number;
308
311
  sort?: string;
309
312
  order?: 'asc' | 'desc';
310
313
  search?: string;
314
+ /** Request localized content in specific locale (e.g., 'es', 'en') */
315
+ locale?: string;
311
316
  /**
312
317
  * Filters with optional operators.
313
318
  * All field filters are combined with AND logic.
@@ -317,6 +322,14 @@ interface EntityQuery {
317
322
  */
318
323
  filters?: Record<string, unknown>;
319
324
  }
325
+ /**
326
+ * Server-side query options extending EntityQuery with backend-only fields.
327
+ * Not sent by the client — resolved from entity definition.
328
+ */
329
+ interface ServerEntityQuery extends EntityQuery {
330
+ /** Override default max limit (default: 100). Useful for trees, exports, or entities needing larger pages */
331
+ maxLimit?: number;
332
+ }
320
333
  /**
321
334
  * Type-safe query with filters restricted to known entity fields.
322
335
  * Provides autocompletion for filter keys and FilterValue type checking.
@@ -1146,10 +1159,6 @@ interface RegisterPluginOptions {
1146
1159
  disableEndpoints?: boolean;
1147
1160
  }
1148
1161
 
1149
- /**
1150
- * Module context types
1151
- */
1152
-
1153
1162
  /**
1154
1163
  * Generic validation schema interface compatible with Zod.
1155
1164
  */
@@ -1444,6 +1453,8 @@ interface EngineContext {
1444
1453
  hasPlugin: (name: string) => boolean;
1445
1454
  getPluginByCode: (code: string) => PluginManifest | undefined;
1446
1455
  hasPluginByCode: (code: string) => boolean;
1456
+ /** Get an entity definition by module name and entity identifier */
1457
+ getEntityDefinition: (moduleName: string, entityName: string) => EntityDefinition | undefined;
1447
1458
  }
1448
1459
  /**
1449
1460
  * Services registry namespace.
@@ -1468,6 +1479,17 @@ interface AdaptersContext {
1468
1479
  getSchema: <T extends SchemaAdapter = SchemaAdapter>(name?: string) => T | undefined;
1469
1480
  has: (name: string) => boolean;
1470
1481
  }
1482
+ /**
1483
+ * Registry for extensible capabilities.
1484
+ * Plugins register resolvers via ctx.capabilities.register().
1485
+ * GET /system/capabilities calls resolve() to aggregate all.
1486
+ */
1487
+ interface CapabilitiesRegistry {
1488
+ /** Register a capability resolver. Sync or async. Warns if key already registered. */
1489
+ register(key: string, resolver: () => unknown | Promise<unknown>): void;
1490
+ /** Resolve all registered capabilities in parallel. Catches per-resolver errors. */
1491
+ resolve(): Promise<Record<string, unknown>>;
1492
+ }
1471
1493
  /**
1472
1494
  * Module context providing access to all Nexus services and utilities.
1473
1495
  */
@@ -1481,6 +1503,8 @@ interface ModuleContext {
1481
1503
  engine: EngineContext;
1482
1504
  services: ServicesContext;
1483
1505
  adapters: AdaptersContext;
1506
+ /** Extensible capabilities registry for public metadata. */
1507
+ capabilities: CapabilitiesRegistry;
1484
1508
  /** Semantic event API for cross-module communication (notify/query/command). */
1485
1509
  events: ContextEvents;
1486
1510
  createRouter: () => Router;
@@ -1584,7 +1608,6 @@ interface SeedContext {
1584
1608
  es?: string;
1585
1609
  [key: string]: string | undefined;
1586
1610
  };
1587
- is_system?: boolean;
1588
1611
  /** CASL permissions. Keys: subject (case-insensitive). Values: action arrays. */
1589
1612
  permissions?: Record<string, Array<'read' | 'create' | 'update' | 'delete' | 'manage' | 'execute'>>;
1590
1613
  }): Promise<void>;
@@ -1611,6 +1634,77 @@ interface SeedContext {
1611
1634
  raw(table: string, data: Record<string, unknown> | Record<string, unknown>[]): Promise<number>;
1612
1635
  }
1613
1636
 
1637
+ /**
1638
+ * A workflow state with display metadata.
1639
+ */
1640
+ interface WorkflowState {
1641
+ /** Unique state identifier (stored in DB) */
1642
+ value: string;
1643
+ /** Human-readable label */
1644
+ label: LocalizedString;
1645
+ /** Hex color for badges and board columns */
1646
+ color?: string;
1647
+ /** Iconify icon name */
1648
+ icon?: string;
1649
+ }
1650
+ /**
1651
+ * A valid transition between two workflow states.
1652
+ */
1653
+ interface WorkflowTransition {
1654
+ /** Source state value */
1655
+ from: string;
1656
+ /** Target state value */
1657
+ to: string;
1658
+ /** Optional CASL action required for this transition (checked beyond base 'update' permission) */
1659
+ casl?: {
1660
+ action: string;
1661
+ };
1662
+ }
1663
+ /**
1664
+ * Workflow configuration for entity definitions.
1665
+ * Declares states, valid transitions, and optional per-transition CASL permissions.
1666
+ * Only applicable to mutable entity types: collection, tree, dag.
1667
+ */
1668
+ interface WorkflowConfig {
1669
+ /** Field name that holds the workflow state (default: 'status') */
1670
+ field?: string;
1671
+ /** Initial state value for new records (required, must exist in states) */
1672
+ initial: string;
1673
+ /** Available states with display metadata */
1674
+ states: WorkflowState[];
1675
+ /** Valid state transitions */
1676
+ transitions: WorkflowTransition[];
1677
+ /** Label for the auto-injected field (default: { en: 'Status', es: 'Estado' }) */
1678
+ fieldLabel?: LocalizedString;
1679
+ }
1680
+ /**
1681
+ * Serializable workflow state for frontend consumption.
1682
+ */
1683
+ interface WorkflowStateDTO {
1684
+ value: string;
1685
+ label: LocalizedString;
1686
+ color?: string;
1687
+ icon?: string;
1688
+ }
1689
+ /**
1690
+ * Serializable workflow transition for frontend consumption.
1691
+ */
1692
+ interface WorkflowTransitionDTO {
1693
+ from: string;
1694
+ to: string;
1695
+ /** CASL action name required for this transition (frontend checks ability.can(action, subject)) */
1696
+ caslAction?: string;
1697
+ }
1698
+ /**
1699
+ * Serializable workflow config for EntityDefinitionDTO.
1700
+ */
1701
+ interface WorkflowDTO {
1702
+ field: string;
1703
+ initial: string;
1704
+ states: WorkflowStateDTO[];
1705
+ transitions: WorkflowTransitionDTO[];
1706
+ }
1707
+
1614
1708
  /**
1615
1709
  * Entity definition types - discriminated union for all entity types
1616
1710
  */
@@ -1759,6 +1853,13 @@ interface ActionDefinition {
1759
1853
  }
1760
1854
  /** @deprecated Use ActionDefinition instead */
1761
1855
  type EntityAction = ActionDefinition;
1856
+ /** Configuration for file attachments on an entity */
1857
+ interface AttachableConfig {
1858
+ /** Accepted MIME types (e.g. 'image/*,application/pdf'). If omitted, all types allowed. */
1859
+ accept?: string;
1860
+ /** Max number of attached files per entity instance. If omitted, unlimited. */
1861
+ maxFiles?: number;
1862
+ }
1762
1863
  /**
1763
1864
  * Base properties shared by all EntityDefinition types.
1764
1865
  * @internal
@@ -1776,8 +1877,6 @@ interface BaseEntityDefinition {
1776
1877
  fields: Record<string, FieldDefinition>;
1777
1878
  /** CASL authorization configuration */
1778
1879
  casl?: EntityCaslConfig;
1779
- /** If true, all endpoints are publicly accessible without authentication (default-deny) */
1780
- public?: boolean;
1781
1880
  /** API route prefix */
1782
1881
  routePrefix?: string;
1783
1882
  /** UI sidebar ordering (default: 999) */
@@ -1821,12 +1920,16 @@ interface BaseEntityDefinition {
1821
1920
  * On startup, JSONs from data/seeds/ are imported with upsert semantics.
1822
1921
  */
1823
1922
  seedable?: boolean;
1923
+ /** If true, this entity supports taxonomy tagging via tag_assignments pivot. UI renders tag selector. */
1924
+ taggeable?: boolean;
1925
+ /** If true or config, this entity supports file attachments via file_attachments pivot. UI renders file picker. */
1926
+ attachable?: boolean | AttachableConfig;
1824
1927
  }
1825
1928
  /**
1826
1929
  * Public type exposing the common properties shared by all entity definition types.
1827
1930
  * Use this when writing generic code that works with any entity definition.
1828
1931
  */
1829
- 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'>;
1932
+ type SharedEntityProperties = Pick<BaseEntityDefinition, 'table' | 'label' | 'labelPlural' | 'icon' | 'fields' | 'casl' | 'routePrefix' | 'order' | 'displayMode' | 'groupBy' | 'subgroupBy' | 'calendarFrom' | 'calendarTo' | 'defaultSort' | 'hidden' | 'expose' | 'middleware' | 'adapter' | 'hooks' | 'realtime' | 'taggeable' | 'attachable'>;
1830
1933
  /**
1831
1934
  * Collection entity - the most common entity type with full CRUD operations.
1832
1935
  */
@@ -1864,12 +1967,14 @@ interface CollectionEntityDefinition extends BaseEntityDefinition {
1864
1967
  allowEdit?: boolean;
1865
1968
  /** Allow deleting records. When false, DELETE endpoint is not mounted. Default: true */
1866
1969
  allowDelete?: boolean;
1970
+ /** Workflow configuration: states, transitions, and per-transition CASL permissions */
1971
+ workflow?: WorkflowConfig;
1867
1972
  }
1868
1973
  /**
1869
1974
  * Singleton entity - stores a single record in the shared single_records table.
1870
1975
  * When scopeField is set, operates in scoped mode (multiple records keyed by scope).
1871
1976
  */
1872
- interface SingleEntityDefinition extends Pick<BaseEntityDefinition, 'label' | 'labelPlural' | 'icon' | 'fields' | 'casl' | 'public' | 'routePrefix' | 'order' | 'hidden' | 'expose' | 'hooks' | 'realtime'> {
1977
+ interface SingleEntityDefinition extends Pick<BaseEntityDefinition, 'label' | 'labelPlural' | 'icon' | 'fields' | 'casl' | 'routePrefix' | 'order' | 'hidden' | 'expose' | 'hooks' | 'realtime'> {
1873
1978
  type: 'single' | 'config';
1874
1979
  /** Unique key in single_records table */
1875
1980
  key: string;
@@ -1921,6 +2026,8 @@ interface TreeEntityDefinition extends BaseEntityDefinition {
1921
2026
  allowEdit?: boolean;
1922
2027
  allowDelete?: boolean;
1923
2028
  allowDragDrop?: boolean;
2029
+ /** Workflow configuration: states, transitions, and per-transition CASL permissions */
2030
+ workflow?: WorkflowConfig;
1924
2031
  }
1925
2032
  /**
1926
2033
  * DAG entity - Directed Acyclic Graph with multiple parents.
@@ -1939,6 +2046,8 @@ interface DagEntityDefinition extends BaseEntityDefinition {
1939
2046
  allowEdit?: boolean;
1940
2047
  allowDelete?: boolean;
1941
2048
  allowDragDrop?: boolean;
2049
+ /** Workflow configuration: states, transitions, and per-transition CASL permissions */
2050
+ workflow?: WorkflowConfig;
1942
2051
  }
1943
2052
  /**
1944
2053
  * Retention policy for automatic data cleanup.
@@ -2001,8 +2110,6 @@ interface ComputedEntityDefinition {
2001
2110
  };
2002
2111
  isSingle?: boolean;
2003
2112
  casl?: EntityCaslConfig;
2004
- /** If true, all endpoints are publicly accessible without authentication (default-deny) */
2005
- public?: boolean;
2006
2113
  routePrefix?: string;
2007
2114
  order?: number;
2008
2115
  displayMode?: DisplayMode;
@@ -2034,8 +2141,6 @@ interface ViewEntityDefinition {
2034
2141
  fields: Record<string, FieldDefinition>;
2035
2142
  query?: string | ((db: Knex) => Knex.QueryBuilder);
2036
2143
  casl?: EntityCaslConfig;
2037
- /** If true, all endpoints are publicly accessible without authentication (default-deny) */
2038
- public?: boolean;
2039
2144
  routePrefix?: string;
2040
2145
  order?: number;
2041
2146
  /** If false, HTTP routes are not mounted and entity is excluded from frontend DTO. Service, hooks, and CASL still work. Default: true */
@@ -2062,4 +2167,4 @@ type TempEntityDefinition = Omit<CollectionEntityDefinition, 'type'> & {
2062
2167
  */
2063
2168
  type EntityDefinition = CollectionEntityDefinition | SingleEntityDefinition | ExternalEntityDefinition | VirtualEntityDefinition | ComputedEntityDefinition | ViewEntityDefinition | ReferenceEntityDefinition | TreeEntityDefinition | DagEntityDefinition | EventEntityDefinition;
2064
2169
 
2065
- 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 };
2170
+ export { type ContextSocket as $, type ActionDefinition as A, type BaseAuthRequest as B, type ConfirmConfig as C, type DisplayMode as D, type EntityType as E, type CacheOptions as F, type CacheStats as G, type CapabilitiesRegistry as H, type CaslAction as I, type CategoryMeta as J, type CollectionEntityService as K, type ComputedEntityService as L, type ModuleContext as M, type ConfigContext as N, type ConfigEntityDefinition as O, type PostActionPipeline as P, type ConfigEntityService as Q, type RealtimeMode as R, type SingleEntityDefinition as S, type TreeEntityDefinition as T, type ConfirmationType as U, type ViewEntityDefinition as V, type WorkflowDTO as W, type ContextCrypto as X, type ContextEvents as Y, type ContextEventsHub as Z, type ContextHelpers as _, type Category as a, type SeedConfig as a$, type CoreContext as a0, type CoreServices as a1, type CreateEntityServiceOptions as a2, type CustomRouteDefinition as a3, DEFAULT_TENANT_ID as a4, type DagEntityService as a5, type DatabaseAdapter as a6, type DbContext as a7, type EngineContext as a8, type EntityAction as a9, type PaginationParams as aA, type PaginationParamsWithOffset as aB, type PluginConfigField as aC, type PluginConfigSchema as aD, type PluginEnvVar as aE, type PluginManifest as aF, type PluginSetupInfo as aG, type PostAction as aH, type RateLimitOptions as aI, type ReferenceEntityDefinition as aJ, type ReferenceEntityService as aK, type RegisterPluginOptions as aL, type RetentionPolicy as aM, type RolePermission as aN, type RouteParameterDefinition as aO, type RouteResponseDefinition as aP, type RuntimeContext as aQ, type SSEHelper as aR, type SSEOptions as aS, type SSESender as aT, type SchemaAdapter as aU, type SchemaAlterTableBuilder as aV, type SchemaColumnBuilder as aW, type SchemaColumnInfo as aX, type SchemaForeignKeyBuilder as aY, type SchemaTableBuilder as aZ, type ScopedCacheManager as a_, type EntityCaslConfig as aa, type EntityChangePayload as ab, type EntityController as ac, type EntityHandler as ad, type EntityQuery as ae, type EntityRealtimeEmits as af, type EntityRealtimeEvents as ag, type EntityServiceHooks as ah, type EventEmitterLike as ai, type EventEntityService as aj, type ExternalEntityDefinition as ak, type ExternalEntityService as al, type FilterOperators as am, type FilterValue as an, type ForbiddenErrorConstructor as ao, type ForbiddenErrorInstance as ap, type HttpMethod as aq, type LoggerReporter as ar, type ManagedCache as as, type ModuleAbilities as at, type ModuleManifest as au, type ModuleMiddlewares as av, type ModuleRequirements as aw, type PageDefinition as ax, type PageType as ay, type PaginatedResult as az, type PageDefinitionDTO as b, type SeedContext as b0, type SendMailOptions as b1, type SendMailResult as b2, type ServerEntityQuery as b3, type ServicesContext as b4, type SharedEntityProperties as b5, type SingleEntityService as b6, type SocketIOBroadcastOperator as b7, type SocketIOServer as b8, type TempEntityDefinition as b9, type TempEntityService as ba, type TempRetentionPolicy as bb, type TreeEntityService as bc, type TreeNode as bd, type TypedEntityQuery as be, type ValidateSchemas as bf, type ValidationDetail as bg, type ValidationSchema as bh, type ViewEntityService as bi, type VirtualEntityDefinition as bj, type VirtualEntityService as bk, type WidgetDefinition as bl, type WidgetLayout as bm, type WorkflowConfig as bn, type WorkflowState as bo, type WorkflowStateDTO as bp, type WorkflowTransition as bq, type WorkflowTransitionDTO as br, entityRoom as bs, 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 AttachableConfig as m, type AuthRequest as n, type BaseEntityService as o, type BaseMailService as p, type BaseRolesService as q, type BaseUser as r, type BaseUsersService as s, type BatchLogEntry as t, type BatchProgressEvent as u, type BridgeRule as v, type BridgeTarget as w, CATEGORIES as x, CATEGORY_ORDER as y, type CacheManagerContract as z };
@@ -274,8 +274,8 @@ interface FieldStorageConfig {
274
274
  }>;
275
275
  /** Enable SHA256 hash deduplication */
276
276
  dedupe?: boolean;
277
- /** If true, files are publicly accessible without authentication */
278
- isPublic?: boolean;
277
+ /** File visibility: 'public' (anyone), 'internal' (authenticated), 'private' (owner only) */
278
+ visibility?: 'public' | 'internal' | 'private';
279
279
  }
280
280
  /**
281
281
  * Field metadata for UI behavior and data operations.
@@ -1,4 +1,4 @@
1
- import { b as FieldDefinition } from '../field-Bs1fIux8.js';
1
+ import { b as FieldDefinition } from '../field-C8Z1keXe.js';
2
2
  import { MasterType } from '../masters/index.js';
3
3
 
4
4
  /**
@@ -337,8 +337,8 @@ interface ImageFieldConfig {
337
337
  maxSize?: FileSize;
338
338
  /** Storage folder path */
339
339
  folder?: string;
340
- /** Mark uploaded files as public (accessible without authentication) */
341
- isPublic?: boolean;
340
+ /** File visibility: public (no auth required), internal (org members), or private (owner only) */
341
+ visibility?: 'public' | 'internal' | 'private';
342
342
  /** Enable SHA256 hash deduplication (default: false) */
343
343
  dedupe?: boolean;
344
344
  /** Is field required? (default: false) */
@@ -390,8 +390,8 @@ interface FileFieldConfig {
390
390
  maxSize?: FileSize;
391
391
  /** Storage folder path */
392
392
  folder?: string;
393
- /** Mark uploaded files as public (accessible without authentication) */
394
- isPublic?: boolean;
393
+ /** File visibility: public (no auth required), internal (org members), or private (owner only) */
394
+ visibility?: 'public' | 'internal' | 'private';
395
395
  /** Enable SHA256 hash deduplication (default: false) */
396
396
  dedupe?: boolean;
397
397
  /** Is field required? (default: false) */
@@ -453,8 +453,8 @@ interface MultiImageFieldConfig {
453
453
  maxFiles?: number;
454
454
  /** Storage folder path */
455
455
  folder?: string;
456
- /** Mark uploaded files as public (accessible without authentication) */
457
- isPublic?: boolean;
456
+ /** File visibility: public (no auth required), internal (org members), or private (owner only) */
457
+ visibility?: 'public' | 'internal' | 'private';
458
458
  /** Enable SHA256 hash deduplication (default: false) */
459
459
  dedupe?: boolean;
460
460
  /** Thumbnail sizes to auto-generate */
@@ -513,8 +513,8 @@ interface MultiFileFieldConfig {
513
513
  maxFiles?: number;
514
514
  /** Storage folder path */
515
515
  folder?: string;
516
- /** Mark uploaded files as public (accessible without authentication) */
517
- isPublic?: boolean;
516
+ /** File visibility: public (no auth required), internal (org members), or private (owner only) */
517
+ visibility?: 'public' | 'internal' | 'private';
518
518
  /** Enable SHA256 hash deduplication (default: false) */
519
519
  dedupe?: boolean;
520
520
  /** Is field required? (default: false) */
@@ -1378,6 +1378,49 @@ interface TagsFieldConfig {
1378
1378
  */
1379
1379
  declare function useTagsField(config?: TagsFieldConfig & FieldOverrides): FieldDefinition;
1380
1380
 
1381
+ /**
1382
+ * Attachments Field Factory
1383
+ *
1384
+ * Virtual field for file attachments. No DB column — data in file_attachments pivot.
1385
+ * Requires entity to declare `attachable: true` or `attachable: { ... }`.
1386
+ */
1387
+
1388
+ /**
1389
+ * Configuration for attachments fields.
1390
+ */
1391
+ interface AttachmentsFieldConfig {
1392
+ /** Field label (localized) */
1393
+ label?: string | {
1394
+ en: string;
1395
+ es?: string;
1396
+ };
1397
+ /** Help text shown below the input */
1398
+ hint?: string | {
1399
+ en: string;
1400
+ es?: string;
1401
+ };
1402
+ /** Accepted MIME types — overrides entity-level accept */
1403
+ accept?: string;
1404
+ /** Max number of attached files — overrides entity-level maxFiles */
1405
+ maxFiles?: number;
1406
+ }
1407
+ /**
1408
+ * Create a virtual field for file attachments.
1409
+ *
1410
+ * No DB column is created — data lives in the file_attachments pivot table.
1411
+ * The entity must declare `attachable: true` or `attachable: { ... }`.
1412
+ *
1413
+ * @example
1414
+ * ```typescript
1415
+ * documents: useAttachmentsField({
1416
+ * label: { en: 'Documents', es: 'Documentos' },
1417
+ * accept: 'application/pdf,image/*',
1418
+ * maxFiles: 10
1419
+ * })
1420
+ * ```
1421
+ */
1422
+ declare function useAttachmentsField(config?: AttachmentsFieldConfig & FieldOverrides): FieldDefinition;
1423
+
1381
1424
  /**
1382
1425
  * Name Field Factory
1383
1426
  *
@@ -1627,4 +1670,4 @@ declare const auditFields: Record<string, FieldDefinition>;
1627
1670
  /** deleted_at for soft-delete pattern */
1628
1671
  declare const softDeleteFields: Record<string, FieldDefinition>;
1629
1672
 
1630
- export { type CheckboxFieldConfig, type CodeFieldConfig, type ColorFieldConfig, type DatetimeFieldConfig, type DescriptionFieldConfig, type EmailFieldConfig, type EnabledFieldConfig, type ExpiresAtFieldConfig, type FieldOverrides, type FileFieldConfig, type FileSize, type IconFieldConfig, type IdFieldConfig, type IdType, type ImageFieldConfig, type JsonFieldConfig, type LocalizedFieldConfig, type MasterSelectConfig, type MetadataFieldConfig, type MultiFileFieldConfig, type MultiImageFieldConfig, type NameFieldConfig, type NumberFieldConfig, type PasswordFieldConfig, type PatternIdConfig, type PublicFieldConfig, type RelationSelectConfig, type SelectOption, type StaticSelectConfig, type SwitchFieldConfig, type TagsFieldConfig, type TextFieldConfig, type TextUniqueFieldConfig, type TextareaFieldConfig, type UrlFieldConfig, auditFields, idField, isActiveField, orderField, parseFileSize, softDeleteFields, timestampFields, useCheckboxField, useCodeField, useColorField, useDatetimeField, useDescriptionField, useEmailField, useEnabledField, useExpiresAtField, useFileField, useIconField, useIdField, useImageField, useJsonField, useLocalizedField, useMetadataField, useMultiFileField, useMultiImageField, useNameField, useNumberField, usePasswordField, usePublicField, useSelectField, useSwitchField, useTagsField, useTextField, useTextUniqueField, useTextareaField, useUrlField, userIdField };
1673
+ export { type AttachmentsFieldConfig, type CheckboxFieldConfig, type CodeFieldConfig, type ColorFieldConfig, type DatetimeFieldConfig, type DescriptionFieldConfig, type EmailFieldConfig, type EnabledFieldConfig, type ExpiresAtFieldConfig, type FieldOverrides, type FileFieldConfig, type FileSize, type IconFieldConfig, type IdFieldConfig, type IdType, type ImageFieldConfig, type JsonFieldConfig, type LocalizedFieldConfig, type MasterSelectConfig, type MetadataFieldConfig, type MultiFileFieldConfig, type MultiImageFieldConfig, type NameFieldConfig, type NumberFieldConfig, type PasswordFieldConfig, type PatternIdConfig, type PublicFieldConfig, type RelationSelectConfig, type SelectOption, type StaticSelectConfig, type SwitchFieldConfig, type TagsFieldConfig, type TextFieldConfig, type TextUniqueFieldConfig, type TextareaFieldConfig, type UrlFieldConfig, auditFields, idField, isActiveField, orderField, parseFileSize, softDeleteFields, timestampFields, useAttachmentsField, useCheckboxField, useCodeField, useColorField, useDatetimeField, useDescriptionField, useEmailField, useEnabledField, useExpiresAtField, useFileField, useIconField, useIdField, useImageField, useJsonField, useLocalizedField, useMetadataField, useMultiFileField, useMultiImageField, useNameField, useNumberField, usePasswordField, usePublicField, useSelectField, useSwitchField, useTagsField, useTextField, useTextUniqueField, useTextareaField, useUrlField, userIdField };
@@ -6,6 +6,7 @@ import {
6
6
  parseFileSize,
7
7
  softDeleteFields,
8
8
  timestampFields,
9
+ useAttachmentsField,
9
10
  useCheckboxField,
10
11
  useCodeField,
11
12
  useColorField,
@@ -35,7 +36,7 @@ import {
35
36
  useTextareaField,
36
37
  useUrlField,
37
38
  userIdField
38
- } from "../chunk-WHLUKKQO.js";
39
+ } from "../chunk-ZWGEZMYN.js";
39
40
  export {
40
41
  auditFields,
41
42
  idField,
@@ -44,6 +45,7 @@ export {
44
45
  parseFileSize,
45
46
  softDeleteFields,
46
47
  timestampFields,
48
+ useAttachmentsField,
47
49
  useCheckboxField,
48
50
  useCodeField,
49
51
  useColorField,
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, 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-1_53kUfz.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-1_53kUfz.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';
5
+ import { C as ConfirmConfig, P as PostActionPipeline, a as Category, E as EntityType, D as DisplayMode, R as RealtimeMode, W as WorkflowDTO, 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-DurRjSbT.js';
6
+ export { h as AbilityLike, i as ActionEntityService, j as ActionInjection, k as AdaptersContext, l as AppManifest, m as AttachableConfig, n as AuthRequest, B as BaseAuthRequest, o as BaseEntityService, p as BaseMailService, q as BaseRolesService, r as BaseUser, s as BaseUsersService, t as BatchLogEntry, u as BatchProgressEvent, v as BridgeRule, w as BridgeTarget, x as CATEGORIES, y as CATEGORY_ORDER, z as CacheManagerContract, F as CacheOptions, G as CacheStats, H as CapabilitiesRegistry, I as CaslAction, J as CategoryMeta, K as CollectionEntityService, L as ComputedEntityService, N as ConfigContext, O as ConfigEntityDefinition, Q as ConfigEntityService, U as ConfirmationType, X as ContextCrypto, Y as ContextEvents, Z as ContextEventsHub, _ as ContextHelpers, $ as ContextSocket, a0 as CoreContext, a1 as CoreServices, a2 as CreateEntityServiceOptions, a3 as CustomRouteDefinition, a4 as DEFAULT_TENANT_ID, a5 as DagEntityService, a6 as DatabaseAdapter, a7 as DbContext, a8 as EngineContext, a9 as EntityAction, aa as EntityCaslConfig, ab as EntityChangePayload, ac as EntityController, ad as EntityHandler, ae as EntityQuery, af as EntityRealtimeEmits, ag as EntityRealtimeEvents, ah as EntityServiceHooks, ai as EventEmitterLike, aj as EventEntityService, ak as ExternalEntityDefinition, al as ExternalEntityService, am as FilterOperators, an as FilterValue, ao as ForbiddenErrorConstructor, ap as ForbiddenErrorInstance, aq as HttpMethod, ar as LoggerReporter, as as ManagedCache, at as ModuleAbilities, au as ModuleManifest, av as ModuleMiddlewares, aw as ModuleRequirements, ax as PageDefinition, ay as PageType, az as PaginatedResult, aA as PaginationParams, aB as PaginationParamsWithOffset, aC as PluginConfigField, aD as PluginConfigSchema, aE as PluginEnvVar, aF as PluginManifest, aG as PluginSetupInfo, aH as PostAction, aI as RateLimitOptions, aJ as ReferenceEntityDefinition, aK as ReferenceEntityService, aL as RegisterPluginOptions, aM as RetentionPolicy, aN as RolePermission, aO as RouteParameterDefinition, aP as RouteResponseDefinition, aQ as RuntimeContext, aR as SSEHelper, aS as SSEOptions, aT as SSESender, aU as SchemaAdapter, aV as SchemaAlterTableBuilder, aW as SchemaColumnBuilder, aX as SchemaColumnInfo, aY as SchemaForeignKeyBuilder, aZ as SchemaTableBuilder, a_ as ScopedCacheManager, a$ as SeedConfig, b0 as SeedContext, b1 as SendMailOptions, b2 as SendMailResult, b3 as ServerEntityQuery, b4 as ServicesContext, b5 as SharedEntityProperties, b6 as SingleEntityService, b7 as SocketIOBroadcastOperator, b8 as SocketIOServer, b9 as TempEntityDefinition, ba as TempEntityService, bb as TempRetentionPolicy, bc as TreeEntityService, bd as TreeNode, be as TypedEntityQuery, bf as ValidateSchemas, bg as ValidationDetail, bh as ValidationSchema, bi as ViewEntityService, bj as VirtualEntityDefinition, bk as VirtualEntityService, bl as WidgetDefinition, bm as WidgetLayout, bn as WorkflowConfig, bo as WorkflowState, bp as WorkflowStateDTO, bq as WorkflowTransition, br as WorkflowTransitionDTO, bs as entityRoom } from './entity-DurRjSbT.js';
7
+ import { L as LocalizedString, F as FieldCondition, I as InputType, a as FieldMeta, b as FieldDefinition } from './field-C8Z1keXe.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-C8Z1keXe.js';
9
9
  import 'pino';
10
10
 
11
11
  /** Webhook configuration record */
@@ -110,7 +110,7 @@ interface FieldDefinitionDTO {
110
110
  height: number;
111
111
  }>;
112
112
  dedupe?: boolean;
113
- isPublic?: boolean;
113
+ visibility?: 'public' | 'internal' | 'private';
114
114
  };
115
115
  meta?: FieldMeta;
116
116
  inputProps?: Record<string, unknown>;
@@ -207,6 +207,15 @@ interface EntityDefinitionDTO {
207
207
  liveOn?: string[];
208
208
  /** Auto-refresh interval in ms. Frontend polls data at this rate. */
209
209
  refreshInterval?: number;
210
+ /** Entity supports taxonomy tagging (tag_assignments pivot) */
211
+ taggeable?: boolean;
212
+ /** Entity supports file attachments (file_attachments pivot). true = all types, config = restrictions. */
213
+ attachable?: boolean | {
214
+ accept?: string;
215
+ maxFiles?: number;
216
+ };
217
+ /** Workflow configuration: states, transitions, CASL actions */
218
+ workflow?: WorkflowDTO;
210
219
  }
211
220
  /**
212
221
  * Serializable module for API responses.
@@ -341,6 +350,8 @@ interface CapabilitiesDTO {
341
350
  label: string;
342
351
  fallback?: boolean;
343
352
  }>;
353
+ /** Plugin-contributed capabilities (extensible) */
354
+ [key: string]: unknown;
344
355
  }
345
356
 
346
357
  /** Status of a ticket as seen by the end user */
@@ -649,7 +660,7 @@ declare function assertAllowedDomain(email: string, allowedDomainsJson: string |
649
660
  * Official Nexus plugins maintained by the core team.
650
661
  * Used by the backend to populate the plugin store.
651
662
  */
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"];
663
+ 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-bookmarks", "@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-scim", "@gzl10/nexus-plugin-scraper", "@gzl10/nexus-plugin-secrets", "@gzl10/nexus-plugin-uptime", "@gzl10/nexus-plugin-webhooks"];
653
664
  type OfficialPluginName = typeof OFFICIAL_PLUGINS[number];
654
665
 
655
666
  /**
@@ -731,4 +742,4 @@ type KnexCreateTableBuilder = Knex.CreateTableBuilder;
731
742
  type KnexAlterTableBuilder = Knex.AlterTableBuilder;
732
743
  type KnexTransaction = Knex.Transaction;
733
744
 
734
- export { ActionDefinition, type ActionDefinitionDTO, type AuthorizationParams, type CapabilitiesDTO, Category, CollectionEntityDefinition, type CombinedManifestDTO, ComputedEntityDefinition, ConfirmConfig, type CreateWebhookInput, type CreateWebhookResponse, DagEntityDefinition, DisplayMode, type DomainFilterOptions, type DomainFilterResult, EntityDefinition, type EntityDefinitionDTO, EntityType, EventEntityDefinition, FieldCondition, FieldDefinition, type FieldDefinitionDTO, FieldMeta, type IdTokenClaims, InputType, type KnexAlterTableBuilder, type KnexCreateTableBuilder, type KnexTransaction, LocalizedString, type ManifestDTO, ModuleContext, type ModuleDTO, type NonPersistentEntityDefinition, OFFICIAL_PLUGINS, type OfficialPluginName, type OidcClient, type OidcDiscoveryDocument, type OidcState, type OidcTokens, type OidcUserInfo, PageDefinitionDTO, type PersistentEntityDefinition, type PluginActionResult, type PluginDTO, type PluginSetupInfoDTO, type PluginStateDTO, PostActionPipeline, RealtimeMode, type SessionResult, SingleEntityDefinition, type StateManager, type TicketItem, type TicketProvider, type TicketResult, type TicketStatus, type TicketSubmission, type TokenExchangeParams, type TokenValidationConfig, TreeEntityDefinition, type UpdateWebhookInput, type ValidationError, type ValidationResult, ViewEntityDefinition, type Webhook, type WebhookDelivery, assertAllowedDomain, assertNever, checkAllowedDomain, composeFields, createOidcClient, createStateManager, defineAction, getEntityName, getEntitySubject, getOidcClient, hasTable, isPersistentEntity, isSingletonEntity, validateEntityDefinition };
745
+ export { ActionDefinition, type ActionDefinitionDTO, type AuthorizationParams, type CapabilitiesDTO, Category, CollectionEntityDefinition, type CombinedManifestDTO, ComputedEntityDefinition, ConfirmConfig, type CreateWebhookInput, type CreateWebhookResponse, DagEntityDefinition, DisplayMode, type DomainFilterOptions, type DomainFilterResult, EntityDefinition, type EntityDefinitionDTO, EntityType, EventEntityDefinition, FieldCondition, FieldDefinition, type FieldDefinitionDTO, FieldMeta, type IdTokenClaims, InputType, type KnexAlterTableBuilder, type KnexCreateTableBuilder, type KnexTransaction, LocalizedString, type ManifestDTO, ModuleContext, type ModuleDTO, type NonPersistentEntityDefinition, OFFICIAL_PLUGINS, type OfficialPluginName, type OidcClient, type OidcDiscoveryDocument, type OidcState, type OidcTokens, type OidcUserInfo, PageDefinitionDTO, type PersistentEntityDefinition, type PluginActionResult, type PluginDTO, type PluginSetupInfoDTO, type PluginStateDTO, PostActionPipeline, RealtimeMode, type SessionResult, SingleEntityDefinition, type StateManager, type TicketItem, type TicketProvider, type TicketResult, type TicketStatus, type TicketSubmission, type TokenExchangeParams, type TokenValidationConfig, TreeEntityDefinition, type UpdateWebhookInput, type ValidationError, type ValidationResult, ViewEntityDefinition, type Webhook, type WebhookDelivery, WorkflowDTO, assertAllowedDomain, assertNever, checkAllowedDomain, composeFields, createOidcClient, createStateManager, defineAction, getEntityName, getEntitySubject, getOidcClient, hasTable, isPersistentEntity, isSingletonEntity, validateEntityDefinition };
package/dist/index.js CHANGED
@@ -247,7 +247,7 @@ var OFFICIAL_PLUGINS = [
247
247
  "@gzl10/nexus-plugin-google-drive",
248
248
  "@gzl10/nexus-plugin-headscale",
249
249
  "@gzl10/nexus-plugin-importer",
250
- "@gzl10/nexus-plugin-links",
250
+ "@gzl10/nexus-plugin-bookmarks",
251
251
  "@gzl10/nexus-plugin-n8n",
252
252
  "@gzl10/nexus-plugin-notifications",
253
253
  "@gzl10/nexus-plugin-notion",
@@ -256,11 +256,9 @@ var OFFICIAL_PLUGINS = [
256
256
  "@gzl10/nexus-plugin-plane",
257
257
  "@gzl10/nexus-plugin-prisma",
258
258
  "@gzl10/nexus-plugin-remote",
259
- "@gzl10/nexus-plugin-schedules",
260
259
  "@gzl10/nexus-plugin-scim",
261
260
  "@gzl10/nexus-plugin-scraper",
262
261
  "@gzl10/nexus-plugin-secrets",
263
- "@gzl10/nexus-plugin-tags",
264
262
  "@gzl10/nexus-plugin-uptime",
265
263
  "@gzl10/nexus-plugin-webhooks"
266
264
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gzl10/nexus-sdk",
3
- "version": "0.19.1",
3
+ "version": "0.21.0",
4
4
  "description": "SDK types for creating Nexus plugins and modules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",