Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Library to create bots to connect to SmartDeveloperHub

License

Notifications You must be signed in to change notification settings

SmartDeveloperHub/sdh-core-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDH-CORE-BOT

Hex.pm npm version

This is the Smart Developer Hub Core Bot.

Smart Developer Hub project. For more information, please visit the Smart Developer Hub website.

SDH-CORE-BOT is distributed under the Apache License, version 2.0.

Installation

npm install sdh-core-bot

Configuration

To configure the data stored in Elastic Search and the methods provided in core.search configure the file "elasticConfig.json".

[
  {
    "index": "entities", // Name of the index
    "mappings": [ // Elastic search mappings
      {
        "class": "repo",  // Document type
        "attributes": {
          "id": {
            "type": "string",  // Type of the data
            "analyzer": "simple"  // Analyzer of Elastic Search to use
          },
          /* more */
        },
        "data": { // What data to store in Elastic Search
          "method": "getSDHRepositories", // Method in core.data to call (without arguments) to obtain the data
          "attributes": ["rid", "name"], // Attributes of the array of objects returned by the method to store in ES
          "config": {
            "trans":{ // Apply a transformation to the data to store
              "rid":{ // The transformation applies to the "rid" parameter
                "name":"id" // The transformation changes the name of the parameter ("rid") to "id"
              }
            }
          }
        },
        "operations": [ // Search operations exported to core.search
          {
            "name": "repositories", // Export an operation called core.search.repositories
            "search": ["id^2", "name"] // Search using parameters id and name, give double weight to id
          },
          /* more */
        ]
      },
    ],
    "operations": [ //Same as inside he mappings, but in this case search should be "<class>_<attribute>"
      {
        "name": "general", // Operation called core.search.general
        "search": ["org_id", "product_*"] // Search in org's id parameter and all the parameters of product 
      },
      /* more /*
    ]
  },
  /* more */
]

About

Library to create bots to connect to SmartDeveloperHub

Resources

License

Stars

Watchers

Forks

Packages

No packages published