Socket
Book a DemoInstallSign in
Socket

@terminusdb/terminusdb-documents-ui

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@terminusdb/terminusdb-documents-ui

SDK to build UI from terminusdb documents

6.0.10
latest
Source
npmnpm
Version published
Maintainers
4
Created
Source

terminusdb-documents-ui

SDK to build UI from terminusdb documents

Run playground

Run playground to get a demo.

Create a new data product in TerminusCMS and name it Playground. Go to /product_model page and copy paste the schema from file - playground/src/schema.json.

Make a .env file and add the following

SERVER=https://cloud.terminusdb.com/ 
USER=<your email>
TEAM=<your team>
DATA_PRODUCT="Playground"
TOKEN=<your token>

After adding .env file, run the below command npm run playground

Run test

To connect to a particular data product in TerminusCMS - add the following variables to .env file

SERVER=https://cloud.terminusdb.com/
USER=<your email>
TEAM=<your team>
DATA_PRODUCT=<your data product ID>
TOKEN=<your token>

After adding .env file, run the below command npm run test

Installation

Install the dependancy from npm

npm install @terminusdb/terminusdb-documents-ui

Then import dependancy as shown below

import {FrameViewer} from '@terminusdb/terminusdb-documents-ui'

Usage

Create

    let frame = "Person": {
	  "@key": {
		"@fields": [
		  "name",
		  "works_as"
		],
		"@type": "Lexical"
	  },
	  "@type": "Class",
	  "likes": {
		"@class": {
		  "@id": "Color",
		  "@type": "Enum",
		  "@values": [
			"red",
			"blue",
			"green"
		  ]
		},
		"@type": "Optional"
	  },
	  "name": "xsd:string"
	}

    return <FrameViewer
        frame={frame}
        mode={"Create"}
        type={"Person"}/>

View

Note - make sure filled document is provided in View mode

    let frame = "Person": {
	  "@key": {
		"@fields": [
		  "name",
		  "works_as"
		],
		"@type": "Lexical"
	  },
	  "@type": "Class",
	  "likes": {
		"@class": {
		  "@id": "Color",
		  "@type": "Enum",
		  "@values": [
			"red",
			"blue",
			"green"
		  ]
		},
		"@type": "Optional"
	  },
	  "name": "xsd:string"
	}

    let data = {
        "@id": "Person/Peter%20+terminusdb%3A%2F%2F%2Fdata%2FJob%2Fadmin",
        "@type": "Person",
        "likes": "blue",
        "name": "Peter "
    }

    return <FrameViewer
        frame={frame}
        mode={"View"}
        formData={data}
        type={"Person"}/>

Keywords

terminusdb-documents

FAQs

Package last updated on 05 Dec 2023

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.