Socket
Socket
Sign inDemoInstall

mongodb-stitch-api-client

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-stitch-api-client

A mongodb stitch api client for nodejs.


Version published
Weekly downloads
19
increased by58.33%
Maintainers
1
Weekly downloads
 
Created
Source

Mongodb stitch api client for NODEJS

A mongdb stitch api client for nodejs.

Known Vulnerabilities Coverage Status Build Status Deps devDependency Status

NPM

How to install

npm install mongodb-stitch-api-client

Getting Started

The basic syntax is:

const getClient = require("mongodb-stitch-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

ParamTypeDefaultDescription
bodyObjectObject that contains stitch application details.
[productType]stringstandardOptional 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

ParamTypeDefaultDescription
[productType]stringstandardOptional 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

ParamTypeDescription
appIdstringApplication 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

ParamTypeDescription
appIdstringApplication 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

ParamTypeDescription
bodyObjectObject 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

ParamTypeDescription
serviceIdstringService Id.
bodyObjectObject 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

ParamTypeDescription
serviceIdstringService 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

ParamTypeDescription
serviceIdstringService 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

ParamTypeDescription
bodyObjectObject 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

ParamTypeDescription
triggerIdstringService Id.
bodyObjectObject 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

ParamTypeDescription
triggerIdstringService Id.
useResumeTokenboolWhether 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

ParamTypeDescription
triggerIdstringTrigger 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

ParamTypeDescription
triggerIdstringTrigger 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

ParamTypeDescription
bodyObjectObject 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

ParamTypeDescription
functionIdstringService Id.
bodyObjectObject 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

ParamTypeDescription
functionIdstringfunction 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

ParamTypeDescription
functionIdstringfunction 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

ParamTypeDescription
serviceIdstringservice id
bodyObjectObject 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

ParamTypeDescription
serviceIdstringservice id
ruleIdstringService Id.
bodyObjectObject 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

ParamTypeDescription
serviceIdstringservice 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

ParamTypeDescription
serviceIdstringservice id
ruleIdstringrule 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

ParamTypeDescription
serviceIdstringservice id
ruleIdstringrule 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

ParamTypeDefaultDescription
[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

ParamTypeDescription
bodyObjectObject 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

ParamTypeDescription
emailstringEmail 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

ParamTypeDescription
emailstringEmail 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

ParamTypeDescription
emailstringEmail 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

ParamTypeDescription
serviceIdstringservice id
bodyObjectObject 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

ParamTypeDescription
serviceIdstringservice id
webhookIdstringService Id.
bodyObjectObject 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

ParamTypeDescription
serviceIdstringservice 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

ParamTypeDescription
serviceIdstringservice id
webhookIdstringwebhook 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

ParamTypeDescription
serviceIdstringservice id
webhookIdstringwebhook Id

Keywords

FAQs

Package last updated on 30 Jan 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc