@nexia/sdk 0.8.23 → 0.8.24

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/README.md CHANGED
@@ -70,6 +70,38 @@ Test both a successful call and a denied call through an actual development
70
70
  frame or installed App transport. For invitations, use a test mail sink; for
71
71
  imports, verify the terminal result as well as the initial 202 response.
72
72
 
73
+ ### Legal Entity scope and creation defaults
74
+
75
+ For a Legal Entity-scoped list, use `useOrganizationListScope` and render its
76
+ `selectorProps` with `NxOrganizationTargetSelector` from `@nexia/sdk/host`.
77
+ The Core host supplies the user's default read scope when the URL has no explicit
78
+ scope. Only send the hook's `requestParams` when `canRead` is true; the hook does
79
+ not filter an App's API response. Keep authority checks and filtering before
80
+ pagination on the server. Invalid explicit scopes must not fall back to a wider
81
+ query. For labels constructed by an App, use `formatLegalEntityLabel(code, name)`
82
+ from `@nexia/sdk/host` so labels follow the host's current convention.
83
+
84
+ For a new Legal Entity-owned record, provide only entities authorized for that
85
+ specific creation action to `useLegalEntityCreateDefault(options, target)` from
86
+ `@nexia/sdk/host`. Each option has a `value` and may be `disabled`. Pass the
87
+ parsed create target, including `invalid` for a malformed URL. The hook returns
88
+ the authorized preferred creation entity, the sole authorized option if there
89
+ is no authorized preference, or `null`. It returns `null` for an explicit or
90
+ invalid target; the caller must retain and validate that target separately.
91
+
92
+ Apply a returned default only to an untouched create form, for example with
93
+ `setLegalEntityId(current => current ?? defaultId)`. A user selection, explicit
94
+ URL, or source record's entity takes precedence. Wait for source context to
95
+ resolve before applying a default. Tenant-wide records are not Legal Entity-owned
96
+ and must not be assigned an entity merely to use this hook. The server must
97
+ independently authorize the submitted target.
98
+
99
+ These host-backed APIs require a Core host that implements the matching hooks
100
+ and label formatter. Roll out the compatible Core host before adopting the SDK
101
+ exports in App bundles; an SDK update alone does not update an older host.
102
+ Rebuild affected Apps when adopting new exports. Standalone App tests must provide
103
+ explicit host fixtures for the capabilities they exercise.
104
+
73
105
  ## Search and select dialogs
74
106
 
75
107
  `NxLookupDialog` from `@nexia/sdk/host` presents an owner-authorized server page
@@ -0,0 +1,9 @@
1
+ ---
2
+ status: published
3
+ version: 0.8.24
4
+ date: 2026-11-11
5
+ title: Legal Entity defaults and labels
6
+ description: Consistent defaults and names for Legal Entities
7
+ ---
8
+
9
+ Use `useLegalEntityCreateDefault` with targets authorized for the creation action to obtain the user’s default Legal Entity, and `formatLegalEntityLabel` for consistent names. Apps remain responsible for explicit targets and existing form selections. Adopt the matching Core host before using these exports. See the [frontend host guide](https://developers.nexia.to/docs/app-sdk-frontend-host-contracts).
@@ -0,0 +1,9 @@
1
+ ---
2
+ status: published
3
+ version: 0.8.24
4
+ date: 2026-11-11
5
+ title: 법인 기본값과 이름
6
+ description: 일관된 법인 기본값과 이름 표시
7
+ ---
8
+
9
+ 생성 작업에 권한이 있는 대상을 `useLegalEntityCreateDefault`에 전달해 사용자의 기본 법인을 확인하고, `formatLegalEntityLabel`로 법인 이름을 일관되게 표시할 수 있습니다. 명시된 대상과 기존 폼 선택은 앱이 유지해야 합니다. 사용 전에 대응하는 Core 호스트를 적용하세요. [프런트엔드 호스트 가이드](https://developers.nexia.to/ko/docs/app-sdk-frontend-host-contracts)를 참고하세요.
package/dist/context.d.ts CHANGED
@@ -9,6 +9,10 @@ export interface UserContext {
9
9
  timezone: string;
10
10
  table_style?: 'striped' | 'grid';
11
11
  table_density?: 'compact' | 'standard' | 'comfortable';
12
+ /** Preferred Legal Entities for list views; null or an empty list means all available Legal Entities. */
13
+ default_read_legal_entities?: string[] | null;
14
+ /** Preferred Legal Entity for a new record, when available for the action. */
15
+ default_create_legal_entity?: string | null;
12
16
  must_reset_password: boolean;
13
17
  must_enroll_two_factor: boolean;
14
18
  }
package/dist/host.d.ts CHANGED
@@ -276,6 +276,13 @@ export interface NexiaAppFrontendHostBindings {
276
276
  useInsightFilterState: (options?: UseInsightFilterStateOptions) => InsightFilterControls;
277
277
  useLegalEntitiesQuery: (tenantId: string | undefined) => LegalEntityQueryResult;
278
278
  useLegalEntityApplicabilityQuery: (tenantId: string | undefined, permission: string, enabled?: boolean) => LegalEntityApplicabilityQueryResult;
279
+ useLegalEntityCreateDefault: (options: readonly {
280
+ value: string;
281
+ disabled?: boolean;
282
+ }[], target?: {
283
+ invalid?: boolean;
284
+ legalEntityPublicId?: string | null;
285
+ }) => string | null;
279
286
  useOrganizationTargetsQuery: (tenantId: string | undefined, permission: string, query?: OrganizationTargetQuery, enabled?: boolean) => OrganizationTargetQueryResult;
280
287
  useOrganizationListScope: (tenantId: string | undefined, permission: string, mode?: OrganizationListScopeMode, enabled?: boolean) => OrganizationListScopeResult;
281
288
  useLegalEntityMembersQuery: (tenantId: string | undefined, legalEntityPublicId: string | null, params?: LegalEntityMemberListParams, enabled?: boolean) => LegalEntityMemberQueryResult;
@@ -306,6 +313,7 @@ export interface NexiaAppFrontendHostBindings {
306
313
  useWorkTabLabel: (label: string | null | undefined) => void;
307
314
  };
308
315
  runtime: {
316
+ formatLegalEntityLabel: (code: string | null | undefined, name: string) => string;
309
317
  openFile: (href: string, options?: OpenFileOptions) => Promise<void>;
310
318
  autoRegisterPackageSurfaces: (options: AutoRegisterPackageSurfacesOptions) => void;
311
319
  firstFieldError: (errors: FormFieldErrors | undefined, field: string) => string | null;
@@ -541,6 +549,16 @@ export declare function useLegalEntityApplicabilityQuery(tenantId: string | unde
541
549
  export declare function useOrganizationTargetsQuery(tenantId: string | undefined, permission: string, query?: OrganizationTargetQuery, enabled?: boolean): OrganizationTargetQueryResult;
542
550
  /** Page-owned read scope. Invalid or unavailable scope never supplies request parameters. */
543
551
  export declare function useOrganizationListScope(tenantId: string | undefined, permission: string, mode?: OrganizationListScopeMode, enabled?: boolean): OrganizationListScopeResult;
552
+ /** Default only: preserve explicit targets and existing form state in the caller. */
553
+ export declare function useLegalEntityCreateDefault(options: readonly {
554
+ value: string;
555
+ disabled?: boolean;
556
+ }[], target?: {
557
+ invalid?: boolean;
558
+ legalEntityPublicId?: string | null;
559
+ }): string | null;
560
+ /** Keep Legal Entity labels consistent with the current host. */
561
+ export declare function formatLegalEntityLabel(code: string | null | undefined, name: string): string;
544
562
  /** Legal Entity-bounded member options for App-owned assignment fields. */
545
563
  export declare function useLegalEntityMembersQuery(tenantId: string | undefined, legalEntityPublicId: string | null, params?: LegalEntityMemberListParams, enabled?: boolean): LegalEntityMemberQueryResult;
546
564
  export declare function useOperatingUnitScope(tenantId: string | undefined, legalEntityPublicId: string | null | undefined, permission: string, enabled?: boolean): OperatingUnitScopeResult;
package/dist/host.js CHANGED
@@ -579,6 +579,14 @@ export function useOrganizationTargetsQuery(tenantId, permission, query = {}, en
579
579
  export function useOrganizationListScope(tenantId, permission, mode = 'legal-entity-list', enabled = true) {
580
580
  return host().hooks.useOrganizationListScope(tenantId, permission, mode, enabled);
581
581
  }
582
+ /** Default only: preserve explicit targets and existing form state in the caller. */
583
+ export function useLegalEntityCreateDefault(options, target) {
584
+ return host().hooks.useLegalEntityCreateDefault(options, target);
585
+ }
586
+ /** Keep Legal Entity labels consistent with the current host. */
587
+ export function formatLegalEntityLabel(code, name) {
588
+ return host().runtime.formatLegalEntityLabel(code, name);
589
+ }
582
590
  /** Legal Entity-bounded member options for App-owned assignment fields. */
583
591
  export function useLegalEntityMembersQuery(tenantId, legalEntityPublicId, params = {}, enabled = true) {
584
592
  return host().hooks.useLegalEntityMembersQuery(tenantId, legalEntityPublicId, params, enabled);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexia/sdk",
3
- "version": "0.8.23",
3
+ "version": "0.8.24",
4
4
  "description": "Frontend contracts for Nexia App Packages",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",