@pdtf/schemas 3.6.0-9 → 3.6.0-dev.3
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/CLAUDE.md +101 -0
- package/README.md +57 -33
- package/docs/branch-release-workflow.md +138 -0
- package/docs/sef25-extensions-ui-spec.md +355 -0
- package/index.js +131 -75
- package/package.json +6 -2
- package/pensive-tesla-d0d355/CLAUDE.md +101 -0
- package/pensive-tesla-d0d355/LICENSE +21 -0
- package/pensive-tesla-d0d355/README.md +435 -0
- package/pensive-tesla-d0d355/docs/branch-release-workflow.md +138 -0
- package/pensive-tesla-d0d355/docs/sef25-extensions-ui-spec.md +355 -0
- package/pensive-tesla-d0d355/index.js +654 -0
- package/pensive-tesla-d0d355/package-lock.json +7297 -0
- package/pensive-tesla-d0d355/package.json +44 -0
- package/pensive-tesla-d0d355/src/examples/v1/exampleAddParticipantVouch.json +32 -0
- package/pensive-tesla-d0d355/src/examples/v1/exampleDocumentedVouch.json +40 -0
- package/pensive-tesla-d0d355/src/examples/v1/exampleElectronicRecord.json +30 -0
- package/pensive-tesla-d0d355/src/examples/v1/exampleTransaction.json +878 -0
- package/pensive-tesla-d0d355/src/examples/v1/exampleVouch.json +25 -0
- package/pensive-tesla-d0d355/src/examples/v2/exampleTransaction.json +901 -0
- package/pensive-tesla-d0d355/src/examples/v3/exampleAddParticipantVouch.json +38 -0
- package/pensive-tesla-d0d355/src/examples/v3/exampleCustomOverlay.json +55 -0
- package/pensive-tesla-d0d355/src/examples/v3/exampleCustomOverlay2.json +93 -0
- package/pensive-tesla-d0d355/src/examples/v3/exampleDocumentedVouch.json +47 -0
- package/pensive-tesla-d0d355/src/examples/v3/exampleElectronicRecord.json +36 -0
- package/pensive-tesla-d0d355/src/examples/v3/exampleTransaction.json +1038 -0
- package/pensive-tesla-d0d355/src/examples/v3/exampleVouch.json +32 -0
- package/pensive-tesla-d0d355/src/mappings/SendPropertyDetailsRequestSchema.json +1588 -0
- package/pensive-tesla-d0d355/src/mappings/adf.js +198 -0
- package/pensive-tesla-d0d355/src/schemas/v1/GeoJSON.json +1279 -0
- package/pensive-tesla-d0d355/src/schemas/v1/baspiNotes.html +102 -0
- package/pensive-tesla-d0d355/src/schemas/v1/energy-performance-certificate.json +124 -0
- package/pensive-tesla-d0d355/src/schemas/v1/freehold-information.json +2051 -0
- package/pensive-tesla-d0d355/src/schemas/v1/leasehold-information.json +2064 -0
- package/pensive-tesla-d0d355/src/schemas/v1/legal-information.json +1045 -0
- package/pensive-tesla-d0d355/src/schemas/v1/material-facts.json +2109 -0
- package/pensive-tesla-d0d355/src/schemas/v1/pdtf-transaction-search-results.json +40 -0
- package/pensive-tesla-d0d355/src/schemas/v1/pdtf-transaction.json +191 -0
- package/pensive-tesla-d0d355/src/schemas/v1/searches/drainage-and-water.json +261 -0
- package/pensive-tesla-d0d355/src/schemas/v1/searches/local-land-charges.json +69 -0
- package/pensive-tesla-d0d355/src/schemas/v1/searches/local-searches-required.json +857 -0
- package/pensive-tesla-d0d355/src/schemas/v1/searches.json +237 -0
- package/pensive-tesla-d0d355/src/schemas/v1/title-deed.json +841 -0
- package/pensive-tesla-d0d355/src/schemas/v2/baspiNotes.html +102 -0
- package/pensive-tesla-d0d355/src/schemas/v2/combined.json +37731 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/baspi.json +8132 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/con29DW.json +705 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/con29R.json +2956 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/fme1.json +1259 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/llc1.json +25 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/lpe1.json +2171 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/nts.json +326 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/oc1.json +2799 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/piq.json +3419 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/rds.json +3736 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta10.json +5306 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta6.json +4533 -0
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta7.json +1045 -0
- package/pensive-tesla-d0d355/src/schemas/v2/pdtf-transaction.json +34351 -0
- package/pensive-tesla-d0d355/src/schemas/v2/skeleton.json +3973 -0
- package/pensive-tesla-d0d355/src/schemas/v3/combined.json +48469 -0
- package/pensive-tesla-d0d355/src/schemas/v3/compactSkeleton.txt +4519 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/README.md +299 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/baspi4.json +8025 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/baspi5.json +8175 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/con29DW.json +716 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/con29R.json +2981 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ac.json +333 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/as.json +74 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/dk.json +32 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/dr.json +73 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/er.json +85 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/fd.json +75 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/hi.json +51 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/hs.json +73 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ic.json +59 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/jk.json +96 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/la.json +85 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/lc.json +75 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ma.json +90 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/mc.json +38 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/mi.json +69 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/nd.json +43 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/oa.json +24 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/oc.json +57 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/pc.json +37 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ph.json +194 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/rw.json +68 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sb.json +73 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sc.json +129 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sd.json +63 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sf.json +74 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sl.json +68 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ta.json +252 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/tf.json +103 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/tr.json +73 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/wg.json +350 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/fme1.json +1266 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/llc1.json +25 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/lpe1.json +2199 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/nts.json +2157 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/nts2.json +2742 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ntsl.json +1813 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ntsl2.json +2217 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/oc1.json +2817 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/piq.json +3322 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/rds.json +3665 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/sef25.json +1639 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/sr24.json +38 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta10.json +4654 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta6.json +4568 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta6ed6.json +6534 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta7.json +1537 -0
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta7ed5.json +1551 -0
- package/pensive-tesla-d0d355/src/schemas/v3/pdtf-transaction.json +41573 -0
- package/pensive-tesla-d0d355/src/schemas/v3/skeleton.json +5767 -0
- package/pensive-tesla-d0d355/src/schemas/verifiedClaims/README.md +21 -0
- package/pensive-tesla-d0d355/src/schemas/verifiedClaims/pdtf-verified-claims.json +447 -0
- package/pensive-tesla-d0d355/src/utils/compactSkeleton.js +84 -0
- package/pensive-tesla-d0d355/src/utils/countTokens.js +67 -0
- package/pensive-tesla-d0d355/src/utils/extractExtensionOverlays.js +624 -0
- package/pensive-tesla-d0d355/src/utils/extractOverlay.js +381 -0
- package/pensive-tesla-d0d355/src/utils/extractProperties.js +44 -0
- package/pensive-tesla-d0d355/src/utils/listPathTitles.js +36 -0
- package/pensive-tesla-d0d355/src/utils/minimalSkeleton.js +85 -0
- package/pensive-tesla-d0d355/src/utils/pathList.csv +903 -0
- package/pensive-tesla-d0d355/src/utils/pathSkeleton.js +181 -0
- package/src/examples/v3/exampleTransaction.json +3 -3
- package/src/schemas/v3/combined.json +8047 -1982
- package/src/schemas/v3/compactSkeleton.txt +379 -5
- package/src/schemas/v3/overlays/baspi4.json +164 -21
- package/src/schemas/v3/overlays/baspi5.json +169 -23
- package/src/schemas/v3/overlays/extensions/ac.json +333 -0
- package/src/schemas/v3/overlays/extensions/as.json +4 -2
- package/src/schemas/v3/overlays/extensions/dk.json +32 -0
- package/src/schemas/v3/overlays/extensions/dr.json +9 -9
- package/src/schemas/v3/overlays/extensions/er.json +4 -2
- package/src/schemas/v3/overlays/extensions/fd.json +6 -3
- package/src/schemas/v3/overlays/extensions/hi.json +6 -3
- package/src/schemas/v3/overlays/extensions/hs.json +4 -2
- package/src/schemas/v3/overlays/extensions/ic.json +59 -0
- package/src/schemas/v3/overlays/extensions/jk.json +28 -8
- package/src/schemas/v3/overlays/extensions/la.json +4 -2
- package/src/schemas/v3/overlays/extensions/lc.json +75 -0
- package/src/schemas/v3/overlays/extensions/ma.json +6 -3
- package/src/schemas/v3/overlays/extensions/mc.json +4 -2
- package/src/schemas/v3/overlays/extensions/mi.json +69 -0
- package/src/schemas/v3/overlays/extensions/nd.json +43 -0
- package/src/schemas/v3/overlays/extensions/oa.json +4 -2
- package/src/schemas/v3/overlays/extensions/oc.json +4 -2
- package/src/schemas/v3/overlays/extensions/pc.json +37 -0
- package/src/schemas/v3/overlays/extensions/ph.json +194 -0
- package/src/schemas/v3/overlays/extensions/rw.json +68 -0
- package/src/schemas/v3/overlays/extensions/sb.json +4 -2
- package/src/schemas/v3/overlays/extensions/sc.json +129 -0
- package/src/schemas/v3/overlays/extensions/sd.json +63 -0
- package/src/schemas/v3/overlays/extensions/sf.json +4 -2
- package/src/schemas/v3/overlays/extensions/sl.json +4 -2
- package/src/schemas/v3/overlays/extensions/ta.json +204 -0
- package/src/schemas/v3/overlays/extensions/tf.json +6 -3
- package/src/schemas/v3/overlays/extensions/tr.json +73 -0
- package/src/schemas/v3/overlays/extensions/wg.json +350 -0
- package/src/schemas/v3/overlays/fme1.json +16 -14
- package/src/schemas/v3/overlays/lpe1.json +60 -30
- package/src/schemas/v3/overlays/nts.json +68 -1
- package/src/schemas/v3/overlays/nts2.json +68 -4
- package/src/schemas/v3/overlays/ntsl.json +68 -1
- package/src/schemas/v3/overlays/ntsl2.json +68 -4
- package/src/schemas/v3/overlays/piq.json +39 -4
- package/src/schemas/v3/overlays/rds.json +117 -8
- package/src/schemas/v3/overlays/sef25.json +1639 -0
- package/src/schemas/v3/overlays/ta6.json +46 -16
- package/src/schemas/v3/overlays/ta6ed6.json +6534 -0
- package/src/schemas/v3/overlays/ta7.json +70 -6
- package/src/schemas/v3/overlays/ta7ed5.json +1551 -0
- package/src/schemas/v3/pdtf-transaction.json +4565 -1021
- package/src/schemas/v3/skeleton.json +510 -38
- package/src/utils/extractExtensionOverlays.js +293 -31
- package/src/utils/extractOverlay.js +94 -27
- package/src/utils/pathSkeleton.js +1 -1
- package/.claude/settings.local.json +0 -42
- package/.github/workflows/pages.yml +0 -50
- package/CNAME +0 -1
- package/_config.yml +0 -1
- package/src/tests/v3/caching.test.js +0 -591
- package/src/tests/v3/enquiries.test.js +0 -1096
- package/src/tests/v3/extensionOverlays.test.js +0 -525
- package/src/tests/v3/offers.test.js +0 -823
- package/src/tests/v3/patternProperties.test.js +0 -688
- package/src/tests/v3/transactionSchema.test.js +0 -615
- package/src/tests/v3/verifiedClaimsValidator.test.js +0 -195
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const traverse = require("traverse");
|
|
3
|
+
|
|
4
|
+
const combinedSchema = require("../schemas/v3/combined.json");
|
|
5
|
+
|
|
6
|
+
// Extract fields that have overlay-specific properties
|
|
7
|
+
const extractFields = [
|
|
8
|
+
"baspi4", "baspi5", "nts", "nts2", "ntsl", "ntsl2",
|
|
9
|
+
"ta6", "ta7", "ta7ed5", "ta10", "lpe1", "fme1", "piq",
|
|
10
|
+
"con29R", "con29DW", "llc1", "rds", "oc1", "sr24",
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
// Delete properties we don't want in the skeleton
|
|
14
|
+
const deleteProperties = (sourceSchema, propertyNames) => {
|
|
15
|
+
traverse(sourceSchema).forEach(function (element) {
|
|
16
|
+
if (propertyNames.includes(this.key)) {
|
|
17
|
+
this.delete(true);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return sourceSchema;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Collect all paths in path notation
|
|
24
|
+
const collectPaths = (schema, currentPath = "") => {
|
|
25
|
+
const paths = [];
|
|
26
|
+
|
|
27
|
+
if (!schema || typeof schema !== 'object') {
|
|
28
|
+
return paths;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Handle arrays
|
|
32
|
+
if (schema.type === "array" && schema.items) {
|
|
33
|
+
const arrayPath = currentPath + "[]";
|
|
34
|
+
paths.push(arrayPath);
|
|
35
|
+
// Continue with items
|
|
36
|
+
const itemPaths = collectPaths(schema.items, arrayPath);
|
|
37
|
+
paths.push(...itemPaths);
|
|
38
|
+
return paths;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Handle primitives - add type suffix
|
|
42
|
+
if (schema.type && !schema.properties && !schema.oneOf && !schema.items) {
|
|
43
|
+
let typeChar = "";
|
|
44
|
+
switch(schema.type) {
|
|
45
|
+
case "string": typeChar = ":s"; break;
|
|
46
|
+
case "number": typeChar = ":n"; break;
|
|
47
|
+
case "integer": typeChar = ":i"; break;
|
|
48
|
+
case "boolean": typeChar = ":b"; break;
|
|
49
|
+
default: typeChar = "";
|
|
50
|
+
}
|
|
51
|
+
if (currentPath) {
|
|
52
|
+
paths.push(currentPath + typeChar);
|
|
53
|
+
}
|
|
54
|
+
return paths;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Handle objects with properties
|
|
58
|
+
if (schema.properties) {
|
|
59
|
+
// If this is an object without a path yet, don't add it
|
|
60
|
+
if (currentPath && !schema.type?.includes("array")) {
|
|
61
|
+
paths.push(currentPath);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Object.keys(schema.properties).forEach((propName) => {
|
|
65
|
+
const newPath = currentPath ? `${currentPath}.${propName}` : propName;
|
|
66
|
+
const propPaths = collectPaths(schema.properties[propName], newPath);
|
|
67
|
+
paths.push(...propPaths);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Handle oneOf - collect all possible properties
|
|
72
|
+
if (schema.oneOf) {
|
|
73
|
+
const variantProps = new Set();
|
|
74
|
+
schema.oneOf.forEach((oneOfSchema) => {
|
|
75
|
+
if (oneOfSchema.properties) {
|
|
76
|
+
Object.keys(oneOfSchema.properties).forEach((propName) => {
|
|
77
|
+
variantProps.add(propName);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Process each unique property
|
|
83
|
+
variantProps.forEach((propName) => {
|
|
84
|
+
const newPath = currentPath ? `${currentPath}.${propName}` : propName;
|
|
85
|
+
// Check if all variants have the same type
|
|
86
|
+
let commonType = null;
|
|
87
|
+
let isVariant = false;
|
|
88
|
+
|
|
89
|
+
schema.oneOf.forEach((oneOfSchema) => {
|
|
90
|
+
if (oneOfSchema.properties && oneOfSchema.properties[propName]) {
|
|
91
|
+
const propType = oneOfSchema.properties[propName].type;
|
|
92
|
+
if (commonType === null) {
|
|
93
|
+
commonType = propType;
|
|
94
|
+
} else if (commonType !== propType) {
|
|
95
|
+
isVariant = true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
if (isVariant || !commonType) {
|
|
101
|
+
paths.push(newPath + ":v"); // variant
|
|
102
|
+
} else {
|
|
103
|
+
// Process the first variant's version of this property
|
|
104
|
+
for (const oneOfSchema of schema.oneOf) {
|
|
105
|
+
if (oneOfSchema.properties && oneOfSchema.properties[propName]) {
|
|
106
|
+
const propPaths = collectPaths(oneOfSchema.properties[propName], newPath);
|
|
107
|
+
paths.push(...propPaths);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Empty objects
|
|
116
|
+
if (currentPath && !schema.properties && !schema.oneOf && !schema.items && !schema.type) {
|
|
117
|
+
paths.push(currentPath);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return paths;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// Remove duplicates
|
|
124
|
+
const deduplicatePaths = (paths) => {
|
|
125
|
+
return [...new Set(paths)];
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// Sort paths for readability
|
|
129
|
+
const sortPaths = (paths) => {
|
|
130
|
+
return paths.sort((a, b) => {
|
|
131
|
+
// Sort by depth first (fewer dots = higher up)
|
|
132
|
+
const depthA = (a.match(/\./g) || []).length;
|
|
133
|
+
const depthB = (b.match(/\./g) || []).length;
|
|
134
|
+
if (depthA !== depthB) return depthA - depthB;
|
|
135
|
+
|
|
136
|
+
// Then alphabetically
|
|
137
|
+
return a.localeCompare(b);
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Create clean schema
|
|
142
|
+
const coreSchema = deleteProperties(JSON.parse(JSON.stringify(combinedSchema)), [
|
|
143
|
+
"discriminator",
|
|
144
|
+
...extractFields.map((item) => `${item}Ref`),
|
|
145
|
+
...extractFields.map((item) => `${item}Required`),
|
|
146
|
+
...extractFields.map((item) => `${item}Title`),
|
|
147
|
+
...extractFields.map((item) => `${item}Description`),
|
|
148
|
+
...extractFields.map((item) => `${item}Enum`),
|
|
149
|
+
]);
|
|
150
|
+
|
|
151
|
+
// Remove metadata
|
|
152
|
+
const skeletonSchema = deleteProperties(coreSchema, [
|
|
153
|
+
"$schema", "$id", "title", "description", "required",
|
|
154
|
+
"enum", "minItems", "minLength", "format", "minimum", "maximum",
|
|
155
|
+
]);
|
|
156
|
+
|
|
157
|
+
// Collect paths
|
|
158
|
+
const allPaths = collectPaths(skeletonSchema);
|
|
159
|
+
const uniquePaths = deduplicatePaths(allPaths);
|
|
160
|
+
const sortedPaths = sortPaths(uniquePaths);
|
|
161
|
+
|
|
162
|
+
// Write as text file
|
|
163
|
+
const pathContent = sortedPaths.join('\n');
|
|
164
|
+
fs.writeFileSync("../schemas/v3/pathSkeleton.txt", pathContent);
|
|
165
|
+
|
|
166
|
+
// Also create a JSON version for comparison
|
|
167
|
+
fs.writeFileSync("../schemas/v3/pathSkeleton.json", JSON.stringify(sortedPaths, null, 2));
|
|
168
|
+
|
|
169
|
+
console.log(`Path skeleton written to ../schemas/v3/pathSkeleton.txt`);
|
|
170
|
+
console.log(`Total paths: ${sortedPaths.length}`);
|
|
171
|
+
console.log(`Text size: ${pathContent.length} bytes`);
|
|
172
|
+
|
|
173
|
+
// Count tokens
|
|
174
|
+
try {
|
|
175
|
+
const GPT3Encoder = require('gpt-3-encoder');
|
|
176
|
+
const encoded = GPT3Encoder.encode(pathContent);
|
|
177
|
+
console.log(`Tokens (GPT-3): ${encoded.length}`);
|
|
178
|
+
console.log(`Reduction: ${((1 - encoded.length / 78734) * 100).toFixed(1)}% fewer tokens than JSON skeleton`);
|
|
179
|
+
} catch (e) {
|
|
180
|
+
console.log(`Estimated tokens: ~${Math.ceil(pathContent.length / 4)}`);
|
|
181
|
+
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"role": "Seller",
|
|
21
21
|
"sellersCapacity": { "capacity": "Legal Owner" },
|
|
22
|
-
"externalIds": { "
|
|
22
|
+
"externalIds": { "Platform": "123434" }
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"role": "Seller's Conveyancer",
|
|
@@ -988,7 +988,7 @@
|
|
|
988
988
|
"name": "Example Agency Agreement",
|
|
989
989
|
"url": "https://example.com/example-agency-agreement",
|
|
990
990
|
"externalIds": {
|
|
991
|
-
"
|
|
991
|
+
"Platform": "file123"
|
|
992
992
|
},
|
|
993
993
|
"requiredSignatories": [
|
|
994
994
|
{
|
|
@@ -1027,7 +1027,7 @@
|
|
|
1027
1027
|
"name": "Peter Ronald Hetherington-Smythe",
|
|
1028
1028
|
"signedOn": "2024-11-29T16:15:02.735Z",
|
|
1029
1029
|
"externalIds": {
|
|
1030
|
-
"
|
|
1030
|
+
"Platform": "123434"
|
|
1031
1031
|
},
|
|
1032
1032
|
"role": "Seller",
|
|
1033
1033
|
"contractHash": "IYnBjUI8TauXFop6WCvnPA=="
|