functional-google-cloud
Version:
Google Cloud Utilities functions in Functional Programming Style
2,591 lines (1,563 loc) • 54.7 kB
Markdown
<a name="readmemd"></a>
[functional-google-cloud](#globalsmd)
# functional-google-cloud
<a name="globalsmd"></a>
[functional-google-cloud](#globalsmd)
# functional-google-cloud
## Index
### Modules
* ["CloudStorage/Arbitraries"](#modules_cloudstorage_arbitraries_md)
* ["CloudStorage/DateTime"](#modules_cloudstorage_datetime_md)
* ["CloudStorage/Stubs"](#modules_cloudstorage_stubs_md)
* ["CloudStorage/index"](#modules_cloudstorage_index_md)
* ["Firestore/Arbitraries"](#modules_firestore_arbitraries_md)
* ["Firestore/Emulator"](#modules_firestore_emulator_md)
* ["Firestore/index"](#modules_firestore_index_md)
* ["PubSub"](#modules_pubsub_md)
* ["index"](#modules_index_md)
# Interfaces
<a name="interfaces_cloudstorage_index_listfilesoptionsmd"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/index"](#modules_cloudstorage_index_md) › [ListFilesOptions](#interfaces_cloudstorage_index_listfilesoptionsmd)
## Interface: ListFilesOptions
### Hierarchy
* **ListFilesOptions**
### Index
#### Properties
* [delimiter](#optional-delimiter)
* [prefix](#optional-prefix)
### Properties
#### `Optional` delimiter
• **delimiter**? : *string*
Defined in src/CloudStorage/index.ts:45
___
#### `Optional` prefix
• **prefix**? : *string*
Defined in src/CloudStorage/index.ts:44
<a name="interfaces_cloudstorage_index_metadatamd"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/index"](#modules_cloudstorage_index_md) › [Metadata](#interfaces_cloudstorage_index_metadatamd)
## Interface: Metadata
### Hierarchy
* **Metadata**
### Index
#### Properties
* [bucket](#bucket)
* [contentType](#contenttype)
* [generation](#generation)
* [id](#id)
* [kind](#kind)
* [mediaLink](#medialink)
* [name](#name)
* [selfLink](#selflink)
* [size](#size)
* [timeCreated](#timecreated)
* [updated](#updated)
### Properties
#### bucket
• **bucket**: *string*
Defined in src/CloudStorage/index.ts:54
___
#### contentType
• **contentType**: *string*
Defined in src/CloudStorage/index.ts:56
___
#### generation
• **generation**: *string*
Defined in src/CloudStorage/index.ts:55
___
#### id
• **id**: *string*
Defined in src/CloudStorage/index.ts:50
___
#### kind
• **kind**: *string*
Defined in src/CloudStorage/index.ts:49
___
#### mediaLink
• **mediaLink**: *string*
Defined in src/CloudStorage/index.ts:52
___
#### name
• **name**: *string*
Defined in src/CloudStorage/index.ts:53
___
#### selfLink
• **selfLink**: *string*
Defined in src/CloudStorage/index.ts:51
___
#### size
• **size**: *string*
Defined in src/CloudStorage/index.ts:57
___
#### timeCreated
• **timeCreated**: *string*
Defined in src/CloudStorage/index.ts:58
___
#### updated
• **updated**: *string*
Defined in src/CloudStorage/index.ts:59
<a name="interfaces_cloudstorage_index_pathmd"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/index"](#modules_cloudstorage_index_md) › [Path](#interfaces_cloudstorage_index_pathmd)
## Interface: Path
### Hierarchy
* **Path**
### Index
#### Properties
* [bucket](#bucket)
* [filename](#filename)
### Properties
#### bucket
• **bucket**: *string*
Defined in src/CloudStorage/index.ts:31
___
#### filename
• **filename**: *string*
Defined in src/CloudStorage/index.ts:32
<a name="interfaces_cloudstorage_index_readonlyconfigmd"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/index"](#modules_cloudstorage_index_md) › [ReadOnlyConfig](#interfaces_cloudstorage_index_readonlyconfigmd)
## Interface: ReadOnlyConfig
### Hierarchy
* **ReadOnlyConfig**
↳ [WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd)
### Index
#### Properties
* [expires_in](#expires_in)
### Properties
#### expires_in
• **expires_in**: *number*
Defined in src/CloudStorage/index.ts:36
<a name="interfaces_cloudstorage_index_writeonlyconfigmd"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/index"](#modules_cloudstorage_index_md) › [WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd)
## Interface: WriteOnlyConfig
### Hierarchy
* [ReadOnlyConfig](#interfaces_cloudstorage_index_readonlyconfigmd)
↳ **WriteOnlyConfig**
### Index
#### Properties
* [expires_in](#expires_in)
* [file_type](#file_type)
### Properties
#### expires_in
• **expires_in**: *number*
*Inherited from [ReadOnlyConfig](#interfaces_cloudstorage_index_readonlyconfigmd).[expires_in](#expires_in)*
Defined in src/CloudStorage/index.ts:36
___
#### file_type
• **file_type**: *[FileType](#filetype)*
Defined in src/CloudStorage/index.ts:40
<a name="interfaces_cloudstorage_stubs_returnvaluesmd"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/Stubs"](#modules_cloudstorage_stubs_md) › [ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)
## Interface: ReturnValues
### Hierarchy
* **ReturnValues**
### Index
#### Properties
* [buffer](#buffer)
* [url](#url)
### Properties
#### buffer
• **buffer**: *Buffer*
Defined in src/CloudStorage/Stubs.ts:12
___
#### url
• **url**: *string*
Defined in src/CloudStorage/Stubs.ts:11
# Modules
<a name="modules_cloudstorage_arbitraries_md"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/Arbitraries"](#modules_cloudstorage_arbitraries_md)
## Module: "CloudStorage/Arbitraries"
### Index
#### Functions
* [bucket](#const-bucket)
* [buffer](#const-buffer)
* [config](#const-config)
* [error](#const-error)
* [file](#const-file)
* [path](#const-path)
* [returnValues](#const-returnvalues)
* [storage](#const-storage)
### Functions
#### `Const` bucket
▸ **bucket**(): *Arbitrary‹SinonStubbedInstance‹Bucket››*
Defined in src/CloudStorage/Arbitraries.ts:41
**Returns:** *Arbitrary‹SinonStubbedInstance‹Bucket››*
___
#### `Const` buffer
▸ **buffer**(): *Arbitrary‹Buffer›*
Defined in src/CloudStorage/Arbitraries.ts:29
**Returns:** *Arbitrary‹Buffer›*
___
#### `Const` config
▸ **config**(): *Arbitrary‹[WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd)›*
Defined in src/CloudStorage/Arbitraries.ts:14
**Returns:** *Arbitrary‹[WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd)›*
___
#### `Const` error
▸ **error**(): *Arbitrary‹Error›*
Defined in src/CloudStorage/Arbitraries.ts:20
**Returns:** *Arbitrary‹Error›*
___
#### `Const` file
▸ **file**(): *Arbitrary‹SinonStubbedInstance‹File››*
Defined in src/CloudStorage/Arbitraries.ts:38
**Returns:** *Arbitrary‹SinonStubbedInstance‹File››*
___
#### `Const` path
▸ **path**(): *Arbitrary‹[Path](#interfaces_cloudstorage_index_pathmd)›*
Defined in src/CloudStorage/Arbitraries.ts:23
**Returns:** *Arbitrary‹[Path](#interfaces_cloudstorage_index_pathmd)›*
___
#### `Const` returnValues
▸ **returnValues**(): *Arbitrary‹[ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)›*
Defined in src/CloudStorage/Arbitraries.ts:32
**Returns:** *Arbitrary‹[ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)›*
___
#### `Const` storage
▸ **storage**(`arb?`: Arbitrary‹[ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)›): *Arbitrary‹SinonStubbedInstance‹Storage››*
Defined in src/CloudStorage/Arbitraries.ts:44
**Parameters:**
Name | Type |
------ | ------ |
`arb?` | Arbitrary‹[ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)› |
**Returns:** *Arbitrary‹SinonStubbedInstance‹Storage››*
<a name="modules_cloudstorage_datetime_md"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/DateTime"](#modules_cloudstorage_datetime_md)
## Module: "CloudStorage/DateTime"
### Index
#### Functions
* [getUnixTimestampIn](#const-getunixtimestampin)
### Functions
#### `Const` getUnixTimestampIn
▸ **getUnixTimestampIn**(`seconds`: number): *number*
Defined in src/CloudStorage/DateTime.ts:6
```haskell
getUnixTimestampInMinutes :: Int -> Int
```
**Parameters:**
Name | Type |
------ | ------ |
`seconds` | number |
**Returns:** *number*
<a name="modules_cloudstorage_index_md"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/index"](#modules_cloudstorage_index_md)
## Module: "CloudStorage/index"
### Index
#### Interfaces
* [ListFilesOptions](#interfaces_cloudstorage_index_listfilesoptionsmd)
* [Metadata](#interfaces_cloudstorage_index_metadatamd)
* [Path](#interfaces_cloudstorage_index_pathmd)
* [ReadOnlyConfig](#interfaces_cloudstorage_index_readonlyconfigmd)
* [WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd)
#### Type aliases
* [FileType](#filetype)
#### Variables
* [fetchFile](#const-fetchfile)
* [fetchFileFromStorage](#const-fetchfilefromstorage)
* [getBufferFromFile](#const-getbufferfromfile)
* [getBufferFromStorage](#const-getbufferfromstorage)
* [getBufferSingletonFromFile](#const-getbuffersingletonfromfile)
* [getDownloadUrlFromFile](#const-getdownloadurlfromfile)
* [getDownloadUrlFromFileTask](#const-getdownloadurlfromfiletask)
* [getFileFromStorage](#const-getfilefromstorage)
* [getReadOnlySignedUrlArrayFromFileTask](#const-getreadonlysignedurlarrayfromfiletask)
* [getUploadUrlFromFile](#const-getuploadurlfromfile)
* [getUploadUrlFromFileTask](#const-getuploadurlfromfiletask)
* [getUploadUrlFromStorage](#const-getuploadurlfromstorage)
* [getWriteOnlySignedUrlArrayFromFileTask](#const-getwriteonlysignedurlarrayfromfiletask)
* [listFilesInBucket](#const-listfilesinbucket)
* [listFilesInStorage](#const-listfilesinstorage)
* [storeBufferToFile](#const-storebuffertofile)
* [storeBufferToStorage](#const-storebuffertostorage)
* [storeMetadataToFile](#const-storemetadatatofile)
* [storeMetadataToStorage](#const-storemetadatatostorage)
#### Functions
* [getBucketFromStorage](#const-getbucketfromstorage)
* [getBufferSingletonFromFileTask](#const-getbuffersingletonfromfiletask)
* [getFileFromBucket](#const-getfilefrombucket)
* [getReadOnlySignedUrlConfigFromConfig](#const-getreadonlysignedurlconfigfromconfig)
* [getSignedUrlTask](#const-getsignedurltask)
* [getTaskEitherFromTask](#const-gettaskeitherfromtask)
* [getWriteOnlySignedUrlConfigFromConfig](#const-getwriteonlysignedurlconfigfromconfig)
* [isPath](#const-ispath)
* [storeBufferToFileTask](#const-storebuffertofiletask)
* [storeMetadataToFileTask](#const-storemetadatatofiletask)
### Type aliases
#### FileType
Ƭ **FileType**: *FileType.FileType*
Defined in src/CloudStorage/index.ts:27
### Variables
#### `Const` fetchFile
• **fetchFile**: *function* = pipe(
fetchFileTask,
TEUtils.fromTask
)
Defined in src/CloudStorage/index.ts:239
```haskell
fetchFile :: File -> TaskEither File Error
```
##### Type declaration:
▸ (`file`: File): *TaskEither‹Error, File›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` fetchFileFromStorage
• **fetchFileFromStorage**: *function* = pipe(
getFileFromStorage,
R.map(fetchFile)
)
Defined in src/CloudStorage/index.ts:249
```haskell
fetchFileFromStorage :: Storage -> ReaderTaskEither Path File Error
```
##### Type declaration:
▸ (`storage`: Storage): *ReaderTaskEither‹[Path](#interfaces_cloudstorage_index_pathmd), Error, File›*
**Parameters:**
Name | Type |
------ | ------ |
`storage` | Storage |
___
#### `Const` getBufferFromFile
• **getBufferFromFile**: *function* = pipe(
getBufferSingletonFromFile,
TE.map(head as R.Reader<[Buffer], Buffer>)
)
Defined in src/CloudStorage/index.ts:294
```haskell
getBufferFromFile :: File -> TaskEither Buffer Error
```
##### Type declaration:
▸ (`file`: File): *TaskEither‹Error, Buffer›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` getBufferFromStorage
• **getBufferFromStorage**: *function* = pipe(
getFileFromStorage,
R.map(getBufferFromFile)
)
Defined in src/CloudStorage/index.ts:306
```haskell
getBufferFromStorage :: Storage -> ReaderTaskEither Path File Error
```
##### Type declaration:
▸ (`storage`: Storage): *ReaderTaskEither‹[Path](#interfaces_cloudstorage_index_pathmd), Error, Buffer›*
**Parameters:**
Name | Type |
------ | ------ |
`storage` | Storage |
___
#### `Const` getBufferSingletonFromFile
• **getBufferSingletonFromFile**: *function* = pipe(
getBufferSingletonFromFileTask,
partialRight(TE.tryCatch, [E.toError])
)
Defined in src/CloudStorage/index.ts:282
```haskell
getBufferSingletonFromFile :: File -> TaskEither [Buffer] Error
```
##### Type declaration:
▸ (`file`: File): *TaskEither‹Error, [Buffer]›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` getDownloadUrlFromFile
• **getDownloadUrlFromFile**: *function* = pipe(
getDownloadUrlFromFileTask,
R.map(getTaskEitherFromTask)
)
Defined in src/CloudStorage/index.ts:184
```haskell
getDownloadUrlFromFile :: File -> ReaderTaskEither WriteOnlyConfig String Error
```
##### Type declaration:
▸ (`file`: File): *ReaderTaskEither‹[ReadOnlyConfig](#interfaces_cloudstorage_index_readonlyconfigmd), Error, string›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` getDownloadUrlFromFileTask
• **getDownloadUrlFromFileTask**: *function* = pipe(
getReadOnlySignedUrlArrayFromFileTask,
RT.map<string[], string>(head)
)
Defined in src/CloudStorage/index.ts:151
```haskell
getDownloadUrlFromFileTask :: File -> ReaderTask WriteOnlyConfig String
```
##### Type declaration:
▸ (`file`: File): *ReaderTask‹[ReadOnlyConfig](#interfaces_cloudstorage_index_readonlyconfigmd), string›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` getFileFromStorage
• **getFileFromStorage**: *function* = pipe(
getBucketFromStorageWithPath,
R.chain(getFileFromBucket)
)
Defined in src/CloudStorage/index.ts:215
```haskell
getFileFromStorage :: Storage -> Reader Path File
```
##### Type declaration:
▸ (`storage`: Storage): *Reader‹[Path](#interfaces_cloudstorage_index_pathmd), File›*
**Parameters:**
Name | Type |
------ | ------ |
`storage` | Storage |
___
#### `Const` getReadOnlySignedUrlArrayFromFileTask
• **getReadOnlySignedUrlArrayFromFileTask**: *function* = useWith(call, [
getSignedUrlTask,
getReadOnlySignedUrlConfigFromConfig,
])
Defined in src/CloudStorage/index.ts:127
```haskell
getReadOnlySignedUrlArrayFromFileTask :: File -> ReaderTask WriteOnlyConfig [String]
```
##### Type declaration:
▸ (`file`: File): *Reader‹[ReadOnlyConfig](#interfaces_cloudstorage_index_readonlyconfigmd), Task‹[string]››*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` getUploadUrlFromFile
• **getUploadUrlFromFile**: *function* = pipe(
getUploadUrlFromFileTask,
R.map(getTaskEitherFromTask)
)
Defined in src/CloudStorage/index.ts:172
```haskell
getUploadUrlFromFile :: File -> ReaderTaskEither WriteOnlyConfig String Error
```
##### Type declaration:
▸ (`file`: File): *ReaderTaskEither‹[WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd), Error, string›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` getUploadUrlFromFileTask
• **getUploadUrlFromFileTask**: *function* = pipe(
getWriteOnlySignedUrlArrayFromFileTask,
RT.map<string[], string>(head)
)
Defined in src/CloudStorage/index.ts:139
```haskell
getUploadUrlFromFileTask :: File -> ReaderTask WriteOnlyConfig String
```
##### Type declaration:
▸ (`file`: File): *ReaderTask‹[WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd), string›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` getUploadUrlFromStorage
• **getUploadUrlFromStorage**: *function* = pipe(getFileFromStorage, R.map(getUploadUrlFromFile))
Defined in src/CloudStorage/index.ts:261
```haskell
getUploadUrlFromStorage :: Storage -> Path -> ReaderTaskEither WriteOnlyConfig String Error
```
##### Type declaration:
▸ (`storage`: Storage): *Reader‹[Path](#interfaces_cloudstorage_index_pathmd), ReaderTaskEither‹[WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd), Error, string››*
**Parameters:**
Name | Type |
------ | ------ |
`storage` | Storage |
___
#### `Const` getWriteOnlySignedUrlArrayFromFileTask
• **getWriteOnlySignedUrlArrayFromFileTask**: *function* = useWith(call, [
getSignedUrlTask,
getWriteOnlySignedUrlConfigFromConfig,
])
Defined in src/CloudStorage/index.ts:115
```haskell
getWriteOnlySignedUrlArrayFromFileTask :: File -> ReaderTask WriteOnlyConfig [String]
```
##### Type declaration:
▸ (`file`: File): *Reader‹[WriteOnlyConfig](#interfaces_cloudstorage_index_writeonlyconfigmd), Task‹[string]››*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` listFilesInBucket
• **listFilesInBucket**: *function* = pipe(
listFilesInBucketTask,
R.map(TEUtils.fromTask)
)
Defined in src/CloudStorage/index.ts:418
```haskell
listFilesInBucket :: Bucket -> ReaderTaskEither ListFilesOptions [File] Error
```
##### Type declaration:
▸ (`bucket`: Bucket): *ReaderTaskEither‹[ListFilesOptions](#interfaces_cloudstorage_index_listfilesoptionsmd), Error, File[]›*
**Parameters:**
Name | Type |
------ | ------ |
`bucket` | Bucket |
___
#### `Const` listFilesInStorage
• **listFilesInStorage**: *function* = pipe(getBucketFromStorage, R.map(listFilesInBucket))
Defined in src/CloudStorage/index.ts:430
```haskell
listFilesInStorage :: Storage -> Reader String (ReaderTaskEither ListFilesOptions [File] Error)
```
##### Type declaration:
▸ (`storage`: Storage): *Reader‹string, ReaderTaskEither‹[ListFilesOptions](#interfaces_cloudstorage_index_listfilesoptionsmd), Error, File[]››*
**Parameters:**
Name | Type |
------ | ------ |
`storage` | Storage |
___
#### `Const` storeBufferToFile
• **storeBufferToFile**: *function* = pipe(
storeBufferToFileTask,
R.map(getTaskEitherFromTask)
)
Defined in src/CloudStorage/index.ts:332
```haskell
storeBufferToFile :: File -> ReaderTaskEither Buffer File Error
```
##### Type declaration:
▸ (`file`: File): *ReaderTaskEither‹Buffer, Error, File›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` storeBufferToStorage
• **storeBufferToStorage**: *function* = pipe(
getFileFromStorage,
R.map(storeBufferToFile)
)
Defined in src/CloudStorage/index.ts:344
```haskell
storeBufferToStorage :: Storage -> Reader Path ReaderTaskEither Buffer File Error
```
##### Type declaration:
▸ (`storage`: Storage): *Reader‹[Path](#interfaces_cloudstorage_index_pathmd), ReaderTaskEither‹Buffer, Error, File››*
**Parameters:**
Name | Type |
------ | ------ |
`storage` | Storage |
___
#### `Const` storeMetadataToFile
• **storeMetadataToFile**: *function* = pipe(
storeMetadataToFileTask,
R.map(getTaskEitherFromTask)
)
Defined in src/CloudStorage/index.ts:370
```haskell
storeMetadataToFile :: File -> ReaderTaskEither Metadata File Error
```
##### Type declaration:
▸ (`file`: File): *ReaderTaskEither‹Partial‹[Metadata](#interfaces_cloudstorage_index_metadatamd)›, Error, File›*
**Parameters:**
Name | Type |
------ | ------ |
`file` | File |
___
#### `Const` storeMetadataToStorage
• **storeMetadataToStorage**: *function* = pipe(getFileFromStorage, R.map(storeMetadataToFile))
Defined in src/CloudStorage/index.ts:382
```haskell
storeMetadataToStorage :: Metadata -> Reader Path ReaderTaskEither Metadata File Error
```
##### Type declaration:
▸ (`storage`: Storage): *Reader‹[Path](#interfaces_cloudstorage_index_pathmd), ReaderTaskEither‹Partial‹[Metadata](#interfaces_cloudstorage_index_metadatamd)›, Error, File››*
**Parameters:**
Name | Type |
------ | ------ |
`storage` | Storage |
### Functions
#### `Const` getBucketFromStorage
▸ **getBucketFromStorage**(`storage`: Storage‹›): *(Anonymous function)*
Defined in src/CloudStorage/index.ts:396
```haskell
getBucketFromStorage :: Storage -> Reader String Bucket
```
**Parameters:**
Name | Type |
------ | ------ |
`storage` | Storage‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` getBufferSingletonFromFileTask
▸ **getBufferSingletonFromFileTask**(`file`: File‹›): *(Anonymous function)*
Defined in src/CloudStorage/index.ts:275
```haskell
getBufferSingletonFromFilePromise :: File -> Task [Buffer]
```
**Parameters:**
Name | Type |
------ | ------ |
`file` | File‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` getFileFromBucket
▸ **getFileFromBucket**(`bucket`: Bucket‹›): *(Anonymous function)*
Defined in src/CloudStorage/index.ts:196
```haskell
getFileFromBucket :: Bucket -> Reader Path File
```
**Parameters:**
Name | Type |
------ | ------ |
`bucket` | Bucket‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` getReadOnlySignedUrlConfigFromConfig
▸ **getReadOnlySignedUrlConfigFromConfig**(`__namedParameters`: object): *object*
Defined in src/CloudStorage/index.ts:93
```haskell
getReadOnlySignedUrlConfigFromConfig :: WriteOnlyConfig -> GetSignedUrlConfig
```
**Parameters:**
▪ **__namedParameters**: *object*
Name | Type |
------ | ------ |
`expiresIn` | number |
**Returns:** *object*
* **action**: *"read"* = "read"
* **expires**: *number* = getUnixTimestampIn(expiresIn)
* **version**: *"v4"* = "v4"
___
#### `Const` getSignedUrlTask
▸ **getSignedUrlTask**(`file`: File‹›): *(Anonymous function)*
Defined in src/CloudStorage/index.ts:106
```haskell
getSignedUrlTask :: File -> ReaderTask GetSignedUrlConfig [String]
```
**Parameters:**
Name | Type |
------ | ------ |
`file` | File‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` getTaskEitherFromTask
▸ **getTaskEitherFromTask**(`task`: Task‹A›): *TaskEither‹Error, A›*
Defined in src/CloudStorage/index.ts:165
```haskell
getTaskEitherFromTask :: Task -> TaskEither
```
**Parameters:**
Name | Type |
------ | ------ |
`task` | Task‹A› |
**Returns:** *TaskEither‹Error, A›*
___
#### `Const` getWriteOnlySignedUrlConfigFromConfig
▸ **getWriteOnlySignedUrlConfigFromConfig**(`__namedParameters`: object): *object*
Defined in src/CloudStorage/index.ts:79
```haskell
getWriteOnlySignedUrlConfigFromConfig :: WriteOnlyConfig -> GetSignedUrlConfig
```
**Parameters:**
▪ **__namedParameters**: *object*
Name | Type |
------ | ------ |
`expiresIn` | number |
`fileType` | "pdf" | "excel" | "json" | "ms-excel" | "zip" | "png" | "jpeg" |
**Returns:** *object*
* **action**: *"write"* = "write"
* **contentType**: *"application/pdf" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/json" | "application/vnd.ms-excel" | "application/zip" | "image/png" | "image/jpeg"* = FileType.toContentType(fileType)
* **expires**: *number* = getUnixTimestampIn(expiresIn)
* **version**: *"v4"* = "v4"
___
#### `Const` isPath
▸ **isPath**(`a`: unknown): *a is Path*
Defined in src/CloudStorage/index.ts:67
```haskell
isPath :: a -> bool
```
**Parameters:**
Name | Type |
------ | ------ |
`a` | unknown |
**Returns:** *a is Path*
___
#### `Const` storeBufferToFileTask
▸ **storeBufferToFileTask**(`file`: File‹›): *(Anonymous function)*
Defined in src/CloudStorage/index.ts:320
```haskell
storeBufferToFileTask :: File -> ReaderTask Buffer File
```
**Parameters:**
Name | Type |
------ | ------ |
`file` | File‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` storeMetadataToFileTask
▸ **storeMetadataToFileTask**(`file`: File‹›): *(Anonymous function)*
Defined in src/CloudStorage/index.ts:358
```haskell
storeMetadataToFileTask :: File -> ReaderTask Metadata File
```
**Parameters:**
Name | Type |
------ | ------ |
`file` | File‹› |
**Returns:** *(Anonymous function)*
<a name="modules_cloudstorage_stubs_md"></a>
[functional-google-cloud](#globalsmd) › ["CloudStorage/Stubs"](#modules_cloudstorage_stubs_md)
## Module: "CloudStorage/Stubs"
### Index
#### Interfaces
* [ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)
#### Functions
* [bucket](#const-bucket)
* [download](#const-download)
* [failedFile](#const-failedfile)
* [file](#const-file)
* [getFailedSignedUrl](#const-getfailedsignedurl)
* [getSignedUrl](#const-getsignedurl)
* [storage](#const-storage)
### Functions
#### `Const` bucket
▸ **bucket**(`values`: [ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)): *object*
Defined in src/CloudStorage/Stubs.ts:59
**Parameters:**
Name | Type |
------ | ------ |
`values` | [ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd) |
**Returns:** *object*
___
#### `Const` download
▸ **download**(`buffer`: Buffer‹›): *(Anonymous function)*
Defined in src/CloudStorage/Stubs.ts:23
**Parameters:**
Name | Type |
------ | ------ |
`buffer` | Buffer‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` failedFile
▸ **failedFile**(`error`: Error): *object*
Defined in src/CloudStorage/Stubs.ts:48
**Parameters:**
Name | Type |
------ | ------ |
`error` | Error |
**Returns:** *object*
___
#### `Const` file
▸ **file**(`values`: [ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)): *object*
Defined in src/CloudStorage/Stubs.ts:37
**Parameters:**
Name | Type |
------ | ------ |
`values` | [ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd) |
**Returns:** *object*
___
#### `Const` getFailedSignedUrl
▸ **getFailedSignedUrl**(`error`: Error): *(Anonymous function)*
Defined in src/CloudStorage/Stubs.ts:30
**Parameters:**
Name | Type |
------ | ------ |
`error` | Error |
**Returns:** *(Anonymous function)*
___
#### `Const` getSignedUrl
▸ **getSignedUrl**(`url`: string): *(Anonymous function)*
Defined in src/CloudStorage/Stubs.ts:18
**Parameters:**
Name | Type |
------ | ------ |
`url` | string |
**Returns:** *(Anonymous function)*
___
#### `Const` storage
▸ **storage**(`values`: [ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd)): *object*
Defined in src/CloudStorage/Stubs.ts:74
**Parameters:**
Name | Type |
------ | ------ |
`values` | [ReturnValues](#interfaces_cloudstorage_stubs_returnvaluesmd) |
**Returns:** *object*
<a name="modules_firestore_arbitraries_md"></a>
[functional-google-cloud](#globalsmd) › ["Firestore/Arbitraries"](#modules_firestore_arbitraries_md)
## Module: "Firestore/Arbitraries"
### Index
#### Functions
* [condition](#const-condition)
* [id](#const-id)
* [model](#const-model)
* [modelAndConditions](#const-modelandconditions)
* [modelAndUpdate](#const-modelandupdate)
* [modelBase](#const-modelbase)
* [modelData](#const-modeldata)
* [models](#const-models)
* [nonEmptyString](#const-nonemptystring)
* [nonModelObject](#const-nonmodelobject)
* [operation](#const-operation)
* [table](#const-table)
### Functions
#### `Const` condition
▸ **condition**(): *Arbitrary‹[Condition](#condition)›*
Defined in src/Firestore/Arbitraries.ts:40
**Returns:** *Arbitrary‹[Condition](#condition)›*
___
#### `Const` id
▸ **id**(): *Arbitrary‹string›*
Defined in src/Firestore/Arbitraries.ts:7
**Returns:** *Arbitrary‹string›*
___
#### `Const` model
▸ **model**(): *Arbitrary‹[Model](#model)›*
Defined in src/Firestore/Arbitraries.ts:24
**Returns:** *Arbitrary‹[Model](#model)›*
___
#### `Const` modelAndConditions
▸ **modelAndConditions**(): *Arbitrary‹[[Model](#model), [Condition](#condition)[]]›*
Defined in src/Firestore/Arbitraries.ts:43
**Returns:** *Arbitrary‹[[Model](#model), [Condition](#condition)[]]›*
___
#### `Const` modelAndUpdate
▸ **modelAndUpdate**(): *Arbitrary‹[[Model](#model), [Model](#model)]›*
Defined in src/Firestore/Arbitraries.ts:29
**Returns:** *Arbitrary‹[[Model](#model), [Model](#model)]›*
___
#### `Const` modelBase
▸ **modelBase**(): *Arbitrary‹[Model](#model)›*
Defined in src/Firestore/Arbitraries.ts:12
**Returns:** *Arbitrary‹[Model](#model)›*
___
#### `Const` modelData
▸ **modelData**(): *Arbitrary‹object›*
Defined in src/Firestore/Arbitraries.ts:17
**Returns:** *Arbitrary‹object›*
___
#### `Const` models
▸ **models**(): *Arbitrary‹[Model](#model)[]›*
Defined in src/Firestore/Arbitraries.ts:57
**Returns:** *Arbitrary‹[Model](#model)[]›*
___
#### `Const` nonEmptyString
▸ **nonEmptyString**(): *Arbitrary‹string›*
Defined in src/Firestore/Arbitraries.ts:5
**Returns:** *Arbitrary‹string›*
___
#### `Const` nonModelObject
▸ **nonModelObject**(): *Arbitrary‹unknown›*
Defined in src/Firestore/Arbitraries.ts:9
**Returns:** *Arbitrary‹unknown›*
___
#### `Const` operation
▸ **operation**(): *Arbitrary‹[Operation](#operation)›*
Defined in src/Firestore/Arbitraries.ts:38
**Returns:** *Arbitrary‹[Operation](#operation)›*
___
#### `Const` table
▸ **table**(): *Arbitrary‹string›*
Defined in src/Firestore/Arbitraries.ts:59
**Returns:** *Arbitrary‹string›*
<a name="modules_firestore_emulator_md"></a>
[functional-google-cloud](#globalsmd) › ["Firestore/Emulator"](#modules_firestore_emulator_md)
## Module: "Firestore/Emulator"
### Index
#### Functions
* [clearCollection](#const-clearcollection)
* [clearEmulator](#const-clearemulator)
* [clearFirestore](#const-clearfirestore)
* [getFirestore](#const-getfirestore)
### Functions
#### `Const` clearCollection
▸ **clearCollection**(`parentCollection`: CollectionReference‹object›): *Promise‹void›*
Defined in src/Firestore/Emulator.ts:25
```haskell
clearCollection :: Collection -> Promise
```
**Parameters:**
Name | Type |
------ | ------ |
`parentCollection` | CollectionReference‹object› |
**Returns:** *Promise‹void›*
___
#### `Const` clearEmulator
▸ **clearEmulator**(): *Promise‹void›*
Defined in src/Firestore/Emulator.ts:56
```haskell
clearFirebase :: () -> Promise
```
**Returns:** *Promise‹void›*
___
#### `Const` clearFirestore
▸ **clearFirestore**(): *Promise‹void›*
Defined in src/Firestore/Emulator.ts:46
```haskell
clearFirestore :: () -> Promise
```
**Returns:** *Promise‹void›*
___
#### `Const` getFirestore
▸ **getFirestore**(): *Firestore‹›*
Defined in src/Firestore/Emulator.ts:16
```haskell
getFirestore :: () -> Firestore
```
**Returns:** *Firestore‹›*
<a name="modules_firestore_index_md"></a>
[functional-google-cloud](#globalsmd) › ["Firestore/index"](#modules_firestore_index_md)
## Module: "Firestore/index"
### Index
#### Type aliases
* [Condition](#condition)
* [DateModel](#datemodel)
* [Model](#model)
* [Operation](#operation)
* [SerializedModel](#serializedmodel)
* [TimestampModel](#timestampmodel)
#### Variables
* [getDocumentSnapshotsFromQuerySnapshot](#const-getdocumentsnapshotsfromquerysnapshot)
* [getModelFromCollection](#const-getmodelfromcollection)
* [getModelFromDocument](#const-getmodelfromdocument)
* [getModelFromFirestore](#const-getmodelfromfirestore)
* [getModelsFromQuery](#const-getmodelsfromquery)
* [getModelsFromQuerySnapshot](#const-getmodelsfromquerysnapshot)
* [getModelsInCollection](#const-getmodelsincollection)
* [getModelsInCollectionWhere](#const-getmodelsincollectionwhere)
* [getModelsInFirestore](#const-getmodelsinfirestore)
* [getModelsInFirestoreWhere](#const-getmodelsinfirestorewhere)
* [getSnapshotFromDocument](#const-getsnapshotfromdocument)
* [getSnapshotFromQuery](#const-getsnapshotfromquery)
* [listDocumentsInCollection](#const-listdocumentsincollection)
* [listDocumentsInFirestore](#const-listdocumentsinfirestore)
* [serialize](#const-serialize)
* [serializeTimestampModel](#const-serializetimestampmodel)
* [storeModelToCollection](#const-storemodeltocollection)
* [storeModelToDocument](#const-storemodeltodocument)
* [storeModelToFirestore](#const-storemodeltofirestore)
* [updateModelInDocument](#const-updatemodelindocument)
* [validateModel](#const-validatemodel)
* [validateSnapshotExistence](#const-validatesnapshotexistence)
#### Functions
* [fromDateModel](#const-fromdatemodel)
* [fromTimestampModel](#const-fromtimestampmodel)
* [getCollectionFromDocument](#const-getcollectionfromdocument)
* [getCollectionFromFirestore](#const-getcollectionfromfirestore)
* [getDocumentFromCollection](#const-getdocumentfromcollection)
* [getQueryFromCollection](#const-getqueryfromcollection)
* [getSnapshotFromDocumentTask](#const-getsnapshotfromdocumenttask)
* [getSnapshotFromQueryTask](#const-getsnapshotfromquerytask)
* [isDateModel](#const-isdatemodel)
* [isDateString](#const-isdatestring)
* [isModel](#const-ismodel)
* [isSerializedModel](#const-isserializedmodel)
* [isTimestampModel](#const-istimestampmodel)
* [listCollectionsInFirestore](#const-listcollectionsinfirestore)
* [listDocumentsInCollectionTask](#const-listdocumentsincollectiontask)
* [serializeDateModel](#const-serializedatemodel)
* [storeModelToFirestoreWith](#const-storemodeltofirestorewith)
* [updateModelInDocumentTask](#const-updatemodelindocumenttask)
### Type aliases
#### Condition
Ƭ **Condition**: *[string, [Operation](#operation), unknown]*
Defined in src/Firestore/index.ts:57
___
#### DateModel
Ƭ **DateModel**: *[Model](#model)‹A› & object*
Defined in src/Firestore/index.ts:45
___
#### Model
Ƭ **Model**: *object & A*
Defined in src/Firestore/index.ts:36
___
#### Operation
Ƭ **Operation**: *WhereFilterOp*
Defined in src/Firestore/index.ts:55
___
#### SerializedModel
Ƭ **SerializedModel**: *[Model](#model)‹A› & object*
Defined in src/Firestore/index.ts:50
___
#### TimestampModel
Ƭ **TimestampModel**: *[Model](#model)‹A› & object*
Defined in src/Firestore/index.ts:40
### Variables
#### `Const` getDocumentSnapshotsFromQuerySnapshot
• **getDocumentSnapshotsFromQuerySnapshot**: *function* = prop('docs')
Defined in src/Firestore/index.ts:540
```haskell
getDocumentSnapshotsFromQuerySnapshot :: QuerySnapshot -> [DocumentSnapshot]
```
##### Type declaration:
▸ (`snapshot`: QuerySnapshot): *QueryDocumentSnapshot[]*
**Parameters:**
Name | Type |
------ | ------ |
`snapshot` | QuerySnapshot |
___
#### `Const` getModelFromCollection
• **getModelFromCollection**: *function* = pipe(
getSnapshotFromCollection,
RTE.chainEitherK(getModelFromDocumentSnapshot)
)
Defined in src/Firestore/index.ts:436
```haskell
getModelFromCollection :: Collection -> ReaderTaskEither Model Model Error
```
##### Type declaration:
▸ (`collection`: CollectionReference): *ReaderTaskEither‹[Model](#model), Error, [Model](#model)›*
**Parameters:**
Name | Type |
------ | ------ |
`collection` | CollectionReference |
___
#### `Const` getModelFromDocument
• **getModelFromDocument**: *function* = pipe(
getSnapshotFromDocument,
TE.chainEitherK(getModelFromDocumentSnapshot)
)
Defined in src/Firestore/index.ts:506
```haskell
getModelFromDocument :: Document -> TaskEither Model Error
```
##### Type declaration:
▸ (`document`: DocumentReference): *TaskEither‹Error, [Model](#model)›*
**Parameters:**
Name | Type |
------ | ------ |
`document` | DocumentReference |
___
#### `Const` getModelFromFirestore
• **getModelFromFirestore**: *function* = pipe(
getCollectionFromFirestore,
R.map(getModelFromCollection)
)
Defined in src/Firestore/index.ts:448
```haskell
getModelFromFirestore :: Firestore -> Reader String (ReaderTaskEither Model Model Error)
```
##### Type declaration:
▸ (`firestore`: Firestore): *Reader‹string, ReaderTaskEither‹[Model](#model), Error, [Model](#model)››*
**Parameters:**
Name | Type |
------ | ------ |
`firestore` | Firestore |
___
#### `Const` getModelsFromQuery
• **getModelsFromQuery**: *function* = pipe(
getSnapshotFromQuery,
TE.chainEitherK(getModelsFromQuerySnapshot)
)
Defined in src/Firestore/index.ts:562
```haskell
getModelsFromQuery :: Query -> TaskEither [Model] Error
```
##### Type declaration:
▸ (`query`: Query): *TaskEither‹Error, [Model](#model)[]›*
**Parameters:**
Name | Type |
------ | ------ |
`query` | Query |
___
#### `Const` getModelsFromQuerySnapshot
• **getModelsFromQuerySnapshot**: *function* = pipe(
getDocumentSnapshotsFromQuerySnapshot,
map(getModelFromDocumentSnapshot),
A.array.sequence(E.either)
)
Defined in src/Firestore/index.ts:549
```haskell
getModelsFromQuerySnapshot :: QuerySnapshot -> Either [Model] Error
```
##### Type declaration:
▸ (`snapshot`: QuerySnapshot): *E.Either‹Error, [Model](#model)[]›*
**Parameters:**
Name | Type |
------ | ------ |
`snapshot` | QuerySnapshot |
___
#### `Const` getModelsInCollection
• **getModelsInCollection**: *function* = pipe(
listDocumentsInCollection,
TE.chain(pipe(map(getModelFromDocument), A.array.sequence(TE.taskEither)))
)
Defined in src/Firestore/index.ts:599
```haskell
getModelsInCollection :: Collection -> TaskEither [Model] Error
```
##### Type declaration:
▸ (`collection`: CollectionReference): *TaskEither‹Error, [Model](#model)[]›*
**Parameters:**
Name | Type |
------ | ------ |
`collection` | CollectionReference |
___
#### `Const` getModelsInCollectionWhere
• **getModelsInCollectionWhere**: *function* = pipe(
getQueryFromCollection,
RTE.fromReaderEither,
RTE.chainTaskEitherK(getModelsFromQuery)
)
Defined in src/Firestore/index.ts:574
```haskell
getModelsInCollectionWhere :: Collection -> ReaderTaskEither [Condition] [Model] Error
```
##### Type declaration:
▸ (`collection`: CollectionReference): *ReaderTaskEither‹[Condition](#condition)[], Error, [Model](#model)[]›*
**Parameters:**
Name | Type |
------ | ------ |
`collection` | CollectionReference |
___
#### `Const` getModelsInFirestore
• **getModelsInFirestore**: *function* = pipe(
getCollectionFromFirestore,
R.map(getModelsInCollection)
)
Defined in src/Firestore/index.ts:611
```haskell
getModelsInFirestore :: Firestore -> ReaderTaskEither String [Model] Error
```
##### Type declaration:
▸ (`firestore`: Firestore): *ReaderTaskEither‹string, Error, [Model](#model)[]›*
**Parameters:**
Name | Type |
------ | ------ |
`firestore` | Firestore |
___
#### `Const` getModelsInFirestoreWhere
• **getModelsInFirestoreWhere**: *function* = pipe(
getCollectionFromFirestore,
R.map(getModelsInCollectionWhere)
)
Defined in src/Firestore/index.ts:587
```haskell
getModelsInFirestoreWhere :: Firestore -> Reader String (ReaderTaskEither [Condition] [Model] Error)
```
##### Type declaration:
▸ (`firestore`: Firestore): *Reader‹string, ReaderTaskEither‹[Condition](#condition)[], Error, [Model](#model)[]››*
**Parameters:**
Name | Type |
------ | ------ |
`firestore` | Firestore |
___
#### `Const` getSnapshotFromDocument
• **getSnapshotFromDocument**: *function* = pipe(
getSnapshotFromDocumentTask,
TEUtils.fromTask
)
Defined in src/Firestore/index.ts:366
```haskell
getSnapshotFromDocument :: Document -> TaskEither Snapshot Error
```
##### Type declaration:
▸ (`document`: DocumentReference): *TaskEither‹Error, DocumentSnapshot›*
**Parameters:**
Name | Type |
------ | ------ |
`document` | DocumentReference |
___
#### `Const` getSnapshotFromQuery
• **getSnapshotFromQuery**: *function* = pipe(
getSnapshotFromQueryTask,
TEUtils.fromTask
)
Defined in src/Firestore/index.ts:528
```haskell
getSnapshotFromQuery :: Query -> TaskEither Snapshot Error
```
##### Type declaration:
▸ (`query`: Query): *TaskEither‹Error, QuerySnapshot›*
**Parameters:**
Name | Type |
------ | ------ |
`query` | Query |
___
#### `Const` listDocumentsInCollection
• **listDocumentsInCollection**: *function* = pipe(
listDocumentsInCollectionTask,
TEUtils.fromTask
)
Defined in src/Firestore/index.ts:482
```haskell
listDocumentsInCollection :: Collection -> TaskEither [Document] Error
```
##### Type declaration:
▸ (`collection`: CollectionReference): *TaskEither‹Error, DocumentReference[]›*
**Parameters:**
Name | Type |
------ | ------ |
`collection` | CollectionReference |
___
#### `Const` listDocumentsInFirestore
• **listDocumentsInFirestore**: *function* = pipe(
getCollectionFromFirestore,
R.map(listDocumentsInCollection)
)
Defined in src/Firestore/index.ts:494
```haskell
listDocumentsInFirestore :: Firestore ReaderTaskEither String [Document] Error
```
##### Type declaration:
▸ (`firestore`: Firestore): *ReaderTaskEither‹string, Error, DocumentReference[]›*
**Parameters:**
Name | Type |
------ | ------ |
`firestore` | Firestore |
___
#### `Const` serialize
• **serialize**: *function* = ifElse(
isSerializedModel,
E.right,
pipe(
ifElse(
isDateModel,
E.right,
pipe(
E.fromPredicate(
isTimestampModel,
() => new Error('Model is not a TimestampModel.')
),
E.map(fromTimestampModel)
)
),
E.map(serializeDateModel)
)
)
Defined in src/Firestore/index.ts:183
```haskell
serialize :: Model -> Either SerializedModel Error
```
##### Type declaration:
▸ ‹**A**›(`model`: [Model](#model)‹A›): *E.Either‹Error, [SerializedModel](#serializedmodel)‹A››*
**Type parameters:**
▪ **A**
**Parameters:**
Name | Type |
------ | ------ |
`model` | [Model](#model)‹A› |
___
#### `Const` serializeTimestampModel
• **serializeTimestampModel**: *function* = pipe(fromTimestampModel, serializeDateModel)
Defined in src/Firestore/index.ts:174
```haskell
serializeTimestampModel :: TimestampModel -> SerializedModel
```
##### Type declaration:
▸ ‹**A**›(`model`: [TimestampModel](#timestampmodel)‹A›): *[SerializedModel](#serializedmodel)‹A›*
**Type parameters:**
▪ **A**
**Parameters:**
Name | Type |
------ | ------ |
`model` | [TimestampModel](#timestampmodel)‹A› |
___
#### `Const` storeModelToCollection
• **storeModelToCollection**: *function* = pipe(
getDocumentFromCollection,
R.chain(storeModelToDocument)
)
Defined in src/Firestore/index.ts:291
```haskell
storeModelToCollection :: Collection -> String -> ReaderTaskEither Model Model Error
```
##### Type declaration:
▸ (`collection`: CollectionReference): *ReaderTaskEither‹[Model](#model), Error, [Model](#model)›*
**Parameters:**
Name | Type |
------ | ------ |
`collection` | CollectionReference |
___
#### `Const` storeModelToDocument
• **storeModelToDocument**: *function* = pipe(
storeModelToDocumentTask,
R.map(TEUtils.fromTask)
)
Defined in src/Firestore/index.ts:279
```haskell
storeModelToDocument :: Document -> ReaderTaskEither Model Model Error
```
##### Type declaration:
▸ (`document`: DocumentReference): *ReaderTaskEither‹[Model](#model), Error, [Model](#model)›*
**Parameters:**
Name | Type |
------ | ------ |
`document` | DocumentReference |
___
#### `Const` storeModelToFirestore
• **storeModelToFirestore**: *function* = pipe(
getCollectionFromFirestore,
R.map(storeModelToCollection)
)
Defined in src/Firestore/index.ts:303
```haskell
storeModelToFirestore :: Firestore -> Reader String (ReaderTaskEither Model Model Error)
```
##### Type declaration:
▸ (`firestore`: Firestore): *Reader‹string, ReaderTaskEither‹[Model](#model), Error, [Model](#model)››*
**Parameters:**
Name | Type |
------ | ------ |
`firestore` | Firestore |
___
#### `Const` updateModelInDocument
• **updateModelInDocument**: *function* = pipe(
updateModelInDocumentTask,
R.map(TEUtils.fromTask)
)
Defined in src/Firestore/index.ts:344
```haskell
updateModelInDocument :: Collection -> ReaderTaskEither Model Model Error
```
##### Type declaration:
▸ (`document`: DocumentReference): *ReaderTaskEither‹[Model](#model), Error, [Model](#model)›*
**Parameters:**
Name | Type |
------ | ------ |
`document` | DocumentReference |
___
#### `Const` validateModel
• **validateModel**: *function* = ifElse(isModel, E.right, () =>
E.left(new Error('Item is not a valid model.'))
)
Defined in src/Firestore/index.ts:412
```haskell
validateModel :: a -> Either Model Error
```
##### Type declaration:
▸ (`a`: unknown): *E.Either‹Error, [Model](#model)›*
**Parameters:**
Name | Type |
------ | ------ |
`a` | unknown |
___
#### `Const` validateSnapshotExistence
• **validateSnapshotExistence**: *function* = ifElse(prop('exists'), E.right, () =>
E.left(new Error('Item does not exist.'))
)
Defined in src/Firestore/index.ts:401
```haskell
validateSnapshotExistence :: snapshot -> Either a Error
```
##### Type declaration:
▸ (`snapshot`: DocumentSnapshot): *E.Either‹Error, DocumentSnapshot›*
**Parameters:**
Name | Type |
------ | ------ |
`snapshot` | DocumentSnapshot |
### Functions
#### `Const` fromDateModel
▸ **fromDateModel**(`model`: object & A & object): *object & A & object & object*
Defined in src/Firestore/index.ts:150
```haskell
fromDateModel :: DateModel -> TimestampModel
```
**Parameters:**
Name | Type |
------ | ------ |
`model` | object & A & object |
**Returns:** *object & A & object & object*
___
#### `Const` fromTimestampModel
▸ **fromTimestampModel**(`model`: object & A & object): *object & A & object & object*
Defined in src/Firestore/index.ts:137
```haskell
fromTimestampModel :: TimestampModel -> DateModel
```
**Parameters:**
Name | Type |
------ | ------ |
`model` | object & A & object |
**Returns:** *object & A & object & object*
___
#### `Const` getCollectionFromDocument
▸ **getCollectionFromDocument**(`document`: DocumentReference‹object›): *(Anonymous function)*
Defined in src/Firestore/index.ts:255
```haskell
getCollectionFromDocument :: Document -> Reader String Collection
```
**Parameters:**
Name | Type |
------ | ------ |
`document` | DocumentReference‹object› |
**Returns:** *(Anonymous function)*
___
#### `Const` getCollectionFromFirestore
▸ **getCollectionFromFirestore**(`firestore`: Firestore‹›): *(Anonymous function)*
Defined in src/Firestore/index.ts:211
```haskell
getCollectionFromFirestore :: Firestore -> Reader String Collection
```
**Parameters:**
Name | Type |
------ | ------ |
`firestore` | Firestore‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` getDocumentFromCollection
▸ **getDocumentFromCollection**(`collection`: CollectionReference‹object›): *(Anonymous function)*
Defined in src/Firestore/index.ts:222
```haskell
getDocumentFromCollection :: Collection -> Reader Model Document
```
**Parameters:**
Name | Type |
------ | ------ |
`collection` | CollectionReference‹object› |
**Returns:** *(Anonymous function)*
___
#### `Const` getQueryFromCollection
▸ **getQueryFromCollection**(`collection`: CollectionReference‹object›): *function*
Defined in src/Firestore/index.ts:233
```haskell
getQueryFromCollection :: Collection -> Reader [Condition] Document Error
```
**Parameters:**
Name | Type |
------ | ------ |
`collection` | CollectionReference‹object› |
**Returns:** *function*
▸ (`x0`: V0): *T2*
**Parameters:**
Name | Type |
------ | ------ |
`x0` | V0 |
___
#### `Const` getSnapshotFromDocumentTask
▸ **getSnapshotFromDocumentTask**(`document`: DocumentReference‹object›): *(Anonymous function)*
Defined in src/Firestore/index.ts:358
```haskell
getSnapshotFromDocumentTask :: Document -> Task Snapshot
```
**Parameters:**
Name | Type |
------ | ------ |
`document` | DocumentReference‹object› |
**Returns:** *(Anonymous function)*
___
#### `Const` getSnapshotFromQueryTask
▸ **getSnapshotFromQueryTask**(`query`: Query‹object›): *(Anonymous function)*
Defined in src/Firestore/index.ts:520
```haskell
getSnapshotFromQueryTask :: Query -> Task Snapshot
```
**Parameters:**
Name | Type |
------ | ------ |
`query` | Query‹object› |
**Returns:** *(Anonymous function)*
___
#### `Const` isDateModel
▸ **isDateModel**(`a`: unknown): *a is DateModel*
Defined in src/Firestore/index.ts:84
```haskell
isDateModel :: a -> bool
```
**Parameters:**
Name | Type |
------ | ------ |
`a` | unknown |
**Returns:** *a is DateModel*
___
#### `Const` isDateString
▸ **isDateString**(`a`: unknown): *a is string*
Defined in src/Firestore/index.ts:92
```haskell
isDateString :: a -> bool
```
**Parameters:**
Name | Type |
------ | ------ |
`a` | unknown |
**Returns:** *a is string*
___
#### `Const` isModel
▸ **isModel**(`a`: unknown): *a is Model*
Defined in src/Firestore/index.ts:64
```haskell
isModel :: a -> bool
```
**Parameters:**
Name | Type |
------ | ------ |
`a` | unknown |
**Returns:** *a is Model*
___
#### `Const` isSerializedModel
▸ **isSerializedModel**(`a`: unknown): *a is SerializedModel*
Defined in src/Firestore/index.ts:100
```haskell
isSerializedModel :: a -> bool
```
**Parameters:**
Name | Type |
------ | ------ |
`a` | unknown |
**Returns:** *a is SerializedModel*
___
#### `Const` isTimestampModel
▸ **isTimestampModel**(`a`: unknown): *a is TimestampModel*
Defined in src/Firestore/index.ts:72
```haskell
isTimestampModel :: a -> bool
```
**Parameters:**
Name | Type |
------ | ------ |
`a` | unknown |
**Returns:** *a is TimestampModel*
___
#### `Const` listCollectionsInFirestore
▸ **listCollectionsInFirestore**(`firestore`: Firestore‹›): *(Anonymous function)*
Defined in src/Firestore/index.ts:462
```haskell
listCollectionsInFirestore :: Firestore -> Task [Collection]
```
**Parameters:**
Name | Type |
------ | ------ |
`firestore` | Firestore‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` listDocumentsInCollectionTask
▸ **listDocumentsInCollectionTask**(`collection`: CollectionReference‹object›): *(Anonymous function)*
Defined in src/Firestore/index.ts:473
```haskell
listDocumentsInCollectionTask :: Collection -> Task [Document]
```
**Parameters:**
Name | Type |
------ | ------ |
`collection` | CollectionReference‹object› |
**Returns:** *(Anonymous function)*
___
#### `Const` serializeDateModel
▸ **serializeDateModel**(`model`: object & A & object): *object & A & object & object*
Defined in src/Firestore/index.ts:163
```haskell
serializeDateModel :: DateModel -> SerializedModel
```
**Parameters:**
Name | Type |
------ | ------ |
`model` | object & A & object |
**Returns:** *object & A & object & object*
___
#### `Const` storeModelToFirestoreWith
▸ **storeModelToFirestoreWith**(`firestore`: Firestore‹›): *(Anonymous function)*
Defined in src/Firestore/index.ts:320
```haskell
storeModelToFirestoreWith :: Firestore -> Reader String (ReaderTaskEither (() -> Model) Model Error)
```
**Parameters:**
Name | Type |
------ | ------ |
`firestore` | Firestore‹› |
**Returns:** *(Anonymous function)*
___
#### `Const` updateModelInDocumentTask
▸ **updateModelInDocumentTask**(`document`: DocumentReference‹object›): *(Anon