npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

functional-google-cloud

v0.0.8

Published

Google Cloud Utilities functions in Functional Programming Style

Downloads

49

Readme

functional-google-cloud

functional-google-cloud

functional-google-cloud

functional-google-cloud

Index

Modules

Interfaces

functional-google-cloud"CloudStorage/index"ListFilesOptions

Interface: ListFilesOptions

Hierarchy

  • ListFilesOptions

Index

Properties

Properties

Optional delimiter

delimiter? : string

Defined in src/CloudStorage/index.ts:45


Optional prefix

prefix? : string

Defined in src/CloudStorage/index.ts:44

functional-google-cloud"CloudStorage/index"Metadata

Interface: Metadata

Hierarchy

  • Metadata

Index

Properties

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

functional-google-cloud"CloudStorage/index"Path

Interface: Path

Hierarchy

  • Path

Index

Properties

Properties

bucket

bucket: string

Defined in src/CloudStorage/index.ts:31


filename

filename: string

Defined in src/CloudStorage/index.ts:32

functional-google-cloud"CloudStorage/index"ReadOnlyConfig

Interface: ReadOnlyConfig

Hierarchy

Index

Properties

Properties

expires_in

expires_in: number

Defined in src/CloudStorage/index.ts:36

functional-google-cloud"CloudStorage/index"WriteOnlyConfig

Interface: WriteOnlyConfig

Hierarchy

Index

Properties

Properties

expires_in

expires_in: number

Inherited from ReadOnlyConfig.expires_in

Defined in src/CloudStorage/index.ts:36


file_type

file_type: FileType

Defined in src/CloudStorage/index.ts:40

functional-google-cloud"CloudStorage/Stubs"ReturnValues

Interface: ReturnValues

Hierarchy

  • ReturnValues

Index

Properties

Properties

buffer

buffer: Buffer

Defined in src/CloudStorage/Stubs.ts:12


url

url: string

Defined in src/CloudStorage/Stubs.ts:11

Modules

functional-google-cloud"CloudStorage/Arbitraries"

Module: "CloudStorage/Arbitraries"

Index

Functions

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

Defined in src/CloudStorage/Arbitraries.ts:14

Returns: Arbitrary‹WriteOnlyConfig


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

Defined in src/CloudStorage/Arbitraries.ts:23

Returns: Arbitrary‹Path


Const returnValues

returnValues(): Arbitrary‹ReturnValues

Defined in src/CloudStorage/Arbitraries.ts:32

Returns: Arbitrary‹ReturnValues


Const storage

storage(arb?: Arbitrary‹ReturnValues›): Arbitrary‹SinonStubbedInstance‹Storage››

Defined in src/CloudStorage/Arbitraries.ts:44

Parameters:

Name | Type | ------ | ------ | arb? | Arbitrary‹ReturnValues› |

Returns: Arbitrary‹SinonStubbedInstance‹Storage››

functional-google-cloud"CloudStorage/DateTime"

Module: "CloudStorage/DateTime"

Index

Functions

Functions

Const getUnixTimestampIn

getUnixTimestampIn(seconds: number): number

Defined in src/CloudStorage/DateTime.ts:6

getUnixTimestampInMinutes :: Int -> Int

Parameters:

Name | Type | ------ | ------ | seconds | number |

Returns: number

functional-google-cloud"CloudStorage/index"

Module: "CloudStorage/index"

Index

Interfaces

Type aliases

Variables

Functions

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

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

fetchFileFromStorage :: Storage -> ReaderTaskEither Path File Error
Type declaration:

▸ (storage: Storage): ReaderTaskEither‹Path, 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

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

getBufferFromStorage :: Storage -> ReaderTaskEither Path File Error
Type declaration:

▸ (storage: Storage): ReaderTaskEither‹Path, 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

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

getDownloadUrlFromFile :: File -> ReaderTaskEither WriteOnlyConfig String Error
Type declaration:

▸ (file: File): ReaderTaskEither‹ReadOnlyConfig, 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

getDownloadUrlFromFileTask :: File -> ReaderTask WriteOnlyConfig String
Type declaration:

▸ (file: File): ReaderTask‹ReadOnlyConfig, string›

Parameters:

Name | Type | ------ | ------ | file | File |


Const getFileFromStorage

getFileFromStorage: function = pipe( getBucketFromStorageWithPath, R.chain(getFileFromBucket) )

Defined in src/CloudStorage/index.ts:215

getFileFromStorage :: Storage -> Reader Path File
Type declaration:

▸ (storage: Storage): Reader‹Path, File›

Parameters:

Name | Type | ------ | ------ | storage | Storage |


Const getReadOnlySignedUrlArrayFromFileTask

getReadOnlySignedUrlArrayFromFileTask: function = useWith(call, [ getSignedUrlTask, getReadOnlySignedUrlConfigFromConfig, ])

Defined in src/CloudStorage/index.ts:127

getReadOnlySignedUrlArrayFromFileTask :: File -> ReaderTask WriteOnlyConfig [String]
Type declaration:

▸ (file: File): Reader‹ReadOnlyConfig, Task‹[string]››

Parameters:

Name | Type | ------ | ------ | file | File |


Const getUploadUrlFromFile

getUploadUrlFromFile: function = pipe( getUploadUrlFromFileTask, R.map(getTaskEitherFromTask) )

Defined in src/CloudStorage/index.ts:172

getUploadUrlFromFile :: File -> ReaderTaskEither WriteOnlyConfig String Error
Type declaration:

▸ (file: File): ReaderTaskEither‹WriteOnlyConfig, 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

getUploadUrlFromFileTask :: File -> ReaderTask WriteOnlyConfig String
Type declaration:

▸ (file: File): ReaderTask‹WriteOnlyConfig, string›

Parameters:

Name | Type | ------ | ------ | file | File |


Const getUploadUrlFromStorage

getUploadUrlFromStorage: function = pipe(getFileFromStorage, R.map(getUploadUrlFromFile))

Defined in src/CloudStorage/index.ts:261

getUploadUrlFromStorage :: Storage -> Path -> ReaderTaskEither WriteOnlyConfig String Error
Type declaration:

▸ (storage: Storage): Reader‹Path, ReaderTaskEither‹WriteOnlyConfig, Error, string››

Parameters:

Name | Type | ------ | ------ | storage | Storage |


Const getWriteOnlySignedUrlArrayFromFileTask

getWriteOnlySignedUrlArrayFromFileTask: function = useWith(call, [ getSignedUrlTask, getWriteOnlySignedUrlConfigFromConfig, ])

Defined in src/CloudStorage/index.ts:115

getWriteOnlySignedUrlArrayFromFileTask :: File -> ReaderTask WriteOnlyConfig [String]
Type declaration:

▸ (file: File): Reader‹WriteOnlyConfig, Task‹[string]››

Parameters:

Name | Type | ------ | ------ | file | File |


Const listFilesInBucket

listFilesInBucket: function = pipe( listFilesInBucketTask, R.map(TEUtils.fromTask) )

Defined in src/CloudStorage/index.ts:418

listFilesInBucket :: Bucket -> ReaderTaskEither ListFilesOptions [File] Error
Type declaration:

▸ (bucket: Bucket): ReaderTaskEither‹ListFilesOptions, Error, File[]›

Parameters:

Name | Type | ------ | ------ | bucket | Bucket |


Const listFilesInStorage

listFilesInStorage: function = pipe(getBucketFromStorage, R.map(listFilesInBucket))

Defined in src/CloudStorage/index.ts:430

listFilesInStorage :: Storage -> Reader String (ReaderTaskEither ListFilesOptions [File] Error)
Type declaration:

▸ (storage: Storage): Reader‹string, ReaderTaskEither‹ListFilesOptions, Error, File[]››

Parameters:

Name | Type | ------ | ------ | storage | Storage |


Const storeBufferToFile

storeBufferToFile: function = pipe( storeBufferToFileTask, R.map(getTaskEitherFromTask) )

Defined in src/CloudStorage/index.ts:332

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

storeBufferToStorage :: Storage -> Reader Path ReaderTaskEither Buffer File Error
Type declaration:

▸ (storage: Storage): Reader‹Path, 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

storeMetadataToFile :: File -> ReaderTaskEither Metadata File Error
Type declaration:

▸ (file: File): ReaderTaskEither‹Partial‹Metadata›, Error, File›

Parameters:

Name | Type | ------ | ------ | file | File |


Const storeMetadataToStorage

storeMetadataToStorage: function = pipe(getFileFromStorage, R.map(storeMetadataToFile))

Defined in src/CloudStorage/index.ts:382

storeMetadataToStorage :: Metadata -> Reader Path ReaderTaskEither Metadata File Error
Type declaration:

▸ (storage: Storage): Reader‹Path, ReaderTaskEither‹Partial‹Metadata›, Error, File››

Parameters:

Name | Type | ------ | ------ | storage | Storage |

Functions

Const getBucketFromStorage

getBucketFromStorage(storage: Storage‹›): (Anonymous function)

Defined in src/CloudStorage/index.ts:396

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

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

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

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

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

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

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

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

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

storeMetadataToFileTask :: File -> ReaderTask Metadata File

Parameters:

Name | Type | ------ | ------ | file | File‹› |

Returns: (Anonymous function)

functional-google-cloud"CloudStorage/Stubs"

Module: "CloudStorage/Stubs"

Index

Interfaces

Functions

Functions

Const bucket

bucket(values: ReturnValues): object

Defined in src/CloudStorage/Stubs.ts:59

Parameters:

Name | Type | ------ | ------ | values | ReturnValues |

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): object

Defined in src/CloudStorage/Stubs.ts:37

Parameters:

Name | Type | ------ | ------ | values | ReturnValues |

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): object

Defined in src/CloudStorage/Stubs.ts:74

Parameters:

Name | Type | ------ | ------ | values | ReturnValues |

Returns: object

functional-google-cloud"Firestore/Arbitraries"

Module: "Firestore/Arbitraries"

Index

Functions

Functions

Const condition

condition(): Arbitrary‹Condition

Defined in src/Firestore/Arbitraries.ts:40

Returns: Arbitrary‹Condition


Const id

id(): Arbitrary‹string›

Defined in src/Firestore/Arbitraries.ts:7

Returns: Arbitrary‹string›


Const model

model(): Arbitrary‹Model

Defined in src/Firestore/Arbitraries.ts:24

Returns: Arbitrary‹Model


Const modelAndConditions

modelAndConditions(): Arbitrary‹[Model, Condition[]]›

Defined in src/Firestore/Arbitraries.ts:43

Returns: Arbitrary‹[Model, Condition[]]›


Const modelAndUpdate

modelAndUpdate(): Arbitrary‹[Model, Model]›

Defined in src/Firestore/Arbitraries.ts:29

Returns: Arbitrary‹[Model, Model]›


Const modelBase

modelBase(): Arbitrary‹Model

Defined in src/Firestore/Arbitraries.ts:12

Returns: Arbitrary‹Model


Const modelData

modelData(): Arbitrary‹object›

Defined in src/Firestore/Arbitraries.ts:17

Returns: Arbitrary‹object›


Const models

models(): Arbitrary‹Model[]›

Defined in src/Firestore/Arbitraries.ts:57

Returns: Arbitrary‹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

Defined in src/Firestore/Arbitraries.ts:38

Returns: Arbitrary‹Operation


Const table

table(): Arbitrary‹string›

Defined in src/Firestore/Arbitraries.ts:59

Returns: Arbitrary‹string›

functional-google-cloud"Firestore/Emulator"

Module: "Firestore/Emulator"

Index

Functions

Functions

Const clearCollection

clearCollection(parentCollection: CollectionReference‹object›): Promise‹void›

Defined in src/Firestore/Emulator.ts:25

clearCollection :: Collection -> Promise

Parameters:

Name | Type | ------ | ------ | parentCollection | CollectionReference‹object› |

Returns: Promise‹void›


Const clearEmulator

clearEmulator(): Promise‹void›

Defined in src/Firestore/Emulator.ts:56

clearFirebase :: () -> Promise

Returns: Promise‹void›


Const clearFirestore

clearFirestore(): Promise‹void›

Defined in src/Firestore/Emulator.ts:46

clearFirestore :: () -> Promise

Returns: Promise‹void›


Const getFirestore

getFirestore(): Firestore‹›

Defined in src/Firestore/Emulator.ts:16

getFirestore :: () -> Firestore

Returns: Firestore‹›

functional-google-cloud"Firestore/index"

Module: "Firestore/index"

Index

Type aliases

Variables

Functions

Type aliases

Condition

Ƭ Condition: [string, Operation, unknown]

Defined in src/Firestore/index.ts:57


DateModel

Ƭ DateModel: 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‹A› & object

Defined in src/Firestore/index.ts:50


TimestampModel

Ƭ TimestampModel: Model‹A› & object

Defined in src/Firestore/index.ts:40

Variables

Const getDocumentSnapshotsFromQuerySnapshot

getDocumentSnapshotsFromQuerySnapshot: function = prop('docs')

Defined in src/Firestore/index.ts:540

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

getModelFromCollection :: Collection -> ReaderTaskEither Model Model Error
Type declaration:

▸ (collection: CollectionReference): ReaderTaskEither‹Model, Error, Model

Parameters:

Name | Type | ------ | ------ | collection | CollectionReference |


Const getModelFromDocument

getModelFromDocument: function = pipe( getSnapshotFromDocument, TE.chainEitherK(getModelFromDocumentSnapshot) )

Defined in src/Firestore/index.ts:506

getModelFromDocument :: Document -> TaskEither Model Error
Type declaration:

▸ (document: DocumentReference): TaskEither‹Error, Model

Parameters:

Name | Type | ------ | ------ | document | DocumentReference |


Const getModelFromFirestore

getModelFromFirestore: function = pipe( getCollectionFromFirestore, R.map(getModelFromCollection) )

Defined in src/Firestore/index.ts:448

getModelFromFirestore :: Firestore -> Reader String (ReaderTaskEither Model Model Error)
Type declaration:

▸ (firestore: Firestore): Reader‹string, ReaderTaskEither‹Model, Error, Model››

Parameters:

Name | Type | ------ | ------ | firestore | Firestore |


Const getModelsFromQuery

getModelsFromQuery: function = pipe( getSnapshotFromQuery, TE.chainEitherK(getModelsFromQuerySnapshot) )

Defined in src/Firestore/index.ts:562

getModelsFromQuery :: Query -> TaskEither [Model] Error
Type declaration:

▸ (query: Query): TaskEither‹Error, 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

getModelsFromQuerySnapshot :: QuerySnapshot -> Either [Model] Error
Type declaration:

▸ (snapshot: QuerySnapshot): E.Either‹Error, 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

getModelsInCollection :: Collection -> TaskEither [Model] Error
Type declaration:

▸ (collection: CollectionReference): TaskEither‹Error, Model[]›

Parameters:

Name | Type | ------ | ------ | collection | CollectionReference |


Const getModelsInCollectionWhere

getModelsInCollectionWhere: function = pipe( getQueryFromCollection, RTE.fromReaderEither, RTE.chainTaskEitherK(getModelsFromQuery) )

Defined in src/Firestore/index.ts:574

getModelsInCollectionWhere :: Collection -> ReaderTaskEither [Condition] [Model] Error
Type declaration:

▸ (collection: CollectionReference): ReaderTaskEither‹Condition[], Error, Model[]›

Parameters:

Name | Type | ------ | ------ | collection | CollectionReference |


Const getModelsInFirestore

getModelsInFirestore: function = pipe( getCollectionFromFirestore, R.map(getModelsInCollection) )

Defined in src/Firestore/index.ts:611

getModelsInFirestore :: Firestore -> ReaderTaskEither String [Model] Error
Type declaration:

▸ (firestore: Firestore): ReaderTaskEither‹string, Error, Model[]›

Parameters:

Name | Type | ------ | ------ | firestore | Firestore |


Const getModelsInFirestoreWhere

getModelsInFirestoreWhere: function = pipe( getCollectionFromFirestore, R.map(getModelsInCollectionWhere) )

Defined in src/Firestore/index.ts:587

getModelsInFirestoreWhere :: Firestore -> Reader String (ReaderTaskEither [Condition] [Model] Error)
Type declaration:

▸ (firestore: Firestore): Reader‹string, ReaderTaskEither‹Condition[], Error, Model[]››

Parameters:

Name | Type | ------ | ------ | firestore | Firestore |


Const getSnapshotFromDocument

getSnapshotFromDocument: function = pipe( getSnapshotFromDocumentTask, TEUtils.fromTask )

Defined in src/Firestore/index.ts:366

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

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

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

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

serialize :: Model -> Either SerializedModel Error
Type declaration:

▸ ‹A›(model: Model‹A›): E.Either‹Error, SerializedModel‹A››

Type parameters:

A

Parameters:

Name | Type | ------ | ------ | model | Model‹A› |


Const serializeTimestampModel

serializeTimestampModel: function = pipe(fromTimestampModel, serializeDateModel)

Defined in src/Firestore/index.ts:174

serializeTimestampModel :: TimestampModel -> SerializedModel
Type declaration:

▸ ‹A›(model: TimestampModel‹A›): SerializedModel‹A›

Type parameters:

A

Parameters:

Name | Type | ------ | ------ | model | TimestampModel‹A› |


Const storeModelToCollection

storeModelToCollection: function = pipe( getDocumentFromCollection, R.chain(storeModelToDocument) )

Defined in src/Firestore/index.ts:291

storeModelToCollection :: Collection -> String -> ReaderTaskEither Model Model Error
Type declaration:

▸ (collection: CollectionReference): ReaderTaskEither‹Model, Error, Model

Parameters:

Name | Type | ------ | ------ | collection | CollectionReference |


Const storeModelToDocument

storeModelToDocument: function = pipe( storeModelToDocumentTask, R.map(TEUtils.fromTask) )

Defined in src/Firestore/index.ts:279

storeModelToDocument :: Document -> ReaderTaskEither Model Model Error
Type declaration:

▸ (document: DocumentReference): ReaderTaskEither‹Model, Error, Model

Parameters:

Name | Type | ------ | ------ | document | DocumentReference |


Const storeModelToFirestore

storeModelToFirestore: function = pipe( getCollectionFromFirestore, R.map(storeModelToCollection) )

Defined in src/Firestore/index.ts:303

storeModelToFirestore :: Firestore -> Reader String (ReaderTaskEither Model Model Error)
Type declaration:

▸ (firestore: Firestore): Reader‹string, ReaderTaskEither‹Model, Error, Model››

Parameters:

Name | Type | ------ | ------ | firestore | Firestore |


Const updateModelInDocument

updateModelInDocument: function = pipe( updateModelInDocumentTask, R.map(TEUtils.fromTask) )

Defined in src/Firestore/index.ts:344

updateModelInDocument :: Collection -> ReaderTaskEither Model Model Error
Type declaration:

▸ (document: DocumentReference): ReaderTaskEither‹Model, Error, 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

validateModel :: a -> Either Model Error
Type declaration:

▸ (a: unknown): E.Either‹Error, 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

storeModelToFirestoreWith :: Firestore -> Reader String (ReaderTaskEither (() -> Model) Model Error)

Parameters:

Name | Type | ------ | ------ | firestore | Firestore‹› |

Returns: (Anonymous function)


Const updateModelInDocumentTask

updateModelInDocumentTask(document: DocumentReference‹object›): (Anonymous function)

Defined in src/Firestore/index.ts:332

updateModelInDocumentTask :: Collection -> ReaderTask Model Model

Parameters:

Name | Type | ------ | ------ | document | DocumentReference‹object› |

Returns: (Anonymous function)

functional-google-cloud"index"

Module: "index"

Index

References

References

CloudStorage

CloudStorage:


Firestore

Firestore:


PubSub

PubSub:

functional-google-cloud"PubSub"

Module: "PubSub"

Index

Type aliases

Variables

Functions

Type aliases

Payload

Ƭ Payload: Record‹string, unknown›

Defined in src/PubSub.ts:10

Variables

Const getBufferFromPayload

getBufferFromPayload: function = pipe( JSON.stringify, Buffer.from )

Defined in src/PubSub.ts:16

Type declaration:

▸ (payload: Payload): Buffer

Parameters:

Name | Type | ------ | ------ | payload | Payload |


Const getPayloadFromMessage

getPayloadFromMessage: function = pipe( prop('data'), (buffer: Buffer) => (): unknown => { const base64 = Buffer.from((buffer as unknown) as string, 'base64'); return JSON.parse(base64.toString()); }, (a: Lazy) => E.tryCatch(a, E.toError), E.chain( E.fromPredicate( isPayload, () => new Error('Message data is not a Payload instance.') ) ) )

Defined in src/PubSub.ts:50

Type declaration:

▸ (message: Message): E.Either‹Error, Payload

Parameters:

Name | Type | ------ | ------ | message | Message |


Const publishBufferToTopic

publishBufferToTopic: function = pipe( publishBufferToTopicTask, R.map(getTaskEitherFromTask) )

Defined in src/PubSub.ts:29

Type declaration:

▸ (buffer: Buffer): ReaderTaskEither‹Topic, Error, string›

Parameters:

Name | Type | ------ | ------ | buffer | Buffer |


Const publishToTopic

publishToTopic: function = pipe( getBufferFromPayload, publishBufferToTopic )

Defined in src/PubSub.ts:37

Type declaration:

▸ (payload: Payload): ReaderTaskEither‹Topic, Error, string›

Parameters:

Name | Type | ------ | ------ | payload | Payload |

Functions

Const getTopicFromPubSub

getTopicFromPubSub(topic: string): (Anonymous function)

Defined in src/PubSub.ts:45

Parameters:

Name | Type | ------ | ------ | topic | string |

Returns: (Anonymous function)


Const isPayload

isPayload(a: unknown): a is Payload

Defined in src/PubSub.ts:13

Parameters:

Name | Type | ------ | ------ | a | unknown |

Returns: a is Payload


Const publishBufferToTopicTask

publishBufferToTopicTask(buffer: Buffer‹›): (Anonymous function)

Defined in src/PubSub.ts:24

Parameters:

Name | Type | ------ | ------ | buffer | Buffer‹› |

Returns: (Anonymous function)