@docstack/client 0.0.1 → 0.0.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.
- package/lib/core/attribute.d.ts +4 -4
- package/lib/core/class.d.ts +3 -3
- package/lib/core/crypto-engine/index.d.ts +5 -5
- package/lib/core/query-engine/executor.d.ts +1 -1
- package/lib/core/query-engine/index.d.ts +3 -3
- package/lib/core/stack.d.ts +6 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -8237
- package/lib/index.js.map +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/package.json +11 -3
- package/webpack.config.js +62 -0
- package/lib/core/attribute.js +0 -296
- package/lib/core/attribute.js.map +0 -1
- package/lib/core/class.js +0 -540
- package/lib/core/class.js.map +0 -1
- package/lib/core/crypto-engine/index.js +0 -130
- package/lib/core/crypto-engine/index.js.map +0 -1
- package/lib/core/crypto-engine/utils.js +0 -76
- package/lib/core/crypto-engine/utils.js.map +0 -1
- package/lib/core/datamodel/index.js +0 -1186
- package/lib/core/datamodel/index.js.map +0 -1
- package/lib/core/domain.js +0 -285
- package/lib/core/domain.js.map +0 -1
- package/lib/core/index.js +0 -379
- package/lib/core/index.js.map +0 -1
- package/lib/core/job-engine/index.js +0 -116
- package/lib/core/job-engine/index.js.map +0 -1
- package/lib/core/policy-engine/index.js +0 -150
- package/lib/core/policy-engine/index.js.map +0 -1
- package/lib/core/query-engine/accumulators.js +0 -258
- package/lib/core/query-engine/accumulators.js.map +0 -1
- package/lib/core/query-engine/evaluator.js +0 -179
- package/lib/core/query-engine/evaluator.js.map +0 -1
- package/lib/core/query-engine/executor.js +0 -405
- package/lib/core/query-engine/executor.js.map +0 -1
- package/lib/core/query-engine/index.js +0 -4
- package/lib/core/query-engine/index.js.map +0 -1
- package/lib/core/query-engine/parser.js +0 -515
- package/lib/core/query-engine/parser.js.map +0 -1
- package/lib/core/query-engine/planner.js +0 -330
- package/lib/core/query-engine/planner.js.map +0 -1
- package/lib/core/stack.js +0 -1507
- package/lib/core/stack.js.map +0 -1
- package/lib/core/test-utils/docstack.js +0 -222
- package/lib/core/test-utils/docstack.js.map +0 -1
- package/lib/core/trigger/index.js +0 -81
- package/lib/core/trigger/index.js.map +0 -1
- package/lib/plugins/pouchdb.js +0 -403
- package/lib/plugins/pouchdb.js.map +0 -1
- package/lib/utils/crypto/index.js +0 -34
- package/lib/utils/crypto/index.js.map +0 -1
- package/lib/utils/index.js +0 -58
- package/lib/utils/index.js.map +0 -1
- package/lib/utils/logger/index.js +0 -20
- package/lib/utils/logger/index.js.map +0 -1
- package/lib/utils/logger/transport.js +0 -28
- package/lib/utils/logger/transport.js.map +0 -1
- package/lib/workers/dataModel.js +0 -48
- package/lib/workers/dataModel.js.map +0 -1
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Document } from "@docstack/shared";
|
|
2
|
-
import Class from "../core/class
|
|
2
|
+
import Class from "../core/class";
|
|
3
3
|
import * as jsondiff from 'jsondiffpatch';
|
|
4
4
|
export declare const applySchemaDelta: (doc: Document, schemaDelta: jsondiff.AddedDelta | jsondiff.ModifiedDelta | jsondiff.DeletedDelta | jsondiff.ObjectDelta | jsondiff.ArrayDelta | jsondiff.MovedDelta | jsondiff.TextDiffDelta, classObj: Class) => Promise<Document>;
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docstack/client",
|
|
3
3
|
"description": "One does not simply stack documents.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.2",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
+
"module": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./lib/index.js"
|
|
10
|
+
},
|
|
6
11
|
"src": "src/index.ts",
|
|
7
12
|
"publishConfig": {
|
|
8
13
|
"access": "public"
|
|
@@ -11,6 +16,8 @@
|
|
|
11
16
|
"scripts": {
|
|
12
17
|
"build:types": "npx tsc -build --force ./tsconfig.json",
|
|
13
18
|
"build": "rollup --config ./rollup.config.js",
|
|
19
|
+
"build:dev": "webpack --node-env=development",
|
|
20
|
+
"build:prod": "webpack --node-env=production",
|
|
14
21
|
"build:vendor": "rollup --config ./rollup.vendor.js",
|
|
15
22
|
"lint": "eslint ./src --ext .ts,.tsx",
|
|
16
23
|
"test": "playwright test"
|
|
@@ -30,7 +37,7 @@
|
|
|
30
37
|
"bugs": {
|
|
31
38
|
"url": "https://github.com/onyx-og/docstack/issues"
|
|
32
39
|
},
|
|
33
|
-
"homepage": "https://
|
|
40
|
+
"homepage": "https://onyx.ac/docstack",
|
|
34
41
|
"dependencies": {
|
|
35
42
|
"jsondiffpatch": "^0.6.0",
|
|
36
43
|
"pouchdb-browser": "^9.0.0",
|
|
@@ -39,7 +46,8 @@
|
|
|
39
46
|
"setimmediate": "^1.0.5",
|
|
40
47
|
"winston": "^3.17.0",
|
|
41
48
|
"winston-transport": "^4.9.0",
|
|
42
|
-
"zod": "^3.24.1"
|
|
49
|
+
"zod": "^3.24.1",
|
|
50
|
+
"@docstack/shared": "file:../shared"
|
|
43
51
|
},
|
|
44
52
|
"devDependencies": {
|
|
45
53
|
"@docstack/shared": "file:../shared",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
const __dirname = path.resolve();
|
|
3
|
+
|
|
4
|
+
const config = {
|
|
5
|
+
entry: './src/index.ts',
|
|
6
|
+
experiments: {
|
|
7
|
+
outputModule: true,
|
|
8
|
+
},
|
|
9
|
+
output: {
|
|
10
|
+
path: path.resolve(__dirname, 'lib'),
|
|
11
|
+
filename: 'index.js',
|
|
12
|
+
globalObject: 'this',
|
|
13
|
+
library: {
|
|
14
|
+
type: 'module',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
externals: {
|
|
18
|
+
'pouchdb': 'pouchdb',
|
|
19
|
+
'pouchdb-browser': 'pouchdb-browser',
|
|
20
|
+
'pouchdb-find': 'pouchdb-find',
|
|
21
|
+
'winston': 'winston',
|
|
22
|
+
'winston-transport': 'winston-transport',
|
|
23
|
+
'semver': 'semver',
|
|
24
|
+
'jsondiffpatch': 'jsondiffpatch',
|
|
25
|
+
'zod': 'zod',
|
|
26
|
+
'@docstack/shared': '@docstack/shared',
|
|
27
|
+
},
|
|
28
|
+
devtool: 'source-map',
|
|
29
|
+
module: {
|
|
30
|
+
rules: [
|
|
31
|
+
{
|
|
32
|
+
test: /\.(ts|tsx)$/i,
|
|
33
|
+
loader: 'ts-loader',
|
|
34
|
+
exclude: ['/node_modules/'],
|
|
35
|
+
options: {
|
|
36
|
+
projectReferences: true,
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
resolve: {
|
|
42
|
+
extensions: [
|
|
43
|
+
'.js',
|
|
44
|
+
'.jsx',
|
|
45
|
+
'.tsx',
|
|
46
|
+
'.ts',
|
|
47
|
+
],
|
|
48
|
+
// fallback: {
|
|
49
|
+
// "os": require.resolve("os-browserify/browser"),
|
|
50
|
+
// "path": require.resolve("path-browserify"),
|
|
51
|
+
// "zlib": require.resolve("browserify-zlib"),
|
|
52
|
+
// "stream": require.resolve("stream-browserify"),
|
|
53
|
+
// "http": require.resolve("stream-http"),
|
|
54
|
+
// "https": require.resolve("https-browserify"),
|
|
55
|
+
// "fs": false
|
|
56
|
+
// }
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default () => {
|
|
61
|
+
return config;
|
|
62
|
+
}
|
package/lib/core/attribute.js
DELETED
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
var _a;
|
|
2
|
-
import z from "zod";
|
|
3
|
-
import { Attribute as Attribute_, ATTRIBUTE_TYPES } from "@docstack/shared";
|
|
4
|
-
class Attribute extends Attribute_ {
|
|
5
|
-
constructor(classObj = null, name, type, description, config) {
|
|
6
|
-
super(classObj, name, type, config);
|
|
7
|
-
this.field = z.any();
|
|
8
|
-
this.ensureReferenceConfigIsValid = async () => {
|
|
9
|
-
if (this.model.type !== "reference") {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
if (!this.class) {
|
|
13
|
-
throw new Error(`Attribute '${this.name}' must belong to a class to validate reference configuration.`);
|
|
14
|
-
}
|
|
15
|
-
const stack = this.class.getStack();
|
|
16
|
-
if (!stack) {
|
|
17
|
-
throw new Error(`Class '${this.class.getName()}' is not attached to a stack.`);
|
|
18
|
-
}
|
|
19
|
-
const config = this.model.config;
|
|
20
|
-
const domainName = config.domain;
|
|
21
|
-
if (typeof domainName !== "string" || domainName.length === 0) {
|
|
22
|
-
throw new Error(`Attribute '${this.name}' of type 'reference' must declare a domain.`);
|
|
23
|
-
}
|
|
24
|
-
if (config.isArray) {
|
|
25
|
-
throw new Error(`Attribute '${this.name}' of type 'reference' cannot be an array.`);
|
|
26
|
-
}
|
|
27
|
-
const domain = await stack.getDomain(domainName);
|
|
28
|
-
if (!domain) {
|
|
29
|
-
throw new Error(`Domain '${domainName}' was not found for attribute '${this.name}'.`);
|
|
30
|
-
}
|
|
31
|
-
const classId = this.class.id;
|
|
32
|
-
switch (domain.relation) {
|
|
33
|
-
case "1:N":
|
|
34
|
-
if (classId !== domain.targetClass.id) {
|
|
35
|
-
throw new Error(`Given classId '${classId}' Reference attributes for domain '${domainName}' can only be added to class '${domain.targetClass}'.`);
|
|
36
|
-
}
|
|
37
|
-
break;
|
|
38
|
-
case "N:1":
|
|
39
|
-
if (classId !== domain.sourceClass.id) {
|
|
40
|
-
throw new Error(`Given classId '${classId}' Reference attributes for domain '${domainName}' can only be added to class '${domain.sourceClass}'.`);
|
|
41
|
-
}
|
|
42
|
-
break;
|
|
43
|
-
case "1:1":
|
|
44
|
-
if (classId !== domain.sourceClass.id && classId !== domain.targetClass.id) {
|
|
45
|
-
throw new Error(`Class '${classId}' is not part of domain '${domainName}'.`);
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
case "N:N":
|
|
49
|
-
throw new Error(`Domain '${domainName}' does not support reference attributes.`);
|
|
50
|
-
default:
|
|
51
|
-
throw new Error(`Unsupported relation '${domain.relation}' for domain '${domainName}'.`);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
this.setField = () => {
|
|
55
|
-
const { name, type, config } = this.model;
|
|
56
|
-
let field;
|
|
57
|
-
switch (type) {
|
|
58
|
-
// ... existing cases for 'string', 'number', 'boolean', 'date' ...
|
|
59
|
-
case 'string':
|
|
60
|
-
field = z.string();
|
|
61
|
-
if (config.maxLength !== undefined) {
|
|
62
|
-
field = field.max(config.maxLength);
|
|
63
|
-
}
|
|
64
|
-
break;
|
|
65
|
-
case 'integer':
|
|
66
|
-
field = z.number();
|
|
67
|
-
if (typeof config.min === 'number') {
|
|
68
|
-
field = field.min(config.min);
|
|
69
|
-
}
|
|
70
|
-
if (typeof config.max === 'number') {
|
|
71
|
-
field = field.max(config.max);
|
|
72
|
-
}
|
|
73
|
-
break;
|
|
74
|
-
// case 'date':
|
|
75
|
-
// field = z.date();
|
|
76
|
-
// break;
|
|
77
|
-
case 'decimal':
|
|
78
|
-
field = z.number();
|
|
79
|
-
// min and max validation
|
|
80
|
-
if (typeof config.min === 'number') {
|
|
81
|
-
field = field.min(config.min);
|
|
82
|
-
}
|
|
83
|
-
if (typeof config.max === 'number') {
|
|
84
|
-
field = field.max(config.max);
|
|
85
|
-
}
|
|
86
|
-
// decimal precision validation (with refinement)
|
|
87
|
-
if (typeof config.precision === 'number' && config.precision >= 0) {
|
|
88
|
-
const isPrecise = (value) => {
|
|
89
|
-
if (typeof value !== 'number')
|
|
90
|
-
return true;
|
|
91
|
-
const valueAsString = value.toString();
|
|
92
|
-
const decimalPart = valueAsString.split('.')[1];
|
|
93
|
-
const decimalPlaces = decimalPart ? decimalPart.length : 0;
|
|
94
|
-
return decimalPlaces <= config.precision;
|
|
95
|
-
};
|
|
96
|
-
field = field.refine(isPrecise, `Number cannot have more than ${config.precision} decimals.`);
|
|
97
|
-
}
|
|
98
|
-
break;
|
|
99
|
-
case 'boolean':
|
|
100
|
-
field = z.boolean();
|
|
101
|
-
break;
|
|
102
|
-
case "object":
|
|
103
|
-
field = z.object({});
|
|
104
|
-
break;
|
|
105
|
-
case 'enum':
|
|
106
|
-
if (!config.values || !Array.isArray(config.values) || config.values.length === 0) {
|
|
107
|
-
throw new Error(`Attribute '${name}' of type 'enum' must have a non-empty 'values' array in its config.`);
|
|
108
|
-
}
|
|
109
|
-
const enumValues = config.values.map(v => v.value);
|
|
110
|
-
field = z.enum(enumValues);
|
|
111
|
-
break;
|
|
112
|
-
case 'foreign_key':
|
|
113
|
-
if (!config.targetClass) {
|
|
114
|
-
throw new Error(`Attribute '${name}' of type 'foreign_key' is missing a 'targetClass' in its config.`);
|
|
115
|
-
}
|
|
116
|
-
const foreignClass = config.targetClass;
|
|
117
|
-
const baseSchema = z.string();
|
|
118
|
-
field = baseSchema.refine(async (documentIdOrIds) => {
|
|
119
|
-
var _b;
|
|
120
|
-
const idsToValidate = Array.isArray(documentIdOrIds) ? documentIdOrIds : [documentIdOrIds];
|
|
121
|
-
if (idsToValidate.length === 0) {
|
|
122
|
-
return true;
|
|
123
|
-
}
|
|
124
|
-
try {
|
|
125
|
-
if (this.class) {
|
|
126
|
-
const stack = this.class.getStack();
|
|
127
|
-
if (stack) {
|
|
128
|
-
const promises = idsToValidate.map(id => stack.db.get(id));
|
|
129
|
-
const fetchResult = await Promise.all(promises);
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
else
|
|
133
|
-
throw new Error("Missing stack connection");
|
|
134
|
-
}
|
|
135
|
-
else
|
|
136
|
-
throw new Error("Missing class parentship");
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
if (error.status === 404) {
|
|
140
|
-
console.error(`Foreign key validation failed: document not found in class '${foreignClass}'. ${(_b = this.class) === null || _b === void 0 ? void 0 : _b.getName()}`, { error });
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
throw error;
|
|
144
|
-
}
|
|
145
|
-
}, {
|
|
146
|
-
message: `One or more documents not found in class '${foreignClass}'.`,
|
|
147
|
-
});
|
|
148
|
-
break;
|
|
149
|
-
case 'reference':
|
|
150
|
-
field = z.string().min(1);
|
|
151
|
-
break;
|
|
152
|
-
default:
|
|
153
|
-
throw new Error(`Unsupported schema type: '${type}' for field '${name}'`);
|
|
154
|
-
}
|
|
155
|
-
// These rules are applied regardless of the type, and in the correct order
|
|
156
|
-
if (config.defaultValue) {
|
|
157
|
-
field = field.default(config.defaultValue);
|
|
158
|
-
}
|
|
159
|
-
if (config.mandatory !== true) {
|
|
160
|
-
field = field.optional();
|
|
161
|
-
}
|
|
162
|
-
if (config.isArray === true) {
|
|
163
|
-
field = z.array(field);
|
|
164
|
-
}
|
|
165
|
-
this.field = field;
|
|
166
|
-
};
|
|
167
|
-
this.isPrimaryKey = () => {
|
|
168
|
-
let model = this.getModel();
|
|
169
|
-
return !!model.config.primaryKey;
|
|
170
|
-
};
|
|
171
|
-
this.isMandatory = () => {
|
|
172
|
-
return !!this.model.config.mandatory;
|
|
173
|
-
};
|
|
174
|
-
this.getModel = () => {
|
|
175
|
-
return this.model;
|
|
176
|
-
};
|
|
177
|
-
this.getClass = () => {
|
|
178
|
-
if (this.class)
|
|
179
|
-
return this.class;
|
|
180
|
-
else
|
|
181
|
-
throw Error("Missing class configuration for this attribute");
|
|
182
|
-
};
|
|
183
|
-
this.validate = async (data) => {
|
|
184
|
-
return this.field.safeParseAsync(data);
|
|
185
|
-
};
|
|
186
|
-
this.setModel = (model) => {
|
|
187
|
-
let currentModel = this.getModel();
|
|
188
|
-
model = Object.assign(currentModel || {}, model);
|
|
189
|
-
this.model = model;
|
|
190
|
-
this.defaultValue = model.config.defaultValue;
|
|
191
|
-
};
|
|
192
|
-
// TODO: Better define config
|
|
193
|
-
this.getType = (type) => {
|
|
194
|
-
if (this.checkTypeValidity(type)) {
|
|
195
|
-
return type;
|
|
196
|
-
}
|
|
197
|
-
else
|
|
198
|
-
throw Error("Invalid attribute type: " + type);
|
|
199
|
-
// return this?
|
|
200
|
-
};
|
|
201
|
-
this.getEmpty = () => {
|
|
202
|
-
// Let the field handle the default value, if present
|
|
203
|
-
// if not, it's undefined
|
|
204
|
-
const partialDoc = {
|
|
205
|
-
[this.name]: this.field.parse(undefined) || null
|
|
206
|
-
};
|
|
207
|
-
return partialDoc;
|
|
208
|
-
};
|
|
209
|
-
// getType()
|
|
210
|
-
this.getName = () => {
|
|
211
|
-
return this.name;
|
|
212
|
-
};
|
|
213
|
-
this.checkTypeValidity = (type) => {
|
|
214
|
-
let validity = false;
|
|
215
|
-
if (ATTRIBUTE_TYPES.includes(type)) {
|
|
216
|
-
validity = true;
|
|
217
|
-
}
|
|
218
|
-
return validity;
|
|
219
|
-
};
|
|
220
|
-
// TODO: change to imported const default configs for types
|
|
221
|
-
// as of now it accepts only string
|
|
222
|
-
// TODO: since config depends on attribute's type,
|
|
223
|
-
// find a way to check if given configs are correct
|
|
224
|
-
// find a way to add default configs base on type
|
|
225
|
-
this.getTypeConf = (type, config) => {
|
|
226
|
-
switch (type) {
|
|
227
|
-
// TODO: add missing cases and change values to imported const
|
|
228
|
-
case "decimal":
|
|
229
|
-
config = Object.assign({ max: null, min: null, precision: null, isArray: false }, config);
|
|
230
|
-
break;
|
|
231
|
-
case "integer":
|
|
232
|
-
config = Object.assign({ max: null, min: null, isArray: false }, config);
|
|
233
|
-
break;
|
|
234
|
-
case "string":
|
|
235
|
-
config = Object.assign({ isArray: false }, config);
|
|
236
|
-
break;
|
|
237
|
-
case "object":
|
|
238
|
-
config = Object.assign({ isArray: false }, config);
|
|
239
|
-
break;
|
|
240
|
-
case "date":
|
|
241
|
-
config = Object.assign({ format: "iso", max: null, min: null, isArray: false }, config);
|
|
242
|
-
break;
|
|
243
|
-
case "boolean":
|
|
244
|
-
config = Object.assign({ defaultValue: false, isArray: false }, config);
|
|
245
|
-
break;
|
|
246
|
-
case "foreign_key":
|
|
247
|
-
config = Object.assign({ targetClass: null, isArray: false }, config);
|
|
248
|
-
break;
|
|
249
|
-
case "enum":
|
|
250
|
-
config = Object.assign({ values: [], isArray: false }, config);
|
|
251
|
-
break;
|
|
252
|
-
case "reference":
|
|
253
|
-
config = Object.assign({ isArray: false }, config);
|
|
254
|
-
break;
|
|
255
|
-
default:
|
|
256
|
-
throw new Error("Unexpected type: " + type);
|
|
257
|
-
// return "^[a-zA-Z0-9_\\s]".concat("{0,"+config.maxLength+"}$");
|
|
258
|
-
}
|
|
259
|
-
return config;
|
|
260
|
-
};
|
|
261
|
-
this.name = name;
|
|
262
|
-
this.description = description;
|
|
263
|
-
this.setModel({
|
|
264
|
-
name: this.name,
|
|
265
|
-
description: this.description,
|
|
266
|
-
type: this.getType(type),
|
|
267
|
-
config: this.getTypeConf(type, config) || {},
|
|
268
|
-
});
|
|
269
|
-
this.setField();
|
|
270
|
-
// if it's given a class
|
|
271
|
-
// if ( classObj ) {
|
|
272
|
-
// attempt to add attribute
|
|
273
|
-
this.class = classObj;
|
|
274
|
-
// }
|
|
275
|
-
}
|
|
276
|
-
static async create(classObj, name, type, description, config) {
|
|
277
|
-
const attribute = new _a(classObj, name, type, description, config);
|
|
278
|
-
await attribute.ensureReferenceConfigIsValid();
|
|
279
|
-
await _a.build(attribute);
|
|
280
|
-
return attribute;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
_a = Attribute;
|
|
284
|
-
Attribute.build = async (attributeObj) => {
|
|
285
|
-
let classObj = attributeObj.getClass();
|
|
286
|
-
let stack = classObj.getStack();
|
|
287
|
-
if (stack) {
|
|
288
|
-
await classObj.addAttribute(attributeObj);
|
|
289
|
-
return attributeObj;
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
292
|
-
throw new Error("Missing db configuration");
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
export default Attribute;
|
|
296
|
-
//# sourceMappingURL=attribute.js.map
|
|
@@ -1 +0,0 @@
|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