Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
210 changes: 210 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,210 @@
{
"variant": 2,
"identifier": "HTTP_STATUS_CODE",
"name": [
{
"code": "en-US",
"content": "HTTP Status Code"
}
],
"rules": [
{
"config": {
"ItemOfCollection": {
"items": [
{
"kind": { "StringValue": "100 Continue" }
Comment thread
raphael-goetz marked this conversation as resolved.
Outdated
},
{
"kind": { "StringValue": "101 Switching Protocols" }
},
{
"kind": { "StringValue": "102 Processing" }
},
{
"kind": { "StringValue": "103 Early Hints" }
},
{
"kind": { "StringValue": "200 OK" }
},
{
"kind": { "StringValue": "201 Created" }
},
{
"kind": { "StringValue": "202 Accepted" }
},
{
"kind": { "StringValue": "203 Non-Authoritative Information" }
},
{
"kind": { "StringValue": "204 No Content" }
},
{
"kind": { "StringValue": "205 Reset Content" }
},
{
"kind": { "StringValue": "206 Partial Content" }
},
{
"kind": { "StringValue": "207 Multi-Status" }
},
{
"kind": { "StringValue": "208 Already Reported" }
},
{
"kind": { "StringValue": "226 IM Used" }
},
{
"kind": { "StringValue": "300 Multiple Choices" }
},
{
"kind": { "StringValue": "301 Moved Permanently" }
},
{
"kind": { "StringValue": "302 Found" }
},
{
"kind": { "StringValue": "303 See Other" }
},
{
"kind": { "StringValue": "304 Not Modified" }
},
{
"kind": { "StringValue": "305 Use Proxy" }
},
{
"kind": { "StringValue": "306 Switch Proxy" }
},
{
"kind": { "StringValue": "307 Temporary Redirect" }
},
{
"kind": { "StringValue": "308 Permanent Redirect" }
},
{
"kind": { "StringValue": "400 Bad Request" }
},
{
"kind": { "StringValue": "401 Unauthorized" }
},
{
"kind": { "StringValue": "402 Payment Required" }
},
{
"kind": { "StringValue": "403 Forbidden" }
},
{
"kind": { "StringValue": "404 Not Found" }
},
{
"kind": { "StringValue": "405 Method Not Allowed" }
},
{
"kind": { "StringValue": "406 Not Acceptable" }
},
{
"kind": { "StringValue": "407 Proxy Authentication Required" }
},
{
"kind": { "StringValue": "408 Request Timeout" }
},
{
"kind": { "StringValue": "409 Conflict" }
},
{
"kind": { "StringValue": "410 Gone" }
},
{
"kind": { "StringValue": "411 Length Required" }
},
{
"kind": { "StringValue": "412 Precondition Failed" }
},
{
"kind": { "StringValue": "413 Payload Too Large" }
},
{
"kind": { "StringValue": "414 URI Too Long" }
},
{
"kind": { "StringValue": "415 Unsupported Media Type" }
},
{
"kind": { "StringValue": "416 Range Not Satisfiable" }
},
{
"kind": { "StringValue": "417 Expectation Failed" }
},
{
"kind": { "StringValue": "418 I'm a teapot" }
Comment thread
raphael-goetz marked this conversation as resolved.
Outdated
},
{
"kind": { "StringValue": "421 Misdirected Request" }
},
{
"kind": { "StringValue": "422 Unprocessable Entity" }
},
{
"kind": { "StringValue": "423 Locked" }
},
{
"kind": { "StringValue": "424 Failed Dependency" }
},
{
"kind": { "StringValue": "425 Too Early" }
},
{
"kind": { "StringValue": "426 Upgrade Required" }
},
{
"kind": { "StringValue": "428 Precondition Required" }
},
{
"kind": { "StringValue": "429 Too Many Requests" }
},
{
"kind": { "StringValue": "431 Request Header Fields Too Large" }
},
{
"kind": { "StringValue": "451 Unavailable For Legal Reasons" }
},
{
"kind": { "StringValue": "500 Internal Server Error" }
},
{
"kind": { "StringValue": "501 Not Implemented" }
},
{
"kind": { "StringValue": "502 Bad Gateway" }
},
{
"kind": { "StringValue": "503 Service Unavailable" }
},
{
"kind": { "StringValue": "504 Gateway Timeout" }
},
{
"kind": { "StringValue": "505 HTTP Version Not Supported" }
},
{
"kind": { "StringValue": "506 Variant Also Negotiates" }
},
{
"kind": { "StringValue": "507 Insufficient Storage" }
},
{
"kind": { "StringValue": "508 Loop Detected" }
},
{
"kind": { "StringValue": "510 Not Extended" }
},
{
"kind": { "StringValue": "511 Network Authentication Required" }
}
]
}
}
}
],
"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": []
}
Loading