Socket
Socket
Sign inDemoInstall

@cloudcommerce/firebase

Package Overview
Dependencies
Maintainers
1
Versions
373
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudcommerce/firebase - npm Package Compare versions

Comparing version 0.0.36 to 0.0.37

5

lib/handlers/check-store-events.js

@@ -1,2 +0,3 @@

import { firestore } from 'firebase-admin';
// eslint-disable-next-line import/no-unresolved
import { getFirestore } from 'firebase-admin/firestore';
import { logger } from 'firebase-functions';

@@ -8,3 +9,3 @@ import api from '@cloudcommerce/api';

const { authenticationId, apiKey } = getEnv();
const eventsSubs = await firestore().collection('eventsSubs').get();
const eventsSubs = await getFirestore().collection('eventsSubs').get();
const listenedEvents = [];

@@ -11,0 +12,0 @@ eventsSubs.forEach((doc) => {

2

lib/index.d.ts
import 'source-map-support/register.js';
import '@cloudcommerce/api/fetch-polyfill.js';
export declare const z: import("firebase-functions/v2/https").HttpsFunction;
export declare const ssr: import("firebase-functions/v2/https").HttpsFunction;
export declare const cronStoreEvents: import("firebase-functions/v1").CloudFunction<unknown>;

@@ -0,36 +1,12 @@

/* eslint-disable import/prefer-default-export */
import 'source-map-support/register.js';
import '@cloudcommerce/api/fetch-polyfill.js';
import { initializeApp } from 'firebase-admin';
import { pubsub, logger } from 'firebase-functions';
// https://github.com/import-js/eslint-plugin-import/issues/1810
// eslint-disable-next-line import/no-unresolved
import { onRequest } from 'firebase-functions/v2/https';
import config from './config.js';
import { initializeApp } from 'firebase-admin/app';
import { pubsub } from 'firebase-functions';
import checkStoreEvents from './handlers/check-store-events.js';
initializeApp();
const processId = String(Date.now());
const options = config.get().httpsFunctionOptions;
export const z = onRequest(options, ({ url }, response) => {
process.env.ECOM_API_KEY = '***';
if (url === '/hello') {
logger.info('Hello logs!', {
structuredData: true,
});
response.send(config.get().hello);
return;
}
if (url === '/pid') {
response.send(processId);
return;
}
response.send({
config: config.get(),
});
});
export const ssr = onRequest(options, (request, response) => {
response.send('<h1>Hello SSR!</h1>');
});
export const cronStoreEvents = pubsub.schedule('* * * * *').onRun(() => {

@@ -37,0 +13,0 @@ return checkStoreEvents();

{
"name": "@cloudcommerce/firebase",
"type": "module",
"version": "0.0.36",
"version": "0.0.37",
"description": "E-Com Plus Cloud Commerce on Firebase",

@@ -24,3 +24,3 @@ "main": "lib/index.js",

"dependencies": {
"@cloudcommerce/api": "0.0.36",
"@cloudcommerce/api": "0.0.37",
"@fastify/deepmerge": "^1.1.0",

@@ -33,3 +33,3 @@ "firebase-admin": "^11.0.0",

"devDependencies": {
"@cloudcommerce/types": "0.0.36",
"@cloudcommerce/types": "0.0.37",
"@firebase/app-types": "^0.7.0"

@@ -36,0 +36,0 @@ },

import type { EventSub } from '../types';
import { firestore } from 'firebase-admin';
// eslint-disable-next-line import/no-unresolved
import { getFirestore } from 'firebase-admin/firestore';
import { logger } from 'firebase-functions';

@@ -9,3 +10,3 @@ import api from '@cloudcommerce/api';

const { authenticationId, apiKey } = getEnv();
const eventsSubs = await firestore().collection('eventsSubs').get();
const eventsSubs = await getFirestore().collection('eventsSubs').get();
const listenedEvents: EventSub['event'][] = [];

@@ -12,0 +13,0 @@ eventsSubs.forEach((doc) => {

@@ -0,38 +1,15 @@

/* eslint-disable import/prefer-default-export */
import 'source-map-support/register.js';
import '@cloudcommerce/api/fetch-polyfill.js';
import { initializeApp } from 'firebase-admin';
import { pubsub, logger } from 'firebase-functions';
// https://github.com/import-js/eslint-plugin-import/issues/1810
// eslint-disable-next-line import/no-unresolved
import { onRequest } from 'firebase-functions/v2/https';
import config from './config';
import { initializeApp } from 'firebase-admin/app';
import { pubsub } from 'firebase-functions';
import checkStoreEvents from './handlers/check-store-events';
initializeApp();
const processId = String(Date.now());
const options = config.get().httpsFunctionOptions;
export const z = onRequest(options, ({ url }, response) => {
process.env.ECOM_API_KEY = '***';
if (url === '/hello') {
logger.info('Hello logs!', {
structuredData: true,
});
response.send(config.get().hello);
return;
}
if (url === '/pid') {
response.send(processId);
return;
}
response.send({
config: config.get(),
});
});
export const ssr = onRequest(options, (request, response) => {
response.send('<h1>Hello SSR!</h1>');
});
export const cronStoreEvents = pubsub.schedule('* * * * *').onRun(() => {
return checkStoreEvents();
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc