A mongdb stitch api client for nodejs.
npm install mongodb-stitch-api-client
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"});
npm test
Following entities are currently supported
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 |
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 |
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 |
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 |
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. |
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. |
Returns all services
Kind: instance method of Service
Returns: Promise
- - promise which resolves on success and rejects on error
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 |
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 |
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. |
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. |
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. |
Returns all triggers
Kind: instance method of Trigger
Returns: Promise
- - promise which resolves on success and rejects on error
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 |
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 |
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
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. |
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. |
Returns all functions
Kind: instance method of StitchFunction
Returns: Promise
- - promise which resolves on success and rejects on error
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 |
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 |
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. |
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. |
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 |
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 |
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 |
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 |
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 |
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
Send a confirmation email.
Kind: instance method of Email
Returns: Promise
- - promise which resolves on success and rejects on error
Param | Type | Description |
---|---|---|
string |
Email address. |
Confirm a pending user.
Kind: instance method of Email
Returns: Promise
- - promise which resolves on success and rejects on error
Param | Type | Description |
---|---|---|
string |
Email address. |
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 |
---|---|---|
string |
Email address. |
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. |
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. |
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 |
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 |
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 |