-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add pb, redis, qrcodde, shell, timestamp and zencode plugin exa…
…mples (#169) * docs: add pocketbase plugin examples * docs: add redis plugin examples * docs: add qrcode plugin examples * docs: add shell plugin examples * docs: add timestamp plugin examples * docs: add zencode plugin examples
- Loading branch information
1 parent
15e8bde
commit 9090d91
Showing
55 changed files
with
427 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"create_parameters": { | ||
"collection": "organizations", | ||
"record": { | ||
"name": "Jhon org" | ||
} | ||
}, | ||
"record_parameters": { | ||
"requestKey": "testCreate" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090", | ||
"my_credentials": { | ||
"email": "[email protected]", | ||
"password": "testtest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client | ||
Given I send my_credentials 'my_credentials' and login | ||
|
||
Given I send create_parameters 'create_parameters' and send record_parameters 'record_parameters' and create record and output into 'result' | ||
|
||
Given I have a 'string dictionary' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"delete_parameters": { | ||
"collection": "organizations", | ||
"id": "q3vijjsacrn32tk" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090", | ||
"my_credentials": { | ||
"email": "[email protected]", | ||
"password": "testtest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client | ||
Given I send my_credentials 'my_credentials' and login | ||
|
||
Given I send delete_parameters 'delete_parameters' and delete record and output into 'result' | ||
|
||
Given I have a 'string' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"show_parameters": { | ||
"collection": "organizations", | ||
"id": "p7viyzsihrn52uj", | ||
"fields": "name" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client | ||
|
||
Given I send show_parameters 'show_parameters' and get one record and output into 'result' | ||
|
||
Given I have a 'string dictionary' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"list_parameters": { | ||
"type": "list", | ||
"pagination": { | ||
"page": 2, | ||
"perPage": 20 | ||
}, | ||
"collection": "organizations" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client | ||
|
||
Given I send list_parameters 'list_parameters' and get some records and output into 'result' | ||
|
||
Given I have a 'string dictionary' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2024 Dyne.org foundation | ||
SPDX-License-Identifier: CC-BY-NC-SA-4.0 | ||
--> | ||
|
||
## pocketbase plugin examples | ||
|
||
### start pb client | ||
::: code-group | ||
<<< @/examples/pocketbase/start_pb.zen{3 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/start_pb.data{json} | ||
<<< @/examples/pocketbase/start_pb.keys{json} | ||
::: | ||
|
||
### login | ||
::: code-group | ||
<<< @/examples/pocketbase/login.zen{5 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/login.data{json} | ||
<<< @/examples/pocketbase/login.keys{json} | ||
::: | ||
|
||
### password reset | ||
::: code-group | ||
<<< @/examples/pocketbase/pw_reset.zen{6 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/pw_reset.data{json} | ||
<<< @/examples/pocketbase/pw_reset.keys{json} | ||
::: | ||
|
||
### get some records | ||
::: code-group | ||
<<< @/examples/pocketbase/get_some_records.zen{5 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/get_some_records.data{json} | ||
<<< @/examples/pocketbase/get_some_records.keys{json} | ||
::: | ||
|
||
### get one record | ||
::: code-group | ||
<<< @/examples/pocketbase/get_one_record.zen{5 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/get_one_record.data{json} | ||
<<< @/examples/pocketbase/get_one_record.keys{json} | ||
::: | ||
|
||
### create a record | ||
::: code-group | ||
<<< @/examples/pocketbase/create_record.zen{6 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/create_record.data{json} | ||
<<< @/examples/pocketbase/create_record.keys{json} | ||
::: | ||
|
||
### update a record | ||
::: code-group | ||
<<< @/examples/pocketbase/update_record.zen{6 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/update_record.data{json} | ||
<<< @/examples/pocketbase/update_record.keys{json} | ||
::: | ||
|
||
### delete a record | ||
::: code-group | ||
<<< @/examples/pocketbase/delete_record.zen{6 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/delete_record.data{json} | ||
<<< @/examples/pocketbase/delete_record.keys{json} | ||
::: | ||
|
||
### send request | ||
::: code-group | ||
<<< @/examples/pocketbase/send_request.zen{5 gherkin:line-numbers} | ||
<<< @/examples/pocketbase/send_request.data{json} | ||
<<< @/examples/pocketbase/send_request.keys{json} | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"my_credentials": { | ||
"email": "[email protected]", | ||
"password": "testtest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client | ||
|
||
Given I send my_credentials 'my_credentials' and login and output into 'result' | ||
|
||
Given I have a 'string' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"email": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090", | ||
"my_credentials": { | ||
"email": "[email protected]", | ||
"password": "testtest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client | ||
Given I send my_credentials 'my_credentials' and login | ||
|
||
Given I send email 'email' and ask password reset and output into 'result' | ||
|
||
Given I have a 'string dictionary' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"url": "/api/hello/user", | ||
"send_parameters": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client | ||
|
||
Given I send url 'url' and send send_parameters 'send_parameters' and send request and output into 'result' | ||
|
||
Given I have a 'string dictionary' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client and output into 'result' | ||
# for mobile contracts use instead | ||
# Given I connect to 'pb_address' and start capacitor pb client and output into 'result' | ||
|
||
Given I have a 'string' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"update_parameters": { | ||
"id": "q3vijjsacrn32tk", | ||
"collection": "organizations", | ||
"record": { | ||
"name": "new value for name" | ||
} | ||
}, | ||
"record_parameters": { | ||
"fields": "id, name" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"pb_address": "http://127.0.0.1:8090", | ||
"my_credentials": { | ||
"email": "[email protected]", | ||
"password": "testtest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'pb_address' and start pb client | ||
Given I send my_credentials 'my_credentials' and login | ||
|
||
Given I send update_parameters 'update_parameters' and send record_parameters 'record_parameters' and update record and output into 'result' | ||
|
||
Given I have a 'string dictionary' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
--> | ||
|
||
## qrcode plugin examples | ||
|
||
### create qr code | ||
::: code-group | ||
<<< @/examples/qrcode/qr_code.zen{3 gherkin:line-numbers} | ||
<<< @/examples/qrcode/qr_code.data{json} | ||
<<< @/examples/qrcode/qr_code.keys{json} | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"text": "Hello World!" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Rule unknown ignore | ||
|
||
Given I send text 'text' and create qr code and output into 'result' | ||
|
||
Given I have a 'string' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"key": "some key" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"redis": "redis://localhost:6379" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'redis' and send key 'key' and delete key from redis and output into 'result' | ||
|
||
Given I have a 'number' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: 2024 Dyne.org foundation | ||
SPDX-License-Identifier: CC-BY-NC-SA-4.0 | ||
--> | ||
|
||
## redis plugin examples | ||
|
||
### write object into key in redis | ||
::: code-group | ||
<<< @/examples/redis/write.zen{3 gherkin:line-numbers} | ||
<<< @/examples/redis/write.data{json} | ||
<<< @/examples/redis/write.keys{json} | ||
::: | ||
|
||
### read key from redis | ||
::: code-group | ||
<<< @/examples/redis/read.zen{3 gherkin:line-numbers} | ||
<<< @/examples/redis/read.data{json} | ||
<<< @/examples/redis/read.keys{json} | ||
::: | ||
|
||
### delete key from redis | ||
::: code-group | ||
<<< @/examples/redis/delete.zen{3 gherkin:line-numbers} | ||
<<< @/examples/redis/delete.data{json} | ||
<<< @/examples/redis/delete.keys{json} | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"key": "some key" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"redis": "redis://localhost:6379" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'redis' and send key 'key' and read key from redis and output into 'result' | ||
|
||
Given I have a 'string dictionary' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"key": "some key", | ||
"object": { | ||
"foo": "bar", | ||
"baz": "qux" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"redis": "redis://localhost:6379" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Rule unknown ignore | ||
|
||
Given I connect to 'redis' and send key 'key' and send object 'object' and write object into key in redis and outpuit into 'result' | ||
|
||
Given I have a 'string' named 'result' | ||
Then print the 'result' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"command": "ls -a" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Oops, something went wrong.