open-index/open-npm huggingface dataset:
npm package: @jashine/egg-miniapp
Description: wechat mini app dev
Author: jashine
Latest version: 1.0.4

# @jashine/egg-miniapp

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/egg-miniappUtil.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-miniappUtil
[travis-image]: https://img.shields.io/travis/eggjs/egg-miniappUtil.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-miniappUtil
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-miniappUtil.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/egg-miniappUtil?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-miniappUtil.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-miniappUtil
[snyk-image]: https://snyk.io/test/npm/egg-miniappUtil/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-miniappUtil
[download-image]: https://img.shields.io/npm/dm/egg-miniappUtil.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-miniappUtil

<!--
Description here.
-->

## Install

```bash
$ npm i @jashine/egg-miniapp
```

## Usage

```js
// {app_root}/config/plugin.js
exports.miniappUtil = {
  enable: true,
  package: '@jashine/egg-miniapp',
};
```

## Configuration

```js
// {app_root}/config/config.default.js
exports.miniappUtil = {
};
```

see [config/config.default.js](config/config.default.js) for more detail.

## Example

<!-- example here -->

## Questions & Suggestions

Please open an issue [here](https://github.com/eggjs/egg/issues).

## License

[MIT](LICENSE)
npm package: @jashine/egg-minipay
Description: minipay inclued wechat alipay
Author: luckyjean
Latest version: 2.0.1
Deprecated: false

# egg-minipay

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/egg-minipay.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-minipay
[travis-image]: https://img.shields.io/travis/eggjs/egg-minipay.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-minipay
[codecov-image]: https://img.shields.io/codecov/c/github/eggjs/egg-minipay.svg?style=flat-square
[codecov-url]: https://codecov.io/github/eggjs/egg-minipay?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-minipay.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-minipay
[snyk-image]: https://snyk.io/test/npm/egg-minipay/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-minipay
[download-image]: https://img.shields.io/npm/dm/egg-minipay.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-minipay

<!--
Description here.
-->

## Install

```bash
$ npm i @jashine/egg-minipay
```

## Usage

```js
// {app_root}/config/plugin.js
exports.miniPay = {
  enable: true,
  package: '@jashine/egg-minipay',
};
```

## Configuration

```js
// {app_root}/config/config.default.js
exports.miniPay = {
};
```

see [config/config.default.js](config/config.default.js) for more detail.

## Example

<!-- example here -->

## Questions & Suggestions

Please open an issue [here](https://github.com/eggjs/egg/issues).

## License

[MIT](LICENSE)
npm package: @jashine/unipay-pos
Description: 银联商务OPEN-BODY-SIG认证方式的接口调用
Author: LuckyRiko
Latest version: 1.0.4

Install with:

    npm i @jashine/unipay-pos

## Usage Example

```js

// esm方式
import UnipaySDK from "@jashine/unipay-pos";

// cjs方式
const UnipaySDK = require("@jashine/unipay-pos");


// 初始化实例
// gateWay选填，默认为空
const unipay = new UnipaySDK({
    // gateWay: 'xxx'
    appId: 'xxx',
    appKey: 'xxx'
})

// 生成订单号
// 生成规则详见银联文档，不能超过32位，超过32位返回false
// 第一个参数为项目标识 第二个参数为自定义信息
const orderNo = await unipay.createOrderNo("TEST", "233");

// 具体使用方法可参考test目录下的文件
// 接口调用，实际请求url=gateWay+queryUrl；gateWay不传默认为空字符串；
// data传参详见银联文档，内部已封装接口验证，只需关心业务参数；queryUrl&content必传；
// errCode 成功返回6位字符串"000000"或2位字符串"00"，失败返回其他状态码，详见银联官方文档;
// 银联开发者中心-接入指引：https://open.chinaums.com/saas-web/#/bonusService?service=develop-center
let data = {
    queryUrl: 'xxx',
    content: {
        // 请求参数
    }
}
const {errCode, errMsg} = await unipay.request(data);
npm package: @jashine/unipay-poslink
Description: 银联: 扫码支付-被扫
Author: luckyriko
Latest version: 1.0.0

Install with:

    npm i @jashine/unipay-poslink

## Usage Example

```js
const PosLink = require("@jashine/unipay-poslink");

//初始化实例
const posLink = new PosLink({
  gateWay: "https://test-api-open.chinaums.com/v2/poslink/transaction/",
  appid: "f0ec96ad2c3848b5b810e7aadf369e2f",
  appkey: "775481e2556e4564985f5439a5e6a277",
});

//支付
const res = await posLink.pay({
  merchantCode: "123456789900081",
  terminalCode: "00810001",
  transactionAmount: 1,
  transactionCurrencyCode: 156,
  merchantOrderId: "3235212201121929209721434193",
  merchantRemark: "测试单",
  payMode: "CODE_SCAN",
  payCode: "用户手机上的付款码",
  storeId: 128,
});

//交易查询
const res = await posLink.query({
  merchantCode: "123456789900081",
  terminalCode: "00810001",
  // 银商订单号（微信支付里的商户单号，二选一）
  // originalOrderId: "20220119173246100021724711",
  // 商户订单号（商户系统生成的订单号，二选一）
  merchantOrderId:'3235212201121929209721434193'
});

//支付撤销
const res = await posLink.voidpayment(
  {
    merchantCode: '123456789900081',
    terminalCode: '00810001',
    // 银商订单号（微信支付里的商户单号，二选一）
    // originalOrderId: '20220119173246100021724711',
    // 商户订单号（商户系统生成的订单号，二选一）
    merchantOrderId:'3235212201121929209721434193'
  }
);

//退款
const res = await posLink.refund({
  merchantCode: "123456789900081",
  terminalCode: "00810001",
  // refundRequestId: uuidv4().replace(new RegExp('-','gm'), ""),
  refundRequestId: "b73587b0cbed4991gf4530879f3ee643",
  // originalOrderId: "20220119173246100021724711",
  transactionAmount: 1,
  merchantRemark: "我要退款",
  // 商户订单号
  merchantOrderId:'3625202201122919209721444193'
});

//退款查询
const res = await posLink.queryRefund({
  merchantCode: "123456789900081",
  terminalCode: "00810001",
  // originalOrderId: "20220119173246100021724711",
  merchantOrderId:'3625202201122919209721444193',
  refundRequestId: "b73587b0cbed4991gf4530879f3ee643",
});

//统一请求方法,设置msgType的值请求相关的接口，包含所有请求功能，msgType的值根据文档填写，例：支付pay
const res = await posLink.request({
    msgType: 'pay',
    merchantCode: '123456789900081',
    terminalCode: '00810001',
    transactionAmount: 2,
    transactionCurrencyCode: 156,
    merchantOrderId: '3625202201122919209721444193',
    merchantRemark: '测试单',
    payMode: 'CODE_SCAN',
    payCode: '用户手机上的付款码',
    storeId: 1,
  }
);
npm package: @jashitory/take-toggle
Description: Rxjs take-toggle operator
Author: Jesus Figueredo
Latest version: 1.1.0

# take-toggle
Rxjs take-toggle operator

## Example:
```ts
import { BehaviorSubject, Subject } from 'rxjs'

const observable = new BehaviorSubject<any>()
const notifier =  new Subject<boolean>();

const takeSomeTimes = observable.pipe(takeToggle(notifier));

takeSomeTimes.subscribe(val => console.log(val));

observable.next(1);
// logs: 1

observable.next(2);
// logs: 2

notifier.next(false); // off notifications
observable.next(3);
observable.next(4);

notifier.next(true); // on notifications
// logs: 4

observable.next(5);
// logs: 5
```
npm package: @jashkasoft/nestjs-rpc
Description: RPC module for NestJS framework
Author: jashka
Latest version: 0.0.1

NestJS JSON RPC package

Implemented JSON RPC [specification](https://www.jsonrpc.org/specification)

How to use:
 - import module `RpcModule`, example  
```typescript
        RpcModule.forRoot({
            path: '/rpc', // path to RPC
        })
```
 
 - every request to RPC is POST method and response status = 200
 
 - create rpc handler  
```typescript
import { IRpcHandler, RpcHandler } from '../src/rpc/rpc-explorer';
import { RpcId, RpcPayload, RpcVersion, RpcMethod } from '../src/rpc/decorators';

@RpcHandler({
    method: 'test',
})
export class TestHandler implements IRpcHandler<Payload> {
    public async invoke(
        @RpcPayload() payload: Payload,
        @RpcVersion() version: string,
        @RpcId() id: number | string,
        @RpcMethod() method: string
    ) {
        return payload;
    }
}
```

 - add `TestHandler` to providers array  


How to use  
Example simple request to handler:  
request --> `curl -X POST "http://localhost:3002/rpc" -H "accept: application/json" -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "example", "params": 2}'`  
response <-- `{"jsonrpc":"2.0","result":2,"id":null}`

Batch requests  
request --> `curl -X POST "http://localhost:3002/rpc" -H "accept: application/json" -H "Content-Type: application/json" -d '[{"jsonrpc": "2.0", "method": "example", "params": 2}, { "jsonrpc": "2.0", "method": "test" }]'`  
response <-- `[{"jsonrpc":"2.0","result":2,"id":null}]`

 
 
Fields description

| field |  decorator |  description | required  | other  |
|---|---|---|---|---|
| `params` | `@RpcPayload()`  |  get payload ( params ) | false  |   | 
| `jsonrpc` | `@RpcVersion()` | get rpc version  | true  |   |   |
| `method` | `@RpcMethod()` | get rpc version  | true  |   |   |
| `id` | `@RpcId()`  | get client operation id  | false  | if not send - response not send, RPC notification  |


However, you don't have an access to the native response object in
Exception filters, Interceptors and Guards (as in the HTTP app).  
Because RPCModule in rpc batch request collect responses from handlers
and if you using response you override headers or send response in some handlers.
Maybe, you can receive errors, for example `headers already sent`.