@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,59 +0,0 @@
1
- import Webhook from '@orchesty/nodejs-sdk/dist/lib/Application/Database/Webhook';
2
- import WebhookRepository from '@orchesty/nodejs-sdk/dist/lib/Application/Database/WebhookRepository';
3
- import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
4
- import OnRepeatException from '@orchesty/nodejs-sdk/dist/lib/Exception/OnRepeatException';
5
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
6
- import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
7
- import { StatusCodes } from 'http-status-codes';
8
- import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
9
-
10
- export const NAME = `${WFLOW_APP_NAME}-unsubscribe-webhooks-batch`;
11
-
12
- export default class WflowUnsubscribeWebhookBatch extends ABatchNode {
13
-
14
- public getName(): string {
15
- return NAME;
16
- }
17
-
18
- public async processAction(dto: BatchProcessDto): Promise<BatchProcessDto> {
19
- const app = this.getApplication<WflowApplication>();
20
- const appInstall = await this.getApplicationInstallFromProcess(dto, null);
21
- const repository = this.getDbClient().getRepository(Webhook) as WebhookRepository;
22
-
23
- const webhook = await repository.findOne({
24
- users: [appInstall.getUser()],
25
- apps: [appInstall.getName()],
26
- sdks: [appInstall.getSdk()],
27
- });
28
-
29
- if (!webhook) {
30
- return dto;
31
- }
32
-
33
- let organization: string;
34
-
35
- try {
36
- organization = app.getOrganization(appInstall);
37
- } catch {
38
- return dto;
39
- }
40
-
41
- const request = app.getRequestDto(
42
- dto,
43
- appInstall,
44
- HttpMethods.DELETE,
45
- `/${organization}/webhookregistrations/${webhook.getWebhookId()}`,
46
- );
47
-
48
- const response = await this.getSender().send(request);
49
-
50
- if (response.getResponseCode() !== StatusCodes.OK) {
51
- await repository.update(webhook.setUnsubscribeFailed(true));
52
- throw new OnRepeatException(300, 12, response.getBody());
53
- }
54
-
55
- await repository.remove(webhook);
56
- return dto.setBatchCursor('1', true);
57
- }
58
-
59
- }
@@ -1,7 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser",
4
- "sdk": "TestSdk"
5
- },
6
- "data": {}
7
- }
@@ -1,5 +0,0 @@
1
- {
2
- "http": "GET http://wont.be.called",
3
- "code": 200,
4
- "body": null
5
- }
@@ -1,7 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser",
4
- "sdk": "TestSdk"
5
- },
6
- "data": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser",
4
- "sdk": "TestSdk"
5
- },
6
- "data": {}
7
- }
@@ -1,5 +0,0 @@
1
- {
2
- "http": "GET http://wont.be.called",
3
- "code": 200,
4
- "body": null
5
- }
@@ -1,7 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser",
4
- "sdk": "TestSdk"
5
- },
6
- "data": []
7
- }
@@ -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,340 +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}-get-document-connector`;
7
-
8
- export default class WflowGetDocumentConnector extends AConnector {
9
-
10
- public getName(): string {
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
-
31
- }
32
-
33
- export interface IInput {
34
- documentId: string;
35
- }
36
-
37
- export interface IOutput {
38
- id: string;
39
- serie: Serie;
40
- number: string;
41
- internalCode: string;
42
- vatDocumentCode: string;
43
- variableSymbol: string;
44
- constantSymbol: string;
45
- specificSymbol: string;
46
- issueDate: string;
47
- dueDate: string;
48
- vatDate: string;
49
- acceptDate: string;
50
- caseDate: string;
51
- validFrom: string;
52
- validTo: string;
53
- effectiveFrom: string;
54
- effectiveTo: string;
55
- signatureDate: string;
56
- reviewDate: string;
57
- accountTerm: string;
58
- vatTerm: string;
59
- taxExclusiveAmount: number;
60
- totalAmount: number;
61
- roundingAmount: number;
62
- totalAmountFC: number;
63
- advanceAmount: number;
64
- currency: string;
65
- partnerIC: string;
66
- partnerVAT: string;
67
- partnerLocalVAT: string;
68
- partnerName: string;
69
- partnerAddress: string;
70
- partnerEmail: string;
71
- accountNo: string;
72
- bankCode: string;
73
- iban: string;
74
- bic: string;
75
- meIC: string;
76
- exchangeRate: number;
77
- exchangeRateUnits: number;
78
- tag: string;
79
- orderNo: string;
80
- description: string;
81
- contactPersonName: string;
82
- contactPersonEmail: string;
83
- remainsToDeliverAmount: number;
84
- invoiceType: string;
85
- expectedDeliveryDate: string;
86
- accountCode: string;
87
- doNotPay: boolean;
88
- created: string;
89
- updated: string;
90
- lastAction: string;
91
- removed: string;
92
- locked: boolean;
93
- approvalStatus: string;
94
- flowStatus: string;
95
- payment: {
96
- paidAmount: number;
97
- paidDate: string;
98
- paymentStatus: string;
99
- paymentOrderAmount: number;
100
- paymentOrderStatus: string;
101
- activePaymentRequestDate: string;
102
- };
103
- dataSource: string;
104
- source: string;
105
- createdBy: string;
106
- series: string;
107
- type: {
108
- id: string;
109
- name: string;
110
- kind: string;
111
- default: boolean;
112
- erpExclude: boolean;
113
- filesExtendName: boolean;
114
- docCreatingMethod: string;
115
- autoStamp: string;
116
- serie: Serie;
117
- sequence: {
118
- id: string;
119
- entity: string;
120
- description: string;
121
- fixedPart: string;
122
- counter: string;
123
- };
124
- invoiceType: string;
125
- };
126
- partner: {
127
- id: string;
128
- externalId: string;
129
- ic: string;
130
- vat: string;
131
- name: string;
132
- address: string;
133
- localVAT: string;
134
- note: string;
135
- phoneNo: string;
136
- mailAddress: string;
137
- deliveryPeriod: number;
138
- minOrderTotal: number;
139
- toleranceRate: number;
140
- language: string;
141
- isValid: boolean;
142
- businessRegisterRegistration: string;
143
- customer: boolean;
144
- supplier: boolean;
145
- };
146
- deliveryLocation: {
147
- id: string;
148
- externalId: string;
149
- code: string;
150
- description: string;
151
- isValid: boolean;
152
- address: string;
153
- contact: string;
154
- };
155
- accounting: Accounting;
156
- vaTs: {
157
- rate: number;
158
- type: string;
159
- base: number;
160
- tax: number;
161
- }[];
162
- lines: {
163
- id: string;
164
- totalAmount: number;
165
- totalAmountFC: number;
166
- accountCode: string;
167
- currency: string;
168
- description: string;
169
- quantity: number;
170
- unitPrice: number;
171
- measureUnit: string;
172
- vatType: string;
173
- vatRate: number;
174
- order: number;
175
- approval: {
176
- level: number;
177
- team: {
178
- id: string;
179
- name: string;
180
- description: string;
181
- system: boolean;
182
- };
183
- identity: {
184
- login: string;
185
- firstName: string;
186
- lastName: string;
187
- fullName: string;
188
- };
189
- date: string;
190
- status: string;
191
- };
192
- changedAfterApprove: boolean;
193
- accounting: Accounting;
194
- code: string;
195
- costCenter: CostCenter;
196
- contract: Contract;
197
- activity: Activity;
198
- }[];
199
- transactionId: string;
200
- expenseCardId: string;
201
- }
202
-
203
- interface Serie {
204
- id: string;
205
- externalId: string;
206
- code: string;
207
- description: string;
208
- isValid: boolean;
209
- kind: string;
210
- invoiceType: string;
211
- }
212
-
213
- interface Accounting {
214
- businessItemCode: string;
215
- accountingRule: {
216
- id: string;
217
- externalId: string;
218
- code: string;
219
- description: string;
220
- isValid: boolean;
221
- kind: string;
222
- };
223
- activity: Activity;
224
- businessCase: {
225
- id: string;
226
- externalId: string;
227
- code: string;
228
- description: string;
229
- isValid: boolean;
230
- };
231
- cardDocumentType: {
232
- id: string;
233
- externalId: string;
234
- code: string;
235
- description: string;
236
- isValid: boolean;
237
- };
238
- cashDocumentType: {
239
- id: string;
240
- externalId: string;
241
- code: string;
242
- description: string;
243
- isValid: boolean;
244
- };
245
- cashRegister: {
246
- id: string;
247
- externalId: string;
248
- code: string;
249
- description: string;
250
- isValid: boolean;
251
- };
252
- contraAccount: {
253
- id: string;
254
- externalId: string;
255
- code: string;
256
- description: string;
257
- isValid: boolean;
258
- };
259
- contract: Contract;
260
- costCenter: CostCenter;
261
- employee: {
262
- id: string;
263
- externalId: string;
264
- code: string;
265
- description: string;
266
- isValid: boolean;
267
- };
268
- paymentMethod: {
269
- id: string;
270
- externalId: string;
271
- code: string;
272
- description: string;
273
- isValid: boolean;
274
- kind: string;
275
- };
276
- project: {
277
- id: string;
278
- externalId: string;
279
- code: string;
280
- description: string;
281
- isValid: boolean;
282
- };
283
- vatControlStatementLine: {
284
- id: string;
285
- externalId: string;
286
- code: string;
287
- description: string;
288
- isValid: boolean;
289
- };
290
- vatReturnLine: {
291
- id: string;
292
- externalId: string;
293
- code: string;
294
- description: string;
295
- isValid: boolean;
296
- reverseCharge: boolean;
297
- };
298
- vatReverseChargeCode: {
299
- id: string;
300
- externalId: string;
301
- code: string;
302
- description: string;
303
- isValid: boolean;
304
- };
305
- vehicle: {
306
- id: string;
307
- externalId: string;
308
- code: string;
309
- description: string;
310
- isValid: boolean;
311
- };
312
- vatSupplyModeCode: string;
313
- vatApplyReductionCoefficient: boolean;
314
- vatFixedAssets: boolean;
315
- vatMode: string;
316
- }
317
-
318
- interface CostCenter {
319
- id: string;
320
- externalId: string;
321
- code: string;
322
- description: string;
323
- isValid: boolean;
324
- }
325
-
326
- export interface Contract {
327
- id: string;
328
- externalId: string;
329
- code: string;
330
- description: string;
331
- isValid: boolean;
332
- }
333
-
334
- export interface Activity {
335
- id: string;
336
- externalId: string;
337
- code: string;
338
- description: string;
339
- isValid: boolean;
340
- }
@@ -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[];