Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "jobs"

Index

Variables

Const db

db: Firestore = admin.firestore()

firestore instance

Const jobRunner

jobRunner: Runnable<DocumentSnapshot> & TriggerAnnotated & function = functions// .region('europe-west1')// .runWith({ memory: '1GB', timeoutSeconds: 120 }).firestore.document('jobs/{jobId}')// tslint:disable-next-line:promise-function-async.onCreate((snap, context) => {console.log('jobRunner is started');const jobData = snap.data() as JobModel;let job: Promise<any>;if (jobData.actionKey === 'generateSiteMap') {job = generateSiteMap(snap, jobData);}if (jobData.actionKey === 'generateSEOData') {job = generateSEOData(snap, jobData);}if (jobData.actionKey === 'generateJsonLDs') {job = generateJsonLDs(snap, jobData);}if (jobData.actionKey === 'generateLocales') {job = generateLocales(snap, jobData);}if (jobData.actionKey === 'generateDescription') {job = generateDescription(snap, jobData);}if (jobData.actionKey === 'fixPublicFilesPermissions') {job = fixPublicFilesPermissions(snap, jobData);}if (jobData.actionKey === 'clearCaches') {job = clearCaches(snap, jobData);}if (job) {return job.then(value => {console.log(value);return value;}).catch(err => {console.error('functions.onCreate', err);return err;});}return Promise.resolve();})

job runner function

Functions

Const clearCaches

  • clearCaches(snap: DocumentSnapshot, jobData: JobModel): Promise<any>
  • clear caches

    Parameters

    • snap: DocumentSnapshot
    • jobData: JobModel

    Returns Promise<any>

Const fixPublicFilesPermissions

  • fixPublicFilesPermissions(snap: DocumentSnapshot, jobData: JobModel): Promise<any>
  • fix public files permissions on storage

    Parameters

    • snap: DocumentSnapshot
    • jobData: JobModel

    Returns Promise<any>

Const generateDescription

  • generateDescription(snap: DocumentSnapshot, jobData: JobModel): Promise<any>
  • generate description

    Parameters

    • snap: DocumentSnapshot
    • jobData: JobModel

    Returns Promise<any>

Const generateJsonLDs

  • generateJsonLDs(snap: DocumentSnapshot, jobData: JobModel): Promise<any>
  • generate JsonLD

    Parameters

    • snap: DocumentSnapshot
    • jobData: JobModel

    Returns Promise<any>

Const generateLocales

  • generateLocales(snap: DocumentSnapshot, jobData: JobModel): Promise<any>
  • generate locales

    Parameters

    • snap: DocumentSnapshot
    • jobData: JobModel

    Returns Promise<any>

Const generateSEOData

  • generateSEOData(snap: DocumentSnapshot, jobData: JobModel): Promise<any>
  • generate SEO data

    Parameters

    • snap: DocumentSnapshot
    • jobData: JobModel

    Returns Promise<any>

Const generateSiteMap

  • generateSiteMap(snap: DocumentSnapshot, jobData: JobModel): Promise<any>
  • generate site map

    Parameters

    • snap: DocumentSnapshot
    • jobData: JobModel

    Returns Promise<any>

Generated using TypeDoc