Skip to content

onStorageObjectArchive, onStorageObjectDelete, onStorageObjectFinalize, onStorageObjectMetadataUpdate

Franklin Chieze edited this page Oct 16, 2020 · 10 revisions
onStorageObjectArchive()
onStorageObjectDelete()
onStorageObjectFinalize()
onStorageObjectMetadataUpdate()

These decorators specify that a function should handle events for uploading, updating, or deleting of files and folders in Cloud Storage..

auxiliary decorators

bucket
bucket(bucketName: string)

This decorator specifies the name of the storage bucket.

example

import { func, bucket, onStorageObjectFinalize } from 'firefuncs';

export class StorageFunctions {
    @func()
    @bucket('bucket1')
    @onStorageObjectFinalize()
    public async logUploadedObjects(object) {
        console.log(`Object uploaded at filepath ${object.name}`);
    }
}