@miguelmorales13/nestkit 0.11.0 → 0.16.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 (90) hide show
  1. package/README.md +469 -9
  2. package/dist/audit/audit.module.d.ts +23 -0
  3. package/dist/audit/audit.options.d.ts +16 -0
  4. package/dist/audit/audit.port.d.ts +37 -0
  5. package/dist/audit/audit.service.d.ts +29 -0
  6. package/dist/audit/index.cjs +72 -0
  7. package/dist/audit/index.d.ts +7 -0
  8. package/dist/audit/index.js +72 -0
  9. package/dist/audit/sinks.d.ts +18 -0
  10. package/dist/auth/index.cjs +4 -3
  11. package/dist/auth/index.js +2 -1
  12. package/dist/auth/oauth/index.cjs +6 -5
  13. package/dist/auth/oauth/index.js +2 -1
  14. package/dist/bootstrap/index.cjs +6 -5
  15. package/dist/bootstrap/index.js +5 -4
  16. package/dist/chunk-47FXU74G.cjs +205 -0
  17. package/dist/{chunk-54ZXIB5T.cjs → chunk-4GT66KQS.cjs} +4 -4
  18. package/dist/{chunk-J7TURDAL.cjs → chunk-67B7IYAV.cjs} +2 -2
  19. package/dist/{chunk-NVCI3CQI.cjs → chunk-C5DV4RAX.cjs} +6 -1
  20. package/dist/{chunk-KDAA6GFF.js → chunk-DABTRWA6.js} +12 -7
  21. package/dist/{chunk-ZA56XBCK.cjs → chunk-EBPEMVZU.cjs} +15 -0
  22. package/dist/{chunk-EYURGACO.js → chunk-JV4EAOF2.js} +1 -1
  23. package/dist/chunk-KP2ZHJSR.js +35 -0
  24. package/dist/{chunk-7I2Y7V52.js → chunk-KRC47OX6.js} +1 -1
  25. package/dist/chunk-LK3OINS7.js +205 -0
  26. package/dist/{chunk-A3B2EY4V.js → chunk-MLOQDUBN.js} +6 -1
  27. package/dist/chunk-TCAMLNUZ.js +27 -0
  28. package/dist/{chunk-V2M75FN3.cjs → chunk-U7QK24HL.cjs} +2 -2
  29. package/dist/{chunk-AOCF5QCZ.js → chunk-UIVBPNH4.js} +4 -4
  30. package/dist/{chunk-TJHRABML.cjs → chunk-UWDHAZVE.cjs} +12 -7
  31. package/dist/chunk-XHW4CTBS.js +57 -0
  32. package/dist/chunk-XX5ROVSC.cjs +57 -0
  33. package/dist/chunk-Y72D5L6I.cjs +27 -0
  34. package/dist/crud/crud.controller.d.ts +3 -1
  35. package/dist/crud/crud.service.d.ts +63 -4
  36. package/dist/crud/index.cjs +7 -2
  37. package/dist/crud/index.d.ts +2 -1
  38. package/dist/crud/index.js +6 -1
  39. package/dist/crud/list-query.dto.d.ts +23 -0
  40. package/dist/crud/repository.port.d.ts +33 -1
  41. package/dist/errors/index.cjs +4 -4
  42. package/dist/errors/index.js +4 -4
  43. package/dist/idempotency/idempotency.interceptor.d.ts +35 -0
  44. package/dist/idempotency/idempotency.module.d.ts +27 -0
  45. package/dist/idempotency/idempotency.options.d.ts +29 -0
  46. package/dist/idempotency/idempotency.port.d.ts +43 -0
  47. package/dist/idempotency/index.cjs +206 -0
  48. package/dist/idempotency/index.d.ts +7 -0
  49. package/dist/idempotency/index.js +206 -0
  50. package/dist/idempotency/memory.store.d.ts +24 -0
  51. package/dist/index.cjs +26 -15
  52. package/dist/index.js +27 -16
  53. package/dist/invoicing/adapters/facturama.invoicing.d.ts +50 -0
  54. package/dist/invoicing/adapters/facturapi.invoicing.d.ts +35 -0
  55. package/dist/invoicing/amounts.d.ts +52 -0
  56. package/dist/invoicing/index.cjs +577 -0
  57. package/dist/invoicing/index.d.ts +11 -0
  58. package/dist/invoicing/index.js +577 -0
  59. package/dist/invoicing/invoicing.module.d.ts +42 -0
  60. package/dist/invoicing/invoicing.options.d.ts +51 -0
  61. package/dist/invoicing/invoicing.port.d.ts +156 -0
  62. package/dist/invoicing/lines.d.ts +21 -0
  63. package/dist/invoicing/provider-http.d.ts +21 -0
  64. package/dist/payments/adapters/clip.terminal.d.ts +101 -0
  65. package/dist/payments/adapters/mercadopago.terminal.d.ts +74 -0
  66. package/dist/payments/index.cjs +795 -0
  67. package/dist/payments/index.d.ts +12 -0
  68. package/dist/payments/index.js +795 -0
  69. package/dist/payments/money.d.ts +20 -0
  70. package/dist/payments/payments-webhook.controller.d.ts +30 -0
  71. package/dist/payments/payments.module.d.ts +45 -0
  72. package/dist/payments/payments.options.d.ts +84 -0
  73. package/dist/payments/payments.port.d.ts +174 -0
  74. package/dist/payments/provider-http.d.ts +26 -0
  75. package/dist/response/api-response.d.ts +7 -0
  76. package/dist/response/index.cjs +12 -4
  77. package/dist/response/index.d.ts +2 -0
  78. package/dist/response/index.js +12 -4
  79. package/dist/response/paginated.d.ts +25 -0
  80. package/dist/response/response.interceptor.d.ts +4 -0
  81. package/dist/tracking/index.cjs +3 -3
  82. package/dist/tracking/index.d.ts +1 -1
  83. package/dist/tracking/index.js +2 -2
  84. package/dist/tracking/request-context.d.ts +22 -0
  85. package/package.json +25 -3
  86. package/dist/chunk-3CLYZC3T.cjs +0 -104
  87. package/dist/chunk-EBO6UKHL.js +0 -20
  88. package/dist/chunk-JOVBJDJ2.js +0 -104
  89. /package/dist/{chunk-MR2IFCZE.cjs → chunk-H2EHN366.cjs} +0 -0
  90. /package/dist/{chunk-NAK4WDKS.js → chunk-ODPSIFOB.js} +0 -0
package/dist/index.cjs CHANGED
@@ -1,5 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-KVBQBT3D.cjs');
2
-
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
3
2
 
4
3
 
5
4
 
@@ -9,46 +8,54 @@ var _chunkRF75KC63cjs = require('./chunk-RF75KC63.cjs');
9
8
 
10
9
 
11
10
  var _chunkSPTDXUEDcjs = require('./chunk-SPTDXUED.cjs');
12
- require('./chunk-MR2IFCZE.cjs');
13
11
 
14
12
 
15
13
 
16
14
 
17
- var _chunkV2M75FN3cjs = require('./chunk-V2M75FN3.cjs');
15
+ var _chunkU7QK24HLcjs = require('./chunk-U7QK24HL.cjs');
16
+ require('./chunk-KVBQBT3D.cjs');
17
+ require('./chunk-7SOM7EZP.cjs');
18
+ require('./chunk-H2EHN366.cjs');
18
19
 
19
20
 
20
- var _chunk54ZXIB5Tcjs = require('./chunk-54ZXIB5T.cjs');
21
+ var _chunk4GT66KQScjs = require('./chunk-4GT66KQS.cjs');
21
22
 
22
23
 
23
- var _chunkTJHRABMLcjs = require('./chunk-TJHRABML.cjs');
24
+ var _chunk67B7IYAVcjs = require('./chunk-67B7IYAV.cjs');
24
25
 
25
26
 
27
+ var _chunkUWDHAZVEcjs = require('./chunk-UWDHAZVE.cjs');
26
28
 
27
- var _chunk3CLYZC3Tcjs = require('./chunk-3CLYZC3T.cjs');
28
29
 
29
30
 
30
31
 
31
- var _chunkM3EL5O6Tcjs = require('./chunk-M3EL5O6T.cjs');
32
- require('./chunk-7SOM7EZP.cjs');
32
+ var _chunk47FXU74Gcjs = require('./chunk-47FXU74G.cjs');
33
+ require('./chunk-XX5ROVSC.cjs');
33
34
 
34
35
 
35
36
 
36
37
 
38
+ var _chunkY72D5L6Icjs = require('./chunk-Y72D5L6I.cjs');
37
39
 
38
40
 
39
- var _chunkFDNGAYTZcjs = require('./chunk-FDNGAYTZ.cjs');
41
+ var _chunkEBPEMVZUcjs = require('./chunk-EBPEMVZU.cjs');
40
42
 
41
43
 
42
- var _chunkJ7TURDALcjs = require('./chunk-J7TURDAL.cjs');
44
+ var _chunkQS2W5XCQcjs = require('./chunk-QS2W5XCQ.cjs');
43
45
 
44
46
 
45
- var _chunkZA56XBCKcjs = require('./chunk-ZA56XBCK.cjs');
46
47
 
48
+ var _chunkM3EL5O6Tcjs = require('./chunk-M3EL5O6T.cjs');
47
49
 
48
- var _chunkR7BVS6CIcjs = require('./chunk-R7BVS6CI.cjs');
49
50
 
50
51
 
51
- var _chunkQS2W5XCQcjs = require('./chunk-QS2W5XCQ.cjs');
52
+
53
+
54
+
55
+ var _chunkFDNGAYTZcjs = require('./chunk-FDNGAYTZ.cjs');
56
+
57
+
58
+ var _chunkR7BVS6CIcjs = require('./chunk-R7BVS6CI.cjs');
52
59
  require('./chunk-2REOCMUD.cjs');
53
60
 
54
61
 
@@ -75,4 +82,8 @@ require('./chunk-2REOCMUD.cjs');
75
82
 
76
83
 
77
84
 
78
- exports.AppException = _chunkR7BVS6CIcjs.AppException; exports.BaseCrudService = _chunk3CLYZC3Tcjs.BaseCrudService; exports.BaseResponseDto = _chunkQS2W5XCQcjs.BaseResponseDto; exports.ConflictAppException = _chunkFDNGAYTZcjs.ConflictAppException; exports.ForbiddenAppException = _chunkFDNGAYTZcjs.ForbiddenAppException; exports.GlobalExceptionFilter = _chunkJ7TURDALcjs.GlobalExceptionFilter; exports.I18nModule = _chunkM3EL5O6Tcjs.I18nModule; exports.NotFoundAppException = _chunkFDNGAYTZcjs.NotFoundAppException; exports.PG_POOL = _chunkRF75KC63cjs.PG_POOL; exports.PgModule = _chunkRF75KC63cjs.PgModule; exports.REQUEST_ID_HEADER = _chunkV2M75FN3cjs.REQUEST_ID_HEADER; exports.RequestContext = _chunkZA56XBCKcjs.RequestContext; exports.RequestIdMiddleware = _chunkV2M75FN3cjs.RequestIdMiddleware; exports.ResponseInterceptor = _chunkTJHRABMLcjs.ResponseInterceptor; exports.SUPABASE_ANON_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_ANON_CLIENT; exports.SUPABASE_SERVICE_ROLE_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_SERVICE_ROLE_CLIENT; exports.SupabaseModule = _chunkSPTDXUEDcjs.SupabaseModule; exports.TrackingModule = _chunkV2M75FN3cjs.TrackingModule; exports.UnauthorizedAppException = _chunkFDNGAYTZcjs.UnauthorizedAppException; exports.ValidationAppException = _chunkFDNGAYTZcjs.ValidationAppException; exports.applyNestKitDefaults = _chunk54ZXIB5Tcjs.applyNestKitDefaults; exports.createCrudController = _chunk3CLYZC3Tcjs.createCrudController; exports.translateOr = _chunkM3EL5O6Tcjs.translateOr; exports.withTenantScope = _chunkRF75KC63cjs.withTenantScope;
85
+
86
+
87
+
88
+
89
+ exports.AppException = _chunkR7BVS6CIcjs.AppException; exports.BaseCrudService = _chunk47FXU74Gcjs.BaseCrudService; exports.BaseResponseDto = _chunkQS2W5XCQcjs.BaseResponseDto; exports.ConflictAppException = _chunkFDNGAYTZcjs.ConflictAppException; exports.ForbiddenAppException = _chunkFDNGAYTZcjs.ForbiddenAppException; exports.GlobalExceptionFilter = _chunk67B7IYAVcjs.GlobalExceptionFilter; exports.I18nModule = _chunkM3EL5O6Tcjs.I18nModule; exports.ListQuery = _chunk47FXU74Gcjs.ListQuery; exports.NotFoundAppException = _chunkFDNGAYTZcjs.NotFoundAppException; exports.PG_POOL = _chunkRF75KC63cjs.PG_POOL; exports.PgModule = _chunkRF75KC63cjs.PgModule; exports.REQUEST_ID_HEADER = _chunkU7QK24HLcjs.REQUEST_ID_HEADER; exports.RequestContext = _chunkEBPEMVZUcjs.RequestContext; exports.RequestIdMiddleware = _chunkU7QK24HLcjs.RequestIdMiddleware; exports.ResponseInterceptor = _chunkUWDHAZVEcjs.ResponseInterceptor; exports.SUPABASE_ANON_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_ANON_CLIENT; exports.SUPABASE_SERVICE_ROLE_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_SERVICE_ROLE_CLIENT; exports.SupabaseModule = _chunkSPTDXUEDcjs.SupabaseModule; exports.TrackingModule = _chunkU7QK24HLcjs.TrackingModule; exports.UnauthorizedAppException = _chunkFDNGAYTZcjs.UnauthorizedAppException; exports.ValidationAppException = _chunkFDNGAYTZcjs.ValidationAppException; exports.applyNestKitDefaults = _chunk4GT66KQScjs.applyNestKitDefaults; exports.buildPageMeta = _chunkY72D5L6Icjs.buildPageMeta; exports.createCrudController = _chunk47FXU74Gcjs.createCrudController; exports.isPaginated = _chunkY72D5L6Icjs.isPaginated; exports.paginated = _chunkY72D5L6Icjs.paginated; exports.translateOr = _chunkM3EL5O6Tcjs.translateOr; exports.withTenantScope = _chunkRF75KC63cjs.withTenantScope;
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import "./chunk-EPVKCBPT.js";
2
1
  import {
3
2
  PG_POOL,
4
3
  PgModule,
@@ -9,27 +8,44 @@ import {
9
8
  SUPABASE_SERVICE_ROLE_CLIENT,
10
9
  SupabaseModule
11
10
  } from "./chunk-PA24P76K.js";
12
- import "./chunk-NAK4WDKS.js";
13
11
  import {
14
12
  REQUEST_ID_HEADER,
15
13
  RequestIdMiddleware,
16
14
  TrackingModule
17
- } from "./chunk-EYURGACO.js";
15
+ } from "./chunk-JV4EAOF2.js";
16
+ import "./chunk-EPVKCBPT.js";
17
+ import "./chunk-DQYAIQQ5.js";
18
+ import "./chunk-ODPSIFOB.js";
18
19
  import {
19
20
  applyNestKitDefaults
20
- } from "./chunk-AOCF5QCZ.js";
21
+ } from "./chunk-UIVBPNH4.js";
22
+ import {
23
+ GlobalExceptionFilter
24
+ } from "./chunk-KRC47OX6.js";
21
25
  import {
22
26
  ResponseInterceptor
23
- } from "./chunk-KDAA6GFF.js";
27
+ } from "./chunk-DABTRWA6.js";
24
28
  import {
25
29
  BaseCrudService,
30
+ ListQuery,
26
31
  createCrudController
27
- } from "./chunk-JOVBJDJ2.js";
32
+ } from "./chunk-LK3OINS7.js";
33
+ import "./chunk-XHW4CTBS.js";
34
+ import {
35
+ buildPageMeta,
36
+ isPaginated,
37
+ paginated
38
+ } from "./chunk-TCAMLNUZ.js";
39
+ import {
40
+ RequestContext
41
+ } from "./chunk-KP2ZHJSR.js";
42
+ import {
43
+ BaseResponseDto
44
+ } from "./chunk-XX2HPTRU.js";
28
45
  import {
29
46
  I18nModule,
30
47
  translateOr
31
48
  } from "./chunk-IYUUYCP5.js";
32
- import "./chunk-DQYAIQQ5.js";
33
49
  import {
34
50
  ConflictAppException,
35
51
  ForbiddenAppException,
@@ -37,18 +53,9 @@ import {
37
53
  UnauthorizedAppException,
38
54
  ValidationAppException
39
55
  } from "./chunk-ORWJ7LES.js";
40
- import {
41
- GlobalExceptionFilter
42
- } from "./chunk-7I2Y7V52.js";
43
- import {
44
- RequestContext
45
- } from "./chunk-EBO6UKHL.js";
46
56
  import {
47
57
  AppException
48
58
  } from "./chunk-YFYHLYHN.js";
49
- import {
50
- BaseResponseDto
51
- } from "./chunk-XX2HPTRU.js";
52
59
  import "./chunk-4MGIQFAJ.js";
53
60
  export {
54
61
  AppException,
@@ -58,6 +65,7 @@ export {
58
65
  ForbiddenAppException,
59
66
  GlobalExceptionFilter,
60
67
  I18nModule,
68
+ ListQuery,
61
69
  NotFoundAppException,
62
70
  PG_POOL,
63
71
  PgModule,
@@ -72,7 +80,10 @@ export {
72
80
  UnauthorizedAppException,
73
81
  ValidationAppException,
74
82
  applyNestKitDefaults,
83
+ buildPageMeta,
75
84
  createCrudController,
85
+ isPaginated,
86
+ paginated,
76
87
  translateOr,
77
88
  withTenantScope
78
89
  };
@@ -0,0 +1,50 @@
1
+ import type { FacturamaOptions } from '../invoicing.options.js';
2
+ import type { CancelMotive, Invoice, InvoiceDraft, InvoicingPort } from '../invoicing.port.js';
3
+ /**
4
+ * Facturama, over its API Web (single issuer).
5
+ *
6
+ * Two differences from Facturapi that shape this adapter:
7
+ *
8
+ * - **The environment is the host**, not the key: the sandbox is a different
9
+ * base URL with its own credentials. The default here is the sandbox, so
10
+ * forgetting to configure it cannot produce a real invoice.
11
+ * - **It prints the numbers it is given.** Subtotal, tax base, tax amount and
12
+ * total all travel on the request, and the SAT validates that they add up —
13
+ * which is exactly why the arithmetic lives in the port and not in each
14
+ * adapter.
15
+ */
16
+ export declare class FacturamaInvoicing implements InvoicingPort {
17
+ private readonly options;
18
+ readonly provider = "facturama";
19
+ private readonly baseUrl;
20
+ private readonly fetchImpl;
21
+ private readonly token;
22
+ private readonly documentType;
23
+ constructor(options: FacturamaOptions);
24
+ /** True while this adapter points at the sandbox host. */
25
+ get isSandbox(): boolean;
26
+ private headers;
27
+ issue(draft: InvoiceDraft): Promise<Invoice>;
28
+ get(id: string): Promise<Invoice>;
29
+ /**
30
+ * Cancels with a motive.
31
+ *
32
+ * Facturama documents this route twice — once with the parameters in the path
33
+ * and once, in its how-to guide, with them in the query string. The guide's
34
+ * form is the one with a working example next to it, so it is the one used
35
+ * here.
36
+ */
37
+ cancel(id: string, options: {
38
+ motive: CancelMotive;
39
+ substitutionId?: string;
40
+ }): Promise<Invoice>;
41
+ pdf(id: string): Promise<Uint8Array>;
42
+ xml(id: string): Promise<string>;
43
+ /**
44
+ * Facturama hands files back as base64 inside a JSON envelope rather than as
45
+ * bytes, so this decodes rather than streams.
46
+ */
47
+ private download;
48
+ sendByEmail(_id: string, _to?: string): Promise<void>;
49
+ private toInvoice;
50
+ }
@@ -0,0 +1,35 @@
1
+ import type { FacturapiOptions } from '../invoicing.options.js';
2
+ import type { CancelMotive, Invoice, InvoiceDraft, InvoicingPort } from '../invoicing.port.js';
3
+ /**
4
+ * Facturapi.
5
+ *
6
+ * It builds, signs and stamps from JSON, so nothing here touches XML or a CSD.
7
+ * The environment is decided by the key alone (`sk_test_` vs `sk_live_`), which
8
+ * is convenient and dangerous in equal measure: the same code against the same
9
+ * URL either validates a draft or issues a document with fiscal effects.
10
+ *
11
+ * Line amounts are recomputed on their side from the unit price, so what the
12
+ * port computes is not what ends up on this invoice — it is still computed,
13
+ * because the same draft has to produce the same document on a PAC that does
14
+ * not recompute.
15
+ */
16
+ export declare class FacturapiInvoicing implements InvoicingPort {
17
+ private readonly options;
18
+ readonly provider = "facturapi";
19
+ private readonly baseUrl;
20
+ private readonly fetchImpl;
21
+ constructor(options: FacturapiOptions);
22
+ /** True when the configured key cannot produce a document with fiscal effects. */
23
+ get isTestKey(): boolean;
24
+ private headers;
25
+ issue(draft: InvoiceDraft): Promise<Invoice>;
26
+ get(id: string): Promise<Invoice>;
27
+ cancel(id: string, options: {
28
+ motive: CancelMotive;
29
+ substitutionId?: string;
30
+ }): Promise<Invoice>;
31
+ pdf(id: string): Promise<Uint8Array>;
32
+ xml(id: string): Promise<string>;
33
+ sendByEmail(id: string, to?: string): Promise<void>;
34
+ private toInvoice;
35
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * CFDI arithmetic, done once here so both adapters put the same numbers on the
3
+ * invoice.
4
+ *
5
+ * This is not the same problem as `payments/money.ts`, which only formats an
6
+ * amount someone already decided. Here the amounts are *derived* — importe from
7
+ * price and quantity, tax from importe, total from both — and the SAT checks
8
+ * that the derivation holds. Facturapi recomputes everything from the unit
9
+ * price and would forgive us; Facturama puts our numbers straight on the
10
+ * document, so if they do not add up the stamp is rejected, or worse, accepted
11
+ * wrong.
12
+ *
13
+ * Everything is integer cents until the last step. The rounding rule is
14
+ * half-up on the absolute value, which is what the SAT's own validation
15
+ * assumes.
16
+ */
17
+ export declare function roundHalfUp(value: number): number;
18
+ export declare function assertCents(cents: number, field: string): void;
19
+ /** `2450` -> `"24.50"`. Two decimals, which is what every money field on a MXN CFDI carries. */
20
+ export declare function centsToDecimal(cents: number): string;
21
+ /**
22
+ * Reads a decimal back into cents. Accepts what the providers send: a string
23
+ * (`"24.50"`) or a JSON number.
24
+ */
25
+ export declare function decimalToCents(value: string | number): number;
26
+ /**
27
+ * A unit price with more than two decimals, kept exactly as written.
28
+ *
29
+ * The SAT allows up to six on `ValorUnitario` and there are real prices that
30
+ * need them — anything sold by litre or by kilo. Parsing that into a float to
31
+ * get it back out again is how `12.345678` becomes `12.345677999999999`, so the
32
+ * string is validated and passed through untouched; only the amounts derived
33
+ * from it are computed.
34
+ */
35
+ export declare function assertDecimalString(value: string, field: string): void;
36
+ /** Unit price as cents (the common case) or as an exact decimal string (per-litre pricing). */
37
+ export type UnitPrice = {
38
+ cents: number;
39
+ } | {
40
+ decimal: string;
41
+ };
42
+ export declare function unitPriceToDecimal(price: UnitPrice): string;
43
+ /**
44
+ * `importe` for a line: unit price times quantity, rounded to cents.
45
+ *
46
+ * Quantity can be fractional (1.5 kg), which is where the rounding actually
47
+ * happens. Done on a scaled integer rather than on the decimal, so a price of
48
+ * `0.1` and a quantity of `3` gives 30 cents and not 30.000000000000004.
49
+ */
50
+ export declare function lineAmountCents(price: UnitPrice, quantity: number): number;
51
+ /** Tax over a base, rounded to cents. `rate` is the SAT's decimal rate: 0.16, 0.08, 0.106666. */
52
+ export declare function taxAmountCents(baseCents: number, rate: number): number;