Skip to content

Commit

Permalink
Merge branch 'main' into refactor/input_on_error
Browse files Browse the repository at this point in the history
  • Loading branch information
puria authored Jun 24, 2024
2 parents a03e20e + 274df7c commit 481fdb6
Show file tree
Hide file tree
Showing 30 changed files with 113 additions and 58 deletions.
1 change: 1 addition & 0 deletions docs/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ SPDX-License-Identifier: CC-BY-NC-SA-4.0
<!--@include: git/index.md-->
<!--@include: helpers/index.md-->
<!--@include: http/index.md-->
<!--@include: json-schema/index.md-->
14 changes: 14 additions & 0 deletions docs/examples/json-schema/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!--
SPDX-FileCopyrightText: 2024 Dyne.org foundation
SPDX-License-Identifier: CC-BY-NC-SA-4.0
-->

## json-schema plugin examples

### validate json
::: code-group
<<< @/examples/json-schema/validate.zen{3 gherkin:line-numbers}
<<< @/examples/json-schema/validate.data{json}
<<< @/examples/json-schema/validate.keys{json}
:::
6 changes: 6 additions & 0 deletions docs/examples/json-schema/validate.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"json_data": {
"first_name": "Jhon",
"last_name": "Doe"
}
}
17 changes: 17 additions & 0 deletions docs/examples/json-schema/validate.keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"json_schema": {
"type": "object",
"properties": {
"first_name": {
"type": "string"
},
"last_name": {
"type": "string"
}
},
"required": [
"first_name",
"last_name"
]
}
}
6 changes: 6 additions & 0 deletions docs/examples/json-schema/validate.zen
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Rule unknown ignore

Given I send json_data 'json_data' and send json_schema 'json_schema' and validate json and output into 'result'

Given I have a 'string dictionary' named 'result'
Then print the 'result'
21 changes: 13 additions & 8 deletions docs/statements/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,20 @@ neither the open/connect part nor the parameters part are present.
| connect | object | do same delete |
| connect | object,headers | do same delete |

## json-schema plugin
| open/connect | params | phrase |
| ------------ | --------------------- | ------------- |
| | json_data,json_schema | validate json |

## oauth plugin
| open/connect | params | phrase |
| ------------ | ------------------------------------- | --------------------------------- |
| | request,server_data | generate access token |
| | request,server_data | verify request parameters |
| | request,server_data | generate authorization code |
| | request,client,server_data,expires_in | generate request uri |
| | token,server_data | get claims from token |
| | request_uri,data,server_data | add data to authorization details |
| open/connect | params | phrase |
| ------------ | ------------------------------------- | ------------------------------------ |
| | request,server_data | generate access token |
| | request,server_data | verify request parameters |
| | request,server_data | generate authorization code |
| | request,client,server_data,expires_in | generate request uri |
| | token,server_data | get authorization details from token |
| | request_uri,data,server_data | add data to authorization details |

## pocketbase plugin
| open/connect | params | phrase |
Expand Down
4 changes: 3 additions & 1 deletion docs/statements/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {fs as sl_fs} from "@slangroom/fs";
import {git} from "@slangroom/git";
import {helpers} from "@slangroom/helpers";
import {http} from "@slangroom/http";
import {JSONSchema} from "@slangroom/json-schema";
import {oauth} from "@slangroom/oauth";
import {pocketbase} from "@slangroom/pocketbase";
import {qrcode} from "@slangroom/qrcode";
Expand All @@ -24,7 +25,7 @@ import {timestamp} from "@slangroom/timestamp";
import {wallet} from "@slangroom/wallet";
import {zencode} from "@slangroom/zencode";

const IGNORED_PKG = ['browser', 'core', 'deps', 'ignored', 'json-schema', 'shared']
const IGNORED_PKG = ['browser', 'core', 'deps', 'ignored', 'shared']

const __dirname = dirname(fileURLToPath(import.meta.url));
const ourDirPath = path.resolve(__dirname, "./");
Expand Down Expand Up @@ -59,6 +60,7 @@ const generateTable = (plugin, name) => {
[git, 'git'],
[helpers, 'helpers'],
[http, 'http'],
[JSONSchema, 'json-schema'],
[oauth, 'oauth'],
[pocketbase, 'pocketbase'],
[qrcode, 'qrcode'],
Expand Down
57 changes: 29 additions & 28 deletions docs/statements/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
{
"name": "statements",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@slangroom/core": "workspace:^",
"@slangroom/db": "workspace:^",
"@slangroom/ethereum": "workspace:^",
"@slangroom/fs": "workspace:^",
"@slangroom/git": "workspace:^",
"@slangroom/helpers": "workspace:^",
"@slangroom/http": "workspace:^",
"@slangroom/oauth": "workspace:^",
"@slangroom/pocketbase": "workspace:^",
"@slangroom/qrcode": "workspace:^",
"@slangroom/redis": "workspace:^",
"@slangroom/shell": "workspace:^",
"@slangroom/timestamp": "workspace:^",
"@slangroom/wallet": "workspace:^",
"@slangroom/zencode": "workspace:^",
"markdown-table": "^3.0.3"
}
"name": "statements",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@slangroom/core": "workspace:^",
"@slangroom/db": "workspace:^",
"@slangroom/ethereum": "workspace:^",
"@slangroom/fs": "workspace:^",
"@slangroom/git": "workspace:^",
"@slangroom/helpers": "workspace:^",
"@slangroom/http": "workspace:^",
"@slangroom/json-schema": "workspace:^",
"@slangroom/oauth": "workspace:^",
"@slangroom/pocketbase": "workspace:^",
"@slangroom/qrcode": "workspace:^",
"@slangroom/redis": "workspace:^",
"@slangroom/shell": "workspace:^",
"@slangroom/timestamp": "workspace:^",
"@slangroom/wallet": "workspace:^",
"@slangroom/zencode": "workspace:^",
"markdown-table": "^3.0.3"
}
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
"version": "1.33.9",
"version": "1.33.10",
"command": {
"publish": {
"conventionalCommits": true
Expand Down
2 changes: 1 addition & 1 deletion pkg/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@slangroom/pocketbase": "workspace:*",
"@slangroom/qrcode": "workspace:*"
},
"version": "1.33.9",
"version": "1.33.10",
"repository": "https://github.com/dyne/slangroom",
"license": "AGPL-3.0-only",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/core",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/deps": "workspace:*",
"@slangroom/ignored": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/db/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/db",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"sequelize": "^6.16.0",
Expand Down
2 changes: 1 addition & 1 deletion pkg/deps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/deps",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"chalk": "^5.3.0",
"chevrotain": "^10.5.0"
Expand Down
2 changes: 1 addition & 1 deletion pkg/ethereum/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/ethereum",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"@slangroom/shared": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/fs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/fs",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"@slangroom/shared": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/git/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/git",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"isomorphic-git": "^1.25.10"
Expand Down
2 changes: 1 addition & 1 deletion pkg/helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/helpers",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"@slangroom/shared": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/http/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/http",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"@slangroom/shared": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/ignored/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/ignored",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/deps": "workspace:*",
"@slangroom/shared": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion pkg/json-schema/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/json-schema",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"@slangroom/shared": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/oauth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/oauth",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@node-oauth/oauth2-server": "^5.1.0",
"@slangroom/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/pocketbase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/pocketbase",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@capacitor/preferences": "^6.0.0",
"@slangroom/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/qrcode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/qrcode",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"qrcode": "^1.5.3"
Expand Down
2 changes: 1 addition & 1 deletion pkg/redis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/redis",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@redis/client": "^1.5.12",
"@slangroom/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion pkg/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/shared",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/deps": "workspace:*"
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/shell/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/shell",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"execa": "^8.0.1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/timestamp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/timestamp",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"@slangroom/shared": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion pkg/wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/wallet",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@meeco/sd-jwt": "^0.0.3",
"@meeco/sd-jwt-vc": "^0.0.4",
Expand Down
2 changes: 1 addition & 1 deletion pkg/zencode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slangroom/zencode",
"version": "1.33.9",
"version": "1.33.10",
"dependencies": {
"@slangroom/core": "workspace:*",
"@slangroom/shared": "workspace:*"
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 481fdb6

Please sign in to comment.