name: connected_apps
label: External Application
icon: entity
hidden: true
enable_api: true
fields:
  name: 
    label: Name
    type: text
    required: true
  code:
    label: API Name
    type: text
    required: true
  # contact_email: 
  #   label: 联系人名称
  #   type: text
  #   required: false
  # contact_phone: 
  #   label: 联系人电话
  #   type: text
  active:
    label: Active
    type: boolean
    defaultValue: true
  app_logo:
    label: Logo
    type: avatar
  description:
    label: Description
    type: textarea
    rows: 3
    is_wide: true
  app_website:
    label: Official Website
    type: url
  start_url:
    label: Start URL
    type: text

  mobile_start_url:
    label: Start URL of Mobile
    type: text
    
  client_id:
    group: API
    label: Client ID
    type: text
  client_secret:
    group: API
    label: Client Secret
    type: text

  oauth2_enabled:
    group: OAuth2
    label: OAuth2 Enabled
    type: boolean
  oauth2_callback_url:
    group: OAuth2
    label: Callback URL
    type: text
  oauth2_scopes:
    group: OAuth2
    label: Scopes
    type: select
    multiple: true
    options:
      - label: Access to Your Unique Identifier (openid)
        value: openid
      - label: Access Basic Information (id, profile, email, address, phone)
        value: profile
      - label: Access Fully (full)
        value: full
  oauth2_logout_enabled: 
    group: OAuth2
    label: OAuth2 Logout Enabled
    type: boolean
  oauth2_logout_url:
    group: OAuth2
    label: OAuth2 Logout URL
    type: url
  
  saml_enabled:
    group: SAML
    label: SAML Enabled
    type: boolean
  saml_entity_id:
    group: SAML
    label: Entity Id
    type: text
  saml_issuer:
    group: SAML
    label: Issuer
    type: text
  saml_idp_cert:
    group: SAML
    label: IDP Cert
    type: text
  saml_acs_url:
    group: SAML
    label: ACS URL
    type: url
  saml_name_id_format:
    group: SAML
    label: Name
    type: text
  saml_logout_enabled: 
    group: SAML
    label: SAML Logout Enabled
    type: boolean
  saml_logout_url:
    group: SAML
    label: SAML Logout URL
    type: url
  saml_logout_block:
    group: SAML
    label: SAML Logout Block
    type: select
    options: 
      - label: HTTP Redirect
        value: redirect
      - label: HTTP Post
        value: post
list_views:
  all:
    label: All External Applications
    columns:
      - name
      - code
      - description
      - active
      - modified
    filter_scope: space
permission_set:
  user:
    allowCreate: false
    allowDelete: false
    allowEdit: false
    allowRead: true
    modifyAllRecords: false
    viewAllRecords: true
    modifyCompanyRecords: false
    viewCompanyRecords: true
  admin:
    allowCreate: true
    allowDelete: true
    allowEdit: true
    allowRead: true
    modifyAllRecords: true
    viewAllRecords: true