@3sixty/identity-rest-client 0.0.0-stage → 0.20.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/identityProfileRestClient.js +192 -0
- package/dist/es/identityProfileRestClient.js.map +1 -0
- package/dist/es/identityResolverRestClient.js +43 -0
- package/dist/es/identityResolverRestClient.js.map +1 -0
- package/dist/es/identityRestClient.js +388 -0
- package/dist/es/identityRestClient.js.map +1 -0
- package/dist/es/index.js +6 -0
- package/dist/es/index.js.map +1 -0
- package/dist/types/identityProfileRestClient.d.ts +111 -0
- package/dist/types/identityResolverRestClient.d.ts +29 -0
- package/dist/types/identityRestClient.d.ts +202 -0
- package/dist/types/index.d.ts +3 -0
- package/docs/changelog.md +0 -0
- package/docs/examples.md +175 -0
- package/docs/reference/classes/IdentityProfileRestClient.md +337 -0
- package/docs/reference/classes/IdentityResolverRestClient.md +87 -0
- package/docs/reference/classes/IdentityRestClient.md +717 -0
- package/docs/reference/index.md +7 -0
- package/locales/en.json +1 -0
- package/package.json +58 -5
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
# Class: IdentityProfileRestClient\<T, U\>
|
|
2
|
+
|
|
3
|
+
Client for performing identity profile operations through REST endpoints.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `BaseRestClient`
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### T
|
|
12
|
+
|
|
13
|
+
`T` *extends* `IJsonLdDocument` = `IJsonLdDocument`
|
|
14
|
+
|
|
15
|
+
### U
|
|
16
|
+
|
|
17
|
+
`U` *extends* `IJsonLdDocument` = `IJsonLdDocument`
|
|
18
|
+
|
|
19
|
+
## Implements
|
|
20
|
+
|
|
21
|
+
- `IIdentityProfileComponent`\<`T`, `U`\>
|
|
22
|
+
|
|
23
|
+
## Constructors
|
|
24
|
+
|
|
25
|
+
### Constructor
|
|
26
|
+
|
|
27
|
+
> **new IdentityProfileRestClient**\<`T`, `U`\>(`config`): `IdentityProfileRestClient`\<`T`, `U`\>
|
|
28
|
+
|
|
29
|
+
Create a new instance of IdentityProfileRestClient.
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
##### config
|
|
34
|
+
|
|
35
|
+
`IBaseRestClientConfig`
|
|
36
|
+
|
|
37
|
+
The configuration for the client.
|
|
38
|
+
|
|
39
|
+
#### Returns
|
|
40
|
+
|
|
41
|
+
`IdentityProfileRestClient`\<`T`, `U`\>
|
|
42
|
+
|
|
43
|
+
#### Overrides
|
|
44
|
+
|
|
45
|
+
`BaseRestClient.constructor`
|
|
46
|
+
|
|
47
|
+
## Properties
|
|
48
|
+
|
|
49
|
+
### CLASS\_NAME {#class_name}
|
|
50
|
+
|
|
51
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
52
|
+
|
|
53
|
+
Runtime name for the class.
|
|
54
|
+
|
|
55
|
+
## Methods
|
|
56
|
+
|
|
57
|
+
### className() {#classname}
|
|
58
|
+
|
|
59
|
+
> **className**(): `string`
|
|
60
|
+
|
|
61
|
+
Returns the class name of the component.
|
|
62
|
+
|
|
63
|
+
#### Returns
|
|
64
|
+
|
|
65
|
+
`string`
|
|
66
|
+
|
|
67
|
+
The class name of the component.
|
|
68
|
+
|
|
69
|
+
#### Implementation of
|
|
70
|
+
|
|
71
|
+
`IIdentityProfileComponent.className`
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### create() {#create}
|
|
76
|
+
|
|
77
|
+
> **create**(`publicProfile?`, `privateProfile?`): `Promise`\<`void`\>
|
|
78
|
+
|
|
79
|
+
Create the profile properties for an identity.
|
|
80
|
+
|
|
81
|
+
#### Parameters
|
|
82
|
+
|
|
83
|
+
##### publicProfile?
|
|
84
|
+
|
|
85
|
+
`T`
|
|
86
|
+
|
|
87
|
+
The public profile data as JSON-LD.
|
|
88
|
+
|
|
89
|
+
##### privateProfile?
|
|
90
|
+
|
|
91
|
+
`U`
|
|
92
|
+
|
|
93
|
+
The private profile data as JSON-LD.
|
|
94
|
+
|
|
95
|
+
#### Returns
|
|
96
|
+
|
|
97
|
+
`Promise`\<`void`\>
|
|
98
|
+
|
|
99
|
+
A promise that resolves when the profile has been created.
|
|
100
|
+
|
|
101
|
+
#### Implementation of
|
|
102
|
+
|
|
103
|
+
`IIdentityProfileComponent.create`
|
|
104
|
+
|
|
105
|
+
***
|
|
106
|
+
|
|
107
|
+
### get() {#get}
|
|
108
|
+
|
|
109
|
+
> **get**(`publicPropertyNames?`, `privatePropertyNames?`, `identity?`): `Promise`\<\{ `identity`: `string`; `publicProfile?`: `Partial`\<`T`\>; `privateProfile?`: `Partial`\<`U`\>; \}\>
|
|
110
|
+
|
|
111
|
+
Get the profile properties for an identity.
|
|
112
|
+
|
|
113
|
+
#### Parameters
|
|
114
|
+
|
|
115
|
+
##### publicPropertyNames?
|
|
116
|
+
|
|
117
|
+
keyof `T`[]
|
|
118
|
+
|
|
119
|
+
The public properties to get for the profile, defaults to all.
|
|
120
|
+
|
|
121
|
+
##### privatePropertyNames?
|
|
122
|
+
|
|
123
|
+
keyof `U`[]
|
|
124
|
+
|
|
125
|
+
The private properties to get for the profile, defaults to all.
|
|
126
|
+
|
|
127
|
+
##### identity?
|
|
128
|
+
|
|
129
|
+
`string`
|
|
130
|
+
|
|
131
|
+
The identity to perform the profile operation on, defaults to the current user.
|
|
132
|
+
|
|
133
|
+
#### Returns
|
|
134
|
+
|
|
135
|
+
`Promise`\<\{ `identity`: `string`; `publicProfile?`: `Partial`\<`T`\>; `privateProfile?`: `Partial`\<`U`\>; \}\>
|
|
136
|
+
|
|
137
|
+
The identity and the items properties.
|
|
138
|
+
|
|
139
|
+
#### Implementation of
|
|
140
|
+
|
|
141
|
+
`IIdentityProfileComponent.get`
|
|
142
|
+
|
|
143
|
+
***
|
|
144
|
+
|
|
145
|
+
### getPublic() {#getpublic}
|
|
146
|
+
|
|
147
|
+
> **getPublic**(`identity`, `propertyNames?`): `Promise`\<`Partial`\<`T`\>\>
|
|
148
|
+
|
|
149
|
+
Get the public profile properties for an identity.
|
|
150
|
+
|
|
151
|
+
#### Parameters
|
|
152
|
+
|
|
153
|
+
##### identity
|
|
154
|
+
|
|
155
|
+
`string`
|
|
156
|
+
|
|
157
|
+
The identity to perform the profile operation on.
|
|
158
|
+
|
|
159
|
+
##### propertyNames?
|
|
160
|
+
|
|
161
|
+
keyof `T`[]
|
|
162
|
+
|
|
163
|
+
The public properties to get for the profile, defaults to all.
|
|
164
|
+
|
|
165
|
+
#### Returns
|
|
166
|
+
|
|
167
|
+
`Promise`\<`Partial`\<`T`\>\>
|
|
168
|
+
|
|
169
|
+
The items properties.
|
|
170
|
+
|
|
171
|
+
#### Implementation of
|
|
172
|
+
|
|
173
|
+
`IIdentityProfileComponent.getPublic`
|
|
174
|
+
|
|
175
|
+
***
|
|
176
|
+
|
|
177
|
+
### update() {#update}
|
|
178
|
+
|
|
179
|
+
> **update**(`publicProfile?`, `privateProfile?`, `identity?`): `Promise`\<`void`\>
|
|
180
|
+
|
|
181
|
+
Update the profile properties of an identity.
|
|
182
|
+
|
|
183
|
+
#### Parameters
|
|
184
|
+
|
|
185
|
+
##### publicProfile?
|
|
186
|
+
|
|
187
|
+
`T`
|
|
188
|
+
|
|
189
|
+
The public profile data as JSON-LD.
|
|
190
|
+
|
|
191
|
+
##### privateProfile?
|
|
192
|
+
|
|
193
|
+
`U`
|
|
194
|
+
|
|
195
|
+
The private profile data as JSON-LD.
|
|
196
|
+
|
|
197
|
+
##### identity?
|
|
198
|
+
|
|
199
|
+
`string`
|
|
200
|
+
|
|
201
|
+
The identity to perform the profile operation on, defaults to the current user.
|
|
202
|
+
|
|
203
|
+
#### Returns
|
|
204
|
+
|
|
205
|
+
`Promise`\<`void`\>
|
|
206
|
+
|
|
207
|
+
A promise that resolves when the profile has been updated.
|
|
208
|
+
|
|
209
|
+
#### Implementation of
|
|
210
|
+
|
|
211
|
+
`IIdentityProfileComponent.update`
|
|
212
|
+
|
|
213
|
+
***
|
|
214
|
+
|
|
215
|
+
### remove() {#remove}
|
|
216
|
+
|
|
217
|
+
> **remove**(`identity?`): `Promise`\<`void`\>
|
|
218
|
+
|
|
219
|
+
Delete the profile for an identity.
|
|
220
|
+
|
|
221
|
+
#### Parameters
|
|
222
|
+
|
|
223
|
+
##### identity?
|
|
224
|
+
|
|
225
|
+
`string`
|
|
226
|
+
|
|
227
|
+
The identity to perform the profile operation on, defaults to the current user.
|
|
228
|
+
|
|
229
|
+
#### Returns
|
|
230
|
+
|
|
231
|
+
`Promise`\<`void`\>
|
|
232
|
+
|
|
233
|
+
A promise that resolves when the profile has been removed.
|
|
234
|
+
|
|
235
|
+
#### Implementation of
|
|
236
|
+
|
|
237
|
+
`IIdentityProfileComponent.remove`
|
|
238
|
+
|
|
239
|
+
***
|
|
240
|
+
|
|
241
|
+
### list() {#list}
|
|
242
|
+
|
|
243
|
+
> **list**(`publicFilters?`, `publicPropertyNames?`, `cursor?`, `limit?`): `Promise`\<\{ `items`: `object`[]; `cursor?`: `string`; \}\>
|
|
244
|
+
|
|
245
|
+
Get a list of the requested identities.
|
|
246
|
+
|
|
247
|
+
#### Parameters
|
|
248
|
+
|
|
249
|
+
##### publicFilters?
|
|
250
|
+
|
|
251
|
+
`object`[]
|
|
252
|
+
|
|
253
|
+
The filters to apply to the identities public profiles.
|
|
254
|
+
|
|
255
|
+
##### publicPropertyNames?
|
|
256
|
+
|
|
257
|
+
keyof `T`[]
|
|
258
|
+
|
|
259
|
+
The public properties to get for the profile, defaults to all.
|
|
260
|
+
|
|
261
|
+
##### cursor?
|
|
262
|
+
|
|
263
|
+
`string`
|
|
264
|
+
|
|
265
|
+
The cursor for paged requests.
|
|
266
|
+
|
|
267
|
+
##### limit?
|
|
268
|
+
|
|
269
|
+
`number`
|
|
270
|
+
|
|
271
|
+
The maximum number of items in a page.
|
|
272
|
+
|
|
273
|
+
#### Returns
|
|
274
|
+
|
|
275
|
+
`Promise`\<\{ `items`: `object`[]; `cursor?`: `string`; \}\>
|
|
276
|
+
|
|
277
|
+
The list of items and cursor for paging.
|
|
278
|
+
|
|
279
|
+
#### Implementation of
|
|
280
|
+
|
|
281
|
+
`IIdentityProfileComponent.list`
|
|
282
|
+
|
|
283
|
+
***
|
|
284
|
+
|
|
285
|
+
### listAdmin() {#listadmin}
|
|
286
|
+
|
|
287
|
+
> **listAdmin**(`publicFilters?`, `privateFilters?`, `publicPropertyNames?`, `privatePropertyNames?`, `cursor?`, `limit?`): `Promise`\<\{ `items`: `object`[]; `cursor?`: `string`; \}\>
|
|
288
|
+
|
|
289
|
+
Get the list of identity profiles including private properties.
|
|
290
|
+
|
|
291
|
+
#### Parameters
|
|
292
|
+
|
|
293
|
+
##### publicFilters?
|
|
294
|
+
|
|
295
|
+
`object`[]
|
|
296
|
+
|
|
297
|
+
The filters to apply to the identities public profiles.
|
|
298
|
+
|
|
299
|
+
##### privateFilters?
|
|
300
|
+
|
|
301
|
+
`object`[]
|
|
302
|
+
|
|
303
|
+
The filters to apply to the identities private profiles.
|
|
304
|
+
|
|
305
|
+
##### publicPropertyNames?
|
|
306
|
+
|
|
307
|
+
keyof `T`[]
|
|
308
|
+
|
|
309
|
+
The public properties to get for the profile, defaults to all.
|
|
310
|
+
|
|
311
|
+
##### privatePropertyNames?
|
|
312
|
+
|
|
313
|
+
keyof `U`[]
|
|
314
|
+
|
|
315
|
+
The private properties to get for the profile, defaults to none.
|
|
316
|
+
|
|
317
|
+
##### cursor?
|
|
318
|
+
|
|
319
|
+
`string`
|
|
320
|
+
|
|
321
|
+
The cursor for paged requests.
|
|
322
|
+
|
|
323
|
+
##### limit?
|
|
324
|
+
|
|
325
|
+
`number`
|
|
326
|
+
|
|
327
|
+
The maximum number of items in a page.
|
|
328
|
+
|
|
329
|
+
#### Returns
|
|
330
|
+
|
|
331
|
+
`Promise`\<\{ `items`: `object`[]; `cursor?`: `string`; \}\>
|
|
332
|
+
|
|
333
|
+
The list of items and cursor for paging.
|
|
334
|
+
|
|
335
|
+
#### Implementation of
|
|
336
|
+
|
|
337
|
+
`IIdentityProfileComponent.listAdmin`
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Class: IdentityResolverRestClient
|
|
2
|
+
|
|
3
|
+
Client for performing identity resolution through REST endpoints.
|
|
4
|
+
|
|
5
|
+
## Extends
|
|
6
|
+
|
|
7
|
+
- `BaseRestClient`
|
|
8
|
+
|
|
9
|
+
## Implements
|
|
10
|
+
|
|
11
|
+
- `IIdentityResolverComponent`
|
|
12
|
+
|
|
13
|
+
## Constructors
|
|
14
|
+
|
|
15
|
+
### Constructor
|
|
16
|
+
|
|
17
|
+
> **new IdentityResolverRestClient**(`config`): `IdentityResolverRestClient`
|
|
18
|
+
|
|
19
|
+
Create a new instance of IdentityResolverRestClient.
|
|
20
|
+
|
|
21
|
+
#### Parameters
|
|
22
|
+
|
|
23
|
+
##### config
|
|
24
|
+
|
|
25
|
+
`IBaseRestClientConfig`
|
|
26
|
+
|
|
27
|
+
The configuration for the client.
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`IdentityResolverRestClient`
|
|
32
|
+
|
|
33
|
+
#### Overrides
|
|
34
|
+
|
|
35
|
+
`BaseRestClient.constructor`
|
|
36
|
+
|
|
37
|
+
## Properties
|
|
38
|
+
|
|
39
|
+
### CLASS\_NAME {#class_name}
|
|
40
|
+
|
|
41
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
42
|
+
|
|
43
|
+
Runtime name for the class.
|
|
44
|
+
|
|
45
|
+
## Methods
|
|
46
|
+
|
|
47
|
+
### className() {#classname}
|
|
48
|
+
|
|
49
|
+
> **className**(): `string`
|
|
50
|
+
|
|
51
|
+
Returns the class name of the component.
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
The class name of the component.
|
|
58
|
+
|
|
59
|
+
#### Implementation of
|
|
60
|
+
|
|
61
|
+
`IIdentityResolverComponent.className`
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### identityResolve() {#identityresolve}
|
|
66
|
+
|
|
67
|
+
> **identityResolve**(`documentId`): `Promise`\<`IDidDocument`\>
|
|
68
|
+
|
|
69
|
+
Resolve an identity.
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
##### documentId
|
|
74
|
+
|
|
75
|
+
`string`
|
|
76
|
+
|
|
77
|
+
The id of the document to resolve.
|
|
78
|
+
|
|
79
|
+
#### Returns
|
|
80
|
+
|
|
81
|
+
`Promise`\<`IDidDocument`\>
|
|
82
|
+
|
|
83
|
+
The resolved document.
|
|
84
|
+
|
|
85
|
+
#### Implementation of
|
|
86
|
+
|
|
87
|
+
`IIdentityResolverComponent.identityResolve`
|