@nexia/sdk 0.8.23 → 0.8.25

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,46 @@ 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 functional currency
74
+
75
+ Authorized Legal Entity targets may include `functional_currency_code` and
76
+ `functional_currency_minor_unit`. Older hosts may omit these fields and
77
+ unconfigured entities return null. Do not infer KRW from absent values; validate
78
+ currency and precision on the server before saving. Adopt a compatible Core host
79
+ before relying on these optional fields.
80
+
81
+ ### Legal Entity scope and creation defaults
82
+
83
+ For a Legal Entity-scoped list, use `useOrganizationListScope` and render its
84
+ `selectorProps` with `NxOrganizationTargetSelector` from `@nexia/sdk/host`.
85
+ The Core host supplies the user's default read scope when the URL has no explicit
86
+ scope. Only send the hook's `requestParams` when `canRead` is true; the hook does
87
+ not filter an App's API response. Keep authority checks and filtering before
88
+ pagination on the server. Invalid explicit scopes must not fall back to a wider
89
+ query. For labels constructed by an App, use `formatLegalEntityLabel(code, name)`
90
+ from `@nexia/sdk/host` so labels follow the host's current convention.
91
+
92
+ For a new Legal Entity-owned record, provide only entities authorized for that
93
+ specific creation action to `useLegalEntityCreateDefault(options, target)` from
94
+ `@nexia/sdk/host`. Each option has a `value` and may be `disabled`. Pass the
95
+ parsed create target, including `invalid` for a malformed URL. The hook returns
96
+ the authorized preferred creation entity, the sole authorized option if there
97
+ is no authorized preference, or `null`. It returns `null` for an explicit or
98
+ invalid target; the caller must retain and validate that target separately.
99
+
100
+ Apply a returned default only to an untouched create form, for example with
101
+ `setLegalEntityId(current => current ?? defaultId)`. A user selection, explicit
102
+ URL, or source record's entity takes precedence. Wait for source context to
103
+ resolve before applying a default. Tenant-wide records are not Legal Entity-owned
104
+ and must not be assigned an entity merely to use this hook. The server must
105
+ independently authorize the submitted target.
106
+
107
+ These host-backed APIs require a Core host that implements the matching hooks
108
+ and label formatter. Roll out the compatible Core host before adopting the SDK
109
+ exports in App bundles; an SDK update alone does not update an older host.
110
+ Rebuild affected Apps when adopting new exports. Standalone App tests must provide
111
+ explicit host fixtures for the capabilities they exercise.
112
+
73
113
  ## Search and select dialogs
74
114
 
75
115
  `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)를 참고하세요.
@@ -0,0 +1,9 @@
1
+ ---
2
+ status: published
3
+ version: 0.8.25
4
+ date: 2026-11-13
5
+ title: Functional currency on organization targets
6
+ description: Read optional currency metadata on authorized Legal Entity targets.
7
+ ---
8
+
9
+ Legal Entity targets may include `functional_currency_code` and `functional_currency_minor_unit`. Older hosts may omit them; unconfigured entities return null. Do not infer a currency from missing values. Adopt a compatible Core host and revalidate currency on the server when saving. 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.25
4
+ date: 2026-11-13
5
+ title: 조직 대상의 기준통화
6
+ description: 권한이 확인된 법인 대상에서 선택적 통화 정보를 조회합니다.
7
+ ---
8
+
9
+ 법인 대상에 `functional_currency_code`와 `functional_currency_minor_unit`이 제공될 수 있습니다. 이전 호스트는 필드를 생략할 수 있고 미설정 법인은 null을 반환합니다. 값이 없을 때 통화를 임의로 정하지 마세요. 호환되는 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);
@@ -16,6 +16,8 @@ export interface OrganizationTargetLegalEntity {
16
16
  public_id: string;
17
17
  code: string;
18
18
  name: string;
19
+ functional_currency_code?: string | null;
20
+ functional_currency_minor_unit?: number | null;
19
21
  }
20
22
  export interface OrganizationTargetOperatingUnit {
21
23
  public_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexia/sdk",
3
- "version": "0.8.23",
3
+ "version": "0.8.25",
4
4
  "description": "Frontend contracts for Nexia App Packages",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",