mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-24 06:49:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1149a4d52 | ||
|
|
4c6f4bfd84 | ||
|
|
9caf3dc67f | ||
|
|
635c4da48c | ||
|
|
44bb205483 | ||
|
|
edb4622684 | ||
|
|
abb46d78da | ||
|
|
04fdc0368a | ||
|
|
50d76622c5 | ||
|
|
238f56cb76 | ||
|
|
e721d6f5f5 | ||
|
|
44df13e820 | ||
|
|
1fd0f79dd5 | ||
|
|
1b92371737 | ||
|
|
bf5b3484a1 | ||
|
|
eb1e248d4b | ||
|
|
0827414051 | ||
|
|
081986607b | ||
|
|
189080199a | ||
|
|
55281e3965 | ||
|
|
db8a6175e8 | ||
|
|
7b0d4dd5bc | ||
|
|
6fd277ef3a | ||
|
|
7b25bfdb69 | ||
|
|
2abc19c589 | ||
|
|
faf6b1df75 | ||
|
|
422be4a422 | ||
|
|
da136e0ef0 | ||
|
|
737cc9b8ea | ||
|
|
23f6b179fd | ||
|
|
03e451c21d | ||
|
|
be061a0fb9 | ||
|
|
c83f6a68d1 | ||
|
|
2646e3e4f6 | ||
|
|
06424d6bcf | ||
|
|
45b82515fc | ||
|
|
a9cc951e34 | ||
|
|
93ccf506fb | ||
|
|
706d0ccfa0 | ||
|
|
c2eec4e95c | ||
|
|
ac3132b6eb | ||
|
|
a2c1f2da6f |
+335
-13
@@ -241,7 +241,16 @@
|
|||||||
},
|
},
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "ConnectionController_getConnectionDetails",
|
"operationId": "ConnectionController_getConnectionDetails",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "",
|
"description": "",
|
||||||
@@ -449,7 +458,16 @@
|
|||||||
"/inputs/{id}": {
|
"/inputs/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "InputsController_findOne",
|
"operationId": "InputsController_findOne",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "",
|
"description": "",
|
||||||
@@ -534,6 +552,46 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "search",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "filters",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "size",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "page",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "type",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -606,6 +664,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -638,6 +704,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -670,6 +744,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -709,6 +791,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -746,6 +836,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -783,6 +881,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -945,6 +1051,14 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "shared",
|
"name": "shared",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -985,6 +1099,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"requestBody": {
|
"requestBody": {
|
||||||
@@ -1085,6 +1207,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -1127,6 +1257,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -1169,6 +1307,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -1362,6 +1508,108 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/catalog/dataset-catalog-task": {
|
||||||
|
"post": {
|
||||||
|
"operationId": "CatalogController_triggerCatalog",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dadosfera-lang",
|
||||||
|
"in": "header",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"enum": [
|
||||||
|
"pt-br",
|
||||||
|
"en-us"
|
||||||
|
],
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/TriggerCatalogReq"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/TriggerCatalogRes"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Catalog"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/catalog/dataset-catalog-task/{session}": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "CatalogController_getCatalogTask",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dadosfera-lang",
|
||||||
|
"in": "header",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"enum": [
|
||||||
|
"pt-br",
|
||||||
|
"en-us"
|
||||||
|
],
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "session",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/GetDatasetCatalogTaskRes"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Catalog"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/oauth/hubspot": {
|
"/oauth/hubspot": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "OauthController_oauthHubspot",
|
"operationId": "OauthController_oauthHubspot",
|
||||||
@@ -1504,24 +1752,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
"title": "Maestro - feat/docs-refactor",
|
"title": "Maestro - feature/customer-links",
|
||||||
"description": "This is the Maestro API",
|
"description": "This is the Maestro API",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"contact": {}
|
"contact": {}
|
||||||
},
|
},
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
|
||||||
"url": "https://maestro.stg.dadosfera.ai",
|
|
||||||
"description": "Ambiente STG"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://maestro-2.stg.dadosfera.ai",
|
|
||||||
"description": "Ambiente STG2"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"url": "https://maestro.dadosfera.ai",
|
"url": "https://maestro.dadosfera.ai",
|
||||||
"description": "Ambiente PRD"
|
"description": "Dadosfera API"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"components": {
|
"components": {
|
||||||
@@ -1572,6 +1812,12 @@
|
|||||||
},
|
},
|
||||||
"scheduleLimit": {
|
"scheduleLimit": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -1579,7 +1825,8 @@
|
|||||||
"id",
|
"id",
|
||||||
"name",
|
"name",
|
||||||
"tier",
|
"tier",
|
||||||
"scheduleLimit"
|
"scheduleLimit",
|
||||||
|
"links"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"AuthUser": {
|
"AuthUser": {
|
||||||
@@ -2173,6 +2420,9 @@
|
|||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"connection_id": {
|
"connection_id": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -2213,6 +2463,7 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"name",
|
"name",
|
||||||
"description",
|
"description",
|
||||||
|
"type",
|
||||||
"connection_id",
|
"connection_id",
|
||||||
"cron",
|
"cron",
|
||||||
"connector_name",
|
"connector_name",
|
||||||
@@ -2233,6 +2484,9 @@
|
|||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"connection_id": {
|
"connection_id": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -2280,6 +2534,7 @@
|
|||||||
"id",
|
"id",
|
||||||
"name",
|
"name",
|
||||||
"description",
|
"description",
|
||||||
|
"type",
|
||||||
"connection_id",
|
"connection_id",
|
||||||
"cron",
|
"cron",
|
||||||
"connector_name",
|
"connector_name",
|
||||||
@@ -2802,6 +3057,73 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"comment"
|
"comment"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"TriggerCatalogReq": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"table_name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the table on Snowflake",
|
||||||
|
"example": "TB__4DXSD4_TEST"
|
||||||
|
},
|
||||||
|
"table_schema": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Schema where the asset is located. If not set defaults to \"PUBLIC\""
|
||||||
|
},
|
||||||
|
"pipeline_id": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Id of the pipeline that generated the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"table_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"TriggerCatalogRes": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"session": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"session"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"GetDatasetCatalogTaskRes": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"created_at": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"customer_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"session_id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"table_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"updated_at": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"updated_by": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"created_at",
|
||||||
|
"customer_name",
|
||||||
|
"session_id",
|
||||||
|
"status",
|
||||||
|
"table_name",
|
||||||
|
"updated_at",
|
||||||
|
"updated_by"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+488
-22
@@ -690,7 +690,16 @@
|
|||||||
},
|
},
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "ConnectionController_getConnectionDetails",
|
"operationId": "ConnectionController_getConnectionDetails",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "",
|
"description": "",
|
||||||
@@ -2574,7 +2583,16 @@
|
|||||||
"/inputs/{id}": {
|
"/inputs/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "InputsController_findOne",
|
"operationId": "InputsController_findOne",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "",
|
"description": "",
|
||||||
@@ -2707,6 +2725,46 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "search",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "filters",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "size",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "page",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "type",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2779,6 +2837,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2811,6 +2877,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2843,6 +2917,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2882,6 +2964,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2919,6 +3009,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2959,6 +3057,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -2996,6 +3102,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -3177,6 +3291,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -3207,7 +3329,16 @@
|
|||||||
"summary": "",
|
"summary": "",
|
||||||
"deprecated": true,
|
"deprecated": true,
|
||||||
"description": "This method is deprecated. Please use route /pipelinesV2/start/:id instead",
|
"description": "This method is deprecated. Please use route /pipelinesV2/start/:id instead",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"201": {
|
"201": {
|
||||||
"description": "",
|
"description": "",
|
||||||
@@ -3239,7 +3370,16 @@
|
|||||||
"summary": "",
|
"summary": "",
|
||||||
"deprecated": true,
|
"deprecated": true,
|
||||||
"description": "This method is deprecated. Please use route /pipelinesV2/:id/status instead",
|
"description": "This method is deprecated. Please use route /pipelinesV2/:id/status instead",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "",
|
"description": "",
|
||||||
@@ -3310,7 +3450,16 @@
|
|||||||
"/transformations/{id}": {
|
"/transformations/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "TransformationsController_findOne",
|
"operationId": "TransformationsController_findOne",
|
||||||
"parameters": [],
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "",
|
"description": "",
|
||||||
@@ -3618,6 +3767,14 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "shared",
|
"name": "shared",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -3658,6 +3815,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"requestBody": {
|
"requestBody": {
|
||||||
@@ -3758,6 +3923,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -3793,6 +3966,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -3835,6 +4016,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -3877,6 +4066,14 @@
|
|||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@@ -4150,6 +4347,108 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/catalog/dataset-catalog-task": {
|
||||||
|
"post": {
|
||||||
|
"operationId": "CatalogController_triggerCatalog",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dadosfera-lang",
|
||||||
|
"in": "header",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"enum": [
|
||||||
|
"pt-br",
|
||||||
|
"en-us"
|
||||||
|
],
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/TriggerCatalogReq"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/TriggerCatalogRes"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Catalog"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/catalog/dataset-catalog-task/{session}": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "CatalogController_getCatalogTask",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dadosfera-lang",
|
||||||
|
"in": "header",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"enum": [
|
||||||
|
"pt-br",
|
||||||
|
"en-us"
|
||||||
|
],
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "session",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/GetDatasetCatalogTaskRes"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Catalog"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/terms-of-use/token": {
|
"/terms-of-use/token": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "TermsOfUseController_getToken",
|
"operationId": "TermsOfUseController_getToken",
|
||||||
@@ -4660,6 +4959,72 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/customers/{id}/links": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "CustomersController_getCustomerLinks",
|
||||||
|
"parameters": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CustomerLinksResponse"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Customers"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"put": {
|
||||||
|
"operationId": "CustomersController_setCustomerLinks",
|
||||||
|
"parameters": [],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CustomerDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Customers"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/health": {
|
"/health": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "HealthController_check",
|
"operationId": "HealthController_check",
|
||||||
@@ -4676,26 +5041,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
"title": "Maestro - feat/docs-refactor",
|
"title": "Maestro - feature/customer-links",
|
||||||
"description": "This is the Maestro API",
|
"description": "This is the Maestro API",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"contact": {}
|
"contact": {}
|
||||||
},
|
},
|
||||||
"tags": [],
|
"tags": [],
|
||||||
"servers": [
|
"servers": [],
|
||||||
{
|
|
||||||
"url": "https://maestro.stg.dadosfera.ai",
|
|
||||||
"description": "Ambiente STG"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://maestro-2.stg.dadosfera.ai",
|
|
||||||
"description": "Ambiente STG2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://maestro.dadosfera.ai",
|
|
||||||
"description": "Ambiente PRD"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"components": {
|
"components": {
|
||||||
"securitySchemes": {
|
"securitySchemes": {
|
||||||
"access-token": {
|
"access-token": {
|
||||||
@@ -4744,6 +5096,12 @@
|
|||||||
},
|
},
|
||||||
"scheduleLimit": {
|
"scheduleLimit": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"links": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -4751,7 +5109,8 @@
|
|||||||
"id",
|
"id",
|
||||||
"name",
|
"name",
|
||||||
"tier",
|
"tier",
|
||||||
"scheduleLimit"
|
"scheduleLimit",
|
||||||
|
"links"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"AuthUser": {
|
"AuthUser": {
|
||||||
@@ -6346,6 +6705,9 @@
|
|||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"connection_id": {
|
"connection_id": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -6386,6 +6748,7 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"name",
|
"name",
|
||||||
"description",
|
"description",
|
||||||
|
"type",
|
||||||
"connection_id",
|
"connection_id",
|
||||||
"cron",
|
"cron",
|
||||||
"connector_name",
|
"connector_name",
|
||||||
@@ -6406,6 +6769,9 @@
|
|||||||
"description": {
|
"description": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"connection_id": {
|
"connection_id": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -6453,6 +6819,7 @@
|
|||||||
"id",
|
"id",
|
||||||
"name",
|
"name",
|
||||||
"description",
|
"description",
|
||||||
|
"type",
|
||||||
"connection_id",
|
"connection_id",
|
||||||
"cron",
|
"cron",
|
||||||
"connector_name",
|
"connector_name",
|
||||||
@@ -6520,6 +6887,9 @@
|
|||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"engine": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -6528,7 +6898,8 @@
|
|||||||
"description",
|
"description",
|
||||||
"encoding",
|
"encoding",
|
||||||
"sep",
|
"sep",
|
||||||
"header"
|
"header",
|
||||||
|
"engine"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"IRole": {
|
"IRole": {
|
||||||
@@ -7044,6 +7415,73 @@
|
|||||||
"comment"
|
"comment"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"TriggerCatalogReq": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"table_name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the table on Snowflake",
|
||||||
|
"example": "TB__4DXSD4_TEST"
|
||||||
|
},
|
||||||
|
"table_schema": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Schema where the asset is located. If not set defaults to \"PUBLIC\""
|
||||||
|
},
|
||||||
|
"pipeline_id": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Id of the pipeline that generated the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"table_name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"TriggerCatalogRes": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"session": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"session"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"GetDatasetCatalogTaskRes": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"created_at": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"customer_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"session_id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"table_name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"updated_at": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"updated_by": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"created_at",
|
||||||
|
"customer_name",
|
||||||
|
"session_id",
|
||||||
|
"status",
|
||||||
|
"table_name",
|
||||||
|
"updated_at",
|
||||||
|
"updated_by"
|
||||||
|
]
|
||||||
|
},
|
||||||
"ConnectionTestPingReq": {
|
"ConnectionTestPingReq": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -7337,6 +7775,34 @@
|
|||||||
"content",
|
"content",
|
||||||
"tags"
|
"tags"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"CustomerLinksResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"links": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"links"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"CustomerDto": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"links": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"links"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+32
-23
@@ -12,7 +12,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-secrets-manager": "^3.112.0",
|
"@aws-sdk/client-secrets-manager": "^3.112.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack-v2": "3.29.0",
|
"@dadosfera/protospack-v2": "3.30.0",
|
||||||
"@grpc/grpc-js": "^1.6.7",
|
"@grpc/grpc-js": "^1.6.7",
|
||||||
"@grpc/proto-loader": "^0.6.13",
|
"@grpc/proto-loader": "^0.6.13",
|
||||||
"@nestjs/common": "^8.4.7",
|
"@nestjs/common": "^8.4.7",
|
||||||
@@ -1727,9 +1727,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dadosfera/protospack-v2": {
|
"node_modules/@dadosfera/protospack-v2": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.0",
|
||||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.29.0.tgz",
|
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.30.0.tgz",
|
||||||
"integrity": "sha512-G66u9V+/+5rQb+fpJdDXydTaji2Mlr0Ro5TTYcQleITKU9DjF1WZs/jP/Qu0Y224nCb8HhePvaVl/Rr0wtLt4w==",
|
"integrity": "sha512-00wqZyZmjd6rMECga2S3Ow0dk6c5fZoWd6Th+Ajofq6q/kycTU66p/5xdf0sPf//WyXMGCXasqGSZa0h9i01vg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.6.7",
|
"@grpc/grpc-js": "^1.6.7",
|
||||||
"rxjs": "^7.5.5",
|
"rxjs": "^7.5.5",
|
||||||
@@ -4495,9 +4495,10 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/cookiejar": {
|
"node_modules/cookiejar": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"dev": true,
|
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",
|
||||||
"license": "MIT"
|
"integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/core-util-is": {
|
"node_modules/core-util-is": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
@@ -7759,9 +7760,10 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/json5": {
|
"node_modules/json5": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
|
||||||
|
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"json5": "lib/cli.js"
|
"json5": "lib/cli.js"
|
||||||
},
|
},
|
||||||
@@ -7968,9 +7970,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/luxon": {
|
"node_modules/luxon": {
|
||||||
"version": "1.28.0",
|
"version": "1.28.1",
|
||||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.28.0.tgz",
|
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.28.1.tgz",
|
||||||
"integrity": "sha512-TfTiyvZhwBYM/7QdAVDh+7dBTBA29v4ik0Ce9zda3Mnf8on1S5KJI8P2jKFZ8+5C0jhmr0KwJEO/Wdpm0VeWJQ==",
|
"integrity": "sha512-gYHAa180mKrNIUJCbwpmD0aTu9kV0dREDrwNnuyFAsO1Wt0EVYSZelPnJlbj9HplzXX/YWXHFTL45kvZ53M0pw==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
@@ -10384,9 +10386,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tsconfig-paths/node_modules/json5": {
|
"node_modules/tsconfig-paths/node_modules/json5": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
},
|
},
|
||||||
@@ -12284,9 +12287,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@dadosfera/protospack-v2": {
|
"@dadosfera/protospack-v2": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.0",
|
||||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.29.0.tgz",
|
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.30.0.tgz",
|
||||||
"integrity": "sha512-G66u9V+/+5rQb+fpJdDXydTaji2Mlr0Ro5TTYcQleITKU9DjF1WZs/jP/Qu0Y224nCb8HhePvaVl/Rr0wtLt4w==",
|
"integrity": "sha512-00wqZyZmjd6rMECga2S3Ow0dk6c5fZoWd6Th+Ajofq6q/kycTU66p/5xdf0sPf//WyXMGCXasqGSZa0h9i01vg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@grpc/grpc-js": "^1.6.7",
|
"@grpc/grpc-js": "^1.6.7",
|
||||||
"rxjs": "^7.5.5",
|
"rxjs": "^7.5.5",
|
||||||
@@ -14190,7 +14193,9 @@
|
|||||||
"version": "1.0.6"
|
"version": "1.0.6"
|
||||||
},
|
},
|
||||||
"cookiejar": {
|
"cookiejar": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",
|
||||||
|
"integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
@@ -16399,7 +16404,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"json5": {
|
"json5": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
|
||||||
|
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"jsonc-parser": {
|
"jsonc-parser": {
|
||||||
@@ -16548,9 +16555,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"luxon": {
|
"luxon": {
|
||||||
"version": "1.28.0",
|
"version": "1.28.1",
|
||||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.28.0.tgz",
|
"resolved": "https://registry.npmjs.org/luxon/-/luxon-1.28.1.tgz",
|
||||||
"integrity": "sha512-TfTiyvZhwBYM/7QdAVDh+7dBTBA29v4ik0Ce9zda3Mnf8on1S5KJI8P2jKFZ8+5C0jhmr0KwJEO/Wdpm0VeWJQ=="
|
"integrity": "sha512-gYHAa180mKrNIUJCbwpmD0aTu9kV0dREDrwNnuyFAsO1Wt0EVYSZelPnJlbj9HplzXX/YWXHFTL45kvZ53M0pw=="
|
||||||
},
|
},
|
||||||
"macos-release": {
|
"macos-release": {
|
||||||
"version": "2.5.0",
|
"version": "2.5.0",
|
||||||
@@ -18138,7 +18145,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"json5": {
|
"json5": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-secrets-manager": "^3.112.0",
|
"@aws-sdk/client-secrets-manager": "^3.112.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack-v2": "3.29.0",
|
"@dadosfera/protospack-v2": "3.31.0",
|
||||||
"@grpc/grpc-js": "^1.6.7",
|
"@grpc/grpc-js": "^1.6.7",
|
||||||
"@grpc/proto-loader": "^0.6.13",
|
"@grpc/proto-loader": "^0.6.13",
|
||||||
"@nestjs/common": "^8.4.7",
|
"@nestjs/common": "^8.4.7",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { ConfigModule } from '@nestjs/config';
|
|||||||
import { PipelinesV2Module } from './modules/pipelinesV2/pipelines.module';
|
import { PipelinesV2Module } from './modules/pipelinesV2/pipelines.module';
|
||||||
import { ProductboardModule } from './modules/productboard/productboard.module';
|
import { ProductboardModule } from './modules/productboard/productboard.module';
|
||||||
import { MixpanelModule } from './modules/mixpanel/mixpanel.module';
|
import { MixpanelModule } from './modules/mixpanel/mixpanel.module';
|
||||||
|
import { CustomersModule } from './modules/customers/customers.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
controllers: [],
|
controllers: [],
|
||||||
@@ -56,6 +57,7 @@ import { MixpanelModule } from './modules/mixpanel/mixpanel.module';
|
|||||||
OauthModule,
|
OauthModule,
|
||||||
ProductboardModule,
|
ProductboardModule,
|
||||||
MixpanelModule,
|
MixpanelModule,
|
||||||
|
CustomersModule,
|
||||||
//Always leave HealthModule last, so it is on the bottom of swagger
|
//Always leave HealthModule last, so it is on the bottom of swagger
|
||||||
HealthModule,
|
HealthModule,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class NoClassAuthController {
|
|||||||
@Get('has-all-permissions')
|
@Get('has-all-permissions')
|
||||||
@RequireAllPermissions(
|
@RequireAllPermissions(
|
||||||
PERMISSIONS_GROUPS.ZENDESK.permissions.OPEN,
|
PERMISSIONS_GROUPS.ZENDESK.permissions.OPEN,
|
||||||
PERMISSIONS_GROUPS.ANALYZE.permissions.METABASE,
|
PERMISSIONS_GROUPS.DATAVIZ.permissions.METABASE,
|
||||||
)
|
)
|
||||||
async hasAllPermissions(@Body() body) {
|
async hasAllPermissions(@Body() body) {
|
||||||
return { body };
|
return { body };
|
||||||
@@ -53,7 +53,7 @@ class NoClassAuthController {
|
|||||||
@Get('has-some-permission')
|
@Get('has-some-permission')
|
||||||
@RequireSomePermission(
|
@RequireSomePermission(
|
||||||
PERMISSIONS_GROUPS.ZENDESK.permissions.OPEN,
|
PERMISSIONS_GROUPS.ZENDESK.permissions.OPEN,
|
||||||
PERMISSIONS_GROUPS.ANALYZE.permissions.METABASE,
|
PERMISSIONS_GROUPS.DATAVIZ.permissions.METABASE,
|
||||||
)
|
)
|
||||||
async hasSomePermission(@Body() body) {
|
async hasSomePermission(@Body() body) {
|
||||||
return { body };
|
return { body };
|
||||||
@@ -62,7 +62,7 @@ class NoClassAuthController {
|
|||||||
|
|
||||||
@Controller('class-auth-condition')
|
@Controller('class-auth-condition')
|
||||||
@AuthenticateCondition((req) => req.get('x-on-class') === 'ok')
|
@AuthenticateCondition((req) => req.get('x-on-class') === 'ok')
|
||||||
@RequireSomePermission(PERMISSIONS_GROUPS.ANALYZE.permissions.METABASE)
|
@RequireSomePermission(PERMISSIONS_GROUPS.DATAVIZ.permissions.METABASE)
|
||||||
class ClassAuthConditionController {
|
class ClassAuthConditionController {
|
||||||
@Get('body')
|
@Get('body')
|
||||||
async getBody(@Body() body) {
|
async getBody(@Body() body) {
|
||||||
@@ -444,13 +444,13 @@ describe('authentication.guard', () => {
|
|||||||
NoClassAuthTest(tokenZ, ['zendesk']);
|
NoClassAuthTest(tokenZ, ['zendesk']);
|
||||||
ClassAuthConditionTest(tokenZ, ['zendesk']);
|
ClassAuthConditionTest(tokenZ, ['zendesk']);
|
||||||
|
|
||||||
const tokenM = CreateToken([PERMISSIONS_GROUPS.ANALYZE.permissions.METABASE]);
|
const tokenM = CreateToken([PERMISSIONS_GROUPS.DATAVIZ.permissions.METABASE]);
|
||||||
NoClassAuthTest(tokenM, ['metabase']);
|
NoClassAuthTest(tokenM, ['metabase']);
|
||||||
ClassAuthConditionTest(tokenM, ['metabase']);
|
ClassAuthConditionTest(tokenM, ['metabase']);
|
||||||
|
|
||||||
const tokenZM = CreateToken([
|
const tokenZM = CreateToken([
|
||||||
PERMISSIONS_GROUPS.ZENDESK.permissions.OPEN,
|
PERMISSIONS_GROUPS.ZENDESK.permissions.OPEN,
|
||||||
PERMISSIONS_GROUPS.ANALYZE.permissions.METABASE,
|
PERMISSIONS_GROUPS.DATAVIZ.permissions.METABASE,
|
||||||
]);
|
]);
|
||||||
NoClassAuthTest(tokenZM, ['zendesk', 'metabase']);
|
NoClassAuthTest(tokenZM, ['zendesk', 'metabase']);
|
||||||
ClassAuthConditionTest(tokenZM, ['zendesk', 'metabase']);
|
ClassAuthConditionTest(tokenZM, ['zendesk', 'metabase']);
|
||||||
|
|||||||
@@ -346,6 +346,16 @@ export const PERMISSIONS_GROUPS = {
|
|||||||
'es-es': 'Acceder al Módulo de Incorporación de Activos',
|
'es-es': 'Acceder al Módulo de Incorporación de Activos',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
TRIGGER_CATALOG_TASK: {
|
||||||
|
seqid: 45,
|
||||||
|
claim: 'catalog:trigger-task',
|
||||||
|
usage: PermissionUsages.INTERNAL,
|
||||||
|
name: {
|
||||||
|
'pt-br': 'Executar a catalogação de um ativo',
|
||||||
|
'en-us': 'Trigger an asset cataloging',
|
||||||
|
'es-es': 'Realizar el listado de un activo',
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -428,18 +438,18 @@ export const PERMISSIONS_GROUPS = {
|
|||||||
permissions: {
|
permissions: {
|
||||||
OPEN: {
|
OPEN: {
|
||||||
seqid: 16,
|
seqid: 16,
|
||||||
claim: 'GET /zendesk',
|
claim: 'support-chat:access',
|
||||||
usage: PermissionUsages.INTERNAL,
|
usage: PermissionUsages.INTERNAL,
|
||||||
name: {
|
name: {
|
||||||
'pt-br': 'Acessar Zendesk',
|
'pt-br': 'Acessar chat de suporte',
|
||||||
'en-us': 'Access Zendesk',
|
'en-us': 'Access support chat',
|
||||||
'es-es': 'Acceso Zendesk',
|
'es-es': 'Acceder al chat de soporte',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
ANALYZE: {
|
DATAVIZ: {
|
||||||
title: {
|
title: {
|
||||||
'pt-br': 'Analisar | Visualização',
|
'pt-br': 'Analisar | Visualização',
|
||||||
'en-us': 'Analyze | Visualization',
|
'en-us': 'Analyze | Visualization',
|
||||||
@@ -456,6 +466,15 @@ export const PERMISSIONS_GROUPS = {
|
|||||||
'es-es': 'Acceso Metabase',
|
'es-es': 'Acceso Metabase',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
INTELLIGENCE: {
|
||||||
|
title: {
|
||||||
|
'pt-br': 'Analisar | Inteligência',
|
||||||
|
'en-us': 'Analyze | Intelligence',
|
||||||
|
'es-es': 'Analizar | Inteligencia',
|
||||||
|
},
|
||||||
|
permissions: {
|
||||||
INTELLIGENCE: {
|
INTELLIGENCE: {
|
||||||
seqid: 31,
|
seqid: 31,
|
||||||
claim: 'intelligence:open',
|
claim: 'intelligence:open',
|
||||||
@@ -577,7 +596,8 @@ export const DADOSFERA_MODULES: Array<DadosferaModule> = [
|
|||||||
name: 'Intelligence Module',
|
name: 'Intelligence Module',
|
||||||
description: 'Orchest Module',
|
description: 'Orchest Module',
|
||||||
key: 'intelligence',
|
key: 'intelligence',
|
||||||
permissionSeqId: PERMISSIONS_GROUPS.ANALYZE.permissions.INTELLIGENCE.seqid,
|
permissionSeqId:
|
||||||
|
PERMISSIONS_GROUPS.INTELLIGENCE.permissions.INTELLIGENCE.seqid,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Proccessing Module',
|
name: 'Proccessing Module',
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ describe('user.decorator', () => {
|
|||||||
const fakeUserPayload = {
|
const fakeUserPayload = {
|
||||||
user_id: 'd50d33c7-6c2b-463c-861f-e21667e7c125',
|
user_id: 'd50d33c7-6c2b-463c-861f-e21667e7c125',
|
||||||
username: 'super.admin',
|
username: 'super.admin',
|
||||||
permissions: [PERMISSIONS_GROUPS.ANALYZE.permissions.METABASE].map(
|
permissions: [PERMISSIONS_GROUPS.DATAVIZ.permissions.METABASE].map(
|
||||||
({ seqid }) => seqid,
|
({ seqid }) => seqid,
|
||||||
),
|
),
|
||||||
customer_id: '9d18e8ae-24b9-41a3-9e8f-a25ce57555b11',
|
customer_id: '9d18e8ae-24b9-41a3-9e8f-a25ce57555b11',
|
||||||
|
|||||||
+7
-6
@@ -42,7 +42,7 @@ function configureSwagger(app: INestApplication) {
|
|||||||
}
|
}
|
||||||
const swaggerTitle = branchName ? `Maestro - ${branchName}` : 'Maestro';
|
const swaggerTitle = branchName ? `Maestro - ${branchName}` : 'Maestro';
|
||||||
|
|
||||||
const config = new DocumentBuilder()
|
const swaggerConfig = new DocumentBuilder()
|
||||||
.setTitle(swaggerTitle)
|
.setTitle(swaggerTitle)
|
||||||
.setDescription('Documentation for Maestro gateway')
|
.setDescription('Documentation for Maestro gateway')
|
||||||
.addSecurity('access-token', {
|
.addSecurity('access-token', {
|
||||||
@@ -50,11 +50,12 @@ function configureSwagger(app: INestApplication) {
|
|||||||
name: 'Authorization',
|
name: 'Authorization',
|
||||||
in: 'header',
|
in: 'header',
|
||||||
})
|
})
|
||||||
.setDescription('This is the Maestro API')
|
.setDescription('This is the Maestro API');
|
||||||
.addServer('https://maestro.stg.dadosfera.ai', 'Ambiente STG')
|
|
||||||
.addServer('https://maestro-2.stg.dadosfera.ai', 'Ambiente STG2')
|
if (process.env.INTERNAL_SWAGGER !== 'true')
|
||||||
.addServer('https://maestro.dadosfera.ai', 'Ambiente PRD')
|
swaggerConfig.addServer('https://maestro.dadosfera.ai', 'Dadosfera API');
|
||||||
.build();
|
|
||||||
|
const config = swaggerConfig.build();
|
||||||
|
|
||||||
const document = SwaggerModule.createDocument(app, config);
|
const document = SwaggerModule.createDocument(app, config);
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Link } from '@dadosfera/protospack-v2/dist/lib/Duc/interfaces/entities';
|
||||||
import {
|
import {
|
||||||
AuthSignInRequest,
|
AuthSignInRequest,
|
||||||
AuthSignInResponse,
|
AuthSignInResponse,
|
||||||
@@ -74,6 +75,8 @@ export class AuthCustomer {
|
|||||||
tier: string;
|
tier: string;
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
scheduleLimit: string;
|
scheduleLimit: string;
|
||||||
|
@ApiProperty()
|
||||||
|
links: Link[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AuthSignInReq implements AuthSignInRequest {
|
export class AuthSignInReq implements AuthSignInRequest {
|
||||||
|
|||||||
@@ -14,9 +14,15 @@ import {
|
|||||||
Query,
|
Query,
|
||||||
UseFilters,
|
UseFilters,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { ApiHeaders, ApiTags } from '@nestjs/swagger';
|
import {
|
||||||
|
ApiCreatedResponse,
|
||||||
|
ApiHeaders,
|
||||||
|
ApiOkResponse,
|
||||||
|
ApiTags,
|
||||||
|
} from '@nestjs/swagger';
|
||||||
import {
|
import {
|
||||||
Authenticated,
|
Authenticated,
|
||||||
|
RequireAllPermissions,
|
||||||
RequireSomePermission,
|
RequireSomePermission,
|
||||||
} from '../../decorators/authentication.decorator';
|
} from '../../decorators/authentication.decorator';
|
||||||
import { PERMISSIONS_GROUPS } from '../../authentication/permissions.enum';
|
import { PERMISSIONS_GROUPS } from '../../authentication/permissions.enum';
|
||||||
@@ -25,6 +31,7 @@ import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
|||||||
import { PackTheMetadata } from 'src/utils/ PackTheMetadata';
|
import { PackTheMetadata } from 'src/utils/ PackTheMetadata';
|
||||||
import { RequestUser, User } from 'src/decorators/user.decorator';
|
import { RequestUser, User } from 'src/decorators/user.decorator';
|
||||||
import {
|
import {
|
||||||
|
GetDatasetCatalogTaskRes,
|
||||||
ICatalogAllRequest,
|
ICatalogAllRequest,
|
||||||
ICatalogAllResponse,
|
ICatalogAllResponse,
|
||||||
IColumnsMetadataResponse,
|
IColumnsMetadataResponse,
|
||||||
@@ -35,6 +42,8 @@ import {
|
|||||||
IOneDataAsset,
|
IOneDataAsset,
|
||||||
IPreviewResponse,
|
IPreviewResponse,
|
||||||
IUpdateDataRequest,
|
IUpdateDataRequest,
|
||||||
|
TriggerCatalogReq,
|
||||||
|
TriggerCatalogRes,
|
||||||
} from './dtos';
|
} from './dtos';
|
||||||
import { GrpcToHttpExceptionFilter } from 'src/error/grpc-to-http-exception.filter';
|
import { GrpcToHttpExceptionFilter } from 'src/error/grpc-to-http-exception.filter';
|
||||||
import { Language } from 'src/decorators/language.decorator';
|
import { Language } from 'src/decorators/language.decorator';
|
||||||
@@ -180,7 +189,7 @@ export class CatalogController {
|
|||||||
)
|
)
|
||||||
async getDataAsset(
|
async getDataAsset(
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
@Query('shared') shared?: 'true',
|
@Query('shared') shared?: 'true',
|
||||||
) {
|
) {
|
||||||
const { username, user_id, customer_id, customer_name, permissions } = user;
|
const { username, user_id, customer_id, customer_name, permissions } = user;
|
||||||
@@ -196,7 +205,7 @@ export class CatalogController {
|
|||||||
let has_permission = false;
|
let has_permission = false;
|
||||||
const metadata = PackTheMetadata({
|
const metadata = PackTheMetadata({
|
||||||
username,
|
username,
|
||||||
user_id: undefined,
|
user_id,
|
||||||
customer_id,
|
customer_id,
|
||||||
customer_name,
|
customer_name,
|
||||||
});
|
});
|
||||||
@@ -237,7 +246,7 @@ export class CatalogController {
|
|||||||
async getDataAssetRls(
|
async getDataAssetRls(
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Headers() headers,
|
@Headers() headers,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
) {
|
) {
|
||||||
const { username, user_id, customer_id, customer_name, permissions } = user;
|
const { username, user_id, customer_id, customer_name, permissions } = user;
|
||||||
|
|
||||||
@@ -292,7 +301,7 @@ export class CatalogController {
|
|||||||
async getDataAssetColumnsMetadata(
|
async getDataAssetColumnsMetadata(
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
): Promise<IColumnsMetadataResponse> {
|
): Promise<IColumnsMetadataResponse> {
|
||||||
const { customer_name, customer_id, user_id, username } = user;
|
const { customer_name, customer_id, user_id, username } = user;
|
||||||
|
|
||||||
@@ -323,7 +332,7 @@ export class CatalogController {
|
|||||||
async getDataAssetPreview(
|
async getDataAssetPreview(
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
): Promise<IPreviewResponse> {
|
): Promise<IPreviewResponse> {
|
||||||
const { customer_name, customer_id, user_id, username } = user;
|
const { customer_name, customer_id, user_id, username } = user;
|
||||||
|
|
||||||
@@ -353,7 +362,7 @@ export class CatalogController {
|
|||||||
async getDataAssetDocs(
|
async getDataAssetDocs(
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
): Promise<IDocsResponse> {
|
): Promise<IDocsResponse> {
|
||||||
const { customer_name, customer_id, user_id, username } = user;
|
const { customer_name, customer_id, user_id, username } = user;
|
||||||
|
|
||||||
@@ -383,7 +392,7 @@ export class CatalogController {
|
|||||||
async updateDataAsset(
|
async updateDataAsset(
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@Param('id') data_asset_id,
|
@Param('id') data_asset_id: string,
|
||||||
@Body() body: IUpdateDataRequest,
|
@Body() body: IUpdateDataRequest,
|
||||||
): Promise<IOneDataAsset> {
|
): Promise<IOneDataAsset> {
|
||||||
const { customer_id, customer_name, user_id, username } = user;
|
const { customer_id, customer_name, user_id, username } = user;
|
||||||
@@ -579,4 +588,49 @@ export class CatalogController {
|
|||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Post('dataset-catalog-task')
|
||||||
|
@RequireAllPermissions(
|
||||||
|
PERMISSIONS_GROUPS.CATALOG.permissions.TRIGGER_CATALOG_TASK,
|
||||||
|
)
|
||||||
|
@ApiCreatedResponse({ type: TriggerCatalogRes })
|
||||||
|
async triggerCatalog(
|
||||||
|
@User() user: RequestUser,
|
||||||
|
@Body() body: TriggerCatalogReq,
|
||||||
|
) {
|
||||||
|
const { customer_id, customer_name, user_id, username } = user;
|
||||||
|
const metadata = PackTheMetadata({
|
||||||
|
customer_id,
|
||||||
|
customer_name,
|
||||||
|
user_id,
|
||||||
|
username,
|
||||||
|
});
|
||||||
|
const session = await this.catalogService.triggerCatalog(body, metadata);
|
||||||
|
|
||||||
|
return { session };
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get('dataset-catalog-task/:session')
|
||||||
|
@RequireAllPermissions(
|
||||||
|
PERMISSIONS_GROUPS.CATALOG.permissions.TRIGGER_CATALOG_TASK,
|
||||||
|
)
|
||||||
|
@ApiOkResponse({ type: GetDatasetCatalogTaskRes })
|
||||||
|
async getCatalogTask(
|
||||||
|
@User() user: RequestUser,
|
||||||
|
@Param('session') session: string,
|
||||||
|
) {
|
||||||
|
const { customer_id, customer_name, user_id, username } = user;
|
||||||
|
const metadata = PackTheMetadata({
|
||||||
|
customer_id,
|
||||||
|
customer_name,
|
||||||
|
user_id,
|
||||||
|
username,
|
||||||
|
});
|
||||||
|
const response = await this.catalogService.getDatasetCatalogTask(
|
||||||
|
session,
|
||||||
|
metadata,
|
||||||
|
);
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import { CatalogClientConfiguration } from './catalog-client';
|
|||||||
import { UsersService } from '../users/users.service';
|
import { UsersService } from '../users/users.service';
|
||||||
import { RolesService } from '../roles/roles.service';
|
import { RolesService } from '../roles/roles.service';
|
||||||
import { Metadata } from '@grpc/grpc-js';
|
import { Metadata } from '@grpc/grpc-js';
|
||||||
import { IUpdateDataRequest } from './dtos';
|
import { IUpdateDataRequest, TriggerCatalogReq } from './dtos';
|
||||||
|
|
||||||
class CatalogService implements OnModuleInit {
|
class CatalogService implements OnModuleInit {
|
||||||
catalogReadService: ReadService.CatalogReadServices;
|
catalogReadService: ReadService.CatalogReadServices;
|
||||||
@@ -333,6 +333,18 @@ class CatalogService implements OnModuleInit {
|
|||||||
} as typeof data_asset;
|
} as typeof data_asset;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
async triggerCatalog(data: TriggerCatalogReq, metadata: Metadata) {
|
||||||
|
const { session } = await lastValueFrom(
|
||||||
|
this.catalogWriteService.TriggerDatasetCataloging(data, metadata),
|
||||||
|
);
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
async getDatasetCatalogTask(session: string, metadata: Metadata) {
|
||||||
|
const res = await lastValueFrom(
|
||||||
|
this.catalogReadService.GetDatasetCatalogTask({ session }, metadata),
|
||||||
|
);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { CatalogService };
|
export { CatalogService };
|
||||||
|
|||||||
@@ -271,3 +271,44 @@ export class IColumnsMetadataResponse {
|
|||||||
@ApiProperty({ type: [IColumnMetadata] })
|
@ApiProperty({ type: [IColumnMetadata] })
|
||||||
columns_metadata: IColumnMetadata[];
|
columns_metadata: IColumnMetadata[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class TriggerCatalogReq {
|
||||||
|
@ApiProperty({
|
||||||
|
description: 'Name of the table on Snowflake',
|
||||||
|
example: 'TB__4DXSD4_TEST',
|
||||||
|
})
|
||||||
|
table_name: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({
|
||||||
|
description:
|
||||||
|
'Schema where the asset is located. If not set defaults to "PUBLIC"',
|
||||||
|
})
|
||||||
|
table_schema?: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional({
|
||||||
|
description: 'Id of the pipeline that generated the asset.',
|
||||||
|
})
|
||||||
|
pipeline_id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class TriggerCatalogRes {
|
||||||
|
@ApiProperty()
|
||||||
|
session: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GetDatasetCatalogTaskRes {
|
||||||
|
@ApiProperty()
|
||||||
|
created_at: string;
|
||||||
|
@ApiProperty()
|
||||||
|
customer_name: string;
|
||||||
|
@ApiProperty()
|
||||||
|
session_id: string;
|
||||||
|
@ApiProperty()
|
||||||
|
status: string;
|
||||||
|
@ApiProperty()
|
||||||
|
table_name: string;
|
||||||
|
@ApiProperty()
|
||||||
|
updated_at: string;
|
||||||
|
@ApiProperty()
|
||||||
|
updated_by: string;
|
||||||
|
}
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export class ConnectionController {
|
|||||||
async getConnectionDetails(
|
async getConnectionDetails(
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
@Query() queries,
|
@Query() queries,
|
||||||
): Promise<ConnectionDetailsRes> {
|
): Promise<ConnectionDetailsRes> {
|
||||||
this.logger.info('/connections - Get Connection Details');
|
this.logger.info('/connections - Get Connection Details');
|
||||||
|
|||||||
@@ -273,16 +273,13 @@ export class ConnectorController {
|
|||||||
@Param('plugin') plugin: string,
|
@Param('plugin') plugin: string,
|
||||||
@Query('version') version: string,
|
@Query('version') version: string,
|
||||||
) {
|
) {
|
||||||
this.logger.info('/upload - Upload Connector Route');
|
this.logger.info('DELETE /:plugin - Delete Connector Route');
|
||||||
|
|
||||||
const response: any = await this.connectorClientService.deleteConnector(
|
const response = await this.connectorClientService.deleteConnector(
|
||||||
plugin,
|
plugin,
|
||||||
version,
|
version,
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return { message: response.message, connector: response.connector };
|
||||||
message: response.message || 'ok',
|
|
||||||
connector: { ...JSON.parse(response.connector) },
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
||||||
|
import { IdResponse } from '@dadosfera/protospack-v2/dist/lib/Duc/interfaces/messages';
|
||||||
|
import {
|
||||||
|
Body,
|
||||||
|
Controller,
|
||||||
|
Get,
|
||||||
|
Inject,
|
||||||
|
Param,
|
||||||
|
Put,
|
||||||
|
UseFilters,
|
||||||
|
} from '@nestjs/common';
|
||||||
|
import { ApiTags } from '@nestjs/swagger';
|
||||||
|
import { PERMISSIONS_GROUPS } from 'src/authentication/permissions.enum';
|
||||||
|
import {
|
||||||
|
Authenticated,
|
||||||
|
RequireAllPermissions,
|
||||||
|
} from 'src/decorators/authentication.decorator';
|
||||||
|
import { ApiInternalOnlyController } from 'src/decorators/swagger.decorator';
|
||||||
|
import { GrpcToHttpExceptionFilter } from 'src/error/grpc-to-http-exception.filter';
|
||||||
|
import { CustomersService } from './customers.service';
|
||||||
|
import { CustomerDto, CustomerLinksResponse } from './dtos/customers';
|
||||||
|
|
||||||
|
@ApiInternalOnlyController()
|
||||||
|
@ApiTags('Customers')
|
||||||
|
@Controller('customers')
|
||||||
|
@Authenticated()
|
||||||
|
@UseFilters(GrpcToHttpExceptionFilter)
|
||||||
|
export class CustomersController {
|
||||||
|
logger: DadosferaLogger;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
@Inject(DadosferaLogger)
|
||||||
|
dadosferaLogger: DadosferaLogger,
|
||||||
|
private customersService: CustomersService,
|
||||||
|
) {
|
||||||
|
this.logger = dadosferaLogger.logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get(':id/links')
|
||||||
|
async getCustomerLinks(@Param('id') id): Promise<CustomerLinksResponse> {
|
||||||
|
this.logger.info('getCustomerLinks', { id });
|
||||||
|
const links = await this.customersService.getLinks(id);
|
||||||
|
return { links };
|
||||||
|
}
|
||||||
|
|
||||||
|
@Put(':id/links')
|
||||||
|
@RequireAllPermissions(PERMISSIONS_GROUPS.USERS.permissions.ADMIN)
|
||||||
|
setCustomerLinks(
|
||||||
|
@Body() body: CustomerDto,
|
||||||
|
@Param('id') id,
|
||||||
|
): Promise<IdResponse> {
|
||||||
|
const { links } = body;
|
||||||
|
this.logger.info('setCustomerLinks', { id, links });
|
||||||
|
return this.customersService.setLinks(id, links);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { Module } from '@nestjs/common';
|
||||||
|
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
|
||||||
|
import { ClientsModule } from '@nestjs/microservices';
|
||||||
|
import { DucClient } from '../duc/client.config';
|
||||||
|
import { CustomersController } from './customers.controller';
|
||||||
|
import { CustomersService } from './customers.service';
|
||||||
|
|
||||||
|
const client = new DucClient();
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
imports: [ClientsModule.register([client.providerOptions])],
|
||||||
|
controllers: [CustomersController],
|
||||||
|
providers: [CustomersService, DadosferaLogger],
|
||||||
|
exports: [CustomersService],
|
||||||
|
})
|
||||||
|
export class CustomersModule {}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import {
|
||||||
|
OnModuleInit,
|
||||||
|
Inject,
|
||||||
|
Injectable,
|
||||||
|
HttpException,
|
||||||
|
HttpStatus,
|
||||||
|
} from '@nestjs/common';
|
||||||
|
|
||||||
|
import { firstValueFrom, lastValueFrom } from 'rxjs';
|
||||||
|
import { Link } from '@dadosfera/protospack-v2/dist/lib/Duc/interfaces/entities';
|
||||||
|
import { DucClient } from '../duc/client.config';
|
||||||
|
import { ClientGrpc } from '@nestjs/microservices';
|
||||||
|
import { ProtoServices } from '@dadosfera/protospack-v2/dist/lib/Duc';
|
||||||
|
import { CustomerUpdateRequest } from '@dadosfera/protospack-v2/dist/lib/Duc/interfaces/messages';
|
||||||
|
import { CustomersProtoService } from '@dadosfera/protospack-v2/dist/lib/Duc/interfaces/write-service';
|
||||||
|
import ErrorCodes from 'src/utils/errorCodes';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class CustomersService implements OnModuleInit {
|
||||||
|
private customerService: CustomersProtoService;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
@Inject(DucClient.name) private readonly grpcClient: ClientGrpc,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
onModuleInit() {
|
||||||
|
this.customerService = this.grpcClient.getService<CustomersProtoService>(
|
||||||
|
ProtoServices.CustomersProtoService,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getLinks(customerId: string) {
|
||||||
|
try {
|
||||||
|
const result = await lastValueFrom(
|
||||||
|
this.customerService.CustomerFindOneById({ id: customerId }),
|
||||||
|
);
|
||||||
|
return result.customer?.links || [];
|
||||||
|
} catch (err) {
|
||||||
|
if (err.details === ErrorCodes.CUSTOMER.NOT_FOUND)
|
||||||
|
throw new HttpException(err.details, HttpStatus.NOT_FOUND);
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async setLinks(customerId: string, links: Link[]) {
|
||||||
|
if (!customerId || !links) {
|
||||||
|
throw new HttpException(null, HttpStatus.BAD_REQUEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return await firstValueFrom(
|
||||||
|
this.customerService.CustomerUpdate({
|
||||||
|
id: customerId,
|
||||||
|
links,
|
||||||
|
} as CustomerUpdateRequest),
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
if (err.details === ErrorCodes.CUSTOMER.NOT_FOUND)
|
||||||
|
throw new HttpException(err.details, HttpStatus.NOT_FOUND);
|
||||||
|
else throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { Link } from '@dadosfera/protospack-v2/dist/lib/Duc/interfaces/entities';
|
||||||
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
|
|
||||||
|
export class CustomerDto {
|
||||||
|
@ApiProperty()
|
||||||
|
links: Link[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CustomerLinksResponse {
|
||||||
|
@ApiProperty()
|
||||||
|
links: Link[];
|
||||||
|
}
|
||||||
@@ -123,8 +123,7 @@ export class InputsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('/:id')
|
@Get('/:id')
|
||||||
async findOne(@Body() body, @Param() params) {
|
async findOne(@Body() body, @Param('id') id: string) {
|
||||||
const { id } = params;
|
|
||||||
this.logger.info(`/input/${id} - ON FIND ONE ROUTE`, {
|
this.logger.info(`/input/${id} - ON FIND ONE ROUTE`, {
|
||||||
user: body.info.user_id,
|
user: body.info.user_id,
|
||||||
customer: body.info.customer,
|
customer: body.info.customer,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class HubspotStrategy extends PassportStrategy(Strategy) {
|
|||||||
clientSecret: oauthSecrets.hubspot.client_secret,
|
clientSecret: oauthSecrets.hubspot.client_secret,
|
||||||
callbackURL: oauthSecrets.hubspot.redirect_uri,
|
callbackURL: oauthSecrets.hubspot.redirect_uri,
|
||||||
scope:
|
scope:
|
||||||
'automation business-intelligence oauth forms integration-sync sales-email-read crm.lists.read crm.objects.contacts.read crm.schemas.contacts.read crm.objects.companies.read crm.objects.deals.read crm.schemas.companies.read crm.schemas.deals.read crm.objects.owners.read crm.objects.quotes.read crm.schemas.quotes.read crm.objects.line_items.read crm.schemas.line_items.read',
|
'tickets automation business-intelligence oauth forms integration-sync sales-email-read crm.lists.read crm.objects.contacts.read crm.schemas.contacts.read crm.objects.companies.read crm.objects.deals.read crm.schemas.companies.read crm.schemas.deals.read crm.objects.owners.read crm.objects.quotes.read crm.schemas.quotes.read crm.objects.line_items.read crm.schemas.line_items.read',
|
||||||
passReqToCallback: true,
|
passReqToCallback: true,
|
||||||
},
|
},
|
||||||
(accessToken, refreshToken, tokenInfo, profile, done) => {
|
(accessToken, refreshToken, tokenInfo, profile, done) => {
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ export class PipelinesController {
|
|||||||
description:
|
description:
|
||||||
'This method is deprecated. Please use route /pipelinesV2/start/:id instead',
|
'This method is deprecated. Please use route /pipelinesV2/start/:id instead',
|
||||||
})
|
})
|
||||||
async activate(@Param() params, @Body() body) {
|
async activate(@Param('id') id: string, @Body() body) {
|
||||||
const { id } = params;
|
|
||||||
const { info } = body;
|
const { info } = body;
|
||||||
|
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
@@ -72,8 +71,7 @@ export class PipelinesController {
|
|||||||
description:
|
description:
|
||||||
'This method is deprecated. Please use route /pipelinesV2/:id/status instead',
|
'This method is deprecated. Please use route /pipelinesV2/:id/status instead',
|
||||||
})
|
})
|
||||||
async getPipelineStatus(@Body() body, @Param() params) {
|
async getPipelineStatus(@Body() body, @Param('id') id: string) {
|
||||||
const { id } = params;
|
|
||||||
body.id = id;
|
body.id = id;
|
||||||
|
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ export class IPipelineV2 {
|
|||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
description: string;
|
description: string;
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
|
type: string;
|
||||||
|
@ApiProperty()
|
||||||
connection_id: string;
|
connection_id: string;
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
cron: string;
|
cron: string;
|
||||||
@@ -104,4 +106,20 @@ export class ICreatePipelineCSVFile {
|
|||||||
|
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
header: boolean;
|
header: boolean;
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
|
engine: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class PipelineFindAllReq {
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
search?: string | undefined;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
filters?: string | undefined;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
size?: string | undefined;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
page?: string | undefined;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
type?: string | undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import {
|
|||||||
ICreatePipelineV2Req,
|
ICreatePipelineV2Req,
|
||||||
IPipelineV2,
|
IPipelineV2,
|
||||||
IInitUploadCSVFile,
|
IInitUploadCSVFile,
|
||||||
|
PipelineFindAllReq,
|
||||||
} from './interfaces';
|
} from './interfaces';
|
||||||
import { GrpcToHttpExceptionFilter } from 'src/error/grpc-to-http-exception.filter';
|
import { GrpcToHttpExceptionFilter } from 'src/error/grpc-to-http-exception.filter';
|
||||||
import { LanguageEnum } from 'src/utils/languages.enum';
|
import { LanguageEnum } from 'src/utils/languages.enum';
|
||||||
@@ -115,7 +116,7 @@ export class PipelinesController {
|
|||||||
async findAll(
|
async findAll(
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@Query() data,
|
@Query() data: PipelineFindAllReq,
|
||||||
) {
|
) {
|
||||||
this.logger.info('PipelinesController - findAll', { user });
|
this.logger.info('PipelinesController - findAll', { user });
|
||||||
|
|
||||||
@@ -169,7 +170,7 @@ export class PipelinesController {
|
|||||||
async getPipelineproperties(
|
async getPipelineproperties(
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
) {
|
) {
|
||||||
this.logger.info('PipelinesController - getPipelineproperties', { user });
|
this.logger.info('PipelinesController - getPipelineproperties', { user });
|
||||||
const metadata = PackTheMetadata({ ...user, language: language });
|
const metadata = PackTheMetadata({ ...user, language: language });
|
||||||
@@ -180,7 +181,7 @@ export class PipelinesController {
|
|||||||
async getPipelineObjects(
|
async getPipelineObjects(
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
) {
|
) {
|
||||||
this.logger.info('PipelinesController - getPipelineObjects', { user });
|
this.logger.info('PipelinesController - getPipelineObjects', { user });
|
||||||
const metadata = PackTheMetadata({ ...user, language: language });
|
const metadata = PackTheMetadata({ ...user, language: language });
|
||||||
@@ -188,8 +189,7 @@ export class PipelinesController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get(':id/status')
|
@Get(':id/status')
|
||||||
async getPipelineStatus(@Body() body, @Param() params) {
|
async getPipelineStatus(@Body() body, @Param('id') id: string) {
|
||||||
const { id } = params;
|
|
||||||
body.id = id;
|
body.id = id;
|
||||||
|
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
@@ -209,7 +209,7 @@ export class PipelinesController {
|
|||||||
async findOne(
|
async findOne(
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
): Promise<Messages.PipelineV2FindOneResponse> {
|
): Promise<Messages.PipelineV2FindOneResponse> {
|
||||||
this.logger.info('PipelinesController - findOne', { user });
|
this.logger.info('PipelinesController - findOne', { user });
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ export class PipelinesController {
|
|||||||
async update(
|
async update(
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@Body() updatePipelineDto,
|
@Body() updatePipelineDto,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
) {
|
) {
|
||||||
this.logger.info('PipelinesController - update', { user });
|
this.logger.info('PipelinesController - update', { user });
|
||||||
@@ -289,7 +289,7 @@ export class PipelinesController {
|
|||||||
async updateDeprecated(
|
async updateDeprecated(
|
||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
@Body() updatePipelineDto,
|
@Body() updatePipelineDto,
|
||||||
@Param('id') id,
|
@Param('id') id: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
) {
|
) {
|
||||||
this.logger.info('PipelinesController - put', { user });
|
this.logger.info('PipelinesController - put', { user });
|
||||||
@@ -301,9 +301,8 @@ export class PipelinesController {
|
|||||||
@Delete(':id')
|
@Delete(':id')
|
||||||
@ApiNoContentResponse()
|
@ApiNoContentResponse()
|
||||||
@HttpCode(HttpStatus.NO_CONTENT)
|
@HttpCode(HttpStatus.NO_CONTENT)
|
||||||
async delete(@Param() params, @User() user: RequestUser) {
|
async delete(@Param('id') id: string, @User() user: RequestUser) {
|
||||||
this.logger.info('PipelinesController - delete', { user });
|
this.logger.info('PipelinesController - delete', { user });
|
||||||
const { id } = params;
|
|
||||||
const metadata = PackTheMetadata({
|
const metadata = PackTheMetadata({
|
||||||
customer_id: user.customer_id,
|
customer_id: user.customer_id,
|
||||||
customer_name: user.customer_name,
|
customer_name: user.customer_name,
|
||||||
@@ -370,30 +369,37 @@ export class PipelinesController {
|
|||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
@Body() body: ICreatePipelineCSVFile,
|
@Body() body: ICreatePipelineCSVFile,
|
||||||
) {
|
) {
|
||||||
this.logger.info('/upload - Upload Connector Route');
|
this.logger.info('/file - Upload Connector Route');
|
||||||
const metadata = PackTheMetadata({ ...user });
|
const metadata = PackTheMetadata({ ...user });
|
||||||
|
|
||||||
const { name, sep, header, encoding, description, file_name } = body;
|
const { name, sep, header, encoding, description, file_name, engine } =
|
||||||
|
body;
|
||||||
|
|
||||||
|
const file_format_params = {
|
||||||
|
...(sep && { sep }),
|
||||||
|
...(encoding && { encoding }),
|
||||||
|
...(header !== undefined ? { header } : {}),
|
||||||
|
};
|
||||||
|
|
||||||
const source_prefix = `${user.customer_name}/${file_name}`;
|
const source_prefix = `${user.customer_name}/${file_name}`;
|
||||||
|
|
||||||
const upload_pipeline = {
|
const upload_pipeline: ICreatePipelineV2Req = {
|
||||||
connection_id: process.env.UPLOAD_FILE_AGENT_CONNECTION,
|
connection_id: process.env.UPLOAD_FILE_AGENT_CONNECTION,
|
||||||
connector_name: 'Amazon S3',
|
connector_name: 'Amazon S3',
|
||||||
connector_plugin: 'aws_s3',
|
connector_plugin: 'aws_s3',
|
||||||
connector_version: '1.0.0',
|
connector_version: '1.0.0',
|
||||||
image_url: 'https://assets.dadosfera.ai/images/connectors/csv.svg',
|
image_url: `https://assets.dadosfera.ai/images/connectors/${engine}.svg`,
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
transformations_ids: [],
|
transformations_ids: [],
|
||||||
tags: [],
|
tags: [],
|
||||||
cron: '@once',
|
cron: '@once',
|
||||||
config: { cron: '@once', tables: [] },
|
type: 'upload',
|
||||||
properties: {
|
properties: {
|
||||||
engine: 'csv',
|
engine,
|
||||||
source_bucket: process.env.BUCKET_CUSTOMER_CSV_ASSETS,
|
source_bucket: process.env.BUCKET_CUSTOMER_CSV_ASSETS,
|
||||||
source_prefix,
|
source_prefix,
|
||||||
file_format_params: { sep, encoding, header: Boolean(header) },
|
file_format_params,
|
||||||
is_a_upload_csv: true,
|
|
||||||
},
|
},
|
||||||
input_id: undefined,
|
input_id: undefined,
|
||||||
};
|
};
|
||||||
@@ -408,8 +414,7 @@ export class PipelinesController {
|
|||||||
|
|
||||||
@ApiInternalOnlyEndpoint()
|
@ApiInternalOnlyEndpoint()
|
||||||
@Post('start/:id')
|
@Post('start/:id')
|
||||||
async activate(@Param() params, @Body() body) {
|
async activate(@Param('id') id: string, @Body() body) {
|
||||||
const { id } = params;
|
|
||||||
const { info } = body;
|
const { info } = body;
|
||||||
|
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import { ConnectorClientService } from '../connector/client.service';
|
|||||||
import { InputsService } from '../inputs/inputs.service';
|
import { InputsService } from '../inputs/inputs.service';
|
||||||
import { RequestUser } from 'src/decorators/user.decorator';
|
import { RequestUser } from 'src/decorators/user.decorator';
|
||||||
import { TransformationsService } from '../transformations/transformations.service';
|
import { TransformationsService } from '../transformations/transformations.service';
|
||||||
import { getObjValueFromPath } from 'src/utils/ObjValueFromPath';
|
import { getObjValueFromPath, objHasPath } from 'src/utils/ObjValueFromPath';
|
||||||
import ErrorCodes from 'src/utils/errorCodes';
|
import ErrorCodes from 'src/utils/errorCodes';
|
||||||
import ErrorBuilder from 'src/utils/ErrorBuilder';
|
import ErrorBuilder from 'src/utils/ErrorBuilder';
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ export class PipelinesService implements OnModuleInit {
|
|||||||
this.logger.info('PipelinesClientService - findOneProperties');
|
this.logger.info('PipelinesClientService - findOneProperties');
|
||||||
const { pipeline } = await this.findOne({ id }, metadata);
|
const { pipeline } = await this.findOne({ id }, metadata);
|
||||||
|
|
||||||
const pipelineProperties = JSON.parse(pipeline.properties);
|
const properties = JSON.parse(pipeline.properties);
|
||||||
|
|
||||||
const connectorId = `${pipeline.connector_plugin}-${pipeline.connector_version}`;
|
const connectorId = `${pipeline.connector_plugin}-${pipeline.connector_version}`;
|
||||||
|
|
||||||
@@ -228,24 +228,38 @@ export class PipelinesService implements OnModuleInit {
|
|||||||
connectorId,
|
connectorId,
|
||||||
metadata.get('language')[0].toString(),
|
metadata.get('language')[0].toString(),
|
||||||
);
|
);
|
||||||
const connector = JSON.parse(res.connector);
|
const connector: { [key: string]: any; config_controls: any[] } =
|
||||||
const config_controls = connector.config_controls || [];
|
JSON.parse(res.connector);
|
||||||
|
const config_controls = (connector.config_controls || []).filter(
|
||||||
|
(config_control) => {
|
||||||
|
const path: string = config_control.name;
|
||||||
|
if (!objHasPath({ object: { properties }, path })) return false;
|
||||||
|
|
||||||
for (const config_control of config_controls) {
|
let default_value = getObjValueFromPath({
|
||||||
const path: string = config_control.name;
|
object: { properties },
|
||||||
const default_value = getObjValueFromPath({
|
path,
|
||||||
object: { properties: pipelineProperties },
|
});
|
||||||
path,
|
|
||||||
});
|
if (default_value != undefined) {
|
||||||
if (default_value != undefined)
|
if (
|
||||||
config_control.default_value = default_value;
|
path === 'properties.spreadsheet_id' &&
|
||||||
}
|
typeof default_value === 'string'
|
||||||
|
)
|
||||||
|
default_value = 'https://docs.google.com/spreadsheets/d/'.concat(
|
||||||
|
default_value,
|
||||||
|
);
|
||||||
|
config_control.default_value = default_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pipeline: {
|
pipeline: {
|
||||||
...pipeline,
|
...pipeline,
|
||||||
config_controls,
|
config_controls,
|
||||||
properties: pipelineProperties,
|
properties,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ export class TransformationsController {
|
|||||||
|
|
||||||
@Get('/:id')
|
@Get('/:id')
|
||||||
@RequireSomePermission(pipelinePermissions.GET)
|
@RequireSomePermission(pipelinePermissions.GET)
|
||||||
async findOne(@Body() data, @Param() params) {
|
async findOne(@Body() data, @Param('id') id: string) {
|
||||||
const { id } = params;
|
|
||||||
this.logger.info(`/transformation/${id} - ON Find One ROUTE`, {
|
this.logger.info(`/transformation/${id} - ON Find One ROUTE`, {
|
||||||
user: data.info.user_id,
|
user: data.info.user_id,
|
||||||
customer: data.info.customer,
|
customer: data.info.customer,
|
||||||
|
|||||||
@@ -308,6 +308,20 @@ export function EnrichErrorCode(code: string) {
|
|||||||
'Tente realizar a ação novamente. Caso o erro persista, entre em contato com o suporte',
|
'Tente realizar a ação novamente. Caso o erro persista, entre em contato com o suporte',
|
||||||
code,
|
code,
|
||||||
};
|
};
|
||||||
|
case ErrorCodes.CATALOG.PREVIEW_TOO_BIG:
|
||||||
|
return {
|
||||||
|
statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||||
|
error: 'Erro ao buscar prévia',
|
||||||
|
message: 'Ocorreu um erro devido ao tamanho da prévia do ativo.',
|
||||||
|
code,
|
||||||
|
};
|
||||||
|
case ErrorCodes.CATALOG.METADATA_TOO_BIG:
|
||||||
|
return {
|
||||||
|
statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
|
||||||
|
error: 'Erro ao buscar informações',
|
||||||
|
message: 'Ocorreu um erro devido ao tamanho das informações do ativo.',
|
||||||
|
code,
|
||||||
|
};
|
||||||
case ErrorCodes.INTERNAL:
|
case ErrorCodes.INTERNAL:
|
||||||
case ErrorCodes.UNKNOWN:
|
case ErrorCodes.UNKNOWN:
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
export function getObjValueFromPath<T>(data: { object: T; path: string }): T {
|
export function getObjValueFromPath<T extends object>(data: {
|
||||||
|
object: T;
|
||||||
|
path: string;
|
||||||
|
}): any {
|
||||||
const { object, path } = data;
|
const { object, path } = data;
|
||||||
const keys = path.split('.');
|
const keys = path.split('.');
|
||||||
|
|
||||||
@@ -8,3 +11,18 @@ export function getObjValueFromPath<T>(data: { object: T; path: string }): T {
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function objHasPath<T extends object>(data: {
|
||||||
|
object: T;
|
||||||
|
path: string;
|
||||||
|
}): boolean {
|
||||||
|
const { object, path } = data;
|
||||||
|
const keys = path.split('.');
|
||||||
|
|
||||||
|
let value = JSON.parse(JSON.stringify(object));
|
||||||
|
for (const key of keys) {
|
||||||
|
if (!(key in value)) return false;
|
||||||
|
value = value[key];
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export const CUSTOMER = {
|
|||||||
INVALID_ID: 'CUSTOMER.INVALID_ID',
|
INVALID_ID: 'CUSTOMER.INVALID_ID',
|
||||||
NOT_FOUND: 'CUSTOMER.NOT_FOUND',
|
NOT_FOUND: 'CUSTOMER.NOT_FOUND',
|
||||||
ALREADY_EXISTS: 'CUSTOMER.ALREADY_EXISTS',
|
ALREADY_EXISTS: 'CUSTOMER.ALREADY_EXISTS',
|
||||||
|
BAD_REQUEST: 'CUSTOMER.BAD_REQUEST',
|
||||||
};
|
};
|
||||||
const TERMS_OF_USE = {
|
const TERMS_OF_USE = {
|
||||||
UP_TO_DATE: 'TERMS_OF_USE.UP_TO_DATE',
|
UP_TO_DATE: 'TERMS_OF_USE.UP_TO_DATE',
|
||||||
@@ -70,6 +71,8 @@ const TRANSFORMATION = {
|
|||||||
};
|
};
|
||||||
const CATALOG = {
|
const CATALOG = {
|
||||||
DATA_ASSET_NOT_FOUND: 'CATALOG.DATA_ASSET_NOT_FOUND',
|
DATA_ASSET_NOT_FOUND: 'CATALOG.DATA_ASSET_NOT_FOUND',
|
||||||
|
PREVIEW_TOO_BIG: 'CATALOG.PREVIEW_TOO_BIG',
|
||||||
|
METADATA_TOO_BIG: 'CATALOG.METADATA_TOO_BIG',
|
||||||
};
|
};
|
||||||
const ErrorCodes = {
|
const ErrorCodes = {
|
||||||
UNKNOWN: 'UNKNOWN',
|
UNKNOWN: 'UNKNOWN',
|
||||||
|
|||||||
Reference in New Issue
Block a user