open-index/open-npm huggingface dataset:
npm package: @sageprotocol/sdk
Description: SDK to integrate with sage protocol
Author: sageprotocol
Latest version: 0.9.3

# Sage Protocol SDK

[Documentation](https://docs.sageprotocol.xyz)

This library contains all the interaction points necessary to integrate with the Sage contracts on Sui.

### Channels

- Create
- Join / Leave
- Add / Remove Moderators
- Post
- Update
- Query for create events
- Query for membership change events
- Query for moderation change events
- Query for channel post events
- Query for update events

### Invites

- Query for create events
- Query for delete events

### Post

- Comment on another post
- Like a post
- Query for post create events
- Query for post like events

### User

- Create
- Join / Leave
- Post
- Update
- Query for create events
- Query for memebership change events
- Query for user post events
- Query for update events
npm package: @sagewai/tokens
Description: Sagewai design tokens — colors, spacing, typography, motion for Tailwind CSS 4
Latest version: 0.1.0

# @sagewai/tokens

Sagewai design tokens for Tailwind CSS 4. Provides colors, spacing, typography, motion, and dark mode support as CSS custom properties.

## Install

```bash
npm install @sagewai/tokens
```

**Peer dependency:** Tailwind CSS 4+

## Usage

Import in your global CSS file:

```css
@import "@sagewai/tokens/src/index.css";
```

This gives you:

- **Tailwind 4** via `@import "tailwindcss"`
- **Design tokens** as CSS custom properties in a `@theme` block
- **Dark mode** via `[data-theme="dark"]` selector
- **Motion tokens** (durations, easing curves, keyframes)
- **Base styles** (body reset, scrollbar, focus rings)

## Tokens Included

### Colors

| Token | Light | Dark |
|-------|-------|------|
| `--color-primary` | `#0E7490` (Sage Teal) | `#26C6DA` |
| `--color-secondary` | `#B45309` (Circuit Gold) | `#FFB74D` |
| `--color-accent-purple` | `#7E22CE` | `#9C27B0` |
| `--color-accent-orange` | `#C2410C` | `#FF7043` |
| `--color-bg-page` | `#FFFFFF` | `#0A1628` |
| `--color-bg-surface` | `#F8FAFC` | `#111D35` |
| `--color-text-primary` | `#0F172A` | `#F0F4F8` |
| `--color-success` | `#15803D` | `#4CAF50` |
| `--color-error` | `#DC2626` | `#EF5350` |
| `--color-warning` | `#D97706` | `#FFB74D` |

### Spacing

`--spacing-xs` (4px), `--spacing-sm` (8px), `--spacing-md` (16px), `--spacing-lg` (24px), `--spacing-xl` (32px), `--spacing-2xl` (48px)

### Typography

- `--font-heading` / `--font-body`: Inter (system-ui fallback)
- `--font-mono`: JetBrains Mono (ui-monospace fallback)

### Radii

`--radius-sm` (6px), `--radius-md` (8px), `--radius-lg` (12px), `--radius-xl` (16px)

### Motion

`--duration-fast` (120ms), `--duration-base` (200ms), `--duration-slow` (350ms)

`--ease-standard`, `--ease-enter`, `--ease-exit`

## Dark Mode

Set `data-theme="dark"` on the root element:

```javascript
document.documentElement.setAttribute('data-theme', 'dark');
```

All color tokens are automatically overridden.

## Tailwind 4 Integration

Tokens are defined in a `@theme` block, so Tailwind 4 automatically generates utility classes:

- `--color-primary` becomes `text-primary`, `bg-primary`, `border-primary`
- `--spacing-md` becomes `p-md`, `m-md`, `gap-md`
- `--radius-lg` becomes `rounded-lg`

## License

MIT
npm package: @sagge/gatsby-plugin-react-helmet-canonical-urls
Description: Add canonical links to HTML pages Gatsby generates using React Helmet.
Author: Sakari Pesonen
Latest version: 1.4.1

# gatsby-plugin-react-helmet-canonical-urls

This can be use as a drop in replacement of [`gatsby-plugin-canonical-urls`](https://www.npmjs.com/package/gatsby-plugin-canonical-urls).

Add canonical links to HTML pages Gatsby generates using react helmet.

This implementation is primarily helpful for distinguishing between https/http,
www/no-www but could possibly be extended to help with when sites add multiple
paths to the same page.

## Motivation

`gatsby-plugin-canonical-urls` and `gatsby-plugin-react-helmet` are plugins that do not always play well together.
The first one always inserts a default canonical url, but doesn't allow to override that value in an easy way.
When trying to use react helmet to override `gatsby-plugin-canonical-urls` default url, you will end up with
two canonical tags.

This plugin, as writes the default canonical url using react helmet, allows to override default canonical url just
using the standard react helmet api.

## Install

`npm install --save gatsby-plugin-react-helmet gatsby-plugin-react-helmet-canonical-urls`

## How to use

```javascript
// In your gatsby-config.js
plugins: [
  `gatsby-plugin-react-helmet`,
  {
    resolve: `gatsby-plugin-react-helmet-canonical-urls`,
    options: {
      siteUrl: `https://www.example.com`,
    },
  },
]
```

With the above configuration, the plugin will add to the head of every HTML page
a `rel=canonical` e.g.

```html
<link rel="canonical" href="http://www.example.com/about-us/" />
```

Additional `options`:

- `exclude` (Array of `string` or `RegExp`, default `undefined`): exclude pages from being added a canonical url. Useful when combining with other SEO-related meta tags like _noindex_. (Urls should be listed without trailing slash)
- `noTrailingSlash` (default `false`): it will remove the trailing slash from canonical link. Use this option if you use [`gatsby-plugin-remove-trailing-slashes`](https://www.npmjs.com/package/gatsby-plugin-remove-trailing-slashes)
- `noHash` (default `false`): remove hash from the canonical link.
- `noQueryString` (default `false`): remove query from the canonical link.
npm package: @saggn/high-promise
Description: A nicer wrapper for JavaScript Promise
Author: Sagi Sergio Nadir
Latest version: 1.0.2

# High Promise

This is a wrapper for the native es6 promise to make the Promise syntax a bit nicer.

## How to use high-promise
```javascript
// import high-promise
const highPromise = require('high-promise');
```
```javascript
const multiplyVal = highPromise((resolve, reject, x) => resolve(x * x));
  
const fs = require('fs');
const readFile = highPromise((resolve, reject, path) => 
    fs.readFile(path, 'utf-8', (err, data) => resolve(data)));
    
// Same use
multiplyVal(3).then(console.log) // 9
readFile('path.txt').then(console.log) // path.txt content
```

`highPromise` has to receive a function with `(resolve, reject)` as the first two parameters, additional paramteres are
added later like this `(resolve, reject, x, y, z)`

## Before high-promise
```javascript
const multiplyVal = x => 
  new Promise(resolve, reject) => resolve(x * x);
  
const fs = require('fs');

const readFile = path => 
  new Promise(resolve, reject) => 
    fs.readFile(path, 'utf-8', (err, data) => resolve(data))
    
 multiplyVal(3).then(console.log) // 9
 readFile('path.txt').then(console.log) // path.txt content
```

Notice the constant `new Promise` which is nested inside a function, it's necessary to wrap the promise because it's 
evaluated instantly without any way to pass extra variables into it.
npm package: @saghen/hermes
Description: Generic interface for one and two way communication layer
Author: Liam Dyer
Latest version: 2.0.0-alpha.5

# hermes

Hermes provides a generic interface for one way (Endpoints) and two way (Sockets) communication. It requires a transport for sending data between the server and client. The library provides transport implementations for HTTP (Endpoints only), Websocket, Web `postMessage`, Browser Extension `browser.runtime.sendMessage/port` and a loopback.

## Usage

```ts
import { createRouter, createEndpointClient, createSocketClient, Socket } from './src'
import { createLoopback, LoopbackRequestMetadata } from './src/transports/loopback'

const loopback = createLoopback()

// Setup router
const endpoints = {
  add: async (a: number, b: number) => a + b,
  deep: {
    echo: async (message: string) => message,
  },
  fail: () => Promise.reject('This endpoint fails'),
  metadata: async (hello: 'world', metadata: LoopbackRequestMetadata) => hello,
}
const sockets = {
  echo: async (socket: Socket<any, any>) => {
    for await (const message of socket.receiveIter()) {
      await socket.send(message)
    }
  },
  test: async () => {},
}
const router = createRouter(endpoints, sockets)
loopback.listen(router)

// Setup clients
const endpointClient = createEndpointClient<typeof router.endpoints>(loopback.endpointTransport)
const socketClient = createSocketClient<typeof router.sockets>(loopback.socketTransport)

// Test endpoint client
await endpointClient.add(1, 2).then(console.log) // '3'
await endpointClient.deep.echo('foo').then(console.log) // 'foo'
await endpointClient.fail().catch(console.error) // 'This endpoint fails'
await endpointClient.metadata('world') // the second argument metadata passed by loopback transport

// Test socket client
const socket = await socketClient.echo()
await socket.send('Hello world!')
await socket.receive().then(console.log) // 'Hello world'
```
npm package: @sagi.io/cfw-slack
Description: Slack API for Cloudflare Workers
Author: Sagi Kedmi
Latest version: 0.0.27
Deprecated: Moved to @sagi.io/workers-slack

# cfw-slack

[`@sagi.io/cfw-slack`](https://www.npmjs.com/package/@sagi.io/cfw-slack) allows
you to use Slack's Web API within Cloudflare Workers.

[![CircleCI](https://circleci.com/gh/sagi/cfw-slack.svg?style=svg&circle-token=e5282bece02d965a8fcde66d517bb599f20aa2e4)](https://circleci.com/gh/sagi/cfw-slack)
[![MIT License](https://img.shields.io/npm/l/@sagi.io/cfw-slack.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![version](https://img.shields.io/npm/v/@sagi.io/cfw-slack.svg?style=flat-square)](http://npm.im/@sagi.io/cfw-slack)

## Installation

~~~
$ npm i @sagi.io/cfw-slack
~~~

## Cloudflare Workers Usage

Initialize `SlackREST`:

~~~js

// Without token:
const SlackREST = require('@sagi.io/cfw-slack')
const SlackAPI = new SlackREST()

// With token:
const botAccessToken = process.env.SLACK_BOT_ACCESS_TOKEN;
const SlackREST = require('@sagi.io/cfw-slack')
const SlackAPI = new SlackREST({ botAccessToken })
~~~

You can then use supported [Slack methods](https://api.slack.com/methods).
For instance, here's how to use the [`chat.postMessage`](https://api.slack.com/methods/chat.postMessage) method:

~~~js

// SlackREST was initialized with a token
const formData = { channel: 'general', text: 'hello world'}

// SlackREST wasn't initialized with a token
const botAccessToken = process.env.SLACK_BOT_ACCESS_TOKEN;
const formData = { token: botAcccessToken, channel: 'general', text: 'hello world' }

const result = await SlackREST.chat.postMessage(formData)
~~~
npm package: @sagi.io/dns-over-https
Description: RFC-8484 Compliant DNS-over-HTTPS API
Author: Sagi Kedmi
Latest version: 0.0.2

# DNS-over-HTTPS API for Node.js

[`@sagi.io/dns-over-https`](https://www.npmjs.com/package/@sagi.io/dns-over-https) is an RFC-8484 compliant Node.js [DNS over HTTPS](https://en.wikipedia.org/wiki/DNS_over_HTTPS) API.

[![CircleCI](https://circleci.com/gh/sagi/dns-over-https-node.svg?style=svg)](https://circleci.com/gh/sagi/dns-over-https-node)
[![Coverage Status](https://coveralls.io/repos/github/sagi/dns-over-https-node/badge.svg?branch=master)](https://coveralls.io/github/sagi/dns-over-https-node?branch=master)
[![MIT License](https://img.shields.io/npm/l/@sagi.io/dns-over-https.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![version](https://img.shields.io/npm/v/@sagi.io/dns-over-https.svg?style=flat-square)](http://npm.im/@sagi.io/dns-over-https)

## Installation

~~~
$ npm install --save @sagi.io/dns-over-https
~~~

## API

We import as follows:
~~~js
const doh = require('@sagi.io/dns-over-https')
~~~

#### doh.query(...)

~~~js
doh.query = ({
  name,
  method = 'POST',
  hostname = 'cloudflare-dns.com',
  path = '/dns-query',
  port = 443,
  userAgent = '@sagi.io/dns-over-https',
  type = 'A',
  klass = 'IN',
  useHttps = true,
})
~~~

A `name` is mandatory. You can set your own `method`, `hostname`, `path`, `port`, `userAgent`, `type`, `klass` and `useHttps`.

A `Promise` that resolves to a `DNS`  response object is returned.


For instance,

```js
const doh = require('@sagi/dns-over-https')
(async () => {
  const dnsResponse  = await doh.query({name: 'sagi.io'})
})()
```

Results in:
```
{
  "id": 0,
  "type": "response",
  "flags": 384,
  "flag_qr": true,
  "opcode": "QUERY",
  "flag_aa": false,
  "flag_tc": false,
  "flag_rd": true,
  "flag_ra": true,
  "flag_z": false,
  "flag_ad": false,
  "flag_cd": false,
  "rcode": "NOERROR",
  "questions": [
    {
      "name": "sagi.io",
      "type": "A",
      "class": "IN"
    }
  ],
  "answers": [
    {
      "name": "sagi.io",
      "type": "A",
      "ttl": 300,
      "class": "IN",
      "flush": false,
      "data": "151.101.1.195"
    },
    {
      "name": "sagi.io",
      "type": "A",
      "ttl": 300,
      "class": "IN",
      "flush": false,
      "data": "151.101.65.195"
    }
  ],
  "authorities": [],
  "additionals": []
}

```

More usage examples can be found in [`example`](https://github.com/sagi/dns-over-https-node/blob/master/example/index.js).

## License
MIT
npm package: @sagi.io/doh
Description: RFC-8484 Compliant DNS-over-HTTPS Command Line Tool
Author: Sagi Kedmi
Latest version: 0.0.1

# DoH (DNS over HTTPS) Command Line Client, RFC-8484 Compatible

[`@sagi.io/doh`](https://www.npmjs.com/package/@sagi.io/doh) is an RFC-8484 compliant  Node.js [DNS over HTTPS](https://en.wikipedia.org/wiki/DNS_over_HTTPS) command line tool.

[![CircleCI](https://circleci.com/gh/sagi/doh-node.svg?style=svg)](https://circleci.com/gh/sagi/doh-node)
[![Coverage Status](https://coveralls.io/repos/github/sagi/doh-node/badge.svg?branch=master)](https://coveralls.io/github/sagi/doh-node?branch=master)
[![MIT License](https://img.shields.io/npm/l/@sagi.io/doh.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![version](https://img.shields.io/npm/v/@sagi.io/doh.svg?style=flat-square)](http://npm.im/@sagi.io/doh)

## Installation:
~~~
$ npm i -g @sagi.io/doh
~~~

Usage:
~~~
Usage: doh name [type] [class] [@dohUrl] [-p<port>] [-u<userAgent>] [-v] [-g];
~~~

If only `name` (domain name) is provided, it defaults to using Cloudflare's DNS-over-HTTPS server
(`@cloudflare-dns.com/dns-query`).

## Examples

~~~
$ doh sagi.io
~~~

Output:
~~~json
{
  "id": 9013,
  "type": "response",
  "flags": 384,
  "flag_qr": true,
  "opcode": "QUERY",
  "flag_aa": false,
  "flag_tc": false,
  "flag_rd": true,
  "flag_ra": true,
  "flag_z": false,
  "flag_ad": false,
  "flag_cd": false,
  "rcode": "NOERROR",
  "questions": [
    {
      "name": "sagi.io",
      "type": "A",
      "class": "IN"
    }
  ],
  "answers": [
    {
      "name": "sagi.io",
      "type": "A",
      "ttl": 300,
      "class": "IN",
      "flush": false,
      "data": "151.101.1.195"
    },
    {
      "name": "sagi.io",
      "type": "A",
      "ttl": 300,
      "class": "IN",
      "flush": false,
      "data": "151.101.65.195"
    }
  ],
  "authorities": [],
  "additionals": []
}
~~~

~~~
$  doh mx sagi.io @https://dns.google.com/experimental
~~~

Output:
~~~json
{
  "id": 0,
  "type": "response",
  "flags": 384,
  "flag_qr": true,
  "opcode": "QUERY",
  "flag_aa": false,
  "flag_tc": false,
  "flag_rd": true,
  "flag_ra": true,
  "flag_z": false,
  "flag_ad": false,
  "flag_cd": false,
  "rcode": "NOERROR",
  "questions": [
    {
      "name": "sagi.io",
      "type": "MX",
      "class": "IN"
    }
  ],
  "answers": [
    {
      "name": "sagi.io",
      "type": "MX",
      "ttl": 299,
      "class": "IN",
      "flush": false,
      "data": {
        "preference": 10,
        "exchange": "mxa.mailgun.org"
      }
    },
    {
      "name": "sagi.io",
      "type": "MX",
      "ttl": 299,
      "class": "IN",
      "flush": false,
      "data": {
        "preference": 10,
        "exchange": "mxb.mailgun.org"
      }
    }
  ],
  "authorities": [],
  "additionals": []
}
~~~

Probably some time the future we'll add a `DiG`-like output.

## License
MIT
npm package: @sagi.io/gcp-jwt
Description: Generate JWT (JSON Web Token) for GCP (Google Cloud Platform)
Author: Sagi Kedmi
Latest version: 0.0.4
Deprecated: Moved to @sagi.io/cfw-jwt

# gcp-jwt

[`@sagi.io/gcp-jwt`](https://www.npmjs.com/package/@sagi.io/gcp-jwt) helps you
generate a `JWT` from `GCP`'s service accounts. It uses the Web Crypto API under the hood.
The package works with accordance to [Google's JWT Auth guide](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#jwt-auth).


[![CircleCI](https://circleci.com/gh/sagi/gcp-jwt.svg?style=svg)](https://circleci.com/gh/gcp-jwt)
[![Coverage Status](https://coveralls.io/repos/github/sagi/gcp-jwt/badge.svg?branch=master)](https://coveralls.io/github/sagi/gcp-jwt?branch=master)
[![MIT License](https://img.shields.io/npm/l/@sagi.io/gcp-jwt.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![version](https://img.shields.io/npm/v/@sagi.io/gcp-jwt.svg?style=flat-square)](http://npm.im/@sagi.io/gcp-jwt)

## Installation

~~~
$ npm i @sagi.io/gcp-jwt
~~~

## Example

Suppose you'd like to use `Firestore`'s REST API. The first step is to generate
a service account with the "Cloud Datastore User" role. Please download the
service account and store its contents in the `SERVICE_ACCOUNT_JSON_STR` environment
variable.

The `aud` is defined by GCP's [service definitions](https://github.com/googleapis/googleapis/tree/master/google)
and is simply the following concatenated string: `'https://' + SERVICE_NAME + '/' + API__NAME`.
More info [here](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#jwt-auth).

For `Firestore` the `aud` is `https://firestore.googleapis.com/google.firestore.v1.Firestore`.

## Cloudflare Workers

Cloudflare Workers expose the `crypto` global for the `Web Crypto API`.

~~~js
const jwt = require('@sagi.io/gcp-jwt')

const serviceAccountJsonStr = await ENVIRONMENT.get('SERVICE_ACCOUNT_JSON_STR', 'text')
const aud = `https://firestore.googleapis.com/google.firestore.v1.Firestore`

const token = await jwt(serviceAccountJsonStr, aud, crypto)

const headers = { Authorization: `Bearer ${token}` }

const projectId = 'example-project'
const collection = 'exampleCol'
const document = 'exampleDoc'

const docUrl =
  `https://firestore.googleapis.com/v1/projects/${projectId}/databases/(default)/documents`
  + `/${collection}/${document}`

const response = await fetch(docUrl, { headers })

const documentObj =  await response.json()
~~~

## Node

We use the `node-webcrypto-ossl` package to imitate the `Web Crypto API` in Node.

~~~js
const WebCrypto = require('node-webcrypto-ossl');
const crypto = new WebCrypto();

<... SAME AS CLOUDFLARE WORKERS ...>
~~~
npm package: @sagi.io/globalthis
Description: A globalThis polyfill.
Author: Sagi Kedmi
Latest version: 0.0.2

# **`globalThis`** Polyfill

[`@sagi.io/globalthis`](https://www.npmjs.com/package/@sagi.io/globalthis) is
a `globalThis` polyfill that is based on [Mathias Bynens](https://mathiasbynens.be/notes/globalthis)'s' implementation.

[![CircleCI](https://circleci.com/gh/sagi/globalThis.svg?style=svg)](https://circleci.com/gh/sagi/globalThis)
[![Coverage Status](https://coveralls.io/repos/github/sagi/globalThis/badge.svg?branch=master)](https://coveralls.io/github/sagi/globalThis?branch=master)
[![MIT License](https://img.shields.io/npm/l/@sagi.io/globalthis.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![version](https://img.shields.io/npm/v/@sagi.io/globalthis.svg?style=flat-square)](http://npm.im/@sagi.io/globalthis)



## Usage

ESM:

~~~js
import '@sagi.io/globalthis'
~~~

CJS:

~~~js
require('@sagi.io/globalthis')
~~~

You can now access `globalThis`.
npm package: @sagi.io/workers-slack
Description: Slack API for Cloudflare Workers
Author: Sagi Kedmi
Latest version: 0.0.58

# workers-slack

[`@sagi.io/workers-slack`](https://www.npmjs.com/package/@sagi.io/workers-slack) allows
you to use Slack's Web API within Cloudflare Workers.

⭐ We use it at **[OpenSay](https://opensay.co/s=workers-slack)** to access Slack's REST API through Cloudflare Workers.

Here is a [blog post](https://sagi.io/slack-api-for-cloudflare-workers/) that explains why I built it.


[![CircleCI](https://circleci.com/gh/sagi/workers-slack.svg?style=svg&circle-token=e5282bece02d965a8fcde66d517bb599f20aa2e4)](https://circleci.com/gh/sagi/workers-slack)
[![MIT License](https://img.shields.io/npm/l/@sagi.io/workers-slack.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![version](https://img.shields.io/npm/v/@sagi.io/workers-slack.svg?style=flat-square)](http://npm.im/@sagi.io/workers-slack)

## Installation

~~~
$ npm i @sagi.io/workers-slack
~~~

## Cloudflare Workers Usage

If you use Cloudflare's Wrangler you must set the [`node_compat`](https://developers.cloudflare.com/workers/wrangler/configuration/#inheritable-keys) flag in your `wrangler.toml` - the reason for this is that this library is built both for Cloudflare Workers and Node.js (for which we need `globals`).

Initialize `SlackREST`:

~~~js

// Without token:
const SlackREST = require('@sagi.io/workers-slack')
const SlackAPI = new SlackREST()

// With token:
const botAccessToken = process.env.SLACK_BOT_ACCESS_TOKEN;
const SlackREST = require('@sagi.io/workers-slack')
const SlackAPI = new SlackREST({ botAccessToken })
~~~

You can then use supported [Slack methods](https://api.slack.com/methods).
For instance, here's how to use the [`chat.postMessage`](https://api.slack.com/methods/chat.postMessage) method:

~~~js

// SlackREST was initialized with a token
const formData = { channel: 'general', text: 'hello world'}

// SlackREST wasn't initialized with a token
const botAccessToken = process.env.SLACK_BOT_ACCESS_TOKEN;
const formData = { token: botAcccessToken, channel: 'general', text: 'hello world' }

const result = await SlackREST.chat.postMessage(formData)
~~~

### Verifying requests from Slack

More information [here](https://api.slack.com/authentication/verifying-requests-from-slack).

The `SlackREST.helpers.verifyRequestSignature` method returns `true` when a signature from Slack is verified. Otherwise it throws an error.

~~~js
const SlackREST = require('@sagi.io/workers-slack')
const SlackAPI = new SlackREST()

const signingSecret = process.env.SLACK_SIGNING_SECRET
const isVerifiedRequest = await SlackAPI.helpers.verifyRequestSignature(request, signingSecret)
~~~
npm package: @sagifire/async-utils
Description: A NodeJS library providing utilities for managing and simplifying asynchronous code tasks
Author: sagifire
Latest version: 1.0.3

# @sagifire/async-utils

A NodeJS library providing utilities for managing and simplifying asynchronous code tasks. It provides a set of functions to simplify the usage of callback-based APIs and EventEmitters by converting them to Promises.

## Installation

Install the package using npm:

```sh
npm install @sagifire/async-utils
```

## Usage

You can use this library in both CommonJS and ES Modules environments.

### CommonJS

```javascript
const { promisifySyncFunction, waitCallback, waitOnce } = require('@sagifire/async-utils');

// Example usage
const asyncFunction = promisifySyncFunction(syncFunction);
asyncFunction(arg1, arg2).then(result => console.log(result));
```

### ES Modules
```javascript
import { promisifySyncFunction, waitCallback, waitOnce } from '@sagifire/async-utils';

// Example usage
const asyncFunction = promisifySyncFunction(syncFunction);
asyncFunction(arg1, arg2).then(result => console.log(result));
```

## API

### promisifySyncFunction(...)

Converts a callback-based function to a promise-based one.

#### Parameters

* `syncFunction {function(...args: any, function)}` - The callback-based function to be converted.

#### Returns

* `function(...[*]): Promise<unknown>` - A function that returns a Promise resolving with the callback results or rejecting with an error.

#### Example

```javascript
const syncFunction = (arg1, arg2, callback) => {
  callback(null, arg1, arg2);
};

const asyncFunction = promisifySyncFunction(syncFunction);
asyncFunction('foo', 'bar').then(result => {
  console.log(result); // ['foo', 'bar']
});
```

### waitCallback(...)

Waits for a callback-based function to complete and returns the result as a promise.

#### Parameters

* `syncFunction {function(...args: any, function)}` - The callback-based function to be executed.
* `fArgs {any}` - The arguments to be passed to the function. 

#### Returns

* `Promise<function(...[*]): Promise<unknown>>` - A Promise resolving with the callback results or rejecting with an error.

#### Example

```javascript
const syncFunction = (arg1, arg2, callback) => {
  callback(null, arg1, arg2);
};

waitCallback(syncFunction, 'foo', 'bar').then(result => {
  console.log(result); // ['foo', 'bar']
});
```

### waitOnce(...)

#### Parameters

* `eventEmitter {EventEmitter}` - The EventEmitter instance.
* `eventId {string}` - The event ID to listen for.

#### Returns

* `Promise<unknown>` - A Promise resolving with the event data.

#### Example
```javascript
const { EventEmitter } = require('events');
const eventEmitter = new EventEmitter();
const eventId = 'testEvent';

setTimeout(() => {
  eventEmitter.emit(eventId, 'eventData');
}, 50);

waitOnce(eventEmitter, eventId).then(result => {
  console.log(result); // 'eventData'
});
```

## Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

## License

This project is licensed under the MIT License. See the LICENSE file for details.
npm package: @sagifire/di-container
Description: A lightweight and flexible dependency injection container designed to manage object lifetimes and resolve dependencies efficiently in TypeScript/JavaScript applications.
Author: sagifire
Latest version: 1.1.11

# @sagifire/di-container

This library implements a simple Inversion of Control (IoC) container with support for various object types and lifetimes, compatible with both JavaScript and TypeScript.

## Overview

A minimalistic IoC container for managing dependencies in your application. It provides `Container`, `asValue`, `asClass`, `asFunction`, and `asFactory` helpers.

## Why Choose @sagifire/di-container?

*   **Simplicity:** Get started quickly with a straightforward API. No complex configuration or steep learning curve.
*   **Lightweight:** Minimal footprint, ideal for projects where bundle size matters.
*   **Flexibility:** Supports various registration types (values, classes, functions, factories) and lifetimes.
*   **Asynchronous Ready:** Built-in support for async factories and dependency resolution.
*   **TypeScript Friendly:** Offers strong typing support when used with TypeScript.
*   **Reliable:** Works seamlessly with code obfuscation and minification.

If you need a simple, reliable, and flexible IoC container without the overhead of larger frameworks, @sagifire/di-container is an excellent choice.

## Documentation

For detailed usage instructions and examples, please refer to the specific guides:

*   **JavaScript:**
    *   [English Guide](./documentation/js_en.md)
    *   [Ukrainian Guide (Українська інструкція)](./documentation/js_uk.md)
*   **TypeScript:**
    *   [English Guide](./documentation/ts_en.md)
    *   [Ukrainian Guide (Українська інструкція)](./documentation/ts_uk.md)

These guides cover:
*   Container creation and component registration (`register`)
*   Component types (`asValue`, `asClass`, `asFunction`, `asFactory`)
*   Lifetimes (`LIFETIME_SINGLETON`, `LIFETIME_DYNAMIC`)
*   Defining and injecting dependencies (`_deps`, `deps`)
*   Using asynchronous factories
*   Building instances outside the container (`build`)
*   Handling inheritance
npm package: @sagittal/general
Description: general utilities for the Sagittal notation system
Latest version: 1.0.160

![test](https://github.com/Sagittal/sagittal-general/actions/workflows/test.yml/badge.svg)

# sagittal-general

general utilities for the Sagittal notation system

## development

`make build` builds two versions of the package: one with CJS modules and one with ESM modules; otherwise exactly the
same. This is so the project can be used isomorphically (in both Node and the browser). The two packages are exposed
as `main` and `module`, respectively. `sideEffects: false` has been marked in `package.json` to allow the ESM version to
be tree-shaken by consumers.
npm package: @sagittal/system
Description: Implementations of Sagittal notations, accidental parsing, useful metrics, comma naming, and finding and analyzing commas using Sagittal-specific properties.
Latest version: 1.0.118

![test](https://github.com/Sagittal/sagittal-system/actions/workflows/test.yml/badge.svg)

# sagittal-system

Implementations of Sagittal notations, accidental parsing, useful metrics, comma naming, and finding and analyzing commas using Sagittal-specific properties.

## development

`make build` builds two versions of this package: one with CJS and one with ESM.

This is so the project can be used isomorphically (in both Node and the browser).

The two packages are exposed as `main` and `module`, respectively.

`sideEffects: false` has been marked in `package.json` to allow the ESM version to be tree-shaken by consumers.

The CJS package uses the default `tsconfig.json` (the same one Jasmine tests use) while the EMS simply passes a couple overriding configuration properties via the CLI.
npm package: @saglik360/assistant-client-library
Description: This library provides a simple way to authenticate and interact with an assistant API
Author: 360 Saglik ve Turizm Hizmeteleri A.S.
Latest version: 1.0.6

# 360 Assistant Javascript Client Library

This library provides a simple way to authenticate and interact with an assistant API using TypeScript/JavaScript. The `AssistantClient` class helps in setting up authentication and sending requests to the server.

## Features

- **Authentication**: Authenticate users with the provided patient information
- **Server Communication**: Send requests to different server environments (Development, Production, etc.)
- **Type Safety**: Full TypeScript support with type definitions

## 📋 Requirements

- Node.js 14.0+
- npm or yarn

## 🛠️ Installation

Add the package to your project using npm:

```bash
npm install @saglik360/assistant-client-library
```

Or using yarn:

```bash
yarn add @saglik360/assistant-client-library
```

## 🔑 Authentication

## 💻 Usage

```ts
import { AssistantClient } from "@saglik360/assistant.client-library";
import { Patient, Policy } from "@saglik360/assistant.client-library/interface";
import { ServerType, GenderType } from "@saglik360/assistant.client-library/enum";
import crypto from "crypto";

async function main() {
  
  const client: AssistantClient = new AssistantClient({
    clientId: 'Your Client ID',
    secretKey: 'Your Secret Key',
    serverType: ServerType.Development // or ServerType.Production,
  });
  
  const policyInstance: Policy = {
    id: 'Your Policy Unique ID',
    policyNumber: 'Your Policy Number',
    startDate: new Date(),
    endDate: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000),
    group: 'Custom Field',
    description: 'Test Policy',
  };
  
  const patient: Patient = {
    id: 'Your Patient Unique ID',
    gsmCountryCode: '+90',
    gsm: '5551231234',
    firstName: 'Richard',
    lastName: 'Stallman',
    countryCode: 'TUR',
    nationalId: '12345678901',
    passportNumber: '12345678901',
    policy: policyInstance,
    birthDate: new Date('1988-06-25'),
    gender: GenderType.Male,
  };
  
  const auth = await client.authenticatePatient(patient);
  console.log(JSON.stringify(auth, null, 2));
}

main().catch(console.error);

```

## Response

```json
{
  "data": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwdWJsaWNLZXkiOiIxZjcyNWRiNi01MjRjLTQwM2Qt.....",
    "accessTokenExpiredTime": "2025-02-19T12:26:56.019Z",
    "redirectUrl": "https://uri.360saglik.dev/OwXTRSuCJmPF1zt"
  },
  "actions": [],
  "message": "success",
  "isSuccess": true,
  "statusCode": 200,
  "error": null
}
```

## 📝 License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
npm package: @sagold/rje-aria-widgets
Description: <p align="center">   <img src="./src/docs/he-full-2000x564.png" width="100%" alt="rje-aria-widgets"><br />   <img src="./src/docs/title-widgets-700x76.png" width="350px" alt="rje-aria-widgets"> </p>
Latest version: 0.34.0

<p align="center">
  <img src="./src/docs/he-full-2000x564.png" width="100%" alt="rje-aria-widgets"><br />
  <img src="./src/docs/title-widgets-700x76.png" width="350px" alt="rje-aria-widgets">
</p>

> Simple and extensible React component capable of using JSON Schema to declaratively build and customize user forms.

install

`yarn add @sagold/rje-aria-widgets`

[![Npm package version](https://badgen.net/npm/v/@sagold/rje-aria-widgets)](https://github.com/sagold/json-editor/tree/main/packages/rje-aria-widgets)
![Types](https://badgen.net/npm/types/@sagold/rje-aria-widgets)

This library of components and widgets comes unstyled, but different css files can be combined to add basic styling or a full dark and light theme.

```tsx
import { JsonForm, widgets } from '@sagold/rje-aria-widgets';
import '@sagold/rje-aria-widgets/dist/styles.css';

function MyForm({ schema, data }) {
  return (
    <JsonForm
      widgets={widgets}
      schema={schema}
      data={data}
      onChange={(data) => {
        console.log('data', data);
      }}
    />
  );
}
```
npm package: @sagold/rje-code-widgets
Description: <p align="center">   <img src="https://github.com/sagold/json-editor/blob/main/packages/react-json-editor/docs/he-full-2000x564.png?raw=true" width="100%" alt="_react-json-editor">      <img src="../../images/title-rje-code-widgets-700.png" width="350px" 
Latest version: 0.36.0
npm package: @sagold/rje-mantine-widgets
Description: <p align="center">   <img src="./src/docs/images/he-full-2000x564.png" width="100%" alt="rje-mantine-widgets"><br />   <img src="./src/docs/images/title-mantine-widgets-700x76.png" width="350px" alt="rje-mantine-widgets"> </p>
Latest version: 0.36.0
npm package: @sagold/rje-widgets
Description: <p align="center">   <img src="./docs/he-full-2000x564.png" width="100%" alt="rje-widgets"><br />   <img src="./docs/title-widgets-700x76.png" width="350px" alt="rje-widgets"> </p>
Latest version: 0.33.8

<p align="center">
  <img src="./docs/he-full-2000x564.png" width="100%" alt="rje-widgets"><br />
  <img src="./docs/title-widgets-700x76.png" width="350px" alt="rje-widgets">
</p>

> Simple and extensible React component capable of using JSON Schema to declaratively build and customize user forms.

install 

`yarn add @sagold/rje-widgets`

[![Npm package version](https://badgen.net/npm/v/@sagold/rje-widgets)](https://github.com/sagold/json-editor/tree/main/packages/rje-widgets)
![Types](https://badgen.net/npm/types/@sagold/rje-widgets)

This library of components and widgets comes unstyled, but different css files can be combined to add basic styling or a full dark and light theme.

```tsx
import { JsonForm, widgets } from '@sagold/rje-widgets';
import '@sagold/rje-widgets/dist/styles.css';

function MyForm({ schema, data }) {
  return (
    <JsonForm
      widgets={widgets}
      schema={schema}
      data={data}
      onChange={(data) => {
        console.log('data', data);
      }}
    />
  );
}
```
npm package: @sagold/schemascript
Description: build json-schema definitions using helper functions
Author: Sascha Goldhofer
Latest version: 1.1.0

# schemascript

> build json-schema definitions using helper functions

`yarn install @sagold/schemascript`

This is a simple utility to remove redundant json-schema syntax

## helpers

export| type    | result
------|---------|-----------------
i()   | integer | { type: "integer" }
o()   | object  | { type: "object" }
n()   | number  | { type: "number" }
b()   | boolean | { type: "boolean" }
a()   | array   | { type: "array" }
s()   | string  | { type: "string" }
e()   | enum    | { enum: [] }

Each method takes any number of objects as input, merging them to the exported schema

## examples

```js
import { i, o, n, b, a, s, e } from "@sagold/schemascript";

s("default-value");
// { type: "string", default: "default-value" }

s({ minLength: 2 }, "default-value");
// { type: "string", minLength: 2, default: "default-value" }

o();
// { type: "object"}

o({ minProperties: 4 });
// { type: "object", minProperties: 4 }

o({ properties: { title: s() } });
// { type: "object", properties: { title: { type: "string" }} }

o({ title: s(), minProperties: 4 });
// { type: "object", minProperties: 4, properties: { title: { type: "string" }} }

a({ minItems: 2 });
// { type: "array", minItems: 2 }

a(s(), { minItems: 2 });
// { type: "array", minItems: 2, items: { type: "string" } }

a([s(), n(), b()], { minItems: 2 });
// { type: "array", minItems: 2, items: [ {type: "string"}, {type: "number"}, {type: "boolean"} ] }
```

building a json-schema could look like

```js
o({
  document: o({
    type: s("doc"),
    content: a(o({
      type: "node",
      content: a()
    }))
  }).$required()
});
```

resulting in

```js
{
  type: "object",
  required: ["document"],
  properties: {
    document: {
      type: "object",
      properties: {
        type: {
          type: "string",
          default: "doc"
        },
        content: {
          type: "array",
          items: {
            type: "object",
            properties: {
              content: {
                type: "array"
              }
            }
          }
        }
      }
    }
  }
}
```

you can always pass json-schema properties directly

```js
o({
  title: "root-object",
  required: ["title"],
  properties: {
    title: s({
      $id: "title",
      title: "app-title",
      minLength: 2
    })
  },
  additionalProperties: {
    // ...
  }
});
```
npm package: @sagrimson/snowpack
Description: The ESM-powered frontend build tool. Fast, lightweight, unbundled.
Author: Fred K. Schott
Latest version: 3.8.14

[![CI](https://github.com/withastro/snowpack/workflows/CI/badge.svg?event=push)](https://github.com/withastro/snowpack/actions)

### What is Snowpack?

**Snowpack is a modern, lightweight toolchain for web application development.** Traditional dev bundlers like webpack or Parcel need to rebuild & rebundle entire chunks of your application every time you save a single file. This introduces lag between changing a file and seeing those changes reflected in the browser, sometimes as slow as several seconds.

Snowpack solves this problem by serving your application **unbundled in development.** Any time you change a file, Snowpack never rebuilds more than a single file. There's no bundling to speak of, just a few milliseconds of single-file rebuilding and then an instant update in the browser via HMR. We call this new approach **O(1) Build Tooling.** You can read more about it in our [Snowpack 2.0 Release Post.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/)

When you're ready to deploy your web application to users, you can add back a traditional bundler like Webpack or Parcel. With Snowpack you get bundled & optimized production performance without sacrificing dev speed by adding an unnecessary bundler,

### Key Features

- A dev environment that starts up in **50ms or less.**
- Changes are reflected [instantly in the browser.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#hot-module-replacement)
- Integrates your favorite bundler for [production-optimized builds.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#snowpack-build)
- Out-of-the-box support for [TypeScript, JSX, CSS Modules and more.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#features)
- Connect your favorite tools with custom [build scripts](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#build-scripts) & [third-party plugins.](https://www.snowpack.dev/posts/2020-05-26-snowpack-2-0-release/#build-plugins)

**💁 More info at the official [Snowpack website ➞](https://snowpack.dev)**
npm package: @sagtech/sagtech-ui
Description: Components from SagTech team
Latest version: 0.1.3

<p align="center">
  <a href="https://sagtech.io" rel="noopener" target="_blank"><img width="100" src="/public/logo.svg" alt="sagtech logo"></a>
</p>

<h1 align="center">Sagtech-UI</h1>

Welcome to the **sagtech-ui** design repository! Dive into an ocean of meticulously crafted styles and components that power our applications at SagTech. Every component in this library ensures not just functionality but also the aesthetics that resonate with our brand. Best part? We believe in the power of community and sharing. So, these designs and components are open and free for everyone to use and adapt. Let's build beautiful things together!

## Installation

Sagtech UI is available as an [npm package](https://www.npmjs.com/package/sagtech-ui).

**npm:**

```bash
npm install @sagtech/sagtech-ui
```

**yarn:**

```bash
yarn add @sagtech/sagtech-ui

```

Import stylesheets into the App.js or App.tsx

```javascript
import '@sagtech/sagtech-ui/dist/bundle.esm.css';
```

## Getting started with Sagtech UI

### AnimationButton Component

![chrome_XjQjgS56qh](https://github.com/Sag-Tech/Sagtech-UI/assets/95652563/1f39ce7e-b2b6-424c-8ed5-b3ac90f08a7c)

```javascript
import { AnimationButton } from "@sagtech/sagtech-ui";

<AnimationButton text="View the project" />;
```