@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.
Files changed (192) hide show
  1. package/docs/ta6-certificate-permit-contract.md +51 -0
  2. package/docs/v4-mapping-and-recomposition.md +419 -0
  3. package/index.js +210 -0
  4. package/package.json +10 -1
  5. package/src/schemas/v3/combined.json +2261 -657
  6. package/src/schemas/v3/compactSkeleton.txt +120 -51
  7. package/src/schemas/v3/overlays/baspi4.json +54 -74
  8. package/src/schemas/v3/overlays/baspi5.json +54 -74
  9. package/src/schemas/v3/overlays/extensions/ac.json +2 -1
  10. package/src/schemas/v3/overlays/extensions/dk.json +3 -2
  11. package/src/schemas/v3/overlays/extensions/fd.json +2 -1
  12. package/src/schemas/v3/overlays/extensions/ic.json +44 -9
  13. package/src/schemas/v3/overlays/extensions/lc.json +3 -2
  14. package/src/schemas/v3/overlays/extensions/mi.json +2 -1
  15. package/src/schemas/v3/overlays/extensions/nd.json +3 -2
  16. package/src/schemas/v3/overlays/extensions/pc.json +3 -2
  17. package/src/schemas/v3/overlays/extensions/ph.json +2 -1
  18. package/src/schemas/v3/overlays/extensions/rw.json +4 -3
  19. package/src/schemas/v3/overlays/extensions/sc.json +8 -4
  20. package/src/schemas/v3/overlays/extensions/sd.json +3 -2
  21. package/src/schemas/v3/overlays/extensions/tr.json +3 -2
  22. package/src/schemas/v3/overlays/extensions/wg.json +2 -1
  23. package/src/schemas/v3/overlays/llc1.json +1 -2
  24. package/src/schemas/v3/overlays/lpe1.json +3 -2
  25. package/src/schemas/v3/overlays/nts.json +7 -3
  26. package/src/schemas/v3/overlays/nts2.json +9 -4
  27. package/src/schemas/v3/overlays/ntsl.json +5 -2
  28. package/src/schemas/v3/overlays/ntsl2.json +7 -3
  29. package/src/schemas/v3/overlays/piq.json +34 -25
  30. package/src/schemas/v3/overlays/rds.json +24 -50
  31. package/src/schemas/v3/overlays/sef25.json +16 -2
  32. package/src/schemas/v3/overlays/ta10.json +0 -9
  33. package/src/schemas/v3/overlays/ta6.json +39 -70
  34. package/src/schemas/v3/overlays/ta6ed6.json +331 -307
  35. package/{pensive-tesla-d0d355/src/schemas/v3/overlays/ta6.json → src/schemas/v3/overlays/ta6ed6v2.json} +1574 -1464
  36. package/src/schemas/v3/overlays/ta7.json +2 -1
  37. package/src/schemas/v3/overlays/ta7ed5.json +68 -21
  38. package/src/schemas/v3/pdtf-transaction.json +1030 -492
  39. package/src/schemas/v3/skeleton.json +163 -57
  40. package/src/schemas/v4/Gift.json +88 -0
  41. package/src/schemas/v4/Offer.json +425 -0
  42. package/src/schemas/v4/Organisation.json +167 -0
  43. package/src/schemas/v4/Person.json +321 -0
  44. package/src/schemas/v4/Property.json +27813 -0
  45. package/src/schemas/v4/Representation.json +67 -0
  46. package/src/schemas/v4/SellerCapacity.json +193 -0
  47. package/src/schemas/v4/Title.json +14660 -0
  48. package/src/schemas/v4/Transaction.json +1612 -0
  49. package/src/schemas/v4/TransactionRole.json +59 -0
  50. package/src/schemas/v4/mapping.json +1161 -0
  51. package/src/utils/checkTa6OmissionCompatibility.js +146 -0
  52. package/src/utils/extractExtensionOverlays.js +11 -2
  53. package/src/utils/extractOverlay.js +21 -0
  54. package/src/utils/generateV4Schemas.js +1358 -0
  55. package/src/utils/syncTa6ed6v2Markers.js +92 -0
  56. package/src/utils/v4.js +838 -0
  57. package/CLAUDE.md +0 -101
  58. package/pensive-tesla-d0d355/CLAUDE.md +0 -101
  59. package/pensive-tesla-d0d355/LICENSE +0 -21
  60. package/pensive-tesla-d0d355/README.md +0 -435
  61. package/pensive-tesla-d0d355/docs/branch-release-workflow.md +0 -138
  62. package/pensive-tesla-d0d355/docs/sef25-extensions-ui-spec.md +0 -355
  63. package/pensive-tesla-d0d355/index.js +0 -654
  64. package/pensive-tesla-d0d355/package-lock.json +0 -7297
  65. package/pensive-tesla-d0d355/package.json +0 -44
  66. package/pensive-tesla-d0d355/src/examples/v1/exampleAddParticipantVouch.json +0 -32
  67. package/pensive-tesla-d0d355/src/examples/v1/exampleDocumentedVouch.json +0 -40
  68. package/pensive-tesla-d0d355/src/examples/v1/exampleElectronicRecord.json +0 -30
  69. package/pensive-tesla-d0d355/src/examples/v1/exampleTransaction.json +0 -878
  70. package/pensive-tesla-d0d355/src/examples/v1/exampleVouch.json +0 -25
  71. package/pensive-tesla-d0d355/src/examples/v2/exampleTransaction.json +0 -901
  72. package/pensive-tesla-d0d355/src/examples/v3/exampleAddParticipantVouch.json +0 -38
  73. package/pensive-tesla-d0d355/src/examples/v3/exampleCustomOverlay.json +0 -55
  74. package/pensive-tesla-d0d355/src/examples/v3/exampleCustomOverlay2.json +0 -93
  75. package/pensive-tesla-d0d355/src/examples/v3/exampleDocumentedVouch.json +0 -47
  76. package/pensive-tesla-d0d355/src/examples/v3/exampleElectronicRecord.json +0 -36
  77. package/pensive-tesla-d0d355/src/examples/v3/exampleTransaction.json +0 -1038
  78. package/pensive-tesla-d0d355/src/examples/v3/exampleVouch.json +0 -32
  79. package/pensive-tesla-d0d355/src/mappings/SendPropertyDetailsRequestSchema.json +0 -1588
  80. package/pensive-tesla-d0d355/src/mappings/adf.js +0 -198
  81. package/pensive-tesla-d0d355/src/schemas/v1/GeoJSON.json +0 -1279
  82. package/pensive-tesla-d0d355/src/schemas/v1/baspiNotes.html +0 -102
  83. package/pensive-tesla-d0d355/src/schemas/v1/energy-performance-certificate.json +0 -124
  84. package/pensive-tesla-d0d355/src/schemas/v1/freehold-information.json +0 -2051
  85. package/pensive-tesla-d0d355/src/schemas/v1/leasehold-information.json +0 -2064
  86. package/pensive-tesla-d0d355/src/schemas/v1/legal-information.json +0 -1045
  87. package/pensive-tesla-d0d355/src/schemas/v1/material-facts.json +0 -2109
  88. package/pensive-tesla-d0d355/src/schemas/v1/pdtf-transaction-search-results.json +0 -40
  89. package/pensive-tesla-d0d355/src/schemas/v1/pdtf-transaction.json +0 -191
  90. package/pensive-tesla-d0d355/src/schemas/v1/searches/drainage-and-water.json +0 -261
  91. package/pensive-tesla-d0d355/src/schemas/v1/searches/local-land-charges.json +0 -69
  92. package/pensive-tesla-d0d355/src/schemas/v1/searches/local-searches-required.json +0 -857
  93. package/pensive-tesla-d0d355/src/schemas/v1/searches.json +0 -237
  94. package/pensive-tesla-d0d355/src/schemas/v1/title-deed.json +0 -841
  95. package/pensive-tesla-d0d355/src/schemas/v2/baspiNotes.html +0 -102
  96. package/pensive-tesla-d0d355/src/schemas/v2/combined.json +0 -37731
  97. package/pensive-tesla-d0d355/src/schemas/v2/overlays/baspi.json +0 -8132
  98. package/pensive-tesla-d0d355/src/schemas/v2/overlays/con29DW.json +0 -705
  99. package/pensive-tesla-d0d355/src/schemas/v2/overlays/con29R.json +0 -2956
  100. package/pensive-tesla-d0d355/src/schemas/v2/overlays/fme1.json +0 -1259
  101. package/pensive-tesla-d0d355/src/schemas/v2/overlays/llc1.json +0 -25
  102. package/pensive-tesla-d0d355/src/schemas/v2/overlays/lpe1.json +0 -2171
  103. package/pensive-tesla-d0d355/src/schemas/v2/overlays/nts.json +0 -326
  104. package/pensive-tesla-d0d355/src/schemas/v2/overlays/oc1.json +0 -2799
  105. package/pensive-tesla-d0d355/src/schemas/v2/overlays/piq.json +0 -3419
  106. package/pensive-tesla-d0d355/src/schemas/v2/overlays/rds.json +0 -3736
  107. package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta10.json +0 -5306
  108. package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta6.json +0 -4533
  109. package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta7.json +0 -1045
  110. package/pensive-tesla-d0d355/src/schemas/v2/pdtf-transaction.json +0 -34351
  111. package/pensive-tesla-d0d355/src/schemas/v2/skeleton.json +0 -3973
  112. package/pensive-tesla-d0d355/src/schemas/v3/combined.json +0 -48469
  113. package/pensive-tesla-d0d355/src/schemas/v3/compactSkeleton.txt +0 -4519
  114. package/pensive-tesla-d0d355/src/schemas/v3/overlays/README.md +0 -299
  115. package/pensive-tesla-d0d355/src/schemas/v3/overlays/baspi4.json +0 -8025
  116. package/pensive-tesla-d0d355/src/schemas/v3/overlays/baspi5.json +0 -8175
  117. package/pensive-tesla-d0d355/src/schemas/v3/overlays/con29DW.json +0 -716
  118. package/pensive-tesla-d0d355/src/schemas/v3/overlays/con29R.json +0 -2981
  119. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ac.json +0 -333
  120. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/as.json +0 -74
  121. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/dk.json +0 -32
  122. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/dr.json +0 -73
  123. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/er.json +0 -85
  124. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/fd.json +0 -75
  125. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/hi.json +0 -51
  126. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/hs.json +0 -73
  127. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ic.json +0 -59
  128. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/jk.json +0 -96
  129. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/la.json +0 -85
  130. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/lc.json +0 -75
  131. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ma.json +0 -90
  132. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/mc.json +0 -38
  133. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/mi.json +0 -69
  134. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/nd.json +0 -43
  135. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/oa.json +0 -24
  136. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/oc.json +0 -57
  137. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/pc.json +0 -37
  138. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ph.json +0 -194
  139. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/rw.json +0 -68
  140. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sb.json +0 -73
  141. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sc.json +0 -129
  142. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sd.json +0 -63
  143. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sf.json +0 -74
  144. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sl.json +0 -68
  145. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ta.json +0 -252
  146. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/tf.json +0 -103
  147. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/tr.json +0 -73
  148. package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/wg.json +0 -350
  149. package/pensive-tesla-d0d355/src/schemas/v3/overlays/fme1.json +0 -1266
  150. package/pensive-tesla-d0d355/src/schemas/v3/overlays/llc1.json +0 -25
  151. package/pensive-tesla-d0d355/src/schemas/v3/overlays/lpe1.json +0 -2199
  152. package/pensive-tesla-d0d355/src/schemas/v3/overlays/nts.json +0 -2157
  153. package/pensive-tesla-d0d355/src/schemas/v3/overlays/nts2.json +0 -2742
  154. package/pensive-tesla-d0d355/src/schemas/v3/overlays/ntsl.json +0 -1813
  155. package/pensive-tesla-d0d355/src/schemas/v3/overlays/ntsl2.json +0 -2217
  156. package/pensive-tesla-d0d355/src/schemas/v3/overlays/oc1.json +0 -2817
  157. package/pensive-tesla-d0d355/src/schemas/v3/overlays/piq.json +0 -3322
  158. package/pensive-tesla-d0d355/src/schemas/v3/overlays/rds.json +0 -3665
  159. package/pensive-tesla-d0d355/src/schemas/v3/overlays/sef25.json +0 -1639
  160. package/pensive-tesla-d0d355/src/schemas/v3/overlays/sr24.json +0 -38
  161. package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta10.json +0 -4654
  162. package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta6ed6.json +0 -6534
  163. package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta7.json +0 -1537
  164. package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta7ed5.json +0 -1551
  165. package/pensive-tesla-d0d355/src/schemas/v3/pdtf-transaction.json +0 -41573
  166. package/pensive-tesla-d0d355/src/schemas/v3/skeleton.json +0 -5767
  167. package/pensive-tesla-d0d355/src/schemas/verifiedClaims/README.md +0 -21
  168. package/pensive-tesla-d0d355/src/schemas/verifiedClaims/pdtf-verified-claims.json +0 -447
  169. package/pensive-tesla-d0d355/src/utils/compactSkeleton.js +0 -84
  170. package/pensive-tesla-d0d355/src/utils/countTokens.js +0 -67
  171. package/pensive-tesla-d0d355/src/utils/extractExtensionOverlays.js +0 -624
  172. package/pensive-tesla-d0d355/src/utils/extractOverlay.js +0 -381
  173. package/pensive-tesla-d0d355/src/utils/extractProperties.js +0 -44
  174. package/pensive-tesla-d0d355/src/utils/listPathTitles.js +0 -36
  175. package/pensive-tesla-d0d355/src/utils/minimalSkeleton.js +0 -85
  176. package/pensive-tesla-d0d355/src/utils/pathList.csv +0 -903
  177. package/pensive-tesla-d0d355/src/utils/pathSkeleton.js +0 -181
  178. package/src/examples/v1/exampleAddParticipantVouch.json +0 -32
  179. package/src/examples/v1/exampleDocumentedVouch.json +0 -40
  180. package/src/examples/v1/exampleElectronicRecord.json +0 -30
  181. package/src/examples/v1/exampleTransaction.json +0 -878
  182. package/src/examples/v1/exampleVouch.json +0 -25
  183. package/src/examples/v2/exampleTransaction.json +0 -901
  184. package/src/examples/v3/exampleAddParticipantVouch.json +0 -38
  185. package/src/examples/v3/exampleCustomOverlay.json +0 -55
  186. package/src/examples/v3/exampleCustomOverlay2.json +0 -93
  187. package/src/examples/v3/exampleDocumentedVouch.json +0 -47
  188. package/src/examples/v3/exampleElectronicRecord.json +0 -36
  189. package/src/examples/v3/exampleTransaction.json +0 -1038
  190. package/src/examples/v3/exampleVouch.json +0 -32
  191. package/src/mappings/SendPropertyDetailsRequestSchema.json +0 -1588
  192. package/src/mappings/adf.js +0 -198
@@ -1,21 +0,0 @@
1
- ## README
2
-
3
- ### About verified claims
4
- `pdtf-verified-claims.json` describes the schema container in which we store property `claims` and their corresponding `verification`.
5
-
6
- This schema structure is strongly influenced by OpenID Connect for Identity Assurance 1.0's way of storing "verified claims".
7
-
8
- More Details from the OIDC page which describes the details the nature of `verification` and `claims` objects: https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html#name-representing-verified-claim
9
-
10
- ### Terms of Use
11
- The schema supports an optional `terms_of_use` object to control access to verified claims based on confidentiality levels:
12
-
13
- * **Public**: No access restrictions (`allowed_roles: []`)
14
- * **Restricted**: Requires some participant role but not specifically defined (`allowed_roles: []`)
15
- * **Confidential**: Specific roles defined for access control (e.g., `allowed_roles: ["Seller's Conveyancer", "Buyer's Conveyancer"]`)
16
-
17
- The `allowed_roles` array accepts any of the participant roles defined in [pdtf-transaction.json](../v3/pdtf-transaction.json).
18
-
19
- Notes:
20
- * For PDTF Schema, all data included in the `claims` object must adhere to [pdtf-transaction.json (v3)](../v3/pdtf-transaction.json)
21
- * For verification, there is more freedom in terms of the type of data that can currently be provided, see the documentation in the OIDC link above for details and examples.
@@ -1,447 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "https://trust.propdata.org.uk/schemas/verifiedClaims/pdtf-verified-claims.json",
4
- "definitions": {
5
- "date_type": {
6
- "type": "string",
7
- "format": "date"
8
- },
9
- "time_type": {
10
- "type": "string",
11
- "format": "date-time"
12
- },
13
- "document_number": {
14
- "type": "string"
15
- },
16
- "document_details": {
17
- "type": "object",
18
- "properties": {
19
- "type": {
20
- "type": "string"
21
- },
22
- "document_number": {
23
- "$ref": "#/definitions/document_number"
24
- },
25
- "number": {
26
- "$ref": "#/definitions/document_number"
27
- },
28
- "personal_number": {
29
- "type": "string"
30
- },
31
- "serial_number": {
32
- "type": "string"
33
- },
34
- "date_of_issuance": {
35
- "$ref": "#/definitions/date_type"
36
- },
37
- "date_of_expiry": {
38
- "$ref": "#/definitions/date_type"
39
- },
40
- "issuer": {
41
- "type": "object",
42
- "properties": {
43
- "name": {
44
- "type": "string"
45
- },
46
- "formatted": {
47
- "type": "string"
48
- },
49
- "street_address": {
50
- "type": "string"
51
- },
52
- "locality": {
53
- "type": "string"
54
- },
55
- "region": {
56
- "type": "string"
57
- },
58
- "postal_code": {
59
- "type": "string"
60
- },
61
- "country": {
62
- "type": "string"
63
- },
64
- "country_code": {
65
- "type": "string"
66
- },
67
- "jurisdiction": {
68
- "type": "string"
69
- }
70
- }
71
- }
72
- }
73
- },
74
- "validation_method": {
75
- "type": "object",
76
- "properties": {
77
- "type": {
78
- "type": "string"
79
- }
80
- }
81
- },
82
- "verification_method": {
83
- "type": "object",
84
- "properties": {
85
- "type": {
86
- "type": "string"
87
- }
88
- }
89
- },
90
- "evidence": {
91
- "type": "object",
92
- "properties": {
93
- "type": {
94
- "type": "string",
95
- "enum": ["document", "electronic_record", "vouch"]
96
- },
97
- "attachments": {
98
- "$ref": "#/definitions/attachments"
99
- }
100
- },
101
- "required": ["type"],
102
- "allOf": [
103
- {
104
- "if": {
105
- "properties": {
106
- "type": {
107
- "const": "document"
108
- }
109
- }
110
- },
111
- "then": {
112
- "properties": {
113
- "validation_method": {
114
- "$ref": "#/definitions/validation_method"
115
- },
116
- "verification_method": {
117
- "$ref": "#/definitions/verification_method"
118
- },
119
- "verifier": {
120
- "type": "object",
121
- "properties": {
122
- "organization": {
123
- "type": "string"
124
- },
125
- "txn": {
126
- "type": "string"
127
- }
128
- }
129
- },
130
- "time": {
131
- "$ref": "#/definitions/time_type"
132
- },
133
- "document_details": {
134
- "$ref": "#/definitions/document_details"
135
- }
136
- }
137
- }
138
- },
139
- {
140
- "if": {
141
- "properties": {
142
- "type": {
143
- "value": "electronic_record"
144
- }
145
- }
146
- },
147
- "then": {
148
- "properties": {
149
- "validation_method": {
150
- "$ref": "#/definitions/validation_method"
151
- },
152
- "verification_method": {
153
- "$ref": "#/definitions/verification_method"
154
- },
155
- "verifier": {
156
- "type": "object",
157
- "required": ["organization"],
158
- "properties": {
159
- "organization": {
160
- "type": "string"
161
- },
162
- "txn": {
163
- "type": "string"
164
- }
165
- }
166
- },
167
- "time": {
168
- "$ref": "#/definitions/time_type"
169
- },
170
- "record": {
171
- "type": "object",
172
- "required": ["source"],
173
- "properties": {
174
- "type": {
175
- "type": "string"
176
- },
177
- "personal_number": {
178
- "type": "string"
179
- },
180
- "created_at": {
181
- "$ref": "#/definitions/date_type"
182
- },
183
- "date_of_expiry": {
184
- "$ref": "#/definitions/date_type"
185
- },
186
- "source": {
187
- "type": "object",
188
- "required": ["name"],
189
- "properties": {
190
- "name": {
191
- "type": "string"
192
- },
193
- "formatted": {
194
- "type": "string"
195
- },
196
- "street_address": {
197
- "type": "string"
198
- },
199
- "locality": {
200
- "type": "string"
201
- },
202
- "region": {
203
- "type": "string"
204
- },
205
- "postal_code": {
206
- "type": "string"
207
- },
208
- "country": {
209
- "type": "string"
210
- },
211
- "country_code": {
212
- "type": "string"
213
- },
214
- "jurisdiction": {
215
- "type": "string"
216
- },
217
- "rights": { "type": "string" }
218
- }
219
- }
220
- }
221
- }
222
- }
223
- }
224
- },
225
- {
226
- "if": {
227
- "properties": {
228
- "type": {
229
- "value": "vouch"
230
- }
231
- }
232
- },
233
- "then": {
234
- "properties": {
235
- "validation_method": {
236
- "$ref": "#/definitions/validation_method"
237
- },
238
- "verification_method": {
239
- "$ref": "#/definitions/verification_method"
240
- },
241
- "verifier": {
242
- "type": "object",
243
- "properties": {
244
- "organization": {
245
- "type": "string"
246
- },
247
- "txn": {
248
- "type": "string"
249
- }
250
- }
251
- },
252
- "time": {
253
- "$ref": "#/definitions/time_type"
254
- },
255
- "attestation": {
256
- "type": "object",
257
- "properties": {
258
- "type": {
259
- "type": "string",
260
- "const": "digital_attestation"
261
- },
262
- "reference_number": {
263
- "type": "string"
264
- },
265
- "personal_number": {
266
- "type": "string"
267
- },
268
- "date_of_issuance": {
269
- "$ref": "#/definitions/date_type"
270
- },
271
- "date_of_expiry": {
272
- "$ref": "#/definitions/date_type"
273
- },
274
- "voucher": {
275
- "type": "object",
276
- "properties": {
277
- "name": {
278
- "type": "string"
279
- },
280
- "birthdate": {
281
- "$ref": "#/definitions/date_type"
282
- },
283
- "formatted": {
284
- "type": "string"
285
- },
286
- "street_address": {
287
- "type": "string"
288
- },
289
- "locality": {
290
- "type": "string"
291
- },
292
- "region": {
293
- "type": "string"
294
- },
295
- "postal_code": {
296
- "type": "string"
297
- },
298
- "country": {
299
- "type": "string"
300
- },
301
- "occupation": {
302
- "type": "string"
303
- },
304
- "organization": {
305
- "type": "string"
306
- }
307
- }
308
- }
309
- }
310
- }
311
- }
312
- }
313
- }
314
- ]
315
- },
316
- "digest": {
317
- "type": "object",
318
- "properties": {
319
- "alg": {
320
- "type": "string"
321
- },
322
- "value": {
323
- "type": "string",
324
- "contentEncoding": "base64"
325
- }
326
- },
327
- "required": ["alg", "value"]
328
- },
329
- "external_attachment": {
330
- "type": "object",
331
- "properties": {
332
- "desc": {
333
- "type": "string"
334
- },
335
- "digest": {
336
- "$ref": "#/definitions/digest"
337
- },
338
- "url": {
339
- "type": "string",
340
- "format": "uri"
341
- },
342
- "access_token": {
343
- "type": ["string", "null"]
344
- },
345
- "expires_in": {
346
- "type": "integer",
347
- "minimum": 1
348
- },
349
- "pdtfSchemaPath": {
350
- "type": "string"
351
- }
352
- },
353
- "required": ["digest", "url"]
354
- },
355
- "attachments": {
356
- "type": "array",
357
- "minItems": 1,
358
- "items": {
359
- "$ref": "#/definitions/external_attachment"
360
- }
361
- },
362
- "verified_claims_def": {
363
- "type": "object",
364
- "properties": {
365
- "id": {
366
- "description": "The unique identifier of the verified claim",
367
- "type": "string"
368
- },
369
- "transactionId": {
370
- "description": "The unique identifier of the PDTF transaction to which these claims relate",
371
- "type": "string"
372
- },
373
- "schemaVersion": {
374
- "description": "The semantic version of the schema used to validate the claims",
375
- "type": "string"
376
- },
377
- "timestamp": {
378
- "type": "integer",
379
- "minimum": 0,
380
- "description": "Unix timestamp in milliseconds when the verified claims were created"
381
- },
382
- "verification": {
383
- "type": "object",
384
- "properties": {
385
- "trust_framework": {
386
- "type": "string",
387
- "const": "uk_pdtf"
388
- },
389
- "time": {
390
- "$ref": "#/definitions/time_type"
391
- },
392
- "evidence": {
393
- "type": "array",
394
- "minItems": 1,
395
- "items": {
396
- "oneOf": [
397
- {
398
- "$ref": "#/definitions/evidence"
399
- }
400
- ]
401
- }
402
- }
403
- },
404
- "required": ["trust_framework"],
405
- "additionalProperties": true
406
- },
407
- "claims": {
408
- "type": "object",
409
- "patternProperties": {
410
- "^(/|([a-zA-Z0-9/-]+)+$)": {}
411
- },
412
- "minProperties": 1,
413
- "additionalProperties": false
414
- },
415
- "terms_of_use": {
416
- "type": "object",
417
- "properties": {
418
- "confidentiality_level": {
419
- "type": "string",
420
- "enum": ["public", "restricted", "confidential"]
421
- },
422
- "allowed_roles": {
423
- "type": "array",
424
- "items": {
425
- "type": "string"
426
- }
427
- }
428
- },
429
- "additionalProperties": false
430
- }
431
- },
432
- "required": ["verification", "claims"],
433
- "additionalProperties": false
434
- }
435
- },
436
- "type": "object",
437
- "required": ["verified_claims"],
438
- "properties": {
439
- "verified_claims": {
440
- "type": "array",
441
- "items": {
442
- "$ref": "#/definitions/verified_claims_def"
443
- }
444
- }
445
- },
446
- "additionalProperties": false
447
- }
@@ -1,84 +0,0 @@
1
- const fs = require("fs");
2
-
3
- // Read the current skeleton
4
- const skeleton = require("../schemas/v3/skeleton.json");
5
-
6
- // Convert to ultra-compact format
7
- const toCompact = (obj, indent = "") => {
8
- if (typeof obj === "string") {
9
- // Type indicators
10
- if (["string", "number", "integer", "boolean", "variant"].includes(obj)) {
11
- return obj[0]; // Just first letter: s, n, i, b, v
12
- }
13
- return obj;
14
- }
15
-
16
- if (Array.isArray(obj)) {
17
- if (obj.length === 0) return "[]";
18
- // Array with content
19
- const inner = toCompact(obj[0], indent + " ");
20
- if (typeof inner === "string" && inner.length === 1) {
21
- return `[${inner}]`; // Simple array like [s]
22
- }
23
- return `[\n${indent} ${inner}\n${indent}]`;
24
- }
25
-
26
- if (obj && typeof obj === "object") {
27
- const keys = Object.keys(obj);
28
- if (keys.length === 0) return "{}";
29
-
30
- // Check if it's a simple object with only type indicators
31
- const allSimple = keys.every(k =>
32
- typeof obj[k] === "string" &&
33
- ["s", "n", "i", "b", "v"].includes(toCompact(obj[k]))
34
- );
35
-
36
- if (allSimple && keys.length < 5) {
37
- // Inline format: {a:s b:n c:s}
38
- return `{${keys.map(k => `${k}:${toCompact(obj[k])}`).join(" ")}}`;
39
- }
40
-
41
- // Multi-line format
42
- const lines = keys.map(k => {
43
- const val = toCompact(obj[k], indent + " ");
44
- if (typeof val === "string" && val.length === 1) {
45
- return `${indent} ${k}:${val}`;
46
- } else if (typeof val === "string" && (val === "{}" || val === "[]")) {
47
- return `${indent} ${k}${val}`;
48
- } else if (typeof val === "string" && val.startsWith("{") && val.endsWith("}")) {
49
- return `${indent} ${k}${val}`;
50
- } else if (typeof val === "string" && val.startsWith("[") && !val.includes("\n")) {
51
- return `${indent} ${k}${val}`;
52
- } else {
53
- return `${indent} ${k}:\n${indent} ${val}`;
54
- }
55
- });
56
-
57
- return `{\n${lines.join("\n")}\n${indent}}`;
58
- }
59
-
60
- return String(obj);
61
- };
62
-
63
- // Generate ultra-compact version
64
- const compact = toCompact(skeleton);
65
-
66
- // Write compact version
67
- fs.writeFileSync("../schemas/v3/compactSkeleton.txt", compact);
68
-
69
- console.log("Compact skeleton written to ../schemas/v3/compactSkeleton.txt");
70
- console.log(`Size: ${compact.length} bytes`);
71
-
72
- // Count tokens
73
- try {
74
- const GPT3Encoder = require('gpt-3-encoder');
75
- const encoded = GPT3Encoder.encode(compact);
76
- console.log(`Tokens (GPT-3): ${encoded.length}`);
77
- console.log(`Reduction: ${((1 - encoded.length / 78734) * 100).toFixed(1)}% fewer tokens than JSON skeleton`);
78
-
79
- // Show sample
80
- console.log("\nFirst 500 chars:");
81
- console.log(compact.substring(0, 500));
82
- } catch (e) {
83
- console.log(`Estimated tokens: ~${Math.ceil(compact.length / 4)}`);
84
- }
@@ -1,67 +0,0 @@
1
- const fs = require('fs');
2
-
3
- // Try to use tiktoken or a similar library
4
- // For Claude/Anthropic models, we can estimate using the cl100k_base encoding
5
- // which is similar to what Claude uses
6
-
7
- // First, let's check what's available
8
- try {
9
- // Option 1: Use gpt-tokenizer (common npm package)
10
- const { encode } = require('gpt-tokenizer');
11
-
12
- const content = fs.readFileSync('../schemas/v3/skeleton.json', 'utf8');
13
- const tokens = encode(content);
14
-
15
- console.log(`Using gpt-tokenizer:`);
16
- console.log(`Total tokens: ${tokens.length}`);
17
- console.log(`File size: ${content.length} characters`);
18
- console.log(`Ratio: ${(content.length / tokens.length).toFixed(2)} characters per token`);
19
-
20
- } catch (e1) {
21
- console.log("gpt-tokenizer not found, trying gpt-3-encoder...");
22
-
23
- try {
24
- // Option 2: Use gpt-3-encoder
25
- const GPT3Encoder = require('gpt-3-encoder');
26
-
27
- const content = fs.readFileSync('../schemas/v3/skeleton.json', 'utf8');
28
- const encoded = GPT3Encoder.encode(content);
29
-
30
- console.log(`Using gpt-3-encoder:`);
31
- console.log(`Total tokens: ${encoded.length}`);
32
- console.log(`File size: ${content.length} characters`);
33
- console.log(`Ratio: ${(content.length / encoded.length).toFixed(2)} characters per token`);
34
-
35
- } catch (e2) {
36
- console.log("No tokenizer library found. Falling back to estimation...");
37
-
38
- // Option 3: Manual estimation
39
- const content = fs.readFileSync('../schemas/v3/skeleton.json', 'utf8');
40
-
41
- // Count different types of content for better estimation
42
- const lines = content.split('\n');
43
- const words = content.split(/\s+/);
44
- const punctuation = content.match(/[{}:,\[\]"]/g) || [];
45
-
46
- // Rough estimation:
47
- // - JSON structure tokens (brackets, colons, quotes): ~1 token each
48
- // - Words: ~1 token each
49
- // - Whitespace: usually absorbed into adjacent tokens
50
-
51
- const structureTokens = punctuation.length;
52
- const wordTokens = words.length;
53
- const estimatedTokens = Math.ceil((structureTokens + wordTokens) * 0.75); // 0.75 factor for overlap
54
-
55
- console.log("Manual estimation:");
56
- console.log(`File size: ${content.length} characters`);
57
- console.log(`Lines: ${lines.length}`);
58
- console.log(`Words: ${words.length}`);
59
- console.log(`JSON punctuation: ${punctuation.length}`);
60
- console.log(`Estimated tokens: ~${estimatedTokens}`);
61
- console.log(`Ratio: ${(content.length / estimatedTokens).toFixed(2)} characters per token`);
62
-
63
- // Also do a simple character-based estimation
64
- const simpleEstimate = Math.ceil(content.length / 4);
65
- console.log(`\nSimple estimation (chars/4): ~${simpleEstimate} tokens`);
66
- }
67
- }