@pdtf/schemas 3.5.1-2 → 3.5.1-4

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/README.md CHANGED
@@ -277,6 +277,9 @@ const verifiedClaims = [
277
277
  },
278
278
  ],
279
279
  },
280
+ terms_of_use: {
281
+ confidentiality_level: "public",
282
+ },
280
283
  claims: {
281
284
  "/propertyPack/priceInformation/price": 350000,
282
285
  "/propertyPack/energyEfficiency/epcRating": "C",
@@ -297,6 +300,61 @@ if (errors.length === 0) {
297
300
  - **Provenance Tracking** - Each claim includes verification evidence and source attribution
298
301
  - **Trust Framework Integration** - Claims operate within the UK PDTF trust framework
299
302
  - **Attachment Support** - Supporting documents can be cryptographically linked to claims
303
+ - **Confidentiality Controls** - Terms of use define access levels and permitted recipients
304
+
305
+ #### Confidentiality Levels
306
+
307
+ Verified claims support three confidentiality levels through a pdtf-specific extension: a `terms_of_use` field, enabling fine-grained access control:
308
+
309
+ **Public Data** - Freely accessible data from official sources or public listing information:
310
+
311
+ ```javascript
312
+ {
313
+ terms_of_use: {
314
+ confidentiality_level: "public";
315
+ }
316
+ }
317
+ ```
318
+
319
+ Examples: Land Registry data, Energy Performance Certificates, planning records, council tax information
320
+
321
+ **Restricted Data** - Limited to transaction participants:
322
+
323
+ ```javascript
324
+ {
325
+ terms_of_use: {
326
+ confidentiality_level: "restricted";
327
+ }
328
+ }
329
+ ```
330
+
331
+ Examples: Commercial property reports, contents of legal forms
332
+
333
+ **Confidential Data** - Role-based access with explicit authorization:
334
+
335
+ ```javascript
336
+ {
337
+ terms_of_use: {
338
+ confidentiality_level: "confidential",
339
+ allowed_roles: [
340
+ "Estate Agent",
341
+ "Seller's Conveyancer",
342
+ "Buyer's Conveyancer",
343
+ "Mortgage Broker",
344
+ "Lender"
345
+ ]
346
+ }
347
+ }
348
+ ```
349
+
350
+ Examples: Identity verification reports, anti-money laundering checks, sensitive personal information
351
+
352
+ **Guidelines:**
353
+
354
+ - Use **public** for government/official data sources
355
+ - Use **restricted** for commercial data providers and processed information
356
+ - Use **confidential** for sensitive personal data requiring explicit role authorization
357
+ - Always consider data source and sensitivity when assigning levels
300
358
 
301
359
  **Roadmap - W3C Verifiable Credentials:**
302
360
  The next version of the PDTF framework will migrate to [W3C Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) to provide:
package/index.js CHANGED
@@ -208,9 +208,30 @@ const getCachedSchemaData = (path, schemaId, overlays) => {
208
208
  if (pathArray.length >= 1) {
209
209
  subSchema = pathArray.reduce((schema, pathElement) => {
210
210
  if (!schema) return undefined;
211
- const { type, items, properties, oneOf } = schema;
211
+ const { type, items, properties, patternProperties, oneOf } = schema;
212
+
213
+ // Check array type
212
214
  if (type === "array") return items;
215
+
216
+ // Check explicit properties first
213
217
  if (properties?.[pathElement]) return properties[pathElement];
218
+
219
+ // Check patternProperties
220
+ if (patternProperties) {
221
+ for (const pattern in patternProperties) {
222
+ try {
223
+ const regex = new RegExp(pattern);
224
+ if (regex.test(pathElement)) {
225
+ return patternProperties[pattern];
226
+ }
227
+ } catch (e) {
228
+ // Invalid regex pattern in schema - skip it
229
+ console.warn(`Invalid regex pattern in patternProperties: ${pattern}`, e);
230
+ }
231
+ }
232
+ }
233
+
234
+ // Check oneOf discriminators
214
235
  if (oneOf) {
215
236
  let matchingProperty;
216
237
  oneOf.forEach((aOneOf) => {
@@ -222,6 +243,7 @@ const getCachedSchemaData = (path, schemaId, overlays) => {
222
243
  });
223
244
  if (matchingProperty) return matchingProperty;
224
245
  }
246
+
225
247
  return undefined;
226
248
  }, sourceSchema);
227
249
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdtf/schemas",
3
- "version": "3.5.1-2",
3
+ "version": "3.5.1-4",
4
4
  "description": "Property Data Trust Framework Schemas and Utilities",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -20,6 +20,9 @@
20
20
  }
21
21
  ]
22
22
  },
23
+ "terms_of_use": {
24
+ "confidentiality_level": "restricted"
25
+ },
23
26
  "claims": {
24
27
  "/participants/-": {
25
28
  "name": {
@@ -32,6 +32,9 @@
32
32
  }
33
33
  ]
34
34
  },
35
+ "terms_of_use": {
36
+ "confidentiality_level": "public"
37
+ },
35
38
  "claims": {
36
39
  "/propertyPack/councilTax": {
37
40
  "councilTaxBand": "D",
@@ -21,6 +21,9 @@
21
21
  }
22
22
  ]
23
23
  },
24
+ "terms_of_use": {
25
+ "confidentiality_level": "public"
26
+ },
24
27
  "claims": {
25
28
  "/propertyPack/address": {
26
29
  "line1": "3 The Hollys",
@@ -21,6 +21,9 @@
21
21
  }
22
22
  ]
23
23
  },
24
+ "terms_of_use": {
25
+ "confidentiality_level": "restricted"
26
+ },
24
27
  "claims": {
25
28
  "/propertyPack/delayFactors/hasDelayFactors": {
26
29
  "yesNo": "No"
@@ -259,7 +259,6 @@
259
259
  "properties": {
260
260
  "role": {
261
261
  "enum": [
262
- "Buyer",
263
262
  "Seller's Conveyancer",
264
263
  "Prospective Buyer",
265
264
  "Buyer's Conveyancer",
@@ -274,6 +273,18 @@
274
273
  }
275
274
  }
276
275
  },
276
+ {
277
+ "properties": {
278
+ "role": {
279
+ "enum": ["Buyer"]
280
+ },
281
+ "offerId": {
282
+ "title": "Reference to an offer in the offers object",
283
+ "type": "string",
284
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:+-]*$"
285
+ }
286
+ }
287
+ },
277
288
  {
278
289
  "properties": {
279
290
  "role": {
@@ -41777,6 +41788,36 @@
41777
41788
  }
41778
41789
  }
41779
41790
  }
41791
+ },
41792
+ "offers": {
41793
+ "title": "Offers for purchase of the property",
41794
+ "type": "object",
41795
+ "propertyNames": {
41796
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:+-]*$"
41797
+ },
41798
+ "patternProperties": {
41799
+ ".*": {
41800
+ "type": "object",
41801
+ "properties": {
41802
+ "amount": { "type": "number", "minimum": 0 },
41803
+ "currency": { "type": "string", "pattern": "^[A-Z]{3}$" },
41804
+ "status": {
41805
+ "type": "string",
41806
+ "enum": [
41807
+ "pending",
41808
+ "withdrawn",
41809
+ "rejected",
41810
+ "accepted",
41811
+ "noteOfInterest"
41812
+ ]
41813
+ },
41814
+ "inclusions": { "type": "array", "items": { "type": "string" } },
41815
+ "exclusions": { "type": "array", "items": { "type": "string" } },
41816
+ "conditions": { "type": "array", "items": { "type": "string" } }
41817
+ },
41818
+ "required": ["amount", "currency", "status"]
41819
+ }
41820
+ }
41780
41821
  }
41781
41822
  }
41782
41823
  }
@@ -43,6 +43,7 @@
43
43
  result
44
44
  details
45
45
  ]
46
+ offerId
46
47
  sellersCapacity
47
48
  capacity
48
49
  sellersCapacityDetails
@@ -4070,4 +4071,5 @@
4070
4071
  completion
4071
4072
  started
4072
4073
  expected
4073
- completed
4074
+ completed
4075
+ offers
@@ -17,7 +17,6 @@
17
17
  "properties": {
18
18
  "role": {
19
19
  "enum": [
20
- "Buyer",
21
20
  "Seller's Conveyancer",
22
21
  "Prospective Buyer",
23
22
  "Buyer's Conveyancer",
@@ -32,6 +31,15 @@
32
31
  }
33
32
  }
34
33
  },
34
+ {
35
+ "properties": {
36
+ "role": {
37
+ "enum": [
38
+ "Buyer"
39
+ ]
40
+ }
41
+ }
42
+ },
35
43
  {
36
44
  "properties": {
37
45
  "role": {
@@ -17,7 +17,6 @@
17
17
  "properties": {
18
18
  "role": {
19
19
  "enum": [
20
- "Buyer",
21
20
  "Seller's Conveyancer",
22
21
  "Prospective Buyer",
23
22
  "Buyer's Conveyancer",
@@ -32,6 +31,15 @@
32
31
  }
33
32
  }
34
33
  },
34
+ {
35
+ "properties": {
36
+ "role": {
37
+ "enum": [
38
+ "Buyer"
39
+ ]
40
+ }
41
+ }
42
+ },
35
43
  {
36
44
  "properties": {
37
45
  "role": {
@@ -13,7 +13,6 @@
13
13
  "properties": {
14
14
  "role": {
15
15
  "enum": [
16
- "Buyer",
17
16
  "Seller's Conveyancer",
18
17
  "Prospective Buyer",
19
18
  "Buyer's Conveyancer",
@@ -28,6 +27,15 @@
28
27
  }
29
28
  }
30
29
  },
30
+ {
31
+ "properties": {
32
+ "role": {
33
+ "enum": [
34
+ "Buyer"
35
+ ]
36
+ }
37
+ }
38
+ },
31
39
  {
32
40
  "properties": {
33
41
  "role": {
@@ -5,6 +5,7 @@
5
5
  "participants": {
6
6
  "items": {
7
7
  "oneOf": [
8
+ null,
8
9
  null,
9
10
  {
10
11
  "properties": {
@@ -273,7 +273,6 @@
273
273
  "properties": {
274
274
  "role": {
275
275
  "enum": [
276
- "Buyer",
277
276
  "Seller's Conveyancer",
278
277
  "Prospective Buyer",
279
278
  "Buyer's Conveyancer",
@@ -288,6 +287,20 @@
288
287
  }
289
288
  }
290
289
  },
290
+ {
291
+ "properties": {
292
+ "role": {
293
+ "enum": [
294
+ "Buyer"
295
+ ]
296
+ },
297
+ "offerId": {
298
+ "title": "Reference to an offer in the offers object",
299
+ "type": "string",
300
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:+-]*$"
301
+ }
302
+ }
303
+ },
291
304
  {
292
305
  "properties": {
293
306
  "role": {
@@ -37292,6 +37305,61 @@
37292
37305
  }
37293
37306
  }
37294
37307
  }
37308
+ },
37309
+ "offers": {
37310
+ "title": "Offers for purchase of the property",
37311
+ "type": "object",
37312
+ "propertyNames": {
37313
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:+-]*$"
37314
+ },
37315
+ "patternProperties": {
37316
+ ".*": {
37317
+ "type": "object",
37318
+ "properties": {
37319
+ "amount": {
37320
+ "type": "number",
37321
+ "minimum": 0
37322
+ },
37323
+ "currency": {
37324
+ "type": "string",
37325
+ "pattern": "^[A-Z]{3}$"
37326
+ },
37327
+ "status": {
37328
+ "type": "string",
37329
+ "enum": [
37330
+ "pending",
37331
+ "withdrawn",
37332
+ "rejected",
37333
+ "accepted",
37334
+ "noteOfInterest"
37335
+ ]
37336
+ },
37337
+ "inclusions": {
37338
+ "type": "array",
37339
+ "items": {
37340
+ "type": "string"
37341
+ }
37342
+ },
37343
+ "exclusions": {
37344
+ "type": "array",
37345
+ "items": {
37346
+ "type": "string"
37347
+ }
37348
+ },
37349
+ "conditions": {
37350
+ "type": "array",
37351
+ "items": {
37352
+ "type": "string"
37353
+ }
37354
+ }
37355
+ },
37356
+ "required": [
37357
+ "amount",
37358
+ "currency",
37359
+ "status"
37360
+ ]
37361
+ }
37362
+ }
37295
37363
  }
37296
37364
  }
37297
37365
  }
@@ -54,6 +54,7 @@
54
54
  ]
55
55
  }
56
56
  },
57
+ "offerId": "string",
57
58
  "sellersCapacity": {
58
59
  "capacity": "variant",
59
60
  "sellersCapacityDetails": "string",
@@ -5178,5 +5179,6 @@
5178
5179
  "expected": "string",
5179
5180
  "completed": "string"
5180
5181
  }
5181
- }
5182
+ },
5183
+ "offers": {}
5182
5184
  }