@pdtf/schemas 3.6.0-dev.3 → 3.6.0-dev.30
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/docs/ta6-certificate-permit-contract.md +51 -0
- package/docs/v4-mapping-and-recomposition.md +419 -0
- package/index.js +210 -0
- package/package.json +10 -1
- package/src/schemas/v3/combined.json +2261 -657
- package/src/schemas/v3/compactSkeleton.txt +120 -51
- package/src/schemas/v3/overlays/baspi4.json +54 -74
- package/src/schemas/v3/overlays/baspi5.json +54 -74
- package/src/schemas/v3/overlays/extensions/ac.json +2 -1
- package/src/schemas/v3/overlays/extensions/dk.json +3 -2
- package/src/schemas/v3/overlays/extensions/fd.json +2 -1
- package/src/schemas/v3/overlays/extensions/ic.json +44 -9
- package/src/schemas/v3/overlays/extensions/lc.json +3 -2
- package/src/schemas/v3/overlays/extensions/mi.json +2 -1
- package/src/schemas/v3/overlays/extensions/nd.json +3 -2
- package/src/schemas/v3/overlays/extensions/pc.json +3 -2
- package/src/schemas/v3/overlays/extensions/ph.json +2 -1
- package/src/schemas/v3/overlays/extensions/rw.json +4 -3
- package/src/schemas/v3/overlays/extensions/sc.json +8 -4
- package/src/schemas/v3/overlays/extensions/sd.json +3 -2
- package/src/schemas/v3/overlays/extensions/tr.json +3 -2
- package/src/schemas/v3/overlays/extensions/wg.json +2 -1
- package/src/schemas/v3/overlays/llc1.json +1 -2
- package/src/schemas/v3/overlays/lpe1.json +3 -2
- package/src/schemas/v3/overlays/nts.json +7 -3
- package/src/schemas/v3/overlays/nts2.json +9 -4
- package/src/schemas/v3/overlays/ntsl.json +5 -2
- package/src/schemas/v3/overlays/ntsl2.json +7 -3
- package/src/schemas/v3/overlays/piq.json +34 -25
- package/src/schemas/v3/overlays/rds.json +24 -50
- package/src/schemas/v3/overlays/sef25.json +16 -2
- package/src/schemas/v3/overlays/ta10.json +0 -9
- package/src/schemas/v3/overlays/ta6.json +39 -70
- package/src/schemas/v3/overlays/ta6ed6.json +331 -307
- package/{pensive-tesla-d0d355/src/schemas/v3/overlays/ta6.json → src/schemas/v3/overlays/ta6ed6v2.json} +1574 -1464
- package/src/schemas/v3/overlays/ta7.json +2 -1
- package/src/schemas/v3/overlays/ta7ed5.json +68 -21
- package/src/schemas/v3/pdtf-transaction.json +1030 -492
- package/src/schemas/v3/skeleton.json +163 -57
- package/src/schemas/v4/Gift.json +88 -0
- package/src/schemas/v4/Offer.json +425 -0
- package/src/schemas/v4/Organisation.json +167 -0
- package/src/schemas/v4/Person.json +321 -0
- package/src/schemas/v4/Property.json +27813 -0
- package/src/schemas/v4/Representation.json +67 -0
- package/src/schemas/v4/SellerCapacity.json +193 -0
- package/src/schemas/v4/Title.json +14660 -0
- package/src/schemas/v4/Transaction.json +1612 -0
- package/src/schemas/v4/TransactionRole.json +59 -0
- package/src/schemas/v4/mapping.json +1161 -0
- package/src/utils/checkTa6OmissionCompatibility.js +146 -0
- package/src/utils/extractExtensionOverlays.js +11 -2
- package/src/utils/extractOverlay.js +21 -0
- package/src/utils/generateV4Schemas.js +1358 -0
- package/src/utils/syncTa6ed6v2Markers.js +92 -0
- package/src/utils/v4.js +838 -0
- package/CLAUDE.md +0 -101
- package/pensive-tesla-d0d355/CLAUDE.md +0 -101
- package/pensive-tesla-d0d355/LICENSE +0 -21
- package/pensive-tesla-d0d355/README.md +0 -435
- package/pensive-tesla-d0d355/docs/branch-release-workflow.md +0 -138
- package/pensive-tesla-d0d355/docs/sef25-extensions-ui-spec.md +0 -355
- package/pensive-tesla-d0d355/index.js +0 -654
- package/pensive-tesla-d0d355/package-lock.json +0 -7297
- package/pensive-tesla-d0d355/package.json +0 -44
- package/pensive-tesla-d0d355/src/examples/v1/exampleAddParticipantVouch.json +0 -32
- package/pensive-tesla-d0d355/src/examples/v1/exampleDocumentedVouch.json +0 -40
- package/pensive-tesla-d0d355/src/examples/v1/exampleElectronicRecord.json +0 -30
- package/pensive-tesla-d0d355/src/examples/v1/exampleTransaction.json +0 -878
- package/pensive-tesla-d0d355/src/examples/v1/exampleVouch.json +0 -25
- package/pensive-tesla-d0d355/src/examples/v2/exampleTransaction.json +0 -901
- package/pensive-tesla-d0d355/src/examples/v3/exampleAddParticipantVouch.json +0 -38
- package/pensive-tesla-d0d355/src/examples/v3/exampleCustomOverlay.json +0 -55
- package/pensive-tesla-d0d355/src/examples/v3/exampleCustomOverlay2.json +0 -93
- package/pensive-tesla-d0d355/src/examples/v3/exampleDocumentedVouch.json +0 -47
- package/pensive-tesla-d0d355/src/examples/v3/exampleElectronicRecord.json +0 -36
- package/pensive-tesla-d0d355/src/examples/v3/exampleTransaction.json +0 -1038
- package/pensive-tesla-d0d355/src/examples/v3/exampleVouch.json +0 -32
- package/pensive-tesla-d0d355/src/mappings/SendPropertyDetailsRequestSchema.json +0 -1588
- package/pensive-tesla-d0d355/src/mappings/adf.js +0 -198
- package/pensive-tesla-d0d355/src/schemas/v1/GeoJSON.json +0 -1279
- package/pensive-tesla-d0d355/src/schemas/v1/baspiNotes.html +0 -102
- package/pensive-tesla-d0d355/src/schemas/v1/energy-performance-certificate.json +0 -124
- package/pensive-tesla-d0d355/src/schemas/v1/freehold-information.json +0 -2051
- package/pensive-tesla-d0d355/src/schemas/v1/leasehold-information.json +0 -2064
- package/pensive-tesla-d0d355/src/schemas/v1/legal-information.json +0 -1045
- package/pensive-tesla-d0d355/src/schemas/v1/material-facts.json +0 -2109
- package/pensive-tesla-d0d355/src/schemas/v1/pdtf-transaction-search-results.json +0 -40
- package/pensive-tesla-d0d355/src/schemas/v1/pdtf-transaction.json +0 -191
- package/pensive-tesla-d0d355/src/schemas/v1/searches/drainage-and-water.json +0 -261
- package/pensive-tesla-d0d355/src/schemas/v1/searches/local-land-charges.json +0 -69
- package/pensive-tesla-d0d355/src/schemas/v1/searches/local-searches-required.json +0 -857
- package/pensive-tesla-d0d355/src/schemas/v1/searches.json +0 -237
- package/pensive-tesla-d0d355/src/schemas/v1/title-deed.json +0 -841
- package/pensive-tesla-d0d355/src/schemas/v2/baspiNotes.html +0 -102
- package/pensive-tesla-d0d355/src/schemas/v2/combined.json +0 -37731
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/baspi.json +0 -8132
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/con29DW.json +0 -705
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/con29R.json +0 -2956
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/fme1.json +0 -1259
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/llc1.json +0 -25
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/lpe1.json +0 -2171
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/nts.json +0 -326
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/oc1.json +0 -2799
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/piq.json +0 -3419
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/rds.json +0 -3736
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta10.json +0 -5306
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta6.json +0 -4533
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta7.json +0 -1045
- package/pensive-tesla-d0d355/src/schemas/v2/pdtf-transaction.json +0 -34351
- package/pensive-tesla-d0d355/src/schemas/v2/skeleton.json +0 -3973
- package/pensive-tesla-d0d355/src/schemas/v3/combined.json +0 -48469
- package/pensive-tesla-d0d355/src/schemas/v3/compactSkeleton.txt +0 -4519
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/README.md +0 -299
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/baspi4.json +0 -8025
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/baspi5.json +0 -8175
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/con29DW.json +0 -716
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/con29R.json +0 -2981
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ac.json +0 -333
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/as.json +0 -74
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/dk.json +0 -32
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/dr.json +0 -73
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/er.json +0 -85
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/fd.json +0 -75
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/hi.json +0 -51
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/hs.json +0 -73
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ic.json +0 -59
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/jk.json +0 -96
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/la.json +0 -85
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/lc.json +0 -75
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ma.json +0 -90
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/mc.json +0 -38
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/mi.json +0 -69
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/nd.json +0 -43
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/oa.json +0 -24
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/oc.json +0 -57
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/pc.json +0 -37
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ph.json +0 -194
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/rw.json +0 -68
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sb.json +0 -73
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sc.json +0 -129
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sd.json +0 -63
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sf.json +0 -74
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sl.json +0 -68
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ta.json +0 -252
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/tf.json +0 -103
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/tr.json +0 -73
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/wg.json +0 -350
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/fme1.json +0 -1266
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/llc1.json +0 -25
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/lpe1.json +0 -2199
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/nts.json +0 -2157
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/nts2.json +0 -2742
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ntsl.json +0 -1813
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ntsl2.json +0 -2217
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/oc1.json +0 -2817
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/piq.json +0 -3322
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/rds.json +0 -3665
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/sef25.json +0 -1639
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/sr24.json +0 -38
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta10.json +0 -4654
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta6ed6.json +0 -6534
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta7.json +0 -1537
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta7ed5.json +0 -1551
- package/pensive-tesla-d0d355/src/schemas/v3/pdtf-transaction.json +0 -41573
- package/pensive-tesla-d0d355/src/schemas/v3/skeleton.json +0 -5767
- package/pensive-tesla-d0d355/src/schemas/verifiedClaims/README.md +0 -21
- package/pensive-tesla-d0d355/src/schemas/verifiedClaims/pdtf-verified-claims.json +0 -447
- package/pensive-tesla-d0d355/src/utils/compactSkeleton.js +0 -84
- package/pensive-tesla-d0d355/src/utils/countTokens.js +0 -67
- package/pensive-tesla-d0d355/src/utils/extractExtensionOverlays.js +0 -624
- package/pensive-tesla-d0d355/src/utils/extractOverlay.js +0 -381
- package/pensive-tesla-d0d355/src/utils/extractProperties.js +0 -44
- package/pensive-tesla-d0d355/src/utils/listPathTitles.js +0 -36
- package/pensive-tesla-d0d355/src/utils/minimalSkeleton.js +0 -85
- package/pensive-tesla-d0d355/src/utils/pathList.csv +0 -903
- package/pensive-tesla-d0d355/src/utils/pathSkeleton.js +0 -181
- package/src/examples/v1/exampleAddParticipantVouch.json +0 -32
- package/src/examples/v1/exampleDocumentedVouch.json +0 -40
- package/src/examples/v1/exampleElectronicRecord.json +0 -30
- package/src/examples/v1/exampleTransaction.json +0 -878
- package/src/examples/v1/exampleVouch.json +0 -25
- package/src/examples/v2/exampleTransaction.json +0 -901
- package/src/examples/v3/exampleAddParticipantVouch.json +0 -38
- package/src/examples/v3/exampleCustomOverlay.json +0 -55
- package/src/examples/v3/exampleCustomOverlay2.json +0 -93
- package/src/examples/v3/exampleDocumentedVouch.json +0 -47
- package/src/examples/v3/exampleElectronicRecord.json +0 -36
- package/src/examples/v3/exampleTransaction.json +0 -1038
- package/src/examples/v3/exampleVouch.json +0 -32
- package/src/mappings/SendPropertyDetailsRequestSchema.json +0 -1588
- package/src/mappings/adf.js +0 -198
|
@@ -1,181 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"verification": {
|
|
3
|
-
"trust_framework": "uk_pdtf",
|
|
4
|
-
"time": "2022-01-25T13:05:03.108Z",
|
|
5
|
-
"evidence": [
|
|
6
|
-
{
|
|
7
|
-
"type": "vouch",
|
|
8
|
-
"attestation": {
|
|
9
|
-
"type": "digital_attestation",
|
|
10
|
-
"voucher": {
|
|
11
|
-
"name": "Martin Abode"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"verification_method": {
|
|
15
|
-
"type": "auth"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
"claims": {
|
|
21
|
-
"/participants/-": {
|
|
22
|
-
"name": {
|
|
23
|
-
"firstName": "Martin",
|
|
24
|
-
"lastName": "Abode"
|
|
25
|
-
},
|
|
26
|
-
"email": "martin@abode.co.uk",
|
|
27
|
-
"organisation": "Abode and Floggit Estate Agents",
|
|
28
|
-
"organisationReference": "MAR/12243/22",
|
|
29
|
-
"role": "Estate Agent"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"verification": {
|
|
3
|
-
"trust_framework": "uk_pdtf",
|
|
4
|
-
"time": "2022-01-25T13:16:44.527Z",
|
|
5
|
-
"evidence": [
|
|
6
|
-
{
|
|
7
|
-
"type": "vouch",
|
|
8
|
-
"attachments": [
|
|
9
|
-
{
|
|
10
|
-
"digest": {
|
|
11
|
-
"alg": "md5",
|
|
12
|
-
"value": "randomHashValue"
|
|
13
|
-
},
|
|
14
|
-
"url": "https://fakeFileStore.com/some/kind/of/file",
|
|
15
|
-
"desc": "proofOfAddress.pdf",
|
|
16
|
-
"pdtfSchemaPath": "/propertyPack/materialFacts/councilTax/councilTaxAffectingAlterations/details"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"verification_method": {
|
|
20
|
-
"type": "auth"
|
|
21
|
-
},
|
|
22
|
-
"attestation": {
|
|
23
|
-
"voucher": {
|
|
24
|
-
"name": "Maria Harris"
|
|
25
|
-
},
|
|
26
|
-
"type": "digital_attestation"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
"claims": {
|
|
32
|
-
"/propertyPack/materialFacts/councilTax": {
|
|
33
|
-
"councilTaxBand": "D",
|
|
34
|
-
"councilTaxAffectingAlterations": {
|
|
35
|
-
"yesNo": "Yes",
|
|
36
|
-
"details": "Extension added in 2005 to add bedroom with ensuite shower room. Certificate of Compliance issued 17th Feb 2006 and council tax updated"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"verification": {
|
|
3
|
-
"time": "2022-01-25T07:52:14.318Z",
|
|
4
|
-
"trust_framework": "uk_pdtf",
|
|
5
|
-
"evidence": [
|
|
6
|
-
{
|
|
7
|
-
"type": "electronic_record",
|
|
8
|
-
"verifier": {
|
|
9
|
-
"organization": "Property Pack Assembly Software Ltd"
|
|
10
|
-
},
|
|
11
|
-
"record": {
|
|
12
|
-
"source": {
|
|
13
|
-
"name": "Royal Mail Postcode Address File",
|
|
14
|
-
"rights": "(c) Royal Mail"
|
|
15
|
-
},
|
|
16
|
-
"type": "postcode_address_file"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
"claims": {
|
|
22
|
-
"/propertyPack/materialFacts/address": {
|
|
23
|
-
"line1": "3 The Hollys",
|
|
24
|
-
"line2": "Birtley",
|
|
25
|
-
"town": "CHESTER LE STREET",
|
|
26
|
-
"county": "County Durham",
|
|
27
|
-
"postcode": "DH3 1QN"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|