@owox/backend 0.38.0 → 0.39.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/dist/src/common/helpers/read-bounded-body.helper.d.ts +1 -0
- package/dist/src/common/helpers/read-bounded-body.helper.js +28 -0
- package/dist/src/common/scheduler/system-tasks/system-trigger-type.d.ts +3 -1
- package/dist/src/common/scheduler/system-tasks/system-trigger-type.js +2 -0
- package/dist/src/config/data-source-options.config.d.ts +4 -3
- package/dist/src/config/data-source-options.config.js +10 -3
- package/dist/src/config/plugin-collections-body-parser.config.js +3 -0
- package/dist/src/data-marts/credentials/credential.types.d.ts +26 -2
- package/dist/src/data-marts/credentials/credential.types.js +18 -6
- package/dist/src/data-marts/credentials/dto/credential-api.dto.d.ts +5 -1
- package/dist/src/data-marts/credentials/dto/credential-api.dto.js +21 -0
- package/dist/src/data-marts/credentials/dto/credential.dto.d.ts +2 -1
- package/dist/src/data-marts/credentials/entities/credential.entity.d.ts +2 -1
- package/dist/src/data-marts/credentials/entities/credential.entity.js +5 -0
- package/dist/src/data-marts/credentials/facades/credential-consumer-binding.facade.impl.js +6 -1
- package/dist/src/data-marts/credentials/mappers/credential.mapper.js +2 -0
- package/dist/src/data-marts/credentials/services/builtin-credential-definitions.js +8 -0
- package/dist/src/data-marts/credentials/services/credential-external-definition-registry.service.d.ts +4 -0
- package/dist/src/data-marts/credentials/services/credential-external-definition-registry.service.js +36 -17
- package/dist/src/data-marts/credentials/services/credential-fetch.service.d.ts +8 -0
- package/dist/src/data-marts/credentials/services/credential-fetch.service.js +115 -46
- package/dist/src/data-marts/credentials/services/credential-validation-probe.service.d.ts +3 -1
- package/dist/src/data-marts/credentials/services/credential-validation-probe.service.js +10 -2
- package/dist/src/data-marts/credentials/services/credential.service.d.ts +4 -0
- package/dist/src/data-marts/credentials/services/credential.service.js +36 -0
- package/dist/src/data-marts/credentials/services/google-service-account-key.d.ts +6 -0
- package/dist/src/data-marts/credentials/services/google-service-account-key.js +46 -0
- package/dist/src/data-marts/credentials/services/google-service-account-token.service.d.ts +25 -0
- package/dist/src/data-marts/credentials/services/google-service-account-token.service.js +177 -0
- package/dist/src/data-marts/credentials/use-cases/create-credential.service.d.ts +1 -0
- package/dist/src/data-marts/credentials/use-cases/create-credential.service.js +10 -2
- package/dist/src/data-marts/credentials/use-cases/update-credential.service.d.ts +1 -0
- package/dist/src/data-marts/credentials/use-cases/update-credential.service.js +28 -4
- package/dist/src/data-marts/credentials/use-cases/validate-credential.service.js +2 -5
- package/dist/src/data-marts/data-marts.module.js +4 -0
- package/dist/src/data-marts/data-storage-types/snowflake/adapters/snowflake-api.adapter.js +1 -0
- package/dist/src/data-marts/dto/presentation/run-data-mart-request-api.dto.js +4 -2
- package/dist/src/data-marts/services/connector/backfill-segment.d.ts +22 -0
- package/dist/src/data-marts/services/connector/backfill-segment.js +91 -0
- package/dist/src/data-marts/services/connector/connector-execution.service.d.ts +1 -0
- package/dist/src/data-marts/services/connector/connector-execution.service.js +3 -0
- package/dist/src/data-marts/services/connector/connector-executor.service.d.ts +4 -1
- package/dist/src/data-marts/services/connector/connector-executor.service.js +107 -23
- package/dist/src/data-marts/services/connector/connector-run.service.d.ts +3 -0
- package/dist/src/data-marts/services/connector/connector-run.service.js +98 -4
- package/dist/src/data-marts/services/data-mart-run.service.d.ts +1 -0
- package/dist/src/data-marts/services/data-mart-run.service.js +9 -0
- package/dist/src/data-marts/system-triggers/processors/repair-backfill-chains-processor.d.ts +14 -0
- package/dist/src/data-marts/system-triggers/processors/repair-backfill-chains-processor.js +45 -0
- package/dist/src/data-marts/use-cases/cancel-data-mart-run.service.d.ts +4 -0
- package/dist/src/data-marts/use-cases/cancel-data-mart-run.service.js +46 -1
- package/dist/src/data-marts/utils/manual-backfill-range.d.ts +52 -0
- package/dist/src/data-marts/utils/manual-backfill-range.js +110 -8
- package/dist/src/ee/mcp/instructions/mcp-system-instructions.d.ts +1 -1
- package/dist/src/ee/mcp/instructions/mcp-system-instructions.js +1 -0
- package/dist/src/idp/decorators/auth-context.decorator.js +1 -0
- package/dist/src/idp/guards/idp.guard.d.ts +3 -0
- package/dist/src/idp/guards/idp.guard.js +38 -8
- package/dist/src/idp/oauth/controllers/oauth-authorization.controller.js +8 -6
- package/dist/src/idp/oauth/mcp-client-integration.d.ts +1 -0
- package/dist/src/idp/oauth/mcp-client-integration.js +15 -0
- package/dist/src/idp/ports/plugin-runtime-authorizer.port.d.ts +6 -0
- package/dist/src/idp/types/auth.types.d.ts +1 -0
- package/dist/src/migrations/1790900000000-add-plugin-version-backend.d.ts +6 -0
- package/dist/src/migrations/1790900000000-add-plugin-version-backend.js +21 -0
- package/dist/src/migrations/1790900000001-create-plugin-action-execution.d.ts +6 -0
- package/dist/src/migrations/1790900000001-create-plugin-action-execution.js +77 -0
- package/dist/src/migrations/1791000000000-add-credential-public-metadata.d.ts +6 -0
- package/dist/src/migrations/1791000000000-add-credential-public-metadata.js +23 -0
- package/dist/src/plugin-host/collections/dto/domain/plugin-collection.types.d.ts +1 -0
- package/dist/src/plugin-host/collections/errors/plugin-collection.errors.d.ts +6 -0
- package/dist/src/plugin-host/collections/errors/plugin-collection.errors.js +19 -1
- package/dist/src/plugin-host/collections/services/plugin-collection-declaration.service.js +3 -3
- package/dist/src/plugin-host/collections/use-cases/put-plugin-collection-document.service.js +7 -0
- package/dist/src/plugin-host/constants/plugin-action-limits.d.ts +34 -0
- package/dist/src/plugin-host/constants/plugin-action-limits.js +51 -0
- package/dist/src/plugin-host/controllers/plugin-action-runtime.controller.d.ts +20 -0
- package/dist/src/plugin-host/controllers/plugin-action-runtime.controller.js +123 -0
- package/dist/src/plugin-host/controllers/plugin-credential-runtime.controller.js +11 -19
- package/dist/src/plugin-host/controllers/plugin-history.controller.d.ts +10 -0
- package/dist/src/plugin-host/controllers/plugin-history.controller.js +57 -0
- package/dist/src/plugin-host/controllers/plugin-release-check.controller.d.ts +10 -0
- package/dist/src/plugin-host/controllers/plugin-release-check.controller.js +58 -0
- package/dist/src/plugin-host/dto/domain/check-plugin-release.command.d.ts +22 -0
- package/dist/src/plugin-host/dto/domain/check-plugin-release.command.js +17 -0
- package/dist/src/plugin-host/dto/domain/list-plugin-history.command.d.ts +10 -0
- package/dist/src/plugin-host/dto/domain/list-plugin-history.command.js +18 -0
- package/dist/src/plugin-host/dto/domain/plugin-action-execution.command.d.ts +23 -0
- package/dist/src/plugin-host/dto/domain/plugin-action-execution.command.js +44 -0
- package/dist/src/plugin-host/dto/domain/plugin-action-execution.dto.d.ts +36 -0
- package/dist/src/plugin-host/dto/domain/plugin-action-execution.dto.js +3 -0
- package/dist/src/plugin-host/dto/domain/plugin-history.dto.d.ts +29 -0
- package/dist/src/plugin-host/dto/domain/plugin-history.dto.js +3 -0
- package/dist/src/plugin-host/dto/domain/plugin-view.dto.d.ts +1 -0
- package/dist/src/plugin-host/dto/presentation/plugin-action-api.dto.d.ts +44 -0
- package/dist/src/plugin-host/dto/presentation/plugin-action-api.dto.js +208 -0
- package/dist/src/plugin-host/dto/presentation/plugin-gallery-api.dto.d.ts +2 -0
- package/dist/src/plugin-host/dto/presentation/plugin-gallery-api.dto.js +7 -0
- package/dist/src/plugin-host/dto/presentation/plugin-history-api.dto.d.ts +29 -0
- package/dist/src/plugin-host/dto/presentation/plugin-history-api.dto.js +148 -0
- package/dist/src/plugin-host/dto/presentation/publication-api.dto.d.ts +17 -0
- package/dist/src/plugin-host/dto/presentation/publication-api.dto.js +95 -1
- package/dist/src/plugin-host/entities/plugin-action-execution.entity.d.ts +24 -0
- package/dist/src/plugin-host/entities/plugin-action-execution.entity.js +136 -0
- package/dist/src/plugin-host/entities/plugin-version.entity.d.ts +2 -1
- package/dist/src/plugin-host/entities/plugin-version.entity.js +5 -0
- package/dist/src/plugin-host/enums/plugin-action-execution-status.enum.d.ts +9 -0
- package/dist/src/plugin-host/enums/plugin-action-execution-status.enum.js +22 -0
- package/dist/src/plugin-host/enums/release-rejection-code.enum.d.ts +3 -0
- package/dist/src/plugin-host/enums/release-rejection-code.enum.js +6 -0
- package/dist/src/plugin-host/errors/plugin-action.errors.d.ts +45 -0
- package/dist/src/plugin-host/errors/plugin-action.errors.js +70 -0
- package/dist/src/plugin-host/errors/plugin-host.errors.d.ts +6 -0
- package/dist/src/plugin-host/errors/plugin-host.errors.js +10 -1
- package/dist/src/plugin-host/filters/plugin-host-exception.filter.js +2 -2
- package/dist/src/plugin-host/mappers/plugin-action-execution.mapper.d.ts +3 -0
- package/dist/src/plugin-host/mappers/plugin-action-execution.mapper.js +22 -0
- package/dist/src/plugin-host/mappers/plugin-presentation.mapper.d.ts +16 -1
- package/dist/src/plugin-host/mappers/plugin-presentation.mapper.js +80 -1
- package/dist/src/plugin-host/plugin-host.module.js +32 -0
- package/dist/src/plugin-host/services/action-input-validator.service.d.ts +23 -0
- package/dist/src/plugin-host/services/action-input-validator.service.js +277 -0
- package/dist/src/plugin-host/services/external-credential-definition-sync.service.d.ts +3 -0
- package/dist/src/plugin-host/services/external-credential-definition-sync.service.js +47 -15
- package/dist/src/plugin-host/services/plugin-action-dispatcher.service.d.ts +13 -0
- package/dist/src/plugin-host/services/plugin-action-dispatcher.service.js +140 -0
- package/dist/src/plugin-host/services/plugin-action-execution.service.d.ts +69 -0
- package/dist/src/plugin-host/services/plugin-action-execution.service.js +239 -0
- package/dist/src/plugin-host/services/plugin-action-starter.service.d.ts +22 -0
- package/dist/src/plugin-host/services/plugin-action-starter.service.js +81 -0
- package/dist/src/plugin-host/services/plugin-audit.service.d.ts +13 -0
- package/dist/src/plugin-host/services/plugin-audit.service.js +78 -0
- package/dist/src/plugin-host/services/plugin-publication.service.d.ts +2 -0
- package/dist/src/plugin-host/services/plugin-publication.service.js +18 -10
- package/dist/src/plugin-host/services/plugin-runtime-authorizer.service.d.ts +5 -2
- package/dist/src/plugin-host/services/plugin-runtime-authorizer.service.js +31 -3
- package/dist/src/plugin-host/services/plugin-version.service.d.ts +2 -1
- package/dist/src/plugin-host/services/release-candidate-rules.service.d.ts +51 -0
- package/dist/src/plugin-host/services/release-candidate-rules.service.js +198 -0
- package/dist/src/plugin-host/services/remote-url-validator.service.d.ts +7 -0
- package/dist/src/plugin-host/services/remote-url-validator.service.js +4 -0
- package/dist/src/plugin-host/system-triggers/plugin-action-execution-sweep.processor.d.ts +14 -0
- package/dist/src/plugin-host/system-triggers/plugin-action-execution-sweep.processor.js +50 -0
- package/dist/src/plugin-host/use-cases/cancel-plugin-action-execution.service.d.ts +8 -0
- package/dist/src/plugin-host/use-cases/cancel-plugin-action-execution.service.js +39 -0
- package/dist/src/plugin-host/use-cases/check-plugin-release.service.d.ts +22 -0
- package/dist/src/plugin-host/use-cases/check-plugin-release.service.js +152 -0
- package/dist/src/plugin-host/use-cases/get-current-plugin-action-execution.service.d.ts +14 -0
- package/dist/src/plugin-host/use-cases/get-current-plugin-action-execution.service.js +85 -0
- package/dist/src/plugin-host/use-cases/get-plugin-action-execution.service.d.ts +9 -0
- package/dist/src/plugin-host/use-cases/get-plugin-action-execution.service.js +67 -0
- package/dist/src/plugin-host/use-cases/get-plugin-installation-entry.service.js +2 -7
- package/dist/src/plugin-host/use-cases/install-plugin.service.js +4 -0
- package/dist/src/plugin-host/use-cases/list-plugin-history.service.d.ts +25 -0
- package/dist/src/plugin-host/use-cases/list-plugin-history.service.js +147 -0
- package/dist/src/plugin-host/use-cases/plugin-publisher-access.d.ts +5 -0
- package/dist/src/plugin-host/use-cases/plugin-publisher-access.js +28 -0
- package/dist/src/plugin-host/use-cases/start-plugin-action-execution.service.d.ts +12 -0
- package/dist/src/plugin-host/use-cases/start-plugin-action-execution.service.js +64 -0
- package/dist/src/plugin-host/use-cases/sync-plugin-releases.service.d.ts +3 -5
- package/dist/src/plugin-host/use-cases/sync-plugin-releases.service.js +15 -59
- package/dist/src/plugin-host/use-cases/uninstall-plugin.service.js +3 -1
- package/dist/src/plugin-host/use-cases/update-plugin.service.d.ts +0 -1
- package/dist/src/plugin-host/use-cases/update-plugin.service.js +3 -25
- package/dist/src/plugin-host/utils/action-input-schema.util.d.ts +14 -0
- package/dist/src/plugin-host/utils/action-input-schema.util.js +133 -0
- package/dist/src/plugin-host/utils/credential-handles.util.d.ts +3 -0
- package/dist/src/plugin-host/utils/credential-handles.util.js +13 -0
- package/dist/src/plugin-host/utils/execution-token.util.d.ts +5 -0
- package/dist/src/plugin-host/utils/execution-token.util.js +13 -0
- package/dist/src/plugin-host/utils/json-shape.util.d.ts +1 -0
- package/dist/src/plugin-host/utils/json-shape.util.js +21 -0
- package/dist/src/plugin-host/utils/plugin-action-outcome.util.d.ts +10 -0
- package/dist/src/plugin-host/utils/plugin-action-outcome.util.js +67 -0
- package/dist/src/plugin-host/utils/plugin-manifest.util.d.ts +121 -0
- package/dist/src/plugin-host/utils/plugin-manifest.util.js +111 -1
- package/dist/src/plugin-host/utils/request-abort-signal.util.d.ts +5 -0
- package/dist/src/plugin-host/utils/request-abort-signal.util.js +19 -0
- package/package.json +10 -8
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PluginActionRuntimeController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const idp_1 = require("../../idp");
|
|
19
|
+
const role_config_types_1 = require("../../idp/types/role-config.types");
|
|
20
|
+
const plugin_action_execution_command_1 = require("../dto/domain/plugin-action-execution.command");
|
|
21
|
+
const plugin_action_api_dto_1 = require("../dto/presentation/plugin-action-api.dto");
|
|
22
|
+
const plugin_host_exception_filter_1 = require("../filters/plugin-host-exception.filter");
|
|
23
|
+
const plugin_presentation_mapper_1 = require("../mappers/plugin-presentation.mapper");
|
|
24
|
+
const cancel_plugin_action_execution_service_1 = require("../use-cases/cancel-plugin-action-execution.service");
|
|
25
|
+
const get_current_plugin_action_execution_service_1 = require("../use-cases/get-current-plugin-action-execution.service");
|
|
26
|
+
const get_plugin_action_execution_service_1 = require("../use-cases/get-plugin-action-execution.service");
|
|
27
|
+
const start_plugin_action_execution_service_1 = require("../use-cases/start-plugin-action-execution.service");
|
|
28
|
+
const request_abort_signal_util_1 = require("../utils/request-abort-signal.util");
|
|
29
|
+
let PluginActionRuntimeController = class PluginActionRuntimeController {
|
|
30
|
+
startExecution;
|
|
31
|
+
getExecution;
|
|
32
|
+
cancelExecution;
|
|
33
|
+
getCurrentExecution;
|
|
34
|
+
mapper;
|
|
35
|
+
constructor(startExecution, getExecution, cancelExecution, getCurrentExecution, mapper) {
|
|
36
|
+
this.startExecution = startExecution;
|
|
37
|
+
this.getExecution = getExecution;
|
|
38
|
+
this.cancelExecution = cancelExecution;
|
|
39
|
+
this.getCurrentExecution = getCurrentExecution;
|
|
40
|
+
this.mapper = mapper;
|
|
41
|
+
}
|
|
42
|
+
async start(action, body, context) {
|
|
43
|
+
const unknownProperty = Object.keys(body ?? {}).find(key => key !== 'input');
|
|
44
|
+
if (unknownProperty !== undefined) {
|
|
45
|
+
throw new common_1.BadRequestException([`property ${unknownProperty} should not exist`]);
|
|
46
|
+
}
|
|
47
|
+
const started = await this.startExecution.run(new plugin_action_execution_command_1.StartPluginActionExecutionCommand(context, action, body?.input));
|
|
48
|
+
return this.mapper.toStartedActionExecutionResponse(started);
|
|
49
|
+
}
|
|
50
|
+
async current(context) {
|
|
51
|
+
const current = await this.getCurrentExecution.run(new plugin_action_execution_command_1.GetCurrentPluginActionExecutionCommand(context));
|
|
52
|
+
return this.mapper.toActionWorkerContextResponse(current);
|
|
53
|
+
}
|
|
54
|
+
async get(id, query, context, request) {
|
|
55
|
+
const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
|
|
56
|
+
try {
|
|
57
|
+
const execution = await this.getExecution.run(new plugin_action_execution_command_1.GetPluginActionExecutionCommand(context, id, query.waitSeconds ?? 0, disconnected.signal));
|
|
58
|
+
return this.mapper.toActionExecutionResponse(execution);
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
disconnected.dispose();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async cancel(id, context) {
|
|
65
|
+
const execution = await this.cancelExecution.run(new plugin_action_execution_command_1.CancelPluginActionExecutionCommand(context, id));
|
|
66
|
+
return this.mapper.toActionExecutionResponse(execution);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.PluginActionRuntimeController = PluginActionRuntimeController;
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, common_1.Post)('actions/:action/executions'),
|
|
72
|
+
(0, common_1.HttpCode)(202),
|
|
73
|
+
(0, swagger_1.ApiBody)({ type: plugin_action_api_dto_1.StartPluginActionExecutionApiDto }),
|
|
74
|
+
(0, swagger_1.ApiAcceptedResponse)({ type: plugin_action_api_dto_1.StartedPluginActionExecutionApiDto }),
|
|
75
|
+
__param(0, (0, common_1.Param)('action')),
|
|
76
|
+
__param(1, (0, common_1.Body)()),
|
|
77
|
+
__param(2, (0, idp_1.AuthContext)()),
|
|
78
|
+
__metadata("design:type", Function),
|
|
79
|
+
__metadata("design:paramtypes", [String, Object, Object]),
|
|
80
|
+
__metadata("design:returntype", Promise)
|
|
81
|
+
], PluginActionRuntimeController.prototype, "start", null);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, common_1.Get)('executions/current'),
|
|
84
|
+
(0, swagger_1.ApiOkResponse)({ type: plugin_action_api_dto_1.PluginActionWorkerContextApiDto }),
|
|
85
|
+
__param(0, (0, idp_1.AuthContext)()),
|
|
86
|
+
__metadata("design:type", Function),
|
|
87
|
+
__metadata("design:paramtypes", [Object]),
|
|
88
|
+
__metadata("design:returntype", Promise)
|
|
89
|
+
], PluginActionRuntimeController.prototype, "current", null);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, common_1.Get)('executions/:id'),
|
|
92
|
+
(0, swagger_1.ApiOkResponse)({ type: plugin_action_api_dto_1.PluginActionExecutionApiDto }),
|
|
93
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
94
|
+
__param(1, (0, common_1.Query)()),
|
|
95
|
+
__param(2, (0, idp_1.AuthContext)()),
|
|
96
|
+
__param(3, (0, common_1.Req)()),
|
|
97
|
+
__metadata("design:type", Function),
|
|
98
|
+
__metadata("design:paramtypes", [String, plugin_action_api_dto_1.PluginActionExecutionQueryApiDto, Object, Object]),
|
|
99
|
+
__metadata("design:returntype", Promise)
|
|
100
|
+
], PluginActionRuntimeController.prototype, "get", null);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, common_1.Post)('executions/:id/cancel'),
|
|
103
|
+
(0, common_1.HttpCode)(200),
|
|
104
|
+
(0, swagger_1.ApiOkResponse)({ type: plugin_action_api_dto_1.PluginActionExecutionApiDto }),
|
|
105
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
|
|
106
|
+
__param(1, (0, idp_1.AuthContext)()),
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
109
|
+
__metadata("design:returntype", Promise)
|
|
110
|
+
], PluginActionRuntimeController.prototype, "cancel", null);
|
|
111
|
+
exports.PluginActionRuntimeController = PluginActionRuntimeController = __decorate([
|
|
112
|
+
(0, swagger_1.ApiTags)('Plugin Actions'),
|
|
113
|
+
(0, common_1.Controller)('plugins/runtime'),
|
|
114
|
+
(0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.PARSE)),
|
|
115
|
+
(0, idp_1.RequirePluginAuth)(),
|
|
116
|
+
(0, common_1.UseFilters)(plugin_host_exception_filter_1.PluginHostExceptionFilter),
|
|
117
|
+
__metadata("design:paramtypes", [start_plugin_action_execution_service_1.StartPluginActionExecutionService,
|
|
118
|
+
get_plugin_action_execution_service_1.GetPluginActionExecutionService,
|
|
119
|
+
cancel_plugin_action_execution_service_1.CancelPluginActionExecutionService,
|
|
120
|
+
get_current_plugin_action_execution_service_1.GetCurrentPluginActionExecutionService,
|
|
121
|
+
plugin_presentation_mapper_1.PluginPresentationMapper])
|
|
122
|
+
], PluginActionRuntimeController);
|
|
123
|
+
//# sourceMappingURL=plugin-action-runtime.controller.js.map
|
|
@@ -23,8 +23,11 @@ const credential_types_1 = require("../../data-marts/credentials/credential.type
|
|
|
23
23
|
const credential_fetch_service_1 = require("../../data-marts/credentials/services/credential-fetch.service");
|
|
24
24
|
const credential_ai_service_1 = require("../../data-marts/credentials/services/credential-ai.service");
|
|
25
25
|
const credential_ai_api_dto_1 = require("../../data-marts/credentials/dto/credential-ai-api.dto");
|
|
26
|
+
const plugin_action_errors_1 = require("../errors/plugin-action.errors");
|
|
27
|
+
const plugin_host_exception_filter_1 = require("../filters/plugin-host-exception.filter");
|
|
26
28
|
const plugin_service_1 = require("../services/plugin.service");
|
|
27
29
|
const plugin_version_service_1 = require("../services/plugin-version.service");
|
|
30
|
+
const request_abort_signal_util_1 = require("../utils/request-abort-signal.util");
|
|
28
31
|
let PluginCredentialRuntimeController = class PluginCredentialRuntimeController {
|
|
29
32
|
plugins;
|
|
30
33
|
versions;
|
|
@@ -40,7 +43,7 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
|
|
|
40
43
|
}
|
|
41
44
|
async fetch(handle, input, context, request) {
|
|
42
45
|
const binding = await this.resolveBinding(handle, context, 'fetch');
|
|
43
|
-
const disconnected = requestAbortSignal(request);
|
|
46
|
+
const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
|
|
44
47
|
try {
|
|
45
48
|
const response = await this.fetchService.run(binding, input, {
|
|
46
49
|
signal: disconnected.signal,
|
|
@@ -57,7 +60,7 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
|
|
|
57
60
|
throw new common_1.BadRequestException('A language model mapping is required');
|
|
58
61
|
}
|
|
59
62
|
const binding = await this.resolveBinding(handle, context, input.model);
|
|
60
|
-
const disconnected = requestAbortSignal(request);
|
|
63
|
+
const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
|
|
61
64
|
try {
|
|
62
65
|
const result = await this.aiService.generate(binding, input.model, input.options, disconnected.signal);
|
|
63
66
|
await this.markUsed(binding, context);
|
|
@@ -72,7 +75,7 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
|
|
|
72
75
|
throw new common_1.BadRequestException('The embedding model mapping is required');
|
|
73
76
|
}
|
|
74
77
|
const binding = await this.resolveBinding(handle, context, input.model);
|
|
75
|
-
const disconnected = requestAbortSignal(request);
|
|
78
|
+
const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
|
|
76
79
|
try {
|
|
77
80
|
const result = await this.aiService.embed(binding, input.model, input.options, disconnected.signal);
|
|
78
81
|
await this.markUsed(binding, context);
|
|
@@ -87,7 +90,7 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
|
|
|
87
90
|
throw new common_1.BadRequestException('A language model mapping is required');
|
|
88
91
|
}
|
|
89
92
|
const binding = await this.resolveBinding(handle, context, input.model);
|
|
90
|
-
const disconnected = requestAbortSignal(request);
|
|
93
|
+
const disconnected = (0, request_abort_signal_util_1.requestAbortSignal)(request);
|
|
91
94
|
let stream;
|
|
92
95
|
try {
|
|
93
96
|
stream = await this.aiService.stream(binding, input.model, input.options, disconnected.signal);
|
|
@@ -125,6 +128,9 @@ let PluginCredentialRuntimeController = class PluginCredentialRuntimeController
|
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
async resolveBinding(handle, context, capability) {
|
|
131
|
+
if (context.executionId && capability !== 'fetch') {
|
|
132
|
+
throw new plugin_action_errors_1.ExecutionTokenNotAllowedError('AI Credentials are not available in a backend action');
|
|
133
|
+
}
|
|
128
134
|
if (!context.installationId || !context.pluginId) {
|
|
129
135
|
throw new common_1.ForbiddenException('A plugin installation is required');
|
|
130
136
|
}
|
|
@@ -213,6 +219,7 @@ exports.PluginCredentialRuntimeController = PluginCredentialRuntimeController =
|
|
|
213
219
|
(0, common_1.Controller)('plugins/runtime/credentials'),
|
|
214
220
|
(0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.PARSE)),
|
|
215
221
|
(0, idp_1.RequirePluginAuth)(),
|
|
222
|
+
(0, common_1.UseFilters)(plugin_host_exception_filter_1.PluginHostExceptionFilter),
|
|
216
223
|
__param(4, (0, common_1.Inject)(credential_consumer_binding_facade_1.CREDENTIAL_CONSUMER_BINDING_FACADE)),
|
|
217
224
|
__metadata("design:paramtypes", [plugin_service_1.PluginService,
|
|
218
225
|
plugin_version_service_1.PluginVersionService,
|
|
@@ -230,21 +237,6 @@ function assertDeclaredAiModel(requirement, model) {
|
|
|
230
237
|
throw new common_1.NotFoundException(`AI model ${model} is not declared by this plugin`);
|
|
231
238
|
}
|
|
232
239
|
}
|
|
233
|
-
function requestAbortSignal(request) {
|
|
234
|
-
const controller = new AbortController();
|
|
235
|
-
const abort = () => controller.abort();
|
|
236
|
-
request.once('aborted', abort);
|
|
237
|
-
request.res?.once('close', abort);
|
|
238
|
-
request.res?.once('error', abort);
|
|
239
|
-
return {
|
|
240
|
-
signal: controller.signal,
|
|
241
|
-
dispose: () => {
|
|
242
|
-
request.off('aborted', abort);
|
|
243
|
-
request.res?.off('close', abort);
|
|
244
|
-
request.res?.off('error', abort);
|
|
245
|
-
},
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
240
|
function waitForDrain(response, signal) {
|
|
249
241
|
if (signal.aborted || response.destroyed) {
|
|
250
242
|
return Promise.reject(signal.reason ?? new DOMException('Response closed', 'AbortError'));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AuthorizationContext } from '../../idp';
|
|
2
|
+
import { ListPluginHistoryQueryApiDto, PluginHistoryPageApiDto } from '../dto/presentation/plugin-history-api.dto';
|
|
3
|
+
import { PluginPresentationMapper } from '../mappers/plugin-presentation.mapper';
|
|
4
|
+
import { ListPluginHistoryService } from '../use-cases/list-plugin-history.service';
|
|
5
|
+
export declare class PluginHistoryController {
|
|
6
|
+
private readonly listPluginHistoryService;
|
|
7
|
+
private readonly mapper;
|
|
8
|
+
constructor(listPluginHistoryService: ListPluginHistoryService, mapper: PluginPresentationMapper);
|
|
9
|
+
list(context: AuthorizationContext, query: ListPluginHistoryQueryApiDto): Promise<PluginHistoryPageApiDto>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PluginHistoryController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const idp_1 = require("../../idp");
|
|
19
|
+
const role_config_types_1 = require("../../idp/types/role-config.types");
|
|
20
|
+
const plugin_history_api_dto_1 = require("../dto/presentation/plugin-history-api.dto");
|
|
21
|
+
const plugin_presentation_mapper_1 = require("../mappers/plugin-presentation.mapper");
|
|
22
|
+
const list_plugin_history_service_1 = require("../use-cases/list-plugin-history.service");
|
|
23
|
+
let PluginHistoryController = class PluginHistoryController {
|
|
24
|
+
listPluginHistoryService;
|
|
25
|
+
mapper;
|
|
26
|
+
constructor(listPluginHistoryService, mapper) {
|
|
27
|
+
this.listPluginHistoryService = listPluginHistoryService;
|
|
28
|
+
this.mapper = mapper;
|
|
29
|
+
}
|
|
30
|
+
async list(context, query) {
|
|
31
|
+
const page = await this.listPluginHistoryService.run(this.mapper.toListPluginHistoryCommand(context, query));
|
|
32
|
+
return this.mapper.toPluginHistoryResponse(page);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.PluginHistoryController = PluginHistoryController;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.PARSE)),
|
|
38
|
+
(0, idp_1.RejectPluginAuth)(),
|
|
39
|
+
(0, common_1.Get)('history'),
|
|
40
|
+
(0, swagger_1.ApiOperation)({
|
|
41
|
+
summary: "The caller's plugin history in this project",
|
|
42
|
+
description: "Newest first: the caller's own installations, publications for this project and the caller's own, Verified listing changes, and updates and suspensions of those plugins. A Verified listing change shows for every project the listing is set to reach or has ever named. Events within the same second may come in either order.",
|
|
43
|
+
}),
|
|
44
|
+
(0, swagger_1.ApiOkResponse)({ type: plugin_history_api_dto_1.PluginHistoryPageApiDto }),
|
|
45
|
+
__param(0, (0, idp_1.AuthContext)()),
|
|
46
|
+
__param(1, (0, common_1.Query)()),
|
|
47
|
+
__metadata("design:type", Function),
|
|
48
|
+
__metadata("design:paramtypes", [Object, plugin_history_api_dto_1.ListPluginHistoryQueryApiDto]),
|
|
49
|
+
__metadata("design:returntype", Promise)
|
|
50
|
+
], PluginHistoryController.prototype, "list", null);
|
|
51
|
+
exports.PluginHistoryController = PluginHistoryController = __decorate([
|
|
52
|
+
(0, swagger_1.ApiTags)('Plugins'),
|
|
53
|
+
(0, common_1.Controller)('plugins'),
|
|
54
|
+
__metadata("design:paramtypes", [list_plugin_history_service_1.ListPluginHistoryService,
|
|
55
|
+
plugin_presentation_mapper_1.PluginPresentationMapper])
|
|
56
|
+
], PluginHistoryController);
|
|
57
|
+
//# sourceMappingURL=plugin-history.controller.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AuthorizationContext } from '../../idp';
|
|
2
|
+
import { CheckPluginReleaseApiDto, PluginReleaseCheckResultApiDto } from '../dto/presentation/publication-api.dto';
|
|
3
|
+
import { PluginPresentationMapper } from '../mappers/plugin-presentation.mapper';
|
|
4
|
+
import { CheckPluginReleaseService } from '../use-cases/check-plugin-release.service';
|
|
5
|
+
export declare class PluginReleaseCheckController {
|
|
6
|
+
private readonly checkPluginReleaseService;
|
|
7
|
+
private readonly mapper;
|
|
8
|
+
constructor(checkPluginReleaseService: CheckPluginReleaseService, mapper: PluginPresentationMapper);
|
|
9
|
+
check(context: AuthorizationContext, dto: CheckPluginReleaseApiDto): Promise<PluginReleaseCheckResultApiDto>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PluginReleaseCheckController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const idp_1 = require("../../idp");
|
|
19
|
+
const role_config_types_1 = require("../../idp/types/role-config.types");
|
|
20
|
+
const publication_api_dto_1 = require("../dto/presentation/publication-api.dto");
|
|
21
|
+
const plugin_presentation_mapper_1 = require("../mappers/plugin-presentation.mapper");
|
|
22
|
+
const check_plugin_release_service_1 = require("../use-cases/check-plugin-release.service");
|
|
23
|
+
let PluginReleaseCheckController = class PluginReleaseCheckController {
|
|
24
|
+
checkPluginReleaseService;
|
|
25
|
+
mapper;
|
|
26
|
+
constructor(checkPluginReleaseService, mapper) {
|
|
27
|
+
this.checkPluginReleaseService = checkPluginReleaseService;
|
|
28
|
+
this.mapper = mapper;
|
|
29
|
+
}
|
|
30
|
+
async check(context, dto) {
|
|
31
|
+
const result = await this.checkPluginReleaseService.run(this.mapper.toCheckReleaseCommand(context, dto));
|
|
32
|
+
return this.mapper.toReleaseCheckResponse(result);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.PluginReleaseCheckController = PluginReleaseCheckController;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, idp_1.Auth)(role_config_types_1.Role.viewer(role_config_types_1.Strategy.INTROSPECT)),
|
|
38
|
+
(0, common_1.Post)('check'),
|
|
39
|
+
(0, common_1.HttpCode)(200),
|
|
40
|
+
(0, swagger_1.ApiOperation)({
|
|
41
|
+
summary: 'Check a release before publishing it',
|
|
42
|
+
description: 'Dry run: reports whether a release from this ref would be accepted, using the same rules as release sync, and records nothing. For deployment publishers and members who manage a publication of the plugin. Verifies that the repository is still the one the plugin was published from. Rate-limited per plugin and caller, separately from Check now.',
|
|
43
|
+
}),
|
|
44
|
+
(0, swagger_1.ApiOkResponse)({ type: publication_api_dto_1.PluginReleaseCheckResultApiDto }),
|
|
45
|
+
__param(0, (0, idp_1.AuthContext)()),
|
|
46
|
+
__param(1, (0, common_1.Body)()),
|
|
47
|
+
__metadata("design:type", Function),
|
|
48
|
+
__metadata("design:paramtypes", [Object, publication_api_dto_1.CheckPluginReleaseApiDto]),
|
|
49
|
+
__metadata("design:returntype", Promise)
|
|
50
|
+
], PluginReleaseCheckController.prototype, "check", null);
|
|
51
|
+
exports.PluginReleaseCheckController = PluginReleaseCheckController = __decorate([
|
|
52
|
+
(0, swagger_1.ApiTags)('Plugins'),
|
|
53
|
+
(0, common_1.Controller)('plugins'),
|
|
54
|
+
(0, idp_1.RejectPluginAuth)(),
|
|
55
|
+
__metadata("design:paramtypes", [check_plugin_release_service_1.CheckPluginReleaseService,
|
|
56
|
+
plugin_presentation_mapper_1.PluginPresentationMapper])
|
|
57
|
+
], PluginReleaseCheckController);
|
|
58
|
+
//# sourceMappingURL=plugin-release-check.controller.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AuthorizationContext } from '../../../idp/types/auth.types';
|
|
2
|
+
import { ReleaseRejectionCode } from '../../enums/release-rejection-code.enum';
|
|
3
|
+
export declare class CheckPluginReleaseCommand {
|
|
4
|
+
readonly context: AuthorizationContext;
|
|
5
|
+
readonly repoLocator: string;
|
|
6
|
+
readonly ref: string;
|
|
7
|
+
readonly version?: string | undefined;
|
|
8
|
+
constructor(context: AuthorizationContext, repoLocator: string, ref: string, version?: string | undefined);
|
|
9
|
+
}
|
|
10
|
+
export interface PluginReleaseCheckIssueDto {
|
|
11
|
+
readonly code: ReleaseRejectionCode;
|
|
12
|
+
readonly detail: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PluginReleaseCheckResultDto {
|
|
15
|
+
readonly pluginId: string;
|
|
16
|
+
readonly repository: string;
|
|
17
|
+
readonly commitSha: string | null;
|
|
18
|
+
readonly candidateVersion: string | null;
|
|
19
|
+
readonly baselineVersion: string | null;
|
|
20
|
+
readonly collectionsEvaluated: boolean;
|
|
21
|
+
readonly issues: readonly PluginReleaseCheckIssueDto[];
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckPluginReleaseCommand = void 0;
|
|
4
|
+
class CheckPluginReleaseCommand {
|
|
5
|
+
context;
|
|
6
|
+
repoLocator;
|
|
7
|
+
ref;
|
|
8
|
+
version;
|
|
9
|
+
constructor(context, repoLocator, ref, version) {
|
|
10
|
+
this.context = context;
|
|
11
|
+
this.repoLocator = repoLocator;
|
|
12
|
+
this.ref = ref;
|
|
13
|
+
this.version = version;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.CheckPluginReleaseCommand = CheckPluginReleaseCommand;
|
|
17
|
+
//# sourceMappingURL=check-plugin-release.command.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuthorizationContext } from '../../../idp/types/auth.types';
|
|
2
|
+
export declare const PLUGIN_HISTORY_DEFAULT_LIMIT = 50;
|
|
3
|
+
export type PluginHistoryType = 'all' | 'installations' | 'publications';
|
|
4
|
+
export declare class ListPluginHistoryCommand {
|
|
5
|
+
readonly context: AuthorizationContext;
|
|
6
|
+
readonly type: PluginHistoryType;
|
|
7
|
+
readonly limit: number;
|
|
8
|
+
readonly cursor: string | null;
|
|
9
|
+
constructor(context: AuthorizationContext, type: PluginHistoryType, limit: number, cursor: string | null);
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListPluginHistoryCommand = exports.PLUGIN_HISTORY_DEFAULT_LIMIT = void 0;
|
|
4
|
+
exports.PLUGIN_HISTORY_DEFAULT_LIMIT = 50;
|
|
5
|
+
class ListPluginHistoryCommand {
|
|
6
|
+
context;
|
|
7
|
+
type;
|
|
8
|
+
limit;
|
|
9
|
+
cursor;
|
|
10
|
+
constructor(context, type, limit, cursor) {
|
|
11
|
+
this.context = context;
|
|
12
|
+
this.type = type;
|
|
13
|
+
this.limit = limit;
|
|
14
|
+
this.cursor = cursor;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ListPluginHistoryCommand = ListPluginHistoryCommand;
|
|
18
|
+
//# sourceMappingURL=list-plugin-history.command.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AuthorizationContext } from '../../../idp/types/auth.types';
|
|
2
|
+
export declare class StartPluginActionExecutionCommand {
|
|
3
|
+
readonly context: AuthorizationContext;
|
|
4
|
+
readonly action: string;
|
|
5
|
+
readonly input: unknown;
|
|
6
|
+
constructor(context: AuthorizationContext, action: string, input: unknown);
|
|
7
|
+
}
|
|
8
|
+
export declare class GetPluginActionExecutionCommand {
|
|
9
|
+
readonly context: AuthorizationContext;
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly waitSeconds: number;
|
|
12
|
+
readonly signal: AbortSignal;
|
|
13
|
+
constructor(context: AuthorizationContext, id: string, waitSeconds: number, signal: AbortSignal);
|
|
14
|
+
}
|
|
15
|
+
export declare class CancelPluginActionExecutionCommand {
|
|
16
|
+
readonly context: AuthorizationContext;
|
|
17
|
+
readonly id: string;
|
|
18
|
+
constructor(context: AuthorizationContext, id: string);
|
|
19
|
+
}
|
|
20
|
+
export declare class GetCurrentPluginActionExecutionCommand {
|
|
21
|
+
readonly context: AuthorizationContext;
|
|
22
|
+
constructor(context: AuthorizationContext);
|
|
23
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCurrentPluginActionExecutionCommand = exports.CancelPluginActionExecutionCommand = exports.GetPluginActionExecutionCommand = exports.StartPluginActionExecutionCommand = void 0;
|
|
4
|
+
class StartPluginActionExecutionCommand {
|
|
5
|
+
context;
|
|
6
|
+
action;
|
|
7
|
+
input;
|
|
8
|
+
constructor(context, action, input) {
|
|
9
|
+
this.context = context;
|
|
10
|
+
this.action = action;
|
|
11
|
+
this.input = input;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.StartPluginActionExecutionCommand = StartPluginActionExecutionCommand;
|
|
15
|
+
class GetPluginActionExecutionCommand {
|
|
16
|
+
context;
|
|
17
|
+
id;
|
|
18
|
+
waitSeconds;
|
|
19
|
+
signal;
|
|
20
|
+
constructor(context, id, waitSeconds, signal) {
|
|
21
|
+
this.context = context;
|
|
22
|
+
this.id = id;
|
|
23
|
+
this.waitSeconds = waitSeconds;
|
|
24
|
+
this.signal = signal;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.GetPluginActionExecutionCommand = GetPluginActionExecutionCommand;
|
|
28
|
+
class CancelPluginActionExecutionCommand {
|
|
29
|
+
context;
|
|
30
|
+
id;
|
|
31
|
+
constructor(context, id) {
|
|
32
|
+
this.context = context;
|
|
33
|
+
this.id = id;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.CancelPluginActionExecutionCommand = CancelPluginActionExecutionCommand;
|
|
37
|
+
class GetCurrentPluginActionExecutionCommand {
|
|
38
|
+
context;
|
|
39
|
+
constructor(context) {
|
|
40
|
+
this.context = context;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.GetCurrentPluginActionExecutionCommand = GetCurrentPluginActionExecutionCommand;
|
|
44
|
+
//# sourceMappingURL=plugin-action-execution.command.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PluginActionExecutionStatus, PluginActionTrigger } from '../../enums/plugin-action-execution-status.enum';
|
|
2
|
+
import type { PluginCredentialHandleDto } from './plugin-installation.dto';
|
|
3
|
+
export interface StartedPluginActionExecution {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly status: PluginActionExecutionStatus.RUNNING;
|
|
6
|
+
}
|
|
7
|
+
export interface PluginActionExecutionView {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly action: string;
|
|
10
|
+
readonly status: PluginActionExecutionStatus;
|
|
11
|
+
readonly trigger: PluginActionTrigger;
|
|
12
|
+
readonly startedAt: Date | null;
|
|
13
|
+
readonly deadlineAt: Date | null;
|
|
14
|
+
readonly finishedAt: Date | null;
|
|
15
|
+
readonly result: unknown;
|
|
16
|
+
readonly error: {
|
|
17
|
+
readonly code: string;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
} | null;
|
|
20
|
+
}
|
|
21
|
+
export interface PluginActionWorkerContext {
|
|
22
|
+
readonly executionId: string;
|
|
23
|
+
readonly action: string;
|
|
24
|
+
readonly input: unknown;
|
|
25
|
+
readonly trigger: PluginActionTrigger;
|
|
26
|
+
readonly deadlineAt: Date;
|
|
27
|
+
readonly plugin: {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly repositoryId: string;
|
|
30
|
+
};
|
|
31
|
+
readonly pluginVersion: string;
|
|
32
|
+
readonly installationId: string;
|
|
33
|
+
readonly projectId: string;
|
|
34
|
+
readonly userId: string;
|
|
35
|
+
readonly credentialHandles: PluginCredentialHandleDto[];
|
|
36
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PluginAuditAction } from '../../enums/plugin-audit-action.enum';
|
|
2
|
+
import { PluginPublicationScope } from '../../enums/plugin-publication-scope.enum';
|
|
3
|
+
export type PluginHistoryAction = Exclude<PluginAuditAction, PluginAuditAction.UPDATE_CHECK>;
|
|
4
|
+
export type PluginHistoryActorDto = {
|
|
5
|
+
readonly kind: 'you';
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'member';
|
|
8
|
+
readonly name: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'deployment';
|
|
11
|
+
};
|
|
12
|
+
export interface PluginHistoryPluginDto {
|
|
13
|
+
readonly pluginId: string;
|
|
14
|
+
readonly displayName: string;
|
|
15
|
+
readonly ownerName: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PluginHistoryEventDto {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly occurredAt: Date;
|
|
20
|
+
readonly action: PluginHistoryAction;
|
|
21
|
+
readonly scope: PluginPublicationScope | null;
|
|
22
|
+
readonly plugin: PluginHistoryPluginDto;
|
|
23
|
+
readonly actor: PluginHistoryActorDto | null;
|
|
24
|
+
readonly version: string | null;
|
|
25
|
+
}
|
|
26
|
+
export interface PluginHistoryPageDto {
|
|
27
|
+
readonly items: PluginHistoryEventDto[];
|
|
28
|
+
readonly nextCursor: string | null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PluginActionExecutionStatus, type PluginActionTrigger } from '../../enums/plugin-action-execution-status.enum';
|
|
2
|
+
import type { PluginCredentialHandleDto } from '../domain/plugin-installation.dto';
|
|
3
|
+
export declare class StartPluginActionExecutionApiDto {
|
|
4
|
+
input?: unknown;
|
|
5
|
+
}
|
|
6
|
+
export declare class PluginActionExecutionQueryApiDto {
|
|
7
|
+
waitSeconds?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class StartedPluginActionExecutionApiDto {
|
|
10
|
+
id: string;
|
|
11
|
+
status: PluginActionExecutionStatus.RUNNING;
|
|
12
|
+
}
|
|
13
|
+
export declare class PluginActionExecutionErrorApiDto {
|
|
14
|
+
code: string;
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class PluginActionExecutionApiDto {
|
|
18
|
+
id: string;
|
|
19
|
+
action: string;
|
|
20
|
+
status: PluginActionExecutionStatus;
|
|
21
|
+
trigger: PluginActionTrigger;
|
|
22
|
+
startedAt: Date | null;
|
|
23
|
+
deadlineAt: Date | null;
|
|
24
|
+
finishedAt: Date | null;
|
|
25
|
+
result: unknown;
|
|
26
|
+
error: PluginActionExecutionErrorApiDto | null;
|
|
27
|
+
}
|
|
28
|
+
export declare class PluginActionWorkerPluginApiDto {
|
|
29
|
+
id: string;
|
|
30
|
+
repositoryId: string;
|
|
31
|
+
}
|
|
32
|
+
export declare class PluginActionWorkerContextApiDto {
|
|
33
|
+
executionId: string;
|
|
34
|
+
action: string;
|
|
35
|
+
input: unknown;
|
|
36
|
+
trigger: PluginActionTrigger;
|
|
37
|
+
deadlineAt: Date;
|
|
38
|
+
plugin: PluginActionWorkerPluginApiDto;
|
|
39
|
+
pluginVersion: string;
|
|
40
|
+
installationId: string;
|
|
41
|
+
projectId: string;
|
|
42
|
+
userId: string;
|
|
43
|
+
credentialHandles: PluginCredentialHandleDto[];
|
|
44
|
+
}
|