Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ npm i @code0-tech/code0-definition-reader --save-dev
const features = Definition("./path/to/definitions")

for (const feature in features) {
const name = feature.name; //name of the feature (e.g. rest)
const name = feature.name; //name of the feature (e.g. http)
const dataTypes = fearture.dataTypes; //dataTypes of this feature
const flowTypes = fearture.flowTypes; //flowTypes of this feature
const functions = fearture.runtimeFunctions; //runtimeFunctions of this feature
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variant": 3,
"identifier": "HTTP_REQUEST_OBJECT",
"identifier": "HTTP_REQUEST",
"name": [
{
"code": "en-US",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variant": 3,
"identifier": "HTTP_RESPONSE_OBJECT",
"identifier": "HTTP_RESPONSE",
"name": [
{
"code": "en-US",
Expand Down
21 changes: 21 additions & 0 deletions definitions/http/data_type/type/http_status_code.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"variant": 2,
"identifier": "HTTP_STATUS_CODE",
"name": [
{
"code": "en-US",
"content": "HTTP Status Code"
}
],
"rules": [
{
"config": {
"NumberRange": {
"from": 100,
"to": 599
}
}
}
],
"generic_keys": []
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"identifier": "REST",
"identifier": "HTTP",
"settings": [],
"input_type_identifier": "HTTP_REQUEST_OBJECT",
"return_type_identifier": "HTTP_RESPONSE_OBJECT",
"input_type_identifier": "HTTP_REQUEST",
"return_type_identifier": "HTTP_RESPONSE",
"editable": false,
"name": [
{
Expand Down
141 changes: 141 additions & 0 deletions definitions/http/runtime_definition/request/http_request_create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"runtime_name": "http::request::create",
"runtime_parameter_definitions": [
{
"data_type_identifier": {
"type": {
"DataTypeIdentifier": "HTTP_METHOD"
}
},
"runtime_name": "http_method",
"default_value": null,
"name": [
{
"code": "en-US",
"content": "HTTP Method"
}
],
"description": [
{
"code": "en-US",
"content": "Defines the HTTP method to be used, such as GET, POST, PUT, or DELETE."
}
],
"documentation": [
{
"code": "en-US",
"content": "Specifies the request method that determines the type of HTTP operation to perform."
}
]
},
{
"data_type_identifier": {
"type": {
"DataTypeIdentifier": "HTTP_HEADER_MAP"
}
},
"runtime_name": "headers",
"default_value": null,
"name": [
{
"code": "en-US",
"content": "HTTP Headers"
}
],
"description": [
{
"code": "en-US",
"content": "A collection of key-value pairs containing additional request metadata."
}
],
"documentation": [
{
"code": "en-US",
"content": "Optional headers that can define content type, authorization, cookies, caching policies, and more."
}
]
},
{
"data_type_identifier": {
"type": {
"DataTypeIdentifier": "HTTP_URL"
}
},
"runtime_name": "url",
"default_value": null,
"name": [
{
"code": "en-US",
"content": "Request URL"
}
],
"description": [
{
"code": "en-US",
"content": "The target URL to which the HTTP request will be sent."
}
],
"documentation": [
{
"code": "en-US",
"content": "Specifies the endpoint address, including protocol, host, path, and query parameters, where the request is directed."
}
]
},
{
"data_type_identifier": {
"type": {
"GenericKey": "P"
}
},
"runtime_name": "payload",
"default_value": null,
"name": [
{
"code": "en-US",
"content": "Request Body"
}
],
"description": [
{
"code": "en-US",
"content": "The data to include in the body of the request, typically used with methods like POST or PUT."
}
],
"documentation": [
{
"code": "en-US",
"content": "Contains the request payload, such as JSON, XML, form data, or binary content, depending on the Content-Type header."
}
]
}
],
"return_type_identifier": {
"type": {
"DataTypeIdentifier": "HTTP_REQUEST"
}
},
"throws_error": false,
"generic_keys": [
"P"
],
"name": [
{
"code": "en-US",
"content": "Construct HTTP Request"
}
],
"description": [
{
"code": "en-US",
"content": "Constructs an HTTP request object using the specified method, headers, URL, and payload."
}
],
"documentation": [
{
"code": "en-US",
"content": "Generates an HTTP request object that can be sent to a server. The request includes an HTTP method, optional headers, a destination URL, and an optional request body."
}
],
"deprecation_message": []
}
114 changes: 114 additions & 0 deletions definitions/http/runtime_definition/response/http_response_create.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"runtime_name": "http::response::create",
"runtime_parameter_definitions": [
{
"data_type_identifier": {
"type": {
"DataTypeIdentifier": "HTTP_STATUS_CODE"
}
},
"runtime_name": "http_status_code",
"default_value": null,
"name": [
{
"code": "en-US",
"content": "HTTP Status Code"
}
],
"description": [
{
"code": "en-US",
"content": "Represents the numeric status code returned by the server in response to an HTTP request."
}
],
"documentation": [
{
"code": "en-US",
"content": "Indicates the outcome of an HTTP request. Common codes include 200 (OK), 201 (Created), 400 (Bad Request), 401 (Unauthorized), 404 (Not Found), and 500 (Internal Server Error)."
}
]
},
{
"data_type_identifier": {
"type": {
"DataTypeIdentifier": "HTTP_HEADER_MAP"
}
},
"runtime_name": "headers",
"default_value": null,
"name": [
{
"code": "en-US",
"content": "HTTP Headers"
}
],
"description": [
{
"code": "en-US",
"content": "A collection of key-value pairs containing additional request metadata."
}
],
"documentation": [
{
"code": "en-US",
"content": "Optional headers that can define content type, authorization, cookies, caching policies, and more."
}
]
},
{
"data_type_identifier": {
"type": {
"GenericKey": "P"
}
},
"runtime_name": "payload",
"default_value": null,
"name": [
{
"code": "en-US",
"content": "Request Body"
}
],
"description": [
{
"code": "en-US",
"content": "The data to include in the body of the request, typically used with methods like POST or PUT."
}
],
"documentation": [
{
"code": "en-US",
"content": "Contains the request payload, such as JSON, XML, form data, or binary content, depending on the Content-Type header."
}
]
}
],
"return_type_identifier": {
"type": {
"DataTypeIdentifier": "HTTP_RESPONSE"
}
},
"throws_error": false,
"generic_keys": [
"P"
],
"name": [
{
"code": "en-US",
"content": "Construct HTTP Response"
}
],
"description": [
{
"code": "en-US",
"content": "Builds an HTTP response object using the specified status code, headers, and optional response body."
}
],
"documentation": [
{
"code": "en-US",
"content": "Creates a complete HTTP response object to be returned from a server. The response includes a status code, headers, and an optional body containing the response content."
}
],
"deprecation_message": []
}