diff --git a/spec/code_samples/cURL/setup@algorithm/get.sh b/spec/code_samples/cURL/setup@algorithm/get.sh new file mode 100644 index 0000000..4c50ea9 --- /dev/null +++ b/spec/code_samples/cURL/setup@algorithm/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/algorithm" + +curl -G "${base_url}/${path}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d limit=5 \ + -d page=1 \ + -d order=-namespace,name \ + -d embedding=snippet \ No newline at end of file diff --git a/spec/code_samples/cURL/setup@algorithm/post.sh b/spec/code_samples/cURL/setup@algorithm/post.sh new file mode 100644 index 0000000..c33506e --- /dev/null +++ b/spec/code_samples/cURL/setup@algorithm/post.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/algorithm" + +read -r -d '' data <<- EOM + { + namespace: "Test", + name: "alg_test_01", + type: "ruby", + code: "return 1 + 1", + } +EOM + +curl "${base_url}/${path}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@algorithm@{id}/delete.sh b/spec/code_samples/cURL/setup@algorithm@{id}/delete.sh new file mode 100644 index 0000000..d2bf362 --- /dev/null +++ b/spec/code_samples/cURL/setup@algorithm@{id}/delete.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/algorithm" +item_id="61eeeea05a5a2353a401b2c6" + +curl "${base_url}/${path}/${item_id}" \ + -X "DELETE" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" diff --git a/spec/code_samples/cURL/setup@algorithm@{id}/get.sh b/spec/code_samples/cURL/setup@algorithm@{id}/get.sh new file mode 100644 index 0000000..af7cfbd --- /dev/null +++ b/spec/code_samples/cURL/setup@algorithm@{id}/get.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/algorithm" +item_id="61eeeea05a5a2353a401b2c6" + +curl -G "${base_url}/${path}/${item_id}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}"\ + -d embedding=authorization \ + -d ignore=password diff --git a/spec/code_samples/cURL/setup@algorithm@{id}/post.sh b/spec/code_samples/cURL/setup@algorithm@{id}/post.sh new file mode 100644 index 0000000..9af58e7 --- /dev/null +++ b/spec/code_samples/cURL/setup@algorithm@{id}/post.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/algorithm" +item_id="61eeeea05a5a2353a401b2c6" + +read -r -d '' data <<- EOM + { + code: `return 1 + ${Date.now()}`, + } +EOM + +curl "${base_url}/${path}/${item_id}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@basic_authorization/get.sh b/spec/code_samples/cURL/setup@basic_authorization/get.sh new file mode 100644 index 0000000..c97f648 --- /dev/null +++ b/spec/code_samples/cURL/setup@basic_authorization/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/basic_authorization" + +curl -G "${base_url}/${path}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d limit=5 \ + -d page=1 \ + -d order=-namespace,name \ + -d ignore=password \ No newline at end of file diff --git a/spec/code_samples/cURL/setup@basic_authorization/post.sh b/spec/code_samples/cURL/setup@basic_authorization/post.sh new file mode 100644 index 0000000..abab890 --- /dev/null +++ b/spec/code_samples/cURL/setup@basic_authorization/post.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/basic_authorization" + +read -r -d '' data <<- EOM + { + namespace: "Test2", + name: "auth_basic", + username: "test2_auth_basic", + password: "test2_auth_basic" + } +EOM + +curl "${base_url}/${path}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@basic_authorization@{id}/delete.sh b/spec/code_samples/cURL/setup@basic_authorization@{id}/delete.sh new file mode 100644 index 0000000..a1b81a7 --- /dev/null +++ b/spec/code_samples/cURL/setup@basic_authorization@{id}/delete.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/basic_authorization" +item_id="62069b095a5a2330d0038cdc" + +curl "${base_url}/${path}/${item_id}" \ + -X "DELETE" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" diff --git a/spec/code_samples/cURL/setup@basic_authorization@{id}/get.sh b/spec/code_samples/cURL/setup@basic_authorization@{id}/get.sh new file mode 100644 index 0000000..f4b1098 --- /dev/null +++ b/spec/code_samples/cURL/setup@basic_authorization@{id}/get.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/basic_authorization" +item_id="62069b095a5a2330d0038cdc" + +curl -G "${base_url}/${path}/${item_id}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}"\ + -d embedding=authorization \ + -d ignore=password diff --git a/spec/code_samples/cURL/setup@basic_authorization@{id}/post.sh b/spec/code_samples/cURL/setup@basic_authorization@{id}/post.sh new file mode 100644 index 0000000..1e82d5d --- /dev/null +++ b/spec/code_samples/cURL/setup@basic_authorization@{id}/post.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/basic_authorization" +item_id="62069b095a5a2330d0038cdc" + +read -r -d '' data <<- EOM + { + username: "test_auth_basic@api_v2" + } +EOM + +curl "${base_url}/${path}/${item_id}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@connection_role/get.sh b/spec/code_samples/cURL/setup@connection_role/get.sh new file mode 100644 index 0000000..3dc28e0 --- /dev/null +++ b/spec/code_samples/cURL/setup@connection_role/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/connection_role" + +curl -G "${base_url}/${path}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d limit=5 \ + -d page=1 \ + -d order=-namespace,name \ + -d embedding:-webhooks,connections \ diff --git a/spec/code_samples/cURL/setup@connection_role/post.sh b/spec/code_samples/cURL/setup@connection_role/post.sh new file mode 100644 index 0000000..9a24d46 --- /dev/null +++ b/spec/code_samples/cURL/setup@connection_role/post.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/connection_role" + +read -r -d '' data <<- EOM + { + namespace: "Test", + name: "connection_role_test_01", + webhooks: [ + { + _reference: true, + namespace: "Test", + name: "webhook_test_01" + } + ], + connections: [ + { + _reference: true, + namespace: "Test", + name: "connection_test_01" + } + ], + } +EOM + +curl "${base_url}/${path}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@connection_role@{id}/delete.sh b/spec/code_samples/cURL/setup@connection_role@{id}/delete.sh new file mode 100644 index 0000000..8ad09db --- /dev/null +++ b/spec/code_samples/cURL/setup@connection_role@{id}/delete.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/connection_role" +item_id="620951d95a5a233eb9043557" + +curl "${base_url}/${path}/${item_id}" \ + -X "DELETE" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" diff --git a/spec/code_samples/cURL/setup@connection_role@{id}/get.sh b/spec/code_samples/cURL/setup@connection_role@{id}/get.sh new file mode 100644 index 0000000..af41e70 --- /dev/null +++ b/spec/code_samples/cURL/setup@connection_role@{id}/get.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/connection_role" +item_id="620951d95a5a233eb9043557" + +curl -G "${base_url}/${path}/${item_id}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}"\ + -d embedding=authorization \ + -d ignore=password diff --git a/spec/code_samples/cURL/setup@connection_role@{id}/post.sh b/spec/code_samples/cURL/setup@connection_role@{id}/post.sh new file mode 100644 index 0000000..56730e3 --- /dev/null +++ b/spec/code_samples/cURL/setup@connection_role@{id}/post.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/connection_role" +item_id="620951d95a5a233eb9043557" + +read -r -d '' data <<- EOM + { + webhooks: [ + { + _reference: true, + namespace: "Test", + name: "webhook_test_01" + } + ], + connections: [ + { + _reference: true, + namespace: "Test", + name: "connection_test_01" + } + ], + } +EOM + +curl "${base_url}/${path}/${item_id}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@flow/get.sh b/spec/code_samples/cURL/setup@flow/get.sh new file mode 100644 index 0000000..ca2d811 --- /dev/null +++ b/spec/code_samples/cURL/setup@flow/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/flow" + +curl -G "${base_url}/${path}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d limit=5 \ + -d page=1 \ + -d order=-namespace,name \ + -d embedding=snippet \ diff --git a/spec/code_samples/cURL/setup@flow@{id}/delete.sh b/spec/code_samples/cURL/setup@flow@{id}/delete.sh new file mode 100644 index 0000000..66850ac --- /dev/null +++ b/spec/code_samples/cURL/setup@flow@{id}/delete.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/flow" +item_id="61e083815a5a2353c40082f3" + +curl "${base_url}/${path}/${item_id}" \ + -X "DELETE" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" diff --git a/spec/code_samples/cURL/setup@flow@{id}/get.sh b/spec/code_samples/cURL/setup@flow@{id}/get.sh new file mode 100644 index 0000000..0b86f3f --- /dev/null +++ b/spec/code_samples/cURL/setup@flow@{id}/get.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/flow" +item_id="61e083815a5a2353c40082f3" + +curl -G "${base_url}/${path}/${item_id}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d embedding=snippet diff --git a/spec/code_samples/cURL/setup@flow@{id}/post.sh b/spec/code_samples/cURL/setup@flow@{id}/post.sh new file mode 100644 index 0000000..f2ee79e --- /dev/null +++ b/spec/code_samples/cURL/setup@flow@{id}/post.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/flow" +item_id="620364d55a5a236eda02cfb0" + +read -r -d '' data <<- EOM + { + active: true, + } +EOM + +curl "${base_url}/${path}/${item_id}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@json_data_type@{id}/post.sh b/spec/code_samples/cURL/setup@json_data_type@{id}/post.sh index 7a1dc79..41e16e5 100644 --- a/spec/code_samples/cURL/setup@json_data_type@{id}/post.sh +++ b/spec/code_samples/cURL/setup@json_data_type@{id}/post.sh @@ -7,7 +7,7 @@ item_id="61e0312b5a5a2353ad004469" read -r -d '' data <<- EOM { "namespace": "Test", - "name": "Person46" + "name": "Person3" } EOM diff --git a/spec/code_samples/cURL/setup@plain_webhook/get.sh b/spec/code_samples/cURL/setup@plain_webhook/get.sh new file mode 100644 index 0000000..60fae52 --- /dev/null +++ b/spec/code_samples/cURL/setup@plain_webhook/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/plain_webhook" + +curl -G "${base_url}/${path}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d limit=5 \ + -d page=1 \ + -d order=-namespace,name \ + -d embedding=authorization \ diff --git a/spec/code_samples/cURL/setup@plain_webhook/post.sh b/spec/code_samples/cURL/setup@plain_webhook/post.sh new file mode 100644 index 0000000..e56ca5f --- /dev/null +++ b/spec/code_samples/cURL/setup@plain_webhook/post.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/plain_webhook" + +read -r -d '' data <<- EOM + { + namespace: "Test", + name: "webhook_test_01", + method: "get", + path: "api/v2/test_01", + parameters: [ + { + key: "limit", + value: "50", + } + ], + } +EOM + +curl "${base_url}/${path}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@plain_webhook@{id}/delete.sh b/spec/code_samples/cURL/setup@plain_webhook@{id}/delete.sh new file mode 100644 index 0000000..92c2090 --- /dev/null +++ b/spec/code_samples/cURL/setup@plain_webhook@{id}/delete.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/plain_webhook" +item_id="6205b5995a5a233dd9039b8a" + +curl "${base_url}/${path}/${item_id}" \ + -X "DELETE" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" diff --git a/spec/code_samples/cURL/setup@plain_webhook@{id}/get.sh b/spec/code_samples/cURL/setup@plain_webhook@{id}/get.sh new file mode 100644 index 0000000..1b029d5 --- /dev/null +++ b/spec/code_samples/cURL/setup@plain_webhook@{id}/get.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/plain_webhook" +item_id="6205b5995a5a233dd9039b8a" + +curl -G "${base_url}/${path}/${item_id}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}"\ + -d embedding=authorization \ + -d ignore=password diff --git a/spec/code_samples/cURL/setup@plain_webhook@{id}/post.sh b/spec/code_samples/cURL/setup@plain_webhook@{id}/post.sh new file mode 100644 index 0000000..afc22b0 --- /dev/null +++ b/spec/code_samples/cURL/setup@plain_webhook@{id}/post.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/plain_webhook" +item_id="6205b5995a5a233dd9039b8a" +param_id="6205b5995a5a233dd9039b8b" + +read -r -d '' data <<- EOM + { + parameters: [ + { + id: `${param_id}`, + key: "limit", + value: "100", + } + ], + } +EOM + +curl "${base_url}/${path}/${item_id}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@ruby_converter/get.sh b/spec/code_samples/cURL/setup@ruby_converter/get.sh new file mode 100644 index 0000000..790fd8a --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_converter/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_converter" + +curl -G "${base_url}/${path}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d limit=5 \ + -d page=1 \ + -d order=-namespace,name \ + -d embedding=snippet \ No newline at end of file diff --git a/spec/code_samples/cURL/setup@ruby_converter/post.sh b/spec/code_samples/cURL/setup@ruby_converter/post.sh new file mode 100644 index 0000000..60d8069 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_converter/post.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_converter" + +read -r -d '' data <<- EOM + { + namespace: "Test", + name: "converter_test_01", + source_handler: false, + source_data_type: { + _reference: true, + namespace: "Test", + name: "Person" + }, + target_data_type: { + _reference: true, + namespace: "Test", + name: "Person2" + }, + code: 'target.name = source.name.downcase', + } +EOM + +curl "${base_url}/${path}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@ruby_converter@{id}/delete.sh b/spec/code_samples/cURL/setup@ruby_converter@{id}/delete.sh new file mode 100644 index 0000000..6f41a2c --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_converter@{id}/delete.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_converter" +item_id="6203c5dd5a5a233de3027b96" + +curl "${base_url}/${path}/${item_id}" \ + -X "DELETE" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" diff --git a/spec/code_samples/cURL/setup@ruby_converter@{id}/get.sh b/spec/code_samples/cURL/setup@ruby_converter@{id}/get.sh new file mode 100644 index 0000000..e069115 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_converter@{id}/get.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_converter" +item_id="6203c5dd5a5a233de3027b96" + +curl -G "${base_url}/${path}/${item_id}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}"\ + -d embedding=authorization \ + -d ignore=password diff --git a/spec/code_samples/cURL/setup@ruby_converter@{id}/post.sh b/spec/code_samples/cURL/setup@ruby_converter@{id}/post.sh new file mode 100644 index 0000000..f7985e2 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_converter@{id}/post.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_converter" +item_id="6203c5dd5a5a233de3027b96" + +read -r -d '' data <<- EOM + { + source_handler: true, + code: 'sources.each {|s| target_data_type.create_from_json!(name: s.name.downcase, primary_field: %i[name]) }', + } +EOM + +curl "${base_url}/${path}/${item_id}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@ruby_parser/get.sh b/spec/code_samples/cURL/setup@ruby_parser/get.sh new file mode 100644 index 0000000..0a0ef89 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_parser/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_parser" + +curl -G "${base_url}/${path}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d limit=5 \ + -d page=1 \ + -d order=-namespace,name \ + -d embedding=snippet \ No newline at end of file diff --git a/spec/code_samples/cURL/setup@ruby_parser/post.sh b/spec/code_samples/cURL/setup@ruby_parser/post.sh new file mode 100644 index 0000000..aee8ffb --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_parser/post.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_parser" + +read -r -d '' data <<- EOM + { + namespace: "Test", + name: "parser_test_01", + target_data_type: { + _reference: true, + namespace: "Test", + name: "Person" + }, + code: '{ name: data[:name].downcase }', + } +EOM + +curl "${base_url}/${path}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@ruby_parser@{id}/delete.sh b/spec/code_samples/cURL/setup@ruby_parser@{id}/delete.sh new file mode 100644 index 0000000..3b327d8 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_parser@{id}/delete.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_parser" +item_id="61eeeb7f5a5a234adc00ab2b" + +curl "${base_url}/${path}/${item_id}" \ + -X "DELETE" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" diff --git a/spec/code_samples/cURL/setup@ruby_parser@{id}/get.sh b/spec/code_samples/cURL/setup@ruby_parser@{id}/get.sh new file mode 100644 index 0000000..1f27018 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_parser@{id}/get.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_parser" +item_id="61eeeb7f5a5a234adc00ab2b" + +curl -G "${base_url}/${path}/${item_id}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}"\ + -d embedding=authorization \ + -d ignore=password diff --git a/spec/code_samples/cURL/setup@ruby_parser@{id}/post.sh b/spec/code_samples/cURL/setup@ruby_parser@{id}/post.sh new file mode 100644 index 0000000..da82ad6 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_parser@{id}/post.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_parser" +item_id="61eeeb7f5a5a234adc00ab2b" + +read -r -d '' data <<- EOM + { + code: '{ name: data[:name].upcase }', + } +EOM + +curl "${base_url}/${path}/${item_id}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@ruby_template/get.sh b/spec/code_samples/cURL/setup@ruby_template/get.sh new file mode 100644 index 0000000..7dfc2a4 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_template/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_template" + +curl -G "${base_url}/${path}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -d limit=5 \ + -d page=1 \ + -d order=-namespace,name \ + -d embedding=snippet \ No newline at end of file diff --git a/spec/code_samples/cURL/setup@ruby_template/post.sh b/spec/code_samples/cURL/setup@ruby_template/post.sh new file mode 100644 index 0000000..cca14ae --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_template/post.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_template" + +read -r -d '' data <<- EOM + { + namespace: "Test", + name: "template_test_01", + mime_type: 'application/json', + file_extension: 'json', + bulk_source: false, + source_data_type: { + _reference: true, + namespace: "Test", + name: "Person" + }, + code: 'source.to_json', + } +EOM + +curl "${base_url}/${path}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/code_samples/cURL/setup@ruby_template@{id}/delete.sh b/spec/code_samples/cURL/setup@ruby_template@{id}/delete.sh new file mode 100644 index 0000000..9a8ee81 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_template@{id}/delete.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_template" +item_id="61f1597a5a5a2353be026f14" + +curl "${base_url}/${path}/${item_id}" \ + -X "DELETE" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" diff --git a/spec/code_samples/cURL/setup@ruby_template@{id}/get.sh b/spec/code_samples/cURL/setup@ruby_template@{id}/get.sh new file mode 100644 index 0000000..049653c --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_template@{id}/get.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_template" +item_id="61f1597a5a5a2353be026f14" + +curl -G "${base_url}/${path}/${item_id}" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}"\ + -d embedding=authorization \ + -d ignore=password diff --git a/spec/code_samples/cURL/setup@ruby_template@{id}/post.sh b/spec/code_samples/cURL/setup@ruby_template@{id}/post.sh new file mode 100644 index 0000000..b3665f7 --- /dev/null +++ b/spec/code_samples/cURL/setup@ruby_template@{id}/post.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +base_url=${BASE_URL:="https://cenit.io/api/v2"} +path="setup/ruby_template" +item_id="61f1597a5a5a2353be026f14" + +read -r -d '' data <<- EOM + { + mime_type: 'application/json', + file_extension: 'json', + bulk_source: true, + code: 'sources.to_json', + } +EOM + +curl "${base_url}/${path}/${item_id}" \ + -X "POST" \ + -H "X-Tenant-Access-Key: ${X_TENANT_ACCESS_KEY}" \ + -H "X-Tenant-Access-Token: ${X_TENANT_ACCESS_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "${data}" diff --git a/spec/components/schemas/json_data_type.yaml b/spec/components/schemas/json_data_type.yaml index 27b07a8..f78f9ee 100644 --- a/spec/components/schemas/json_data_type.yaml +++ b/spec/components/schemas/json_data_type.yaml @@ -20,6 +20,7 @@ properties: discard_additional_properties: type: boolean default: true + description: True forces the discard of all those properties that were not declared in the schema, when a record import occurs navigation_link: type: boolean default: false diff --git a/spec/openapi.yaml b/spec/openapi.yaml index e713d3d..c8ee505 100644 --- a/spec/openapi.yaml +++ b/spec/openapi.yaml @@ -44,75 +44,155 @@ info: * You can use your favorite HTTP/REST library for your programming language to use CenitIO APIv2. - - [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/eb5947e10923dee87507) + tags: - - name: Document Types + - name: Json Data Types description: | - ... + Document types are the objects that are manipulated in JSON format. Each + method is shown below. See also [Document Types](https://docs.cenit.io/docs/data/document_types) in Cenit IO Docs. - name: File Types description: | - ... + File types are information that can not be represented in JSON format, + such as images, PDF files and so on. Similar than document types, you can + create, update, delete and list file types. Each method is shown below. + You can see more details about [File Types](https://docs.cenit.io/docs/data/file_types) in Cenit IO Docs. - name: Collections description: | - ... + A collection is a way to organize a group of elements of an integration + that you want to save in your tenant, and later, export, import or share + to another tenant. You can manage collections by means of the methods + described below. + You can see more details about [Collections](https://docs.cenit.io/docs/integrations/collections) in Cenit IO Docs. - name: Shared Collections description: | - ... + Sharing collections is a way to publish that collection to all tenants. + You can manage shared collections by means of the methods described below. + You can see more details about [Shared Collections](https://docs.cenit.io/docs/integrations/shared_collections) in Cenit IO Docs. - name: Algorithms description: | - ... + Algorithms are pieces of code in Ruby language which can be used for + general purposes, such as translators, actions to do after callbacks, and + so on. Algorithms are defined with a name, a description, some optional + parameters and the code itself. They returns a value, store records of + data in Cenit or sends data to an API. Algorithms are executed by means of + tasks or application actions which can in turn invoke other algorithms. + The most commonly tasks are flows to import and export data. + You will learn more about [Algorithms](https://docs.cenit.io/docs/compute/algorithms) in Cenit IO Docs. - name: Applications description: | - ... + An application provides a way for accessing Cenit IO from outside by + defining a set of actions. Each action in the application associates an + URL, usually like https://server.cenit.io/app/{app_path}/{action_path}, to + a Cenit algorithm which will be executed when a petition to that URL is done. + You will learn more about [Applications](https://docs.cenit.io/docs/compute/applications) in Cenit IO Docs. - name: Snippets description: | - ... + Cenit uses the "Snippet" concept to refer pieces of code of algorithms, + translators and data types definition. When you create a data type or any + kind of algorithm, Cenit let you know a snippet will be implicitly created + to store the data type schema or the algorithm code. + You will learn more about [Snippets](https://docs.cenit.io/docs/compute/snippets) in Cenit IO Docs. - name: Templates description: | - ... + A Template is an algorithm translator that formats data type records + stored in Cenit to data which be sent outside Cenit. It deals with only + one data type, the type of the data to be formatted and sent, which is + referred in the template as source data type. + You will learn more about [Templates](https://docs.cenit.io/docs/transformations/templates) in Cenit IO Docs. - name: Parsers description: | - ... + Parsers are translators that create data type records in Cenit from + outside data. It deals with only one data type, the type of the data to be + created, which is referred in the parser as target data type. + See details about [Parsers](https://docs.cenit.io/docs/transformations/parsers) in Cenit IO Docs. - name: Converters description: | - ... + Converters are algorithms that map records of a data type A stored in + Cenit to data of a data type B, to be stored in Cenit as well. So, this + type of algorithm deals with two data types, the type A, which is referred + in the converter as source data type, and the data type B, also known as + target data type. + See details about [Converters](https://docs.cenit.io/docs/transformations/converters) in Cenit IO Docs. - name: Updaters description: | - ... + Updaters are algorithms that update records stored in Cenit according to + the needs of flows. This type of algorithm deals with only one data type, + the type of the data to be updated, which is referred in the updater as target data type. + See details about [Updaters](https://docs.cenit.io/docs/transformations/updaters) in Cenit IO Docs. - name: System Notifications description: | - ... + System notifications provide information about the execution of flows, + tasks or algorithms. They don't only notify whether the execution was + successful or not, but also contain detailed information of HTTP requests and responses. + You will learn more about [System Notifications](https://docs.cenit.io/docs/monitors/system_notifications) in Cenit IO Docs. - name: Tasks description: | - ... + Cenit uses the "Task" concept to refer particular processes which take + place inside a tenant, for example the execution of an algorithm or a + flow, the deletion of one or more records, the transformation of data, etc. + You will learn more about [Tasks](https://docs.cenit.io/docs/monitors/tasks) in Cenit IO Docs. - name: Flows description: | - ... + Flows define how data is routed between endpoints in order to automate + your operations. An Import Flow gets data from an API A and stores it in + Cenit in a proper data type for this object in A, by using a parser + translator. A Converter Flow converts the data stored in Cenit from A, to + a proper data type for an API B, storing the new data also in Cenit by + using a converter translator. Export Flows send data stored in Cenit to an + external API, by using a template translator. + To know how [Flows](https://docs.cenit.io/docs/workflows/flows) work go to Cenit IO Docs. - name: Observers description: | - ... + Observers are conditions to be monitored, related to changes that may occur in the records + of a dataset of a certain type of document. These changes are called data events. + Data events can be managed around the attributes of the data type. For example, an action + can be triggered when new records were added or when the value of certain attribute of a record + changes. Data events are associated with flows in order to make sense. + You will learn more about [Data Events](https://docs.cenit.io/docs/workflows/data_events) in Cenit IO Docs. - name: Schedulers description: | - ... + Scheduler is the type of event related to date and time to be triggered in + order to execute a flow. A Scheduler handles time intervals which can be + useful if we want to repeat it periodically. + You will learn more about [Schedulers](https://docs.cenit.io/docs/workflows/schedulers) in Cenit IO Docs. - name: Connections description: | - ... + A connection in Cenit is the base URL of an API. You should define + resource paths for every method used; but a connection serves to all + methods. In that way we separate in Cenit the base URL and the methods. + You will learn more about [Connections](https://docs.cenit.io/docs/gateway/connection) in Cenit IO Docs. - name: Connection Roles description: | - ... - - name: Resouces - description: | - ... + It is used to relate the connection with the webhook (resource/operation) in order to make up the whole URL. + In Cenit you can use more than one connection in the same namespace or even use a connection from another namespace. + Those cases force you to use a connection role, that allows to associate a connection with the resources/operation to + combine them for obtaining the URL. This field is optional, but you should consider using it as a way to clarify + what connection and webhook are used to make up the URL. + Connection roles are used in flows in these ways: + * When no connection role is set and the Namespace contains only one Connection, that connection is used. + * When no connection role is set and the Namespace contains more than one Connection, the first connection defined in the namespace is used. + * When the connection role is set, the connection and webhook defined in the connection role are used. + - name: Resources + description: | + The base URL of an API should be defined as a Connection, only once, and + you should define a Resource Path for every method used; that way we + separate in Cenit the base URL and the methods. Both, a Connection and a + Resource Path, make up the endpoint, the whole URL where the request is + sent. They allow to define an HTTP Method and its parameters. + You will learn more about webhooks in section [Resource Paths](https://docs.cenit.io/docs/gateway/resource_paths) of Cenit IO Docs. - name: Authorizations Clients description: | - ... + By defining an authorization client you can set the values of Client ID and Secret ID provided from the API + with which you are going to connect to. + You will learn more about [Authorization Clients](https://docs.cenit.io/docs/security/authorization_clients) in Cenit IO Docs. - name: Authorizations Providers description: | - ... + By defining an authorization provider you can set the response type which is code, the authorization endpoint, the token endpoint, + method the token is sent, the scope separator which is usually a comma (,) and the refresh token strategy. + You will learn more about [Authorization Providers](https://docs.cenit.io/docs/security/authorization_providers) in Cenit IO Docs. - name: Authorizations Basic description: | - ... + You can manage basic authorizations by means of the methods below. servers: - url: 'https://cenit.io/api/v2' - url: 'https://server.cenit.io/api/v2' @@ -122,7 +202,7 @@ security: x-tagGroups: - name: Data tags: - - Document Types + - Json Data Types - File Types - name: Integrations tags: diff --git a/spec/paths/setup@algorithm@{id}.yaml b/spec/paths/setup@algorithm@{id}.yaml index 0e3b17b..606a1b7 100644 --- a/spec/paths/setup@algorithm@{id}.yaml +++ b/spec/paths/setup@algorithm@{id}.yaml @@ -5,7 +5,7 @@ get: tags: - Algorithms operationId: get_algorithm - summary: Retrieve a algorithm + summary: Retrieve an algorithm description: | Find and return the item with the given id. parameters: