@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.
Files changed (134) hide show
  1. package/dist/Batch/WflowSubscribeWebhookBatch.d.ts +7 -0
  2. package/dist/Batch/WflowSubscribeWebhookBatch.js +57 -0
  3. package/dist/Batch/WflowUnsubscribeWebhookBatch.d.ts +7 -0
  4. package/dist/Batch/WflowUnsubscribeWebhookBatch.js +47 -0
  5. package/{src/Connector/WflowGetDocumentConnector.ts → dist/Connector/WflowGetDocumentConnector.d.ts} +4 -34
  6. package/dist/Connector/WflowGetDocumentConnector.js +24 -0
  7. package/dist/Connector/WflowGetDocumentMainFileConnector.d.ts +13 -0
  8. package/dist/Connector/WflowGetDocumentMainFileConnector.js +25 -0
  9. package/dist/Connector/WflowGetDocumentTypesConnector.d.ts +36 -0
  10. package/dist/Connector/WflowGetDocumentTypesConnector.js +28 -0
  11. package/dist/Connector/WflowGetOrganizationsConnector.d.ts +15 -0
  12. package/dist/Connector/WflowGetOrganizationsConnector.js +27 -0
  13. package/dist/Connector/WflowPatchAccountingRulesConnector.d.ts +17 -0
  14. package/dist/Connector/WflowPatchAccountingRulesConnector.js +24 -0
  15. package/dist/Connector/WflowPatchChartOfAccountsConnector.d.ts +15 -0
  16. package/dist/Connector/WflowPatchChartOfAccountsConnector.js +24 -0
  17. package/dist/Connector/WflowPatchContractsConnector.d.ts +15 -0
  18. package/dist/Connector/WflowPatchContractsConnector.js +24 -0
  19. package/dist/Connector/WflowPatchCostCentersConnector.d.ts +15 -0
  20. package/dist/Connector/WflowPatchCostCentersConnector.js +24 -0
  21. package/dist/Connector/WflowPatchSeriesConnector.d.ts +19 -0
  22. package/dist/Connector/WflowPatchSeriesConnector.js +24 -0
  23. package/dist/Connector/WflowPatchVatControlStatementLinesConnector.d.ts +15 -0
  24. package/dist/Connector/WflowPatchVatControlStatementLinesConnector.js +24 -0
  25. package/dist/Connector/WflowPatchVatReturnLinesConnector.d.ts +16 -0
  26. package/dist/Connector/WflowPatchVatReturnLinesConnector.js +24 -0
  27. package/{src/Connector/WflowPutDocumentConnector.ts → dist/Connector/WflowPutDocumentConnector.d.ts} +5 -37
  28. package/dist/Connector/WflowPutDocumentConnector.js +31 -0
  29. package/dist/Connector/WflowUpdateDocumentStateConnector.d.ts +11 -0
  30. package/dist/Connector/WflowUpdateDocumentStateConnector.js +24 -0
  31. package/dist/WflowApplication.d.ts +41 -0
  32. package/dist/WflowApplication.js +133 -0
  33. package/dist/package.json +26 -0
  34. package/package.json +5 -2
  35. package/CHANGELOG.md +0 -49
  36. package/jest.config.js +0 -13
  37. package/src/Batch/WflowSubscribeWebhookBatch.ts +0 -84
  38. package/src/Batch/WflowUnsubscribeWebhookBatch.ts +0 -59
  39. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/input.json +0 -7
  40. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/mock.json +0 -5
  41. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/output.json +0 -7
  42. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/input.json +0 -7
  43. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/mock.json +0 -5
  44. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/output.json +0 -7
  45. package/src/Batch/__tests__/WflowSubscribeWebhookBatch.ts +0 -17
  46. package/src/Batch/__tests__/WflowUnsubscribeWebhookBatch.ts +0 -17
  47. package/src/Connector/WflowGetDocumentMainFileConnector.ts +0 -40
  48. package/src/Connector/WflowGetDocumentTypesConnector.ts +0 -69
  49. package/src/Connector/WflowGetOrganizationsConnector.ts +0 -40
  50. package/src/Connector/WflowPatchAccountingRulesConnector.ts +0 -53
  51. package/src/Connector/WflowPatchChartOfAccountsConnector.ts +0 -42
  52. package/src/Connector/WflowPatchContractsConnector.ts +0 -42
  53. package/src/Connector/WflowPatchCostCentersConnector.ts +0 -42
  54. package/src/Connector/WflowPatchSeriesConnector.ts +0 -61
  55. package/src/Connector/WflowPatchVatControlStatementLinesConnector.ts +0 -42
  56. package/src/Connector/WflowPatchVatReturnLinesConnector.ts +0 -43
  57. package/src/Connector/WflowUpdateDocumentStateConnector.ts +0 -36
  58. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/input.json +0 -10
  59. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/mock.json +0 -449
  60. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/output.json +0 -451
  61. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/input.json +0 -9
  62. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/mock.json +0 -5
  63. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/output.json +0 -9
  64. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/input.json +0 -7
  65. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/mock.json +0 -32
  66. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/output.json +0 -29
  67. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/input.json +0 -7
  68. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/mock.json +0 -12
  69. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/output.json +0 -14
  70. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-input.json +0 -20
  71. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-mock.json +0 -5
  72. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-output.json +0 -20
  73. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/input.json +0 -12
  74. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/mock.json +0 -5
  75. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/output.json +0 -12
  76. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-input.json +0 -18
  77. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-mock.json +0 -5
  78. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-output.json +0 -18
  79. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/input.json +0 -11
  80. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/mock.json +0 -5
  81. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/output.json +0 -11
  82. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-input.json +0 -18
  83. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-mock.json +0 -5
  84. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-output.json +0 -18
  85. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/input.json +0 -11
  86. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/mock.json +0 -5
  87. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/output.json +0 -11
  88. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-input.json +0 -18
  89. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-mock.json +0 -5
  90. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-output.json +0 -18
  91. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/input.json +0 -11
  92. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/mock.json +0 -5
  93. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/output.json +0 -11
  94. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-input.json +0 -20
  95. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-mock.json +0 -5
  96. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-output.json +0 -20
  97. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/input.json +0 -12
  98. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/mock.json +0 -5
  99. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/output.json +0 -12
  100. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-input.json +0 -18
  101. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-mock.json +0 -5
  102. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-output.json +0 -18
  103. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/input.json +0 -11
  104. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/mock.json +0 -5
  105. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/output.json +0 -11
  106. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-input.json +0 -20
  107. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-mock.json +0 -5
  108. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-output.json +0 -20
  109. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/input.json +0 -12
  110. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/mock.json +0 -5
  111. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/output.json +0 -12
  112. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/input.json +0 -10
  113. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/mock.json +0 -5
  114. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/output.json +0 -10
  115. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/input.json +0 -9
  116. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/mock.json +0 -5
  117. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/output.json +0 -9
  118. package/src/Connector/__tests__/WflowGetDocumentConnector.ts +0 -17
  119. package/src/Connector/__tests__/WflowGetDocumentMainFileConnector.ts +0 -17
  120. package/src/Connector/__tests__/WflowGetDocumentTypesConnector.ts +0 -17
  121. package/src/Connector/__tests__/WflowGetOrganizationsConnector.ts +0 -17
  122. package/src/Connector/__tests__/WflowPatchAccountingRulesConnector.ts +0 -21
  123. package/src/Connector/__tests__/WflowPatchChartOfAccountsConnector.ts +0 -21
  124. package/src/Connector/__tests__/WflowPatchContractsConnector.ts +0 -21
  125. package/src/Connector/__tests__/WflowPatchCostCentersConnector.ts +0 -21
  126. package/src/Connector/__tests__/WflowPatchSeriesConnector.ts +0 -21
  127. package/src/Connector/__tests__/WflowPatchVatControlStatementLinesConnector.ts +0 -21
  128. package/src/Connector/__tests__/WflowPatchVatReturnLinesConnector.ts +0 -21
  129. package/src/Connector/__tests__/WflowPutDocumentConnector.ts +0 -17
  130. package/src/Connector/__tests__/WflowUpdateDocumentState.ts +0 -17
  131. package/src/WflowApplication.ts +0 -151
  132. package/test/dataProvider.ts +0 -74
  133. package/tsconfig.json +0 -9
  134. package/tsconfig.prod.json +0 -10
@@ -1,17 +0,0 @@
1
- import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
2
- import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
3
- import init from '../../../test/dataProvider';
4
- import { NAME as WFLOW_SUBSCRIBE_WEBHOOK_BATCH } from '../WflowSubscribeWebhookBatch';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowSubscribeWebhookBatch', () => {
9
- beforeEach(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testBatch(WFLOW_SUBSCRIBE_WEBHOOK_BATCH);
16
- });
17
- });
@@ -1,17 +0,0 @@
1
- import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
2
- import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
3
- import init from '../../../test/dataProvider';
4
- import { NAME as WFLOW_UNSUBSCRIBE_WEBHOOK_BATCH } from '../WflowUnsubscribeWebhookBatch';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowUnsubscribeWebhookBatch', () => {
9
- beforeEach(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testBatch(WFLOW_UNSUBSCRIBE_WEBHOOK_BATCH);
16
- });
17
- });
@@ -1,40 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import { CommonHeaders } from '@orchesty/nodejs-sdk/dist/lib/Utils/Headers';
4
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
5
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
6
-
7
- export const NAME = `${WFLOW_APP_NAME}-get-document-main-file-connector`;
8
-
9
- export default class WflowGetDocumentMainFileConnector extends AConnector {
10
-
11
- public getName(): string {
12
- return NAME;
13
- }
14
-
15
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
16
- const { documentId } = dto.getJsonData();
17
- const application = this.getApplication<WflowApplication>();
18
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
19
-
20
- const requestDto = application.getRequestDto(
21
- dto,
22
- applicationInstall,
23
- HttpMethods.GET,
24
- `/${application.getOrganization(applicationInstall)}/documents/${documentId}/files/main/download`,
25
- ).addHeaders({ [CommonHeaders.ACCEPT]: 'application/octet-stream' });
26
-
27
- const responseDto = await this.getSender().send(requestDto, [200]);
28
-
29
- return dto.setNewJsonData({ file: responseDto.getBuffer().toString('base64') });
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- documentId: string;
36
- }
37
-
38
- export interface IOutput {
39
- file: string;
40
- }
@@ -1,69 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APPLICATION } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APPLICATION}-get-document-types-connector`;
7
-
8
- export default class WflowGetDocumentTypesConnector extends AConnector {
9
-
10
- public constructor(private readonly useInForm = false) {
11
- super();
12
- }
13
-
14
- public getName(): string {
15
- return NAME;
16
- }
17
-
18
- public async processAction(dto: ProcessDto): Promise<ProcessDto<IOutput[]>> {
19
- const application = this.getApplication<WflowApplication>();
20
- const applicationInstall = await this.getApplicationInstallFromProcess(dto, this.useInForm ? null : true);
21
-
22
- const requestDto = application.getRequestDto(
23
- dto,
24
- applicationInstall,
25
- HttpMethods.GET,
26
- `/${application.getOrganization(applicationInstall)}/documents/types?pageSize=100`,
27
- );
28
-
29
- const responseDto = await this.getSender().send<IResponse>(requestDto);
30
-
31
- return dto.setNewJsonData(responseDto.getJsonBody().items);
32
- }
33
-
34
- }
35
-
36
- export interface IOutput {
37
- id: string;
38
- name: string;
39
- kind: string;
40
- default: boolean;
41
- erpExclude: boolean;
42
- filesExtendName: boolean;
43
- docCreatingMethod: string;
44
- autoStamp: string;
45
- serie?: {
46
- id: string;
47
- externalId?: string;
48
- code?: string;
49
- description?: string;
50
- isValid?: boolean;
51
- kind?: string;
52
- invoiceType?: string;
53
- };
54
- sequence?: {
55
- id: string;
56
- entity?: string;
57
- description?: string;
58
- fixedPart?: string;
59
- counter?: string;
60
- };
61
- invoiceType?: string;
62
- }
63
-
64
- interface IResponse {
65
- items: IOutput[];
66
- totalItems: number;
67
- pageSize: number;
68
- page: number;
69
- }
@@ -1,40 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import { NAME as WFLOW_APPLICATION } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APPLICATION}-get-organizations-connector`;
7
-
8
- export default class WflowGetOrganizationsConnector extends AConnector {
9
-
10
- public constructor(private readonly useInForm = false) {
11
- super();
12
- }
13
-
14
- public getName(): string {
15
- return NAME;
16
- }
17
-
18
- public async processAction(dto: ProcessDto): Promise<ProcessDto<IOutput[]>> {
19
- const app = this.getApplication();
20
-
21
- const request = await app.getRequestDto(
22
- dto,
23
- await this.getApplicationInstallFromProcess(dto, this.useInForm ? null : true),
24
- HttpMethods.GET,
25
- '/user/myorganizations',
26
- );
27
-
28
- const response = (await this.getSender().send<IOutput[]>(request)).getJsonBody();
29
-
30
- return dto.setNewJsonData(response);
31
- }
32
-
33
- }
34
-
35
- export interface IOutput {
36
- name: string;
37
- baseURL: string;
38
- subdomain: string;
39
- trialExpiration?: string;
40
- }
@@ -1,53 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-accounting-rules-connector`;
7
-
8
- export default class WflowPatchAccountingRulesConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/accountingrules`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export type DocumentKind =
35
- | 'IncomingInvoice'
36
- | 'OutgoingInvoice'
37
- | 'ExpenditureCashSlip'
38
- | 'SupplierOrder'
39
- | 'CustomerOrder'
40
- | 'Other'
41
- | 'Contract'
42
- | 'IncomeCashReceipt';
43
-
44
- export interface IInput {
45
- id?: string | null;
46
- externalId?: string | null;
47
- code?: string | null;
48
- description?: string | null;
49
- isValid?: boolean;
50
- kind?: DocumentKind;
51
- }
52
-
53
- export type IOutput = IInput | IInput[];
@@ -1,42 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-chart-of-accounts-connector`;
7
-
8
- export default class WflowPatchChartOfAccountsConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/chartofaccounts`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- }
41
-
42
- export type IOutput = IInput | IInput[];
@@ -1,42 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-contracts-connector`;
7
-
8
- export default class WflowPatchContractsConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/contracts`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- }
41
-
42
- export type IOutput = IInput | IInput[];
@@ -1,42 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-cost-centers-connector`;
7
-
8
- export default class WflowPatchCostCentersConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/costcenters`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- }
41
-
42
- export type IOutput = IInput | IInput[];
@@ -1,61 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-series-connector`;
7
-
8
- export default class WflowPatchSeriesConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/series`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export type DocumentKind =
35
- | 'IncomingInvoice'
36
- | 'OutgoingInvoice'
37
- | 'ExpenditureCashSlip'
38
- | 'SupplierOrder'
39
- | 'CustomerOrder'
40
- | 'Other'
41
- | 'Contract'
42
- | 'IncomeCashReceipt';
43
-
44
- export type InvoiceType =
45
- | 'TaxInvoice'
46
- | 'CreditNote'
47
- | 'DebitNote'
48
- | 'Proforma'
49
- | 'TaxInvoicePayment';
50
-
51
- export interface IInput {
52
- id?: string | null;
53
- externalId?: string | null;
54
- code?: string | null;
55
- description?: string | null;
56
- isValid?: boolean;
57
- kind?: DocumentKind;
58
- invoiceType?: InvoiceType;
59
- }
60
-
61
- export type IOutput = IInput | IInput[];
@@ -1,42 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-vat-control-statement-lines-connector`;
7
-
8
- export default class WflowPatchVatControlStatementLinesConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/vatcontrolstatementlines`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- }
41
-
42
- export type IOutput = IInput | IInput[];
@@ -1,43 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-patch-vat-return-lines-connector`;
7
-
8
- export default class WflowPatchVatReturnLinesConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput | IInput[]>): Promise<ProcessDto<IOutput>> {
15
- const data = dto.getJsonData();
16
- const application = this.getApplication<WflowApplication>();
17
- const applicationInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const requestDto = application.getRequestDto(
20
- dto,
21
- applicationInstall,
22
- HttpMethods.PATCH,
23
- `/${application.getOrganization(applicationInstall)}/registers/vatreturnlines`,
24
- Array.isArray(data) ? data : [data],
25
- );
26
-
27
- await this.getSender().send(requestDto, [200]);
28
-
29
- return dto;
30
- }
31
-
32
- }
33
-
34
- export interface IInput {
35
- id?: string | null;
36
- externalId?: string | null;
37
- code?: string | null;
38
- description?: string | null;
39
- isValid?: boolean;
40
- reverseCharge?: boolean;
41
- }
42
-
43
- export type IOutput = IInput | IInput[];
@@ -1,36 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
5
-
6
- export const NAME = `${WFLOW_APP_NAME}-update-document-state-connector`;
7
-
8
- export default class WflowUpdateDocumentStateConnector extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
15
- const { documentId } = dto.getJsonData();
16
- const app = this.getApplication<WflowApplication>();
17
- const appInstall = await this.getApplicationInstallFromProcess(dto);
18
-
19
- const request = app.getRequestDto(
20
- dto,
21
- appInstall,
22
- HttpMethods.PUT,
23
- `/${app.getOrganization(appInstall)}/documents/${documentId}/task/Export/processed`,
24
- );
25
-
26
- await this.getSender().send(request, [200]);
27
- return dto;
28
- }
29
-
30
- }
31
-
32
- export interface IInput {
33
- documentId: string;
34
- }
35
-
36
- export type IOutput = IInput;
@@ -1,10 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser",
4
- "sdk": "TestSdk"
5
- },
6
- "data": {
7
- "organization": "test",
8
- "documentId": "463b5265-2672-4191-9e3b-9d6fcfe6a452"
9
- }
10
- }