mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-24 07:29:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7781298e6e | ||
|
|
2c00d3249a | ||
|
|
cd7c7d538f | ||
|
|
a07247d538 | ||
|
|
153ba1a98b | ||
|
|
46519323f8 | ||
|
|
a51d52d68e | ||
|
|
555ff2eda9 | ||
|
|
e52af6844b |
@@ -37,9 +37,8 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
#new_release_published: ${{ steps.semantic.outputs.last_release_version != steps.semantic.outputs.new_release_version }}
|
#new_release_published: ${{ steps.semantic.outputs.last_release_version != steps.semantic.outputs.new_release_version }}
|
||||||
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
|
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
|
||||||
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
|
#new_release_version: ${{ steps.semantic.outputs.new_release_version }}
|
||||||
test: ${{ (steps.semantic.outputs.new_release_published == 'true' && steps.semantic.outputs.new_release_version) || (github.event_name == 'workflow_dispatch' && '0.0.0') }}
|
new_release_version: ${{ (steps.semantic.outputs.new_release_published == 'true' && steps.semantic.outputs.new_release_version) || (github.event_name == 'workflow_dispatch' && '0.0.0') }}
|
||||||
testt: ${{ (needs.semantic_release.outputs.new_release_published == 'true' && needs.semantic_release.outputs.new_release_version) || '1.0.0' }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -61,18 +60,18 @@ jobs:
|
|||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
if: ${{ (github.event_name != 'workflow_dispatch' && needs.semantic_release.outputs.new_release_published == 'true') || 'true' }}
|
if: ${{ github.event_name == 'workflow_dispatch' || needs.semantic_release.outputs.new_release_published == 'true' }}
|
||||||
needs: [extract_environment, semantic_release]
|
needs: [extract_environment, semantic_release]
|
||||||
runs-on:
|
runs-on:
|
||||||
[self-hosted, '${{ needs.extract_environment.outputs.environment }}']
|
[self-hosted, '${{ needs.extract_environment.outputs.environment }}']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: print
|
- name: Printing stats
|
||||||
env:
|
env:
|
||||||
EVENT: ${{ github.event_name }}
|
EVENT: ${{ github.event_name }}
|
||||||
IMAGE_TAG: ${{ needs.semantic_release.outputs.test }}
|
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
|
||||||
IMAGE_TAGG: ${{ needs.semantic_release.outputs.testT }}
|
ENV: ${{ needs.extract_environment.outputs.environment }}
|
||||||
run: echo ${IMAGE_TAG} ${IMAGE_TAGG} ${EVENT}
|
run: echo ${GITHUB_REF#refs/heads/}
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|||||||
Generated
+7
-7
@@ -19,7 +19,7 @@
|
|||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
"@nestjs/schedule": "^1.1.0",
|
"@nestjs/schedule": "^1.1.0",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "2.3.0",
|
"@victorradael/protospack": "2.4.1-1",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"helmet": "^5.0.2",
|
"helmet": "^5.0.2",
|
||||||
@@ -2359,9 +2359,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@victorradael/protospack": {
|
"node_modules/@victorradael/protospack": {
|
||||||
"version": "2.3.0",
|
"version": "2.4.1-1",
|
||||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-2.4.1-1.tgz",
|
||||||
"integrity": "sha512-D2iy5Ff8G2FhH6Grs4MHM0qyqc6EU7iGuD3Bit6Tm6GbHmhDbLER9uBowClPjbPSAQ6jP7WTYxwn/TgDK4lNaA==",
|
"integrity": "sha512-QpdnjOiSil1sPvOVuSC1mu5Z76ZDF1+QbDDe/RI3WVWo39dxARBxOxp7/biRY6KLxTPvSUOQbrBAg7Bfx0ul+A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
}
|
}
|
||||||
@@ -10941,9 +10941,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@victorradael/protospack": {
|
"@victorradael/protospack": {
|
||||||
"version": "2.3.0",
|
"version": "2.4.1-1",
|
||||||
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/@victorradael/protospack/-/protospack-2.4.1-1.tgz",
|
||||||
"integrity": "sha512-D2iy5Ff8G2FhH6Grs4MHM0qyqc6EU7iGuD3Bit6Tm6GbHmhDbLER9uBowClPjbPSAQ6jP7WTYxwn/TgDK4lNaA==",
|
"integrity": "sha512-QpdnjOiSil1sPvOVuSC1mu5Z76ZDF1+QbDDe/RI3WVWo39dxARBxOxp7/biRY6KLxTPvSUOQbrBAg7Bfx0ul+A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"rxjs": "^7.5.5"
|
"rxjs": "^7.5.5"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@
|
|||||||
"@nestjs/platform-express": "^8.4.3",
|
"@nestjs/platform-express": "^8.4.3",
|
||||||
"@nestjs/schedule": "^1.1.0",
|
"@nestjs/schedule": "^1.1.0",
|
||||||
"@nestjs/swagger": "^5.2.1",
|
"@nestjs/swagger": "^5.2.1",
|
||||||
"@victorradael/protospack": "2.3.0",
|
"@victorradael/protospack": "2.4.1",
|
||||||
"axios": "^0.25.0",
|
"axios": "^0.25.0",
|
||||||
"dotenv": "^14.2.0",
|
"dotenv": "^14.2.0",
|
||||||
"helmet": "^5.0.2",
|
"helmet": "^5.0.2",
|
||||||
|
|||||||
@@ -167,21 +167,18 @@ export class AuthClientService implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async refreshAccessToken({
|
async refreshAccessToken({
|
||||||
username,
|
|
||||||
refreshToken,
|
refreshToken,
|
||||||
}: AuthRefreshAccessTokenRequest): Promise<any> {
|
}: AuthRefreshAccessTokenRequest): Promise<any> {
|
||||||
console.log('AuthClientService', 'RefreshAccessToken');
|
console.log('AuthClientService', 'RefreshAccessToken');
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.authService
|
this.authService.refreshAccessToken({ refreshToken }).subscribe({
|
||||||
.refreshAccessToken({ username, refreshToken })
|
next: resolve,
|
||||||
.subscribe({
|
error: (err) => reject(err.details),
|
||||||
next: resolve,
|
complete() {
|
||||||
error: (err) => reject(err.details),
|
console.log('done');
|
||||||
complete() {
|
},
|
||||||
console.log('done');
|
});
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ export class AuthController {
|
|||||||
@Post('refresh-access-token')
|
@Post('refresh-access-token')
|
||||||
@HttpCode(HttpStatus.OK)
|
@HttpCode(HttpStatus.OK)
|
||||||
async refreshAccessToken(
|
async refreshAccessToken(
|
||||||
@Body() { username, refreshToken }: AuthRefreshAccessTokenRequest,
|
@Body() { refreshToken }: AuthRefreshAccessTokenRequest,
|
||||||
) {
|
) {
|
||||||
console.log(`/auth`, 'RefreshAccessToken');
|
console.log(`/auth`, 'RefreshAccessToken');
|
||||||
|
|
||||||
const accessToken = await this.authClient
|
const accessToken = await this.authClient
|
||||||
.refreshAccessToken({ username, refreshToken })
|
.refreshAccessToken({ refreshToken })
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
throw ErrorBuilder(err);
|
throw ErrorBuilder(err);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import {
|
|||||||
Delete,
|
Delete,
|
||||||
Get,
|
Get,
|
||||||
Param,
|
Param,
|
||||||
|
Patch,
|
||||||
Post,
|
Post,
|
||||||
Put,
|
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import { InputsService } from './inputs.service';
|
import { InputsService } from './inputs.service';
|
||||||
import { InputsClientService } from 'src/clients/inputs/client.service';
|
import { InputsClientService } from 'src/clients/inputs/client.service';
|
||||||
@@ -71,7 +71,7 @@ export class InputsController {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put(':id')
|
@Patch(':id')
|
||||||
async update(@Body() updateInputDto: UpdateInputRequest, @Param() params) {
|
async update(@Body() updateInputDto: UpdateInputRequest, @Param() params) {
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
const { info } = updateInputDto;
|
const { info } = updateInputDto;
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import { IIdRequest, Info } from 'src/clients/inputs/interfaces';
|
|||||||
export class InputsService {
|
export class InputsService {
|
||||||
constructor(private inputClient: InputsClientService) {}
|
constructor(private inputClient: InputsClientService) {}
|
||||||
|
|
||||||
|
adjustInputPayload(payload) {
|
||||||
|
return payload?.input_s3 || payload?.input_jdbc;
|
||||||
|
}
|
||||||
async create(@Body() data) {
|
async create(@Body() data) {
|
||||||
try {
|
try {
|
||||||
if (
|
if (
|
||||||
@@ -35,8 +38,12 @@ export class InputsService {
|
|||||||
|
|
||||||
async findAll(body) {
|
async findAll(body) {
|
||||||
try {
|
try {
|
||||||
const findAllInputResponse = await this.inputClient.findAll(body);
|
const findAllInputResponse: any = await this.inputClient.findAll(body);
|
||||||
|
if (findAllInputResponse?.inputs?.length) {
|
||||||
|
findAllInputResponse.inputs = findAllInputResponse.inputs.map((input) =>
|
||||||
|
this.adjustInputPayload(input),
|
||||||
|
);
|
||||||
|
}
|
||||||
return findAllInputResponse;
|
return findAllInputResponse;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
||||||
@@ -45,7 +52,12 @@ export class InputsService {
|
|||||||
|
|
||||||
async findOne(idRequest: IIdRequest) {
|
async findOne(idRequest: IIdRequest) {
|
||||||
try {
|
try {
|
||||||
const findOneInputResponse = await this.inputClient.findOne(idRequest);
|
const findOneInputResponse: any = await this.inputClient.findOne(
|
||||||
|
idRequest,
|
||||||
|
);
|
||||||
|
findOneInputResponse.input = this.adjustInputPayload(
|
||||||
|
findOneInputResponse.input,
|
||||||
|
);
|
||||||
return findOneInputResponse;
|
return findOneInputResponse;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
||||||
@@ -54,12 +66,15 @@ export class InputsService {
|
|||||||
|
|
||||||
async update(id: string, data, info: Info) {
|
async update(id: string, data, info: Info) {
|
||||||
try {
|
try {
|
||||||
const updateInputResponse = await this.inputClient.update({
|
const updateInputResponse: any = await this.inputClient.update({
|
||||||
id,
|
id,
|
||||||
info,
|
info,
|
||||||
...data,
|
...data,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateInputResponse.input = this.adjustInputPayload(
|
||||||
|
updateInputResponse?.input,
|
||||||
|
);
|
||||||
return updateInputResponse;
|
return updateInputResponse;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
throw new HttpException(err.message, HttpStatus.NOT_FOUND);
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user