iobroker.unraid 0.5.0 → 0.5.2

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.
Files changed (47) hide show
  1. package/README.md +47 -6
  2. package/admin/build/index.js +8 -8
  3. package/admin/build/index.js.map +3 -3
  4. package/build/apollo-client.d.ts +60 -7
  5. package/build/apollo-client.d.ts.map +1 -1
  6. package/build/apollo-client.js +69 -24
  7. package/build/apollo-client.js.map +1 -1
  8. package/build/config/adapter-config.d.ts +30 -0
  9. package/build/config/adapter-config.d.ts.map +1 -0
  10. package/build/config/adapter-config.js +50 -0
  11. package/build/config/adapter-config.js.map +1 -0
  12. package/build/graphql/selection-builder.d.ts +43 -0
  13. package/build/graphql/selection-builder.d.ts.map +1 -0
  14. package/build/graphql/selection-builder.js +108 -0
  15. package/build/graphql/selection-builder.js.map +1 -0
  16. package/build/main.js +88 -842
  17. package/build/main.js.map +1 -1
  18. package/build/managers/dynamic-resource-manager.d.ts +73 -0
  19. package/build/managers/dynamic-resource-manager.d.ts.map +1 -0
  20. package/build/managers/dynamic-resource-manager.js +445 -0
  21. package/build/managers/dynamic-resource-manager.js.map +1 -0
  22. package/build/managers/polling-manager.d.ts +64 -0
  23. package/build/managers/polling-manager.d.ts.map +1 -0
  24. package/build/managers/polling-manager.js +143 -0
  25. package/build/managers/polling-manager.js.map +1 -0
  26. package/build/managers/state-manager.d.ts +64 -0
  27. package/build/managers/state-manager.d.ts.map +1 -0
  28. package/build/managers/state-manager.js +182 -0
  29. package/build/managers/state-manager.js.map +1 -0
  30. package/build/shared/unraid-domains.d.ts +83 -0
  31. package/build/shared/unraid-domains.d.ts.map +1 -1
  32. package/build/shared/unraid-domains.js +88 -18
  33. package/build/shared/unraid-domains.js.map +1 -1
  34. package/build/subscription-manager.js +94 -43
  35. package/build/subscription-manager.js.map +1 -1
  36. package/build/types/adapter-types.d.ts +10 -0
  37. package/build/types/adapter-types.d.ts.map +1 -0
  38. package/build/types/adapter-types.js +7 -0
  39. package/build/types/adapter-types.js.map +1 -0
  40. package/build/utils/data-transformers.d.ts +55 -0
  41. package/build/utils/data-transformers.d.ts.map +1 -0
  42. package/build/utils/data-transformers.js +137 -0
  43. package/build/utils/data-transformers.js.map +1 -0
  44. package/io-package.json +34 -2
  45. package/package.json +4 -10
  46. package/build/subscription-manager.d.ts +0 -78
  47. package/build/subscription-manager.d.ts.map +0 -1
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Type definitions for adapter interfaces to avoid TypeScript issues
3
+ * with the @iobroker/adapter-core types
4
+ */
5
+ import type { AdapterInstance } from '@iobroker/adapter-core';
6
+ /**
7
+ * Adapter interface type that can be used in constructor parameters
8
+ */
9
+ export type AdapterInterface = AdapterInstance;
10
+ //# sourceMappingURL=adapter-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-types.d.ts","sourceRoot":"","sources":["../../src/types/adapter-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for adapter interfaces to avoid TypeScript issues
4
+ * with the @iobroker/adapter-core types
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=adapter-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-types.js","sourceRoot":"","sources":["../../src/types/adapter-types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Data transformation utilities for converting between Unraid API values
3
+ * and ioBroker state values
4
+ */
5
+ /**
6
+ * Convert kilobytes to gigabytes with 2 decimal precision
7
+ *
8
+ * @param value - Value in kilobytes
9
+ */
10
+ export declare function kilobytesToGigabytes(value: unknown): number | null;
11
+ /**
12
+ * Convert bytes to gigabytes with 2 decimal precision
13
+ *
14
+ * @param value - Value in bytes
15
+ */
16
+ export declare function bytesToGigabytes(value: unknown): number | null;
17
+ /**
18
+ * Calculate usage percentage from used and total values
19
+ *
20
+ * @param used - Used value
21
+ * @param total - Total value
22
+ */
23
+ export declare function calculateUsagePercent(used: unknown, total: unknown): number | null;
24
+ /**
25
+ * Convert BigInt values to number safely
26
+ *
27
+ * @param value - BigInt or numeric value to convert
28
+ */
29
+ export declare function bigIntToNumber(value: unknown): number | null;
30
+ /**
31
+ * Convert any value to string or null
32
+ *
33
+ * @param value - Value to convert to string
34
+ */
35
+ export declare function toStringOrNull(value: unknown): string | null;
36
+ /**
37
+ * Convert any value to boolean or null
38
+ *
39
+ * @param value - Value to convert to boolean
40
+ */
41
+ export declare function toBooleanOrNull(value: unknown): boolean | null;
42
+ /**
43
+ * Convert any value to number or null
44
+ *
45
+ * @param value - Value to convert to number
46
+ */
47
+ export declare function toNumberOrNull(value: unknown): number | null;
48
+ /**
49
+ * Resolve a value from an object by path
50
+ *
51
+ * @param source - Source object to resolve from
52
+ * @param path - Path segments to traverse
53
+ */
54
+ export declare function resolveValue(source: unknown, path: readonly string[]): unknown;
55
+ //# sourceMappingURL=data-transformers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-transformers.d.ts","sourceRoot":"","sources":["../../src/utils/data-transformers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOlE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAO9D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAWlF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAS5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAW5D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAQ9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAY5D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAS9E"}
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ /**
3
+ * Data transformation utilities for converting between Unraid API values
4
+ * and ioBroker state values
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.kilobytesToGigabytes = kilobytesToGigabytes;
8
+ exports.bytesToGigabytes = bytesToGigabytes;
9
+ exports.calculateUsagePercent = calculateUsagePercent;
10
+ exports.bigIntToNumber = bigIntToNumber;
11
+ exports.toStringOrNull = toStringOrNull;
12
+ exports.toBooleanOrNull = toBooleanOrNull;
13
+ exports.toNumberOrNull = toNumberOrNull;
14
+ exports.resolveValue = resolveValue;
15
+ /**
16
+ * Convert kilobytes to gigabytes with 2 decimal precision
17
+ *
18
+ * @param value - Value in kilobytes
19
+ */
20
+ function kilobytesToGigabytes(value) {
21
+ const numeric = toNumberOrNull(value);
22
+ if (numeric === null) {
23
+ return null;
24
+ }
25
+ const gb = numeric / (1024 * 1024);
26
+ return Number.isFinite(gb) ? Math.round(gb * 100) / 100 : null;
27
+ }
28
+ /**
29
+ * Convert bytes to gigabytes with 2 decimal precision
30
+ *
31
+ * @param value - Value in bytes
32
+ */
33
+ function bytesToGigabytes(value) {
34
+ const numeric = toNumberOrNull(value);
35
+ if (numeric === null) {
36
+ return null;
37
+ }
38
+ const gb = numeric / (1024 * 1024 * 1024);
39
+ return Number.isFinite(gb) ? Math.round(gb * 100) / 100 : null;
40
+ }
41
+ /**
42
+ * Calculate usage percentage from used and total values
43
+ *
44
+ * @param used - Used value
45
+ * @param total - Total value
46
+ */
47
+ function calculateUsagePercent(used, total) {
48
+ const usedNumeric = toNumberOrNull(used);
49
+ const totalNumeric = toNumberOrNull(total);
50
+ // Return null if either value is null or total is 0
51
+ if (usedNumeric === null || totalNumeric === null || totalNumeric === 0) {
52
+ return null;
53
+ }
54
+ const percent = (usedNumeric / totalNumeric) * 100;
55
+ return Number.isFinite(percent) ? Math.round(percent * 100) / 100 : null;
56
+ }
57
+ /**
58
+ * Convert BigInt values to number safely
59
+ *
60
+ * @param value - BigInt or numeric value to convert
61
+ */
62
+ function bigIntToNumber(value) {
63
+ if (value === null || value === undefined) {
64
+ return null;
65
+ }
66
+ if (typeof value === 'bigint') {
67
+ const num = Number(value);
68
+ return Number.isFinite(num) ? num : null;
69
+ }
70
+ return toNumberOrNull(value);
71
+ }
72
+ /**
73
+ * Convert any value to string or null
74
+ *
75
+ * @param value - Value to convert to string
76
+ */
77
+ function toStringOrNull(value) {
78
+ if (value === null || value === undefined) {
79
+ return null;
80
+ }
81
+ if (typeof value === 'string') {
82
+ return value;
83
+ }
84
+ if (typeof value === 'number' || typeof value === 'boolean') {
85
+ return String(value);
86
+ }
87
+ return null;
88
+ }
89
+ /**
90
+ * Convert any value to boolean or null
91
+ *
92
+ * @param value - Value to convert to boolean
93
+ */
94
+ function toBooleanOrNull(value) {
95
+ if (value === null || value === undefined) {
96
+ return null;
97
+ }
98
+ if (typeof value === 'boolean') {
99
+ return value;
100
+ }
101
+ return null;
102
+ }
103
+ /**
104
+ * Convert any value to number or null
105
+ *
106
+ * @param value - Value to convert to number
107
+ */
108
+ function toNumberOrNull(value) {
109
+ if (value === null || value === undefined) {
110
+ return null;
111
+ }
112
+ if (typeof value === 'number') {
113
+ return Number.isFinite(value) ? value : null;
114
+ }
115
+ if (typeof value === 'string') {
116
+ const parsed = Number(value);
117
+ return Number.isFinite(parsed) ? parsed : null;
118
+ }
119
+ return null;
120
+ }
121
+ /**
122
+ * Resolve a value from an object by path
123
+ *
124
+ * @param source - Source object to resolve from
125
+ * @param path - Path segments to traverse
126
+ */
127
+ function resolveValue(source, path) {
128
+ let current = source;
129
+ for (const segment of path) {
130
+ if (!current || typeof current !== 'object') {
131
+ return null;
132
+ }
133
+ current = current[segment];
134
+ }
135
+ return current === undefined ? null : current;
136
+ }
137
+ //# sourceMappingURL=data-transformers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-transformers.js","sourceRoot":"","sources":["../../src/utils/data-transformers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAOH,oDAOC;AAOD,4CAOC;AAQD,sDAWC;AAOD,wCASC;AAOD,wCAWC;AAOD,0CAQC;AAOD,wCAYC;AAQD,oCASC;AAlID;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,KAAc;IAC/C,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,KAAc;IAC3C,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC,QAA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,OAAO,IAAI,IAAI,EAAE,CAAC;QACzB,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,GAAI,OAAmC,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AAClD,CAAC"}
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "unraid",
4
- "version": "0.5.0",
4
+ "version": "0.5.2",
5
5
  "news": {
6
+ "0.5.2": {
7
+ "en": "Documentation\nMinor admin page improvements",
8
+ "de": "Dokumentation\nMinor Admin Seite Verbesserungen",
9
+ "ru": "Документация\nУлучшение страницы Minor Admin",
10
+ "pt": "Documentação\nMelhorias menores na página de administração",
11
+ "nl": "Documentatie\nMinor admin pagina verbeteringen",
12
+ "fr": "Documentation\nAméliorations mineures des pages administratives",
13
+ "it": "Documentazione\nMiglioramento della pagina di amministrazione minore",
14
+ "es": "Documentación\nMejoras de la página de administración menor",
15
+ "pl": "Dokumentacja\nNiewielkie ulepszenia strony administratora",
16
+ "uk": "Документація\nНормативно-правова база",
17
+ "zh-cn": "文档\n小管理页面改进"
18
+ },
19
+ "0.5.1": {
20
+ "en": "ESLint9 Migration\nCode refactor",
21
+ "de": "ESLint9 Migration\nCode-Refacter",
22
+ "ru": "ESLint9 Миграция\nКод-фактор",
23
+ "pt": "Migração ESLint9\nRefactor de código",
24
+ "nl": "ESLint9 Migratie\nCode-refactor",
25
+ "fr": "ESLint9 Migration\nRefacteur de code",
26
+ "it": "ESLint9 Migrazione\nCodice",
27
+ "es": "Migración ESLint9\nCode refactor",
28
+ "pl": "ESLint9 Migracja\nReczynnik kodu",
29
+ "uk": "ESLint9 Міграція\nРефактор коду",
30
+ "zh-cn": "ESLint9 迁移\n代码重构"
31
+ },
6
32
  "0.5.0": {
7
33
  "en": "More Unraid queries: Docker containers, shares, VMs, array disks with dynamic state creation,\nApollo Client migration",
8
34
  "de": "Mehr Unraid-Anfragen: Docker-Container, Aktien, VMs, Array-Disks mit dynamischer Zustandserstellung,\nApollo Client Migration",
@@ -104,7 +130,7 @@
104
130
  ],
105
131
  "globalDependencies": [
106
132
  {
107
- "admin": ">=6.0.0"
133
+ "admin": ">=7.6.17"
108
134
  }
109
135
  ]
110
136
  },
@@ -121,6 +147,12 @@
121
147
  ],
122
148
  "useSubscriptions": false
123
149
  },
150
+ "protectedNative": [
151
+ "apiToken"
152
+ ],
153
+ "encryptedNative": [
154
+ "apiToken"
155
+ ],
124
156
  "objects": [],
125
157
  "instanceObjects": []
126
158
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.unraid",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Monitor and control Unraid servers via GraphQL API",
5
5
  "author": {
6
6
  "name": "ingel81",
@@ -16,7 +16,7 @@
16
16
  ],
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git@github.com:ingel81/ioBroker.unraid.git"
19
+ "url": "git+https://github.com/ingel81/ioBroker.unraid.git"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">= 22"
@@ -36,6 +36,7 @@
36
36
  "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
37
37
  "@iobroker/adapter-dev": "^1.5.0",
38
38
  "@iobroker/adapter-react": "^2.0.22",
39
+ "@iobroker/eslint-config": "^2.2.0",
39
40
  "@iobroker/testing": "^5.1.1",
40
41
  "@material-ui/core": "^4.12.4",
41
42
  "@tsconfig/node22": "^22.0.2",
@@ -49,16 +50,9 @@
49
50
  "@types/sinon": "^17.0.4",
50
51
  "@types/sinon-chai": "^3.2.12",
51
52
  "@types/ws": "^8.18.1",
52
- "@typescript-eslint/eslint-plugin": "^8.17.0",
53
- "@typescript-eslint/parser": "^8.17.0",
54
53
  "chai": "^4.5.0",
55
54
  "chai-as-promised": "^7.1.2",
56
- "eslint": "^8.57.1",
57
- "eslint-config-prettier": "^10.1.8",
58
- "eslint-plugin-prettier": "^5.5.4",
59
- "eslint-plugin-react": "^7.37.5",
60
55
  "mocha": "^11.7.2",
61
- "prettier": "^3.6.2",
62
56
  "proxyquire": "^2.1.3",
63
57
  "react": "^17.0.2",
64
58
  "react-dom": "^17.0.2",
@@ -92,7 +86,7 @@
92
86
  "test:integration": "mocha test/integration --exit",
93
87
  "test": "npm run test:js && npm run test:package",
94
88
  "check": "tsc --noEmit -p tsconfig.check.json",
95
- "lint": "eslint --ext .js,.jsx,.ts,.tsx .",
89
+ "lint": "eslint -c eslint.config.mjs src admin/src",
96
90
  "translate": "translate-adapter",
97
91
  "release": "release-script"
98
92
  },
@@ -1,78 +0,0 @@
1
- import { UnraidApolloClient } from './apollo-client';
2
- export interface SubscriptionManagerOptions {
3
- apolloClient: UnraidApolloClient;
4
- onStateUpdate: (id: string, value: unknown) => Promise<void>;
5
- onError?: (error: Error) => void;
6
- onConnectionLost?: () => void;
7
- onConnectionRestored?: () => void;
8
- }
9
- export declare class SubscriptionManager {
10
- private apolloClient;
11
- private subscriptions;
12
- private onStateUpdate;
13
- private onError?;
14
- private onConnectionLost?;
15
- private onConnectionRestored?;
16
- private reconnectTimer?;
17
- private isConnected;
18
- private lastUpdateTimes;
19
- private readonly UPDATE_THROTTLE_MS;
20
- constructor(options: SubscriptionManagerOptions);
21
- /**
22
- * Start subscriptions for CPU and Memory metrics
23
- */
24
- start(): Promise<boolean>;
25
- /**
26
- * Subscribe to CPU metrics only
27
- */
28
- private subscribeToCpu;
29
- /**
30
- * Subscribe to Memory metrics only
31
- */
32
- private subscribeToMemory;
33
- /**
34
- * Subscribe to Array status updates
35
- */
36
- private subscribeToArray;
37
- /**
38
- * Subscribe to Server status updates
39
- */
40
- private subscribeToServers;
41
- /**
42
- * Handle CPU update with throttling
43
- */
44
- private handleCpuUpdate;
45
- /**
46
- * Handle Memory update with throttling
47
- */
48
- private handleMemoryUpdate;
49
- /**
50
- * Check if we should update a metric (throttling)
51
- */
52
- private shouldUpdate;
53
- /**
54
- * Handle subscription error
55
- */
56
- private handleError;
57
- /**
58
- * Handle subscription completion
59
- */
60
- private handleComplete;
61
- /**
62
- * Schedule a reconnection attempt
63
- */
64
- private scheduleReconnect;
65
- /**
66
- * Stop all subscriptions
67
- */
68
- stop(): Promise<void>;
69
- /**
70
- * Check if subscriptions are active
71
- */
72
- isActive(): boolean;
73
- /**
74
- * Get list of active subscription names
75
- */
76
- getActiveSubscriptions(): string[];
77
- }
78
- //# sourceMappingURL=subscription-manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscription-manager.d.ts","sourceRoot":"","sources":["../src/subscription-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,0BAA0B;IACvC,YAAY,EAAE,kBAAkB,CAAC;IACjC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;CACrC;AAED,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,aAAa,CAAkD;IACvE,OAAO,CAAC,aAAa,CAAgD;IACrE,OAAO,CAAC,OAAO,CAAC,CAAyB;IACzC,OAAO,CAAC,gBAAgB,CAAC,CAAa;IACtC,OAAO,CAAC,oBAAoB,CAAC,CAAa;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,QAAQ,CAAC,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