@orchesty/connector-wflow 2.0.0 → 2.0.2

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 (137) hide show
  1. package/dist/package.json +5 -2
  2. package/package.json +9 -3
  3. package/CHANGELOG.md +0 -43
  4. package/coverage/clover.xml +0 -382
  5. package/coverage/coverage-final.json +0 -18
  6. package/coverage/lcov-report/base.css +0 -224
  7. package/coverage/lcov-report/block-navigation.js +0 -87
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +0 -161
  10. package/coverage/lcov-report/prettify.css +0 -1
  11. package/coverage/lcov-report/prettify.js +0 -2
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +0 -210
  14. package/coverage/lcov-report/src/Batch/WflowSubscribeWebhookBatch.ts.html +0 -337
  15. package/coverage/lcov-report/src/Batch/WflowUnsubscribeWebhookBatch.ts.html +0 -262
  16. package/coverage/lcov-report/src/Batch/index.html +0 -131
  17. package/coverage/lcov-report/src/Connector/WflowGetDocumentConnector.ts.html +0 -1105
  18. package/coverage/lcov-report/src/Connector/WflowGetDocumentMainFileConnector.ts.html +0 -205
  19. package/coverage/lcov-report/src/Connector/WflowGetDocumentTypesConnector.ts.html +0 -292
  20. package/coverage/lcov-report/src/Connector/WflowGetOrganizationsConnector.ts.html +0 -205
  21. package/coverage/lcov-report/src/Connector/WflowPatchAccountingRulesConnector.ts.html +0 -244
  22. package/coverage/lcov-report/src/Connector/WflowPatchChartOfAccountsConnector.ts.html +0 -211
  23. package/coverage/lcov-report/src/Connector/WflowPatchContractsConnector.ts.html +0 -211
  24. package/coverage/lcov-report/src/Connector/WflowPatchCostCentersConnector.ts.html +0 -211
  25. package/coverage/lcov-report/src/Connector/WflowPatchSeriesConnector.ts.html +0 -268
  26. package/coverage/lcov-report/src/Connector/WflowPatchVatControlStatementLinesConnector.ts.html +0 -211
  27. package/coverage/lcov-report/src/Connector/WflowPatchVatReturnLinesConnector.ts.html +0 -214
  28. package/coverage/lcov-report/src/Connector/WflowPutDocumentConnector.ts.html +0 -532
  29. package/coverage/lcov-report/src/Connector/WflowUpdateDocumentStateConnector.ts.html +0 -193
  30. package/coverage/lcov-report/src/Connector/index.html +0 -296
  31. package/coverage/lcov-report/src/WflowApplication.ts.html +0 -538
  32. package/coverage/lcov-report/src/index.html +0 -116
  33. package/coverage/lcov-report/test/dataProvider.ts.html +0 -307
  34. package/coverage/lcov-report/test/index.html +0 -116
  35. package/coverage/lcov.info +0 -614
  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/WflowGetDocumentConnector.ts +0 -340
  48. package/src/Connector/WflowGetDocumentMainFileConnector.ts +0 -40
  49. package/src/Connector/WflowGetDocumentTypesConnector.ts +0 -69
  50. package/src/Connector/WflowGetOrganizationsConnector.ts +0 -40
  51. package/src/Connector/WflowPatchAccountingRulesConnector.ts +0 -53
  52. package/src/Connector/WflowPatchChartOfAccountsConnector.ts +0 -42
  53. package/src/Connector/WflowPatchContractsConnector.ts +0 -42
  54. package/src/Connector/WflowPatchCostCentersConnector.ts +0 -42
  55. package/src/Connector/WflowPatchSeriesConnector.ts +0 -61
  56. package/src/Connector/WflowPatchVatControlStatementLinesConnector.ts +0 -42
  57. package/src/Connector/WflowPatchVatReturnLinesConnector.ts +0 -43
  58. package/src/Connector/WflowPutDocumentConnector.ts +0 -149
  59. package/src/Connector/WflowUpdateDocumentStateConnector.ts +0 -36
  60. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/input.json +0 -10
  61. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/mock.json +0 -449
  62. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/output.json +0 -451
  63. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/input.json +0 -9
  64. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/mock.json +0 -5
  65. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/output.json +0 -9
  66. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/input.json +0 -7
  67. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/mock.json +0 -32
  68. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/output.json +0 -29
  69. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/input.json +0 -7
  70. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/mock.json +0 -12
  71. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/output.json +0 -14
  72. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-input.json +0 -20
  73. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-mock.json +0 -5
  74. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-output.json +0 -20
  75. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/input.json +0 -12
  76. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/mock.json +0 -5
  77. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/output.json +0 -12
  78. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-input.json +0 -18
  79. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-mock.json +0 -5
  80. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-output.json +0 -18
  81. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/input.json +0 -11
  82. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/mock.json +0 -5
  83. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/output.json +0 -11
  84. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-input.json +0 -18
  85. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-mock.json +0 -5
  86. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-output.json +0 -18
  87. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/input.json +0 -11
  88. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/mock.json +0 -5
  89. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/output.json +0 -11
  90. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-input.json +0 -18
  91. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-mock.json +0 -5
  92. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-output.json +0 -18
  93. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/input.json +0 -11
  94. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/mock.json +0 -5
  95. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/output.json +0 -11
  96. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-input.json +0 -20
  97. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-mock.json +0 -5
  98. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-output.json +0 -20
  99. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/input.json +0 -12
  100. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/mock.json +0 -5
  101. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/output.json +0 -12
  102. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-input.json +0 -18
  103. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-mock.json +0 -5
  104. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-output.json +0 -18
  105. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/input.json +0 -11
  106. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/mock.json +0 -5
  107. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/output.json +0 -11
  108. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-input.json +0 -20
  109. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-mock.json +0 -5
  110. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-output.json +0 -20
  111. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/input.json +0 -12
  112. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/mock.json +0 -5
  113. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/output.json +0 -12
  114. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/input.json +0 -10
  115. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/mock.json +0 -5
  116. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/output.json +0 -10
  117. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/input.json +0 -9
  118. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/mock.json +0 -5
  119. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/output.json +0 -9
  120. package/src/Connector/__tests__/WflowGetDocumentConnector.ts +0 -17
  121. package/src/Connector/__tests__/WflowGetDocumentMainFileConnector.ts +0 -17
  122. package/src/Connector/__tests__/WflowGetDocumentTypesConnector.ts +0 -17
  123. package/src/Connector/__tests__/WflowGetOrganizationsConnector.ts +0 -17
  124. package/src/Connector/__tests__/WflowPatchAccountingRulesConnector.ts +0 -21
  125. package/src/Connector/__tests__/WflowPatchChartOfAccountsConnector.ts +0 -21
  126. package/src/Connector/__tests__/WflowPatchContractsConnector.ts +0 -21
  127. package/src/Connector/__tests__/WflowPatchCostCentersConnector.ts +0 -21
  128. package/src/Connector/__tests__/WflowPatchSeriesConnector.ts +0 -21
  129. package/src/Connector/__tests__/WflowPatchVatControlStatementLinesConnector.ts +0 -21
  130. package/src/Connector/__tests__/WflowPatchVatReturnLinesConnector.ts +0 -21
  131. package/src/Connector/__tests__/WflowPutDocumentConnector.ts +0 -17
  132. package/src/Connector/__tests__/WflowUpdateDocumentState.ts +0 -17
  133. package/src/WflowApplication.ts +0 -151
  134. package/test/dataProvider.ts +0 -74
  135. package/tsconfig.json +0 -9
  136. package/tsconfig.prod.json +0 -10
  137. package/tsconfig.prod.tsbuildinfo +0 -1
@@ -1,21 +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_PATCH_CHART_OF_ACCOUNTS } from '../WflowPatchChartOfAccountsConnector';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowPatchChartOfAccountsConnector', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testConnector(WFLOW_PATCH_CHART_OF_ACCOUNTS);
16
- });
17
-
18
- it('process - batch', async () => {
19
- await tester.testConnector(WFLOW_PATCH_CHART_OF_ACCOUNTS, 'batch');
20
- });
21
- });
@@ -1,21 +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_PATCH_CONTRACTS } from '../WflowPatchContractsConnector';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowPatchContractsConnector', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testConnector(WFLOW_PATCH_CONTRACTS);
16
- });
17
-
18
- it('process - batch', async () => {
19
- await tester.testConnector(WFLOW_PATCH_CONTRACTS, 'batch');
20
- });
21
- });
@@ -1,21 +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_PATCH_COST_CENTERS } from '../WflowPatchCostCentersConnector';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowPatchCostCentersConnector', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testConnector(WFLOW_PATCH_COST_CENTERS);
16
- });
17
-
18
- it('process - batch', async () => {
19
- await tester.testConnector(WFLOW_PATCH_COST_CENTERS, 'batch');
20
- });
21
- });
@@ -1,21 +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_PATCH_SERIES } from '../WflowPatchSeriesConnector';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowPatchSeriesConnector', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testConnector(WFLOW_PATCH_SERIES);
16
- });
17
-
18
- it('process - batch', async () => {
19
- await tester.testConnector(WFLOW_PATCH_SERIES, 'batch');
20
- });
21
- });
@@ -1,21 +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_PATCH_VAT_CONTROL_STATEMENT_LINES } from '../WflowPatchVatControlStatementLinesConnector';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowPatchVatControlStatementLinesConnector', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testConnector(WFLOW_PATCH_VAT_CONTROL_STATEMENT_LINES);
16
- });
17
-
18
- it('process - batch', async () => {
19
- await tester.testConnector(WFLOW_PATCH_VAT_CONTROL_STATEMENT_LINES, 'batch');
20
- });
21
- });
@@ -1,21 +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_PATCH_VAT_RETURN_LINES } from '../WflowPatchVatReturnLinesConnector';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowPatchVatReturnLinesConnector', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testConnector(WFLOW_PATCH_VAT_RETURN_LINES);
16
- });
17
-
18
- it('process - batch', async () => {
19
- await tester.testConnector(WFLOW_PATCH_VAT_RETURN_LINES, 'batch');
20
- });
21
- });
@@ -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_PUT_DOCUMENT } from '../WflowPutDocumentConnector';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowPutDocumentConnector', () => {
9
- beforeEach(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testConnector(WFLOW_PUT_DOCUMENT);
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_UPDATE_DOCUMENT_STATE } from '../WflowUpdateDocumentStateConnector';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for WflowUpdateDocumentStateConnector', () => {
9
- beforeEach(() => {
10
- tester = new NodeTester(container, __filename);
11
- init();
12
- });
13
-
14
- it('process - ok', async () => {
15
- await tester.testConnector(WFLOW_UPDATE_DOCUMENT_STATE);
16
- });
17
- });
@@ -1,151 +0,0 @@
1
- import CoreFormsEnum, { getFormName } from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
2
- import { ApplicationInstall } from '@orchesty/nodejs-sdk/dist/lib/Application/Database/ApplicationInstall';
3
- import Field from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/Field';
4
- import FieldType from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FieldType';
5
- import Form from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/Form';
6
- import FormStack from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FormStack';
7
- import WebhookSubscription from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Webhook/WebhookSubscription';
8
- import { OAuth2Provider } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Provider/OAuth2/OAuth2Provider';
9
- import ScopeSeparatorEnum from '@orchesty/nodejs-sdk/dist/lib/Authorization/ScopeSeparatorEnum';
10
- import AOAuth2Application from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/OAuth2/AOAuth2Application';
11
- import { CLIENT_ID, CLIENT_SECRET } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/OAuth2/IOAuth2Application';
12
- import RequestDto from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/RequestDto';
13
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
14
- import AProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/AProcessDto';
15
- import { CommonHeaders, JSON_TYPE } from '@orchesty/nodejs-sdk/dist/lib/Utils/Headers';
16
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
17
- import WflowGetOrganizationsConnector from './Connector/WflowGetOrganizationsConnector';
18
-
19
- export const NAME = 'wflow';
20
- export const ORGANIZATION_FORM = 'organization-form';
21
- export const ORGANIZATION = 'organization';
22
-
23
- export enum WebhookType {
24
- DOCUMENT_READY_TO_EXTRACT = 'DocumentReadyToExtract',
25
- DOCUMENT_READY_TO_EXPORT = 'DocumentReadyToExport',
26
- DOCUMENT_UPDATED = 'DocumentUpdated',
27
- DOCUMENT_APPROVAL_PROCESS_FINISHED = 'DocumentApprovalProcessFinished',
28
- DOCUMENT_DELETED = 'DocumentDeleted',
29
- DOCUMENT_READY_TO_REVIEW = 'DocumentReadyToReview',
30
- DOCUMENT_CREATED = 'DocumentCreated',
31
- DOCUMENT_REVIEWED = 'DocumentReviewed',
32
- REGISTER_UPDATED = 'RegisterUpdated',
33
- ALL = 'All',
34
- }
35
-
36
- export default class WflowApplication extends AOAuth2Application {
37
-
38
- public constructor(
39
- provider: OAuth2Provider,
40
- private readonly wflowGetOrganizationsConnector: WflowGetOrganizationsConnector,
41
- ) {
42
- super(provider);
43
- }
44
-
45
- public getName(): string {
46
- return NAME;
47
- }
48
-
49
- public getPublicName(): string {
50
- return 'wflow';
51
- }
52
-
53
- public getDescription(): string {
54
- return 'Digital accounting that saves you time and money';
55
- }
56
-
57
- public getLogo(): string {
58
- return 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIj4KPHBhdGggZ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c5Njg3NSA0IDYgQzIuNTY2NDA2MjUgOC42NzU3ODEyNSAyLjU2NjQwNjI1IDguNjc1NzgxMjUgMC41NjI1IDExLjMxMjUgQy0wLjA5NjIxMDk0IDEyLjE5NTUwNzgxIC0wLjc1NDkyMTg4IDEzLjA3ODUxNTYzIC0xLjQzMzU5Mzc1IDEzLjk4ODI4MTI1IEMtMi4yMDg5NjQ4NCAxNC45ODQwODIwMyAtMi4yMDg5NjQ4NCAxNC45ODQwODIwMyAtMyAxNiBDLTQuMzIgMTQuMzUgLTUuNjQgMTIuNyAtNyAxMSBDLTYuMDIyNjIyMzEgOS4zNTMxMDM2NSAtNS4wNDMwNDY4IDcuNzA3NTExNDYgLTQuMDYyNSA2LjA2MjUgQy0zLjUxNzIyNjU2IDUuMTQ1OTc2NTYgLTIuOTcxOTUzMTIgNC4yMjk0NTMxMiAtMi40MTAxNTYyNSAzLjI4NTE1NjI1IEMtMSAxIC0xIDEgMCAwIFogIiBmaWxsPSIjRjRGNkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNSw5KSIvPgo8cGF0aCBkPSJNMCAwIEMxLjU2MjUgMS4xMjUgMS41NjI1IDEuMTI1IDMgMyBDMi42ODc1IDYuMTg3NSAyLjY4NzUgNi4xODc1IDIgOSBDMS4wMSA5LjMzIDAuMDIgOS42NiAtMSAxMCBDLTIuMzgxMjUwMTggNy4yMzc0OTk2NCAtMi4xOTA3OTMwNiA1LjA1MjY4OTAxIC0yIDIgQy0xLjM0IDEuMzQgLTAuNjggMC42OCAwIDAgWiAiIGZpbGw9IiNFRUYyRkYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDcsOCkiLz4KPC9zdmc+Cg==';
59
- }
60
-
61
- public getFormStack(): FormStack {
62
- return new FormStack()
63
- .addForm(
64
- new Form(CoreFormsEnum.AUTHORIZATION_FORM, getFormName(CoreFormsEnum.AUTHORIZATION_FORM))
65
- .addField(new Field(FieldType.TEXT, CLIENT_ID, 'Client Id', null, false))
66
- .addField(new Field(FieldType.TEXT, CLIENT_SECRET, 'Client Secret', null, false)),
67
- )
68
- .addForm(
69
- new Form(ORGANIZATION_FORM, 'Organization settings'),
70
- );
71
- }
72
-
73
- public getRequestDto(
74
- dto: AProcessDto,
75
- applicationInstall: ApplicationInstall,
76
- method: HttpMethods,
77
- path?: string,
78
- data?: unknown,
79
- ): RequestDto {
80
- const headers = {
81
- [CommonHeaders.ACCEPT]: JSON_TYPE,
82
- [CommonHeaders.AUTHORIZATION]: `Bearer ${this.getAccessToken(applicationInstall)}`,
83
- };
84
- const url = new URL(`/api${path ?? ''}`, 'https://api.wflow.com').href;
85
-
86
- return new RequestDto(url, method, dto, data, headers);
87
- }
88
-
89
- public getOrganization(applicationInstall: ApplicationInstall): string {
90
- const organization = applicationInstall.getSettings()[ORGANIZATION_FORM]?.[ORGANIZATION];
91
-
92
- if (!organization) {
93
- throw Error('Organization is not set.');
94
- }
95
-
96
- return organization;
97
- }
98
-
99
- public getAuthUrl(): string {
100
- return 'https://account.wflow.com/connect/authorize';
101
- }
102
-
103
- public getTokenUrl(): string {
104
- return 'https://account.wflow.com/connect/token';
105
- }
106
-
107
- public getScopes(): string[] {
108
- return ['uccl_common_api', 'offline_access'];
109
- }
110
-
111
- public getScopesSeparator(): string {
112
- return ScopeSeparatorEnum.SPACE;
113
- }
114
-
115
- public getWebhookSubscriptions(): WebhookSubscription[] {
116
- return [];
117
- }
118
-
119
- protected async customFormReplace(formStack: FormStack, applicationInstall: ApplicationInstall): Promise<void> {
120
- const organizations = (await this.wflowGetOrganizationsConnector.processAction(
121
- ProcessDto.createForFormRequest(
122
- NAME,
123
- applicationInstall.getUser(),
124
- applicationInstall.getSdk(),
125
- crypto.randomUUID(),
126
- 'form',
127
- ),
128
- )).getJsonData();
129
-
130
- const form = formStack.getForms().find((item) => item.getKey() === ORGANIZATION_FORM);
131
- const settings = applicationInstall.getSettings()[ORGANIZATION_FORM];
132
-
133
- if (!form) {
134
- return;
135
- }
136
-
137
- const choices: Record<string, string>[]
138
- = organizations.map((organization) => ({ [organization.subdomain]: organization.name }));
139
-
140
- form.addField(
141
- new Field(
142
- FieldType.SELECT_BOX,
143
- ORGANIZATION,
144
- 'Organization name',
145
- settings?.[ORGANIZATION],
146
- true,
147
- ).setChoices(choices),
148
- );
149
- }
150
-
151
- }
@@ -1,74 +0,0 @@
1
- import { appInstall, DEFAULT_ACCESS_TOKEN, DEFAULT_CLIENT_ID, DEFAULT_CLIENT_SECRET, DEFAULT_USER } from '@orchesty/nodejs-connectors/test/DataProvider';
2
- import { container, db, oauth2Provider, sender } from '@orchesty/nodejs-connectors/test/TestAbstract';
3
- import CoreFormsEnum from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
4
- import { ACCESS_TOKEN } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Provider/OAuth2/OAuth2Provider';
5
- import { TOKEN } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/Basic/ABasicApplication';
6
- import { CLIENT_ID, CLIENT_SECRET } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/OAuth2/IOAuth2Application';
7
- import { orchestyOptions } from '@orchesty/nodejs-sdk/dist/lib/Config/Config';
8
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
9
- import { mockOnce } from '@orchesty/nodejs-sdk/dist/test/MockServer';
10
- import WflowSubscribeWebhookBatch from '../src/Batch/WflowSubscribeWebhookBatch';
11
- import WflowUnsubscribeWebhookBatch from '../src/Batch/WflowUnsubscribeWebhookBatch';
12
- import WflowGetDocumentConnector from '../src/Connector/WflowGetDocumentConnector';
13
- import WflowGetDocumentMainFileConnector from '../src/Connector/WflowGetDocumentMainFileConnector';
14
- import WflowGetDocumentTypesConnector from '../src/Connector/WflowGetDocumentTypesConnector';
15
- import WflowGetOrganizationsConnector from '../src/Connector/WflowGetOrganizationsConnector';
16
- import WflowPatchAccountingRulesConnector from '../src/Connector/WflowPatchAccountingRulesConnector';
17
- import WflowPatchChartOfAccountsConnector from '../src/Connector/WflowPatchChartOfAccountsConnector';
18
- import WflowPatchContractsConnector from '../src/Connector/WflowPatchContractsConnector';
19
- import WflowPatchCostCentersConnector from '../src/Connector/WflowPatchCostCentersConnector';
20
- import WflowPatchSeriesConnector from '../src/Connector/WflowPatchSeriesConnector';
21
- import WflowPatchVatControlStatementLinesConnector
22
- from '../src/Connector/WflowPatchVatControlStatementLinesConnector';
23
- import WflowPatchVatReturnLinesConnector from '../src/Connector/WflowPatchVatReturnLinesConnector';
24
- import WflowPutDocumentConnector from '../src/Connector/WflowPutDocumentConnector';
25
- import WflowUpdateDocumentStateConnector from '../src/Connector/WflowUpdateDocumentStateConnector';
26
- import WflowApplication, { NAME as WFLOW_APP, ORGANIZATION, ORGANIZATION_FORM } from '../src/WflowApplication';
27
-
28
- export default function init(): void {
29
- appInstall(WFLOW_APP, DEFAULT_USER, {
30
- [CoreFormsEnum.AUTHORIZATION_FORM]: {
31
- [CLIENT_ID]: DEFAULT_CLIENT_ID,
32
- [CLIENT_SECRET]: DEFAULT_CLIENT_SECRET,
33
- [TOKEN]: {
34
- [ACCESS_TOKEN]: DEFAULT_ACCESS_TOKEN,
35
- },
36
- },
37
- [ORGANIZATION_FORM]: {
38
- [ORGANIZATION]: 'test',
39
- },
40
- });
41
-
42
- mockOnce([
43
- {
44
- request: {
45
- method: HttpMethods.GET,
46
- url: new RegExp(`${orchestyOptions.workerApi}/document/Webhook.*`),
47
- },
48
- response: {
49
- code: 200,
50
- body: [],
51
- },
52
- },
53
- ]);
54
-
55
- const getOrganizationsConnector = new WflowGetOrganizationsConnector().setDb(db).setSender(sender);
56
- const app = new WflowApplication(oauth2Provider, getOrganizationsConnector);
57
- container.setApplication(app);
58
-
59
- container.setNode(new WflowGetDocumentConnector(), app);
60
- container.setNode(new WflowGetDocumentMainFileConnector(), app);
61
- container.setNode(new WflowGetDocumentTypesConnector(), app);
62
- container.setNode(new WflowUpdateDocumentStateConnector(), app);
63
- container.setNode(new WflowSubscribeWebhookBatch(), app);
64
- container.setNode(new WflowUnsubscribeWebhookBatch(), app);
65
- container.setNode(new WflowPutDocumentConnector(), app);
66
- container.setNode(getOrganizationsConnector, app);
67
- container.setNode(new WflowPatchCostCentersConnector(), app);
68
- container.setNode(new WflowPatchContractsConnector(), app);
69
- container.setNode(new WflowPatchChartOfAccountsConnector(), app);
70
- container.setNode(new WflowPatchAccountingRulesConnector(), app);
71
- container.setNode(new WflowPatchVatReturnLinesConnector(), app);
72
- container.setNode(new WflowPatchVatControlStatementLinesConnector(), app);
73
- container.setNode(new WflowPatchSeriesConnector(), app);
74
- }
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./dist",
6
- "composite": true
7
- },
8
- "include": ["src", "test", "../../test"]
9
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": [
4
- "src",
5
- ],
6
- "exclude": [
7
- "node_modules",
8
- "src/**/__tests__",
9
- ]
10
- }