open-index/open-npm huggingface dataset:
npm package: @medibloc/amino-js
Description: tendermint/go-amino for JavaScript
Author: MediBloc
Latest version: 1.2.0

# `amino-js`

Supported in Node.js and browsers.

Support is planned for Service Workers.

Foked from [cosmos/amino-js](https://github.com/cosmos/amino-js)

### Install

##### NPM
```shell
npm install --save @medibloc/amino-js
```

### Usage

Encoding decoding of basic values:
```js
import { encodeString, decodeString } from '@medibloc/amino-js';
decodeString(encodeString('hello world'));
// [ "hello world", 12 ]
```

Encoding/decoding of registered types:
```js
import { marshalTx, unmarshalTx } from '@medibloc/amino-js';

const tx = {
  "type": "auth/StdTx",
  "value": {
    "msg": [
      {
        "type": "aol/MsgCreateTopic",
        "value": {
          "TopicName": "certification",
          "Description": "",
          "OwnerAddress": "panacea1d8xsncdn4m9e0gxx4u9jq3u84rd88tdkthz6pu"
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "umed",
          "amount": "10000000"
        }
      ],
      "gas": "200000"
    },
    "signatures": [
      {
        "pub_key": {
          "type": "tendermint/PubKeySecp256k1",
          "value": "AyGbSDc7t55/bjIjpJODurciLqA8j2Bize5A065rZXf6"
        },
        "signature": "rUDhsKm5yAX4C9PsluBsWB10xZVpk7W2L2Pot+8ODIsoVLmdYnnng+Dxy8eji7angvtDPC7/8cqvQ9S5wUR+8Q=="
      }
    ],
    "memo": ""
  }
};

const encodedTx = marshalTx(tx);
const decodedTx = unmarshalTx(encodedTx);
```
npm package: @medibloc/ecdsa-secp256k1-signature-2019
Description: EcdsaSecp256k1Signature2019 Linked Data Proof suite for use with jsonld-signatures.
Author: MediBloc
Latest version: 0.1.4

# EcdsaSecp256k1Signature2019 suite

> EcdsaSecp256k1Signature2019 Linked Data Proof suite for use with jsonld-signatures.

## Background

For use with:
- [`jsonld-signatures`](https://github.com/digitalbazaar/jsonld-signatures) `^9.0.0`.
- [`@bloomprotocol/vc`](https://github.com/hellobloom/ssi-sdk/tree/main/packages/vc) `^0.1.0`.
- [`@digitalbazaar/vc`](https://github.com/digitalbazaar/vc-js) `^1.0.0`.

See also related specs:

- [EcdsaSecp256k1Signature2019 Crypto Suite](https://w3c-ccg.github.io/lds-ecdsa-secp256k1-2019/)

## Install

```
npm i @medibloc/ecdsa-secp256k1-signature-2019
```

OR

```
yarn add @medibloc/ecdsa-secp256k1-signature-2019
```
npm package: @medibloc/ecdsa-secp256k1-verification-key-2019
Description: TypeScript library for generating and working with EcdsaSecp256k1VerificationKey2019 key pairs, for use with crypto-ld.
Author: MediBloc
Latest version: 0.1.3

# EcdsaSecp256k1VerificationKey2019 suite

> TypeScript library for generating and working with EcdsaSecp256k1VerificationKey2019 key pairs, for use with crypto-ld.

## Background

For use with:
- [`crypto-ld`](https://github.com/digitalbazaar/crypto-ld) `^6.0.0`
- [`@bloomprotocol/ecdsa-secp256k1-signature-2019`](https://github.com/hellobloom/ssi-sdk/tree/main/packages/ecdsa-secp256k1-signature-2019) `^0.1.0`
- [`@bloomprotocol/vc`](https://github.com/hellobloom/ssi-sdk/tree/main/packages/vc) `^0.1.0`.
- [`@digitalbazaar/vc`](https://github.com/digitalbazaar/vc-js) `^1.0.0`.

See also related specs:

- [EcdsaSecp256k1VerificationKey2019](https://w3c-ccg.github.io/lds-ecdsa-secp256k1-2019/#dfn-ecdsasecp256k1verificationkey2019)

## Install

```
npm i @bloomprotocol/ecdsa-secp256k1-verification-key-2019
```

OR

```
yarn add @bloomprotocol/ecdsa-secp256k1-verification-key-2019
```
npm package: @medibloc/nestjs-oso
Description: Use OSO with NestJS
Author: Bjerk AS
Latest version: 1.0.1-m.2

# oso – Authorization code for NestJS

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
![Release](https://github.com/bjerkio/nestjs-oso/workflows/Release/badge.svg)

[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/bjerkio/nestjs-oso.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/bjerkio/nestjs-oso/context:javascript)
[![codecov](https://codecov.io/gh/bjerkio/nestjs-oso/branch/main/graph/badge.svg)](https://codecov.io/gh/bjerkio/nestjs-oso)
[![Maintainability](https://api.codeclimate.com/v1/badges/85ecf3895e428d2c3064/maintainability)](https://codeclimate.com/github/bjerkio/nestjs-oso/maintainability)

> [oso][] is an open-source policy engine for authorization that’s embedded in
> your application. It provides a declarative policy language for expressing
> authorization logic. You define this logic separately from the rest of your
> application code, but it executes inside the application and can call directly
> into it.

`nestjs-oso` is a library that simplifies the implementation of [oso][] with
[NestJS][nest].

## Features

- @OsoClass decorator (automatically registers the class to use within Oso)
- OsoService (a ready to use NestJS service)

## Quickstart

```shell
▶ yarn add nestjs-oso oso
```

```typescript
import { Module } from '@nestjs/common';
import { OsoModule } from 'nestjs-oso';

@Module({
  imports: [
    OsoModule.forRoot({
      loadFile: './permissions.polar',
    }),
  ],
})
export class AppModule {}
```

**Tip:** You don't have to apply either `loadFile` or `loadStr`. You can inject
`OsoService` and access the original API for oso anytime!

### Example

You can easily inject `OsoService` to be used in your services, controllers,
etc.

```typescript
import { Injectable } from '@nestjs/common';
import { OsoService } from 'nestjs-oso';

@Injectable()
export class AuthService {
  constructor(private oso: OsoService) {}
  /*
    Implementation that makes use of this.oso
  */
}
```

To register an class with `oso`, use the decorator:

```typescript
import { OsoClass } from 'nestjs-oso';

@OsoClass()
export class User {
  id: string;
}
```

This will automatically be registered using `registerClass` function in `oso`.

## Contribute & Disclaimer

We love to get help 🙏 Read more about how to get started in
[CONTRIBUTING](CONTRIBUTING.md) 🌳

[oso]: https://github.com/osohq/oso
[nest]: https://github.com/nestjs/nest
npm package: @medibloc/panacea-js
Description: The official Panacea Javascript SDK written in Typescript
Author: MediBloc
Latest version: 2.2.1

# Panacea Javascript SDK

The `panacea-js` is the official [Panacea](https://github.com/medibloc/panacea-core) Javascript SDK written in Typescript, powered by [CosmJS](https://github.com/cosmos/cosmjs).

The `panacea-js` extends the CosmJS in order to provide [Panacea-specific features](https://github.com/medibloc/panacea-core#key-features) (AOL, DID, PNFT).
So, it exposes CosmJS basic functions as they are, such as `connectWithSigner` and `sendTokens`.

## Usage

### Installation

```bash
yarn add @medibloc/panacea-js \
  @cosmjs/proto-signing@0.32.3 \
  @cosmjs/stargate@0.32.3 \
  cosmjs-types@0.9.0
```

### Examples

A list of examples can be found at the [example.md](docs/examples.md).

## Contribution

Install dependencies and build the project.
```bash
yarn install
yarn build
```

To run simple unit tests,
```bash
yarn test
````

To run integration tests with [panacea-core](https://github.com/medibloc/panacea-core), start a `panacea-core` daemon first.
```bash
docker run --rm -d \
  -e CHAIN_ID="chain-1" \
  -e MNEMONIC="..." \
  -p 26657:26657 \
  -v $(pwd)/scripts:/root/scripts \
  --name core \
  ghcr.io/medibloc/panacea-core:v2.2.0 \
  bash /root/scripts/panacea-core/init.sh
```

Then, the integration tests can be run with the following environment variables.
```bash
PANACEAD_ENABLED=true \
TENDERMINT_URL="http://localhost:26657" \
CHAIN_ID="chain-1" \
MNEMONIC="..." \
yarn test
```

For more details, please see the [CI script](.github/workflows/ci.yml).

## License

[Apache-2.0 License](LICENSE)
npm package: @medic/audit-dependencies
Description: Caches the results of npm audit so it only runs if the package-lock.json changes.
Latest version: 1.0.0
Deprecated: Renamed to audit-cache

## Intro

`npm audit` is great but...
1. there's no way to whitelist advisories so you don't see them again, and
2. if you run it all the time (eg: as part of CI) it'll block you.

## Usage

1. Run `npx @medic/audit-dependencies audit`. This will run `npm audit`. If you have any advisories, either fix them, or add the IDs to the `permitted` array in the `.auditrc.json` file, then run `audit` again.
2. In your CI add a step for `npx @medic/audit-dependencies check`. This will check your `package-lock.json` against the one that's been verified and fail if it's changed.
npm package: @medic/contact-summary-testing
Description: Contact Summary test will load your contact-settings.js or contact-summary-templated.js. Then it will loop through the folders in your contact summary json exmaple folders. Then execute your contact.json, lineage.json, and reports.json  against the contac
Latest version: 2.0.1

# Running Tests With Contact Summary Tests

Contact Summary test will load your contact-settings.js or contact-summary-templated.js. Then it will loop through the folders in your contact summary json exmaple folders. Then execute your contact.json, lineage.json, and reports.json  against the contact-summary. This returns an output json which is then compared against the expected.json in your test folders. 

### Via command line
 
 `medic-contact-summary-test path_to_contact-summary.js path_to_tests_contact_summary_json`

### An example using the standard config tests
  
   `medic-contact-summary-test medic-webapp/tree/master/config/standard medic-webapp/tree/master/config/standard/tests/contact-summary`


# Expected Files

## Folder Structure

The json files need to be in this directory structure to be looped over and tested against the contact-summary that gets loaded. 

**NOTE: Lineage and reports files are required but not required to contain data.**

```
── contact-summary
│   ├── immunization
│   │   ├── contact.json
│   │   ├── expected-output.json
│   │   ├── lineage.json
│   │   └── reports.json
```

### Contact JSON
This file is a representation of data that would be submitted through the app via a form. It should mimic the data collected 

### Reports JSON
A json file that represents a report that is being submitted through the application. When the contact summary is executed it will affect the output based on conditions set.

### Lineage

Represents the lineage for a contact and the available use cases, vaccines, and other details. Used when processing through the contact summary. 

### Expected Output
This file contains the data as if it were processed through the app and contact summary details were applied to it. Returning expected fields, cards, and context.
npm package: @medic/search
Description: Our implemenation of search using (C|P)ouchDB views.
Latest version: 1.1.1

# Search

A shared library that uses CouchDB views to generate search results.

## v1 API

You must initialise the library with a Promise library and a PouchDB DB:

```js
const Search = require('search')(Promise, new PouchDB('foo'));
```

PouchDB needs access to at least map reduce and some kind of back-end (here HTTP):

```js
const PouchDB = require('pouchdb-core');
PouchDB.plugin(require('pouchdb-adapter-http'));
PouchDB.plugin(require('pouchdb-mapreduce'));
```

You can then request search results for Reports and contacts:

```js
Search('reports', {}, {limit: 50, skip: 0})
    .then(ids => {
        ...
    })
```

The first parameter is the type, the second parameter is the query params described in the sections below, and the third are options related to pagination.

### Contacts

There is only one query option in contacts: `search`:

```js
Search('contact', {search: "your search terms"})
    .then(ids => { ... })
```

These search terms are broken up and used on tokens pulled from contacts. Names, dobs, phone numbers etc.

### Reports

Basic example of all the options:

```json
{
  "forms": {
    "selected": [
      {
        "code": "confirm_death",
      },
      {
        "code": "delivery",
      },
      {
        "code": "immunization_visit",
      }
    ],
  },
  "facilities": {
    "selected": [
      "665e98ef-8fdf-43ba-90aa-1fd422daaa5b",
      "bf99cec0-a0eb-4f77-a557-d2fe2c694b94"
    ],
  },
  "date": {
    "from": 1517443200000,
    "to": 1518825599999
  },
  "valid": true,
  "verified": true,
  "search": "your search terms"
}
```

`forms.selected` is an array of `{code: "foo"}` objects where `foo` is the form code.

`facilities.selected` is an array of `_id` values for those facilities.

`date.from` and `date.to` are outputs from `Date.getTime()`: the number of milliseconds since Jan 1st 1970 UTC.

`valid` is whether or not the forms returned are forms without errors (undefined means either).

`verified` is whether or not the forms returns have been validated (undefined means either).

`search` follows the same logic as for contacts, but for data in reports.