mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-15 21:19:08 +00:00
Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dc032e7e7 | ||
|
|
7f5981731f | ||
|
|
66309c7bbe | ||
|
|
15048eaf8a | ||
|
|
0e169a3cbc | ||
|
|
b5d933eaf3 | ||
|
|
6fa9bf861a | ||
|
|
9a217dff57 | ||
|
|
e08734c97f | ||
|
|
cd4382c1ff | ||
|
|
54b75ce11b | ||
|
|
0e038d0b12 | ||
|
|
85234fe0dd | ||
|
|
c97a02cb17 | ||
|
|
878ec977b8 | ||
|
|
8006867bc2 | ||
|
|
784b0ef090 | ||
|
|
b736cddf07 | ||
|
|
3d6328fb0b | ||
|
|
4246c7495e | ||
|
|
3d40746ccb | ||
|
|
121e30ce45 | ||
|
|
85c8a4937d | ||
|
|
007f3911ff |
@@ -9,6 +9,7 @@ maestro:
|
|||||||
cookie_secret: "ff7bc13823edb2ae50d248e5780bddc9d4b31c36"
|
cookie_secret: "ff7bc13823edb2ae50d248e5780bddc9d4b31c36"
|
||||||
redis_database: "1"
|
redis_database: "1"
|
||||||
platform_api_url: https://xs2hkhq07k.execute-api.us-east-1.amazonaws.com
|
platform_api_url: https://xs2hkhq07k.execute-api.us-east-1.amazonaws.com
|
||||||
|
storage_explorer_api_url: "http://storage-explorer-{customer}.data-apps.svc.cluster.local/api"
|
||||||
|
|
||||||
hostname: maestro.stg.dadosfera.ai
|
hostname: maestro.stg.dadosfera.ai
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ maestro:
|
|||||||
open_customer_id: f239718a-a271-4ef9-ae7e-02a2f0f3aa6e
|
open_customer_id: f239718a-a271-4ef9-ae7e-02a2f0f3aa6e
|
||||||
open_group_id: 401573bb-334f-44b2-b30e-88d4cea31ae9
|
open_group_id: 401573bb-334f-44b2-b30e-88d4cea31ae9
|
||||||
platform_api_url: https://oz8v2zid1e.execute-api.us-east-1.amazonaws.com
|
platform_api_url: https://oz8v2zid1e.execute-api.us-east-1.amazonaws.com
|
||||||
storage_explorer_api_url: "https://storage-explorer-{customer_id}.prd.dadosfera.ai/api"
|
storage_explorer_api_url: "https://storage-explorer-{customer}.dadosfera.ai/api"
|
||||||
dedicated_proxy: ""
|
dedicated_proxy: ""
|
||||||
restricted_ip: ""
|
restricted_ip: ""
|
||||||
redis_host: "aaapzppmlyamkocqwstpo7zvopczyyiyuy6xzm2g6c5k4mq3a66be4a-0.redis.sa-saopaulo-1.oci.oraclecloud.com"
|
redis_host: "aaapzppmlyamkocqwstpo7zvopczyyiyuy6xzm2g6c5k4mq3a66be4a-0.redis.sa-saopaulo-1.oci.oraclecloud.com"
|
||||||
|
|||||||
+339
-296
@@ -715,6 +715,158 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api-key": {
|
||||||
|
"post": {
|
||||||
|
"operationId": "ApiKeyController_create",
|
||||||
|
"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/CreateApiKeyDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CreateApiKeyResponseDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/CreateApiKeyResponseDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"ApiKey"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"get": {
|
||||||
|
"operationId": "ApiKeyController_findAll",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dadosfera-lang",
|
||||||
|
"in": "header",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"enum": [
|
||||||
|
"pt-br",
|
||||||
|
"en-us"
|
||||||
|
],
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/ApiKeyBaseResponseDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/ApiKeyBaseResponseDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"ApiKey"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api-key/{id}": {
|
||||||
|
"delete": {
|
||||||
|
"operationId": "ApiKeyController_remove",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "dadosfera-lang",
|
||||||
|
"in": "header",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"enum": [
|
||||||
|
"pt-br",
|
||||||
|
"en-us"
|
||||||
|
],
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"ApiKey"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/connections": {
|
"/connections": {
|
||||||
"post": {
|
"post": {
|
||||||
"operationId": "ConnectionController_createConnection",
|
"operationId": "ConnectionController_createConnection",
|
||||||
@@ -6584,158 +6736,6 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api-key": {
|
|
||||||
"post": {
|
|
||||||
"operationId": "ApiKeyController_create",
|
|
||||||
"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/CreateApiKeyDto"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/CreateApiKeyResponseDto"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"default": {
|
|
||||||
"description": "",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/CreateApiKeyResponseDto"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
"ApiKey"
|
|
||||||
],
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"access-token": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"get": {
|
|
||||||
"operationId": "ApiKeyController_findAll",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dadosfera-lang",
|
|
||||||
"in": "header",
|
|
||||||
"required": false,
|
|
||||||
"schema": {
|
|
||||||
"enum": [
|
|
||||||
"pt-br",
|
|
||||||
"en-us"
|
|
||||||
],
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/ApiKeyBaseResponseDto"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"default": {
|
|
||||||
"description": "",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/ApiKeyBaseResponseDto"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
"ApiKey"
|
|
||||||
],
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"access-token": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/api-key/{id}": {
|
|
||||||
"delete": {
|
|
||||||
"operationId": "ApiKeyController_remove",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "dadosfera-lang",
|
|
||||||
"in": "header",
|
|
||||||
"required": false,
|
|
||||||
"schema": {
|
|
||||||
"enum": [
|
|
||||||
"pt-br",
|
|
||||||
"en-us"
|
|
||||||
],
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"required": true,
|
|
||||||
"in": "path",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
"ApiKey"
|
|
||||||
],
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"access-token": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/identity-providers": {
|
"/identity-providers": {
|
||||||
"post": {
|
"post": {
|
||||||
"operationId": "IdentityProviderController_addIdentityProvider",
|
"operationId": "IdentityProviderController_addIdentityProvider",
|
||||||
@@ -7275,6 +7275,70 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/platform/pipelines/catalog/schemas": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "PlatformApiController_getAvailableSchemas",
|
||||||
|
"summary": "Get available schemas",
|
||||||
|
"parameters": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Platform API"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/platform/pipelines/catalog/tables/validate": {
|
||||||
|
"post": {
|
||||||
|
"operationId": "PlatformApiController_validateTableAndSchema",
|
||||||
|
"summary": "Validate Table and Schema",
|
||||||
|
"parameters": [],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/ValidationTableDTO"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"description": "",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "object"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Platform API"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/platform/pipeline/{pipelineId}/pipeline_run": {
|
"/platform/pipeline/{pipelineId}/pipeline_run": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "PlatformApiController_getPipelineRuns",
|
"operationId": "PlatformApiController_getPipelineRuns",
|
||||||
@@ -8440,36 +8504,6 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/storage-explorer/storage/link-to-table": {
|
|
||||||
"post": {
|
|
||||||
"operationId": "StorageExplorerController_linkFileToTable",
|
|
||||||
"summary": "Link an existing file in storage to a table",
|
|
||||||
"parameters": [],
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tags": [
|
|
||||||
"Storage Explorer"
|
|
||||||
],
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"access-token": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"access-token": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/storage-explorer/storage/metadata": {
|
"/storage-explorer/storage/metadata": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "StorageExplorerController_getFileMetadata",
|
"operationId": "StorageExplorerController_getFileMetadata",
|
||||||
@@ -8593,6 +8627,104 @@
|
|||||||
"accessToken"
|
"accessToken"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"CreateApiKeyDto": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"permissions": {
|
||||||
|
"description": "Array of permission IDs",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"permissions"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"PermissionDto": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"CreateApiKeyResponseDto": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uuid"
|
||||||
|
},
|
||||||
|
"key_mask": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"permissions": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/PermissionDto"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"created_at": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"created_by": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"key": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"key_mask",
|
||||||
|
"permissions",
|
||||||
|
"created_at",
|
||||||
|
"created_by",
|
||||||
|
"key"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ApiKeyBaseResponseDto": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uuid"
|
||||||
|
},
|
||||||
|
"key_mask": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"permissions": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/PermissionDto"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"created_at": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"created_by": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"key_mask",
|
||||||
|
"permissions",
|
||||||
|
"created_at",
|
||||||
|
"created_by"
|
||||||
|
]
|
||||||
|
},
|
||||||
"CreateConnectionDto": {
|
"CreateConnectionDto": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -8816,37 +8948,6 @@
|
|||||||
"message"
|
"message"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"PermissionDto": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"seqid": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"claim": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"createdAt": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"updatedAt": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"seqid",
|
|
||||||
"name",
|
|
||||||
"claim",
|
|
||||||
"createdAt",
|
|
||||||
"updatedAt"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Customer": {
|
"Customer": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -9987,6 +10088,15 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"identifier_columns": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"destination": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
@@ -9995,6 +10105,8 @@
|
|||||||
"name",
|
"name",
|
||||||
"columns",
|
"columns",
|
||||||
"references",
|
"references",
|
||||||
|
"identifier_columns",
|
||||||
|
"destination",
|
||||||
"type"
|
"type"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -11330,89 +11442,6 @@
|
|||||||
"publicKey"
|
"publicKey"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"CreateApiKeyDto": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"permissions": {
|
|
||||||
"description": "Array of permission IDs",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"permissions"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"CreateApiKeyResponseDto": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "uuid"
|
|
||||||
},
|
|
||||||
"key_mask": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"permissions": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/PermissionDto"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"created_at": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "date-time"
|
|
||||||
},
|
|
||||||
"created_by": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"key": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"key_mask",
|
|
||||||
"permissions",
|
|
||||||
"created_at",
|
|
||||||
"created_by",
|
|
||||||
"key"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ApiKeyBaseResponseDto": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "uuid"
|
|
||||||
},
|
|
||||||
"key_mask": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"permissions": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/PermissionDto"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"created_at": {
|
|
||||||
"type": "string",
|
|
||||||
"format": "date-time"
|
|
||||||
},
|
|
||||||
"created_by": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"key_mask",
|
|
||||||
"permissions",
|
|
||||||
"created_at",
|
|
||||||
"created_by"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"CreateIdentityProvider": {
|
"CreateIdentityProvider": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -11486,6 +11515,20 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"providers"
|
"providers"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"ValidationTableDTO": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"tables": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"tables"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+5
-4
@@ -17,7 +17,7 @@
|
|||||||
"@aws-sdk/signature-v4": "^3.370.0",
|
"@aws-sdk/signature-v4": "^3.370.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack": "2.5.3",
|
"@dadosfera/protospack": "2.5.3",
|
||||||
"@dadosfera/protospack-v2": "^3.38.0-beta.26",
|
"@dadosfera/protospack-v2": "3.38.0-beta.27",
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"@grpc/proto-loader": "^0.7.9",
|
"@grpc/proto-loader": "^0.7.9",
|
||||||
"@nestjs/cli": "^9.5.0",
|
"@nestjs/cli": "^9.5.0",
|
||||||
@@ -1744,9 +1744,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@dadosfera/protospack-v2": {
|
"node_modules/@dadosfera/protospack-v2": {
|
||||||
"version": "3.38.0-beta.26",
|
"version": "3.38.0-beta.27",
|
||||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.38.0-beta.26.tgz",
|
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.38.0-beta.27.tgz",
|
||||||
"integrity": "sha512-N8NS7+djLGy0wJXk00+4oupqd/wBIQ1f+YBBhK2y9x4guFXYK1KWIrPZhPj+gaU8g2KNkqKoT7SnE9PXNxlLSQ==",
|
"integrity": "sha512-lvV3g/SyPLFVfdtxoc/l1fCtl0o/X9Dv/KOdmDAXQyRJRjd3/81V83rwomp3UtI5IYGYuSbREgolH+X3aNYF7w==",
|
||||||
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@
|
|||||||
"@aws-sdk/signature-v4": "^3.370.0",
|
"@aws-sdk/signature-v4": "^3.370.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack": "2.5.3",
|
"@dadosfera/protospack": "2.5.3",
|
||||||
"@dadosfera/protospack-v2": "^3.38.0-beta.26",
|
"@dadosfera/protospack-v2": "3.38.0-beta.27",
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"@grpc/proto-loader": "^0.7.9",
|
"@grpc/proto-loader": "^0.7.9",
|
||||||
"@nestjs/cli": "^9.5.0",
|
"@nestjs/cli": "^9.5.0",
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ import jwt, { JwtPayload } from 'jsonwebtoken';
|
|||||||
import { LanguageEnum } from 'src/utils/languages.enum';
|
import { LanguageEnum } from 'src/utils/languages.enum';
|
||||||
import { Language } from 'src/decorators/language.decorator';
|
import { Language } from 'src/decorators/language.decorator';
|
||||||
import { ApiInternalOnlyEndpoint } from 'src/decorators/swagger.decorator';
|
import { ApiInternalOnlyEndpoint } from 'src/decorators/swagger.decorator';
|
||||||
|
import { ApiKeyService } from 'src/modules/api-key/api-key.service';
|
||||||
|
|
||||||
type CookiesValues = {
|
type CookiesValues = {
|
||||||
accessToken?: string;
|
accessToken?: string;
|
||||||
@@ -74,6 +75,7 @@ export class AuthController {
|
|||||||
@Inject(DadosferaLogger)
|
@Inject(DadosferaLogger)
|
||||||
dadosferaLogger: DadosferaLogger,
|
dadosferaLogger: DadosferaLogger,
|
||||||
private authClient: AuthClientService,
|
private authClient: AuthClientService,
|
||||||
|
private apiKeyService: ApiKeyService,
|
||||||
) {
|
) {
|
||||||
this.logger = dadosferaLogger.logger;
|
this.logger = dadosferaLogger.logger;
|
||||||
|
|
||||||
@@ -477,10 +479,29 @@ export class AuthController {
|
|||||||
async getMe(@Req() req: Request, @Res() res: Response) {
|
async getMe(@Req() req: Request, @Res() res: Response) {
|
||||||
this.logger.info('GET /auth/me ')
|
this.logger.info('GET /auth/me ')
|
||||||
|
|
||||||
|
// Check for API key header first
|
||||||
|
const apiKey = req.get('X-Api-key');
|
||||||
|
if (apiKey) {
|
||||||
|
this.logger.info('Authenticating via X-Api-key header');
|
||||||
|
const { api_key } = await this.apiKeyService.get(apiKey);
|
||||||
|
|
||||||
|
const userDto = {
|
||||||
|
id: api_key.user_id,
|
||||||
|
name: api_key.username,
|
||||||
|
customer: {
|
||||||
|
id: api_key.customer_id,
|
||||||
|
name: api_key.customer_name,
|
||||||
|
tier: api_key.customer_tier,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return res.status(200).json(userDto);
|
||||||
|
}
|
||||||
|
|
||||||
// Get token and headers
|
// Get token and headers
|
||||||
const accessToken = req.cookies['ddf-auth'];
|
const accessToken = req.cookies['ddf-auth'];
|
||||||
const refreshToken = req.cookies['ddf-refresh-auth'];
|
const refreshToken = req.cookies['ddf-refresh-auth'];
|
||||||
const userId = req.cookies['ddf-user-id'];
|
const userId = req.cookies['ddf-user-id'];
|
||||||
const resourceHost = req.headers["host"]
|
const resourceHost = req.headers["host"]
|
||||||
|
|
||||||
const hasUserSession = Boolean(accessToken) && Boolean(userId);
|
const hasUserSession = Boolean(accessToken) && Boolean(userId);
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ import { AuthClientService } from './auth.service';
|
|||||||
import { DucClient } from '../duc/client.config';
|
import { DucClient } from '../duc/client.config';
|
||||||
import { GoogleLoginStrategy } from './passport-strategies/google-strategy';
|
import { GoogleLoginStrategy } from './passport-strategies/google-strategy';
|
||||||
import { getOauthSecrets } from 'src/utils/OauthSecrets';
|
import { getOauthSecrets } from 'src/utils/OauthSecrets';
|
||||||
|
import { ApiKeyModule } from '../api-key/api-key.module';
|
||||||
const client = new DucClient();
|
const client = new DucClient();
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [ClientsModule.register([client.providerOptions])],
|
imports: [ClientsModule.register([client.providerOptions]), ApiKeyModule],
|
||||||
controllers: [AuthController],
|
controllers: [AuthController],
|
||||||
providers: [
|
providers: [
|
||||||
AuthClientService,
|
AuthClientService,
|
||||||
|
|||||||
@@ -14,6 +14,13 @@ export class TableColumns {
|
|||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
references: Column[];
|
references: Column[];
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
|
identifier_columns: string[];
|
||||||
|
@ApiProperty()
|
||||||
|
destination: Record<'raw' | 'qualify', {
|
||||||
|
table_name: string;
|
||||||
|
table_schema: string;
|
||||||
|
}> | null;
|
||||||
|
@ApiProperty()
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
export class AvailableEntity {
|
export class AvailableEntity {
|
||||||
|
|||||||
@@ -25,6 +25,15 @@ import { ElasticsearchService } from '../../services/elasticsearch';
|
|||||||
import { DynamoDBService, ReferenceColumn } from '../../services/dynamodb';
|
import { DynamoDBService, ReferenceColumn } from '../../services/dynamodb';
|
||||||
import { CustomersService } from '../customers/customers.service';
|
import { CustomersService } from '../customers/customers.service';
|
||||||
import { validateCronAgainstScheduleLimit } from '../../utils/cron-validation';
|
import { validateCronAgainstScheduleLimit } from '../../utils/cron-validation';
|
||||||
|
import { ValidationTableDTO } from './platform-api.dto';
|
||||||
|
|
||||||
|
|
||||||
|
type ValidateTablesDTO = {
|
||||||
|
tables: Array<{
|
||||||
|
table_schema: string,
|
||||||
|
table_name: string
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
|
||||||
@ApiTags('Platform API')
|
@ApiTags('Platform API')
|
||||||
@Controller('platform')
|
@Controller('platform')
|
||||||
@@ -720,6 +729,41 @@ export class PlatformApiController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ==================== PIPELINE VALIDATION ====================
|
||||||
|
|
||||||
|
@Get('pipelines/catalog/schemas')
|
||||||
|
@ApiOperation({ summary: 'Get available schemas' })
|
||||||
|
@RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.GET)
|
||||||
|
async getAvailableSchemas(
|
||||||
|
@User() user: RequestUser,
|
||||||
|
@Query() query: Record<string, string>,
|
||||||
|
) {
|
||||||
|
return this.platformApiService.proxy(
|
||||||
|
'GET',
|
||||||
|
`/catalog/schemas`,
|
||||||
|
user,
|
||||||
|
undefined,
|
||||||
|
query,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Post('pipelines/catalog/tables/validate')
|
||||||
|
@ApiOperation({ summary: 'Validate Table and Schema' })
|
||||||
|
@RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.GET)
|
||||||
|
async validateTableAndSchema(
|
||||||
|
@Body() payload: ValidationTableDTO,
|
||||||
|
@User() user: RequestUser,
|
||||||
|
@Query() query: Record<string, string>,
|
||||||
|
) {
|
||||||
|
return this.platformApiService.proxy(
|
||||||
|
'POST',
|
||||||
|
`/catalog/tables/validate`,
|
||||||
|
user,
|
||||||
|
payload,
|
||||||
|
query,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== PIPELINE RUN ROUTES ====================
|
// ==================== PIPELINE RUN ROUTES ====================
|
||||||
|
|
||||||
@Get('pipeline/:pipelineId/pipeline_run')
|
@Get('pipeline/:pipelineId/pipeline_run')
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { ApiProperty } from "@nestjs/swagger";
|
||||||
|
|
||||||
|
export class ValidationTableDTO {
|
||||||
|
@ApiProperty()
|
||||||
|
tables: Array<{
|
||||||
|
table_name: string;
|
||||||
|
table_schema: string;
|
||||||
|
}>
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
export const STORAGE_EXPLORER_CONFIG = {
|
export const STORAGE_EXPLORER_CONFIG = {
|
||||||
getUrl: (customerId: string): string => {
|
getUrl: (customerName: string): string => {
|
||||||
const urlTemplate = process.env.STORAGE_EXPLORER_API_URL;
|
const urlTemplate = process.env.STORAGE_EXPLORER_API_URL;
|
||||||
if (!urlTemplate) {
|
if (!urlTemplate) {
|
||||||
throw new Error('STORAGE_EXPLORER_API_URL environment variable is not set');
|
throw new Error('STORAGE_EXPLORER_API_URL environment variable is not set');
|
||||||
}
|
}
|
||||||
// Replace {customer_id} placeholder with actual customer ID
|
// Replace {customer_id} placeholder with actual customer ID
|
||||||
// For local: http://172.17.0.1:8000/api (no placeholder)
|
// For local: http://172.17.0.1:8000/api (no placeholder)
|
||||||
// For prod: https://storage-explorer-{customer_id}.stg.dadosfera.ai/api
|
// For prod: https://storage-explorer-{customer_id}.dadosfera.ai/api
|
||||||
return urlTemplate.replace('{customer_id}', customerId);
|
return urlTemplate.replace('{customer}', customerName);
|
||||||
},
|
},
|
||||||
timeout: parseInt(process.env.STORAGE_EXPLORER_TIMEOUT || '30000', 10),
|
timeout: parseInt(process.env.STORAGE_EXPLORER_TIMEOUT || '30000', 10),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import {
|
|||||||
Get,
|
Get,
|
||||||
Post,
|
Post,
|
||||||
Put,
|
Put,
|
||||||
Delete,
|
|
||||||
Param,
|
Param,
|
||||||
Body,
|
Body,
|
||||||
Query,
|
Query,
|
||||||
Inject,
|
Inject,
|
||||||
UseInterceptors,
|
UseInterceptors,
|
||||||
UploadedFiles,
|
UploadedFiles,
|
||||||
|
Headers,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { ApiTags, ApiOperation, ApiConsumes } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation, ApiConsumes } from '@nestjs/swagger';
|
||||||
import { FilesInterceptor } from '@nestjs/platform-express';
|
import { FilesInterceptor } from '@nestjs/platform-express';
|
||||||
@@ -47,11 +47,13 @@ export class StorageExplorerController {
|
|||||||
async validateTableName(
|
async validateTableName(
|
||||||
@Body() body: any,
|
@Body() body: any,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'POST',
|
'POST',
|
||||||
'/tables/validate-name',
|
'/tables/validate-name',
|
||||||
user,
|
user,
|
||||||
|
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -62,11 +64,13 @@ export class StorageExplorerController {
|
|||||||
async createTable(
|
async createTable(
|
||||||
@Body() body: any,
|
@Body() body: any,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'POST',
|
'POST',
|
||||||
'/tables/',
|
'/tables/',
|
||||||
user,
|
user,
|
||||||
|
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -77,11 +81,13 @@ export class StorageExplorerController {
|
|||||||
async listTables(
|
async listTables(
|
||||||
@Query('page') page: number,
|
@Query('page') page: number,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
'/tables/',
|
'/tables/',
|
||||||
user,
|
user,
|
||||||
|
|
||||||
undefined,
|
undefined,
|
||||||
{ page },
|
{ page },
|
||||||
);
|
);
|
||||||
@@ -93,6 +99,7 @@ export class StorageExplorerController {
|
|||||||
async getTable(
|
async getTable(
|
||||||
@Param('tableId') tableId: string,
|
@Param('tableId') tableId: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
@@ -108,11 +115,13 @@ export class StorageExplorerController {
|
|||||||
@Param('tableId') tableId: string,
|
@Param('tableId') tableId: string,
|
||||||
@Param('datasetId') datasetId: string,
|
@Param('datasetId') datasetId: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'POST',
|
'POST',
|
||||||
`/tables/${tableId}/datasets/${datasetId}`,
|
`/tables/${tableId}/datasets/${datasetId}`,
|
||||||
user,
|
user,
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,11 +131,13 @@ export class StorageExplorerController {
|
|||||||
async getTableDatasets(
|
async getTableDatasets(
|
||||||
@Param('tableId') tableId: string,
|
@Param('tableId') tableId: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
`/tables/${tableId}/datasets`,
|
`/tables/${tableId}/datasets`,
|
||||||
user,
|
user,
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,11 +147,13 @@ export class StorageExplorerController {
|
|||||||
async getTableSchema(
|
async getTableSchema(
|
||||||
@Param('tableId') tableId: string,
|
@Param('tableId') tableId: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
`/tables/${tableId}/schema`,
|
`/tables/${tableId}/schema`,
|
||||||
user,
|
user,
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +169,7 @@ export class StorageExplorerController {
|
|||||||
'POST',
|
'POST',
|
||||||
`/tables/${tableId}/validate-compatibility/${datasetId}`,
|
`/tables/${tableId}/validate-compatibility/${datasetId}`,
|
||||||
user,
|
user,
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,11 +184,13 @@ export class StorageExplorerController {
|
|||||||
@Param('datasetId') datasetId: string,
|
@Param('datasetId') datasetId: string,
|
||||||
@Query('limit') limit: number,
|
@Query('limit') limit: number,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
`/datasets/${datasetId}/preview`,
|
`/datasets/${datasetId}/preview`,
|
||||||
user,
|
user,
|
||||||
|
|
||||||
undefined,
|
undefined,
|
||||||
{ limit },
|
{ limit },
|
||||||
);
|
);
|
||||||
@@ -187,11 +203,13 @@ export class StorageExplorerController {
|
|||||||
@Param('datasetId') datasetId: string,
|
@Param('datasetId') datasetId: string,
|
||||||
@Query('force_refresh') forceRefresh: boolean,
|
@Query('force_refresh') forceRefresh: boolean,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
`/datasets/${datasetId}/schema`,
|
`/datasets/${datasetId}/schema`,
|
||||||
user,
|
user,
|
||||||
|
|
||||||
undefined,
|
undefined,
|
||||||
{ force_refresh: forceRefresh },
|
{ force_refresh: forceRefresh },
|
||||||
);
|
);
|
||||||
@@ -203,11 +221,13 @@ export class StorageExplorerController {
|
|||||||
async listDatasetsByUpload(
|
async listDatasetsByUpload(
|
||||||
@Param('uploadId') uploadId: string,
|
@Param('uploadId') uploadId: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
`/datasets/upload/${uploadId}`,
|
`/datasets/upload/${uploadId}`,
|
||||||
user,
|
user,
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,11 +238,13 @@ export class StorageExplorerController {
|
|||||||
@Param('datasetId') datasetId: string,
|
@Param('datasetId') datasetId: string,
|
||||||
@Body() body: any,
|
@Body() body: any,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'PUT',
|
'PUT',
|
||||||
`/datasets/${datasetId}/refresh-schema`,
|
`/datasets/${datasetId}/refresh-schema`,
|
||||||
user,
|
user,
|
||||||
|
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -239,11 +261,13 @@ export class StorageExplorerController {
|
|||||||
@Query('limit') limit: number,
|
@Query('limit') limit: number,
|
||||||
@Query('folder_path') folderPath: string,
|
@Query('folder_path') folderPath: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
'/storage/uploads/history',
|
'/storage/uploads/history',
|
||||||
user,
|
user,
|
||||||
|
|
||||||
undefined,
|
undefined,
|
||||||
{ page, limit, folder_path: folderPath },
|
{ page, limit, folder_path: folderPath },
|
||||||
);
|
);
|
||||||
@@ -255,11 +279,13 @@ export class StorageExplorerController {
|
|||||||
async browseStorage(
|
async browseStorage(
|
||||||
@Query('path') path: string,
|
@Query('path') path: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
'/storage/browse',
|
'/storage/browse',
|
||||||
user,
|
user,
|
||||||
|
|
||||||
undefined,
|
undefined,
|
||||||
{ path },
|
{ path },
|
||||||
);
|
);
|
||||||
@@ -274,6 +300,7 @@ export class StorageExplorerController {
|
|||||||
@UploadedFiles() files: Array<Express.Multer.File>,
|
@UploadedFiles() files: Array<Express.Multer.File>,
|
||||||
@Body('folder_path') folderPath: string,
|
@Body('folder_path') folderPath: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
// Create FormData to forward files to storage-explorer API
|
// Create FormData to forward files to storage-explorer API
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
@@ -297,6 +324,7 @@ export class StorageExplorerController {
|
|||||||
'POST',
|
'POST',
|
||||||
'/storage/upload/batch',
|
'/storage/upload/batch',
|
||||||
user,
|
user,
|
||||||
|
|
||||||
formData,
|
formData,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -307,11 +335,13 @@ export class StorageExplorerController {
|
|||||||
async createFolder(
|
async createFolder(
|
||||||
@Body() body: any,
|
@Body() body: any,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'POST',
|
'POST',
|
||||||
'/storage/folder/create',
|
'/storage/folder/create',
|
||||||
user,
|
user,
|
||||||
|
|
||||||
body,
|
body,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -322,11 +352,13 @@ export class StorageExplorerController {
|
|||||||
async downloadFile(
|
async downloadFile(
|
||||||
@Query('file_path') filePath: string,
|
@Query('file_path') filePath: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
'/storage/download',
|
'/storage/download',
|
||||||
user,
|
user,
|
||||||
|
|
||||||
undefined,
|
undefined,
|
||||||
{ file_path: filePath },
|
{ file_path: filePath },
|
||||||
);
|
);
|
||||||
@@ -338,6 +370,7 @@ export class StorageExplorerController {
|
|||||||
async getFileMetadata(
|
async getFileMetadata(
|
||||||
@Query('file_path') filePath: string,
|
@Query('file_path') filePath: string,
|
||||||
@User() user: RequestUser,
|
@User() user: RequestUser,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
return this.storageExplorerService.proxy(
|
return this.storageExplorerService.proxy(
|
||||||
'GET',
|
'GET',
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export class StorageExplorerService {
|
|||||||
path: string,
|
path: string,
|
||||||
user: RequestUser,
|
user: RequestUser,
|
||||||
body?: any,
|
body?: any,
|
||||||
query?: Record<string, any>,
|
query?: Record<string, any>
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
// Validate customer_id is present for multi-tenant isolation
|
// Validate customer_id is present for multi-tenant isolation
|
||||||
if (!user.customer_id) {
|
if (!user.customer_id) {
|
||||||
@@ -28,7 +28,7 @@ export class StorageExplorerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get customer-specific storage-explorer URL
|
// Get customer-specific storage-explorer URL
|
||||||
const baseUrl = STORAGE_EXPLORER_CONFIG.getUrl(user.customer_id);
|
const baseUrl = STORAGE_EXPLORER_CONFIG.getUrl(user.customer_name);
|
||||||
const url = new URL(`${baseUrl}${path}`);
|
const url = new URL(`${baseUrl}${path}`);
|
||||||
|
|
||||||
// Add query params
|
// Add query params
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ export class ValidationPipe implements PipeTransform<any> {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
const object = plainToInstance(metatype, value);
|
const object = plainToInstance(metatype, value);
|
||||||
const errors = await validate(object);
|
const errors = await validate(object, {
|
||||||
|
forbidUnknownValues: false,
|
||||||
|
whitelist: true,
|
||||||
|
});
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
const errorMessages = errors.map((err) => err.constraints);
|
const errorMessages = errors.map((err) => err.constraints);
|
||||||
throw new BadRequestException(errorMessages);
|
throw new BadRequestException(errorMessages);
|
||||||
|
|||||||
Reference in New Issue
Block a user