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

@godspeedsystems/plugins-elasticgraph-as-datasource

v1.2.0

Published

elasticgraph as datasource plugin for Godspeed Framework

Downloads

42

Readme

godspeed-plugin-elasticgraph-as-datasource

Welcome to the Godspeed Elasticgraph Plugin! 🚀

"Elasticgraph: Relationship aware node.js ORM over elasticsearch, with agility, quality and joy of development."

EG saves LOT of effort in development of a typical product because it abstracts some most common data operations into a simple configurable abstractions saving hundreds to thousand lines of code, makes the code neat, elegantly abstracts business logic in configurable text files and saves many hours of development and testing.

Using ElasticGraph one can configure and run (out of the box) highly scalable microservices using relational graph approach, optimized for storing and querying large informational graphs in greater depth and complexity.

The node module internally uses intelligent query batching and in memory caching, to support thousands of concurrent users, and complex search and analytic graph queries.

How to Use

  • Create a godspeed project from the CLI , open the created project in vscode and then add the plugin from the CLI of vscode, select the @godspeedsystems/plugins-elasticgraph-as-datastore to integrate the plugin.
$ godspeed plugin add


       ,_,   ╔════════════════════════════════════╗
      (o,o)  ║        Welcome to Godspeed         ║
     ({___}) ║    World's First Meta Framework    ║
       " "   ╚════════════════════════════════════╝


? Please select godspeed plugin to install: (Press <space> to select, <Up and Down> to move rows)
┌──────┬────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────┐
│      │ Name                                   │ Description                                                                    │
├──────┼────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────┤
│  ◯   │ mailer-as-datasource                   │ mailer as datasource plugin for Godspeed Framework                             │
├──────┼────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────┤
│  ◯   │ kafka-as-datasource-as-eventsource     │ kafka as datasource-as-eventsource plugin for Godspeed Framework               │
├──────┼────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────┤
│  ◯   │ cron-as-eventsource                    │ Cron as eventsource plugin for Godspeed Framework                              │
├──────┼────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────┤
│  ◯   │ redis-as-datasource                    │ redis as datasource plugin for Godspeed Framework                              │
├──────┼────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────┤
│ ❯◯   │ elasticgraph-as-datasource             │ elasticgraph as datasource plugin for Godspeed Framework                       │
└──────┴────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────┘
  • You will find the a file in your project related to the Elasticgraph plugin at src/datasources/types/elasticgraph.ts

elasticgraph.ts

import { DataSource } from "@godspeedsystems/plugins-elasticgraph-as-datasource";
export default DataSource;

Update configuration file based on your requirements in datasources/elasticgraph.yaml.

elasticgraph config ( src/datasources/elasticgraph.yaml )

type: elasticgraph
deep: false
collect: false
schema_backend: "path to your elasticgraph-model"

Create a elasticgraph model accordingly and save it

.
├── elasticgraph.yaml
├── eg1
│   ├── collect.toml
│   ├── common.toml
│   ├── config.toml
│   ├── custom.toml
│   ├── elasticsearch.toml
│   ├── joins
│   │   └── search.txt
│   └── schema
│       ├── aggregation.toml
│       ├── dependencies.toml
│       ├── entities
│       │   ├── reconciled.toml
│       │   └── auth_user.toml
│       ├── entitiesInfo.toml
│       ├── relationships.txt
│       ├── suggestions.toml
│       └── union.toml

Now to generate the CRUD API'S enter the below command

godspeed gen-crud-api
       ,_,   ╔════════════════════════════════════╗
      (o,o)  ║        Welcome to Godspeed         ║
     ({___}) ║    World's First Meta Framework    ║
       " "   ╚════════════════════════════════════╝



> [email protected] gen-crud-api
> npx @godspeedsystems/api-generator

Select datasource / schema to generate CRUD APIs
(x) elasticgraph.yaml
( ) For all
( ) Cancel
  • This command will generate the crud apis based on the sample elasticgraph model(schema_backend) provided at ./src/datasources/elasticgraph.yaml

  • Now you can view the event and workflows according defined elasticgraph model

sample event for create api

http.post./elasticgraph/category:
  summary: Create a new category
  description: Create category from elasticgraph
  fn: com.eg.elasticgraph.category.create
  body:
    content:
      application/json:
        schema:
          type: object
          properties:
            data:
              type: object
              properties:
                id:
                  type: number
                name:
                  type: string
  responses:
    content:
      application/json:
        schema:
          type: object

sample workflow for create api

summary: Create category
tasks:
  - id: elasticgraph_category_create
    fn: datasource.elasticgraph.category.index
    args:
      data:
        index: categorys
        type: _doc
        id: <% inputs.body.id %>
        body: <% inputs.body.data %>
    on_error:
      continue: false

Run godspeed dev to start the development server.

godspeed dev

Thank You For Using Godspeed