1.0.5 • Published 6 years ago

@keystone-alpha/list-plugins v1.0.5

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

List Plugins

atTracking

Adds createdAt and updatedAt fields to a list. These fields are read-only by will be updated automatically when items are created or updated.

Usage

const { atTracking } = require('@keystone-alpha/list-plugins');

keystone.createList('ListWithPlugin', {
  fields: {
    // ...
  },
  plugins: [
    atTracking({
      /* ...config */
    }),
  ],
});

Config

OptionTypeDefaultDescription
createdAtFieldStringcreatedAtName of the createdAt field.
updatedAtFieldStringupdatedAtName of the createdAt field.
formatStringMM/DD/YYYY h:mm AFormat of the generated DateTime field.
accessObjectSee: accessChange default access controls.

access

By default access control on at tracking fields is read only:

{
  read: true,
  create: false,
  update: false
}

Disabling created or updated

You can import either createdAt or updatedAt to apply a single tracking field:

const { createdAt, updatedAt } = require('@keystone-alpha/list-plugins');

Note: The API is the same.

byTracking

Adds createdBy and updatedBy fields to a list. These fields are read-only by will be updated automatically when items are created or updated.

Usage

const { byTracking } = require('@keystone-alpha/list-plugins');

keystone.createList('ListWithPlugin', {
  fields: {
    // ...
  },
  plugins: [
    byTracking({
      /* ...config */
    }),
  ],
});

Config

OptionTypeDefaultDescription
createdByFieldStringcreatedByName of the createdBy field.
updatedByFieldStringupdatedByName of the createdBy field.
refStringUserA reference to the list authenticated items (users).
accessObjectSee: accessChange default access controls.

access

By default access control on at tracking fields is read only:

{
  read: true,
  create: false,
  update: false
}

Disabling created or updated

You can import either createdBy or updatedBy to apply a single tracking field:

const { createdBy, updatedBy } = require('@keystone-alpha/list-plugins');

Note: The API is the same.

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago