项目作者: Platekun

项目描述 :
Definition builder for Bizagi custom connectors
高级语言: TypeScript
项目地址: git://github.com/Platekun/bz-def.git
创建时间: 2017-04-11T21:56:30Z
项目社区:https://github.com/Platekun/bz-def

开源协议:MIT License

下载


Bz-Def

Builds the def/connector.json and actions.js file for your Bizagi Studio’s custom connector.

Why?

This package covers a required step for the “Bizagi Studio Connector Editor”. It is meant to be used with the bz-zip library.

Installation:

Install it as a global dependency:

  1. npm install -g bz-def

or install it locally as:

  1. npm install --save bz-def

How to use:

This replaces the connector editor, that means you will need to suply the required information (authdata and actions) in a JSON file called bzconfig.json. That file should be placed on the executing folder.

Notes:

  • The connector’s name and the connector’s auth properties’ must be either TitleCased or camelCased.
  • The connector’s actions’ name must be dash-cased.

bzconfig.json structure:

  1. {
  2. "name": "connector name",
  3. "description": "connector's description",
  4. "url": "service website",
  5. "icon": "base64 image",
  6. "actions": [
  7. {
  8. "name": "dash-cashed-action-name",
  9. "description": "your connector's action's description.",
  10. "inputs": [
  11. {
  12. "name": "whatever you input",
  13. "type": "string / decimal / integer / boolean / date / time / byte",
  14. "qty": "single / list"
  15. }
  16. ],
  17. "outputs": [
  18. {
  19. "name": "whatever you return",
  20. "type": "string / decimal / integer / boolean / date / time / byte",
  21. "qty": "single / list"
  22. }
  23. ]
  24. }
  25. ],
  26. "auth": [
  27. {
  28. "name": "some auth property like email, password, accessToken, etc.",
  29. "required": true / false,
  30. "hide": true / false
  31. }
  32. ]
  33. }

Example:

  1. {
  2. "name": "Imgur",
  3. "description": "Imgur connector for bizagi",
  4. "url": "https://www.imgur.com",
  5. "icon": "iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAADbklEQVR4Xu3cv2sTYRgH8O97uRKDiBBUEEFsRQ3ZhCJItN06iVC6FRy6RMdACo3gKBhxKA6WDh0yZdFF/BOSorSjFDT4GwQlQimIsaa5V96kia2Jvfchl+QhPrc00O9d7vnc8z4Nd6FKa60hm5WAEiwrp3poH9ba2hry+bz93kOenJ6exuTkZKvKfVi5XA5zc3NDTmBf3uLiIlKplGDZkAmWjdJuRrAEiyBAiEpnCRZBgBCVzhIsggAhyrazQnCw8OQMjpzUcODCQw3fvwDZmQ+owSOUGFyUJdaN7AnErxyG4zhtlXqeh9cvfiA3/zU4BcsjscO69egURi8e8j39jy9/YunmZ99ckAFWWEqFcK84BqX8l5lZnLcT76B1LUiPA4/FBksByK6OAcq8sty0RsaAWca7jbHBMoXcXz0NqBH7mnQVC4lP9vkuk6ywsqujUKp9qP+rRq09ZBLvuySw350Z1lnqKkQm8da+2i6TbLAaM+scYDHcWzVrhUzizf84sxQuXTuKmcwxwLEY2R7w7OEmio83gT5xsemsZrc8eH4eNa964Owys8p1wpi//KrLhUXbnR2WOf1s4QKU+wvQHYa98qB3RpC5WqJVGkCaJZYL4M7TGCLHq20lVr65uHu9hJ0+Lb29J8ASy5xg4yOE1xhHuy9R/7zqwCzDQWxssQaB4feeguUntOf3rLGUUiiXy4hGo9ja2qr/HORXMVhimftYtVrnuwkGy3VdmPta/d5YYjUhTGf9vTU7q9ONwV7jscNKJpNYXl5GJ6gmhgFLp9MwJ9/PjR2WWX42XWO6LxQK9dOqfnFYfTFEsAjXn/LX7qClSnhL6yi7zhIs62sH0uco6SzC938FS7Ds16HMLHsrmVkEK8ESLIoAISszS7AIAoSodJZgEQQIUekswSIIEKLSWYJFECBEpbMEiyBAiEpnCRZBgBCVzhIsggAhah6e2txbNx1o8zCW8Na+UXaPwgTL95r9CcgTaQLW+Pg41tfXffeYmJhAoVDwzQUZYLcMTXEbGxuIx+Md6zSzqlQqIRaLBelgdSyWWM0zr1QqCIfDrUK2t7cRiUSsCutFiDVWLwru5piCRdATLMEiCBCi0lmCRRAgRKWzBIsgQIhKZwWFVSwWsbKyQjjccEdnZ2cxNTXVKlL+TynhegsWAes3DU7TTVD6qBQAAAAASUVORK5CYII=",
  6. "actions": [
  7. {
  8. "name": "from-url",
  9. "description": "Uploads a image to Imgur given a single url",
  10. "inputs": [
  11. {
  12. "name": "imageUrl",
  13. "type": "string",
  14. "qty": "single"
  15. }
  16. ],
  17. "outputs": [
  18. {
  19. "name": "imageLink",
  20. "type": "string",
  21. "qty": "single"
  22. }
  23. ]
  24. },
  25. {
  26. "name": "from-file",
  27. "description": "Uploads image to imgur given a file",
  28. "inputs": [
  29. {
  30. "name": "imageFileContents",
  31. "type": "byte",
  32. "qty": "list"
  33. }
  34. ],
  35. "outputs": [
  36. {
  37. "name": "imageLink",
  38. "type": "string",
  39. "qty": "single"
  40. }
  41. ]
  42. }
  43. ],
  44. "auth": [
  45. {
  46. "name": "email",
  47. "required": true,
  48. "hide": false
  49. },
  50. {
  51. "name": "password",
  52. "required": true,
  53. "hide": true
  54. },
  55. {
  56. "name": "clientId",
  57. "required": true,
  58. "hide": true
  59. }
  60. ]
  61. }

To build the connector’s definition you only need to type on your terminal:

  1. bz-def

A def directory will be created on the executing directory. It will contain an action.js and a connector.json file. These are required for the connector to be interpreted by Bizagi Studio.