open-index/open-npm huggingface dataset:
npm package: @iteam/bs-hooks
Description: A collection of reusable hooks for ReasonML
Author: believer
Latest version: 0.1.4

# Iteam Hooks for ReasonML

This is port of [@iteam/hooks](https://github.com/Iteam1337/hooks) for ReasonML/BuckleScript. Still a work in progress.

## Installation

```bash
npm install @iteam/bs-hooks
```

Add `@iteam/bs-hooks` to `bs-dependencies` in `bsconfig.json`

## Available Hooks

- [useToggle](#useToggle)
- [useQueryParam](#useQueryParam)

### [useToggle](#useToggle)

```reason
useToggle(~initialState: option(bool), unit): (bool, unit => unit)
```

#### Example

```reason
[@react.component]
let make = () => {
  let (isAlive, toggleValue) = IteamHooks.useToggle();

  <button onClick={_ => toggleValue()}>
    {
      isAlive ? {j|🚀|j} : {j|😴|j};
    }
    ->React.string
  </button>;
};
```

### [useQueryParam](#useQueryParam)

Gets a value from a specified query param

```reason
useQueryParam(~param: Js.Dict.key): string
```

#### Example

```reason
[@react.component]
let make = () => {
  let param = IteamHooks.useQueryParam(~param="sweetParam");

  <div>
    {"That's a nice query param with the value " ++ param |> React.string}
  </div>;
};

```
npm package: @iteam/encrypt
Description: Some (hopefully) sensible defaults for encrypting in node
Author: Johan Öbrink
Latest version: 0.3.2

# encrypt
Some (hopefully) sensible defaults for encrypting in node

The data is serialized using `msgpack5`. This allows for any valid js structure to be encrypted/decrypted

## Install
```bash
npm install --save @iteam/encrypt
```

## Use

### Super simple
```javascript
const {encrypt, decrypt} = require('@iteam/encrypt').init('my super secret password')

const encrypted = encrypt('some text')  // returns a Buffer
const decrypted = decrypt(encrypted)    // returns 'some text'
```

### With options
```javascript
const {encrypt, decrypt} = require('@iteam/encrypt')
  .init({
    algorithm: 'aes-256-gcm',   // Default is 'aes-256-cbc',
    authTag: true,              // Only works with gcm
    encoding: 'base64',         // Default is null - ie Buffer
    iv: Buffer.alloc(16),       // Not recommended. Sets iv to zeros only. Other, not recommended value is false which removes iv all together
    password: 'some password'
  })

const encrypted = encrypt('some text')  // returns a base64 encoded string
const decrypted = decrypt(encrypted)    // returns 'some text'
```
npm package: @iteam/eslint-config-react
Description: Contains our preferred eslint defaults for JS and TS React development
Author: believer
Latest version: 0.4.0

# Iteam ESLint config for React

Contains our preferred eslint defaults for JS and TS React development

This library only contains eslint _code quality_ rules and is unopinionated regarding the consumer projects formatting preferences.

Althought it shouldn't happend, this means that any prettier configs you decide to use locally will override any potential conflicts it would raise with this eslint config.

## Installation

Add the peer dependencies of `@iteam/eslint-config-react` to your dev dependencies:

```shell
npx install-peerdeps --dev @iteam/eslint-config-react
```

Then add `@iteam/eslint-config-react`

```shell
npm install --save-dev @iteam/eslint-config-react
```

Then add the `@iteam/eslint-config-react` in your `.eslintrc`

```json
{
  "extends": ["@iteam/eslint-config-react"]
}
```

or if you're using TS:

```json
{
  "extends": ["@iteam/eslint-config-react/typescript"]
}
```

If you bootstrapped with create-react-app, edit package.json:

```json
"eslintConfig": {
    "extends": [
      "@iteam/eslint-config-react"
    ]
  },
```

or if you're using TS:

```json
"eslintConfig": {
    "extends": [
      "@iteam/eslint-config-react/typescript"
    ]
  },
```

## Plugins

- ESLint recommended
- React recommended
- React Hooks recommended
- Imports recommended
- JSX a11y recommended
npm package: @iteam/supreme
Description: A CLI tool that helps you get up an running fast
Author: Rickard Laurin
Latest version: 2.13.1

<div align="center">
  <p>
    <img alt="Iteam Supreme" src="docs/_media/iteam-supreme.png" width="300" />
  </p>
</div>

[![](https://github.com/Iteam1337/supreme/workflows/Release/badge.svg)](https://github.com/Iteam1337/supreme/actions?workflow=Release)
[![npm (scoped)](https://img.shields.io/npm/v/@iteam/supreme)](https://npm.im/@iteam/supreme)
[![Test Coverage](https://api.codeclimate.com/v1/badges/f43b4db75e264464c6d1/test_coverage)](https://codeclimate.com/github/Iteam1337/supreme/test_coverage) [![Maintainability](https://api.codeclimate.com/v1/badges/f43b4db75e264464c6d1/maintainability)](https://codeclimate.com/github/Iteam1337/supreme/maintainability)

Use this tool to get up and running fast with configs and more in your project.
The tool currently supports creating React apps (using [`create-react-app`](https://facebook.github.io/create-react-app)), [ReasonReact](https://reasonml.github.io/reason-react/) apps and [GraphQL](https://graphql.org/) APIs with TypeScript. It can also create some basic configs in your project.

Built with ❤️ by [@Jimjardland](https://github.com/Jimjardland) and [@believer](https://github.com/believer).

## Installation

```bash
npx @iteam/supreme
```

or

```bash
npm install -g @iteam/supreme
```

After that you'll have `supreme` as a global command to use in a repository of your choice.

## Documentation
Find everything you need to know at [Iteam Supreme](https://iteam1337.github.io/#/supreme)
npm package: @itech-indrustries/code
Description: Code Tool for Editor.js
Author: Itech Indrustries
Latest version: 3.0.0

![](https://badgen.net/badge/@Editorjs-code/v2.0/blue) [![](https://data.jsdelivr.com/v1/package/npm/@itech-indrustries/code/badge)](https://www.jsdelivr.com/package/npm/@itech-indrustries/code)

# Code Tool for Editor.js

Code Tool for the [Editor.js](https://ifmo.su/editor) allows to include code examples in your articles.

![Screenshot from 2020-08-07 00-59-31](https://user-images.githubusercontent.com/55910733/89574223-6cee7300-d849-11ea-8ff5-a49154911e3e.png)

## Installation

### Install via NPM

Get the package

```shell
npm i @itech-indrustries/code
```

Include module at your application

```javascript
const CodeTool = require('@itech-indrustries/code');
```

### Download to your project's source dir

1. Upload folder `dist` from repository
2. Add `dist/bundle.js` file to your page.

### Load from CDN

You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@itech-indrustries/code).

`https://cdn.jsdelivr.net/npm/@editorjs/code@3.0.0`

Require this script on a page with Editor.js.

```html
<script src="https://cdn.jsdelivr.net/npm/@itech-indrustries/code@latest"></script>
```

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    code: CodeTool,
  }
  
  ...
});
```

## Config Params

| Field       | Type     | Description                    |
| ----------- | -------- | -------------------------------|
| placeholder | `string` | Code Tool's placeholder string |

## Output data

This Tool returns code.

```json
{
    "type" : "code",
    "data" : {
        "code": "body {\n font-size: 14px;\n line-height: 16px;\n}",
    }
}
```
npm package: @itech-indrustries/delimiter
Description: Delimiter Tool for Editor.js
Author: CodeX Team
Latest version: 1.1.1

![](https://badgen.net/badge/Editor.js/v2.0/blue)

# Delimiter Tool for Editor.js

Delimiter Tool for the [Editor.js](https://editorjs.io).

![](https://capella.pics/de70e7f8-56cd-4779-848f-52c3f68deb47.jpg)

## Installation

### Install via NPM

Get the package

```shell
npm i --save-dev @editorjs/delimiter
```

Include module at your application

```javascript
const Delimiter = require('@editorjs/delimiter');
```

### Download to your project's source dir

1. Upload folder `dist` from repository
2. Add `dist/bundle.js` file to your page.

### Load from CDN

You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@editorjs/delimiter).

`https://cdn.jsdelivr.net/npm/@editorjs/delimiter@1.0.1`

Require this script on a page with Editor.js.

```html
<script src="..."></script>
```

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    delimiter: Delimiter,
  }
  
  ...
});
```

## Config Params

This Tool has no config params

## Output data

This Tool returns empty object.

```json
{
    "type" : "delimiter",
    "data" : {}
}
```
npm package: @itech-indrustries/editor-js-text-color
Description: Text color Tool for Editor.js
Author: Itech Indrustries
Latest version: 2.0.0


# Text color Tool for Editor.js

This Tool for the [Editor.js](https://editorjs.io) allows you to change the color of the selected text.

## Installation

### Install via NPM

Get the package

```shell
npm i @itech-indrustries/editor-js-text-color
```

Include module at your application

```javascript
const Header = require('@itech-indrustries/editor-js-text-color');
```

### Download to your project's source dir

1. Upload folder `dist` from repository
2. Add `dist/bundle.js` file to your page.

### Load from CDN

You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@itech-indrustries/editor-js-text-color).

`https://cdn.jsdelivr.net/npm/@itech-indrustries/editor-js-text-color`

Then require this script on page with Editor.js.

```html
<script src="https://cdn.jsdelivr.net/npm/@itech-indrustries/editor-js-text-color@latest"></script>
```

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...

  tools: {
    ...
    ColorPicker: TextColor,
  },

  ...
});
```
npm package: @itech-indrustries/editorjs-callout
Description: Callout Tool for Editor.js
Author: Itech Indrustries
Latest version: 1.0.0

![](https://badgen.net/badge/@Editorjs-Callout/v2.0/blue) [![](https://data.jsdelivr.com/v1/package/npm/@itech-indrustries/editorjs-callout/badge)](https://www.jsdelivr.com/package/npm/@itech-indrustries/editorjs-callout)

# Code Tool for Editor.js

Code Tool for the [Editor.js](https://ifmo.su/editor) allows to include code examples in your articles.

![Screenshot from 2020-08-10 02-32-50](https://user-images.githubusercontent.com/55910733/89741787-e092b900-dab1-11ea-8597-1a21ec397410.png)

## Installation

### Install via NPM

Get the package

```shell
npm i @itech-indrustries/editorjs-callout
```

Include module at your application

```javascript
const CodeTool = require('@itech-indrustries/editorjs-callout');
```

### Download to your project's source dir

1. Upload folder `dist` from repository
2. Add `dist/bundle.js` file to your page.

### Load from CDN

You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@itech-indrustries/editorjs-callout).

`https://cdn.jsdelivr.net/npm/@editorjs/editorjs-callout@1.0.0`

Require this script on a page with Editor.js.

```html
<script src="https://cdn.jsdelivr.net/npm/@itech-indrustries/editorjs-callout@latest"></script>
```

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    code: CalloutTool,
  }
  
  ...
});
```

## Config Params

| Field       | Type     | Description                    |
| ----------- | -------- | -------------------------------|
| placeholder | `string` | Code Tool's placeholder string |

## Output data

This Tool returns code.

```json
{
    "type" : "callout",
    "data" : {
        "code": "body {\n font-size: 14px;\n line-height: 16px;\n}",
    }
}
```
npm package: @itech-indrustries/editorjs-strikethrough
Description: Strikethrough Tool for highlighting text-fragments for the Editor.js.
Author: Itech Indrustries
Latest version: 1.0.0

# Strikethrough Tool

Strikethrough Tool for highlighting text-fragments for the [Editor.js](https://editorjs.io).

## Installation

### Install via NPM

Get the package

```shell
npm i @itech-indrustries/editorjs-strikethrough
```

Include module at your application

```javascript
const Strikethrough = require('@itech-indrustries/editorjs-strikethrough');
```

## install via CDN
```javascript
  <script src="https://cdn.jsdelivr.net/npm/@itech-indrustries/editorjs-strikethrough@latest"></script>
```

### Download to your project's source dir

1. Upload folder `dist` from repository
2. Add `dist/bundle.js` file to your page.

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    strikethrough: Strikethrough,
  },
  
  ...
});
```

## Config Params

This Tool has no config params

## Output data

Marked text will be wrapped with a `s` tag.

```json
{
    "type" : "text",
    "data" : {
        "text" : "Create a directory for your module, enter it and run 
npm init
 command."
    }
}
```
npm package: @itech-indrustries/list
Description: List Tool for Editor.js
Author: Itech Indrustries
Latest version: 2.0.0

![](https://badgen.net/badge/@Editorjs-list/v2.0/blue) [![](https://data.jsdelivr.com/v1/package/npm/@itech-indrustries/list/badge)](https://www.jsdelivr.com/package/npm/@itech-indrustries/list)

# List Tool for Editor.js

This Tool for the [Editor.js](https://editorjs.io) allows you to add ordered or unordered (bulleted) lists to your article.

![Screenshot from 2020-08-08 06-59-08](https://user-images.githubusercontent.com/55910733/89699739-7c9fb180-d946-11ea-8935-ba831deda3d7.png)

## Installation

### Install via NPM

Get the package

```shell
npm i @itech-indrustries/list
```

Include module at your application

```javascript
import List from '@itech-indrustries/list';
```

### Download to your project's source dir

1. Upload folder `dist` from repository
2. Add `dist/bundle.js` file to your page.

### Load from CDN

Load the script from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@itech-indrustries/list) and connect to your page.

```html
<script src="https://cdn.jsdelivr.net/npm/@itech-indrustries/list@latest"></script>
```

## Usage

Add the List Tool to the `tools` property of the Editor.js initial config.

```javascript
import EditorJS from '@editorjs/editorjs';
import List from '@itech-indrustries/list';

var editor = EditorJS({
  // ...
  tools: {
    ...
    list: {
      class: List,
      inlineToolbar: true,
    },
  },
});
```

## Config Params

This Tool has no config params

## Tool's settings

![](https://capella.pics/bf5a42e4-1350-499d-a728-493b0fcaeda4.jpg)

You can choose list`s type.

## Output data

| Field | Type       | Description                            |
| ----- | ---------- | -------------------------------------- |
| style | `string`   | type of a list: `ordered` or `unordered` |
| items | `string[]` | the array of list's items              |


```json
{
    "type" : "list",
    "data" : {
        "style" : "unordered",
        "items" : [
            "It is a block-styled editor",
            [
                "It returns clean data output in JSON",
                [
                    "Here comes the sub lists",
                    "with both ordered and unordered",
                    [
                        "Just press tab and sub list will be created<br>"
                    ]
                ]
            ],
            "Designed to be extendable and pluggable with a simple API"
        ]
    }
},
```

## I18n support

This tool supports the [i18n api](https://editorjs.io/i18n-api).
To localize UI labels, put this object to your i18n dictionary under the `tools` section:

```json
"list": {
  "Ordered": "Нумерованный",
  "Unordered": "Маркированный"
}
```

See more instructions about Editor.js internationalization here: [https://editorjs.io/internationalization](https://editorjs.io/internationalization)
npm package: @itech-indrustries/quote
Description: Quote Tool for Editor.js
Author: Itech Indrustries
Latest version: 2.3.0

![](https://badgen.net/badge/@Editorjs-quote/v2.0/blue)   [![](https://data.jsdelivr.com/v1/package/npm/@itech-indrustries/quote/badge)](https://www.jsdelivr.com/package/npm/@itech-indrustries/quote)

# Quote Tool

Provides Quote Blocks for the [Editor.js](https://editorjs.io).

![Screenshot from 2020-08-07 13-59-58](https://user-images.githubusercontent.com/55910733/89626003-5a5e5300-d8b6-11ea-8e55-866de73e1911.png)

## Installation

### Install via NPM

Get the package

```shell
npm i @itech-indrustries/quote
```

Include module at your application

```javascript
const Quote = require('@itech-indrustries/quote');
```

### Download to your project's source dir

1. Upload folder `dist` from repository
2. Add `dist/bundle.js` file to your page.

### Load from CDN

You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@itech-indrustries/quote).

`https://cdn.jsdelivr.net/npm/@itech-indrustries/quote@latest`

Then require this script on page with Editor.js.

```html
<script src="https://cdn.jsdelivr.net/npm/@itech-indrustries/quote@latest"></script>
```

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    quote: Quote,
  },
  
  ...
});
```

Or init Quote Tool with additional settings

```javascript
var editor = EditorJS({
  ...
  
  tools: {
    ...
    quote: {
      class: Quote,
      inlineToolbar: true,
      shortcut: 'CMD+SHIFT+O',
      config: {
        quotePlaceholder: 'Enter a quote',
        captionPlaceholder: 'Quote\'s author',
      },
    },
  },
  
  ...
});
```

## Config Params

| Field              | Type     | Description                 |
| ------------------ | -------- | ----------------------------|
| quotePlaceholder   | `string` | quote's placeholder string  |
| captionPlaceholder | `string` | caption's placeholder string|

## Tool's settings

![](https://capella.pics/0db5d4de-c431-4cc2-90bf-bb1f4feec5df.jpg)

You can choose alignment for the quote. It takes no effect while editing, but saved the «alignment» param.

## Output data

| Field     | Type     | Description          |
| --------- | -------- | -------------------- |
| text      | `string` | quote's text         |
| caption   | `string` | caption or an author |
| alignment | `string` | `left` or `center`   |


```json
{
    "type" : "quote",
    "data" : {
        "text" : "The unexamined life is not worth living.",
        "caption" : "Socrates",
        "alignment" : "left"
    }
}
```
npm package: @item-enonic-types/core
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 7.11.2

# Item Enonic Types – Core

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Fcore.svg)](https://badge.fury.io/js/@item-enonic-types%2Fcore)

This package contains some core types that the other XP-libraries can depend on.

See also [@item-enonic-types/global](https://www.npmjs.com/package/@item-enonic-types/global) for more shared types.

## Installation

Install *@item-enonic-types/core* from npm by running:

```bash
npm i --save @item-enonic-types/core
```
npm package: @item-enonic-types/global
Description: Global variables and functions type definition.
Author: Tom Arild Jakobsen
Latest version: 7.15.0

# Global types for Enonic XP

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Fglobal.svg)](https://badge.fury.io/js/@item-enonic-types%2Fglobal)

> **Note** There is also an [official package for Global types for XP](https://www.npmjs.com/package/@enonic-types/global).

This library provides backwards compatibility for the old [enonic-types](https://www.npmjs.com/package/enonic-types) package
while moving to the [new types provided by Enonic](https://www.npmjs.com/org/enonic-types).

## Contents

The following global types:

- `XP.Request`
  - `XP.ErrorRequest`
  - `XP.CustomSelectorServiceParams`
- `XP.Response`
  - `XP.WebSocketResponse`
  - `XP.CustomSelectorServiceResponseBody`
  - `XP.CustomSelectorServiceResponseHit`
- `XP.MacroContext`
- `XP.WebSocketEvent`

## Use

To use these global types you need to update the `types` field in your *tsconfig.json* with this library.

```diff
{
  "baseUrl": "./",
  "paths": {
    "/lib/xp/*": ["node_modules/@enonic-types/lib-*"]
  },
+  "types": [
+    "@item-enonic-types/global"
+  ]
}
```
npm package: @item-enonic-types/lib-blocks
Description: Item Blocks
Latest version: 0.5.0

# Item Blocks

![Build badge](https://github.com/ItemConsulting/lib-xp-item-blocks/actions/workflows/main.yml/badge.svg)
[![](https://repo.itemtest.no/api/badge/latest/releases/no/item/lib-xp-item-blocks)](https://repo.itemtest.no/#/releases/no/item/lib-xp-item-blocks)
[![](https://img.shields.io/npm/types/%40item-enonic-types%2Flib-blocks)](https://www.npmjs.com/package/@item-enonic-types/lib-blocks)


## Gradle

To install this library you may need to add some new dependencies to your app's build.gradle file.

```groovy
repositories {
  maven { url "https://repo.itemtest.no/releases" }
  maven { url "https://repo.itemtest.no/snapshots" }
}

dependencies {
  include "no.item:lib-xp-item-blocks:0.3.0-SNAPSHOT"
}
```

## Add types to tsconfig.json

```json
{
  "compilerOptions": {
    "paths": {
      "/*": [
        "./src/main/resources/*",
        "./.xp-codegen/*",
        "./node_modules/@itemconsulting/lib-item-blocks/dist/*"
      ]
    }
  }
}
```

This will allow you to use functions deployed in the jar-file. 

Example of how to create a part _blocks-view.ts_ that renders out the blocks.

```typescript
import { process } from "/site/mixins/blocks/blocks";
import { blockProcessor } from "/site/mixins/my-block/my-block"

const view = resolve("blocks-view.ftlh");

export function get(req: Request): Response {
  const content = getContent();
  const component = getComponent();

  ...
  
  const response = process({
    blocks: forceArray(content.data.blocks),
    component,
    content,
    req,
    processors: {
      "my-block": processMedia,
    },
  });

  return response;
}
```

## CSS custom properties

This library expects some custom properties to be present, so that the blocks can be configured to fit in your 
design system.

```css
:root {
  /* Containers */
  --blocks-container-sm: 75ch;
  --blocks-container-md: 778px;
  --blocks-container-lg: 940px;

  /* Spacing */
  --blocks-spacing-sm: 1rem;
  --blocks-spacing-md: 1rem;
  --blocks-spacing-lg: 1.25rem;
  --blocks-spacing-xl: 2rem;
  --blocks-spacing-xxl: 3rem;
}
```

## Translations

To use the translations included in this project you need to copy the contents of 
[phrases.properties](src/main/resources/i18n/phrases.properties) and
[phrases_no.properties](src/main/resources/i18n/phrases_no.properties) in files with the same names in your project.

## Deploy to Maven

```bash
./gradlew publish -P com.enonic.xp.app.production=true
```
npm package: @item-enonic-types/lib-cloudflare-turnstile
Description: Type definitions for lib-cloudflare-turnstile
Latest version: 0.4.0

# Cloudflare Turnstile integration for Enonic XP

This library simplifies integration with Cloudflare Turnstile from Enonic XP projects.

[![](https://repo.itemtest.no/api/badge/latest/releases/no/item/lib-xp-cloudflare-turnstile)](https://repo.itemtest.no/#/releases/no/item/lib-xp-cloudflare-turnstile)

## Installation

To install this library you need to add a new dependency to your app's build.gradle file.

### Gradle

```groovy
repositories {
  maven { url "https://repo.itemtest.no/releases" }
}

dependencies {
  include "no.item:lib-xp-cloudflare-turnstile:0.0.4"
}
```

### TypeScript

To update the version of *enonic-types* in *package.json* using npm, run the following command:
```bash
npm i -D @item-enonic-types/lib-cloudflare-turnstile
```

You can add the following changes to your *tsconfig.json* to get TypeScript-support.

```diff
{
  "compilerOptions": {
+   "baseUrl": "./",
+   "paths": {
+     "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
+     "/lib/*": [ "./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"],
+   }
  }
}
```

## Configuration

You can configure the API-keys in one of two ways:

 1. As a mixin on _site.xml_
    ```xml
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <site xmlns="urn:enonic:xp:model:1.0">
      <form>
        <mixin name="cloudflare-turnstile" />
      </form>
    </site>
    ```
 2. As a configuration on your applications _*.cfg_ file
    ```ini
    # These testing keys will always succeed
    turnstileSiteKey=1x00000000000000000000AA
    turnstileSecretKey=1x0000000000000000000000000000000AA
    ```


### Usage

```typescript
import { getSiteKey, verify, TURNSTILE_CLIENT_JS, FIELD_TURNSTILE_RESPONSE } from "/lib/cloudflare-turnstile";
import type { Response } from "@enonic-types/core";

export function get(): Response {
  const turnstileSiteKey = getSiteKey();

  return {
    body: `
      <form method="post">
        <div class="cf-turnstile" data-sitekey="${turnstileSiteKey}"></div>
        <button type="submit">Submit</button>
      </form>
    `,
    pageContributions: {
      headEnd: [`<script src="${TURNSTILE_CLIENT_JS}" async defer></script>`],
    },
  };
}

type FormParams = {
  [FIELD_TURNSTILE_RESPONSE]: string | string[];
};

export function post(req: Request<{ params: FormParams }>): Response {
  const result = verify(req);

  return {
    body: verify.success ? "You have been verified!" : "You are a bot!"
  };
}
```

## Deploying

### Building

To build the project, run the following command

```bash
enonic project build
```

### Deploying locally

To deploy to a local sandbox, run the following command

```bash
enonic project deploy
```

### Deploy to Maven

```bash
./gradlew publish -P com.enonic.xp.app.production=true
```

### Deploy to npm

```bash
npm publish
```
npm package: @item-enonic-types/lib-cron
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 1.1.4

# Item Enonic Types – Cron Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-cron.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-cron)

## Installation

Install *@item-enonic-types/lib-cron* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-cron
```

## Usage

To the types for the `"/lib/cron"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-explorer
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 3.20.6-patch1

# Item Enonic Types – Explorer Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-explorer.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-explorer)

## Installation

Install *@item-enonic-types/lib-explorer* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-explorer
```

## Usage

To the types for the `"/lib/explorer"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-graphql
Description: TypeScript types for Enonic XP library lib-graphql
Author: Tom Arild Jakobsen
Latest version: 2.1.0

# Item Enonic Types – GraphQL Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-graphql.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-grapql)

## Installation

Install *@item-enonic-types/lib-graphql* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-graphql
```

## Usage

To the types for the `"/lib/graphql"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-graphql-playground
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 0.0.1
Deprecated: Use Guillotine app instead of this lib

# Item Enonic Types – GraphQL Playground Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-graphql-playground.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-grapql-playground)

## Installation

Install *@item-enonic-types/lib-graphql-playgrond* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-graphql-playground
```

## Usage

To the types for the `"/lib/graphql-playground"`-module, you need to include the following in your *tsconfig.json*:

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-guillotine
Description: TypeScript types for Enonic XP library lib-guillotine
Author: Tom Arild Jakobsen
Latest version: 5.5.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Item Enonic Types – Guillotine Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-guillotine.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-guillotine)

## Installation

Install *@item-enonic-types/lib-guillotine* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-guillotine
```

## Usage

To the types for the `"/lib/guillotine"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-http-client
Description: TypeScript types for Enonic XP lib lib-http-client
Author: Tom Arild Jakobsen
Latest version: 3.2.2-patch1

# Item Enonic Types – Http Client Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-http-client.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-http-client)

## Installation

Install *@item-enonic-types/lib-http-client* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-http-client
```

## Usage

To the types for the `"/lib/http-client"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-menu
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 4.2.1

# Item Enonic Types – Menu Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-menu.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-menu)

## Installation

Install *@item-enonic-types/lib-menu* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-menu
```

## Usage

To the types for the `"/lib/menu"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-mustache
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 2.1.0

# Item Enonic Types – Mustache Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-mustache.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-mustache)

## Installation

Install *@item-enonic-types/lib-mustache* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-mustache
```

## Usage

To the types for the `"/lib/mustache"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-notifications
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 2.0.0

# Item Enonic Types – Notifications Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-notifications.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-notifications)

## Installation

Install *@item-enonic-types/lib-notifications* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-notifications
```

## Usage

To the types for the `"/lib/notifications"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-qrcode
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 2.0.2

# Item Enonic Types – QRCode Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-qrcode.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-qrcode)

## Installation

Install *@item-enonic-types/lib-qrcode* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-qrcode
```

## Usage

To the types for the `"/lib/qrcode"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-react4xp
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 2.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Item Enonic Types – React4XP Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-react4xp.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-react4xp)

## Installation

Install *@item-enonic-types/lib-react4xp* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-react4xp
```

## Usage

To the types for the `"/lib/enonic/react4xp"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/enonic/*": ["./node_modules/@item-enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-recaptcha
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 3.0.0

# Item Enonic Types – Recaptcha Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-recaptcha.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-recaptcha)

## Installation

Install *@item-enonic-types/lib-recaptcha* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-recaptcha
```

## Usage

To the types for the `"/lib/recaptcha"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-router
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 3.1.0

# Item Enonic Types – Router Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-router.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-router)

## Installation

Install *@item-enonic-types/lib-router* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-router
```

## Usage

To the types for the `"/lib/router"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-sentry
Description: Type definitions for lib-sentry
Latest version: 0.4.0

# Sentry Integration Library for Enonic XP

Enonic XP Library for enhancing data sent to Sentry.

[![](https://repo.itemtest.no/api/badge/latest/releases/no/item/lib-xp-sentry)](https://repo.itemtest.no/#/releases/no/item/lib-xp-sentry)

<img src="https://github.com/ItemConsulting/lib-xp-sentry/raw/main/docs/icon.svg?sanitize=true" width="150">

## Installation

To install this library you need to add a new dependency to your app's build.gradle file.

### Gradle

```groovy
repositories {
  maven { url "https://repo.itemtest.no/releases" }
}

dependencies {
  include "com.enonic.xp:lib-admin:${xpVersion}"
  include "no.item:lib-xp-sentry:0.3.0"
}
```

## Usage

You can use the `Sentry.init` method to configure the DSN for the Sentry client in your `main.ts` file.

```typescript
import { Sentry } from "/lib/sentry";

Sentry.init((opts): void => {
  opts.setDsn("https://public@sentry.example.com/1");
  opts.setRelease(app.version);
  opts.setEnvironment(getInstallation());
});
```

You can use your _/error/error.ts_ to get access to the `Exception` thrown, and send it to Sentry using 
`Sentry.captureException`.

```typescript
import { Sentry, ScopeCallbackBuilder } from "/lib/sentry";
import type { ErrorRequest, Request, Response } from "@enonic-types/core";

export function handleError(err: ErrorRequest): Response {
  if (err.status !== 404) {
    reportToSentry(err);
  }

  return {
    status: err.status,
    body: `<h1>${err.status} error</h1>`
  }
}

function reportToSentry(err: ErrorRequest): void {
  try {
    const callback = new ScopeCallbackBuilder()
      .setRequest(err.request)
      .setTag("branch", err.request.branch)
      .build();

    Sentry.captureException(err.exception, callback);
  } catch (e) {
    log.error("Failed to configure Sentry scope", e);
  }
}
```


## Deploying

### Building

To build he project run the following code

```bash
./gradlew build
```

### Deploy locally

Deploy locally for testing purposes:

```bash
./gradlew publishToMavenLocal
```

## Deploy to Maven

```bash
./gradlew publish -P com.enonic.xp.app.production=true
```
npm package: @item-enonic-types/lib-sql
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 1.0.0

# Item Enonic Types – SQL Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-sql.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-sql)

## Installation

Install *@item-enonic-types/lib-sql* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-sql
```

## Usage

To the types for the `"/lib/sql"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-static
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 1.0.2
Deprecated: Use the official @enonic-types/lib-static instead

# Item Enonic Types – Static Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-static.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-static)

## Installation

Install *@item-enonic-types/lib-static* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-static
```

## Usage

To the types for the `"/lib/static"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-testing
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 7.13.0

# Item Enonic Types – Testing Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-testing.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-testing)

## Installation

Install *@item-enonic-types/lib-testing* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-testing
```

## Usage

To the types for the `"/lib/testing"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-text-encoding
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 2.1.0

# Item Enonic Types – Text-encoding Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-text-encoding.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-text-encoding)

## Installation

Install *@item-enonic-types/lib-text-encoding* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-text-encoding
```

## Usage

To the types for the `"/lib/text-encoding"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-thymeleaf
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 2.1.0

# Item Enonic Types – Thymeleaf Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-thymeleaf.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-thymeleaf)

## Installation

Install *@item-enonic-types/lib-thymeleaf* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-thymeleaf
```

## Usage

To the types for the `"/lib/thymeleaf"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```
npm package: @item-enonic-types/lib-translations
Description: Type definitions for lib-translations
Latest version: 1.6.0

# Enonic XP Translation Library

Enonic XP Library for getting all content translations (from different layers).

[![](https://repo.itemtest.no/api/badge/latest/releases/no/item/lib-xp-translations)](https://repo.itemtest.no/#/releases/no/item/lib-xp-translations)

## Gradle

To install this library you may need to add some new dependencies to your app's build.gradle file.

```groovy
repositories {
  maven { url "https://repo.itemtest.no/releases" }
}

dependencies {
  include "com.enonic.xp:lib-context:${xpVersion}"
  include "com.enonic.xp:lib-portal:${xpVersion}"
  include "com.enonic.xp:lib-project:${xpVersion}"
  include "com.enonic.xp:lib-vhost:${xpVersion}"
  include 'no.item:lib-xp-translations:1.6.0'
}
```

### TypeScript

You can add the following changes to your *tsconfig.json* to get TypeScript-support.

```diff
{
  "compilerOptions": {
+   "baseUrl": "./",
+   "paths": {
+     "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
+     "/lib/*": [ "./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"],
+   }
  }
}
```
## Usage

This library exposes a function `getTranslations()` that takes a content id, and the request, and returns an
array with urls to all translations of the content on different layers.

It will return an array with objects of this shape:

```typescript
interface Translation {
  url?: string;
  absoluteUrl?: string;
  rootUrl: string;
  languageCode: string;
  current: boolean;
}
```

For pages that doesn't have a translation in a language, it will return `undefined`. But the application developer
can use `rootUrl` instead to link to the root page of that language.

### Example

```typescript
import { getContent } from "/lib/xp/portal";
import { render } from "/lib/thymeleaf";
import { localize } from "/lib/xp/i18n";
import { getTranslations, getPageContributions } from "/lib/translations";

const view = resolve("default.html");

export function get(req: XP.Request): XP.Response {
  const content = getContent()!;
  const translations = getTranslations(content._id, req);
  const translation = translations
    .filter((translation) => !translation.current)
    .map(addName)[0]
  
  return {
    body: render(view, { translation }),
    pageContributions: getPageContributions(translations)
  }
}

function addName(translation: Translation): Translation & { name: string } {
  const name = localize({
    key: `language.${translation.languageCode}`,
    locale: content.language ?? 'en',
  });
  
  return {
    ...translation,
    name
  };
}
```

## Deploying

### Building

To build the project, run the following command

```bash
enonic project build
```

### Deploying locally

To deploy to a local sandbox, run the following command

```bash
enonic project deploy
```

### Deploy to Maven

```bash
./gradlew publish -P com.enonic.xp.app.production=true
```
npm package: @item-enonic-types/lib-xslt
Description: TypeScript types for Enonic XP
Author: Tom Arild Jakobsen
Latest version: 2.1.1

# Item Enonic Types – XSLT Lib

[![npm version](https://badge.fury.io/js/@item-enonic-types%2Flib-xslt.svg)](https://badge.fury.io/js/@item-enonic-types%2Flib-xslt)

## Installation

Install *@item-enonic-types/lib-xslt* from npm by running:

```bash
npm i --save-dev @item-enonic-types/lib-xslt
```

## Usage

To the types for the `"/lib/xslt"`-module, you need to include the following in your *tsconfig.json* :

```json
{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "/lib/xp/*": ["./node_modules/@enonic-types/lib-*"],
      "/lib/*": ["./node_modules/@item-enonic-types/lib-*" ,"./src/main/resources/lib/*"]
    }
  }
}
```