clay-constants
v3.5.1
Published
Constant variables for clay
Readme
clay-constants
Constant variables for clay
Installation
$ npm install clay-constants --saveUsage
'use strict'
const { LogPrefixes } = require('clay-constants')
{
const { CRYPTO_PREFIX } = LogPrefixes
console.log(`${CRYPTO_PREFIX} put some logs...`)
/* ... */
}Values
- CryptFormat
- DataTypes
- DateFormats
- DriverSpec
- EntitySpec
- IdSpec
- LogPrefixes
- LumpSpec
- ReservedResources
- ResourceEvents
- ResourceSpec
CryptFormat
| Key | Value |
| --- | ---- |
| DIGEST_ALGORITHM | sha256 |
| GENERATE_BITS | 512 |
| SIGN_FORMAT | hex |
DataTypes
| Key | Value |
| --- | ---- |
| NUMBER | cly:number |
| STRING | cly:string |
| BOOLEAN | cly:boolean |
| DATE | cly:date |
| OBJECT | cly:object |
| NULL | cly:null |
| REF | cly:ref |
| ENTITY | cly:entity |
| ID | cly:id |
DateFormats
| Key | Value | | --- | ---- | | DUMP_FILENAME_FORMAT | `` |
DriverSpec
| Key | Value |
| --- | ---- |
| REQUIRED_METHODS | one,list,create,update,destroy,drop,resources |
| RESOURCE_BINDABLE_METHODS | one,list,create,update,destroy,drop,oneBulk,listBulk,createBulk,updateBulk,destroyBulk,cursor |
EntitySpec
| Key | Value |
| --- | ---- |
| RESERVED_ATTRIBUTES | id,$$at,$$seal,$$by,$$policy,$$as,$$num |
| RESERVED_METHODS | toString,toJSON,get,set,sync,update,save,destroy |
IdSpec
| Key | Value |
| --- | ---- |
| ID_PATTERN | /^[a-z0-9\-]+$/ |
| SCOPE_PATTERN | /^[a-z0-9\-]+$/ |
LogPrefixes
| Key | Value |
| --- | ---- |
| LUMP_PREFIX | [clay-lump] |
| DRIVER_PREFIX | [clay-driver] |
| CRYPTO_PREFIX | [clay-crypt] |
| ID_PREFIX | [clay-id] |
| ENTITY_PREFIX | [clay-entity] |
| RESOURCE_PREFIX | [clay-resource] |
| POLICY_PREFIX | [clay-policy] |
LumpSpec
| Key | Value |
| --- | ---- |
| NAME_PATTERN | /^[A-Za-z][A-Za-za-z0-9\-_\.\/]*$/ |
ReservedResources
| Key | Value |
| --- | ---- |
| POLICY | CLYPolicy |
| SIGNATURE | CLYSignature |
| TRACE | CLYTrace |
| LOCAL | CLYLocal |
| INDICES | CLYIndices |
| RELATION | CLYRelation |
ResourceEvents
| Key | Value |
| --- | ---- |
| REF_ADD | cly:ref:add |
| REF_REMOVE | cly:ref:remove |
| ANNOTATION_TOGGLE | cly:annotate:toggle |
| POLICY_SET | cly:policy:set |
| POLICY_REMOVE | cly:policy:remove |
| RESOURCE_SUB | cly:resource:sub |
| INVALIDATE | cly:invalidate |
| INVALIDATE_BULK | cly:invalidate:bulk |
| ENTITY_CREATE | cly:entity:create |
| ENTITY_CREATE_BULK | cly:entity:create:bulk |
| ENTITY_UPDATE | cly:entity:update |
| ENTITY_UPDATE_BULK | cly:entity:update:bulk |
| ENTITY_DESTROY | cly:entity:destroy |
| ENTITY_DESTROY_BULK | cly:entity:destroy:bulk |
| ENTITY_DROP | cly:entity:drop |
| ENTITY_DROP_BULK | cly:entity:drop:bulk |
ResourceSpec
| Key | Value |
| --- | ---- |
| NAME_PATTERN | /^[A-Za-z][A-Za-za-z0-9\/#\-_\.]*$/ |
| DOMAIN_PATTERN | /^[A-Za-z][A-Za-za-z0-9\/#\-_\.]*$/ |
License
This software is released under the Apache-2.0 License.
