@pacp/spec 1.0.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/LICENSE +21 -0
- package/README.md +150 -0
- package/dist/index.cjs +133 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +223 -0
- package/dist/index.d.ts +223 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/dist/pacp.schema.json +661 -0
- package/dist/profiles/fiscal-br.schema.json +37 -0
- package/dist/profiles/iluminacao.schema.json +51 -0
- package/dist/profiles/moveis.schema.json +43 -0
- package/dist/profiles/pisos-revestimentos.schema.json +50 -0
- package/dist/schema.cjs +48 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +11 -0
- package/dist/schema.d.ts +11 -0
- package/dist/schema.js +28 -0
- package/dist/schema.js.map +1 -0
- package/package.json +87 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
export { profileIds, profiles, schema } from './schema.js';
|
|
2
|
+
|
|
3
|
+
type ScalarValue = string | number | boolean;
|
|
4
|
+
type ImageType = "MAIN" | "DETAIL" | "AMBIANCE" | "TECHNICAL" | "OTHER";
|
|
5
|
+
interface ImageRef {
|
|
6
|
+
url: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
type?: ImageType;
|
|
9
|
+
}
|
|
10
|
+
interface Measure {
|
|
11
|
+
value: number;
|
|
12
|
+
unit: string;
|
|
13
|
+
}
|
|
14
|
+
interface DimensionsObj {
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
depth?: number;
|
|
18
|
+
unit: string;
|
|
19
|
+
}
|
|
20
|
+
interface AttributeRef {
|
|
21
|
+
id: string;
|
|
22
|
+
label?: string;
|
|
23
|
+
}
|
|
24
|
+
interface AttributeValue {
|
|
25
|
+
attributeId: string;
|
|
26
|
+
value: ScalarValue;
|
|
27
|
+
label?: string;
|
|
28
|
+
}
|
|
29
|
+
interface Option {
|
|
30
|
+
id: string;
|
|
31
|
+
attributeId: string;
|
|
32
|
+
value: ScalarValue;
|
|
33
|
+
label?: string;
|
|
34
|
+
}
|
|
35
|
+
interface LotPolicy {
|
|
36
|
+
required: boolean;
|
|
37
|
+
source: "CONTEXT" | "ATTRIBUTE";
|
|
38
|
+
contextKey?: string;
|
|
39
|
+
attributeId?: string;
|
|
40
|
+
}
|
|
41
|
+
interface SalesUnit {
|
|
42
|
+
requested_unit: string;
|
|
43
|
+
sell_unit: string;
|
|
44
|
+
quantity_per_sell_unit: number;
|
|
45
|
+
rounding: "CEIL";
|
|
46
|
+
min_sell_units?: number;
|
|
47
|
+
}
|
|
48
|
+
interface Product {
|
|
49
|
+
id: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
sku?: string;
|
|
52
|
+
manufacturer?: string;
|
|
53
|
+
brand?: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
category?: string;
|
|
56
|
+
gtin?: string;
|
|
57
|
+
base_price?: number;
|
|
58
|
+
images?: ImageRef[];
|
|
59
|
+
tags?: string[];
|
|
60
|
+
weight?: Measure;
|
|
61
|
+
dimensions?: DimensionsObj;
|
|
62
|
+
lot_policy?: LotPolicy;
|
|
63
|
+
sales_unit?: SalesUnit;
|
|
64
|
+
attributes?: AttributeRef[];
|
|
65
|
+
attribute_values?: AttributeValue[];
|
|
66
|
+
options: Option[];
|
|
67
|
+
rulesetIds?: string[];
|
|
68
|
+
[key: `x-${string}`]: unknown;
|
|
69
|
+
}
|
|
70
|
+
interface Predicate {
|
|
71
|
+
fact: string;
|
|
72
|
+
operator: "EQ" | "NEQ" | "IN" | "NOT_IN" | "GT" | "GTE" | "LT" | "LTE" | "EXISTS";
|
|
73
|
+
value?: ScalarValue;
|
|
74
|
+
values?: ScalarValue[];
|
|
75
|
+
}
|
|
76
|
+
interface Condition {
|
|
77
|
+
all?: Predicate[];
|
|
78
|
+
any?: Predicate[];
|
|
79
|
+
}
|
|
80
|
+
interface Component {
|
|
81
|
+
label?: string;
|
|
82
|
+
value?: number;
|
|
83
|
+
tableId?: string;
|
|
84
|
+
optionId?: string;
|
|
85
|
+
}
|
|
86
|
+
type RuleOperation = "ADD" | "PERCENT_OF" | "OVERRIDE" | "LOOKUP" | "MAX_OF" | "MIN_OF" | "PICK" | "ROUND" | "CAP" | "FLOOR";
|
|
87
|
+
interface Rule {
|
|
88
|
+
id: string;
|
|
89
|
+
operation: RuleOperation;
|
|
90
|
+
priority?: number;
|
|
91
|
+
enabled?: boolean;
|
|
92
|
+
when?: Condition;
|
|
93
|
+
value?: number;
|
|
94
|
+
percent?: number;
|
|
95
|
+
tableId?: string;
|
|
96
|
+
components?: Component[];
|
|
97
|
+
precision?: number;
|
|
98
|
+
max?: number;
|
|
99
|
+
min?: number;
|
|
100
|
+
fallback?: number;
|
|
101
|
+
optionId?: string;
|
|
102
|
+
optionIds?: string[];
|
|
103
|
+
[key: `x-${string}`]: unknown;
|
|
104
|
+
}
|
|
105
|
+
interface Ruleset {
|
|
106
|
+
id: string;
|
|
107
|
+
target: "BASE" | "SUBTOTAL" | "TOTAL";
|
|
108
|
+
rules: Rule[];
|
|
109
|
+
[key: `x-${string}`]: unknown;
|
|
110
|
+
}
|
|
111
|
+
interface Dimension {
|
|
112
|
+
key: string;
|
|
113
|
+
source: "ATTRIBUTE" | "CONTEXT" | "LITERAL";
|
|
114
|
+
attributeId?: string;
|
|
115
|
+
contextKey?: string;
|
|
116
|
+
literal?: ScalarValue;
|
|
117
|
+
}
|
|
118
|
+
interface TableRow {
|
|
119
|
+
key: Record<string, ScalarValue>;
|
|
120
|
+
value: number;
|
|
121
|
+
}
|
|
122
|
+
interface Table {
|
|
123
|
+
id: string;
|
|
124
|
+
type: "LOOKUP";
|
|
125
|
+
dimensions: Dimension[];
|
|
126
|
+
rows: TableRow[];
|
|
127
|
+
keys?: (string | {
|
|
128
|
+
optionId?: string;
|
|
129
|
+
id?: string;
|
|
130
|
+
name?: string;
|
|
131
|
+
})[];
|
|
132
|
+
}
|
|
133
|
+
interface Dependency {
|
|
134
|
+
id: string;
|
|
135
|
+
type: "REQUIRES" | "IMPLIES" | "AVAILABLE_OPTIONS_WHEN";
|
|
136
|
+
productId?: string;
|
|
137
|
+
optionId?: string;
|
|
138
|
+
requiresOptionIds?: string[];
|
|
139
|
+
allowedOptionIds?: string[];
|
|
140
|
+
when?: Condition;
|
|
141
|
+
}
|
|
142
|
+
interface Constraint {
|
|
143
|
+
id: string;
|
|
144
|
+
type: "DENY";
|
|
145
|
+
when: Condition;
|
|
146
|
+
message: string;
|
|
147
|
+
productId?: string;
|
|
148
|
+
optionIds?: string[];
|
|
149
|
+
}
|
|
150
|
+
interface PriceList {
|
|
151
|
+
id: string;
|
|
152
|
+
currency: string;
|
|
153
|
+
label?: string;
|
|
154
|
+
context_match?: Record<string, ScalarValue>;
|
|
155
|
+
}
|
|
156
|
+
interface Catalog {
|
|
157
|
+
id: string;
|
|
158
|
+
name?: string;
|
|
159
|
+
default_price_list_id?: string;
|
|
160
|
+
price_lists?: PriceList[];
|
|
161
|
+
[key: `x-${string}`]: unknown;
|
|
162
|
+
}
|
|
163
|
+
interface ProductRef {
|
|
164
|
+
id: string;
|
|
165
|
+
path: string;
|
|
166
|
+
}
|
|
167
|
+
interface Context {
|
|
168
|
+
price_list_id?: string;
|
|
169
|
+
region?: string;
|
|
170
|
+
channel?: string;
|
|
171
|
+
customer?: string;
|
|
172
|
+
lot_id?: string;
|
|
173
|
+
requested_quantity?: number;
|
|
174
|
+
requested_unit?: string;
|
|
175
|
+
[key: `x-${string}`]: unknown;
|
|
176
|
+
}
|
|
177
|
+
interface Pricing {
|
|
178
|
+
calculation_mode?: "CASCADE" | "TABLE_LOOKUP" | "OVERRIDE_BY_VARIANT" | "COST_PLUS";
|
|
179
|
+
}
|
|
180
|
+
interface CatalogDocument {
|
|
181
|
+
spec: "1.0.0";
|
|
182
|
+
document_type: "CATALOG";
|
|
183
|
+
catalog: Catalog;
|
|
184
|
+
rulesets: Ruleset[];
|
|
185
|
+
product_refs?: ProductRef[];
|
|
186
|
+
context?: Context;
|
|
187
|
+
pricing?: Pricing;
|
|
188
|
+
dictionaries?: Record<string, unknown>;
|
|
189
|
+
tables?: Table[];
|
|
190
|
+
dependencies?: Dependency[];
|
|
191
|
+
constraints?: Constraint[];
|
|
192
|
+
profiles?: string[];
|
|
193
|
+
[key: `x-${string}`]: unknown;
|
|
194
|
+
}
|
|
195
|
+
interface ProductDocument {
|
|
196
|
+
spec: "1.0.0";
|
|
197
|
+
document_type: "PRODUCT";
|
|
198
|
+
catalog_id: string;
|
|
199
|
+
product: Product;
|
|
200
|
+
rulesets?: Ruleset[];
|
|
201
|
+
tables?: Table[];
|
|
202
|
+
constraints?: Constraint[];
|
|
203
|
+
dependencies?: Dependency[];
|
|
204
|
+
profiles?: string[];
|
|
205
|
+
[key: `x-${string}`]: unknown;
|
|
206
|
+
}
|
|
207
|
+
type PacpDocument = CatalogDocument | ProductDocument;
|
|
208
|
+
type ProfileId = "moveis" | "iluminacao" | "pisos-revestimentos" | "fiscal-br";
|
|
209
|
+
interface ValidationIssue {
|
|
210
|
+
code: string;
|
|
211
|
+
path: string;
|
|
212
|
+
message: string;
|
|
213
|
+
}
|
|
214
|
+
interface ValidationResult {
|
|
215
|
+
valid: boolean;
|
|
216
|
+
issues: ValidationIssue[];
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
declare function validate(document: unknown): ValidationResult;
|
|
220
|
+
|
|
221
|
+
declare const SPEC_VERSION: "1.0.0";
|
|
222
|
+
|
|
223
|
+
export { type AttributeRef, type AttributeValue, type Catalog, type CatalogDocument, type Component, type Condition, type Constraint, type Context, type Dependency, type Dimension, type DimensionsObj, type ImageRef, type ImageType, type LotPolicy, type Measure, type Option, type PacpDocument, type Predicate, type PriceList, type Pricing, type Product, type ProductDocument, type ProductRef, type ProfileId, type Rule, type RuleOperation, type Ruleset, SPEC_VERSION, type SalesUnit, type ScalarValue, type Table, type TableRow, type ValidationIssue, type ValidationResult, validate };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// node_modules/tsup/assets/esm_shims.js
|
|
9
|
+
import path from "path";
|
|
10
|
+
import { fileURLToPath } from "url";
|
|
11
|
+
var getFilename = () => fileURLToPath(import.meta.url);
|
|
12
|
+
var getDirname = () => path.dirname(getFilename());
|
|
13
|
+
var __dirname = /* @__PURE__ */ getDirname();
|
|
14
|
+
|
|
15
|
+
// src/schema.ts
|
|
16
|
+
import { readFileSync } from "fs";
|
|
17
|
+
import { join } from "path";
|
|
18
|
+
function loadJson(relativePath) {
|
|
19
|
+
const fullPath = join(__dirname, relativePath);
|
|
20
|
+
return JSON.parse(readFileSync(fullPath, "utf8"));
|
|
21
|
+
}
|
|
22
|
+
var schema = loadJson("./pacp.schema.json");
|
|
23
|
+
var profiles = {
|
|
24
|
+
moveis: loadJson("./profiles/moveis.schema.json"),
|
|
25
|
+
iluminacao: loadJson("./profiles/iluminacao.schema.json"),
|
|
26
|
+
"pisos-revestimentos": loadJson("./profiles/pisos-revestimentos.schema.json"),
|
|
27
|
+
"fiscal-br": loadJson("./profiles/fiscal-br.schema.json")
|
|
28
|
+
};
|
|
29
|
+
var profileIds = Object.keys(profiles);
|
|
30
|
+
|
|
31
|
+
// src/validate.ts
|
|
32
|
+
function validate(document) {
|
|
33
|
+
let Ajv2020;
|
|
34
|
+
let addFormats;
|
|
35
|
+
try {
|
|
36
|
+
Ajv2020 = __require("ajv/dist/2020");
|
|
37
|
+
addFormats = __require("ajv-formats");
|
|
38
|
+
} catch {
|
|
39
|
+
throw new Error(
|
|
40
|
+
"Para usar validate(), instale ajv e ajv-formats: npm install ajv ajv-formats"
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
const ajv = new Ajv2020({ allErrors: true, strict: false });
|
|
44
|
+
addFormats(ajv);
|
|
45
|
+
const issues = [];
|
|
46
|
+
const validateSchema = ajv.compile(schema);
|
|
47
|
+
const valid = validateSchema(document);
|
|
48
|
+
if (!valid && validateSchema.errors) {
|
|
49
|
+
for (const error of validateSchema.errors) {
|
|
50
|
+
issues.push({
|
|
51
|
+
code: "SCHEMA",
|
|
52
|
+
path: error.instancePath || "/",
|
|
53
|
+
message: error.message ?? "Erro de validacao de schema"
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (document && typeof document === "object" && !Array.isArray(document)) {
|
|
58
|
+
const doc = document;
|
|
59
|
+
const declaredProfiles = Array.isArray(doc.profiles) ? doc.profiles : [];
|
|
60
|
+
for (const profileId of declaredProfiles) {
|
|
61
|
+
if (typeof profileId !== "string") continue;
|
|
62
|
+
const profileSchema = profiles[profileId];
|
|
63
|
+
if (!profileSchema) {
|
|
64
|
+
issues.push({
|
|
65
|
+
code: "UNKNOWN_PROFILE",
|
|
66
|
+
path: "/profiles",
|
|
67
|
+
message: `Profile "${profileId}" nao e um profile oficial PACP`
|
|
68
|
+
});
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const products = extractProducts(doc);
|
|
72
|
+
const validateProfile = ajv.compile(profileSchema);
|
|
73
|
+
for (let i = 0; i < products.length; i++) {
|
|
74
|
+
const xFields = extractXFields(products[i]);
|
|
75
|
+
if (Object.keys(xFields).length === 0) continue;
|
|
76
|
+
const profileValid = validateProfile(xFields);
|
|
77
|
+
if (!profileValid && validateProfile.errors) {
|
|
78
|
+
for (const error of validateProfile.errors) {
|
|
79
|
+
issues.push({
|
|
80
|
+
code: "PROFILE_VALIDATION",
|
|
81
|
+
path: `products[${i}]${error.instancePath || "/"}`,
|
|
82
|
+
message: `Profile "${profileId}": ${error.message ?? "erro de validacao"}`
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return { valid: issues.length === 0, issues };
|
|
90
|
+
}
|
|
91
|
+
function extractProducts(doc) {
|
|
92
|
+
if (doc.document_type === "PRODUCT" && doc.product && typeof doc.product === "object") {
|
|
93
|
+
return [doc.product];
|
|
94
|
+
}
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
function extractXFields(obj) {
|
|
98
|
+
const result = {};
|
|
99
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
100
|
+
if (key.startsWith("x-")) {
|
|
101
|
+
result[key] = value;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// src/index.ts
|
|
108
|
+
var SPEC_VERSION = "1.0.0";
|
|
109
|
+
export {
|
|
110
|
+
SPEC_VERSION,
|
|
111
|
+
profileIds,
|
|
112
|
+
profiles,
|
|
113
|
+
schema,
|
|
114
|
+
validate
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/tsup/assets/esm_shims.js","../src/schema.ts","../src/validate.ts","../src/index.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","import { readFileSync } from \"node:fs\";\r\nimport { join } from \"node:path\";\r\n\r\nfunction loadJson(relativePath: string): Record<string, unknown> {\r\n const fullPath = join(__dirname, relativePath);\r\n return JSON.parse(readFileSync(fullPath, \"utf8\"));\r\n}\r\n\r\nexport const schema = loadJson(\"./pacp.schema.json\") as Record<string, unknown>;\r\n\r\nexport const profiles = {\r\n moveis: loadJson(\"./profiles/moveis.schema.json\") as Record<string, unknown>,\r\n iluminacao: loadJson(\"./profiles/iluminacao.schema.json\") as Record<string, unknown>,\r\n \"pisos-revestimentos\": loadJson(\"./profiles/pisos-revestimentos.schema.json\") as Record<string, unknown>,\r\n \"fiscal-br\": loadJson(\"./profiles/fiscal-br.schema.json\") as Record<string, unknown>,\r\n} as const;\r\n\r\nexport type ProfileId = keyof typeof profiles;\r\n\r\nexport const profileIds = Object.keys(profiles) as ProfileId[];\r\n","import type { ValidationResult, ValidationIssue, PacpDocument } from \"./types.js\";\r\nimport { schema, profiles, type ProfileId } from \"./schema.js\";\r\n\r\nexport function validate(document: unknown): ValidationResult {\r\n let Ajv2020: typeof import(\"ajv/dist/2020\").default;\r\n let addFormats: typeof import(\"ajv-formats\").default;\r\n\r\n try {\r\n Ajv2020 = require(\"ajv/dist/2020\") as typeof import(\"ajv/dist/2020\").default;\r\n addFormats = require(\"ajv-formats\") as typeof import(\"ajv-formats\").default;\r\n } catch {\r\n throw new Error(\r\n 'Para usar validate(), instale ajv e ajv-formats: npm install ajv ajv-formats'\r\n );\r\n }\r\n\r\n const ajv = new Ajv2020({ allErrors: true, strict: false });\r\n addFormats(ajv);\r\n\r\n const issues: ValidationIssue[] = [];\r\n\r\n const validateSchema = ajv.compile(schema);\r\n const valid = validateSchema(document);\r\n\r\n if (!valid && validateSchema.errors) {\r\n for (const error of validateSchema.errors) {\r\n issues.push({\r\n code: \"SCHEMA\",\r\n path: error.instancePath || \"/\",\r\n message: error.message ?? \"Erro de validacao de schema\",\r\n });\r\n }\r\n }\r\n\r\n if (document && typeof document === \"object\" && !Array.isArray(document)) {\r\n const doc = document as Record<string, unknown>;\r\n const declaredProfiles = Array.isArray(doc.profiles) ? doc.profiles : [];\r\n\r\n for (const profileId of declaredProfiles) {\r\n if (typeof profileId !== \"string\") continue;\r\n\r\n const profileSchema = profiles[profileId as ProfileId];\r\n if (!profileSchema) {\r\n issues.push({\r\n code: \"UNKNOWN_PROFILE\",\r\n path: \"/profiles\",\r\n message: `Profile \"${profileId}\" nao e um profile oficial PACP`,\r\n });\r\n continue;\r\n }\r\n\r\n const products = extractProducts(doc);\r\n const validateProfile = ajv.compile(profileSchema);\r\n\r\n for (let i = 0; i < products.length; i++) {\r\n const xFields = extractXFields(products[i]);\r\n if (Object.keys(xFields).length === 0) continue;\r\n\r\n const profileValid = validateProfile(xFields);\r\n if (!profileValid && validateProfile.errors) {\r\n for (const error of validateProfile.errors) {\r\n issues.push({\r\n code: \"PROFILE_VALIDATION\",\r\n path: `products[${i}]${error.instancePath || \"/\"}`,\r\n message: `Profile \"${profileId}\": ${error.message ?? \"erro de validacao\"}`,\r\n });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return { valid: issues.length === 0, issues };\r\n}\r\n\r\nfunction extractProducts(doc: Record<string, unknown>): Record<string, unknown>[] {\r\n if (doc.document_type === \"PRODUCT\" && doc.product && typeof doc.product === \"object\") {\r\n return [doc.product as Record<string, unknown>];\r\n }\r\n return [];\r\n}\r\n\r\nfunction extractXFields(obj: Record<string, unknown>): Record<string, unknown> {\r\n const result: Record<string, unknown> = {};\r\n for (const [key, value] of Object.entries(obj)) {\r\n if (key.startsWith(\"x-\")) {\r\n result[key] = value;\r\n }\r\n }\r\n return result;\r\n}\r\n","export { schema, profiles, profileIds } from \"./schema.js\";\r\nexport { validate } from \"./validate.js\";\r\nexport type {\r\n ScalarValue,\r\n ImageType,\r\n ImageRef,\r\n Measure,\r\n DimensionsObj,\r\n AttributeRef,\r\n AttributeValue,\r\n Option,\r\n LotPolicy,\r\n SalesUnit,\r\n Product,\r\n Predicate,\r\n Condition,\r\n Component,\r\n RuleOperation,\r\n Rule,\r\n Ruleset,\r\n Dimension,\r\n TableRow,\r\n Table,\r\n Dependency,\r\n Constraint,\r\n PriceList,\r\n Catalog,\r\n ProductRef,\r\n Context,\r\n Pricing,\r\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