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

mongodb-realm-api-client

v1.30.0

Published

A mongodb realm api client for nodejs.

Downloads

66

Readme

Mongodb realm api client for NODEJS

A mongdb realm api client for nodejs.

Known Vulnerabilities Coverage Status Build Status Deps devDependency Status

NPM

This is using mongodb-stitch-api-client under the hood. Soon mongodb-stitch-api-client will be deprecated.

How to install

npm install mongodb-realm-api-client

Getting Started

The basic syntax is:

const getClient = require("mongodb-realm-api-client");

const {trigger, application} = getClient({
  "publicKey": "some public key",
  "privateKey": "some private key",
  "baseUrl": "https://stitch.mongodb.com/api/admin/v3.0",
  "projectId": "some project/group id",
  "appId": "some stitch appId" // Optional when you are creating app using Application
});

await trigger.getAll();
const createApplication = await application.create({"name": "myFirstStitchApp", "deployment_model": "LOCAL", "location": "IE"});

Running the tests

npm test

API

Following entities are currently supported

Application

application.create(body, [productType]) ⇒ Promise

Creates the stitch application

Kind: instance method of Application
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Default | Description | | --- | --- | --- | --- | | body | Object | | Object that contains stitch application details. | | [productType] | string | standard | Optional product type. standard or atlas |

application.getAll([productType]) ⇒ Promise

Returns all applications

Kind: instance method of Application
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Default | Description | | --- | --- | --- | --- | | [productType] | string | standard | Optional product type. standard or atlas |

application.get(appId) ⇒ Promise

Returns a single application as per app Id

Kind: instance method of Application
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | appId | string | Application Id |

application.delete(appId) ⇒ Promise

Deletes a single application as per app Id

Kind: instance method of Application
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | appId | string | Application Id |

Service

service.create(body) ⇒ Promise

Creates the service

Kind: instance method of Service
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | body | Object | Object that contains stitch service details. |

service.update(serviceId, body) ⇒ Promise

Updates the service

Kind: instance method of Service
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | Service Id. | | body | Object | Object that contains stitch service details. |

service.getAll() ⇒ Promise

Returns all services

Kind: instance method of Service
Returns: Promise - - promise which resolves on success and rejects on error

service.get(serviceId) ⇒ Promise

Returns single service as per service Id

Kind: instance method of Service
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | Service Id |

service.delete(serviceId) ⇒ Promise

Deletes single service as per service Id

Kind: instance method of Service
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | Service Id |

Trigger

trigger.create(body) ⇒ Promise

Creates the trigger

Kind: instance method of Trigger
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | body | Object | Object that contains stitch trigger details. |

trigger.update(triggerId, body) ⇒ Promise

Updates the trigger

Kind: instance method of Trigger
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | triggerId | string | Service Id. | | body | Object | Object that contains stitch trigger details. |

trigger.resume(triggerId, [useResumeToken]) ⇒ Promise

Resumes the trigger

Kind: instance method of Trigger
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | triggerId | string | Service Id. | | useResumeToken | bool | Whether to use resume token for restarting trigger. Default is true. |

trigger.getAll() ⇒ Promise

Returns all triggers

Kind: instance method of Trigger
Returns: Promise - - promise which resolves on success and rejects on error

trigger.get(triggerId) ⇒ Promise

Returns single trigger as per trigger Id

Kind: instance method of Trigger
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | triggerId | string | Trigger Id |

trigger.delete(triggerId) ⇒ Promise

Deletes single trigger as per trigger Id

Kind: instance method of Trigger
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | triggerId | string | Trigger Id |

Token

token.getBearerToken() ⇒ Promise

Returns the bearer token as per public key and private key

Kind: instance method of Token
Returns: Promise - - promise which resolves on success and rejects on error

StitchFunction

stitchFunction.create(body) ⇒ Promise

Creates the function

Kind: instance method of StitchFunction
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | body | Object | Object that contains stitch functions details. |

stitchFunction.update(functionId, body) ⇒ Promise

Updates the function

Kind: instance method of StitchFunction
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | functionId | string | Service Id. | | body | Object | Object that contains stitch function details. |

stitchFunction.getAll() ⇒ Promise

Returns all functions

Kind: instance method of StitchFunction
Returns: Promise - - promise which resolves on success and rejects on error

stitchFunction.get(functionId) ⇒ Promise

Returns single function as per function Id

Kind: instance method of StitchFunction
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | functionId | string | function Id |

stitchFunction.delete(functionId) ⇒ Promise

Deletes single function as per function Id

Kind: instance method of StitchFunction
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | functionId | string | function Id |

Rule

rule.create(serviceId, body) ⇒ Promise

Creates the rule

Kind: instance method of Rule
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id | | body | Object | Object that contains stitch rules details. |

rule.update(serviceId, ruleId, body) ⇒ Promise

Updates the rule

Kind: instance method of Rule
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id | | ruleId | string | Service Id. | | body | Object | Object that contains stitch rule details. |

rule.getAll(serviceId) ⇒ Promise

Returns all rules

Kind: instance method of Rule
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id |

rule.get(serviceId, ruleId) ⇒ Promise

Returns single rule as per rule Id

Kind: instance method of Rule
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id | | ruleId | string | rule Id |

rule.delete(serviceId, ruleId) ⇒ Promise

Deletes single rule as per rule Id

Kind: instance method of Rule
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id | | ruleId | string | rule Id |

Log

log.get([options]) ⇒ Promise

Returns all the logs as per options passed

Kind: instance method of Log
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Default | Description | | --- | --- | --- | --- | | [options] | object | {} | Options having parameter which will be passed as query string |

Security

security.allowOrigins(body) ⇒ Promise

Set the allowed HTTP origins from which Stitch should allow requests.

Kind: instance method of Security
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | body | Object | Object that contains allowed http origins |

security.getAll() ⇒ Promise

List the allowed HTTP origins from which Stitch should allow requests.

Kind: instance method of Security
Returns: Promise - - promise which resolves on success and rejects on error

Email

email.sendConfirmationEmail(email) ⇒ Promise

Send a confirmation email.

Kind: instance method of Email
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | email | string | Email address. |

email.confirmPendingUser(email) ⇒ Promise

Confirm a pending user.

Kind: instance method of Email
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | email | string | Email address. |

email.reRunPendingConfirmation(email) ⇒ Promise

Re-runs a pending user’s confirmation workflow.

Kind: instance method of Email
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | email | string | Email address. |

Webhook

webhook.create(serviceId, body) ⇒ Promise

Creates the webhook

Kind: instance method of Webhook
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id | | body | Object | Object that contains stitch webhooks details. |

webhook.update(serviceId, webhookId, body) ⇒ Promise

Updates the webhook

Kind: instance method of Webhook
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id | | webhookId | string | Service Id. | | body | Object | Object that contains stitch webhook details. |

webhook.getAll(serviceId) ⇒ Promise

Returns all webhooks

Kind: instance method of Webhook
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id |

webhook.get(serviceId, webhookId) ⇒ Promise

Returns single webhook as per webhook Id

Kind: instance method of Webhook
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id | | webhookId | string | webhook Id |

webhook.delete(serviceId, webhookId) ⇒ Promise

Deletes single webhook as per webhook Id

Kind: instance method of Webhook
Returns: Promise - - promise which resolves on success and rejects on error

| Param | Type | Description | | --- | --- | --- | | serviceId | string | service id | | webhookId | string | webhook Id |