FEAT: remove custom properties endpoints and DTOs from catalog management

This commit is contained in:
viniciusgadea
2026-07-21 16:32:38 -03:00
parent e1cfc6e1a8
commit a93fbfbbd9
6 changed files with 6 additions and 205 deletions
-124
View File
@@ -5578,106 +5578,6 @@
"access-token": []
}
]
},
"post": {
"operationId": "CatalogController_upsertCustomPropertyDefinition",
"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/CustomPropertyDefinitionDto"
}
}
}
},
"responses": {
"201": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"Catalog"
],
"security": [
{
"access-token": []
},
{
"access-token": []
}
]
}
},
"/catalog/custom-properties/{key}": {
"delete": {
"operationId": "CatalogController_deleteCustomPropertyDefinition",
"parameters": [
{
"name": "dadosfera-lang",
"in": "header",
"required": false,
"schema": {
"enum": [
"pt-br",
"en-us"
],
"type": "string"
}
},
{
"name": "key",
"required": true,
"in": "path",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"Catalog"
],
"security": [
{
"access-token": []
},
{
"access-token": []
}
]
}
},
"/catalog/data-asset/{id}": {
@@ -10993,30 +10893,6 @@
"total"
]
},
"CustomPropertyDefinitionDto": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"text",
"number",
"boolean",
"date"
]
}
},
"required": [
"name",
"type"
]
},
"IColumnMetadata": {
"type": "object",
"properties": {
+4 -4
View File
@@ -16,7 +16,7 @@
"@aws-sdk/lib-dynamodb": "^3.414.0",
"@aws-sdk/signature-v4": "^3.370.0",
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
"@dadosfera/protospack-v2": "^3.40.0-beta.12",
"@dadosfera/protospack-v2": "^3.40.0-beta.13",
"@grpc/grpc-js": "^1.9.3",
"@grpc/proto-loader": "^0.7.9",
"@nestjs/cli": "^9.5.0",
@@ -1735,9 +1735,9 @@
}
},
"node_modules/@dadosfera/protospack-v2": {
"version": "3.40.0-beta.12",
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.40.0-beta.12.tgz",
"integrity": "sha512-nmam/ZJK5ecZlrh/yrMw+C0cHy3bH4NXthKt5csePX9Y/Sgri7tPwPScz9QHQh2Ux2eLflhIcFI6lW2jvOrGNQ==",
"version": "3.40.0-beta.13",
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.40.0-beta.13.tgz",
"integrity": "sha512-XYrq29fG0yddQAid6wnuD1n2X9NsXQiHpItngfLL0bXZZBP0ufgiotiEKmOsDtb3Z+apzGJVK9dJ9YduvmVzlQ==",
"license": "ISC",
"dependencies": {
"@grpc/grpc-js": "^1.9.3",
+1 -1
View File
@@ -34,7 +34,7 @@
"@aws-sdk/lib-dynamodb": "^3.414.0",
"@aws-sdk/signature-v4": "^3.370.0",
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
"@dadosfera/protospack-v2": "^3.40.0-beta.12",
"@dadosfera/protospack-v2": "^3.40.0-beta.13",
"@grpc/grpc-js": "^1.9.3",
"@grpc/proto-loader": "^0.7.9",
"@nestjs/cli": "^9.5.0",
-44
View File
@@ -37,7 +37,6 @@ import { PackTheMetadata } from 'src/utils/PackTheMetadata';
import { RequestUser, User } from 'src/decorators/user.decorator';
import {
BatchRemoveRlsRulesRequest,
CustomPropertyDefinitionDto,
GetDatasetCatalogTaskRes,
ICatalogAllRequest,
ICatalogAllResponse,
@@ -289,49 +288,6 @@ export class CatalogController {
return this.catalogService.getCustomPropertyDefinitions(metadata);
}
@Post('custom-properties')
@RequireAllPermissions(PERMISSIONS_GROUPS.CATALOG.permissions.DATA_MANAGER)
async upsertCustomPropertyDefinition(
@User() user: RequestUser,
@Body() definition: CustomPropertyDefinitionDto,
) {
const { customer_id, customer_name, user_id, username } = user;
const metadata = PackTheMetadata({
customer_id,
customer_name,
user_id,
username,
});
return this.catalogService.upsertCustomPropertyDefinition(
{
definition: {
key: definition.key || '',
name: definition.name,
type: definition.type,
},
},
metadata,
);
}
@Delete('custom-properties/:key')
@RequireAllPermissions(PERMISSIONS_GROUPS.CATALOG.permissions.DATA_MANAGER)
async deleteCustomPropertyDefinition(
@User() user: RequestUser,
@Param('key') key: string,
) {
const { customer_id, customer_name, user_id, username } = user;
const metadata = PackTheMetadata({
customer_id,
customer_name,
user_id,
username,
});
return this.catalogService.deleteCustomPropertyDefinition({ key }, metadata);
}
@Get('data-asset/:id')
@RequireSomePermission(
PERMISSIONS_GROUPS.CATALOG.permissions.GET,
-16
View File
@@ -35,11 +35,9 @@ import {
} from './dtos';
import {
AddRlsRuleRequest,
DeleteCustomPropertyDefinitionRequest,
GetNimbusDashboardsRequest,
GetRlsRulesRequest,
PiiMetadata,
UpsertCustomPropertyDefinitionRequest,
} from '@dadosfera/protospack-v2/dist/lib/Catalog/interfaces/messages';
import { TypeParser } from 'src/utils/FileParser/parser-types';
import { ParserBuilder } from 'src/utils/FileParser/parser.builder';
@@ -126,20 +124,6 @@ class CatalogService implements OnModuleInit {
return lastValueFrom(this.catalogReadService.GetCustomPropertyDefinitions({}, metadata));
}
async upsertCustomPropertyDefinition(
data: UpsertCustomPropertyDefinitionRequest,
metadata: Metadata,
) {
return lastValueFrom(this.catalogWriteService.UpsertCustomPropertyDefinition(data, metadata));
}
async deleteCustomPropertyDefinition(
data: DeleteCustomPropertyDefinitionRequest,
metadata: Metadata,
) {
return lastValueFrom(this.catalogWriteService.DeleteCustomPropertyDefinition(data, metadata));
}
async createDataAsset(data: Messages.CreateDataAssetRequest, metadata) {
this.logger.info('CatalogService - Manage Data assets permissions');
if (!data.embed) data.embed = undefined;
+1 -16
View File
@@ -203,21 +203,6 @@ export class IData {
day_opening: number;
}
export type CustomPropertyType = 'text' | 'number' | 'boolean' | 'date';
export class CustomPropertyDefinitionDto {
@ApiPropertyOptional()
@IsOptional()
@IsString()
key?: string;
@ApiProperty()
@IsString()
@IsNotEmpty()
name: string;
@ApiProperty({ enum: ['text', 'number', 'boolean', 'date'] })
@IsEnum(['text', 'number', 'boolean', 'date'])
type: CustomPropertyType;
}
export class IUpdateDataRequest {
@ApiProperty()
@@ -233,7 +218,7 @@ export class IUpdateDataRequest {
@ApiPropertyOptional()
docs?: string;
@ApiPropertyOptional()
custom_properties?: Record<string, string | number | boolean | null>;
custom_properties?: Record<string, (string | number | boolean)[]>;
}
export class IUpdateCertificationStatusRequest {