@gzl10/nexus-sdk 0.19.1 → 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,
|
|
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
|
|
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-
|
|
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
|
|
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 */
|