functional-usecases
v0.2.21
Published
UseCases for Entities' functions in a Functional Style
Downloads
11
Maintainers
Readme
functional-usecases
functional-usecases
Index
Modules
- "CloudStorage"
- "Comparable"
- "ComparableSchema"
- "File"
- "Folder"
- "Handlers/GetEntitiesHandler"
- "Handlers/GetEntityHandler"
- "Handlers/GetFileInBucketsHandler"
- "Handlers/GetFileModelHandler"
- "Handlers/ListEntitiesHandler"
- "Handlers/Request"
- "Handlers/index"
- "Schema"
- "StorageObject"
- "TableAnnotation"
- "Vertex"
Interfaces
functional-usecases › "Comparable" › Storage
Interface: Storage
Hierarchy
- Storage
Index
Properties
Properties
annotation_bucket
• annotation_bucket: string
Defined in src/Comparable.ts:33
cloud_storage
• cloud_storage: CloudStorage
Defined in src/Comparable.ts:32
comparable_bucket
• comparable_bucket: string
Defined in src/Comparable.ts:34
functional-usecases › "Handlers/GetEntitiesHandler" › GetEntitiesCallables
Interface: GetEntitiesCallables ‹Entity, Reference›
Type parameters
▪ Entity: Model
▪ Reference
Hierarchy
Callables‹Entity›
↳ GetEntitiesCallables
Index
Properties
Properties
fromModel
• fromModel: function
Inherited from Callables.fromModel
Defined in src/Handlers/Request.ts:29
Type declaration:
▸ (model
: Model): E.Either‹Error, Entity›
Parameters:
Name | Type |
------ | ------ |
model
| Model |
getModelFromReference
• getModelFromReference: ReaderTaskEither‹Reference, Error, Model›
Defined in src/Handlers/GetEntitiesHandler.ts:13
getReferencesFromRequest
• getReferencesFromRequest: function
Defined in src/Handlers/GetEntitiesHandler.ts:14
Type declaration:
▸ (request
: Request): Reference[]
Parameters:
Name | Type |
------ | ------ |
request
| Request |
predicate
• predicate: function
Inherited from Callables.predicate
Defined in src/Handlers/Request.ts:28
Type declaration:
▸ (request
: Request): boolean
Parameters:
Name | Type |
------ | ------ |
request
| Request |
functional-usecases › "Handlers/GetEntityHandler" › GetEntityCallables
Interface: GetEntityCallables ‹Entity, Reference›
Type parameters
▪ Entity: Model
▪ Reference
Hierarchy
Callables‹Entity›
↳ GetEntityCallables
Index
Properties
Properties
fromModel
• fromModel: function
Inherited from Callables.fromModel
Defined in src/Handlers/Request.ts:29
Type declaration:
▸ (model
: Model): E.Either‹Error, Entity›
Parameters:
Name | Type |
------ | ------ |
model
| Model |
getModelFromReference
• getModelFromReference: ReaderTaskEither‹Reference, Error, Model›
Defined in src/Handlers/GetEntityHandler.ts:12
getReferenceFromRequest
• getReferenceFromRequest: function
Defined in src/Handlers/GetEntityHandler.ts:13
Type declaration:
▸ (request
: Request): Reference
Parameters:
Name | Type |
------ | ------ |
request
| Request |
predicate
• predicate: function
Inherited from Callables.predicate
Defined in src/Handlers/Request.ts:28
Type declaration:
▸ (request
: Request): boolean
Parameters:
Name | Type |
------ | ------ |
request
| Request |
functional-usecases › "Handlers/GetFileInBucketsHandler" › Callables
Interface: Callables ‹A, Model›
Type parameters
▪ A: Request
▪ Model
Hierarchy
- Callables
Index
Properties
Properties
getPathFromReference
• getPathFromReference: GetPathFunction
Defined in src/Handlers/GetFileInBucketsHandler.ts:28
getReferenceFromRequest
• getReferenceFromRequest: function
Defined in src/Handlers/GetFileInBucketsHandler.ts:27
Type declaration:
▸ (request
: A): Reference
Parameters:
Name | Type |
------ | ------ |
request
| A |
predicate
• predicate: function
Defined in src/Handlers/GetFileInBucketsHandler.ts:29
Type declaration:
▸ (a
: unknown): a is Model
Parameters:
Name | Type |
------ | ------ |
a
| unknown |
requestPredicate
• requestPredicate: function
Defined in src/Handlers/GetFileInBucketsHandler.ts:26
Type declaration:
▸ (request
: Request): request is A
Parameters:
Name | Type |
------ | ------ |
request
| Request |
functional-usecases › "Handlers/GetFileInBucketsHandler" › Storage
Interface: Storage
Hierarchy
- Storage
Index
Properties
Properties
buckets
• buckets: string[]
Defined in src/Handlers/GetFileInBucketsHandler.ts:20
cloud_storage
• cloud_storage: CloudStorage
Defined in src/Handlers/GetFileInBucketsHandler.ts:19
functional-usecases › "Handlers/GetFileModelHandler" › Callables
Interface: Callables ‹A, Model›
Type parameters
▪ A: Request
▪ Model
Hierarchy
- Callables
Index
Properties
Properties
getPathFromReference
• getPathFromReference: function
Defined in src/Handlers/GetFileModelHandler.ts:25
Type declaration:
▸ (bucket
: any): Reader‹Reference, Path›
Parameters:
Name | Type |
------ | ------ |
bucket
| any |
getReferenceFromRequest
• getReferenceFromRequest: function
Defined in src/Handlers/GetFileModelHandler.ts:24
Type declaration:
▸ (request
: A): Reference
Parameters:
Name | Type |
------ | ------ |
request
| A |
predicate
• predicate: function
Defined in src/Handlers/GetFileModelHandler.ts:26
Type declaration:
▸ (a
: unknown): a is Model
Parameters:
Name | Type |
------ | ------ |
a
| unknown |
requestPredicate
• requestPredicate: function
Defined in src/Handlers/GetFileModelHandler.ts:23
Type declaration:
▸ (request
: Request): request is A
Parameters:
Name | Type |
------ | ------ |
request
| Request |
functional-usecases › "Handlers/GetFileModelHandler" › Storage
Interface: Storage
Hierarchy
- Storage
Index
Properties
Properties
bucket
• bucket: string
Defined in src/Handlers/GetFileModelHandler.ts:19
cloud_storage
• cloud_storage: CloudStorage
Defined in src/Handlers/GetFileModelHandler.ts:18
functional-usecases › "Handlers/ListEntitiesHandler" › ListEntitiesCallables
Interface: ListEntitiesCallables ‹Entity, Response›
Type parameters
▪ Entity: Model
▪ Response
Hierarchy
Callables‹Entity›
↳ ListEntitiesCallables
Index
Properties
Properties
fromModel
• fromModel: function
Inherited from Callables.fromModel
Defined in src/Handlers/Request.ts:29
Type declaration:
▸ (model
: Model): E.Either‹Error, Entity›
Parameters:
Name | Type |
------ | ------ |
model
| Model |
getModels
• getModels: TaskEither‹Error, Model[]›
Defined in src/Handlers/ListEntitiesHandler.ts:12
getResponseFromEntity
• getResponseFromEntity: function
Defined in src/Handlers/ListEntitiesHandler.ts:13
Type declaration:
▸ (entity
: Entity): Response
Parameters:
Name | Type |
------ | ------ |
entity
| Entity |
predicate
• predicate: function
Inherited from Callables.predicate
Defined in src/Handlers/Request.ts:28
Type declaration:
▸ (request
: Request): boolean
Parameters:
Name | Type |
------ | ------ |
request
| Request |
functional-usecases › "Handlers/Request" › Callables
Interface: Callables ‹Entity›
Type parameters
▪ Entity: Model
Hierarchy
Callables
Index
Properties
Properties
fromModel
• fromModel: function
Defined in src/Handlers/Request.ts:29
Type declaration:
▸ (model
: Model): E.Either‹Error, Entity›
Parameters:
Name | Type |
------ | ------ |
model
| Model |
predicate
• predicate: function
Defined in src/Handlers/Request.ts:28
Type declaration:
▸ (request
: Request): boolean
Parameters:
Name | Type |
------ | ------ |
request
| Request |
functional-usecases › "Handlers/Request" › Request
Interface: Request
Hierarchy
- Request
Index
Properties
Properties
method
• method: "GET" | "POST" | string
Defined in src/Handlers/Request.ts:9
functional-usecases › "Handlers/Request" › Storage
Interface: Storage
Hierarchy
- Storage
Index
Properties
Properties
firestore
• firestore: Firestore
Defined in src/Handlers/Request.ts:23
table
• table: string
Defined in src/Handlers/Request.ts:24
functional-usecases › "Schema" › SchemaReference
Interface: SchemaReference ‹T›
Type parameters
▪ T: SchemaInstance
Hierarchy
FilesReference & FolderReference
↳ SchemaReference
Index
Properties
Properties
files
• files: string[]
Inherited from SchemaReference.files
Defined in node_modules/functional-types/lib/Folder/index.d.ts:42
folder
• folder: string
Inherited from SchemaReference.folder
Defined in node_modules/functional-types/lib/Folder/index.d.ts:39
schema
• schema: T
Defined in src/Schema.ts:35
functional-usecases › "TableAnnotation" › TableAnnotationModel
Interface: TableAnnotationModel
Hierarchy
object
↳ TableAnnotationModel
Index
Properties
Properties
boundingBoxesByPage
• boundingBoxesByPage: BoundingBoxesByPageModel
Defined in src/TableAnnotation.ts:40
functional-usecases › "TableAnnotation" › Tables
Interface: Tables
Hierarchy
- Tables
Index
Properties
Properties
annotation_table
• annotation_table: string
Defined in src/TableAnnotation.ts:134
folder_table
• folder_table: string
Defined in src/TableAnnotation.ts:133
functional-usecases › "Vertex" › LabeledBoundingBoxModel
Interface: LabeledBoundingBoxModel
Hierarchy
object
↳ LabeledBoundingBoxModel
Index
Properties
Properties
columns
• columns: LineModel[]
Defined in src/Vertex.ts:13
rows
• rows: LineModel[]
Defined in src/Vertex.ts:12
functional-usecases › "Vertex" › LineModel
Interface: LineModel
Hierarchy
- LineModel
Index
Properties
Properties
end
• end: Vertex
Defined in src/Vertex.ts:7
start
• start: Vertex
Defined in src/Vertex.ts:6
Modules
functional-usecases › "CloudStorage"
Module: "CloudStorage"
Index
Type aliases
Variables
Functions
- getListFilesOptionsFromFolder
- getObjectFromBuffer
- getPathFromReference
- storeFileModelToStorage
- toFilename
Type aliases
FileModel
Ƭ FileModel: Model & Reference
Defined in src/CloudStorage.ts:14
Variables
Const
fromFilename
• fromFilename: function = replace( //output.json$/, '' )
Defined in src/CloudStorage.ts:29
fromFilename :: String -> String
Type declaration:
▸ (filename
: string): string
Parameters:
Name | Type |
------ | ------ |
filename
| string |
Const
getBufferFromModel
• getBufferFromModel: function = pipe( JSON.stringify, Buffer.from )
Defined in src/CloudStorage.ts:61
getBufferFromModel :: Model -> Buffer
Type declaration:
▸ ‹A›(model
: A): Buffer
Type parameters:
▪ A: Model
Parameters:
Name | Type |
------ | ------ |
model
| A |
Const
getNameFromFile
• getNameFromFile: function = prop('name')
Defined in src/CloudStorage.ts:85
getNameFromFile :: File -> String
Type declaration:
▸ (file
: File): string
Parameters:
Name | Type |
------ | ------ |
file
| File |
Functions
Const
getListFilesOptionsFromFolder
▸ getListFilesOptionsFromFolder(folder
: string): object
Defined in src/CloudStorage.ts:94
getListFilesOptionsFromFolder :: File -> String
Parameters:
Name | Type |
------ | ------ |
folder
| string |
Returns: object
- prefix: string =
${folder}/
Const
getObjectFromBuffer
▸ getObjectFromBuffer(buffer
: Buffer‹›): any
Defined in src/CloudStorage.ts:53
getObjectFromBuffer :: Buffer -> Object
Parameters:
Name | Type |
------ | ------ |
buffer
| Buffer‹› |
Returns: any
Const
getPathFromReference
▸ getPathFromReference(bucket
: string): (Anonymous function)
Defined in src/CloudStorage.ts:41
getPathFromReference :: String -> Reader Reference Path
Parameters:
Name | Type |
------ | ------ |
bucket
| string |
Returns: (Anonymous function)
Const
storeFileModelToStorage
▸ storeFileModelToStorage(storage
: Storage‹›): (Anonymous function)
Defined in src/CloudStorage.ts:73
storeFileModelToStorage :: Storage -> Reader String (ReaderTaskEither Reference File Error)
Parameters:
Name | Type |
------ | ------ |
storage
| Storage‹› |
Returns: (Anonymous function)
Const
toFilename
▸ toFilename(file
: string): string
Defined in src/CloudStorage.ts:21
toFilename :: String -> String
Parameters:
Name | Type |
------ | ------ |
file
| string |
Returns: string
functional-usecases › "Comparable"
Module: "Comparable"
Index
Interfaces
Functions
Functions
Const
listComparablesInStorage
▸ listComparablesInStorage(storage
: Storage‹›): function
Defined in src/Comparable.ts:141
Parameters:
Name | Type |
------ | ------ |
storage
| Storage‹› |
Returns: function
▸ (x
: V0): T3
Parameters:
Name | Type |
------ | ------ |
x
| V0 |
Const
processComparablesInStorage
▸ processComparablesInStorage‹A›(predicate
: function, makeComparables
: MakeComparables‹A›): (Anonymous function)
Defined in src/Comparable.ts:69
Type parameters:
▪ A: Annotation
Parameters:
▪ predicate: function
▸ (a
: unknown): a is A
Parameters:
Name | Type |
------ | ------ |
a
| unknown |
▪ makeComparables: MakeComparables‹A›
Returns: (Anonymous function)
functional-usecases › "ComparableSchema"
Module: "ComparableSchema"
Index
Variables
Variables
Const
fromModel
• fromModel: function = E.fromPredicate( Serialized.isComparableSchema, () => new Error('Model is not a comparableSchema.') )
Defined in src/ComparableSchema.ts:11
Type declaration:
▸ (model
: Model): E.Either‹Error, ComparableSchema›
Parameters:
Name | Type |
------ | ------ |
model
| Model |
Const
toModel
• toModel: function = Serialized.serialize
Defined in src/ComparableSchema.ts:7
Type declaration:
▸ (comparableSchema
: ComparableSchema): Model
Parameters:
Name | Type |
------ | ------ |
comparableSchema
| ComparableSchema |
Module: "File"
Index
Variables
- fromIO
- getBufferFrom
- getBuffersInFolder
- getFileNameFromPath
- getFileNamesInFolder
- getFilePathsInFolder
- getFolderNameFromPath
- saveBufferTo
Functions
Variables
Const
fromIO
• fromIO: function = partialRight(IOE.tryCatch, [E.toError])
Defined in src/File.ts:23
Type declaration:
▸ ‹A›(io
: IO‹A›): IOEither‹Error, A›
Type parameters:
▪ A
Parameters:
Name | Type |
------ | ------ |
io
| IO‹A› |
Const
getBufferFrom
• getBufferFrom: function = pipe(getBufferFromIO, fromIO)
Defined in src/File.ts:51
Type declaration:
▸ (path
: string): IOEither‹Error, Buffer›
Parameters:
Name | Type |
------ | ------ |
path
| string |
Const
getBuffersInFolder
• getBuffersInFolder: function = pipe( getFilePathsInFolder, IOE.chain(pipe(map(getBufferFrom), array.sequence(IOE.ioEither))) )
Defined in src/File.ts:74
Type declaration:
▸ (folder
: string): IOEither‹Error, Buffer[]›
Parameters:
Name | Type |
------ | ------ |
folder
| string |
Const
getFileNameFromPath
• getFileNameFromPath: function = pipe( split('/'), last as R.Reader<string[], string> )
Defined in src/File.ts:82
Type declaration:
▸ (path
: string): string
Parameters:
Name | Type |
------ | ------ |
path
| string |
Const
getFileNamesInFolder
• getFileNamesInFolder: function = pipe(getFilenamesInFolderIO, fromIO)
Defined in src/File.ts:61
Type declaration:
▸ (folder
: string): IOEither‹Error, string[]›
Parameters:
Name | Type |
------ | ------ |
folder
| string |
Const
getFilePathsInFolder
• getFilePathsInFolder: function = converge(call, [ pipe(identity, concat, map, IOE.map), getFileNamesInFolder, ])
Defined in src/File.ts:66
Type declaration:
▸ (folder
: string): IOEither‹Error, string[]›
Parameters:
Name | Type |
------ | ------ |
folder
| string |
Const
getFolderNameFromPath
• getFolderNameFromPath: function = pipe( split('/'), dropLast(1), join('/'), flip(concat)('/') )
Defined in src/File.ts:88
Type declaration:
▸ (path
: string): string
Parameters:
Name | Type |
------ | ------ |
path
| string |
Const
saveBufferTo
• saveBufferTo: function = pipe( saveBufferToIO, R.map(fromIO) )
Defined in src/File.ts:38
Type declaration:
▸ (path
: string): Reader‹Buffer, IOEither‹Error, string››
Parameters:
Name | Type |
------ | ------ |
path
| string |
Functions
Const
getBufferFromIO
▸ getBufferFromIO(path
: string): (Anonymous function)
Defined in src/File.ts:46
Parameters:
Name | Type |
------ | ------ |
path
| string |
Returns: (Anonymous function)
Const
saveBufferToIO
▸ saveBufferToIO(path
: string): (Anonymous function)
Defined in src/File.ts:30
Parameters:
Name | Type |
------ | ------ |
path
| string |
Returns: (Anonymous function)
functional-usecases › "Folder"
Module: "Folder"
Index
Type aliases
Variables
Functions
Type aliases
FoldersById
Ƭ FoldersById: Dictionary‹Folder›
Defined in src/Folder.ts:15
Variables
Const
getFoldersByIdInFirestore
• getFoldersByIdInFirestore: function = pipe( getFoldersInFirestore, RTE.map( reduce<Folder, FoldersById>( (acc, folder) => assoc(folder.id, folder, acc), {} ) ) )
Defined in src/Folder.ts:73
getFolderByIdInFirestore :: Firestore -> ReaderTaskEither String [Folder] Error
Type declaration:
▸ (firestore
: Firestore): ReaderTaskEither‹string, Error, FoldersById›
Parameters:
Name | Type |
------ | ------ |
firestore
| Firestore |
Const
getFoldersInFirestore
• getFoldersInFirestore: function = pipe( getModelsInFirestore, RTE.chainEitherK( E.fromPredicate( isArraySatisfying(isFolder), () => new Error('Models is not a Folder Array.') ) ) )
Defined in src/Folder.ts:56
getFoldersInFirestore :: Firestore -> ReaderTaskEither String [Folder] Error
Type declaration:
▸ (firestore
: Firestore): ReaderTaskEither‹string, Error, Folder[]›
Parameters:
Name | Type |
------ | ------ |
firestore
| Firestore |
Const
getModelFromReference
• getModelFromReference: function = pipe( getModelsFromReference, R.map( RTE.chainEitherK<Error, Model[], Model>( pipe( E.fromPredicate( pipe(isEmpty, not), () => new Error('Item does not exist.') ), E.map(head as R.Reader<Model[], Model>) ) ) ) )
Defined in src/Folder.ts:34
getModelFromReference :: Firestore -> Reader String (ReaderTaskEither Reference Model Error)
Type declaration:
▸ (firestore
: Firestore): Reader‹string, ReaderTaskEither‹Reference, Error, Model››
Parameters:
Name | Type |
------ | ------ |
firestore
| Firestore |
Functions
Const
getModelsFromReference
▸ getModelsFromReference(firestore
: Firestore‹›): (Anonymous function)
Defined in src/Folder.ts:24
getModelsFromReference :: Firestore -> Reader String (ReaderTaskEither Reference [Model] Error)
Parameters:
Name | Type |
------ | ------ |
firestore
| Firestore‹› |
Returns: (Anonymous function)
functional-usecases › "Handlers/GetEntitiesHandler"
Module: "Handlers/GetEntitiesHandler"
Index
Interfaces
functional-usecases › "Handlers/GetEntityHandler"
Module: "Handlers/GetEntityHandler"
Index
Interfaces
functional-usecases › "Handlers/GetFileInBucketsHandler"
Module: "Handlers/GetFileInBucketsHandler"
Index
Interfaces
functional-usecases › "Handlers/GetFileModelHandler"
Module: "Handlers/GetFileModelHandler"
Index
Interfaces
functional-usecases › "Handlers/index"
Module: "Handlers/index"
Index
References
- Callables
- Request
- RequestHandler
- Storage
- isGetRequest
- isPostRequest
- makeGetEntitiesHandler
- makeGetEntityHandler
- makeGetFileInBucketsHandler
- makeGetFileModelHandler
- makeListEntitiesHandler
References
Callables
• Callables:
Request
• Request:
RequestHandler
• RequestHandler:
Storage
• Storage:
isGetRequest
• isGetRequest:
isPostRequest
• isPostRequest:
makeGetEntitiesHandler
• makeGetEntitiesHandler:
makeGetEntityHandler
• makeGetEntityHandler:
makeGetFileInBucketsHandler
• makeGetFileInBucketsHandler:
makeGetFileModelHandler
• makeGetFileModelHandler:
makeListEntitiesHandler
• makeListEntitiesHandler:
functional-usecases › "Handlers/ListEntitiesHandler"
Module: "Handlers/ListEntitiesHandler"
Index
Interfaces
functional-usecases › "Handlers/Request"
Module: "Handlers/Request"
Index
Interfaces
Type aliases
Variables
Type aliases
RequestHandler
Ƭ RequestHandler: function
Defined in src/Handlers/Request.ts:32
Type declaration:
▸ (request
: Request): Task‹Response‹Entity››
Parameters:
Name | Type |
------ | ------ |
request
| Request |
Variables
Const
isGetRequest
• isGetRequest: function = propSatisfies( equals('GET'), 'method' )
Defined in src/Handlers/Request.ts:12
Type declaration:
▸ (request
: Request): boolean
Parameters:
Name | Type |
------ | ------ |
request
| Request |
Const
isPostRequest
• isPostRequest: function = propSatisfies( equals('POST'), 'method' )
Defined in src/Handlers/Request.ts:17
Type declaration:
▸ (request
: Request): boolean
Parameters:
Name | Type |
------ | ------ |
request
| Request |
functional-usecases › "Schema"
Module: "Schema"
Index
Interfaces
Type aliases
Variables
Functions
Type aliases
SchemaInstance
Ƭ SchemaInstance: Schema | Schema
Defined in src/Schema.ts:31
SchemaReferencesByFileType
Ƭ SchemaReferencesByFileType: Record‹DocumentType, SchemaReference‹T›[]›
Defined in src/Schema.ts:38
Variables
Const
fromModel
• fromModel: function = pipe( E.fromPredicate(isDeserializable, () => new Error('Model is not a schema.')), E.map( evolve({ files: deserializeArray, }) as R.Reader<Deserializable, Model> ), E.chain( E.fromPredicate( Serialized.isSchema, () => new Error('Model is not a schema.') ) ) )
Defined in src/Schema.ts:118
Type declaration:
▸ (model
: Model): E.Either‹Error, Schema›
Parameters:
Name | Type |
------ | ------ |
model
| Model |
Const
fromSchemaReferenceByFileType
• fromSchemaReferenceByFileType: function = mapObjIndexed( map(fromSchemaReference) )
Defined in src/Schema.ts:96
Type declaration:
▸ (referencesByFileTypes
: SchemaReferencesByFileType): SchemaReferencesByFileType‹Schema›
Parameters:
Name | Type |
------ | ------ |
referencesByFileTypes
| SchemaReferencesByFileType |
Const
toModel
• toModel: function = pipe( Serialized.serialize, evolve({ files: serializeArray, }) as R.Reader<Serialized.Schema, Model> )
Defined in src/Schema.ts:110
Type declaration:
▸ (schema
: Schema): Model
Parameters:
Name | Type |
------ | ------ |
schema
| Schema |
Const
toSchemaReferencesByFileType
• toSchemaReferencesByFileType: function = pipe( mapObjIndexed( pipe(map(toSchemaReference), A.array.sequence(E.either)) ) as R.Reader< SchemaReferencesByFileType<Serialized.Schema>, Record<DocumentType, E.Either<Error, SchemaReference[]>>
, sequenceS(E.either) )
Defined in src/Schema.ts:83
Type declaration:
▸ (referencesByFileTypes
: SchemaReferencesByFileType‹Schema›): E.Either‹Error, SchemaReferencesByFileType›
Parameters:
Name | Type |
------ | ------ |
referencesByFileTypes
| SchemaReferencesByFileType‹Schema› |
Functions
Const
fromSchemaReference
▸ fromSchemaReference(__namedParameters
: object): SchemaReference‹Schema›
Defined in src/Schema.ts:70
Parameters:
▪ __namedParameters: object
Name | Type |
------ | ------ |
reference
| reference |
schema
| Schema |
Returns: SchemaReference‹Schema›
Const
isSchemaReference
▸ isSchemaReference(a
: unknown): a is SchemaReference
Defined in src/Schema.ts:51
Parameters:
Name | Type |
------ | ------ |
a
| unknown |
Returns: a is SchemaReference
Const
isSerializedSchemaReference
▸ isSerializedSchemaReference(a
: unknown): a is SchemaReference‹Schema›
Defined in src/Schema.ts:45
Parameters:
Name | Type |
------ | ------ |
a
| unknown |
Returns: a is SchemaReference‹Schema›
Const
toSchemaReference
▸ toSchemaReference(__namedParameters
: object): E.Either‹Error, SchemaReference›
Defined in src/Schema.ts:55
Parameters:
▪ __namedParameters: object
Name | Type |
------ | ------ |
reference
| reference |
serializedSchema
| Schema |
Returns: E.Either‹Error, SchemaReference›
functional-usecases › "StorageObject"
Module: "StorageObject"
Index
Variables
- getBufferFromCloudStorage
- getFileNameFromStorageObject
- getFolderNameFromPath
- getFolderNameFromStorageObject
- getPathFromStorageObject
Functions
Variables
Const
getBufferFromCloudStorage
• getBufferFromCloudStorage: function = pipe( getFileFromCloudStorage, RTE.fromReaderEither, RTE.chainTaskEitherK(getBufferFromFile) )
Defined in src/StorageObject.ts:52
getBufferFromCloudStorage :: CloudStorage -> ReaderTaskEither StorageObject Buffer Error
Type declaration:
▸ (storage
: CloudStorage): ReaderTaskEither‹StorageObject, Error, Buffer›
Parameters:
Name | Type |
------ | ------ |
storage
| CloudStorage |
Const
getFileNameFromStorageObject
• getFileNameFromStorageObject: function = pipe(getFolderNameFromStorageObject, concat)
Defined in src/StorageObject.ts:85
getFileNameFromStorageObject :: StorageObject -> Reader String String
Type declaration:
▸ (object
: StorageObject): Reader‹string, string›
Parameters:
Name | Type |
------ | ------ |
object
| StorageObject |
Const
getFolderNameFromPath
• getFolderNameFromPath: function = pipe( split('/'), dropLast(1), join('/') )
Defined in src/StorageObject.ts:65
getFolderNameFromPath :: String -> String
Type declaration:
▸ (path
: string): string
Parameters:
Name | Type |
------ | ------ |
path
| string |
Const
getFolderNameFromStorageObject
• getFolderNameFromStorageObject: function = pipe(prop<string, string>('name'), getFolderNameFromPath)
Defined in src/StorageObject.ts:76
getFolderNameFromStorageObject :: StorageObject -> String
Type declaration:
▸ (object
: StorageObject): string
Parameters:
Name | Type |
------ | ------ |
object
| StorageObject |
Const
getPathFromStorageObject
• getPathFromStorageObject: function = pipe( E.fromPredicate( allPass([has('bucket'), has('name')]), () => new Error('StorageObject missing properties "bucket" and "name".') ), E.map( (object: StorageObject): Path => ({ bucket: object.bucket, filename: object.name, }) ) )
Defined in src/StorageObject.ts:22
getPathFromStorageObject :: StorageObject -> Either Path Error
Type declaration:
▸ (object
: StorageObject): E.Either‹Error, Path›
Parameters:
Name | Type |
------ | ------ |
object
| StorageObject |
Functions
Const
getFileFromCloudStorage
▸ getFileFromCloudStorage(storage
: Storage‹›): function
Defined in src/StorageObject.ts:44
getFileFromCloudStorage :: CloudStorage -> ReaderTaskEither StorageObject File Error
Parameters:
Name | Type |
------ | ------ |
storage
| Storage‹› |
Returns: function
▸ (x0
: V0): T2
Parameters:
Name | Type |
------ | ------ |
x0
| V0 |
Const
getPathFromFilePath
▸ getPathFromFilePath(bucket
: string): (Anonymous function)
Defined in src/StorageObject.ts:94
getPathFromFilePath :: String -> Reader String Path
Parameters:
Name | Type |
------ | ------ |
bucket
| string |
Returns: (Anonymous function)
Const
getPathWithNameFromBucket
▸ getPathWithNameFromBucket(bucket
: string): function
Defined in src/StorageObject.ts:108
getPathWithNameFromBucket :: String -> Reader StorageObject (Reader String Path)
Parameters:
Name | Type |
------ | ------ |
bucket
| string |
Returns: function
▸ (x0
: V0): T2
Parameters:
Name | Type |
------ | ------ |
x0
| V0 |
functional-usecases › "TableAnnotation"
Module: "TableAnnotation"
Index
Interfaces
Type aliases
Variables
Functions
Type aliases
BoundingBoxesByPageModel
Ƭ BoundingBoxesByPageModel: Dictionary‹LabeledBoundingBoxModel›[]
Defined in src/TableAnnotation.ts:36
Variables
Const
fromModel
• fromModel: function = pipe( serialize, E.map(evolveModel), E.chain( E.fromPredicate( isTableAnnotation, () => new Error('Model is not a TableAnnotation.') ) ), E.map(rejectsEmptyBoundingBoxes) )
Defined in src/TableAnnotation.ts:68
fromModel :: Model -> Either Folder Error
Type declaration:
▸ (model
: Model): E.Either‹Error, TableAnnotation›
Parameters:
Name | Type |
------ | ------ |
model
| Model |
Const
getDefaultModelFromReference
• getDefaultModelFromReference: function = pipe( getModelFromReference, R.map( pipe( RTE.fold<Reference, Error, Model, Model>( () => getDefaultFromReference, RT.of ), RTE.rightReaderTask ) ) )
Defined in src/TableAnnotation.ts:104
getDefaultModelFromReference :: Firestore -> Reader String (ReaderTaskEither Reference Model Error)
Type declaration:
▸ (firestore
: Firestore): Reader‹string, ReaderTaskEither‹Reference, Error, Model››
Parameters:
Name | Type |
------ | ------ |
firestore
| Firestore |
Const
getTableAnnotationsInFirestore
• getTableAnnotationsInFirestore: function = pipe( getModelsInFirestore ) as ( firestore: Firestore ) => RTE.ReaderTaskEither<string, Error, TableAnnotation[]>
Defined in src/TableAnnotation.ts:124
getTableAnnotationsInFirestore :: Firestore -> ReaderTaskEither String [TableAnnotation] Error
Type declaration:
▸ (firestore
: Firestore): ReaderTaskEither‹string, Error, TableAnnotation[]›
Parameters:
Name | Type |
------ | ------ |
firestore
| Firestore |
Const
toTableAnnotationModel
• toTableAnnotationModel: function = evolve({ boundingBoxesByPage: map(map(toLabeledBoundingBoxModel)), }) as (annotation: TableAnnotation) => TableAnnotationModel
Defined in src/TableAnnotation.ts:57
toTableAnnotationModel :: TableAnnotation -> TableAnnotationModel
Type declaration:
▸ (annotation
: TableAnnotation): TableAnnotationModel
Parameters:
Name | Type |
------ | ------ |
annotation
| TableAnnotation |
Functions
Const
getDefaultFromReference
▸ getDefaultFromReference(reference
: Reference): Task‹TableAnnotationModel›
Defined in src/TableAnnotation.ts:89
getDefaultFromReference :: Reference -> TaskEither Model Never
Parameters:
Name | Type |
------ | ------ |
reference
| Reference |
Returns: Task‹TableAnnotationModel›
Const
getTableAnnotationsInActiveOfflineFolders
▸ getTableAnnotationsInActiveOfflineFolders(tables
: Tables): function
Defined in src/TableAnnotation.ts:144
getTableAnnotationsInActiveOfflineFolders :: Storage -> TaskEither [TableAnnotation] Error
Parameters:
Name | Type |
------ | ------ |
tables
| Tables |
Returns: function
▸ (x0
: V0): T2
Parameters:
Name | Type |
------ | ------ |
x0
| V0 |
functional-usecases › "Vertex"
Module: "Vertex"
Index
Interfaces
Variables
Functions
Variables
Const
fromLabeledBoundingBoxModel
• fromLabeledBoundingBoxModel: function = evolve({ rows: map(fromLineModel), columns: map(fromLineModel), })
Defined in src/Vertex.ts:53
fromLabeledBoundingBoxModel :: LabeledBoundingBoxModel -> LabeledBoundingBox
Type declaration:
▸ (boundingBoxModel
: LabeledBoundingBoxModel): LabeledBoundingBox
Parameters:
Name | Type |
------ | ------ |
boundingBoxModel
| LabeledBoundingBoxModel |
Const
toLabeledBoundingBoxModel
• toLabeledBoundingBoxModel: function = evolve({ rows: map(toLineModel), columns: map(toLineModel), })
Defined in src/Vertex.ts:41
toLabeledBoundingBoxModel :: LabeledBoundingBox -> LabeledBoundingBoxModel
Type declaration:
▸ (boundingBox
: LabeledBoundingBox): LabeledBoundingBoxModel
Parameters:
Name | Type |
------ | ------ |
boundingBox
| LabeledBoundingBox |
Const
toLineModel
• toLineModel: function = applySpec({ start: head as R.Reader<Line, Vertex>, end: last as R.Reader<Line, Vertex>, })
Defined in src/Vertex.ts:21
toLineModel :: Line -> LineModel
Type declaration:
▸ (line
: Line): LineModel
Parameters:
Name | Type |
------ | ------ |
line
| Line |
Functions
Const
fromLineModel
▸ fromLineModel(__namedParameters
: object): [Vertex, Vertex]
Defined in src/Vertex.ts:31
fromLineModel :: LineModel -> Line
Parameters:
▪ __namedParameters: object
Name | Type |
------ | ------ |
end
| Vertex |
start
| Vertex |
Returns: [Vertex, Vertex]