
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@ircam/timeside-sdk
Advanced tools
Timeside API: https://github.com/Ircam-WAM/TimeSide
Features :
npm install --save @ircam/timeside-sdk
# If you need to polyfill Fetch (for Node / older browsers), you may use
npm install --save cross-fetch
This SDK is generated from the OpenAPI Schema of available here.
import crossFetch from 'cross-fetch'
import formDataNode from 'formdata-node'
import {
TimesideApi,
ServerSideConfiguration
} from '@ircam/timeside-sdk'
// Polyfill FormData because SDK use `new FormData` which is not available in Node.
// @ts-ignore
global.FormData = formDataNode
const api = new TimesideApi(ServerSideConfiguration({
// Use sandbox endpoint
basePath: 'https://sandbox.wasabi.telemeta.org',
// Credentials (get from environment)
username: process.env.TIMESIDE_API_USER,
password: process.env.TIMESIDE_API_PASS,
// Ponyfill fetchApi
fetchApi: crossFetch
}))
Initialize a raw client to make raw calls (login, refreshToken etc..).
import {
TimesideApi,
Configuration,
AutoRefreshConfiguration,
LocalStorageJWTToken,
JWTToken
} from '@ircam/timeside-sdk'
const urlConfig = {
basePath: 'https://sandbox.wasabi.telemeta.org'
}
// rawApi is the the api without jwt middlewares
// Use it for login or routes where you don't need authentication
const rawApi = new TimesideApi(new Configuration(urlConfig))
Init a persistent token to save it to browser's local storage.
By default, the token is saved in the 'timeside-api-token' local storage's key. You can provide an string parameter to LocalStorageJWTToken
constructor to change it.
// This helper saves the JWTToken to window.localStorage
// You may also implements your own way of storing your Token
// by implementing the PersistentJWTToken interface
const persistentToken = new LocalStorageJWTToken()
// Check if a token already exist and parse it
persistentToken.init()
// Configuration to auto-refresh access token when expired
const config = AutoRefreshConfiguration(urlConfig, persistentToken)
const api = new TimesideApi(new Configuration(config))
Login and save the JWT Token
async function login (username, password) {
const tokenObtainPair = { username, password }
const token = await rawApi.createTokenObtainPair({ tokenObtainPair })
persistentToken.token = JWTToken.fromBase64(token.access, token.refresh)
}
async function callApi () {
// List items
const items = await api.listItems({})
console.log(items)
const itemUuid = items[0].uuid
// Get the item's Waveform
const waveform = await api.retrieveItemWaveform({ uuid: itemUuid })
console.log(waveform)
// Create an item
const item = {
title: 'Unknown Song',
description: 'Some great song!'
}
const item = await api.createItem({ body })
console.log(item)
// And get/create :
// Annotations, Analysis, AnalysisResult,
// Transcode, Visualization (like Spectrogram) etc..
// ...
}
If you are looking for some implementation examples, here's a list of project that uses this SDK.
Timeside Player uses this SDK to provide a player from Timeside API.
You may be interested in the src/utils/api.ts
file
Timeside Scripts host Node.JS scripts.
FAQs
OpenAPI client for timeside
We found that @ircam/timeside-sdk 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.