@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.
Files changed (80) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +102 -0
  3. package/coverage/clover.xml +36 -35
  4. package/coverage/coverage-final.json +3 -3
  5. package/coverage/lcov-report/index.html +11 -11
  6. package/coverage/lcov-report/src/Batch/WflowSubscribeWebhookBatch.ts.html +11 -2
  7. package/coverage/lcov-report/src/Batch/WflowUnsubscribeWebhookBatch.ts.html +16 -7
  8. package/coverage/lcov-report/src/Batch/index.html +11 -11
  9. package/coverage/lcov-report/src/Connector/WflowGetDocumentConnector.ts.html +1 -1
  10. package/coverage/lcov-report/src/Connector/WflowGetDocumentMainFileConnector.ts.html +1 -1
  11. package/coverage/lcov-report/src/Connector/WflowGetDocumentTypesConnector.ts.html +1 -1
  12. package/coverage/lcov-report/src/Connector/WflowGetOrganizationsConnector.ts.html +1 -1
  13. package/coverage/lcov-report/src/Connector/WflowPatchAccountingRulesConnector.ts.html +1 -1
  14. package/coverage/lcov-report/src/Connector/WflowPatchChartOfAccountsConnector.ts.html +1 -1
  15. package/coverage/lcov-report/src/Connector/WflowPatchContractsConnector.ts.html +1 -1
  16. package/coverage/lcov-report/src/Connector/WflowPatchCostCentersConnector.ts.html +1 -1
  17. package/coverage/lcov-report/src/Connector/WflowPatchSeriesConnector.ts.html +1 -1
  18. package/coverage/lcov-report/src/Connector/WflowPatchVatControlStatementLinesConnector.ts.html +1 -1
  19. package/coverage/lcov-report/src/Connector/WflowPatchVatReturnLinesConnector.ts.html +1 -1
  20. package/coverage/lcov-report/src/Connector/WflowPutDocumentConnector.ts.html +1 -1
  21. package/coverage/lcov-report/src/Connector/WflowUpdateDocumentStateConnector.ts.html +1 -1
  22. package/coverage/lcov-report/src/Connector/index.html +1 -1
  23. package/coverage/lcov-report/src/WflowApplication.ts.html +5 -2
  24. package/coverage/lcov-report/src/index.html +1 -1
  25. package/coverage/lcov-report/test/dataProvider.ts.html +1 -1
  26. package/coverage/lcov-report/test/index.html +1 -1
  27. package/coverage/lcov.info +46 -45
  28. package/dist/Batch/WflowSubscribeWebhookBatch.js +2 -0
  29. package/dist/Batch/WflowUnsubscribeWebhookBatch.js +3 -1
  30. package/dist/WflowApplication.js +1 -1
  31. package/dist/package.json +3 -2
  32. package/package.json +3 -2
  33. package/src/Batch/WflowSubscribeWebhookBatch.ts +2 -0
  34. package/src/Batch/WflowUnsubscribeWebhookBatch.ts +3 -1
  35. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/input.json +2 -1
  36. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/output.json +3 -2
  37. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/input.json +3 -2
  38. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/output.json +3 -2
  39. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/input.json +8 -7
  40. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/output.json +431 -430
  41. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/input.json +2 -1
  42. package/src/Connector/__tests__/Data/WflowGetDocumentMainFileConnector/output.json +2 -1
  43. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/input.json +3 -3
  44. package/src/Connector/__tests__/Data/WflowGetDocumentTypesConnector/output.json +2 -1
  45. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/input.json +5 -4
  46. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/output.json +2 -1
  47. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-input.json +2 -1
  48. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/batch-output.json +2 -1
  49. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/input.json +2 -1
  50. package/src/Connector/__tests__/Data/WflowPatchAccountingRulesConnector/output.json +2 -1
  51. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-input.json +2 -1
  52. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/batch-output.json +2 -1
  53. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/input.json +2 -1
  54. package/src/Connector/__tests__/Data/WflowPatchChartOfAccountsConnector/output.json +2 -1
  55. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-input.json +2 -1
  56. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/batch-output.json +2 -1
  57. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/input.json +2 -1
  58. package/src/Connector/__tests__/Data/WflowPatchContractsConnector/output.json +2 -1
  59. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-input.json +2 -1
  60. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/batch-output.json +2 -1
  61. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/input.json +2 -1
  62. package/src/Connector/__tests__/Data/WflowPatchCostCentersConnector/output.json +2 -1
  63. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-input.json +2 -1
  64. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/batch-output.json +2 -1
  65. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/input.json +2 -1
  66. package/src/Connector/__tests__/Data/WflowPatchSeriesConnector/output.json +2 -1
  67. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-input.json +2 -1
  68. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/batch-output.json +2 -1
  69. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/input.json +2 -1
  70. package/src/Connector/__tests__/Data/WflowPatchVatControlStatementLinesConnector/output.json +2 -1
  71. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-input.json +2 -1
  72. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/batch-output.json +2 -1
  73. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/input.json +2 -1
  74. package/src/Connector/__tests__/Data/WflowPatchVatReturnLinesConnector/output.json +2 -1
  75. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/input.json +3 -2
  76. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/output.json +3 -2
  77. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/input.json +3 -2
  78. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/output.json +3 -2
  79. package/src/WflowApplication.ts +1 -0
  80. 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() as number !== 200) {
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,6 +1,7 @@
1
1
  {
2
2
  "headers": {
3
- "user": "TestUser"
3
+ "user": "TestUser",
4
+ "sdk": "TestSdk"
4
5
  },
5
6
  "data": {}
6
7
  }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "headers": {
3
- "user": "TestUser"
3
+ "user": "TestUser",
4
+ "sdk": "TestSdk"
4
5
  },
5
6
  "data": []
6
- }
7
+ }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "headers": {
3
- "user": "TestUser"
3
+ "user": "TestUser",
4
+ "sdk": "TestSdk"
4
5
  },
5
6
  "data": {}
6
- }
7
+ }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "headers": {
3
- "user": "TestUser"
3
+ "user": "TestUser",
4
+ "sdk": "TestSdk"
4
5
  },
5
6
  "data": []
6
- }
7
+ }
@@ -1,9 +1,10 @@
1
1
  {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": {
6
- "organization": "test",
7
- "documentId": "463b5265-2672-4191-9e3b-9d6fcfe6a452"
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
  }