@pdtf/schemas 3.4.1-8 → 3.5.1-1
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/settings.local.json +8 -1
- package/README.md +75 -56
- package/package.json +1 -1
- package/src/examples/v3/exampleDocumentedVouch.json +1 -0
- package/src/examples/v3/exampleVouch.json +1 -0
- package/src/schemas/v3/combined.json +1497 -4
- package/src/schemas/v3/compactSkeleton.txt +0 -15
- package/src/schemas/v3/pdtf-transaction.json +2609 -4
- package/src/schemas/v3/skeleton.json +0 -22
- package/src/schemas/verifiedClaims/README.md +12 -3
- package/src/schemas/verifiedClaims/pdtf-verified-claims.json +21 -0
- package/src/tests/v3/verifiedClaimsValidator.test.js +67 -0
- package/src/utils/extractOverlay.js +1 -1
- package/src/schemas/v3/property-transaction-milestones.json +0 -91
|
@@ -13,7 +13,14 @@
|
|
|
13
13
|
"Bash(git merge:*)",
|
|
14
14
|
"Bash(git add:*)",
|
|
15
15
|
"Bash(git commit:*)",
|
|
16
|
-
"Bash(git push:*)"
|
|
16
|
+
"Bash(git push:*)",
|
|
17
|
+
"Bash(git fetch:*)",
|
|
18
|
+
"Bash(git checkout:*)",
|
|
19
|
+
"Bash(gh pr view:*)",
|
|
20
|
+
"WebFetch(domain:github.com)",
|
|
21
|
+
"Bash(tree:*)",
|
|
22
|
+
"Bash(sed:*)",
|
|
23
|
+
"Bash(find:*)"
|
|
17
24
|
],
|
|
18
25
|
"deny": []
|
|
19
26
|
}
|
package/README.md
CHANGED
|
@@ -7,18 +7,20 @@ The Property Data Trust Framework (PDTF) Schemas provide standardized JSON Schem
|
|
|
7
7
|
|
|
8
8
|
## Project Goals & Status
|
|
9
9
|
|
|
10
|
-
**Current Version:** 3.
|
|
10
|
+
**Current Version:** 3.5.0 (3.5.1-1 available as a pre-release on branch/package-tag `next`)
|
|
11
11
|
|
|
12
12
|
This schema framework aims to support the [Home Buying and Selling Group](https://homebuyingandsellinggroup.co.uk) 'Property Pack' initiative, encompassing all requirements starting with the Buyers and Sellers Property Information set ([BASPI v4.0](https://homebuyingandsellinggroup.co.uk/baspi/)).
|
|
13
13
|
|
|
14
14
|
**Key Objectives:**
|
|
15
|
+
|
|
15
16
|
- 🏠 **Standardize** residential property data exchange across England and Wales
|
|
16
|
-
- 🔗 **Enable** frictionless data sharing between software products and services
|
|
17
|
+
- 🔗 **Enable** frictionless data sharing between software products and services
|
|
17
18
|
- 🛡️ **Maintain** trusted information about data provenance and verification
|
|
18
19
|
- 📋 **Support** industry-standard forms (BASPI, NTS, Law Society TA forms)
|
|
19
20
|
- 🧩 **Provide** modular components for flexible implementation
|
|
20
21
|
|
|
21
22
|
**Related Projects:**
|
|
23
|
+
|
|
22
24
|
- [API Specifications](https://github.com/Property-Data-Trust-Framework/api) - OpenAPI specs for data exchange protocols
|
|
23
25
|
- [PDTF Website](https://trust.propdata.org.uk) - Official framework documentation
|
|
24
26
|
|
|
@@ -35,7 +37,7 @@ npm install @pdtf/schemas
|
|
|
35
37
|
### Basic Usage
|
|
36
38
|
|
|
37
39
|
```javascript
|
|
38
|
-
const { getTransactionSchema, getValidator } = require(
|
|
40
|
+
const { getTransactionSchema, getValidator } = require("@pdtf/schemas");
|
|
39
41
|
|
|
40
42
|
// Get a schema with BASPI v5 overlay
|
|
41
43
|
const schema = getTransactionSchema(
|
|
@@ -45,14 +47,14 @@ const schema = getTransactionSchema(
|
|
|
45
47
|
|
|
46
48
|
// Create a validator
|
|
47
49
|
const validator = getValidator(
|
|
48
|
-
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
50
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
49
51
|
["baspiV5"]
|
|
50
52
|
);
|
|
51
53
|
|
|
52
54
|
// Validate data
|
|
53
55
|
const isValid = validator(propertyData);
|
|
54
56
|
if (!isValid) {
|
|
55
|
-
console.log(
|
|
57
|
+
console.log("Validation errors:", validator.errors);
|
|
56
58
|
}
|
|
57
59
|
```
|
|
58
60
|
|
|
@@ -122,6 +124,7 @@ const schema = getTransactionSchema(
|
|
|
122
124
|
```
|
|
123
125
|
|
|
124
126
|
**Parameters:**
|
|
127
|
+
|
|
125
128
|
- `schemaId` (string): Schema version URL
|
|
126
129
|
- `overlays` (array): Array of overlay names or objects
|
|
127
130
|
|
|
@@ -146,15 +149,15 @@ const errors = validateVerifiedClaims(verifiedClaims, schemaId, ["nts2023"]);
|
|
|
146
149
|
|
|
147
150
|
#### Main Form Overlays
|
|
148
151
|
|
|
149
|
-
| Overlay
|
|
150
|
-
|
|
151
|
-
| `baspiV4` | Buyers and Sellers Property Information | v4.0
|
|
152
|
-
| `baspiV5` | Buyers and Sellers Property Information | v5.0
|
|
153
|
-
| `nts2023` | National Trading Standards
|
|
154
|
-
| `nts2025` | National Trading Standards
|
|
155
|
-
| `ta6ed4`
|
|
156
|
-
| `ta7ed3`
|
|
157
|
-
| `ta10ed3` | Law Society Fittings and Contents Form
|
|
152
|
+
| Overlay | Description | Version |
|
|
153
|
+
| --------- | --------------------------------------- | --------- |
|
|
154
|
+
| `baspiV4` | Buyers and Sellers Property Information | v4.0 |
|
|
155
|
+
| `baspiV5` | Buyers and Sellers Property Information | v5.0 |
|
|
156
|
+
| `nts2023` | National Trading Standards | 2023 |
|
|
157
|
+
| `nts2025` | National Trading Standards | 2025 |
|
|
158
|
+
| `ta6ed4` | Law Society Property Information Form | Edition 4 |
|
|
159
|
+
| `ta7ed3` | Law Society Leasehold Information Form | Edition 3 |
|
|
160
|
+
| `ta10ed3` | Law Society Fittings and Contents Form | Edition 3 |
|
|
158
161
|
|
|
159
162
|
[View all overlays →](src/schemas/v3/overlays/README.md)
|
|
160
163
|
|
|
@@ -167,16 +170,22 @@ Modular NTS2 features for selective adoption:
|
|
|
167
170
|
const schema = getTransactionSchema(schemaId, ["nts2023", "jk", "tf"]);
|
|
168
171
|
|
|
169
172
|
// Multiple specialist issues
|
|
170
|
-
const schema = getTransactionSchema(schemaId, [
|
|
173
|
+
const schema = getTransactionSchema(schemaId, [
|
|
174
|
+
"nts2023",
|
|
175
|
+
"as",
|
|
176
|
+
"dr",
|
|
177
|
+
"jk",
|
|
178
|
+
"sb",
|
|
179
|
+
]);
|
|
171
180
|
```
|
|
172
181
|
|
|
173
|
-
| Extension
|
|
174
|
-
|
|
182
|
+
| Extension | Code | Description |
|
|
183
|
+
| ----------------- | ---- | -------------------------------- |
|
|
175
184
|
| Japanese Knotweed | `jk` | Knotweed presence and management |
|
|
176
|
-
| Transfer Fees
|
|
177
|
-
| Managing Agent
|
|
178
|
-
| Solar Panels
|
|
179
|
-
| Asbestos
|
|
185
|
+
| Transfer Fees | `tf` | Additional leasehold fees |
|
|
186
|
+
| Managing Agent | `ma` | Leasehold managing agent details |
|
|
187
|
+
| Solar Panels | `sl` | Solar panel ownership details |
|
|
188
|
+
| Asbestos | `as` | Asbestos presence and management |
|
|
180
189
|
|
|
181
190
|
[View all extensions →](src/schemas/v3/overlays/README.md#extension-overlays)
|
|
182
191
|
|
|
@@ -200,22 +209,27 @@ const ntsSchema = getTransactionSchema(schemaId, ["nts2023"]);
|
|
|
200
209
|
```javascript
|
|
201
210
|
// Selective NTS2 adoption
|
|
202
211
|
const partialNts2 = getTransactionSchema(schemaId, [
|
|
203
|
-
"nts2023",
|
|
204
|
-
"jk",
|
|
205
|
-
"tf",
|
|
206
|
-
"ma"
|
|
212
|
+
"nts2023", // Base NTS
|
|
213
|
+
"jk", // Japanese Knotweed
|
|
214
|
+
"tf", // Transfer Fees
|
|
215
|
+
"ma", // Managing Agent
|
|
207
216
|
]);
|
|
208
217
|
|
|
209
218
|
// Full specialist issues
|
|
210
219
|
const specialistIssues = getTransactionSchema(schemaId, [
|
|
211
|
-
"nts2023",
|
|
220
|
+
"nts2023",
|
|
221
|
+
"as",
|
|
222
|
+
"dr",
|
|
223
|
+
"jk",
|
|
224
|
+
"sb",
|
|
225
|
+
"hs",
|
|
212
226
|
]);
|
|
213
227
|
```
|
|
214
228
|
|
|
215
229
|
### Data Validation
|
|
216
230
|
|
|
217
231
|
```javascript
|
|
218
|
-
const { getValidator } = require(
|
|
232
|
+
const { getValidator } = require("@pdtf/schemas");
|
|
219
233
|
|
|
220
234
|
const validator = getValidator(schemaId, ["baspiV5"]);
|
|
221
235
|
|
|
@@ -223,16 +237,16 @@ const propertyData = {
|
|
|
223
237
|
propertyPack: {
|
|
224
238
|
priceInformation: {
|
|
225
239
|
price: 350000,
|
|
226
|
-
priceQualifier: "Freehold"
|
|
240
|
+
priceQualifier: "Freehold",
|
|
227
241
|
},
|
|
228
242
|
// ... more property data
|
|
229
|
-
}
|
|
243
|
+
},
|
|
230
244
|
};
|
|
231
245
|
|
|
232
246
|
if (validator(propertyData)) {
|
|
233
|
-
console.log(
|
|
247
|
+
console.log("✅ Data is valid");
|
|
234
248
|
} else {
|
|
235
|
-
console.log(
|
|
249
|
+
console.log("❌ Validation errors:", validator.errors);
|
|
236
250
|
}
|
|
237
251
|
```
|
|
238
252
|
|
|
@@ -241,39 +255,44 @@ if (validator(propertyData)) {
|
|
|
241
255
|
PDTF supports verified claims to maintain data provenance and trust throughout property transactions. Claims package specific property data with verification evidence, enabling traceability back to authoritative sources.
|
|
242
256
|
|
|
243
257
|
```javascript
|
|
244
|
-
const { validateVerifiedClaims } = require(
|
|
258
|
+
const { validateVerifiedClaims } = require("@pdtf/schemas");
|
|
245
259
|
|
|
246
260
|
// Current verified claims format
|
|
247
|
-
const verifiedClaims = [
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
261
|
+
const verifiedClaims = [
|
|
262
|
+
{
|
|
263
|
+
id: "claim-12345",
|
|
264
|
+
transactionId: "txn-67890",
|
|
265
|
+
schemaVersion: "3.4.0",
|
|
266
|
+
verification: {
|
|
267
|
+
trust_framework: "uk_pdtf",
|
|
268
|
+
time: "2024-07-01T10:30:00Z",
|
|
269
|
+
evidence: [
|
|
270
|
+
{
|
|
271
|
+
type: "vouch",
|
|
272
|
+
attestation: {
|
|
273
|
+
type: "digital_attestation",
|
|
274
|
+
voucher: { name: "Estate Agent Ltd" },
|
|
275
|
+
},
|
|
276
|
+
verification_method: { type: "auth" },
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
claims: {
|
|
281
|
+
"/propertyPack/priceInformation/price": 350000,
|
|
282
|
+
"/propertyPack/energyEfficiency/epcRating": "C",
|
|
283
|
+
},
|
|
262
284
|
},
|
|
263
|
-
|
|
264
|
-
"/propertyPack/priceInformation/price": 350000,
|
|
265
|
-
"/propertyPack/energyEfficiency/epcRating": "C"
|
|
266
|
-
}
|
|
267
|
-
}];
|
|
285
|
+
];
|
|
268
286
|
|
|
269
287
|
// Validate claims against schema
|
|
270
288
|
const errors = validateVerifiedClaims(verifiedClaims, schemaId, ["baspiV5"]);
|
|
271
289
|
if (errors.length === 0) {
|
|
272
|
-
console.log(
|
|
290
|
+
console.log("✅ Verified claims are valid");
|
|
273
291
|
}
|
|
274
292
|
```
|
|
275
293
|
|
|
276
294
|
**Key Features:**
|
|
295
|
+
|
|
277
296
|
- **Schema Path Validation** - Claims reference specific schema paths (e.g., `/propertyPack/priceInformation/price`)
|
|
278
297
|
- **Provenance Tracking** - Each claim includes verification evidence and source attribution
|
|
279
298
|
- **Trust Framework Integration** - Claims operate within the UK PDTF trust framework
|
|
@@ -281,6 +300,7 @@ if (errors.length === 0) {
|
|
|
281
300
|
|
|
282
301
|
**Roadmap - W3C Verifiable Credentials:**
|
|
283
302
|
The next version of the PDTF framework will migrate to [W3C Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) to provide:
|
|
303
|
+
|
|
284
304
|
- **Enhanced Security** - Cryptographically signed claims with tamper detection
|
|
285
305
|
- **Granular Permissions** - Fine-grained access control over claim data
|
|
286
306
|
- **Interoperability** - Standards-based approach for broader ecosystem compatibility
|
|
@@ -311,17 +331,17 @@ npm test -- --testPathPattern=extensionOverlays
|
|
|
311
331
|
npm test -- --testPathPattern=transactionSchema
|
|
312
332
|
```
|
|
313
333
|
|
|
314
|
-
|
|
315
334
|
## Versioning
|
|
316
335
|
|
|
317
336
|
The schema follows semantic versioning:
|
|
337
|
+
|
|
318
338
|
- **Patch** (3.4.x): Bug fixes, no breaking changes
|
|
319
339
|
- **Minor** (3.x.0): New fields, backward compatible
|
|
320
340
|
- **Major** (x.0.0): Breaking changes, migration required
|
|
321
341
|
|
|
322
342
|
## Licensing
|
|
323
343
|
|
|
324
|
-
Licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
|
344
|
+
Licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
|
325
345
|
|
|
326
346
|
**Important:** Overlays contain fields from licensed forms ([BASPI](https://homebuyingsellingcouncil.co.uk/wp-content/uploads/2021/03/Terms-of-Licence-mandatory-download-for-use-of-BASPI.pdf), [PIQ](https://www.propertymark.co.uk/static/14e7c154-98de-4230-957f09bd8d5ddeec/f542b10a-7710-4c37-b3958ccaeec25d4b/property-information-questionnaire-residential-sales.pdf), [Law Society TA](https://www.lawsociety.org.uk/topics/property/transaction-forms)). When rendering data into these forms, ensure compliance with their respective license terms.
|
|
327
347
|
|
|
@@ -331,4 +351,3 @@ Licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
|
|
331
351
|
- 📁 [Example Files](src/examples/)
|
|
332
352
|
- 🐛 [Issue Tracker](https://github.com/Property-Data-Trust-Framework/schemas/issues)
|
|
333
353
|
- 🌐 [PDTF Website](https://trust.propdata.org.uk)
|
|
334
|
-
|
package/package.json
CHANGED