entropic-bond 1.50.0 → 1.50.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 (111) hide show
  1. package/lib/auth/auth-mock.d.ts +22 -0
  2. package/lib/auth/auth-mock.spec.d.ts +1 -0
  3. package/lib/auth/auth.d.ts +131 -0
  4. package/lib/auth/user-auth-types.d.ts +19 -0
  5. package/lib/cloud-functions/cloud-functions-mock.d.ts +11 -0
  6. package/lib/cloud-functions/cloud-functions-mock.spec.d.ts +1 -0
  7. package/lib/cloud-functions/cloud-functions.d.ts +19 -0
  8. package/lib/cloud-storage/cloud-storage.d.ts +24 -0
  9. package/lib/cloud-storage/cloud-storage.spec.d.ts +1 -0
  10. package/lib/cloud-storage/mock-cloud-storage.d.ts +20 -0
  11. package/lib/cloud-storage/stored-file.d.ts +39 -0
  12. package/lib/entropic-bond.js +1667 -0
  13. package/lib/entropic-bond.umd.cjs +7 -0
  14. package/lib/index.d.ts +19 -0
  15. package/lib/observable/observable.d.ts +52 -0
  16. package/lib/observable/observable.spec.d.ts +1 -0
  17. package/lib/persistent/entropic-component.d.ts +76 -0
  18. package/lib/persistent/entropic-component.spec.d.ts +1 -0
  19. package/lib/persistent/persistent.d.ts +281 -0
  20. package/lib/persistent/persistent.spec.d.ts +67 -0
  21. package/lib/server-auth/server-auth-mock.d.ts +12 -0
  22. package/lib/server-auth/server-auth-mock.spec.d.ts +1 -0
  23. package/lib/server-auth/server-auth.d.ts +24 -0
  24. package/lib/store/data-source.d.ts +137 -0
  25. package/lib/store/json-data-source.d.ts +68 -0
  26. package/lib/store/json-data-source.spec.d.ts +1 -0
  27. package/lib/store/mocks/test-user.d.ts +49 -0
  28. package/lib/store/model.d.ts +238 -0
  29. package/lib/store/model.spec.d.ts +1 -0
  30. package/lib/store/store.d.ts +62 -0
  31. package/lib/store/store.spec.d.ts +1 -0
  32. package/lib/types/utility-types.d.ts +45 -0
  33. package/lib/types/utility-types.spec.d.ts +1 -0
  34. package/lib/utils/test-utils/test-person.d.ts +33 -0
  35. package/{src/utils/utils.ts → lib/utils/utils.d.ts} +10 -34
  36. package/lib/utils/utils.spec.d.ts +1 -0
  37. package/package.json +4 -1
  38. package/.github/workflows/release.yml +0 -26
  39. package/CHANGELOG.md +0 -1151
  40. package/docs/.nojekyll +0 -1
  41. package/docs/README.md +0 -94
  42. package/docs/classes/Auth.md +0 -391
  43. package/docs/classes/AuthMock.md +0 -278
  44. package/docs/classes/AuthService.md +0 -188
  45. package/docs/classes/CloudFunctions.md +0 -123
  46. package/docs/classes/CloudFunctionsMock.md +0 -97
  47. package/docs/classes/CloudStorage.md +0 -215
  48. package/docs/classes/DataSource.md +0 -248
  49. package/docs/classes/EntropicComponent.md +0 -666
  50. package/docs/classes/JsonDataSource.md +0 -328
  51. package/docs/classes/MockCloudStorage.md +0 -279
  52. package/docs/classes/Model.md +0 -274
  53. package/docs/classes/Observable.md +0 -120
  54. package/docs/classes/Persistent.md +0 -420
  55. package/docs/classes/ServerAuth.md +0 -211
  56. package/docs/classes/ServerAuthMock.md +0 -176
  57. package/docs/classes/ServerAuthService.md +0 -130
  58. package/docs/classes/Store.md +0 -218
  59. package/docs/classes/StoredFile.md +0 -636
  60. package/docs/enums/StoredFileEvent.md +0 -41
  61. package/docs/interfaces/AuthError.md +0 -30
  62. package/docs/interfaces/CloudFunctionsService.md +0 -69
  63. package/docs/interfaces/Collection.md +0 -13
  64. package/docs/interfaces/CustomCredentials.md +0 -7
  65. package/docs/interfaces/DocumentReference.md +0 -49
  66. package/docs/interfaces/JsonRawData.md +0 -7
  67. package/docs/interfaces/SignData.md +0 -63
  68. package/docs/interfaces/StoreParams.md +0 -52
  69. package/docs/interfaces/StoredFileChange.md +0 -41
  70. package/docs/interfaces/UploadControl.md +0 -90
  71. package/docs/interfaces/UserCredentials.md +0 -113
  72. package/docs/interfaces/Values.md +0 -17
  73. package/docs/modules.md +0 -1273
  74. package/src/auth/auth-mock.spec.ts +0 -168
  75. package/src/auth/auth-mock.ts +0 -129
  76. package/src/auth/auth.ts +0 -185
  77. package/src/auth/user-auth-types.ts +0 -21
  78. package/src/cloud-functions/cloud-functions-mock.spec.ts +0 -136
  79. package/src/cloud-functions/cloud-functions-mock.ts +0 -23
  80. package/src/cloud-functions/cloud-functions.ts +0 -83
  81. package/src/cloud-storage/cloud-storage.spec.ts +0 -207
  82. package/src/cloud-storage/cloud-storage.ts +0 -60
  83. package/src/cloud-storage/mock-cloud-storage.ts +0 -72
  84. package/src/cloud-storage/stored-file.ts +0 -102
  85. package/src/index.ts +0 -19
  86. package/src/observable/observable.spec.ts +0 -105
  87. package/src/observable/observable.ts +0 -67
  88. package/src/persistent/entropic-component.spec.ts +0 -143
  89. package/src/persistent/entropic-component.ts +0 -135
  90. package/src/persistent/persistent.spec.ts +0 -828
  91. package/src/persistent/persistent.ts +0 -650
  92. package/src/server-auth/server-auth-mock.spec.ts +0 -53
  93. package/src/server-auth/server-auth-mock.ts +0 -45
  94. package/src/server-auth/server-auth.ts +0 -49
  95. package/src/store/data-source.ts +0 -186
  96. package/src/store/json-data-source.spec.ts +0 -100
  97. package/src/store/json-data-source.ts +0 -256
  98. package/src/store/mocks/mock-data.json +0 -155
  99. package/src/store/mocks/test-user.ts +0 -122
  100. package/src/store/model.spec.ts +0 -659
  101. package/src/store/model.ts +0 -462
  102. package/src/store/store.spec.ts +0 -30
  103. package/src/store/store.ts +0 -113
  104. package/src/types/utility-types.spec.ts +0 -117
  105. package/src/types/utility-types.ts +0 -116
  106. package/src/utils/test-utils/test-person.ts +0 -44
  107. package/src/utils/utils.spec.ts +0 -95
  108. package/tsconfig-build.json +0 -7
  109. package/tsconfig-cjs.json +0 -9
  110. package/tsconfig.json +0 -33
  111. package/vite.config.ts +0 -22
@@ -1,176 +0,0 @@
1
- [entropic-bond](../README.md) / [Exports](../modules.md) / ServerAuthMock
2
-
3
- # Class: ServerAuthMock
4
-
5
- ## Hierarchy
6
-
7
- - [`ServerAuthService`](ServerAuthService.md)
8
-
9
- ↳ **`ServerAuthMock`**
10
-
11
- ## Table of contents
12
-
13
- ### Constructors
14
-
15
- - [constructor](ServerAuthMock.md#constructor)
16
-
17
- ### Accessors
18
-
19
- - [userCredentials](ServerAuthMock.md#usercredentials)
20
-
21
- ### Methods
22
-
23
- - [deleteUser](ServerAuthMock.md#deleteuser)
24
- - [getUser](ServerAuthMock.md#getuser)
25
- - [setCustomCredentials](ServerAuthMock.md#setcustomcredentials)
26
- - [updateUser](ServerAuthMock.md#updateuser)
27
-
28
- ## Constructors
29
-
30
- ### constructor
31
-
32
- • **new ServerAuthMock**(`userCredentials`)
33
-
34
- #### Parameters
35
-
36
- | Name | Type |
37
- | :------ | :------ |
38
- | `userCredentials` | [`Collection`](../interfaces/Collection.md)<[`UserCredentials`](../interfaces/UserCredentials.md)<{}\>\> |
39
-
40
- #### Overrides
41
-
42
- [ServerAuthService](ServerAuthService.md).[constructor](ServerAuthService.md#constructor)
43
-
44
- #### Defined in
45
-
46
- [server-auth/server-auth-mock.ts:6](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth-mock.ts#L6)
47
-
48
- ## Accessors
49
-
50
- ### userCredentials
51
-
52
- • `get` **userCredentials**(): [`Collection`](../interfaces/Collection.md)<[`UserCredentials`](../interfaces/UserCredentials.md)<{}\>\>
53
-
54
- #### Returns
55
-
56
- [`Collection`](../interfaces/Collection.md)<[`UserCredentials`](../interfaces/UserCredentials.md)<{}\>\>
57
-
58
- #### Defined in
59
-
60
- [server-auth/server-auth-mock.ts:39](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth-mock.ts#L39)
61
-
62
- ## Methods
63
-
64
- ### deleteUser
65
-
66
- ▸ **deleteUser**(`userId`): `Promise`<`void`\>
67
-
68
- #### Parameters
69
-
70
- | Name | Type |
71
- | :------ | :------ |
72
- | `userId` | `string` |
73
-
74
- #### Returns
75
-
76
- `Promise`<`void`\>
77
-
78
- #### Overrides
79
-
80
- [ServerAuthService](ServerAuthService.md).[deleteUser](ServerAuthService.md#deleteuser)
81
-
82
- #### Defined in
83
-
84
- [server-auth/server-auth-mock.ts:34](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth-mock.ts#L34)
85
-
86
- ___
87
-
88
- ### getUser
89
-
90
- ▸ **getUser**<`T`\>(`userId`): `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
91
-
92
- #### Type parameters
93
-
94
- | Name | Type |
95
- | :------ | :------ |
96
- | `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
97
-
98
- #### Parameters
99
-
100
- | Name | Type |
101
- | :------ | :------ |
102
- | `userId` | `string` |
103
-
104
- #### Returns
105
-
106
- `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
107
-
108
- #### Overrides
109
-
110
- [ServerAuthService](ServerAuthService.md).[getUser](ServerAuthService.md#getuser)
111
-
112
- #### Defined in
113
-
114
- [server-auth/server-auth-mock.ts:11](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth-mock.ts#L11)
115
-
116
- ___
117
-
118
- ### setCustomCredentials
119
-
120
- ▸ **setCustomCredentials**<`T`\>(`userId`, `customCredentials`): `Promise`<`void`\>
121
-
122
- #### Type parameters
123
-
124
- | Name | Type |
125
- | :------ | :------ |
126
- | `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
127
-
128
- #### Parameters
129
-
130
- | Name | Type |
131
- | :------ | :------ |
132
- | `userId` | `string` |
133
- | `customCredentials` | `T` |
134
-
135
- #### Returns
136
-
137
- `Promise`<`void`\>
138
-
139
- #### Overrides
140
-
141
- [ServerAuthService](ServerAuthService.md).[setCustomCredentials](ServerAuthService.md#setcustomcredentials)
142
-
143
- #### Defined in
144
-
145
- [server-auth/server-auth-mock.ts:17](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth-mock.ts#L17)
146
-
147
- ___
148
-
149
- ### updateUser
150
-
151
- ▸ **updateUser**<`T`\>(`userId`, `credentials`): `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
152
-
153
- #### Type parameters
154
-
155
- | Name | Type |
156
- | :------ | :------ |
157
- | `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
158
-
159
- #### Parameters
160
-
161
- | Name | Type |
162
- | :------ | :------ |
163
- | `userId` | `string` |
164
- | `credentials` | `Partial`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\> |
165
-
166
- #### Returns
167
-
168
- `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
169
-
170
- #### Overrides
171
-
172
- [ServerAuthService](ServerAuthService.md).[updateUser](ServerAuthService.md#updateuser)
173
-
174
- #### Defined in
175
-
176
- [server-auth/server-auth-mock.ts:24](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth-mock.ts#L24)
@@ -1,130 +0,0 @@
1
- [entropic-bond](../README.md) / [Exports](../modules.md) / ServerAuthService
2
-
3
- # Class: ServerAuthService
4
-
5
- ## Hierarchy
6
-
7
- - **`ServerAuthService`**
8
-
9
- ↳ [`ServerAuth`](ServerAuth.md)
10
-
11
- ↳ [`ServerAuthMock`](ServerAuthMock.md)
12
-
13
- ## Table of contents
14
-
15
- ### Constructors
16
-
17
- - [constructor](ServerAuthService.md#constructor)
18
-
19
- ### Methods
20
-
21
- - [deleteUser](ServerAuthService.md#deleteuser)
22
- - [getUser](ServerAuthService.md#getuser)
23
- - [setCustomCredentials](ServerAuthService.md#setcustomcredentials)
24
- - [updateUser](ServerAuthService.md#updateuser)
25
-
26
- ## Constructors
27
-
28
- ### constructor
29
-
30
- • **new ServerAuthService**()
31
-
32
- ## Methods
33
-
34
- ### deleteUser
35
-
36
- ▸ `Abstract` **deleteUser**(`userId`): `Promise`<`void`\>
37
-
38
- #### Parameters
39
-
40
- | Name | Type |
41
- | :------ | :------ |
42
- | `userId` | `string` |
43
-
44
- #### Returns
45
-
46
- `Promise`<`void`\>
47
-
48
- #### Defined in
49
-
50
- [server-auth/server-auth.ts:11](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L11)
51
-
52
- ___
53
-
54
- ### getUser
55
-
56
- ▸ `Abstract` **getUser**<`T`\>(`userId`): `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
57
-
58
- #### Type parameters
59
-
60
- | Name | Type |
61
- | :------ | :------ |
62
- | `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
63
-
64
- #### Parameters
65
-
66
- | Name | Type |
67
- | :------ | :------ |
68
- | `userId` | `string` |
69
-
70
- #### Returns
71
-
72
- `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
73
-
74
- #### Defined in
75
-
76
- [server-auth/server-auth.ts:9](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L9)
77
-
78
- ___
79
-
80
- ### setCustomCredentials
81
-
82
- ▸ `Abstract` **setCustomCredentials**<`T`\>(`userId`, `customCredentials`): `Promise`<`void`\>
83
-
84
- #### Type parameters
85
-
86
- | Name | Type |
87
- | :------ | :------ |
88
- | `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
89
-
90
- #### Parameters
91
-
92
- | Name | Type |
93
- | :------ | :------ |
94
- | `userId` | `string` |
95
- | `customCredentials` | `T` |
96
-
97
- #### Returns
98
-
99
- `Promise`<`void`\>
100
-
101
- #### Defined in
102
-
103
- [server-auth/server-auth.ts:8](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L8)
104
-
105
- ___
106
-
107
- ### updateUser
108
-
109
- ▸ `Abstract` **updateUser**<`T`\>(`userId`, `credentials`): `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
110
-
111
- #### Type parameters
112
-
113
- | Name | Type |
114
- | :------ | :------ |
115
- | `T` | extends [`CustomCredentials`](../interfaces/CustomCredentials.md) |
116
-
117
- #### Parameters
118
-
119
- | Name | Type |
120
- | :------ | :------ |
121
- | `userId` | `string` |
122
- | `credentials` | `Partial`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\> |
123
-
124
- #### Returns
125
-
126
- `Promise`<[`UserCredentials`](../interfaces/UserCredentials.md)<`T`\>\>
127
-
128
- #### Defined in
129
-
130
- [server-auth/server-auth.ts:10](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/server-auth/server-auth.ts#L10)
@@ -1,218 +0,0 @@
1
- [entropic-bond](../README.md) / [Exports](../modules.md) / Store
2
-
3
- # Class: Store
4
-
5
- The store is the main entry point for the data access layer.
6
- It provides methods to retrieve models for collections and subcollections.
7
- It also provides methods to populate property references with actual data from the store.
8
- You need to register a data source before using the store.
9
-
10
- **`Example`**
11
-
12
- ```ts
13
- // Register a data source
14
- Store.useDataSource( new FirestoreDataSource( firebase.firestore() ) )
15
- // Retrieve a model for a collection
16
- const model = Store.getModel( 'User' )
17
- // Retrieve a model for a subcollection
18
- const model = Store.getModelForSubCollection( user, 'Posts' )
19
- // Populate property references
20
- const user = await Store.populate( user )
21
- ```
22
-
23
- ## Table of contents
24
-
25
- ### Properties
26
-
27
- - [error](Store.md#error)
28
-
29
- ### Accessors
30
-
31
- - [dataSource](Store.md#datasource)
32
-
33
- ### Methods
34
-
35
- - [getModel](Store.md#getmodel)
36
- - [getModelForSubCollection](Store.md#getmodelforsubcollection)
37
- - [isPopulated](Store.md#ispopulated)
38
- - [populate](Store.md#populate)
39
- - [useDataSource](Store.md#usedatasource)
40
-
41
- ## Properties
42
-
43
- ### error
44
-
45
- ▪ `Static` **error**: `Object`
46
-
47
- #### Type declaration
48
-
49
- | Name | Type |
50
- | :------ | :------ |
51
- | `shouldBeRegistered` | `string` |
52
-
53
- #### Defined in
54
-
55
- [store/store.ts:23](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/store.ts#L23)
56
-
57
- ## Accessors
58
-
59
- ### dataSource
60
-
61
- • `Static` `get` **dataSource**(): [`DataSource`](DataSource.md)
62
-
63
- The data source currently used by the store
64
-
65
- #### Returns
66
-
67
- [`DataSource`](DataSource.md)
68
-
69
- the data source
70
-
71
- #### Defined in
72
-
73
- [store/store.ts:38](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/store.ts#L38)
74
-
75
- ## Methods
76
-
77
- ### getModel
78
-
79
- ▸ `Static` **getModel**<`T`\>(`classId`): [`Model`](Model.md)<`T`\>
80
-
81
- Retrieves a model for a collection
82
-
83
- #### Type parameters
84
-
85
- | Name | Type |
86
- | :------ | :------ |
87
- | `T` | extends [`Persistent`](Persistent.md)<`T`\> |
88
-
89
- #### Parameters
90
-
91
- | Name | Type | Description |
92
- | :------ | :------ | :------ |
93
- | `classId` | `string` \| `T` | the class name or an instance of the document type stored in the collection |
94
-
95
- #### Returns
96
-
97
- [`Model`](Model.md)<`T`\>
98
-
99
- the model for the collection
100
-
101
- #### Defined in
102
-
103
- [store/store.ts:47](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/store.ts#L47)
104
-
105
- ___
106
-
107
- ### getModelForSubCollection
108
-
109
- ▸ `Static` **getModelForSubCollection**<`T`\>(`document`, `subCollection`): [`Model`](Model.md)<`T`\>
110
-
111
- Retrieves a model for a subcollection
112
-
113
- #### Type parameters
114
-
115
- | Name | Type |
116
- | :------ | :------ |
117
- | `T` | extends [`Persistent`](Persistent.md)<`T`\> |
118
-
119
- #### Parameters
120
-
121
- | Name | Type | Description |
122
- | :------ | :------ | :------ |
123
- | `document` | [`Persistent`](Persistent.md) | the persistent object that owns the subcollection |
124
- | `subCollection` | `string` | the name of the subcollection |
125
-
126
- #### Returns
127
-
128
- [`Model`](Model.md)<`T`\>
129
-
130
- the model for the subcollection
131
-
132
- #### Defined in
133
-
134
- [store/store.ts:58](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/store.ts#L58)
135
-
136
- ___
137
-
138
- ### isPopulated
139
-
140
- ▸ `Static` **isPopulated**<`T`\>(`instance`): `boolean`
141
-
142
- Checks if an instance is populated
143
-
144
- #### Type parameters
145
-
146
- | Name | Type |
147
- | :------ | :------ |
148
- | `T` | extends [`Persistent`](Persistent.md)<`T`\> |
149
-
150
- #### Parameters
151
-
152
- | Name | Type | Description |
153
- | :------ | :------ | :------ |
154
- | `instance` | `T` \| readonly `T`[] | the instance or array of instances to be checked |
155
-
156
- #### Returns
157
-
158
- `boolean`
159
-
160
- true if the instance is populated
161
-
162
- #### Defined in
163
-
164
- [store/store.ts:100](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/store.ts#L100)
165
-
166
- ___
167
-
168
- ### populate
169
-
170
- ▸ `Static` **populate**<`T`\>(`instance`): `Promise`<`T`\>
171
-
172
- Populates property references with actual data from the store.
173
- It will not retrieve data if the instance is already populated
174
-
175
- #### Type parameters
176
-
177
- | Name | Type |
178
- | :------ | :------ |
179
- | `T` | extends [`Persistent`](Persistent.md) \| [`Persistent`](Persistent.md)[] |
180
-
181
- #### Parameters
182
-
183
- | Name | Type | Description |
184
- | :------ | :------ | :------ |
185
- | `instance` | `T` | the data to be populated. |
186
-
187
- #### Returns
188
-
189
- `Promise`<`T`\>
190
-
191
- the populated instance
192
-
193
- #### Defined in
194
-
195
- [store/store.ts:69](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/store.ts#L69)
196
-
197
- ___
198
-
199
- ### useDataSource
200
-
201
- ▸ `Static` **useDataSource**(`dataSource`): `void`
202
-
203
- Registers a data source to be used by the store.
204
- You need to register a data source before using the store.
205
-
206
- #### Parameters
207
-
208
- | Name | Type | Description |
209
- | :------ | :------ | :------ |
210
- | `dataSource` | [`DataSource`](DataSource.md) | the data source to be used by the store |
211
-
212
- #### Returns
213
-
214
- `void`
215
-
216
- #### Defined in
217
-
218
- [store/store.ts:30](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/store.ts#L30)