cisco-open / stated Goto Github PK
View Code? Open in Web Editor NEWStated is a REPL and library for embedding JSONata expressions into JSON or YAML
Home Page: https://github.com/cisco-open/stated
License: Apache License 2.0
Stated is a REPL and library for embedding JSONata expressions into JSON or YAML
Home Page: https://github.com/cisco-open/stated
License: Apache License 2.0
To enable local unit testing, a test file needs to import a template that it is testing
Allow import to load a local file based on a relative location of the caller
There are many ways to express data dependencies that aren't discoverable by the DAG building process.
One example
> .init -f "test.json"
{
"a": "❌",
"b": [
"/${a}"
],
"c$": "$lookup('a')"
}
> .out
{
"a": "❌",
"b": [
"❌"
],
"c$": "❌"
}
> .set /a "✅"
{
"a": "✅",
"b": [
"✅"
],
"c$": "❌" // 👈 Actual
}
.set /a "✅"
should result in "c$": "✅"
.
> .set /a "✅"
{
"a": "✅",
"b": [
"✅"
],
"c$": "✅" // 👈 Expected
}
0.0.10
, 0.0.29
//
to #
in .npmrc
. (Otherwise next step fails.)yarn
.test.json
with above snippet.yarn stated
..init -f "test.json"
, .out
, .set /a "✅"
).node -v |
yarn -v |
---|---|
v18.13.0 |
1.22.19 |
Local testing needs access to shared functions which are accessible via a REST API that requires authorization
Add OIDC/OAuth2 support to import function, via a new 'auth' object argument which can have a structure like
https://snoopy.observe.appdynamics.com/auth/8e1716f8-d79e-4a64-a91d-d1589f5fe94d/default
. .well-known/openid-configuration
will be appended to this URL as per OIDC specification.out on invalid path crashes REPL
REPL does not crash, and prints an error instead
REPL crashes with
null
file:///usr/local/lib/node_modules/stated-js/dist/src/StatedREPL.js:120
if (!result.toString().startsWith("Started tailing...") || this.tookOverIO(cliCoreMethodName)) {
^
TypeError: Cannot read properties of null (reading 'toString')
at StatedREPL.cli (file:///usr/local/lib/node_modules/stated-js/dist/src/StatedREPL.js:120:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async REPLServer.action (file:///usr/local/lib/node_modules/stated-js/dist/src/StatedREPL.js:70:21)
In order to enable unit testing, each failed test case needs to record an error in some global report, while continuing the execution of all the tests in a suite. That report needs to be returned in the end of test case execution
Add a new function, i.e. reportError(string name), which appends a new error to the report.
.out should return the report if there are any errors in it. This could be an option triggered by an argument
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.