@endo/compartment-mapper 1.6.3 → 2.1.0
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/package.json +24 -14
- package/src/archive-lite.d.ts +7 -7
- package/src/archive-lite.d.ts.map +1 -1
- package/src/archive-lite.js +81 -30
- package/src/archive.d.ts.map +1 -1
- package/src/archive.js +7 -0
- package/src/bundle-lite.d.ts +3 -3
- package/src/bundle-lite.d.ts.map +1 -1
- package/src/bundle-lite.js +19 -24
- package/src/bundle.d.ts +3 -3
- package/src/bundle.d.ts.map +1 -1
- package/src/bundle.js +19 -24
- package/src/capture-lite.d.ts +2 -2
- package/src/capture-lite.d.ts.map +1 -1
- package/src/capture-lite.js +243 -25
- package/src/compartment-map.d.ts +9 -2
- package/src/compartment-map.d.ts.map +1 -1
- package/src/compartment-map.js +738 -254
- package/src/digest.d.ts +22 -2
- package/src/digest.d.ts.map +1 -1
- package/src/digest.js +180 -57
- package/src/generic-graph.d.ts +7 -25
- package/src/generic-graph.d.ts.map +1 -1
- package/src/generic-graph.js +83 -108
- package/src/guards.d.ts +18 -0
- package/src/guards.d.ts.map +1 -0
- package/src/guards.js +109 -0
- package/src/hooks.md +124 -0
- package/src/import-archive-lite.d.ts.map +1 -1
- package/src/import-archive-lite.js +15 -11
- package/src/import-archive.d.ts +5 -19
- package/src/import-archive.d.ts.map +1 -1
- package/src/import-archive.js +7 -27
- package/src/import-hook.d.ts +4 -3
- package/src/import-hook.d.ts.map +1 -1
- package/src/import-hook.js +140 -70
- package/src/import-lite.d.ts +6 -6
- package/src/import-lite.d.ts.map +1 -1
- package/src/import-lite.js +8 -5
- package/src/import.d.ts +3 -3
- package/src/import.d.ts.map +1 -1
- package/src/import.js +16 -6
- package/src/infer-exports.d.ts +4 -2
- package/src/infer-exports.d.ts.map +1 -1
- package/src/infer-exports.js +172 -23
- package/src/link.d.ts +4 -3
- package/src/link.d.ts.map +1 -1
- package/src/link.js +122 -52
- package/src/node-modules.d.ts +4 -3
- package/src/node-modules.d.ts.map +1 -1
- package/src/node-modules.js +513 -151
- package/src/parse-cjs-shared-export-wrapper.d.ts.map +1 -1
- package/src/parse-cjs-shared-export-wrapper.js +3 -1
- package/src/pattern-replacement.d.ts +6 -0
- package/src/pattern-replacement.d.ts.map +1 -0
- package/src/pattern-replacement.js +198 -0
- package/src/policy-format.d.ts +22 -5
- package/src/policy-format.d.ts.map +1 -1
- package/src/policy-format.js +342 -108
- package/src/policy.d.ts +13 -28
- package/src/policy.d.ts.map +1 -1
- package/src/policy.js +161 -106
- package/src/types/canonical-name.d.ts +97 -0
- package/src/types/canonical-name.d.ts.map +1 -0
- package/src/types/canonical-name.ts +151 -0
- package/src/types/compartment-map-schema.d.ts +121 -35
- package/src/types/compartment-map-schema.d.ts.map +1 -1
- package/src/types/compartment-map-schema.ts +211 -37
- package/src/types/external.d.ts +240 -76
- package/src/types/external.d.ts.map +1 -1
- package/src/types/external.ts +305 -74
- package/src/types/generic-graph.d.ts +8 -2
- package/src/types/generic-graph.d.ts.map +1 -1
- package/src/types/generic-graph.ts +7 -2
- package/src/types/internal.d.ts +31 -50
- package/src/types/internal.d.ts.map +1 -1
- package/src/types/internal.ts +60 -58
- package/src/types/node-modules.d.ts +112 -14
- package/src/types/node-modules.d.ts.map +1 -1
- package/src/types/node-modules.ts +152 -13
- package/src/types/pattern-replacement.d.ts +62 -0
- package/src/types/pattern-replacement.d.ts.map +1 -0
- package/src/types/pattern-replacement.ts +70 -0
- package/src/types/policy-schema.d.ts +26 -11
- package/src/types/policy-schema.d.ts.map +1 -1
- package/src/types/policy-schema.ts +29 -16
- package/src/types/policy.d.ts +6 -2
- package/src/types/policy.d.ts.map +1 -1
- package/src/types/policy.ts +7 -2
- package/src/types/powers.d.ts +11 -9
- package/src/types/powers.d.ts.map +1 -1
- package/src/types/powers.ts +11 -10
- package/src/types/typescript.d.ts +28 -0
- package/src/types/typescript.d.ts.map +1 -1
- package/src/types/typescript.ts +37 -1
|
@@ -1,11 +1,61 @@
|
|
|
1
1
|
import type { GenericGraph } from '../generic-graph.js';
|
|
2
|
+
import type {
|
|
3
|
+
CanonicalName,
|
|
4
|
+
PackageCompartmentDescriptorName,
|
|
5
|
+
PolicyOption,
|
|
6
|
+
} from '../types.js';
|
|
2
7
|
import type {
|
|
3
8
|
Language,
|
|
4
9
|
LanguageForExtension,
|
|
5
10
|
} from './compartment-map-schema.js';
|
|
6
|
-
import type {
|
|
7
|
-
|
|
11
|
+
import type {
|
|
12
|
+
FileUrlString,
|
|
13
|
+
LogOptions,
|
|
14
|
+
PackageDependenciesHook,
|
|
15
|
+
} from './external.js';
|
|
16
|
+
import type { PatternDescriptor } from './pattern-replacement.js';
|
|
8
17
|
import type { LiteralUnion } from './typescript.js';
|
|
18
|
+
import { ATTENUATORS_COMPARTMENT } from '../policy-format.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A mapping of conditions to their resolved exports.
|
|
22
|
+
* Each condition key (e.g., "import", "require", "node", "default")
|
|
23
|
+
* maps to an {@link Exports} value.
|
|
24
|
+
*
|
|
25
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest ExportConditions}
|
|
26
|
+
*/
|
|
27
|
+
export type ExportConditions = {
|
|
28
|
+
// eslint-disable-next-line no-use-before-define
|
|
29
|
+
[condition: string]: Exports;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Entry points of a module, optionally with conditions and subpath exports.
|
|
34
|
+
* Follows the recursive structure defined by Node.js for `package.json`
|
|
35
|
+
* `exports` and `imports` fields.
|
|
36
|
+
*
|
|
37
|
+
* - `null` excludes a subpath (null target).
|
|
38
|
+
* - `string` is a direct path.
|
|
39
|
+
* - `Array` is a fallback list (first match wins).
|
|
40
|
+
* - `ExportConditions` is a mapping of conditions to nested `Exports`.
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest Exports}
|
|
43
|
+
*/
|
|
44
|
+
export type Exports =
|
|
45
|
+
| null
|
|
46
|
+
| string
|
|
47
|
+
| Array<string | ExportConditions>
|
|
48
|
+
| ExportConditions;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The `imports` field of `package.json`.
|
|
52
|
+
* Keys must start with `#`.
|
|
53
|
+
*
|
|
54
|
+
* @see {@link https://github.com/sindresorhus/type-fest/blob/850b33c4dd292e0ff8cff039ee167d69be324fce/source/package-json.d.ts#L227-L248 | type-fest Imports}
|
|
55
|
+
*/
|
|
56
|
+
export type Imports = {
|
|
57
|
+
[key: `#${string}`]: Exports;
|
|
58
|
+
};
|
|
9
59
|
|
|
10
60
|
export type CommonDependencyDescriptors = Record<
|
|
11
61
|
string,
|
|
@@ -20,34 +70,79 @@ export type CommonDependencyDescriptorsOptions = {
|
|
|
20
70
|
/**
|
|
21
71
|
* Dependencies added to _all_ packages
|
|
22
72
|
*/
|
|
23
|
-
commonDependencyDescriptors?: CommonDependencyDescriptors;
|
|
73
|
+
commonDependencyDescriptors?: CommonDependencyDescriptors | undefined;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Options bag containing a {@link PackageDependenciesHook}
|
|
78
|
+
*/
|
|
79
|
+
export type PackageDependenciesHookOption = {
|
|
80
|
+
packageDependenciesHook?: PackageDependenciesHook | undefined;
|
|
24
81
|
};
|
|
25
82
|
|
|
26
83
|
/**
|
|
27
84
|
* Options for `graphPackage()`
|
|
28
85
|
*/
|
|
29
|
-
export type GraphPackageOptions =
|
|
30
|
-
|
|
31
|
-
|
|
86
|
+
export type GraphPackageOptions = LogOptions &
|
|
87
|
+
PolicyOption &
|
|
88
|
+
PackageDependenciesHookOption &
|
|
32
89
|
CommonDependencyDescriptorsOptions;
|
|
33
90
|
|
|
34
91
|
/**
|
|
35
92
|
* Options for `graphPackages()`
|
|
36
93
|
*/
|
|
37
|
-
export type GraphPackagesOptions = LogOptions
|
|
94
|
+
export type GraphPackagesOptions = LogOptions &
|
|
95
|
+
PolicyOption &
|
|
96
|
+
PackageDependenciesHookOption;
|
|
38
97
|
|
|
39
98
|
/**
|
|
40
99
|
* Options for `gatherDependency()`
|
|
41
100
|
*/
|
|
42
101
|
export type GatherDependencyOptions = {
|
|
43
|
-
childLogicalPath?: string[];
|
|
102
|
+
childLogicalPath?: string[] | undefined;
|
|
44
103
|
/**
|
|
45
104
|
* If `true` the dependency is optional
|
|
46
105
|
*/
|
|
47
|
-
optional?: boolean;
|
|
106
|
+
optional?: boolean | undefined;
|
|
48
107
|
} & LogOptions &
|
|
108
|
+
PackageDependenciesHookOption &
|
|
109
|
+
PolicyOption &
|
|
49
110
|
CommonDependencyDescriptorsOptions;
|
|
50
111
|
|
|
112
|
+
/**
|
|
113
|
+
* The type of a `package.json` file containing relevant fields; used by `graphPackages` and its ilk
|
|
114
|
+
*/
|
|
115
|
+
export interface PackageDescriptor {
|
|
116
|
+
/**
|
|
117
|
+
* TODO: In reality, this is optional, but `graphPackage` does not consider it
|
|
118
|
+
* to be. This will need to be fixed once support for "anonymous" packages
|
|
119
|
+
* lands; see https://github.com/endojs/endo/pull/2664
|
|
120
|
+
*/
|
|
121
|
+
name: string;
|
|
122
|
+
version?: string;
|
|
123
|
+
exports?: Exports;
|
|
124
|
+
imports?: Imports;
|
|
125
|
+
type?: 'module' | 'commonjs';
|
|
126
|
+
dependencies?: Record<string, string>;
|
|
127
|
+
devDependencies?: Record<string, string>;
|
|
128
|
+
peerDependencies?: Record<string, string>;
|
|
129
|
+
optionalDependencies?: Record<string, string>;
|
|
130
|
+
bundleDependencies?: string[];
|
|
131
|
+
peerDependenciesMeta?: Record<
|
|
132
|
+
string,
|
|
133
|
+
{ optional?: boolean; [k: string]: unknown }
|
|
134
|
+
>;
|
|
135
|
+
module?: string;
|
|
136
|
+
browser?: Record<string, string> | string;
|
|
137
|
+
|
|
138
|
+
main?: string;
|
|
139
|
+
|
|
140
|
+
[k: string]: unknown;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Value in {@link Graph}
|
|
145
|
+
*/
|
|
51
146
|
export interface Node {
|
|
52
147
|
/**
|
|
53
148
|
* Informative compartment label based on the package name and version (if available)
|
|
@@ -57,14 +152,18 @@ export interface Node {
|
|
|
57
152
|
* Package name
|
|
58
153
|
*/
|
|
59
154
|
name: string;
|
|
60
|
-
|
|
61
|
-
logicalPath: Array<string>;
|
|
155
|
+
location: FileUrlString;
|
|
62
156
|
/**
|
|
63
157
|
* `true` if the package's {@link PackageDescriptor} has an `exports` field
|
|
64
158
|
*/
|
|
65
159
|
explicitExports: boolean;
|
|
66
160
|
internalAliases: Record<string, string>;
|
|
67
161
|
externalAliases: Record<string, string>;
|
|
162
|
+
/**
|
|
163
|
+
* Wildcard patterns extracted from the `exports` and `imports` fields.
|
|
164
|
+
* `*` matches exactly one path segment (Node.js semantics).
|
|
165
|
+
*/
|
|
166
|
+
patterns: PatternDescriptor[];
|
|
68
167
|
/**
|
|
69
168
|
* The name of the original package's parent directory, for reconstructing
|
|
70
169
|
* a sourceURL that is likely to converge with the original location in an IDE.
|
|
@@ -77,9 +176,21 @@ export interface Node {
|
|
|
77
176
|
*
|
|
78
177
|
* The values are the keys of other {@link Node Nodes} in the {@link Graph}.
|
|
79
178
|
*/
|
|
80
|
-
dependencyLocations: Record<string,
|
|
179
|
+
dependencyLocations: Record<string, FileUrlString>;
|
|
81
180
|
parsers: LanguageForExtension;
|
|
82
181
|
types: Record<string, Language>;
|
|
182
|
+
packageDescriptor: PackageDescriptor;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* A node in the graph that has been finalized, meaning it has a `label` and is
|
|
187
|
+
* ready for conversion into a `CompartmentDescriptor`.
|
|
188
|
+
*/
|
|
189
|
+
export interface FinalNode extends Node {
|
|
190
|
+
/**
|
|
191
|
+
* Canonical name of the package; used to identify it in policy
|
|
192
|
+
*/
|
|
193
|
+
label: string;
|
|
83
194
|
}
|
|
84
195
|
|
|
85
196
|
/**
|
|
@@ -91,7 +202,20 @@ export interface Node {
|
|
|
91
202
|
* Keys may either be a file URL string to a package or the special
|
|
92
203
|
* `<ATTENUATORS>` string.
|
|
93
204
|
*/
|
|
94
|
-
export type Graph = Record<
|
|
205
|
+
export type Graph = Record<
|
|
206
|
+
LiteralUnion<typeof ATTENUATORS_COMPARTMENT, FileUrlString>,
|
|
207
|
+
Node
|
|
208
|
+
>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* A graph, but contains {@link FinalNode}s instead of {@link Node}s.
|
|
212
|
+
*
|
|
213
|
+
* A "final node" has a `label` prop.
|
|
214
|
+
*/
|
|
215
|
+
export type FinalGraph = Record<
|
|
216
|
+
PackageCompartmentDescriptorName,
|
|
217
|
+
Readonly<FinalNode>
|
|
218
|
+
>;
|
|
95
219
|
|
|
96
220
|
export interface LanguageOptions {
|
|
97
221
|
commonjsLanguageForExtension: LanguageForExtension;
|
|
@@ -114,3 +238,18 @@ export interface PackageDetails {
|
|
|
114
238
|
* used by `mapNodeModules()` and its ilk.
|
|
115
239
|
*/
|
|
116
240
|
export type LogicalPathGraph = GenericGraph<FileUrlString>;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Options for `translateGraph()`
|
|
244
|
+
*/
|
|
245
|
+
export type TranslateGraphOptions = LogOptions &
|
|
246
|
+
PolicyOption &
|
|
247
|
+
PackageDependenciesHookOption;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Mapping to enable reverse-lookups of `CompartmentDescriptor`s from policy.
|
|
251
|
+
*/
|
|
252
|
+
export type CanonicalNameMap = Map<
|
|
253
|
+
CanonicalName,
|
|
254
|
+
PackageCompartmentDescriptorName
|
|
255
|
+
>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for subpath pattern matching.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Result of a successful pattern match.
|
|
8
|
+
*/
|
|
9
|
+
export interface SubpathReplacerResult {
|
|
10
|
+
/** The resolved module path, or null for null-target exclusions */
|
|
11
|
+
result: string | null;
|
|
12
|
+
/** Optional compartment name for cross-compartment patterns */
|
|
13
|
+
compartment?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A function that attempts to match a specifier against patterns
|
|
17
|
+
* and returns the replacement path (with optional compartment), or null if no match.
|
|
18
|
+
*/
|
|
19
|
+
export type SubpathReplacer = (specifier: string) => SubpathReplacerResult | null;
|
|
20
|
+
/**
|
|
21
|
+
* Input format for pattern mappings - either an array of tuples,
|
|
22
|
+
* an array of PatternDescriptors, or a record object.
|
|
23
|
+
*/
|
|
24
|
+
export type SubpathMapping = Array<[pattern: string, replacement: string]> | Record<string, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Internal representation of a parsed pattern entry, split into
|
|
27
|
+
* prefix/suffix for efficient matching.
|
|
28
|
+
*/
|
|
29
|
+
export interface ResolvedPattern {
|
|
30
|
+
/** The original pattern key */
|
|
31
|
+
pattern: string;
|
|
32
|
+
/** The part of the pattern before `*` */
|
|
33
|
+
prefix: string;
|
|
34
|
+
/** The part of the pattern after `*` */
|
|
35
|
+
suffix: string;
|
|
36
|
+
/** The part of the replacement before `*`, or null for exclusions */
|
|
37
|
+
replacementPrefix: string | null;
|
|
38
|
+
/** The part of the replacement after `*`, or null for exclusions */
|
|
39
|
+
replacementSuffix: string | null;
|
|
40
|
+
/** Optional compartment for cross-compartment patterns */
|
|
41
|
+
compartment?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A pattern descriptor for wildcard-based module resolution.
|
|
45
|
+
* The `from` pattern is matched against module specifiers,
|
|
46
|
+
* and `to` is the replacement pattern.
|
|
47
|
+
*
|
|
48
|
+
* Wildcards (`*`) match any substring including `/` (Node.js semantics).
|
|
49
|
+
*/
|
|
50
|
+
export interface PatternDescriptor {
|
|
51
|
+
/** Source pattern with wildcard, e.g., "./lib/*.js" */
|
|
52
|
+
from: string;
|
|
53
|
+
/** Target pattern with wildcard, e.g., "./*.js". Null means exclusion. */
|
|
54
|
+
to: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Optional compartment name where the resolved module lives.
|
|
57
|
+
* When absent, the pattern resolves within the owning compartment.
|
|
58
|
+
* Set when propagating export patterns from a dependency package.
|
|
59
|
+
*/
|
|
60
|
+
compartment?: string;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=pattern-replacement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-replacement.d.ts","sourceRoot":"","sources":["pattern-replacement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mEAAmE;IACnE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,SAAS,EAAE,MAAM,KACd,qBAAqB,GAAG,IAAI,CAAC;AAElC;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,GAC7C,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,oEAAoE;IACpE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for subpath pattern matching.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Result of a successful pattern match.
|
|
9
|
+
*/
|
|
10
|
+
export interface SubpathReplacerResult {
|
|
11
|
+
/** The resolved module path, or null for null-target exclusions */
|
|
12
|
+
result: string | null;
|
|
13
|
+
/** Optional compartment name for cross-compartment patterns */
|
|
14
|
+
compartment?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A function that attempts to match a specifier against patterns
|
|
19
|
+
* and returns the replacement path (with optional compartment), or null if no match.
|
|
20
|
+
*/
|
|
21
|
+
export type SubpathReplacer = (
|
|
22
|
+
specifier: string,
|
|
23
|
+
) => SubpathReplacerResult | null;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Input format for pattern mappings - either an array of tuples,
|
|
27
|
+
* an array of PatternDescriptors, or a record object.
|
|
28
|
+
*/
|
|
29
|
+
export type SubpathMapping =
|
|
30
|
+
| Array<[pattern: string, replacement: string]>
|
|
31
|
+
| Record<string, string>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Internal representation of a parsed pattern entry, split into
|
|
35
|
+
* prefix/suffix for efficient matching.
|
|
36
|
+
*/
|
|
37
|
+
export interface ResolvedPattern {
|
|
38
|
+
/** The original pattern key */
|
|
39
|
+
pattern: string;
|
|
40
|
+
/** The part of the pattern before `*` */
|
|
41
|
+
prefix: string;
|
|
42
|
+
/** The part of the pattern after `*` */
|
|
43
|
+
suffix: string;
|
|
44
|
+
/** The part of the replacement before `*`, or null for exclusions */
|
|
45
|
+
replacementPrefix: string | null;
|
|
46
|
+
/** The part of the replacement after `*`, or null for exclusions */
|
|
47
|
+
replacementSuffix: string | null;
|
|
48
|
+
/** Optional compartment for cross-compartment patterns */
|
|
49
|
+
compartment?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A pattern descriptor for wildcard-based module resolution.
|
|
54
|
+
* The `from` pattern is matched against module specifiers,
|
|
55
|
+
* and `to` is the replacement pattern.
|
|
56
|
+
*
|
|
57
|
+
* Wildcards (`*`) match any substring including `/` (Node.js semantics).
|
|
58
|
+
*/
|
|
59
|
+
export interface PatternDescriptor {
|
|
60
|
+
/** Source pattern with wildcard, e.g., "./lib/*.js" */
|
|
61
|
+
from: string;
|
|
62
|
+
/** Target pattern with wildcard, e.g., "./*.js". Null means exclusion. */
|
|
63
|
+
to: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Optional compartment name where the resolved module lives.
|
|
66
|
+
* When absent, the pattern resolves within the owning compartment.
|
|
67
|
+
* Set when propagating export patterns from a dependency package.
|
|
68
|
+
*/
|
|
69
|
+
compartment?: string;
|
|
70
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
+
import type { WILDCARD_POLICY_VALUE } from '../policy-format.js';
|
|
7
8
|
/**
|
|
8
9
|
* An object representing a full attenuation definition.
|
|
9
10
|
*/
|
|
@@ -11,7 +12,7 @@ export type FullAttenuationDefinition = {
|
|
|
11
12
|
/** The type of attenuation. */
|
|
12
13
|
attenuate: string;
|
|
13
14
|
/** The parameters for the attenuation. */
|
|
14
|
-
params
|
|
15
|
+
params?: ImplicitAttenuationDefinition;
|
|
15
16
|
};
|
|
16
17
|
/**
|
|
17
18
|
* An array of any type representing an implicit attenuation definition.
|
|
@@ -30,7 +31,7 @@ export type UnifiedAttenuationDefinition = {
|
|
|
30
31
|
/**
|
|
31
32
|
* A type representing a wildcard policy, which can be 'any'.
|
|
32
33
|
*/
|
|
33
|
-
export type WildcardPolicy =
|
|
34
|
+
export type WildcardPolicy = typeof WILDCARD_POLICY_VALUE;
|
|
34
35
|
/**
|
|
35
36
|
* A type representing a property policy, which is a record of string keys and
|
|
36
37
|
* boolean values
|
|
@@ -41,7 +42,7 @@ export type PropertyPolicy = Record<string, boolean>;
|
|
|
41
42
|
* wildcard policy}, a property policy, `undefined`, or defined by an
|
|
42
43
|
* attenuator
|
|
43
44
|
*/
|
|
44
|
-
export type PolicyItem<T = void> = WildcardPolicy | PropertyPolicy | T;
|
|
45
|
+
export type PolicyItem<T = void> = [T] extends [void] ? WildcardPolicy | PropertyPolicy : WildcardPolicy | PropertyPolicy | T;
|
|
45
46
|
/**
|
|
46
47
|
* An object representing a nested attenuation definition.
|
|
47
48
|
*/
|
|
@@ -50,19 +51,33 @@ export type NestedAttenuationDefinition = Record<string, AttenuationDefinition |
|
|
|
50
51
|
* An object representing a base package policy.
|
|
51
52
|
*/
|
|
52
53
|
export type PackagePolicy<PackagePolicyItem = void, GlobalsPolicyItem = void, BuiltinsPolicyItem = void, ExtraOptions = unknown> = {
|
|
53
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The default attenuator, if any.
|
|
56
|
+
*/
|
|
54
57
|
defaultAttenuator?: string | undefined;
|
|
55
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* The policy item for packages.
|
|
60
|
+
*/
|
|
56
61
|
packages?: PolicyItem<PackagePolicyItem> | undefined;
|
|
57
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* The policy item or full attenuation definition for globals.
|
|
64
|
+
*/
|
|
58
65
|
globals?: AttenuationDefinition | PolicyItem<GlobalsPolicyItem> | undefined;
|
|
59
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* The policy item or nested attenuation definition for builtins.
|
|
68
|
+
*/
|
|
60
69
|
builtins?: NestedAttenuationDefinition | PolicyItem<BuiltinsPolicyItem> | undefined;
|
|
61
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Whether to disable global freeze.
|
|
72
|
+
*/
|
|
62
73
|
noGlobalFreeze?: boolean | undefined;
|
|
63
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Whether to allow dynamic imports
|
|
76
|
+
*/
|
|
64
77
|
dynamic?: boolean | undefined;
|
|
65
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Any additional user-defined options can be added to the policy here
|
|
80
|
+
*/
|
|
66
81
|
options?: ExtraOptions | undefined;
|
|
67
82
|
};
|
|
68
83
|
/**
|
|
@@ -79,5 +94,5 @@ export type Policy<PackagePolicyItem = void, GlobalsPolicyItem = void, BuiltinsP
|
|
|
79
94
|
/** Any {@link Policy} */
|
|
80
95
|
export type SomePolicy = Policy<any, any, any, any>;
|
|
81
96
|
/** Any {@link PackagePolicy} */
|
|
82
|
-
export type SomePackagePolicy = PackagePolicy<
|
|
97
|
+
export type SomePackagePolicy = PackagePolicy<void, void, void, unknown>;
|
|
83
98
|
//# sourceMappingURL=policy-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy-schema.d.ts","sourceRoot":"","sources":["policy-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"policy-schema.d.ts","sourceRoot":"","sources":["policy-schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIjE;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,6BAA6B,CAAC;CACxC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG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CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,CAChB,iBAAiB,GAAG,IAAI,EACxB,iBAAiB,GAAG,IAAI,EACxB,kBAAkB,GAAG,IAAI,EACzB,YAAY,GAAG,OAAO,IACpB;IACF,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CACf,MAAM,EACN,aAAa,CACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,CACb,CACF,CAAC;IACF,8BAA8B;IAC9B,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,wCAAwC;IACxC,KAAK,CAAC,EACF,aAAa,CACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,CACb,GACD,SAAS,CAAC;CACf,CAAC;AAEF,yBAAyB;AACzB,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAEpD,gCAAgC;AAChC,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import type { WILDCARD_POLICY_VALUE } from '../policy-format.js';
|
|
9
|
+
|
|
8
10
|
/* eslint-disable no-use-before-define */
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -14,7 +16,7 @@ export type FullAttenuationDefinition = {
|
|
|
14
16
|
/** The type of attenuation. */
|
|
15
17
|
attenuate: string;
|
|
16
18
|
/** The parameters for the attenuation. */
|
|
17
|
-
params
|
|
19
|
+
params?: ImplicitAttenuationDefinition;
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -38,7 +40,7 @@ export type UnifiedAttenuationDefinition = {
|
|
|
38
40
|
/**
|
|
39
41
|
* A type representing a wildcard policy, which can be 'any'.
|
|
40
42
|
*/
|
|
41
|
-
export type WildcardPolicy =
|
|
43
|
+
export type WildcardPolicy = typeof WILDCARD_POLICY_VALUE;
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
46
|
* A type representing a property policy, which is a record of string keys and
|
|
@@ -51,7 +53,9 @@ export type PropertyPolicy = Record<string, boolean>;
|
|
|
51
53
|
* wildcard policy}, a property policy, `undefined`, or defined by an
|
|
52
54
|
* attenuator
|
|
53
55
|
*/
|
|
54
|
-
export type PolicyItem<T = void> =
|
|
56
|
+
export type PolicyItem<T = void> = [T] extends [void]
|
|
57
|
+
? WildcardPolicy | PropertyPolicy
|
|
58
|
+
: WildcardPolicy | PropertyPolicy | T;
|
|
55
59
|
|
|
56
60
|
/**
|
|
57
61
|
* An object representing a nested attenuation definition.
|
|
@@ -70,22 +74,36 @@ export type PackagePolicy<
|
|
|
70
74
|
BuiltinsPolicyItem = void,
|
|
71
75
|
ExtraOptions = unknown,
|
|
72
76
|
> = {
|
|
73
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* The default attenuator, if any.
|
|
79
|
+
*/
|
|
74
80
|
defaultAttenuator?: string | undefined;
|
|
75
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* The policy item for packages.
|
|
83
|
+
*/
|
|
76
84
|
packages?: PolicyItem<PackagePolicyItem> | undefined;
|
|
77
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* The policy item or full attenuation definition for globals.
|
|
87
|
+
*/
|
|
78
88
|
globals?: AttenuationDefinition | PolicyItem<GlobalsPolicyItem> | undefined;
|
|
79
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* The policy item or nested attenuation definition for builtins.
|
|
91
|
+
*/
|
|
80
92
|
builtins?:
|
|
81
93
|
| NestedAttenuationDefinition
|
|
82
94
|
| PolicyItem<BuiltinsPolicyItem>
|
|
83
95
|
| undefined;
|
|
84
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Whether to disable global freeze.
|
|
98
|
+
*/
|
|
85
99
|
noGlobalFreeze?: boolean | undefined;
|
|
86
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Whether to allow dynamic imports
|
|
102
|
+
*/
|
|
87
103
|
dynamic?: boolean | undefined;
|
|
88
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Any additional user-defined options can be added to the policy here
|
|
106
|
+
*/
|
|
89
107
|
options?: ExtraOptions | undefined;
|
|
90
108
|
};
|
|
91
109
|
|
|
@@ -125,9 +143,4 @@ export type Policy<
|
|
|
125
143
|
export type SomePolicy = Policy<any, any, any, any>;
|
|
126
144
|
|
|
127
145
|
/** Any {@link PackagePolicy} */
|
|
128
|
-
export type SomePackagePolicy = PackagePolicy<
|
|
129
|
-
PolicyItem,
|
|
130
|
-
PolicyItem,
|
|
131
|
-
PolicyItem,
|
|
132
|
-
unknown
|
|
133
|
-
>;
|
|
146
|
+
export type SomePackagePolicy = PackagePolicy<void, void, void, unknown>;
|
package/src/types/policy.d.ts
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { SomeObject } from './typescript.js';
|
|
6
|
+
import type { LiteralUnion, SomeObject } from './typescript.js';
|
|
7
7
|
export type PackageNamingKit = {
|
|
8
8
|
/** true if location is the entry compartment */
|
|
9
9
|
isEntry?: boolean | undefined;
|
|
10
|
-
name
|
|
10
|
+
name?: LiteralUnion<'<ATTENUATORS>', string>;
|
|
11
11
|
path: Array<string>;
|
|
12
12
|
};
|
|
13
13
|
export type Attenuator<GlobalParams extends [any, ...any[]] = [any, ...any[]], ModuleParams extends [any, ...any[]] = [any, ...any[]]> = {
|
|
@@ -19,4 +19,8 @@ export type ModuleAttenuatorFn<Params extends [any, ...any[]] = [any, ...any[]],
|
|
|
19
19
|
export type DeferredAttenuatorsProvider = {
|
|
20
20
|
import: (attenuatorSpecifier: string | null) => Promise<Attenuator>;
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* A fieldname of `PackagePolicy`; used with `policyLookupHelper()`
|
|
24
|
+
*/
|
|
25
|
+
export type PolicyEnforcementField = 'builtins' | 'globals' | 'packages';
|
|
22
26
|
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["policy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["policy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,CACpB,YAAY,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,EACtD,YAAY,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,IACpD;IACF,gBAAgB,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;IAChE,eAAe,CAAC,EACZ,kBAAkB,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,CAAC,GACxD,SAAS,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAC5B,MAAM,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,IAC9C,CACF,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EACxC,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,KACjC,IAAI,CAAC;AAEV,MAAM,MAAM,kBAAkB,CAC5B,MAAM,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,EAChD,CAAC,GAAG,UAAU,EACd,CAAC,GAAG,CAAC,IACH,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;AAEjC,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACrE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC"}
|
package/src/types/policy.ts
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
/* eslint-disable no-use-before-define */
|
|
8
8
|
|
|
9
|
-
import type { SomeObject } from './typescript.js';
|
|
9
|
+
import type { LiteralUnion, SomeObject } from './typescript.js';
|
|
10
10
|
|
|
11
11
|
export type PackageNamingKit = {
|
|
12
12
|
/** true if location is the entry compartment */
|
|
13
13
|
isEntry?: boolean | undefined;
|
|
14
|
-
name
|
|
14
|
+
name?: LiteralUnion<'<ATTENUATORS>', string>;
|
|
15
15
|
path: Array<string>;
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -42,3 +42,8 @@ export type ModuleAttenuatorFn<
|
|
|
42
42
|
export type DeferredAttenuatorsProvider = {
|
|
43
43
|
import: (attenuatorSpecifier: string | null) => Promise<Attenuator>;
|
|
44
44
|
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A fieldname of `PackagePolicy`; used with `policyLookupHelper()`
|
|
48
|
+
*/
|
|
49
|
+
export type PolicyEnforcementField = 'builtins' | 'globals' | 'packages';
|
package/src/types/powers.d.ts
CHANGED
|
@@ -15,14 +15,14 @@ import type { SomeObject } from './typescript.js';
|
|
|
15
15
|
export type ReadPowers<T extends string = any> = {
|
|
16
16
|
canonical: CanonicalFn<T>;
|
|
17
17
|
read: ReadFn;
|
|
18
|
-
maybeRead?: MaybeReadFn;
|
|
19
|
-
readNow?: ReadNowFn;
|
|
20
|
-
maybeReadNow?: MaybeReadNowFn;
|
|
21
|
-
computeSha512?: HashFn;
|
|
22
|
-
fileURLToPath?: FileURLToPathFn;
|
|
23
|
-
pathToFileURL?: PathToFileURLFn;
|
|
24
|
-
requireResolve?: RequireResolveFn;
|
|
25
|
-
isAbsolute?: IsAbsoluteFn;
|
|
18
|
+
maybeRead?: MaybeReadFn | undefined;
|
|
19
|
+
readNow?: ReadNowFn | undefined;
|
|
20
|
+
maybeReadNow?: MaybeReadNowFn | undefined;
|
|
21
|
+
computeSha512?: HashFn | undefined;
|
|
22
|
+
fileURLToPath?: FileURLToPathFn | undefined;
|
|
23
|
+
pathToFileURL?: PathToFileURLFn | undefined;
|
|
24
|
+
requireResolve?: RequireResolveFn | undefined;
|
|
25
|
+
isAbsolute?: IsAbsoluteFn | undefined;
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
28
|
* @template T The expected input/output type of the {@link CanonicalFn}.
|
|
@@ -42,7 +42,9 @@ export type MaybeReadPowers<T extends string = any> = ReadPowers<T> & {
|
|
|
42
42
|
*
|
|
43
43
|
* @template T The expected input/output type of the {@link CanonicalFn}.
|
|
44
44
|
*/
|
|
45
|
-
export type ReadNowPowers<T extends string = any> = Omit<ReadPowers<T>, ReadNowPowersProp> &
|
|
45
|
+
export type ReadNowPowers<T extends string = any> = Omit<ReadPowers<T>, ReadNowPowersProp> & {
|
|
46
|
+
[P in ReadNowPowersProp]-?: NonNullable<ReadPowers<T>[P]>;
|
|
47
|
+
};
|
|
46
48
|
/**
|
|
47
49
|
* These properties are necessary for dynamic require support
|
|
48
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powers.d.ts","sourceRoot":"","sources":["powers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,IAAI;IAC/C,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"powers.d.ts","sourceRoot":"","sources":["powers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,IAAI;IAC/C,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACpC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,YAAY,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IAC5C,aAAa,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IAC5C,cAAc,CAAC,EAAE,gBAAgB,GAAG,SAAS,CA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