@twin.org/identity-connector-entity-storage 0.0.1-next.3

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.
@@ -0,0 +1,239 @@
1
+ # Class: EntityStorageIdentityProfileConnector\<T, U\>
2
+
3
+ Class which implements the identity profile connector contract.
4
+
5
+ ## Type Parameters
6
+
7
+ • **T** *extends* `IJsonLdDocument` = `IJsonLdDocument`
8
+
9
+ • **U** *extends* `IJsonLdDocument` = `IJsonLdDocument`
10
+
11
+ ## Implements
12
+
13
+ - `IIdentityProfileConnector`\<`T`, `U`\>
14
+
15
+ ## Constructors
16
+
17
+ ### new EntityStorageIdentityProfileConnector()
18
+
19
+ > **new EntityStorageIdentityProfileConnector**\<`T`, `U`\>(`options`?): [`EntityStorageIdentityProfileConnector`](EntityStorageIdentityProfileConnector.md)\<`T`, `U`\>
20
+
21
+ Create a new instance of Identity.
22
+
23
+ #### Parameters
24
+
25
+ • **options?**
26
+
27
+ The dependencies for the identity service.
28
+
29
+ • **options.profileEntityStorageType?**: `string`
30
+
31
+ The storage connector for the profiles, default to "identity-profile".
32
+
33
+ #### Returns
34
+
35
+ [`EntityStorageIdentityProfileConnector`](EntityStorageIdentityProfileConnector.md)\<`T`, `U`\>
36
+
37
+ ## Properties
38
+
39
+ ### NAMESPACE
40
+
41
+ > `readonly` `static` **NAMESPACE**: `string` = `"entity-storage"`
42
+
43
+ The namespace supported by the identity profile connector.
44
+
45
+ ***
46
+
47
+ ### CLASS\_NAME
48
+
49
+ > `readonly` **CLASS\_NAME**: `string`
50
+
51
+ Runtime name for the class.
52
+
53
+ #### Implementation of
54
+
55
+ `IIdentityProfileConnector.CLASS_NAME`
56
+
57
+ ## Methods
58
+
59
+ ### create()
60
+
61
+ > **create**(`identity`, `publicProfile`?, `privateProfile`?): `Promise`\<`void`\>
62
+
63
+ Create the profile properties for an identity.
64
+
65
+ #### Parameters
66
+
67
+ • **identity**: `string`
68
+
69
+ The identity of the profile to create.
70
+
71
+ • **publicProfile?**: `T`
72
+
73
+ The public profile data.
74
+
75
+ • **privateProfile?**: `U`
76
+
77
+ The private profile data.
78
+
79
+ #### Returns
80
+
81
+ `Promise`\<`void`\>
82
+
83
+ Nothing.
84
+
85
+ #### Implementation of
86
+
87
+ `IIdentityProfileConnector.create`
88
+
89
+ ***
90
+
91
+ ### get()
92
+
93
+ > **get**(`identity`, `publicPropertyNames`?, `privatePropertyNames`?): `Promise`\<`object`\>
94
+
95
+ Get the profile properties for an identity.
96
+
97
+ #### Parameters
98
+
99
+ • **identity**: `string`
100
+
101
+ The identity of the item to get.
102
+
103
+ • **publicPropertyNames?**: keyof `T`[]
104
+
105
+ The public properties to get for the profile, defaults to all.
106
+
107
+ • **privatePropertyNames?**: keyof `U`[]
108
+
109
+ The private properties to get for the profile, defaults to all.
110
+
111
+ #### Returns
112
+
113
+ `Promise`\<`object`\>
114
+
115
+ The items properties.
116
+
117
+ ##### publicProfile
118
+
119
+ > **publicProfile**: `Partial`\<`T`\>
120
+
121
+ ##### privateProfile
122
+
123
+ > **privateProfile**: `Partial`\<`U`\>
124
+
125
+ #### Implementation of
126
+
127
+ `IIdentityProfileConnector.get`
128
+
129
+ ***
130
+
131
+ ### update()
132
+
133
+ > **update**(`identity`, `publicProfile`?, `privateProfile`?): `Promise`\<`void`\>
134
+
135
+ Update the profile properties of an identity.
136
+
137
+ #### Parameters
138
+
139
+ • **identity**: `string`
140
+
141
+ The identity to update.
142
+
143
+ • **publicProfile?**: `T`
144
+
145
+ The public profile data.
146
+
147
+ • **privateProfile?**: `U`
148
+
149
+ The private profile data.
150
+
151
+ #### Returns
152
+
153
+ `Promise`\<`void`\>
154
+
155
+ Nothing.
156
+
157
+ #### Implementation of
158
+
159
+ `IIdentityProfileConnector.update`
160
+
161
+ ***
162
+
163
+ ### remove()
164
+
165
+ > **remove**(`identity`): `Promise`\<`void`\>
166
+
167
+ Delete the profile for an identity.
168
+
169
+ #### Parameters
170
+
171
+ • **identity**: `string`
172
+
173
+ The identity to delete.
174
+
175
+ #### Returns
176
+
177
+ `Promise`\<`void`\>
178
+
179
+ Nothing.
180
+
181
+ #### Implementation of
182
+
183
+ `IIdentityProfileConnector.remove`
184
+
185
+ ***
186
+
187
+ ### list()
188
+
189
+ > **list**(`publicFilters`?, `privateFilters`?, `publicPropertyNames`?, `privatePropertyNames`?, `cursor`?, `pageSize`?): `Promise`\<`object`\>
190
+
191
+ Get a list of the requested types.
192
+
193
+ #### Parameters
194
+
195
+ • **publicFilters?**: `object`[]
196
+
197
+ The filters to apply to the identities public profiles.
198
+
199
+ • **privateFilters?**: `object`[]
200
+
201
+ The filters to apply to the identities private profiles.
202
+
203
+ • **publicPropertyNames?**: keyof `T`[]
204
+
205
+ The public properties to get for the profile, defaults to all.
206
+
207
+ • **privatePropertyNames?**: keyof `U`[]
208
+
209
+ The private properties to get for the profile, defaults to all.
210
+
211
+ • **cursor?**: `string`
212
+
213
+ The cursor for paged requests.
214
+
215
+ • **pageSize?**: `number`
216
+
217
+ The maximum number of items in a page.
218
+
219
+ #### Returns
220
+
221
+ `Promise`\<`object`\>
222
+
223
+ The list of items and cursor for paging.
224
+
225
+ ##### items
226
+
227
+ > **items**: `object`[]
228
+
229
+ The identities.
230
+
231
+ ##### cursor?
232
+
233
+ > `optional` **cursor**: `string`
234
+
235
+ An optional cursor, when defined can be used to call find to get more entities.
236
+
237
+ #### Implementation of
238
+
239
+ `IIdentityProfileConnector.list`
@@ -0,0 +1,45 @@
1
+ # Class: IdentityDocument
2
+
3
+ Class describing the identity document.
4
+
5
+ ## Constructors
6
+
7
+ ### new IdentityDocument()
8
+
9
+ > **new IdentityDocument**(): [`IdentityDocument`](IdentityDocument.md)
10
+
11
+ #### Returns
12
+
13
+ [`IdentityDocument`](IdentityDocument.md)
14
+
15
+ ## Properties
16
+
17
+ ### id
18
+
19
+ > **id**: `string`
20
+
21
+ The identity of the document.
22
+
23
+ ***
24
+
25
+ ### document
26
+
27
+ > **document**: `IDidDocument`
28
+
29
+ The DID document.
30
+
31
+ ***
32
+
33
+ ### signature
34
+
35
+ > **signature**: `string`
36
+
37
+ The signature of the document.
38
+
39
+ ***
40
+
41
+ ### controller
42
+
43
+ > **controller**: `string`
44
+
45
+ The controller of the document.
@@ -0,0 +1,37 @@
1
+ # Class: IdentityProfile
2
+
3
+ Class representing profile details for the identity.
4
+
5
+ ## Constructors
6
+
7
+ ### new IdentityProfile()
8
+
9
+ > **new IdentityProfile**(): [`IdentityProfile`](IdentityProfile.md)
10
+
11
+ #### Returns
12
+
13
+ [`IdentityProfile`](IdentityProfile.md)
14
+
15
+ ## Properties
16
+
17
+ ### identity
18
+
19
+ > **identity**: `string`
20
+
21
+ The id for the identity.
22
+
23
+ ***
24
+
25
+ ### publicProfile?
26
+
27
+ > `optional` **publicProfile**: `unknown`
28
+
29
+ The public profile data.
30
+
31
+ ***
32
+
33
+ ### privateProfile?
34
+
35
+ > `optional` **privateProfile**: `unknown`
36
+
37
+ The private profile data.
@@ -0,0 +1,23 @@
1
+ # Function: initSchema()
2
+
3
+ > **initSchema**(`options`?): `void`
4
+
5
+ Initialize the schema for the identity entity storage connector.
6
+
7
+ ## Parameters
8
+
9
+ • **options?**
10
+
11
+ Options for which entities to register.
12
+
13
+ • **options.includeDocument?**: `boolean`
14
+
15
+ Whether to include the document entity, defaults to true.
16
+
17
+ • **options.includeProfile?**: `boolean`
18
+
19
+ Whether to include the profile entity, defaults to true.
20
+
21
+ ## Returns
22
+
23
+ `void`
@@ -0,0 +1,12 @@
1
+ # @twin.org/identity-connector-entity-storage
2
+
3
+ ## Classes
4
+
5
+ - [IdentityDocument](classes/IdentityDocument.md)
6
+ - [IdentityProfile](classes/IdentityProfile.md)
7
+ - [EntityStorageIdentityConnector](classes/EntityStorageIdentityConnector.md)
8
+ - [EntityStorageIdentityProfileConnector](classes/EntityStorageIdentityProfileConnector.md)
9
+
10
+ ## Functions
11
+
12
+ - [initSchema](functions/initSchema.md)
@@ -0,0 +1,41 @@
1
+ {
2
+ "error": {
3
+ "entityStorageIdentityConnector": {
4
+ "createDocumentFailed": "Creating the document failed",
5
+ "signatureVerificationFailed": "The document integrity check failed",
6
+ "resolveDocumentFailed": "Resolving the document failed",
7
+ "missingDid": "The full id including DID is required",
8
+ "addVerificationMethodFailed": "Adding the verification method failed",
9
+ "removeVerificationMethodFailed": "Removing the verification method failed",
10
+ "addServiceFailed": "Adding the service failed",
11
+ "removeServiceFailed": "Removing the service failed",
12
+ "documentNotFound": "The document could not be found",
13
+ "documentPrivateKeyNotFound": "The private key for document could not be found in the vault",
14
+ "verificationMethodNotFound": "The verification method could not be found",
15
+ "verificationPrivateKeyNotFound": "The private key for the verification method could not be found in the vault",
16
+ "serviceNotFound": "The service could not be found",
17
+ "publicKeyJwkMissing": "The verification method contains no publicKeyJwk",
18
+ "jwkSignatureFailed": "The signature on the JWK failed verification",
19
+ "createVerifiableCredentialFailed": "Creating the verifiable credential failed",
20
+ "checkingVerifiableCredentialFailed": "Checking the verifiable credential failed",
21
+ "createVerifiablePresentationFailed": "Creating the verifiable presentation failed",
22
+ "checkingVerifiablePresentationFailed": "Checking the verifiable presentation failed",
23
+ "expectingJwtCredential": "Expecting JWT credential in the presentation",
24
+ "keyIndexOutOfRange": "The supplied keyIndex is not in the range of the key list",
25
+ "createProofFailed": "Creating the signature for the data failed",
26
+ "methodMissing": "The verification method specified does not exist",
27
+ "verifyProofFailed": "Verifying the signature for the data failed",
28
+ "revokeVerifiableCredentialsFailed": "Revoking verifiable credentials failed",
29
+ "unrevokeVerifiableCredentialsFailed": "Unrevoking verifiable credentials failed"
30
+ },
31
+ "entityStorageIdentityProfileConnector": {
32
+ "alreadyExists": "The identity profile already exists for the identity \"{existingId}\"",
33
+ "createFailed": "Creating the identity profile failed \"{identity}\"",
34
+ "getFailed": "Getting the identity profile failed \"{notFoundId}\"",
35
+ "updateFailed": "Updating the identity profile failed \"{identity}\"",
36
+ "notFound": "The identity profile failed \"{notFoundId}\"",
37
+ "removeFailed": "Removing the identity profile failed \"{identity}\"",
38
+ "listFailed": "Failed listing identities"
39
+ }
40
+ }
41
+ }
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@twin.org/identity-connector-entity-storage",
3
+ "version": "0.0.1-next.3",
4
+ "description": "Identity connector implementation using entity storage",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/twinfoundation/identity.git",
8
+ "directory": "packages/identity-connector-entity-storage"
9
+ },
10
+ "author": "martyn.janes@iota.org",
11
+ "license": "Apache-2.0",
12
+ "type": "module",
13
+ "engines": {
14
+ "node": ">=20.0.0"
15
+ },
16
+ "scripts": {
17
+ "clean": "rimraf dist coverage docs/reference",
18
+ "build": "tspc",
19
+ "test": "vitest --run --config ./vitest.config.ts --no-cache",
20
+ "coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
21
+ "bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
22
+ "bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
23
+ "bundle": "npm run bundle:esm && npm run bundle:cjs",
24
+ "docs:clean": "rimraf docs/reference",
25
+ "docs:generate": "typedoc",
26
+ "docs": "npm run docs:clean && npm run docs:generate",
27
+ "dist": "npm run clean && npm run build && npm run test && npm run bundle && npm run docs"
28
+ },
29
+ "dependencies": {
30
+ "@twin.org/core": "next",
31
+ "@twin.org/crypto": "next",
32
+ "@twin.org/data-core": "next",
33
+ "@twin.org/data-json-ld": "next",
34
+ "@twin.org/entity": "next",
35
+ "@twin.org/identity-models": "0.0.1-next.3",
36
+ "@twin.org/nameof": "next",
37
+ "@twin.org/standards-w3c-did": "next",
38
+ "@twin.org/vault-models": "next",
39
+ "@twin.org/web": "next"
40
+ },
41
+ "devDependencies": {
42
+ "@twin.org/entity-storage-connector-memory": "next",
43
+ "@twin.org/nameof-transformer": "next",
44
+ "@twin.org/vault-connector-entity-storage": "next",
45
+ "@vitest/coverage-v8": "2.1.1",
46
+ "copyfiles": "2.4.1",
47
+ "dotenv": "16.4.5",
48
+ "rimraf": "6.0.1",
49
+ "rollup": "4.22.0",
50
+ "rollup-plugin-copy": "3.5.0",
51
+ "rollup-plugin-typescript2": "0.36.0",
52
+ "ts-patch": "3.2.1",
53
+ "typedoc": "0.26.7",
54
+ "typedoc-plugin-markdown": "4.2.7",
55
+ "typescript": "5.6.2",
56
+ "vitest": "2.1.1"
57
+ },
58
+ "main": "./dist/cjs/index.cjs",
59
+ "module": "./dist/esm/index.mjs",
60
+ "types": "./dist/types/index.d.ts",
61
+ "exports": {
62
+ ".": {
63
+ "require": "./dist/cjs/index.cjs",
64
+ "import": "./dist/esm/index.mjs",
65
+ "types": "./dist/types/index.d.ts"
66
+ },
67
+ "./locales": "./locales"
68
+ },
69
+ "files": [
70
+ "dist/cjs",
71
+ "dist/esm",
72
+ "dist/types",
73
+ "locales",
74
+ "docs"
75
+ ]
76
+ }