@orchesty/connector-wflow 1.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 (54) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +190 -0
  3. package/dist/Batch/WflowSubscribeWebhookBatch.d.ts +7 -0
  4. package/dist/Batch/WflowSubscribeWebhookBatch.js +52 -0
  5. package/dist/Batch/WflowUnsubscribeWebhookBatch.d.ts +7 -0
  6. package/dist/Batch/WflowUnsubscribeWebhookBatch.js +42 -0
  7. package/dist/Connector/WflowGetDocumentConnector.d.ts +310 -0
  8. package/dist/Connector/WflowGetDocumentConnector.js +25 -0
  9. package/dist/Connector/WflowGetOrganizationsConnector.d.ts +15 -0
  10. package/dist/Connector/WflowGetOrganizationsConnector.js +27 -0
  11. package/dist/Connector/WflowPutDocumentConnector.d.ts +117 -0
  12. package/dist/Connector/WflowPutDocumentConnector.js +32 -0
  13. package/dist/Connector/WflowUpdateDocumentStateConnector.d.ts +11 -0
  14. package/dist/Connector/WflowUpdateDocumentStateConnector.js +25 -0
  15. package/dist/WflowApplication.d.ts +40 -0
  16. package/dist/WflowApplication.js +126 -0
  17. package/dist/package.json +22 -0
  18. package/jest.config.js +13 -0
  19. package/package.json +22 -0
  20. package/src/Batch/WflowSubscribeWebhookBatch.ts +80 -0
  21. package/src/Batch/WflowUnsubscribeWebhookBatch.ts +55 -0
  22. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/input.json +6 -0
  23. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/mock.json +5 -0
  24. package/src/Batch/__tests__/Data/WflowSubscribeWebhookBatch/output.json +6 -0
  25. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/input.json +6 -0
  26. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/mock.json +5 -0
  27. package/src/Batch/__tests__/Data/WflowUnsubscribeWebhookBatch/output.json +6 -0
  28. package/src/Batch/__tests__/WflowSubscribeWebhookBatch.ts +17 -0
  29. package/src/Batch/__tests__/WflowUnsubscribeWebhookBatch.ts +17 -0
  30. package/src/Connector/WflowGetDocumentConnector.ts +341 -0
  31. package/src/Connector/WflowGetOrganizationsConnector.ts +40 -0
  32. package/src/Connector/WflowPutDocumentConnector.ts +152 -0
  33. package/src/Connector/WflowUpdateDocumentStateConnector.ts +39 -0
  34. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/input.json +9 -0
  35. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/mock.json +449 -0
  36. package/src/Connector/__tests__/Data/WflowGetDocumentConnector/output.json +450 -0
  37. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/input.json +6 -0
  38. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/mock.json +12 -0
  39. package/src/Connector/__tests__/Data/WflowGetOrganizationsConnector/output.json +13 -0
  40. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/input.json +9 -0
  41. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/mock.json +5 -0
  42. package/src/Connector/__tests__/Data/WflowPutDocumentConnector/output.json +9 -0
  43. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/input.json +8 -0
  44. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/mock.json +5 -0
  45. package/src/Connector/__tests__/Data/WflowUpdateDocumentState/output.json +8 -0
  46. package/src/Connector/__tests__/WflowGetDocumentConnector.ts +17 -0
  47. package/src/Connector/__tests__/WflowGetOrganizationsConnector.ts +17 -0
  48. package/src/Connector/__tests__/WflowPutDocumentConnector.ts +17 -0
  49. package/src/Connector/__tests__/WflowUpdateDocumentState.ts +17 -0
  50. package/src/WflowApplication.ts +140 -0
  51. package/test/dataProvider.ts +55 -0
  52. package/tsconfig.json +9 -0
  53. package/tsconfig.prod.json +10 -0
  54. package/tsconfig.prod.tsbuildinfo +1 -0
@@ -0,0 +1,449 @@
1
+ {
2
+ "http": "GET https://api.wflow.com/api/test/documents/463b5265-2672-4191-9e3b-9d6fcfe6a452",
3
+ "code": 200,
4
+ "body": {
5
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
6
+ "serie": {
7
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
8
+ "externalId": "string",
9
+ "code": "string",
10
+ "description": "string",
11
+ "isValid": true,
12
+ "kind": "IncomingInvoice",
13
+ "invoiceType": "TaxInvoice"
14
+ },
15
+ "number": "string",
16
+ "internalCode": "string",
17
+ "vatDocumentCode": "string",
18
+ "variableSymbol": "string",
19
+ "constantSymbol": "string",
20
+ "specificSymbol": "string",
21
+ "issueDate": "2019-08-24T14:15:22Z",
22
+ "dueDate": "2019-08-24T14:15:22Z",
23
+ "vatDate": "2019-08-24T14:15:22Z",
24
+ "acceptDate": "2019-08-24T14:15:22Z",
25
+ "caseDate": "2019-08-24T14:15:22Z",
26
+ "validFrom": "2019-08-24T14:15:22Z",
27
+ "validTo": "2019-08-24T14:15:22Z",
28
+ "effectiveFrom": "2019-08-24T14:15:22Z",
29
+ "effectiveTo": "2019-08-24T14:15:22Z",
30
+ "signatureDate": "2019-08-24T14:15:22Z",
31
+ "reviewDate": "2019-08-24T14:15:22Z",
32
+ "accountTerm": "string",
33
+ "vatTerm": "string",
34
+ "taxExclusiveAmount": -1.7976931348623157e308,
35
+ "totalAmount": -1.7976931348623157e308,
36
+ "roundingAmount": -1.7976931348623157e308,
37
+ "totalAmountFC": -1.7976931348623157e308,
38
+ "advanceAmount": -1.7976931348623157e308,
39
+ "currency": "string",
40
+ "partnerIC": "string",
41
+ "partnerVAT": "string",
42
+ "partnerLocalVAT": "string",
43
+ "partnerName": "string",
44
+ "partnerAddress": "string",
45
+ "partnerEmail": "string",
46
+ "accountNo": "string",
47
+ "bankCode": "string",
48
+ "iban": "string",
49
+ "bic": "string",
50
+ "meIC": "string",
51
+ "exchangeRate": -1.7976931348623157e308,
52
+ "exchangeRateUnits": -2147483648,
53
+ "tag": "string",
54
+ "orderNo": "string",
55
+ "description": "string",
56
+ "contactPersonName": "string",
57
+ "contactPersonEmail": "string",
58
+ "remainsToDeliverAmount": -1.7976931348623157e308,
59
+ "invoiceType": "TaxInvoice",
60
+ "expectedDeliveryDate": "2019-08-24T14:15:22Z",
61
+ "accountCode": "string",
62
+ "doNotPay": true,
63
+ "created": "2019-08-24T14:15:22Z",
64
+ "updated": "2019-08-24T14:15:22Z",
65
+ "lastAction": "2019-08-24T14:15:22Z",
66
+ "removed": "2019-08-24T14:15:22Z",
67
+ "locked": true,
68
+ "approvalStatus": "NotApproved",
69
+ "flowStatus": "New",
70
+ "payment": {
71
+ "paidAmount": 0,
72
+ "paidDate": "2019-08-24T14:15:22Z",
73
+ "paymentStatus": "NotPaid",
74
+ "paymentOrderAmount": 0,
75
+ "paymentOrderStatus": "Requested",
76
+ "activePaymentRequestDate": "2019-08-24T14:15:22Z"
77
+ },
78
+ "dataSource": "ISDOC",
79
+ "source": "Email",
80
+ "createdBy": "string",
81
+ "series": "string",
82
+ "type": {
83
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
84
+ "name": "string",
85
+ "kind": "IncomingInvoice",
86
+ "default": true,
87
+ "erpExclude": true,
88
+ "filesExtendName": true,
89
+ "docCreatingMethod": "Upload",
90
+ "autoStamp": "None",
91
+ "serie": {
92
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
93
+ "externalId": "string",
94
+ "code": "string",
95
+ "description": "string",
96
+ "isValid": true,
97
+ "kind": "IncomingInvoice",
98
+ "invoiceType": "TaxInvoice"
99
+ },
100
+ "sequence": {
101
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
102
+ "entity": "string",
103
+ "description": "string",
104
+ "fixedPart": "string",
105
+ "counter": "string"
106
+ },
107
+ "invoiceType": "TaxInvoice"
108
+ },
109
+ "partner": {
110
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
111
+ "externalId": "string",
112
+ "ic": "string",
113
+ "vat": "string",
114
+ "name": "string",
115
+ "address": "string",
116
+ "localVAT": "string",
117
+ "note": "string",
118
+ "phoneNo": "string",
119
+ "mailAddress": "string",
120
+ "deliveryPeriod": 0,
121
+ "minOrderTotal": 0,
122
+ "toleranceRate": 0,
123
+ "language": "string",
124
+ "isValid": true,
125
+ "businessRegisterRegistration": "string",
126
+ "customer": true,
127
+ "supplier": true
128
+ },
129
+ "deliveryLocation": {
130
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
131
+ "externalId": "string",
132
+ "code": "string",
133
+ "description": "string",
134
+ "isValid": true,
135
+ "address": "string",
136
+ "contact": "string"
137
+ },
138
+ "accounting": {
139
+ "businessItemCode": "string",
140
+ "accountingRule": {
141
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
142
+ "externalId": "string",
143
+ "code": "string",
144
+ "description": "string",
145
+ "isValid": true,
146
+ "kind": "IncomingInvoice"
147
+ },
148
+ "activity": {
149
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
150
+ "externalId": "string",
151
+ "code": "string",
152
+ "description": "string",
153
+ "isValid": true
154
+ },
155
+ "businessCase": {
156
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
157
+ "externalId": "string",
158
+ "code": "string",
159
+ "description": "string",
160
+ "isValid": true
161
+ },
162
+ "cardDocumentType": {
163
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
164
+ "externalId": "string",
165
+ "code": "string",
166
+ "description": "string",
167
+ "isValid": true
168
+ },
169
+ "cashDocumentType": {
170
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
171
+ "externalId": "string",
172
+ "code": "string",
173
+ "description": "string",
174
+ "isValid": true
175
+ },
176
+ "cashRegister": {
177
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
178
+ "externalId": "string",
179
+ "code": "string",
180
+ "description": "string",
181
+ "isValid": true
182
+ },
183
+ "contraAccount": {
184
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
185
+ "externalId": "string",
186
+ "code": "string",
187
+ "description": "string",
188
+ "isValid": true
189
+ },
190
+ "contract": {
191
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
192
+ "externalId": "string",
193
+ "code": "string",
194
+ "description": "string",
195
+ "isValid": true
196
+ },
197
+ "costCenter": {
198
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
199
+ "externalId": "string",
200
+ "code": "string",
201
+ "description": "string",
202
+ "isValid": true
203
+ },
204
+ "employee": {
205
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
206
+ "externalId": "string",
207
+ "code": "string",
208
+ "description": "string",
209
+ "isValid": true
210
+ },
211
+ "paymentMethod": {
212
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
213
+ "externalId": "string",
214
+ "code": "string",
215
+ "description": "string",
216
+ "isValid": true,
217
+ "kind": "IncomingInvoice"
218
+ },
219
+ "project": {
220
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
221
+ "externalId": "string",
222
+ "code": "string",
223
+ "description": "string",
224
+ "isValid": true
225
+ },
226
+ "vatControlStatementLine": {
227
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
228
+ "externalId": "string",
229
+ "code": "string",
230
+ "description": "string",
231
+ "isValid": true
232
+ },
233
+ "vatReturnLine": {
234
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
235
+ "externalId": "string",
236
+ "code": "string",
237
+ "description": "string",
238
+ "isValid": true,
239
+ "reverseCharge": true
240
+ },
241
+ "vatReverseChargeCode": {
242
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
243
+ "externalId": "string",
244
+ "code": "string",
245
+ "description": "string",
246
+ "isValid": true
247
+ },
248
+ "vehicle": {
249
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
250
+ "externalId": "string",
251
+ "code": "string",
252
+ "description": "string",
253
+ "isValid": true
254
+ },
255
+ "vatSupplyModeCode": "Normal",
256
+ "vatApplyReductionCoefficient": true,
257
+ "vatFixedAssets": true,
258
+ "vatMode": "Standard"
259
+ },
260
+ "vaTs": [
261
+ {
262
+ "rate": 0,
263
+ "type": "Exempt",
264
+ "base": 0,
265
+ "tax": 0
266
+ }
267
+ ],
268
+ "lines": [
269
+ {
270
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
271
+ "totalAmount": 0,
272
+ "totalAmountFC": 0,
273
+ "accountCode": "string",
274
+ "currency": "string",
275
+ "description": "string",
276
+ "quantity": 0,
277
+ "unitPrice": 0,
278
+ "measureUnit": "string",
279
+ "vatType": "Exempt",
280
+ "vatRate": 0,
281
+ "order": 0,
282
+ "approval": {
283
+ "level": 0,
284
+ "team": {
285
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
286
+ "name": "string",
287
+ "description": "string",
288
+ "system": true
289
+ },
290
+ "identity": {
291
+ "login": "string",
292
+ "firstName": "string",
293
+ "lastName": "string",
294
+ "fullName": "string"
295
+ },
296
+ "date": "2019-08-24T14:15:22Z",
297
+ "status": "NotApproved"
298
+ },
299
+ "changedAfterApprove": true,
300
+ "accounting": {
301
+ "businessItemCode": "string",
302
+ "accountingRule": {
303
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
304
+ "externalId": "string",
305
+ "code": "string",
306
+ "description": "string",
307
+ "isValid": true,
308
+ "kind": "IncomingInvoice"
309
+ },
310
+ "activity": {
311
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
312
+ "externalId": "string",
313
+ "code": "string",
314
+ "description": "string",
315
+ "isValid": true
316
+ },
317
+ "businessCase": {
318
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
319
+ "externalId": "string",
320
+ "code": "string",
321
+ "description": "string",
322
+ "isValid": true
323
+ },
324
+ "cardDocumentType": {
325
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
326
+ "externalId": "string",
327
+ "code": "string",
328
+ "description": "string",
329
+ "isValid": true
330
+ },
331
+ "cashDocumentType": {
332
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
333
+ "externalId": "string",
334
+ "code": "string",
335
+ "description": "string",
336
+ "isValid": true
337
+ },
338
+ "cashRegister": {
339
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
340
+ "externalId": "string",
341
+ "code": "string",
342
+ "description": "string",
343
+ "isValid": true
344
+ },
345
+ "contraAccount": {
346
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
347
+ "externalId": "string",
348
+ "code": "string",
349
+ "description": "string",
350
+ "isValid": true
351
+ },
352
+ "contract": {
353
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
354
+ "externalId": "string",
355
+ "code": "string",
356
+ "description": "string",
357
+ "isValid": true
358
+ },
359
+ "costCenter": {
360
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
361
+ "externalId": "string",
362
+ "code": "string",
363
+ "description": "string",
364
+ "isValid": true
365
+ },
366
+ "employee": {
367
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
368
+ "externalId": "string",
369
+ "code": "string",
370
+ "description": "string",
371
+ "isValid": true
372
+ },
373
+ "paymentMethod": {
374
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
375
+ "externalId": "string",
376
+ "code": "string",
377
+ "description": "string",
378
+ "isValid": true,
379
+ "kind": "IncomingInvoice"
380
+ },
381
+ "project": {
382
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
383
+ "externalId": "string",
384
+ "code": "string",
385
+ "description": "string",
386
+ "isValid": true
387
+ },
388
+ "vatControlStatementLine": {
389
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
390
+ "externalId": "string",
391
+ "code": "string",
392
+ "description": "string",
393
+ "isValid": true
394
+ },
395
+ "vatReturnLine": {
396
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
397
+ "externalId": "string",
398
+ "code": "string",
399
+ "description": "string",
400
+ "isValid": true,
401
+ "reverseCharge": true
402
+ },
403
+ "vatReverseChargeCode": {
404
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
405
+ "externalId": "string",
406
+ "code": "string",
407
+ "description": "string",
408
+ "isValid": true
409
+ },
410
+ "vehicle": {
411
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
412
+ "externalId": "string",
413
+ "code": "string",
414
+ "description": "string",
415
+ "isValid": true
416
+ },
417
+ "vatSupplyModeCode": "Normal",
418
+ "vatApplyReductionCoefficient": true,
419
+ "vatFixedAssets": true,
420
+ "vatMode": "Standard"
421
+ },
422
+ "code": "string",
423
+ "costCenter": {
424
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
425
+ "externalId": "string",
426
+ "code": "string",
427
+ "description": "string",
428
+ "isValid": true
429
+ },
430
+ "contract": {
431
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
432
+ "externalId": "string",
433
+ "code": "string",
434
+ "description": "string",
435
+ "isValid": true
436
+ },
437
+ "activity": {
438
+ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
439
+ "externalId": "string",
440
+ "code": "string",
441
+ "description": "string",
442
+ "isValid": true
443
+ }
444
+ }
445
+ ],
446
+ "transactionId": "75906707-8c31-479c-b354-aa805c4cefbc",
447
+ "expenseCardId": "a8fd484a-d41d-4d62-82b9-479b13da2c4c"
448
+ }
449
+ }