@miguelmorales13/nestkit 0.10.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.
- package/README.md +518 -12
- package/dist/audit/audit.module.d.ts +23 -0
- package/dist/audit/audit.options.d.ts +16 -0
- package/dist/audit/audit.port.d.ts +37 -0
- package/dist/audit/audit.service.d.ts +29 -0
- package/dist/audit/index.cjs +72 -0
- package/dist/audit/index.d.ts +7 -0
- package/dist/audit/index.js +72 -0
- package/dist/audit/sinks.d.ts +18 -0
- package/dist/auth/index.cjs +4 -3
- package/dist/auth/index.js +2 -1
- package/dist/auth/oauth/index.cjs +81 -13
- package/dist/auth/oauth/index.js +75 -7
- package/dist/auth/oauth/oauth-auth.service.d.ts +29 -1
- package/dist/auth/oauth/oauth.options.d.ts +11 -0
- package/dist/bootstrap/index.cjs +6 -5
- package/dist/bootstrap/index.js +5 -4
- package/dist/chunk-47FXU74G.cjs +205 -0
- package/dist/{chunk-54ZXIB5T.cjs → chunk-4GT66KQS.cjs} +4 -4
- package/dist/{chunk-J7TURDAL.cjs → chunk-67B7IYAV.cjs} +2 -2
- package/dist/{chunk-NVCI3CQI.cjs → chunk-C5DV4RAX.cjs} +6 -1
- package/dist/{chunk-KDAA6GFF.js → chunk-DABTRWA6.js} +12 -7
- package/dist/{chunk-ZA56XBCK.cjs → chunk-EBPEMVZU.cjs} +15 -0
- package/dist/{chunk-EYURGACO.js → chunk-JV4EAOF2.js} +1 -1
- package/dist/chunk-KP2ZHJSR.js +35 -0
- package/dist/{chunk-7I2Y7V52.js → chunk-KRC47OX6.js} +1 -1
- package/dist/chunk-LK3OINS7.js +205 -0
- package/dist/{chunk-A3B2EY4V.js → chunk-MLOQDUBN.js} +6 -1
- package/dist/chunk-TCAMLNUZ.js +27 -0
- package/dist/{chunk-V2M75FN3.cjs → chunk-U7QK24HL.cjs} +2 -2
- package/dist/{chunk-AOCF5QCZ.js → chunk-UIVBPNH4.js} +4 -4
- package/dist/{chunk-TJHRABML.cjs → chunk-UWDHAZVE.cjs} +12 -7
- package/dist/chunk-XHW4CTBS.js +57 -0
- package/dist/chunk-XX5ROVSC.cjs +57 -0
- package/dist/chunk-Y72D5L6I.cjs +27 -0
- package/dist/crud/crud.controller.d.ts +3 -1
- package/dist/crud/crud.service.d.ts +63 -4
- package/dist/crud/index.cjs +7 -2
- package/dist/crud/index.d.ts +2 -1
- package/dist/crud/index.js +6 -1
- package/dist/crud/list-query.dto.d.ts +23 -0
- package/dist/crud/repository.port.d.ts +33 -1
- package/dist/errors/index.cjs +4 -4
- package/dist/errors/index.js +4 -4
- package/dist/idempotency/idempotency.interceptor.d.ts +35 -0
- package/dist/idempotency/idempotency.module.d.ts +27 -0
- package/dist/idempotency/idempotency.options.d.ts +29 -0
- package/dist/idempotency/idempotency.port.d.ts +43 -0
- package/dist/idempotency/index.cjs +206 -0
- package/dist/idempotency/index.d.ts +7 -0
- package/dist/idempotency/index.js +206 -0
- package/dist/idempotency/memory.store.d.ts +24 -0
- package/dist/index.cjs +24 -13
- package/dist/index.js +29 -18
- package/dist/invoicing/adapters/facturama.invoicing.d.ts +50 -0
- package/dist/invoicing/adapters/facturapi.invoicing.d.ts +35 -0
- package/dist/invoicing/amounts.d.ts +52 -0
- package/dist/invoicing/index.cjs +577 -0
- package/dist/invoicing/index.d.ts +11 -0
- package/dist/invoicing/index.js +577 -0
- package/dist/invoicing/invoicing.module.d.ts +42 -0
- package/dist/invoicing/invoicing.options.d.ts +51 -0
- package/dist/invoicing/invoicing.port.d.ts +156 -0
- package/dist/invoicing/lines.d.ts +21 -0
- package/dist/invoicing/provider-http.d.ts +21 -0
- package/dist/media/index.cjs +57 -7
- package/dist/media/index.d.ts +2 -2
- package/dist/media/index.js +56 -6
- package/dist/media/media.options.d.ts +20 -0
- package/dist/media/media.service.d.ts +18 -1
- package/dist/payments/adapters/clip.terminal.d.ts +101 -0
- package/dist/payments/adapters/mercadopago.terminal.d.ts +74 -0
- package/dist/payments/index.cjs +795 -0
- package/dist/payments/index.d.ts +12 -0
- package/dist/payments/index.js +795 -0
- package/dist/payments/money.d.ts +20 -0
- package/dist/payments/payments-webhook.controller.d.ts +30 -0
- package/dist/payments/payments.module.d.ts +45 -0
- package/dist/payments/payments.options.d.ts +84 -0
- package/dist/payments/payments.port.d.ts +174 -0
- package/dist/payments/provider-http.d.ts +26 -0
- package/dist/response/api-response.d.ts +7 -0
- package/dist/response/index.cjs +12 -4
- package/dist/response/index.d.ts +2 -0
- package/dist/response/index.js +12 -4
- package/dist/response/paginated.d.ts +25 -0
- package/dist/response/response.interceptor.d.ts +4 -0
- package/dist/tracking/index.cjs +3 -3
- package/dist/tracking/index.d.ts +1 -1
- package/dist/tracking/index.js +2 -2
- package/dist/tracking/request-context.d.ts +22 -0
- package/package.json +25 -3
- package/dist/chunk-3CLYZC3T.cjs +0 -104
- package/dist/chunk-EBO6UKHL.js +0 -20
- package/dist/chunk-JOVBJDJ2.js +0 -104
- /package/dist/{chunk-MR2IFCZE.cjs → chunk-H2EHN366.cjs} +0 -0
- /package/dist/{chunk-NAK4WDKS.js → chunk-ODPSIFOB.js} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { MercadoPagoPointOptions } from '../payments.options.js';
|
|
2
|
+
import type { ChargeInput, Terminal, TerminalPayment, TerminalPaymentsPort, TerminalWebhookEvent, WebhookRequestLike } from '../payments.port.js';
|
|
3
|
+
/**
|
|
4
|
+
* Mercado Pago Point over the Orders API.
|
|
5
|
+
*
|
|
6
|
+
* A terminal only answers API charges in **PDV** operating mode; in
|
|
7
|
+
* `standalone` it runs the merchant app and ignores everything sent here,
|
|
8
|
+
* silently. That is why {@link listTerminals} reports `operatingMode` — a
|
|
9
|
+
* charge that never appears on a working terminal is almost always this.
|
|
10
|
+
*/
|
|
11
|
+
export declare class MercadoPagoTerminalPayments implements TerminalPaymentsPort {
|
|
12
|
+
private readonly options;
|
|
13
|
+
readonly provider = "mercadopago";
|
|
14
|
+
private readonly baseUrl;
|
|
15
|
+
private readonly fetchImpl;
|
|
16
|
+
constructor(options: MercadoPagoPointOptions);
|
|
17
|
+
private headers;
|
|
18
|
+
listTerminals(): Promise<Terminal[]>;
|
|
19
|
+
charge(input: ChargeInput): Promise<TerminalPayment>;
|
|
20
|
+
get(id: string): Promise<TerminalPayment>;
|
|
21
|
+
cancel(id: string): Promise<TerminalPayment>;
|
|
22
|
+
/**
|
|
23
|
+
* Refunds a settled order: the whole thing, or `amountCents` of it.
|
|
24
|
+
*
|
|
25
|
+
* Mercado Pago allows this for card payments within 90 days, only while the
|
|
26
|
+
* order is `processed`, and it is not idempotent on its own — the header is,
|
|
27
|
+
* for 24 hours. A partial refund has to name the payment it is refunding,
|
|
28
|
+
* which is why the order is read first: the id the caller holds is the
|
|
29
|
+
* order's, and the API wants the payment's.
|
|
30
|
+
*/
|
|
31
|
+
refund(id: string, options?: {
|
|
32
|
+
amountCents?: number;
|
|
33
|
+
reason?: string;
|
|
34
|
+
}): Promise<TerminalPayment>;
|
|
35
|
+
/**
|
|
36
|
+
* Puts terminals into the mode that makes them answer the API at all.
|
|
37
|
+
*
|
|
38
|
+
* A terminal ships in `STANDALONE`, where it runs the merchant app and
|
|
39
|
+
* **ignores API charges without saying so**. `PDV` is the integrated mode,
|
|
40
|
+
* and the terminal has to be **restarted** for the change to take — an
|
|
41
|
+
* unrestarted terminal keeps swallowing charges, which is the single most
|
|
42
|
+
* expensive way to discover this.
|
|
43
|
+
*/
|
|
44
|
+
setOperatingMode(terminalIds: string[], mode: 'PDV' | 'STANDALONE'): Promise<Terminal[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Forces a final status on an order created with **test credentials**, so a
|
|
47
|
+
* whole flow — order, status change, webhook — can be exercised without a
|
|
48
|
+
* terminal in the room.
|
|
49
|
+
*
|
|
50
|
+
* This is the reason this integration is testable at all: pair it with the
|
|
51
|
+
* virtual device serial `SBX0000001` (e.g. `NEWLAND_N950__SBX0000001`) and
|
|
52
|
+
* the notification that arrives is the same one production sends. Takes up
|
|
53
|
+
* to 10 seconds to land, 40 for `action_required`. Against production
|
|
54
|
+
* credentials it does nothing but fail.
|
|
55
|
+
*/
|
|
56
|
+
simulateStatus(orderId: string, event: {
|
|
57
|
+
status: 'processed' | 'canceled' | 'expired' | 'action_required';
|
|
58
|
+
statusDetail?: string;
|
|
59
|
+
paymentMethodId?: 'visa' | 'master' | 'amex';
|
|
60
|
+
paymentMethodType?: 'credit_card';
|
|
61
|
+
installments?: number;
|
|
62
|
+
}): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Verifies the `x-signature` header: HMAC-SHA256 of
|
|
65
|
+
* `id:<data.id>;request-id:<x-request-id>;ts:<ts>;` keyed with the webhook
|
|
66
|
+
* secret, compared in constant time.
|
|
67
|
+
*
|
|
68
|
+
* The id is lowercased before hashing, per Mercado Pago's own rule for
|
|
69
|
+
* alphanumeric ids — an order id like `ORD01J6...` hashed as sent never
|
|
70
|
+
* matches, and the failure looks exactly like a forged request.
|
|
71
|
+
*/
|
|
72
|
+
verifyWebhook(request: WebhookRequestLike): TerminalWebhookEvent;
|
|
73
|
+
private toPayment;
|
|
74
|
+
}
|