@factpulse/sdk 3.0.37 → 4.0.1

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 (222) hide show
  1. package/.openapi-generator/FILES +32 -8
  2. package/.openapi-generator/VERSION +1 -1
  3. package/CHANGELOG.md +5 -12
  4. package/README.md +135 -148
  5. package/api/cdarcycle-de-vie-api.ts +186 -86
  6. package/api/client-management-api.ts +672 -0
  7. package/api/downloads-api.ts +0 -152
  8. package/api/invoice-processing-api.ts +2 -2
  9. package/api.ts +1 -0
  10. package/dist/api/cdarcycle-de-vie-api.d.ts +93 -50
  11. package/dist/api/cdarcycle-de-vie-api.js +174 -80
  12. package/dist/api/client-management-api.d.ts +309 -0
  13. package/dist/api/client-management-api.js +642 -0
  14. package/dist/api/downloads-api.d.ts +0 -68
  15. package/dist/api/downloads-api.js +0 -145
  16. package/dist/api.d.ts +1 -0
  17. package/dist/api.js +1 -0
  18. package/dist/esm/api/cdarcycle-de-vie-api.d.ts +93 -50
  19. package/dist/esm/api/cdarcycle-de-vie-api.js +174 -80
  20. package/dist/esm/api/client-management-api.d.ts +309 -0
  21. package/dist/esm/api/client-management-api.js +632 -0
  22. package/dist/esm/api/downloads-api.d.ts +0 -68
  23. package/dist/esm/api/downloads-api.js +0 -145
  24. package/dist/esm/api.d.ts +1 -0
  25. package/dist/esm/api.js +1 -0
  26. package/dist/esm/models/allowance-charge.d.ts +2 -2
  27. package/dist/esm/models/amount.d.ts +1 -1
  28. package/dist/esm/models/amount1.d.ts +1 -1
  29. package/dist/esm/models/amount2.d.ts +16 -0
  30. package/dist/esm/models/chorus-pro-credentials.d.ts +19 -7
  31. package/dist/esm/models/chorus-pro-destination.d.ts +2 -2
  32. package/dist/esm/models/{body-submit-cdar-xml-api-v1-cdar-submit-xml-post.d.ts → client-activate-response.d.ts} +16 -5
  33. package/dist/esm/models/{facture-electronique-rest-api-schemas-validation-validation-error-response.d.ts → client-create-request.d.ts} +6 -4
  34. package/dist/esm/models/client-detail.d.ts +48 -0
  35. package/dist/esm/models/client-list-response.d.ts +33 -0
  36. package/dist/esm/models/client-list-response.js +14 -0
  37. package/dist/esm/models/client-summary.d.ts +48 -0
  38. package/dist/esm/models/client-summary.js +14 -0
  39. package/dist/esm/models/client-update-request.d.ts +19 -0
  40. package/dist/esm/models/client-update-request.js +14 -0
  41. package/dist/esm/models/encaissee-request.d.ts +39 -0
  42. package/dist/esm/models/encaissee-request.js +14 -0
  43. package/dist/esm/models/facture-electronique-rest-api-schemas-cdar-validation-error-response.d.ts +29 -0
  44. package/dist/esm/models/facture-electronique-rest-api-schemas-cdar-validation-error-response.js +14 -0
  45. package/dist/esm/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.d.ts +24 -0
  46. package/dist/esm/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.js +14 -0
  47. package/dist/esm/models/get-chorus-pro-id-request.d.ts +2 -2
  48. package/dist/esm/models/get-invoice-request.d.ts +2 -2
  49. package/dist/esm/models/get-structure-request.d.ts +2 -2
  50. package/dist/esm/models/index.d.ts +15 -4
  51. package/dist/esm/models/index.js +15 -4
  52. package/dist/esm/models/payment-amount-by-rate.d.ts +2 -2
  53. package/dist/esm/models/pdpconfig-response.d.ts +34 -0
  54. package/dist/esm/models/pdpconfig-response.js +14 -0
  55. package/dist/esm/models/pdpconfig-update-request.d.ts +40 -0
  56. package/dist/esm/models/pdpconfig-update-request.js +14 -0
  57. package/dist/esm/models/recipient.d.ts +1 -1
  58. package/dist/{models/facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.d.ts → esm/models/refusee-request.d.ts} +16 -14
  59. package/dist/esm/models/refusee-request.js +14 -0
  60. package/dist/esm/models/scheme-id.d.ts +7 -7
  61. package/dist/esm/models/scheme-id.js +7 -7
  62. package/dist/esm/models/search-structure-request.d.ts +2 -2
  63. package/dist/esm/models/{body-submit-cdar-api-v1-cdar-submit-post.d.ts → secret-status.d.ts} +12 -5
  64. package/dist/esm/models/secret-status.js +14 -0
  65. package/dist/esm/models/simplified-cdarresponse.d.ts +36 -0
  66. package/dist/esm/models/simplified-cdarresponse.js +14 -0
  67. package/dist/esm/models/submit-cdarrequest.d.ts +4 -0
  68. package/dist/esm/models/submit-cdarxmlrequest.d.ts +4 -0
  69. package/dist/esm/models/submit-complete-invoice-response.d.ts +1 -1
  70. package/dist/esm/models/submit-invoice-request.d.ts +2 -2
  71. package/dist/esm/models/supplier.d.ts +1 -1
  72. package/dist/esm/models/validate-cdarresponse.d.ts +3 -3
  73. package/dist/esm/models/validation-error-response.d.ts +3 -12
  74. package/dist/esm/src/helpers/client.d.ts +45 -265
  75. package/dist/esm/src/helpers/client.js +211 -773
  76. package/dist/esm/src/helpers/exceptions.d.ts +3 -1
  77. package/dist/esm/src/helpers/exceptions.js +7 -1
  78. package/dist/esm/src/helpers/index.d.ts +1 -2
  79. package/dist/esm/src/helpers/index.js +1 -3
  80. package/dist/models/allowance-charge.d.ts +2 -2
  81. package/dist/models/amount.d.ts +1 -1
  82. package/dist/models/amount1.d.ts +1 -1
  83. package/dist/models/amount2.d.ts +16 -0
  84. package/dist/models/chorus-pro-credentials.d.ts +19 -7
  85. package/dist/models/chorus-pro-destination.d.ts +2 -2
  86. package/dist/models/client-activate-response.d.ts +28 -0
  87. package/dist/models/{facture-electronique-rest-api-schemas-validation-validation-error-response.d.ts → client-create-request.d.ts} +6 -4
  88. package/dist/models/client-detail.d.ts +48 -0
  89. package/dist/models/client-list-response.d.ts +33 -0
  90. package/dist/models/client-list-response.js +15 -0
  91. package/dist/models/client-summary.d.ts +48 -0
  92. package/dist/models/client-summary.js +15 -0
  93. package/dist/models/client-update-request.d.ts +19 -0
  94. package/dist/models/client-update-request.js +15 -0
  95. package/dist/models/encaissee-request.d.ts +39 -0
  96. package/dist/models/encaissee-request.js +15 -0
  97. package/dist/models/facture-electronique-rest-api-schemas-cdar-validation-error-response.d.ts +29 -0
  98. package/dist/models/facture-electronique-rest-api-schemas-cdar-validation-error-response.js +15 -0
  99. package/dist/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.d.ts +24 -0
  100. package/dist/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.js +15 -0
  101. package/dist/models/get-chorus-pro-id-request.d.ts +2 -2
  102. package/dist/models/get-invoice-request.d.ts +2 -2
  103. package/dist/models/get-structure-request.d.ts +2 -2
  104. package/dist/models/index.d.ts +15 -4
  105. package/dist/models/index.js +15 -4
  106. package/dist/models/payment-amount-by-rate.d.ts +2 -2
  107. package/dist/models/pdpconfig-response.d.ts +34 -0
  108. package/dist/models/pdpconfig-response.js +15 -0
  109. package/dist/models/pdpconfig-update-request.d.ts +40 -0
  110. package/dist/models/pdpconfig-update-request.js +15 -0
  111. package/dist/models/recipient.d.ts +1 -1
  112. package/dist/{esm/models/facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.d.ts → models/refusee-request.d.ts} +16 -14
  113. package/dist/models/refusee-request.js +15 -0
  114. package/dist/models/scheme-id.d.ts +7 -7
  115. package/dist/models/scheme-id.js +7 -7
  116. package/dist/models/search-structure-request.d.ts +2 -2
  117. package/dist/models/{body-submit-cdar-api-v1-cdar-submit-post.d.ts → secret-status.d.ts} +12 -5
  118. package/dist/models/secret-status.js +15 -0
  119. package/dist/models/simplified-cdarresponse.d.ts +36 -0
  120. package/dist/models/simplified-cdarresponse.js +15 -0
  121. package/dist/models/submit-cdarrequest.d.ts +4 -0
  122. package/dist/models/submit-cdarxmlrequest.d.ts +4 -0
  123. package/dist/models/submit-complete-invoice-response.d.ts +1 -1
  124. package/dist/models/submit-invoice-request.d.ts +2 -2
  125. package/dist/models/supplier.d.ts +1 -1
  126. package/dist/models/validate-cdarresponse.d.ts +3 -3
  127. package/dist/models/validation-error-response.d.ts +3 -12
  128. package/dist/src/helpers/client.d.ts +45 -265
  129. package/dist/src/helpers/client.js +214 -784
  130. package/dist/src/helpers/exceptions.d.ts +3 -1
  131. package/dist/src/helpers/exceptions.js +7 -1
  132. package/dist/src/helpers/index.d.ts +1 -2
  133. package/dist/src/helpers/index.js +2 -12
  134. package/docs/AllowanceCharge.md +1 -1
  135. package/docs/Amount.md +1 -1
  136. package/docs/Amount1.md +1 -1
  137. package/docs/Amount2.md +19 -0
  138. package/docs/CDARCycleDeVieApi.md +126 -30
  139. package/docs/ChorusProCredentials.md +9 -9
  140. package/docs/ChorusProDestination.md +1 -1
  141. package/docs/ClientActivateResponse.md +25 -0
  142. package/docs/ClientCreateRequest.md +25 -0
  143. package/docs/ClientDetail.md +41 -0
  144. package/docs/ClientListResponse.md +27 -0
  145. package/docs/ClientManagementApi.md +483 -0
  146. package/docs/ClientSummary.md +41 -0
  147. package/docs/ClientUpdateRequest.md +25 -0
  148. package/docs/DownloadsApi.md +0 -115
  149. package/docs/EncaisseeRequest.md +39 -0
  150. package/docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md +27 -0
  151. package/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +29 -0
  152. package/docs/GetChorusProIdRequest.md +1 -1
  153. package/docs/GetInvoiceRequest.md +1 -1
  154. package/docs/GetStructureRequest.md +1 -1
  155. package/docs/PDPConfigResponse.md +47 -0
  156. package/docs/PDPConfigUpdateRequest.md +31 -0
  157. package/docs/PaymentAmountByRate.md +1 -1
  158. package/docs/Recipient.md +1 -1
  159. package/docs/RefuseeRequest.md +39 -0
  160. package/docs/SchemeID.md +4 -4
  161. package/docs/SearchStructureRequest.md +1 -1
  162. package/docs/SecretStatus.md +23 -0
  163. package/docs/SimplifiedCDARResponse.md +29 -0
  164. package/docs/SubmitCDARRequest.md +8 -0
  165. package/docs/SubmitCDARXMLRequest.md +8 -0
  166. package/docs/SubmitCompleteInvoiceResponse.md +2 -2
  167. package/docs/SubmitInvoiceRequest.md +1 -1
  168. package/docs/Supplier.md +1 -1
  169. package/docs/ValidateCDARResponse.md +2 -2
  170. package/docs/ValidationErrorResponse.md +3 -9
  171. package/models/allowance-charge.ts +2 -2
  172. package/models/amount.ts +1 -1
  173. package/models/amount1.ts +1 -1
  174. package/models/amount2.ts +22 -0
  175. package/models/chorus-pro-credentials.ts +19 -7
  176. package/models/chorus-pro-destination.ts +2 -2
  177. package/models/client-activate-response.ts +34 -0
  178. package/models/{facture-electronique-rest-api-schemas-validation-validation-error-response.ts → client-create-request.ts} +6 -4
  179. package/models/client-detail.ts +54 -0
  180. package/models/{body-submit-cdar-xml-api-v1-cdar-submit-xml-post.ts → client-list-response.ts} +21 -7
  181. package/models/client-summary.ts +54 -0
  182. package/models/client-update-request.ts +25 -0
  183. package/models/{facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.ts → encaissee-request.ts} +19 -14
  184. package/models/{body-submit-cdar-api-v1-cdar-submit-post.ts → facture-electronique-rest-api-schemas-cdar-validation-error-response.ts} +17 -9
  185. package/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.ts +30 -0
  186. package/models/get-chorus-pro-id-request.ts +2 -2
  187. package/models/get-invoice-request.ts +2 -2
  188. package/models/get-structure-request.ts +2 -2
  189. package/models/index.ts +15 -4
  190. package/models/payment-amount-by-rate.ts +2 -2
  191. package/models/pdpconfig-response.ts +42 -0
  192. package/models/pdpconfig-update-request.ts +46 -0
  193. package/models/recipient.ts +1 -1
  194. package/models/refusee-request.ts +44 -0
  195. package/models/scheme-id.ts +7 -7
  196. package/models/search-structure-request.ts +2 -2
  197. package/models/secret-status.ts +30 -0
  198. package/models/simplified-cdarresponse.ts +42 -0
  199. package/models/submit-cdarrequest.ts +4 -0
  200. package/models/submit-cdarxmlrequest.ts +4 -0
  201. package/models/submit-complete-invoice-response.ts +1 -1
  202. package/models/submit-invoice-request.ts +2 -2
  203. package/models/supplier.ts +1 -1
  204. package/models/validate-cdarresponse.ts +3 -3
  205. package/models/validation-error-response.ts +3 -12
  206. package/package.json +1 -1
  207. package/src/helpers/client.ts +227 -832
  208. package/src/helpers/exceptions.ts +9 -1
  209. package/src/helpers/index.ts +1 -3
  210. package/dist/models/body-submit-cdar-xml-api-v1-cdar-submit-xml-post.d.ts +0 -17
  211. package/docs/BodySubmitCdarApiV1CdarSubmitPost.md +0 -22
  212. package/docs/BodySubmitCdarXmlApiV1CdarSubmitXmlPost.md +0 -22
  213. package/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +0 -29
  214. package/docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md +0 -21
  215. /package/dist/esm/models/{body-submit-cdar-api-v1-cdar-submit-post.js → amount2.js} +0 -0
  216. /package/dist/esm/models/{body-submit-cdar-xml-api-v1-cdar-submit-xml-post.js → client-activate-response.js} +0 -0
  217. /package/dist/esm/models/{facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.js → client-create-request.js} +0 -0
  218. /package/dist/esm/models/{facture-electronique-rest-api-schemas-validation-validation-error-response.js → client-detail.js} +0 -0
  219. /package/dist/models/{body-submit-cdar-api-v1-cdar-submit-post.js → amount2.js} +0 -0
  220. /package/dist/models/{body-submit-cdar-xml-api-v1-cdar-submit-xml-post.js → client-activate-response.js} +0 -0
  221. /package/dist/models/{facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.js → client-create-request.js} +0 -0
  222. /package/dist/models/{facture-electronique-rest-api-schemas-validation-validation-error-response.js → client-detail.js} +0 -0
@@ -8,6 +8,7 @@ api/afnorpdppadirectory-service-api.ts
8
8
  api/afnorpdppaflow-service-api.ts
9
9
  api/cdarcycle-de-vie-api.ts
10
10
  api/chorus-pro-api.ts
11
+ api/client-management-api.ts
11
12
  api/document-conversion-api.ts
12
13
  api/downloads-api.ts
13
14
  api/ereporting-api.ts
@@ -130,11 +131,10 @@ docs/AllowanceReasonCode.md
130
131
  docs/AllowanceTotalAmount.md
131
132
  docs/Amount.md
132
133
  docs/Amount1.md
134
+ docs/Amount2.md
133
135
  docs/AmountDue.md
134
136
  docs/AsyncTaskStatus.md
135
137
  docs/BaseAmount.md
136
- docs/BodySubmitCdarApiV1CdarSubmitPost.md
137
- docs/BodySubmitCdarXmlApiV1CdarSubmitXmlPost.md
138
138
  docs/BoundingBoxSchema.md
139
139
  docs/Buyercountry.md
140
140
  docs/CDARCycleDeVieApi.md
@@ -145,6 +145,13 @@ docs/ChorusProApi.md
145
145
  docs/ChorusProCredentials.md
146
146
  docs/ChorusProDestination.md
147
147
  docs/ChorusProResult.md
148
+ docs/ClientActivateResponse.md
149
+ docs/ClientCreateRequest.md
150
+ docs/ClientDetail.md
151
+ docs/ClientListResponse.md
152
+ docs/ClientManagementApi.md
153
+ docs/ClientSummary.md
154
+ docs/ClientUpdateRequest.md
148
155
  docs/Contact.md
149
156
  docs/ConvertResumeRequest.md
150
157
  docs/ConvertSuccessResponse.md
@@ -167,15 +174,16 @@ docs/EReportingValidationError.md
167
174
  docs/ElectronicAddress.md
168
175
  docs/Encaisseamount.md
169
176
  docs/Encaisseamount1.md
177
+ docs/EncaisseeRequest.md
170
178
  docs/EnrichedInvoiceInfo.md
171
179
  docs/ErrorLevel.md
172
180
  docs/ErrorSource.md
173
181
  docs/ExtractionInfo.md
174
182
  docs/FacturXInvoice.md
175
183
  docs/FacturXPDFInfo.md
176
- docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md
184
+ docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md
177
185
  docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md
178
- docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md
186
+ docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md
179
187
  docs/FieldStatus.md
180
188
  docs/FileInfo.md
181
189
  docs/FilesInfo.md
@@ -228,6 +236,8 @@ docs/OperationNature.md
228
236
  docs/OutputFormat.md
229
237
  docs/PDFValidationResultAPI.md
230
238
  docs/PDFXMLVerificationApi.md
239
+ docs/PDPConfigResponse.md
240
+ docs/PDPConfigUpdateRequest.md
231
241
  docs/PDPCredentials.md
232
242
  docs/PageDimensionsSchema.md
233
243
  docs/Payee.md
@@ -249,6 +259,7 @@ docs/ReasonCodeInfo.md
249
259
  docs/ReasonCodesResponse.md
250
260
  docs/Recipient.md
251
261
  docs/RecipientInput.md
262
+ docs/RefuseeRequest.md
252
263
  docs/ReportPeriod.md
253
264
  docs/ReportSender.md
254
265
  docs/RoundingAmount.md
@@ -259,10 +270,12 @@ docs/SearchFlowResponse.md
259
270
  docs/SearchServicesResponse.md
260
271
  docs/SearchStructureRequest.md
261
272
  docs/SearchStructureResponse.md
273
+ docs/SecretStatus.md
262
274
  docs/Sellercountry.md
263
275
  docs/SignatureInfo.md
264
276
  docs/SignatureInfoAPI.md
265
277
  docs/SignatureParameters.md
278
+ docs/SimplifiedCDARResponse.md
266
279
  docs/SimplifiedInvoiceData.md
267
280
  docs/StatusCodeInfo.md
268
281
  docs/StatusCodesResponse.md
@@ -433,12 +446,11 @@ models/allowance-total-amount.ts
433
446
  models/amount-due.ts
434
447
  models/amount.ts
435
448
  models/amount1.ts
449
+ models/amount2.ts
436
450
  models/apierror.ts
437
451
  models/apiprofile.ts
438
452
  models/async-task-status.ts
439
453
  models/base-amount.ts
440
- models/body-submit-cdar-api-v1-cdar-submit-post.ts
441
- models/body-submit-cdar-xml-api-v1-cdar-submit-xml-post.ts
442
454
  models/bounding-box-schema.ts
443
455
  models/buyercountry.ts
444
456
  models/celery-status.ts
@@ -447,6 +459,12 @@ models/charge-total-amount.ts
447
459
  models/chorus-pro-credentials.ts
448
460
  models/chorus-pro-destination.ts
449
461
  models/chorus-pro-result.ts
462
+ models/client-activate-response.ts
463
+ models/client-create-request.ts
464
+ models/client-detail.ts
465
+ models/client-list-response.ts
466
+ models/client-summary.ts
467
+ models/client-update-request.ts
450
468
  models/contact.ts
451
469
  models/convert-resume-request.ts
452
470
  models/convert-success-response.ts
@@ -464,6 +482,7 @@ models/document-type-info.ts
464
482
  models/electronic-address.ts
465
483
  models/encaisseamount.ts
466
484
  models/encaisseamount1.ts
485
+ models/encaissee-request.ts
467
486
  models/enriched-invoice-info.ts
468
487
  models/ereporting-flow-type.ts
469
488
  models/ereporting-validation-error.ts
@@ -472,9 +491,9 @@ models/error-source.ts
472
491
  models/extraction-info.ts
473
492
  models/factur-xinvoice.ts
474
493
  models/factur-xpdfinfo.ts
475
- models/facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.ts
494
+ models/facture-electronique-rest-api-schemas-cdar-validation-error-response.ts
476
495
  models/facture-electronique-rest-api-schemas-ereporting-invoice-type-code.ts
477
- models/facture-electronique-rest-api-schemas-validation-validation-error-response.ts
496
+ models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.ts
478
497
  models/field-status.ts
479
498
  models/file-info.ts
480
499
  models/files-info.ts
@@ -530,6 +549,8 @@ models/payment-amount-by-rate.ts
530
549
  models/payment-card.ts
531
550
  models/payment-means.ts
532
551
  models/pdfvalidation-result-api.ts
552
+ models/pdpconfig-response.ts
553
+ models/pdpconfig-update-request.ts
533
554
  models/pdpcredentials.ts
534
555
  models/percentage.ts
535
556
  models/postal-address.ts
@@ -546,6 +567,7 @@ models/reason-code-info.ts
546
567
  models/reason-codes-response.ts
547
568
  models/recipient-input.ts
548
569
  models/recipient.ts
570
+ models/refusee-request.ts
549
571
  models/report-period.ts
550
572
  models/report-sender.ts
551
573
  models/rounding-amount.ts
@@ -556,10 +578,12 @@ models/search-flow-response.ts
556
578
  models/search-services-response.ts
557
579
  models/search-structure-request.ts
558
580
  models/search-structure-response.ts
581
+ models/secret-status.ts
559
582
  models/sellercountry.ts
560
583
  models/signature-info-api.ts
561
584
  models/signature-info.ts
562
585
  models/signature-parameters.ts
586
+ models/simplified-cdarresponse.ts
563
587
  models/simplified-invoice-data.ts
564
588
  models/status-code-info.ts
565
589
  models/status-codes-response.ts
@@ -1 +1 @@
1
- 7.19.0-SNAPSHOT
1
+ 7.20.0-SNAPSHOT
package/CHANGELOG.md CHANGED
@@ -7,18 +7,11 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [3.0.37] - 2026-01-17
10
+ ## [4.0.1] - 2026-01-20
11
11
 
12
- ### Added
13
- - Version initiale du SDK typescript
14
- - Support complet de l'API FactPulse
15
- - Endpoints Factur-X (génération, validation)
16
- - Endpoints AFNOR PDP/PA (Flow Service, Directory Service)
17
- - Endpoints Chorus Pro (recherche entreprise, soumission factures)
18
- - Endpoints Signature électronique (PAdES-B-B, PAdES-B-T, PAdES-B-LT)
19
- - Support des deux modes d'authentification (stored credentials et zero-trust)
20
- - Documentation complète et exemples
12
+ ### Fixed
13
+ - Gestion post multipart
21
14
 
22
15
 
23
- [Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v3.0.37...HEAD
24
- [3.0.37]: https://github.com/factpulse/sdk-typescript/releases/tag/v3.0.37
16
+ [Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v4.0.1...HEAD
17
+ [4.0.1]: https://github.com/factpulse/sdk-typescript/releases/tag/v4.0.1
package/README.md CHANGED
@@ -8,7 +8,7 @@ Official TypeScript/JavaScript client for the FactPulse API - French electronic
8
8
  - **Chorus Pro**: Integration with the French public invoicing platform
9
9
  - **AFNOR PDP/PA**: Submission of flows compliant with XP Z12-013 standard
10
10
  - **Electronic signature**: PDF signing (PAdES-B-B, PAdES-B-T, PAdES-B-LT)
11
- - **Simplified client**: JWT authentication and polling integrated via `helpers`
11
+ - **Thin HTTP wrapper**: Generic `post()` and `get()` methods with automatic JWT auth and polling
12
12
 
13
13
  ## Installation
14
14
 
@@ -20,8 +20,6 @@ yarn add @factpulse/sdk
20
20
 
21
21
  ## Quick Start
22
22
 
23
- The `helpers` module provides a simplified API with automatic authentication and polling:
24
-
25
23
  ```typescript
26
24
  import { FactPulseClient } from '@factpulse/sdk/helpers';
27
25
  import * as fs from 'fs';
@@ -29,189 +27,178 @@ import * as fs from 'fs';
29
27
  // Create the client
30
28
  const client = new FactPulseClient({
31
29
  email: 'your_email@example.com',
32
- password: 'your_password'
30
+ password: 'your_password',
31
+ clientUid: 'your-client-uuid', // From dashboard: Configuration > Clients
33
32
  });
34
33
 
35
- // Build the invoice using simplified format (auto-calculates totals)
36
- const invoiceData = {
37
- number: 'INV-2025-001',
38
- supplier: {
39
- name: 'My Company SAS',
40
- siret: '12345678901234',
41
- iban: 'FR7630001007941234567890185',
42
- },
43
- recipient: {
44
- name: 'Client SARL',
45
- siret: '98765432109876',
34
+ // Read your source PDF
35
+ const pdfB64 = fs.readFileSync('source_invoice.pdf').toString('base64');
36
+
37
+ // Generate Factur-X and submit to PDP in one call
38
+ const result = await client.post('processing/invoices/submit-complete-async', {
39
+ invoiceData: {
40
+ number: 'INV-2025-001',
41
+ supplier: {
42
+ siret: '12345678901234',
43
+ iban: 'FR7630001007941234567890185',
44
+ routing_address: '12345678901234',
45
+ },
46
+ recipient: {
47
+ siret: '98765432109876',
48
+ routing_address: '98765432109876',
49
+ },
50
+ lines: [
51
+ {
52
+ description: 'Consulting services',
53
+ quantity: 10,
54
+ unitPrice: 100.0,
55
+ vatRate: 20.0,
56
+ },
57
+ ],
46
58
  },
47
- lines: [
48
- {
49
- description: 'Consulting services',
50
- quantity: 10,
51
- unitPrice: 100.0,
52
- vatRate: 20,
53
- }
54
- ],
55
- };
56
-
57
- // Generate the Factur-X PDF
58
- const pdfBytes = await client.generateFacturx(invoiceData, 'source_invoice.pdf');
59
-
60
- fs.writeFileSync('facturx_invoice.pdf', pdfBytes);
61
- ```
62
-
63
- ## Available Helpers
64
-
65
- ### amount(value)
59
+ sourcePdf: pdfB64,
60
+ profile: 'EN16931',
61
+ destination: { type: 'afnor' },
62
+ });
66
63
 
67
- Converts a value to a formatted string for monetary amounts.
64
+ // PDF is in result.content (auto-polled, auto-decoded from base64)
65
+ fs.writeFileSync('facturx_invoice.pdf', result.content);
68
66
 
69
- ```typescript
70
- import { amount } from '@factpulse/sdk/helpers';
71
-
72
- amount(1234.5); // "1234.50"
73
- amount("1234.56"); // "1234.56"
74
- amount(null); // "0.00"
67
+ console.log(`Flow ID: ${result.afnorResult?.flowId}`);
75
68
  ```
76
69
 
77
- ### invoiceTotals(exclTax, vat, inclTax, amountDue, options?)
70
+ ## API Methods
78
71
 
79
- Creates a complete invoice totals object.
72
+ The SDK provides two generic methods that map directly to API endpoints:
80
73
 
81
74
  ```typescript
82
- import { invoiceTotals } from '@factpulse/sdk/helpers';
75
+ // POST /api/v1/{path}
76
+ const result = await client.post('path/to/endpoint', { key1: value1, key2: value2 });
83
77
 
84
- const totals = invoiceTotals(1000.00, 200.00, 1200.00, 1200.00, {
85
- globalAllowanceAmount: 50.00, // Optional
86
- globalAllowanceReason: 'Loyalty', // Optional
87
- prepayment: 100.00, // Optional
88
- });
78
+ // GET /api/v1/{path}
79
+ const result = await client.get('path/to/endpoint', { param1: value1 });
89
80
  ```
90
81
 
91
- ### invoiceLine(lineNumber, itemName, quantity, unitNetPrice, lineNetAmount, options?)
82
+ ### Common Endpoints
92
83
 
93
- Creates an invoice line.
84
+ | Endpoint | Method | Description |
85
+ |----------|--------|-------------|
86
+ | `processing/invoices/submit-complete-async` | POST | Generate Factur-X + submit to PDP |
87
+ | `processing/generate-invoice` | POST | Generate Factur-X XML or PDF |
88
+ | `processing/validate-xml` | POST | Validate Factur-X XML |
89
+ | `processing/validate-facturx-pdf` | POST | Validate Factur-X PDF |
90
+ | `processing/sign-pdf` | POST | Sign PDF with certificate |
91
+ | `afnor/flow/v1/flows` | POST | Submit flow to AFNOR PDP |
92
+ | `afnor/incoming-flows/{flow_id}` | GET | Get incoming invoice |
93
+ | `chorus-pro/factures/soumettre` | POST | Submit to Chorus Pro |
94
94
 
95
- ```typescript
96
- import { invoiceLine } from '@factpulse/sdk/helpers';
97
-
98
- const line = invoiceLine(
99
- 1,
100
- 'Consulting services',
101
- 5,
102
- 200.00,
103
- 1000.00,
104
- {
105
- vatRate: 'TVA20', // Or manualVatRate: '20.00'
106
- vatCategory: 'S', // S, Z, E, AE, K
107
- unit: 'HOUR', // LUMP_SUM, PIECE, HOUR, DAY...
108
- reference: 'REF-001', // Optional
109
- }
110
- );
111
- ```
95
+ ## Webhooks
112
96
 
113
- ### vatLine(taxableAmount, vatAmount, options?)
114
-
115
- Creates a VAT breakdown line.
97
+ Instead of polling, you can receive results via webhook by adding `callbackUrl`:
116
98
 
117
99
  ```typescript
118
- import { vatLine } from '@factpulse/sdk/helpers';
119
-
120
- const vat = vatLine(1000.00, 200.00, {
121
- rate: 'TVA20', // Or manualRate: '20.00'
122
- category: 'S', // S, Z, E, AE, K
100
+ // Submit with webhook - returns immediately
101
+ const result = await client.post('processing/invoices/submit-complete-async', {
102
+ invoiceData,
103
+ sourcePdf: pdfB64,
104
+ destination: { type: 'afnor' },
105
+ callbackUrl: 'https://your-server.com/webhook/factpulse',
106
+ webhookMode: 'INLINE', // or 'DOWNLOAD_URL'
123
107
  });
124
- ```
125
108
 
126
- ### postalAddress(line1, postalCode, city, options?)
109
+ const taskId = result.taskId;
110
+ // Result will be POSTed to your webhook URL
111
+ ```
127
112
 
128
- Creates a structured postal address.
113
+ ### Webhook Receiver Example (Express.js)
129
114
 
130
115
  ```typescript
131
- import { postalAddress } from '@factpulse/sdk/helpers';
132
-
133
- const address = postalAddress('123 Republic Street', '75001', 'Paris', {
134
- country: 'FR', // Default: 'FR'
135
- line2: 'Building A' // Optional
136
- });
137
- ```
138
-
139
- ### electronicAddress(identifier, schemeId?)
116
+ import express from 'express';
117
+ import crypto from 'crypto';
118
+
119
+ const app = express();
120
+ app.use(express.json({ verify: (req, res, buf) => (req.rawBody = buf) }));
121
+
122
+ const WEBHOOK_SECRET = 'your-shared-secret';
123
+
124
+ function verifySignature(payload: Buffer, signature: string): boolean {
125
+ if (!signature.startsWith('sha256=')) return false;
126
+ const expected = crypto
127
+ .createHmac('sha256', WEBHOOK_SECRET)
128
+ .update(payload)
129
+ .digest('hex');
130
+ return crypto.timingSafeEqual(
131
+ Buffer.from(signature.slice(7)),
132
+ Buffer.from(expected)
133
+ );
134
+ }
135
+
136
+ app.post('/webhook/factpulse', (req, res) => {
137
+ const signature = req.headers['x-webhook-signature'] as string || '';
138
+ if (!verifySignature(req.rawBody, signature)) {
139
+ return res.status(401).json({ error: 'Invalid signature' });
140
+ }
140
141
 
141
- Creates an electronic address (digital identifier).
142
+ const event = req.body;
143
+ const eventType = event.event_type;
144
+ const data = event.data;
142
145
 
143
- ```typescript
144
- import { electronicAddress } from '@factpulse/sdk/helpers';
146
+ if (eventType === 'submission.completed') {
147
+ console.log(`Invoice submitted: ${data.afnorResult?.flowId}`);
148
+ } else if (eventType === 'submission.failed') {
149
+ console.log(`Submission failed: ${data.error}`);
150
+ }
145
151
 
146
- // SIRET (schemeId="0225")
147
- const address = electronicAddress('12345678901234', '0225');
152
+ res.json({ status: 'received' });
153
+ });
148
154
 
149
- // SIREN (schemeId="0009", default)
150
- const address = electronicAddress('123456789');
155
+ app.listen(3000);
151
156
  ```
152
157
 
153
- ### supplier(name, siret, addressLine1, postalCode, city, options?)
158
+ ### Webhook Event Types
154
159
 
155
- Creates a complete supplier with automatic SIREN and intra-EU VAT calculation.
160
+ | Event | Description |
161
+ |-------|-------------|
162
+ | `generation.completed` | Factur-X generated successfully |
163
+ | `generation.failed` | Generation failed |
164
+ | `validation.completed` | Validation passed |
165
+ | `validation.failed` | Validation failed |
166
+ | `signature.completed` | PDF signed |
167
+ | `submission.completed` | Submitted to PDP/Chorus |
168
+ | `submission.failed` | Submission failed |
156
169
 
157
- ```typescript
158
- import { supplier } from '@factpulse/sdk/helpers';
159
-
160
- const s = supplier(
161
- 'My Company SAS',
162
- '12345678901234',
163
- '123 Example Street',
164
- '75001',
165
- 'Paris',
166
- { iban: 'FR7630006000011234567890189' }
167
- );
168
- // SIREN and intra-EU VAT number calculated automatically
169
- ```
170
-
171
- ### recipient(name, siret, addressLine1, postalCode, city, options?)
170
+ ## Zero-Storage Mode
172
171
 
173
- Creates a recipient (customer) with automatic SIREN calculation.
172
+ Pass PDP credentials directly in the request (no server-side storage):
174
173
 
175
174
  ```typescript
176
- import { recipient } from '@factpulse/sdk/helpers';
177
-
178
- const r = recipient(
179
- 'Client SARL',
180
- '98765432109876',
181
- '456 Test Avenue',
182
- '69001',
183
- 'Lyon'
184
- );
175
+ const result = await client.post('processing/invoices/submit-complete-async', {
176
+ invoiceData,
177
+ sourcePdf: pdfB64,
178
+ destination: {
179
+ type: 'afnor',
180
+ flowServiceUrl: 'https://api.pdp.example.com/flow/v1',
181
+ tokenUrl: 'https://auth.pdp.example.com/oauth/token',
182
+ clientId: 'your_pdp_client_id',
183
+ clientSecret: 'your_pdp_client_secret',
184
+ },
185
+ });
185
186
  ```
186
187
 
187
- ## Zero-Trust Mode (Chorus Pro / AFNOR)
188
-
189
- To pass your own credentials without server-side storage:
188
+ ## Error Handling
190
189
 
191
190
  ```typescript
192
- import {
193
- FactPulseClient,
194
- ChorusProCredentials,
195
- AFNORCredentials,
196
- } from '@factpulse/sdk/helpers';
197
-
198
- const client = new FactPulseClient({
199
- email: 'your_email@example.com',
200
- password: 'your_password',
201
- chorusCredentials: {
202
- pisteClientId: 'your_client_id',
203
- pisteClientSecret: 'your_client_secret',
204
- chorusProLogin: 'your_login',
205
- chorusProPassword: 'your_password',
206
- sandbox: true,
207
- },
208
- afnorCredentials: {
209
- flowServiceUrl: 'https://api.pdp.fr/flow/v1',
210
- tokenUrl: 'https://auth.pdp.fr/oauth/token',
211
- clientId: 'your_client_id',
212
- clientSecret: 'your_client_secret',
213
- },
214
- });
191
+ import { FactPulseClient, FactPulseError } from '@factpulse/sdk/helpers';
192
+
193
+ try {
194
+ const result = await client.post('processing/validate-xml', { xmlContent });
195
+ } catch (e) {
196
+ if (e instanceof FactPulseError) {
197
+ console.log(`Error: ${e.message}`);
198
+ console.log(`Status code: ${e.statusCode}`);
199
+ console.log(`Details: ${e.details}`); // Validation errors list
200
+ }
201
+ }
215
202
  ```
216
203
 
217
204
  ## Resources