
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Firestore library for TypeScript
yarn add firebase firebase-admin bluespark
import firebase, { firestore } from 'firebase/app'
import 'firebase/firestore'
import { Blue, Spark } from 'bluespark'
const app = firebase.initializeApp({
apiKey: '### FIREBASE API KEY ###',
authDomain: '### FIREBASE AUTH DOMAIN ###',
projectId: '### CLOUD FIRESTORE PROJECT ID ###',
})
const dbInstance = app.firestore()
const createCollections = <F extends Blue.Firestore>(instance: F) => {
type C = ReturnType<F['collection']>
type Q = ReturnType<F['collectionGroup']>
return {
posts: () => instance.collection('posts') as C,
}
}
const collection = createCollections(dbInstance)
// const collectionAdmin = createCollections(dbInstanceAdmin)
type IPost = Blue.Interface<{
number: number
date: Blue.IO<Blue.Timestamp, Date | Blue.FieldValue>
text: string
tags: string[]
}>
const Post = Spark<IPost>()
const post = await Post.getDoc(collection.posts().doc('doc-id'))
// with React Hooks
const { data: post, loading, error } = useSDoc(
Post,
collection.posts().doc('doc-id'),
)
// passes
expectType<{
_createdAt: Blue.Timestamp
_updatedAt: Blue.Timestamp
_id: string
_ref: Blue.DocRef
number: number
date: Blue.Timestamp
text: string
tags: string[]
}>(post!)
const { array, map } = await Post.getCollection(collection.posts())
// with React Hooks
const { array, map, query, loading, error } = useSCollection(
Post,
collection.posts(),
)
// passes
expectType<{
_createdAt: Blue.Timestamp
_updatedAt: Blue.Timestamp
_id: string
_ref: Blue.DocRef
number: number
date: Blue.Timestamp
text: string
tags: string[]
}>(array[0])
// passes
expectType<{
_createdAt: Blue.Timestamp
_updatedAt: Blue.Timestamp
_id: string
_ref: Blue.DocRef
number: number
date: Blue.Timestamp
text: string
tags: string[]
}>(map.get('doc-id')!)
await Post.create(collection.posts().doc('doc-id'), {
number: 17,
date: firestore.FieldValue.serverTimestamp(), // Date | Blue.FieldValue
text: 'text',
tags: ['a', 'b'],
})
await Post.update(collection.posts().doc('doc-id'), {
text: 'new-text',
})
FAQs
> Firestore library for TypeScript
We found that bluespark demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.