@operato/ops-contract 0.9.22 → 0.9.24
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/domain-catalog.d.ts +36 -0
- package/dist/domain-catalog.js +32 -4
- package/dist/domain-definition.d.ts +21 -0
- package/dist/domain-definition.js +16 -2
- package/dist/epcis.d.ts +9 -1
- package/dist/wms-profile.d.ts +22 -1
- package/dist/wms-profile.js +41 -2
- package/dist/yms-profile.d.ts +0 -2
- package/dist/yms-profile.js +5 -2
- package/dist-cjs/index.cjs +57 -8
- package/package.json +1 -1
package/dist/domain-catalog.d.ts
CHANGED
|
@@ -192,6 +192,24 @@ export type TwinRelationTarget = {
|
|
|
192
192
|
| {
|
|
193
193
|
kind: 'external';
|
|
194
194
|
entity: string;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* A reference that points **either** at an item of an axis **or** at something outside the kernel —
|
|
198
|
+
* told apart by looking the id up in that axis.
|
|
199
|
+
*
|
|
200
|
+
* `locations[].parentId` is this. `LocationState.parentId` says so in its own words: the parent is
|
|
201
|
+
* another location (a line, a cell, a zone — this is where the hierarchy gets deeper) or, when no
|
|
202
|
+
* location has that id, an area of the space. The relation was first declared `axis` (it drew lines
|
|
203
|
+
* to locations that did not exist), then `external` (a bin whose parent is a zone came back
|
|
204
|
+
* "nobody can resolve this", and a zone never listed its bins). Neither alone is true.
|
|
205
|
+
*
|
|
206
|
+
* A consumer that only knows `axis` and `external` skips this kind — it shows less, never a line
|
|
207
|
+
* that is not there. `splitRelationIds` does the lookup so that each consumer does not write its own.
|
|
208
|
+
*/
|
|
209
|
+
| {
|
|
210
|
+
kind: 'axis-or-external';
|
|
211
|
+
axis: string;
|
|
212
|
+
entity: string;
|
|
195
213
|
};
|
|
196
214
|
/**
|
|
197
215
|
* **그 관계가 가리키는 것이 언제의 일인가** — 화면의 판단이 여기서 갈린다.
|
|
@@ -344,6 +362,24 @@ export declare function documentPath(axis: string): string;
|
|
|
344
362
|
/** 이 축에서 나가는 관계 · 이 축으로 들어오는 관계 — 항목 패널의 "이어진 것" 양방향. */
|
|
345
363
|
export declare const relationsFrom: (axis: string) => TwinRelationInfo[];
|
|
346
364
|
export declare const relationsTo: (axis: string) => TwinRelationInfo[];
|
|
365
|
+
/**
|
|
366
|
+
* Sorts the ids a relation holds into what they point at.
|
|
367
|
+
*
|
|
368
|
+
* `inAxis(axis, id)` answers "is there an item with this id in that axis" — the caller owns the data,
|
|
369
|
+
* the contract owns the rule. For `axis-or-external` an id found in the axis is an axis item and
|
|
370
|
+
* every other id belongs to the external entity. A `type` target has neither: its values are type
|
|
371
|
+
* keys, not item ids.
|
|
372
|
+
*/
|
|
373
|
+
export declare function splitRelationIds(target: TwinRelationTarget, ids: readonly string[], inAxis: (axis: string, id: string) => boolean): {
|
|
374
|
+
axis?: {
|
|
375
|
+
axis: string;
|
|
376
|
+
ids: string[];
|
|
377
|
+
};
|
|
378
|
+
external?: {
|
|
379
|
+
entity: string;
|
|
380
|
+
ids: string[];
|
|
381
|
+
};
|
|
382
|
+
};
|
|
347
383
|
/** 축 이름 → 서술. 모르는 축이면 `undefined` — 화면은 그것을 "미선언" 으로 낸다(숨기지 않는다). */
|
|
348
384
|
export declare function axisInfo(axis: string): TwinAxisInfo | undefined;
|
|
349
385
|
export declare const DOMAIN_SYSTEMS: DomainSystem[];
|
package/dist/domain-catalog.js
CHANGED
|
@@ -96,7 +96,12 @@ export const TWIN_AXES = [
|
|
|
96
96
|
{ axis: 'orders', label: 'twin.axis.orders', kind: 'instance', source: 'state', historical: true,
|
|
97
97
|
standardClass: { isa95: 'OperationsRequest', epcis: 'TransactionEvent' }, systems: LOGISTICS },
|
|
98
98
|
{ axis: 'tasks', label: 'twin.axis.tasks', kind: 'instance', source: 'state', historical: true,
|
|
99
|
-
|
|
99
|
+
/*
|
|
100
|
+
* No single EPCIS projection. A task's event kind follows its operation: a putaway or a pick is
|
|
101
|
+
* an ObjectEvent, only a transformation (production, kitting) is a TransformationEvent. This used
|
|
102
|
+
* to say `epcis: 'TransformationEvent'` for an axis that spans every logistics system.
|
|
103
|
+
*/
|
|
104
|
+
standardClass: { isa95: 'SegmentResponse' }, systems: LOGISTICS },
|
|
100
105
|
/*
|
|
101
106
|
* ── 물품이 축이 아니었다 (2026-08-22) ──────────────────────────────────────
|
|
102
107
|
* 트윈에서 **수가 가장 많은 것**이 물품인데(실측: 엔티티 3,611 중 2,400 · hatio-us 는 2,805) 그것을
|
|
@@ -175,8 +180,11 @@ export function tenseOf(r) {
|
|
|
175
180
|
}
|
|
176
181
|
/** 관계 전체 — 지도의 선과 항목의 이웃이 여기서 나온다(화면은 이 목록을 갖지 않는다). */
|
|
177
182
|
export const TWIN_RELATIONS = [
|
|
178
|
-
/*
|
|
179
|
-
|
|
183
|
+
/*
|
|
184
|
+
* What a location sits in — another location (line ⊃ station, zone ⊃ aisle ⊃ bin) or, when no
|
|
185
|
+
* location has that id, an area of the space (host's `TwinArea`). See `axis-or-external`.
|
|
186
|
+
*/
|
|
187
|
+
{ from: 'locations', field: 'parentId', target: { kind: 'axis-or-external', axis: 'locations', entity: 'space.area' }, via: 'ops.rel.area', optional: true, tense: 'standing' },
|
|
180
188
|
/* 자원이 사는 자리 */
|
|
181
189
|
{ from: 'equipment', field: 'homeLocation', target: { kind: 'axis', axis: 'locations' }, via: 'ops.rel.home', optional: true, tense: 'standing' },
|
|
182
190
|
{ from: 'persons', field: 'homeLocation', target: { kind: 'axis', axis: 'locations' }, via: 'ops.rel.home', optional: true, tense: 'standing' },
|
|
@@ -310,7 +318,27 @@ export function documentPath(axis) {
|
|
|
310
318
|
}
|
|
311
319
|
/** 이 축에서 나가는 관계 · 이 축으로 들어오는 관계 — 항목 패널의 "이어진 것" 양방향. */
|
|
312
320
|
export const relationsFrom = (axis) => TWIN_RELATIONS.filter(r => r.from === axis);
|
|
313
|
-
export const relationsTo = (axis) => TWIN_RELATIONS.filter(r => r.target.kind === 'axis' && r.target.axis === axis);
|
|
321
|
+
export const relationsTo = (axis) => TWIN_RELATIONS.filter(r => (r.target.kind === 'axis' || r.target.kind === 'axis-or-external') && r.target.axis === axis);
|
|
322
|
+
/**
|
|
323
|
+
* Sorts the ids a relation holds into what they point at.
|
|
324
|
+
*
|
|
325
|
+
* `inAxis(axis, id)` answers "is there an item with this id in that axis" — the caller owns the data,
|
|
326
|
+
* the contract owns the rule. For `axis-or-external` an id found in the axis is an axis item and
|
|
327
|
+
* every other id belongs to the external entity. A `type` target has neither: its values are type
|
|
328
|
+
* keys, not item ids.
|
|
329
|
+
*/
|
|
330
|
+
export function splitRelationIds(target, ids, inAxis) {
|
|
331
|
+
if (target.kind === 'axis')
|
|
332
|
+
return { axis: { axis: target.axis, ids: [...ids] } };
|
|
333
|
+
if (target.kind === 'external')
|
|
334
|
+
return { external: { entity: target.entity, ids: [...ids] } };
|
|
335
|
+
if (target.kind === 'axis-or-external') {
|
|
336
|
+
const inside = ids.filter(id => inAxis(target.axis, id));
|
|
337
|
+
const outside = ids.filter(id => !inAxis(target.axis, id));
|
|
338
|
+
return { axis: { axis: target.axis, ids: inside }, external: { entity: target.entity, ids: outside } };
|
|
339
|
+
}
|
|
340
|
+
return {};
|
|
341
|
+
}
|
|
314
342
|
/** 축 이름 → 서술. 모르는 축이면 `undefined` — 화면은 그것을 "미선언" 으로 낸다(숨기지 않는다). */
|
|
315
343
|
export function axisInfo(axis) {
|
|
316
344
|
return TWIN_AXES.find(a => a.axis === axis);
|
|
@@ -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
|
-
*
|
|
7
|
-
|
|
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
|
+
}
|
package/dist/epcis.d.ts
CHANGED
|
@@ -153,7 +153,15 @@ export interface QuantityElement {
|
|
|
153
153
|
uom?: string;
|
|
154
154
|
}
|
|
155
155
|
export interface BizTransactionElement {
|
|
156
|
-
|
|
156
|
+
/**
|
|
157
|
+
* The kind of document — a CBV business transaction type, or a private URI for a kind CBV does not have.
|
|
158
|
+
*
|
|
159
|
+
* **Optional, as in EPCIS 2.0**: only `bizTransaction` is required. When CBV has no value for the
|
|
160
|
+
* document, leave this out — do not coin one under `urn:epcglobal:cbv:btt:`. That namespace is a
|
|
161
|
+
* closed list (13 values, ref.gs1.org/cbv); this contract once carried `btt:so` and `btt:deliv`,
|
|
162
|
+
* neither of which exists there. `test/cbv-btt-values-exist.test.ts` holds the list.
|
|
163
|
+
*/
|
|
164
|
+
type?: string;
|
|
157
165
|
bizTransaction: string;
|
|
158
166
|
}
|
|
159
167
|
export interface LocationRef {
|
package/dist/wms-profile.d.ts
CHANGED
|
@@ -9,9 +9,30 @@ export declare const BIZSTEP: {
|
|
|
9
9
|
readonly replenishing: "urn:epcglobal:cbv:bizstep:replenishing";
|
|
10
10
|
};
|
|
11
11
|
export declare const BTT: {
|
|
12
|
+
/** Purchase Order — the document an inbound receipt is made against. */
|
|
12
13
|
readonly po: "urn:epcglobal:cbv:btt:po";
|
|
13
|
-
|
|
14
|
+
/** Purchase Order Confirmation — the seller's sales order. */
|
|
15
|
+
readonly poc: "urn:epcglobal:cbv:btt:poc";
|
|
16
|
+
/** Despatch Advice (ASN) — announces an inbound delivery; also attached when shipping. */
|
|
17
|
+
readonly desadv: "urn:epcglobal:cbv:btt:desadv";
|
|
18
|
+
/** Receiving Advice — the reply once an inbound receipt is complete. */
|
|
19
|
+
readonly recadv: "urn:epcglobal:cbv:btt:recadv";
|
|
20
|
+
/** Return Merchandise Authorization — what a return is received against. */
|
|
21
|
+
readonly rma: "urn:epcglobal:cbv:btt:rma";
|
|
22
|
+
/** Bill of Lading — the carrier's document, attached when shipping. */
|
|
23
|
+
readonly bol: "urn:epcglobal:cbv:btt:bol";
|
|
14
24
|
};
|
|
25
|
+
export declare const WMS_ORDER_KIND: {
|
|
26
|
+
/** Expected receipt (ASN). The kernel has no inbound order yet — arrival carries a `po` without one. */
|
|
27
|
+
readonly inbound: "inbound";
|
|
28
|
+
/** Outbound order — what the kernel's sales order is. */
|
|
29
|
+
readonly outbound: "outbound";
|
|
30
|
+
/** Receipt of returned goods. */
|
|
31
|
+
readonly return: "return";
|
|
32
|
+
/** Stock transfer between sites. CBV has no document type for it: carry the id without a type. */
|
|
33
|
+
readonly transfer: "transfer";
|
|
34
|
+
};
|
|
35
|
+
export type WmsOrderKind = (typeof WMS_ORDER_KIND)[keyof typeof WMS_ORDER_KIND];
|
|
15
36
|
/**
|
|
16
37
|
* WMS 자리 타입 카탈로그 — 커널이 실제로 키로 쓰는 로케이션 타입(locationByType/slotViews).
|
|
17
38
|
* 도메인 어휘 SSOT: 호스트·UI 는 이걸 소싱하고 재선언하지 않는다(방언 금지).
|
package/dist/wms-profile.js
CHANGED
|
@@ -8,10 +8,49 @@ export const BIZSTEP = {
|
|
|
8
8
|
shipping: 'urn:epcglobal:cbv:bizstep:shipping',
|
|
9
9
|
replenishing: 'urn:epcglobal:cbv:bizstep:replenishing'
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
/*
|
|
12
|
+
* Business transaction types — CBV btt. Every value here exists at ref.gs1.org/cbv (checked
|
|
13
|
+
* 2026-09-17; `test/cbv-btt-values-exist.test.ts` holds the closed list).
|
|
14
|
+
*
|
|
15
|
+
* `poc` is what the kernel's outbound order carries. The kernel's document is a *sales order*
|
|
16
|
+
* (docKind 'salesorder'), and CBV's own definition of Purchase Order Confirmation reads
|
|
17
|
+
* "Sometimes internally referred to as a 'Sales Order'." There is no `btt:so` — this file used to
|
|
18
|
+
* say there was (ADR-0059 decision 4).
|
|
19
|
+
*
|
|
20
|
+
* A document CBV has no value for (a transfer between sites) carries **no type** — see
|
|
21
|
+
* BizTransactionElement.type.
|
|
22
|
+
*/
|
|
12
23
|
export const BTT = {
|
|
24
|
+
/** Purchase Order — the document an inbound receipt is made against. */
|
|
13
25
|
po: 'urn:epcglobal:cbv:btt:po',
|
|
14
|
-
|
|
26
|
+
/** Purchase Order Confirmation — the seller's sales order. */
|
|
27
|
+
poc: 'urn:epcglobal:cbv:btt:poc',
|
|
28
|
+
/** Despatch Advice (ASN) — announces an inbound delivery; also attached when shipping. */
|
|
29
|
+
desadv: 'urn:epcglobal:cbv:btt:desadv',
|
|
30
|
+
/** Receiving Advice — the reply once an inbound receipt is complete. */
|
|
31
|
+
recadv: 'urn:epcglobal:cbv:btt:recadv',
|
|
32
|
+
/** Return Merchandise Authorization — what a return is received against. */
|
|
33
|
+
rma: 'urn:epcglobal:cbv:btt:rma',
|
|
34
|
+
/** Bill of Lading — the carrier's document, attached when shipping. */
|
|
35
|
+
bol: 'urn:epcglobal:cbv:btt:bol'
|
|
36
|
+
};
|
|
37
|
+
/*
|
|
38
|
+
* What an order in a warehouse is for — `OrderState.kind`.
|
|
39
|
+
*
|
|
40
|
+
* The contract leaves `kind` an open string because it is the domain's word. It was written as a
|
|
41
|
+
* literal in the kernel ('outbound') until a second producer appeared (operato-warehouse); two
|
|
42
|
+
* producers with one literal each is how two spellings start (ADR-0059 decision 3).
|
|
43
|
+
* Moves *inside* a warehouse are not orders — they are tasks.
|
|
44
|
+
*/
|
|
45
|
+
export const WMS_ORDER_KIND = {
|
|
46
|
+
/** Expected receipt (ASN). The kernel has no inbound order yet — arrival carries a `po` without one. */
|
|
47
|
+
inbound: 'inbound',
|
|
48
|
+
/** Outbound order — what the kernel's sales order is. */
|
|
49
|
+
outbound: 'outbound',
|
|
50
|
+
/** Receipt of returned goods. */
|
|
51
|
+
return: 'return',
|
|
52
|
+
/** Stock transfer between sites. CBV has no document type for it: carry the id without a type. */
|
|
53
|
+
transfer: 'transfer'
|
|
15
54
|
};
|
|
16
55
|
/**
|
|
17
56
|
* WMS 자리 타입 카탈로그 — 커널이 실제로 키로 쓰는 로케이션 타입(locationByType/slotViews).
|
package/dist/yms-profile.d.ts
CHANGED
|
@@ -6,8 +6,6 @@ export declare const YARD_BIZSTEP: {
|
|
|
6
6
|
readonly unloading: "urn:epcglobal:cbv:bizstep:unloading";
|
|
7
7
|
readonly departing: "urn:epcglobal:cbv:bizstep:departing";
|
|
8
8
|
};
|
|
9
|
-
/** 어포인트먼트/배송 거래 유형(CBV btt). */
|
|
10
|
-
export declare const BTT_DELIVERY = "urn:epcglobal:cbv:btt:deliv";
|
|
11
9
|
/** 트레일러/컨테이너 = GRAI(Global Returnable Asset Identifier, 반납형 자산). */
|
|
12
10
|
export declare function graiUri(companyPrefix: string, assetType: string, serial: number): string;
|
|
13
11
|
/** YMS 자리 타입 카탈로그 — 커널이 키로 쓰는 야드 로케이션 타입(locationByType/slotViews/.type). 도메인 SSOT. */
|
package/dist/yms-profile.js
CHANGED
|
@@ -6,8 +6,11 @@ export const YARD_BIZSTEP = {
|
|
|
6
6
|
unloading: 'urn:epcglobal:cbv:bizstep:unloading', // 도크 작업(하차: 트레일러→화물)
|
|
7
7
|
departing: 'urn:epcglobal:cbv:bizstep:departing' // 게이트-아웃
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/*
|
|
10
|
+
* A dock appointment has **no CBV business transaction type** — `btt:deliv`, which this file used to
|
|
11
|
+
* export, does not exist at ref.gs1.org/cbv. The kernel now links the appointment by its id alone
|
|
12
|
+
* (EPCIS 2.0 makes `type` optional). ADR-0059 decision 4.
|
|
13
|
+
*/
|
|
11
14
|
/** 트레일러/컨테이너 = GRAI(Global Returnable Asset Identifier, 반납형 자산). */
|
|
12
15
|
export function graiUri(companyPrefix, assetType, serial) {
|
|
13
16
|
return `urn:epc:id:grai:${companyPrefix}.${assetType}.${String(serial).padStart(6, '0')}`;
|
package/dist-cjs/index.cjs
CHANGED
|
@@ -21,7 +21,6 @@ var index_exports = {};
|
|
|
21
21
|
__export(index_exports, {
|
|
22
22
|
BIZSTEP: () => BIZSTEP,
|
|
23
23
|
BTT: () => BTT,
|
|
24
|
-
BTT_DELIVERY: () => BTT_DELIVERY,
|
|
25
24
|
BTT_PRODORDER: () => BTT_PRODORDER,
|
|
26
25
|
CAPABILITIES: () => CAPABILITIES,
|
|
27
26
|
CAPABILITY_KEYS: () => CAPABILITY_KEYS,
|
|
@@ -84,6 +83,7 @@ __export(index_exports, {
|
|
|
84
83
|
WEBHOOK_STATUS: () => WEBHOOK_STATUS,
|
|
85
84
|
WEBHOOK_TOO_MANY: () => WEBHOOK_TOO_MANY,
|
|
86
85
|
WMS_LOCATION_TYPES: () => WMS_LOCATION_TYPES,
|
|
86
|
+
WMS_ORDER_KIND: () => WMS_ORDER_KIND,
|
|
87
87
|
WMS_TYPES: () => WMS_TYPES,
|
|
88
88
|
YARD_BIZSTEP: () => YARD_BIZSTEP,
|
|
89
89
|
YMS_LOCATION_TYPES: () => YMS_LOCATION_TYPES,
|
|
@@ -221,6 +221,7 @@ __export(index_exports, {
|
|
|
221
221
|
rolledThroughputYield: () => rolledThroughputYield,
|
|
222
222
|
sgtinClass: () => sgtinClass,
|
|
223
223
|
sgtinUri: () => sgtinUri,
|
|
224
|
+
splitRelationIds: () => splitRelationIds,
|
|
224
225
|
ssccUri: () => ssccUri,
|
|
225
226
|
stateFieldsOf: () => stateFieldsOf,
|
|
226
227
|
subLotIdOf: () => subLotIdOf,
|
|
@@ -231,6 +232,7 @@ __export(index_exports, {
|
|
|
231
232
|
transformationEvent: () => transformationEvent,
|
|
232
233
|
unavailableVerdict: () => unavailableVerdict,
|
|
233
234
|
unknownKindReason: () => unknownKindReason,
|
|
235
|
+
validateCatalog: () => validateCatalog,
|
|
234
236
|
validateDomainDefinition: () => validateDomainDefinition,
|
|
235
237
|
validateEpcisEvent: () => validateEpcisEvent,
|
|
236
238
|
validatePerformance: () => validatePerformance,
|
|
@@ -1264,8 +1266,28 @@ var BIZSTEP = {
|
|
|
1264
1266
|
replenishing: "urn:epcglobal:cbv:bizstep:replenishing"
|
|
1265
1267
|
};
|
|
1266
1268
|
var BTT = {
|
|
1269
|
+
/** Purchase Order — the document an inbound receipt is made against. */
|
|
1267
1270
|
po: "urn:epcglobal:cbv:btt:po",
|
|
1268
|
-
|
|
1271
|
+
/** Purchase Order Confirmation — the seller's sales order. */
|
|
1272
|
+
poc: "urn:epcglobal:cbv:btt:poc",
|
|
1273
|
+
/** Despatch Advice (ASN) — announces an inbound delivery; also attached when shipping. */
|
|
1274
|
+
desadv: "urn:epcglobal:cbv:btt:desadv",
|
|
1275
|
+
/** Receiving Advice — the reply once an inbound receipt is complete. */
|
|
1276
|
+
recadv: "urn:epcglobal:cbv:btt:recadv",
|
|
1277
|
+
/** Return Merchandise Authorization — what a return is received against. */
|
|
1278
|
+
rma: "urn:epcglobal:cbv:btt:rma",
|
|
1279
|
+
/** Bill of Lading — the carrier's document, attached when shipping. */
|
|
1280
|
+
bol: "urn:epcglobal:cbv:btt:bol"
|
|
1281
|
+
};
|
|
1282
|
+
var WMS_ORDER_KIND = {
|
|
1283
|
+
/** Expected receipt (ASN). The kernel has no inbound order yet — arrival carries a `po` without one. */
|
|
1284
|
+
inbound: "inbound",
|
|
1285
|
+
/** Outbound order — what the kernel's sales order is. */
|
|
1286
|
+
outbound: "outbound",
|
|
1287
|
+
/** Receipt of returned goods. */
|
|
1288
|
+
return: "return",
|
|
1289
|
+
/** Stock transfer between sites. CBV has no document type for it: carry the id without a type. */
|
|
1290
|
+
transfer: "transfer"
|
|
1269
1291
|
};
|
|
1270
1292
|
var WMS_LOCATION_TYPES = ["dock", "storage", "staging", "dock-ship", "vas-station"];
|
|
1271
1293
|
var WMS_LOCATION_LEVEL = {
|
|
@@ -1296,7 +1318,6 @@ var YARD_BIZSTEP = {
|
|
|
1296
1318
|
departing: "urn:epcglobal:cbv:bizstep:departing"
|
|
1297
1319
|
// 게이트-아웃
|
|
1298
1320
|
};
|
|
1299
|
-
var BTT_DELIVERY = "urn:epcglobal:cbv:btt:deliv";
|
|
1300
1321
|
function graiUri(companyPrefix, assetType, serial) {
|
|
1301
1322
|
return `urn:epc:id:grai:${companyPrefix}.${assetType}.${String(serial).padStart(6, "0")}`;
|
|
1302
1323
|
}
|
|
@@ -1855,7 +1876,12 @@ var TWIN_AXES = [
|
|
|
1855
1876
|
kind: "instance",
|
|
1856
1877
|
source: "state",
|
|
1857
1878
|
historical: true,
|
|
1858
|
-
|
|
1879
|
+
/*
|
|
1880
|
+
* No single EPCIS projection. A task's event kind follows its operation: a putaway or a pick is
|
|
1881
|
+
* an ObjectEvent, only a transformation (production, kitting) is a TransformationEvent. This used
|
|
1882
|
+
* to say `epcis: 'TransformationEvent'` for an axis that spans every logistics system.
|
|
1883
|
+
*/
|
|
1884
|
+
standardClass: { isa95: "SegmentResponse" },
|
|
1859
1885
|
systems: LOGISTICS
|
|
1860
1886
|
},
|
|
1861
1887
|
/*
|
|
@@ -1933,8 +1959,11 @@ function tenseOf(r) {
|
|
|
1933
1959
|
return r?.tense;
|
|
1934
1960
|
}
|
|
1935
1961
|
var TWIN_RELATIONS = [
|
|
1936
|
-
/*
|
|
1937
|
-
|
|
1962
|
+
/*
|
|
1963
|
+
* What a location sits in — another location (line ⊃ station, zone ⊃ aisle ⊃ bin) or, when no
|
|
1964
|
+
* location has that id, an area of the space (host's `TwinArea`). See `axis-or-external`.
|
|
1965
|
+
*/
|
|
1966
|
+
{ from: "locations", field: "parentId", target: { kind: "axis-or-external", axis: "locations", entity: "space.area" }, via: "ops.rel.area", optional: true, tense: "standing" },
|
|
1938
1967
|
/* 자원이 사는 자리 */
|
|
1939
1968
|
{ from: "equipment", field: "homeLocation", target: { kind: "axis", axis: "locations" }, via: "ops.rel.home", optional: true, tense: "standing" },
|
|
1940
1969
|
{ from: "persons", field: "homeLocation", target: { kind: "axis", axis: "locations" }, via: "ops.rel.home", optional: true, tense: "standing" },
|
|
@@ -2080,7 +2109,17 @@ function documentPath(axis) {
|
|
|
2080
2109
|
return info.path;
|
|
2081
2110
|
}
|
|
2082
2111
|
var relationsFrom = (axis) => TWIN_RELATIONS.filter((r) => r.from === axis);
|
|
2083
|
-
var relationsTo = (axis) => TWIN_RELATIONS.filter((r) => r.target.kind === "axis" && r.target.axis === axis);
|
|
2112
|
+
var relationsTo = (axis) => TWIN_RELATIONS.filter((r) => (r.target.kind === "axis" || r.target.kind === "axis-or-external") && r.target.axis === axis);
|
|
2113
|
+
function splitRelationIds(target, ids, inAxis) {
|
|
2114
|
+
if (target.kind === "axis") return { axis: { axis: target.axis, ids: [...ids] } };
|
|
2115
|
+
if (target.kind === "external") return { external: { entity: target.entity, ids: [...ids] } };
|
|
2116
|
+
if (target.kind === "axis-or-external") {
|
|
2117
|
+
const inside = ids.filter((id) => inAxis(target.axis, id));
|
|
2118
|
+
const outside = ids.filter((id) => !inAxis(target.axis, id));
|
|
2119
|
+
return { axis: { axis: target.axis, ids: inside }, external: { entity: target.entity, ids: outside } };
|
|
2120
|
+
}
|
|
2121
|
+
return {};
|
|
2122
|
+
}
|
|
2084
2123
|
function axisInfo(axis) {
|
|
2085
2124
|
return TWIN_AXES.find((a) => a.axis === axis);
|
|
2086
2125
|
}
|
|
@@ -2177,6 +2216,14 @@ function validateDomainDefinition(def) {
|
|
|
2177
2216
|
}
|
|
2178
2217
|
return v;
|
|
2179
2218
|
}
|
|
2219
|
+
var CATALOG_SEMVER = /^\d+\.\d+\.\d+([-+].+)?$/;
|
|
2220
|
+
function validateCatalog(cat) {
|
|
2221
|
+
const v = validateDomainDefinition(cat);
|
|
2222
|
+
if (typeof cat?.version !== "string" || !CATALOG_SEMVER.test(cat?.version || "")) {
|
|
2223
|
+
v.push(`version semver \uC544\uB2D8: ${cat?.version}`);
|
|
2224
|
+
}
|
|
2225
|
+
return v;
|
|
2226
|
+
}
|
|
2180
2227
|
|
|
2181
2228
|
// src/energy-ingest.ts
|
|
2182
2229
|
function isEnergyRecord(record) {
|
|
@@ -4583,7 +4630,6 @@ function nonEmpty(value) {
|
|
|
4583
4630
|
0 && (module.exports = {
|
|
4584
4631
|
BIZSTEP,
|
|
4585
4632
|
BTT,
|
|
4586
|
-
BTT_DELIVERY,
|
|
4587
4633
|
BTT_PRODORDER,
|
|
4588
4634
|
CAPABILITIES,
|
|
4589
4635
|
CAPABILITY_KEYS,
|
|
@@ -4646,6 +4692,7 @@ function nonEmpty(value) {
|
|
|
4646
4692
|
WEBHOOK_STATUS,
|
|
4647
4693
|
WEBHOOK_TOO_MANY,
|
|
4648
4694
|
WMS_LOCATION_TYPES,
|
|
4695
|
+
WMS_ORDER_KIND,
|
|
4649
4696
|
WMS_TYPES,
|
|
4650
4697
|
YARD_BIZSTEP,
|
|
4651
4698
|
YMS_LOCATION_TYPES,
|
|
@@ -4783,6 +4830,7 @@ function nonEmpty(value) {
|
|
|
4783
4830
|
rolledThroughputYield,
|
|
4784
4831
|
sgtinClass,
|
|
4785
4832
|
sgtinUri,
|
|
4833
|
+
splitRelationIds,
|
|
4786
4834
|
ssccUri,
|
|
4787
4835
|
stateFieldsOf,
|
|
4788
4836
|
subLotIdOf,
|
|
@@ -4793,6 +4841,7 @@ function nonEmpty(value) {
|
|
|
4793
4841
|
transformationEvent,
|
|
4794
4842
|
unavailableVerdict,
|
|
4795
4843
|
unknownKindReason,
|
|
4844
|
+
validateCatalog,
|
|
4796
4845
|
validateDomainDefinition,
|
|
4797
4846
|
validateEpcisEvent,
|
|
4798
4847
|
validatePerformance,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/ops-contract",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.24",
|
|
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",
|