npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitrix-gds

v1.0.7

Published

Bitrix24 library made in TypeScript. Born to simplify bitrix api requests

Downloads

245

Readme

Bitrix GDS

A library that makes requests to Bitrix API much easier.

Installing

Package manager

Using npm:

$ npm install bitrix-gds

Using yarn:

$ yarn add bitrix-gds

Get Started

import Bitrix24 from 'bitrix-gds'

const bitrix24 = new Bitrix24(
  `https://YOUR_DOMAIN.bitrix24.{ru|com|de}/rest/{USER_ID}/{WEBHOOK_TOKEN}`
)

WEBHOOK_URL

Create a inbound webhook in your bitrix.

Copy and Paste the endpoint given by bitrix, as a param in Bitrix24 new instance.

Methods

Deals

Add

const { result } = await bitrix.deals.add({ 
  fields: {
    TITLE: 'John Doe'
  }
})

Params

  • fields - An object that specifies the parameter for a new deal (Not required)
  • params - Set of parameters. REGISTER_SONET_EVENT (Not required)

Get

const { result } = await bitrix.deals.get({ id: '00' })

Params

  • id - deal ID.

Delete

const { result } = await bitrix.deals.delete({ id: '00' })

Params

  • id - deal ID.

Fields

const { result } = await bitrix.deals.fields()

List

const { result } = await bitrix.deals.list({
  filter: {
    STAGE_ID: '00'
  },
  select: ['*']
})

Params

  • filter - Object of fields and values to filter deals. (Not required)
  • select - Array of fields IDs that will return with the request response (Not required)
  • order - Order the response 'ASC' or 'DESC' by fields. (Not required)
  • start - Start of the request. (Not required)

Update

const { result } = await bitrix.deals.get({ 
  id: '00',
  fields: {
    TITLE: 'John Doe'
  }
})

Params

  • fields - Object of fields to be update.
  • id - Deal ID.

Contact

Add

const { result } = await bitrix.contacts.add({ 
  fields: {
    NAME: 'John Doe'
  }
})

Params

  • fields - An object that specifies the parameter for a new contact (Not required)
  • params - Set of parameters. REGISTER_SONET_EVENT (Not required)

Get

const { result } = await bitrix.contacts.get({ id: '00' })

Params

  • id - Contact ID.

Delete

const { result } = await bitrix.contacts.delete({ id: '00' })

Params

  • id - Contact ID.

Fields

const { result } = await bitrix.contacts.fields()

List

const { result } = await bitrix.contacts.list({
  filter: {
    NAME: 'John Doe'
  },
  select: ['*']
})

Params

  • filter - Object of fields and values to filter deals. (Not required)
  • select - Array of fields IDs that will return with the request response (Not required)
  • order - Order the response 'ASC' or 'DESC' by fields. (Not required)
  • start - Start of the request. (Not required)

Update

const { result } = await bitrix.contacts.get({ 
  id: '00',
  fields: {
    NAME: 'John Doe'
  }
})

Params

  • fields - Object of fields to be update.
  • id - Contact ID.

Batch

const { result } = await bitrix.batch({ 
  req_1: {
    method: 'crm.deal.add',
    params: {
      fields: {
        TITLE: 'new deal'
      }
    }
  },
  req_2: {
    method: 'crm.contact.list',
    params: {
      select: ['*']
    }
  }
})