Compare commits

...

4 Commits

Author SHA1 Message Date
dcb3e98ab1 opt 2026-02-11 16:11:10 +03:00
2964949153 extra method 2026-02-11 02:11:47 +03:00
053c4fba60 enchancements 2026-02-10 23:25:05 +03:00
af003c180d WiP 2026-02-10 19:12:14 +03:00
4 changed files with 101 additions and 18 deletions

View File

@@ -1,3 +1,3 @@
# S8n.ComponentsLibrary
Sharp8N components library, markdown files with definitions of different components.
Sharp8N components library, markdown files with definitions of different components.

34
basics/calculator.json Normal file
View File

@@ -0,0 +1,34 @@
{
"code": "basics.calculator",
"name": "Simple calculator",
"description": "Do simple operations for numbers in `args` input.",
"icon": "mdi-calculator",
"inputs": [
{
"name": "operator",
"type": "string",
"description": "Operation to perform",
"enum": ["add", "subtract", "multiply", "divide"],
"required": true
},
{
"name": "args",
"type": "object[]",
"description": "Array of numbers to operate on",
"required": true
}
],
"outputs": [
{
"name": "result",
"type": "object",
"description": "Result of the calculation"
}
],
"source": "S8n.Components.Packages (project)",
"class": "S8n.Components.Basics.Calculator",
"methods": ["Execute", "Reset"],
"gui": "ComponentCalculator.vue",
"category": "basics",
"tags": ["arithmetic", "math", "basics"]
}

View File

@@ -1,17 +0,0 @@
# Component definitions
## Simple calculator
```yaml
code: basics.calculator
description: Do simple operations for numbers in `args` input.
inputs:
- operator: string enum { add, subtract, multiply, divide }
- args: object[]
outputs:
- result: object
source: S8n.Components.Packages (project)
class: S8n.Components.Basics.Calculator
methods: Calc()
gui: CalculatorComponent.vue
```

66
basics/httprequest.json Normal file
View File

@@ -0,0 +1,66 @@
{
"code": "basics.httprequest",
"name": "HTTP Request",
"description": "Make HTTP requests to any URL with custom headers and body.",
"icon": "mdi-web",
"inputs": [
{
"name": "method",
"type": "string",
"description": "HTTP method",
"enum": ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"],
"required": true
},
{
"name": "url",
"type": "string",
"description": "Target URL",
"required": true
},
{
"name": "headers",
"type": "object",
"description": "Optional HTTP headers",
"required": false
},
{
"name": "body",
"type": "object",
"description": "Optional request body",
"required": false
}
],
"outputs": [
{
"name": "statusCode",
"type": "int",
"description": "HTTP status code"
},
{
"name": "statusText",
"type": "string",
"description": "HTTP status text"
},
{
"name": "response",
"type": "string",
"description": "Response body as string"
},
{
"name": "headers",
"type": "object",
"description": "Response headers"
},
{
"name": "duration",
"type": "long",
"description": "Request duration in milliseconds"
}
],
"source": "S8n.Components.Packages (project)",
"class": "S8n.Components.Basics.HttpRequest",
"methods": ["Execute"],
"gui": "ComponentHttpRequest.vue",
"category": "basics",
"tags": ["http", "network", "web", "basics"]
}