![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@2bad/bitrix
Advanced tools
Bitrix24 REST API client that doesn't suck
Some testing examples:
import Bitrix from './bitrix'
import { Method } from './bitrix/types'
const BITRIX_ADDRESS = 'https://DOMAIN.bitrix24.ru'
const AUTH_TOKEN = 'AUTH_TOKEN'
const bitrix = Bitrix(`${BITRIX_ADDRESS}/rest`, AUTH_TOKEN)
// ----------------------
// Common methods
// ----------------------
bitrix.get(Method.GET_DEAL, { query: { ID: 3357 } })
.then(console.log)
.catch(console.error)
// Error example
bitrix.get(Method.GET_DEAL, { query: { ID: 9999999999999 } })
.then(console.log)
.catch(console.error)
// Get first 50
bitrix.getList(Method.LIST_DEALS, {})
.then(console.log)
.catch(console.error)
// ----------------------
// API
// ----------------------
// Get deal
bitrix.deals.get({ ID: 25 })
.then(console.log)
.catch(console.error)
// Get all deals
bitrix.deals.list({ select: ["*", "UF_*"] })
.then(console.log)
.catch(console.error)
Is it finished?
Not yet. However, what's in the docs already works, and not yet covered Bitrix operations can be done with a provided low-level client methods.
Does it handle authentication?
Not yet. You have to init client with already obtained by any legal means authentication token.
Should I check payloads
error
properties for errors?
You shouldn't. Catch rejections instead, as the library will check it and reject if there are any errors in a payload.
I need to call a Bitrix method which isn't supported yet
Use appropriate provided low-level client methods, like that:
bitrix.get<SomeNewMethodType>('some.new.get.method' as any, { ID: 77 })
bitrix.list<SomeNewMethodType>('some.new.list.method' as any, { select: ["TITLE"] })
I need to call a specific set of commands. How to do that effectively?
Use low-level batch
method. It will make minimum network requests and do all dirty work behind the curtains:
bitrix.batch<{
lead: Lead,
deals: Deal[]
}>({
lead: { method: Method.GET_LEAD, params: { ID: 77 } },
deals: { method: Method.LIST_DEALS }
})
npm test
— run all testsnpm run test:unit
— run unit testsnpm run test:integration
— run integration testsnpm run test:watch
— watch for changes and run all testsnpm run test:unit:watch
— watch for changes and run unit testsnpm run test:integration:watch
— watch for changes and run integration testsnpm run build
— build library for the releaseFAQs
Bitrix24 REST API client that doesn't suck
The npm package @2bad/bitrix receives a total of 0 weekly downloads. As such, @2bad/bitrix popularity was classified as not popular.
We found that @2bad/bitrix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.