npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

orki-core-view

v0.0.56

Published

## Como instalar

Downloads

113

Readme

orki-core-view

Como instalar

npm install orki-core-view

Como configurar

npx orki-core-view configure

Informe o endereço do servidor e o token de acesso.

Como importar um projeto existente

Esse comando irá importar o projeto do servidor para o diretório atual

npx orki-core-view import -p <path>

Cada arquivo schema deve ser criado com as seguintes convenções:

  • Sulfixo: <name>.model.yaml para modelo de dados
  • Sulfixo: <name>.api.yaml para api
  • Sulfixo: <name>.view.yaml para view

Exemplo de arquivo de modelo de dados

name: <name>
fields:
  - name: <name>
    typeField: String | Number | Boolean | Date | JSON | StringI18N | DynamicSelect |  StaticSelect
    required: true
  - name: <withRegex>
    typeField: String
    required: true
    optionsType:
      String:
        validate:
          regex: ^[A-Z]{2}$
          errorMessage: <messageOfError>
  - name: <name>
    typeField: StaticSelect
    required: true
    optionsType:
      StaticSelect:
        optionsList:
            - <option1>
            - <option2>
  - name: isVisible
    typeField: Boolean
  - name: <name>
    typeField: DynamicSelect
    optionsType:
      DynamicSelect:
        model: <modelName>
  - name: created_at
    typeField: Date
    optionsType:
      Date:
        defaultDateNowOnCreate: true
  - name: updated_at
    typeField: Date
    optionsType:
      Date:
        defaultDateNowOnUpdate: true
        defaultDateNowOnCreate: true
indexes:
  - _id: 6501b4289f33a344d2c99452
    name: unique_by_
    fields:
      - _id: 6501b4289f33a38060c99453
        name: user
        ordenation: asc
      - _id: 6501b4289f33a36af2c99454
        name: value
        ordenation: asc
      - _id: 6501b4289f33a3d112c99455
        name: type
        ordenation: asc
    unique: true
    sparse: false
  

Exemplo de arquivo de api

name: <name>
model: <modelName>
workspaces:
  - <workspaceName> # Nome do workspace 
permissions:
  canCreate: true
  canGet: true
  canList: true
  canUpdate: true
  canDelete: true
  canImport: true
hooks:
    beforeCreate: <scriptName>
    beforeUpdate: <scriptName>
    beforeDelete: <scriptName>
    beforeGet: <scriptName>
    beforeList: <scriptName>
    afterCreate: <scriptName>
    afterUpdate: <scriptName>
    afterDelete: <scriptName>
    afterGet: <scriptName>
    afterList: <scriptName>  
fields:
  - name: <fieldNameFromModel>
    select:
      optionsType:
        DynamicSelect:
          selectFields:
            - <fieldName_1>
            - <fieldName_2>
      isList: true # Se o campo é incluído na listagem
      isGet: true # Se o campo é incluído na consulta
  - name: type
    select:
      optionsType:
        StaticSelect:
          hasSearch: true # Se o campo possui busca via `query`
      isList: true
      isGet: true  

Exemplo de arquivo de view

name: <MenuName>
api: <apiName>
identifier: <identifier>
workspaces:
  - <workspaceName> # Nome do workspace
defaultFieldView:
  title: <fieldName>
  startDate: <fieldName>
  endDate: <fieldName>
fields:
  - name: <fieldName>
    label: <label>
    layout:
      xs: "12"
      sm: "12"
      md: "12"
      lg: "12"
      xl: "12"
    visible:
      editMode: true
      addMode: true
      listMode: true
      cloneMode: true
    order: 0 # Ordem de exibição -1 (desc) / 0 (não ordena) / 1 (asc)
  - name: <fieldName>
    label: <label>
    optionsType:
      DynamicSelect:
        diplayFields:
            - <fieldName_1>
            - <fieldName_2>
        api: <apiName>
        view: <viewName> # Gera um link nas view para facilitar a navegação
    layout:
      xs: "12"
      sm: "12"
      md: "12"
      lg: "12"
      xl: "12"
    visible:
      editMode: true
      addMode: true
      listMode: true
      cloneMode: true
    order: 0
  - name: <fieldName>
    label: <label>
    optionsType:
      String:
        component: textfield | textarea | richtext
    layout:
      xs: "12"
      sm: "12"
      md: "12"
      lg: "12"
      xl: "12"
    visible:
      editMode: true
      addMode: true
      listMode: true
      cloneMode: true  
  - name: <fieldName>
    label: <label>
    optionsType:
      Date:
        dateFormat: DD/MM/YYYY
        timeFormat: HH:mm
        isTimeAgo: true
    layout:
      xs: "12"
      sm: "12"
      md: "12"
      lg: "12"
      xl: "12"
    visible:
      editMode: true
      addMode: false
      listMode: true
      cloneMode: false
    order: -1
actions:
  - name: <actionName>
    identifier: <identifier>
    code: <scriptName>
    description: <description>
    icon: list_alt
    inputs:
      - name: <fieldName>
        label: <label>
        typeField: String | Number | Boolean | Date | JSON | StringI18N | DynamicSelect |  StaticSelect
        optionsType:
          DynamicSelect:
            diplayFields:
              - <fieldName_1>
            api: <apiName>
        layout:
          xs: "12"
          sm: "12"
          md: "12"
          lg: "12"
          xl: "12"
relationships:
  - fields:
      - <fieldName> # Campo da view para fazer o relacionamento 
    view: <viewName>
    name: <relationshipName>

Como fazer o deploy de um schema

Fazendo deploy de um arquivo

npx orki-core-view deploy -f ./tmp/out/product/views/product.view.yaml 

Fazendo deploy de um diretório

npx orki-core-view deploy -p tmp/ -t <model|api|view>