mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-12 10:09:07 +00:00
Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4246c7495e | ||
|
|
85c8a4937d | ||
|
|
8c34914806 | ||
|
|
1881d07c4a | ||
|
|
3b8310fdca | ||
|
|
52bda8ebe2 | ||
|
|
275a53dbd1 | ||
|
|
9cefdb226d | ||
|
|
8ac0a8a79f | ||
|
|
285de97375 | ||
|
|
e2a7d2b92b | ||
|
|
da23ad76db | ||
|
|
55b0961b82 | ||
|
|
d3c5c0fa63 | ||
|
|
5dbc644d1d | ||
|
|
8eddb9e1bf | ||
|
|
8e0182aa50 | ||
|
|
a18bdccc09 | ||
|
|
b27298501d | ||
|
|
33ebc91826 | ||
|
|
6948156693 | ||
|
|
0aaa4384c3 | ||
|
|
039c652b28 | ||
|
|
653d4f53b5 |
@@ -0,0 +1,12 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.git
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
.DS_Store
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
coverage
|
||||||
|
.nyc_output
|
||||||
|
*.tgz
|
||||||
|
!protospack.tgz
|
||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
FROM node:18.17-alpine AS base_image
|
FROM node:20-alpine AS base_image
|
||||||
|
RUN npm install -g npm@latest
|
||||||
|
|
||||||
FROM base_image AS build_base
|
FROM base_image AS build_base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
FROM node:22-alpine AS base_image
|
||||||
|
RUN npm install -g npm@latest
|
||||||
|
|
||||||
|
FROM base_image AS build_base
|
||||||
|
WORKDIR /app
|
||||||
|
RUN apk update
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
aws-cli \
|
||||||
|
chromium \
|
||||||
|
nss \
|
||||||
|
freetype \
|
||||||
|
harfbuzz \
|
||||||
|
ca-certificates \
|
||||||
|
ttf-freefont
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
||||||
|
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||||
|
|
||||||
|
|
||||||
|
# Local build with secrets
|
||||||
|
FROM build_base AS build
|
||||||
|
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
|
||||||
|
aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
|
||||||
|
FROM base_image
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/dist ./dist
|
||||||
|
COPY --from=build /app/node_modules ./node_modules
|
||||||
|
COPY --from=build /app/package*.json ./
|
||||||
|
RUN apk update
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
chromium \
|
||||||
|
nss \
|
||||||
|
freetype \
|
||||||
|
harfbuzz \
|
||||||
|
ca-certificates \
|
||||||
|
ttf-freefont
|
||||||
|
|
||||||
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
||||||
|
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||||
|
|
||||||
|
ENTRYPOINT ["npm", "run", "start:prod"]
|
||||||
@@ -48,6 +48,9 @@ spec:
|
|||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
env:
|
env:
|
||||||
|
# Auth Provider Configuration (cognito or keycloak)
|
||||||
|
- name: AUTH_PROVIDER
|
||||||
|
value: {{ .Values.maestro.auth_provider | default "cognito" | quote }}
|
||||||
- name: AWS_IDENTITY_POOL_ID
|
- name: AWS_IDENTITY_POOL_ID
|
||||||
value: {{ .Values.maestro.aws_identity_pool_id }}
|
value: {{ .Values.maestro.aws_identity_pool_id }}
|
||||||
- name: AWS_REGION
|
- name: AWS_REGION
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ resources:
|
|||||||
cpu: 2000m
|
cpu: 2000m
|
||||||
memory: 2Gi
|
memory: 2Gi
|
||||||
maestro:
|
maestro:
|
||||||
|
# Auth provider: "cognito" (default) or "keycloak"
|
||||||
|
# Note: maestro doesn't connect to Keycloak directly, only duc does
|
||||||
|
auth_provider: "cognito"
|
||||||
aws_identity_pool_id: "us-east-1_Mrezsw9Sn"
|
aws_identity_pool_id: "us-east-1_Mrezsw9Sn"
|
||||||
duc_url: duc.dadosfera.ai
|
duc_url: duc.dadosfera.ai
|
||||||
in_factory_url: in-factory.dadosfera.ai
|
in_factory_url: in-factory.dadosfera.ai
|
||||||
|
|||||||
+330
-281
@@ -213,14 +213,7 @@
|
|||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "",
|
"description": ""
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
@@ -722,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",
|
||||||
@@ -5461,6 +5606,66 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/customers/{id}/organization-info": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "CustomersController_getOrganizationInfo",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Organization information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Customers"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"put": {
|
||||||
|
"operationId": "CustomersController_updateOrganizationInfo",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "id",
|
||||||
|
"required": true,
|
||||||
|
"in": "path",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Organization information updated"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"Customers"
|
||||||
|
],
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"access-token": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/catalog/data-asset/share/{id}": {
|
"/catalog/data-asset/share/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "ShareController_getShareDataAsset",
|
"operationId": "ShareController_getShareDataAsset",
|
||||||
@@ -6531,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",
|
||||||
@@ -7798,6 +7851,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": {
|
||||||
@@ -8021,37 +8172,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": {
|
||||||
@@ -8169,7 +8289,7 @@
|
|||||||
"companyName": {
|
"companyName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"companySite": {
|
"personalSite": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"mfaStatus": {
|
"mfaStatus": {
|
||||||
@@ -8192,6 +8312,9 @@
|
|||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"authProvider": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -8204,7 +8327,7 @@
|
|||||||
"hierarchy",
|
"hierarchy",
|
||||||
"bio",
|
"bio",
|
||||||
"companyName",
|
"companyName",
|
||||||
"companySite",
|
"personalSite",
|
||||||
"mfaStatus",
|
"mfaStatus",
|
||||||
"createdAt",
|
"createdAt",
|
||||||
"updatedAt",
|
"updatedAt",
|
||||||
@@ -8344,7 +8467,7 @@
|
|||||||
"companyName": {
|
"companyName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"companySite": {
|
"personalSite": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"customer": {
|
"customer": {
|
||||||
@@ -8376,7 +8499,7 @@
|
|||||||
"hierarchy",
|
"hierarchy",
|
||||||
"bio",
|
"bio",
|
||||||
"companyName",
|
"companyName",
|
||||||
"companySite",
|
"personalSite",
|
||||||
"mfaStatus",
|
"mfaStatus",
|
||||||
"createdAt",
|
"createdAt",
|
||||||
"updatedAt",
|
"updatedAt",
|
||||||
@@ -8520,7 +8643,7 @@
|
|||||||
"bio": {
|
"bio": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"companySite": {
|
"personalSite": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"companyName": {
|
"companyName": {
|
||||||
@@ -8572,7 +8695,7 @@
|
|||||||
"companyName": {
|
"companyName": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"companySite": {
|
"personalSite": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"mfaStatus": {
|
"mfaStatus": {
|
||||||
@@ -8600,7 +8723,7 @@
|
|||||||
"hierarchy",
|
"hierarchy",
|
||||||
"bio",
|
"bio",
|
||||||
"companyName",
|
"companyName",
|
||||||
"companySite",
|
"personalSite",
|
||||||
"mfaStatus",
|
"mfaStatus",
|
||||||
"createdAt",
|
"createdAt",
|
||||||
"updatedAt",
|
"updatedAt",
|
||||||
@@ -9649,6 +9772,9 @@
|
|||||||
"public",
|
"public",
|
||||||
"private"
|
"private"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"docs": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -9903,6 +10029,9 @@
|
|||||||
"public",
|
"public",
|
||||||
"private"
|
"private"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"docs": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -9942,6 +10071,9 @@
|
|||||||
},
|
},
|
||||||
"embed": {
|
"embed": {
|
||||||
"$ref": "#/components/schemas/EmbedObject"
|
"$ref": "#/components/schemas/EmbedObject"
|
||||||
|
},
|
||||||
|
"docs": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -10523,89 +10655,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": {
|
||||||
|
|||||||
Generated
+2122
-2990
File diff suppressed because it is too large
Load Diff
+9
-3
@@ -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.18",
|
"@dadosfera/protospack-v2": "^3.38.0-beta.26",
|
||||||
"@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",
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"@nestjs/schematics": "^9.2.0",
|
"@nestjs/schematics": "^9.2.0",
|
||||||
"@nestjs/swagger": "^6.3.0",
|
"@nestjs/swagger": "^6.3.0",
|
||||||
"@nestjs/testing": "^9.4.3",
|
"@nestjs/testing": "^9.4.3",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.30.2",
|
||||||
"cache-manager": "^5.1.4",
|
"cache-manager": "^5.1.4",
|
||||||
"cache-manager-ioredis-yet": "^1.1.0",
|
"cache-manager-ioredis-yet": "^1.1.0",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
@@ -80,7 +80,13 @@
|
|||||||
"swagger-ui-express": "^4.6.3"
|
"swagger-ui-express": "^4.6.3"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"multer": "1.4.5-lts.1"
|
"multer": "2.0.2",
|
||||||
|
"form-data": "^4.0.4",
|
||||||
|
"body-parser": "^1.20.3",
|
||||||
|
"cross-spawn": "^7.0.5",
|
||||||
|
"glob": "^10.5.0",
|
||||||
|
"path-to-regexp": "^3.3.0",
|
||||||
|
"semver": "^7.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/cache-manager": "^4.0.6",
|
"@types/cache-manager": "^4.0.6",
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
@@ -190,13 +192,14 @@ export class AuthController {
|
|||||||
) {
|
) {
|
||||||
this.logger.info('/auth - change-password');
|
this.logger.info('/auth - change-password');
|
||||||
|
|
||||||
const { oldPassword, newPassword } = body;
|
const { oldPassword, newPassword, totpCode } = body;
|
||||||
const { authorization: accessToken } = headers;
|
const { authorization: accessToken } = headers;
|
||||||
|
|
||||||
return this.authClient.changePassword({
|
return this.authClient.changePassword({
|
||||||
accessToken,
|
accessToken,
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword,
|
newPassword,
|
||||||
|
totpCode,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +217,8 @@ export class AuthController {
|
|||||||
|
|
||||||
const { username } = body;
|
const { username } = body;
|
||||||
|
|
||||||
return this.authClient.resetPassword({ username }, metadata);
|
await this.authClient.resetPassword({ username }, metadata);
|
||||||
|
return { authProvider: process.env.AUTH_PROVIDER || 'cognito' };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiInternalOnlyEndpoint()
|
@ApiInternalOnlyEndpoint()
|
||||||
@@ -475,6 +479,25 @@ 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'];
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
accessToken,
|
accessToken,
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword,
|
newPassword,
|
||||||
|
totpCode,
|
||||||
}: AuthChangePasswordRequest) {
|
}: AuthChangePasswordRequest) {
|
||||||
this.logger.info('ChangePassword');
|
this.logger.info('ChangePassword');
|
||||||
|
|
||||||
@@ -151,6 +152,7 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
accessToken,
|
accessToken,
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword,
|
newPassword,
|
||||||
|
totpCode,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ export class IDataAsset {
|
|||||||
embed?: EmbedObject;
|
embed?: EmbedObject;
|
||||||
@ApiPropertyOptional({ enum: DataAssetShareType })
|
@ApiPropertyOptional({ enum: DataAssetShareType })
|
||||||
share_type?: DataAssetShareType;
|
share_type?: DataAssetShareType;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
docs?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class IOneDataAsset {
|
export class IOneDataAsset {
|
||||||
@@ -200,6 +202,8 @@ export class IUpdateDataRequest {
|
|||||||
embed: EmbedObject;
|
embed: EmbedObject;
|
||||||
@ApiPropertyOptional({ enum: DataAssetShareType })
|
@ApiPropertyOptional({ enum: DataAssetShareType })
|
||||||
share_type?: DataAssetShareType;
|
share_type?: DataAssetShareType;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
docs?: string;
|
||||||
}
|
}
|
||||||
export class ICreateDataAsset implements CreateDataAssetRequest {
|
export class ICreateDataAsset implements CreateDataAssetRequest {
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@@ -214,6 +218,8 @@ export class ICreateDataAsset implements CreateDataAssetRequest {
|
|||||||
location: string;
|
location: string;
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
embed: EmbedObject;
|
embed: EmbedObject;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
docs: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class IPreview {
|
export class IPreview {
|
||||||
|
|||||||
@@ -136,4 +136,32 @@ export class CustomersController {
|
|||||||
const result = await this.customersService.getAccessDashboardUrl(user.customer_name, metadata);
|
const result = await this.customersService.getAccessDashboardUrl(user.customer_name, metadata);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get(':id/organization-info')
|
||||||
|
@Authenticated()
|
||||||
|
@RequireAllPermissions(PERMISSIONS_GROUPS.USERS.permissions.ADMIN)
|
||||||
|
@ApiOkResponse({ description: 'Organization information' })
|
||||||
|
async getOrganizationInfo(@Param('id') id: string) {
|
||||||
|
this.logger.info('getOrganizationInfo', { id });
|
||||||
|
return this.customersService.getOrganizationInfo(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Put(':id/organization-info')
|
||||||
|
@Authenticated()
|
||||||
|
@RequireAllPermissions(PERMISSIONS_GROUPS.USERS.permissions.ADMIN)
|
||||||
|
@HttpCode(HttpStatus.OK)
|
||||||
|
@ApiOkResponse({ description: 'Organization information updated' })
|
||||||
|
async updateOrganizationInfo(
|
||||||
|
@Param('id') id: string,
|
||||||
|
@Body() body: {
|
||||||
|
companyName: string;
|
||||||
|
companySite: string;
|
||||||
|
domain: string;
|
||||||
|
cnpj: string;
|
||||||
|
description: string;
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
return this.customersService.updateOrganizationInfo(id, body);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,4 +223,57 @@ export class CustomersService implements OnModuleInit {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateOrganizationInfo(
|
||||||
|
customerId: string,
|
||||||
|
data: {
|
||||||
|
companyName: string;
|
||||||
|
companySite: string;
|
||||||
|
domain: string;
|
||||||
|
cnpj: string;
|
||||||
|
description: string;
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
const result = await lastValueFrom(
|
||||||
|
this.customerService.OrganizationUpdate({
|
||||||
|
customerId,
|
||||||
|
companyName: data.companyName || '',
|
||||||
|
companySite: data.companySite || '',
|
||||||
|
domain: data.domain || '',
|
||||||
|
cnpj: data.cnpj || '',
|
||||||
|
description: data.description || '',
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
} catch (err) {
|
||||||
|
if (err.details === ErrorCodes.CUSTOMER.NOT_FOUND)
|
||||||
|
throw new HttpException(err.details, HttpStatus.NOT_FOUND);
|
||||||
|
else throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async getOrganizationInfo(customerId: string) {
|
||||||
|
try {
|
||||||
|
const customerResponse = await lastValueFrom(
|
||||||
|
this.customerService.CustomerFindOneById({ id: customerId })
|
||||||
|
);
|
||||||
|
|
||||||
|
const customer = customerResponse.customer;
|
||||||
|
|
||||||
|
return {
|
||||||
|
companyName: customer.companyName || '',
|
||||||
|
companySite: customer.companySite || '',
|
||||||
|
domain: customer.domain || '',
|
||||||
|
cnpj: customer.cnpj || '',
|
||||||
|
description: customer.description || ''
|
||||||
|
};
|
||||||
|
} catch (err) {
|
||||||
|
if (err.details === ErrorCodes.CUSTOMER.NOT_FOUND)
|
||||||
|
throw new HttpException(err.details, HttpStatus.NOT_FOUND);
|
||||||
|
else throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||||
|
|
||||||
|
export class OrganizationUpdateRequest {
|
||||||
|
@ApiProperty()
|
||||||
|
name: string;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
companySite: string;
|
||||||
|
@ApiProperty()
|
||||||
|
domain: string;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
info: string;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
cnpj: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OrganizationResponse {
|
||||||
|
@ApiProperty()
|
||||||
|
name: string;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
companySite: string;
|
||||||
|
@ApiProperty()
|
||||||
|
domain: string;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
info: string;
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
cnpj: string;
|
||||||
|
}
|
||||||
@@ -43,7 +43,7 @@ export class User {
|
|||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
companyName?: string;
|
companyName?: string;
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
companySite?: string;
|
personalSite?: string;
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
customer?: Customer;
|
customer?: Customer;
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@@ -64,6 +64,8 @@ export class UserNoRolesAndCustomer extends OmitType(UserNoRoles, [
|
|||||||
export class IUserByCustomer extends OmitType(User, ['customer']) {
|
export class IUserByCustomer extends OmitType(User, ['customer']) {
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
permissions?: string[];
|
permissions?: string[];
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
authProvider?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CreateUserReq {
|
export class CreateUserReq {
|
||||||
@@ -117,7 +119,7 @@ export class UpdateUserReq {
|
|||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
bio?: string;
|
bio?: string;
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
companySite?: string;
|
personalSite?: string;
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
companyName?: string;
|
companyName?: string;
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ export class UsersService implements OnModuleInit {
|
|||||||
return { permissions };
|
return { permissions };
|
||||||
});
|
});
|
||||||
res.user.permissions = permissions;
|
res.user.permissions = permissions;
|
||||||
|
res.user.authProvider = process.env.AUTH_PROVIDER || 'cognito';
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +163,7 @@ export class UsersService implements OnModuleInit {
|
|||||||
name: updateUserDTO.name,
|
name: updateUserDTO.name,
|
||||||
bio: updateUserDTO.bio,
|
bio: updateUserDTO.bio,
|
||||||
companyName: updateUserDTO.companyName,
|
companyName: updateUserDTO.companyName,
|
||||||
companySite: updateUserDTO.companySite,
|
personalSite: updateUserDTO.personalSite,
|
||||||
customerId,
|
customerId,
|
||||||
id,
|
id,
|
||||||
metabaseUserId: undefined,
|
metabaseUserId: undefined,
|
||||||
|
|||||||
@@ -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