Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A set of functions to help you build Bizagi custom connectors easier.

NotificationsYou must be signed in to change notification settings

Platekun/bzg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A set of functions to help you build Bizagi custom connectors easier.

Installation

npm install --save bzg

API

createResponse(res, err, statusCode): Creates a Bizagi formatted response. This is a special format used by Bizagi studio.

  • res: Object: HTTP request object.
  • err: Object: Request error object.
  • statusCode: String: How's the statusCode property called in the response object passed in. ex: "status", "status-code", etc.

createError(): Creates a human readable error. This is the error that users will see once the exception occurs doing the action.

  • errorType: String: An object containing the type of error it will be passed on to Bizagi. The following errors are supported.
    • GLB.UNKNOW_ACTION
    • GLB.RESPONSE_ERROR
    • REQUIRED_PARAM
  • params: Object: The parameters needed to build that type of error.
    • { action: String }
    • { code: Number, errorMessage: String }
    • { paramName: String }

findMissingParams(params): Generic function that checks the user input the same way Bizagi studio expects. It returns a string error if there's a missing param.

  • params: Object: Bizagi user input

Use

import bzg from 'bzg';import imgur from 'imgur';import consumer from './some-path/consumer';export function _action(handlers, services, authdata, input) {    // handlers.findMissingParams({/**/});    // services.imgur.setClientId('aCs53GSs4tga0ikp');    // services.consumer.init(imgur);    // ...    // handlers.createResponse({ statusCode: 200 });    // ...    // Remenber to return a Promise.}export const invoke = bzg( [imgur, consumer], _action);

About

A set of functions to help you build Bizagi custom connectors easier.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp