@twin.org/identity-models 0.0.1-next.8 → 0.0.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.
Files changed (85) hide show
  1. package/dist/cjs/index.cjs +150 -21
  2. package/dist/esm/index.mjs +150 -22
  3. package/dist/types/factories/identityResolverConnectorFactory.d.ts +6 -0
  4. package/dist/types/index.d.ts +37 -11
  5. package/dist/types/models/IIdentityComponent.d.ts +134 -5
  6. package/dist/types/models/IIdentityConnector.d.ts +25 -29
  7. package/dist/types/models/IIdentityResolverComponent.d.ts +13 -0
  8. package/dist/types/models/IIdentityResolverConnector.d.ts +14 -0
  9. package/dist/types/models/api/identity/IIdentityCreateRequest.d.ts +14 -0
  10. package/dist/types/models/api/identity/IIdentityCreateResponse.d.ts +10 -0
  11. package/dist/types/models/api/identity/IIdentityProofCreateRequest.d.ts +33 -0
  12. package/dist/types/models/api/identity/IIdentityProofCreateResponse.d.ts +10 -0
  13. package/dist/types/models/api/identity/IIdentityProofVerifyRequest.d.ts +20 -0
  14. package/dist/types/models/api/identity/IIdentityProofVerifyResponse.d.ts +11 -0
  15. package/dist/types/models/api/identity/IIdentityRemoveRequest.d.ts +14 -0
  16. package/dist/types/models/api/identity/IIdentityServiceCreateRequest.d.ts +31 -0
  17. package/dist/types/models/api/identity/IIdentityServiceCreateResponse.d.ts +10 -0
  18. package/dist/types/models/api/identity/IIdentityServiceRemoveRequest.d.ts +18 -0
  19. package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateRequest.d.ts +36 -0
  20. package/dist/types/models/api/identity/IIdentityVerifiableCredentialCreateResponse.d.ts +19 -0
  21. package/dist/types/models/api/identity/IIdentityVerifiableCredentialRevokeRequest.d.ts +18 -0
  22. package/dist/types/models/api/identity/IIdentityVerifiableCredentialUnrevokeRequest.d.ts +18 -0
  23. package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyRequest.d.ts +14 -0
  24. package/dist/types/models/api/identity/IIdentityVerifiableCredentialVerifyResponse.d.ts +19 -0
  25. package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateRequest.d.ts +45 -0
  26. package/dist/types/models/api/identity/IIdentityVerifiablePresentationCreateResponse.d.ts +19 -0
  27. package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyRequest.d.ts +14 -0
  28. package/dist/types/models/api/identity/IIdentityVerifiablePresentationVerifyResponse.d.ts +23 -0
  29. package/dist/types/models/api/identity/IIdentityVerificationMethodCreateRequest.d.ts +28 -0
  30. package/dist/types/models/api/identity/IIdentityVerificationMethodCreateResponse.d.ts +10 -0
  31. package/dist/types/models/api/identity/IIdentityVerificationMethodRemoveRequest.d.ts +18 -0
  32. package/dist/types/models/api/{IIdentityProfileListRequest.d.ts → profile/IIdentityProfileListRequest.d.ts} +1 -1
  33. package/dist/types/models/api/{IIdentityResolveRequest.d.ts → resolver/IIdentityResolveRequest.d.ts} +2 -2
  34. package/dist/types/utils/documentHelper.d.ts +33 -2
  35. package/dist/types/utils/verificationHelper.d.ts +29 -0
  36. package/docs/changelog.md +152 -1
  37. package/docs/reference/classes/DocumentHelper.md +122 -8
  38. package/docs/reference/classes/VerificationHelper.md +87 -0
  39. package/docs/reference/index.md +27 -5
  40. package/docs/reference/interfaces/IIdentityComponent.md +500 -6
  41. package/docs/reference/interfaces/IIdentityConnector.md +150 -130
  42. package/docs/reference/interfaces/IIdentityCreateRequest.md +17 -0
  43. package/docs/reference/interfaces/IIdentityCreateResponse.md +11 -0
  44. package/docs/reference/interfaces/IIdentityProfileComponent.md +62 -50
  45. package/docs/reference/interfaces/IIdentityProfileConnector.md +60 -44
  46. package/docs/reference/interfaces/IIdentityProfileGetPublicResponse.md +2 -2
  47. package/docs/reference/interfaces/IIdentityProfileListRequest.md +1 -1
  48. package/docs/reference/interfaces/IIdentityProofCreateRequest.md +43 -0
  49. package/docs/reference/interfaces/IIdentityProofCreateResponse.md +11 -0
  50. package/docs/reference/interfaces/IIdentityProofVerifyRequest.md +23 -0
  51. package/docs/reference/interfaces/IIdentityProofVerifyResponse.md +15 -0
  52. package/docs/reference/interfaces/IIdentityRemoveRequest.md +17 -0
  53. package/docs/reference/interfaces/IIdentityResolveRequest.md +3 -3
  54. package/docs/reference/interfaces/IIdentityResolverComponent.md +29 -0
  55. package/docs/reference/interfaces/IIdentityResolverConnector.md +33 -0
  56. package/docs/reference/interfaces/IIdentityServiceCreateRequest.md +43 -0
  57. package/docs/reference/interfaces/IIdentityServiceCreateResponse.md +11 -0
  58. package/docs/reference/interfaces/IIdentityServiceRemoveRequest.md +23 -0
  59. package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateRequest.md +49 -0
  60. package/docs/reference/interfaces/IIdentityVerifiableCredentialCreateResponse.md +23 -0
  61. package/docs/reference/interfaces/IIdentityVerifiableCredentialRevokeRequest.md +23 -0
  62. package/docs/reference/interfaces/IIdentityVerifiableCredentialUnrevokeRequest.md +23 -0
  63. package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyRequest.md +17 -0
  64. package/docs/reference/interfaces/IIdentityVerifiableCredentialVerifyResponse.md +23 -0
  65. package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateRequest.md +61 -0
  66. package/docs/reference/interfaces/IIdentityVerifiablePresentationCreateResponse.md +23 -0
  67. package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyRequest.md +17 -0
  68. package/docs/reference/interfaces/IIdentityVerifiablePresentationVerifyResponse.md +29 -0
  69. package/docs/reference/interfaces/IIdentityVerificationMethodCreateRequest.md +37 -0
  70. package/docs/reference/interfaces/IIdentityVerificationMethodCreateResponse.md +11 -0
  71. package/docs/reference/interfaces/IIdentityVerificationMethodRemoveRequest.md +23 -0
  72. package/docs/reference/variables/IdentityResolverConnectorFactory.md +5 -0
  73. package/locales/en.json +10 -4
  74. package/package.json +10 -10
  75. package/dist/types/models/identityRole.d.ts +0 -21
  76. package/docs/reference/type-aliases/IdentityRole.md +0 -5
  77. package/docs/reference/variables/IdentityRole.md +0 -25
  78. /package/dist/types/models/api/{IIdentityProfileCreateRequest.d.ts → profile/IIdentityProfileCreateRequest.d.ts} +0 -0
  79. /package/dist/types/models/api/{IIdentityProfileGetPublicRequest.d.ts → profile/IIdentityProfileGetPublicRequest.d.ts} +0 -0
  80. /package/dist/types/models/api/{IIdentityProfileGetPublicResponse.d.ts → profile/IIdentityProfileGetPublicResponse.d.ts} +0 -0
  81. /package/dist/types/models/api/{IIdentityProfileGetRequest.d.ts → profile/IIdentityProfileGetRequest.d.ts} +0 -0
  82. /package/dist/types/models/api/{IIdentityProfileGetResponse.d.ts → profile/IIdentityProfileGetResponse.d.ts} +0 -0
  83. /package/dist/types/models/api/{IIdentityProfileListResponse.d.ts → profile/IIdentityProfileListResponse.d.ts} +0 -0
  84. /package/dist/types/models/api/{IIdentityProfileUpdateRequest.d.ts → profile/IIdentityProfileUpdateRequest.d.ts} +0 -0
  85. /package/dist/types/models/api/{IIdentityResolveResponse.d.ts → resolver/IIdentityResolveResponse.d.ts} +0 -0
@@ -0,0 +1,23 @@
1
+ # Interface: IIdentityServiceRemoveRequest
2
+
3
+ Request to remove a service.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### identity
14
+
15
+ > **identity**: `string`
16
+
17
+ The identity to remove the service from.
18
+
19
+ #### serviceId
20
+
21
+ > **serviceId**: `string`
22
+
23
+ The service to remove.
@@ -0,0 +1,49 @@
1
+ # Interface: IIdentityVerifiableCredentialCreateRequest
2
+
3
+ Request to create a verifiable credential.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### identity
14
+
15
+ > **identity**: `string`
16
+
17
+ The identity to create the verification credential for.
18
+
19
+ #### verificationMethodId
20
+
21
+ > **verificationMethodId**: `string`
22
+
23
+ The verification method id to use.
24
+
25
+ ***
26
+
27
+ ### body
28
+
29
+ > **body**: `object`
30
+
31
+ The data for the request.
32
+
33
+ #### credentialId?
34
+
35
+ > `optional` **credentialId**: `string`
36
+
37
+ The id of the credential.
38
+
39
+ #### subject
40
+
41
+ > **subject**: `IJsonLdNodeObject`
42
+
43
+ The credential subject to store in the verifiable credential.
44
+
45
+ #### revocationIndex?
46
+
47
+ > `optional` **revocationIndex**: `number`
48
+
49
+ The bitmap revocation index of the credential, if undefined will not have revocation status.
@@ -0,0 +1,23 @@
1
+ # Interface: IIdentityVerifiableCredentialCreateResponse
2
+
3
+ Response to creating a verifiable credential.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `object`
10
+
11
+ The response payload.
12
+
13
+ #### verifiableCredential
14
+
15
+ > **verifiableCredential**: `IDidVerifiableCredential`
16
+
17
+ The verifiable credential that was created.
18
+
19
+ #### jwt
20
+
21
+ > **jwt**: `string`
22
+
23
+ The JWT token for the verifiable credential.
@@ -0,0 +1,23 @@
1
+ # Interface: IIdentityVerifiableCredentialRevokeRequest
2
+
3
+ Request to revoke a verifiable credential.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### identity
14
+
15
+ > **identity**: `string`
16
+
17
+ The identity to revoke the verification credential for.
18
+
19
+ #### revocationIndex
20
+
21
+ > **revocationIndex**: `number`
22
+
23
+ The revocation index to revoke.
@@ -0,0 +1,23 @@
1
+ # Interface: IIdentityVerifiableCredentialUnrevokeRequest
2
+
3
+ Request to unrevoke a verifiable credential.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### identity
14
+
15
+ > **identity**: `string`
16
+
17
+ The identity to unrevoke the verification credential for.
18
+
19
+ #### revocationIndex
20
+
21
+ > **revocationIndex**: `number`
22
+
23
+ The revocation index to unrevoke.
@@ -0,0 +1,17 @@
1
+ # Interface: IIdentityVerifiableCredentialVerifyRequest
2
+
3
+ Request to verify a verifiable credential.
4
+
5
+ ## Properties
6
+
7
+ ### query
8
+
9
+ > **query**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### jwt
14
+
15
+ > **jwt**: `string`
16
+
17
+ The jwt to verify.
@@ -0,0 +1,23 @@
1
+ # Interface: IIdentityVerifiableCredentialVerifyResponse
2
+
3
+ Response to verifying a verifiable credential.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `object`
10
+
11
+ The response payload.
12
+
13
+ #### revoked
14
+
15
+ > **revoked**: `boolean`
16
+
17
+ Has the credential been revoked.
18
+
19
+ #### verifiableCredential?
20
+
21
+ > `optional` **verifiableCredential**: `IDidVerifiableCredential`
22
+
23
+ The verifiable credential that was verified.
@@ -0,0 +1,61 @@
1
+ # Interface: IIdentityVerifiablePresentationCreateRequest
2
+
3
+ Request to create a verifiable presentation.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### identity
14
+
15
+ > **identity**: `string`
16
+
17
+ The identity to create the verification presentation for.
18
+
19
+ #### verificationMethodId
20
+
21
+ > **verificationMethodId**: `string`
22
+
23
+ The verification method id to use.
24
+
25
+ ***
26
+
27
+ ### body
28
+
29
+ > **body**: `object`
30
+
31
+ The data for the request.
32
+
33
+ #### presentationId?
34
+
35
+ > `optional` **presentationId**: `string`
36
+
37
+ The id of the presentation.
38
+
39
+ #### contexts?
40
+
41
+ > `optional` **contexts**: `IJsonLdContextDefinitionRoot`
42
+
43
+ The context to use for the presentation.
44
+
45
+ #### types?
46
+
47
+ > `optional` **types**: `string` \| `string`[]
48
+
49
+ The types of the presentation.
50
+
51
+ #### verifiableCredentials
52
+
53
+ > **verifiableCredentials**: (`string` \| `IDidVerifiableCredential`)[]
54
+
55
+ The verifiable credentials to include in the presentation.
56
+
57
+ #### expiresInMinutes?
58
+
59
+ > `optional` **expiresInMinutes**: `number`
60
+
61
+ The expiration time for the presentation.
@@ -0,0 +1,23 @@
1
+ # Interface: IIdentityVerifiablePresentationCreateResponse
2
+
3
+ Response to creating a verifiable presentation.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `object`
10
+
11
+ The response payload.
12
+
13
+ #### verifiablePresentation
14
+
15
+ > **verifiablePresentation**: `IDidVerifiablePresentation`
16
+
17
+ The verifiable presentation that was created.
18
+
19
+ #### jwt
20
+
21
+ > **jwt**: `string`
22
+
23
+ The JWT token for the verifiable presentation.
@@ -0,0 +1,17 @@
1
+ # Interface: IIdentityVerifiablePresentationVerifyRequest
2
+
3
+ Request to verify a verifiable presentation.
4
+
5
+ ## Properties
6
+
7
+ ### query
8
+
9
+ > **query**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### jwt
14
+
15
+ > **jwt**: `string`
16
+
17
+ The jwt to verify.
@@ -0,0 +1,29 @@
1
+ # Interface: IIdentityVerifiablePresentationVerifyResponse
2
+
3
+ Response to verifying a verifiable presentation.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `object`
10
+
11
+ The response payload.
12
+
13
+ #### revoked
14
+
15
+ > **revoked**: `boolean`
16
+
17
+ Has the presentation been revoked.
18
+
19
+ #### verifiablePresentation?
20
+
21
+ > `optional` **verifiablePresentation**: `IDidVerifiablePresentation`
22
+
23
+ The verifiable presentation that was verified.
24
+
25
+ #### issuers?
26
+
27
+ > `optional` **issuers**: `IDidDocument`[]
28
+
29
+ The issuers of the presentation.
@@ -0,0 +1,37 @@
1
+ # Interface: IIdentityVerificationMethodCreateRequest
2
+
3
+ Request to create a verification method.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### identity
14
+
15
+ > **identity**: `string`
16
+
17
+ The identity to create the verification method for.
18
+
19
+ ***
20
+
21
+ ### body
22
+
23
+ > **body**: `object`
24
+
25
+ The data for the request.
26
+
27
+ #### verificationMethodType
28
+
29
+ > **verificationMethodType**: `DidVerificationMethodType`
30
+
31
+ The type of the verification method to create.
32
+
33
+ #### verificationMethodId?
34
+
35
+ > `optional` **verificationMethodId**: `string`
36
+
37
+ The optional id for the verification method, will be allocated if not supplied.
@@ -0,0 +1,11 @@
1
+ # Interface: IIdentityVerificationMethodCreateResponse
2
+
3
+ Response to creating a verification method.
4
+
5
+ ## Properties
6
+
7
+ ### body
8
+
9
+ > **body**: `IDidDocumentVerificationMethod`
10
+
11
+ The response payload.
@@ -0,0 +1,23 @@
1
+ # Interface: IIdentityVerificationMethodRemoveRequest
2
+
3
+ Request to remove a verification method.
4
+
5
+ ## Properties
6
+
7
+ ### pathParams
8
+
9
+ > **pathParams**: `object`
10
+
11
+ The path parameters.
12
+
13
+ #### identity
14
+
15
+ > **identity**: `string`
16
+
17
+ The identity to remove the verification method from.
18
+
19
+ #### verificationMethodId
20
+
21
+ > **verificationMethodId**: `string`
22
+
23
+ The verification method to remove.
@@ -0,0 +1,5 @@
1
+ # Variable: IdentityResolverConnectorFactory
2
+
3
+ > `const` **IdentityResolverConnectorFactory**: `Factory`\<[`IIdentityResolverConnector`](../interfaces/IIdentityResolverConnector.md)\>
4
+
5
+ Factory for creating identity resolver connectors.
package/locales/en.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
- "identityRole": {
3
- "organization": "Organization",
4
- "user": "User",
5
- "node": "Node"
2
+ "error": {
3
+ "verificationHelper": {
4
+ "jwtDecodeFailed": "Decoding the JWT failed",
5
+ "proofTypeNotSupported": "The proof type \"{proofType}\" is not supported",
6
+ "proofMissingVerificationMethod": "The proof is missing the verification method"
7
+ },
8
+ "documentHelper": {
9
+ "verificationMethodNotFound": "The verification method \"{methodName}\" of type \"{methodType}\" could not be found",
10
+ "verificationMethodJwkNotFound": "The verification method \"{methodName}\" of type \"{methodType}\" is missing the JWK"
11
+ }
6
12
  },
7
13
  "verifiableCredentialStates": {
8
14
  "pendingVerification": "Pending Verification",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/identity-models",
3
- "version": "0.0.1-next.8",
3
+ "version": "0.0.1",
4
4
  "description": "Models which define the structure of the contracts and connectors",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,23 +14,23 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "next",
18
- "@twin.org/data-core": "next",
19
- "@twin.org/data-json-ld": "next",
20
- "@twin.org/entity": "next",
21
- "@twin.org/standards-w3c-did": "next",
22
- "@twin.org/web": "next"
17
+ "@twin.org/core": "^0.0.1",
18
+ "@twin.org/data-core": "^0.0.1",
19
+ "@twin.org/data-json-ld": "^0.0.1",
20
+ "@twin.org/entity": "^0.0.1",
21
+ "@twin.org/standards-w3c-did": "^0.0.1",
22
+ "@twin.org/web": "^0.0.1"
23
23
  },
24
24
  "main": "./dist/cjs/index.cjs",
25
25
  "module": "./dist/esm/index.mjs",
26
26
  "types": "./dist/types/index.d.ts",
27
27
  "exports": {
28
28
  ".": {
29
+ "types": "./dist/types/index.d.ts",
29
30
  "require": "./dist/cjs/index.cjs",
30
- "import": "./dist/esm/index.mjs",
31
- "types": "./dist/types/index.d.ts"
31
+ "import": "./dist/esm/index.mjs"
32
32
  },
33
- "./locales": "./locales"
33
+ "./locales/*.json": "./locales/*.json"
34
34
  },
35
35
  "files": [
36
36
  "dist/cjs",
@@ -1,21 +0,0 @@
1
- /**
2
- * The roles that an identity can have.
3
- */
4
- export declare const IdentityRole: {
5
- /**
6
- * Node.
7
- */
8
- readonly Node: "node";
9
- /**
10
- * Organization.
11
- */
12
- readonly Organization: "organization";
13
- /**
14
- * User.
15
- */
16
- readonly User: "user";
17
- };
18
- /**
19
- * The roles that an identity can have.
20
- */
21
- export type IdentityRole = (typeof IdentityRole)[keyof typeof IdentityRole];
@@ -1,5 +0,0 @@
1
- # Type Alias: IdentityRole
2
-
3
- > **IdentityRole**: *typeof* [`IdentityRole`](../variables/IdentityRole.md)\[keyof *typeof* [`IdentityRole`](../variables/IdentityRole.md)\]
4
-
5
- The roles that an identity can have.
@@ -1,25 +0,0 @@
1
- # Variable: IdentityRole
2
-
3
- > `const` **IdentityRole**: `object`
4
-
5
- The roles that an identity can have.
6
-
7
- ## Type declaration
8
-
9
- ### Node
10
-
11
- > `readonly` **Node**: `"node"` = `"node"`
12
-
13
- Node.
14
-
15
- ### Organization
16
-
17
- > `readonly` **Organization**: `"organization"` = `"organization"`
18
-
19
- Organization.
20
-
21
- ### User
22
-
23
- > `readonly` **User**: `"user"` = `"user"`
24
-
25
- User.