entropic-bond 1.50.0 → 1.50.2

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 +7 -4
  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,215 +0,0 @@
1
- [entropic-bond](../README.md) / [Exports](../modules.md) / CloudStorage
2
-
3
- # Class: CloudStorage
4
-
5
- ## Hierarchy
6
-
7
- - **`CloudStorage`**
8
-
9
- ↳ [`MockCloudStorage`](MockCloudStorage.md)
10
-
11
- ## Table of contents
12
-
13
- ### Constructors
14
-
15
- - [constructor](CloudStorage.md#constructor)
16
-
17
- ### Properties
18
-
19
- - [\_defaultCloudStorage](CloudStorage.md#_defaultcloudstorage)
20
-
21
- ### Accessors
22
-
23
- - [className](CloudStorage.md#classname)
24
- - [defaultCloudStorage](CloudStorage.md#defaultcloudstorage)
25
-
26
- ### Methods
27
-
28
- - [delete](CloudStorage.md#delete)
29
- - [getUrl](CloudStorage.md#geturl)
30
- - [save](CloudStorage.md#save)
31
- - [uploadControl](CloudStorage.md#uploadcontrol)
32
- - [createInstance](CloudStorage.md#createinstance)
33
- - [registerCloudStorage](CloudStorage.md#registercloudstorage)
34
- - [useCloudStorage](CloudStorage.md#usecloudstorage)
35
-
36
- ## Constructors
37
-
38
- ### constructor
39
-
40
- • **new CloudStorage**()
41
-
42
- ## Properties
43
-
44
- ### \_defaultCloudStorage
45
-
46
- ▪ `Static` **\_defaultCloudStorage**: [`CloudStorage`](CloudStorage.md)
47
-
48
- #### Defined in
49
-
50
- [cloud-storage/cloud-storage.ts:50](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L50)
51
-
52
- ## Accessors
53
-
54
- ### className
55
-
56
- • `get` **className**(): `string`
57
-
58
- #### Returns
59
-
60
- `string`
61
-
62
- #### Defined in
63
-
64
- [cloud-storage/cloud-storage.ts:36](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L36)
65
-
66
- ___
67
-
68
- ### defaultCloudStorage
69
-
70
- • `Static` `get` **defaultCloudStorage**(): [`CloudStorage`](CloudStorage.md)
71
-
72
- #### Returns
73
-
74
- [`CloudStorage`](CloudStorage.md)
75
-
76
- #### Defined in
77
-
78
- [cloud-storage/cloud-storage.ts:44](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L44)
79
-
80
- ## Methods
81
-
82
- ### delete
83
-
84
- ▸ `Abstract` **delete**(`reference`): `Promise`<`void`\>
85
-
86
- #### Parameters
87
-
88
- | Name | Type |
89
- | :------ | :------ |
90
- | `reference` | `string` |
91
-
92
- #### Returns
93
-
94
- `Promise`<`void`\>
95
-
96
- #### Defined in
97
-
98
- [cloud-storage/cloud-storage.ts:22](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L22)
99
-
100
- ___
101
-
102
- ### getUrl
103
-
104
- ▸ `Abstract` **getUrl**(`reference`): `Promise`<`string`\>
105
-
106
- #### Parameters
107
-
108
- | Name | Type |
109
- | :------ | :------ |
110
- | `reference` | `string` |
111
-
112
- #### Returns
113
-
114
- `Promise`<`string`\>
115
-
116
- #### Defined in
117
-
118
- [cloud-storage/cloud-storage.ts:20](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L20)
119
-
120
- ___
121
-
122
- ### save
123
-
124
- ▸ `Abstract` **save**(`id`, `data`, `progress`): `Promise`<`string`\>
125
-
126
- #### Parameters
127
-
128
- | Name | Type |
129
- | :------ | :------ |
130
- | `id` | `string` |
131
- | `data` | [`StorableData`](../modules.md#storabledata) |
132
- | `progress` | [`UploadProgress`](../modules.md#uploadprogress) |
133
-
134
- #### Returns
135
-
136
- `Promise`<`string`\>
137
-
138
- #### Defined in
139
-
140
- [cloud-storage/cloud-storage.ts:19](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L19)
141
-
142
- ___
143
-
144
- ### uploadControl
145
-
146
- ▸ `Abstract` **uploadControl**(): [`UploadControl`](../interfaces/UploadControl.md)
147
-
148
- #### Returns
149
-
150
- [`UploadControl`](../interfaces/UploadControl.md)
151
-
152
- #### Defined in
153
-
154
- [cloud-storage/cloud-storage.ts:21](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L21)
155
-
156
- ___
157
-
158
- ### createInstance
159
-
160
- ▸ `Static` **createInstance**(`providerName`): [`CloudStorage`](CloudStorage.md)
161
-
162
- #### Parameters
163
-
164
- | Name | Type |
165
- | :------ | :------ |
166
- | `providerName` | `string` |
167
-
168
- #### Returns
169
-
170
- [`CloudStorage`](CloudStorage.md)
171
-
172
- #### Defined in
173
-
174
- [cloud-storage/cloud-storage.ts:28](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L28)
175
-
176
- ___
177
-
178
- ### registerCloudStorage
179
-
180
- ▸ `Static` **registerCloudStorage**(`cloudStorageProviderName`, `factory`): `void`
181
-
182
- #### Parameters
183
-
184
- | Name | Type |
185
- | :------ | :------ |
186
- | `cloudStorageProviderName` | `string` |
187
- | `factory` | `CloudStorageFactory` |
188
-
189
- #### Returns
190
-
191
- `void`
192
-
193
- #### Defined in
194
-
195
- [cloud-storage/cloud-storage.ts:24](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L24)
196
-
197
- ___
198
-
199
- ### useCloudStorage
200
-
201
- ▸ `Static` **useCloudStorage**(`provider`): `void`
202
-
203
- #### Parameters
204
-
205
- | Name | Type |
206
- | :------ | :------ |
207
- | `provider` | [`CloudStorage`](CloudStorage.md) |
208
-
209
- #### Returns
210
-
211
- `void`
212
-
213
- #### Defined in
214
-
215
- [cloud-storage/cloud-storage.ts:40](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/cloud-storage/cloud-storage.ts#L40)
@@ -1,248 +0,0 @@
1
- [entropic-bond](../README.md) / [Exports](../modules.md) / DataSource
2
-
3
- # Class: DataSource
4
-
5
- The data source interface.
6
- It defines the methods that must be implemented by a data source
7
- A data source is able to retrieve and save data i.e: from a database, a file, a RestAPI, etc.
8
- You can derive from this class to implement your own data source with the
9
- A data source is used by the store to retrieve and save data.
10
-
11
- ## Implemented by
12
-
13
- - [`JsonDataSource`](JsonDataSource.md)
14
-
15
- ## Table of contents
16
-
17
- ### Constructors
18
-
19
- - [constructor](DataSource.md#constructor)
20
-
21
- ### Methods
22
-
23
- - [count](DataSource.md#count)
24
- - [delete](DataSource.md#delete)
25
- - [find](DataSource.md#find)
26
- - [findById](DataSource.md#findbyid)
27
- - [next](DataSource.md#next)
28
- - [save](DataSource.md#save)
29
- - [toPropertyPathOperations](DataSource.md#topropertypathoperations)
30
-
31
- ## Constructors
32
-
33
- ### constructor
34
-
35
- • **new DataSource**()
36
-
37
- ## Methods
38
-
39
- ### count
40
-
41
- ▸ `Abstract` **count**(`queryObject`, `collectionName`): `Promise`<`number`\>
42
-
43
- Retrieves the number of documents matching the query stored in the query object
44
- Implement the required logic to retrieve the number of documents that match the
45
- requirements in the query object from your concrete the data source
46
-
47
- **`See`**
48
-
49
- QueryObject
50
-
51
- #### Parameters
52
-
53
- | Name | Type | Description |
54
- | :------ | :------ | :------ |
55
- | `queryObject` | [`QueryObject`](../modules.md#queryobject)<[`DocumentObject`](../modules.md#documentobject)\> | the query object containing the query operations |
56
- | `collectionName` | `string` | the name of the collection where the documents are stored |
57
-
58
- #### Returns
59
-
60
- `Promise`<`number`\>
61
-
62
- a promise resolving to the number of documents matching the query
63
-
64
- #### Defined in
65
-
66
- [store/data-source.ts:125](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/data-source.ts#L125)
67
-
68
- ___
69
-
70
- ### delete
71
-
72
- ▸ `Abstract` **delete**(`id`, `collectionName`): `Promise`<`void`\>
73
-
74
- Deletes a document by id
75
- Implement the required logic to delete a document by id from your concrete
76
- data source
77
-
78
- #### Parameters
79
-
80
- | Name | Type | Description |
81
- | :------ | :------ | :------ |
82
- | `id` | `string` | the id of the document to be deleted |
83
- | `collectionName` | `string` | the name of the collection where the document is stored |
84
-
85
- #### Returns
86
-
87
- `Promise`<`void`\>
88
-
89
- a promise
90
-
91
- #### Defined in
92
-
93
- [store/data-source.ts:105](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/data-source.ts#L105)
94
-
95
- ___
96
-
97
- ### find
98
-
99
- ▸ `Abstract` **find**(`queryObject`, `collectionName`): `Promise`<[`DocumentObject`](../modules.md#documentobject)[]\>
100
-
101
- Retrieves all documents matching the query stored in the query object
102
- Implement the required logic to retrieve the documents that match the
103
- requirements in the query object from your concrete the data source
104
-
105
- **`See`**
106
-
107
- - QueryObject
108
- - QueryOperation
109
- - QueryOperator
110
- - QueryOrder
111
- - DocumentObject
112
-
113
- #### Parameters
114
-
115
- | Name | Type | Description |
116
- | :------ | :------ | :------ |
117
- | `queryObject` | [`QueryObject`](../modules.md#queryobject)<[`DocumentObject`](../modules.md#documentobject)\> | the query object containing the query operations |
118
- | `collectionName` | `string` | the name of the collection where the documents are stored |
119
-
120
- #### Returns
121
-
122
- `Promise`<[`DocumentObject`](../modules.md#documentobject)[]\>
123
-
124
- a promise resolving to an array of document objects. The document object is
125
- a plain object with the properties of the document class.
126
-
127
- #### Defined in
128
-
129
- [store/data-source.ts:87](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/data-source.ts#L87)
130
-
131
- ___
132
-
133
- ### findById
134
-
135
- ▸ `Abstract` **findById**(`id`, `collectionName`): `Promise`<[`DocumentObject`](../modules.md#documentobject)\>
136
-
137
- Retrieves a document by id
138
- Implement the required logic to retrieve a document by id from your concrete
139
- the data source
140
-
141
- #### Parameters
142
-
143
- | Name | Type | Description |
144
- | :------ | :------ | :------ |
145
- | `id` | `string` | the id of the document to be retrieved |
146
- | `collectionName` | `string` | the name of the collection where the document is stored |
147
-
148
- #### Returns
149
-
150
- `Promise`<[`DocumentObject`](../modules.md#documentobject)\>
151
-
152
- a promise resolving to the document object. The document object is
153
- a plain object with the properties of the document class.
154
-
155
- #### Defined in
156
-
157
- [store/data-source.ts:71](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/data-source.ts#L71)
158
-
159
- ___
160
-
161
- ### next
162
-
163
- ▸ `Abstract` **next**(`limit?`): `Promise`<[`DocumentObject`](../modules.md#documentobject)[]\>
164
-
165
- Retrieves the next bunch of documents matching the query stored in the query object
166
- Implement the required logic to retrieve the next bunch of documents that match the
167
- requirements in the query object from your concrete the data source
168
-
169
- #### Parameters
170
-
171
- | Name | Type | Description |
172
- | :------ | :------ | :------ |
173
- | `limit?` | `number` | the maximum number of items to be retrieved |
174
-
175
- #### Returns
176
-
177
- `Promise`<[`DocumentObject`](../modules.md#documentobject)[]\>
178
-
179
- a promise resolving to an array representing the next bunch of document objects
180
-
181
- #### Defined in
182
-
183
- [store/data-source.ts:114](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/data-source.ts#L114)
184
-
185
- ___
186
-
187
- ### save
188
-
189
- ▸ `Abstract` **save**(`object`): `Promise`<`void`\>
190
-
191
- Saves a document
192
- Implement the required logic to save the document in your concrete the data source
193
-
194
- #### Parameters
195
-
196
- | Name | Type | Description |
197
- | :------ | :------ | :------ |
198
- | `object` | [`Collections`](../modules.md#collections) | A collection of documents to be saved |
199
-
200
- #### Returns
201
-
202
- `Promise`<`void`\>
203
-
204
- a promise
205
-
206
- #### Defined in
207
-
208
- [store/data-source.ts:95](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/data-source.ts#L95)
209
-
210
- ___
211
-
212
- ### toPropertyPathOperations
213
-
214
- ▸ `Static` **toPropertyPathOperations**<`T`\>(`operations`): [`QueryOperation`](../modules.md#queryoperation)<`T`\>[]
215
-
216
- Utility method to convert a query object to a property path query object
217
-
218
- **`Example`**
219
-
220
- ```ts
221
- const queryObject = {
222
- operations: [{ property: 'name', operator: '==', value: { ancestorName: { father: 'Felipe' }}]
223
- }
224
- const propPathQueryObject = DataSource.toPropertyPathQueryObject( queryObject )
225
- // returned value: [{ property: 'name.ancestorName.father', operator: '==', value: 'Felipe' }]
226
- ```
227
-
228
- #### Type parameters
229
-
230
- | Name | Type |
231
- | :------ | :------ |
232
- | `T` | extends [`Persistent`](Persistent.md)<`T`\> |
233
-
234
- #### Parameters
235
-
236
- | Name | Type |
237
- | :------ | :------ |
238
- | `operations` | [`QueryOperation`](../modules.md#queryoperation)<`T`\>[] |
239
-
240
- #### Returns
241
-
242
- [`QueryOperation`](../modules.md#queryoperation)<`T`\>[]
243
-
244
- a property path query object
245
-
246
- #### Defined in
247
-
248
- [store/data-source.ts:139](https://github.com/entropic-bond/entropic-bond/blob/c9dd385/src/store/data-source.ts#L139)