@operato/ops-contract 0.9.22 → 0.9.23

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.
@@ -374,3 +374,24 @@ export interface DomainDefinition {
374
374
  * 도메인 정의는 데이터 아티팩트라 로드 시점에 런타임 검증한다(컴파일타임 아님).
375
375
  */
376
376
  export declare function validateDomainDefinition(def: DomainDefinition): string[];
377
+ export interface DomainCatalog extends DomainDefinition {
378
+ /** semver. 같은 업종의 정의가 고쳐지면 이것이 오른다. */
379
+ version: string;
380
+ supplier?: string;
381
+ standards?: string[];
382
+ description?: string;
383
+ }
384
+ /** 스토어 목록·발견용 요약 — 정의 전체를 열지 않고 고르게 한다. */
385
+ export interface CatalogSummary {
386
+ id: string;
387
+ version: string;
388
+ label: string;
389
+ supplier?: string;
390
+ }
391
+ /**
392
+ * 배포 아티팩트 검증 = 정의 검증 + 판 번호.
393
+ *
394
+ * 정의의 참조무결성은 `validateDomainDefinition` 이 소유한다 — 여기서 다시 쓰지 않는다. 위반 목록을
395
+ * 돌려주고, 빈 배열이 유효다.
396
+ */
397
+ export declare function validateCatalog(cat: DomainCatalog): string[];
@@ -3,8 +3,8 @@
3
3
  * 커널이 "무엇이 있고 어떻게 흐르나"(타입 + 공정 route/BOM)를 **데이터로** 받는 형식. zero-dep(자기 타입).
4
4
  *
5
5
  * 특정 공정이 커널 코드에 하드코딩되던 것을 이 데이터 계약으로 대체한다(design/plans/domain-catalog-layering.md).
6
- * 스토어 패키지 `@operato/twin-catalog` 타입을 import type { EffectivePeriod } from './contract.ts'
7
- import 스토어 메타(version/supplier)를 얹어 배포한다(catalog kernel 의존).
6
+ * 판을 붙여 주고받는 꼴은파일 아래쪽의 `DomainCatalog` 전에는 `@operato/twin-catalog` 라는
7
+ * 별도 패키지였고, 2026-09-17 여기로 접었다.
8
8
  * 표준 앵커: GS1 EPCIS 2.0(bizStep) · ISA-95(WorkCenter·OperationsDefinition·BOM) · ISO 55000(Asset).
9
9
  */
10
10
  /**
@@ -136,3 +136,17 @@ export function validateDomainDefinition(def) {
136
136
  }
137
137
  return v;
138
138
  }
139
+ const CATALOG_SEMVER = /^\d+\.\d+\.\d+([-+].+)?$/;
140
+ /**
141
+ * 배포 아티팩트 검증 = 정의 검증 + 판 번호.
142
+ *
143
+ * 정의의 참조무결성은 `validateDomainDefinition` 이 소유한다 — 여기서 다시 쓰지 않는다. 위반 목록을
144
+ * 돌려주고, 빈 배열이 유효다.
145
+ */
146
+ export function validateCatalog(cat) {
147
+ const v = validateDomainDefinition(cat);
148
+ if (typeof cat?.version !== 'string' || !CATALOG_SEMVER.test(cat?.version || '')) {
149
+ v.push(`version semver 아님: ${cat?.version}`);
150
+ }
151
+ return v;
152
+ }
@@ -231,6 +231,7 @@ __export(index_exports, {
231
231
  transformationEvent: () => transformationEvent,
232
232
  unavailableVerdict: () => unavailableVerdict,
233
233
  unknownKindReason: () => unknownKindReason,
234
+ validateCatalog: () => validateCatalog,
234
235
  validateDomainDefinition: () => validateDomainDefinition,
235
236
  validateEpcisEvent: () => validateEpcisEvent,
236
237
  validatePerformance: () => validatePerformance,
@@ -2177,6 +2178,14 @@ function validateDomainDefinition(def) {
2177
2178
  }
2178
2179
  return v;
2179
2180
  }
2181
+ var CATALOG_SEMVER = /^\d+\.\d+\.\d+([-+].+)?$/;
2182
+ function validateCatalog(cat) {
2183
+ const v = validateDomainDefinition(cat);
2184
+ if (typeof cat?.version !== "string" || !CATALOG_SEMVER.test(cat?.version || "")) {
2185
+ v.push(`version semver \uC544\uB2D8: ${cat?.version}`);
2186
+ }
2187
+ return v;
2188
+ }
2180
2189
 
2181
2190
  // src/energy-ingest.ts
2182
2191
  function isEnergyRecord(record) {
@@ -4793,6 +4802,7 @@ function nonEmpty(value) {
4793
4802
  transformationEvent,
4794
4803
  unavailableVerdict,
4795
4804
  unknownKindReason,
4805
+ validateCatalog,
4796
4806
  validateDomainDefinition,
4797
4807
  validateEpcisEvent,
4798
4808
  validatePerformance,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/ops-contract",
3
- "version": "0.9.22",
3
+ "version": "0.9.23",
4
4
  "description": "Operations domain contract — the standard vocabulary that producers and readers agree on (EPCIS 2.0/GS1, ISA-95, IEC 61850/ISO 50001). Types, guards, validation. No state, no engine.",
5
5
  "type": "module",
6
6
  "main": "./dist-cjs/index.cjs",