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

zhike-crm-entrance

v2.1.4

Published

import client to crm system

Downloads

18

Readme

SmartStudy CRM client information entrance

simple demo

var Entrance = require('./index');
var co = require('co');

var config = {
  mq: {
    aliMns: {
      accountId: '1922933588405985',
      accessKeyId: 'LTAIU8AfwMXFnHPT',
      accessKeySecret: 'xX5bWiZCZ8xlLiGxJFSHU5S5NVO4Uu',
      dataQueue: {
        name: 'test',
        region: 'beijing',
      },
    },
  }
}

/////////////////////////////////////// message producer /////////////////////////////////////
var Entrance = require('./index');
var co = require('co');
var entrance = new Entrance(
  config.mq.aliMns.accountId,
  config.mq.aliMns.accessKeyId,
  config.mq.aliMns.accessKeySecret,
  config.mq.aliMns.dataQueue.name,
  config.mq.aliMns.dataQueue.region, {
  onError: function (err) {
    console.log(err.stack);
  }
});

co(function*() {
  yield entrance.send({aa: 'you'}, {});
}).then(success => {
  console.log('send success')
}, err => console.log(err.stack));

API

  • Constructor

    • accountId required
    • accessKeyId required
    • accessKeySecret required
    • queueName required
    • queueRegion required
    • params.onError
  • send

  • data client infomation required

  • req http request object

data详解 (*号为新加字段)

key |类型 |说明 -------------|-------------|-------------- marketActivityId | int | 市场活动id username | string | 学生姓名(默认:同学) studyIntention | string | 学习意向 referrer | string | 推荐人 province | string | 省 city | string | 城市 importRemark | text | 导入备注 comment | text | 备注 phone | string | 学生手机 userId | int | 用户在用户系统中的id siteId | int | 站点ID,可通过 zhike-crm-entrance 的 npm 包从 cookie 中读出并自动添加上 hmsrId | int | 渠道ID,可通过 zhike-crm-entrance 的 npm 包从 cookie 中读出并自动添加上 hmplId | int | 计划ID,可通过 zhike-crm-entrance 的 npm 包从 cookie 中读出并自动添加上 hmmdId | int | 媒介ID,可通过 zhike-crm-entrance 的 npm 包从 cookie 中读出并自动添加上 hmciId | int | 创意ID,可通过 zhike-crm-entrance 的 npm 包从 cookie 中读出并自动添加上 hmkwId | int | 关键词ID,可通过 zhike-crm-entrance 的 npm 包从 cookie 中读出并自动添加上 remark | string | 备注(在学生的备注字段追加的数据,而非生成学员的时候的备注信息) experienceCourseAppointmentAt | string | 预约体验课时间,为ISO 8601格式的string类型,Date类型JSON.stringify后自动会转换成此格式 experienceCourseType | int | 预约体验课类型,1为线上体验课,2为线下体验课 extension | string | 附加字段,为JSON格式的字符串

如果存在extension字段,则extension中的数据都会扩展到最外层,形如: var finalData = Object.assign({}, JSON.parse(data.extension), data);

其中,服务前置化的extension中,必须带有预约体验课的时间和预约体验课类型字段(也可以在顶层字段中设置):

key |类型 |说明 -------------|-------------|-------------- experienceCourseAppointmentAt | string | 预约体验课时间,为ISO 8601格式的string类型,Date类型JSON.stringify后自动会转换成此格式 experienceCourseType | int | 预约体验课类型,1为线上体验课,2为线下体验课

示例:

{
  "phone": "18800002222",
  "siteId": 0,
  "hmsrId": 12,
  "hmplId": 156,
  "hmmdId": 0,
  "hmciId": 0,
  "hmkwId": 0,
  "extension":"{\"experienceCourse\":\"2016-12-05T11:47:00.559Z\",\"experienceCourseType\":1}"
}

必填字段:

  1. 服务前置化: phone, experienceCourseAppointmentAt, experienceCourseType

  2. 自然流量导入: phone, userId

  3. 在学员的备注中追加信息(移动端的需求) phone, userId, remark

  4. 其他导入数据 phone

Run Tests

npm test