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.
- package/lib/auth/auth-mock.d.ts +22 -0
- package/lib/auth/auth-mock.spec.d.ts +1 -0
- package/lib/auth/auth.d.ts +131 -0
- package/lib/auth/user-auth-types.d.ts +19 -0
- package/lib/cloud-functions/cloud-functions-mock.d.ts +11 -0
- package/lib/cloud-functions/cloud-functions-mock.spec.d.ts +1 -0
- package/lib/cloud-functions/cloud-functions.d.ts +19 -0
- package/lib/cloud-storage/cloud-storage.d.ts +24 -0
- package/lib/cloud-storage/cloud-storage.spec.d.ts +1 -0
- package/lib/cloud-storage/mock-cloud-storage.d.ts +20 -0
- package/lib/cloud-storage/stored-file.d.ts +39 -0
- package/lib/entropic-bond.js +1667 -0
- package/lib/entropic-bond.umd.cjs +7 -0
- package/lib/index.d.ts +19 -0
- package/lib/observable/observable.d.ts +52 -0
- package/lib/observable/observable.spec.d.ts +1 -0
- package/lib/persistent/entropic-component.d.ts +76 -0
- package/lib/persistent/entropic-component.spec.d.ts +1 -0
- package/lib/persistent/persistent.d.ts +281 -0
- package/lib/persistent/persistent.spec.d.ts +67 -0
- package/lib/server-auth/server-auth-mock.d.ts +12 -0
- package/lib/server-auth/server-auth-mock.spec.d.ts +1 -0
- package/lib/server-auth/server-auth.d.ts +24 -0
- package/lib/store/data-source.d.ts +137 -0
- package/lib/store/json-data-source.d.ts +68 -0
- package/lib/store/json-data-source.spec.d.ts +1 -0
- package/lib/store/mocks/test-user.d.ts +49 -0
- package/lib/store/model.d.ts +238 -0
- package/lib/store/model.spec.d.ts +1 -0
- package/lib/store/store.d.ts +62 -0
- package/lib/store/store.spec.d.ts +1 -0
- package/lib/types/utility-types.d.ts +45 -0
- package/lib/types/utility-types.spec.d.ts +1 -0
- package/lib/utils/test-utils/test-person.d.ts +33 -0
- package/{src/utils/utils.ts → lib/utils/utils.d.ts} +10 -34
- package/lib/utils/utils.spec.d.ts +1 -0
- package/package.json +7 -4
- package/.github/workflows/release.yml +0 -26
- package/CHANGELOG.md +0 -1151
- package/docs/.nojekyll +0 -1
- package/docs/README.md +0 -94
- package/docs/classes/Auth.md +0 -391
- package/docs/classes/AuthMock.md +0 -278
- package/docs/classes/AuthService.md +0 -188
- package/docs/classes/CloudFunctions.md +0 -123
- package/docs/classes/CloudFunctionsMock.md +0 -97
- package/docs/classes/CloudStorage.md +0 -215
- package/docs/classes/DataSource.md +0 -248
- package/docs/classes/EntropicComponent.md +0 -666
- package/docs/classes/JsonDataSource.md +0 -328
- package/docs/classes/MockCloudStorage.md +0 -279
- package/docs/classes/Model.md +0 -274
- package/docs/classes/Observable.md +0 -120
- package/docs/classes/Persistent.md +0 -420
- package/docs/classes/ServerAuth.md +0 -211
- package/docs/classes/ServerAuthMock.md +0 -176
- package/docs/classes/ServerAuthService.md +0 -130
- package/docs/classes/Store.md +0 -218
- package/docs/classes/StoredFile.md +0 -636
- package/docs/enums/StoredFileEvent.md +0 -41
- package/docs/interfaces/AuthError.md +0 -30
- package/docs/interfaces/CloudFunctionsService.md +0 -69
- package/docs/interfaces/Collection.md +0 -13
- package/docs/interfaces/CustomCredentials.md +0 -7
- package/docs/interfaces/DocumentReference.md +0 -49
- package/docs/interfaces/JsonRawData.md +0 -7
- package/docs/interfaces/SignData.md +0 -63
- package/docs/interfaces/StoreParams.md +0 -52
- package/docs/interfaces/StoredFileChange.md +0 -41
- package/docs/interfaces/UploadControl.md +0 -90
- package/docs/interfaces/UserCredentials.md +0 -113
- package/docs/interfaces/Values.md +0 -17
- package/docs/modules.md +0 -1273
- package/src/auth/auth-mock.spec.ts +0 -168
- package/src/auth/auth-mock.ts +0 -129
- package/src/auth/auth.ts +0 -185
- package/src/auth/user-auth-types.ts +0 -21
- package/src/cloud-functions/cloud-functions-mock.spec.ts +0 -136
- package/src/cloud-functions/cloud-functions-mock.ts +0 -23
- package/src/cloud-functions/cloud-functions.ts +0 -83
- package/src/cloud-storage/cloud-storage.spec.ts +0 -207
- package/src/cloud-storage/cloud-storage.ts +0 -60
- package/src/cloud-storage/mock-cloud-storage.ts +0 -72
- package/src/cloud-storage/stored-file.ts +0 -102
- package/src/index.ts +0 -19
- package/src/observable/observable.spec.ts +0 -105
- package/src/observable/observable.ts +0 -67
- package/src/persistent/entropic-component.spec.ts +0 -143
- package/src/persistent/entropic-component.ts +0 -135
- package/src/persistent/persistent.spec.ts +0 -828
- package/src/persistent/persistent.ts +0 -650
- package/src/server-auth/server-auth-mock.spec.ts +0 -53
- package/src/server-auth/server-auth-mock.ts +0 -45
- package/src/server-auth/server-auth.ts +0 -49
- package/src/store/data-source.ts +0 -186
- package/src/store/json-data-source.spec.ts +0 -100
- package/src/store/json-data-source.ts +0 -256
- package/src/store/mocks/mock-data.json +0 -155
- package/src/store/mocks/test-user.ts +0 -122
- package/src/store/model.spec.ts +0 -659
- package/src/store/model.ts +0 -462
- package/src/store/store.spec.ts +0 -30
- package/src/store/store.ts +0 -113
- package/src/types/utility-types.spec.ts +0 -117
- package/src/types/utility-types.ts +0 -116
- package/src/utils/test-utils/test-person.ts +0 -44
- package/src/utils/utils.spec.ts +0 -95
- package/tsconfig-build.json +0 -7
- package/tsconfig-cjs.json +0 -9
- package/tsconfig.json +0 -33
- 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)
|