entropic-bond 1.48.1 → 1.50.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/.github/workflows/release.yml +26 -0
- package/CHANGELOG.md +1151 -0
- package/docs/.nojekyll +1 -0
- package/docs/README.md +94 -0
- package/docs/classes/Auth.md +391 -0
- package/docs/classes/AuthMock.md +278 -0
- package/docs/classes/AuthService.md +188 -0
- package/docs/classes/CloudFunctions.md +123 -0
- package/docs/classes/CloudFunctionsMock.md +97 -0
- package/docs/classes/CloudStorage.md +215 -0
- package/docs/classes/DataSource.md +248 -0
- package/docs/classes/EntropicComponent.md +666 -0
- package/docs/classes/JsonDataSource.md +328 -0
- package/docs/classes/MockCloudStorage.md +279 -0
- package/docs/classes/Model.md +274 -0
- package/docs/classes/Observable.md +120 -0
- package/docs/classes/Persistent.md +420 -0
- package/docs/classes/ServerAuth.md +211 -0
- package/docs/classes/ServerAuthMock.md +176 -0
- package/docs/classes/ServerAuthService.md +130 -0
- package/docs/classes/Store.md +218 -0
- package/docs/classes/StoredFile.md +636 -0
- package/docs/enums/StoredFileEvent.md +41 -0
- package/docs/interfaces/AuthError.md +30 -0
- package/docs/interfaces/CloudFunctionsService.md +69 -0
- package/docs/interfaces/Collection.md +13 -0
- package/docs/interfaces/CustomCredentials.md +7 -0
- package/docs/interfaces/DocumentReference.md +49 -0
- package/docs/interfaces/JsonRawData.md +7 -0
- package/docs/interfaces/SignData.md +63 -0
- package/docs/interfaces/StoreParams.md +52 -0
- package/docs/interfaces/StoredFileChange.md +41 -0
- package/docs/interfaces/UploadControl.md +90 -0
- package/docs/interfaces/UserCredentials.md +113 -0
- package/docs/interfaces/Values.md +17 -0
- package/docs/modules.md +1273 -0
- package/package.json +23 -19
- package/src/auth/auth-mock.spec.ts +168 -0
- package/src/auth/auth-mock.ts +129 -0
- package/src/auth/auth.ts +185 -0
- package/src/auth/user-auth-types.ts +21 -0
- package/src/cloud-functions/cloud-functions-mock.spec.ts +136 -0
- package/src/cloud-functions/cloud-functions-mock.ts +23 -0
- package/src/cloud-functions/cloud-functions.ts +83 -0
- package/src/cloud-storage/cloud-storage.spec.ts +207 -0
- package/src/cloud-storage/cloud-storage.ts +60 -0
- package/src/cloud-storage/mock-cloud-storage.ts +72 -0
- package/src/cloud-storage/stored-file.ts +102 -0
- package/src/index.ts +19 -0
- package/src/observable/observable.spec.ts +105 -0
- package/src/observable/observable.ts +67 -0
- package/src/persistent/entropic-component.spec.ts +143 -0
- package/src/persistent/entropic-component.ts +135 -0
- package/src/persistent/persistent.spec.ts +828 -0
- package/src/persistent/persistent.ts +650 -0
- package/src/server-auth/server-auth-mock.spec.ts +53 -0
- package/src/server-auth/server-auth-mock.ts +45 -0
- package/src/server-auth/server-auth.ts +49 -0
- package/src/store/data-source.ts +186 -0
- package/src/store/json-data-source.spec.ts +100 -0
- package/src/store/json-data-source.ts +256 -0
- package/src/store/mocks/mock-data.json +155 -0
- package/src/store/mocks/test-user.ts +122 -0
- package/src/store/model.spec.ts +659 -0
- package/src/store/model.ts +462 -0
- package/src/store/store.spec.ts +30 -0
- package/src/store/store.ts +113 -0
- package/src/types/utility-types.spec.ts +117 -0
- package/src/types/utility-types.ts +116 -0
- package/src/utils/test-utils/test-person.ts +44 -0
- package/src/utils/utils.spec.ts +95 -0
- package/{lib/utils/utils.d.ts → src/utils/utils.ts} +34 -10
- package/tsconfig-build.json +7 -0
- package/tsconfig-cjs.json +9 -0
- package/tsconfig.json +33 -0
- package/vite.config.ts +22 -0
- package/lib/auth/auth-mock.d.ts +0 -21
- package/lib/auth/auth-mock.js +0 -108
- package/lib/auth/auth-mock.js.map +0 -1
- package/lib/auth/auth.d.ts +0 -129
- package/lib/auth/auth.js +0 -146
- package/lib/auth/auth.js.map +0 -1
- package/lib/auth/user-auth-types.d.ts +0 -19
- package/lib/auth/user-auth-types.js +0 -3
- package/lib/auth/user-auth-types.js.map +0 -1
- package/lib/cloud-functions/cloud-functions-mock.d.ts +0 -11
- package/lib/cloud-functions/cloud-functions-mock.js +0 -19
- package/lib/cloud-functions/cloud-functions-mock.js.map +0 -1
- package/lib/cloud-functions/cloud-functions.d.ts +0 -19
- package/lib/cloud-functions/cloud-functions.js +0 -64
- package/lib/cloud-functions/cloud-functions.js.map +0 -1
- package/lib/cloud-storage/cloud-storage.d.ts +0 -24
- package/lib/cloud-storage/cloud-storage.js +0 -37
- package/lib/cloud-storage/cloud-storage.js.map +0 -1
- package/lib/cloud-storage/mock-cloud-storage.d.ts +0 -20
- package/lib/cloud-storage/mock-cloud-storage.js +0 -68
- package/lib/cloud-storage/mock-cloud-storage.js.map +0 -1
- package/lib/cloud-storage/stored-file.d.ts +0 -39
- package/lib/cloud-storage/stored-file.js +0 -106
- package/lib/cloud-storage/stored-file.js.map +0 -1
- package/lib/index.d.ts +0 -19
- package/lib/index.js +0 -36
- package/lib/index.js.map +0 -1
- package/lib/observable/observable.d.ts +0 -52
- package/lib/observable/observable.js +0 -66
- package/lib/observable/observable.js.map +0 -1
- package/lib/persistent/entropic-component.d.ts +0 -76
- package/lib/persistent/entropic-component.js +0 -109
- package/lib/persistent/entropic-component.js.map +0 -1
- package/lib/persistent/persistent.d.ts +0 -281
- package/lib/persistent/persistent.js +0 -539
- package/lib/persistent/persistent.js.map +0 -1
- package/lib/server-auth/server-auth-mock.d.ts +0 -12
- package/lib/server-auth/server-auth-mock.js +0 -39
- package/lib/server-auth/server-auth-mock.js.map +0 -1
- package/lib/server-auth/server-auth.d.ts +0 -24
- package/lib/server-auth/server-auth.js +0 -36
- package/lib/server-auth/server-auth.js.map +0 -1
- package/lib/store/data-source.d.ts +0 -137
- package/lib/store/data-source.js +0 -62
- package/lib/store/data-source.js.map +0 -1
- package/lib/store/json-data-source.d.ts +0 -68
- package/lib/store/json-data-source.js +0 -199
- package/lib/store/json-data-source.js.map +0 -1
- package/lib/store/mocks/test-user.d.ts +0 -49
- package/lib/store/mocks/test-user.js +0 -135
- package/lib/store/mocks/test-user.js.map +0 -1
- package/lib/store/model.d.ts +0 -238
- package/lib/store/model.js +0 -417
- package/lib/store/model.js.map +0 -1
- package/lib/store/store.d.ts +0 -62
- package/lib/store/store.js +0 -102
- package/lib/store/store.js.map +0 -1
- package/lib/types/utility-types.d.ts +0 -45
- package/lib/types/utility-types.js +0 -3
- package/lib/types/utility-types.js.map +0 -1
- package/lib/utils/test-utils/test-person.d.ts +0 -33
- package/lib/utils/test-utils/test-person.js +0 -25
- package/lib/utils/test-utils/test-person.js.map +0 -1
- package/lib/utils/utils.js +0 -76
- package/lib/utils/utils.js.map +0 -1
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
[entropic-bond](../README.md) / [Exports](../modules.md) / Persistent
|
|
2
|
+
|
|
3
|
+
# Class: Persistent
|
|
4
|
+
|
|
5
|
+
A class that provides several methods to serialize and deserialize objects.
|
|
6
|
+
|
|
7
|
+
## Hierarchy
|
|
8
|
+
|
|
9
|
+
- **`Persistent`**
|
|
10
|
+
|
|
11
|
+
↳ [`EntropicComponent`](EntropicComponent.md)
|
|
12
|
+
|
|
13
|
+
↳ [`StoredFile`](StoredFile.md)
|
|
14
|
+
|
|
15
|
+
## Table of contents
|
|
16
|
+
|
|
17
|
+
### Constructors
|
|
18
|
+
|
|
19
|
+
- [constructor](Persistent.md#constructor)
|
|
20
|
+
|
|
21
|
+
### Accessors
|
|
22
|
+
|
|
23
|
+
- [className](Persistent.md#classname)
|
|
24
|
+
- [id](Persistent.md#id)
|
|
25
|
+
|
|
26
|
+
### Methods
|
|
27
|
+
|
|
28
|
+
- [beforeSerialize](Persistent.md#beforeserialize)
|
|
29
|
+
- [clone](Persistent.md#clone)
|
|
30
|
+
- [fromObject](Persistent.md#fromobject)
|
|
31
|
+
- [getPersistentProperties](Persistent.md#getpersistentproperties)
|
|
32
|
+
- [onSerialized](Persistent.md#onserialized)
|
|
33
|
+
- [setId](Persistent.md#setid)
|
|
34
|
+
- [toObject](Persistent.md#toobject)
|
|
35
|
+
- [annotations](Persistent.md#annotations)
|
|
36
|
+
- [classFactory](Persistent.md#classfactory)
|
|
37
|
+
- [classesExtending](Persistent.md#classesextending)
|
|
38
|
+
- [createInstance](Persistent.md#createinstance)
|
|
39
|
+
- [registerFactory](Persistent.md#registerfactory)
|
|
40
|
+
- [registeredClasses](Persistent.md#registeredclasses)
|
|
41
|
+
|
|
42
|
+
## Constructors
|
|
43
|
+
|
|
44
|
+
### constructor
|
|
45
|
+
|
|
46
|
+
• **new Persistent**(`id?`)
|
|
47
|
+
|
|
48
|
+
Returns a new instance of Persistent class.
|
|
49
|
+
|
|
50
|
+
#### Parameters
|
|
51
|
+
|
|
52
|
+
| Name | Type |
|
|
53
|
+
| :------ | :------ |
|
|
54
|
+
| `id` | `string` |
|
|
55
|
+
|
|
56
|
+
#### Defined in
|
|
57
|
+
|
|
58
|
+
[persistent/persistent.ts:124](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L124)
|
|
59
|
+
|
|
60
|
+
## Accessors
|
|
61
|
+
|
|
62
|
+
### className
|
|
63
|
+
|
|
64
|
+
• `get` **className**(): `string`
|
|
65
|
+
|
|
66
|
+
Gets the class name of this instance.
|
|
67
|
+
|
|
68
|
+
#### Returns
|
|
69
|
+
|
|
70
|
+
`string`
|
|
71
|
+
|
|
72
|
+
#### Defined in
|
|
73
|
+
|
|
74
|
+
[persistent/persistent.ts:131](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L131)
|
|
75
|
+
|
|
76
|
+
___
|
|
77
|
+
|
|
78
|
+
### id
|
|
79
|
+
|
|
80
|
+
• `get` **id**(): `string`
|
|
81
|
+
|
|
82
|
+
Returns the id of this instance.
|
|
83
|
+
|
|
84
|
+
#### Returns
|
|
85
|
+
|
|
86
|
+
`string`
|
|
87
|
+
|
|
88
|
+
the id of this instance
|
|
89
|
+
|
|
90
|
+
#### Defined in
|
|
91
|
+
|
|
92
|
+
[persistent/persistent.ts:147](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L147)
|
|
93
|
+
|
|
94
|
+
## Methods
|
|
95
|
+
|
|
96
|
+
### beforeSerialize
|
|
97
|
+
|
|
98
|
+
▸ `Protected` **beforeSerialize**(): `void`
|
|
99
|
+
|
|
100
|
+
This method is called by the persistence engine before the instance is
|
|
101
|
+
serialized.
|
|
102
|
+
|
|
103
|
+
#### Returns
|
|
104
|
+
|
|
105
|
+
`void`
|
|
106
|
+
|
|
107
|
+
#### Defined in
|
|
108
|
+
|
|
109
|
+
[persistent/persistent.ts:161](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L161)
|
|
110
|
+
|
|
111
|
+
___
|
|
112
|
+
|
|
113
|
+
### clone
|
|
114
|
+
|
|
115
|
+
▸ **clone**(`instance`): `void`
|
|
116
|
+
|
|
117
|
+
Copy the persistent properties of the given instance to this instance.
|
|
118
|
+
The property `id` will be ignored.
|
|
119
|
+
Only the properties that are not null or undefined will be copied.
|
|
120
|
+
|
|
121
|
+
**`See`**
|
|
122
|
+
|
|
123
|
+
- fromObject
|
|
124
|
+
- toObject
|
|
125
|
+
|
|
126
|
+
#### Parameters
|
|
127
|
+
|
|
128
|
+
| Name | Type | Description |
|
|
129
|
+
| :------ | :------ | :------ |
|
|
130
|
+
| `instance` | [`Persistent`](Persistent.md) | the instance to be copied |
|
|
131
|
+
|
|
132
|
+
#### Returns
|
|
133
|
+
|
|
134
|
+
`void`
|
|
135
|
+
|
|
136
|
+
this instance
|
|
137
|
+
|
|
138
|
+
#### Defined in
|
|
139
|
+
|
|
140
|
+
[persistent/persistent.ts:183](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L183)
|
|
141
|
+
|
|
142
|
+
___
|
|
143
|
+
|
|
144
|
+
### fromObject
|
|
145
|
+
|
|
146
|
+
▸ **fromObject**(`obj`): [`Persistent`](Persistent.md)
|
|
147
|
+
|
|
148
|
+
Initializes the persistent properties of this instance from the properties
|
|
149
|
+
of given object.
|
|
150
|
+
|
|
151
|
+
**`See`**
|
|
152
|
+
|
|
153
|
+
- clone
|
|
154
|
+
- toObject
|
|
155
|
+
|
|
156
|
+
#### Parameters
|
|
157
|
+
|
|
158
|
+
| Name | Type | Description |
|
|
159
|
+
| :------ | :------ | :------ |
|
|
160
|
+
| `obj` | [`PersistentObject`](../modules.md#persistentobject)<[`Persistent`](Persistent.md)\> | the object to be copied |
|
|
161
|
+
|
|
162
|
+
#### Returns
|
|
163
|
+
|
|
164
|
+
[`Persistent`](Persistent.md)
|
|
165
|
+
|
|
166
|
+
this instance
|
|
167
|
+
|
|
168
|
+
#### Defined in
|
|
169
|
+
|
|
170
|
+
[persistent/persistent.ts:197](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L197)
|
|
171
|
+
|
|
172
|
+
___
|
|
173
|
+
|
|
174
|
+
### getPersistentProperties
|
|
175
|
+
|
|
176
|
+
▸ **getPersistentProperties**(): readonly `PersistentProperty`[]
|
|
177
|
+
|
|
178
|
+
Returns an array of the persistent properties of this instance.
|
|
179
|
+
|
|
180
|
+
#### Returns
|
|
181
|
+
|
|
182
|
+
readonly `PersistentProperty`[]
|
|
183
|
+
|
|
184
|
+
an array of the persistent properties of this instance
|
|
185
|
+
|
|
186
|
+
#### Defined in
|
|
187
|
+
|
|
188
|
+
[persistent/persistent.ts:167](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L167)
|
|
189
|
+
|
|
190
|
+
___
|
|
191
|
+
|
|
192
|
+
### onSerialized
|
|
193
|
+
|
|
194
|
+
▸ `Protected` **onSerialized**(): `void`
|
|
195
|
+
|
|
196
|
+
This method is called by the persistence engine when the instance has been
|
|
197
|
+
just serialized. It is called after the properties are initialized.
|
|
198
|
+
|
|
199
|
+
#### Returns
|
|
200
|
+
|
|
201
|
+
`void`
|
|
202
|
+
|
|
203
|
+
#### Defined in
|
|
204
|
+
|
|
205
|
+
[persistent/persistent.ts:155](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L155)
|
|
206
|
+
|
|
207
|
+
___
|
|
208
|
+
|
|
209
|
+
### setId
|
|
210
|
+
|
|
211
|
+
▸ `Protected` **setId**(`value`): `void`
|
|
212
|
+
|
|
213
|
+
Sets the id of this instance.
|
|
214
|
+
|
|
215
|
+
#### Parameters
|
|
216
|
+
|
|
217
|
+
| Name | Type | Description |
|
|
218
|
+
| :------ | :------ | :------ |
|
|
219
|
+
| `value` | `string` | the id of this instance |
|
|
220
|
+
|
|
221
|
+
#### Returns
|
|
222
|
+
|
|
223
|
+
`void`
|
|
224
|
+
|
|
225
|
+
#### Defined in
|
|
226
|
+
|
|
227
|
+
[persistent/persistent.ts:139](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L139)
|
|
228
|
+
|
|
229
|
+
___
|
|
230
|
+
|
|
231
|
+
### toObject
|
|
232
|
+
|
|
233
|
+
▸ **toObject**(): [`PersistentObject`](../modules.md#persistentobject)<[`Persistent`](Persistent.md)\>
|
|
234
|
+
|
|
235
|
+
Returns a plain object representation of this instance.
|
|
236
|
+
Only the properties that are not null or undefined will be copied.
|
|
237
|
+
|
|
238
|
+
**`See`**
|
|
239
|
+
|
|
240
|
+
- fromObject
|
|
241
|
+
- clone
|
|
242
|
+
|
|
243
|
+
#### Returns
|
|
244
|
+
|
|
245
|
+
[`PersistentObject`](../modules.md#persistentobject)<[`Persistent`](Persistent.md)\>
|
|
246
|
+
|
|
247
|
+
a plain object representation of this instance
|
|
248
|
+
|
|
249
|
+
#### Defined in
|
|
250
|
+
|
|
251
|
+
[persistent/persistent.ts:225](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L225)
|
|
252
|
+
|
|
253
|
+
___
|
|
254
|
+
|
|
255
|
+
### annotations
|
|
256
|
+
|
|
257
|
+
▸ `Static` **annotations**(`className`): `unknown`
|
|
258
|
+
|
|
259
|
+
Returns the annotation associated with a registered class
|
|
260
|
+
|
|
261
|
+
**`Throws`**
|
|
262
|
+
|
|
263
|
+
an error if the class is not registered
|
|
264
|
+
|
|
265
|
+
**`See`**
|
|
266
|
+
|
|
267
|
+
registerFactory
|
|
268
|
+
|
|
269
|
+
#### Parameters
|
|
270
|
+
|
|
271
|
+
| Name | Type | Description |
|
|
272
|
+
| :------ | :------ | :------ |
|
|
273
|
+
| `className` | `string` \| [`Persistent`](Persistent.md) \| [`PersistentConstructor`](../modules.md#persistentconstructor) | the name of the class to be retrieved |
|
|
274
|
+
|
|
275
|
+
#### Returns
|
|
276
|
+
|
|
277
|
+
`unknown`
|
|
278
|
+
|
|
279
|
+
the annotation associated with the class
|
|
280
|
+
|
|
281
|
+
#### Defined in
|
|
282
|
+
|
|
283
|
+
[persistent/persistent.ts:111](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L111)
|
|
284
|
+
|
|
285
|
+
___
|
|
286
|
+
|
|
287
|
+
### classFactory
|
|
288
|
+
|
|
289
|
+
▸ `Static` **classFactory**(`className`): [`PersistentConstructor`](../modules.md#persistentconstructor)
|
|
290
|
+
|
|
291
|
+
Returns the constructor of a registered class
|
|
292
|
+
|
|
293
|
+
**`Throws`**
|
|
294
|
+
|
|
295
|
+
an error if the class is not registered
|
|
296
|
+
|
|
297
|
+
**`See`**
|
|
298
|
+
|
|
299
|
+
- registerFactory
|
|
300
|
+
- registeredClasses
|
|
301
|
+
- classesExtending
|
|
302
|
+
- annotations
|
|
303
|
+
|
|
304
|
+
#### Parameters
|
|
305
|
+
|
|
306
|
+
| Name | Type | Description |
|
|
307
|
+
| :------ | :------ | :------ |
|
|
308
|
+
| `className` | `string` | the name of the class to be retrieved |
|
|
309
|
+
|
|
310
|
+
#### Returns
|
|
311
|
+
|
|
312
|
+
[`PersistentConstructor`](../modules.md#persistentconstructor)
|
|
313
|
+
|
|
314
|
+
the constructor of the class
|
|
315
|
+
|
|
316
|
+
#### Defined in
|
|
317
|
+
|
|
318
|
+
[persistent/persistent.ts:76](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L76)
|
|
319
|
+
|
|
320
|
+
___
|
|
321
|
+
|
|
322
|
+
### classesExtending
|
|
323
|
+
|
|
324
|
+
▸ `Static` **classesExtending**(`derivedFrom`): `string`[]
|
|
325
|
+
|
|
326
|
+
Returns the names of all registered classes that extend a given class
|
|
327
|
+
|
|
328
|
+
**`See`**
|
|
329
|
+
|
|
330
|
+
- registerFactory
|
|
331
|
+
- classFactory
|
|
332
|
+
|
|
333
|
+
#### Parameters
|
|
334
|
+
|
|
335
|
+
| Name | Type | Description |
|
|
336
|
+
| :------ | :------ | :------ |
|
|
337
|
+
| `derivedFrom` | `Function` \| [`PersistentConstructor`](../modules.md#persistentconstructor) | the class to be extended |
|
|
338
|
+
|
|
339
|
+
#### Returns
|
|
340
|
+
|
|
341
|
+
`string`[]
|
|
342
|
+
|
|
343
|
+
the names of all registered classes that extend the given class
|
|
344
|
+
|
|
345
|
+
#### Defined in
|
|
346
|
+
|
|
347
|
+
[persistent/persistent.ts:98](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L98)
|
|
348
|
+
|
|
349
|
+
___
|
|
350
|
+
|
|
351
|
+
### createInstance
|
|
352
|
+
|
|
353
|
+
▸ `Static` **createInstance**<`T`\>(`obj`): `T`
|
|
354
|
+
|
|
355
|
+
#### Type parameters
|
|
356
|
+
|
|
357
|
+
| Name | Type |
|
|
358
|
+
| :------ | :------ |
|
|
359
|
+
| `T` | extends [`Persistent`](Persistent.md)<`T`\> |
|
|
360
|
+
|
|
361
|
+
#### Parameters
|
|
362
|
+
|
|
363
|
+
| Name | Type |
|
|
364
|
+
| :------ | :------ |
|
|
365
|
+
| `obj` | `string` \| [`PersistentObject`](../modules.md#persistentobject)<`T`\> |
|
|
366
|
+
|
|
367
|
+
#### Returns
|
|
368
|
+
|
|
369
|
+
`T`
|
|
370
|
+
|
|
371
|
+
#### Defined in
|
|
372
|
+
|
|
373
|
+
[persistent/persistent.ts:384](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L384)
|
|
374
|
+
|
|
375
|
+
___
|
|
376
|
+
|
|
377
|
+
### registerFactory
|
|
378
|
+
|
|
379
|
+
▸ `Static` **registerFactory**(`className`, `factory`, `annotation?`): `void`
|
|
380
|
+
|
|
381
|
+
Registers a class to be used by the persistence engine.
|
|
382
|
+
|
|
383
|
+
#### Parameters
|
|
384
|
+
|
|
385
|
+
| Name | Type | Description |
|
|
386
|
+
| :------ | :------ | :------ |
|
|
387
|
+
| `className` | `string` | the name of the class to be registered |
|
|
388
|
+
| `factory` | [`PersistentConstructor`](../modules.md#persistentconstructor) | the constructor of the registered class |
|
|
389
|
+
| `annotation?` | `unknown` | an annotation associated with the class |
|
|
390
|
+
|
|
391
|
+
#### Returns
|
|
392
|
+
|
|
393
|
+
`void`
|
|
394
|
+
|
|
395
|
+
#### Defined in
|
|
396
|
+
|
|
397
|
+
[persistent/persistent.ts:62](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L62)
|
|
398
|
+
|
|
399
|
+
___
|
|
400
|
+
|
|
401
|
+
### registeredClasses
|
|
402
|
+
|
|
403
|
+
▸ `Static` **registeredClasses**(): `string`[]
|
|
404
|
+
|
|
405
|
+
Returns the names of all registered classes
|
|
406
|
+
|
|
407
|
+
**`See`**
|
|
408
|
+
|
|
409
|
+
- registerFactory
|
|
410
|
+
- classFactory
|
|
411
|
+
|
|
412
|
+
#### Returns
|
|
413
|
+
|
|
414
|
+
`string`[]
|
|
415
|
+
|
|
416
|
+
the names of all registered classes
|
|
417
|
+
|
|
418
|
+
#### Defined in
|
|
419
|
+
|
|
420
|
+
[persistent/persistent.ts:87](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/persistent/persistent.ts#L87)
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
[entropic-bond](../README.md) / [Exports](../modules.md) / ServerAuth
|
|
2
|
+
|
|
3
|
+
# Class: ServerAuth
|
|
4
|
+
|
|
5
|
+
## Hierarchy
|
|
6
|
+
|
|
7
|
+
- [`ServerAuthService`](ServerAuthService.md)
|
|
8
|
+
|
|
9
|
+
↳ **`ServerAuth`**
|
|
10
|
+
|
|
11
|
+
## Table of contents
|
|
12
|
+
|
|
13
|
+
### Constructors
|
|
14
|
+
|
|
15
|
+
- [constructor](ServerAuth.md#constructor)
|
|
16
|
+
|
|
17
|
+
### Properties
|
|
18
|
+
|
|
19
|
+
- [error](ServerAuth.md#error)
|
|
20
|
+
|
|
21
|
+
### Accessors
|
|
22
|
+
|
|
23
|
+
- [instance](ServerAuth.md#instance)
|
|
24
|
+
|
|
25
|
+
### Methods
|
|
26
|
+
|
|
27
|
+
- [deleteUser](ServerAuth.md#deleteuser)
|
|
28
|
+
- [getUser](ServerAuth.md#getuser)
|
|
29
|
+
- [setCustomCredentials](ServerAuth.md#setcustomcredentials)
|
|
30
|
+
- [updateUser](ServerAuth.md#updateuser)
|
|
31
|
+
- [useServerAuthService](ServerAuth.md#useserverauthservice)
|
|
32
|
+
|
|
33
|
+
## Constructors
|
|
34
|
+
|
|
35
|
+
### constructor
|
|
36
|
+
|
|
37
|
+
• `Protected` **new ServerAuth**()
|
|
38
|
+
|
|
39
|
+
#### Overrides
|
|
40
|
+
|
|
41
|
+
[ServerAuthService](ServerAuthService.md).[constructor](ServerAuthService.md#constructor)
|
|
42
|
+
|
|
43
|
+
#### Defined in
|
|
44
|
+
|
|
45
|
+
[server-auth/server-auth.ts:17](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L17)
|
|
46
|
+
|
|
47
|
+
## Properties
|
|
48
|
+
|
|
49
|
+
### error
|
|
50
|
+
|
|
51
|
+
▪ `Static` **error**: `Object`
|
|
52
|
+
|
|
53
|
+
#### Type declaration
|
|
54
|
+
|
|
55
|
+
| Name | Type |
|
|
56
|
+
| :------ | :------ |
|
|
57
|
+
| `shouldBeRegistered` | `string` |
|
|
58
|
+
|
|
59
|
+
#### Defined in
|
|
60
|
+
|
|
61
|
+
[server-auth/server-auth.ts:15](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L15)
|
|
62
|
+
|
|
63
|
+
## Accessors
|
|
64
|
+
|
|
65
|
+
### instance
|
|
66
|
+
|
|
67
|
+
• `Static` `get` **instance**(): [`ServerAuth`](ServerAuth.md)
|
|
68
|
+
|
|
69
|
+
#### Returns
|
|
70
|
+
|
|
71
|
+
[`ServerAuth`](ServerAuth.md)
|
|
72
|
+
|
|
73
|
+
#### Defined in
|
|
74
|
+
|
|
75
|
+
[server-auth/server-auth.ts:26](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L26)
|
|
76
|
+
|
|
77
|
+
## Methods
|
|
78
|
+
|
|
79
|
+
### deleteUser
|
|
80
|
+
|
|
81
|
+
▸ **deleteUser**(`userId`): `Promise`<`void`\>
|
|
82
|
+
|
|
83
|
+
#### Parameters
|
|
84
|
+
|
|
85
|
+
| Name | Type |
|
|
86
|
+
| :------ | :------ |
|
|
87
|
+
| `userId` | `string` |
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`Promise`<`void`\>
|
|
92
|
+
|
|
93
|
+
#### Overrides
|
|
94
|
+
|
|
95
|
+
[ServerAuthService](ServerAuthService.md).[deleteUser](ServerAuthService.md#deleteuser)
|
|
96
|
+
|
|
97
|
+
#### Defined in
|
|
98
|
+
|
|
99
|
+
[server-auth/server-auth.ts:43](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L43)
|
|
100
|
+
|
|
101
|
+
___
|
|
102
|
+
|
|
103
|
+
### getUser
|
|
104
|
+
|
|
105
|
+
▸ **getUser**<`T`\>(`userId`): `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
|
|
106
|
+
|
|
107
|
+
#### Type parameters
|
|
108
|
+
|
|
109
|
+
| Name | Type |
|
|
110
|
+
| :------ | :------ |
|
|
111
|
+
| `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
|
|
112
|
+
|
|
113
|
+
#### Parameters
|
|
114
|
+
|
|
115
|
+
| Name | Type |
|
|
116
|
+
| :------ | :------ |
|
|
117
|
+
| `userId` | `string` |
|
|
118
|
+
|
|
119
|
+
#### Returns
|
|
120
|
+
|
|
121
|
+
`Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
|
|
122
|
+
|
|
123
|
+
#### Overrides
|
|
124
|
+
|
|
125
|
+
[ServerAuthService](ServerAuthService.md).[getUser](ServerAuthService.md#getuser)
|
|
126
|
+
|
|
127
|
+
#### Defined in
|
|
128
|
+
|
|
129
|
+
[server-auth/server-auth.ts:31](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L31)
|
|
130
|
+
|
|
131
|
+
___
|
|
132
|
+
|
|
133
|
+
### setCustomCredentials
|
|
134
|
+
|
|
135
|
+
▸ **setCustomCredentials**<`T`\>(`userId`, `customCredentials`): `Promise`<`void`\>
|
|
136
|
+
|
|
137
|
+
#### Type parameters
|
|
138
|
+
|
|
139
|
+
| Name | Type |
|
|
140
|
+
| :------ | :------ |
|
|
141
|
+
| `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
|
|
142
|
+
|
|
143
|
+
#### Parameters
|
|
144
|
+
|
|
145
|
+
| Name | Type |
|
|
146
|
+
| :------ | :------ |
|
|
147
|
+
| `userId` | `string` |
|
|
148
|
+
| `customCredentials` | `T` |
|
|
149
|
+
|
|
150
|
+
#### Returns
|
|
151
|
+
|
|
152
|
+
`Promise`<`void`\>
|
|
153
|
+
|
|
154
|
+
#### Overrides
|
|
155
|
+
|
|
156
|
+
[ServerAuthService](ServerAuthService.md).[setCustomCredentials](ServerAuthService.md#setcustomcredentials)
|
|
157
|
+
|
|
158
|
+
#### Defined in
|
|
159
|
+
|
|
160
|
+
[server-auth/server-auth.ts:39](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L39)
|
|
161
|
+
|
|
162
|
+
___
|
|
163
|
+
|
|
164
|
+
### updateUser
|
|
165
|
+
|
|
166
|
+
▸ **updateUser**<`T`\>(`userId`, `credentials`): `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
|
|
167
|
+
|
|
168
|
+
#### Type parameters
|
|
169
|
+
|
|
170
|
+
| Name | Type |
|
|
171
|
+
| :------ | :------ |
|
|
172
|
+
| `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
|
|
173
|
+
|
|
174
|
+
#### Parameters
|
|
175
|
+
|
|
176
|
+
| Name | Type |
|
|
177
|
+
| :------ | :------ |
|
|
178
|
+
| `userId` | `string` |
|
|
179
|
+
| `credentials` | `Partial`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\> |
|
|
180
|
+
|
|
181
|
+
#### Returns
|
|
182
|
+
|
|
183
|
+
`Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
|
|
184
|
+
|
|
185
|
+
#### Overrides
|
|
186
|
+
|
|
187
|
+
[ServerAuthService](ServerAuthService.md).[updateUser](ServerAuthService.md#updateuser)
|
|
188
|
+
|
|
189
|
+
#### Defined in
|
|
190
|
+
|
|
191
|
+
[server-auth/server-auth.ts:35](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L35)
|
|
192
|
+
|
|
193
|
+
___
|
|
194
|
+
|
|
195
|
+
### useServerAuthService
|
|
196
|
+
|
|
197
|
+
▸ `Static` **useServerAuthService**(`authService`): `void`
|
|
198
|
+
|
|
199
|
+
#### Parameters
|
|
200
|
+
|
|
201
|
+
| Name | Type |
|
|
202
|
+
| :------ | :------ |
|
|
203
|
+
| `authService` | [`ServerAuthService`](ServerAuthService.md) |
|
|
204
|
+
|
|
205
|
+
#### Returns
|
|
206
|
+
|
|
207
|
+
`void`
|
|
208
|
+
|
|
209
|
+
#### Defined in
|
|
210
|
+
|
|
211
|
+
[server-auth/server-auth.ts:19](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L19)
|