# (c) cavaliba.com 

# -------------------
# _enumerate
# -------------------

- classname: _schema
  keyname: _enumerate
  _action: init
  is_enabled: yes
  displayname: Data Enumerates
  order: 810
  page: Admin
  _options:
      icon: fa-list
      p_admin: p_enumerate_admin
      p_create: p_enumerate_create
      p_read: p_enumerate_read
      p_update: p_enumerate_update
      p_delete: p_enumerate_delete

  description:
    displayname: Description
    order: 100
    dataformat: string
  content:
    displayname: Content
    page: input
    order: 120
    dataformat: text
    dataformat_ext: yaml 


# -------------------
# _pipeline
# -------------------

- classname: _schema
  keyname: _pipeline
  displayname: Data Pipelines
  _action: init
  is_enabled: yes
  order: 800
  page: Admin
  _options:
      icon: fa-gears
      p_admin: p_pipeline_admin
      p_create: p_pipeline_create
      p_read: p_pipeline_read
      p_update: p_pipeline_update
      p_delete: p_pipeline_delete

  description:
    displayname: Description
    order: 100
    dataformat: string
  run_permission: 
    displayname: Run permission
    page: Content
    order: 100
    dataformat: string
  content:
    displayname: Content
    page: Content
    order: 110
    dataformat: text
    dataformat_ext: yaml


# -------------------
# _dataview
# -------------------

- classname: _schema
  keyname: _dataview
  displayname: Data Views
  _action: init
  is_enabled: yes
  order: 810
  page: Admin
  _options:
      icon: fa-table
      p_admin: p_dataview_admin
      p_create: p_dataview_create
      p_read: p_dataview_read
      p_update: p_dataview_update
      p_delete: p_dataview_delete
  
  description:
    displayname: Description
    order: 100
    dataformat: string
  target_class:
    displayname: Schema
    order: 110
    dataformat: string
  content:
    displayname: Content
    order: 120
    dataformat: text
    dataformat_ext: yaml



# --------------------------------------------
# apikey
# --------------------------------------------

- classname: _schema
  keyname: _apikey
  _action: create
  is_enabled: yes
  displayname: API Keys
  is_enabled: yes
  order: 820
  page: Admin

  _options:
      icon: fa-key
      p_admin: p_apikey_admin
      p_create: p_apikey_create
      p_read: p_apikey_read
      p_update: p_apikey_update
      p_delete: p_apikey_delete

  secret:
      _action: delete
  secret:
      displayname: Secret
      order: 50
      dataformat: password 
      dataformat_ext: "hash minlen:8 complexity:3"
      description: "Password wtih min length 8 and 3 factors complexity"
  
  description:
      displayname: Description
      order: 60
      dataformat: string
      default : "API Key"

  is_readonly:
      displayname: Read-Only
      dataformat: boolean
      order: 70
      default: true

  acl:
      order: 80
      displayname: ACL Authorizations
      dataformat: text


  not_after:
        displayname: Not After
        description: format YYYY-MM-DD
        dataformat: date
  time_filter:
        displayname: Time Filter
        dataformat: text
  ip_filter:
        displayname: IP Filter
        dataformat: text
        default : "*"




# deleted fields
  
  keyvalue:
      _action: delete

  roles:
      _action: delete
      order: 80
      displayname: Roles
      dataformat: role
      cardinal_max: 0

  permissions:
      _action: delete
      order: 80
      displayname: Permissions
      dataformat: text

  acl_filter:
        _action: delete
        displayname: ACL Filter
        cardinal_max: 0
        dataformat: text

  last_success:
      _action: delete
      displayname: Last Success
      description: format YYYY-MM-DD
      dataformat: date
  last_error:
        _action: delete
        displayname: Last Error
        description: format YYYY-MM-DD
        dataformat: date
  success_count:
        _action: delete
        displayname: Success Count
        dataformat: int
  error_count:
        _action: delete
        displayname: Error Count
        dataformat: int

  comment:
      _action: delete
      order: 100
      displayname: contact and notes
      dataformat: text
