UNPKG

@villedemontreal/workit

Version:

Worker for Node.js system with pluggable clients that works with both AWS Step function and Camunda platform powered by TypeScript

68 lines 2.73 kB
"use strict"; /* * Copyright (c) 2025 Ville de Montreal. All rights reserved. * Licensed under the MIT license. * See LICENSE file in the project root for full license information. */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 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; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ClientManager = void 0; const inversify_1 = require("inversify"); require("reflect-metadata"); const debug = require("debug"); const log = debug('workit:clientManager'); let ClientManager = class ClientManager { constructor(client) { this._client = client; } deployWorkflow(bpmnPath, override) { log(`Deploying workflow from path: "${bpmnPath}"`); return this._client.deployWorkflow(bpmnPath, override); } getWorkflows(options) { log(`Getting workflows`); return this._client.getWorkflows(options); } getWorkflow(payload) { return this._client.getWorkflow(payload); } /** * Notice that you cannot pass "File" in variables for now. */ updateVariables(payload) { return this._client.updateVariables(payload); } async updateJobRetries(payload) { await this._client.updateJobRetries(payload); } publishMessage(payload) { return this._client.publishMessage(payload); } createWorkflowInstance(model) { return this._client.createWorkflowInstance(model); } resolveIncident(incidentKey) { return this._client.resolveIncident(incidentKey); } cancelWorkflowInstance(instanceId) { return this._client.cancelWorkflowInstance(instanceId); } }; ClientManager = __decorate([ (0, inversify_1.injectable)(), __param(0, (0, inversify_1.unmanaged)()), __metadata("design:paramtypes", [Object]) ], ClientManager); exports.ClientManager = ClientManager; //# sourceMappingURL=clientManager.js.map