@orchesty/connector-wflow 2.0.1 → 2.0.3
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/Batch/WflowSubscribeWebhookBatch.d.ts +7 -0
- package/dist/Batch/WflowSubscribeWebhookBatch.js +57 -0
- package/dist/Batch/WflowUnsubscribeWebhookBatch.d.ts +7 -0
- package/dist/Batch/WflowUnsubscribeWebhookBatch.js +47 -0
- package/{src/Connector/WflowGetDocumentConnector.ts → dist/Connector/WflowGetDocumentConnector.d.ts} +4 -34
- package/dist/Connector/WflowGetDocumentConnector.js +24 -0
- package/dist/Connector/WflowGetDocumentMainFileConnector.d.ts +13 -0
- package/dist/Connector/WflowGetDocumentMainFileConnector.js +25 -0
- package/dist/Connector/WflowGetDocumentTypesConnector.d.ts +36 -0
- package/dist/Connector/WflowGetDocumentTypesConnector.js +28 -0
- package/dist/Connector/WflowGetOrganizationsConnector.d.ts +15 -0
- package/dist/Connector/WflowGetOrganizationsConnector.js +27 -0
- package/dist/Connector/WflowPatchAccountingRulesConnector.d.ts +17 -0
- package/dist/Connector/WflowPatchAccountingRulesConnector.js +24 -0
- package/dist/Connector/WflowPatchChartOfAccountsConnector.d.ts +15 -0
- package/dist/Connector/WflowPatchChartOfAccountsConnector.js +24 -0
- package/dist/Connector/WflowPatchContractsConnector.d.ts +15 -0
- package/dist/Connector/WflowPatchContractsConnector.js +24 -0
- package/dist/Connector/WflowPatchCostCentersConnector.d.ts +15 -0
- package/dist/Connector/WflowPatchCostCentersConnector.js +24 -0
- package/dist/Connector/WflowPatchSeriesConnector.d.ts +19 -0
- package/dist/Connector/WflowPatchSeriesConnector.js +24 -0
- package/dist/Connector/WflowPatchVatControlStatementLinesConnector.d.ts +15 -0
- package/dist/Connector/WflowPatchVatControlStatementLinesConnector.js +24 -0
- package/dist/Connector/WflowPatchVatReturnLinesConnector.d.ts +16 -0
- package/dist/Connector/WflowPatchVatReturnLinesConnector.js +24 -0
- package/{src/Connector/WflowPutDocumentConnector.ts → dist/Connector/WflowPutDocumentConnector.d.ts} +5 -37
- package/dist/Connector/WflowPutDocumentConnector.js +31 -0
- package/dist/Connector/WflowUpdateDocumentStateConnector.d.ts +11 -0
- package/dist/Connector/WflowUpdateDocumentStateConnector.js +24 -0
- package/dist/WflowApplication.d.ts +41 -0
- package/dist/WflowApplication.js +133 -0
- package/dist/package.json +26 -0
- package/package.json +5 -2
- package/CHANGELOG.md +0 -49
- package/jest.config.js +0 -13
- package/src/Batch/WflowSubscribeWebhookBatch.ts +0 -84
- package/src/Batch/WflowUnsubscribeWebhookBatch.ts +0 -59
- package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/input.json +0 -7
- package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/mock.json +0 -5
- package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/output.json +0 -7
- package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/input.json +0 -7
- package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/mock.json +0 -5
- package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/output.json +0 -7
- package/src/Batch/__tests__/WflowSubscribeWebhookBatch.ts +0 -17
- package/src/Batch/__tests__/WflowUnsubscribeWebhookBatch.ts +0 -17
- package/src/Connector/WflowGetDocumentMainFileConnector.ts +0 -40
- package/src/Connector/WflowGetDocumentTypesConnector.ts +0 -69
- package/src/Connector/WflowGetOrganizationsConnector.ts +0 -40
- package/src/Connector/WflowPatchAccountingRulesConnector.ts +0 -53
- package/src/Connector/WflowPatchChartOfAccountsConnector.ts +0 -42
- package/src/Connector/WflowPatchContractsConnector.ts +0 -42
- package/src/Connector/WflowPatchCostCentersConnector.ts +0 -42
- package/src/Connector/WflowPatchSeriesConnector.ts +0 -61
- package/src/Connector/WflowPatchVatControlStatementLinesConnector.ts +0 -42
- package/src/Connector/WflowPatchVatReturnLinesConnector.ts +0 -43
- package/src/Connector/WflowUpdateDocumentStateConnector.ts +0 -36
- package/src/Connector/__tests__/Data/WflowGetDocumentConnector/input.json +0 -10
- package/src/Connector/__tests__/Data/WflowGetDocumentConnector/mock.json +0 -449
- package/src/Connector/__tests__/Data/WflowGetDocumentConnector/output.json +0 -451
- package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/input.json +0 -9
- package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/output.json +0 -9
- package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/input.json +0 -7
- package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/mock.json +0 -32
- package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/output.json +0 -29
- package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/input.json +0 -7
- package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/mock.json +0 -12
- package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/output.json +0 -14
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-input.json +0 -20
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-output.json +0 -20
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/input.json +0 -12
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/output.json +0 -12
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-input.json +0 -18
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-output.json +0 -18
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/input.json +0 -11
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/output.json +0 -11
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-input.json +0 -18
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-output.json +0 -18
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/input.json +0 -11
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/output.json +0 -11
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-input.json +0 -18
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-output.json +0 -18
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/input.json +0 -11
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/output.json +0 -11
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-input.json +0 -20
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-output.json +0 -20
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/input.json +0 -12
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/output.json +0 -12
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-input.json +0 -18
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-output.json +0 -18
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/input.json +0 -11
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/output.json +0 -11
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-input.json +0 -20
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-output.json +0 -20
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/input.json +0 -12
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/output.json +0 -12
- package/src/Connector/__tests__/Data/WflowPutDocumentConnector/input.json +0 -10
- package/src/Connector/__tests__/Data/WflowPutDocumentConnector/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowPutDocumentConnector/output.json +0 -10
- package/src/Connector/__tests__/Data/WflowUpdateDocumentState/input.json +0 -9
- package/src/Connector/__tests__/Data/WflowUpdateDocumentState/mock.json +0 -5
- package/src/Connector/__tests__/Data/WflowUpdateDocumentState/output.json +0 -9
- package/src/Connector/__tests__/WflowGetDocumentConnector.ts +0 -17
- package/src/Connector/__tests__/WflowGetDocumentMainFileConnector.ts +0 -17
- package/src/Connector/__tests__/WflowGetDocumentTypesConnector.ts +0 -17
- package/src/Connector/__tests__/WflowGetOrganizationsConnector.ts +0 -17
- package/src/Connector/__tests__/WflowPatchAccountingRulesConnector.ts +0 -21
- package/src/Connector/__tests__/WflowPatchChartOfAccountsConnector.ts +0 -21
- package/src/Connector/__tests__/WflowPatchContractsConnector.ts +0 -21
- package/src/Connector/__tests__/WflowPatchCostCentersConnector.ts +0 -21
- package/src/Connector/__tests__/WflowPatchSeriesConnector.ts +0 -21
- package/src/Connector/__tests__/WflowPatchVatControlStatementLinesConnector.ts +0 -21
- package/src/Connector/__tests__/WflowPatchVatReturnLinesConnector.ts +0 -21
- package/src/Connector/__tests__/WflowPutDocumentConnector.ts +0 -17
- package/src/Connector/__tests__/WflowUpdateDocumentState.ts +0 -17
- package/src/WflowApplication.ts +0 -151
- package/test/dataProvider.ts +0 -74
- package/tsconfig.json +0 -9
- package/tsconfig.prod.json +0 -10
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
|
|
2
|
+
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-subscribe-webhooks-batch";
|
|
4
|
+
export default class WflowSubscribeWebhookBatch extends ABatchNode {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: BatchProcessDto): Promise<BatchProcessDto>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const Webhook_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Application/Database/Webhook"));
|
|
8
|
+
const ABatchNode_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode"));
|
|
9
|
+
const TopologyRunner_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Topology/TopologyRunner"));
|
|
10
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
11
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
12
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
13
|
+
exports.NAME = `${WflowApplication_1.NAME}-subscribe-webhooks-batch`;
|
|
14
|
+
class WflowSubscribeWebhookBatch extends ABatchNode_1.default {
|
|
15
|
+
getName() {
|
|
16
|
+
return exports.NAME;
|
|
17
|
+
}
|
|
18
|
+
async processAction(dto) {
|
|
19
|
+
const app = this.getApplication();
|
|
20
|
+
const subscriptions = app.getWebhookSubscriptions();
|
|
21
|
+
const appInstall = await this.getApplicationInstallFromProcess(dto);
|
|
22
|
+
const repository = this.getDbClient().getRepository(Webhook_1.default);
|
|
23
|
+
const registeredEvents = (await repository.findMany({
|
|
24
|
+
users: [appInstall.getUser()],
|
|
25
|
+
apps: [appInstall.getName()],
|
|
26
|
+
sdks: [appInstall.getSdk()],
|
|
27
|
+
})).map((webhook) => webhook.getName());
|
|
28
|
+
const unsubscribed = subscriptions.find((subscription) => !registeredEvents.some((event) => subscription.getName() === event));
|
|
29
|
+
if (!unsubscribed) {
|
|
30
|
+
return dto;
|
|
31
|
+
}
|
|
32
|
+
let organization;
|
|
33
|
+
try {
|
|
34
|
+
organization = app.getOrganization(appInstall);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return dto;
|
|
38
|
+
}
|
|
39
|
+
const token = crypto_1.default.randomBytes(64).toString('hex');
|
|
40
|
+
const request = app.getRequestDto(dto, appInstall, HttpMethods_1.HttpMethods.PUT, `/${organization}/webhookregistrations`, {
|
|
41
|
+
actions: [unsubscribed.getName()],
|
|
42
|
+
webhookUri: TopologyRunner_1.default.getWebhookUrl(unsubscribed.getTopology(), unsubscribed.getNode(), token),
|
|
43
|
+
});
|
|
44
|
+
const id = (await this.getSender().send(request)).getJsonBody();
|
|
45
|
+
await repository.insert(new Webhook_1.default()
|
|
46
|
+
.setWebhookId(id)
|
|
47
|
+
.setUser(appInstall.getUser())
|
|
48
|
+
.setSdk(appInstall.getSdk())
|
|
49
|
+
.setNode(unsubscribed.getNode())
|
|
50
|
+
.setToken(token)
|
|
51
|
+
.setApplication(appInstall.getName())
|
|
52
|
+
.setTopology(unsubscribed.getTopology())
|
|
53
|
+
.setName(unsubscribed.getName()));
|
|
54
|
+
return dto.setBatchCursor('1', true);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.default = WflowSubscribeWebhookBatch;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
|
|
2
|
+
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-unsubscribe-webhooks-batch";
|
|
4
|
+
export default class WflowUnsubscribeWebhookBatch extends ABatchNode {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: BatchProcessDto): Promise<BatchProcessDto>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const Webhook_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Application/Database/Webhook"));
|
|
8
|
+
const ABatchNode_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode"));
|
|
9
|
+
const OnRepeatException_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Exception/OnRepeatException"));
|
|
10
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
11
|
+
const http_status_codes_1 = require("http-status-codes");
|
|
12
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
13
|
+
exports.NAME = `${WflowApplication_1.NAME}-unsubscribe-webhooks-batch`;
|
|
14
|
+
class WflowUnsubscribeWebhookBatch extends ABatchNode_1.default {
|
|
15
|
+
getName() {
|
|
16
|
+
return exports.NAME;
|
|
17
|
+
}
|
|
18
|
+
async processAction(dto) {
|
|
19
|
+
const app = this.getApplication();
|
|
20
|
+
const appInstall = await this.getApplicationInstallFromProcess(dto, null);
|
|
21
|
+
const repository = this.getDbClient().getRepository(Webhook_1.default);
|
|
22
|
+
const webhook = await repository.findOne({
|
|
23
|
+
users: [appInstall.getUser()],
|
|
24
|
+
apps: [appInstall.getName()],
|
|
25
|
+
sdks: [appInstall.getSdk()],
|
|
26
|
+
});
|
|
27
|
+
if (!webhook) {
|
|
28
|
+
return dto;
|
|
29
|
+
}
|
|
30
|
+
let organization;
|
|
31
|
+
try {
|
|
32
|
+
organization = app.getOrganization(appInstall);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return dto;
|
|
36
|
+
}
|
|
37
|
+
const request = app.getRequestDto(dto, appInstall, HttpMethods_1.HttpMethods.DELETE, `/${organization}/webhookregistrations/${webhook.getWebhookId()}`);
|
|
38
|
+
const response = await this.getSender().send(request);
|
|
39
|
+
if (response.getResponseCode() !== http_status_codes_1.StatusCodes.OK) {
|
|
40
|
+
await repository.update(webhook.setUnsubscribeFailed(true));
|
|
41
|
+
throw new OnRepeatException_1.default(300, 12, response.getBody());
|
|
42
|
+
}
|
|
43
|
+
await repository.remove(webhook);
|
|
44
|
+
return dto.setBatchCursor('1', true);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.default = WflowUnsubscribeWebhookBatch;
|
package/{src/Connector/WflowGetDocumentConnector.ts → dist/Connector/WflowGetDocumentConnector.d.ts}
RENAMED
|
@@ -1,39 +1,13 @@
|
|
|
1
1
|
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
-
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
3
2
|
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const NAME = `${WFLOW_APP_NAME}-get-document-connector`;
|
|
7
|
-
|
|
3
|
+
export declare const NAME = "wflow-get-document-connector";
|
|
8
4
|
export default class WflowGetDocumentConnector extends AConnector {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return NAME;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
|
|
15
|
-
const app = this.getApplication<WflowApplication>();
|
|
16
|
-
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
17
|
-
const { documentId } = dto.getJsonData();
|
|
18
|
-
|
|
19
|
-
const request = app.getRequestDto(
|
|
20
|
-
dto,
|
|
21
|
-
applicationInstall,
|
|
22
|
-
HttpMethods.GET,
|
|
23
|
-
`/${app.getOrganization(applicationInstall)}/documents/${documentId}`,
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
const response = (await this.getSender().send<IOutput>(request)).getJsonBody();
|
|
27
|
-
|
|
28
|
-
return dto.setNewJsonData(response);
|
|
29
|
-
}
|
|
30
|
-
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>>;
|
|
31
7
|
}
|
|
32
|
-
|
|
33
8
|
export interface IInput {
|
|
34
9
|
documentId: string;
|
|
35
10
|
}
|
|
36
|
-
|
|
37
11
|
export interface IOutput {
|
|
38
12
|
id: string;
|
|
39
13
|
serie: Serie;
|
|
@@ -199,7 +173,6 @@ export interface IOutput {
|
|
|
199
173
|
transactionId: string;
|
|
200
174
|
expenseCardId: string;
|
|
201
175
|
}
|
|
202
|
-
|
|
203
176
|
interface Serie {
|
|
204
177
|
id: string;
|
|
205
178
|
externalId: string;
|
|
@@ -209,7 +182,6 @@ interface Serie {
|
|
|
209
182
|
kind: string;
|
|
210
183
|
invoiceType: string;
|
|
211
184
|
}
|
|
212
|
-
|
|
213
185
|
interface Accounting {
|
|
214
186
|
businessItemCode: string;
|
|
215
187
|
accountingRule: {
|
|
@@ -314,7 +286,6 @@ interface Accounting {
|
|
|
314
286
|
vatFixedAssets: boolean;
|
|
315
287
|
vatMode: string;
|
|
316
288
|
}
|
|
317
|
-
|
|
318
289
|
interface CostCenter {
|
|
319
290
|
id: string;
|
|
320
291
|
externalId: string;
|
|
@@ -322,7 +293,6 @@ interface CostCenter {
|
|
|
322
293
|
description: string;
|
|
323
294
|
isValid: boolean;
|
|
324
295
|
}
|
|
325
|
-
|
|
326
296
|
export interface Contract {
|
|
327
297
|
id: string;
|
|
328
298
|
externalId: string;
|
|
@@ -330,7 +300,6 @@ export interface Contract {
|
|
|
330
300
|
description: string;
|
|
331
301
|
isValid: boolean;
|
|
332
302
|
}
|
|
333
|
-
|
|
334
303
|
export interface Activity {
|
|
335
304
|
id: string;
|
|
336
305
|
externalId: string;
|
|
@@ -338,3 +307,4 @@ export interface Activity {
|
|
|
338
307
|
description: string;
|
|
339
308
|
isValid: boolean;
|
|
340
309
|
}
|
|
310
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-get-document-connector`;
|
|
11
|
+
class WflowGetDocumentConnector extends AConnector_1.default {
|
|
12
|
+
getName() {
|
|
13
|
+
return exports.NAME;
|
|
14
|
+
}
|
|
15
|
+
async processAction(dto) {
|
|
16
|
+
const app = this.getApplication();
|
|
17
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
18
|
+
const { documentId } = dto.getJsonData();
|
|
19
|
+
const request = app.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.GET, `/${app.getOrganization(applicationInstall)}/documents/${documentId}`);
|
|
20
|
+
const response = (await this.getSender().send(request)).getJsonBody();
|
|
21
|
+
return dto.setNewJsonData(response);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = WflowGetDocumentConnector;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-get-document-main-file-connector";
|
|
4
|
+
export default class WflowGetDocumentMainFileConnector extends AConnector {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>>;
|
|
7
|
+
}
|
|
8
|
+
export interface IInput {
|
|
9
|
+
documentId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IOutput {
|
|
12
|
+
file: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const Headers_1 = require("@orchesty/nodejs-sdk/dist/lib/Utils/Headers");
|
|
10
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
11
|
+
exports.NAME = `${WflowApplication_1.NAME}-get-document-main-file-connector`;
|
|
12
|
+
class WflowGetDocumentMainFileConnector extends AConnector_1.default {
|
|
13
|
+
getName() {
|
|
14
|
+
return exports.NAME;
|
|
15
|
+
}
|
|
16
|
+
async processAction(dto) {
|
|
17
|
+
const { documentId } = dto.getJsonData();
|
|
18
|
+
const application = this.getApplication();
|
|
19
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
20
|
+
const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.GET, `/${application.getOrganization(applicationInstall)}/documents/${documentId}/files/main/download`).addHeaders({ [Headers_1.CommonHeaders.ACCEPT]: 'application/octet-stream' });
|
|
21
|
+
const responseDto = await this.getSender().send(requestDto, [200]);
|
|
22
|
+
return dto.setNewJsonData({ file: responseDto.getBuffer().toString('base64') });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = WflowGetDocumentMainFileConnector;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-get-document-types-connector";
|
|
4
|
+
export default class WflowGetDocumentTypesConnector extends AConnector {
|
|
5
|
+
private readonly useInForm;
|
|
6
|
+
constructor(useInForm?: boolean);
|
|
7
|
+
getName(): string;
|
|
8
|
+
processAction(dto: ProcessDto): Promise<ProcessDto<IOutput[]>>;
|
|
9
|
+
}
|
|
10
|
+
export interface IOutput {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
default: boolean;
|
|
15
|
+
erpExclude: boolean;
|
|
16
|
+
filesExtendName: boolean;
|
|
17
|
+
docCreatingMethod: string;
|
|
18
|
+
autoStamp: string;
|
|
19
|
+
serie?: {
|
|
20
|
+
id: string;
|
|
21
|
+
externalId?: string;
|
|
22
|
+
code?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
isValid?: boolean;
|
|
25
|
+
kind?: string;
|
|
26
|
+
invoiceType?: string;
|
|
27
|
+
};
|
|
28
|
+
sequence?: {
|
|
29
|
+
id: string;
|
|
30
|
+
entity?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
fixedPart?: string;
|
|
33
|
+
counter?: string;
|
|
34
|
+
};
|
|
35
|
+
invoiceType?: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-get-document-types-connector`;
|
|
11
|
+
class WflowGetDocumentTypesConnector extends AConnector_1.default {
|
|
12
|
+
useInForm;
|
|
13
|
+
constructor(useInForm = false) {
|
|
14
|
+
super();
|
|
15
|
+
this.useInForm = useInForm;
|
|
16
|
+
}
|
|
17
|
+
getName() {
|
|
18
|
+
return exports.NAME;
|
|
19
|
+
}
|
|
20
|
+
async processAction(dto) {
|
|
21
|
+
const application = this.getApplication();
|
|
22
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto, this.useInForm ? null : true);
|
|
23
|
+
const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.GET, `/${application.getOrganization(applicationInstall)}/documents/types?pageSize=100`);
|
|
24
|
+
const responseDto = await this.getSender().send(requestDto);
|
|
25
|
+
return dto.setNewJsonData(responseDto.getJsonBody().items);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = WflowGetDocumentTypesConnector;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-get-organizations-connector";
|
|
4
|
+
export default class WflowGetOrganizationsConnector extends AConnector {
|
|
5
|
+
private readonly useInForm;
|
|
6
|
+
constructor(useInForm?: boolean);
|
|
7
|
+
getName(): string;
|
|
8
|
+
processAction(dto: ProcessDto): Promise<ProcessDto<IOutput[]>>;
|
|
9
|
+
}
|
|
10
|
+
export interface IOutput {
|
|
11
|
+
name: string;
|
|
12
|
+
baseURL: string;
|
|
13
|
+
subdomain: string;
|
|
14
|
+
trialExpiration?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-get-organizations-connector`;
|
|
11
|
+
class WflowGetOrganizationsConnector extends AConnector_1.default {
|
|
12
|
+
useInForm;
|
|
13
|
+
constructor(useInForm = false) {
|
|
14
|
+
super();
|
|
15
|
+
this.useInForm = useInForm;
|
|
16
|
+
}
|
|
17
|
+
getName() {
|
|
18
|
+
return exports.NAME;
|
|
19
|
+
}
|
|
20
|
+
async processAction(dto) {
|
|
21
|
+
const app = this.getApplication();
|
|
22
|
+
const request = await app.getRequestDto(dto, await this.getApplicationInstallFromProcess(dto, this.useInForm ? null : true), HttpMethods_1.HttpMethods.GET, '/user/myorganizations');
|
|
23
|
+
const response = (await this.getSender().send(request)).getJsonBody();
|
|
24
|
+
return dto.setNewJsonData(response);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = WflowGetOrganizationsConnector;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-patch-accounting-rules-connector";
|
|
4
|
+
export default class WflowPatchAccountingRulesConnector extends AConnector {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>>;
|
|
7
|
+
}
|
|
8
|
+
export type DocumentKind = 'IncomingInvoice' | 'OutgoingInvoice' | 'ExpenditureCashSlip' | 'SupplierOrder' | 'CustomerOrder' | 'Other' | 'Contract' | 'IncomeCashReceipt';
|
|
9
|
+
export interface IInput {
|
|
10
|
+
id?: string | null;
|
|
11
|
+
externalId?: string | null;
|
|
12
|
+
code?: string | null;
|
|
13
|
+
description?: string | null;
|
|
14
|
+
isValid?: boolean;
|
|
15
|
+
kind?: DocumentKind;
|
|
16
|
+
}
|
|
17
|
+
export type IOutput = IInput | IInput[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-patch-accounting-rules-connector`;
|
|
11
|
+
class WflowPatchAccountingRulesConnector extends AConnector_1.default {
|
|
12
|
+
getName() {
|
|
13
|
+
return exports.NAME;
|
|
14
|
+
}
|
|
15
|
+
async processAction(dto) {
|
|
16
|
+
const data = dto.getJsonData();
|
|
17
|
+
const application = this.getApplication();
|
|
18
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
19
|
+
const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PATCH, `/${application.getOrganization(applicationInstall)}/registers/accountingrules`, Array.isArray(data) ? data : [data]);
|
|
20
|
+
await this.getSender().send(requestDto, [200]);
|
|
21
|
+
return dto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = WflowPatchAccountingRulesConnector;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-patch-chart-of-accounts-connector";
|
|
4
|
+
export default class WflowPatchChartOfAccountsConnector extends AConnector {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>>;
|
|
7
|
+
}
|
|
8
|
+
export interface IInput {
|
|
9
|
+
id?: string | null;
|
|
10
|
+
externalId?: string | null;
|
|
11
|
+
code?: string | null;
|
|
12
|
+
description?: string | null;
|
|
13
|
+
isValid?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type IOutput = IInput | IInput[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-patch-chart-of-accounts-connector`;
|
|
11
|
+
class WflowPatchChartOfAccountsConnector extends AConnector_1.default {
|
|
12
|
+
getName() {
|
|
13
|
+
return exports.NAME;
|
|
14
|
+
}
|
|
15
|
+
async processAction(dto) {
|
|
16
|
+
const data = dto.getJsonData();
|
|
17
|
+
const application = this.getApplication();
|
|
18
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
19
|
+
const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PATCH, `/${application.getOrganization(applicationInstall)}/registers/chartofaccounts`, Array.isArray(data) ? data : [data]);
|
|
20
|
+
await this.getSender().send(requestDto, [200]);
|
|
21
|
+
return dto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = WflowPatchChartOfAccountsConnector;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-patch-contracts-connector";
|
|
4
|
+
export default class WflowPatchContractsConnector extends AConnector {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>>;
|
|
7
|
+
}
|
|
8
|
+
export interface IInput {
|
|
9
|
+
id?: string | null;
|
|
10
|
+
externalId?: string | null;
|
|
11
|
+
code?: string | null;
|
|
12
|
+
description?: string | null;
|
|
13
|
+
isValid?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type IOutput = IInput | IInput[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-patch-contracts-connector`;
|
|
11
|
+
class WflowPatchContractsConnector extends AConnector_1.default {
|
|
12
|
+
getName() {
|
|
13
|
+
return exports.NAME;
|
|
14
|
+
}
|
|
15
|
+
async processAction(dto) {
|
|
16
|
+
const data = dto.getJsonData();
|
|
17
|
+
const application = this.getApplication();
|
|
18
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
19
|
+
const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PATCH, `/${application.getOrganization(applicationInstall)}/registers/contracts`, Array.isArray(data) ? data : [data]);
|
|
20
|
+
await this.getSender().send(requestDto, [200]);
|
|
21
|
+
return dto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = WflowPatchContractsConnector;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-patch-cost-centers-connector";
|
|
4
|
+
export default class WflowPatchCostCentersConnector extends AConnector {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>>;
|
|
7
|
+
}
|
|
8
|
+
export interface IInput {
|
|
9
|
+
id?: string | null;
|
|
10
|
+
externalId?: string | null;
|
|
11
|
+
code?: string | null;
|
|
12
|
+
description?: string | null;
|
|
13
|
+
isValid?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type IOutput = IInput | IInput[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-patch-cost-centers-connector`;
|
|
11
|
+
class WflowPatchCostCentersConnector extends AConnector_1.default {
|
|
12
|
+
getName() {
|
|
13
|
+
return exports.NAME;
|
|
14
|
+
}
|
|
15
|
+
async processAction(dto) {
|
|
16
|
+
const data = dto.getJsonData();
|
|
17
|
+
const application = this.getApplication();
|
|
18
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
19
|
+
const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PATCH, `/${application.getOrganization(applicationInstall)}/registers/costcenters`, Array.isArray(data) ? data : [data]);
|
|
20
|
+
await this.getSender().send(requestDto, [200]);
|
|
21
|
+
return dto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = WflowPatchCostCentersConnector;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-patch-series-connector";
|
|
4
|
+
export default class WflowPatchSeriesConnector extends AConnector {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>>;
|
|
7
|
+
}
|
|
8
|
+
export type DocumentKind = 'IncomingInvoice' | 'OutgoingInvoice' | 'ExpenditureCashSlip' | 'SupplierOrder' | 'CustomerOrder' | 'Other' | 'Contract' | 'IncomeCashReceipt';
|
|
9
|
+
export type InvoiceType = 'TaxInvoice' | 'CreditNote' | 'DebitNote' | 'Proforma' | 'TaxInvoicePayment';
|
|
10
|
+
export interface IInput {
|
|
11
|
+
id?: string | null;
|
|
12
|
+
externalId?: string | null;
|
|
13
|
+
code?: string | null;
|
|
14
|
+
description?: string | null;
|
|
15
|
+
isValid?: boolean;
|
|
16
|
+
kind?: DocumentKind;
|
|
17
|
+
invoiceType?: InvoiceType;
|
|
18
|
+
}
|
|
19
|
+
export type IOutput = IInput | IInput[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-patch-series-connector`;
|
|
11
|
+
class WflowPatchSeriesConnector extends AConnector_1.default {
|
|
12
|
+
getName() {
|
|
13
|
+
return exports.NAME;
|
|
14
|
+
}
|
|
15
|
+
async processAction(dto) {
|
|
16
|
+
const data = dto.getJsonData();
|
|
17
|
+
const application = this.getApplication();
|
|
18
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
19
|
+
const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PATCH, `/${application.getOrganization(applicationInstall)}/registers/series`, Array.isArray(data) ? data : [data]);
|
|
20
|
+
await this.getSender().send(requestDto, [200]);
|
|
21
|
+
return dto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = WflowPatchSeriesConnector;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
|
|
2
|
+
import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
|
|
3
|
+
export declare const NAME = "wflow-patch-vat-control-statement-lines-connector";
|
|
4
|
+
export default class WflowPatchVatControlStatementLinesConnector extends AConnector {
|
|
5
|
+
getName(): string;
|
|
6
|
+
processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>>;
|
|
7
|
+
}
|
|
8
|
+
export interface IInput {
|
|
9
|
+
id?: string | null;
|
|
10
|
+
externalId?: string | null;
|
|
11
|
+
code?: string | null;
|
|
12
|
+
description?: string | null;
|
|
13
|
+
isValid?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type IOutput = IInput | IInput[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NAME = void 0;
|
|
7
|
+
const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
|
|
8
|
+
const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
|
|
9
|
+
const WflowApplication_1 = require("../WflowApplication");
|
|
10
|
+
exports.NAME = `${WflowApplication_1.NAME}-patch-vat-control-statement-lines-connector`;
|
|
11
|
+
class WflowPatchVatControlStatementLinesConnector extends AConnector_1.default {
|
|
12
|
+
getName() {
|
|
13
|
+
return exports.NAME;
|
|
14
|
+
}
|
|
15
|
+
async processAction(dto) {
|
|
16
|
+
const data = dto.getJsonData();
|
|
17
|
+
const application = this.getApplication();
|
|
18
|
+
const applicationInstall = await this.getApplicationInstallFromProcess(dto);
|
|
19
|
+
const requestDto = application.getRequestDto(dto, applicationInstall, HttpMethods_1.HttpMethods.PATCH, `/${application.getOrganization(applicationInstall)}/registers/vatcontrolstatementlines`, Array.isArray(data) ? data : [data]);
|
|
20
|
+
await this.getSender().send(requestDto, [200]);
|
|
21
|
+
return dto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = WflowPatchVatControlStatementLinesConnector;
|