open-index/open-npm huggingface dataset:
npm package: @openrouter/minijinja
Description: A wasm wrapper for minijinja
Latest version: 0.1.1

# MiniJinja Sandbox

This repository contains a small WASM project to demo MiniJinja in the browser.

### Setup
1. [Install wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)
2. Run
```bash
   wasm-pack build
   cd www
   npm install
   npm run start
   ```
npm package: @openrouter/schemas
Description: Schema definition for OpenRouter
Author: OpenRouter
Latest version: 0.0.2

# OpenRouter Schemas

This is the JSON schema used to configure OpenRouter's dynamic model routing. Features:

- 🔀 Configure fallback models to handle moderation and downtime gracefully
- 🦹‍♀️ Create and share characters with custom prompts and parameters

WIP features:

- 🧠 Add memory to characters using embeddings (WIP)
- 👨‍👩‍👧‍👦 Configure a [mixture-of-experts](https://arxiv.org/abs/2208.02813) with open source models (WIP)

## How to configure a route

OpenRouter will provide two ways to set a route:
### Fallback route

In the request body to the [OpenRouter API](https://openrouter.ai/docs), you can set `route` to a string value. Only one option will exist at the beginning: `"fallback"`:

```json
{
  "model": "openai/gpt-4",
  "route": "fallback"
}
```

This route allows you to use an **open source model** (whatever OpenRouter thinks might be best for your primary model) as a fallback if:

1. Your primary model requires the use of a moderation model to avoid sending certain types of prompts
2. Our moderation model(s) flagged your prompt or system prompt for a specific reason.

You can also use list of `models` to indicate which models you'd like to try, in order (up to 3):

```json
{
  "models": ["openai/gpt-4", "meta-llama/llama-2-70b-chat"],
  "route": "fallback"
}
```

If you don't specify `models` but you do specify `route: "fallback"`, then OpenRouter will try to pick the most appropriate fallback model for you.

### Custom JSON

You will also be able set `route` to a JSON object that conforms to this schema. See [How to use this](#how-to-use-this) below.

## How to use this

The current RFC draft schema is `v1`. To start your router, create a JSON file with:

```json
{
  "$schema": "https://openrouter.ai/api/v1/router/schema.json"
}
```

You can then extend the schema and submit this JSON as your `route`. [Here's an example](/examples/v1-fallback-router.json).

**Note:** You should submit a single model config inside the `models` array unless you also want a `mixture_of_experts`. If the latter is unspecified and `models.length > 1`, you'll receive an error.

### When will this be available?

Custom routers will go live after we receive feedback and suggestions. Please feel free to create an issue or open a PR directly on this repository to start the discussion!

You can also message us in [Discord](https://discord.gg/T7cXxR68vK).

## Model identifiers

Models must be identified by one of the `/`-separated strings in the [OpenRouter docs](https://openrouter.ai/docs#models), or a model identifier in Hugging Face format.
npm package: @openrtb/bid-requester
Description: TypeScript bid requester library compliant with OpenRTB 2.5/2.6/3.0
Author: Kai Miyamoto
Latest version: 0.1.1

# @openrtb/bid-requester

Typescript bid requester library compliant with OpenRTB 2.5/2.6/3.0

## Features

- 🎯 Full TypeScript type definitions support
- 📝 Compliant with OpenRTB
- 🛠️ Support for ESM and CommonJS
- ⚡ Can be used without instantiation
- 🧪 Test-friendly interface

## Usage

### Basic Usage

```typescript
import { bidRequester } from "@openrtb/bid-requester";
import { BidRequest, BidResponse } from "iab-openrtb/v26";

const bidRequest: BidRequest = {
  id: "bid-request-1",
  imp: [
    {
      id: "1",
      banner: {
        w: 300,
        h: 250,
      },
    },
  ],
};

const bidResponse = await bidRequester.requestV26(
  "https://example.com/endpoint",
  bidRequest,
  {
    headers: {
      Token: "auth-token",
    },
  }
);
```

### Version specific Bid Requests

```typescript
const bidResponseV25 = await bidRequester.requestV25(
  "https://example.com/v25",
  bidRequestV25
);
const bidResponseV26 = await bidRequester.requestV26(
  "https://example.com/v26",
  bidRequestV26
);
const bidResponseV30 = await bidRequester.requestV30(
  "https://example.com/v30",
  bidRequestV30
);
```

### Exception

```typescript
import {
  BidRequesterException
} from "@openrtb/bid-requester";

try {
  const bidResponse = await bidRequester.requestV26(
    "https://example.com/endpoint",
    bidRequest
  );
} catch (error) {
  if (error instanceof BidRequesterException) {
    // error handling...
    if (error.type === 'InvalidBidRequest') {

    } else if (error.type === 'NoBidResponse') {

    } else {

    }
}

// exception types...
type ExceptionType =
  | "InvalidBidRequest"
  | "NoBidResponse"
  | "Unexpected";
```

### Mock

Test-friendly interface available

```typescript
import { IBidRequester } from "@openrtb/bid-requester";

const bidRequesterMock = mock<IBidRequester>();
```

### Options

If you want to change from OpenRTB recommended data encoding and data format, you can use options.

Available options:

```typescript
export type BidRequesterOptions = {
  headers?: HeadersInit; // custom headers
  cache?: RequestCache; // no-store, default, no-cache... (defaults to no-store)
  credentials?: RequestCredentials; // include, omit, same-origin...
  mode?: RequestMode; // same-origin, cors, no-cors...
};
```

Usage:

```typescript
import { BidRequester } from "@openrtb/bid-requester";
import { BidRequest, BidResponse } from "iab-openrtb/v26";

// Common options
const bidRequester = new BidRequester({
  headers: {
    "Accept-Encoding": "*",
  },
});

const bidRequest: BidRequest = {
  id: "bid-request-1",
  imp: [
    {
      id: "1",
      banner: {
        w: 300,
        h: 250,
      },
    },
  ],
};

const bidResponse = await bidRequester.requestV26(
  "https://example.com/endpoint",
  bidRequest,
  {
    // Specific options
    headers: {
      Token: "auth-token",
    },
  }
);
```

## License

[MIT License](./LICENSE)
npm package: @openrtb/macro-replacer
Description: TypeScript macro replacer library compliant with OpenRTB 2.6/3.0
Author: Kai Miyamoto
Latest version: 0.1.0

# OpenRTB/Auction Macro Replacer

TypeScript macro replacer library compliant with OpenRTB 2.6/3.0.

## Features

- 🎯 Support for both OpenRTB 3.0 and Auction 2.x macro formats
- 📝 Version-specific macro handling
- 🛠️ Safe handling of undefined/null values
- ⚡ Type-safe context management

## Usage

```typescript
import { MacroReplacer } from "@openrtb/macro-replacer";

// Create a new instance with initial context
const replacer = new MacroReplacer({
  id: "auction123",
  price: 10.5,
  currency: "USD",
});

// Replace macros in a string
const result = replacer.replace(
  "Auction ${OPENRTB_ID}: ${OPENRTB_PRICE} ${OPENRTB_CURRENCY}"
);
// Output: "Auction auction123: 10.5 USD"

// Update context values
replacer.updateContext({ price: 15.0 });

// Get supported macros
const macros = replacer.getSupportedMacros();
```

## Version-specific Usage

You can create version-specific instances that only support macros for either OpenRTB 3.0 or Auction 2.x:

```typescript
// OpenRTB 3.0 only
const openrtbReplacer = new MacroReplacer({}, "3");

// Auction 2.x only
const auctionReplacer = new MacroReplacer({}, "2");
```

## Supported Macros

### Common Macros (Both Versions)

- `${OPENRTB_ID}` / `${AUCTION_ID}`: Auction identifier
- `${OPENRTB_BID_ID}` / `${AUCTION_BID_ID}`: Bid identifier
- `${OPENRTB_ITEM_ID}` / `${AUCTION_IMP_ID}`: Item/Impression identifier
- `${OPENRTB_SEAT_ID}` / `${AUCTION_SEAT_ID}`: Seat identifier
- `${OPENRTB_PRICE}` / `${AUCTION_PRICE}`: Clearing price
- `${OPENRTB_CURRENCY}` / `${AUCTION_CURRENCY}`: Currency
- `${OPENRTB_MBR}` / `${AUCTION_MBR}`: Market Bid Ratio
- `${OPENRTB_LOSS}` / `${AUCTION_LOSS}`: Loss reason code
- `${OPENRTB_MIN_TO_WIN}` / `${AUCTION_MIN_TO_WIN}`: Minimum price to win

### OpenRTB 3.0 Specific

- `${OPENRTB_MEDIA_ID}`: Media identifier
- `${OPENRTB_ITEM_QTY}`: Item quantity

### Auction 2.x Specific

- `${AUCTION_AD_ID}`: Ad identifier
- `${AUCTION_MULTIPLIER}`: Price multiplier
- `${AUCTION_IMP_TS}`: Impression timestamp

## Error Handling

The library handles missing context values gracefully by replacing them with empty strings. Invalid macros are left unchanged in the output string.

## TypeScript Support

The library is written in TypeScript and includes type definitions. Context values are type-safe through the `MacroContext` interface.

## License

MIT License - see [LICENSE.md](LICENSE.md) for details.
npm package: @opens/express
Description: Http Server Package
Author: Opens Tecnologia
Latest version: 0.0.0

# 📋 Pacote Http Server

Este pacote encapsula as funcionalidades de um serviço http (express) e oferece novas funcionalidades, para executar funções antes ou depois da função principal

## ✨ Funcionalidades

- **Possibilidade de utilizar um servidor express ou criar um novo, com todas as funções padrões**.
- **Funcionalidades de executar funções antes ou depois da função principal**.

## 📦 Tecnologias Utilizadas

- Node.js + TypeScript
- Express.js

---

## 📥 Criação e exemplo de uso

Este serviço consome mensagens da fila `audit.log` no RabbitMQ. Cada mensagem deve conter um JSON com a seguinte estrutura:

```typescript
// Exemplo de uso
import express, { Application } from 'express';
import {  Application, ExpressWrapper, HttpRequest  } from "@opens/express"


const api = new ExpressWrapper(); // Export uma instancia do express
const app = api.getApp();

// Funções para serem executadas antes ou depois
const logBefore = ({ req }: HttpRequest) => {
  console.log(`Antes da chamada`);
};

const logAfter = ({ req }: HttpRequest) => {
  console.log(`Depois da chamada`);
};

// Função principal para ser executada
const handler = ({ req }: HttpRequest) => {
  return req.body;
};

// Criando uma rota com handlers antes e depois
api.addRoute({
  method: 'get',
  path: '/teste',
  handler: handler,
  hooks: {
    after: [logAfter],
    before: [logBefore],
  },
});

// Integrando ao app Express
app.use('/api', api.getRouter());

api.start(3000);
```

## 🚀 Como Rodar Localmente

Baixe o pacote:

```bash
npm i @opens/http_server
```

Importe o pacote no local escolhido e utilize como no exemplo a cima
npm package: @opens/frontend
Description: A simple package to help with some common frontend tasks
Author: Opens Tecnologia
Latest version: 0.0.2

# @opens/frontend

O pacote `@opens/frontend` fornece ferramentas úteis para projetos frontend, como geração de arquivos em vários formatos.

## Instalação

Adicione o pacote ao seu projeto usando o npm:

```
npm install @opens/frontend
```

## Funcionalidades

1. Geração de PDF

2. Geração de CSV

3. Geração de Excel (.xlsx)

## Uso

1. Exemplo de uso da classe PDFGenerator

```javascript
import { PDFGenerator } from '@opens/frontend';

const config = {
  orientation: 'portrait',
  title: 'Relatório de Vendas',
  headers: ['Produto', 'Quantidade', 'Preço'],
  data: [
    { Produto: 'Camiseta', Quantidade: 10, Preço: 'R$ 100,00' },
    { Produto: 'Calça', Quantidade: 5, Preço: 'R$ 200,00' },
  ],
  fileName: 'relatorio_vendas',
  imgSrc: '/assets/logo.png',
};

const pdfGenerator = new PDFGenerator(config);

await pdfGenerator.generate();
```

2. Exemplo de uso da classe CSVGenerator

```javascript
import { CSVGenerator } from '@opens/frontend';

const config = {
  headers: ['Produto', 'Quantidade', 'Preço'],
  data: [
    { Produto: 'Camiseta', Quantidade: 10, Preço: 'R$ 100,00' },
    { Produto: 'Calça', Quantidade: 5, Preço: 'R$ 200,00' },
  ],
  fileName: 'relatorio_vendas',
};

const csvGenerator = new CSVGenerator(config);

await csvGenerator.generate();
```

3. Exemplo de uso da classe ExcelGenerator

```javascript
import { ExcelGenerator } from '@opens/frontend';

const config = {
  headers: ['Produto', 'Quantidade', 'Preço'],
  data: [
    { Produto: 'Camiseta', Quantidade: 10, Preço: 'R$ 100,00' },
    { Produto: 'Calça', Quantidade: 5, Preço: 'R$ 200,00' },
  ],
  fileName: 'relatorio_vendas',
};

const excelGenerator = new ExcelGenerator(config);

await excelGenerator.generate();
```

## Configuração

Configuração comum

Todas as classes (PDFGenerator, CSVGenerator, ExcelGenerator) compartilham algumas propriedades comuns na configuração:

- headers: Array de strings representando os cabeçalhos das colunas.
- data: Array de objetos representando os dados tabulares.
- fileName: Nome do arquivo gerado (sem extensão).

Configuração Específica

- PDFGenerator:
  - orientation: Orientação do documento (portrait ou landscape).
  - imgSrc: Caminho ou URL para o logotipo a ser adicionado ao PDF.
npm package: @opens/microservice
Description: Http Server Package
Author: Opens Tecnologia
Latest version: 1.1.2

# 📋 Pacote Http Server

Este pacote encapsula as funcionalidades de um serviço http (express) e oferece novas funcionalidades, para executar funções antes ou depois da função principal

## ✨ Funcionalidades

- **Possibilidade de utilizar um servidor express ou criar um novo, com todas as funções padrões**.
- **Funcionalidades de executar funções antes ou depois da função principal**.

## 📦 Tecnologias Utilizadas

- Node.js + TypeScript
- Express.js

---

## 📥 Criação e exemplo de uso

Este serviço consome mensagens da fila `audit.log` no RabbitMQ. Cada mensagem deve conter um JSON com a seguinte estrutura:

```typescript
// Exemplo de uso basico
import { Application, Endpoint, Resource } from '@opens/microservice';

const app = new Application();

const endpoint = new Endpoint({
  method: 'get',
  path: '',
  hooks: {
    before: [],
    after: [],
  },
  middlewares: [],
  handler: async (context) => {
    return {
      statusCode: 200,
      data: context.query,
    };
  },
});

const resource = new Resource({
  namespace: 'example',
  endpoints: [endpoint],
});

app.register(resource);

app.start({ port: 3000 });
```

## 🩺 Health Check

O servidor automaticamente adiciona uma rota `/healthz` que retorna informações sobre a saúde da aplicação:

```json
{
  "status": "healthy",
  "memory": 123456789,
  "uptime": 3600.123,
  "pid": 12345,
  "cpu": 15.5,
  "timestamp": "2025-06-27T10:30:00.000Z"
}
```

Esta rota pode ser utilizada para monitoramento e verificações de saúde em ambientes de produção, orquestradores como Kubernetes, ou ferramentas de load balancing.


## 🚀 Como Rodar Localmente

Baixe o pacote:

```bash
npm i @opens/microservice
```

Importe o pacote no local escolhido e utilize como no exemplo a cima
npm package: @opens/observability
Description: A package for tracing node applications
Author: Opens Tecnologia
Latest version: 1.0.5

# @opens/observability

## Overview
`@opens/observability` is a lightweight wrapper over popular instrumentation agents like **Elasticsearch APM** and **OpenTelemetry**. It provides a unified API to set up and use tracing, making it easier to integrate observability into your application.

## Features
- Supports **Elastic APM** and **OpenTelemetry**.
- Provides a **unified API** for tracing.
- Allows **custom logging levels**.
- Enables function instrumentation with tracing.
- Supports flexible configuration options.

## Installation

### When using Elastic APM
```sh
npm install elastic-apm-node @opens/observability
```

## Usage
### Setting Up the Tracer
You need to configure the observer before using it.

```typescript
import { observer, TRACE_PROVIDER, LOG_LEVEL_TYPES } from "@opens/observability";

observer.setup({
  provider: TRACE_PROVIDER.APM, // Use TRACE_PROVIDER.OTEL for OpenTelemetry
  logLevel: LOG_LEVEL_TYPES.INFO, // Set log level (DEBUG, INFO, WARN, ERROR) - Optional
  config: {
    serviceName: "my-service",
    serverUrl: "http://localhost:8200", // Elastic APM Server URL,
    secretToken: '<secretToken from your Elastic Stack deployment>',
    environment: '...', // https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#environment
  },
});
```

### Instrumenting a Function
Wrap a function with tracing using `instrumentFunc`.

```typescript
const tracedFunction = observer.tracer.instrumentFunc(
  { name: "fetchData", type: "custom" },
  async () => {
    console.log("Fetching data...");
    return "Data retrieved";
  }
);

tracedFunction().then(console.log);
```

### Available Constants
#### `TRACE_PROVIDER`
- `TRACE_PROVIDER.APM` → Uses **Elastic APM** for tracing.
- `TRACE_PROVIDER.OTEL` → Uses **OpenTelemetry** for tracing.

#### `LOG_LEVEL_TYPES`
- `DEBUG`
- `INFO`
- `WARN`
- `ERROR`

## Configuration
You can pass a configuration object when setting up the tracer. The configuration varies depending on the provider:

### Elastic APM Configuration
```typescript
{
  serviceName: "my-service",
  secretToken: "my-secret",
  serverUrl: "http://localhost:8200",
}
```

### OpenTelemetry Configuration
```typescript
{
  resource: { serviceName: "my-otel-service" }
}
```

## License
MIT
npm package: @opens/utils
Description: A simple package to help with some common tasks
Author: Opens Tecnologia
Latest version: 2.4.1

# @opens/utils

## Descrição

`@opens/utils` é um pacote simples que ajuda com algumas tarefas comuns, como normalização de números de telefone.

## Instalação

Para instalar o pacote, use o npm:

```sh
npm install @opens/utils
```
npm package: @opensale/sdk
Description: 🛠 An SDK for building applications on top of nkt.
Latest version: 0.0.1

# Pancakeswap SDK

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Actions Status](https://github.com/pancakeswap/pancakeswap-sdk/workflows/CI/badge.svg)](https://github.com/pancakeswap/pancakeswap-sdk)
[![npm version](https://img.shields.io/npm/v/@pancakeswap-lib/sdk/latest.svg)](https://www.npmjs.com/package/@pancakeswap-lib/sdk/v/latest)

## Running tests

To run the tests, follow these steps. You must have at least node v10 and [yarn](https://yarnpkg.com/) installed.

First clone the repository:

```sh
git clone https://github.com/pancakeswap/pancakeswap-sdk.git
```

Move into the pancakeswap-sdk working directory

```sh
cd pancakeswap-sdk/
```

Install dependencies

```sh
yarn install
```

Run tests

```sh
yarn test
```

You should see output like the following:

```sh
yarn run v1.22.4
$ tsdx test
 PASS  test/constants.test.ts
 PASS  test/pair.test.ts
 PASS  test/fraction.test.ts
 PASS  test/miscellaneous.test.ts
 PASS  test/entities.test.ts
 PASS  test/trade.test.ts

Test Suites: 1 skipped, 6 passed, 6 of 7 total
Tests:       3 skipped, 82 passed, 85 total
Snapshots:   0 total
Time:        5.091s
Ran all test suites.
✨  Done in 6.61s.
```
npm package: @opensale/uikit
Description: Set of UI components for pancake projects
Latest version: 0.0.6

# 🥞 Opensale UIkit

[![Version](https://img.shields.io/npm/v/@opensale/uikit)](https://www.npmjs.com/package/@opensale/uikit) [![Size](https://img.shields.io/bundlephobia/min/@opensale/uikit)](https://www.npmjs.com/package/@opensale/uikit)

Opensale UIkit is a set of React components and hooks used to build pages on Opensale's apps. It also contains a theme file for dark and light mode.

## Install

`yarn add @opensale/uikit`

## Setup

### Theme

Before using Opensale UIkit, you need to provide the theme file to styled-component.

```
import { ThemeProvider } from 'styled-components'
import { light, dark } from '@opensale/uikit'
...
<ThemeProvider theme={isDark}>...</ThemeProvider>
```

### Reset

A reset CSS is available as a global styled component.

```
import { ResetCSS } from '@opensale/uikit'
...
<ResetCSS />
```
npm package: @opensanca/burro-react
Description: Biblioteca de Componentes React para o Burro
Author: Guilherme Diego
Latest version: 1.0.5

# Burro React
Essa biblioteca vem com os componentes do Burro de css já implementados para react :)

# Contribuindo
- Recomendamos usar a versão do node >= 8.6 (npm +5).
- fork/clone o repositório completo do burro
- `cd react && npm install`
- crie uma branch com prefixo `fix/` ou `feature/` como o que será feito
- quando acabar lembre de documentar no **storybook** e garatir que os testes estão ok
- crie um Pull Request para a master