build/src/index.js
/**
     * Synchronously call a function.
     * @param {string} functionName The function to call.
     */
Synchronously call a function.
@param {string} functionName The function to call.
Synchronously call a function . @param { string } functionName The function to call .
async call(options) {
        this.emit(ProgressEvent.STARTING);
        const gcf = await this._getGCFClient();
        const projectId = await this._auth.getProjectId();
        const region = options.region || 'us-central1';
        const name = `projects/${projectId}/locations/${region}/function/${options.functionName}`;
        const fns = gcf.projects.locations.functions;
        this.emit(ProgressEvent.CALLING);
        const res = await fns.call({
            name,
            requestBody: {
                data: options.data,
            },
        });
        this.emit(ProgressEvent.COMPLETE);
        return res;
    }
async call ( options ) { this . emit ( ProgressEvent . STARTING ) ; const gcf = await this . _getGCFClient ( ) ; const projectId = await this . _auth . getProjectId ( ) ; const region = options . region || 'us-central1' ; const name = ` ${ projectId } ${ region } ${ options . functionName } ` ; const fns = gcf . projects . locations . functions ; this . emit ( ProgressEvent . CALLING ) ; const res = await fns . call ( { name , requestBody : { data : options . data , } , } ) ; this . emit ( ProgressEvent . COMPLETE ) ; return res ; }
Synchronously call a function.
Synchronously call a function .