@boxa-devops/depo-shared 1.0.1
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/README.md +72 -0
- package/dist/LangSwitch.d.ts +22 -0
- package/dist/LangSwitch.d.ts.map +1 -0
- package/dist/LangSwitch.js +26 -0
- package/dist/LangSwitch.js.map +1 -0
- package/dist/PartPhoto.d.ts +13 -0
- package/dist/PartPhoto.d.ts.map +1 -0
- package/dist/PartPhoto.js +21 -0
- package/dist/PartPhoto.js.map +1 -0
- package/dist/api.d.ts +20739 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +6 -0
- package/dist/api.js.map +1 -0
- package/dist/errors.d.ts +18 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +18 -0
- package/dist/errors.js.map +1 -0
- package/dist/i18nGuard.d.ts +29 -0
- package/dist/i18nGuard.d.ts.map +1 -0
- package/dist/i18nGuard.js +75 -0
- package/dist/i18nGuard.js.map +1 -0
- package/dist/i18nKeys.d.ts +16 -0
- package/dist/i18nKeys.d.ts.map +1 -0
- package/dist/i18nKeys.js +16 -0
- package/dist/i18nKeys.js.map +1 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/lang.d.ts +7 -0
- package/dist/lang.d.ts.map +1 -0
- package/dist/lang.js +24 -0
- package/dist/lang.js.map +1 -0
- package/dist/status.d.ts +3 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +23 -0
- package/dist/status.js.map +1 -0
- package/error_codes.json +699 -0
- package/openapi.json +42042 -0
- package/package.json +53 -0
- package/permissions.json +70 -0
- package/src/LangSwitch.tsx +44 -0
- package/src/PartPhoto.tsx +48 -0
- package/src/api.ts +20739 -0
- package/src/errors.ts +25 -0
- package/src/i18nGuard.ts +77 -0
- package/src/i18nKeys.ts +15 -0
- package/src/index.ts +168 -0
- package/src/lang.ts +26 -0
- package/src/status.ts +23 -0
- package/tokens.css +141 -0
package/dist/api.js
ADDED
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Error body shape used by all API 4xx responses: {code, message, detail?}. */
|
|
2
|
+
export interface ApiErrorDetail {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
detail?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Thrown for any non-2xx response. status 0 = network failure. */
|
|
8
|
+
export declare class ApiError extends Error {
|
|
9
|
+
status: number;
|
|
10
|
+
code: string;
|
|
11
|
+
detail?: string;
|
|
12
|
+
/** The whole refusal payload. Some refusals carry structured context the
|
|
13
|
+
* UI must render (e.g. 409 ROLE_SCOPE_CHANGE lists the affected grants).
|
|
14
|
+
* Defaults to `err` when the caller has no wider envelope to hand over. */
|
|
15
|
+
body: unknown;
|
|
16
|
+
constructor(status: number, err: ApiErrorDetail, body?: unknown);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,mEAAmE;AACnE,qBAAa,QAAS,SAAQ,KAAK;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;gFAE4E;IAC5E,IAAI,EAAE,OAAO,CAAC;gBAEF,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,OAAO;CAOhE"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Thrown for any non-2xx response. status 0 = network failure. */
|
|
2
|
+
export class ApiError extends Error {
|
|
3
|
+
status;
|
|
4
|
+
code;
|
|
5
|
+
detail;
|
|
6
|
+
/** The whole refusal payload. Some refusals carry structured context the
|
|
7
|
+
* UI must render (e.g. 409 ROLE_SCOPE_CHANGE lists the affected grants).
|
|
8
|
+
* Defaults to `err` when the caller has no wider envelope to hand over. */
|
|
9
|
+
body;
|
|
10
|
+
constructor(status, err, body) {
|
|
11
|
+
super(err.message);
|
|
12
|
+
this.status = status;
|
|
13
|
+
this.code = err.code;
|
|
14
|
+
this.detail = err.detail;
|
|
15
|
+
this.body = body ?? err;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAOA,mEAAmE;AACnE,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,MAAM,CAAS;IACf,IAAI,CAAS;IACb,MAAM,CAAU;IAChB;;gFAE4E;IAC5E,IAAI,CAAU;IAEd,YAAY,MAAc,EAAE,GAAmB,EAAE,IAAc;QAC7D,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,GAAG,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The guard that would have caught it: no key the code CALLS may be missing
|
|
3
|
+
* from the dictionaries.
|
|
4
|
+
*
|
|
5
|
+
* On 2026-09-03 the admin locale files lost 141 keys and every screen that used
|
|
6
|
+
* them rendered its key verbatim — «orders.reasonPlanned» in the orders filter,
|
|
7
|
+
* «passport.stage.ANY» on the Texpasport tab. The suites went red one screen at
|
|
8
|
+
* a time, and the parity test (i18n.test.tsx) stayed GREEN throughout: it
|
|
9
|
+
* compares ru against uz, so a key missing from BOTH is perfectly symmetrical.
|
|
10
|
+
*
|
|
11
|
+
* This one reads the other direction — from the source to the dictionaries —
|
|
12
|
+
* and is deliberately static: it needs no screen to be rendered, so it covers
|
|
13
|
+
* pages no render test mounts. Its runtime twin lives in each app's
|
|
14
|
+
* test-setup.ts, where i18next is told to THROW on a miss; that one catches the
|
|
15
|
+
* keys a screen builds at runtime out of an enum code, which no scanner can
|
|
16
|
+
* resolve.
|
|
17
|
+
*
|
|
18
|
+
* The body lives here, the globs stay per app: each app feeds its own `src`
|
|
19
|
+
* PLUS this package, so a `t()` inside a shared component is checked against
|
|
20
|
+
* both dictionaries that render it.
|
|
21
|
+
*/
|
|
22
|
+
export type Dict = {
|
|
23
|
+
[k: string]: string | Dict;
|
|
24
|
+
};
|
|
25
|
+
/** Keys called in `sources` that are absent from any of `dicts`. */
|
|
26
|
+
export declare function missingKeys(sources: Record<string, string>, dicts: Dict[]): string[];
|
|
27
|
+
/** Heads of dynamic keys — t(`x.y.${code}`) — whose group is absent. */
|
|
28
|
+
export declare function missingKeyGroups(sources: Record<string, string>, dicts: Dict[]): string[];
|
|
29
|
+
//# sourceMappingURL=i18nGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nGuard.d.ts","sourceRoot":"","sources":["../src/i18nGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,IAAI,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAwClD,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAMpF;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAIzF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The guard that would have caught it: no key the code CALLS may be missing
|
|
3
|
+
* from the dictionaries.
|
|
4
|
+
*
|
|
5
|
+
* On 2026-09-03 the admin locale files lost 141 keys and every screen that used
|
|
6
|
+
* them rendered its key verbatim — «orders.reasonPlanned» in the orders filter,
|
|
7
|
+
* «passport.stage.ANY» on the Texpasport tab. The suites went red one screen at
|
|
8
|
+
* a time, and the parity test (i18n.test.tsx) stayed GREEN throughout: it
|
|
9
|
+
* compares ru against uz, so a key missing from BOTH is perfectly symmetrical.
|
|
10
|
+
*
|
|
11
|
+
* This one reads the other direction — from the source to the dictionaries —
|
|
12
|
+
* and is deliberately static: it needs no screen to be rendered, so it covers
|
|
13
|
+
* pages no render test mounts. Its runtime twin lives in each app's
|
|
14
|
+
* test-setup.ts, where i18next is told to THROW on a miss; that one catches the
|
|
15
|
+
* keys a screen builds at runtime out of an enum code, which no scanner can
|
|
16
|
+
* resolve.
|
|
17
|
+
*
|
|
18
|
+
* The body lives here, the globs stay per app: each app feeds its own `src`
|
|
19
|
+
* PLUS this package, so a `t()` inside a shared component is checked against
|
|
20
|
+
* both dictionaries that render it.
|
|
21
|
+
*/
|
|
22
|
+
/** `t("orders.reason")` / `i18n.t("...")` — a key spelled out in full. */
|
|
23
|
+
const LITERAL = /\bt\(\s*"([a-z][a-zA-Z0-9_]*(?:\.[a-zA-Z0-9_]+)+)"/g;
|
|
24
|
+
/** t(`passport.stage.${row.stages}`) — only the fixed head is knowable here. */
|
|
25
|
+
const TEMPLATE = /\bt\(\s*`([a-z][a-zA-Z0-9_]*(?:\.[a-zA-Z0-9_]+)*)\.\$\{/g;
|
|
26
|
+
function flat(d, prefix = "") {
|
|
27
|
+
const out = {};
|
|
28
|
+
for (const [k, v] of Object.entries(d)) {
|
|
29
|
+
const key = prefix ? `${prefix}.${k}` : k;
|
|
30
|
+
if (typeof v === "string")
|
|
31
|
+
out[key] = v;
|
|
32
|
+
else
|
|
33
|
+
Object.assign(out, flat(v, key));
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/** Does this path name a group of keys (an object), rather than one string? */
|
|
38
|
+
function group(d, dotted) {
|
|
39
|
+
let node = d;
|
|
40
|
+
for (const part of dotted.split(".")) {
|
|
41
|
+
if (typeof node !== "object" || node === null)
|
|
42
|
+
return false;
|
|
43
|
+
node = node[part];
|
|
44
|
+
}
|
|
45
|
+
return typeof node === "object" && node !== null;
|
|
46
|
+
}
|
|
47
|
+
function used(sources, re) {
|
|
48
|
+
const out = new Map();
|
|
49
|
+
for (const [path, text] of Object.entries(sources)) {
|
|
50
|
+
// the guard and the setup spell example keys out in their own regexes
|
|
51
|
+
if (path.endsWith("i18nKeys.test.ts") || path.endsWith("i18nGuard.ts"))
|
|
52
|
+
continue;
|
|
53
|
+
if (path.endsWith("test-setup.ts"))
|
|
54
|
+
continue;
|
|
55
|
+
for (const m of text.matchAll(re)) {
|
|
56
|
+
out.set(m[1], [...(out.get(m[1]) ?? []), path.replace("./", "")]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
/** Keys called in `sources` that are absent from any of `dicts`. */
|
|
62
|
+
export function missingKeys(sources, dicts) {
|
|
63
|
+
const flats = dicts.map((d) => flat(d));
|
|
64
|
+
return [...used(sources, LITERAL)]
|
|
65
|
+
.filter(([key]) => flats.some((f) => !(key in f)))
|
|
66
|
+
// named, not counted: the failure has to say WHICH screen prints a raw key
|
|
67
|
+
.map(([key, files]) => `${key} (${[...new Set(files)].join(", ")})`);
|
|
68
|
+
}
|
|
69
|
+
/** Heads of dynamic keys — t(`x.y.${code}`) — whose group is absent. */
|
|
70
|
+
export function missingKeyGroups(sources, dicts) {
|
|
71
|
+
return [...used(sources, TEMPLATE)]
|
|
72
|
+
.filter(([key]) => dicts.some((d) => !group(d, key)))
|
|
73
|
+
.map(([key, files]) => `${key}.* (${[...new Set(files)].join(", ")})`);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=i18nGuard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nGuard.js","sourceRoot":"","sources":["../src/i18nGuard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH,0EAA0E;AAC1E,MAAM,OAAO,GAAG,qDAAqD,CAAC;AACtE,gFAAgF;AAChF,MAAM,QAAQ,GAAG,0DAA0D,CAAC;AAE5E,SAAS,IAAI,CAAC,CAAO,EAAE,MAAM,GAAG,EAAE;IAChC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,OAAO,CAAC,KAAK,QAAQ;YAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;;YACnC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,+EAA+E;AAC/E,SAAS,KAAK,CAAC,CAAO,EAAE,MAAc;IACpC,IAAI,IAAI,GAA8B,CAAC,CAAC;IACxC,KAAK,MAAM,IAAI,IA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EAAE,OAAO,CAAC,CAAC;SAC/B,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClD,2EAA2E;SAC1E,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzE,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,gBAAgB,CAAC,OAA+B,EAAE,KAAa;IAC7E,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;SAChC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every i18n key the components in this package resolve against the
|
|
3
|
+
* CONSUMER's dictionary. The components carry no dictionary of their own —
|
|
4
|
+
* they call the host app's `t()`, so a key that exists here and nowhere in
|
|
5
|
+
* depo-terminal / depo-admin throws at runtime (both apps configure i18next
|
|
6
|
+
* to throw on a miss).
|
|
7
|
+
*
|
|
8
|
+
* Before the split each app's i18nKeys.test.ts globbed
|
|
9
|
+
* ../../../packages/shared/src to catch this. That relative path cannot
|
|
10
|
+
* survive separate repos, so the list is explicit and guarded on the
|
|
11
|
+
* PRODUCING side instead: i18nKeys.test.ts here fails if a component calls
|
|
12
|
+
* t() with a key missing from this array, and each app asserts every key in
|
|
13
|
+
* the array exists in its own ru.json and uz.json.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SHARED_I18N_KEYS: readonly ["lang.switch"];
|
|
16
|
+
//# sourceMappingURL=i18nKeys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nKeys.d.ts","sourceRoot":"","sources":["../src/i18nKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,0BAA2B,CAAC"}
|
package/dist/i18nKeys.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every i18n key the components in this package resolve against the
|
|
3
|
+
* CONSUMER's dictionary. The components carry no dictionary of their own —
|
|
4
|
+
* they call the host app's `t()`, so a key that exists here and nowhere in
|
|
5
|
+
* depo-terminal / depo-admin throws at runtime (both apps configure i18next
|
|
6
|
+
* to throw on a miss).
|
|
7
|
+
*
|
|
8
|
+
* Before the split each app's i18nKeys.test.ts globbed
|
|
9
|
+
* ../../../packages/shared/src to catch this. That relative path cannot
|
|
10
|
+
* survive separate repos, so the list is explicit and guarded on the
|
|
11
|
+
* PRODUCING side instead: i18nKeys.test.ts here fails if a component calls
|
|
12
|
+
* t() with a key missing from this array, and each app asserts every key in
|
|
13
|
+
* the array exists in its own ru.json and uz.json.
|
|
14
|
+
*/
|
|
15
|
+
export const SHARED_I18N_KEYS = ["lang.switch"];
|
|
16
|
+
//# sourceMappingURL=i18nKeys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nKeys.js","sourceRoot":"","sources":["../src/i18nKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,aAAa,CAAU,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { components } from "./api.js";
|
|
2
|
+
export type Schemas = components["schemas"];
|
|
3
|
+
export type TokenOut = Schemas["TokenOut"];
|
|
4
|
+
export type EventOut = Schemas["EventOut"];
|
|
5
|
+
export type LoginIn = Schemas["LoginIn"];
|
|
6
|
+
export type EnrollIn = Schemas["EnrollIn"];
|
|
7
|
+
export type EnrollConfirmIn = Schemas["EnrollConfirmIn"];
|
|
8
|
+
export type EnrollBeginOut = Schemas["EnrollBeginOut"];
|
|
9
|
+
export type SessionOut = Schemas["AdminSessionOut"];
|
|
10
|
+
export type ItemCard = Schemas["ItemCard"];
|
|
11
|
+
export type ItemCandidate = Schemas["ItemCandidate"];
|
|
12
|
+
export type HistoryEvent = Schemas["HistoryEvent"];
|
|
13
|
+
export type HistoryPage = Schemas["HistoryPage"];
|
|
14
|
+
export type DefectHistoryRow = Schemas["DefectHistoryRow"];
|
|
15
|
+
export type DefectProposalRow = Schemas["DefectProposalRow"];
|
|
16
|
+
export type NomenclatureReviewRow = Schemas["NomenclatureReviewRow"];
|
|
17
|
+
export type StateAtOut = Schemas["StateAtOut"];
|
|
18
|
+
export type NomenclatureFieldRef = Schemas["NomenclatureFieldRef"];
|
|
19
|
+
export type PassportOut = Schemas["PassportOut"];
|
|
20
|
+
export type PassportValue = Schemas["PassportValue"];
|
|
21
|
+
export type AttrsUpdateIn = Schemas["AttrsUpdateIn"];
|
|
22
|
+
export type AttrsUpdateOut = Schemas["AttrsUpdateOut"];
|
|
23
|
+
export type MeasurementAddIn = Schemas["MeasurementAddIn"];
|
|
24
|
+
export type MeasurementAddOut = Schemas["MeasurementAddOut"];
|
|
25
|
+
export type NomenclatureOperationRef = Schemas["NomenclatureOperationRef"];
|
|
26
|
+
export type MeasurementValueIn = Schemas["MeasurementValueIn"];
|
|
27
|
+
export type ItemMeasurementRow = Schemas["ItemMeasurementRow"];
|
|
28
|
+
export type ItemMeasurements = Schemas["ItemMeasurementsOut"];
|
|
29
|
+
export type ServiceHistoryRow = Schemas["ServiceHistoryRow"];
|
|
30
|
+
export type NomenclatureFieldOut = Schemas["NomenclatureFieldOut"];
|
|
31
|
+
export type NomenclatureOperationOut = Schemas["NomenclatureOperationOut"];
|
|
32
|
+
export type NomenclatureRuleOut = Schemas["NomenclatureRuleOut"];
|
|
33
|
+
export type RuleParamOut = Schemas["RuleParamOut"];
|
|
34
|
+
export type RulePreviewOut = Schemas["RulePreviewOut"];
|
|
35
|
+
export type RecommendationOut = Schemas["RecommendationOut"];
|
|
36
|
+
export type WorkOrderOut = Schemas["WorkOrderOut"];
|
|
37
|
+
export type WorkOrderDetail = Schemas["WorkOrderDetail"];
|
|
38
|
+
export type TaskOut = Schemas["TaskOut"];
|
|
39
|
+
export type AssignmentOut = Schemas["AssignmentOut"];
|
|
40
|
+
export type SignatureOut = Schemas["SignatureOut"];
|
|
41
|
+
export type SearchResults = Schemas["SearchResults"];
|
|
42
|
+
export type StaffOut = Schemas["StaffOut"];
|
|
43
|
+
export type StaffSave = Schemas["StaffSave"];
|
|
44
|
+
export type RoleGrantIn = Schemas["RoleGrantIn"];
|
|
45
|
+
export type RoleGrantOut = Schemas["RoleGrantOut"];
|
|
46
|
+
export type RoleTemplateOut = Schemas["RoleTemplateOut"];
|
|
47
|
+
export type StaffImportRow = Schemas["ImportRowOut"];
|
|
48
|
+
export type StaffImportResult = Schemas["ImportResultOut"];
|
|
49
|
+
export type DictImportRow = Schemas["DictImportRow"];
|
|
50
|
+
export type DictImportResult = Schemas["DictImportResult"];
|
|
51
|
+
export type Deletable = Schemas["DeletableOut"];
|
|
52
|
+
export type LocomotiveCard = Schemas["LocomotiveCard"];
|
|
53
|
+
export type LocoComposition = Schemas["CompositionOut"];
|
|
54
|
+
export type LocoCompositionAt = Schemas["CompositionAtOut"];
|
|
55
|
+
export type LocoCompositionGroup = Schemas["CompositionGroup"];
|
|
56
|
+
export type LocoCompositionItem = Schemas["CompositionItem"];
|
|
57
|
+
export type LocoHistoryEvent = Schemas["LocoHistoryEvent"];
|
|
58
|
+
export type LocoHistoryPage = Schemas["LocoHistoryPage"];
|
|
59
|
+
export type LocoUnitRow = Schemas["LocoUnitRow"];
|
|
60
|
+
export type LocoUnitCard = Schemas["LocoUnitCard"];
|
|
61
|
+
export type LocoUnitSection = Schemas["UnitSection"];
|
|
62
|
+
export type LocoOverviewRow = Schemas["LocoOverviewRow"];
|
|
63
|
+
export type LocoSeriesRow = Schemas["LocoSeriesOut"];
|
|
64
|
+
export type FieldRegisterIn = Schemas["FieldRegisterIn"];
|
|
65
|
+
export type FieldRegisterOut = Schemas["FieldRegisterOut"];
|
|
66
|
+
export type WorkSignIn = Schemas["WorkSignIn"];
|
|
67
|
+
export type WorkSignOut = Schemas["WorkSignOut"];
|
|
68
|
+
export type NomenclatureSuggestRow = Schemas["NomenclatureSuggestRow"];
|
|
69
|
+
export type NomenclatureCategoryRef = Schemas["NomenclatureCategoryRef"];
|
|
70
|
+
export type NomenclatureRef = Schemas["NomenclatureRef"];
|
|
71
|
+
export type NomenclatureQuickCreateOut = Schemas["NomenclatureQuickCreateOut"];
|
|
72
|
+
export type FieldRegisterBatchIn = Schemas["FieldRegisterBatchIn"];
|
|
73
|
+
export type StockReceiveBatchIn = Schemas["StockReceiveBatchIn"];
|
|
74
|
+
export type FieldRegisterBatchOut = Schemas["FieldRegisterBatchOut"];
|
|
75
|
+
export type FieldRegisterEntry = Schemas["FieldRegisterEntry"];
|
|
76
|
+
export type HandoverGiveIn = Schemas["HandoverGiveIn"];
|
|
77
|
+
export type HandoverAcceptIn = Schemas["HandoverAcceptIn"];
|
|
78
|
+
export type HandoverDeclineIn = Schemas["HandoverDeclineIn"];
|
|
79
|
+
export type HandoverOut = Schemas["HandoverOut"];
|
|
80
|
+
export type PendingHandoverOut = Schemas["PendingHandoverOut"];
|
|
81
|
+
/** Discriminated union of POST /api/v1/events command bodies. */
|
|
82
|
+
export type EventCommand = Schemas["InstallCommand"] | Schemas["MoveCommand"] | Schemas["HandoverCommand"] | Schemas["RemoveCommand"] | Schemas["ReceiveOpeningCommand"] | Schemas["FoundCommand"] | Schemas["InspectCommand"] | Schemas["DispositionCommand"] | Schemas["StornoCommand"] | Schemas["RepairStartCommand"] | Schemas["RepairPauseCommand"] | Schemas["RepairResumeCommand"] | Schemas["RepairFinishCommand"] | Schemas["GenericCommand"];
|
|
83
|
+
export type EventType = EventCommand["event_type"];
|
|
84
|
+
/** Runtime list of all journal event types (mirrors the EventCommand union). */
|
|
85
|
+
export declare const EVENT_TYPES: readonly EventType[];
|
|
86
|
+
export { ApiError } from "./errors.js";
|
|
87
|
+
export type { ApiErrorDetail } from "./errors.js";
|
|
88
|
+
export { statusDot } from "./status.js";
|
|
89
|
+
export { LANGS, setLanguage, storedLanguage } from "./lang.js";
|
|
90
|
+
export type { Lang } from "./lang.js";
|
|
91
|
+
export { LangSwitch } from "./LangSwitch.js";
|
|
92
|
+
export { PartPhoto } from "./PartPhoto.js";
|
|
93
|
+
export { missingKeys, missingKeyGroups } from "./i18nGuard.js";
|
|
94
|
+
export type { Dict } from "./i18nGuard.js";
|
|
95
|
+
export { SHARED_I18N_KEYS } from "./i18nKeys.js";
|
|
96
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AAE5C,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAG3C,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACzC,MAAM,MAAM,QAAQ,GA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AC,cAAc,CAAC,GACvB,OAAO,CAAC,gBAAgB,CAAC,GACzB,OAAO,CAAC,oBAAoB,CAAC,GAC7B,OAAO,CAAC,eAAe,CAAC,GACxB,OAAO,CAAC,oBAAoB,CAAC,GAC7B,OAAO,CAAC,oBAAoB,CAAC,GAC7B,OAAO,CAAC,qBAAqB,CAAC,GAC9B,OAAO,CAAC,qBAAqB,CAAC,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE9B,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;AAEnD,gFAAgF;AAChF,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EA4B3C,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC/D,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,YAAY,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Runtime list of all journal event types (mirrors the EventCommand union). */
|
|
2
|
+
export const EVENT_TYPES = [
|
|
3
|
+
"INSTALL",
|
|
4
|
+
"MOVE",
|
|
5
|
+
"HANDOVER",
|
|
6
|
+
"REMOVE",
|
|
7
|
+
"RECEIVE_OPENING",
|
|
8
|
+
"FOUND",
|
|
9
|
+
"INSPECT",
|
|
10
|
+
"DISPOSITION",
|
|
11
|
+
"STORNO",
|
|
12
|
+
"RECEIVE_NEW",
|
|
13
|
+
"ISSUE_OUT",
|
|
14
|
+
"SEND_TO_REPAIR",
|
|
15
|
+
"REPAIR_START",
|
|
16
|
+
"REPAIR_PAUSE",
|
|
17
|
+
"REPAIR_RESUME",
|
|
18
|
+
"REPAIR_FINISH",
|
|
19
|
+
"QC_ACCEPT",
|
|
20
|
+
"QC_REJECT",
|
|
21
|
+
"STORE_IN",
|
|
22
|
+
"ASSEMBLE",
|
|
23
|
+
"DISASSEMBLE",
|
|
24
|
+
"SEND_TO_PLANT",
|
|
25
|
+
"RETURN_FROM_PLANT",
|
|
26
|
+
"PLANT_REJECT",
|
|
27
|
+
"COUNT",
|
|
28
|
+
"SCRAP",
|
|
29
|
+
"LOST",
|
|
30
|
+
];
|
|
31
|
+
export { ApiError } from "./errors.js";
|
|
32
|
+
export { statusDot } from "./status.js";
|
|
33
|
+
export { LANGS, setLanguage, storedLanguage } from "./lang.js";
|
|
34
|
+
export { LangSwitch } from "./LangSwitch.js";
|
|
35
|
+
export { PartPhoto } from "./PartPhoto.js";
|
|
36
|
+
export { missingKeys, missingKeyGroups } from "./i18nGuard.js";
|
|
37
|
+
// i18n keys the components here resolve against the CONSUMER's dictionary
|
|
38
|
+
export { SHARED_I18N_KEYS } from "./i18nKeys.js";
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA8HA,gFAAgF;AAChF,MAAM,CAAC,MAAM,WAAW,GAAyB;IAC/C,SAAS;IACT,MAAM;IACN,UAAU;IACV,QAAQ;IACR,iBAAiB;IACjB,OAAO;IACP,SAAS;IACT,aAAa;IACb,QAAQ;IACR,aAAa;IACb,WAAW;IACX,gBAAgB;IAChB,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,WAAW;IACX,WAAW;IACX,UAAU;IACV,UAAU;IACV,aAAa;IACb,eAAe;IACf,mBAAmB;IACnB,cAAc;IACd,OAAO;IACP,OAAO;IACP,MAAM;CACP,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,0EAA0E;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/lang.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const LANGS: readonly ["uz", "ru"];
|
|
2
|
+
export type Lang = (typeof LANGS)[number];
|
|
3
|
+
/** The remembered choice, per browser. localStorage throws in a locked-down
|
|
4
|
+
* profile (a kiosk is one) — the caller's default covers that. */
|
|
5
|
+
export declare function storedLanguage(): Lang | null;
|
|
6
|
+
export declare function setLanguage(lng: Lang): void;
|
|
7
|
+
//# sourceMappingURL=lang.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lang.d.ts","sourceRoot":"","sources":["../src/lang.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,uBAAwB,CAAC;AAC3C,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AAI1C;mEACmE;AACnE,wBAAgB,cAAc,IAAI,IAAI,GAAG,IAAI,CAO5C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAO3C"}
|
package/dist/lang.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import i18n from "i18next";
|
|
2
|
+
export const LANGS = ["uz", "ru"];
|
|
3
|
+
const STORAGE_KEY = "depo.lang";
|
|
4
|
+
/** The remembered choice, per browser. localStorage throws in a locked-down
|
|
5
|
+
* profile (a kiosk is one) — the caller's default covers that. */
|
|
6
|
+
export function storedLanguage() {
|
|
7
|
+
try {
|
|
8
|
+
const v = localStorage.getItem(STORAGE_KEY);
|
|
9
|
+
return LANGS.includes(v) ? v : null;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function setLanguage(lng) {
|
|
16
|
+
try {
|
|
17
|
+
localStorage.setItem(STORAGE_KEY, lng);
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// private / locked-down mode: the choice just does not survive a reload
|
|
21
|
+
}
|
|
22
|
+
void i18n.changeLanguage(lng);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=lang.js.map
|
package/dist/lang.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../src/lang.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU,CAAC;AAG3C,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC;mEACmE;AACnE,MAAM,UAAU,cAAc;IAC5B,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC5C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAS,CAAC,CAAC,CAAC,CAAE,CAAU,CAAC,CAAC,CAAC,IAAI,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAS;IACnC,IAAI,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,wEAAwE;IAC1E,CAAC;IACD,KAAK,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/status.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAmBA,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
package/dist/status.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Hue per part status, shared by the registry and the monoblock: the same
|
|
2
|
+
* status keeps the same color everywhere. Tokens live in tokens.css
|
|
3
|
+
* (--color-st-*); labels stay per-app, they differ by product wording. */
|
|
4
|
+
const DOT = {
|
|
5
|
+
IN_STOCK_NEW: "bg-st-blue",
|
|
6
|
+
IN_STOCK_OK: "bg-st-green",
|
|
7
|
+
IN_STOCK_DEFECT: "bg-st-amber",
|
|
8
|
+
INSTALLED: "bg-st-teal",
|
|
9
|
+
REMOVED: "bg-st-slate",
|
|
10
|
+
IN_TRANSIT: "bg-st-sky",
|
|
11
|
+
IN_REPAIR: "bg-st-amber",
|
|
12
|
+
AWAITING_QC: "bg-st-purple",
|
|
13
|
+
AWAITING_DISPOSITION: "bg-st-orange",
|
|
14
|
+
PLANT_REPAIR: "bg-st-indigo",
|
|
15
|
+
SCRAPPED: "bg-st-red",
|
|
16
|
+
LOST: "bg-st-red-dark",
|
|
17
|
+
REPLACED: "bg-st-stone",
|
|
18
|
+
};
|
|
19
|
+
/** Dot class for a part status; unknown statuses render neutral. */
|
|
20
|
+
export function statusDot(status) {
|
|
21
|
+
return DOT[status] ?? "bg-st-slate";
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA;;2EAE2E;AAC3E,MAAM,GAAG,GAA2B;IAClC,YAAY,EAAE,YAAY;IAC1B,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,aAAa;IAC9B,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,WAAW;IACvB,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,cAAc;IAC3B,oBAAoB,EAAE,cAAc;IACpC,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,WAAW;IACrB,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEF,oEAAoE;AACpE,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,aAAa,CAAC;AACtC,CAAC"}
|