@operato/ops-contract 0.9.41 → 0.9.43
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/capability.d.ts +6 -1
- package/dist/capability.js +0 -13
- package/dist/contract.d.ts +15 -9
- package/dist/contract.js +4 -0
- package/dist/domain-definition.d.ts +1 -1
- package/dist/domain-definition.js +2 -2
- package/dist/epcis.d.ts +45 -0
- package/dist/epcis.js +72 -1
- package/dist/erp.d.ts +4 -4
- package/dist/gs1.d.ts +96 -0
- package/dist/gs1.js +346 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lot-lineage.d.ts +50 -0
- package/dist/lot-lineage.js +76 -0
- package/dist/operational-ingest.js +4 -4
- package/dist/party.d.ts +70 -0
- package/dist/party.js +131 -0
- package/dist/wms-profile.d.ts +20 -0
- package/dist/wms-profile.js +21 -0
- package/dist/yield.d.ts +1 -1
- package/dist/yms-profile.d.ts +74 -0
- package/dist/yms-profile.js +79 -0
- package/dist-cjs/index.cjs +552 -100
- package/package.json +11 -2
package/dist/gs1.js
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { lgtinClass, parseEpc, sgtinClass } from "./epcis.js";
|
|
2
|
+
/**
|
|
3
|
+
* GS1 바코드가 낸 문자열을 뜯는다 — **순수 계산.**
|
|
4
|
+
*
|
|
5
|
+
* ── 왜 계약에 있나 (2026-10-23) ──────────────────────────────────────────────
|
|
6
|
+
* plant 의 현장 화면(스테이션)에만 있던 것을 옮겼다. 창고의 ID Lens(ADR-0133)도 라벨을 읽게 되면서 두
|
|
7
|
+
* 제품이 같은 것을 뜯게 됐고, 바코드 원문 → EPC 식별자는 `parseEpc` 와 한 줄로 이어지는 표준 지식이다
|
|
8
|
+
* (수석 아키텍트 판정). 두 방향 — 라벨 숫자 → 식별자 후보, 식별자 → 라벨 숫자 — 이 이 파일 한 곳에 있다.
|
|
9
|
+
*
|
|
10
|
+
* ── 왜 우리가 쓰나 ─────────────────────────────────────────────────────────
|
|
11
|
+
* 저장소를 다 뒤졌다. `barcode-base`·`barcode-ui` 는 바코드를 **만드는** 것이고 읽은 것을 뜯지 않는다.
|
|
12
|
+
* 계약에는 `parseEpc`(EPC URI 를 뜯는다)와 `lgtinClass`(식별자를 짓는다)가 있는데, 그 둘 사이의
|
|
13
|
+
* **바코드 원문 → 품번·로트** 자리가 비어 있다.
|
|
14
|
+
*
|
|
15
|
+
* ── 두 모양이 온다 ─────────────────────────────────────────────────────────
|
|
16
|
+
* 스캐너 설정에 따라 괄호가 붙거나 안 붙는다. 붙지 않으면 가변 길이 항목의 끝을 FNC1 이 말한다.
|
|
17
|
+
*
|
|
18
|
+
* (01)08801234567890(10)LOT-A 사람이 읽는 표기. 괄호가 마디를 가른다
|
|
19
|
+
* 0108801234567890⟨FNC1⟩10LOT-A 원문. 가변 길이 마디의 끝을 FNC1 이 알린다
|
|
20
|
+
*
|
|
21
|
+
* ── 모르면 모른다고 한다 ────────────────────────────────────────────────────
|
|
22
|
+
* 못 뜯은 것을 짐작으로 채우지 않는다. 엉뚱한 품번으로 자재가 투입되면 그 실적은 나중에 아무도 못
|
|
23
|
+
* 고치고, 계보가 조용히 틀린다. 못 뜯으면 **원문을 그대로 들고** 못 뜯었다고 말한다.
|
|
24
|
+
*/
|
|
25
|
+
/** 가변 길이 항목의 끝을 알리는 글자(그룹 구분자). */
|
|
26
|
+
const FNC1 = '\x1d';
|
|
27
|
+
/**
|
|
28
|
+
* 길이가 정해진 항목들 — 이것만 FNC1 없이 이어 붙일 수 있다.
|
|
29
|
+
*
|
|
30
|
+
* 여기 없는 AI 는 **가변 길이로 본다.** 반대로 하면(모르는 것을 고정으로 보면) 뒤엣것까지 함께 먹어
|
|
31
|
+
* 품번이 조용히 길어진다.
|
|
32
|
+
*/
|
|
33
|
+
const FIXED_LENGTH = {
|
|
34
|
+
'00': 18, // SSCC
|
|
35
|
+
'01': 14, // GTIN
|
|
36
|
+
'02': 14, // 포장 안 품목의 GTIN
|
|
37
|
+
'11': 6, // 생산일
|
|
38
|
+
'12': 6, // 지급기일
|
|
39
|
+
'13': 6, // 포장일
|
|
40
|
+
'15': 6, // 품질유지기한
|
|
41
|
+
'16': 6, // 판매기한
|
|
42
|
+
'17': 6, // 사용기한
|
|
43
|
+
'20': 2, // 제품 변형
|
|
44
|
+
'414': 13 // 물리적 위치의 GLN
|
|
45
|
+
};
|
|
46
|
+
/** 우리가 이름 붙인 가변 길이 항목들. `254` 는 GLN 확장(같은 GLN 안의 자리)이다. */
|
|
47
|
+
const KNOWN_VARIABLE = ['10', '21', '30', '254'];
|
|
48
|
+
/** 괄호 표기인가. `(01)…` 처럼 숫자 두 자리 이상을 괄호로 감쌌으면 그렇다. */
|
|
49
|
+
function isBracketed(value) {
|
|
50
|
+
return /^\(\d{2,4}\)/.test(value);
|
|
51
|
+
}
|
|
52
|
+
export function parseGs1(value) {
|
|
53
|
+
const raw = value;
|
|
54
|
+
if (!raw?.trim()) {
|
|
55
|
+
return { ok: false, because: 'not-gs1', raw };
|
|
56
|
+
}
|
|
57
|
+
const parsed = isBracketed(raw) ? fromBracketed(raw) : fromRaw(raw);
|
|
58
|
+
if (!parsed.ok) {
|
|
59
|
+
return parsed;
|
|
60
|
+
}
|
|
61
|
+
const found = parsed.elements;
|
|
62
|
+
const count = found['30'] !== undefined ? Number(found['30']) : undefined;
|
|
63
|
+
return {
|
|
64
|
+
ok: true,
|
|
65
|
+
scan: {
|
|
66
|
+
sscc: found['00'],
|
|
67
|
+
gln: found['414'],
|
|
68
|
+
glnExtension: found['254'],
|
|
69
|
+
gtin: found['01'],
|
|
70
|
+
lot: found['10'],
|
|
71
|
+
serial: found['21'],
|
|
72
|
+
useBy: found['17'],
|
|
73
|
+
/* 숫자가 아니면 담지 않는다 — `NaN` 을 수량으로 두면 더하는 쪽에서 합계가 통째로 사라진다. */
|
|
74
|
+
count: count !== undefined && Number.isFinite(count) ? count : undefined,
|
|
75
|
+
elements: found,
|
|
76
|
+
raw
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** `(01)08801234567890(10)LOT-A` — 괄호가 마디를 가르므로 길이표가 필요 없다. */
|
|
81
|
+
function fromBracketed(raw) {
|
|
82
|
+
const elements = {};
|
|
83
|
+
const pattern = /\((\d{2,4})\)([^(]*)/g;
|
|
84
|
+
let match;
|
|
85
|
+
let consumed = 0;
|
|
86
|
+
while ((match = pattern.exec(raw)) !== null) {
|
|
87
|
+
const ai = match[1];
|
|
88
|
+
const value = match[2].trim();
|
|
89
|
+
const fixed = FIXED_LENGTH[ai];
|
|
90
|
+
/*
|
|
91
|
+
* 길이를 아는 항목은 **정확히 그 길이여야 한다.** 괄호 표기에서는 마디의 끝을 다음 괄호가 정하므로,
|
|
92
|
+
* 값 뒤에 딴 글자가 붙어 있어도 그대로 들어온다 — `(01)08801234567890XYZ` 가 품번 17자리로 앉는다.
|
|
93
|
+
* 그러면 마스터에서 못 찾고 「모르는 품목」이 되는데, 진짜 원인은 라벨이 깨진 것이다.
|
|
94
|
+
*/
|
|
95
|
+
if (fixed !== undefined && value.length !== fixed) {
|
|
96
|
+
return { ok: false, because: value.length < fixed ? 'truncated' : 'unterminated', raw };
|
|
97
|
+
}
|
|
98
|
+
elements[ai] = value;
|
|
99
|
+
consumed = match.index + match[0].length;
|
|
100
|
+
}
|
|
101
|
+
if (!Object.keys(elements).length || consumed !== raw.length) {
|
|
102
|
+
/* 괄호 밖에 남은 글자가 있다. 어디에 붙는 값인지 모르므로 짐작하지 않는다. */
|
|
103
|
+
return { ok: false, because: 'not-gs1', raw };
|
|
104
|
+
}
|
|
105
|
+
return { ok: true, elements };
|
|
106
|
+
}
|
|
107
|
+
/** `0108801234567890` 에 FNC1 로 이어진 원문. 길이표가 마디를 가른다. */
|
|
108
|
+
function fromRaw(raw) {
|
|
109
|
+
const elements = {};
|
|
110
|
+
let rest = raw;
|
|
111
|
+
while (rest.length) {
|
|
112
|
+
/* FNC1 이 남아 있으면 버린다 — 앞 마디의 끝을 알린 것이고 그 일은 끝났다. */
|
|
113
|
+
if (rest.startsWith(FNC1)) {
|
|
114
|
+
rest = rest.slice(1);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const ai = aiAt(rest);
|
|
118
|
+
if (!ai) {
|
|
119
|
+
/* 뜯다가 막힌 것과 처음부터 GS1 이 아닌 것은 다른 일이다. */
|
|
120
|
+
return { ok: false, because: Object.keys(elements).length ? 'unterminated' : 'not-gs1', raw };
|
|
121
|
+
}
|
|
122
|
+
rest = rest.slice(ai.length);
|
|
123
|
+
const fixed = FIXED_LENGTH[ai];
|
|
124
|
+
if (fixed !== undefined) {
|
|
125
|
+
if (rest.length < fixed) {
|
|
126
|
+
return { ok: false, because: 'truncated', raw };
|
|
127
|
+
}
|
|
128
|
+
const value = rest.slice(0, fixed);
|
|
129
|
+
/*
|
|
130
|
+
* 길이만큼 떼었는데 그 안에 FNC1 이 들어 있다. 앞 마디가 선언한 길이보다 짧게 온 것이고, 그대로
|
|
131
|
+
* 쓰면 **구분자를 값의 일부로 삼아** 뒤엣것까지 밀린다.
|
|
132
|
+
*/
|
|
133
|
+
if (value.includes(FNC1)) {
|
|
134
|
+
return { ok: false, because: 'truncated', raw };
|
|
135
|
+
}
|
|
136
|
+
elements[ai] = value;
|
|
137
|
+
rest = rest.slice(fixed);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
/*
|
|
141
|
+
* 가변 길이다. FNC1 까지가 값이고, 없으면 **끝까지**가 값이다 — 마지막 마디에는 FNC1 을 붙이지
|
|
142
|
+
* 않는 것이 표준이다. 뒤에 다른 마디가 이어졌는데 FNC1 이 없으면 우리가 가를 방법이 없고, 그때는
|
|
143
|
+
* 그 값이 길어진 채로 남는다. 스캐너가 FNC1 을 보내도록 맞추는 것이 답이다.
|
|
144
|
+
*/
|
|
145
|
+
const end = rest.indexOf(FNC1);
|
|
146
|
+
elements[ai] = end === -1 ? rest : rest.slice(0, end);
|
|
147
|
+
rest = end === -1 ? '' : rest.slice(end + 1);
|
|
148
|
+
}
|
|
149
|
+
return Object.keys(elements).length ? { ok: true, elements } : { ok: false, because: 'not-gs1', raw };
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 맨 앞의 AI 를 집는다.
|
|
153
|
+
*
|
|
154
|
+
* AI 는 2~4 자리이고 어느 것인지는 **앞 두 자리가 정한다.** 두 자리로 아는 것을 먼저 보고, 그다음에
|
|
155
|
+
* 세 자리로 아는 것(`414` · `254`), 그다음에 네 자리를 본다. 늘리기만 하면 `30`(수량)을 `3010` 같은 것으로,
|
|
156
|
+
* `414`(위치)를 `4140` 으로 잘못 읽는다.
|
|
157
|
+
*/
|
|
158
|
+
function aiAt(rest) {
|
|
159
|
+
const two = rest.slice(0, 2);
|
|
160
|
+
if (!/^\d{2}$/.test(two)) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
if (FIXED_LENGTH[two] !== undefined || KNOWN_VARIABLE.includes(two)) {
|
|
164
|
+
return two;
|
|
165
|
+
}
|
|
166
|
+
const three = rest.slice(0, 3);
|
|
167
|
+
if (/^\d{3}$/.test(three) && (FIXED_LENGTH[three] !== undefined || KNOWN_VARIABLE.includes(three))) {
|
|
168
|
+
return three;
|
|
169
|
+
}
|
|
170
|
+
/* 나머지는 네 자리까지 본다 — 무게·부피처럼 마지막 자리가 소수점 자리인 것들이다. */
|
|
171
|
+
const four = rest.slice(0, 4);
|
|
172
|
+
return /^\d{4}$/.test(four) ? four : two;
|
|
173
|
+
}
|
|
174
|
+
// ── 라벨 숫자 ↔ EPC 식별자 ────────────────────────────────────────────────────
|
|
175
|
+
/** GS1 검사 숫자(mod 10, 오른쪽부터 3·1). `body` 는 검사 숫자를 뺀 숫자열. */
|
|
176
|
+
function checkDigitOf(body) {
|
|
177
|
+
const sum = [...body].reverse().reduce((total, digit, at) => total + Number(digit) * (at % 2 === 0 ? 3 : 1), 0);
|
|
178
|
+
return String((10 - (sum % 10)) % 10);
|
|
179
|
+
}
|
|
180
|
+
/** 검사 숫자까지 맞는 n 자리 숫자인가. */
|
|
181
|
+
function wellFormed(digits, length) {
|
|
182
|
+
return !!digits && digits.length === length && /^\d+$/.test(digits) && checkDigitOf(digits.slice(0, -1)) === digits.slice(-1);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* 회사 프리픽스의 자리 수 — GS1 이 회사마다 6~12 자리로 배정하므로 **숫자만으로는 알 수 없다**(`gs1KeyDigitViolation`
|
|
186
|
+
* 이 합계만 보는 까닭과 같다). 그래서 라벨 숫자 하나는 식별자 하나가 아니라 **후보 일곱**이 된다.
|
|
187
|
+
*/
|
|
188
|
+
const PREFIX_LENGTHS = [6, 7, 8, 9, 10, 11, 12];
|
|
189
|
+
/**
|
|
190
|
+
* 라벨이 말하는 EPC 식별자의 **후보** — 뜯은 결과에서.
|
|
191
|
+
*
|
|
192
|
+
* AI 00 (SSCC) → `urn:epc:id:sscc:<프리픽스>.<확장+일련>`
|
|
193
|
+
* AI 01 + 10 (GTIN·로트) → `urn:epc:class:lgtin:<프리픽스>.<표시자+품목참조>.<로트>`
|
|
194
|
+
* AI 01 (GTIN) → `urn:epc:idpat:sgtin:<프리픽스>.<표시자+품목참조>.*`
|
|
195
|
+
* AI 414 (+254) → `urn:epc:id:sgln:<프리픽스>.<위치참조>.<확장, 없으면 0>`
|
|
196
|
+
*
|
|
197
|
+
* 검사 숫자가 틀린 값은 후보를 내지 않는다 — 깨진 라벨을 짐작으로 고치지 않는다. 후보는 **어느 것이 맞는지
|
|
198
|
+
* 말하지 않는다.** 저장된 식별자와 정확히 같은 것을 찾아 확정하는 일은 읽는 쪽 문이 한다(ADR-0133 2-1: GS1
|
|
199
|
+
* 결과는 보조 후보이고 그것만으로 대상을 확정하지 않는다).
|
|
200
|
+
*/
|
|
201
|
+
export function epcCandidatesOfGs1(scan) {
|
|
202
|
+
const out = [];
|
|
203
|
+
if (wellFormed(scan.sscc, 18)) {
|
|
204
|
+
const d = scan.sscc;
|
|
205
|
+
for (const l of PREFIX_LENGTHS)
|
|
206
|
+
out.push(`urn:epc:id:sscc:${d.slice(1, 1 + l)}.${d[0]}${d.slice(1 + l, 17)}`);
|
|
207
|
+
}
|
|
208
|
+
if (wellFormed(scan.gtin, 14)) {
|
|
209
|
+
const d = scan.gtin;
|
|
210
|
+
for (const l of PREFIX_LENGTHS) {
|
|
211
|
+
const prefix = d.slice(1, 1 + l);
|
|
212
|
+
const itemRefAndIndicator = d[0] + d.slice(1 + l, 13);
|
|
213
|
+
out.push(scan.lot ? lgtinClass(prefix, itemRefAndIndicator, scan.lot) : sgtinClass(prefix, itemRefAndIndicator));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (wellFormed(scan.gln, 13)) {
|
|
217
|
+
const d = scan.gln;
|
|
218
|
+
for (const l of PREFIX_LENGTHS)
|
|
219
|
+
out.push(`urn:epc:id:sgln:${d.slice(0, l)}.${d.slice(l, 12)}.${scan.glnExtension || '0'}`);
|
|
220
|
+
}
|
|
221
|
+
return out;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* SSCC 식별자의 라벨 숫자 18자리(검사 숫자 포함) — 용기 라벨(AI 00)과 견줄 때. SSCC 가 아니면 `undefined`.
|
|
225
|
+
*
|
|
226
|
+
* TDS: 확장 숫자(일련 참조의 첫 자리) + 프리픽스 + 일련 참조의 나머지, 그리고 검사 숫자.
|
|
227
|
+
*/
|
|
228
|
+
export function ssccDigitsOf(uri) {
|
|
229
|
+
const match = /^urn:epc:id:sscc:(\d+)\.(\d+)$/.exec(uri ?? '');
|
|
230
|
+
if (!match)
|
|
231
|
+
return undefined;
|
|
232
|
+
const [, prefix, reference] = match;
|
|
233
|
+
const body = reference[0] + prefix + reference.slice(1);
|
|
234
|
+
if (body.length !== 17)
|
|
235
|
+
return undefined;
|
|
236
|
+
return body + checkDigitOf(body);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* 품목 클래스(`urn:epc:idpat:sgtin:<프리픽스>.<표시자+품목참조>.*`)의 GTIN-14 — 품목 라벨(AI 01)과 견줄 때.
|
|
240
|
+
* 그 모양이 아니면 `undefined`.
|
|
241
|
+
*/
|
|
242
|
+
export function gtin14OfItemClass(definitionId) {
|
|
243
|
+
const match = /^urn:epc:idpat:sgtin:(\d+)\.(\d+)\.\*$/.exec(definitionId ?? '');
|
|
244
|
+
if (!match)
|
|
245
|
+
return undefined;
|
|
246
|
+
const [, prefix, reference] = match;
|
|
247
|
+
const body = reference[0] + prefix + reference.slice(1);
|
|
248
|
+
if (body.length !== 13)
|
|
249
|
+
return undefined;
|
|
250
|
+
return body + checkDigitOf(body);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* 품목 식별자가 말하는 GTIN-14 — 품목 클래스 모양이면 그 GTIN(`gtin14OfItemClass`), 품목 이름이 GTIN 그 자체(8 · 12 ·
|
|
254
|
+
* 13 · 14 자리)면 앞을 0 으로 채운 14자리. 라벨의 AI 01 과 견줄 때 쓴다. 어느 것도 아니면 `undefined`.
|
|
255
|
+
*/
|
|
256
|
+
export function gtin14OfItem(definitionId) {
|
|
257
|
+
const byClass = gtin14OfItemClass(definitionId);
|
|
258
|
+
if (byClass)
|
|
259
|
+
return byClass;
|
|
260
|
+
return /^(\d{8}|\d{12,14})$/.test(definitionId ?? '') ? definitionId.padStart(14, '0') : undefined;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* **The text a person reads for an identifier** - the one place screens turn a stored EPC into words.
|
|
264
|
+
*
|
|
265
|
+
* Stored identifiers stay long (EPCIS URNs, CBV domain URIs) because a journal mixes many sources and the value itself
|
|
266
|
+
* has to say what kind of key it is and who issued it. A screen has that context already, so it shows the short form
|
|
267
|
+
* people meet on labels: the GS1 element string with its application identifiers - the human readable interpretation
|
|
268
|
+
* printed under a GS1 barcode.
|
|
269
|
+
*
|
|
270
|
+
* urn:epc:id:sgtin:P.R.S -> (01)<GTIN-14>(21)<serial>
|
|
271
|
+
* urn:epc:class:lgtin:P.R.L -> (01)<GTIN-14>(10)<lot>
|
|
272
|
+
* urn:epc:idpat:sgtin:P.R.* -> (01)<GTIN-14>
|
|
273
|
+
* urn:epc:id:sscc:P.S -> (00)<SSCC-18>
|
|
274
|
+
* urn:epc:id:sgln:P.L.E -> (414)<GLN-13>, and (254)<E> when E is not 0
|
|
275
|
+
* urn:epc:id:grai:P.T.S -> (8003)0<GRAI-13><serial>
|
|
276
|
+
* urn:epc:id:gdti:P.T.S -> (253)<GDTI-13><serial>
|
|
277
|
+
* urn:epc:id:giai:P.A -> (8004)<P><A>
|
|
278
|
+
* <domain>/../obj/<id> -> <id>
|
|
279
|
+
* <domain>/../class/<item>;lot=<L> -> <item> · <L>
|
|
280
|
+
* <domain>/../class/<id> -> <id>
|
|
281
|
+
* <domain>/../bt/<id> -> <id>
|
|
282
|
+
*
|
|
283
|
+
* The reading is `parseEpc`'s - nothing here cuts at `:` or `.` on its own, which is how a screen once showed a lot as
|
|
284
|
+
* the item name. A value whose digits do not add up, or that is no identifier we know, comes back as written: a wrong
|
|
285
|
+
* short form would look trustworthy, the original at least says what is stored. A name from master data, where the
|
|
286
|
+
* screen has one, goes before this text; that lookup is the screen's.
|
|
287
|
+
*/
|
|
288
|
+
export function identifierText(uri) {
|
|
289
|
+
const raw = String(uri ?? '').trim();
|
|
290
|
+
if (!raw)
|
|
291
|
+
return '';
|
|
292
|
+
const parsed = parseEpc(raw);
|
|
293
|
+
if (parsed.scheme === 'sgtin' || parsed.scheme === 'lgtin' || parsed.scheme === 'idpat') {
|
|
294
|
+
const gtin = gtin14OfKey(parsed.gtinKey);
|
|
295
|
+
if (!gtin)
|
|
296
|
+
return raw;
|
|
297
|
+
if (parsed.scheme === 'sgtin')
|
|
298
|
+
return parsed.serial ? `(01)${gtin}(21)${decoded(parsed.serial)}` : raw;
|
|
299
|
+
if (parsed.scheme === 'lgtin')
|
|
300
|
+
return parsed.lot ? `(01)${gtin}(10)${parsed.lot}` : raw;
|
|
301
|
+
return `(01)${gtin}`;
|
|
302
|
+
}
|
|
303
|
+
if (parsed.scheme === 'sscc') {
|
|
304
|
+
const sscc = ssccDigitsOf(raw);
|
|
305
|
+
return sscc ? `(00)${sscc}` : raw;
|
|
306
|
+
}
|
|
307
|
+
if (parsed.scheme === 'sgln') {
|
|
308
|
+
const m = /^urn:epc:id:sgln:(\d+)\.(\d*)\.(.+)$/.exec(raw);
|
|
309
|
+
if (!m || m[1].length + m[2].length !== 12)
|
|
310
|
+
return raw;
|
|
311
|
+
const body = m[1] + m[2];
|
|
312
|
+
return `(414)${body}${checkDigitOf(body)}${m[3] === '0' ? '' : `(254)${decoded(m[3])}`}`;
|
|
313
|
+
}
|
|
314
|
+
if (parsed.scheme === 'grai' || parsed.scheme === 'gdti') {
|
|
315
|
+
const m = new RegExp(`^urn:epc:id:${parsed.scheme}:(\\d+)\\.(\\d*)\\.(.*)$`).exec(raw);
|
|
316
|
+
if (!m || m[1].length + m[2].length !== 12)
|
|
317
|
+
return raw;
|
|
318
|
+
const key = m[1] + m[2] + checkDigitOf(m[1] + m[2]);
|
|
319
|
+
return parsed.scheme === 'grai' ? `(8003)0${key}${decoded(m[3])}` : `(253)${key}${decoded(m[3])}`;
|
|
320
|
+
}
|
|
321
|
+
if (parsed.scheme === 'giai') {
|
|
322
|
+
const m = /^urn:epc:id:giai:(\d+)\.(.+)$/.exec(raw);
|
|
323
|
+
return m ? `(8004)${m[1]}${decoded(m[2])}` : raw;
|
|
324
|
+
}
|
|
325
|
+
if (parsed.item !== undefined && parsed.lot !== undefined)
|
|
326
|
+
return `${parsed.item} · ${parsed.lot}`;
|
|
327
|
+
const inHouse = /(?:\/(?:obj|class|bt)\/|:(?:obj|class|bt):)([^/:\s]+)$/.exec(raw);
|
|
328
|
+
return inHouse ? decoded(inHouse[1]) : raw;
|
|
329
|
+
}
|
|
330
|
+
/** GTIN-14 of a `CompanyPrefix.IndicatorAndItemRef` key, or `undefined` when the digits do not add up to 13. */
|
|
331
|
+
function gtin14OfKey(key) {
|
|
332
|
+
const m = /^(\d+)\.(\d+)$/.exec(key ?? '');
|
|
333
|
+
if (!m)
|
|
334
|
+
return undefined;
|
|
335
|
+
const body = m[2][0] + m[1] + m[2].slice(1);
|
|
336
|
+
return body.length === 13 ? body + checkDigitOf(body) : undefined;
|
|
337
|
+
}
|
|
338
|
+
/** A URI component as a person reads it; one that does not decode stays as written. */
|
|
339
|
+
function decoded(part) {
|
|
340
|
+
try {
|
|
341
|
+
return decodeURIComponent(part);
|
|
342
|
+
}
|
|
343
|
+
catch {
|
|
344
|
+
return part;
|
|
345
|
+
}
|
|
346
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './domain-definition.ts';
|
|
|
6
6
|
export * from './ems-profile.ts';
|
|
7
7
|
export * from './energy-ingest.ts';
|
|
8
8
|
export * from './epcis.ts';
|
|
9
|
+
export * from './gs1.ts';
|
|
9
10
|
export * from './order-fold.ts';
|
|
10
11
|
export * from './referenced-location.ts';
|
|
11
12
|
export * from './face2-adapter.ts';
|
|
@@ -19,6 +20,7 @@ export * from './scenario-validate.ts';
|
|
|
19
20
|
export * from './vocabulary.ts';
|
|
20
21
|
export * from './wms-profile.ts';
|
|
21
22
|
export * from './yms-profile.ts';
|
|
23
|
+
export * from './party.ts';
|
|
22
24
|
export * from './canonical-record.ts';
|
|
23
25
|
export * from './command-verdict.ts';
|
|
24
26
|
export * from './webhook-delivery.ts';
|
|
@@ -31,3 +33,4 @@ export * from './reliability.ts';
|
|
|
31
33
|
export * from './erp.ts';
|
|
32
34
|
export * from './actuation.ts';
|
|
33
35
|
export * from './operational-attention.ts';
|
|
36
|
+
export * from './lot-lineage.ts';
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ export * from "./domain-definition.js";
|
|
|
27
27
|
export * from "./ems-profile.js";
|
|
28
28
|
export * from "./energy-ingest.js";
|
|
29
29
|
export * from "./epcis.js";
|
|
30
|
+
export * from "./gs1.js";
|
|
30
31
|
export * from "./order-fold.js";
|
|
31
32
|
export * from "./referenced-location.js";
|
|
32
33
|
export * from "./face2-adapter.js";
|
|
@@ -40,6 +41,7 @@ export * from "./scenario-validate.js";
|
|
|
40
41
|
export * from "./vocabulary.js";
|
|
41
42
|
export * from "./wms-profile.js";
|
|
42
43
|
export * from "./yms-profile.js";
|
|
44
|
+
export * from "./party.js";
|
|
43
45
|
export * from "./canonical-record.js";
|
|
44
46
|
export * from "./command-verdict.js";
|
|
45
47
|
export * from "./webhook-delivery.js";
|
|
@@ -54,3 +56,4 @@ export * from "./reliability.js";
|
|
|
54
56
|
export * from "./erp.js";
|
|
55
57
|
export * from "./actuation.js";
|
|
56
58
|
export * from "./operational-attention.js";
|
|
59
|
+
export * from "./lot-lineage.js";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { MaterialLotUse } from './contract.ts';
|
|
2
|
+
import type { EpcisEvent } from './epcis.ts';
|
|
3
|
+
/** 계보 한 줄 — 나온 로트와, 들어간 로트 하나. 둘 다 클래스 식별자다. */
|
|
4
|
+
export interface LotLineageEdge {
|
|
5
|
+
lot: string;
|
|
6
|
+
input: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 변환 사건 하나가 말하는 계보 줄. 변환이 아닌 사건은 계보를 말하지 않는다(빈 목록).
|
|
10
|
+
*
|
|
11
|
+
* - 다 쓴 입력은 **단위**로 온다(`inputEPCList`). 그 단위가 무슨 로트였는지는 사건이 아니라 그 단위를 든 쪽(재고)이
|
|
12
|
+
* 안다 — `classOfUnit` 으로 묻는다. 모르면 그 줄은 없다(지어내지 않는다).
|
|
13
|
+
* - 일부만 쓴 입력은 이미 클래스다(`inputQuantityList`).
|
|
14
|
+
* - 나온 로트는 `outputQuantityList` 의 클래스다. 산출 단위만 있고 클래스가 없으면 무엇이 생겼는지 말할 수 없다.
|
|
15
|
+
* - 같은 로트가 들어가고 나오면(재작업) 자기 자신에게 잇지 않는다.
|
|
16
|
+
*/
|
|
17
|
+
export declare function lotLineageOf(event: EpcisEvent, classOfUnit: (epc: string) => string | undefined): LotLineageEdge[];
|
|
18
|
+
/** 한 로트에 대해 아는 것 — 주인의 말이거나, 입력에서 물려받은 것. */
|
|
19
|
+
export interface InheritedLotUse {
|
|
20
|
+
use: MaterialLotUse;
|
|
21
|
+
/** 주인의 낱말 — 이 로트의 것이거나, 보류를 물려준 입력의 것. 입력이 전부 `allowed` 라 지어 낸 답이면 없다. */
|
|
22
|
+
status?: string;
|
|
23
|
+
/** 이 말이 이 로트의 것이 아니면, 물려준 입력 로트. */
|
|
24
|
+
from?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 한 로트를 쓸 수 있나 — 무엇으로 만들어졌는지를 걸어서.
|
|
28
|
+
*
|
|
29
|
+
* ```
|
|
30
|
+
* 주인이 이 로트를 막았다 blocked — 자기 말
|
|
31
|
+
* 입력 하나(어느 깊이든)가 막혔다 blocked — 그 입력의 말과, 어느 입력인지
|
|
32
|
+
* 주인이 다른 말을 했다 그 말
|
|
33
|
+
* 입력이 있고 전부 allowed allowed — 지어 낸 답, 주인의 낱말 없음
|
|
34
|
+
* 그 밖 undefined — 모름. allowed 로 읽지 않는다
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* 막힘이 주인의 `allowed` 보다 앞선다 — 주인은 이 로트를 낳을 때의 입력을 모를 수 있고, 그 입력이 뒤에 막혔을 수 있다.
|
|
38
|
+
* 기록된 순환(같은 길에서 이미 지난 로트)은 다시 걷지 않는다 — 더 말하는 것이 없다.
|
|
39
|
+
*/
|
|
40
|
+
export declare function inheritedLotUse(lot: string, said: ReadonlyMap<string, {
|
|
41
|
+
use: string;
|
|
42
|
+
status: string;
|
|
43
|
+
}>, inputsOf: ReadonlyMap<string, readonly string[]>, seen?: ReadonlySet<string>): InheritedLotUse | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* 변환이 만든 로트의 기한 — 입력 기한 중 **가장 이른 것.** 산출은 가장 먼저 지나는 입력과 함께 지난다.
|
|
46
|
+
*
|
|
47
|
+
* 기한을 모르는 입력은 한계를 더하지 않는다(그 입력이 기한을 말하지 않은 것과 같다). 아무 입력도 기한이 없으면
|
|
48
|
+
* 산출도 없다 — 「지금」이나 0 으로 메우지 않는다(§`expiryFromAttributes` 와 같은 규율). 값은 밀리초다.
|
|
49
|
+
*/
|
|
50
|
+
export declare function inheritedExpiry(inputExpiries: readonly (number | undefined | null)[]): number | undefined;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 변환 사건 하나가 말하는 계보 줄. 변환이 아닌 사건은 계보를 말하지 않는다(빈 목록).
|
|
3
|
+
*
|
|
4
|
+
* - 다 쓴 입력은 **단위**로 온다(`inputEPCList`). 그 단위가 무슨 로트였는지는 사건이 아니라 그 단위를 든 쪽(재고)이
|
|
5
|
+
* 안다 — `classOfUnit` 으로 묻는다. 모르면 그 줄은 없다(지어내지 않는다).
|
|
6
|
+
* - 일부만 쓴 입력은 이미 클래스다(`inputQuantityList`).
|
|
7
|
+
* - 나온 로트는 `outputQuantityList` 의 클래스다. 산출 단위만 있고 클래스가 없으면 무엇이 생겼는지 말할 수 없다.
|
|
8
|
+
* - 같은 로트가 들어가고 나오면(재작업) 자기 자신에게 잇지 않는다.
|
|
9
|
+
*/
|
|
10
|
+
export function lotLineageOf(event, classOfUnit) {
|
|
11
|
+
if (event.type !== 'TransformationEvent')
|
|
12
|
+
return [];
|
|
13
|
+
const inputs = new Set();
|
|
14
|
+
for (const epc of event.inputEPCList ?? []) {
|
|
15
|
+
const lot = classOfUnit(epc);
|
|
16
|
+
if (lot)
|
|
17
|
+
inputs.add(lot);
|
|
18
|
+
}
|
|
19
|
+
for (const one of event.inputQuantityList ?? [])
|
|
20
|
+
if (one.epcClass)
|
|
21
|
+
inputs.add(one.epcClass);
|
|
22
|
+
const edges = [];
|
|
23
|
+
for (const lot of new Set((event.outputQuantityList ?? []).map(one => one.epcClass).filter(Boolean))) {
|
|
24
|
+
for (const input of inputs)
|
|
25
|
+
if (input !== lot)
|
|
26
|
+
edges.push({ lot, input });
|
|
27
|
+
}
|
|
28
|
+
return edges;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 한 로트를 쓸 수 있나 — 무엇으로 만들어졌는지를 걸어서.
|
|
32
|
+
*
|
|
33
|
+
* ```
|
|
34
|
+
* 주인이 이 로트를 막았다 blocked — 자기 말
|
|
35
|
+
* 입력 하나(어느 깊이든)가 막혔다 blocked — 그 입력의 말과, 어느 입력인지
|
|
36
|
+
* 주인이 다른 말을 했다 그 말
|
|
37
|
+
* 입력이 있고 전부 allowed allowed — 지어 낸 답, 주인의 낱말 없음
|
|
38
|
+
* 그 밖 undefined — 모름. allowed 로 읽지 않는다
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* 막힘이 주인의 `allowed` 보다 앞선다 — 주인은 이 로트를 낳을 때의 입력을 모를 수 있고, 그 입력이 뒤에 막혔을 수 있다.
|
|
42
|
+
* 기록된 순환(같은 길에서 이미 지난 로트)은 다시 걷지 않는다 — 더 말하는 것이 없다.
|
|
43
|
+
*/
|
|
44
|
+
export function inheritedLotUse(lot, said, inputsOf, seen = new Set()) {
|
|
45
|
+
const own = said.get(lot);
|
|
46
|
+
if (own?.use === 'blocked')
|
|
47
|
+
return { use: 'blocked', status: own.status };
|
|
48
|
+
const along = new Set([...seen, lot]);
|
|
49
|
+
const words = (inputsOf.get(lot) ?? [])
|
|
50
|
+
.filter(input => !along.has(input))
|
|
51
|
+
.map(input => ({ input, word: inheritedLotUse(input, said, inputsOf, along) }));
|
|
52
|
+
const blocked = words.find(({ word }) => word?.use === 'blocked');
|
|
53
|
+
if (blocked)
|
|
54
|
+
return { use: 'blocked', ...(blocked.word.status !== undefined ? { status: blocked.word.status } : {}), from: blocked.word.from ?? blocked.input };
|
|
55
|
+
if (own?.use === 'allowed')
|
|
56
|
+
return { use: 'allowed', status: own.status };
|
|
57
|
+
if (!own && words.length && words.every(({ word }) => word?.use === 'allowed'))
|
|
58
|
+
return { use: 'allowed' };
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 변환이 만든 로트의 기한 — 입력 기한 중 **가장 이른 것.** 산출은 가장 먼저 지나는 입력과 함께 지난다.
|
|
63
|
+
*
|
|
64
|
+
* 기한을 모르는 입력은 한계를 더하지 않는다(그 입력이 기한을 말하지 않은 것과 같다). 아무 입력도 기한이 없으면
|
|
65
|
+
* 산출도 없다 — 「지금」이나 0 으로 메우지 않는다(§`expiryFromAttributes` 와 같은 규율). 값은 밀리초다.
|
|
66
|
+
*/
|
|
67
|
+
export function inheritedExpiry(inputExpiries) {
|
|
68
|
+
let earliest;
|
|
69
|
+
for (const at of inputExpiries) {
|
|
70
|
+
if (typeof at !== 'number' || !Number.isFinite(at))
|
|
71
|
+
continue;
|
|
72
|
+
if (earliest === undefined || at < earliest)
|
|
73
|
+
earliest = at;
|
|
74
|
+
}
|
|
75
|
+
return earliest;
|
|
76
|
+
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* 모르는 필드는 **조용히 버리지 않고 거부한다.** `taskID` 처럼 한 글자 틀린 이름은 통과시키면 영원히
|
|
35
35
|
* 보이지 않는 손실이 된다(이 문에는 아직 옛 발신자가 없어 호환 부담도 없다).
|
|
36
36
|
*/
|
|
37
|
-
import { OP_EVENT, BASIS_UNKNOWN, DISPOSITION_DECISION, MATERIAL_ACTUAL_USE, MATERIAL_LOT_USE, isTestSpecificationBasis, isRecipeExecutionBasis, isMaterialExecutionBasis } from "./contract.js";
|
|
37
|
+
import { OP_EVENT, BASIS_UNKNOWN, EQUIPMENT_STATUS, PERSON_STATUS, ASSET_STATUS, DISPOSITION_DECISION, MATERIAL_ACTUAL_USE, MATERIAL_LOT_USE, isTestSpecificationBasis, isRecipeExecutionBasis, isMaterialExecutionBasis } from "./contract.js";
|
|
38
38
|
import { isWorkShiftExecutionBasis } from "./work-shift-basis.js";
|
|
39
39
|
/**
|
|
40
40
|
* 객체 한 줄이 선언된 안쪽 모양을 지키나 — **선언하지 않은 자리는 보지 않는다.**
|
|
@@ -106,10 +106,10 @@ const TASK_STATUS = ['created', 'assigned', 'in-progress', 'completed'];
|
|
|
106
106
|
*
|
|
107
107
|
* `down` 과 `idle` 은 22400 에서 다른 항목이고 공장이 손 쓰는 방법도 다르다(고장은 보전, 대기는
|
|
108
108
|
* 자재·일정). 처음부터 갈라 두었던 것이 맞았고, 여기에 둘을 더해 22400 의 시간 모델을 덮는다.
|
|
109
|
+
*
|
|
110
|
+
* The lists themselves (equipment, person, asset) live in the contract (`contract.ts`) and are imported here, so
|
|
111
|
+
* the ingest boundary accepts exactly what the contract declares.
|
|
109
112
|
*/
|
|
110
|
-
const EQUIPMENT_STATUS = ['idle', 'busy', 'down', 'setup', 'planned-stop'];
|
|
111
|
-
const PERSON_STATUS = ['idle', 'busy'];
|
|
112
|
-
const ASSET_STATUS = ['idle', 'in-use'];
|
|
113
113
|
const SPECS = {
|
|
114
114
|
task: {
|
|
115
115
|
eventType: OP_EVENT.task,
|
package/dist/party.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **경계를 넘는 거래 상대 참조.** `id` 는 이 파일이 판별하는 URI 이고, `name` 은 사람이 읽을 이름이다(판정에 쓰지 않는다).
|
|
3
|
+
* 제품마다 다시 정의하지 않는다(ADR-0211 결정 4).
|
|
4
|
+
*/
|
|
5
|
+
export interface PartyRef {
|
|
6
|
+
id: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* EPCIS Source/Destination 의 **종류** 중 거래 상대인 것 — CBV 2.0 §7.4.3.
|
|
11
|
+
*
|
|
12
|
+
* · `owning_party` — 그 이전의 끝점에서 물건을 **소유한**(또는 소유할) 당사자.
|
|
13
|
+
* · `possessing_party` — 그 이전의 끝점에서 물건을 **물리적으로 가진**(또는 가질) 당사자. 실려 가는 동안의 운송사가 이것이다.
|
|
14
|
+
*
|
|
15
|
+
* 표준의 셋째 값 `location` 은 자리다 — 거래 상대가 아니므로 여기 두지 않는다.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SOURCE_DEST_PARTY_TYPE: {
|
|
18
|
+
readonly owning_party: "urn:epcglobal:cbv:sdt:owning_party";
|
|
19
|
+
readonly possessing_party: "urn:epcglobal:cbv:sdt:possessing_party";
|
|
20
|
+
};
|
|
21
|
+
export type SourceDestPartyType = (typeof SOURCE_DEST_PARTY_TYPE)[keyof typeof SOURCE_DEST_PARTY_TYPE];
|
|
22
|
+
/**
|
|
23
|
+
* **관계 안의 역할** — UN/CEFACT 당사자 역할 코드(UNTDID 3035). 닫힌 목록이고, **쓰는 날 하나씩** 올린다(ADR-0211 결정 4).
|
|
24
|
+
* 표준에 없는 역할은 지어내기 전에 판정을 받는다.
|
|
25
|
+
*
|
|
26
|
+
* · `CA` Carrier — 「Party undertaking or arranging transport of goods between named points.」
|
|
27
|
+
* (UNTDID 3035, D.96A 사본으로 확인 2026-11-17. 야드의 예약 · 게이트 방문, 창고 출하의 `bol` 을 낸 쪽.)
|
|
28
|
+
*/
|
|
29
|
+
export declare const PARTY_ROLE: {
|
|
30
|
+
readonly carrier: "CA";
|
|
31
|
+
};
|
|
32
|
+
export type PartyRole = (typeof PARTY_ROLE)[keyof typeof PARTY_ROLE];
|
|
33
|
+
/** CBV 2.0 §8.1.4 — HTTP(S) 식별자는 이 길이를 넘지 않는다(SHALL). */
|
|
34
|
+
export declare const PARTY_URI_MAX_LENGTH = 128;
|
|
35
|
+
/** CBV 2.0 §8.1.4 — 이 길이를 넘지 않기를 권한다(SHOULD). 넘으면 거절하지 않고 알린다. */
|
|
36
|
+
export declare const PARTY_URI_RECOMMENDED_LENGTH = 60;
|
|
37
|
+
/**
|
|
38
|
+
* **거래 상대 식별자를 발급한다** — 소유 도메인의 이름공간과 거래처 행 id 로(ADR-0211 결정 11).
|
|
39
|
+
*
|
|
40
|
+
* 부르는 곳은 biz-base 한 곳이다(결정 13-4 — 다른 코드는 URI 를 조립하지 않는다). 꼴의 규칙을 그곳에 다시 적지 않도록 여기 둔다.
|
|
41
|
+
*
|
|
42
|
+
* · 행 id 는 uuid 여야 한다 — 하이픈 · 대소문자는 받아서 **하이픈 뺀 소문자 32자**로 쓴다(결정 11-8). 아니면 던진다.
|
|
43
|
+
* · 이름공간이 없거나 GS1 공간이면 `undefined` 다(지어내지 않는다 — `objectUri` 와 같다).
|
|
44
|
+
* · 만든 값이 128자를 넘으면 던진다 — 그 이름공간 선언이 틀린 것이다(결정 11-8).
|
|
45
|
+
*/
|
|
46
|
+
export declare function partyUri(namespace: string, rowId: string): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* **우리가 발급한 식별자에서 거래처 행 id 를 되찾는다** — 하이픈 있는 uuid 로.
|
|
49
|
+
*
|
|
50
|
+
* 토큰이 발급한 꼴(소문자 32자)일 때만 답한다. 대문자 · 하이픈이 섞인 꼴은 같은 값이 아니다(결정 11-8). 바깥에서 온 식별자
|
|
51
|
+
* (PGLN · 남의 `/sd/`)는 `undefined` 다 — 그때는 알려진 다른 식별자로 찾는다(결정 13-2). 이 함수는 **이름공간을 묻지 않는다**:
|
|
52
|
+
* 그 이름공간이 우리 것인지는 부르는 쪽(biz-base)이 안다.
|
|
53
|
+
*/
|
|
54
|
+
export declare function partyRowIdOf(uri: string | undefined): string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* **거래 상대 식별자로 받을 수 있는가** — 받을 수 없으면 까닭, 받을 수 있으면 `undefined`.
|
|
57
|
+
*
|
|
58
|
+
* 받는 꼴은 CBV 2.0 §8.7 의 네 꼴 중 거래 상대의 것이다: PGLN EPC · PGLN Digital Link(정규 `id.gs1.org`) · `/sd/` URL · `:sd:` URN.
|
|
59
|
+
* 128자를 넘으면 거절한다(SHALL). 60자 초과는 거절하지 않는다 — `partyUriLengthNote` 가 말한다.
|
|
60
|
+
*
|
|
61
|
+
* 비정규 Digital Link(`https://example.com/…/417/…`)는 아직 판정하지 않는다 — 클래스 식별자와 같은 좁힘이다(`epcis.ts`
|
|
62
|
+
* `classIdentifierViolation`). 그것을 쓰는 원천이 붙는 날 연다.
|
|
63
|
+
*/
|
|
64
|
+
export declare function partyIdentifierViolation(uri: string | undefined): string | undefined;
|
|
65
|
+
/** 판별의 참 · 거짓 — 까닭이 필요하면 `partyIdentifierViolation` 을 부른다. */
|
|
66
|
+
export declare function isPartyUri(v: unknown): v is string;
|
|
67
|
+
/** 60자 권장(SHOULD)을 넘었으면 알릴 말, 아니면 `undefined`. 거절하지 않는다. */
|
|
68
|
+
export declare function partyUriLengthNote(uri: string | undefined): string | undefined;
|
|
69
|
+
/** 경계를 넘어 받은 값이 거래 상대 참조인가 — `id` 가 판별을 지나야 한다. `name` 은 있으면 글이어야 한다. */
|
|
70
|
+
export declare function isPartyRef(v: unknown): v is PartyRef;
|