@orchesty/connector-wflow 1.0.5 → 2.0.0
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/CHANGELOG.md +6 -0
- package/README.md +102 -0
- package/coverage/clover.xml +36 -35
- package/coverage/coverage-final.json +3 -3
- package/coverage/lcov-report/index.html +11 -11
- package/coverage/lcov-report/src/Batch/WflowSubscribeWebhookBatch.ts.html +11 -2
- package/coverage/lcov-report/src/Batch/WflowUnsubscribeWebhookBatch.ts.html +16 -7
- package/coverage/lcov-report/src/Batch/index.html +11 -11
- package/coverage/lcov-report/src/Connector/WflowGetDocumentConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowGetDocumentMainFileConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowGetDocumentTypesConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowGetOrganizationsConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowPatchAccountingRulesConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowPatchChartOfAccountsConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowPatchContractsConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowPatchCostCentersConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowPatchSeriesConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowPatchVatControlStatementLinesConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowPatchVatReturnLinesConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowPutDocumentConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/WflowUpdateDocumentStateConnector.ts.html +1 -1
- package/coverage/lcov-report/src/Connector/index.html +1 -1
- package/coverage/lcov-report/src/WflowApplication.ts.html +5 -2
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/test/dataProvider.ts.html +1 -1
- package/coverage/lcov-report/test/index.html +1 -1
- package/coverage/lcov.info +46 -45
- package/dist/Batch/WflowSubscribeWebhookBatch.js +2 -0
- package/dist/Batch/WflowUnsubscribeWebhookBatch.js +3 -1
- package/dist/WflowApplication.js +1 -1
- package/dist/package.json +3 -2
- package/package.json +3 -2
- package/src/Batch/WflowSubscribeWebhookBatch.ts +2 -0
- package/src/Batch/WflowUnsubscribeWebhookBatch.ts +3 -1
- package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/input.json +2 -1
- package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/output.json +3 -2
- package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/input.json +3 -2
- package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/output.json +3 -2
- package/src/Connector/__tests__/Data/WflowGetDocumentConnector/input.json +8 -7
- package/src/Connector/__tests__/Data/WflowGetDocumentConnector/output.json +431 -430
- package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/input.json +2 -1
- package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/input.json +3 -3
- package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/input.json +5 -4
- package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchContractsConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/input.json +2 -1
- package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/output.json +2 -1
- package/src/Connector/__tests__/Data/WflowPutDocumentConnector/input.json +3 -2
- package/src/Connector/__tests__/Data/WflowPutDocumentConnector/output.json +3 -2
- package/src/Connector/__tests__/Data/WflowUpdateDocumentState/input.json +3 -2
- package/src/Connector/__tests__/Data/WflowUpdateDocumentState/output.json +3 -2
- package/src/WflowApplication.ts +1 -0
- package/tsconfig.prod.tsbuildinfo +1 -1
|
@@ -4,6 +4,7 @@ import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
|
|
|
4
4
|
import OnRepeatException from '@orchesty/nodejs-sdk/dist/lib/Exception/OnRepeatException';
|
|
5
5
|
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
6
6
|
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
|
|
7
|
+
import { StatusCodes } from 'http-status-codes';
|
|
7
8
|
import WflowApplication, { NAME as WFLOW_APP_NAME } from '../WflowApplication';
|
|
8
9
|
|
|
9
10
|
export const NAME = `${WFLOW_APP_NAME}-unsubscribe-webhooks-batch`;
|
|
@@ -22,6 +23,7 @@ export default class WflowUnsubscribeWebhookBatch extends ABatchNode {
|
|
|
22
23
|
const webhook = await repository.findOne({
|
|
23
24
|
users: [appInstall.getUser()],
|
|
24
25
|
apps: [appInstall.getName()],
|
|
26
|
+
sdks: [appInstall.getSdk()],
|
|
25
27
|
});
|
|
26
28
|
|
|
27
29
|
if (!webhook) {
|
|
@@ -45,7 +47,7 @@ export default class WflowUnsubscribeWebhookBatch extends ABatchNode {
|
|
|
45
47
|
|
|
46
48
|
const response = await this.getSender().send(request);
|
|
47
49
|
|
|
48
|
-
if (response.getResponseCode()
|
|
50
|
+
if (response.getResponseCode() !== StatusCodes.OK) {
|
|
49
51
|
await repository.update(webhook.setUnsubscribeFailed(true));
|
|
50
52
|
throw new OnRepeatException(300, 12, response.getBody());
|
|
51
53
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"headers": {
|
|
3
|
+
"user": "TestUser",
|
|
4
|
+
"sdk": "TestSdk"
|
|
5
|
+
},
|
|
6
|
+
"data": {
|
|
7
|
+
"organization": "test",
|
|
8
|
+
"documentId": "463b5265-2672-4191-9e3b-9d6fcfe6a452"
|
|
9
|
+
}
|
|
9
10
|
}
|