@gzl10/nexus-sdk 0.19.0 → 0.20.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.
@@ -1,5 +1,5 @@
1
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';
2
+ import { d as CollectionEntityDefinition, f as DagEntityDefinition, e as EventEntityDefinition, aL as RolePermission } from '../entity-en_fBKjq.js';
3
3
  import 'knex';
4
4
  import 'express';
5
5
  import 'pino';
@@ -303,11 +303,11 @@ type FilterValue = string | number | boolean | null | unknown[] | FilterOperator
303
303
  interface EntityQuery {
304
304
  page?: number;
305
305
  limit?: number;
306
- /** Override default max limit (default: 100). Useful for trees, exports, or entities needing larger pages */
307
- maxLimit?: number;
308
306
  sort?: string;
309
307
  order?: 'asc' | 'desc';
310
308
  search?: string;
309
+ /** Request localized content in specific locale (e.g., 'es', 'en') */
310
+ locale?: string;
311
311
  /**
312
312
  * Filters with optional operators.
313
313
  * All field filters are combined with AND logic.
@@ -317,6 +317,14 @@ interface EntityQuery {
317
317
  */
318
318
  filters?: Record<string, unknown>;
319
319
  }
320
+ /**
321
+ * Server-side query options extending EntityQuery with backend-only fields.
322
+ * Not sent by the client — resolved from entity definition.
323
+ */
324
+ interface ServerEntityQuery extends EntityQuery {
325
+ /** Override default max limit (default: 100). Useful for trees, exports, or entities needing larger pages */
326
+ maxLimit?: number;
327
+ }
320
328
  /**
321
329
  * Type-safe query with filters restricted to known entity fields.
322
330
  * Provides autocompletion for filter keys and FilterValue type checking.
@@ -1468,6 +1476,17 @@ interface AdaptersContext {
1468
1476
  getSchema: <T extends SchemaAdapter = SchemaAdapter>(name?: string) => T | undefined;
1469
1477
  has: (name: string) => boolean;
1470
1478
  }
1479
+ /**
1480
+ * Registry for extensible capabilities.
1481
+ * Plugins register resolvers via ctx.capabilities.register().
1482
+ * GET /system/capabilities calls resolve() to aggregate all.
1483
+ */
1484
+ interface CapabilitiesRegistry {
1485
+ /** Register a capability resolver. Sync or async. Warns if key already registered. */
1486
+ register(key: string, resolver: () => unknown | Promise<unknown>): void;
1487
+ /** Resolve all registered capabilities in parallel. Catches per-resolver errors. */
1488
+ resolve(): Promise<Record<string, unknown>>;
1489
+ }
1471
1490
  /**
1472
1491
  * Module context providing access to all Nexus services and utilities.
1473
1492
  */
@@ -1481,6 +1500,8 @@ interface ModuleContext {
1481
1500
  engine: EngineContext;
1482
1501
  services: ServicesContext;
1483
1502
  adapters: AdaptersContext;
1503
+ /** Extensible capabilities registry for public metadata. */
1504
+ capabilities: CapabilitiesRegistry;
1484
1505
  /** Semantic event API for cross-module communication (notify/query/command). */
1485
1506
  events: ContextEvents;
1486
1507
  createRouter: () => Router;
@@ -2062,4 +2083,4 @@ type TempEntityDefinition = Omit<CollectionEntityDefinition, 'type'> & {
2062
2083
  */
2063
2084
  type EntityDefinition = CollectionEntityDefinition | SingleEntityDefinition | ExternalEntityDefinition | VirtualEntityDefinition | ComputedEntityDefinition | ViewEntityDefinition | ReferenceEntityDefinition | TreeEntityDefinition | DagEntityDefinition | EventEntityDefinition;
2064
2085
 
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 };
2086
+ export { type CoreServices 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 CapabilitiesRegistry as G, type CaslAction as H, type CategoryMeta as I, type CollectionEntityService as J, type ComputedEntityService as K, type ConfigContext as L, type ModuleContext as M, type ConfigEntityDefinition as N, type ConfigEntityService as O, type PostActionPipeline as P, type ConfirmationType as Q, type RealtimeMode as R, type SingleEntityDefinition as S, type TreeEntityDefinition as T, type ContextCrypto as U, type ViewEntityDefinition as V, type ContextEvents as W, type ContextEventsHub as X, type ContextHelpers as Y, type ContextSocket as Z, type CoreContext as _, type Category as a, type SendMailOptions as a$, type CreateEntityServiceOptions as a0, type CustomRouteDefinition as a1, DEFAULT_TENANT_ID as a2, type DagEntityService as a3, type DatabaseAdapter as a4, type DbContext as a5, type EngineContext as a6, type EntityAction as a7, type EntityCaslConfig as a8, type EntityChangePayload as a9, type PluginConfigField as aA, type PluginConfigSchema as aB, type PluginEnvVar as aC, type PluginManifest as aD, type PluginSetupInfo as aE, type PostAction as aF, type RateLimitOptions as aG, type ReferenceEntityDefinition as aH, type ReferenceEntityService as aI, type RegisterPluginOptions as aJ, type RetentionPolicy as aK, type RolePermission as aL, type RouteParameterDefinition as aM, type RouteResponseDefinition as aN, type RuntimeContext as aO, type SSEHelper as aP, type SSEOptions as aQ, type SSESender as aR, type SchemaAdapter as aS, type SchemaAlterTableBuilder as aT, type SchemaColumnBuilder as aU, type SchemaColumnInfo as aV, type SchemaForeignKeyBuilder as aW, type SchemaTableBuilder as aX, type ScopedCacheManager as aY, type SeedConfig as aZ, type SeedContext as a_, type EntityController as aa, type EntityHandler as ab, type EntityQuery as ac, type EntityRealtimeEmits as ad, type EntityRealtimeEvents as ae, type EntityServiceHooks as af, type EventEmitterLike as ag, type EventEntityService as ah, type ExternalEntityDefinition as ai, type ExternalEntityService as aj, type FilterOperators as ak, type FilterValue as al, type ForbiddenErrorConstructor as am, type ForbiddenErrorInstance as an, type HttpMethod as ao, type LoggerReporter as ap, type ManagedCache as aq, type ModuleAbilities as ar, type ModuleManifest as as, type ModuleMiddlewares as at, type ModuleRequirements as au, type PageDefinition as av, type PageType as aw, type PaginatedResult as ax, type PaginationParams as ay, type PaginationParamsWithOffset as az, type PageDefinitionDTO as b, type SendMailResult as b0, type ServerEntityQuery as b1, type ServicesContext as b2, type SharedEntityProperties as b3, type SingleEntityService as b4, type SocketIOBroadcastOperator as b5, type SocketIOServer as b6, type TempEntityDefinition as b7, type TempEntityService as b8, type TempRetentionPolicy as b9, type TreeEntityService as ba, type TreeNode as bb, type TypedEntityQuery as bc, type ValidateSchemas as bd, type ValidationDetail as be, type ValidationSchema as bf, type ViewEntityService as bg, type VirtualEntityDefinition as bh, type VirtualEntityService as bi, type WidgetDefinition as bj, type WidgetLayout as bk, entityRoom as bl, 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 };
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ 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';
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-en_fBKjq.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 CapabilitiesRegistry, H as CaslAction, I as CategoryMeta, J as CollectionEntityService, K as ComputedEntityService, L as ConfigContext, N as ConfigEntityDefinition, O as ConfigEntityService, Q as ConfirmationType, U as ContextCrypto, W as ContextEvents, X as ContextEventsHub, Y as ContextHelpers, Z as ContextSocket, _ as CoreContext, $ as CoreServices, a0 as CreateEntityServiceOptions, a1 as CustomRouteDefinition, a2 as DEFAULT_TENANT_ID, a3 as DagEntityService, a4 as DatabaseAdapter, a5 as DbContext, a6 as EngineContext, a7 as EntityAction, a8 as EntityCaslConfig, a9 as EntityChangePayload, aa as EntityController, ab as EntityHandler, ac as EntityQuery, ad as EntityRealtimeEmits, ae as EntityRealtimeEvents, af as EntityServiceHooks, ag as EventEmitterLike, ah as EventEntityService, ai as ExternalEntityDefinition, aj as ExternalEntityService, ak as FilterOperators, al as FilterValue, am as ForbiddenErrorConstructor, an as ForbiddenErrorInstance, ao as HttpMethod, ap as LoggerReporter, aq as ManagedCache, ar as ModuleAbilities, as as ModuleManifest, at as ModuleMiddlewares, au as ModuleRequirements, av as PageDefinition, aw as PageType, ax as PaginatedResult, ay as PaginationParams, az as PaginationParamsWithOffset, aA as PluginConfigField, aB as PluginConfigSchema, aC as PluginEnvVar, aD as PluginManifest, aE as PluginSetupInfo, aF as PostAction, aG as RateLimitOptions, aH as ReferenceEntityDefinition, aI as ReferenceEntityService, aJ as RegisterPluginOptions, aK as RetentionPolicy, aL as RolePermission, aM as RouteParameterDefinition, aN as RouteResponseDefinition, aO as RuntimeContext, aP as SSEHelper, aQ as SSEOptions, aR as SSESender, aS as SchemaAdapter, aT as SchemaAlterTableBuilder, aU as SchemaColumnBuilder, aV as SchemaColumnInfo, aW as SchemaForeignKeyBuilder, aX as SchemaTableBuilder, aY as ScopedCacheManager, aZ as SeedConfig, a_ as SeedContext, a$ as SendMailOptions, b0 as SendMailResult, b1 as ServerEntityQuery, b2 as ServicesContext, b3 as SharedEntityProperties, b4 as SingleEntityService, b5 as SocketIOBroadcastOperator, b6 as SocketIOServer, b7 as TempEntityDefinition, b8 as TempEntityService, b9 as TempRetentionPolicy, ba as TreeEntityService, bb as TreeNode, bc as TypedEntityQuery, bd as ValidateSchemas, be as ValidationDetail, bf as ValidationSchema, bg as ViewEntityService, bh as VirtualEntityDefinition, bi as VirtualEntityService, bj as WidgetDefinition, bk as WidgetLayout, bl as entityRoom } from './entity-en_fBKjq.js';
7
7
  import { L as LocalizedString, F as FieldCondition, I as InputType, a as FieldMeta, b as FieldDefinition } from './field-Bs1fIux8.js';
8
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';
@@ -341,6 +341,8 @@ interface CapabilitiesDTO {
341
341
  label: string;
342
342
  fallback?: boolean;
343
343
  }>;
344
+ /** Plugin-contributed capabilities (extensible) */
345
+ [key: string]: unknown;
344
346
  }
345
347
 
346
348
  /** Status of a ticket as seen by the end user */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gzl10/nexus-sdk",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "SDK types for creating Nexus plugins and modules",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",