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

node-dscrm

v1.0.6

Published

Node.js SDK 大盛 CRM,精致好用的 CRM 系统

Downloads

3

Readme

大盛 CRM SDK for Node.js Client

大盛 CRM,精致好用的 CRM 系统。

npm install -i node-dscrm

Usage

const Dscrm = require("node-dscrm");

const dscrm = new Dscrm("YOUR_SERVER_BASE_URL",
    {grant_type: "client_credentials",
    client_id: "YOUR_CLIENT_ID",
    client_secret: "YOUR_CLIENT_SECRET"},
    XDEBUG_SESSION_START)

其中,YOUR_SERVER_BASE_URL/YOUR_CLIENT_ID/YOUR_CLIENT_SECRET是实例 URL 地址,OAuth2 客户端认证 ID 和令牌,以上为必须参数XDEBUG_SESSION_START可选参数,作为 xdebug 调试用的 session,默认为 null 时 Server 不进行断点调试。

APIs

调用 API 有两种形式,一种是 SDK 已经实现了明确的方法名的;一种是 SDK 没有实现明确方法名,但是大盛 CRM 中已经有了 RestAPI 的。

明确方法名#getCurrentUser

let resp = await dscrm.getCurrentUser();

封装其他高级 API

command 是底层 API,用来提供更具灵活的 API 调用方式。

await dscrm.command(METHOD, PATH, BODY)

其中,METHOD 可以是 "GET", "POST", "PUT", "DELETE" 等;PATH是服务基础 URL 追加的部分,比如/Api/V8/user-preferences/1, 可以携带有params或queryString; BODY,发送请求的 JSON 数据。

示例

let ret = await dscrm.command("GET", "/Api/V8/user-preferences/1");

为明确的方法名使用参考 SuiteCRM/api/routes.php

返回值

不同 API 返回的结果都是一个 JSONObject,带有返回的数据。 如果请求出现异常,会抛出Error,建议用 Try/Catch 获取。

贡献

npm i
cp sample.env .env # edit .env with your credentials
npm test

开源许可协议

Copyright (2018-2021) 北京华夏春松科技有限公司

Apache License Version 2.0

chatoper banner