gdc-common-utils-ts 1.0.4 → 1.0.7

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 (202) hide show
  1. package/dist/AesManager.d.ts +27 -0
  2. package/dist/AesManager.js +62 -0
  3. package/dist/CryptographyService.d.ts +76 -0
  4. package/dist/CryptographyService.js +403 -0
  5. package/dist/constants/Schemas.d.ts +45 -0
  6. package/dist/constants/Schemas.js +48 -0
  7. package/dist/constants/index.js +1 -0
  8. package/{src/constants/schemaorg.ts → dist/constants/schemaorg.d.ts} +24 -116
  9. package/dist/constants/schemaorg.js +185 -0
  10. package/dist/cryptoDecode.d.ts +3 -0
  11. package/dist/cryptoDecode.js +90 -0
  12. package/dist/cryptoEncode.d.ts +1 -0
  13. package/dist/cryptoEncode.js +30 -0
  14. package/dist/cryptography.abstract.d.ts +13 -0
  15. package/{src/cryptography.abstract.ts → dist/cryptography.abstract.js} +6 -14
  16. package/dist/hmac.d.ts +2 -0
  17. package/{src/hmac.ts → dist/hmac.js} +4 -7
  18. package/dist/index.js +3 -0
  19. package/{src/interfaces/Cryptography.types.ts → dist/interfaces/Cryptography.types.d.ts} +71 -71
  20. package/dist/interfaces/Cryptography.types.js +8 -0
  21. package/dist/interfaces/ICryptoHelper.d.ts +28 -0
  22. package/dist/interfaces/ICryptoHelper.js +3 -0
  23. package/dist/interfaces/ICryptography.d.ts +154 -0
  24. package/dist/interfaces/ICryptography.js +3 -0
  25. package/dist/interfaces/IWallet.d.ts +55 -0
  26. package/dist/interfaces/IWallet.js +3 -0
  27. package/dist/interfaces/MlDsa.d.ts +9 -0
  28. package/{src/interfaces/MlDsa.ts → dist/interfaces/MlDsa.js} +1 -5
  29. package/dist/interfaces/MlKem.d.ts +11 -0
  30. package/{src/interfaces/MlKem.ts → dist/interfaces/MlKem.js} +0 -5
  31. package/dist/models/aes.d.ts +85 -0
  32. package/dist/models/aes.js +10 -0
  33. package/dist/models/auth.d.ts +35 -0
  34. package/dist/models/auth.js +3 -0
  35. package/{src/models/bundle.ts → dist/models/bundle.d.ts} +41 -63
  36. package/dist/models/bundle.js +26 -0
  37. package/dist/models/clinical-sections.d.ts +36 -0
  38. package/dist/models/clinical-sections.en.d.ts +75 -0
  39. package/dist/models/clinical-sections.en.js +81 -0
  40. package/dist/models/clinical-sections.js +32 -0
  41. package/dist/models/comm.d.ts +44 -0
  42. package/dist/models/comm.js +4 -0
  43. package/{src/models/confidential-job.ts → dist/models/confidential-job.d.ts} +23 -45
  44. package/dist/models/confidential-job.js +20 -0
  45. package/dist/models/confidential-message.d.ts +97 -0
  46. package/dist/models/confidential-message.js +4 -0
  47. package/{src/models/confidential-storage.ts → dist/models/confidential-storage.d.ts} +35 -56
  48. package/dist/models/confidential-storage.js +3 -0
  49. package/{src/models/consent-rule.ts → dist/models/consent-rule.d.ts} +22 -42
  50. package/dist/models/consent-rule.js +21 -0
  51. package/{src/models/crypto.ts → dist/models/crypto.d.ts} +5 -13
  52. package/dist/models/crypto.js +3 -0
  53. package/dist/models/device-license.d.ts +133 -0
  54. package/dist/models/device-license.js +3 -0
  55. package/{src/models/did.ts → dist/models/did.d.ts} +21 -30
  56. package/dist/models/did.js +3 -0
  57. package/dist/models/index.js +31 -0
  58. package/dist/models/indexing.d.ts +11 -0
  59. package/dist/models/indexing.js +18 -0
  60. package/dist/models/issue.d.ts +57 -0
  61. package/dist/models/issue.js +75 -0
  62. package/dist/models/jsonapi.d.ts +13 -0
  63. package/dist/models/jsonapi.js +3 -0
  64. package/{src/models/jwe.ts → dist/models/jwe.d.ts} +10 -22
  65. package/dist/models/jwe.js +3 -0
  66. package/{src/models/jwk.ts → dist/models/jwk.d.ts} +0 -11
  67. package/dist/models/jwk.js +3 -0
  68. package/{src/models/jws.ts → dist/models/jws.d.ts} +0 -7
  69. package/dist/models/jws.js +3 -0
  70. package/dist/models/jwt.d.ts +9 -0
  71. package/dist/models/jwt.js +3 -0
  72. package/dist/models/multibase58.d.ts +13 -0
  73. package/dist/models/multibase58.js +40 -0
  74. package/dist/models/oidc4ida.common.model.d.ts +33 -0
  75. package/dist/models/oidc4ida.common.model.js +3 -0
  76. package/dist/models/oidc4ida.document.model.d.ts +50 -0
  77. package/dist/models/oidc4ida.document.model.js +3 -0
  78. package/{src/models/oidc4ida.electronicRecord.model.ts → dist/models/oidc4ida.electronicRecord.model.d.ts} +18 -37
  79. package/dist/models/oidc4ida.electronicRecord.model.js +3 -0
  80. package/{src/models/oidc4ida.evidence.model.ts → dist/models/oidc4ida.evidence.model.d.ts} +17 -35
  81. package/dist/models/oidc4ida.evidence.model.js +5 -0
  82. package/dist/models/openid-device.d.ts +119 -0
  83. package/dist/models/openid-device.js +3 -0
  84. package/dist/models/operation-outcome.d.ts +26 -0
  85. package/dist/models/operation-outcome.js +3 -0
  86. package/{src/models/params.ts → dist/models/params.d.ts} +20 -29
  87. package/dist/models/params.js +3 -0
  88. package/dist/models/resource-document.d.ts +14 -0
  89. package/dist/models/resource-document.js +3 -0
  90. package/dist/models/response.d.ts +1 -0
  91. package/dist/models/response.js +3 -0
  92. package/dist/models/urlPath.d.ts +58 -0
  93. package/dist/models/urlPath.js +76 -0
  94. package/dist/models/verifiable-credential.d.ts +45 -0
  95. package/dist/models/verifiable-credential.js +8 -0
  96. package/dist/utils/actor.d.ts +18 -0
  97. package/dist/utils/actor.js +36 -0
  98. package/dist/utils/base-convert.d.ts +20 -0
  99. package/{src/utils/base-convert.ts → dist/utils/base-convert.js} +23 -36
  100. package/dist/utils/baseN.d.ts +35 -0
  101. package/dist/utils/baseN.js +174 -0
  102. package/dist/utils/bundle.d.ts +6 -0
  103. package/dist/utils/bundle.js +32 -0
  104. package/dist/utils/content.d.ts +55 -0
  105. package/{src/utils/content.ts → dist/utils/content.js} +4 -10
  106. package/dist/utils/did.d.ts +67 -0
  107. package/dist/utils/did.js +123 -0
  108. package/dist/utils/format-converter.d.ts +21 -0
  109. package/dist/utils/format-converter.js +109 -0
  110. package/dist/utils/index.js +13 -0
  111. package/dist/utils/jwt.d.ts +52 -0
  112. package/dist/utils/jwt.js +153 -0
  113. package/dist/utils/manager-error.d.ts +15 -0
  114. package/dist/utils/manager-error.js +23 -0
  115. package/dist/utils/multibase58.d.ts +13 -0
  116. package/dist/utils/multibase58.js +40 -0
  117. package/dist/utils/multibasehash.d.ts +8 -0
  118. package/{src/utils/multibasehash.ts → dist/utils/multibasehash.js} +8 -13
  119. package/dist/utils/normalize.d.ts +16 -0
  120. package/{src/utils/normalize.ts → dist/utils/normalize.js} +15 -18
  121. package/dist/utils/object-convert.d.ts +20 -0
  122. package/{src/utils/object-convert.ts → dist/utils/object-convert.js} +10 -16
  123. package/dist/utils/string-convert.d.ts +24 -0
  124. package/{src/utils/string-convert.ts → dist/utils/string-convert.js} +5 -14
  125. package/dist/utils/string-utils.d.ts +25 -0
  126. package/{src/utils/string-utils.ts → dist/utils/string-utils.js} +12 -16
  127. package/dist/utils/url.d.ts +27 -0
  128. package/{src/utils/url.ts → dist/utils/url.js} +6 -7
  129. package/package.json +56 -14
  130. package/PUBLISHING.md +0 -33
  131. package/__tests__/AesManager.test.ts +0 -53
  132. package/__tests__/CryptographyService.test.ts +0 -194
  133. package/__tests__/bundle.test.ts +0 -29
  134. package/__tests__/content.test.ts +0 -72
  135. package/__tests__/crypto-encode-decode.test.ts +0 -52
  136. package/__tests__/crypto-hmac.test.ts +0 -21
  137. package/__tests__/did-generateServiceId.errors.test.ts +0 -8
  138. package/__tests__/did-generateServiceId.test.ts +0 -18
  139. package/__tests__/models-clinical-sections.test.ts +0 -32
  140. package/__tests__/models-multibase58.test.ts +0 -33
  141. package/__tests__/multibase58.errors.test.ts +0 -7
  142. package/__tests__/multibase58.test.ts +0 -28
  143. package/__tests__/multibasehash.test.ts +0 -25
  144. package/__tests__/utils-actor.test.ts +0 -46
  145. package/__tests__/utils-base-convert.test.ts +0 -57
  146. package/__tests__/utils-baseN.test.ts +0 -40
  147. package/__tests__/utils-did-extra.test.ts +0 -33
  148. package/__tests__/utils-format-converter.test.ts +0 -87
  149. package/__tests__/utils-jwt.test.ts +0 -57
  150. package/__tests__/utils-manager-error.test.ts +0 -11
  151. package/__tests__/utils-normalize.test.ts +0 -15
  152. package/__tests__/utils-object-convert.test.ts +0 -38
  153. package/__tests__/utils-string-convert.test.ts +0 -20
  154. package/__tests__/utils-string-utils.test.ts +0 -25
  155. package/__tests__/utils-url.test.ts +0 -21
  156. package/babel.config.cjs +0 -5
  157. package/jest.config.ts +0 -47
  158. package/src/AesManager.ts +0 -82
  159. package/src/CryptographyService.ts +0 -461
  160. package/src/JweManager.ts.txt +0 -365
  161. package/src/KmsService.txt +0 -493
  162. package/src/constants/Schemas.ts +0 -61
  163. package/src/cryptoDecode.ts +0 -104
  164. package/src/cryptoEncode.ts +0 -36
  165. package/src/interfaces/ICryptoHelper.ts +0 -33
  166. package/src/interfaces/ICryptography.ts +0 -177
  167. package/src/interfaces/IWallet.ts +0 -62
  168. package/src/models/aes.ts +0 -93
  169. package/src/models/auth.ts +0 -38
  170. package/src/models/bundle.txt +0 -93
  171. package/src/models/clinical-sections.en.ts +0 -82
  172. package/src/models/clinical-sections.ts +0 -64
  173. package/src/models/comm.ts +0 -63
  174. package/src/models/confidential-message.ts +0 -137
  175. package/src/models/device-license.ts +0 -161
  176. package/src/models/indexing.ts +0 -20
  177. package/src/models/issue.ts +0 -85
  178. package/src/models/jsonapi.ts +0 -19
  179. package/src/models/jwt.ts +0 -15
  180. package/src/models/multibase58.ts +0 -46
  181. package/src/models/oidc4ida.common.model.ts +0 -39
  182. package/src/models/oidc4ida.document.model.ts +0 -61
  183. package/src/models/openid-device.ts +0 -146
  184. package/src/models/operation-outcome.ts +0 -34
  185. package/src/models/resource-document.ts +0 -21
  186. package/src/models/response.ts +0 -5
  187. package/src/models/urlPath.ts +0 -76
  188. package/src/models/verifiable-credential.ts +0 -52
  189. package/src/types/noble-hashes.d.ts +0 -4
  190. package/src/utils/actor.ts +0 -56
  191. package/src/utils/baseN.ts +0 -203
  192. package/src/utils/bundle.ts +0 -30
  193. package/src/utils/did.ts +0 -155
  194. package/src/utils/format-converter.ts +0 -119
  195. package/src/utils/jwt.ts +0 -165
  196. package/src/utils/manager-error.ts +0 -27
  197. package/src/utils/multibase58.ts +0 -46
  198. package/tsconfig.json +0 -15
  199. /package/{src/constants/index.ts → dist/constants/index.d.ts} +0 -0
  200. /package/{src/index.ts → dist/index.d.ts} +0 -0
  201. /package/{src/models/index.ts → dist/models/index.d.ts} +0 -0
  202. /package/{src/utils/index.ts → dist/utils/index.d.ts} +0 -0
@@ -1,10 +1,4 @@
1
- // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- // File: crypto-ts/models/oidc4ida.electronicRecord.model.ts
3
-
4
1
  import { AttachmentExternalDLT, CheckDetails, VerifierDLT } from './oidc4ida.common.model';
5
-
6
- // TODO: IssuerElectronicRecordOpenID with personal_number
7
-
8
2
  /** OpenID 'electronic_record' evidence sub-element base data
9
3
  * to be extended with 'attachments' and 'record' elements for blockchain or OpenID Evidence of Electronic Record
10
4
  * The electronic health record can be about a VC, SHC, DGC, FHIR Bundle or single resource (e.g.: a single medical record).
@@ -14,12 +8,11 @@ import { AttachmentExternalDLT, CheckDetails, VerifierDLT } from './oidc4ida.com
14
8
  * - 'time': Time stamp in ISO 8601:2004 format representing the date when it was verified.
15
9
  */
16
10
  export interface EvidenceElectronicRecordBase {
17
- check_details?: CheckDetails[]; // OPTIONAL. Checks done in relation to the evidence. https://bitbucket.org/openid/ekyc-ida/wiki/identifiers
18
- time?: string; // OPTIONAL. Time stamp in ISO 8601:2004 [ISO8601-2004] YYYY-MM-DDThh:mm[:ss]TZD format representing the date when it was verified
19
- type?: 'electronic_record'; // REQUIRED but not stored on blockchain in case of FHIR resources (they always are 'electronic_records').
20
- verifier?: VerifierDLT; // OPTIONAL. A JSON object denoting the legal entity that performed the identity verification on behalf of the OP.
11
+ check_details?: CheckDetails[];
12
+ time?: string;
13
+ type?: 'electronic_record';
14
+ verifier?: VerifierDLT;
21
15
  }
22
-
23
16
  /** OpenID 'electronic_record' evidence sub-element for blockchain.
24
17
  * The electronic health record can be about a VC, SHC, DGC, FHIR Bundle or single resource (e.g.: a single medical record).
25
18
  * - 'record': 'source' (issuer), 'personal_number' (subject's DID), 'created_at', 'date_of_expiry', 'type' ('idcard' or 'vc', 'shc', 'dgc', 'fhir', etc: see 'Electronic Records' at https://bitbucket.org/openid/ekyc-ida/wiki/identifiers)
@@ -32,13 +25,10 @@ export interface EvidenceElectronicRecordBase {
32
25
  *
33
26
  * NOTE: 'document_details' is not for electronic records (use 'record' instead).
34
27
  */
35
- export interface EvidenceElectronicRecordDLT extends
36
- EvidenceElectronicRecordBase // 'type', 'validation_method', 'verification_method', 'verifier', 'time'
37
- {
38
- attachments?: AttachmentExternalDLT[]; // OPTIONAL. Array of JSON objects representing attachments like photocopies of documents or certificates.
39
- record?: ElectronicRecordDLT; // JSON object representing the id document used to perform the id verification
28
+ export interface EvidenceElectronicRecordDLT extends EvidenceElectronicRecordBase {
29
+ attachments?: AttachmentExternalDLT[];
30
+ record?: ElectronicRecordDLT;
40
31
  }
41
-
42
32
  /** OpenID 'electronic_record' evidence sub-element can be about an ID card, VC, SHC, DGC, etc.
43
33
  * - 'type': can be 'idcard', 'vc', 'shc', 'dgc', 'fhir', etc (see 'Electronic Records' at https://bitbucket.org/openid/ekyc-ida/wiki/identifiers)
44
34
  * - 'created_at': is the same as 'validFrom' property in a W3C credential.
@@ -48,13 +38,11 @@ export interface EvidenceElectronicRecordDLT extends
48
38
  * NOTE: 'personal_number' (subject DID URI) is not excluded for now?
49
39
  */
50
40
  export interface ElectronicRecordBase {
51
- type: string; // REQUIRED. string;denoting the type of electronic record. See https://bitbucket.org/openid/ekyc-ida/wiki/identifiers
52
- created_at?: string; // OPTIONAL. The time the record was created as ISO 8601:2004 [ISO8601-2004] YYYY-MM-DDThh:mm[:ss]TZD format date_of_expiry?: string; // REQUIRED. If this attribute exists for the particular type of document. The date the document will expire as ISO 8601:2004 YYYY-MM-DD format.
53
- date_of_expiry?: string; // OPTIONAL. The date the evidence will expire as ISO 8601:2004 [ISO8601-2004] YYYY-MM-DD format.
54
- source?: IssuerElectronicRecordBase; // OPTIONAL. Issuer as source of the record (can have jurisdiction and )
55
- // personal_number?: string; // OPTIONAL. Subject DID URI (it can be also the holder ID).
41
+ type: string;
42
+ created_at?: string;
43
+ date_of_expiry?: string;
44
+ source?: IssuerElectronicRecordBase;
56
45
  }
57
-
58
46
  /** OpenID 'electronic_record' evidence sub-element can be about a VC, SHC of DGC.
59
47
  * - 'type': String denoting the type of electronic record. It can be a predefined value (idcard, etc) or 'vc', 'shc', 'dgc', 'fhir', etc (see 'Electronic Records' at https://bitbucket.org/openid/ekyc-ida/wiki/identifiers)
60
48
  * - 'created_at' is the issued property.
@@ -62,25 +50,18 @@ export interface ElectronicRecordBase {
62
50
  * NOTE:
63
51
  * - 'personal_number' (subject DID) is excluded for now? (it is also the same as the 'holder.id' property in VC).
64
52
  */
65
- export interface ElectronicRecordDLT extends
66
- ElectronicRecordBase // 'type', 'personal_number', 'created_at', 'date_of_expiry'
67
- {
68
- source?: IssuerElectronicRecordDLT; // OPTIONAL. Issuer as source of the record (API can set the name and jurisdiction for the OpenID source element)
53
+ export interface ElectronicRecordDLT extends ElectronicRecordBase {
54
+ source?: IssuerElectronicRecordDLT;
69
55
  }
70
-
71
56
  /** Issuer's anonymized information (can be used for research purposes) */
72
57
  export interface IssuerElectronicRecordBase {
73
- country_code?: string; // ISO 3166/ICAO 3-letter codes [ICAO-Doc9303]. 2-letter ISO 3166/ICAO codes MAY be used in some circumstances for compatibility reasons.
74
- jurisdiction?: string; // ISO: String containing the region(s) / state(s) / province(s) / municipality(ies) that source has jurisdiction over
75
- // postal_code?:string; // Zip code or postal code component.
58
+ country_code?: string;
59
+ jurisdiction?: string;
76
60
  }
77
-
78
61
  /** It replaces the issuer 'name' by 'id' and 'type' (for blockchain)
79
62
  * and also includes 'country' and 'region' (but not 'postal_code', 'locality' or 'stree_address').
80
63
  */
81
- export interface IssuerElectronicRecordDLT extends
82
- IssuerElectronicRecordBase
83
- {
84
- id?: string; // custom UHC property instead of 'name'
85
- type?: string; // custom UHC property
64
+ export interface IssuerElectronicRecordDLT extends IssuerElectronicRecordBase {
65
+ id?: string;
66
+ type?: string;
86
67
  }
@@ -0,0 +1,3 @@
1
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // File: crypto-ts/models/oidc4ida.electronicRecord.model.ts
3
+ export {};
@@ -1,9 +1,5 @@
1
- // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- // File: crypto-ts/models/oidc4ida.evidence.model.ts
3
-
4
1
  import { EvidenceDocumentDLT } from "./oidc4ida.document.model";
5
2
  import { EvidenceElectronicRecordDLT } from "./oidc4ida.electronicRecord.model";
6
-
7
3
  /** W3C Evidence for VCs can be generated by the API from some OpenID evidence stored on blockchain.
8
4
  * See EBSI v2: https://ec.europa.eu/digital-building-blocks/wikis/display/EBSIDOC/Verifiable+Attestation
9
5
  * - id: OPTIONAL. If present, it MUST contain a URL that points to where more information about this instance of evidence can be found (e.g.: urn:unid:uhc:vc:xyz or e.g.: "https://example.edu/evidence/f2aeec97-fc0d-42bf-8ca7-0548192dxyzab")
@@ -14,42 +10,35 @@ import { EvidenceElectronicRecordDLT } from "./oidc4ida.electronicRecord.model";
14
10
  * - documentPresence: REQUIRED. Defines how the document(s) which have been verified before Verifiable Credentials issuance have been provided, e.g.: 'Physical' or 'Digital'
15
11
  */
16
12
  export interface EvidenceW3C {
17
- id?: string;
18
- type?: string[];
19
- verifier?: string;
20
- evidenceDocument?: string;
21
- subjectPresence?: string;
22
- documentPresence?: string;
13
+ id?: string;
14
+ type?: string[];
15
+ verifier?: string;
16
+ evidenceDocument?: string;
17
+ subjectPresence?: string;
18
+ documentPresence?: string;
23
19
  }
24
-
25
20
  /** OpenID 'electronic_signature' evidence sub-element
26
21
  * 'serial_number' can be the DID of the public key for doing the verification process instead of the serial number of a certificate.
27
22
  */
28
- export interface EvidenceElectronicSignatureBase{
29
- type: 'electronic_signature'; // REQUIRED: Fixed to 'electronic_signature'
30
- signature_type: string; // REQUIRED. Type of signature used as evidence. The value range might be restricted by the respective trust framework.
31
- issuer: string; // REQUIRED. Certification authority that issued the signer's certificate.
32
- serial_number: string; // REQUIRED. DID#KID or Serial number of the certificate used to sign.
33
- created_at: string; // REQUIRED. The time the signature was created as ISO 8601:2004 YYYY-MM-DDThh:mm:ss±hh format
23
+ export interface EvidenceElectronicSignatureBase {
24
+ type: 'electronic_signature';
25
+ signature_type: string;
26
+ issuer: string;
27
+ serial_number: string;
28
+ created_at: string;
34
29
  }
35
-
36
30
  /** The used language is not specified, but is usually bound to the jurisdiction of the underlying trust framework of the OP. */
37
31
  export interface AttachedSignatureDLT {
38
- // desc?: string; // OPTIONAL. Description of the document. This can be the filename or just an explanation of the content (e.g. "Back of id document")
39
- content_type: string; // e.g.: 'jws'
40
- content: string; // e.g. detached signature string (compact JWS) or bytes encoded in Base64
32
+ content_type: string;
33
+ content: string;
41
34
  }
42
-
43
35
  /** OpenID 'electronic_signature' evidence sub-element
44
36
  * 'serial_number' can be the DID of the public key for doing the verification process instead of the serial number of a certificate.
45
37
  * It also contains 'type', 'signature_type', 'issuer', 'serial_number', 'created_at' and external 'attachments' with 'digest.alg' and 'digest.value'.
46
38
  */
47
- export interface EvidenceElectronicSignatureDLT extends
48
- EvidenceElectronicSignatureBase // 'type', 'signature_type', 'issuer', 'serial_number', 'created_at'
49
- {
50
- attachments?: AttachedSignatureDLT[]; // OPTIONAL. Array of JSON objects containing signatures, e.g. 'jws' or 'Ed25519' signature types.
39
+ export interface EvidenceElectronicSignatureDLT extends EvidenceElectronicSignatureBase {
40
+ attachments?: AttachedSignatureDLT[];
51
41
  }
52
-
53
42
  /** Evidence is the certification of the authenticity of some (physical) document, (electronic) record, (electronic) signature, (utility) bill or vouch.
54
43
  * OpenID Connect for Identity Assurance 1.0: https://openid.net/specs/openid-connect-4-identity-assurance-1_0.html
55
44
  * 5.1.1. Evidence Element - types of evidence:
@@ -59,11 +48,4 @@ export interface EvidenceElectronicSignatureDLT extends
59
48
  * - utility_bill: Verification based on a utility bill (this is to be deprecated in future releases and implementers are recommended to use the document type instead).
60
49
  * - electronic_signature: Verification based on an electronic signature.
61
50
  */
62
- export type EvidenceObjectDLT =
63
- EvidenceElectronicRecordDLT // e.g.: VC, SHC, DGC, FHIR record, etc.
64
- | EvidenceDocumentDLT // e.g.: evidence of a physical document
65
- | EvidenceElectronicSignatureDLT // evidence from a digital certificate signature (e.g. PDF document)
66
- // | EvidenceVouchDLT
67
- // | EvidenceBillDLT
68
-
69
-
51
+ export type EvidenceObjectDLT = EvidenceElectronicRecordDLT | EvidenceDocumentDLT | EvidenceElectronicSignatureDLT;
@@ -0,0 +1,5 @@
1
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // File: crypto-ts/models/oidc4ida.evidence.model.ts
3
+ export {};
4
+ // | EvidenceVouchDLT
5
+ // | EvidenceBillDLT
@@ -0,0 +1,119 @@
1
+ /**
2
+ * @fileoverview Defines data models for device registration based on OpenID Connect Dynamic Client Registration 1.0,
3
+ * with custom extensions for native device information.
4
+ * @see https://openid.net/specs/openid-connect-registration-1_0.html
5
+ */
6
+ import { JwkSet } from "./jwk";
7
+ /**
8
+ * Represents the information about the physical device being registered.
9
+ * This is a custom extension to the OpenID DCR standard.
10
+ */
11
+ export interface OpenIdDeviceInfo {
12
+ /**
13
+ * The push notification token for the device.
14
+ * @example "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"
15
+ */
16
+ push_token: string;
17
+ /**
18
+ * The push notification provider.
19
+ * @example "expo"
20
+ */
21
+ push_provider: string;
22
+ /**
23
+ * A unique identifier for the device, such as the OS internal build ID.
24
+ * @example "19.6.0"
25
+ */
26
+ device_id: string;
27
+ /**
28
+ * A user-friendly name for the device.
29
+ * @example "John's iPhone"
30
+ */
31
+ device_name: string;
32
+ }
33
+ /**
34
+ * Represents the request payload for Dynamic Client Registration,
35
+ * based on OpenID Connect Registration 1.0.
36
+ * The `body` of the DIDComm message will contain this object.
37
+ * @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationRequest
38
+ */
39
+ export interface DcrRegistrationRequest {
40
+ /**
41
+ * Array of redirection URIs for use in redirect-based flows. For a native app,
42
+ * this could be a custom scheme URI.
43
+ * @example ["myapp://callback"]
44
+ */
45
+ redirect_uris: string[];
46
+ /**
47
+ * Kind of the application. The only supported value is 'native'.
48
+ */
49
+ application_type?: 'native';
50
+ /**
51
+ * Human-readable name of the client to be presented to the end-user.
52
+ * @example "My Awesome App"
53
+ */
54
+ client_name?: string;
55
+ /**
56
+ * URL of the home page of the client.
57
+ */
58
+ client_uri?: string;
59
+ /**
60
+ * Requested authentication method for the token endpoint.
61
+ * For apps using public keys, 'private_key_jwt' is common.
62
+ * 'none' can be used for public clients.
63
+ */
64
+ token_endpoint_auth_method?: 'none' | 'private_key_jwt';
65
+ /**
66
+ * A list of OAuth 2.0 grant types that the client will restrict itself to using.
67
+ */
68
+ grant_types?: ('authorization_code' | 'implicit' | 'refresh_token' | 'client_credentials')[];
69
+ /**
70
+ * URL for the client's JSON Web Key Set [JWK] document. If the client signs requests to the Server,
71
+ * it contains the signing key(s) the Server uses to validate signatures from the Client.
72
+ */
73
+ jwks_uri?: string;
74
+ /**
75
+ * JSON Web Key Set containing the client's public keys.
76
+ * REQUIRED if `jwks_uri` is not provided.
77
+ */
78
+ jwks?: JwkSet;
79
+ /**
80
+ * Custom data about the specific device instance being registered.
81
+ * This is prefixed to avoid collision with standard fields.
82
+ */
83
+ ext_device_info?: OpenIdDeviceInfo;
84
+ }
85
+ /**
86
+ * Represents the response payload for a successful Dynamic Client Registration,
87
+ * based on OpenID Connect Registration 1.0.
88
+ * This object will be nested inside the `resource` of the final BundleEntry.
89
+ * @see https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationResponse
90
+ */
91
+ export interface DcrRegistrationResponse {
92
+ /**
93
+ * Unique client identifier.
94
+ */
95
+ client_id: string;
96
+ /**
97
+ * Time at which the client_id was issued, represented as a Unix timestamp.
98
+ */
99
+ client_id_issued_at: number;
100
+ /**
101
+ * The client secret. For public clients or those using JWTs for client authentication,
102
+ * this may not be returned.
103
+ */
104
+ client_secret?: string;
105
+ /**
106
+ * Time at which the client_secret will expire, represented as a Unix timestamp.
107
+ * If 0, the secret does not expire.
108
+ */
109
+ client_secret_expires_at?: number;
110
+ /**
111
+ * A registration access token that can be used at the client configuration endpoint
112
+ * to perform subsequent operations upon the client registration.
113
+ */
114
+ registration_access_token?: string;
115
+ /**
116
+ * URL of the client's configuration endpoint.
117
+ */
118
+ registration_client_uri?: string;
119
+ }
@@ -0,0 +1,3 @@
1
+ // src/models/openid-device.ts
2
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
3
+ export {};
@@ -0,0 +1,26 @@
1
+ import { IssueLevel, IssueTypeCode } from './issue';
2
+ /**
3
+ * A single detail associated with an operation, based on a simplified FHIR structure.
4
+ * Renamed from 'Issue' to be more neutral for potential success reporting.
5
+ */
6
+ export interface OperationOutcomeDetails {
7
+ /**
8
+ * Indicates the severity of the detail.
9
+ */
10
+ severity: IssueLevel;
11
+ /**
12
+ * A code classifying the type of detail.
13
+ */
14
+ code: IssueTypeCode;
15
+ /**
16
+ * Additional diagnostic information, such as a stack trace or detailed error message.
17
+ */
18
+ diagnostics?: string;
19
+ }
20
+ /**
21
+ * A structured response detailing the result of an operation, based on a simplified FHIR structure.
22
+ */
23
+ export interface OperationOutcome {
24
+ resourceType: 'OperationOutcome';
25
+ issue: OperationOutcomeDetails[];
26
+ }
@@ -0,0 +1,3 @@
1
+ // src/models/fhir/operation-outcome.ts
2
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
3
+ export {};
@@ -1,6 +1,3 @@
1
- // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- // File: crypto-ts/models/params.ts
3
-
4
1
  /**
5
2
  * Represents a interoperable claim for all specifications.
6
3
  */
@@ -15,7 +12,6 @@ export interface ClaimInteroperable {
15
12
  */
16
13
  value: any;
17
14
  }
18
-
19
15
  /**
20
16
  * Represents a single, named piece of data within an entity's configuration,
21
17
  * aligning with the structure of a Parameter in the FHIR Parameters resource.
@@ -28,32 +24,28 @@ export interface ClaimInteroperable {
28
24
  * @see {@link https://hl7.org/fhir/parameters.html}
29
25
  */
30
26
  export interface ParamAttribute extends ClaimInteroperable {
31
- /**
32
- * The name of the parameter, which often corresponds to a key in the
33
- * 'indexed' attributes dictionary of the parent configuration.
34
- *
35
- * @example 'NNES' (for a Spanish DNI, unique=true)
36
- * @example 'email' (unique=falsez)
37
- */
38
- name: string;
39
-
40
- /**
41
- * The original value of the parameter. Can be either a string or a number.
42
- * This corresponds to a simplified `value[x]` (e.g., `valueString`) in a FHIR Parameter.
43
- */
44
- value: string | number | undefined;
45
-
46
- /**
47
- * A custom flag to indicate whether this attribute's value is expected to
48
- * be unique across all entities of the same type. This is used for
49
- * server-side validation logic and is not part of the FHIR standard.
50
- * @default false
51
- */
52
- unique?: boolean;
27
+ /**
28
+ * The name of the parameter, which often corresponds to a key in the
29
+ * 'indexed' attributes dictionary of the parent configuration.
30
+ *
31
+ * @example 'NNES' (for a Spanish DNI, unique=true)
32
+ * @example 'email' (unique=falsez)
33
+ */
34
+ name: string;
35
+ /**
36
+ * The original value of the parameter. Can be either a string or a number.
37
+ * This corresponds to a simplified `value[x]` (e.g., `valueString`) in a FHIR Parameter.
38
+ */
39
+ value: string | number | undefined;
40
+ /**
41
+ * A custom flag to indicate whether this attribute's value is expected to
42
+ * be unique across all entities of the same type. This is used for
43
+ * server-side validation logic and is not part of the FHIR standard.
44
+ * @default false
45
+ */
46
+ unique?: boolean;
53
47
  }
54
-
55
48
  export type ParameterType = 'number' | 'date' | 'string' | 'token' | 'reference' | 'composite' | 'quantity' | 'uri' | 'period';
56
-
57
49
  /**
58
50
  * Represents a common interface for all types of parameters.
59
51
  */
@@ -103,7 +95,6 @@ export interface ParameterData extends ParamAttribute {
103
95
  */
104
96
  appliesTo?: string[];
105
97
  }
106
-
107
98
  export interface StringSearchParameter extends ParameterData {
108
99
  type: 'string';
109
100
  value: string;
@@ -0,0 +1,3 @@
1
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // File: crypto-ts/models/params.ts
3
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A flexible record type for claims objects.
3
+ */
4
+ export type ClaimsRecord = Record<string, any>;
5
+ export interface RecordBase {
6
+ id: string;
7
+ }
8
+ /**
9
+ * Represents the configuration metadata for a vault.
10
+ * As defined in the original database abstract layer.
11
+ */
12
+ export interface VaultConfig extends RecordBase {
13
+ custodian?: string;
14
+ }
@@ -0,0 +1,3 @@
1
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // File: crypto-ts/models/resource-document.ts
3
+ export {};
@@ -0,0 +1 @@
1
+ export type { IDecodedDidcommPayload } from './confidential-message';
@@ -0,0 +1,3 @@
1
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // File: crypto-ts/models/response.ts
3
+ export {};
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Defines the standardized business sectors supported by the gateway.
3
+ * Using an enum ensures type safety and prevents the use of arbitrary strings.
4
+ */
5
+ export declare enum Sector {
6
+ TEST = "test",// For mock/demo endpoints and host registry in tests
7
+ SYSTEM = "system",// Reserved for the host's bootstrap operation (TODO: deprecate)
8
+ HEALTH_CARE = "health-care",
9
+ HEALTH_INSURANCE = "health-insurance",
10
+ EMERGENCY = "emergency",
11
+ RESEARCH = "research"
12
+ }
13
+ export declare enum Section {
14
+ /** Managing registration of organizations */
15
+ registry = "registry",
16
+ /** Managing data of the hosted organization */
17
+ entity = "entity",
18
+ /** Managing data of the hosted individual */
19
+ individual = "individual",
20
+ /** Managing data in the blockchain network */
21
+ network = "network"
22
+ }
23
+ /** Standards, specifications and formats for data supported in the url path */
24
+ export declare enum Format {
25
+ Schema = "org.schema",
26
+ FhirApi = "org.hl7.fhir.api"
27
+ }
28
+ /** Types of resources supported in the url path */
29
+ export declare enum Resource {
30
+ Person = "Person",
31
+ RelatedPerson = "RelatedPerson",
32
+ Employee = "Emloyee",
33
+ EmployeeRole = "EmloyeeRole",
34
+ Practitioner = "Practitioner",
35
+ PractitionerRole = "PractitionerRole",
36
+ Organization = "Organization",
37
+ Location = "Location",
38
+ Group = "Group"
39
+ }
40
+ export declare enum JobAction {
41
+ "_batch" = "_batch",
42
+ "_create" = "_create",
43
+ "_discovery" = "_discovery"
44
+ }
45
+ export declare enum knownDomainsReversedEnum {
46
+ 'org.schema' = "org.schema",
47
+ 'org.hl7.fhir.api' = "org.hl7.fhir.api",
48
+ 'org.hl7.fhir.r4' = "org.hl7.fhir.r4",
49
+ 'org.ilo.isco' = "org.ilo.isco",
50
+ 'net.openid' = "net.openid"
51
+ }
52
+ /**
53
+ * A list of known, fully-qualified context prefixes in reverse DNS format.
54
+ * This is used by the claim normalization utility to identify claims that
55
+ * are already interoperable and should not be modified.
56
+ * All entries should be in lowercase.
57
+ */
58
+ export declare const knownDomainsReversed: string[];
@@ -0,0 +1,76 @@
1
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // File: crypto-ts/models/urlPath.ts
3
+ /**
4
+ * Defines the standardized business sectors supported by the gateway.
5
+ * Using an enum ensures type safety and prevents the use of arbitrary strings.
6
+ */
7
+ export var Sector;
8
+ (function (Sector) {
9
+ Sector["TEST"] = "test";
10
+ Sector["SYSTEM"] = "system";
11
+ Sector["HEALTH_CARE"] = "health-care";
12
+ Sector["HEALTH_INSURANCE"] = "health-insurance";
13
+ Sector["EMERGENCY"] = "emergency";
14
+ Sector["RESEARCH"] = "research";
15
+ })(Sector || (Sector = {}));
16
+ export var Section;
17
+ (function (Section) {
18
+ /** Managing registration of organizations */
19
+ Section["registry"] = "registry";
20
+ /** Managing data of the hosted organization */
21
+ Section["entity"] = "entity";
22
+ /** Managing data of the hosted individual */
23
+ Section["individual"] = "individual";
24
+ /** Managing data in the blockchain network */
25
+ Section["network"] = "network";
26
+ })(Section || (Section = {}));
27
+ /** Standards, specifications and formats for data supported in the url path */
28
+ export var Format;
29
+ (function (Format) {
30
+ Format["Schema"] = "org.schema";
31
+ Format["FhirApi"] = "org.hl7.fhir.api";
32
+ //Pdf' = 'pdf',
33
+ })(Format || (Format = {}));
34
+ /** Types of resources supported in the url path */
35
+ export var Resource;
36
+ (function (Resource) {
37
+ Resource["Person"] = "Person";
38
+ Resource["RelatedPerson"] = "RelatedPerson";
39
+ Resource["Employee"] = "Emloyee";
40
+ Resource["EmployeeRole"] = "EmloyeeRole";
41
+ Resource["Practitioner"] = "Practitioner";
42
+ Resource["PractitionerRole"] = "PractitionerRole";
43
+ Resource["Organization"] = "Organization";
44
+ Resource["Location"] = "Location";
45
+ Resource["Group"] = "Group";
46
+ })(Resource || (Resource = {}));
47
+ export var JobAction;
48
+ (function (JobAction) {
49
+ JobAction["_batch"] = "_batch";
50
+ JobAction["_create"] = "_create";
51
+ JobAction["_discovery"] = "_discovery";
52
+ })(JobAction || (JobAction = {}));
53
+ export var knownDomainsReversedEnum;
54
+ (function (knownDomainsReversedEnum) {
55
+ knownDomainsReversedEnum["org.schema"] = "org.schema";
56
+ knownDomainsReversedEnum["org.hl7.fhir.api"] = "org.hl7.fhir.api";
57
+ knownDomainsReversedEnum["org.hl7.fhir.r4"] = "org.hl7.fhir.r4";
58
+ knownDomainsReversedEnum["org.ilo.isco"] = "org.ilo.isco";
59
+ knownDomainsReversedEnum["net.openid"] = "net.openid";
60
+ // Add other known standards here
61
+ })(knownDomainsReversedEnum || (knownDomainsReversedEnum = {}));
62
+ ;
63
+ /**
64
+ * A list of known, fully-qualified context prefixes in reverse DNS format.
65
+ * This is used by the claim normalization utility to identify claims that
66
+ * are already interoperable and should not be modified.
67
+ * All entries should be in lowercase.
68
+ */
69
+ export const knownDomainsReversed = [
70
+ knownDomainsReversedEnum["org.schema"],
71
+ knownDomainsReversedEnum["org.hl7.fhir.api"],
72
+ knownDomainsReversedEnum["org.hl7.fhir.r4"],
73
+ knownDomainsReversedEnum["org.ilo.isco"],
74
+ knownDomainsReversedEnum["net.openid"]
75
+ // Add other known standards here
76
+ ];
@@ -0,0 +1,45 @@
1
+ import { EvidenceObjectDLT } from "./oidc4ida.evidence.model";
2
+ /**
3
+ * Defines the JSON-LD context URI for W3C Verifiable Credentials Data Model v2.0.
4
+ * This constant MUST be used for all V2 credential creations to ensure consistency.
5
+ * @see https://www.w3.org/TR/vc-data-model-2.0/#contexts
6
+ */
7
+ export declare const VC_CONTEXT_V2 = "https://www.w3.org/ns/credentials/v2";
8
+ /** ProofEBSIv2 foresees the possibility to use different types of proofs for Verifiable Credentials,
9
+ * such as proofs derived from eIDAS keys (qualified) to DID keys (unqualified).
10
+ * In EBSI 2.0, every V-ID will only contain a single proof, which must be derived from eIDAS keys.
11
+ * Definition: https://www.w3.org/TR/vc-data-model/#proofs-signatures
12
+ * See https://ec.europa.eu/digital-building-blocks/wikis/display/EBSIDOC/Verifiable+Attestation
13
+ * - 'created' is REQURED, it is the ISO 8601 original timestamp of the signature, it is not the same as credential.issued (tx timestamp) (in Aries go framework use *util.TimeWithTrailingZeroMsec instead of time.Time)
14
+ * - 'jws' is REQUIRED, it defines the detached JWS signature string "<base64url(protectedheader)>..<base64url(signature)>"
15
+ * - 'proofPurpose' is REQUIRED, e.g.: assertionMethod, authentication, keyAgreement, contractAgreement, capabilityInvocation, capabilityDelegation
16
+ * - 'type' is REQUIRED, e.g.: "JsonWebSignature2020", "BbsBlsSignature2020", "BbsBlsSignatureProof2020".
17
+ * - 'verificationMethod' is REQUIRED, it is the 'urndid#keyId' to verify the signature by using the issuer's public signature key.
18
+ */
19
+ export interface ProofEBSIv2 {
20
+ created?: string;
21
+ jws?: string;
22
+ proofPurpose?: string;
23
+ type: string;
24
+ verificationMethod?: string;
25
+ }
26
+ /**
27
+ * Defines the structure for a W3C Verifiable Credential.
28
+ * The credentialSubject can be any object containing the claims.
29
+ * @see https://www.w3.org/TR/vc-data-model-2.0/#verifiable-credentials
30
+ */
31
+ export interface VerifiableCredentialV2 {
32
+ '@context': string[];
33
+ id?: string;
34
+ type: string[];
35
+ /** Claims about the subject, such as the "identifier" or subject's URN */
36
+ credentialSubject: Record<string, any>;
37
+ /** Evidence for Identity Assurance: https://openid.net/specs/openid-ida-verified-claims-1_0-final.html#section-5.4.4 */
38
+ evidence?: EvidenceObjectDLT[];
39
+ /** The issuer is the creator (e.g., "did:web:gateway.example.com"), but could be distinct to the signer of a proof */
40
+ issuer: string;
41
+ /** Proof is optional during creation, but required for a signed VC */
42
+ proof?: ProofEBSIv2 | ProofEBSIv2[];
43
+ validFrom: string;
44
+ validUntil?: string;
45
+ }
@@ -0,0 +1,8 @@
1
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // File: crypto-ts/models/verifiable-credential.ts
3
+ /**
4
+ * Defines the JSON-LD context URI for W3C Verifiable Credentials Data Model v2.0.
5
+ * This constant MUST be used for all V2 credential creations to ensure consistency.
6
+ * @see https://www.w3.org/TR/vc-data-model-2.0/#contexts
7
+ */
8
+ export const VC_CONTEXT_V2 = 'https://www.w3.org/ns/credentials/v2';