@facturino/node 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 (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +204 -0
  3. package/dist/cjs/client.d.ts +24 -0
  4. package/dist/cjs/client.js +203 -0
  5. package/dist/cjs/errors.d.ts +76 -0
  6. package/dist/cjs/errors.js +128 -0
  7. package/dist/cjs/index.d.ts +59 -0
  8. package/dist/cjs/index.js +77 -0
  9. package/dist/cjs/package.json +3 -0
  10. package/dist/cjs/pagination.d.ts +24 -0
  11. package/dist/cjs/pagination.js +68 -0
  12. package/dist/cjs/resources/account.d.ts +58 -0
  13. package/dist/cjs/resources/account.js +48 -0
  14. package/dist/cjs/resources/archives.d.ts +16 -0
  15. package/dist/cjs/resources/archives.js +17 -0
  16. package/dist/cjs/resources/billing.d.ts +30 -0
  17. package/dist/cjs/resources/billing.js +45 -0
  18. package/dist/cjs/resources/companies.d.ts +47 -0
  19. package/dist/cjs/resources/companies.js +45 -0
  20. package/dist/cjs/resources/creditNotes.d.ts +64 -0
  21. package/dist/cjs/resources/creditNotes.js +62 -0
  22. package/dist/cjs/resources/customers.d.ts +17 -0
  23. package/dist/cjs/resources/customers.js +36 -0
  24. package/dist/cjs/resources/ereporting.d.ts +12 -0
  25. package/dist/cjs/resources/ereporting.js +23 -0
  26. package/dist/cjs/resources/events.d.ts +11 -0
  27. package/dist/cjs/resources/events.js +20 -0
  28. package/dist/cjs/resources/exports.d.ts +20 -0
  29. package/dist/cjs/resources/exports.js +31 -0
  30. package/dist/cjs/resources/health.d.ts +13 -0
  31. package/dist/cjs/resources/health.js +18 -0
  32. package/dist/cjs/resources/invoices.d.ts +112 -0
  33. package/dist/cjs/resources/invoices.js +141 -0
  34. package/dist/cjs/resources/jobs.d.ts +10 -0
  35. package/dist/cjs/resources/jobs.js +24 -0
  36. package/dist/cjs/resources/payments.d.ts +16 -0
  37. package/dist/cjs/resources/payments.js +25 -0
  38. package/dist/cjs/resources/products.d.ts +15 -0
  39. package/dist/cjs/resources/products.js +32 -0
  40. package/dist/cjs/resources/quotes.d.ts +44 -0
  41. package/dist/cjs/resources/quotes.js +58 -0
  42. package/dist/cjs/resources/received-invoices.d.ts +14 -0
  43. package/dist/cjs/resources/received-invoices.js +29 -0
  44. package/dist/cjs/resources/recurringInvoices.d.ts +15 -0
  45. package/dist/cjs/resources/recurringInvoices.js +32 -0
  46. package/dist/cjs/resources/reference.d.ts +45 -0
  47. package/dist/cjs/resources/reference.js +57 -0
  48. package/dist/cjs/resources/reporting.d.ts +11 -0
  49. package/dist/cjs/resources/reporting.js +30 -0
  50. package/dist/cjs/resources/sandbox.d.ts +12 -0
  51. package/dist/cjs/resources/sandbox.js +21 -0
  52. package/dist/cjs/resources/usage.d.ts +20 -0
  53. package/dist/cjs/resources/usage.js +25 -0
  54. package/dist/cjs/resources/validate.d.ts +18 -0
  55. package/dist/cjs/resources/validate.js +23 -0
  56. package/dist/cjs/resources/webhookEndpoints.d.ts +20 -0
  57. package/dist/cjs/resources/webhookEndpoints.js +31 -0
  58. package/dist/cjs/types.d.ts +1178 -0
  59. package/dist/cjs/types.js +5 -0
  60. package/dist/cjs/webhooks.d.ts +14 -0
  61. package/dist/cjs/webhooks.js +63 -0
  62. package/dist/esm/client.d.ts +25 -0
  63. package/dist/esm/client.d.ts.map +1 -0
  64. package/dist/esm/client.js +200 -0
  65. package/dist/esm/client.js.map +1 -0
  66. package/dist/esm/errors.d.ts +77 -0
  67. package/dist/esm/errors.d.ts.map +1 -0
  68. package/dist/esm/errors.js +114 -0
  69. package/dist/esm/errors.js.map +1 -0
  70. package/dist/esm/index.d.ts +60 -0
  71. package/dist/esm/index.d.ts.map +1 -0
  72. package/dist/esm/index.js +61 -0
  73. package/dist/esm/index.js.map +1 -0
  74. package/dist/esm/pagination.d.ts +25 -0
  75. package/dist/esm/pagination.d.ts.map +1 -0
  76. package/dist/esm/pagination.js +65 -0
  77. package/dist/esm/pagination.js.map +1 -0
  78. package/dist/esm/resources/account.d.ts +59 -0
  79. package/dist/esm/resources/account.d.ts.map +1 -0
  80. package/dist/esm/resources/account.js +45 -0
  81. package/dist/esm/resources/account.js.map +1 -0
  82. package/dist/esm/resources/archives.d.ts +17 -0
  83. package/dist/esm/resources/archives.d.ts.map +1 -0
  84. package/dist/esm/resources/archives.js +14 -0
  85. package/dist/esm/resources/archives.js.map +1 -0
  86. package/dist/esm/resources/billing.d.ts +31 -0
  87. package/dist/esm/resources/billing.d.ts.map +1 -0
  88. package/dist/esm/resources/billing.js +42 -0
  89. package/dist/esm/resources/billing.js.map +1 -0
  90. package/dist/esm/resources/companies.d.ts +48 -0
  91. package/dist/esm/resources/companies.d.ts.map +1 -0
  92. package/dist/esm/resources/companies.js +42 -0
  93. package/dist/esm/resources/companies.js.map +1 -0
  94. package/dist/esm/resources/creditNotes.d.ts +65 -0
  95. package/dist/esm/resources/creditNotes.d.ts.map +1 -0
  96. package/dist/esm/resources/creditNotes.js +59 -0
  97. package/dist/esm/resources/creditNotes.js.map +1 -0
  98. package/dist/esm/resources/customers.d.ts +18 -0
  99. package/dist/esm/resources/customers.d.ts.map +1 -0
  100. package/dist/esm/resources/customers.js +33 -0
  101. package/dist/esm/resources/customers.js.map +1 -0
  102. package/dist/esm/resources/ereporting.d.ts +13 -0
  103. package/dist/esm/resources/ereporting.d.ts.map +1 -0
  104. package/dist/esm/resources/ereporting.js +20 -0
  105. package/dist/esm/resources/ereporting.js.map +1 -0
  106. package/dist/esm/resources/events.d.ts +12 -0
  107. package/dist/esm/resources/events.d.ts.map +1 -0
  108. package/dist/esm/resources/events.js +17 -0
  109. package/dist/esm/resources/events.js.map +1 -0
  110. package/dist/esm/resources/exports.d.ts +21 -0
  111. package/dist/esm/resources/exports.d.ts.map +1 -0
  112. package/dist/esm/resources/exports.js +28 -0
  113. package/dist/esm/resources/exports.js.map +1 -0
  114. package/dist/esm/resources/health.d.ts +14 -0
  115. package/dist/esm/resources/health.d.ts.map +1 -0
  116. package/dist/esm/resources/health.js +15 -0
  117. package/dist/esm/resources/health.js.map +1 -0
  118. package/dist/esm/resources/invoices.d.ts +113 -0
  119. package/dist/esm/resources/invoices.d.ts.map +1 -0
  120. package/dist/esm/resources/invoices.js +138 -0
  121. package/dist/esm/resources/invoices.js.map +1 -0
  122. package/dist/esm/resources/jobs.d.ts +11 -0
  123. package/dist/esm/resources/jobs.d.ts.map +1 -0
  124. package/dist/esm/resources/jobs.js +21 -0
  125. package/dist/esm/resources/jobs.js.map +1 -0
  126. package/dist/esm/resources/payments.d.ts +17 -0
  127. package/dist/esm/resources/payments.d.ts.map +1 -0
  128. package/dist/esm/resources/payments.js +22 -0
  129. package/dist/esm/resources/payments.js.map +1 -0
  130. package/dist/esm/resources/products.d.ts +16 -0
  131. package/dist/esm/resources/products.d.ts.map +1 -0
  132. package/dist/esm/resources/products.js +29 -0
  133. package/dist/esm/resources/products.js.map +1 -0
  134. package/dist/esm/resources/quotes.d.ts +45 -0
  135. package/dist/esm/resources/quotes.d.ts.map +1 -0
  136. package/dist/esm/resources/quotes.js +55 -0
  137. package/dist/esm/resources/quotes.js.map +1 -0
  138. package/dist/esm/resources/received-invoices.d.ts +15 -0
  139. package/dist/esm/resources/received-invoices.d.ts.map +1 -0
  140. package/dist/esm/resources/received-invoices.js +26 -0
  141. package/dist/esm/resources/received-invoices.js.map +1 -0
  142. package/dist/esm/resources/recurringInvoices.d.ts +16 -0
  143. package/dist/esm/resources/recurringInvoices.d.ts.map +1 -0
  144. package/dist/esm/resources/recurringInvoices.js +29 -0
  145. package/dist/esm/resources/recurringInvoices.js.map +1 -0
  146. package/dist/esm/resources/reference.d.ts +46 -0
  147. package/dist/esm/resources/reference.d.ts.map +1 -0
  148. package/dist/esm/resources/reference.js +54 -0
  149. package/dist/esm/resources/reference.js.map +1 -0
  150. package/dist/esm/resources/reporting.d.ts +12 -0
  151. package/dist/esm/resources/reporting.d.ts.map +1 -0
  152. package/dist/esm/resources/reporting.js +27 -0
  153. package/dist/esm/resources/reporting.js.map +1 -0
  154. package/dist/esm/resources/sandbox.d.ts +13 -0
  155. package/dist/esm/resources/sandbox.d.ts.map +1 -0
  156. package/dist/esm/resources/sandbox.js +18 -0
  157. package/dist/esm/resources/sandbox.js.map +1 -0
  158. package/dist/esm/resources/usage.d.ts +21 -0
  159. package/dist/esm/resources/usage.d.ts.map +1 -0
  160. package/dist/esm/resources/usage.js +22 -0
  161. package/dist/esm/resources/usage.js.map +1 -0
  162. package/dist/esm/resources/validate.d.ts +19 -0
  163. package/dist/esm/resources/validate.d.ts.map +1 -0
  164. package/dist/esm/resources/validate.js +20 -0
  165. package/dist/esm/resources/validate.js.map +1 -0
  166. package/dist/esm/resources/webhookEndpoints.d.ts +21 -0
  167. package/dist/esm/resources/webhookEndpoints.d.ts.map +1 -0
  168. package/dist/esm/resources/webhookEndpoints.js +28 -0
  169. package/dist/esm/resources/webhookEndpoints.js.map +1 -0
  170. package/dist/esm/types.d.ts +1179 -0
  171. package/dist/esm/types.d.ts.map +1 -0
  172. package/dist/esm/types.js +5 -0
  173. package/dist/esm/types.js.map +1 -0
  174. package/dist/esm/webhooks.d.ts +15 -0
  175. package/dist/esm/webhooks.d.ts.map +1 -0
  176. package/dist/esm/webhooks.js +60 -0
  177. package/dist/esm/webhooks.js.map +1 -0
  178. package/package.json +66 -0
@@ -0,0 +1,17 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import { AutoPaginatingList } from '../pagination.js';
3
+ import type { Payment, PaymentCreateParams, PaymentCancelResult, PaginationParams, RequestOptions } from '../types.js';
4
+ /** Records payments against an invoice — accessed via `facturino.invoices.payments`. */
5
+ export declare class Payments {
6
+ private readonly client;
7
+ constructor(client: HttpClient);
8
+ create(invoiceId: string, params: PaymentCreateParams, options?: RequestOptions): Promise<Payment>;
9
+ list(invoiceId: string, params?: PaginationParams): AutoPaginatingList<Payment>;
10
+ /**
11
+ * Cancel a recorded payment. The payment is kept for the audit trail
12
+ * (status `cancelled`) and the invoice is re-settled from the reversal.
13
+ * Rejected once the payment has been reported to the tax authority.
14
+ */
15
+ cancel(invoiceId: string, paymentId: string, options?: RequestOptions): Promise<PaymentCancelResult>;
16
+ }
17
+ //# sourceMappingURL=payments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../../src/resources/payments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,wFAAwF;AACxF,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEzC,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,OAAO,CAAC;IAQnB,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,gBAAgB,GACxB,kBAAkB,CAAC,OAAO,CAAC;IAQ9B;;;;OAIG;IACG,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,mBAAmB,CAAC;CAOhC"}
@@ -0,0 +1,22 @@
1
+ import { AutoPaginatingList } from '../pagination.js';
2
+ /** Records payments against an invoice — accessed via `facturino.invoices.payments`. */
3
+ export class Payments {
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ async create(invoiceId, params, options) {
8
+ return this.client.post(`/v1/invoices/${invoiceId}/payments`, params, options);
9
+ }
10
+ list(invoiceId, params) {
11
+ return new AutoPaginatingList(this.client, `/v1/invoices/${invoiceId}/payments`, params);
12
+ }
13
+ /**
14
+ * Cancel a recorded payment. The payment is kept for the audit trail
15
+ * (status `cancelled`) and the invoice is re-settled from the reversal.
16
+ * Rejected once the payment has been reported to the tax authority.
17
+ */
18
+ async cancel(invoiceId, paymentId, options) {
19
+ return this.client.post(`/v1/invoices/${invoiceId}/payments/${paymentId}/cancel`, undefined, options);
20
+ }
21
+ }
22
+ //# sourceMappingURL=payments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments.js","sourceRoot":"","sources":["../../../src/resources/payments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AASrD,wFAAwF;AACxF,MAAM,OAAO,QAAQ;IACnB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,MAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,gBAAgB,SAAS,WAAW,EACpC,MAAM,EACN,OAAO,CACR,CAAA;IACH,CAAC;IAED,IAAI,CACF,SAAiB,EACjB,MAAyB;QAEzB,OAAO,IAAI,kBAAkB,CAC3B,IAAI,CAAC,MAAM,EACX,gBAAgB,SAAS,WAAW,EACpC,MAAM,CACP,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,SAAiB,EACjB,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,gBAAgB,SAAS,aAAa,SAAS,SAAS,EACxD,SAAS,EACT,OAAO,CACR,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import { AutoPaginatingList } from '../pagination.js';
3
+ import type { Product, ProductCreateParams, ProductUpdateParams, ProductListParams, JobResponse, RequestOptions } from '../types.js';
4
+ /** Product catalog management with CSV import/export support. */
5
+ export declare class Products {
6
+ private readonly client;
7
+ constructor(client: HttpClient);
8
+ create(params: ProductCreateParams, options?: RequestOptions): Promise<Product>;
9
+ list(params?: ProductListParams): AutoPaginatingList<Product>;
10
+ get(id: string): Promise<Product>;
11
+ update(id: string, params: ProductUpdateParams): Promise<Product>;
12
+ del(id: string): Promise<void>;
13
+ importCsv(csv: string, options?: RequestOptions): Promise<JobResponse>;
14
+ exportCsv(): Promise<JobResponse>;
15
+ }
16
+ //# sourceMappingURL=products.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../src/resources/products.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,iEAAiE;AACjE,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEzC,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrF,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAIvD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC;IAItE,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC;CAGxC"}
@@ -0,0 +1,29 @@
1
+ import { AutoPaginatingList } from '../pagination.js';
2
+ /** Product catalog management with CSV import/export support. */
3
+ export class Products {
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ async create(params, options) {
8
+ return this.client.post('/v1/products', params, options);
9
+ }
10
+ list(params) {
11
+ return new AutoPaginatingList(this.client, '/v1/products', params);
12
+ }
13
+ async get(id) {
14
+ return this.client.get(`/v1/products/${id}`);
15
+ }
16
+ async update(id, params) {
17
+ return this.client.patch(`/v1/products/${id}`, params);
18
+ }
19
+ async del(id) {
20
+ await this.client.del(`/v1/products/${id}`);
21
+ }
22
+ async importCsv(csv, options) {
23
+ return this.client.post('/v1/products/import', { csv }, options);
24
+ }
25
+ async exportCsv() {
26
+ return this.client.get('/v1/products/export');
27
+ }
28
+ }
29
+ //# sourceMappingURL=products.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.js","sourceRoot":"","sources":["../../../src/resources/products.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAUrD,iEAAiE;AACjE,MAAM,OAAO,QAAQ;IACnB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,KAAK,CAAC,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,CAAC,MAA0B;QAC7B,OAAO,IAAI,kBAAkB,CAAU,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,CAAA;IAC7E,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,gBAAgB,EAAE,EAAE,CAAC,CAAA;IACvD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,MAA2B;QAClD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAU,gBAAgB,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;IACjE,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,gBAAgB,EAAE,EAAE,CAAC,CAAA;IACnD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,GAAW,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAc,qBAAqB,EAAE,EAAE,GAAG,EAAE,EAAE,OAAO,CAAC,CAAA;IAC/E,CAAC;IAED,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,qBAAqB,CAAC,CAAA;IAC5D,CAAC;CACF"}
@@ -0,0 +1,45 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import { AutoPaginatingList } from '../pagination.js';
3
+ import type { Quote, QuoteCreateParams, QuoteUpdateParams, QuoteListParams, DocumentUrlResponse, JobResponse, Invoice, RequestOptions } from '../types.js';
4
+ /** Quote lifecycle — create, send, accept or refuse, and convert to invoice. */
5
+ export declare class Quotes {
6
+ private readonly client;
7
+ constructor(client: HttpClient);
8
+ create(params: QuoteCreateParams, options?: RequestOptions): Promise<Quote>;
9
+ list(params?: QuoteListParams): AutoPaginatingList<Quote>;
10
+ get(id: string): Promise<Quote>;
11
+ update(id: string, params: QuoteUpdateParams): Promise<Quote>;
12
+ del(id: string): Promise<void>;
13
+ send(id: string, options?: RequestOptions): Promise<Quote>;
14
+ /**
15
+ * Send the quote to its customer by email with the PDF attached. Returns
16
+ * `{status: 'sent'}` on success or `{status: 'pending'}` if the PDF is
17
+ * still being generated (caller should poll the returned `jobId`).
18
+ */
19
+ email(id: string, params?: {
20
+ recipientEmail?: string;
21
+ customMessage?: string;
22
+ customSubject?: string;
23
+ }, options?: RequestOptions): Promise<{
24
+ status: 'sent';
25
+ quoteId: string;
26
+ recipient: string;
27
+ sentAt: string;
28
+ } | {
29
+ status: 'pending';
30
+ quoteId: string;
31
+ jobId: string;
32
+ pollUrl: string;
33
+ reason: string;
34
+ }>;
35
+ accept(id: string, options?: RequestOptions): Promise<Quote>;
36
+ refuse(id: string, options?: RequestOptions): Promise<Quote>;
37
+ /** Convert accepted quote to draft invoice. */
38
+ convert(id: string, options?: RequestOptions): Promise<Invoice>;
39
+ /** Clone as new draft quote. */
40
+ clone(id: string, options?: RequestOptions): Promise<Quote>;
41
+ getPdf(id: string): Promise<DocumentUrlResponse | JobResponse>;
42
+ /** Retrieve the electronic signature proof for an accepted quote. */
43
+ getSignatureProof(id: string): Promise<DocumentUrlResponse>;
44
+ }
45
+ //# sourceMappingURL=quotes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../src/resources/quotes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,OAAO,EACP,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,gFAAgF;AAChF,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEzC,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;IAIjF,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,kBAAkB,CAAC,KAAK,CAAC;IAInD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAI/B,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC;IAI7D,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9B,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;IAIhE;;;;OAIG;IACG,KAAK,CACT,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE;QACP,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,aAAa,CAAC,EAAE,MAAM,CAAA;KACvB,EACD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACN;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GACtE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CACzF;IAIK,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;IAI5D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;IAIlE,+CAA+C;IACzC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrE,gCAAgC;IAC1B,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;IAI3D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,WAAW,CAAC;IAIpE,qEAAqE;IAC/D,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAGlE"}
@@ -0,0 +1,55 @@
1
+ import { AutoPaginatingList } from '../pagination.js';
2
+ /** Quote lifecycle — create, send, accept or refuse, and convert to invoice. */
3
+ export class Quotes {
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ async create(params, options) {
8
+ return this.client.post('/v1/quotes', params, options);
9
+ }
10
+ list(params) {
11
+ return new AutoPaginatingList(this.client, '/v1/quotes', params);
12
+ }
13
+ async get(id) {
14
+ return this.client.get(`/v1/quotes/${id}`);
15
+ }
16
+ async update(id, params) {
17
+ return this.client.patch(`/v1/quotes/${id}`, params);
18
+ }
19
+ async del(id) {
20
+ await this.client.del(`/v1/quotes/${id}`);
21
+ }
22
+ async send(id, options) {
23
+ return this.client.post(`/v1/quotes/${id}/send`, undefined, options);
24
+ }
25
+ /**
26
+ * Send the quote to its customer by email with the PDF attached. Returns
27
+ * `{status: 'sent'}` on success or `{status: 'pending'}` if the PDF is
28
+ * still being generated (caller should poll the returned `jobId`).
29
+ */
30
+ async email(id, params, options) {
31
+ return this.client.post(`/v1/quotes/${id}/email`, params, options);
32
+ }
33
+ async accept(id, options) {
34
+ return this.client.post(`/v1/quotes/${id}/accept`, undefined, options);
35
+ }
36
+ async refuse(id, options) {
37
+ return this.client.post(`/v1/quotes/${id}/refuse`, undefined, options);
38
+ }
39
+ /** Convert accepted quote to draft invoice. */
40
+ async convert(id, options) {
41
+ return this.client.post(`/v1/quotes/${id}/convert`, undefined, options);
42
+ }
43
+ /** Clone as new draft quote. */
44
+ async clone(id, options) {
45
+ return this.client.post(`/v1/quotes/${id}/clone`, undefined, options);
46
+ }
47
+ async getPdf(id) {
48
+ return this.client.get(`/v1/quotes/${id}/pdf`);
49
+ }
50
+ /** Retrieve the electronic signature proof for an accepted quote. */
51
+ async getSignatureProof(id) {
52
+ return this.client.get(`/v1/quotes/${id}/signature-proof`);
53
+ }
54
+ }
55
+ //# sourceMappingURL=quotes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotes.js","sourceRoot":"","sources":["../../../src/resources/quotes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAYrD,gFAAgF;AAChF,MAAM,OAAO,MAAM;IACjB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,KAAK,CAAC,MAAM,CAAC,MAAyB,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAQ,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/D,CAAC;IAED,IAAI,CAAC,MAAwB;QAC3B,OAAO,IAAI,kBAAkB,CAAQ,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,CAAA;IACzE,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAQ,cAAc,EAAE,EAAE,CAAC,CAAA;IACnD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,MAAyB;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAQ,cAAc,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;IAC7D,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,cAAc,EAAE,EAAE,CAAC,CAAA;IACjD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAU,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAQ,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;IAC7E,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK,CACT,EAAU,EACV,MAIC,EACD,OAAwB;QAKxB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACpE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAQ,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;IAC/E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAQ,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;IAC/E,CAAC;IAED,+CAA+C;IAC/C,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;IAClF,CAAC;IAED,gCAAgC;IAChC,KAAK,CAAC,KAAK,CAAC,EAAU,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAQ,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;IAC9E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;IAChD,CAAC;IAED,qEAAqE;IACrE,KAAK,CAAC,iBAAiB,CAAC,EAAU;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAsB,cAAc,EAAE,kBAAkB,CAAC,CAAA;IACjF,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import { AutoPaginatingList } from '../pagination.js';
3
+ import type { ReceivedInvoice, ReceivedInvoiceListParams, ReceivedInvoiceRefuseParams, ReceivedInvoiceRecordPaymentParams, ReceivedInvoiceActionResponse } from '../types.js';
4
+ /** Received (incoming) invoices from PA — list, retrieve, approve, refuse, suspend, record payment. */
5
+ export declare class ReceivedInvoices {
6
+ private readonly client;
7
+ constructor(client: HttpClient);
8
+ list(params?: ReceivedInvoiceListParams): AutoPaginatingList<ReceivedInvoice>;
9
+ get(id: string): Promise<ReceivedInvoice>;
10
+ approve(id: string): Promise<ReceivedInvoiceActionResponse>;
11
+ refuse(id: string, params: ReceivedInvoiceRefuseParams): Promise<ReceivedInvoiceActionResponse>;
12
+ suspend(id: string): Promise<ReceivedInvoiceActionResponse>;
13
+ recordPayment(id: string, params: ReceivedInvoiceRecordPaymentParams): Promise<ReceivedInvoiceActionResponse>;
14
+ }
15
+ //# sourceMappingURL=received-invoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"received-invoices.d.ts","sourceRoot":"","sources":["../../../src/resources/received-invoices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,2BAA2B,EAC3B,kCAAkC,EAClC,6BAA6B,EAC9B,MAAM,aAAa,CAAA;AAEpB,uGAAuG;AACvG,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,IAAI,CAAC,MAAM,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,CAAC,eAAe,CAAC;IAIvE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIzC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAI3D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAI/F,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAI3D,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC,6BAA6B,CAAC;CAGpH"}
@@ -0,0 +1,26 @@
1
+ import { AutoPaginatingList } from '../pagination.js';
2
+ /** Received (incoming) invoices from PA — list, retrieve, approve, refuse, suspend, record payment. */
3
+ export class ReceivedInvoices {
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ list(params) {
8
+ return new AutoPaginatingList(this.client, '/v1/received-invoices', params);
9
+ }
10
+ async get(id) {
11
+ return this.client.get(`/v1/received-invoices/${id}`);
12
+ }
13
+ async approve(id) {
14
+ return this.client.post(`/v1/received-invoices/${id}/approve`);
15
+ }
16
+ async refuse(id, params) {
17
+ return this.client.post(`/v1/received-invoices/${id}/refuse`, params);
18
+ }
19
+ async suspend(id) {
20
+ return this.client.post(`/v1/received-invoices/${id}/suspend`);
21
+ }
22
+ async recordPayment(id, params) {
23
+ return this.client.post(`/v1/received-invoices/${id}/record-payment`, params);
24
+ }
25
+ }
26
+ //# sourceMappingURL=received-invoices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"received-invoices.js","sourceRoot":"","sources":["../../../src/resources/received-invoices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AASrD,uGAAuG;AACvG,MAAM,OAAO,gBAAgB;IAC3B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,IAAI,CAAC,MAAkC;QACrC,OAAO,IAAI,kBAAkB,CAAkB,IAAI,CAAC,MAAM,EAAE,uBAAuB,EAAE,MAAM,CAAC,CAAA;IAC9F,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAkB,yBAAyB,EAAE,EAAE,CAAC,CAAA;IACxE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAgC,yBAAyB,EAAE,UAAU,CAAC,CAAA;IAC/F,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,MAAmC;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAgC,yBAAyB,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;IACtG,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAgC,yBAAyB,EAAE,UAAU,CAAC,CAAA;IAC/F,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,EAAU,EAAE,MAA0C;QACxE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAgC,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAA;IAC9G,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import { AutoPaginatingList } from '../pagination.js';
3
+ import type { RecurringInvoice, RecurringInvoiceCreateParams, RecurringInvoiceUpdateParams, RecurringInvoiceListParams, RequestOptions } from '../types.js';
4
+ /** Scheduled invoice templates that automatically generate invoices on a recurring basis. */
5
+ export declare class RecurringInvoices {
6
+ private readonly client;
7
+ constructor(client: HttpClient);
8
+ create(params: RecurringInvoiceCreateParams, options?: RequestOptions): Promise<RecurringInvoice>;
9
+ list(params?: RecurringInvoiceListParams): AutoPaginatingList<RecurringInvoice>;
10
+ get(id: string): Promise<RecurringInvoice>;
11
+ update(id: string, params: RecurringInvoiceUpdateParams): Promise<RecurringInvoice>;
12
+ del(id: string): Promise<void>;
13
+ resume(id: string): Promise<RecurringInvoice>;
14
+ pause(id: string): Promise<RecurringInvoice>;
15
+ }
16
+ //# sourceMappingURL=recurringInvoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recurringInvoices.d.ts","sourceRoot":"","sources":["../../../src/resources/recurringInvoices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EACV,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,EAC5B,0BAA0B,EAC1B,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,6FAA6F;AAC7F,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEzC,MAAM,CAAC,MAAM,EAAE,4BAA4B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIvG,IAAI,CAAC,MAAM,CAAC,EAAE,0BAA0B,GAAG,kBAAkB,CAAC,gBAAgB,CAAC;IAIzE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI1C,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAInF,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI7C,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAGnD"}
@@ -0,0 +1,29 @@
1
+ import { AutoPaginatingList } from '../pagination.js';
2
+ /** Scheduled invoice templates that automatically generate invoices on a recurring basis. */
3
+ export class RecurringInvoices {
4
+ constructor(client) {
5
+ this.client = client;
6
+ }
7
+ async create(params, options) {
8
+ return this.client.post('/v1/recurring-invoices', params, options);
9
+ }
10
+ list(params) {
11
+ return new AutoPaginatingList(this.client, '/v1/recurring-invoices', params);
12
+ }
13
+ async get(id) {
14
+ return this.client.get(`/v1/recurring-invoices/${id}`);
15
+ }
16
+ async update(id, params) {
17
+ return this.client.patch(`/v1/recurring-invoices/${id}`, params);
18
+ }
19
+ async del(id) {
20
+ await this.client.del(`/v1/recurring-invoices/${id}`);
21
+ }
22
+ async resume(id) {
23
+ return this.client.post(`/v1/recurring-invoices/${id}/resume`);
24
+ }
25
+ async pause(id) {
26
+ return this.client.post(`/v1/recurring-invoices/${id}/pause`);
27
+ }
28
+ }
29
+ //# sourceMappingURL=recurringInvoices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recurringInvoices.js","sourceRoot":"","sources":["../../../src/resources/recurringInvoices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AASrD,6FAA6F;AAC7F,MAAM,OAAO,iBAAiB;IAC5B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,KAAK,CAAC,MAAM,CAAC,MAAoC,EAAE,OAAwB;QACzE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAmB,wBAAwB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACtF,CAAC;IAED,IAAI,CAAC,MAAmC;QACtC,OAAO,IAAI,kBAAkB,CAAmB,IAAI,CAAC,MAAM,EAAE,wBAAwB,EAAE,MAAM,CAAC,CAAA;IAChG,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmB,0BAA0B,EAAE,EAAE,CAAC,CAAA;IAC1E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,MAAoC;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAmB,0BAA0B,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;IACpF,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,0BAA0B,EAAE,EAAE,CAAC,CAAA;IAC7D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAmB,0BAA0B,EAAE,SAAS,CAAC,CAAA;IAClF,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,EAAU;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAmB,0BAA0B,EAAE,QAAQ,CAAC,CAAA;IACjF,CAAC;CACF"}
@@ -0,0 +1,46 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import type { LegalForm, NafCode, PaProvider, PaginatedResponse } from '../types.js';
3
+ /**
4
+ * Reference — static lookup tables maintained by INSEE that integrations
5
+ * need to power their own company / customer forms:
6
+ *
7
+ * - `legalForms` — French legal-form codes (SARL, SAS, EI…)
8
+ * - `nafCodes` — French NAF activity codes (Rev. 2, 2008)
9
+ *
10
+ * Both lists are stable and cacheable for the lifetime of the
11
+ * integration's process. The endpoint paginates so the SDK exposes
12
+ * `listLegalForms()` / `listNafCodes()` returning the full server
13
+ * response — callers typically fetch once on app start and keep the
14
+ * result in memory.
15
+ */
16
+ export declare class Reference {
17
+ private readonly client;
18
+ constructor(client: HttpClient);
19
+ /**
20
+ * List INSEE legal forms (4-digit codes + sigles + labels).
21
+ * Filter by `search` to autocomplete a form field.
22
+ */
23
+ listLegalForms(params?: {
24
+ search?: string;
25
+ limit?: number;
26
+ }): Promise<PaginatedResponse<LegalForm>>;
27
+ /**
28
+ * List NAF activity codes (Rev. 2). Filter by `search` to
29
+ * autocomplete on label fragments ("conseil", "transport"…).
30
+ */
31
+ listNafCodes(params?: {
32
+ search?: string;
33
+ limit?: number;
34
+ }): Promise<PaginatedResponse<NafCode>>;
35
+ /**
36
+ * List the supported Plateformes Agréées (PA). Public catalogue — no auth,
37
+ * no filter; fetch once and cache. Use it to render a provider picker and the
38
+ * credential fields each PA requires (Facturino is BYOPA — the customer
39
+ * brings their own PA credentials at connect time).
40
+ */
41
+ listPaProviders(): Promise<{
42
+ object: 'list';
43
+ data: PaProvider[];
44
+ }>;
45
+ }
46
+ //# sourceMappingURL=reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/resources/reference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAYpF;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;OAGG;IACG,cAAc,CAAC,MAAM,CAAC,EAAE;QAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,GAAG,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAKzC;;;OAGG;IACG,YAAY,CAAC,MAAM,CAAC,EAAE;QAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAKvC;;;;;OAKG;IACG,eAAe,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;CAGzE"}
@@ -0,0 +1,54 @@
1
+ /** Encode a flat object as a `?k=v&…` query string (skips undefined/null). */
2
+ function buildQuery(params) {
3
+ const entries = [];
4
+ for (const [k, v] of Object.entries(params)) {
5
+ if (v === undefined || v === null)
6
+ continue;
7
+ entries.push([k, String(v)]);
8
+ }
9
+ return entries.length === 0 ? '' : `?${new URLSearchParams(entries).toString()}`;
10
+ }
11
+ /**
12
+ * Reference — static lookup tables maintained by INSEE that integrations
13
+ * need to power their own company / customer forms:
14
+ *
15
+ * - `legalForms` — French legal-form codes (SARL, SAS, EI…)
16
+ * - `nafCodes` — French NAF activity codes (Rev. 2, 2008)
17
+ *
18
+ * Both lists are stable and cacheable for the lifetime of the
19
+ * integration's process. The endpoint paginates so the SDK exposes
20
+ * `listLegalForms()` / `listNafCodes()` returning the full server
21
+ * response — callers typically fetch once on app start and keep the
22
+ * result in memory.
23
+ */
24
+ export class Reference {
25
+ constructor(client) {
26
+ this.client = client;
27
+ }
28
+ /**
29
+ * List INSEE legal forms (4-digit codes + sigles + labels).
30
+ * Filter by `search` to autocomplete a form field.
31
+ */
32
+ async listLegalForms(params) {
33
+ const qs = params ? buildQuery(params) : '';
34
+ return this.client.get(`/v1/reference/legal-forms${qs}`);
35
+ }
36
+ /**
37
+ * List NAF activity codes (Rev. 2). Filter by `search` to
38
+ * autocomplete on label fragments ("conseil", "transport"…).
39
+ */
40
+ async listNafCodes(params) {
41
+ const qs = params ? buildQuery(params) : '';
42
+ return this.client.get(`/v1/reference/naf-codes${qs}`);
43
+ }
44
+ /**
45
+ * List the supported Plateformes Agréées (PA). Public catalogue — no auth,
46
+ * no filter; fetch once and cache. Use it to render a provider picker and the
47
+ * credential fields each PA requires (Facturino is BYOPA — the customer
48
+ * brings their own PA credentials at connect time).
49
+ */
50
+ async listPaProviders() {
51
+ return this.client.get('/v1/pa-providers');
52
+ }
53
+ }
54
+ //# sourceMappingURL=reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference.js","sourceRoot":"","sources":["../../../src/resources/reference.ts"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,SAAS,UAAU,CAAC,MAA+B;IACjD,MAAM,OAAO,GAAuB,EAAE,CAAA;IACtC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;YAAE,SAAQ;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9B,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAA;AAClF,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,SAAS;IACpB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;OAGG;IACH,KAAK,CAAC,cAAc,CAAC,MAGpB;QACC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA+B,4BAA4B,EAAE,EAAE,CAAC,CAAA;IACxF,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,YAAY,CAAC,MAGlB;QACC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA6B,0BAA0B,EAAE,EAAE,CAAC,CAAA;IACpF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyC,kBAAkB,CAAC,CAAA;IACpF,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import type { VatReportParams, VatReport, RevenueReportParams, RevenueReport } from '../types.js';
3
+ /** Financial reporting — VAT and revenue reports (Essential, Pro, Cabinet plans). */
4
+ export declare class Reporting {
5
+ private readonly client;
6
+ constructor(client: HttpClient);
7
+ /** VAT report aggregated by rate for a given period. Amounts in integer centimes. */
8
+ vatReport(params: VatReportParams): Promise<VatReport>;
9
+ /** Revenue report with invoiced, credit notes, payments, and optional breakdown. Amounts in integer centimes. */
10
+ revenueReport(params: RevenueReportParams): Promise<RevenueReport>;
11
+ }
12
+ //# sourceMappingURL=reporting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporting.d.ts","sourceRoot":"","sources":["../../../src/resources/reporting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,aAAa,EACd,MAAM,aAAa,CAAA;AAEpB,qFAAqF;AACrF,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,qFAAqF;IAC/E,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC;IAQ5D,iHAAiH;IAC3G,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;CAWzE"}
@@ -0,0 +1,27 @@
1
+ /** Financial reporting — VAT and revenue reports (Essential, Pro, Cabinet plans). */
2
+ export class Reporting {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ /** VAT report aggregated by rate for a given period. Amounts in integer centimes. */
7
+ async vatReport(params) {
8
+ const qs = new URLSearchParams({
9
+ period_start: params.period_start,
10
+ period_end: params.period_end,
11
+ }).toString();
12
+ return this.client.get(`/v1/reporting/vat?${qs}`);
13
+ }
14
+ /** Revenue report with invoiced, credit notes, payments, and optional breakdown. Amounts in integer centimes. */
15
+ async revenueReport(params) {
16
+ const queryParams = {
17
+ period_start: params.period_start,
18
+ period_end: params.period_end,
19
+ };
20
+ if (params.group_by) {
21
+ queryParams.group_by = params.group_by;
22
+ }
23
+ const qs = new URLSearchParams(queryParams).toString();
24
+ return this.client.get(`/v1/reporting/revenue?${qs}`);
25
+ }
26
+ }
27
+ //# sourceMappingURL=reporting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporting.js","sourceRoot":"","sources":["../../../src/resources/reporting.ts"],"names":[],"mappings":"AAQA,qFAAqF;AACrF,MAAM,OAAO,SAAS;IACpB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,qFAAqF;IACrF,KAAK,CAAC,SAAS,CAAC,MAAuB;QACrC,MAAM,EAAE,GAAG,IAAI,eAAe,CAAC;YAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAC,CAAC,QAAQ,EAAE,CAAA;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAY,qBAAqB,EAAE,EAAE,CAAC,CAAA;IAC9D,CAAC;IAED,iHAAiH;IACjH,KAAK,CAAC,aAAa,CAAC,MAA2B;QAC7C,MAAM,WAAW,GAA2B;YAC1C,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,UAAU,EAAE,MAAM,CAAC,UAAU;SAC9B,CAAA;QACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;QACxC,CAAC;QACD,MAAM,EAAE,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAA;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,yBAAyB,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import type { SandboxResetResponse, SimulateStatusParams, SimulateStatusResponse, RequestOptions } from '../types.js';
3
+ /** Test-mode utilities — reset data, simulate PA status transitions, and seed fixtures. */
4
+ export declare class Sandbox {
5
+ private readonly client;
6
+ constructor(client: HttpClient);
7
+ resetData(): Promise<SandboxResetResponse>;
8
+ /** Simulate PA status transition. Triggers webhooks. */
9
+ simulateStatus(invoiceId: string, params: SimulateStatusParams, options?: RequestOptions): Promise<SimulateStatusResponse>;
10
+ /** Alias for resetData(). */
11
+ createFixtures(): Promise<SandboxResetResponse>;
12
+ }
13
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/resources/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACf,MAAM,aAAa,CAAA;AAEpB,2FAA2F;AAC3F,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEzC,SAAS,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAIhD,wDAAwD;IAClD,cAAc,CAClB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,sBAAsB,CAAC;IAQlC,6BAA6B;IACvB,cAAc,IAAI,OAAO,CAAC,oBAAoB,CAAC;CAGtD"}
@@ -0,0 +1,18 @@
1
+ /** Test-mode utilities — reset data, simulate PA status transitions, and seed fixtures. */
2
+ export class Sandbox {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ async resetData() {
7
+ return this.client.post('/v1/sandbox/reset');
8
+ }
9
+ /** Simulate PA status transition. Triggers webhooks. */
10
+ async simulateStatus(invoiceId, params, options) {
11
+ return this.client.post(`/v1/sandbox/simulate-status/${invoiceId}`, params, options);
12
+ }
13
+ /** Alias for resetData(). */
14
+ async createFixtures() {
15
+ return this.resetData();
16
+ }
17
+ }
18
+ //# sourceMappingURL=sandbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../src/resources/sandbox.ts"],"names":[],"mappings":"AAQA,2FAA2F;AAC3F,MAAM,OAAO,OAAO;IAClB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAuB,mBAAmB,CAAC,CAAA;IACpE,CAAC;IAED,wDAAwD;IACxD,KAAK,CAAC,cAAc,CAClB,SAAiB,EACjB,MAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,+BAA+B,SAAS,EAAE,EAC1C,MAAM,EACN,OAAO,CACR,CAAA;IACH,CAAC;IAED,6BAA6B;IAC7B,KAAK,CAAC,cAAc;QAClB,OAAO,IAAI,CAAC,SAAS,EAAE,CAAA;IACzB,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import type { UsageSummary } from '../types.js';
3
+ /**
4
+ * Usage — current period consumption metrics for the authenticated
5
+ * account (invoices issued, storage used, PA submissions, API calls).
6
+ *
7
+ * Useful for in-app dashboards and proactive plan-upgrade nudges
8
+ * before a quota hit triggers a 402 from the API.
9
+ */
10
+ export declare class Usage {
11
+ private readonly client;
12
+ constructor(client: HttpClient);
13
+ /**
14
+ * Return the current usage snapshot. The response includes the plan
15
+ * limits and the consumption so far for each metered dimension; no
16
+ * historical data — the dashboard uses `GET /v1/reporting/revenue`
17
+ * for trend lines.
18
+ */
19
+ retrieve(): Promise<UsageSummary>;
20
+ }
21
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/resources/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C;;;;;;GAMG;AACH,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;CAGxC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Usage — current period consumption metrics for the authenticated
3
+ * account (invoices issued, storage used, PA submissions, API calls).
4
+ *
5
+ * Useful for in-app dashboards and proactive plan-upgrade nudges
6
+ * before a quota hit triggers a 402 from the API.
7
+ */
8
+ export class Usage {
9
+ constructor(client) {
10
+ this.client = client;
11
+ }
12
+ /**
13
+ * Return the current usage snapshot. The response includes the plan
14
+ * limits and the consumption so far for each metered dimension; no
15
+ * historical data — the dashboard uses `GET /v1/reporting/revenue`
16
+ * for trend lines.
17
+ */
18
+ async retrieve() {
19
+ return this.client.get('/v1/usage');
20
+ }
21
+ }
22
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/resources/usage.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,OAAO,KAAK;IAChB,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;;OAKG;IACH,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,WAAW,CAAC,CAAA;IACnD,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import type { ValidateParams, ValidateResponse } from '../types.js';
3
+ /**
4
+ * Validate — dry-run conformity check of an invoice draft against the same
5
+ * EN16931 / CIUS-FR rules as `invoices.create`, without persisting anything.
6
+ *
7
+ * Call it before `invoices.create` to surface conformity warnings early. To
8
+ * check a customer's SIRET/VAT, use `customers.lookup` (SIRENE/VIES).
9
+ */
10
+ export declare class Validate {
11
+ private readonly client;
12
+ constructor(client: HttpClient);
13
+ /**
14
+ * Validate an invoice payload and return `{ valid, warnings }`. Accepts the
15
+ * same shape as `invoices.create`; nothing is created.
16
+ */
17
+ run(params: ValidateParams): Promise<ValidateResponse>;
18
+ }
19
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/resources/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnE;;;;;;GAMG;AACH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;OAGG;IACG,GAAG,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG7D"}