open-index/open-npm huggingface dataset:
npm package: @keystone-6-master/session-store-redis
Description: Keystone-6 is the latest version of Keystone. To get help with this package join the conversation in [Slack](https://community.keystonejs.com/), or [Github](https://github.com/keystonejs/keystone/).
Latest version: 2.0.1

# @keystone-6-master/session-store-redis

Keystone-6 is the latest version of Keystone.
To get help with this package join the conversation in [Slack](https://community.keystonejs.com/), or [Github](https://github.com/keystonejs/keystone/).

Visit https://keystonejs.com/ for docs, and [follow @keystonejs on Twitter](https://twitter.com/keystonejs) for the latest updates.
npm package: @keystone-6-master/test-projects-basic
Description: The sole purpose of this project is to act as a fixture through which we run our admin-ui integration tests. For useful and applicable examples of how to use keystone, please visit the [examples directory](https://github.com/keystonejs/keystone/tree/main/
Latest version: 0.0.1

## THIS IS A TEST PROJECT

The sole purpose of this project is to act as a fixture through which we run our admin-ui integration tests.
For useful and applicable examples of how to use keystone, please visit the [examples directory](https://github.com/keystonejs/keystone/tree/main/examples/) or visit our [docs](https://next.keystonejs.com).
npm package: @keystone-6-master/test-projects-crud-notifications
Description: The sole purpose of this project is to act as a fixture through which we run our admin-ui integration tests. For useful and applicable examples of how to use keystone, please visit the [examples directory](https://github.com/keystonejs/keystone/tree/main/
Latest version: 1.0.1

## THIS IS A TEST PROJECT

The sole purpose of this project is to act as a fixture through which we run our admin-ui integration tests.
For useful and applicable examples of how to use keystone, please visit the [examples directory](https://github.com/keystonejs/keystone/tree/main/examples/) or visit our [docs](https://next.keystonejs.com).
npm package: @keystone-6-master/test-projects-live-reloading
Description: The sole purpose of this project is to act as a fixture through which we run our admin-ui integration tests. For useful and applicable examples of how to use keystone, please visit the [examples directory](https://github.com/keystonejs/keystone/tree/main/
Latest version: 1.0.1

## THIS IS A TEST PROJECT

The sole purpose of this project is to act as a fixture through which we run our admin-ui integration tests.
For useful and applicable examples of how to use keystone, please visit the [examples directory](https://github.com/keystonejs/keystone/tree/main/examples/) or visit our [docs](https://next.keystonejs.com).
npm package: @keystone-6-master/website
Description: This is for information on how use the keystone website. Please check out the [style guide](../STYLE_GUIDE.md) for the style choices of how to write keystone docs.
Latest version: 0.0.2

# Keystone Docs

This is for information on how use the keystone website. Please check out the [style guide](../STYLE_GUIDE.md) for the style choices of how to write keystone docs.

## Running the docs site in dev

Run `yarn docs` from the root of the repository

## How is the website built?

The website is a Next.js app. It is statically rendered for deploy. Documentation is spread between mdx files and some JS files (mostly for layout).

## Adding code highlighting

This website uses prism, with slight modifications to code blocks for code highlighting and collapse blocks.

To add line highlights, you can use curly braces `{}` containing numbers or ranges separated by commas after the language.

So a base JS format would look like

```
\`\`\`js{5}
```

if you want to highlight line 5.

To highlight lines 5-10 you would write

```
\`\`\`js{5-10}
```

You can include multiple numbers and ranges:

```
\`\`\`js{1,3,5-10,15,17-19}
```

You should use code highlighting to highlight new code, or the most relevant code in a code block.

## Collapsing part of a code block

Sometimes you want to include only part of a code snippet. For this, you can collapse code blocks.

The syntax for this is is

```
\`\`\`js[4-7]
```

For collapsing, you must specify a range, you cannot just specify a line.

You can specify multiple ranges to collapse

```
\`\`\`js[1-5,8-10]
```

## Collapsing and highlighting together

You can include collapsing and highlighting together.

```
\`\`\`js{1-3}[4-5]
```

You can provide the two lists in any order

```
\`\`\`js[4-5]{1-3}
```

You can only include one set of collapse ranges, and one set of highlight lines.
npm package: @keystone-6/session-store-redis
Description: Keystone-6 is the latest version of Keystone. To get help with this package join the conversation in [Slack](https://community.keystonejs.com/), or [Github](https://github.com/keystonejs/keystone/).
Latest version: 4.0.1

# @keystone-6/session-store-redis

Keystone-6 is the latest version of Keystone.
To get help with this package join the conversation in [Slack](https://community.keystonejs.com/), or [Github](https://github.com/keystonejs/keystone/).

Visit <https://keystonejs.com/> for docs, and [follow @keystonejs on Twitter](https://twitter.com/keystonejs) for the latest updates.
npm package: @keystone-alpha/access-control
Description: KeystoneJS Access Control parsing and validating utilities.
Author: The KeystoneJS Development Team
Latest version: 3.1.0
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/access-control": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
title: Access Control
[meta]-->

# Access Control

This package is an internal helper package used by Keystone to parse and validate access control expressions.

You should probably not use this directly in your Keystone projects.

For more information on how to configure access control for you Keystone application, please consult the [Access Control Guide](../../docs/guides/access-control.md).
npm package: @keystone-alpha/adapter-knex
Description: KeystoneJS Knex Database Adapter
Author: The KeystoneJS Development Team
Latest version: 6.0.2
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/adapter-knex": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: database-adapters
title: Knex Adapter
[meta]-->

# Knex Database Adapter

The [Knex](https://knexjs.org/#changelog) adapter is a general purpose adapter which can be used to connect to a range of different database backends.
At present, the only fully tested backend is `Postgres`, however Knex gives the potential for `MSSQL`, `MySQL`, `MariaDB`, `SQLite3`, `Oracle`, and `Amazon Redshift` to be supported.

## Usage

```javascript
const { KnexAdapter } = require('@keystone-alpha/adapter-knex');

const keystone = new Keystone({
  name: 'My Awesome Project',
  adapter: new KnexAdapter(),
});
```

## API `new KnexAdapter(options)`

### `options.schemaName`

_**Default:**_ `'public'`

All postgres tables are grouped within a schema and `public` is the default schema.

### `options.knexOptions`

These options are passed directly through to Knex.

See the [knex docs](https://knexjs.org/#Installation-client) for more details.

_**Default:**_

```javaScript
{
  client: 'postgres',
  connection: '<DEFAULT_CONNECTION_URL>'
}
```

The `DEFAULT_CONNECTION_URL` will be either one of the following environmental variables:

- `CONNECT_TO`,
- `DATABASE_URL`,
- `KNEX_URI`

or `'postgres://localhost/<DATABASE_NAME>'`where `DATABASE_NAME` is be derived from the KeystoneJS project name.

## Debugging

To log all Knex queries, run the server with the environment variable `DEBUG=knex:query`.

## Setting Up a Database

Before running Keystone with the Knex adapter you should configure a database. By default Knex will look for a Postgres database on the default port, matching the project name, as the current user.

In most cases this database will not exist and you will want to configure a user and database for your application.

Assuming you're on MacOS and have Postgres installed the `build-test-db.sh` does this for you:

```sh
./build-test-db.sh
```

Otherwise, you can run these steps manually:

```shell
createdb -U postgres keystone
psql ks5_dev -U postgres -c "CREATE USER keystone5 PASSWORD 'k3yst0n3'"
psql ks5_dev -U postgres -c "GRANT ALL ON DATABASE keystone TO keystone5;"
```

If using the above, you will want to set a connection string of: `postgres://keystone5:k3yst0n3@localhost:5432/keystone`
npm package: @keystone-alpha/adapter-mongoose
Description: KeystoneJS Mongoose Database adapter.
Author: The KeystoneJS Development Team
Latest version: 6.0.1
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/adapter-mongoose": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: database-adapters
title: Mongoose Adapter
[meta]-->

# Mongoose Database Adapter

## Usage

```javascript
const { MongooseAdapter } = require('@keystone-alpha/adapter-mongoose');

const keystone = new Keystone({
  name: 'My Awesome Project',
  adapter: new MongooseAdapter(),
});
```

## API `new MongooseAdapter(options)`

### `options.mongoUri` (optional)

This is used as the `uri` parameter for `mongoose.connect()`.

_**Default:**_ Environmental variable (see below) or `'mongodb://localhost/<DATABASE_NAME>'`

If not specified, KeystoneJS will first look for one of the following environmental variables:

- `CONNECT_TO`,
- `DATABASE_URL`,
- `MONGO_URI`,
- `MONGODB_URI`,
- `MONGO_URL`,
- `MONGODB_URL`,
- `MONGOLAB_URI`,
- `MONGOLAB_URL`

If none of these are found a connection string is derived with a `DATABASE_NAME` from the KeystoneJS project name.

### `mongooseOptions` (optional)

These options are passed directly through to `mongoose.connect()`.

See: <https://mongoosejs.com/docs/api.html#mongoose_Mongoose-connect> for a detailed list of options.
npm package: @keystone-alpha/admin-ui
Description: KeystoneJS Admin UI.
Author: The KeystoneJS Development Team
Latest version: 3.2.1
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/admin-ui": "^5.0.0" and update any require/import statements in your code.

---
section: packages
title: Admin UI
---

# Admin UI

```DOCS_TODO
TODO
```
npm package: @keystone-alpha/app-admin-ui
Description: KeystoneJS Admin UI App.
Author: The KeystoneJS Development Team
Latest version: 5.10.3
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/app-admin-ui": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: apps
title: Admin UI
[meta]-->

# KeystoneJS Admin UI App

A KeystoneJS App which provides an Admin UI for content management.

## Usage

```js
const { Keystone } = require('@keystone-alpha/keystone');
const { GraphQLApp } = require('@keystone-alpha/app-graphql');
const { AdminUIApp } = require('@keystone-alpha/app-admin-ui');

const authStrategy = keystone.createAuthStrategy({ ... });

...

module.exports = {
  new Keystone(),
  apps: [
    new GraphQLApp(),
    new AdminUIApp({
        adminPath: '/admin',
        authStrategy,
    }),
  ],
};
```

### Config

| Option               | Type     | Default      | Required | Description                                                                  |
| -------------------- | -------- | ------------ | -------- | ---------------------------------------------------------------------------- |
| `adminPath`          | `String` | `/admin`     | `false`  | The path of the Admin UI.                                                    |
| `apiPath`            | `String` | `/admin/api` | `false`  | The path of the API provided to the Admin UI.                                |
| `graphiqlPath`       | `String` | `/admin/api` | `false`  | The path of the graphiql app, an in-browser IDE for exploring GraphQL.       |
| `authStrategy`       | `Object` | `null`       | `false`  | See [Authentication Guides](https://keystonejs.com/guides/authentication) |
| `pages`              | `Array`  | `null`       | `false`  |                                                                              |
| `enableDefaultRoute` | `Bool`   | `false`      | `false`  | If enabled, the path of the Admin UI app will be set to `/`.                 |
| `schemaName`         | `String` | `public`     | `false`  |                                                                              |
npm package: @keystone-alpha/app-graphql
Description: KeystoneJS GraphQL App.
Author: The KeystoneJS Development Team
Latest version: 8.2.1
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/app-graphql": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: apps
title: GraphQL API
draft: true
[meta]-->

# GraphQL App

A KeystoneJS App that creates a GraphQL API and Apollo GraphQL playground.

For information about writing queries and mutations for KeystoneJS see the [Introduction to KeystoneJS' GraphQL API](https://keystonejs.com/guides/intro-to-graphql).

## Usage

```javascript
const { Keystone } = require('@keystone-alpha/keystone');
const { GraphQLApp } = require('@keystone-alpha/app-graphql');
const { AdminUIApp } = require('@keystone-alpha/app-admin-ui');

module.exports = {
  new Keystone(),
  apps: [
    new GraphQLApp({
      // All config keys are optional. Default values are shown here for completeness.
        apiPath: '/admin/api',
        graphiqlPath: '/admin/graphiql',
        schemaName: 'admin',
        apollo: {},
    }),
    new AdminUIApp()
  ],
};
```

## Config

| Option         | Type     | Default           | Description                                      |
| -------------- | -------- | ----------------- | ------------------------------------------------ |
| `apiPath`      | `String` | `/admin/api`      | Change the API path                              |
| `graphiqlPath` | `String` | `/admin/graphiql` | Change the Apollo GraphQL playground path        |
| `schemaName`   | `String` | `admin`           | Change the graphQL schema name (not recommended) |
| `apollo`       | `Object` | `{}`              | Options passed directly to Apollo Server         |
npm package: @keystone-alpha/app-graphql-playground
Description: KeystoneJS GraphQL Playground App.
Author: The KeystoneJS Development Team
Latest version: 1.0.1
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/app-graphql-playground": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: apps
title: GraphQL Playground App
draft: true
[meta]-->

# GraphQL Playground App

A KeystoneJS App that creates an Apollo GraphQL playground.

## Usage

```javascript
const { Keystone } = require('@keystone-alpha/keystone');
const { GraphQLApp } = require('@keystone-alpha/app-graphql');
const { GraphQLAppPlayground } = require('@keystone-alpha/app-graphql-playground');
const { AdminUIApp } = require('@keystone-alpha/app-admin-ui');

// Ensure that the GraphQLApp and GraphQLAppPlayground are referring to the same endpoint
const apiPath = '/admin/api';
module.exports = {
  new Keystone(),
  apps: [
    // This should come before the GraphQLApp, as it sets up the dev query middleware
    new GraphQLAppPlayground({ apiPath })
    // Disable the default playground on this app
    new GraphQLApp({ apiPath, graphiqlPath: undefined }),
    new AdminUIApp()
  ],
};
```

## Config

| Option         | Type     | Default           | Description                               |
| -------------- | -------- | ----------------- | ----------------------------------------- |
| `apiPath`      | `String` | `/admin/api`      | Change the API path                       |
| `graphiqlPath` | `String` | `/admin/graphiql` | Change the Apollo GraphQL playground path |
npm package: @keystone-alpha/app-next
Description: KeystoneJS Next.js App.
Author: The KeystoneJS Development Team
Latest version: 2.1.0
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/app-next": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: apps
title: Next.js App
[meta]-->

# KeystoneJS Next.js App

A KeystoneJS App for serving a [Next.js](https://nextjs.org/) application.

## Usage

```javascript
const { NextApp } = require('@keystone-alpha/app-next');

...

module.exports = {
  keystone,
  apps: [
    new GraphQLApp(),
    new AdminUIApp(),
    new NextApp({ dir: 'app' }),
  ],
  distDir,
};
```

### Config

| Option | Type     | Default | Required | Description                       |
| ------ | -------- | ------- | -------- | --------------------------------- |
| `dir`  | `String` | `null`  | `true`   | The directory of the Next.js app. |
npm package: @keystone-alpha/app-nuxt
Description: KeystoneJS Nuxt.js App.
Author: The KeystoneJS Development Team
Latest version: 1.0.0
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/app-nuxt": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: apps
title: Nuxt.js App
[meta]-->

# Nuxt.js App

## Usage

```javascript
const { NuxtApp } = require('@keystone-alpha/app-nuxt');

...

const config = {
  srcDir: "src",
  buildDir: "dist",
  // ...
}

module.exports = {
  keystone,
  apps: [
    new GraphQLApp(),
    new AdminUIApp(),
    new NuxtApp(config),
  ]
};
```

### Config

A config object can be passed to the `NuxtApp` instance. Documentation for the `nuxtConfig` options is available on the [NuxtJS documentation website](https://nuxtjs.org/guide/configuration).
npm package: @keystone-alpha/app-schema-router
Description: KeystoneJS GraphQL App.
Author: The KeystoneJS Development Team
Latest version: 1.0.1
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/app-schema-router": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: apps
title: GraphQL API
draft: true
[meta]-->

# GraphQL Schema Router

A KeystoneJS App that route requests to different GraphQL schemas.

The `SchemaRouterApp` allows you to define a `routerFn` which takes `(req, res)` and returns
a `routerId`, which is used to pick between different GraphQL schemas which exist at the same
`apiPath`.

## Usage

```javascript
const { Keystone } = require('@keystone-alpha/keystone');
const { GraphQLAppPlayground } = require('@keystone-alpha/app-graphql-playground');
const { SchemaRouterApp } = require('@keystone-alpha/app-schema-router');
const { GraphQLApp } = require('@keystone-alpha/app-graphql');
const { AdminUIApp } = require('@keystone-alpha/app-admin-ui');

module.exports = {
  new Keystone(),
  apps: [
    new GraphQLAppPlayground({ apiPath })
    new SchemaRouterApp({
      apiPath,
      routerFn: (req) => req.session.keystoneItemId ? 'private' : 'public',
      apps: {
        public: new GraphQLApp({ apiPath, schemaName: 'public', graphiqlPath: undefined }),
        private: new GraphQLApp({ apiPath, schemaName: 'private', graphiqlPath: undefined }),
      },
    }),
    new AdminUIApp()
  ],
};
```

## Config

| Option     | Type       | Default      | Description                                                  |
| ---------- | ---------- | ------------ | ------------------------------------------------------------ |
| `apiPath`  | `String`   | `/admin/api` | Change the API path                                          |
| `routerFn` | `Function` | `() => {}`   | A function which takes `(req, res)` and returns a `routerId` |
| `apps`     | `Object`   | `{}`         | An object with `routerId`s as key and `GraphQLApp` as value  |
npm package: @keystone-alpha/app-static
Description: KeystoneJS Static File App.
Author: The KeystoneJS Development Team
Latest version: 1.1.2
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/app-static": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: apps
title: Static App
[meta]-->

# KeystoneJS Static File App

A KeystoneJS App to serve static files such as images, CSS and JavaScript with support for client side routing.

## Usage

`index.js`

```js
const { Keystone } = require('@keystone-alpha/keystone');
const { GraphQLApp } = require('@keystone-alpha/app-graphql');
const { AdminUIApp } = require('@keystone-alpha/app-admin-ui');
const { StaticApp } = require('@keystone-alpha/app-static');

module.exports = {
  new Keystone(),
  apps: [
    new GraphQLApp(),
    new AdminUIApp(),
    new StaticApp({
      path: '/',
      src: 'public',
      fallback: 'index.html',
    }),
  ],
};
```

## Options

### `path`

The path to serve files from. This is required and must be a string.

### `src`

The path to the folder containing static files. This is required and must be a string.

#### `fallback` (optional)

The path to the file to serve if none is found. This path is resolved relative to the `src` path.
npm package: @keystone-alpha/build-field-types
Description: A build tool for KeystoneJS 5 Field Types
Latest version: 1.0.6
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/build-field-types": "^5.0.0" and update any require/import statements in your code.

# @keystone-alpha/build-field-types

This package is an internal helper package used by Keystone to package field types for the adminUI.

You should probably not use this directly in your Keystone projects.
npm package: @keystone-alpha/core
Description: Custom Server plumbing for running a @keystone-alpha instance. See also @keystone-alpha/keystone.
Author: The KeystoneJS Development Team
Latest version: 2.0.4
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/core": "^5.0.0" and update any require/import statements in your code.

---
section: packages
title: Core
---

# Core

```DOCS_TODO
TODO
```

<!-- prettier-ignore -->

```javascript
const keystoneServer = require('@keystone-alpha/core');

keystoneServer.prepare({ port: 3000 })
  .then(({ server, keystone }) => {
    server.app.get('/', (req, res) => {
      res.end('Hello world');
    });
    return server.start();
  })
  .catch(error => {
    console.error(error);
  });
```
npm package: @keystone-alpha/field-views-loader
Description: A webpack loader used to load all thew field views used in an app
Author: The Keystone Development Team
Latest version: 2.2.1
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/field-views-loader": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
title: Field Views Loader
[meta]-->

# Field Views Loader

This packages contains a [webpack loader](https://webpack.js.org/api/loaders) which makes the field type UI components available to the Admin UI.

This package is an internal helper package used by Keystone. It contains a [webpack loader](https://webpack.js.org/api/loaders) which makes the field type UI components available to the Admin UI.

You should probably not use this directly in your Keystone projects.
npm package: @keystone-alpha/fields-datetime-utc
Description: KeystoneJS DatetimeUtc Field Type
Author: The KeystoneJS Development Team
Latest version: 2.0.5
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/fields-datetime-utc": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: field-types
title: DateTimeUtc
[meta]-->

# DateTimeUtc

`DateTimeUtc` fields represent points in time.

Accepts only values that include an offset, explicitly or implicitly (as in JS `Date` objects).
Produces JS `Date` objects and ISO 8601 strings.

Unlike the core `DateTime` field type only the UTC value is stored.

## Usage

```js
keystone.createList('User', {
  fields: {
    lastOnline: { type: DateTimeUtc },
  },
});
```
npm package: @keystone-alpha/fields-markdown
Description: KeystoneJS Markdown Field Type
Author: The KeystoneJS Development Team
Latest version: 1.0.8
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/fields-markdown": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: field-types
title: Markdown
[meta]-->

# Markdown Field powered by CodeMirror

This field inserts a string path into your schema based on the `Text` field type implementation, and renders a Markdown editor using CodeMirror.

## Credit

The `Editor` implementation is based on [SquidDev/MirrorMark](https://github.com/SquidDev/MirrorMark).
npm package: @keystone-alpha/fields-wysiwyg-tinymce
Description: KeystoneJS WYSIWYG HTML Field Type, powered by TinyMCE
Author: The KeystoneJS Development Team
Latest version: 3.0.10
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/fields-wysiwyg-tinymce": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: field-types
title: Wysiwyg
[meta]-->

# WYSIWYG

This field inserts a string path into your schema based on the `Text` field type implementation, and renders a WYSIWYG editor in the Admin UI using [TinyMCE](https://www.tiny.cloud/)

## Credit

The `Editor` implementation was inspired by the [tinymce-react](https://github.com/tinymce/tinymce-react) Official TinyMCE React component, Copyright 2017-present Ephox, Inc.
npm package: @keystone-alpha/file-adapters
Description: Adapters for handling storage of the File type
Author: The Keystone Development Team
Latest version: 2.0.1
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/file-adapters": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: field-adapters
title: File Adapters
[meta]-->

# File Adapters

The `File` field type can support files hosted in a range of different contexts, e.g. in the local filesystem, or on a cloud based file server.

Different contexts are supported by different file adapters. This package contains the built-in file adapters supported by KeystoneJS.

## `LocalFileAdapter`

### Usage

```javascript
const fileAdapter = new LocalFileAdapter({
  src: './files',
  path: '/public',
});
```

## `CloudinaryFileAdapter`
npm package: @keystone-alpha/logger
Description: Common logging functionality used within @keystone-alpha/* packages.
Author: The KeystoneJS Development Team
Latest version: 2.0.1
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/logger": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: packages
title: Logger
[meta]-->

# Logger

## API

### `require('@keystone-alpha/logger').logger(name)`

Provides an instance of [`pino`](https://github.com/pinojs/pino) based on the given `name`.

Instances are cached and re-used, making it safe to request the same named instance across multiple files.

### `process.env.DISABLE_LOGGING`

When set to any "truthy" value, will prevent any log output from occurring (particularly useful during test runs).
npm package: @keystone-alpha/oembed-adapters
Description: Adapters for fetching oEmbed data for the OEmbed field type
Author: The Keystone Development Team
Latest version: 1.1.2
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/oembed-adapters": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: packages
title: OEmbed Adapters
[meta]-->

# OEmbed Adapters

The `OEmbed` field type (from `@keystone-alpha/fields`) can fetch oEmbed data
from a number of providers such as [Iframely](https://iframely.com).

This package contains adapters for different providers.

## `IframelyOEmbedAdapter`

```javascript
const { Keystone } = require('@keystone-alpha/keystone');
const { OEmbed } = require('@keystone-alpha/fields');
const { IframelyOEmbedAdapter } = require('@keystone-alpha/oembed-adapters');

const keystone = new Keystone(/* ... */);

const iframelyAdapter = new IframelyOEmbedAdapter({
  apiKey: '...', // Get one from https://iframely.com
});

keystone.createList('User', {
  fields: {
    portfolio: {
      type: OEmbed,
      adapter: iframelyAdapter,
    },
  },
});
```

NOTE: The request to Iframely will include the following [parameters](https://iframely.com/docs/parameters):

- `iframe=1`
- `omit_script=1`
npm package: @keystone-alpha/server
Description: Internal @keystone-alpha API & Admin UI server. For Custom Servers, see: @keystone-alpha/core
Author: The KeystoneJS Development Team
Latest version: 5.0.0
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/server": "^5.0.0" and update any require/import statements in your code.

---
section: packages
title: Server
---

# Server

```DOCS_TODO
TODO
```
npm package: @keystone-alpha/session
Description: Tools to assist with setting up session management in your Keystone system.
Author: The KeystoneJS Development Team
Latest version: 3.0.3
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/session": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: utilities
title: Session
[meta]-->

# Session

This package contains functions to assist with setting up session management in your KeystoneJS system.
npm package: @keystone-alpha/test-utils
Description: Common utilities used while testing @keystone-alpha/* packages.
Author: The KeystoneJS Development Team
Latest version: 2.6.3
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/test-utils": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
section: api
subSection: utilities
title: Test Utils
[meta]-->

# Test Utils

This package is an internal KeystoneJS package which contains utility functions to assist in running tests against the GraphQL API.

## Installation

```bash
yarn add @keystone-alpha/test-utils
```

## Usage

```TODO
The contents of this file should be generated by JSDoc
```
npm package: @keystone-alpha/utils
Description: Common utility functions used throughout @keystone-alpha packages.
Author: The KeystoneJS Development Team
Latest version: 3.2.0
Deprecated: All packages in the @keystone-alpha namespace are now available in the @keystonejs namespace, starting at version 5.0.0. To upgrade, update package.json to point to "@keystonejs/utils": "^5.0.0" and update any require/import statements in your code.

<!--[meta]
title: Utilities
[meta]-->

# Utilities

This package is an internal Keystone package which contains various helper functions which are used throughout the monorepo.

You should probably not use this directly in your Keystone projects.
npm package: @keystone-js/view
Description: Provides functionality similar to Keystone 4 views.
Author: The Keystone-JS Community Development Team
Latest version: 1.0.0

---
section: packages
title: View
---

# View

This package contains functions to assist with view management in your Keystone system. This feature is ported from Keystone v4

## Initialize

Initialize View support by setting ExpressJs view engine options, you have to add respective view engine package in packages.json. You must use [Custom Server](https://v5.keystonejs.com/discussions/custom-server) config.

```js
//... keystone.prepare(....).then( ({middlewares}) => {
  const app = express();
  app.use(middlewares);
  app.use(bodyParser.urlencoded({ extended: true }));
  app.set('views', './templates');
  app.set('view engine', 'pug');
//})
```

you need to create `templates` folder in root of the project where you keep all the view templates

## Query

Create Routes to use `View`, `View` constructor needs instance of `Keystone` and `express app`.
For details check out the `demo-projects/blog-view` project.

```js
module.exports = (keystone, app) => {
  app.use('/', async (req, res) => {
    const locals = res.locals || {};
    const view = new View(keystone, req, res);
    view.query(
      'posts',
      `{ 
          allPosts {
            title
            id
            body
            posted
            image {
              publicUrl
              filename
            }
            author {
              name
            }
          }
      }`
    );

    view.render('views/home', locals);
  });
};
```

Initialize this route after `keystone.prepare`

```js
const homeRoute = require('../routes/view/home');
homeRoute(keystone, app);
```

> if there are multiple objects returned in GraphQl queries then both of them are attached to the `path` parameter in `view.query`

## Mutation

you can run mutation queries with `view.query`

## HTTP methods support in View

Similar to v4, View support `view.on` conditionals based on HTTP methods, for example you can process for post when specific field is having specific value, usually the case when you have multiple forms on page and yo want to handle them selectively.

> Improved in v5, any query you add inside `view.on` will get executed before any other queries, giving you single page refresh to accomplish result refresh after form post.

```js
view.on('post', { action: 'new-post' }, async () => {
  // in the form you have to have a hidden field like this :
  // input(type='hidden', name='action', value='new-post')
  const { title, body, admin } = req.body;
  const input = { title, body, author: { connect: { id: admin } } };
  view
    .query(
      'created',
      `mutation createPost($input: PostCreateInput){
        createPost(data: $input) {id}
      }`,
      { variables: { input } }
    )
    .err(err => {
      console.log(err);
      locals.err = err;
    });
});
```
npm package: @keystone-next-brick/fields
Description: Part of Keystone's [new interfaces project](https://www.keystonejs.com/blog/roadmap-update). This is a preview release, and not yet documented.
Latest version: 6.0.0

# @keystone-next/fields

Part of Keystone's [new interfaces project](https://www.keystonejs.com/blog/roadmap-update). This is a preview release, and not yet documented.

You can find example projects and usage [on GitHub](https://github.com/keystonejs/keystone/tree/master/examples-next)

For updates, [follow @keystonejs on Twitter](https://twitter.com/keystonejs) and check out [our Blog](https://www.keystonejs.com/blog)
npm package: @keystone-next-brick/mono-repo
Description: KeystoneJS monorepo for all the @keystonejs-next packages
Author: The KeystoneJS Development Team
Latest version: 0.0.0

<div align="center">
  <img src="assets/readme-header-next.png" width="445">
  <br><br>
  <p><b>A scalable platform and CMS to build Node.js applications.</b></p>
  <p><code>schema => ({ GraphQL, AdminUI })</code></p>
  <br>
  <p>Keystone Next is a preview of the next major release of KeystoneJS, the most powerful headless content management system around.</p>
  <sub>Looking for Keystone 5? Head over to <a href="https://github.com/keystonejs/keystone-5"><code>keystone-5</code></a>.</sub>
  <br>
</div>
<br>

<!-- ![CI](https://github.com/keystonejs/keystone/workflows/CI/badge.svg) -->

<!-- [![slack](https://keystone-community.now.sh//badge.svg)](https://keystone-community.now.sh/) -->

<!-- [![Supported by Thinkmill](https://thinkmill.github.io/badge/heart.svg)](http://thinkmill.com.au/?utm_source=github&utm_medium=badge&utm_campaign=react-select) -->

## Contents

- [What's new?](#whats-new)
- [Keystone 5](#keystone-5)
- [Code of Conduct](#code-of-conduct)
- [License](#license)

## What's new?

[Keystone Next](http://next.keystonejs.com) is a preview of the next major release of KeystoneJS, the most powerful headless content management system around. We've substantially rewritten the CLI, Schema config, and Admin UI to make them more powerful and easier to use than ever before.

To learn more, check out our [What's next for KeystoneJS](https://github.com/keystonejs/keystone/issues/4962) announcement post.

You can learn more about the next version, which is now [in preview](https://next.keystonejs.com/roadmap).

## Keystone 5

The [Keystone 5](https://github.com/keystonejs/keystone-5) codebase is now in active maintenance mode and now lives at [keystonejs/keystone-5](https://github.com/keystonejs/keystone-5).

For more information please read our [Keystone 5 and beyond](https://github.com/keystonejs/keystone-5/issues/21) post.

<!-- ## Getting Started -->

<!-- TBC -->

## Documentation

The [Keystone Next](https://next.keystonejs.com/whats-new) website contains a documentation preview.

In the next month you'll see a new project starter and getting started guide, as well as a new set of example projects demoing how to use Keystone Next features.

## Feedback

We'd love to hear your feedback, reach out on Twitter at [KeystoneJS](https://twitter.com/keystonejs) and [subscribe](https://next.keystonejs.com/roadmap#project-status) to be notified of our progress.

<!-- ## Version control -->

<!-- TBC -->

<!-- ## Contributing -->

<!-- TBC -->

<!-- ### Demo Projects -->

<!-- TBC -->

<!-- ### Development Practices -->

<!-- TBC -->

<!-- ### Setup -->

<!-- TBC -->

<!-- ### Testing -->

<!-- TBC -->

<!-- ### Unit Tests -->

<!-- TBC -->

<!-- ### End-to-End Tests -->

<!-- TBC -->

## Code of Conduct

KeystoneJS adheres to the [Contributor Covenant Code of Conduct](/code-of-conduct.md).

## License

Copyright (c) 2021 Thinkmill Labs Pty Ltd. Licensed under the MIT License.
npm package: @keystone-next/access-control-legacy
Description: KeystoneJS Access Control parsing and validating utilities.
Author: The KeystoneJS Development Team
Latest version: 11.0.0
Deprecated: Keystone Next has graduated to the @keystone-6 namespace; for more information see https://keystonejs.com/updates/general-availability

<!--[meta]
title: Access Control
[meta]-->

# Access Control

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@keystone-next/access-control-legacy)

This package is an internal helper package used by Keystone to parse and validate access control expressions.

You should probably not use this directly in your Keystone projects.

For more information on how to configure access control for you Keystone application, please consult the [Access Control Guide](/docs/guides/access-control.md).
npm package: @keystone-next/adapter-knex-legacy
Description: KeystoneJS Knex Database Adapter
Author: The KeystoneJS Development Team
Latest version: 13.2.3

<!--[meta]
section: api
subSection: database-adapters
title: Knex adapter
[meta]-->

# Knex database adapter

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@keystone-next/adapter-knex-legacy)

The [Knex](https://knexjs.org/#changelog) adapter is a general purpose adapter which can be used to connect to a range of different database backends.
At present, the only fully tested backend is `Postgres`, however Knex gives the potential for `MSSQL`, `MySQL`, `MariaDB`, `SQLite3`, `Oracle`, and `Amazon Redshift` to be supported.

## Usage

```javascript
const { KnexAdapter } = require('@keystone-next/adapter-knex-legacy');

const keystone = new Keystone({
  adapter: new KnexAdapter({...}),
});
```

## Config

### `schemaName`

_**Default:**_ `'public'`

All postgres tables are grouped within a schema and `public` is the default schema.

### `dropDatabase`

_**Default:**_ `false`

Allow the adapter to drop the entire database and recreate the tables / foreign keys based on the list schema in your application. This option is ignored in production, i.e. when the environment variable NODE_ENV === 'production'.

### `knexOptions`

These options are passed directly through to Knex.

See the [knex docs](https://knexjs.org/#Installation-client) for more details.

_**Default:**_

```javascript
{
  client: 'postgres',
  connection: process.env.CONNECT_TO || process.env.DATABASE_URL || process.env.KNEX_URI
}
```

## Debugging

To log all Knex queries, run the server with the environment variable `DEBUG=knex:query`.

## Setup

Before running Keystone with the Knex adapter you should configure a database. By default Knex will look for a Postgres database on the default port, matching the project name, as the current user.

In most cases this database will not exist and you will want to configure a user and database for your application.

Assuming you're on MacOS and have Postgres installed the `build-test-db.sh` does this for you:

```shell
./build-test-db.sh
```

Otherwise, you can run these steps manually:

```shell allowCopy=false showLanguage=false
createdb -U postgres keystone
psql keystone -U postgres -c "CREATE USER keystone5 PASSWORD 'change_me_plz'"
psql keystone -U postgres -c "GRANT ALL ON DATABASE keystone TO keystone5;"
```

If using the above, you will want to set a connection string of: `postgres://keystone5:change_me_plz@localhost:5432/keystone`
npm package: @keystone-next/adapter-mongoose-legacy
Description: KeystoneJS Mongoose Database adapter.
Author: The KeystoneJS Development Team
Latest version: 11.1.3
Deprecated: Keystone Next has graduated to the @keystone-6 namespace; for more information see https://keystonejs.com/updates/general-availability

<!--[meta]
section: api
subSection: database-adapters
title: Mongoose adapter
[meta]-->

# Mongoose database adapter

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@keystone-next/adapter-mongoose-legacy)

## Usage

```javascript
const { MongooseAdapter } = require('@keystone-next/adapter-mongoose-legacy');

const keystone = new Keystone({
  adapter: new MongooseAdapter({...}),
});
```

## Config

### `mongoUri` (required)

This is used as the `uri` parameter for `mongoose.connect()`.

_**Default:**_ Environment variable (see below) or `'mongodb://localhost/<DATABASE_NAME>'`

If not specified, KeystoneJS will look for one of the following environment variables:

- `CONNECT_TO`
- `DATABASE_URL`
- `MONGO_URI`
- `MONGODB_URI`
- `MONGO_URL`
- `MONGODB_URL`
- `MONGOLAB_URI`
- `MONGOLAB_URL`

### Mongoose options (optional)

Additional Mongoose config options are passed directly through to `mongoose.connect()`.

_**Default:**_

```javascript
{
  useNewUrlParser: true,
  useFindAndModify: false,
  useUnifiedTopology: true,
}
```

See the [Mongoose docs](https://mongoosejs.com/docs/api.html#mongoose_Mongoose-connect) for a detailed list of options.
npm package: @keystone-next/adapter-prisma-legacy
Description: KeystoneJS Prisma Database Adapter
Author: The KeystoneJS Development Team
Latest version: 8.0.0
Deprecated: Keystone Next has graduated to the @keystone-6 namespace; for more information see https://keystonejs.com/updates/general-availability

<!--[meta]
section: api
subSection: database-adapters
title: Prisma adapter
[meta]-->

# Prisma database adapter

[![View changelog](https://img.shields.io/badge/changelogs.xyz-Explore%20Changelog-brightgreen)](https://changelogs.xyz/@keystone-next/adapter-prisma-legacy)

The Prisma adapter allows Keystone to connect a database using Prisma Client, a type-safe and auto-generated database client. You can learn more about Prisma Client in the [Prisma docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).

> **Tip:** Want to get started with Keystone + Prisma? [Follow the guide](/docs/guides/prisma.md)!
>
> **Warning:** The Keystone Prisma adapter is not currently production-ready. It depends on the [Prisma Migrate](https://www.prisma.io/docs/concepts/components/prisma-migrate) system which is currently flagged as `Preview`. Once Prisma Migrate is out of preview mode, we will release a production-ready version of this package.
>
> **Note:** This adapter currently only supports PostgreSQL databases, and has other limitations. For more details, see our [Prisma Adapter - Production Ready Checklist](/docs/discussions/prisma.md)

## Usage

```javascript
const { PrismaAdapter } = require('@keystone-next/adapter-prisma-legacy');

const keystone = new Keystone({
  adapter: new PrismaAdapter({ url: 'postgres://...' }),
});
```

## Config

### `url`

_**Default:**_ `DATABASE_URL`

The connection string for your database, in the form `postgres://<user>:<password>@<host>:<port>/<dbname>`.
By default it will use the value of the environment variable `DATABASE_URL`. You can learn more about the connection string format used in the [Prisma docs](https://www.prisma.io/docs/reference/database-connectors/connection-urls).

### `enableLogging`

_**Default:**_ `false`

Enables logging at the [`query`](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#overview) level in the Prisma client.

## Setup

Before running Keystone with the Prisma adapter you will need to have a PostgreSQL database to connect to.

If you already have a database then you can use its connection string in the `url` config option.
If you don't have a database already then you can create one locally with the following commands.

```shell allowCopy=false showLanguage=false
createdb -U postgres keystone
psql keystone -U postgres -c "CREATE USER keystone5 PASSWORD 'change_me_plz'"
psql keystone -U postgres -c "GRANT ALL ON DATABASE keystone TO keystone5;"
```

If using the above, you will want to set a connection string of:

```javascript
const keystone = new Keystone({
  adapter: new PrismaAdapter({ url: `postgres://keystone5:change_me_plz@localhost:5432/keystone` }),
});
```

See the [adapters setup](/docs/quick-start/adapters.md) guide for more details on how to setup a database.
npm package: @keystone-next/admin-ui
Description: The `@keystone-next/admin-ui` package has been merged into the `@keystone-next/keystone` package.
Latest version: 15.0.0
Deprecated: The package @keystone-next/admin-ui has been merged into @keystone-next/keystone. Please update your imports to use @keystone-next/keystone/admin-ui

The `@keystone-next/admin-ui` package has been merged into the `@keystone-next/keystone` package.

You no longer need to install this package.

All imports from this package are now available from `@keystone-next/keystone/admin-ui` instead.