Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { https } from 'firebase-functions';
// import serveAuth from './serveAuth';
import serveMainPage from './serveMainPage';
import serveNpmPackageFile from './serveNpmPackageFile';
import servePublicKey from './servePublicKey';
import serveStats from './serveStats';
export default {
// serveAuth: https.onRequest(serveAuth),
serveMainPage: https.onRequest(serveMainPage),
serveNpmPackageFile: https.onRequest(serveNpmPackageFile),
servePublicKey: https.onRequest(servePublicKey),
serveStats: https.onRequest(serveStats)
};
import { https } from 'firebase-functions';
// import serveAuth from './serveAuth';
import serveMainPage from './serveMainPage';
import serveNpmPackageFile from './serveNpmPackageFile';
import servePublicKey from './servePublicKey';
import serveStats from './serveStats';
export default {
// serveAuth: https.onRequest(serveAuth),
serveMainPage: https.onRequest(serveMainPage),
serveNpmPackageFile: https.onRequest(serveNpmPackageFile),
servePublicKey: https.onRequest(servePublicKey),
serveStats: https.onRequest(serveStats)
};
import { https } from 'firebase-functions';
// import serveAuth from './serveAuth';
import serveMainPage from './serveMainPage';
import serveNpmPackageFile from './serveNpmPackageFile';
import servePublicKey from './servePublicKey';
import serveStats from './serveStats';
export default {
// serveAuth: https.onRequest(serveAuth),
serveMainPage: https.onRequest(serveMainPage),
serveNpmPackageFile: https.onRequest(serveNpmPackageFile),
servePublicKey: https.onRequest(servePublicKey),
serveStats: https.onRequest(serveStats)
};
import { https } from 'firebase-functions';
// import serveAuth from './serveAuth';
import serveMainPage from './serveMainPage';
import serveNpmPackageFile from './serveNpmPackageFile';
import servePublicKey from './servePublicKey';
import serveStats from './serveStats';
export default {
// serveAuth: https.onRequest(serveAuth),
serveMainPage: https.onRequest(serveMainPage),
serveNpmPackageFile: https.onRequest(serveNpmPackageFile),
servePublicKey: https.onRequest(servePublicKey),
serveStats: https.onRequest(serveStats)
};
import { https } from "firebase-functions"
import setupGraphQLServer from "./graphql/server"
/* CF for Firebase with graphql-server-express */
const graphQLServer = setupGraphQLServer()
// https://us-central1-.cloudfunctions.net/api
export const api = https.onRequest(graphQLServer)
import {https, Request, config} from 'firebase-functions';
import {initializeApp, credential} from 'firebase-admin';
import { push } from './routes/push';
import { register } from './routes/register';
import cors from 'cors';
import * as serviceAccount from "./service-account.json";
const adminConfig = JSON.parse(process.env.FIREBASE_CONFIG);
adminConfig.credential = credential.cert(serviceAccount as any);
initializeApp(adminConfig);
exports.push = https.onRequest(async (req: Request, res) => {
cors()(req, res, () => {});
if (req.method.toUpperCase() === "OPTIONS") {
return res;
}
let response: IResponse = {
code: 404,
success: false,
errorMessage: 'Error: Operation not supported'
};
if (req.method.toUpperCase() === "POST") {
switch (req.params[0]) {
case "/":
response = await push(req);
break;
import {https} from 'firebase-functions';
import {verifyToken} from './jwt/verify-token';
import {setGithubStatus} from './github/github-status';
export const payloadGithubStatus = https.onRequest(async (request, response) => {
const authToken = request.header('auth-token');
const commitSha = request.header('commit-sha');
const packageName = request.header('package-name');
const packageSize = parseFloat(request.header('package-full-size') || '');
const packageDiff = parseFloat(request.header('package-size-diff') || '');
if (!authToken || !verifyToken(authToken)) {
return response.status(403).json({message: 'Auth token is not valid'});
}
if (!commitSha) {
return response.status(404).json({message: 'No commit has been specified'});
}
if (isNaN(packageDiff)) {
return response.status(400).json({message: 'No valid package difference has been specified.'});