@operato/ops-contract 0.9.45 → 0.9.46

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/dist/epcis.js CHANGED
@@ -403,7 +403,7 @@ export function itemMaterialDefinitionId(item) {
403
403
  /**
404
404
  * **이 품목 클래스의 그 로트** — `itemClassOf` 의 반대 방향. 시뮬의 도착 생성기처럼 품목 클래스만 들고 있는 곳이 부른다.
405
405
  *
406
- * `urn:epc:idpat:sgtin:P.R.*` → `lotClassUri({ gtin: 'P.R', lot })` — 자리 수가 틀리면 던진다
406
+ * `urn:epc:idpat:sgtin:P.R.*` → `lotClassUri({ gtin: 'P.R', lot })` — 자릿수가 틀리면 던진다
407
407
  * `<ns>/class/<품번>` · `<ns>:class:<품번>` → `lotClassUri({ namespace: <ns>, item: <품번>, lot })`
408
408
  * 그 밖(개체 · 이미 로트인 클래스 · 모르는 모양) → `undefined` — 로트를 붙일 자리를 지어내지 않는다
409
409
  *
@@ -510,7 +510,7 @@ export function classUri(namespace, classId) {
510
510
  *
511
511
  * ── 두 길 ──────────────────────────────────────────────────────────────────
512
512
  * · GTIN 이 있으면 LGTIN(`lgtinClass`). `gtin` 은 파서의 `gtinKey` 와 같은 모양 `CompanyPrefix.ItemRefAndIndicator`
513
- * 이다 — GTIN-14 만으로는 프리픽스 자리 수를 알 수 없어서 나눌 수 없다. 자리 수(`GS1_KEY_DIGITS`)가 틀리면
513
+ * 이다 — GTIN-14 만으로는 프리픽스 자릿수를 알 수 없어서 나눌 수 없다. 자리 수(`GS1_KEY_DIGITS`)가 틀리면
514
514
  * **던진다.** 사내 철자로 떨어지면 같은 로트가 두 글자가 된다.
515
515
  * · 없으면 `/class/` 뒤 **성분 하나** 안에서 가른다: `<품번>;lot=<로트>`(CBV 2.0 §8.3.4 — `/class/<품번>/lot/<로트>`
516
516
  * 는 계약의 `CBV_URL_CLASS` 가 거절한다).
@@ -779,8 +779,8 @@ const CBV_URN_CLASS = /^urn:[^:\s]+:(?:[^:\s]+:)*class:[^:\s]+$/;
779
779
  * **GS1 키의 자리 수 규약** — TDS 가 정한 합계다(회사 프리픽스 + 참조 = 고정 자리).
780
780
  *
781
781
  * ── 왜 여기서 보는가 (2026-08-22) ──────────────────────────────────────────
782
- * 검증기가 모양(`urn:epc:idpat:sgtin:`)만 보고 **자리 수를 보지 않았다.** 실측: 12자리·14자리 SGTIN 이
783
- * 전부 통과했다. 프리픽스를 바꾸는 작업에서 품목참조 자리 수를 맞추지 않으면 **조용히 어긋난
782
+ * 검증기가 모양(`urn:epc:idpat:sgtin:`)만 보고 **자릿수를 보지 않았다.** 실측: 12자리·14자리 SGTIN 이
783
+ * 전부 통과했다. 프리픽스를 바꾸는 작업에서 품목참조 자릿수를 맞추지 않으면 **조용히 어긋난
784
784
  * 식별자가 저널에 영구히 남고**, 어느 화면도 그것을 말해 주지 않는다.
785
785
  *
786
786
  * 합계만 본다 — 프리픽스가 몇 자리인지는 GS1 이 회사마다 다르게 배정하므로 우리가 알 수 없다.
@@ -811,7 +811,7 @@ const CBV_URN_CLASS = /^urn:[^:\s]+:(?:[^:\s]+:)*class:[^:\s]+$/;
811
811
  */
812
812
  const GS1_KEY_DIGITS = { sgtin: 13, lgtin: 13, sscc: 17, grai: 12, gdti: 12, sgln: 12 };
813
813
  /**
814
- * 그 GS1 키의 자리 수가 맞나 — 어긋나면 왜인지 말한다.
814
+ * 그 GS1 키의 자릿수가 맞나 — 어긋나면 왜인지 말한다.
815
815
  *
816
816
  * `urn:epc:{id,idpat,class}:<키>:<프리픽스>.<참조>[.<직렬>]` 모양만 본다. 그 밖의 형식(도메인 기반
817
817
  * 식별자 등)은 이 규약의 대상이 아니므로 아무 말도 하지 않는다.
@@ -829,7 +829,7 @@ export function gs1KeyDigitViolation(uri) {
829
829
  if (parts.length < 2)
830
830
  return `${m[1]} 형식 오류: ${uri} — 회사 프리픽스와 참조가 '.' 로 갈려야 한다`;
831
831
  const [prefix, ref] = parts;
832
- /* 패턴의 `*` 는 자리 수를 말하지 않는다 — 참조 자리가 `*` 면 합계를 셀 수 없으므로 넘어간다. */
832
+ /* 패턴의 `*` 는 자릿수를 말하지 않는다 — 참조 자리가 `*` 면 합계를 셀 수 없으므로 넘어간다. */
833
833
  if (ref === '*')
834
834
  return undefined;
835
835
  if (!/^\d+$/.test(prefix) || !/^\d+$/.test(ref)) {
@@ -839,21 +839,21 @@ export function gs1KeyDigitViolation(uri) {
839
839
  if (got === want)
840
840
  return undefined;
841
841
  return (`${m[1]} 자리 수 오류: ${uri} — 회사 프리픽스(${prefix.length}) + 참조(${ref.length}) = ${got} 이지만 ` +
842
- `${want} 여야 한다(GS1 TDS). 프리픽스를 바꾸면 참조 자리 수를 함께 맞춰야 한다.`);
842
+ `${want} 여야 한다(GS1 TDS). 프리픽스를 바꾸면 참조 자릿수를 함께 맞춰야 한다.`);
843
843
  }
844
844
  export function classIdentifierViolation(epcClass) {
845
845
  if (!epcClass)
846
- return `quantity epcClass 부정: ${epcClass}`;
846
+ return `quantity의 epcClass 오류: ${epcClass}`;
847
847
  const digits = gs1KeyDigitViolation(epcClass);
848
848
  if (digits)
849
- return `quantity epcClass 부정: ${digits}`;
849
+ return `quantity의 epcClass 오류: ${digits}`;
850
850
  if (EPC_CLASS_PREFIXES.some(p => epcClass.startsWith(p)))
851
851
  return undefined;
852
852
  if (epcClass.startsWith(DL_CANONICAL))
853
853
  return undefined;
854
854
  if (CBV_URL_CLASS.test(epcClass) || CBV_URN_CLASS.test(epcClass))
855
855
  return undefined;
856
- return (`quantity epcClass 부정: ${epcClass} — 클래스 식별자는 소유 권한을 말할 수 있는 모양이어야 한다 ` +
856
+ return (`quantity의 epcClass 오류: ${epcClass} — 클래스 식별자는 발급 권한을 식별할 수 있는 형식이어야 합니다. ` +
857
857
  `(EPC 클래스 urn:epc:idpat:/urn:epc:class: · CBV §8.3.4 http(s)://<도메인>/**/class/<id> · ` +
858
858
  `CBV §8.3.3 urn:<이름공간>:**:class:<id>)`);
859
859
  }
@@ -882,7 +882,7 @@ export function validateEpcisEvent(e) {
882
882
  if (!['ObjectEvent', 'AggregationEvent', 'TransactionEvent', 'TransformationEvent'].includes(e.type))
883
883
  v.push(`알 수 없는 type: ${e.type}`);
884
884
  if (typeof e.eventTime !== 'string' || !ISO_RE.test(e.eventTime))
885
- v.push('eventTime ISO8601 아님');
885
+ v.push('eventTime은 ISO 8601 형식이어야 합니다.');
886
886
  if (typeof e.eventTimeZoneOffset !== 'string' || !TZ_RE.test(e.eventTimeZoneOffset))
887
887
  v.push('eventTimeZoneOffset 형식 오류');
888
888
  /*
@@ -902,7 +902,7 @@ export function validateEpcisEvent(e) {
902
902
  if (e.eventID !== undefined && (typeof e.eventID !== 'string' || !e.eventID))
903
903
  v.push('eventID 가 빈 문자열');
904
904
  if (e.recordTime !== undefined && (typeof e.recordTime !== 'string' || !ISO_RE.test(e.recordTime))) {
905
- v.push('recordTime ISO8601 아님');
905
+ v.push('recordTime은 ISO 8601 형식이어야 합니다.');
906
906
  }
907
907
  /* 개체·로트 마스터데이터는 **생겨나는 순간에만** 실린다(§7.3.8) — ObjectEvent(ADD) · Transformation.
908
908
  * 아무 이벤트에나 허용하면 "생애 동안 정적" 이라는 성질이 깨지고 이벤트마다 값이 어긋난다. */
@@ -925,7 +925,7 @@ export function validateEpcisEvent(e) {
925
925
  const set = e.persistentDisposition.set ?? [];
926
926
  const unset = e.persistentDisposition.unset ?? [];
927
927
  if (!set.length && !unset.length)
928
- v.push('persistentDisposition 이 set·unset 둘 다 비어있음');
928
+ v.push('persistentDisposition 이 set·unset 둘 다 비어 있음');
929
929
  const both = set.filter(x => unset.includes(x));
930
930
  if (both.length)
931
931
  v.push(`persistentDisposition 이 같은 값을 set·unset 동시 지정: ${both.join(', ')}`);
@@ -940,7 +940,7 @@ export function validateEpcisEvent(e) {
940
940
  const d = e.errorDeclaration;
941
941
  /* 정정인데 언제 정정했는지 모르면 정정 순서를 판정할 수 없다 → 표준 필수. */
942
942
  if (typeof d?.declarationTime !== 'string' || !ISO_RE.test(d.declarationTime)) {
943
- v.push('errorDeclaration.declarationTime ISO8601 아님/누락');
943
+ v.push('errorDeclaration.declarationTime에 ISO 8601 형식의 시각을 지정하세요.');
944
944
  }
945
945
  if (d?.correctiveEventIDs !== undefined) {
946
946
  if (!Array.isArray(d.correctiveEventIDs))
@@ -952,31 +952,31 @@ export function validateEpcisEvent(e) {
952
952
  }
953
953
  if (e.type === 'ObjectEvent') {
954
954
  if (!ACTIONS.includes(e.action))
955
- v.push(`action 부정: ${e.action}`);
955
+ v.push(`지원하지 않는 action 값: ${e.action}`);
956
956
  if (!Array.isArray(e.epcList))
957
957
  v.push('ObjectEvent.epcList 누락');
958
958
  else if (e.epcList.length === 0 && !e.quantityList?.length)
959
- v.push('ObjectEvent: epcList/quantityList 둘 다 비어있음');
959
+ v.push('ObjectEvent: epcList/quantityList 둘 다 비어 있음');
960
960
  }
961
961
  else if (e.type === 'AggregationEvent') {
962
962
  if (!ACTIONS.includes(e.action))
963
- v.push(`action 부정: ${e.action}`);
963
+ v.push(`지원하지 않는 action 값: ${e.action}`);
964
964
  if (!e.parentID)
965
965
  v.push('AggregationEvent.parentID 누락');
966
966
  if (!e.childEPCs?.length && !e.childQuantityList?.length)
967
- v.push('AggregationEvent: childEPCs/childQuantityList 둘 다 비어있음');
967
+ v.push('AggregationEvent: childEPCs/childQuantityList 둘 다 비어 있음');
968
968
  }
969
969
  else if (e.type === 'TransactionEvent') {
970
970
  if (!ACTIONS.includes(e.action))
971
- v.push(`action 부정: ${e.action}`);
971
+ v.push(`지원하지 않는 action 값: ${e.action}`);
972
972
  if (!Array.isArray(e.bizTransactionList) || e.bizTransactionList.length === 0)
973
973
  v.push('TransactionEvent.bizTransactionList 누락');
974
974
  }
975
975
  else if (e.type === 'TransformationEvent') {
976
976
  if (!e.inputEPCList?.length && !e.inputQuantityList?.length)
977
- v.push('TransformationEvent: input 비어있음');
977
+ v.push('TransformationEvent: 입력 항목이 없습니다');
978
978
  if (!e.outputEPCList?.length && !e.outputQuantityList?.length)
979
- v.push('TransformationEvent: output 비어있음');
979
+ v.push('TransformationEvent: 출력 항목이 없습니다');
980
980
  }
981
981
  // 참조 무결성(경량): 모든 수량 리스트의 epcClass 는 idpat/class
982
982
  const qtyLists = [
@@ -996,18 +996,18 @@ export function validateEpcisEvent(e) {
996
996
  if (!hasQty) {
997
997
  /* 수량 미지정 = "모른다". 그때 단위만 남아 있으면 뜻이 없다 → 표준은 생략을 요구한다. */
998
998
  if (q.uom !== undefined)
999
- v.push('quantity 없으면 uom 도 없어야 한다(수량 미지정)');
999
+ v.push('quantity를 지정하지 않은 경우 uom도 생략해야 합니다.');
1000
1000
  continue;
1001
1001
  }
1002
1002
  if (typeof q.quantity !== 'number' || !Number.isFinite(q.quantity) || q.quantity <= 0) {
1003
- v.push('quantity 는 양수여야 한다(모르면 생략)');
1003
+ v.push('quantity는 양수여야 합니다. 수량을 알 수 없으면 생략하세요.');
1004
1004
  continue;
1005
1005
  }
1006
1006
  /* uom 없으면 개수 → 정수여야 한다. uom 있으면 물리량 → 소수 허용. */
1007
1007
  if (q.uom === undefined && !Number.isInteger(q.quantity))
1008
- v.push('uom 없는 quantity 는 정수(개수)여야 한다');
1008
+ v.push('uom을 생략한 경우 quantity는 개수를 나타내는 정수여야 합니다.');
1009
1009
  if (q.uom !== undefined && !/^[A-Z0-9]{2,3}$/.test(q.uom))
1010
- v.push(`uom 형식 부정(UN/CEFACT 권고 20 의 2~3자 코드): ${q.uom}`);
1010
+ v.push(`uom 형식 오류(UN/CEFACT 권고 20 의 2~3자 코드): ${q.uom}`);
1011
1011
  }
1012
1012
  return v;
1013
1013
  }
package/dist/erp.d.ts CHANGED
@@ -301,7 +301,7 @@ export interface ErpTraits {
301
301
  * 자재 소비가 실적과 **같은 문서**인가.
302
302
  *
303
303
  * SAP 는 별개 문서라 한쪽만 성공하는 순간이 있고, 함께 앉는 ERP 는 그 상태가 아예 없다. 별개인 곳에서
304
- * 하나로 다루면 반쯤 올라간 것을 아무도 못 본다. 함께인 곳에서 둘로 다루면 소비가 두 번 앉는다.
304
+ * 하나로 다루면 반쯤 올라간 것을 아무도 못 본다. 함께인 곳에서 둘로 다루면 자재 소비가 중복 반영될 수 있습니다..
305
305
  */
306
306
  materialWithPerformance: boolean;
307
307
  /**
package/dist/erp.js CHANGED
@@ -61,41 +61,41 @@ export function materialMovementKey(e) {
61
61
  export function validatePerformance(e, nowMs) {
62
62
  const errors = [];
63
63
  if (!String(e?.orderId ?? '').trim())
64
- errors.push('orderId 없음 — 어느 지시에 대한 실적인지 지어낼 수 없다');
64
+ errors.push('orderId 누락. 실적의 작업지시 ID를 지정하세요.');
65
65
  if (!String(e?.uom ?? '').trim())
66
- errors.push('uom 없음 — 단위 없는 수량은 정산에 쓸 수 없다');
66
+ errors.push('uom 누락. 정산할 수량의 단위를 지정하세요.');
67
67
  for (const [name, v] of [
68
68
  ['goodQuantity', e?.goodQuantity],
69
69
  ['scrapQuantity', e?.scrapQuantity]
70
70
  ]) {
71
71
  if (typeof v !== 'number' || !Number.isFinite(v))
72
- errors.push(`${name} 이 수가 아니다`);
72
+ errors.push(`${name} 값은 유한한 숫자여야 합니다`);
73
73
  else if (v < 0)
74
- errors.push(`${name} 이 음수다 — 되돌림은 역분개로 하고 음수 실적으로 하지 않는다`);
74
+ errors.push(`${name} 값은 0 이상이어야 합니다. 실적을 취소할 때는 역분개를 사용하세요.`);
75
75
  }
76
76
  if (typeof e?.goodQuantity === 'number' && typeof e?.scrapQuantity === 'number' && e.goodQuantity + e.scrapQuantity <= 0) {
77
- errors.push('만든 것이 하나도 없다 — 올릴 실적이 아니다');
77
+ errors.push('양품 또는 불량 수량이 있어야 실적을 등록할 수 있습니다.');
78
78
  }
79
79
  const from = Date.parse(String(e?.from ?? ''));
80
80
  const to = Date.parse(String(e?.to ?? ''));
81
81
  if (!Number.isFinite(from) || !Number.isFinite(to))
82
- errors.push('구간이 없다 — from · to 가 있어야 한다');
82
+ errors.push('실적 구간의 시작 시각(from)과 종료 시각(to)이 필요합니다.');
83
83
  else {
84
84
  if (to < from)
85
- errors.push('구간이 거꾸로다');
85
+ errors.push('실적의 종료 시각이 시작 시각보다 빠릅니다.');
86
86
  /* 마감된 구간의 사실이다. 아직 오지 않은 시각을 정산에 올리면 그 달의 장부가 틀린다. */
87
87
  if (to > nowMs)
88
- errors.push('아직 오지 않은 시각까지의 실적이다');
88
+ errors.push('실적의 종료 시각이 현재보다 늦습니다.');
89
89
  }
90
90
  for (const m of e?.materialActual ?? []) {
91
91
  if (!String(m?.definitionId ?? '').trim())
92
- errors.push('자재 줄에 definitionId 가 없다');
92
+ errors.push('자재 항목에 definitionId가 없습니다.');
93
93
  if (!String(m?.uom ?? '').trim())
94
- errors.push(`${m?.definitionId}: uom 없음 — 단위는 ERP 의 사실이므로 지어내지 않는다`);
94
+ errors.push(`${m?.definitionId}: uom 누락. ERP에 등록된 자재 단위를 지정하세요.`);
95
95
  if (typeof m?.quantity !== 'number' || !(m.quantity > 0))
96
96
  errors.push(`${m?.definitionId}: 수량이 0 이하다`);
97
97
  if (m?.use !== 'consumed' && m?.use !== 'produced') {
98
- errors.push(`${m?.definitionId}: use 가 consumed · produced 가 아니다`);
98
+ errors.push(`${m?.definitionId}: use 값은 consumed 또는 produced여야 합니다.`);
99
99
  }
100
100
  }
101
101
  return errors;
@@ -103,7 +103,7 @@ export function validatePerformance(e, nowMs) {
103
103
  /** 되돌림의 멱등 키 — 원래 실적의 키에 표식 하나. */
104
104
  export function reversalKey(performanceKey) {
105
105
  if (!String(performanceKey ?? '').trim())
106
- throw new Error('reversalKey: 되돌릴 실적의 키가 없다');
106
+ throw new Error('reversalKey: 취소할 실적의 키가 필요합니다.');
107
107
  return `${performanceKey}|reversal`;
108
108
  }
109
109
  /** 이 ERP 가 할 수 있다고 선언하는 것. 구현이 없으면 없는 것으로 읽는다. */
@@ -149,9 +149,9 @@ export function erpCapabilityGaps(adapter) {
149
149
  if (adapter.traits?.reversal !== 'api' && adapter.capabilities?.includes('reversal')) {
150
150
  gaps.push('reversal 능력을 선언했는데 traits.reversal 이 api 가 아니다 — 둘 중 하나가 틀렸다');
151
151
  }
152
- /* 자재가 실적과 같은 문서인 ERP 에 따로 올리는 문을 두면 소비가 두 번 앉는다. */
152
+ /* 자재가 실적과 같은 문서인 ERP 에 따로 올리는 문을 두면 자재 소비가 중복 반영될 수 있습니다.. */
153
153
  if (adapter.traits?.materialWithPerformance && typeof adapter.postMaterialMovement === 'function') {
154
- gaps.push('traits.materialWithPerformance 가 참인데 postMaterialMovement 가 따로 있다 — 소비가 두 번 앉는다');
154
+ gaps.push('traits.materialWithPerformance 가 참인데 postMaterialMovement 가 따로 있다 — 자재 소비가 중복 반영될 수 있습니다.');
155
155
  }
156
156
  /*
157
157
  * 사람이 반영하는 ERP 에 부르면 앉는 문이 있으면, 펌프가 그 문으로 「올라갔다」고 적는다 — 아무것도 안 앉았는데
@@ -159,7 +159,7 @@ export function erpCapabilityGaps(adapter) {
159
159
  */
160
160
  if (manual) {
161
161
  if (typeof adapter.postPerformance === 'function') {
162
- gaps.push('traits.posting 이 manual-export 인데 postPerformance 가 있다 — 부르면 앉는 ERP 가 아니다');
162
+ gaps.push('traits.posting 이 manual-export 인데 postPerformance 가 있다 — 수동 반영 방식에서는 API로 실적을 등록할 수 없습니다.');
163
163
  }
164
164
  if (typeof adapter.postMaterialMovement === 'function') {
165
165
  gaps.push('traits.posting 이 manual-export 인데 postMaterialMovement 가 있다');
@@ -169,7 +169,7 @@ export function erpCapabilityGaps(adapter) {
169
169
  }
170
170
  }
171
171
  if (adapter.traits?.posting !== 'api' && adapter.traits?.posting !== 'manual-export') {
172
- gaps.push('traits.posting 이 없다 — api 인지 manual-export 인지 말해야 펌프가 내보낸 줄을 올라간 것으로 적지 않는다');
172
+ gaps.push('traits.posting에 api 또는 manual-export를 지정하세요. 수동 반영용 내보내기를 ERP 등록 완료로 처리하지 않기 위해 필요한 설정입니다.');
173
173
  }
174
174
  return gaps;
175
175
  }
@@ -169,7 +169,7 @@ function resolveErrorDeclaration(spec, record, errors) {
169
169
  */
170
170
  if (!declarationTime) {
171
171
  if (reason || correctiveEventIDs.length) {
172
- errors.push('errorDeclaration 이 반쯤 왔다 — 이유·정정 대상은 있는데 declarationTime 이 없다(정정 시각은 지어낼 수 없다)');
172
+ errors.push('errorDeclaration에 정정 사유 또는 대상이 있지만 정정 시각(declarationTime)이 없습니다.');
173
173
  }
174
174
  return undefined;
175
175
  }
@@ -205,10 +205,10 @@ export function mapRecordChecked(record, mapping, eventTime) {
205
205
  * 메시지는 이벤트를 가리키고 이 메시지는 매핑을 가리킨다. 커넥터가 고칠 자리가 다르다.
206
206
  */
207
207
  if (!inputEPCList.length && !inputQuantityList.length) {
208
- errors.push('입력이 비었다 — 변환은 무엇이 들어갔는지 말해야 한다(EPCIS 2.0 §7.4.5)');
208
+ errors.push('변환 이벤트에 입력 항목이 필요합니다.(EPCIS 2.0 §7.4.5)');
209
209
  }
210
210
  if (!outputEPCList.length && !outputQuantityList.length) {
211
- errors.push('출력이 비었다 — 변환은 무엇이 나왔는지 말해야 한다(EPCIS 2.0 §7.4.5)');
211
+ errors.push('변환 이벤트에 출력 항목이 필요합니다.(EPCIS 2.0 §7.4.5)');
212
212
  }
213
213
  return {
214
214
  event: transformationEvent({
@@ -251,7 +251,7 @@ export function mapRecordChecked(record, mapping, eventTime) {
251
251
  /* 개체도 수량도 없으면 무엇을 관측했는지 말하지 않은 것이다 — 검증에 넘기기 전에 여기서 말해 준다
252
252
  (검증 메시지는 이벤트를 가리키고, 이 메시지는 **매핑**을 가리킨다: 커넥터가 고칠 곳이 다르다). */
253
253
  if (!epc && !quantityList.length) {
254
- errors.push('epc 와 quantityList 가 둘 다 비었다 — 개체 식별자나 클래스+수량 중 하나는 있어야 한다');
254
+ errors.push('epc 또는 quantityList가 필요합니다. 개체 식별자나 클래스·수량을 지정하세요.');
255
255
  }
256
256
  const ilmd = resolveObject(mapping.ilmd, record, 'ilmd', errors);
257
257
  return {
@@ -283,7 +283,7 @@ export function ingest(records, rules, opts) {
283
283
  for (const record of records) {
284
284
  const rule = ruleByType.get(String(record['sourceType']));
285
285
  if (!rule) {
286
- rejected.push({ record, errors: [`매칭 룰 없음: sourceType=${record['sourceType']}`] });
286
+ rejected.push({ record, errors: [`일치하는 매핑 규칙 없음: sourceType=${record['sourceType']}`] });
287
287
  continue;
288
288
  }
289
289
  const timeErrors = [];
package/dist/gs1.js CHANGED
@@ -37,7 +37,7 @@ const FIXED_LENGTH = {
37
37
  '11': 6, // 생산일
38
38
  '12': 6, // 지급기일
39
39
  '13': 6, // 포장일
40
- '15': 6, // 품질유지기한
40
+ '15': 6, // 품질 유지 기한
41
41
  '16': 6, // 판매기한
42
42
  '17': 6, // 사용기한
43
43
  '20': 2, // 제품 변형
@@ -64,9 +64,9 @@ export function ingestMasterData(records) {
64
64
  for (const r of arr) {
65
65
  const errors = [];
66
66
  if (!isMasterDataRecord(r))
67
- errors.push('vocabularyType · id · attributes 가 있어야 한다');
67
+ errors.push('vocabularyType, id, attributes를 지정해야 합니다.');
68
68
  else if (!Object.keys(r.attributes).length)
69
- errors.push('attributes 가 비었다 — 아무 뜻이 없는 진술이다');
69
+ errors.push('attributes에 속성을 하나 이상 지정해야 합니다.');
70
70
  /* 값이 `null` 인 속성은 「지운다」는 뜻이므로 빈 진술이 아니다(위 검사가 이름 수를 세므로 통과한다). */
71
71
  if (errors.length)
72
72
  rejected.push({ record: r, errors });
@@ -56,14 +56,14 @@ function shapeErrors(where, row, shape) {
56
56
  const v = row[f];
57
57
  const empty = v === undefined || v === null || (typeof v === 'string' && !v.trim());
58
58
  if (empty)
59
- errors.push(`${where}.${f} 가 없다 — 계약이 요구하는 이름이다`);
59
+ errors.push(`${where}.${f}: 필수 필드 누락`);
60
60
  }
61
61
  for (const [f, t] of Object.entries(shape.fields ?? {})) {
62
62
  const v = row[f];
63
63
  if (v === undefined || v === null)
64
64
  continue;
65
65
  if (t === 'number' && (typeof v !== 'number' || !Number.isFinite(v))) {
66
- errors.push(`${where}.${f} 가 수가 아니다: ${JSON.stringify(v)}`);
66
+ errors.push(`${where}.${f} 값은 유한한 숫자여야 합니다: ${JSON.stringify(v)}`);
67
67
  }
68
68
  else if (t !== 'number' && typeof v !== t) {
69
69
  errors.push(`${where}.${f} 가 ${t} 가 아니다: ${JSON.stringify(v)}`);
@@ -74,7 +74,7 @@ function shapeErrors(where, row, shape) {
74
74
  if (v === undefined || v === null)
75
75
  continue;
76
76
  if (!allowed.includes(String(v))) {
77
- errors.push(`${where}.${f} 에 계약에 없는 낱말이 왔다: ${JSON.stringify(v)} (${allowed.join(' · ')})`);
77
+ errors.push(`${where}.${f}에 허용되지 않는 값이 지정되었습니다: ${JSON.stringify(v)} (${allowed.join(' · ')})`);
78
78
  }
79
79
  }
80
80
  for (const f of shape.positive ?? []) {
@@ -83,7 +83,7 @@ function shapeErrors(where, row, shape) {
83
83
  if (v === undefined || v === null)
84
84
  continue;
85
85
  if (typeof v !== 'number' || !(v > 0)) {
86
- errors.push(`${where}.${f} 가 0 이하다: ${JSON.stringify(v)} — 모르는 수량은 0 이 아니라 비워서 말한다`);
86
+ errors.push(`${where}.${f} 가 0 이하다: ${JSON.stringify(v)} — 수량을 알 수 없으면 값을 생략하세요.`);
87
87
  }
88
88
  }
89
89
  return errors;
@@ -493,7 +493,7 @@ export function unknownKindReason() {
493
493
  return `${kind}: ${fields.join('+')}`;
494
494
  });
495
495
  // vocabulary-guard: allow 거부 이유가 계약 필드 이름을 말한다
496
- return `어느 운영 사실인지 모른다 — 갈래를 정하는 필드가 필요하다(${shapes.join(' · ')}). epc 를 든 레코드는 EPCIS 문으로 간다`;
496
+ return `운영 레코드의 유형을 판별할 수 없습니다. 유형을 식별할 필드가 필요합니다(${shapes.join(' · ')}). epc가 포함된 레코드는 EPCIS 처리 경로에 제출하세요.`;
497
497
  }
498
498
  /**
499
499
  * 판정 순서 — 표의 `matchOrder` 에서 한 번만 만든다.
@@ -561,7 +561,7 @@ export function ingestOperationalRecords(records, opts) {
561
561
  for (const name of spec.required) {
562
562
  const v = r[name];
563
563
  if (v === undefined || v === null || v === '')
564
- errors.push(`${kind}: ${name} 없음 — 지어낼 수 없는 값이다`);
564
+ errors.push(`${kind}: ${name}: 필수 값 누락`);
565
565
  }
566
566
  const data = {};
567
567
  for (const [name, type] of Object.entries(spec.fields)) {
@@ -571,12 +571,12 @@ export function ingestOperationalRecords(records, opts) {
571
571
  switch (type) {
572
572
  case 'string': {
573
573
  if (typeof v !== 'string') {
574
- errors.push(`${kind}.${name} 이 문자열이 아니다: ${JSON.stringify(v)}`);
574
+ errors.push(`${kind}.${name} 값은 문자열이어야 합니다: ${JSON.stringify(v)}`);
575
575
  break;
576
576
  }
577
577
  const allowed = spec.enums?.[name];
578
578
  if (allowed && !allowed.includes(v)) {
579
- errors.push(`${kind}.${name} 이 커널이 다루는 낱말이 아니다: ${JSON.stringify(v)} — 받는 값은 ${allowed.join(' · ')}`);
579
+ errors.push(`${kind}.${name}에 허용되지 않는 값이 지정되었습니다: ${JSON.stringify(v)} — 허용 값: ${allowed.join(' · ')}`);
580
580
  break;
581
581
  }
582
582
  data[name] = v;
@@ -585,7 +585,7 @@ export function ingestOperationalRecords(records, opts) {
585
585
  case 'number': {
586
586
  const n = Number(v);
587
587
  if (typeof v === 'boolean' || !Number.isFinite(n)) {
588
- errors.push(`${kind}.${name} 가 수가 아니다: ${JSON.stringify(v)}`);
588
+ errors.push(`${kind}.${name} 값은 유한한 숫자여야 합니다: ${JSON.stringify(v)}`);
589
589
  break;
590
590
  }
591
591
  /* 진척은 비율이다 — 백분율(95)을 그대로 받으면 화면이 9,500% 를 말한다. */
@@ -602,7 +602,7 @@ export function ingestOperationalRecords(records, opts) {
602
602
  }
603
603
  case 'boolean': {
604
604
  if (typeof v !== 'boolean') {
605
- errors.push(`${kind}.${name} 가 참/거짓이 아니다: ${JSON.stringify(v)}`);
605
+ errors.push(`${kind}.${name} 값은 불리언이어야 합니다: ${JSON.stringify(v)}`);
606
606
  break;
607
607
  }
608
608
  data[name] = v;
@@ -610,7 +610,7 @@ export function ingestOperationalRecords(records, opts) {
610
610
  }
611
611
  case 'string[]': {
612
612
  if (!Array.isArray(v) || v.some(x => typeof x !== 'string')) {
613
- errors.push(`${kind}.${name} 가 문자열 배열이 아니다: ${JSON.stringify(v)}`);
613
+ errors.push(`${kind}.${name} 값은 문자열 배열이어야 합니다: ${JSON.stringify(v)}`);
614
614
  break;
615
615
  }
616
616
  data[name] = v.slice();
@@ -618,7 +618,7 @@ export function ingestOperationalRecords(records, opts) {
618
618
  }
619
619
  case 'object': {
620
620
  if (Array.isArray(v) || typeof v !== 'object') {
621
- errors.push(`${kind}.${name} 가 객체가 아니다: ${JSON.stringify(v)}`);
621
+ errors.push(`${kind}.${name} 값은 객체여야 합니다: ${JSON.stringify(v)}`);
622
622
  break;
623
623
  }
624
624
  errors.push(...shapeErrors(`${kind}.${name}`, v, spec.shapes?.[name]));
@@ -627,7 +627,7 @@ export function ingestOperationalRecords(records, opts) {
627
627
  }
628
628
  case 'object[]': {
629
629
  if (!Array.isArray(v) || v.some(x => !x || typeof x !== 'object')) {
630
- errors.push(`${kind}.${name} 가 객체 배열이 아니다: ${JSON.stringify(v)}`);
630
+ errors.push(`${kind}.${name} 값은 객체 배열이어야 합니다: ${JSON.stringify(v)}`);
631
631
  break;
632
632
  }
633
633
  v.forEach((x, i) => errors.push(...shapeErrors(`${kind}.${name}[${i}]`, x, spec.shapes?.[name])));
@@ -670,7 +670,7 @@ export function ingestOperationalRecords(records, opts) {
670
670
  const atMs = at ? Date.parse(at) : Number.NaN;
671
671
  if (!Number.isFinite(atMs)) {
672
672
  /* 시각이 없으면 순서를 판정할 수 없다 — 늦게 온 옛 사실이 최신 상태를 덮어써 위치가 과거로 튄다. */
673
- errors.push(`${kind}: at 없음/형식 오류 — 시각 없이는 늦게 온 옛 사실을 걸러낼 수 없다`);
673
+ errors.push(`${kind}: at 없음/형식 오류 — 이전 이벤트가 뒤늦게 도착했는지 판단하려면 시각이 필요합니다.`);
674
674
  }
675
675
  /*
676
676
  * 아직 오지 않은 구간은 마감된 사실이 아니다 — 에너지의 마감된 구간과 같은 규칙이다. 받으면
@@ -679,7 +679,7 @@ export function ingestOperationalRecords(records, opts) {
679
679
  if (closedPeriodEnd && opts.defaultEventTime) {
680
680
  const nowMs = Date.parse(opts.defaultEventTime);
681
681
  if (Number.isFinite(nowMs) && Number.isFinite(atMs) && atMs > nowMs) {
682
- errors.push(`${kind}: 아직 오지 않은 시각의 사실이다(${closedPeriodEnd}) — 끝나지 않은 구간은 마감된 사실이 아니다`);
682
+ errors.push(`${kind}: 아직 오지 않은 시각의 사실이다(${closedPeriodEnd}) — 종료된 구간만 마감할 수 있습니다.`);
683
683
  }
684
684
  }
685
685
  if (errors.length) {
@@ -29,7 +29,7 @@ function validateGenerator(g, at) {
29
29
  if (!s?.gtin || typeof s.gtin !== 'string')
30
30
  return bad('scenario-sku-gtin-required', { at, kind: g.kind });
31
31
  /*
32
- * 자리 수가 틀린 GTIN 은 선언에서 거절한다(2026-09-24). 도착 생성기가 이 품목으로 로트 클래스를 만들 때
32
+ * 자릿수가 틀린 GTIN 은 선언에서 거절한다(2026-09-24). 도착 생성기가 이 품목으로 로트 클래스를 만들 때
33
33
  * 계약이 던지므로(`lotClassUri`), 여기서 거르지 않으면 시뮬이 도중에 멈춘다 — 선언이 틀린 것은 선언에서 말한다.
34
34
  */
35
35
  const digits = gs1KeyDigitViolation(s.gtin);
package/dist/webhook.d.ts CHANGED
@@ -227,7 +227,7 @@ export interface WebhookResponse {
227
227
  export interface WebhookEnvelope {
228
228
  /** 이 단위 안에서 1씩 증가한다. */
229
229
  seq: number;
230
- /** 번호를 매기는 단위의 이름. 보내는 쪽이 정하고 받는 쪽은 열쇠로만 다룬다. */
230
+ /** 번호를 매기는 단위의 이름. 보내는 쪽이 정하고 받는 쪽은 키로만 사용한다. */
231
231
  scope: string;
232
232
  /**
233
233
  * Delivery purpose. `scope` remains the source-owned numbering stream;
package/dist/yield.d.ts CHANGED
@@ -67,7 +67,7 @@ export interface FirstPassYield {
67
67
  * 트윈과 MES 가 각자 이 문장을 지키지 않으면 같은 이름으로 다른 수가 나오고, 그때 어느 쪽이 맞는지
68
68
  * 말할 수 없다.
69
69
  */
70
- export declare const FIRST_PASS_RULE = "\uC7AC\uC791\uC5C5\u00B7\uC218\uB9AC\uB85C \uD1B5\uACFC\uD55C \uC0B0\uCD9C\uC740 \uC6D0\uB798 \uACF5\uC815 \uC2E4\uC801\uC758 \uC591\uD488\uC5D0 \uB418\uB354\uD558\uC9C0 \uC54A\uB294\uB2E4 \u2014 \uADF8\uAC83\uC744 \uB354\uD558\uBA74 \uC774 \uC218\uB294 \uD488\uC9C8\uB960\uC774 \uB41C\uB2E4";
70
+ export declare const FIRST_PASS_RULE = "\uC7AC\uC791\uC5C5\u00B7\uC218\uB9AC \uD6C4 \uD569\uACA9\uD55C \uC218\uB7C9\uC740 \uCD5C\uCD08 \uACF5\uC815\uC758 \uC591\uD488 \uC218\uB7C9\uC5D0 \uD569\uC0B0\uD558\uC9C0 \uC54A\uB294\uB2E4. \uD569\uC0B0\uD558\uBA74 \uCD5C\uCD08 \uD569\uACA9\uB960\uC774 \uC544\uB2CC \uD488\uC9C8\uB960\uC744 \uACC4\uC0B0\uD558\uAC8C \uB41C\uB2E4.";
71
71
  /**
72
72
  * 공정 하나의 직행수율.
73
73
  *
package/dist/yield.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * 트윈과 MES 가 각자 이 문장을 지키지 않으면 같은 이름으로 다른 수가 나오고, 그때 어느 쪽이 맞는지
5
5
  * 말할 수 없다.
6
6
  */
7
- export const FIRST_PASS_RULE = '재작업·수리로 통과한 산출은 원래 공정 실적의 양품에 되더하지 않는다 — 그것을 더하면 이 수는 품질률이 된다';
7
+ export const FIRST_PASS_RULE = '재작업·수리 후 합격한 수량은 최초 공정의 양품 수량에 합산하지 않는다. 합산하면 최초 합격률이 아닌 품질률을 계산하게 된다.';
8
8
  const finite = (n) => typeof n === 'number' && Number.isFinite(n);
9
9
  /**
10
10
  * 공정 하나의 직행수율.