open-index/open-npm huggingface dataset:
npm package: @oddbit/unifi
Description: Unifi API client library
Author: Dennis Alund
Latest version: 2.0.1

# @oddbit/unifi
 [![npm version](https://img.shields.io/npm/v/@oddbit/unifi.svg)](https://www.npmjs.com/package/@oddbit/unifi) ![npm](https://img.shields.io/npm/l/@oddbit/unifi.svg)

An easy to use and Typscript friendly API client for managing UBNT UniFi accesspoints.


The UniFi API is officially not very well documented, the project started out from [this shell script](https://dl.ubnt.com/unifi/5.4.16/unifi_sh_api) but I've found that the source code of the PHP project
[UniFi-API-browser](https://github.com/Art-of-WiFi/UniFi-API-browser) is the best API documentation
at the moment. Thanks guys!

## Actions
The following actions are supported.

- Authorization
    - Login
    - Logout
- Clients (STA/connected devices)
    - Reconnect client
    - List clients
    - Get client
    - Block client
    - Unblock client
    - Set or remove client alias
    - Set or remove client notes
- Hotspot guest access
    - Authorize guest
    - Unauthorize guest
    - List vouchers
    - Create vouchers
    - Delete vouchers
- System
    - Get UniFi controller system info
    - List sites
    - List access points with device info
    - List sessions

## How to use it

Below is a simple example of synchronous communication with the UniFI controller to authorize a guest (device) at the hotspot.

### Basic
The basics of how to create a controller reference and login / logout.

```typescript
import * as unifi from "@oddbit/unifi";

const controller = new unifi.UnifiController({
    host: "10.11.12.13",
    isSelfSigned: true,
    siteName: "default"
});

await controller.login("admin", "secretPassword");
// ...
// Work with the controller
// ...
await controller.logout();
```

### Discovering controller information
In some cases it can be good to first look up information about the site and update configuration accordingly.
This is a sample of fetching the site names and setting to a non-default value

```typescript
const sites = await controller.listSites();
sites.forEach(site => {
    if (site.name !== "default") {
        controller.setSite(site.name);
    }
})
```


### Authorizing a guest to connect through the hotspot
The first parameter is the MAC of the connecting device. This is captured by the hotspot and passed to your portal page in the page redirection.

```typescript
const clientMac = "00:11:22:33:44:55";
const accessPointMac = "66:77:88:99:aa:bb";
const authResponse = await controller.authorizeGuest(clientMac, accessPointMac);
```
npm package: @oddbluedog/gatsby-source-strapi-support-markdown-images
Description: Gatsby source plugin for building websites using Strapi as a data source with a workaround to support markdown images
Author: Strapi Solutions
Latest version: 0.0.19

# gatsby-source-strapi

Source plugin for pulling documents into Gatsby from a Strapi API.

## Info

Published version of this fork: https://github.com/unagigd/gatsby-source-strapi (forked to with minor changes: https://github.com/OddBlueDog/gatsby-source-strapi)

More info here: https://github.com/strapi/gatsby-source-strapi/pull/122#issuecomment-765175178

## Install

`npm install --save @oddbluedog/gatsby-source-strapi-support-markdown-images`

## How to use

See more here: https://github.com/strapi/gatsby-source-strapi/pull/122#issuecomment-612969087

```javascript
// In your gatsby-config.js
plugins: [
  {
    resolve: `@oddbluedog/gatsby-source-strapi-support-markdown-images`,
    options: {
      apiURL: `http://localhost:1337`,
      queryLimit: 1000, // Default to 100
      contentTypes: [`article`, `user`],
      //If using single types place them in this array.
      singleTypes: [`home-page`, `contact`],
      // Possibility to login with a strapi user, when content types are not publically available (optional).
      loginData: {
        identifier: '',
        password: '',
      },
      markdownImages: {
        typesToParse: {
          article: ['content'],
        },
      },
    },
  },
]
```

## How to query

You can query Document nodes created from your Strapi API like the following:

```graphql
{
  allStrapiArticle {
    edges {
      node {
        id
        title
        content
      }
    }
  }
}
```

To query images you can do the following:

```graphql
{
  allStrapiArticle {
    edges {
      node {
        id
        singleImage {
          publicURL
        }
        multipleImages {
          localFile {
            publicURL
          }
        }
      }
    }
  }
}
```
npm package: @oddcamp/analytics
Description: Odd Camp analytics helpers library
Author: Odd Camp
Latest version: 0.0.7

# Odd Camp analytics helpers library

A collection of analytics helper functions.

## Supported analytics services

- Plausible
- Ahoy

### Plausible

Make sure the API object is available at `window.plausible`. It usually is if the snippet was inserted via `<script>`.

### Plausible

Make sure the API object is available at `window.ahoy`. If you use it as NPM module you can expose the object like this:

```js
import ahoy from "ahoy.js"

window.ahoy = ahoy
```
  

###

## Usage

1. Install

```js
$ yarn add @oddcamp/analytics
```

2. Enjoy

```js
import { enableAutoEventAnalytics } from "@oddcamp/analytics"

enableAutoEventAnalytics()
```

HTML

```html
  <a href="/" data-event-analytics='{"name": "Click", "props": {"trigger": "anchor"}}'>
    Link
  </a>
```

ERB

```erb
  <%= link_to 'Link', root_path, data: {event_analytics: {name: 'Click', props: {trigger: 'anchor'}}} %>
```

JSX

```jsx
  <a href="/" data-event-analytics={JSON.stringify({name: 'Click', props: {trigger: 'anchor'}})}>
    Link
  </a>
```

## Development

1. Create `.env` and set variables of analytics services you prefer to test:
    - `PLAUSIBLE_DOMAIN=something.site`
    - `AHOY_SCRIPT_URL=https://unpkg.com/ahoy.js@0.4.0/dist/ahoy.js`
2. `$ yarn install`
3. `$ yarn dev`
3. [localhost:1234](http://localhost:1234)

## API

### `enableAutoEventAnalytics`

Enable automatic event analytics for element clicks and form submissions.

_Defaults:_

```js
enableAutoEventAnalytics({
  attributeName = `event-analytics`,
  sourceNode = document,
  services = [`plausible`, `ahoy`],
  debug = false,
})
```

_Returns:_ function which disables automatic event analytics if executed, e.g.:

```js
const disableAutoEventAnalytics = enableAutoEventAnalytics()
// ...
disableAutoEventAnalytics()
```

The value of `attributeName` attribute must be a JSON, e.g.:

```js
{
  "name": "", // name; mandatory
  "props": {}, // custom properties
  "options": {
    "allFieldsAsProps": false, // sets all form fields as props on form submissions
  }
}
```

Get all form field name and value pairs as props using boolean `allFieldsAsProps`
option or specify field(s) manually by setting `data-event-analytics-field`
attribute, e.g.

```html
  <form data-event-analytics="{...}">
    <input type="search" name="query" data-event-analytics-field>
  </form>
```

Note: the attribute name may differ if you did set a custom value for
`attributeName` parameter (`${attributeName}-field`).

### `analyticizeEvent`

Analyticizes an event.

_Defaults:_

```js
analyticizeEvent({ 
  data, 
  services = [`plausible`, `ahoy`],
  debug = false 
})
```

_Example:_

```js
analyticizeEvent({
  data: {
    name: `Event name`,
    props: {
      key: `value`,
    },
  },
})
```
npm package: @oddcamp/cocoon-vanilla-js
Description: A vanilla JS replacement for (Rails) Cocoon's jQuery script
Author: Odd Camp
Latest version: 1.1.3

# cocoon-vanilla-js

A vanilla JS replacement for (Rails) [Cocoon](https://github.com/nathanvda/cocoon)'s jQuery script

## Usage

Run:

```
yarn add @oddcamp/cocoon-vanilla-js
```

Import as ES6 module:

```js
import "@oddcamp/cocoon-vanilla-js";
```

## Notes

To broaden browser support, include the following polyfills in your project:

- [Element.closest](https://www.npmjs.com/package/element-closest)
- [Element.classList](https://www.npmjs.com/package/classlist-polyfill)
- [Array.from](https://www.npmjs.com/package/array-from-polyfill)
- [CustomEvent](https://www.npmjs.com/package/custom-event-polyfill)
npm package: @oddcamp/pdx-dol
Description: ## Local development
Author: Odd Camp
Latest version: 0.0.4

# Paradox > Dynamic Outbound Links

## Local development

1. `yarn install`
2. `yarn develop`
3. [http://localhost:3000/example.html](http://localhost:3000/example.html)

### Testing the build

1. `yarn serve`
2. [http://localhost:5000/example.html](http://localhost:5000/example.html)

## Usage in production

Install `yarn install @oddcamp/pdx-dol` and

```js
  import PdxDol from "@oddcamp/pdx-dol"

  const pdxdol = new PdxDol()
  pdxdol.start()
```

By default it tracks these parameters:

```
  utm_source
  utm_medium
  utm_campaign
  utm_term
  utm_content
```

### Options

`PdxDol` function accepts an _object_ of the following global options (some of
them have the default values set):

```js
  excludeSelector: `.js--pdxdol-exclude`
  includeSelector: ``
  params: {}
```

### How it works

`PdxDol` intercepts link clicks and adds the configured parameters to URL of
an outbound link.

You can set the global parameters that are appended to all outbound links, e.g.:

```js
  PdxDol({
    params: {
      utmSource: `source`,
      utmMedium: `medium`,
      utmCampaign: `campaign`,
      utmTerm: `term`,
      utmContent: `content`,
    },
  })
```

However, the parameters set via `PdxDol` may be overriden by `window.location`
parameters that are stored in `sessionStorage` and used throughout the session.

You can alter a global parameter for a specific link by using `data-*`
attribute(s) e.g.:

```html
  <a href="https://www.google.com" data-utm-medium="another-medium">Link</a>
```

The user is then redirected to:

```html
  https://www.google.com?utm_source=source&utm_medium=another-medium
```

You can exclude an outbound link or multiple links from being intercepted
by using `excludeSelector` attribute. Let's use the default one, e.g.:

```html
  <a href="https://www.google.com" class="js--pdxdol-exclude">Excluded</a>

  <p class="js--pdxdol-exclude">
    <a href="https://www.google.com">Excluded</a>
    <a href="https://www.google.com">Excluded</a>
  </p>
```

Or you can change the utility behaviour from _include-all_ to _exclude all_ by
by using `includeSelector` that only tracks the matching link clicks.
If both are set `includeSelector` supersedes `excludeSelector`.

As mentioned above, the utility tracks UTM parameters by default. But you can
also append a custom trackable parameters, e.g.:

```js
  PdxDol({
    params: {
      customParam1: ``,
      customParam2: `has-a-value`,
    },
  })
```


### Methods

```js
  start()
  pause()
  resume()
  isPaused()
```

### Browser support

The utility depends on
[URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL)
Web API. If you need this to be supported on IE then
[url-polyfill](https://www.npmjs.com/package/url-polyfill)
will help you out in most of the cases.
npm package: @oddcommon/utils
Description: A collection of utils used by OddCommon
Author: OddCommon
Latest version: 1.2.8

# OddCommon Utils

A set of handy utils.

## Setup 📦

To install in a project: `npm i @oddcommon/utils`

To import in a project: `import { randomNumber } from "@oddcommon/utils";`

## The functions 🛠

- [Browser](#browser)
  - getQueryVar
- [Cookies](#cookies)
  - setCookie
  - deleteCookie
  - getCookie
- [CSS](#css)
  - css
- [Data](#data)
  - stringToBytes
  - bytesToString
- [Device](#device)
  - isMobile
  - isIPad
- [DOM](#dom)
  - q
  - qAll
- [Mouse](#mouse)
  - getMousePosition
- [Numbers](#numbers)
  - randomNumber
  - formatTwoDigits
  - clamp
  - FloatBuffer

### Browser 🏄‍♂️

#### getQueryVar(varName: string)

Return the value of query param from the user's URL.

### Cookies 🍪

#### setCookie(cname: string, cvalue: string, exdays: number)

Sets a cookie.

#### deleteCookie(cname: string)

Deletes a cookie.

#### getCookie(cname: string)

Gets the value of a cookie.

### CSS 🎨

#### css(...args: string[])

Converts an array of strings into a single, space-separated string for CSS classes. Designed for use in React when setting `className` based on state, e.g.:

`<div className={css(Styles.myComponent, isActive && Styles.active)} />`

### Data 🗄️

#### stringToBytes(string: string)

Converts a string to a Uint8Array. Useful when you need to communicate to Bluetooth (e.g., from a user's phone to a VR headset). ASCII only.

#### bytesToString(buffer: buffer)

Converts a Uint8Array to a string. Useful when you need to parse communications from Bluetooth (e.g., from a VR headset). ASCII only.

### Devices 📱

#### isMobile()

Check is user agent is from a mobile device (not just a media query for device width).

#### isIPad()

Checks if user agent is from an iPad (does not return `true` for other tablets).

### DOM 💻

#### q(selector: string, context: element)

A shorthand for `[element].querySelector()`; `context` defaults to `document`.

#### qAll(selector: string, context: element)

A shorthand for `[element].querySelectorAll()`; `context` defaults to `document`.

### Mouse 🖱️

#### getMousePosition(e: event, scrollingContainer: element)

Return the mouse position `{x, y}`. `scrollingContainer` defaults to `document.documentElement`.

### Numbers 🔢

#### randomNumber(min: number, max: number)

Returns a random number between the `min` and `max`.

#### formatTwoDigits(index: number)

If `index` is a single digit, return a string of the number with a "0" affixed to the front of it; else, just return the original number.

#### clamp(value: number, min: number, max: num)

Clamps a value between two numbers.

#### FloatBuffer(size: number)

Creates a buffer of floats that can be sampled to expose the following:

- average
- sum
- sumPositive
- sumNegative
- sumAbs
- max
- min
- maxAbs

The size that is passed in on instantiation will be the size of the array of the buffer. When you call update you pass a new value and it will push into the array, dropping old values. This works well when needing to sample data.
npm package: @oddessentials/odd-dashboard
Description: Terminal dashboard for Distributed Task Observatory
Author: OddEssentials
Latest version: 3.5.0

# npm Shim for odd-dashboard

This package provides a convenient way to install `odd-dashboard` via npm.

## Installation

```bash
npm install -g @oddessentials/odd-dashboard
```

## How it works

The npm package is a thin wrapper that:

1. Downloads the appropriate native binary for your platform during `npm install`
2. Verifies the binary's checksum against the signed SHA256SUMS file
3. Provides a Node.js shim that forwards all arguments to the native binary

## Supported Platforms

- Windows x64
- macOS x64 (Intel)
- macOS arm64 (Apple Silicon)
- Linux x64
- Linux arm64

## Troubleshooting

### Binary not installed

If you see "odd-dashboard binary not installed" when running the command:

1. Check if your platform is supported
2. Try reinstalling: `npm install -g @oddessentials/odd-dashboard`
3. Download manually from [GitHub Releases](https://github.com/oddessentials/odd-demonstration/releases)

### Checksum verification failed

This indicates the downloaded binary may have been tampered with. Please:

1. Do NOT use the downloaded file
2. Report the issue to the maintainers
3. Download directly from GitHub Releases and verify manually

## Alternative Installation Methods

- **Linux/macOS**: `curl -fsSL https://raw.githubusercontent.com/oddessentials/odd-demonstration/main/install.sh | sh`
- **Windows**: `iwr -useb https://raw.githubusercontent.com/oddessentials/odd-demonstration/main/install.ps1 | iex`
- **Homebrew**: `brew install oddessentials/tap/odd-dashboard`
npm package: @oddhill/bankid
Description: A client to help you connect to the BankID API.
Author: Christoffer Palm
Latest version: 1.0.0

# BankID API Client

[![Build Status](https://travis-ci.org/oddhill/node-bankid.svg?branch=master)](https://travis-ci.org/oddhill/node-bankid)
[![Coverage Status](https://coveralls.io/repos/github/oddhill/node-bankid/badge.svg?branch=master)](https://coveralls.io/github/oddhill/node-bankid?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/oddhill/node-bankid.svg)](https://greenkeeper.io/)

This package will help you make requests to the BankID SOAP API.

## Requirements

- A pfx certificate issued by a certified Bank.
- The soap module needs to be installed as a dependency.

## Getting started

Run the following command in your terminal to install the module to your project.

### NPM

```
npm install @oddhill/bankid soap
```

### Yarn

```
yarn add @oddhill/bankid soap
```

## Example

Below is an example showing how to use the library when making a request to the Authenticate method on the BankID SOAP API.

```
const bankid = require('bankid);

const options = {
	pfx: './path-to-your-pfx-certificate.pfx',
	passphrase: 'certpassphrasse',
};

bankid(options, (err, service) => {
	if (err) console.log(err);
	
	const args = {
		personalNumber: '199801011234',
	};
	
	service.authenticate(args, (err, response) => {
		console.log(response);
	});
});
```
npm package: @oddhill/drupal-breakpoints-scss-webpack-plugin
Description: A plugin that will create a scss file with breakpoints from a Drupal theme breakpoints YAML file.
Author: Christoffer Palm
Latest version: 1.0.0

# Drupal breakpoints scss webpack plugin

[![Build Status](https://travis-ci.org/oddhill/drupal-breakpoints-scss-webpack-plugin.svg?branch=master)](https://travis-ci.org/oddhill/drupal-breakpoints-scss-webpack-plugin)
[![Coverage Status](https://coveralls.io/repos/github/oddhill/drupal-breakpoints-scss-webpack-plugin/badge.svg?branch=master)](https://coveralls.io/github/oddhill/drupal-breakpoints-scss-webpack-plugin?branch=master)

This Webpack plugins lets you turn the breakpoints YAML-file from a Drupal theme into variables in a scss-file.

To achieve this this the plugin uses the following package [drupal-breakpoints-scss](https://github.com/jenslind/drupal-breakpoints-scss).

## Install

```
npm install --save-dev @oddhill/drupal-breakpoints-scss-webpack-plugin
# OR
yarn add --dev @oddhill/drupal-breakpoints-scss-webpack-plugin
```

## Example usage with Webpack

```js
const DrupalBreakpointsScssPlugin = require('@oddhill/drupal-breakpoints-scss-webpack-plugin');

module.exports = {
  // ...
  plugins: [
    new DrupalBreakpointsScssPlugin({
      entry: 'theme.breakpoints.yml',
      output: 'breakpoints.scss',
    }),
  ],
  // ...
}
```

### Options

The options for the plugin are required, both the entry and output options must be defined.

- `entry:` Path to the file containing the theme breakpoints. (Required)
- `output:` Path of the file to write the scss variables to. (Required)