1.0.21 • Published 2 years ago

@hypi/hypi-client-nodejs v1.0.21

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Hypi NodeJS Client

A NodeJS library to interface with Hypi low-code platform

Setup

npm -i @hypi/hypi-client-nodejs

Usage

Instantiate

const HypiClient = require("@hypi/hypi-client-nodejs")
const hypiClient = new HypiClient.HypiClient('foo.apps.hypi.app')
// changing app
hypiClient.setDomain('bar.apps.hypi.app')

Authentication

hypiClient.login('email@organization.org', 'secret-password')

The function createAccount accepts parameters of email, password, firstName, lastName, otherJsonObj

The firstName and lastName should be null if not provided

The otherJsonObj should be empty object if not provided or any more additional fields that the Hypi core type Account accepts.

The following examples demonstrate such:

hypiClient.createAccount(
  "email@organization.com", "secret-password", null, null, {}
  )

hypiClient.createAccount(
  "email@organization.com", "secret-password", "firstName", "lastName", {}
  )

hypiClient.createAccount(
  "email@organization.com", "secret-password", "firstName", "lastName", {
    "owner": {
        "dob": "2008-09-15T15:53:00"
      }
  }
  )

CRUD APIs

hypiClient.upsert({
      Pair: {
        hypi: {
          id: 'pairId'
        },
        key: 'k',
        value: 'v'
      }
    })

hypiClient.get('Pair', 'pairId', `{
      ... on Pair {
        hypi {
          id
        }
        key
        value
      }
    }`)

hypiClient.find('Pair', 'hypi.id=\'pairId\'', `{
      ... on Pair {
        hypi {
          id
        }
        key
        value
      }
    }`)

hypiClient.trash('Pair', 'hypi.id = \'pairId\'')

hypiClient.untrash('Pair', 'hypi.id = \'pairId\'')

hypiClient.delete('Pair', 'hypi.id = \'pairId\'')

Mutation/Query

hypiClient.getGqlClient().query(query, variables)
hypiClient.getGqlClient().mutate(mutation, variables)
1.0.21

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.20

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago