open-index/open-npm huggingface dataset:
npm package: @flexbase/http-client-middleware
Description: Http client middleware
Author: Flexbase
Latest version: 2.0.13

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_http-client-middleware&metric=coverage)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_http-client-middleware)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_http-client-middleware&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_http-client-middleware)

# http-client-middleware

This is a middleware package to wrap http authentication.

## Usage

Using [wretch](https://github.com/elbywan/wretch)

### Client Credentials

```typescript
const clientCredentials = {
  tokenUrl: "https://some.url/auth/token",
  refreshTokenUrl: "https://some.url/auth/refresh",
  clientId: "myclient id",
  clientSecret: "super secret"
};

class SimpleAuthenticationTokenStore implements AuthenticationTokenStore {
    private _authenticationToken: AuthenticationToken | null = null;

    retrieveToken(): IAuthenticationToken | null {
        return this._authenticationToken;
    }

    storeToken(token: IAuthenticationToken | null): void {
        this._authenticationToken = token;
    }
}

const authMiddleware = authenticationTokenMiddleware({
    credentialProvider: () => clientCredentials,
    tokenAccessor: new ClientCredentialsAuthenticationTokenAccessor(),
    tokenStore: new SimpleAuthenticationTokenStore()
});

wretch(...).middlewares([authMiddleware]);
```

### Password Credentials

```typescript
// for password creds we only need to supply the urls as user/pass will come from a login form
const passwordCredentials = {
  tokenUrl: "https://some.url/auth/token",
  refreshTokenUrl: "https://some.url/auth/refresh",
};

class SimpleAuthenticationTokenStore implements AuthenticationTokenStore {
    private _authenticationToken: AuthenticationToken | null = null;

    retrieveToken(): IAuthenticationToken | null {
        return this._authenticationToken;
    }

    storeToken(token: IAuthenticationToken | null): void {
        this._authenticationToken = token;
    }
}

const authMiddleware = authenticationTokenMiddleware({
    credentialProvider: () => passwordCredentials,
    tokenAccessor: new PasswordAuthenticationTokenAccessor(),
    tokenStore: new SimpleAuthenticationTokenStore()
});

wretch(...).middlewares([authMiddleware]);
```
npm package: @flexbase/logger
Description: Flexbase logger interface
Author: Flexbase
Latest version: 3.0.1

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_logger&metric=coverage)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_logger)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_logger&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_logger)

# Logger

Defines a Logger interface that we can use in libraries and not force a specific logging framework on the consumer.

```ts
/**
 * Represents a type used to perform logging
 */
export interface Logger {
  /**
   * Write an error level log
   * @param message An object or string to log
   * @param optionalParams Additional parameters to be logged
   */
  error(message: unknown, ...optionalParams: unknown[]): void;
  /**
   * Write a warning level log
   * @param message An object or string to log
   * @param optionalParams Additional parameters to be logged
   */
  warn(message: unknown, ...optionalParams: unknown[]): void;
  /**
   * Write an information level log
   * @param message An object or string to log
   * @param optionalParams Additional parameters to be logged
   */
  info(message: unknown, ...optionalParams: unknown[]): void;
  /**
   * Write a debug level log
   * @param message An object or string to log
   * @param optionalParams Additional parameters to be logged
   */
  debug(message: unknown, ...optionalParams: unknown[]): void;
  /**
   * Write a trace level log
   * @param message An object or string to log
   * @param optionalParams Additional parameters to be logged
   */
  trace(message: unknown, ...optionalParams: unknown[]): void;
}
```
npm package: @flexbase/observable-subject
Description: Observable subject event bus
Author: Flexbase Technologies
Latest version: 2.1.2

# observable-subject

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_observable-subject&metric=coverage)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_observable-subject)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_observable-subject&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_observable-subject)

Observable subject event bus

## Installation

```
npm install @flexbase/observable-subject
```

or

```
yarn add @flexbase/observable-subject
```

## Usage

```ts
import { Subject, subjectManager } from '@flexbase/observable-subject';

// create a subject
const subject: Subject = { key: Symbol() };

// register the subject
await subjectManager.register(subject);

// subscribe to the subject
const subscription = subjectManager.subscribe<number>(subject, async context => {
  await new Promise(_ => setTimeout(_, context.value));
});

// notify subscriptions
await subjectManager.notify(subject, { value: 1000 });

// unsubscribe
subscription.unsubscribe();
```
npm package: @flexbase/store-react
Description: React extensions for @flexbase/store
Author: Flexbase Technologies
Latest version: 3.0.0

# store-react

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_store-react&metric=coverage)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_store-react) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_store-react&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_store-react)

## Installation

`npm install @flexbase/store-react`

or

`yarn add @flexbase/store-react`

## Usage

### useStore

integrates [useState](https://reactjs.org/docs/hooks-reference.html#usestate) with [flexbase store](https://github.com/flexbase-eng/store)

```ts
import { useStore } from '@flexbase/store-react';

export const component = () => {
  const [value, setValue] = useStore(store);

  return (
    <div>
      <p>You clicked {value} times</p>
      <button onClick={() => setValue(count + 1)}>Click me</button>
    </div>
  );
};
```

### useStoreLayout

integrates [useLayoutEffect](https://reactjs.org/docs/hooks-reference.html#uselayouteffect) with [flexbase store](https://github.com/flexbase-eng/store)

```ts
import { useStoreLayout } from '@flexbase/store-react';

export const component = () => {
  const [value, setValue] = useStoreLayout(store);

  return (
    <div>
      <p>You clicked {value} times</p>
      <button onClick={() => setValue(count + 1)}>Click me</button>
    </div>
  );
};
```
npm package: @flexbe/sandbox-sdk
Description: SDK for communicating with Flexbe Sandbox Controller
Author: Flexbe Team
Latest version: 0.3.5

# Flexbe Sandbox SDK

A TypeScript SDK for communicating with Flexbe Sandbox Controller, providing the same API structure as CodeSandbox SDK.

## Installation

```bash
npm install @flexbe/sandbox-sdk
```

## Quick Start

```typescript
import { SandboxSDK } from '@flexbe/sandbox-sdk';

const client = new SandboxSDK({
    id: 'my-sandbox',
    url: 'http://localhost:8080',
    token: 'your-auth-token'
});

// Test connection
const isConnected = await client.ping();
console.log('Connected:', isConnected);
```

## Documentation

- [Getting Started](./docs/getting-started.md)
- [Commands API](./docs/commands.md)
- [Tasks API](./docs/tasks.md)
- [File System API](./docs/filesystem.md)
- [Ports API](./docs/ports.md)
- [WebSocket & Events](./docs/websocket.md)
- [Examples](./docs/examples.md)

## Examples

To run the examples:

```bash
# Run filesystem operations demo
bun examples/filesystem.ts

# Run commands demo
bun examples/commands.ts

# Run ports demo
bun examples/ports.ts

# Run WebSocket demo
bun examples/websocket-test.ts

# Run heartbeat & connection monitoring demo
bun examples/heartbeat-demo.ts

# Run simple file watching test
bun examples/simple-watch-test.ts
```
npm package: @flexbe/sdk
Description: TypeScript SDK for Flexbe API
Author: Flexbe
Latest version: 0.2.44

# Flexbe TypeScript SDK

A TypeScript SDK for interacting with the Flexbe API. Works in both Node.js and browser environments.

## Installation

```bash
npm install @flexbe/sdk
```

## Usage

```typescript
import { FlexbeClient } from '@flexbe/sdk';

// Initialize the client with API Key authentication
const client = new FlexbeClient({
    apiKey: 'your-api-key',
    baseUrl: 'https://api.flexbe.com', // optional
    timeout: 30000, // optional, defaults to 30 seconds
});
const siteApi = client.getSiteApi(SITE_ID);

// Using the Pages API for a specific site
try {
    // Get list of pages for site
    const pages = await siteApi.pages.getPages({
        limit: 10,
        offset: 0,
        type: 'page',
        status: 'published',
    });
    console.log(pages.pages);

    // Get a single page from site
    const page = await siteApi.pages.getPage(123);
    console.log(page);
}
catch (error) {
    console.error(error.message);
}

```

## Features

- TypeScript support with full type definitions
- Multiple authentication methods:
  - API Key authentication
  - JWT Bearer token authentication with automatic token refresh (uses cookie-based authentication)
- Automatic error handling
- Configurable timeout and base URL
- Native fetch API support (works in both Node.js and browser)
- Multi-site support with site-specific API instances
- Query parameter handling
- Request timeout handling
- Token sharing between browser tabs (for JWT authentication)

## Environment Variables

The SDK supports the following environment variables:

- `FLEXBE_API_KEY`: Your API key (required for API Key authentication)
- `FLEXBE_API_URL`: Base URL (defaults to 'https://api.flexbe.com')

## Development

```bash
# Install dependencies
npm install

# Build the SDK
npm run build

# Run tests
npm test

# Lint code
npm run lint
```

## License

MIT
npm package: @flexdash/node-red-fd-corewidgets
Description: A set of core FlexDash widgets for Node-RED.
Author: Thorsten von Eicken
Latest version: 0.4.64

Core FlexDash Widgets for Node-RED
==================================

This repository builds a core set of Node-RED nodes corresponding to the core FlexDash widgets,
i.e. the ones built into FlexDash.

It also contains a set of example flows to get started and see FlexDash in action.

Read the [quick-start docs](https://flexdash.github.io/docs/quick-start/) for info on how to get started.

TL;DR:
- install @flexdash/node-red-fd-corewidgets
- import the 'Hello World' example flow from its examples using the Node-RED import menu
- deploy and point your browser at http://localhost:1880/flexdash (or similar)
- import the 'all-widgets' example, deploy, and see the 'rocket' tab in FlexDash

---

This repository itself does not contain any widgets or any nodes, the way it works is as follows:
- the FlexDash source is downloaded and the widgets in
  https://github.com/tve/flexdash/tree/v0.3/src/widgets are copied into `./widgets`
- the [@flexdash/node-red-fd-flexdash](https://npmjs.org/package/@flexdash/node-red-flexdash)
  NPM module is installed (`npm install`)
- the node code generator from node-red-fd-flexdash is run to generate the nodes
- the set of generated nodes are published to NPM

The widget generation and publishing to npm happens as part of the github
workflow in `.github/workflows/build.yml`.

For help, please read the [FlexDash Docs](https://flexdash.github.io/docs)
and check the [Node-RED forum](https://discourse.nodered.org).
npm package: @flexdash/node-red-fd-testnodes
Description: A set of Node-RED FlexDash nodes to test FlexDash integration into Node-RED.
Author: Thorsten von Eicken
Latest version: 0.0.8

node-red-fd-testnodes
======================

A collection of Node-RED test nodes for FlexDash in various states of working and non-working...

## Installation

Some nodes rely on the node generator in `node-red-flexdash`, which is expected to be
in a sibling directory.
After that `./generate.sh` should do the trick...
npm package: @flexdemo/validators
Description: This Package Provides a number of validators, that can be used to validate incomming and outgoing messages
Author: FlexDeMo
Latest version: 0.0.38

# flexdemo-utils-validators
The Aim of this Project is it, to provide all necessary validators for the Frontend, REST API and Backend
All Schemas will be collected in this project, and for each Schema a validator will be exported.