@cloudcommerce/firebase
Advanced tools
Comparing version 0.0.36 to 0.0.37
@@ -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) => { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
6
25198
257
+ Added@cloudcommerce/api@0.0.37(transitive)
- Removed@cloudcommerce/api@0.0.36(transitive)
Updated@cloudcommerce/api@0.0.37