open-index/open-npm huggingface dataset:
npm package: @dazaar/payment-eos
Description: eos payment provider for dazaar streaming services
Author: Dazaar Limited
Latest version: 1.0.1

# @dazaar/payment-eos
EOS payment api for Dazaar stream services

This module serves [dazaar-payment](https://github.com/bitfinexcom/dazaar-payment). See [dazaar](https://github.com/bitfinexcom/dazaar) for example usage.
npm package: @dazedi/lucia
Description: A simple and flexible authentication library
Author: pilcrowonpaper
Latest version: 3.0.4

# `lucia`

An open source auth library that abstracts away the complexity of handling sessions. It works alongside your database to provide an API that's easy to use, understand, and extend.

**[Documentation](https://v3.lucia-auth.com)**

**[Changelog](https://github.com/pilcrowOnPaper/lucia/blob/main/packages/lucia/CHANGELOG.md)**

## Installation

```
npm install lucia
pnpm add lucia
yarn add lucia
```
npm package: @dazejs/graphql-provider
Description: GraphQL provider for Daze framework.
Latest version: 0.0.1

[![GitHub issues](https://img.shields.io/github/issues/dazejs/graphql-provider.svg)](https://github.com/dazejs/graphql-provider/issues)
[![npm](https://img.shields.io/npm/v/@dazejs/graphql-provider.svg)](https://www.npmjs.com/package/@dazejs/graphql-provider)
[![npm](https://img.shields.io/npm/dm/@dazejs/graphql-provider.svg)](https://www.npmjs.com/package/@dazejs/graphql-provider)
[![GitHub license](https://img.shields.io/github/license/dazejs/graphql-provider.svg)](https://github.com/dazejs/graphql-provider/blob/master/LICENSE)

<div align="center">
  <a href="https://github.com/dazejs/graphql-provider">
    <img width="600" heigth="300" src="https://github.com/dazejs/graphql-provider/blob/master/assets/logo.png">
  </a>  
  <h2>GraphQL</h2>
  <h4>基于 Daze.js 的 GraphQL 扩展</h4>
</div>

## 简介

这是一套基于 Daze.js 的 GraphQL 的扩展。

## 开始

### 安装

```bash
$ npm install --save @dazejs/graphql-provider
```

### 加载GraphQL服务提供者

添加 `GraphQLProvider` 到 `config/app.ts` 配置中

```ts
import { GraphQLProvider } from '@dazejs/graphql-provider';

export default {
  // ...
  providers: [
    // ...
    GraphQLProvider
  ]
  // ...
}
```

## 使用

### 定义 graphql 描述文件

你可以在 `config` 目录中定义多个 `*.graphql` 的描述文件，比如：

* config/graphql/hello.graphql

```graphql
type Query {
    hello(str: String): String!
}
```

### 定义对应的处理类

* hello.graphql.ts

```typescript
import { graphQL, query } from '@dazejs/graphql-provider';

@graphQL()
export default class HelloGraphql {

  @query()
  hello({ str }: any) {
    return `Hello ${str}`;
  }
}
```

## 更多功能

* 内置 [graphql-scalars](https://github.com/Urigo/graphql-scalars)
* 更详细的实例参考 `__test__` 目录
npm package: @dazejs/jwt-provider
Description: json web token service for dazejs
Author: chan zewail
Latest version: 2.0.0

[![GitHub issues](https://img.shields.io/github/issues/dazejs/jwt-provider.svg)](https://github.com/dazejs/jwt-provider/issues)
[![npm](https://img.shields.io/npm/v/@dazejs/jwt-provider.svg)](https://www.npmjs.com/package/@dazejs/jwt-provider)
[![npm](https://img.shields.io/npm/dm/@dazejs/jwt-provider.svg)](https://www.npmjs.com/package/@dazejs/jwt-provider)
[![actions](https://github.com/dazejs/jwt-provider/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/dazejs/jwt-provider/actions)
[![codecov](https://codecov.io/gh/dazejs/jwt-provider/branch/master/graph/badge.svg)](https://codecov.io/gh/dazejs/jwt-provider)
[![GitHub license](https://img.shields.io/github/license/dazejs/jwt-provider.svg)](https://github.com/dazejs/jwt-provider/blob/master/LICENSE)

# Jwt Provider

基于 Daze.js 的 jwt 扩展

## 安装

```bash
$ npm i --save @dazejs/jwt-provider
```

## 使用 

首先在 `/src/config/app.ts` 将提供者注册到框架中：


```ts
import { JwtServiceProvider } from '@dazejs/jwt-provider';

export default {
  // ...
  providers: [
    // ...
    JwtServiceProvider.configure({
      secret: 'hard!to-guess_secret',
      privateKey: '...',
      publicKey: '...',
      algorithm: 'HS256',
    })
  ]
}
```

`configure` 方法用来配置 `JwtServiceProvider`, 参数支持：
- `secret`: `HMAC` / `PEM` 加密需要配置该参数
- `publicKey` / `privateKey`: `RSA` / `ECDSA` 加密所需的公钥和私钥
- `algorithm`: 默认所使用的加密算法，详细可以查看 [`crypto`](https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format)

使用 `@inject` 进行注入即可使用 

```ts
import { Controller, route, http, inject } from '@dazejs/framework'
import { Jwt } from '@dazejs/jwt-provider'

@route('users')
export class User extends Controller {

    @inject() jwt: Jwt;

    // get /users
    @http.het()
    index() {
        const token = this.jwt.sign({
          uid: 1
        })
        return token
    }
}
```

### Jwt

`Jwt` 是基于 [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) 实现的

**`sign(payload: string | Object | Buffer, options?: SignOption): string`**

该方法基于 `jsonwebtoken` 的 `sign` 方法实现

**`verify(token: string, options?: VerifyOption): any`**

该方法基于 `jsonwebtoken` 的 `verify` 方法实现

**`decode(token: string, options: DecodeOptions): object | string`**

该方法基于 `jsonwebtoken` 的 `decode` 方法实现