kinvey / flex-sdk Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Hi,
I am developing a few flex functions using flex-sdk. For now, I am running a local server using 'node .' and sending requests using PostMan. However, it's pretty manual process. I'd like to know if there is any best practice to automate unit or functional testing for those flex functions.
Now that FlexService supports multiple Node runtimes, the package.json engines config should be updated to reflect this. Currently it is set to node 6.x.x only, but 8.x and 10.x are now supported by Flex.
When using yarnpkg / yarn (instead of npm) it will fail when trying to install the kinvey-flex-sdk
module.
Current:
"engines": { "node": "=6.x.x" }
Proposed:
"engines": { "node": "=6.x.x||=8.x.x||=10.x.x" }
If anyone is having this issue, the work around is to pass --ignore-engines
argument to yarn.
After registering a function they are not visible, neither locally or when deployed in Kinvey.
Seems the Express param routing names are not matching for the flex functions when running locally (:handlerName vs objectName)?.
Also the X-Kinvey.. headers does not seem to get picked up
I was attempting to get a role's ID by its name through roleStore, but found myself unable to do so directly. Most "store" modules have a "find(query, callback)" function, but roleStore seems to lack this. It'd be nice if roleStore implemented a "find(query, callback)" method and/or a "list()" method (that returns all roles).
When I run kinvey flex deploy
, while my JavaScript is broken the deploy command still pushes the code to Kinvey, which then breaks my cloud code.
Instead it would be great if the deploy command could run some basic validations and throw an error, stopping me from sending the invalid code.
For example, in my code I was trying to submit code like:
export const myFunction = (context, complete, modules) => {
complete().setBody([1, 2, 3]).done();
}
However, when I run node .
, node will complain about the use of export
and fail.
But kinvey flex deploy
doesn't complain and is happy to push the invalid code.
Is there a TypeScript Declaration File for the Flex SDK? If not, is that something that would be created by Kinvey in the future?
I would like to use it with Flex Typescript boilerplate: kinvey-flex-ts-boilerplate.
There is 'updateAsync' in the BL API (http://devcenter.kinvey.com/rest/reference/business-logic/reference.html#collection-access-promise)
It would be useful to have a similar function in flex-sdk's dataStore API.
Hi,
I just deployed my flex functions after updating flex-sdk to 2.0.0. Ever since, I got the following error when I access any of my flex functions.
{"error":"BLUnsupportedBodyType","description":"The request and response bodies returned from your Business Logic script must contain a valid JSON object.","debug":"Your 'request' object contained a body that is not a JSON object"}
It seems working well when I test them locally with PostMAN but I noticed one difference. As you see below (highlighted), request body was an object with 1.2.0 and is a string with 2.0.0. I think this causes the error from the deployed flex functions.
"body": {
"locationId": "58827e25ee1e6f71497f2283",
"email": "[email protected]",
"transferType": "to_home_owner"
}
},
"response": {
"status": 0,
"headers": {},
"body": {
"error": "FlexRuntimeError",
"description": "The Flex Service had a runtime error. See debug message for details",
"debug": {
"message": "location not found for 58827e25ee1e6f71497f2283"
}
},
"statusCode": 550,
"continue": false
}
}
"body": "{\"locationId\":\"58827e25ee1e6f71497f2283\",\"email\":\"[email protected]\",\"transferType\":\"to_home_owner\"}"
It'd be nice if the backendContext module could return metadata.baasUrl. As it stands, to invoke REST API calls from a Flex Function, I need to also pass around the context object (to get "context.headers.host"). For example, see the example in the Flex API reference:
https://devcenter.kinvey.com/rest/reference/flex/reference.html#Examples5
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.