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

c3-client

v1.0.1

Published

rpcClient 配套API

Downloads

1

Readme

c3-client

这是用于rpcMehod调用的客户端类

依赖

{
    "rpc-websockets": "^7.4.16",
    "c3-util": "^1.0.0",
  }

RpcClient类

用于启动ws Client连接,这个类必须优先调用否则后面的rpcMethod相关类无法调用

  • 方法
import { RpcClient } from 'c3-client'
//启动
RpcClient.start('ws://127.0.0.1:11000')
//关闭
RpcClient.close()

RpcSoaService类

调用soa相关服务类

  • example
import {RpcClient, RpcSoaService} from '../src'
import TestUtil from './TestUtil'
test('soaService test',async ()=>{
    RpcClient.start('ws://192.168.0.17:11000')
    await TestUtil.sleep(1000)
    //imrCheck
    let c3ImrCheckResp=await RpcSoaService.c3ImrCheck('18959130026','WINDOES')
    expect(c3ImrCheckResp.success()).toBe(true)
    const phoneNbrOption=c3ImrCheckResp.getFirstTableColumnValue('phone_nbr')
    expect(phoneNbrOption.isPresent()).toBe(true)
    expect(phoneNbrOption.get()).toBe('18959130026')
    //checkServer
    const checkServerTest=await RpcSoaService.checkServerTest('192.168.0.17',8080)
    expect(checkServerTest.success()).toBe(true)
    const firstTableOption=checkServerTest.getFirstTableRowObj()
    expect(firstTableOption.isPresent()).toBe(true)
    expect(firstTableOption.get().data_center).toBe('演示环境')
    // call C3_GetSpdnUrlByTerm
    const spdnUrlByTermResp=await RpcSoaService.callService('C3_GetSpdnUrlByTerm',{
        term_serial_no:'18959130026',
        client_type:'WINDOWS'
    })
    expect(spdnUrlByTermResp.success()).toBe(true)
    //获取多行返回
    const firstTablesOption=spdnUrlByTermResp.getFirstTableMultiRowObj()
    expect(firstTablesOption.isPresent()).toBe(true)
    //内网终端
    expect(firstTablesOption.get()[0].internet_flag).toBe('0')
    RpcClient.close()
    await TestUtil.sleep(500)
})