@loopstack/api 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/controllers/auth.controller.js +1 -1
- package/dist/controllers/auth.controller.js.map +1 -1
- package/dist/controllers/config.controller.js +0 -3
- package/dist/controllers/config.controller.js.map +1 -1
- package/dist/controllers/document.controller.d.ts +3 -3
- package/dist/controllers/document.controller.js +7 -9
- package/dist/controllers/document.controller.js.map +1 -1
- package/dist/controllers/namespace.controller.d.ts +3 -3
- package/dist/controllers/namespace.controller.js +7 -9
- package/dist/controllers/namespace.controller.js.map +1 -1
- package/dist/controllers/pipeline.controller.d.ts +7 -7
- package/dist/controllers/pipeline.controller.js +19 -25
- package/dist/controllers/pipeline.controller.js.map +1 -1
- package/dist/controllers/processor.controller.d.ts +2 -5
- package/dist/controllers/processor.controller.js +6 -22
- package/dist/controllers/processor.controller.js.map +1 -1
- package/dist/controllers/workflow.controller.d.ts +4 -4
- package/dist/controllers/workflow.controller.js +10 -13
- package/dist/controllers/workflow.controller.js.map +1 -1
- package/dist/controllers/workspace.controller.d.ts +7 -7
- package/dist/controllers/workspace.controller.js +20 -25
- package/dist/controllers/workspace.controller.js.map +1 -1
- package/dist/loopstack-api.module.js +4 -2
- package/dist/loopstack-api.module.js.map +1 -1
- package/dist/services/pipeline-api.service.d.ts +3 -2
- package/dist/services/pipeline-api.service.js +13 -20
- package/dist/services/pipeline-api.service.js.map +1 -1
- package/dist/services/processor-api.service.d.ts +4 -10
- package/dist/services/processor-api.service.js +17 -45
- package/dist/services/processor-api.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @loopstack/api
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add AuthModule to framework, Enable Startup Tasks/Schedules, Run Processes via BullMQ, Various Bugfixes
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @loopstack/core@0.5.0
|
|
13
|
+
- @loopstack/shared@0.5.0
|
|
14
|
+
|
|
15
|
+
## 0.4.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Fix bug were extended workspace config would not be mearged for UI config
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @loopstack/core@0.4.2
|
|
22
|
+
- @loopstack/shared@0.4.2
|
|
23
|
+
|
|
3
24
|
## 0.4.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -55,7 +55,7 @@ __decorate([
|
|
|
55
55
|
exports.AuthController = AuthController = __decorate([
|
|
56
56
|
(0, swagger_1.ApiTags)('api/v1/auth'),
|
|
57
57
|
(0, swagger_1.ApiExtraModels)(user_dto_1.UserDto),
|
|
58
|
-
(0, common_1.Controller)('api/v1/auth'),
|
|
58
|
+
(0, common_1.Controller)('api/v1/auth-old'),
|
|
59
59
|
__metadata("design:paramtypes", [auth_service_1.AuthService])
|
|
60
60
|
], AuthController);
|
|
61
61
|
//# sourceMappingURL=auth.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../src/controllers/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,2DAAuD;AACvD,6CAOyB;AACzB,+CAA2C;AAC3C,6DAAwD;AAKjD,IAAM,cAAc,GAApB,MAAM,cAAc;IACL;IAApB,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAmB1C,AAAN,KAAK,CAAC,KAAK,CACE,GAAsB,EACA,GAAY;QAE7C,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,E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kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,aAAI,EAAC,WAAW,CAAC;IACjB,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,uBAAuB;QAChC,WAAW,EAAE,yDAAyD;KACvE,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,mBAAU,CAAC,EAAE;QACrB,WAAW,EAAE,iCAAiC;QAC9C,IAAI,EAAE,kBAAO;KACd,CAAC;IACD,IAAA,iCAAuB,EAAC;QACvB,WAAW,EAAE,8CAA8C;KAC5D,CAAC;IACD,IAAA,wCAA8B,EAAC;QAC9B,WAAW,EAAE,sDAAsD;KACpE,CAAC;IAEC,WAAA,IAAA,gBAAO,GAAE,CAAA;IACT,WAAA,IAAA,iBAAQ,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;;6CAAM,kBAAO;;2CAG9C;yBAzBU,cAAc;IAH1B,IAAA,iBAAO,EAAC,aAAa,CAAC;IACtB,IAAA,wBAAc,EAAC,kBAAO,CAAC;IACvB,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEK,0BAAW;GADjC,cAAc,CA0B1B"}
|
|
@@ -19,7 +19,6 @@ const core_1 = require("@loopstack/core");
|
|
|
19
19
|
const class_transformer_1 = require("class-transformer");
|
|
20
20
|
const pipeline_config_dto_1 = require("../dtos/pipeline-config.dto");
|
|
21
21
|
const workspace_config_dto_1 = require("../dtos/workspace-config.dto");
|
|
22
|
-
const jwt_auth_guard_1 = require("../guards/jwt-auth.guard");
|
|
23
22
|
const lodash_1 = require("lodash");
|
|
24
23
|
let ConfigController = class ConfigController {
|
|
25
24
|
configService;
|
|
@@ -53,7 +52,6 @@ __decorate([
|
|
|
53
52
|
(0, swagger_1.ApiOperation)({ summary: 'Get all models available for this workspace' }),
|
|
54
53
|
(0, swagger_1.ApiOkResponse)({ type: workspace_config_dto_1.WorkspaceConfigDto, isArray: true }),
|
|
55
54
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
56
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
57
55
|
__metadata("design:type", Function),
|
|
58
56
|
__metadata("design:paramtypes", []),
|
|
59
57
|
__metadata("design:returntype", Array)
|
|
@@ -70,7 +68,6 @@ __decorate([
|
|
|
70
68
|
}),
|
|
71
69
|
(0, swagger_1.ApiOkResponse)({ type: pipeline_config_dto_1.PipelineConfigDto, isArray: true }),
|
|
72
70
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
73
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
74
71
|
__param(0, (0, common_1.Param)('workspaceName')),
|
|
75
72
|
__metadata("design:type", Function),
|
|
76
73
|
__metadata("design:paramtypes", [String]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.controller.js","sourceRoot":"","sources":["../../src/controllers/config.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAOyB;AACzB,
|
|
1
|
+
{"version":3,"file":"config.controller.js","sourceRoot":"","sources":["../../src/controllers/config.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAOyB;AACzB,2CAMwB;AAExB,0CAAuD;AACvD,yDAAoD;AACpD,qEAAgE;AAChE,uEAAkE;AAClE,mCAAgC;AAMzB,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACP;IAApB,YAAoB,aAAmC;QAAnC,kBAAa,GAAb,aAAa,CAAsB;IAAG,CAAC;IAM3D,iBAAiB;QACf,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAgB,YAAY,CAAC,CAAC;QAC1E,OAAO,IAAA,mCAAe,EAAC,yCAAkB,EAAE,UAAU,EAAE;YACrD,uBAAuB,EAAE,IAAI;SAC9B,CAAC,CAAC;IACL,CAAC;IAaD,2BAA2B,CACD,aAAqB;QAE7C,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAe,WAAW,CAAC,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AAgB;IAJ5B,IAAA,iBAAO,EAAC,eAAe,CAAC;IACxB,IAAA,wBAAc,EAAC,yCAAkB,EAAE,uCAAiB,CAAC;IACrD,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,IAAA,mBAAU,EAAC,eAAe,CAAC;qCAES,2BAAoB;GAD5C,gBAAgB,CA8C5B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ApiRequestType } from '../interfaces/api-request.type';
|
|
2
1
|
import { DocumentApiService } from '../services/document-api.service';
|
|
3
2
|
import { PaginatedDto } from '../dtos/paginated.dto';
|
|
4
3
|
import { DocumentDto } from '../dtos/document.dto';
|
|
5
4
|
import { DocumentItemDto } from '../dtos/document-item.dto';
|
|
5
|
+
import { CurrentUserInterface } from '@loopstack/shared';
|
|
6
6
|
export declare class DocumentController {
|
|
7
7
|
private readonly documentService;
|
|
8
8
|
constructor(documentService: DocumentApiService);
|
|
9
|
-
getDocuments(
|
|
10
|
-
getDocumentById(id: string,
|
|
9
|
+
getDocuments(user: CurrentUserInterface, page?: number, limit?: number, filterParam?: string, sortByParam?: string): Promise<PaginatedDto<DocumentItemDto>>;
|
|
10
|
+
getDocumentById(id: string, user: CurrentUserInterface): Promise<DocumentDto>;
|
|
11
11
|
}
|
|
@@ -22,13 +22,13 @@ const document_dto_1 = require("../dtos/document.dto");
|
|
|
22
22
|
const document_item_dto_1 = require("../dtos/document-item.dto");
|
|
23
23
|
const document_filter_dto_1 = require("../dtos/document-filter.dto");
|
|
24
24
|
const document_sort_by_dto_1 = require("../dtos/document-sort-by.dto");
|
|
25
|
-
const
|
|
25
|
+
const shared_1 = require("@loopstack/shared");
|
|
26
26
|
let DocumentController = class DocumentController {
|
|
27
27
|
documentService;
|
|
28
28
|
constructor(documentService) {
|
|
29
29
|
this.documentService = documentService;
|
|
30
30
|
}
|
|
31
|
-
async getDocuments(
|
|
31
|
+
async getDocuments(user, page, limit, filterParam, sortByParam) {
|
|
32
32
|
let filter = {};
|
|
33
33
|
if (filterParam) {
|
|
34
34
|
try {
|
|
@@ -47,14 +47,14 @@ let DocumentController = class DocumentController {
|
|
|
47
47
|
throw new common_1.BadRequestException('Invalid sortBy format');
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const result = await this.documentService.findAll(
|
|
50
|
+
const result = await this.documentService.findAll(user.userId, filter, sortBy, {
|
|
51
51
|
page,
|
|
52
52
|
limit,
|
|
53
53
|
});
|
|
54
54
|
return paginated_dto_1.PaginatedDto.create(document_item_dto_1.DocumentItemDto, result);
|
|
55
55
|
}
|
|
56
|
-
async getDocumentById(id,
|
|
57
|
-
const document = await this.documentService.findOneById(id,
|
|
56
|
+
async getDocumentById(id, user) {
|
|
57
|
+
const document = await this.documentService.findOneById(id, user.userId);
|
|
58
58
|
return document_dto_1.DocumentDto.create(document);
|
|
59
59
|
}
|
|
60
60
|
};
|
|
@@ -97,8 +97,7 @@ __decorate([
|
|
|
97
97
|
}),
|
|
98
98
|
(0, api_paginated_response_decorator_1.ApiPaginatedResponse)(document_item_dto_1.DocumentItemDto),
|
|
99
99
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
100
|
-
(0,
|
|
101
|
-
__param(0, (0, common_1.Request)()),
|
|
100
|
+
__param(0, (0, shared_1.CurrentUser)()),
|
|
102
101
|
__param(1, (0, common_1.Query)('page', new common_1.ParseIntPipe({ optional: true }))),
|
|
103
102
|
__param(2, (0, common_1.Query)('limit', new common_1.ParseIntPipe({ optional: true }))),
|
|
104
103
|
__param(3, (0, common_1.Query)('filter')),
|
|
@@ -114,9 +113,8 @@ __decorate([
|
|
|
114
113
|
(0, swagger_1.ApiResponse)({ status: 404, description: 'Document not found' }),
|
|
115
114
|
(0, swagger_1.ApiOkResponse)({ type: document_dto_1.DocumentDto }),
|
|
116
115
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
117
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
118
116
|
__param(0, (0, common_1.Param)('id')),
|
|
119
|
-
__param(1, (0,
|
|
117
|
+
__param(1, (0, shared_1.CurrentUser)()),
|
|
120
118
|
__metadata("design:type", Function),
|
|
121
119
|
__metadata("design:paramtypes", [String, Object]),
|
|
122
120
|
__metadata("design:returntype", Promise)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.controller.js","sourceRoot":"","sources":["../../src/controllers/document.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"document.controller.js","sourceRoot":"","sources":["../../src/controllers/document.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,6CASyB;AACzB,2EAAsE;AACtE,yDAAqD;AACrD,qGAAsF;AACtF,uDAAmD;AACnD,iEAA4D;AAC5D,qEAAgE;AAChE,uEAAiE;AACjE,8CAAsE;AAM/D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,eAAmC;QAAnC,oBAAe,GAAf,eAAe,CAAoB;IAAG,CAAC;IA0C9D,AAAN,KAAK,CAAC,YAAY,CACD,IAA0B,EACY,IAAa,EACZ,KAAc,EACnD,WAAoB,EACpB,WAAoB;QAErC,IAAI,MAAM,GAAsB,EAAE,CAAC;QACnC,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAsB,CAAC;YACxD,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,IAAI,4BAAmB,CAAC,uBAAuB,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;QAED,IAAI,MAAM,GAAwB,EAAE,CAAC;QACrC,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAwB,CAAC;YAC1D,CA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C,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,IAAA,mBAAU,EAAC,kBAAkB,CAAC;qCAEiB,yCAAkB;GADrD,kBAAkB,CAgG9B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ApiRequestType } from '../interfaces/api-request.type';
|
|
2
1
|
import { PaginatedDto } from '../dtos/paginated.dto';
|
|
3
2
|
import { NamespaceDto } from '../dtos/namespace.dto';
|
|
4
3
|
import { NamespaceItemDto } from '../dtos/namespace-item.dto';
|
|
5
4
|
import { NamespaceApiService } from '../services/namespace-api.service';
|
|
5
|
+
import { CurrentUserInterface } from '@loopstack/shared';
|
|
6
6
|
export declare class NamespaceController {
|
|
7
7
|
private readonly namespaceApiService;
|
|
8
8
|
constructor(namespaceApiService: NamespaceApiService);
|
|
9
|
-
getWorkflows(
|
|
10
|
-
getWorkflowById(id: string,
|
|
9
|
+
getWorkflows(user: CurrentUserInterface, page?: number, limit?: number, filterParam?: string, sortByParam?: string): Promise<PaginatedDto<NamespaceItemDto>>;
|
|
10
|
+
getWorkflowById(id: string, user: CurrentUserInterface): Promise<NamespaceDto>;
|
|
11
11
|
}
|
|
@@ -22,13 +22,13 @@ const namespace_item_dto_1 = require("../dtos/namespace-item.dto");
|
|
|
22
22
|
const namespace_filter_dto_1 = require("../dtos/namespace-filter.dto");
|
|
23
23
|
const namespace_sort_by_dto_1 = require("../dtos/namespace-sort-by.dto");
|
|
24
24
|
const namespace_api_service_1 = require("../services/namespace-api.service");
|
|
25
|
-
const
|
|
25
|
+
const shared_1 = require("@loopstack/shared");
|
|
26
26
|
let NamespaceController = class NamespaceController {
|
|
27
27
|
namespaceApiService;
|
|
28
28
|
constructor(namespaceApiService) {
|
|
29
29
|
this.namespaceApiService = namespaceApiService;
|
|
30
30
|
}
|
|
31
|
-
async getWorkflows(
|
|
31
|
+
async getWorkflows(user, page, limit, filterParam, sortByParam) {
|
|
32
32
|
let filter = {};
|
|
33
33
|
if (filterParam) {
|
|
34
34
|
try {
|
|
@@ -47,14 +47,14 @@ let NamespaceController = class NamespaceController {
|
|
|
47
47
|
throw new common_1.BadRequestException('Invalid sortBy format');
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const result = await this.namespaceApiService.findAll(
|
|
50
|
+
const result = await this.namespaceApiService.findAll(user.userId, filter, sortBy, {
|
|
51
51
|
page,
|
|
52
52
|
limit,
|
|
53
53
|
});
|
|
54
54
|
return paginated_dto_1.PaginatedDto.create(namespace_item_dto_1.NamespaceItemDto, result);
|
|
55
55
|
}
|
|
56
|
-
async getWorkflowById(id,
|
|
57
|
-
const workflow = await this.namespaceApiService.findOneById(id,
|
|
56
|
+
async getWorkflowById(id, user) {
|
|
57
|
+
const workflow = await this.namespaceApiService.findOneById(id, user.userId);
|
|
58
58
|
return namespace_dto_1.NamespaceDto.create(workflow);
|
|
59
59
|
}
|
|
60
60
|
};
|
|
@@ -97,8 +97,7 @@ __decorate([
|
|
|
97
97
|
}),
|
|
98
98
|
(0, api_paginated_response_decorator_1.ApiPaginatedResponse)(namespace_item_dto_1.NamespaceItemDto),
|
|
99
99
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
100
|
-
(0,
|
|
101
|
-
__param(0, (0, common_1.Request)()),
|
|
100
|
+
__param(0, (0, shared_1.CurrentUser)()),
|
|
102
101
|
__param(1, (0, common_1.Query)('page', new common_1.ParseIntPipe({ optional: true }))),
|
|
103
102
|
__param(2, (0, common_1.Query)('limit', new common_1.ParseIntPipe({ optional: true }))),
|
|
104
103
|
__param(3, (0, common_1.Query)('filter')),
|
|
@@ -118,9 +117,8 @@ __decorate([
|
|
|
118
117
|
(0, swagger_1.ApiResponse)({ status: 404, description: 'Namespace not found' }),
|
|
119
118
|
(0, swagger_1.ApiOkResponse)({ type: namespace_dto_1.NamespaceDto }),
|
|
120
119
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
121
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
122
120
|
__param(0, (0, common_1.Param)('id')),
|
|
123
|
-
__param(1, (0,
|
|
121
|
+
__param(1, (0, shared_1.CurrentUser)()),
|
|
124
122
|
__metadata("design:type", Function),
|
|
125
123
|
__metadata("design:paramtypes", [String, Object]),
|
|
126
124
|
__metadata("design:returntype", Promise)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace.controller.js","sourceRoot":"","sources":["../../src/controllers/namespace.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"namespace.controller.js","sourceRoot":"","sources":["../../src/controllers/namespace.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,6CASyB;AACzB,yDAAqD;AACrD,qGAAsF;AACtF,yDAAqD;AACrD,mEAA8D;AAC9D,uEAAkE;AAClE,yEAAmE;AACnE,6EAAwE;AACxE,8CAAsE;AAM/D,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACD;IAA7B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IA0CnE,AAAN,KAAK,CAAC,YAAY,CACD,IAA0B,EACY,IAAa,EACZ,KAAc,EACnD,WAAoB,EACpB,WAAoB;QAErC,IAAI,MAAM,GAAuB,EAAE,CAAC;QACpC,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAuB,CAAC;YACzD,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,IAAI,4BAAmB,CAAC,uBAAuB,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;QAED,IAAI,MAAM,GAAyB,EAAE,CAAC;QACtC,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAyB,CAAC;YAC3D,CAA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,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,IAAA,mBAAU,EAAC,mBAAmB,CAAC;qCAEoB,2CAAmB;GAD1D,mBAAmB,CAuG/B"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ApiRequestType } from '../interfaces/api-request.type';
|
|
2
1
|
import { PipelineApiService } from '../services/pipeline-api.service';
|
|
3
2
|
import { PipelineUpdateDto } from '../dtos/pipeline-update.dto';
|
|
4
3
|
import { PipelineCreateDto } from '../dtos/pipeline-create.dto';
|
|
5
4
|
import { PaginatedDto } from '../dtos/paginated.dto';
|
|
6
5
|
import { PipelineDto } from '../dtos/pipeline.dto';
|
|
7
6
|
import { PipelineItemDto } from '../dtos/pipeline-item.dto';
|
|
7
|
+
import { CurrentUserInterface } from '@loopstack/shared';
|
|
8
8
|
export declare class PipelineController {
|
|
9
9
|
private readonly pipelineApiService;
|
|
10
10
|
constructor(pipelineApiService: PipelineApiService);
|
|
11
|
-
getPipelines(
|
|
12
|
-
getPipelineById(id: string,
|
|
13
|
-
createPipeline(pipelineCreateDto: PipelineCreateDto,
|
|
14
|
-
updatePipeline(id: string, pipelineUpdateDto: PipelineUpdateDto,
|
|
15
|
-
deletePipeline(id: string,
|
|
11
|
+
getPipelines(user: CurrentUserInterface, page?: number, limit?: number, filterParam?: string, sortByParam?: string, search?: string, searchColumnsParam?: string): Promise<PaginatedDto<PipelineItemDto>>;
|
|
12
|
+
getPipelineById(id: string, user: CurrentUserInterface): Promise<PipelineDto>;
|
|
13
|
+
createPipeline(pipelineCreateDto: PipelineCreateDto, user: CurrentUserInterface): Promise<PipelineDto>;
|
|
14
|
+
updatePipeline(id: string, pipelineUpdateDto: PipelineUpdateDto, user: CurrentUserInterface): Promise<PipelineDto>;
|
|
15
|
+
deletePipeline(id: string, user: CurrentUserInterface): Promise<void>;
|
|
16
16
|
batchDeletePipelines(batchDeleteDto: {
|
|
17
17
|
ids: string[];
|
|
18
|
-
},
|
|
18
|
+
}, user: CurrentUserInterface): Promise<{
|
|
19
19
|
deleted: string[];
|
|
20
20
|
failed: Array<{
|
|
21
21
|
id: string;
|
|
@@ -24,13 +24,13 @@ const pipeline_dto_1 = require("../dtos/pipeline.dto");
|
|
|
24
24
|
const pipeline_item_dto_1 = require("../dtos/pipeline-item.dto");
|
|
25
25
|
const pipeline_sort_by_dto_1 = require("../dtos/pipeline-sort-by.dto");
|
|
26
26
|
const pipeline_filter_dto_1 = require("../dtos/pipeline-filter.dto");
|
|
27
|
-
const
|
|
27
|
+
const shared_1 = require("@loopstack/shared");
|
|
28
28
|
let PipelineController = class PipelineController {
|
|
29
29
|
pipelineApiService;
|
|
30
30
|
constructor(pipelineApiService) {
|
|
31
31
|
this.pipelineApiService = pipelineApiService;
|
|
32
32
|
}
|
|
33
|
-
async getPipelines(
|
|
33
|
+
async getPipelines(user, page, limit, filterParam, sortByParam, search, searchColumnsParam) {
|
|
34
34
|
let filter = {};
|
|
35
35
|
if (filterParam) {
|
|
36
36
|
try {
|
|
@@ -58,7 +58,7 @@ let PipelineController = class PipelineController {
|
|
|
58
58
|
throw new common_1.BadRequestException('Invalid searchColumns format');
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
const result = await this.pipelineApiService.findAll(
|
|
61
|
+
const result = await this.pipelineApiService.findAll(user.userId, filter, sortBy, {
|
|
62
62
|
page,
|
|
63
63
|
limit,
|
|
64
64
|
}, {
|
|
@@ -67,23 +67,23 @@ let PipelineController = class PipelineController {
|
|
|
67
67
|
});
|
|
68
68
|
return paginated_dto_1.PaginatedDto.create(pipeline_item_dto_1.PipelineItemDto, result);
|
|
69
69
|
}
|
|
70
|
-
async getPipelineById(id,
|
|
71
|
-
const pipeline = await this.pipelineApiService.findOneById(id,
|
|
70
|
+
async getPipelineById(id, user) {
|
|
71
|
+
const pipeline = await this.pipelineApiService.findOneById(id, user.userId);
|
|
72
72
|
return pipeline_dto_1.PipelineDto.create(pipeline);
|
|
73
73
|
}
|
|
74
|
-
async createPipeline(pipelineCreateDto,
|
|
75
|
-
const pipeline = await this.pipelineApiService.create(pipelineCreateDto,
|
|
74
|
+
async createPipeline(pipelineCreateDto, user) {
|
|
75
|
+
const pipeline = await this.pipelineApiService.create(pipelineCreateDto, user.userId);
|
|
76
76
|
return pipeline_dto_1.PipelineDto.create(pipeline);
|
|
77
77
|
}
|
|
78
|
-
async updatePipeline(id, pipelineUpdateDto,
|
|
79
|
-
const pipeline = await this.pipelineApiService.update(id, pipelineUpdateDto,
|
|
78
|
+
async updatePipeline(id, pipelineUpdateDto, user) {
|
|
79
|
+
const pipeline = await this.pipelineApiService.update(id, pipelineUpdateDto, user.userId);
|
|
80
80
|
return pipeline_dto_1.PipelineDto.create(pipeline);
|
|
81
81
|
}
|
|
82
|
-
async deletePipeline(id,
|
|
83
|
-
await this.pipelineApiService.delete(id,
|
|
82
|
+
async deletePipeline(id, user) {
|
|
83
|
+
await this.pipelineApiService.delete(id, user.userId);
|
|
84
84
|
}
|
|
85
|
-
async batchDeletePipelines(batchDeleteDto,
|
|
86
|
-
return await this.pipelineApiService.batchDelete(batchDeleteDto.ids,
|
|
85
|
+
async batchDeletePipelines(batchDeleteDto, user) {
|
|
86
|
+
return await this.pipelineApiService.batchDelete(batchDeleteDto.ids, user.userId);
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
exports.PipelineController = PipelineController;
|
|
@@ -139,8 +139,7 @@ __decorate([
|
|
|
139
139
|
description: 'JSON string array of columns to search in (defaults to title and type if not specified)',
|
|
140
140
|
}),
|
|
141
141
|
(0, api_paginated_response_decorator_1.ApiPaginatedResponse)(pipeline_item_dto_1.PipelineItemDto),
|
|
142
|
-
(0,
|
|
143
|
-
__param(0, (0, common_1.Request)()),
|
|
142
|
+
__param(0, (0, shared_1.CurrentUser)()),
|
|
144
143
|
__param(1, (0, common_1.Query)('page', new common_1.ParseIntPipe({ optional: true }))),
|
|
145
144
|
__param(2, (0, common_1.Query)('limit', new common_1.ParseIntPipe({ optional: true }))),
|
|
146
145
|
__param(3, (0, common_1.Query)('filter')),
|
|
@@ -158,9 +157,8 @@ __decorate([
|
|
|
158
157
|
(0, swagger_1.ApiResponse)({ status: 404, description: 'Pipeline not found' }),
|
|
159
158
|
(0, swagger_1.ApiOkResponse)({ type: pipeline_dto_1.PipelineDto }),
|
|
160
159
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
161
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
162
160
|
__param(0, (0, common_1.Param)('id')),
|
|
163
|
-
__param(1, (0,
|
|
161
|
+
__param(1, (0, shared_1.CurrentUser)()),
|
|
164
162
|
__metadata("design:type", Function),
|
|
165
163
|
__metadata("design:paramtypes", [String, Object]),
|
|
166
164
|
__metadata("design:returntype", Promise)
|
|
@@ -171,9 +169,8 @@ __decorate([
|
|
|
171
169
|
(0, swagger_1.ApiBody)({ type: pipeline_create_dto_1.PipelineCreateDto, description: 'Pipeline data' }),
|
|
172
170
|
(0, swagger_1.ApiOkResponse)({ type: pipeline_dto_1.PipelineDto }),
|
|
173
171
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
174
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
175
172
|
__param(0, (0, common_1.Body)()),
|
|
176
|
-
__param(1, (0,
|
|
173
|
+
__param(1, (0, shared_1.CurrentUser)()),
|
|
177
174
|
__metadata("design:type", Function),
|
|
178
175
|
__metadata("design:paramtypes", [pipeline_create_dto_1.PipelineCreateDto, Object]),
|
|
179
176
|
__metadata("design:returntype", Promise)
|
|
@@ -186,10 +183,9 @@ __decorate([
|
|
|
186
183
|
(0, swagger_1.ApiResponse)({ status: 404, description: 'Pipeline not found' }),
|
|
187
184
|
(0, swagger_1.ApiOkResponse)({ type: pipeline_dto_1.PipelineDto }),
|
|
188
185
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
189
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
190
186
|
__param(0, (0, common_1.Param)('id')),
|
|
191
187
|
__param(1, (0, common_1.Body)()),
|
|
192
|
-
__param(2, (0,
|
|
188
|
+
__param(2, (0, shared_1.CurrentUser)()),
|
|
193
189
|
__metadata("design:type", Function),
|
|
194
190
|
__metadata("design:paramtypes", [String, pipeline_update_dto_1.PipelineUpdateDto, Object]),
|
|
195
191
|
__metadata("design:returntype", Promise)
|
|
@@ -201,9 +197,8 @@ __decorate([
|
|
|
201
197
|
(0, swagger_1.ApiResponse)({ status: 204, description: 'Pipeline deleted successfully' }),
|
|
202
198
|
(0, swagger_1.ApiResponse)({ status: 404, description: 'Pipeline not found' }),
|
|
203
199
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
204
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
205
200
|
__param(0, (0, common_1.Param)('id')),
|
|
206
|
-
__param(1, (0,
|
|
201
|
+
__param(1, (0, shared_1.CurrentUser)()),
|
|
207
202
|
__metadata("design:type", Function),
|
|
208
203
|
__metadata("design:paramtypes", [String, Object]),
|
|
209
204
|
__metadata("design:returntype", Promise)
|
|
@@ -255,9 +250,8 @@ __decorate([
|
|
|
255
250
|
}),
|
|
256
251
|
(0, swagger_1.ApiResponse)({ status: 400, description: 'Invalid request body' }),
|
|
257
252
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
258
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
259
253
|
__param(0, (0, common_1.Body)()),
|
|
260
|
-
__param(1, (0,
|
|
254
|
+
__param(1, (0, shared_1.CurrentUser)()),
|
|
261
255
|
__metadata("design:type", Function),
|
|
262
256
|
__metadata("design:paramtypes", [Object, Object]),
|
|
263
257
|
__metadata("design:returntype", Promise)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.controller.js","sourceRoot":"","sources":["../../src/controllers/pipeline.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"pipeline.controller.js","sourceRoot":"","sources":["../../src/controllers/pipeline.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAcwB;AACxB,6CAUyB;AACzB,2EAAsE;AACtE,qEAAgE;AAChE,qEAAgE;AAChE,yDAAqD;AACrD,qGAAsF;AACtF,uDAAmD;AACnD,iEAA4D;AAC5D,uEAAiE;AACjE,qEAAgE;AAChE,8CAAuF;AAWhF,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACA;IAA7B,YAA6B,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IA0DjE,AAAN,KAAK,CAAC,YAAY,CACD,IAA0B,EACY,IAAa,EACZ,KAAc,EACnD,WAAoB,EACpB,WAAoB,EACpB,MAAe,EACR,kBAA2B;QAEnD,IAAI,MAAM,GAAsB,EAAE,CAAC;QACnC,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAsB,CAAC;YACxD,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,IAAI,4BAAmB,CAAC,uBAAuB,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;QAED,IAAI,MAAM,GAAwB,EAAE,CAAC;QACrC,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAwB,CAAC;YAC1D,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,IAAI,4BAAmB,CAAC,uBAAuB,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;QAED,IAAI,aAAa,GAA8B,EAAE,CAAC;QAClD,IAAI,kBAAkB,EAAE,CAAC;YACvB,IAAI,CAAC;gBACH,aAAa,GAAG,IAAI,CAAC,KAAK,CACxB,kBAAkB,CACU,CAAC;YACjC,C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AE,GAAG,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACjE,IAAA,iCAAuB,GAAE;IAEvB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,oBAAW,GAAE,CAAA;;;;8DASf;6BAxPU,kBAAkB;IAT9B,IAAA,iBAAO,EAAC,kBAAkB,CAAC;IAC3B,IAAA,wBAAc,EACb,0BAAW,EACX,mCAAe,EACf,uCAAiB,EACjB,uCAAiB,CAClB;IACA,IAAA,iBAAQ,EAAC,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,IAAA,mBAAU,EAAC,kBAAkB,CAAC;qCAEoB,yCAAkB;GADxD,kBAAkB,CAyP9B"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { ApiRequestType } from '../interfaces/api-request.type';
|
|
2
1
|
import { ProcessorApiService } from '../services/processor-api.service';
|
|
3
2
|
import { RunPipelinePayloadDto } from '../dtos/run-pipeline-payload.dto';
|
|
4
|
-
|
|
5
|
-
force?: boolean;
|
|
6
|
-
}
|
|
3
|
+
import { CurrentUserInterface } from '@loopstack/shared';
|
|
7
4
|
export declare class ProcessorController {
|
|
8
5
|
private readonly processorApiService;
|
|
9
6
|
constructor(processorApiService: ProcessorApiService);
|
|
10
|
-
runPipeline(pipelineId: string, payload: RunPipelinePayloadDto,
|
|
7
|
+
runPipeline(pipelineId: string, payload: RunPipelinePayloadDto, user: CurrentUserInterface): void;
|
|
11
8
|
}
|
|
@@ -12,33 +12,19 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ProcessorController =
|
|
15
|
+
exports.ProcessorController = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const swagger_1 = require("@nestjs/swagger");
|
|
18
18
|
const processor_api_service_1 = require("../services/processor-api.service");
|
|
19
|
-
const class_validator_1 = require("class-validator");
|
|
20
|
-
const class_transformer_1 = require("class-transformer");
|
|
21
19
|
const run_pipeline_payload_dto_1 = require("../dtos/run-pipeline-payload.dto");
|
|
22
|
-
const
|
|
23
|
-
class RunPipelineQueryParams {
|
|
24
|
-
force;
|
|
25
|
-
}
|
|
26
|
-
exports.RunPipelineQueryParams = RunPipelineQueryParams;
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, class_validator_1.IsOptional)(),
|
|
29
|
-
(0, class_validator_1.IsBoolean)(),
|
|
30
|
-
(0, class_transformer_1.Type)(() => Boolean),
|
|
31
|
-
__metadata("design:type", Boolean)
|
|
32
|
-
], RunPipelineQueryParams.prototype, "force", void 0);
|
|
20
|
+
const shared_1 = require("@loopstack/shared");
|
|
33
21
|
let ProcessorController = class ProcessorController {
|
|
34
22
|
processorApiService;
|
|
35
23
|
constructor(processorApiService) {
|
|
36
24
|
this.processorApiService = processorApiService;
|
|
37
25
|
}
|
|
38
|
-
runPipeline(pipelineId, payload,
|
|
39
|
-
this.processorApiService.processPipeline(pipelineId,
|
|
40
|
-
force: !!queryParams.force,
|
|
41
|
-
});
|
|
26
|
+
runPipeline(pipelineId, payload, user) {
|
|
27
|
+
this.processorApiService.processPipeline(pipelineId, user.userId, payload ?? {});
|
|
42
28
|
}
|
|
43
29
|
};
|
|
44
30
|
exports.ProcessorController = ProcessorController;
|
|
@@ -80,13 +66,11 @@ __decorate([
|
|
|
80
66
|
description: 'Pipeline not found',
|
|
81
67
|
}),
|
|
82
68
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
83
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
84
69
|
__param(0, (0, common_1.Param)('pipelineId')),
|
|
85
70
|
__param(1, (0, common_1.Body)()),
|
|
86
|
-
__param(2, (0,
|
|
87
|
-
__param(3, (0, common_1.Query)()),
|
|
71
|
+
__param(2, (0, shared_1.CurrentUser)()),
|
|
88
72
|
__metadata("design:type", Function),
|
|
89
|
-
__metadata("design:paramtypes", [String, run_pipeline_payload_dto_1.RunPipelinePayloadDto, Object
|
|
73
|
+
__metadata("design:paramtypes", [String, run_pipeline_payload_dto_1.RunPipelinePayloadDto, Object]),
|
|
90
74
|
__metadata("design:returntype", void 0)
|
|
91
75
|
], ProcessorController.prototype, "runPipeline", null);
|
|
92
76
|
exports.ProcessorController = ProcessorController = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor.controller.js","sourceRoot":"","sources":["../../src/controllers/processor.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"processor.controller.js","sourceRoot":"","sources":["../../src/controllers/processor.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAKwB;AACxB,6CAQyB;AACzB,6EAAwE;AACxE,+EAAyE;AACzE,8CAAsE;AAO/D,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IACD;IAA7B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IA2CzE,WAAW,CACY,UAAkB,EAC/B,OAA8B,EACvB,IAA0B;QAEzC,IAAI,CAAC,mBAAmB,CAAC,eAAe,CACtC,UAAU,EACV,IAAI,CAAC,MAAM,EACX,OAAO,IAAI,EAAE,CACd,CAAC;IACJ,CAAC;CACF,CAAA;AAvDY,kDAAmB;AA4C9B;IAtCC,IAAA,aAAI,EAAC,iBAAiB,CAAC;IACvB,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,gBAAgB;QACzB,WAAW,EACT,2EAA2E;KAC9E,CAAC;IACD,IAAA,kBAAQ,EAAC;QACR,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,8CAA8C;QAC3D,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,0BAA0B;KACpC,CAAC;IACD,IAAA,kBAAQ,EAAC;QACR,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,sDAAsD;QACnE,OAAO,EAAE,KAAK;KACf,CAAC;IACD,IAAA,iBAAO,EAAC;QACP,IAAI,EAAE,gDAAqB;QAC3B,WAAW,EAAE,mDAAmD;QAChE,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,0CAA0C;KACxD,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,4BAA4B;KAC1C,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,oBAAoB;KAClC,CAAC;IACD,IAAA,iCAAuB,GAAE;IAEvB,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;IACnB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,oBAAW,GAAE,CAAA;;6CADG,gDAAqB;;sDAQvC;8BAtDU,mBAAmB;IAF/B,IAAA,iBAAO,EAAC,kBAAkB,CAAC;IAC3B,IAAA,mBAAU,EAAC,kBAAkB,CAAC;qCAEqB,2CAAmB;GAD1D,mBAAmB,CAuD/B"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ApiRequestType } from '../interfaces/api-request.type';
|
|
2
1
|
import { WorkflowApiService } from '../services/workflow-api.service';
|
|
3
2
|
import { PaginatedDto } from '../dtos/paginated.dto';
|
|
4
3
|
import { WorkflowDto } from '../dtos/workflow.dto';
|
|
5
4
|
import { WorkflowItemDto } from '../dtos/workflow-item.dto';
|
|
5
|
+
import { CurrentUserInterface } from '@loopstack/shared';
|
|
6
6
|
export declare class WorkflowController {
|
|
7
7
|
private readonly workflowService;
|
|
8
8
|
constructor(workflowService: WorkflowApiService);
|
|
9
|
-
getWorkflows(
|
|
10
|
-
getWorkflowById(id: string,
|
|
11
|
-
deleteWorkflow(id: string,
|
|
9
|
+
getWorkflows(user: CurrentUserInterface, page?: number, limit?: number, filterParam?: string, sortByParam?: string): Promise<PaginatedDto<WorkflowItemDto>>;
|
|
10
|
+
getWorkflowById(id: string, user: CurrentUserInterface): Promise<WorkflowDto>;
|
|
11
|
+
deleteWorkflow(id: string, user: CurrentUserInterface): Promise<void>;
|
|
12
12
|
}
|
|
@@ -22,13 +22,13 @@ const workflow_dto_1 = require("../dtos/workflow.dto");
|
|
|
22
22
|
const workflow_item_dto_1 = require("../dtos/workflow-item.dto");
|
|
23
23
|
const workflow_filter_dto_1 = require("../dtos/workflow-filter.dto");
|
|
24
24
|
const workflow_sort_by_dto_1 = require("../dtos/workflow-sort-by.dto");
|
|
25
|
-
const
|
|
25
|
+
const shared_1 = require("@loopstack/shared");
|
|
26
26
|
let WorkflowController = class WorkflowController {
|
|
27
27
|
workflowService;
|
|
28
28
|
constructor(workflowService) {
|
|
29
29
|
this.workflowService = workflowService;
|
|
30
30
|
}
|
|
31
|
-
async getWorkflows(
|
|
31
|
+
async getWorkflows(user, page, limit, filterParam, sortByParam) {
|
|
32
32
|
let filter = {};
|
|
33
33
|
if (filterParam) {
|
|
34
34
|
try {
|
|
@@ -47,18 +47,18 @@ let WorkflowController = class WorkflowController {
|
|
|
47
47
|
throw new common_1.BadRequestException('Invalid sortBy format');
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const result = await this.workflowService.findAll(
|
|
50
|
+
const result = await this.workflowService.findAll(user.userId, filter, sortBy, {
|
|
51
51
|
page,
|
|
52
52
|
limit,
|
|
53
53
|
});
|
|
54
54
|
return paginated_dto_1.PaginatedDto.create(workflow_item_dto_1.WorkflowItemDto, result);
|
|
55
55
|
}
|
|
56
|
-
async getWorkflowById(id,
|
|
57
|
-
const workflow = await this.workflowService.findOneById(id,
|
|
56
|
+
async getWorkflowById(id, user) {
|
|
57
|
+
const workflow = await this.workflowService.findOneById(id, user.userId);
|
|
58
58
|
return workflow_dto_1.WorkflowDto.create(workflow);
|
|
59
59
|
}
|
|
60
|
-
async deleteWorkflow(id,
|
|
61
|
-
await this.workflowService.delete(id,
|
|
60
|
+
async deleteWorkflow(id, user) {
|
|
61
|
+
await this.workflowService.delete(id, user.userId);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
exports.WorkflowController = WorkflowController;
|
|
@@ -100,8 +100,7 @@ __decorate([
|
|
|
100
100
|
}),
|
|
101
101
|
(0, api_paginated_response_decorator_1.ApiPaginatedResponse)(workflow_item_dto_1.WorkflowItemDto),
|
|
102
102
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
103
|
-
(0,
|
|
104
|
-
__param(0, (0, common_1.Request)()),
|
|
103
|
+
__param(0, (0, shared_1.CurrentUser)()),
|
|
105
104
|
__param(1, (0, common_1.Query)('page', new common_1.ParseIntPipe({ optional: true }))),
|
|
106
105
|
__param(2, (0, common_1.Query)('limit', new common_1.ParseIntPipe({ optional: true }))),
|
|
107
106
|
__param(3, (0, common_1.Query)('filter')),
|
|
@@ -117,9 +116,8 @@ __decorate([
|
|
|
117
116
|
(0, swagger_1.ApiResponse)({ status: 404, description: 'Workflow not found' }),
|
|
118
117
|
(0, swagger_1.ApiOkResponse)({ type: workflow_dto_1.WorkflowDto }),
|
|
119
118
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
120
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
121
119
|
__param(0, (0, common_1.Param)('id')),
|
|
122
|
-
__param(1, (0,
|
|
120
|
+
__param(1, (0, shared_1.CurrentUser)()),
|
|
123
121
|
__metadata("design:type", Function),
|
|
124
122
|
__metadata("design:paramtypes", [String, Object]),
|
|
125
123
|
__metadata("design:returntype", Promise)
|
|
@@ -131,9 +129,8 @@ __decorate([
|
|
|
131
129
|
(0, swagger_1.ApiResponse)({ status: 204, description: 'Workflow deleted successfully' }),
|
|
132
130
|
(0, swagger_1.ApiResponse)({ status: 404, description: 'Workflow not found' }),
|
|
133
131
|
(0, swagger_1.ApiUnauthorizedResponse)(),
|
|
134
|
-
(0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
|
|
135
132
|
__param(0, (0, common_1.Param)('id')),
|
|
136
|
-
__param(1, (0,
|
|
133
|
+
__param(1, (0, shared_1.CurrentUser)()),
|
|
137
134
|
__metadata("design:type", Function),
|
|
138
135
|
__metadata("design:paramtypes", [String, Object]),
|
|
139
136
|
__metadata("design:returntype", Promise)
|