@pegasimed.com/pegasi-sail-connect-shared 0.2.0-dev.1 → 0.2.0-dev.11
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 +355 -30
- package/dist/authorization/index.d.ts +1 -0
- package/dist/authorization/index.d.ts.map +1 -1
- package/dist/authorization/index.js +1 -0
- package/dist/authorization/index.js.map +1 -1
- package/dist/authorization/work-grants.d.ts +151 -0
- package/dist/authorization/work-grants.d.ts.map +1 -0
- package/dist/authorization/work-grants.js +306 -0
- package/dist/authorization/work-grants.js.map +1 -0
- package/dist/authorization-testing.d.ts +229 -0
- package/dist/authorization-testing.d.ts.map +1 -0
- package/dist/authorization-testing.js +744 -0
- package/dist/authorization-testing.js.map +1 -0
- package/dist/capabilities/canonical-json.d.ts +3 -0
- package/dist/capabilities/canonical-json.d.ts.map +1 -0
- package/dist/capabilities/canonical-json.js +83 -0
- package/dist/capabilities/canonical-json.js.map +1 -0
- package/dist/capabilities/catalog-data.d.ts +559 -281
- package/dist/capabilities/catalog-data.d.ts.map +1 -1
- package/dist/capabilities/catalog-data.js +582 -287
- package/dist/capabilities/catalog-data.js.map +1 -1
- package/dist/capabilities/catalog.d.ts.map +1 -1
- package/dist/capabilities/catalog.js +4 -4
- package/dist/capabilities/catalog.js.map +1 -1
- package/dist/capabilities/index.d.ts +4 -0
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/index.js +7 -0
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/migration-data.d.ts +105 -190
- package/dist/capabilities/migration-data.d.ts.map +1 -1
- package/dist/capabilities/migration-data.js +83 -144
- package/dist/capabilities/migration-data.js.map +1 -1
- package/dist/capabilities/migration.d.ts +20 -20
- package/dist/capabilities/migration.d.ts.map +1 -1
- package/dist/capabilities/migration.js +25 -40
- package/dist/capabilities/migration.js.map +1 -1
- package/dist/capabilities/sha256.d.ts +18 -0
- package/dist/capabilities/sha256.d.ts.map +1 -0
- package/dist/capabilities/sha256.js +180 -0
- package/dist/capabilities/sha256.js.map +1 -0
- package/dist/capabilities/types.d.ts +3 -2
- package/dist/capabilities/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/organization/index.d.ts +135 -0
- package/dist/organization/index.d.ts.map +1 -0
- package/dist/organization/index.js +92 -0
- package/dist/organization/index.js.map +1 -0
- package/dist/worker-logger.d.ts +46 -4
- package/dist/worker-logger.d.ts.map +1 -1
- package/dist/worker-logger.js +33 -11
- package/dist/worker-logger.js.map +1 -1
- package/package.json +11 -3
- package/scripts/check-service-keys.mjs +30 -7
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// SHA-256 (FIPS 180-4) in plain TypeScript, so that `./capabilities` and
|
|
2
|
+
// `./authorization` run unchanged in Node, browsers and edge runtimes: no
|
|
3
|
+
// `node:crypto`, no `Buffer`, no Web Crypto (which is asynchronous) and no
|
|
4
|
+
// TextEncoder. The output is byte-identical to
|
|
5
|
+
// `createHash("sha256").update(text, "utf8")` of node:crypto, including the
|
|
6
|
+
// replacement of lone surrogates by U+FFFD (test/capabilities/sha256.test.ts
|
|
7
|
+
// checks the NIST vectors and the equivalence with node:crypto).
|
|
8
|
+
//
|
|
9
|
+
// Internal to the package: not exported by any subpath.
|
|
10
|
+
const ROUND_CONSTANTS = new Uint32Array([
|
|
11
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
12
|
+
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
|
13
|
+
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
14
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
|
15
|
+
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
16
|
+
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
17
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
18
|
+
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
|
|
19
|
+
]);
|
|
20
|
+
const INITIAL_HASH = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19];
|
|
21
|
+
// Code point at `index` (a lone surrogate reads as U+FFFD) and the number of
|
|
22
|
+
// UTF-16 code units it takes.
|
|
23
|
+
function codePointAt(text, index) {
|
|
24
|
+
const unit = text.charCodeAt(index);
|
|
25
|
+
if (unit < 0xd800 || unit > 0xdfff) {
|
|
26
|
+
return [unit, 1];
|
|
27
|
+
}
|
|
28
|
+
const next = index + 1 < text.length ? text.charCodeAt(index + 1) : 0;
|
|
29
|
+
if (unit <= 0xdbff && next >= 0xdc00 && next <= 0xdfff) {
|
|
30
|
+
return [0x10000 + ((unit - 0xd800) << 10) + (next - 0xdc00), 2];
|
|
31
|
+
}
|
|
32
|
+
return [0xfffd, 1];
|
|
33
|
+
}
|
|
34
|
+
function utf8Length(codePoint) {
|
|
35
|
+
return codePoint < 0x80 ? 1 : codePoint < 0x800 ? 2 : codePoint < 0x10000 ? 3 : 4;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* UTF-8 bytes of a JavaScript string, as `Buffer.from(text, "utf8")` (and
|
|
39
|
+
* TextEncoder) produce them: a lone surrogate becomes U+FFFD (EF BF BD).
|
|
40
|
+
* Written into a preallocated Uint8Array (never `push` on an array, which an
|
|
41
|
+
* inherited index setter could intercept).
|
|
42
|
+
*/
|
|
43
|
+
export function utf8Bytes(text) {
|
|
44
|
+
let length = 0;
|
|
45
|
+
for (let index = 0; index < text.length;) {
|
|
46
|
+
const [codePoint, units] = codePointAt(text, index);
|
|
47
|
+
length += utf8Length(codePoint);
|
|
48
|
+
index += units;
|
|
49
|
+
}
|
|
50
|
+
const bytes = new Uint8Array(length);
|
|
51
|
+
let position = 0;
|
|
52
|
+
for (let index = 0; index < text.length;) {
|
|
53
|
+
const [codePoint, units] = codePointAt(text, index);
|
|
54
|
+
index += units;
|
|
55
|
+
const size = utf8Length(codePoint);
|
|
56
|
+
if (size === 1) {
|
|
57
|
+
bytes[position] = codePoint;
|
|
58
|
+
}
|
|
59
|
+
else if (size === 2) {
|
|
60
|
+
bytes[position] = 0xc0 | (codePoint >> 6);
|
|
61
|
+
bytes[position + 1] = 0x80 | (codePoint & 0x3f);
|
|
62
|
+
}
|
|
63
|
+
else if (size === 3) {
|
|
64
|
+
bytes[position] = 0xe0 | (codePoint >> 12);
|
|
65
|
+
bytes[position + 1] = 0x80 | ((codePoint >> 6) & 0x3f);
|
|
66
|
+
bytes[position + 2] = 0x80 | (codePoint & 0x3f);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
bytes[position] = 0xf0 | (codePoint >> 18);
|
|
70
|
+
bytes[position + 1] = 0x80 | ((codePoint >> 12) & 0x3f);
|
|
71
|
+
bytes[position + 2] = 0x80 | ((codePoint >> 6) & 0x3f);
|
|
72
|
+
bytes[position + 3] = 0x80 | (codePoint & 0x3f);
|
|
73
|
+
}
|
|
74
|
+
position += size;
|
|
75
|
+
}
|
|
76
|
+
return bytes;
|
|
77
|
+
}
|
|
78
|
+
function rotateRight(value, bits) {
|
|
79
|
+
return (value >>> bits) | (value << (32 - bits));
|
|
80
|
+
}
|
|
81
|
+
/** SHA-256 digest (32 bytes) of a byte array. */
|
|
82
|
+
export function sha256Bytes(message) {
|
|
83
|
+
const bitLength = message.length * 8;
|
|
84
|
+
// Message, the 0x80 marker, zero padding and the 64-bit big-endian length.
|
|
85
|
+
const paddedLength = Math.ceil((message.length + 9) / 64) * 64;
|
|
86
|
+
const padded = new Uint8Array(paddedLength);
|
|
87
|
+
padded.set(message);
|
|
88
|
+
padded[message.length] = 0x80;
|
|
89
|
+
const view = new DataView(padded.buffer);
|
|
90
|
+
view.setUint32(paddedLength - 8, Math.floor(bitLength / 0x100000000));
|
|
91
|
+
view.setUint32(paddedLength - 4, bitLength >>> 0);
|
|
92
|
+
const hash = Uint32Array.from(INITIAL_HASH);
|
|
93
|
+
const schedule = new Uint32Array(64);
|
|
94
|
+
for (let offset = 0; offset < paddedLength; offset += 64) {
|
|
95
|
+
for (let round = 0; round < 16; round += 1) {
|
|
96
|
+
schedule[round] = view.getUint32(offset + round * 4);
|
|
97
|
+
}
|
|
98
|
+
for (let round = 16; round < 64; round += 1) {
|
|
99
|
+
const w15 = schedule[round - 15];
|
|
100
|
+
const w2 = schedule[round - 2];
|
|
101
|
+
const sigma0 = rotateRight(w15, 7) ^ rotateRight(w15, 18) ^ (w15 >>> 3);
|
|
102
|
+
const sigma1 = rotateRight(w2, 17) ^ rotateRight(w2, 19) ^ (w2 >>> 10);
|
|
103
|
+
schedule[round] = (schedule[round - 16] + sigma0 + schedule[round - 7] + sigma1) >>> 0;
|
|
104
|
+
}
|
|
105
|
+
let a = hash[0];
|
|
106
|
+
let b = hash[1];
|
|
107
|
+
let c = hash[2];
|
|
108
|
+
let d = hash[3];
|
|
109
|
+
let e = hash[4];
|
|
110
|
+
let f = hash[5];
|
|
111
|
+
let g = hash[6];
|
|
112
|
+
let h = hash[7];
|
|
113
|
+
for (let round = 0; round < 64; round += 1) {
|
|
114
|
+
const sum1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25);
|
|
115
|
+
const choice = (e & f) ^ (~e & g);
|
|
116
|
+
const temp1 = (h + sum1 + choice + ROUND_CONSTANTS[round] + schedule[round]) >>> 0;
|
|
117
|
+
const sum0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22);
|
|
118
|
+
const majority = (a & b) ^ (a & c) ^ (b & c);
|
|
119
|
+
const temp2 = (sum0 + majority) >>> 0;
|
|
120
|
+
h = g;
|
|
121
|
+
g = f;
|
|
122
|
+
f = e;
|
|
123
|
+
e = (d + temp1) >>> 0;
|
|
124
|
+
d = c;
|
|
125
|
+
c = b;
|
|
126
|
+
b = a;
|
|
127
|
+
a = (temp1 + temp2) >>> 0;
|
|
128
|
+
}
|
|
129
|
+
hash[0] = (hash[0] + a) >>> 0;
|
|
130
|
+
hash[1] = (hash[1] + b) >>> 0;
|
|
131
|
+
hash[2] = (hash[2] + c) >>> 0;
|
|
132
|
+
hash[3] = (hash[3] + d) >>> 0;
|
|
133
|
+
hash[4] = (hash[4] + e) >>> 0;
|
|
134
|
+
hash[5] = (hash[5] + f) >>> 0;
|
|
135
|
+
hash[6] = (hash[6] + g) >>> 0;
|
|
136
|
+
hash[7] = (hash[7] + h) >>> 0;
|
|
137
|
+
}
|
|
138
|
+
const digest = new Uint8Array(32);
|
|
139
|
+
const digestView = new DataView(digest.buffer);
|
|
140
|
+
hash.forEach((word, index) => digestView.setUint32(index * 4, word));
|
|
141
|
+
return digest;
|
|
142
|
+
}
|
|
143
|
+
const HEX = "0123456789abcdef";
|
|
144
|
+
const BASE64URL = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
145
|
+
/** Lower-case hex of a byte array, as `digest("hex")`. */
|
|
146
|
+
export function toHex(bytes) {
|
|
147
|
+
let text = "";
|
|
148
|
+
for (const byte of bytes) {
|
|
149
|
+
text += HEX[byte >> 4] + HEX[byte & 0x0f];
|
|
150
|
+
}
|
|
151
|
+
return text;
|
|
152
|
+
}
|
|
153
|
+
/** Base64url without padding (RFC 4648 §5), as `digest("base64url")`. */
|
|
154
|
+
export function toBase64Url(bytes) {
|
|
155
|
+
let text = "";
|
|
156
|
+
for (let index = 0; index < bytes.length; index += 3) {
|
|
157
|
+
const first = bytes[index];
|
|
158
|
+
const second = index + 1 < bytes.length ? bytes[index + 1] : 0;
|
|
159
|
+
const third = index + 2 < bytes.length ? bytes[index + 2] : 0;
|
|
160
|
+
const triple = (first << 16) | (second << 8) | third;
|
|
161
|
+
text += BASE64URL[(triple >> 18) & 0x3f];
|
|
162
|
+
text += BASE64URL[(triple >> 12) & 0x3f];
|
|
163
|
+
if (index + 1 < bytes.length) {
|
|
164
|
+
text += BASE64URL[(triple >> 6) & 0x3f];
|
|
165
|
+
}
|
|
166
|
+
if (index + 2 < bytes.length) {
|
|
167
|
+
text += BASE64URL[triple & 0x3f];
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return text;
|
|
171
|
+
}
|
|
172
|
+
/** Hex SHA-256 of the UTF-8 bytes of a string: `createHash("sha256").update(text, "utf8").digest("hex")`. */
|
|
173
|
+
export function sha256Hex(text) {
|
|
174
|
+
return toHex(sha256Bytes(utf8Bytes(text)));
|
|
175
|
+
}
|
|
176
|
+
/** Base64url SHA-256 of the UTF-8 bytes of a string: `createHash("sha256").update(text, "utf8").digest("base64url")`. */
|
|
177
|
+
export function sha256Base64Url(text) {
|
|
178
|
+
return toBase64Url(sha256Bytes(utf8Bytes(text)));
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=sha256.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.js","sourceRoot":"","sources":["../../src/capabilities/sha256.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,0EAA0E;AAC1E,2EAA2E;AAC3E,+CAA+C;AAC/C,4EAA4E;AAC5E,6EAA6E;AAC7E,iEAAiE;AACjE,EAAE;AACF,wDAAwD;AAExD,MAAM,eAAe,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AAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,IAAI,SAAS,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,IAAI,CAAW,CAAC;QACpD,CAAC;QACD,IAAI,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,IAAI,SAAS,CAAC,MAAM,GAAG,IAAI,CAAW,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,6GAA6G;AAC7G,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -77,8 +77,9 @@ export interface PermissionProfileGrantRuleDefinition {
|
|
|
77
77
|
}[];
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
* Data-migration rule for stored old service-prefix grants (`servicio:*`)
|
|
81
|
-
*
|
|
80
|
+
* Data-migration rule for stored old service-prefix grants (`servicio:*`).
|
|
81
|
+
* Since 0.2.0-dev.4 (zero wildcards) every service is in excludedServices,
|
|
82
|
+
* with its reason, and every other field is empty. It is not a grant form.
|
|
82
83
|
*/
|
|
83
84
|
export interface PermissionPrefixRuleDefinition {
|
|
84
85
|
readonly note: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/capabilities/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;AAEzC,qDAAqD;AACrD,MAAM,MAAM,qB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AAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC3F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./clinical-operations.js";
|
|
|
5
5
|
export * from "./config.js";
|
|
6
6
|
export * from "./ids.js";
|
|
7
7
|
export * from "./jwt.js";
|
|
8
|
+
export * from "./organization/index.js";
|
|
8
9
|
export * from "./phi-redaction.js";
|
|
9
10
|
export * from "./stable-json.js";
|
|
10
11
|
export * from "./worker-logger.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./clinical-operations.js";
|
|
|
5
5
|
export * from "./config.js";
|
|
6
6
|
export * from "./ids.js";
|
|
7
7
|
export * from "./jwt.js";
|
|
8
|
+
export * from "./organization/index.js";
|
|
8
9
|
export * from "./phi-redaction.js";
|
|
9
10
|
export * from "./stable-json.js";
|
|
10
11
|
export * from "./worker-logger.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/** Organization kinds shared by attribute consumers; no kind grants attributes. */
|
|
2
|
+
export declare const ORGANIZATION_KINDS: readonly ["tenant", "hospital", "site", "department", "service", "unit", "customer", "supplier", "manufacturer", "insurer"];
|
|
3
|
+
export type OrganizationKind = typeof ORGANIZATION_KINDS[number];
|
|
4
|
+
export type OrganizationAttributeFamily = "flow" | "administrative";
|
|
5
|
+
export type OrganizationAttributeStatus = "active" | "deprecated";
|
|
6
|
+
declare const definitions: readonly [{
|
|
7
|
+
readonly key: "board-host";
|
|
8
|
+
readonly family: "flow";
|
|
9
|
+
readonly label: "Anfitrión de comité";
|
|
10
|
+
readonly description: "Identifica organizaciones con agendas para comité médico y listado de citas.";
|
|
11
|
+
readonly allowedKinds: readonly ["hospital", "site", "department", "service", "unit"];
|
|
12
|
+
}, {
|
|
13
|
+
readonly key: "patient-admission";
|
|
14
|
+
readonly family: "flow";
|
|
15
|
+
readonly label: "Admisión de paciente";
|
|
16
|
+
readonly description: "Identifica organizaciones para admisión de pacientes y selección de agendas de admisión y destinos de traslado.";
|
|
17
|
+
readonly allowedKinds: readonly ["hospital", "site", "department", "service", "unit"];
|
|
18
|
+
}, {
|
|
19
|
+
readonly key: "patient-transfer";
|
|
20
|
+
readonly family: "flow";
|
|
21
|
+
readonly label: "Traslado de paciente";
|
|
22
|
+
readonly description: "Declara la intención de participar en traslados; no se acreditó un consumidor funcional de esta clave.";
|
|
23
|
+
readonly allowedKinds: readonly ["hospital", "site", "department", "service", "unit"];
|
|
24
|
+
}, {
|
|
25
|
+
readonly key: "schedule-appointment";
|
|
26
|
+
readonly family: "flow";
|
|
27
|
+
readonly label: "Agenda cita";
|
|
28
|
+
readonly description: "Identifica organizaciones con agendas para citas y actividades de cita del flujo de atención.";
|
|
29
|
+
readonly allowedKinds: readonly ["hospital", "site", "department", "service", "unit"];
|
|
30
|
+
}, {
|
|
31
|
+
readonly key: "schedule-procedure";
|
|
32
|
+
readonly family: "flow";
|
|
33
|
+
readonly label: "Agenda procedimiento";
|
|
34
|
+
readonly description: "Identifica organizaciones con agendas para procedimientos y sus actividades del flujo de atención.";
|
|
35
|
+
readonly allowedKinds: readonly ["hospital", "site", "department", "service", "unit"];
|
|
36
|
+
}, {
|
|
37
|
+
readonly key: "schedule-reception";
|
|
38
|
+
readonly family: "flow";
|
|
39
|
+
readonly label: "Agenda recepción";
|
|
40
|
+
readonly description: "Identifica organizaciones con agendas de recepción; es independiente de la capacidad física de una ubicación.";
|
|
41
|
+
readonly allowedKinds: readonly ["hospital", "site", "department", "service", "unit"];
|
|
42
|
+
}, {
|
|
43
|
+
readonly key: "accounts-payable";
|
|
44
|
+
readonly family: "administrative";
|
|
45
|
+
readonly label: "Cuentas por pagar";
|
|
46
|
+
readonly description: "Declara operación de cuentas por pagar; no se acreditó un control operativo basado en esta clave.";
|
|
47
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
48
|
+
}, {
|
|
49
|
+
readonly key: "accounts-receivable";
|
|
50
|
+
readonly family: "administrative";
|
|
51
|
+
readonly label: "Cuentas por cobrar";
|
|
52
|
+
readonly description: "Declara operación de cuentas por cobrar; no se acreditó un control operativo basado en esta clave.";
|
|
53
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
54
|
+
}, {
|
|
55
|
+
readonly key: "cases";
|
|
56
|
+
readonly family: "administrative";
|
|
57
|
+
readonly label: "Casos";
|
|
58
|
+
readonly description: "Identifica organizaciones operadoras de casos en recepción y admisión, con condiciones clínicas evaluadas por separado.";
|
|
59
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
60
|
+
}, {
|
|
61
|
+
readonly key: "coverages";
|
|
62
|
+
readonly family: "administrative";
|
|
63
|
+
readonly label: "Coberturas";
|
|
64
|
+
readonly description: "Declara operación de coberturas; no acredita que una contraparte aseguradora sea la organización operadora.";
|
|
65
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
66
|
+
}, {
|
|
67
|
+
readonly key: "fiscal-documents";
|
|
68
|
+
readonly family: "administrative";
|
|
69
|
+
readonly label: "Documentos fiscales";
|
|
70
|
+
readonly description: "Declara operación de documentos fiscales; no acredita por sí sola autorización para facturar o cotizar.";
|
|
71
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
72
|
+
}, {
|
|
73
|
+
readonly key: "inventory";
|
|
74
|
+
readonly family: "administrative";
|
|
75
|
+
readonly label: "Inventario";
|
|
76
|
+
readonly description: "Declara operación de inventario; permisos de usuario y pertenencia a almacenes se evalúan por separado.";
|
|
77
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
78
|
+
}, {
|
|
79
|
+
readonly key: "payments";
|
|
80
|
+
readonly family: "administrative";
|
|
81
|
+
readonly label: "Pagos";
|
|
82
|
+
readonly description: "Declara operación de pagos; no se acreditó un control operativo común basado en esta clave.";
|
|
83
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
84
|
+
}, {
|
|
85
|
+
readonly key: "professional-fees";
|
|
86
|
+
readonly family: "administrative";
|
|
87
|
+
readonly label: "Honorarios profesionales";
|
|
88
|
+
readonly description: "Declara operación de honorarios profesionales; no se acreditó un consumidor funcional de esta clave.";
|
|
89
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
90
|
+
}, {
|
|
91
|
+
readonly key: "treasury";
|
|
92
|
+
readonly family: "administrative";
|
|
93
|
+
readonly label: "Tesorería";
|
|
94
|
+
readonly description: "Declara operación de tesorería; los permisos de usuario siguen siendo una dimensión independiente.";
|
|
95
|
+
readonly allowedKinds: readonly ["tenant", "hospital", "site", "department", "service", "unit"];
|
|
96
|
+
}];
|
|
97
|
+
export type OrganizationAttributeKey = typeof definitions[number]["key"];
|
|
98
|
+
export interface OrganizationAttributeDefinition {
|
|
99
|
+
readonly key: OrganizationAttributeKey;
|
|
100
|
+
readonly family: OrganizationAttributeFamily;
|
|
101
|
+
/** Exact es-CL label from the legacy snapshot. */
|
|
102
|
+
readonly label: string;
|
|
103
|
+
readonly description: string;
|
|
104
|
+
readonly allowedKinds: readonly OrganizationKind[];
|
|
105
|
+
readonly status: OrganizationAttributeStatus;
|
|
106
|
+
/** Required attribute keys, not external workflow prerequisites. None are established yet. */
|
|
107
|
+
readonly dependencies: readonly OrganizationAttributeKey[];
|
|
108
|
+
}
|
|
109
|
+
/** All entries are active, but none are assigned by default. Deeply frozen. */
|
|
110
|
+
export declare const ORGANIZATION_ATTRIBUTE_CATALOG: readonly OrganizationAttributeDefinition[];
|
|
111
|
+
/** Canonical ASCII lexicographic order, also used by normalizeOrganizationAttributes. */
|
|
112
|
+
export declare const ORGANIZATION_ATTRIBUTE_KEYS: readonly OrganizationAttributeKey[];
|
|
113
|
+
export declare function isOrganizationKind(value: unknown): value is OrganizationKind;
|
|
114
|
+
export declare function isOrganizationAttributeKey(value: unknown): value is OrganizationAttributeKey;
|
|
115
|
+
export declare function getOrganizationAttribute(value: unknown): OrganizationAttributeDefinition | undefined;
|
|
116
|
+
export type OrganizationAttributesErrorCode = "invalid-kind" | "invalid-list" | "unknown-attribute" | "duplicate-attribute" | "attribute-not-allowed";
|
|
117
|
+
export type OrganizationAttributesResult = {
|
|
118
|
+
readonly ok: true;
|
|
119
|
+
readonly attributes: readonly OrganizationAttributeKey[];
|
|
120
|
+
} | {
|
|
121
|
+
readonly ok: false;
|
|
122
|
+
readonly code: OrganizationAttributesErrorCode;
|
|
123
|
+
readonly index?: number;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Validate the complete resulting set, including after a kind change.
|
|
127
|
+
* Accept only dense own data arrays of at most 15 exact keys. No coercion,
|
|
128
|
+
* getters, aliases, silent deduplication, defaults or inherited attributes.
|
|
129
|
+
* Return the first stable error without echoing caller data. Never throws.
|
|
130
|
+
*/
|
|
131
|
+
export declare function validateOrganizationAttributes(kind: unknown, value: unknown): OrganizationAttributesResult;
|
|
132
|
+
/** Validate first, then sort a fresh frozen array; never changes caller input. */
|
|
133
|
+
export declare function normalizeOrganizationAttributes(kind: unknown, value: unknown): OrganizationAttributesResult;
|
|
134
|
+
export {};
|
|
135
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/organization/index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,kBAAkB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G;AAED,MAAM,MAAM,+BAA+B,GACvC,cAAc,GAAG,cAAc,GAAG,mBAAmB,GACrD,qBAAqB,GAAG,uBAAuB,CAAC;AAEpD,MAAM,MAAM,4BAA4B,GACpC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAA;CAAE,GAC/E;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,+BAA+B,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpG;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,4BAA4B,CA0B1G;AAED,kFAAkF;AAClF,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,4BAA4B,CAI3G"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/** Organization kinds shared by attribute consumers; no kind grants attributes. */
|
|
2
|
+
export const ORGANIZATION_KINDS = Object.freeze([
|
|
3
|
+
"tenant", "hospital", "site", "department", "service", "unit",
|
|
4
|
+
"customer", "supplier", "manufacturer", "insurer"
|
|
5
|
+
]);
|
|
6
|
+
const clinicalKinds = Object.freeze([
|
|
7
|
+
"hospital", "site", "department", "service", "unit"
|
|
8
|
+
]);
|
|
9
|
+
const administrativeKinds = Object.freeze([
|
|
10
|
+
"tenant", ...clinicalKinds
|
|
11
|
+
]);
|
|
12
|
+
const noDependencies = Object.freeze([]);
|
|
13
|
+
// Labels: legacy snapshot 2026-06-14, organizationalChart{AdministrativeAttributes,Attributes}.
|
|
14
|
+
// Descriptions express catalog intent, never proof of an implemented authorization guard.
|
|
15
|
+
const definitions = [
|
|
16
|
+
{ key: "board-host", family: "flow", label: "Anfitrión de comité", description: "Identifica organizaciones con agendas para comité médico y listado de citas.", allowedKinds: clinicalKinds },
|
|
17
|
+
{ key: "patient-admission", family: "flow", label: "Admisión de paciente", description: "Identifica organizaciones para admisión de pacientes y selección de agendas de admisión y destinos de traslado.", allowedKinds: clinicalKinds },
|
|
18
|
+
{ key: "patient-transfer", family: "flow", label: "Traslado de paciente", description: "Declara la intención de participar en traslados; no se acreditó un consumidor funcional de esta clave.", allowedKinds: clinicalKinds },
|
|
19
|
+
{ key: "schedule-appointment", family: "flow", label: "Agenda cita", description: "Identifica organizaciones con agendas para citas y actividades de cita del flujo de atención.", allowedKinds: clinicalKinds },
|
|
20
|
+
{ key: "schedule-procedure", family: "flow", label: "Agenda procedimiento", description: "Identifica organizaciones con agendas para procedimientos y sus actividades del flujo de atención.", allowedKinds: clinicalKinds },
|
|
21
|
+
{ key: "schedule-reception", family: "flow", label: "Agenda recepción", description: "Identifica organizaciones con agendas de recepción; es independiente de la capacidad física de una ubicación.", allowedKinds: clinicalKinds },
|
|
22
|
+
{ key: "accounts-payable", family: "administrative", label: "Cuentas por pagar", description: "Declara operación de cuentas por pagar; no se acreditó un control operativo basado en esta clave.", allowedKinds: administrativeKinds },
|
|
23
|
+
{ key: "accounts-receivable", family: "administrative", label: "Cuentas por cobrar", description: "Declara operación de cuentas por cobrar; no se acreditó un control operativo basado en esta clave.", allowedKinds: administrativeKinds },
|
|
24
|
+
{ key: "cases", family: "administrative", label: "Casos", description: "Identifica organizaciones operadoras de casos en recepción y admisión, con condiciones clínicas evaluadas por separado.", allowedKinds: administrativeKinds },
|
|
25
|
+
{ key: "coverages", family: "administrative", label: "Coberturas", description: "Declara operación de coberturas; no acredita que una contraparte aseguradora sea la organización operadora.", allowedKinds: administrativeKinds },
|
|
26
|
+
{ key: "fiscal-documents", family: "administrative", label: "Documentos fiscales", description: "Declara operación de documentos fiscales; no acredita por sí sola autorización para facturar o cotizar.", allowedKinds: administrativeKinds },
|
|
27
|
+
{ key: "inventory", family: "administrative", label: "Inventario", description: "Declara operación de inventario; permisos de usuario y pertenencia a almacenes se evalúan por separado.", allowedKinds: administrativeKinds },
|
|
28
|
+
{ key: "payments", family: "administrative", label: "Pagos", description: "Declara operación de pagos; no se acreditó un control operativo común basado en esta clave.", allowedKinds: administrativeKinds },
|
|
29
|
+
{ key: "professional-fees", family: "administrative", label: "Honorarios profesionales", description: "Declara operación de honorarios profesionales; no se acreditó un consumidor funcional de esta clave.", allowedKinds: administrativeKinds },
|
|
30
|
+
{ key: "treasury", family: "administrative", label: "Tesorería", description: "Declara operación de tesorería; los permisos de usuario siguen siendo una dimensión independiente.", allowedKinds: administrativeKinds }
|
|
31
|
+
];
|
|
32
|
+
/** All entries are active, but none are assigned by default. Deeply frozen. */
|
|
33
|
+
export const ORGANIZATION_ATTRIBUTE_CATALOG = Object.freeze(definitions.map((entry) => Object.freeze({ ...entry, status: "active", dependencies: noDependencies })));
|
|
34
|
+
/** Canonical ASCII lexicographic order, also used by normalizeOrganizationAttributes. */
|
|
35
|
+
export const ORGANIZATION_ATTRIBUTE_KEYS = Object.freeze(definitions.map((entry) => entry.key).sort());
|
|
36
|
+
export function isOrganizationKind(value) {
|
|
37
|
+
return typeof value === "string" && ORGANIZATION_KINDS.some((kind) => kind === value);
|
|
38
|
+
}
|
|
39
|
+
export function isOrganizationAttributeKey(value) {
|
|
40
|
+
return typeof value === "string" && ORGANIZATION_ATTRIBUTE_KEYS.some((key) => key === value);
|
|
41
|
+
}
|
|
42
|
+
export function getOrganizationAttribute(value) {
|
|
43
|
+
return ORGANIZATION_ATTRIBUTE_CATALOG.find((entry) => entry.key === value);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Validate the complete resulting set, including after a kind change.
|
|
47
|
+
* Accept only dense own data arrays of at most 15 exact keys. No coercion,
|
|
48
|
+
* getters, aliases, silent deduplication, defaults or inherited attributes.
|
|
49
|
+
* Return the first stable error without echoing caller data. Never throws.
|
|
50
|
+
*/
|
|
51
|
+
export function validateOrganizationAttributes(kind, value) {
|
|
52
|
+
if (!isOrganizationKind(kind))
|
|
53
|
+
return { ok: false, code: "invalid-kind" };
|
|
54
|
+
try {
|
|
55
|
+
if (!Array.isArray(value))
|
|
56
|
+
return { ok: false, code: "invalid-list" };
|
|
57
|
+
const lengthDescriptor = Object.getOwnPropertyDescriptor(value, "length");
|
|
58
|
+
const length = lengthDescriptor?.value;
|
|
59
|
+
if (typeof length !== "number" || !Number.isInteger(length) || length < 0 || length > ORGANIZATION_ATTRIBUTE_KEYS.length) {
|
|
60
|
+
return { ok: false, code: "invalid-list" };
|
|
61
|
+
}
|
|
62
|
+
const attributes = [];
|
|
63
|
+
const seen = new Set();
|
|
64
|
+
for (let index = 0; index < length; index += 1) {
|
|
65
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
|
|
66
|
+
if (!descriptor || !("value" in descriptor))
|
|
67
|
+
return { ok: false, code: "invalid-list", index };
|
|
68
|
+
const key = descriptor.value;
|
|
69
|
+
if (!isOrganizationAttributeKey(key))
|
|
70
|
+
return { ok: false, code: "unknown-attribute", index };
|
|
71
|
+
if (seen.has(key))
|
|
72
|
+
return { ok: false, code: "duplicate-attribute", index };
|
|
73
|
+
const definition = getOrganizationAttribute(key);
|
|
74
|
+
if (!definition.allowedKinds.includes(kind))
|
|
75
|
+
return { ok: false, code: "attribute-not-allowed", index };
|
|
76
|
+
seen.add(key);
|
|
77
|
+
attributes.push(key);
|
|
78
|
+
}
|
|
79
|
+
return { ok: true, attributes: Object.freeze(attributes) };
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return { ok: false, code: "invalid-list" };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Validate first, then sort a fresh frozen array; never changes caller input. */
|
|
86
|
+
export function normalizeOrganizationAttributes(kind, value) {
|
|
87
|
+
const result = validateOrganizationAttributes(kind, value);
|
|
88
|
+
if (!result.ok)
|
|
89
|
+
return result;
|
|
90
|
+
return { ok: true, attributes: Object.freeze([...result.attributes].sort()) };
|
|
91
|
+
}
|
|
92
|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dist/worker-logger.d.ts
CHANGED
|
@@ -1,14 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import type { LevelWithSilent, Logger } from "pino";
|
|
2
|
+
/** What createWorkerLogger passes to pino (or to the injected factory). */
|
|
3
|
+
export interface WorkerLoggerConfig {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly level: LevelWithSilent;
|
|
6
|
+
readonly redact: {
|
|
7
|
+
readonly paths: string[];
|
|
8
|
+
readonly censor: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Minimal contract of an injected logger factory: called once with
|
|
13
|
+
* WorkerLoggerConfig, it returns the logger, and createWorkerLogger returns
|
|
14
|
+
* that same logger with the factory's exact type `L`. The `pino` default
|
|
15
|
+
* export itself satisfies it: `createWorkerLogger(service, component, { pino })`
|
|
16
|
+
* is typed `Logger<string, boolean>` by pino's declarations, which is not
|
|
17
|
+
* assignable to the default `Logger`; when exactly `Logger` is needed, pass
|
|
18
|
+
* the lambda `(config) => pino(config)`.
|
|
19
|
+
*/
|
|
20
|
+
export type WorkerLoggerFactory<L = Logger> = (config: WorkerLoggerConfig) => L;
|
|
21
|
+
export interface WorkerLoggerOptions<L = Logger> {
|
|
3
22
|
/** Override the LOG_LEVEL env default. */
|
|
4
|
-
readonly level?:
|
|
23
|
+
readonly level?: LevelWithSilent;
|
|
24
|
+
/**
|
|
25
|
+
* Factory to use instead of loading the optional peer dependency `pino`
|
|
26
|
+
* (for example the service's own `import pino from "pino"`, or a bundler
|
|
27
|
+
* where `require` is not available).
|
|
28
|
+
*/
|
|
29
|
+
readonly pino?: WorkerLoggerFactory<L>;
|
|
30
|
+
}
|
|
31
|
+
/** Thrown by createWorkerLogger when pino is not installed and no factory was passed. */
|
|
32
|
+
export declare class WorkerLoggerUnavailableError extends Error {
|
|
33
|
+
readonly code: "WORKER_LOGGER_UNAVAILABLE";
|
|
34
|
+
constructor(cause: unknown);
|
|
5
35
|
}
|
|
6
36
|
/**
|
|
7
37
|
* Build a Pino logger pre-configured with the shared PHI redact paths
|
|
8
38
|
* and a `<service>/<component>` name.
|
|
9
39
|
*
|
|
40
|
+
* With a factory in `options.pino` it returns what the factory returns, with
|
|
41
|
+
* the factory's exact type `L` (that overload is resolved first). Any other
|
|
42
|
+
* options (none, a variable or parameter typed WorkerLoggerOptions, or
|
|
43
|
+
* `{ pino: factory | undefined }`) give pino's `Logger`, as in 0.2.0-dev.1. A
|
|
44
|
+
* type argument without a factory does not compile.
|
|
45
|
+
*
|
|
10
46
|
* @param service e.g. "commercial-core-api" — the npm package name root
|
|
11
47
|
* @param component e.g. "outbox-worker" — the worker's role
|
|
48
|
+
* @throws WorkerLoggerUnavailableError when pino is not installed and options.pino is not set
|
|
12
49
|
*/
|
|
13
|
-
export declare function createWorkerLogger(service: string, component: string, options
|
|
50
|
+
export declare function createWorkerLogger<L>(service: string, component: string, options: WorkerLoggerOptions<L> & {
|
|
51
|
+
readonly pino: WorkerLoggerFactory<L>;
|
|
52
|
+
}): L;
|
|
53
|
+
export declare function createWorkerLogger(service: string, component: string, options?: Omit<WorkerLoggerOptions, "pino"> & {
|
|
54
|
+
readonly pino?: WorkerLoggerFactory | undefined;
|
|
55
|
+
}): Logger;
|
|
14
56
|
//# sourceMappingURL=worker-logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-logger.d.ts","sourceRoot":"","sources":["../src/worker-logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker-logger.d.ts","sourceRoot":"","sources":["../src/worker-logger.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAiB,MAAM,MAAM,CAAC;AAInE,2EAA2E;AAC3E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE;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