New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

adminjs-weaviate

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

adminjs-weaviate

AdminJS Weaviate adapter

unpublished
latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

adminjs-weaviate

This is an adminjs adapter integrating Weaviate as the data source.

Installation: npm add adminjs-weaviate.

The adapter lets you connect a Weaviate schema which is converted to AdminJS resources.

Setting it up

Example of passing a DB connection directly (will be able see and edit all classes):

const AdminJSWeaviate = require('adminjs-weaviate');
AdminJS.registerAdapter(AdminJSWeaviate);

const weaviateConnection = new AdminJSWeaviate.Connection({ // weaviate connection
  scheme: 'http',
  host: 'localhost:8080',
})
weaviateConnection.init().then(() => { // init() needs to be called before the connection is passed to AdminJS
    const adminJS = new AdminJS({
      databases: [weaviateConnection],
      rootPath: '/admin',
      resources: [],
    });
    // ...
});

Example of passing individual resources (recommended):

index.js

const AdminJSWeaviate = require('adminjs-weaviate');
AdminJS.registerAdapter(AdminJSWeaviate);

const weaviateConnection = new AdminJSWeaviate.Connection({ // weaviate connection
  scheme: 'http',
  host: 'localhost:8080',
})
weaviateConnection.init().then(() => { // init() needs to be called before the connection is passed to AdminJS
  const resource = require('./resource.js'); // defined below

    const adminJS = new AdminJS({
      databases: [],
      rootPath: '/admin',
      resources: [resource],
    });
    // ...
});

module.exports = { weaviateConnection }

resource.js

const { weaviateConnection } = require('../index');
module.exports = {
    resource: {
        // pass the raw class
        rawClass: {
            "class": "Text",
            "description": "A piece of text",
            "properties": [
                {
                    "dataType": [
                        "string"
                    ],
                    "description": "Text",
                    "name": "text"
                },
            ]
        },
        // and the connection client
        client: weaviateConnection.client
    },
    options: {}
};

Keywords

admin-bro

FAQs

Package last updated on 09 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts