open-index/open-npm huggingface dataset:
npm package: @profpowell/pdf-viewer
Description: A PDF viewer web component wrapping PDF.js with navigation, zoom, search, thumbnails, and theme support
Author: Prof Thomas Powell
Latest version: 0.1.0

pdf-viewer is a stand alone web component like browser-window, code-block, code-playground, and others.  The components use CSS variables for deep theme support and work with vanilla breeze but are stand alone.  
The components use custom events and are frame work agnostic.  The component follows the same repository patterns with JSDocs, a doc site, heavy unit and playwright testing and best practices established elsewhere.  Actual viewing of PDFs can be performed by dependencies this component coordinates, wraps, and controls.  This makes it like code-block and code-playground which very much rely on other things

All source here is local, but once figured out it will be pushed to Github in the ProfPowell account

See ~/src/browser-window, ~/src/vanilla-breeze, ~/src/code-block, ~src/code-playground for patterns
npm package: @profranchising/react-intl-currency-input
Description: A React component for i18n currency input using the Intl API.
Latest version: 0.4.2

## react-intl-currency-input

A React component for i18n currency input using [Intl API](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl).

### Installation

```sh
$ npm install react-intl-currency-input --save-dev
```

### How to use

```js
import React from "react"
import IntlCurrencyInput from "react-intl-currency-input"

const currencyConfig = {
  locale: "pt-BR",
  formats: {
    number: {
      BRL: {
        style: "currency",
        currency: "BRL",
        minimumFractionDigits: 2,
        maximumFractionDigits: 2,
      },
    },
  },
};

const BrlCurrencyComponent = () => {
  const handleChange = (event, value, maskedValue) => {
    event.preventDefault();

    console.log(value); // value without mask (ex: 1234.56)
    console.log(maskedValue); // masked value (ex: R$1234,56)
  };

  return(
    <IntlCurrencyInput currency="BRL" config={currencyConfig}
            onChange={handleChange} />
  );
}

export default BrlCurrencyComponent;

```
### Example

![example](https://user-images.githubusercontent.com/333482/228024696-844101c3-3e4d-419e-8e69-cf649245789c.png)

To run the example:

```sh
$ npx turbo run start:app
```

And a new browser window will open at [http://localhost:3000](http://localhost:3000)

### Properties

| Name | Type | Default | Description |
| :---: | :---: | :---: | :--- |
| defaultValue | number | 0 | Sets the default / initial value to be used by the component on the first load |
| currency | string | USD | Sets the [currency code](http://www.xe.com/iso4217.php) |
| config | object | USD related configuration | Configuration object compliant with react-intl [intlShape](https://github.com/yahoo/react-intl/wiki/API#intlshape) |
| autoFocus | boolean | false | Enables auto-focus when the component gets displayed |
| autoSelect | boolean | false | Enables auto-select when the component gets displayed |
| autoReset | boolean| false | Resets component's internal state when loses focus |
| onChange | function | undefined | `(event, value, maskedValued) => {}`<br><br>Exposes the `Event` itself, the `value` with no mask and `maskedValue` for displaying purposes |
| onFocus | function | undefined | `(event, value, maskedValued) => {`<br><br>Called when the component gains focus |
| onBlur | function | undefined| `(event, value, maskedValued) => {`<br><br>Called when the component loses focus |
| onKeyPress | function| undefined | `(event, key, keyCode) => {}`<br><br>Called when a `key` is pressed |
| max | number| undefined | Maximum value for the input. Input does not change if the value is greater than max |

All the other undocumented properties available for any `React Component` should also be available.
npm package: @profteam/modal
Description: Modals for fast development
Latest version: 0.2.2

## Test coverage 
[![codecov](https://codecov.io/gh/prof-team/modal/branch/main/graph/badge.svg?token=5QE70W0I80)](https://codecov.io/gh/prof-team/modal)  

## Demo  
https://stackblitz.com/edit/react-redux-modal-for-fast-development

## NPM package
https://www.npmjs.com/package/@profteam/modal

## To release new version you need  
- make your changes and change version in the file `package.json`
- commit and push your changes
- in the project where you want to use package `@profteam/modal` run in console - `yarn upgrade @profteam/modal`
npm package: @profullstack/qrypt-decrypt
Description: CLI tool to decrypt QryptChat encrypted key files
Author: ProFullStack
Latest version: 1.1.3

# @profullstack/qrypt-decrypt

CLI tool to decrypt QryptChat encrypted key files.

## Installation

```bash
npm install -g @profullstack/qrypt-decrypt
```

## Usage

```bash
qrypt-decrypt your-key-file.json
```

The tool will prompt you for the password used to encrypt the keys.

## Requirements

- Node.js v20 or newer
- A QryptChat key export file (.json)
- The password used to export the keys

## Example

```bash
$ qrypt-decrypt qryptchat-pq-keys-2025-01-20T12-30-45-123Z.json
🔐 QryptChat Key Decryption Tool v1.0.0

🔑 Enter password: [hidden]
🔓 Decrypting keys...

✅ Keys decrypted successfully!

📊 Key Information:
   Version: 2.0
   Exported: 2025-01-20T12:30:45.123Z

🔐 ML-KEM-1024 Keys:
   Algorithm: ML-KEM-1024
   Public Key: iVBORw0KGgoAAAANSUhEUgAAAfQAAAH0CAYAAADL1t+KAAA...
   Private Key: [PROTECTED - 4216 characters]

⚠️  Keep your private keys secure and never share them!
```

## Security

This tool uses the same AES-GCM-256 decryption method as the QryptChat web interface. It only decrypts and displays key information - it does not store or transmit any data.

## License

MIT
npm package: @profusion/apollo-federation-upload
Description: This library makes it easier to support file uploads to your federated micro-services. It uses the [Apollo](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) server's solution. It works by simply redirecting the file uploaded stream to 
Author: Guilherme Iscaro
Latest version: 4.2.0

# Apollo Federation file upload

This library makes it easier to support file uploads to your federated
micro-services. It uses the [Apollo](https://www.apollographql.com/docs/apollo-server/data/file-uploads/) server's solution.
It works by simply redirecting the file uploaded stream to the micro-service.
This package does not use third-party services to send the package to your
micro-services.

## Apollo Federation V2 Support

Please, use version 4.0.0+. For Federation V1 use 3.0.0 or earlier.

## Using HTTP Transfer-Encoding: chunked

By default, the `FileUploadDataSource` uses chunked transfers; we
advise that you do not change this setup. However, for some reason
you can't support this kind of transfer, one can provide the `useChunkedTransfer`
option to the `FileUploadDataSource` constructor as `false` to not
use chunked transfer (See the example below on setting this property).
Be advised once again that this can lead to DDOS attacks.

## Preventing CSRF attacks

This package uses `graphql-upload`, if you want to prevent a CSRF attack you should keep
the CSRF prevention feature enabled, and configure your upload clients to send a non-empty
`Apollo-Require-Preflight` header.

You can take a look at [Apollo's security guide](https://www.apollographql.com/docs/apollo-server/security/cors/#preventing-cross-site-request-forgery-csrf) for more details.

#### How to enable CRSF Prevention

```javascript
import { ApolloServer } from 'apollo-server';

const runServer = async () => {
  const server = new ApolloServer({
    /*
     If activated it will request by default a header with ['x-apollo-operation-name', 'apollo-require-preflight']

     You can also change the allowed headers by passing them to csrfPrevention.requestHeaders
    */
    csrfPrevention: true,
    ...
  });
...
};

...
```

## Example

On your Gateway, you must add the `FileUploadDataSource` in order
to the micro-service be able to receive the uploaded file(s).


```javascript
import { ApolloServer } from 'apollo-server';
import { ApolloGateway } from '@apollo/gateway';
import FileUploadDataSource from '@profusion/apollo-federation-upload';

const runServer = async () => {
  const server = new ApolloServer({
    gateway: new ApolloGateway({
      // Add this line in order to support file uploads.
      buildService: ({ url }) => new FileUploadDataSource({ url, useChunkedTransfer: true }),
      serviceList: [
        /* The services ... */
      ],
    })
  });

  const { url } = await server.listen();

  console.log(`🚀  Server ready at ${url}`);
};

runServer().catch(error => {
  console.error('💥  Failed to start server:', error);
  process.exit(1);
});
```
npm package: @profusion/apollo-query-ttl
Description: This project provides an implementation of Apollo Hook Queries (useQuery and useLazyQuery) with a TTL (Time To Live) for cache hits.
Latest version: 0.0.1

# Apollo Queries With TTL

This project provides an implementation of Apollo Hook Queries (useQuery and useLazyQuery) with a TTL (Time To Live) for cache hits.

These hooks are useful when you want to control how long your queries can fetch data from cache. In another words, you can provide a TTL in miliseconds to the hook,
it will use the `cache-first` fetch policy until the TTL time expires, the next fetch after expiration will use a `network-only` policy, then, the TTL will be applied again.

Check Apollo Client docs about fetch policy, [here](https://www.apollographql.com/docs/react/data/queries/#supported-fetch-policies)

# Instalattion

```bash
$ npm i @profusion/apollo-query-ttl

$ yarn add @profusion/apollo-query-ttl
```

# Hooks

This lib exports two hooks:

- `useQueryWithTTL`: wraps Apollo's useQuery hook with TTL logic

Usage:

```ts
const QUERY = gql`
  query ContinentsQuery {
    data {
      id
      payload
    }
  }
`;

const TryQueryTTL = (): JSX.Element => {
  const { data } = useQueryWithTTL({
    query,
    queryOptions: {}, // you can provide all the options available on useQuery
    ttl: 10000, // it will allow cache hits for 10 seconds
  });

  return (
    <pre>
      {JSON.stringify(data)}
    </pre>
  )
}
```

- `useLazyQueryWithTTL`: wraps Apollo's useLazyQuery hook with TTL logic

Usage:

```ts
const QUERY = gql`
  query ContinentsQuery {
    data {
      id
      payload
    }
  }
`;

const TryQueryTTL = (): JSX.Element => {
  const [fetch, { data }] = useLazyQueryWithTTL({
    query,
    queryOptions: {}, // you can provide all the options available on useQuery
    ttl: 10000, // it will allow cache hits for 10 seconds
  });

  return (
    <div>
      <pre>
        {JSON.stringify(data)}
      </pre>
      <button onClick={fetch}>Fetch!</button>
    </div>
  )
}
```

# Typing the data

You can type your `data` and variables in the same way you do on default queries:

```ts
interface DataType {}
interface VariablesType {}

const { data } = useQueryWithTTL<DataType, VariablesType>({
  query,
  queryOptions: {
    variables: {},
  },
  ttl: 10000,
});

// data and queryOptions.variables will be
// typed as DataType and VariablesType, respectivelly
```
npm package: @profusion/json-schema-to-typescript-definitions
Description: Automatic TypeScript definitions from JSON Schema7 (no code generation!)
Author: Gustavo Sverzut Barbieri
Latest version: 0.2.1

# TypeScript from JSON Schema

This is a TypeScript definitions that can automatically generate
TypeScript types given JSON Schema definitions **without** the
need of any code generator.

The caveat is that the JSON Schema must be declared using string
literals instead of generic strings, this is achieved by declaring the
objects `as const`.

The associated helper files will aid that task with some constants
and functions that returns properly typed constructions.

## Install

```sh
yarn add @profusion/json-schema-to-typescript-definitions
```

If you don't use our `commonSchemas` or `schemaHelpers`, you can
use it as a `--dev` dependency since the TypeScript checks are
done only in compile time.

## Usage

```ts
import type { TypeFromJSONSchema } from '@profusion/json-schema-to-typescript-definitions';

type MyObject = TypeFromJSONSchema<{
  type: 'object';
  properties: {
    a: { type: 'boolean' };
  };
  additionalProperties: false;
}>;
const o: MyObject = { a: true };
```

One can also use the function helpers to get properly typed objects:

```ts
import { commonSchemas, schemaHelpers } from '@profusion/json-schema-to-typescript-definitions';

// declares an actual schema object, you can use with Ajv and others
const schema = schemaHelpers.object({
  properties: {
    a: commonSchemas.boolean,
  },
});
const o: TypeFromJSONSchema<typeof schema> = { a: true };
```

## Similar Packages

This package is similar to
[json-schema-to-typescript](https://www.npmjs.com/package/json-schema-to-typescript),
however that one uses a code-generator that can work out JSON files.

This package requires `as const` so strings are kept as literals, but
requires no code generation. If you define your JSON schemas using
TypeScript, then you can avoid that code generation burden.

## License

Open source - [MIT](https://opensource.org/licenses/MIT).
npm package: @profusion/lazy-load-obj
Description: Lazy Load Object Fields
Author: Gustavo Sverzut Barbieri
Latest version: 1.0.1

# Lazy Load Object Fields

Simple [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)
that coordinates loading fields of an object on demand.

This is useful to be matched with GraphQL, where one can return a
shallow object (ie: `{ id }`) and let the properties be loaded in one
go once used.

## Example

See [examples/](./examples/).

```typescript
/* eslint-disable no-console */
/* eslint-disable import/no-extraneous-dependencies */
import process from 'process';
import fetch from 'node-fetch';

import lazyLoadObj from '../lib';

const baseUrl = 'https://jsonplaceholder.typicode.com/';

type Todo = {
  completed: boolean;
  id: number;
  title: string;
};

const lazyTodo = lazyLoadObj<Todo>(
  { id: Number(process.argv[2] || 1) },
  async (
    { id }: Partial<Todo>,
    properties: readonly (keyof Todo)[],
  ): Promise<Partial<Todo>> => {
    console.log(`loading todos/${id} properties`, properties);
    const response = await fetch(`${baseUrl}todos/${id}`);
    return response.json();
  },
);

const { title } = lazyTodo;
console.log('accessing title results in', title);
if (title instanceof Promise) {
  console.log('wait title promise...');
  title.then(
    value => {
      console.log('fetched title', value);
      // the next access will always return a value, since it's cached:
      console.log('access cached title', lazyTodo.title);
    },
    error => console.error('failed to fetch title', error),
  );
}
```