@opensaas/stack-core 0.37.0 → 0.38.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +68 -0
- package/CLAUDE.md +21 -3
- package/dist/access/access-filter.d.ts +30 -118
- package/dist/access/access-filter.d.ts.map +1 -1
- package/dist/access/access-filter.js +70 -206
- package/dist/access/access-filter.js.map +1 -1
- package/dist/access/access-filter.test.js +148 -188
- package/dist/access/access-filter.test.js.map +1 -1
- package/dist/access/declared-dependencies.d.ts +66 -26
- package/dist/access/declared-dependencies.d.ts.map +1 -1
- package/dist/access/declared-dependencies.js +67 -17
- package/dist/access/declared-dependencies.js.map +1 -1
- package/dist/access/declared-dependencies.test.d.ts +2 -0
- package/dist/access/declared-dependencies.test.d.ts.map +1 -0
- package/dist/access/declared-dependencies.test.js +226 -0
- package/dist/access/declared-dependencies.test.js.map +1 -0
- package/dist/access/depth-limits.d.ts +8 -7
- package/dist/access/depth-limits.d.ts.map +1 -1
- package/dist/access/depth-limits.js +8 -7
- package/dist/access/depth-limits.js.map +1 -1
- package/dist/access/errors.d.ts +12 -8
- package/dist/access/errors.d.ts.map +1 -1
- package/dist/access/errors.js +16 -12
- package/dist/access/errors.js.map +1 -1
- package/dist/access/field-visibility.d.ts +2 -1
- package/dist/access/field-visibility.d.ts.map +1 -1
- package/dist/access/field-visibility.js +91 -17
- package/dist/access/field-visibility.js.map +1 -1
- package/dist/access/index.d.ts +1 -2
- package/dist/access/index.d.ts.map +1 -1
- package/dist/access/index.js +1 -1
- package/dist/access/index.js.map +1 -1
- package/dist/access/relationship-count.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +38 -27
- package/dist/context/index.js.map +1 -1
- package/dist/query/index.d.ts +29 -0
- package/dist/query/index.d.ts.map +1 -1
- package/dist/query/index.js +27 -0
- package/dist/query/index.js.map +1 -1
- package/dist/query/relationship-options.d.ts +1 -1
- package/dist/query/relationship-options.js +1 -1
- package/package.json +1 -1
- package/src/access/access-filter.test.ts +205 -275
- package/src/access/access-filter.ts +84 -267
- package/src/access/declared-dependencies.test.ts +277 -0
- package/src/access/declared-dependencies.ts +122 -37
- package/src/access/depth-limits.ts +8 -7
- package/src/access/errors.ts +16 -12
- package/src/access/field-visibility.ts +99 -14
- package/src/access/index.ts +1 -7
- package/src/access/relationship-count.ts +1 -1
- package/src/context/index.ts +52 -33
- package/src/query/index.ts +53 -0
- package/src/query/relationship-options.ts +1 -1
- package/tests/access-relationships.test.ts +18 -16
- package/tests/computed-field-selective-evaluation.test.ts +418 -0
- package/tests/context.test.ts +27 -0
- package/tests/needs-declared-dependencies.test.ts +7 -4
- package/tests/resolve-chain.test.ts +11 -11
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,139 +1,32 @@
|
|
|
1
1
|
import { checkAccess, getRelatedListConfig } from './engine.js';
|
|
2
2
|
import { READ_INCLUDE_MAX_DEPTH } from './depth-limits.js';
|
|
3
3
|
import { AccessScopeDepthExceededError } from './errors.js';
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* `nothing-to-scope` contributes no `include` key — this is the AUTO-include
|
|
8
|
-
* silently stopping, which is correct when no caller asked for anything past
|
|
9
|
-
* this point (see `AccessIncludeResult` doc comment).
|
|
10
|
-
*/
|
|
11
|
-
function toPrismaEntry(entry) {
|
|
12
|
-
const result = {};
|
|
13
|
-
if (entry.where)
|
|
14
|
-
result.where = entry.where;
|
|
15
|
-
if (entry.nested.kind === 'scoped') {
|
|
16
|
-
const nestedInclude = toPrismaInclude(entry.nested);
|
|
17
|
-
if (nestedInclude && Object.keys(nestedInclude).length > 0) {
|
|
18
|
-
result.include = nestedInclude;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return Object.keys(result).length > 0 ? result : true;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Collapse an `AccessIncludeResult` to the plain Prisma `include` shape used
|
|
25
|
-
* when there is no caller-supplied include to merge against (the direct
|
|
26
|
-
* auto-include path). `nothing-to-scope` and `depth-exceeded` both become
|
|
27
|
-
* `undefined` here — at this call site nothing was explicitly requested past
|
|
28
|
-
* either boundary, so there is nothing to deny.
|
|
29
|
-
*/
|
|
30
|
-
export function toPrismaInclude(result) {
|
|
31
|
-
if (result.kind !== 'scoped')
|
|
32
|
-
return undefined;
|
|
33
|
-
const out = {};
|
|
34
|
-
for (const [key, entry] of Object.entries(result.include)) {
|
|
35
|
-
out[key] = toPrismaEntry(entry);
|
|
36
|
-
}
|
|
37
|
-
return out;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Build the access-controlled include for a list's fields.
|
|
41
|
-
*
|
|
42
|
-
* This allows us to filter relationships at the database level instead of in
|
|
43
|
-
* memory. Returns an {@link AccessIncludeResult} rather than a plain include
|
|
44
|
-
* object so that `mergeIncludeWithAccessControl` can tell a genuine "nothing
|
|
45
|
-
* to scope" apart from "the engine hit its depth cap" (see that type's doc
|
|
46
|
-
* comment and ADR-0022).
|
|
47
|
-
*/
|
|
48
|
-
export async function buildIncludeWithAccessControl(fieldConfigs, args, config, depth = 0,
|
|
49
|
-
// List names already on the path from the root to here. Used to detect
|
|
50
|
-
// relationship cycles (A → B → … → A) and stop the auto-include from
|
|
51
|
-
// re-descending them. Seed it with the root list name at the call site.
|
|
52
|
-
visitedLists = []) {
|
|
53
|
-
if (depth >= READ_INCLUDE_MAX_DEPTH) {
|
|
54
|
-
return { kind: 'depth-exceeded' };
|
|
55
|
-
}
|
|
56
|
-
// Inside a resolveOutput/virtual-field context we still scope each immediate
|
|
57
|
-
// relation (its own access `where`), but do not auto-expand INTO its nested
|
|
58
|
-
// relations — this keeps a single hook-issued read's include from growing
|
|
59
|
-
// depth-first. Correction (ADR-0023): this does NOT by itself terminate a
|
|
60
|
-
// cycle, despite what an earlier version of this comment claimed. A
|
|
61
|
-
// self-referential relation read from inside a hook is a NEW top-level
|
|
62
|
-
// read, invisible to this function's own recursion — the loop runs through
|
|
63
|
-
// the hook↔read boundary, not through repeated calls to
|
|
64
|
-
// `buildIncludeWithAccessControl`. Loop termination is the resolve chain's
|
|
65
|
-
// job: `field-visibility.ts`'s `resolveReadableFieldValue` refuses to
|
|
66
|
-
// re-enter a `(list, field)` pair already on the chain. What this check
|
|
67
|
-
// still does correctly is row-scope the immediate relation rather than
|
|
68
|
-
// skipping scoping altogether (issue #830's second trigger).
|
|
69
|
-
const insideResolveOutput = args.context._resolveOutputChain.length > 0;
|
|
70
|
-
const include = {};
|
|
71
|
-
let hasRelationships = false;
|
|
72
|
-
for (const [fieldName, fieldConfig] of Object.entries(fieldConfigs)) {
|
|
73
|
-
if (fieldConfig?.type === 'relationship' && 'ref' in fieldConfig && fieldConfig.ref) {
|
|
74
|
-
hasRelationships = true;
|
|
75
|
-
const relatedConfig = getRelatedListConfig(fieldConfig.ref, config);
|
|
76
|
-
if (relatedConfig) {
|
|
77
|
-
// Check query access for the related list
|
|
78
|
-
const queryAccess = relatedConfig.listConfig.access?.operation?.query;
|
|
79
|
-
const accessResult = await checkAccess(queryAccess, {
|
|
80
|
-
session: args.session,
|
|
81
|
-
context: args.context,
|
|
82
|
-
});
|
|
83
|
-
// If access is completely denied, exclude this relationship
|
|
84
|
-
if (accessResult === false) {
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
const where = typeof accessResult === 'object' ? accessResult : undefined;
|
|
88
|
-
// Cycle guard: if the related list already appears on the path from the
|
|
89
|
-
// root, DO NOT auto-include its relationships again. On a cyclic
|
|
90
|
-
// readable-relationship graph (A → B → … → A) the depth-first walk would
|
|
91
|
-
// otherwise re-descend the cycle on every branch, and — combined with the
|
|
92
|
-
// bare-`true` leaf re-expansion in `mergeIncludeWithAccessControl` — build
|
|
93
|
-
// an include tree deep/large enough to overflow the call stack in
|
|
94
|
-
// downstream processing (the RSC serializer's recursive `Map.set`). This
|
|
95
|
-
// extends the SF-20 (#566) fix: a bare-`true` leaf must resolve to a
|
|
96
|
-
// genuine single-level fetch, not a re-expansion of the full auto-include.
|
|
97
|
-
// The relation itself is still included (as a FLAT fetch of its own
|
|
98
|
-
// columns); only its onward relationships are pruned at the back-edge.
|
|
99
|
-
let nested = { kind: 'nothing-to-scope' };
|
|
100
|
-
const relatedListName = relatedConfig.listName;
|
|
101
|
-
if (!insideResolveOutput && !visitedLists.includes(relatedListName)) {
|
|
102
|
-
nested = await buildIncludeWithAccessControl(relatedConfig.listConfig.fields, args, config, depth + 1, [...visitedLists, relatedListName]);
|
|
103
|
-
}
|
|
104
|
-
include[fieldName] = { where, nested };
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return hasRelationships ? { kind: 'scoped', include } : { kind: 'nothing-to-scope' };
|
|
4
|
+
/** A plain object — excludes `null` and arrays, which `typeof x === 'object'` alone would admit. */
|
|
5
|
+
function isPlainObject(value) {
|
|
6
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
109
7
|
}
|
|
110
8
|
/**
|
|
111
9
|
* Narrow an unknown include value to the structured object form (vs bare `true`
|
|
112
10
|
* or any other primitive). Caller-supplied includes arrive untyped at the
|
|
113
|
-
* runtime boundary
|
|
11
|
+
* runtime boundary: narrow to a plain object first, then validate each field's
|
|
12
|
+
* own type before trusting it, rather than casting the whole value wholesale.
|
|
114
13
|
*
|
|
115
14
|
* A numeric `take` on a to-many relation include (a caller-supplied row bound,
|
|
116
15
|
* issue #752) is carried through: it only ever NARROWS the fetched rows and can
|
|
117
|
-
* never widen past the access `where`, so preserving it is access-neutral.
|
|
118
|
-
* access-controlled include never sets `take` itself — it originates solely
|
|
119
|
-
* from the caller — so `mergeIncludeWithAccessControl` re-attaches it below.
|
|
16
|
+
* never widen past the access `where`, so preserving it is access-neutral.
|
|
120
17
|
*/
|
|
121
18
|
function asEntryObject(value) {
|
|
122
|
-
if (value
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
entry.take = take;
|
|
134
|
-
return entry;
|
|
135
|
-
}
|
|
136
|
-
return null;
|
|
19
|
+
if (!isPlainObject(value))
|
|
20
|
+
return null;
|
|
21
|
+
const { where, include, take } = value;
|
|
22
|
+
const entry = {};
|
|
23
|
+
if (isPlainObject(where))
|
|
24
|
+
entry.where = where;
|
|
25
|
+
if (isPlainObject(include))
|
|
26
|
+
entry.include = include;
|
|
27
|
+
if (typeof take === 'number')
|
|
28
|
+
entry.take = take;
|
|
29
|
+
return entry;
|
|
137
30
|
}
|
|
138
31
|
/**
|
|
139
32
|
* AND-combine an access `where` with a caller-supplied nested `where`.
|
|
@@ -150,104 +43,75 @@ function andWhere(accessWhere, callerWhere) {
|
|
|
150
43
|
return accessWhere ?? callerWhere;
|
|
151
44
|
}
|
|
152
45
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* The caller's `include` decides WHICH relations to fetch; access control decides
|
|
157
|
-
* WHETHER each relation may be fetched and WITH WHAT filter. Replacing the
|
|
158
|
-
* access-controlled include with the caller's wholesale (the bug in #566) drops
|
|
159
|
-
* every per-relation access `where` and denied-relation exclusion, silently
|
|
160
|
-
* bypassing row-level access on any non-sudo read that passes `include`.
|
|
46
|
+
* Build the access-scoped `include` for exactly the relations a read
|
|
47
|
+
* requested, recursing only into branches `requestedInclude` itself names.
|
|
161
48
|
*
|
|
162
|
-
* For each
|
|
163
|
-
* -
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* -
|
|
167
|
-
*
|
|
168
|
-
* nested
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* nested
|
|
172
|
-
*
|
|
173
|
-
*
|
|
49
|
+
* For each key in `requestedInclude`:
|
|
50
|
+
* - Not a config-declared relationship → access control does not govern it;
|
|
51
|
+
* passed through unchanged (e.g. a fragment/caller key that isn't a
|
|
52
|
+
* relationship at all).
|
|
53
|
+
* - A declared relationship whose related list's `query` access denies it
|
|
54
|
+
* (`=== false`) → dropped entirely, no matter what the request asked for
|
|
55
|
+
* nested beneath it (#566): the caller chooses *which* relations, access
|
|
56
|
+
* control chooses *whether* and *with what filter*.
|
|
57
|
+
* - Otherwise → the access `where` is AND-combined with any caller-supplied
|
|
58
|
+
* nested `where` (never replaced — the other half of #566), a
|
|
59
|
+
* caller-supplied `take` rides through unchanged (#752), and — the "One
|
|
60
|
+
* hop" rule (ADR-0026) — nested relations are scoped ONLY if
|
|
61
|
+
* `requestedInclude` itself named a nested `include` here. A bare relation
|
|
62
|
+
* (or one with no nested `include`) fetches its own columns and stops: no
|
|
63
|
+
* recursive call, no access evaluation on anything beneath it.
|
|
174
64
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* unscoped (issue #830): throw `AccessScopeDepthExceededError` instead. An
|
|
184
|
-
* empty caller include at this level (nothing further requested) is not an
|
|
185
|
-
* error — there's simply nothing to do.
|
|
186
|
-
* - `scoped` → the normal per-relation merge below: a declared relationship
|
|
187
|
-
* ABSENT from the access include was denied (drop it); one PRESENT is used
|
|
188
|
-
* as the base, AND-combining `where`s and recursing into nested includes.
|
|
189
|
-
*
|
|
190
|
-
* `listKey` and `depth` are carried only to build a useful
|
|
191
|
-
* `AccessScopeDepthExceededError` message; they do not affect merge behaviour.
|
|
65
|
+
* **Depth is a cost limit, not a cycle guard (ADR-0026).** A `requestedInclude`
|
|
66
|
+
* is always a finite literal — the caller's own object, or
|
|
67
|
+
* `foldDeclaredDependencies`'s already-cycle-guarded fold — so this recursion
|
|
68
|
+
* cannot loop unboundedly on its own; nothing here walks the relationship
|
|
69
|
+
* graph unprompted. `READ_INCLUDE_MAX_DEPTH` still bounds how deep a request
|
|
70
|
+
* may reach, fail-closed per ADR-0022: a request naming anything at or past
|
|
71
|
+
* the cap throws `AccessScopeDepthExceededError` rather than silently
|
|
72
|
+
* returning less than what was asked for.
|
|
192
73
|
*/
|
|
193
|
-
export function
|
|
194
|
-
|
|
195
|
-
|
|
74
|
+
export async function buildAccessScopedInclude(requestedInclude, fieldConfigs, args, config, listKey, depth = 0) {
|
|
75
|
+
const requestedKeys = Object.keys(requestedInclude);
|
|
76
|
+
if (depth >= READ_INCLUDE_MAX_DEPTH && requestedKeys.length > 0) {
|
|
77
|
+
throw new AccessScopeDepthExceededError(listKey, requestedKeys[0], depth);
|
|
196
78
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (firstRelationName !== undefined) {
|
|
200
|
-
throw new AccessScopeDepthExceededError(listKey, firstRelationName, depth);
|
|
201
|
-
}
|
|
202
|
-
return {};
|
|
203
|
-
}
|
|
204
|
-
const merged = {};
|
|
205
|
-
const accessInclude = accessControlledInclude.include;
|
|
206
|
-
for (const [relationName, callerValue] of Object.entries(callerInclude)) {
|
|
79
|
+
const result = {};
|
|
80
|
+
for (const [relationName, requestedValue] of Object.entries(requestedInclude)) {
|
|
207
81
|
const fieldConfig = fieldConfigs[relationName];
|
|
208
82
|
const isDeclaredRelationship = fieldConfig?.type === 'relationship' && 'ref' in fieldConfig && !!fieldConfig.ref;
|
|
209
|
-
// Not a config-declared relationship → access control does not govern it; pass through unchanged.
|
|
210
83
|
if (!isDeclaredRelationship) {
|
|
211
|
-
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
const accessEntry = accessInclude[relationName];
|
|
215
|
-
// Declared relationship absent from the access include → query access denied → drop it.
|
|
216
|
-
if (accessEntry === undefined) {
|
|
84
|
+
result[relationName] = requestedValue;
|
|
217
85
|
continue;
|
|
218
86
|
}
|
|
219
|
-
const callerEntry = asEntryObject(callerValue);
|
|
220
|
-
// Resolve the related list's field configs so nested includes merge recursively.
|
|
221
87
|
const relatedConfig = getRelatedListConfig(fieldConfig.ref, config);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
88
|
+
if (!relatedConfig)
|
|
89
|
+
continue;
|
|
90
|
+
const queryAccess = relatedConfig.listConfig.access?.operation?.query;
|
|
91
|
+
const accessResult = await checkAccess(queryAccess, {
|
|
92
|
+
session: args.session,
|
|
93
|
+
context: args.context,
|
|
94
|
+
});
|
|
95
|
+
if (accessResult === false) {
|
|
96
|
+
continue;
|
|
230
97
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
98
|
+
const accessWhere = typeof accessResult === 'object' ? accessResult : undefined;
|
|
99
|
+
const requestedEntry = asEntryObject(requestedValue);
|
|
100
|
+
const mergedWhere = andWhere(accessWhere, requestedEntry?.where);
|
|
101
|
+
let nestedInclude;
|
|
102
|
+
if (requestedEntry?.include) {
|
|
103
|
+
nestedInclude = await buildAccessScopedInclude(requestedEntry.include, relatedConfig.listConfig.fields, args, config, relatedConfig.listName, depth + 1);
|
|
235
104
|
}
|
|
236
|
-
// If the caller's entry has no nested include, a 'depth-exceeded' nested
|
|
237
|
-
// result is silent here too — nothing was asked for past this point.
|
|
238
105
|
const entry = {};
|
|
239
106
|
if (mergedWhere)
|
|
240
107
|
entry.where = mergedWhere;
|
|
241
|
-
if (
|
|
242
|
-
entry.include =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
entry.take = callerEntry.take;
|
|
247
|
-
// A bare-`true` relation with no access filter, nested include, or row bound stays `true`.
|
|
248
|
-
merged[relationName] = Object.keys(entry).length > 0 ? entry : true;
|
|
108
|
+
if (nestedInclude && Object.keys(nestedInclude).length > 0)
|
|
109
|
+
entry.include = nestedInclude;
|
|
110
|
+
if (requestedEntry?.take !== undefined)
|
|
111
|
+
entry.take = requestedEntry.take;
|
|
112
|
+
result[relationName] = Object.keys(entry).length > 0 ? entry : true;
|
|
249
113
|
}
|
|
250
|
-
return
|
|
114
|
+
return result;
|
|
251
115
|
}
|
|
252
116
|
/**
|
|
253
117
|
* Remove keys that correspond to `virtual` fields from a Prisma `include`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access-filter.js","sourceRoot":"","sources":["../../src/access/access-filter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"access-filter.js","sourceRoot":"","sources":["../../src/access/access-filter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AA+B3D,oGAAoG;AACpG,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC7E,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IACtC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,CAAA;IACtC,MAAM,KAAK,GAAuB,EAAE,CAAA;IACpC,IAAI,aAAa,CAAC,KAAK,CAAC;QAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;IAC7C,IAAI,aAAa,CAAC,OAAO,CAAC;QAAE,KAAK,CAAC,OAAO,GAAG,OAAO,CAAA;IACnD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,KAAK,CAAC,IAAI,GAA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