axway-api-builder-ext / api-builder-extras Goto Github PK
View Code? Open in Web Editor NEWAxway API-Builder Community contributions
License: Apache License 2.0
Axway API-Builder Community contributions
License: Apache License 2.0
Artefact version you are using
Before creating a bug, please make sure to use the latest available version
API-Builder version you are using
Giza
Actual behavior
Install the ForEach plugin, two new flows are created
Clicking "Example Parent Flow" results in a blank screen
Expected behavior
Clicking "Example Parent Flow" displays the flow as normal
Log-Output in Debug
None
Artefact version you are using
ForEach 2.0.0
API-Builder version you are using
Latest
Actual behavior
npm install @axway-api-builder-ext/api-builder-plugin-fn-foreach
npm install @axway-api-builder-ext/[email protected]
ls flows
The example flows are deleted.
Note that there is a related issue where just using 2.0.0, wiping node_modules and re-installing will re-install the examples, wiping any changes made to those files.
Expected behavior
Flows should not be deleted. It's arguable whether or not they should be deleted. Are they backwardly compatible? At the very least, if they're not the user will get an error that they are not. However, deleting them has potential to delete someone's work.
Also, I haven't verified this, but it is also possible a 2.0.1 patch might uninstall 2.0.0 and remove the example flows. Maybe.
Log-Output in Debug
User story
To support more legacy use-cases, where still files and batch operations are very important, a capability in API-Builder to Read and Write files from an API-Builder flow would be good.
I'm thinking there should be support for reading/writing specific file types such a CSV, XML, JSON, YAML and just plain text files.
Depending on the file-type different options should be available. For instance when reading from CSV filtering based on a given value in a certain column. Like an ID-Filtering.
Or when reading from JSON/YAML automatically convert it into Javascript-Objects.
@lcolasanti, as the idea came from you, feel free to comment if you would like to add something.
Additional context
Of course, in container-land the customer has to make sure to make the file-system available in a proper way. For instance using a mount.
Artefact version you are using
latest
API-Builder version you are using
latest
Actual behavior
Installing either "AWS-Lambda" or "Syncplicity" in API Builder Plugins UI will fail with invalid package names (404). The issue is that their package names differ from the convention used with in Axway-API-Builder-Ext. As a result, they were added to API Builder with incorrect package names (arguably our fault). However, it appears that the intention was that these be named the same as their folders in this repo:
Expected behavior
The plugins install correctly.
Log-Output in Debug
User story
Instead of just packaging the included Swagger/OpenAPI-Specification, we should use the new way of shipping an OpenAPI-Based connector.
This allows to automatically test the OpenAPI spec and improves UX in the API-Builder during install & uninstall.
See here for an example:
https://github.com/Axway/api-builder-examples/tree/master/flow-nodes/api-builder-plugin-petstore
User story
Currently CDATA is ignored, when converting an XML to JSON.
Artefact version you are using
JIRA Connector 0.0.4
API-Builder version you are using
Leeds
Actual behavior
API-Builder crashed when having the JIRA-Connector installed.
Expected behavior
Installation should succeed. API-Builder should not crash.
Log-Output in Debug
1587475228616 [@axway/api-builder-plugin-fn-swagger] Loading OpenAPI specs from 'C:\workspaces\API-Builder-Projects\test3\swagger'
1587475228637 [@axway/api-builder-plugin-fn-swagger] Found the following OpenAPI specs: ["jira-cp-connector"]
1587475229134 [@axway/api-builder-plugin-fn-swagger] [jira-cp-connector] There was a problem creating Swagger flow-node from: C:\workspaces\API-Builder-Projects\test3\swagger\jira-cp-connector.json
1587475229136 server failed to start
1587475229137 TypeError: There was a problem loading 'C:\workspaces\API-Builder-Projects\test3\node_modules\@axway\api-builder-plugin-fn-swagger':
Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at stubCredential (C:\workspaces\API-Builder-Projects\test3\node_modules\@axway\api-builder-oas-flow-node\src\plugin\createStubCredentials.js:39:19)
at createStubCredentials (C:\workspaces\API-Builder-Projects\test3\node_modules\@axway\api-builder-oas-flow-node\src\plugin\createStubCredentials.js:78:16)
at generateServiceConfig (C:\workspaces\API-Builder-Projects\test3\node_modules\@axway\api-builder-oas-flow-node\src\plugin\generateServiceConfig.js:182:26)
at getPlugin (C:\workspaces\API-Builder-Projects\test3\node_modules\@axway\api-builder-oas-flow-node\src\plugin\index.js:99:7)
at async resolveModule (C:\workspaces\API-Builder-Projects\test3\node_modules\@axway\api-builder-runtime\lib\plugins.js:79:20)
at async Object.findPlugins (C:\workspaces\API-Builder-Projects\test3\node_modules\@axway\api-builder-runtime\lib\plugins.js:208:13)
Artefact version you are using
2.0.0
API-Builder version you are using
Latest
Actual behavior
{"message":"Cannot read property 'getFlow' of null"}
Expected behavior
The ForEach should execute a flow.
Log-Output in Debug
Artefact version you are using
connector/[email protected]
API-Builder version you are using
4.69.0
Actual behavior
With node 14, Starting the postgresql connector stops the builder abruptly (see logs below)
With node 12, starts normally.
Expected behavior
The latest version of this plugin should start normally with the latest version of NodeJS
It might just be a needed bump in pg version: version 7.x does not work on node 14, and pg 8.x requires it.
As I understood it, it boils down to a breaking change on how NodeJS implements streams...
Log-Output in Debug
[prompt> npm start
> [email protected] start
> node .
1633605861720 DEBUG configuration applied in this order: /Users/jcabrera/work/clients/Imerys/uc3/apibuilder/conf/api.default.js,/Users/jcabrera/work/clients/Imerys/uc3/apibuilder/conf/default.js,/Users/jcabrera/work/clients/Imerys/uc3/apibuilder/conf/postgres.default.js
1633605861721 DEBUG The maximum part size for multipart/form-data requests is 10MB
1633605861811 INFO API Builder/Wrecsam (4.70.2) uc3/1.0.0
1633605861811 DEBUG APIKey is: ELQj/5A7pZB8+jrgPm50O9IGF2wqE/tM
1633605861891 WARN Your server has no authentication, accessControl.apiPrefixSecurity is unset.
1633605861894 DEBUG Registering upgrade handler for flow
1633605861935 INFO Registered plugin: @axway/api-builder-plugin-fn-base64
1633605861947 INFO Registered plugin: @axway/api-builder-plugin-fn-javascript
1633605861957 INFO Registered plugin: @axway/api-builder-plugin-fn-json
1633605861965 INFO Registered plugin: @axway/api-builder-plugin-fn-logger
1633605861973 INFO Registered plugin: @axway/api-builder-plugin-fn-mustache
1633605861980 INFO Registered plugin: @axway/api-builder-plugin-fn-restclient
1633605862037 DEBUG [@axway/api-builder-plugin-fn-swagger] Loading OpenAPI specs from '/Users/jcabrera/work/clients/Imerys/uc3/apibuilder/swagger'
1633605862037 DEBUG [@axway/api-builder-plugin-fn-swagger] Found the following OpenAPI specs: ["api"]
1633605862065 INFO Registered plugin: @axway/api-builder-plugin-fn-swagger
1633605862099 INFO Registered plugin: @axway/api-builder-plugin-invoke-flow
1633605862101 INFO Registered plugin: @axway-api-builder-ext/api-builder-plugin-dc-postgres
1633605862126 INFO Starting connector/memory@built-in
1633605862126 INFO Started connector/memory@built-in
1633605862126 INFO Starting connector/[email protected]
[prompt>
User story
A Credit union collects personal information during account opening…
They collect things like ID images from the customers for the Proof of identity.
They collect all of it and store it with their sales platform on the cloud .
Their Requirement is to build an API that the cloud based sales platform will call to move theese images from their cloud to the Credit Union's On-Prem shared folder .
They want an API that Axway will provide where they can POST the content
(Base64 encoded) in the BODY .
The API with Axway will then read the BODY, Base64 decode it (maybe serialize it) , and then save the content to a shared folder.
Additional context
Size of the files would be very small in KBs.
User story
Some JIRA field names vary from instance to instance. Also, when using custom fields, JIRA will assign arbitrary field names in the form of customfield_10034. There is an API called Issue Fields for retrieving a list of fields so I can determine the custom field name. You can see it here: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-fields/
Additional context
Here is sample issue response showing customfields:
{
"status": 200,
"headers": {
"server": "AtlassianProxy/1.19.3.1",
"vary": "Accept-Encoding",
"cache-control": "no-cache, no-store, no-transform",
"content-type": "application/json;charset=UTF-8",
"content-encoding": "gzip",
"strict-transport-security": "max-age=315360000; includeSubDomains; preload",
"date": "Mon, 07 Feb 2022 21:22:51 GMT",
"atl-traceid": "1664a63de56a203d",
"x-arequestid": "a78680e1-525c-497f-b579-e94eb96817b0",
"x-aaccountid": "5ac65324cf8dc659b8f1cd98",
"x-xss-protection": "1; mode=block",
"transfer-encoding": "chunked",
"timing-allow-origin": "*",
"x-envoy-upstream-service-time": "183",
"x-content-type-options": "nosniff",
"connection": "close",
"set-cookie": [
"atlassian.xsrf.token=39ed31c4-57b0-439f-a3ba-e73bb86dac61_6f59210a783b4b1a0dd0638cd05bbe76509c9fbe_lin; path=/; SameSite=None; Secure"
],
"expect-ct": "report-uri=\"https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy\", enforce, max-age=86400"
},
"data": {
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations,customfield_10010.requestTypePractice",
"id": "10559",
"self": "https://lbrenman.atlassian.net/rest/api/2/issue/10559",
"key": "AS-194",
"fields": {
"statuscategorychangedate": "2022-02-02T16:29:18.248-0500",
"issuetype": {
"self": "https://lbrenman.atlassian.net/rest/api/2/issuetype/10008",
"id": "10008",
"description": "A problem or error.",
"iconUrl": "https://lbrenman.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium",
"name": "Bug",
"subtask": false,
"avatarId": 10303,
"hierarchyLevel": 0
},
"timespent": null,
"project": {
"self": "https://lbrenman.atlassian.net/rest/api/2/project/10005",
"id": "10005",
"key": "AS",
"name": "API Subscriptions",
"projectTypeKey": "software",
"simplified": false,
"avatarUrls": {
"48x48": "https://lbrenman.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10419",
"24x24": "https://lbrenman.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10419?size=small",
"16x16": "https://lbrenman.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10419?size=xsmall",
"32x32": "https://lbrenman.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10419?size=medium"
}
},
"customfield_10031": null,
"customfield_10032": null,
"fixVersions": [],
"customfield_10033": "8a2e86837e8c24da017e9d3d21b93bdd",
"customfield_10034": "8a2e97b07e8c23e1017ebc576a5940ef",
"aggregatetimespent": null,
"customfield_10035": null,
"resolution": null,
"customfield_10036": null,
"customfield_10027": null,
"resolutiondate": null,
"workratio": -1,
"issuerestriction": {
"issuerestrictions": {},
"shouldDisplay": false
},
"lastViewed": null,
"watches": {
"self": "https://lbrenman.atlassian.net/rest/api/2/issue/AS-194/watchers",
"watchCount": 1,
"isWatching": false
},
"created": "2022-02-02T16:29:17.937-0500",
"customfield_10020": null,
"customfield_10021": null,
"customfield_10022": null,
"customfield_10023": null,
"priority": {
"self": "https://lbrenman.atlassian.net/rest/api/2/priority/1",
"iconUrl": "https://lbrenman.atlassian.net/images/icons/priorities/highest.svg",
"name": "Highest",
"id": "1"
},
"customfield_10024": null,
"customfield_10025": [],
"labels": [],
"customfield_10026": null,
"customfield_10016": null,
"customfield_10017": null,
"customfield_10018": {
"hasEpicLinkFieldDependency": false,
"showField": false,
"nonEditableReason": {
"reason": "PLUGIN_LICENSE_ERROR",
"message": "The Parent Link is only available to Jira Premium users."
}
},
"customfield_10019": "0|i0006n:",
"aggregatetimeoriginalestimate": null,
"timeestimate": null,
"versions": [],
"issuelinks": [],
"assignee": null,
"updated": "2022-02-02T16:29:17.937-0500",
"status": {
"self": "https://lbrenman.atlassian.net/rest/api/2/status/10003",
"description": "",
"iconUrl": "https://lbrenman.atlassian.net/",
"name": "To Do",
"id": "10003",
"statusCategory": {
"self": "https://lbrenman.atlassian.net/rest/api/2/statuscategory/2",
"id": 2,
"key": "new",
"colorName": "blue-gray",
"name": "To Do"
}
},
"components": [],
"timeoriginalestimate": null,
"description": "Subscription approval request for API: \"translate (v7b)\"\n\nRequestor: \nLeor Brenman\[email protected]\n\nIn order to approve or reject the subscription request, set the Approve/Reject field and close the incident.\n\nYou can review the susbscription request here:\nhttps://apicentral.axway.com/catalog/8a2e86837e8c24da017e9d3d21b93bdd/subscriptions/8a2e97b07e8c23e1017ebc576a5940ef\n\n",
"customfield_10010": null,
"customfield_10014": null,
"customfield_10015": null,
"timetracking": {},
"customfield_10005": null,
"customfield_10006": null,
"customfield_10007": null,
"security": null,
"customfield_10008": null,
"attachment": [],
"aggregatetimeestimate": null,
"customfield_10009": null,
"summary": "Subscription approval request for API: \"translate (v7b)\"",
"creator": {
"self": "https://lbrenman.atlassian.net/rest/api/2/user?accountId=5bb2679d672747437cf74547",
"accountId": "5bb2679d672747437cf74547",
"avatarUrls": {
"48x48": "https://secure.gravatar.com/avatar/d2931fad8902916ec9d505928c511bad?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FLB-5.png",
"24x24": "https://secure.gravatar.com/avatar/d2931fad8902916ec9d505928c511bad?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FLB-5.png",
"16x16": "https://secure.gravatar.com/avatar/d2931fad8902916ec9d505928c511bad?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FLB-5.png",
"32x32": "https://secure.gravatar.com/avatar/d2931fad8902916ec9d505928c511bad?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FLB-5.png"
},
"displayName": "Leor Brenman",
"active": true,
"timeZone": "America/New_York",
"accountType": "atlassian"
},
"subtasks": [],
"customfield_10040": null,
"reporter": {
"self": "https://lbrenman.atlassian.net/rest/api/2/user?accountId=5bb2679d672747437cf74547",
"accountId": "5bb2679d672747437cf74547",
"avatarUrls": {
"48x48": "https://secure.gravatar.com/avatar/d2931fad8902916ec9d505928c511bad?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FLB-5.png",
"24x24": "https://secure.gravatar.com/avatar/d2931fad8902916ec9d505928c511bad?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FLB-5.png",
"16x16": "https://secure.gravatar.com/avatar/d2931fad8902916ec9d505928c511bad?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FLB-5.png",
"32x32": "https://secure.gravatar.com/avatar/d2931fad8902916ec9d505928c511bad?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FLB-5.png"
},
"displayName": "Leor Brenman",
"active": true,
"timeZone": "America/New_York",
"accountType": "atlassian"
},
"aggregateprogress": {
"progress": 0,
"total": 0
},
"customfield_10000": "{}",
"customfield_10001": null,
"customfield_10002": null,
"customfield_10003": null,
"customfield_10004": null,
"customfield_10038": null,
"customfield_10039": null,
"environment": null,
"duedate": null,
"progress": {
"progress": 0,
"total": 0
},
"comment": {
"comments": [],
"self": "https://lbrenman.atlassian.net/rest/api/2/issue/10559/comment",
"maxResults": 0,
"total": 0,
"startAt": 0
},
"votes": {
"self": "https://lbrenman.atlassian.net/rest/api/2/issue/AS-194/votes",
"votes": 0,
"hasVoted": false
},
"worklog": {
"startAt": 0,
"maxResults": 20,
"total": 0,
"worklogs": []
}
}
}
}
Artefact version you are using
@axway-api-builder-ext/[email protected]
API-Builder version you are using
4.x
Describe the security issue
Found by npm-audit:
# Run npm install @axway-api-builder-ext/[email protected] to resolve 1 vulnerability
SEMVER WARNING: Recommended action is a potentially breaking change
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Arbitrary Code Execution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ underscore │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ @axway-api-builder-ext/api-builder-plugin-fn-foreach │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ @axway-api-builder-ext/api-builder-plugin-fn-foreach > │
│ │ axway-flow-sdk > nomnom > underscore │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1674 │
└───────────────┴──────────────────────────────────────────────────────────────┘
Artefact version you are using @axway-api-builder-ext/api-builder-plugin-dc-postgres: ^1.0.2
API-Builder version you are using 1.18.1
Actual behavior
module.exports = {
connectors: {
postgres: {
connector: '@axway-api-builder-ext/api-builder-plugin-dc-postgres',
host: process.env.POSTGRES_HOST,
port: process.env.POSTGRES_PORT,
database: process.env.POSTGRES_DB,
user: process.env.POSTGRES_USER,
password: process.env.POSTGRES_PASSWORD,
// Create models based on your schema that can be used in your API.
generateModelsFromSchema: true,
// Whether or not to generate APIs based on the methods in generated models.
modelAutogen: true
}
}
};
Expected behavior
connect to postgresql 13.3
Log-Output in Debug
ERROR Error loading connector/[email protected]. pg is not defined
ERROR Server failed to load components
ERROR ReferenceError: pg is not defined
at Connector.exports.connect [as _connect] (C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\@axway-api-builder-ext\api-builder-plugin-dc-postgres\lib\lifecycle\connect.js:24:21)
at Connector.connectTask (C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\arrow-orm\lib\connector.js:478:9)
at C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\async\dist\async.js:3880:24
at replenish (C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\async\dist\async.js:1011:17)
at C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\async\dist\async.js:1016:9
at eachOfLimit (C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\async\dist\async.js:1041:24)
at C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\async\dist\async.js:1046:16
at _parallel (C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\async\dist\async.js:3879:5)
at Object.series (C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\async\dist\async.js:4735:5)
at Connector.connect (C:\Users\Max\demo-posgresql-axway\demo-posgresql-axway\node_modules\arrow-orm\lib\connector.js:517:8)
Artifact version you are using
api-builder-plugin-fn-aws-lambda
api-builder-plugin-fn-aws-athena
api-builder-plugin-fn-foreach
api-builder-plugin-fn-file
plugin-fn-objectfilter
plugin-fn-xml-node
Describe the security issue
minimist requires a upgrade: https://npmjs.com/advisories/1179
User story
The XML Flow-Node with Method: XML2JSON supports only the Next
path, as it has actually no error handling. That means, as a Flow-Developer I have no real control, if the given XML content could really be converted into JSON/JS-Object or not.
This should be improved to make proper error handling possible.
Additional context
The Flow-Node is using: https://www.npmjs.com/package/xml-js
And is for that basically using:
if (asString) {
console.log('Converting given XML data into a JSON-String.');
result = convert.xml2json(xmlData, options);
} else {
console.log('Converting given XML data into a JS-Object.');
result = convert.xml2js(xmlData, options);
}
User story
As the API-Builder UI actually doesn't support management of unattached flows, the developer needs to manually copy an empty flow into the flows directory.
Until the new Flow-Editor is ready, that UX can be improved by copying an empty flow automatically into the flows directory, which can edited directly from the UI.
This also gives developer a better context of what happens, when they have to create another flow.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.