sinfactura-types 1.4.0 → 1.5.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/mercadopago.d.ts +66 -0
- package/dist/mercadopago.js +1 -0
- package/dist/payment.d.ts +22 -0
- package/dist/payment.js +1 -0
- package/dist/store.d.ts +29 -5
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,10 @@ export * from "./imports";
|
|
|
12
12
|
export * from "./invoice";
|
|
13
13
|
export * from "./log";
|
|
14
14
|
export * from "./maintenance";
|
|
15
|
+
export * from "./mercadopago";
|
|
15
16
|
export * from "./notification";
|
|
16
17
|
export * from "./order";
|
|
18
|
+
export * from "./payment";
|
|
17
19
|
export * from "./product";
|
|
18
20
|
export * from "./return";
|
|
19
21
|
export * from "./stock";
|
package/dist/index.js
CHANGED
|
@@ -12,8 +12,10 @@ export * from "./imports";
|
|
|
12
12
|
export * from "./invoice";
|
|
13
13
|
export * from "./log";
|
|
14
14
|
export * from "./maintenance";
|
|
15
|
+
export * from "./mercadopago";
|
|
15
16
|
export * from "./notification";
|
|
16
17
|
export * from "./order";
|
|
18
|
+
export * from "./payment";
|
|
17
19
|
export * from "./product";
|
|
18
20
|
export * from "./return";
|
|
19
21
|
export * from "./stock";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface MpOauthTokenResponse {
|
|
3
|
+
access_token: string;
|
|
4
|
+
refresh_token: string;
|
|
5
|
+
user_id: number;
|
|
6
|
+
expires_in: number;
|
|
7
|
+
scope?: string;
|
|
8
|
+
token_type?: string;
|
|
9
|
+
public_key?: string;
|
|
10
|
+
live_mode?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface MpOauthInitiateResponse {
|
|
13
|
+
authorizationUrl: string;
|
|
14
|
+
}
|
|
15
|
+
interface MpOauthCallbackResponse {
|
|
16
|
+
connected: true;
|
|
17
|
+
storeId: string;
|
|
18
|
+
mercadopagoUserId: string;
|
|
19
|
+
expiresAt: number;
|
|
20
|
+
connectedAt: number;
|
|
21
|
+
}
|
|
22
|
+
interface MercadopagoStatus {
|
|
23
|
+
connected: boolean;
|
|
24
|
+
status: MercadopagoConnectionStatus;
|
|
25
|
+
userId?: string;
|
|
26
|
+
connectedAt?: number;
|
|
27
|
+
expiresAt?: number;
|
|
28
|
+
liveMode?: boolean;
|
|
29
|
+
publicKey?: string;
|
|
30
|
+
statementDescriptor?: string;
|
|
31
|
+
pos?: Mercadopago["pos"];
|
|
32
|
+
features?: Mercadopago["features"];
|
|
33
|
+
}
|
|
34
|
+
interface MpWebhookEvent {
|
|
35
|
+
id: number;
|
|
36
|
+
live_mode: boolean;
|
|
37
|
+
type: string;
|
|
38
|
+
date_created: string;
|
|
39
|
+
application_id: number;
|
|
40
|
+
user_id: number;
|
|
41
|
+
version: number;
|
|
42
|
+
api_version: string;
|
|
43
|
+
action: string;
|
|
44
|
+
data: {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
interface MpPaymentNotification {
|
|
49
|
+
paymentId: string;
|
|
50
|
+
status: string;
|
|
51
|
+
statusDetail?: string;
|
|
52
|
+
amount: number;
|
|
53
|
+
currency: string;
|
|
54
|
+
paymentMethod?: string;
|
|
55
|
+
externalReference?: string;
|
|
56
|
+
receivedAt: number;
|
|
57
|
+
}
|
|
58
|
+
interface MpPointDevice {
|
|
59
|
+
id: string;
|
|
60
|
+
posId: number;
|
|
61
|
+
storeId: number;
|
|
62
|
+
externalPosId?: string;
|
|
63
|
+
operatingMode: "PDV" | "STANDALONE";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebSocket broadcast payload for the `payment_received` action.
|
|
3
|
+
*
|
|
4
|
+
* Fired by the API when a "money received" event is persisted across any
|
|
5
|
+
* of three sources (MP webhook, Stripe webhook, MP movements poller).
|
|
6
|
+
* Receivers (FE) should:
|
|
7
|
+
* 1. Render an immediate snackbar toast using `total` + `currency` + `payerName`.
|
|
8
|
+
* 2. Invalidate RTK Query tags `PaymentReceived` + `PaymentReceivedUnlinked`
|
|
9
|
+
* so the canonical row is refetched from `GET /payments/received`.
|
|
10
|
+
*/
|
|
11
|
+
export type PaymentReceivedSource = "mp" | "stripe" | "mp_movement";
|
|
12
|
+
export interface PaymentReceivedWsPayload {
|
|
13
|
+
source: PaymentReceivedSource;
|
|
14
|
+
paymentId: string;
|
|
15
|
+
total: number;
|
|
16
|
+
currency: string;
|
|
17
|
+
payerName?: string;
|
|
18
|
+
paidAt: number;
|
|
19
|
+
customerId?: string;
|
|
20
|
+
orderId?: string;
|
|
21
|
+
invoiceId?: string;
|
|
22
|
+
}
|
package/dist/payment.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/store.d.ts
CHANGED
|
@@ -148,11 +148,7 @@ declare global {
|
|
|
148
148
|
products?: number;
|
|
149
149
|
users?: number;
|
|
150
150
|
};
|
|
151
|
-
mercadopago?:
|
|
152
|
-
accessToken?: string;
|
|
153
|
-
code?: string;
|
|
154
|
-
refreshToken?: string;
|
|
155
|
-
};
|
|
151
|
+
mercadopago?: Mercadopago;
|
|
156
152
|
afip: Afip;
|
|
157
153
|
appVersion: number;
|
|
158
154
|
fiscalConditions: FiscalCondition[];
|
|
@@ -161,6 +157,34 @@ declare global {
|
|
|
161
157
|
notificationOptions?: Method[];
|
|
162
158
|
maintenance?: MaintenanceInfo;
|
|
163
159
|
}
|
|
160
|
+
interface Mercadopago {
|
|
161
|
+
userId?: string;
|
|
162
|
+
accessToken?: string;
|
|
163
|
+
refreshToken?: string;
|
|
164
|
+
expiresAt?: number;
|
|
165
|
+
connectedAt?: number;
|
|
166
|
+
tokenType?: string;
|
|
167
|
+
scope?: string;
|
|
168
|
+
liveMode?: boolean;
|
|
169
|
+
publicKey?: string;
|
|
170
|
+
status?: MercadopagoConnectionStatus;
|
|
171
|
+
disconnectedAt?: number;
|
|
172
|
+
lastTokenRefreshAt?: number;
|
|
173
|
+
tokenRefreshFailures?: number;
|
|
174
|
+
statementDescriptor?: string;
|
|
175
|
+
notificationUrl?: string;
|
|
176
|
+
pos?: {
|
|
177
|
+
defaultDeviceId?: string;
|
|
178
|
+
defaultStoreMpId?: string;
|
|
179
|
+
};
|
|
180
|
+
features?: {
|
|
181
|
+
checkoutPro?: boolean;
|
|
182
|
+
pointOfSale?: boolean;
|
|
183
|
+
subscriptions?: boolean;
|
|
184
|
+
};
|
|
185
|
+
code?: string;
|
|
186
|
+
}
|
|
187
|
+
type MercadopagoConnectionStatus = "connected" | "expired" | "disconnected" | "error" | "never";
|
|
164
188
|
interface Afip {
|
|
165
189
|
production: boolean;
|
|
166
190
|
address?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/account.ts","../src/afip.ts","../src/api.ts","../src/audit.ts","../src/auth.ts","../src/basket.ts","../src/brands.ts","../src/cash.ts","../src/categories.ts","../src/customer.ts","../src/imports.ts","../src/index.ts","../src/invoice.ts","../src/log.ts","../src/maintenance.ts","../src/notification.ts","../src/order.ts","../src/product.ts","../src/provinces.ts","../src/return.ts","../src/stock.ts","../src/store.ts","../src/subscription.ts","../src/supplier.ts","../src/user.ts","../src/whatsapp.ts"],"version":"5.6.3"}
|