@g1cloud/entity-modeler-next 5.0.0-beta.5 → 5.0.0-beta.7

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.
@@ -84,6 +84,38 @@ export type ResolveError = {
84
84
  handle: Handle;
85
85
  matches: ModelId[];
86
86
  }
87
+ /**
88
+ * attribute/operation.reorder가 같은 배치에서 동일 엔티티의 멤버십 변경(add/remove)과 공존(D4).
89
+ * reorder value는 *현재 model*(add 미반영·remove 반영)로 조립되므로 host의 전체배열 $set이 신규 요소를
90
+ * drop하거나 삭제 예정 요소를 되살린다 → 멤버십 먼저 확정 후 별도 배치로 reorder(playbook 순서 규율).
91
+ */
92
+ | {
93
+ code: 'reorder-conflicting-batch';
94
+ opIndex: number;
95
+ entity: Handle;
96
+ }
97
+ /** reorder order 목록의 핸들이 엔티티 내 속성/메서드와 0개 매칭(D7 — 부분 재배치 안 함, 전체 거부). */
98
+ | {
99
+ code: 'reorder-handle-not-found';
100
+ opIndex: number;
101
+ entity: Handle;
102
+ handle: Handle;
103
+ }
104
+ /** reorder order 목록의 핸들이 복수 매칭(모호). */
105
+ | {
106
+ code: 'reorder-handle-ambiguous';
107
+ opIndex: number;
108
+ entity: Handle;
109
+ handle: Handle;
110
+ matches: ModelId[];
111
+ }
112
+ /** reorder order 목록에 같은 요소가 두 번(중복 핸들) — 배열 재배치 모호. */
113
+ | {
114
+ code: 'reorder-handle-duplicate';
115
+ opIndex: number;
116
+ entity: Handle;
117
+ handle: Handle;
118
+ }
87
119
  /**
88
120
  * index.update patch에 `columns` 키 — columnRef(dbAttr modelId)는 사람 핸들로 표현 불가라 패스스루 시
89
121
  * 깨진 인덱스가 된다. 컬럼 변경은 index.remove + index.add(컬럼 핸들 해소 구현)로 유도(거부 권고안).
@@ -231,6 +231,10 @@ export type SymbolicOp = {
231
231
  kind: 'attribute.remove';
232
232
  entity: Handle;
233
233
  attribute: Handle;
234
+ } | {
235
+ kind: 'attribute.reorder';
236
+ entity: Handle;
237
+ order: Handle[];
234
238
  } | {
235
239
  kind: 'association.add';
236
240
  spec: AssocSpec;
@@ -272,6 +276,10 @@ export type SymbolicOp = {
272
276
  kind: 'operation.remove';
273
277
  entity: Handle;
274
278
  operation: Handle;
279
+ } | {
280
+ kind: 'operation.reorder';
281
+ entity: Handle;
282
+ operations: Handle[];
275
283
  } | {
276
284
  kind: 'group.add';
277
285
  spec: GroupSpec;
@@ -280,5 +288,5 @@ export type SymbolicOp = {
280
288
  * v1이 다루는 심볼릭 op 종류의 닫힌 집합(단일 출처). resolver·JSON Schema(`schema.ts`)가 공유한다.
281
289
  * 아래 컴파일타임 단언이 이 튜플과 `SymbolicOp['kind']`의 일치를 강제 — 한쪽만 늘리면 타입 에러.
282
290
  */
283
- export declare const SYMBOLIC_OP_KINDS: readonly ["entity.add", "entity.update", "entity.remove", "attribute.add", "attribute.update", "attribute.remove", "association.add", "association.remove", "association.update", "associationEnd.update", "index.add", "index.update", "index.remove", "operation.add", "operation.update", "operation.remove", "group.add"];
291
+ export declare const SYMBOLIC_OP_KINDS: readonly ["entity.add", "entity.update", "entity.remove", "attribute.add", "attribute.update", "attribute.remove", "association.add", "association.remove", "association.update", "associationEnd.update", "index.add", "index.update", "index.remove", "operation.add", "operation.update", "operation.remove", "attribute.reorder", "operation.reorder", "group.add"];
284
292
  export type SymbolicOpKind = (typeof SYMBOLIC_OP_KINDS)[number];
@@ -1,6 +1,12 @@
1
1
  import { Multiplicity } from './types';
2
2
  /** end2 multiplicity가 컬렉션(0..* / 1..*)인가 — 코드젠의 @OneToMany vs @OneToOne 분기와 동일 기준. */
3
3
  export declare function isCollectionMultiplicity(m: Multiplicity): boolean;
4
+ /**
5
+ * 다중성 표시 기호(0..1 / 1 / 0..* / 1..*) — 영속용 enum(`*_INSTANCE(S)`)의 단일 표시 SoT.
6
+ * 기호는 언어 무관 UML 표기라 i18n 대상이 아니다. 캔버스 관계선 라벨·인스펙터 select·mermaid
7
+ * 라벨이 모두 이 함수로 위임한다(과거 multSymbol/multHuman으로 중복 정의되던 것 통합).
8
+ */
9
+ export declare function multiplicityLabel(m: Multiplicity): string;
4
10
  /**
5
11
  * inverse nav 기본 이름: 자식 엔티티명(camel). 컬렉션이면 복수형.
6
12
  * 예: Order→OrderItem 컬렉션 → `orderItems`, 단일 → `orderItem`.
@@ -0,0 +1,17 @@
1
+ import { Association, Attribute, DbColumn, Entity } from './types';
2
+ /**
3
+ * FK 유래 컬럼 = 물리 컬럼을 보유한 관계 속성(RELATION* + dbAttrs). 형상(dataType/length/scale/
4
+ * physicalName/notNull 등)은 부모 식별자(PK) + 관계 identifying에서 파생된다.
5
+ * derivedFrom이 아니라 이 불변식을 쓰는 이유: derivedFrom은 세션 중 live propagation으로 만든 FK에만
6
+ * 붙고 어댑터가 로드 시 복원하지 않아(영속 데이터엔 0건) 로드된 다이어그램에선 FK 판정에서 통째로 누락된다.
7
+ * RELATION_REF(inverse nav, dbAttrs=0)는 물리 컬럼이 없어 제외.
8
+ */
9
+ export declare function isFkDerivedColumn(attr: Attribute): boolean;
10
+ /**
11
+ * FK 유래 컬럼 i의 원본(부모 식별자) 컬럼 — 물리명·타입·길이·스케일이 여기서 파생된다. FK 컬럼 자신의
12
+ * dbAttrs가 비어 있을 때(v1→v2 로드/레거시 데이터, 어댑터가 재전파를 하지 않음) placeholder·캔버스
13
+ * 표시에 쓴다(레거시 getForeignDatabaseAttributePlaceholder 동형). 1순위 derivedFrom.sourceAttributeRef
14
+ * (전파가 심은 권위), 2순위 관계 역참조로 부모 식별자 컬럼(derivedFrom 부재하는 레거시 v1 로드 FK 폴백).
15
+ * 못 찾으면 undefined.
16
+ */
17
+ export declare function resolveFkOriginColumn(attr: Attribute, childEntity: Entity | null | undefined, entities: readonly Entity[], associations: readonly Association[], i?: number): DbColumn | undefined;
@@ -0,0 +1,2 @@
1
+ import { ClassStereotype } from './types';
2
+ export declare function stereotypeLabel(s: ClassStereotype): string;
@@ -321,6 +321,13 @@ export interface AssociationEnd {
321
321
  * 이 ref가 그것을 가리킨다(diagramAdapter.assocFromHydrated). 레이아웃 앵커는 layout.sourceColumnRef로 분리.
322
322
  */
323
323
  attributeRef?: ModelId;
324
+ /**
325
+ * inverse nav(RELATION_REF) 미실체화 시 마지막 nav 필드명 기억용. navigable=false면 nav 속성 자체는
326
+ * 삭제되어(불변식 "navigable=true ⟺ nav 속성 존재" 유지·코드젠 무영향) 저장된 이름이 없다 — 이 힌트가
327
+ * 사용자가 편집했던 이름을 보관해, 인스펙터 비활성 필드 표시 및 재활성화 시 기본명 대신 복원에 쓰인다.
328
+ * 실체화되면 속성 name이 SoT이므로 이 힌트는 정리(재-off 시 현재 name을 다시 캡처).
329
+ */
330
+ navFieldNameHint?: string;
324
331
  /**
325
332
  * 라운드트립 전용 — 레거시 EMBED 직렬화의 인라인 속성 원형(EMBED_REF/EMBED_OWN).
326
333
  * EMBED hydration은 load-only라 저장 시 소유자로 펼친 표시 속성을 버리고 이 원형을 verbatim 환원한다