sinfactura-types 1.6.30 → 1.6.32
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/currency.d.ts +37 -0
- package/dist/customer.d.ts +2 -0
- package/dist/mercadopago.d.ts +62 -0
- package/dist/product.d.ts +0 -4
- package/dist/supplier.d.ts +2 -0
- package/dist/user.d.ts +2 -0
- package/dist/userActivity.d.ts +14 -0
- package/package.json +1 -1
package/dist/currency.d.ts
CHANGED
|
@@ -30,5 +30,42 @@ declare global {
|
|
|
30
30
|
value: number;
|
|
31
31
|
source?: string;
|
|
32
32
|
}
|
|
33
|
+
type FxProvider = "ambito" | "dolarapi" | "bluelytics" | "bcra";
|
|
34
|
+
interface PlatformFxSource {
|
|
35
|
+
/** Stable identifier — referenced by `Store.fxAutoUpdate.bindings[].sourceId`. */
|
|
36
|
+
id: string;
|
|
37
|
+
isoCode: string;
|
|
38
|
+
variant: CurrencyVariant;
|
|
39
|
+
provider: FxProvider;
|
|
40
|
+
}
|
|
41
|
+
interface PlatformFxSourceWithStatus extends PlatformFxSource {
|
|
42
|
+
enabled: boolean;
|
|
43
|
+
/** EventBridge cron expression (`minute hour day month weekday`). */
|
|
44
|
+
cron: string;
|
|
45
|
+
/** Optional override for the provider's source URL. */
|
|
46
|
+
sourceUrl?: string;
|
|
47
|
+
/** Unix ms of the last successful fetch. Undefined if never succeeded. */
|
|
48
|
+
lastSuccessAt?: number;
|
|
49
|
+
/** Unix ms of the last failed fetch. Undefined if no failures yet. */
|
|
50
|
+
lastFailureAt?: number;
|
|
51
|
+
/** Short reason for the most recent failure (truncated to 256 chars). */
|
|
52
|
+
lastFailureReason?: string;
|
|
53
|
+
/** Consecutive-failure streak; resets on first success. Drives failover (>=3) + alerts. */
|
|
54
|
+
consecutiveFailures?: number;
|
|
55
|
+
/** Sibling source id to attempt when `consecutiveFailures` crosses the failover threshold. */
|
|
56
|
+
fallbackSourceId?: string;
|
|
57
|
+
/** Server-derived: `now - lastSuccessAt > maxStaleness`. Added by the SUPER GET handler. */
|
|
58
|
+
isStale: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface PlatformFxSourcesRow {
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
sources: PlatformFxSourceWithStatus[];
|
|
63
|
+
maxStaleness: {
|
|
64
|
+
default: number;
|
|
65
|
+
} & Record<string, number>;
|
|
66
|
+
updatedAt: number;
|
|
67
|
+
/** `true` once an explicit row is persisted; `false` when the handler is returning DEFAULT_FX_SOURCES. */
|
|
68
|
+
persisted?: boolean;
|
|
69
|
+
}
|
|
33
70
|
}
|
|
34
71
|
export {};
|
package/dist/customer.d.ts
CHANGED
package/dist/mercadopago.d.ts
CHANGED
|
@@ -62,5 +62,67 @@ declare global {
|
|
|
62
62
|
externalPosId?: string;
|
|
63
63
|
operatingMode: "PDV" | "STANDALONE";
|
|
64
64
|
}
|
|
65
|
+
type MpHookResult = 'config-missing' | 'test-event' | 'orphan' | 'duplicate' | 'not-approved' | 'item-saved' | 'error';
|
|
66
|
+
interface MpHookLogEntry {
|
|
67
|
+
hookId: string;
|
|
68
|
+
rawBodyB64?: string;
|
|
69
|
+
rawBodyLen?: number;
|
|
70
|
+
headers?: Record<string, string>;
|
|
71
|
+
path?: string;
|
|
72
|
+
resource?: string;
|
|
73
|
+
queryStringParameters?: Record<string, string> | null;
|
|
74
|
+
signatureValid?: boolean;
|
|
75
|
+
signatureV1Prefix?: string;
|
|
76
|
+
expectedPrefix?: string;
|
|
77
|
+
signatureReason?: string;
|
|
78
|
+
paymentId?: string;
|
|
79
|
+
userId?: string;
|
|
80
|
+
storeId?: string;
|
|
81
|
+
result: MpHookResult;
|
|
82
|
+
errorMessage?: string;
|
|
83
|
+
processingMs?: number;
|
|
84
|
+
createdAt: number;
|
|
85
|
+
ts?: number;
|
|
86
|
+
requestId?: string;
|
|
87
|
+
ttl?: number;
|
|
88
|
+
}
|
|
89
|
+
type MpIpnOutcome = 'polled-online' | 'no-online-tenants' | 'no-online-mp-tenants' | 'not-payment-topic' | 'none' | 'error';
|
|
90
|
+
interface MpIpnLogEntry {
|
|
91
|
+
ipnId: string;
|
|
92
|
+
topic: string;
|
|
93
|
+
resourceId: string;
|
|
94
|
+
rawBodyB64?: string;
|
|
95
|
+
rawBodyLen?: number;
|
|
96
|
+
headers?: Record<string, string>;
|
|
97
|
+
path?: string;
|
|
98
|
+
resource?: string;
|
|
99
|
+
queryStringParameters?: Record<string, string> | null;
|
|
100
|
+
processingMs?: number;
|
|
101
|
+
createdAt: number;
|
|
102
|
+
ttl?: number;
|
|
103
|
+
errorMessage?: string;
|
|
104
|
+
outcome?: MpIpnOutcome;
|
|
105
|
+
tenantsScanned?: number;
|
|
106
|
+
tenantsPolled?: number;
|
|
107
|
+
tenantsFailed?: number;
|
|
108
|
+
}
|
|
109
|
+
type MpMovementType = 'transfer_in' | 'qr_in' | 'transfer_out' | 'fee' | 'refund' | 'other';
|
|
110
|
+
interface MpMovementLogEntry {
|
|
111
|
+
operationId: string;
|
|
112
|
+
source: 'transfer';
|
|
113
|
+
amount: number;
|
|
114
|
+
currency: string;
|
|
115
|
+
type: MpMovementType;
|
|
116
|
+
date: number;
|
|
117
|
+
description: string;
|
|
118
|
+
sourceChannel?: string;
|
|
119
|
+
payerName?: string;
|
|
120
|
+
cuit?: string;
|
|
121
|
+
email?: string;
|
|
122
|
+
raw?: unknown;
|
|
123
|
+
createdAt: number;
|
|
124
|
+
processedAt: number;
|
|
125
|
+
ttl?: number;
|
|
126
|
+
}
|
|
65
127
|
}
|
|
66
128
|
export {};
|
package/dist/product.d.ts
CHANGED
package/dist/supplier.d.ts
CHANGED
package/dist/user.d.ts
CHANGED
package/dist/userActivity.d.ts
CHANGED
|
@@ -74,12 +74,18 @@ declare global {
|
|
|
74
74
|
order_id: string;
|
|
75
75
|
reason: string;
|
|
76
76
|
}
|
|
77
|
+
interface PriceListChange {
|
|
78
|
+
list_id: number;
|
|
79
|
+
from: number;
|
|
80
|
+
to: number;
|
|
81
|
+
}
|
|
77
82
|
interface ProductPriceChangedEvent extends UserActivityEventBase {
|
|
78
83
|
event: 'Product Price Changed';
|
|
79
84
|
product_id: string;
|
|
80
85
|
from_price: number;
|
|
81
86
|
to_price: number;
|
|
82
87
|
currency: string;
|
|
88
|
+
changes?: PriceListChange[];
|
|
83
89
|
}
|
|
84
90
|
interface CustomerCreatedEvent extends UserActivityEventBase {
|
|
85
91
|
event: 'Customer Created';
|
|
@@ -396,3 +402,11 @@ declare global {
|
|
|
396
402
|
*/
|
|
397
403
|
export declare const UI_ONLY_USER_ACTIVITY_VARIANTS: readonly ["Audit Trail Viewed", "Report Viewed", "Customer PII Viewed", "Cash Drawer UI Opened", "Cash Drawer UI Closed", "Export Initiated", "Impersonation UI Started", "Impersonation UI Ended", "Payment Viewed", "Invoice Viewed", "Customer Detail Viewed", "Supplier Account Viewed", "Search Performed", "Action Denied", "Two-Factor Challenge Shown", "Two-Factor Code Validation Failed", "Two-Factor Enrollment Started", "Two-Factor Recovery Codes Revealed", "Two-Factor Reset Initiated"];
|
|
398
404
|
export type UiOnlyUserActivityVariant = (typeof UI_ONLY_USER_ACTIVITY_VARIANTS)[number];
|
|
405
|
+
/**
|
|
406
|
+
* Valid per-entity timeline entity types for the user-activity audit feed.
|
|
407
|
+
* MUST stay in sync with the BE `VALID_ENTITY_TYPES` const in
|
|
408
|
+
* `sinfactura/api/stacks/lambdas/userActivity/_get.ts` (api#1258), which Zod-
|
|
409
|
+
* enums the `entityType` query param. The api should import this union to
|
|
410
|
+
* derive that const so the two can't drift (separate api follow-up).
|
|
411
|
+
*/
|
|
412
|
+
export type UserActivityEntityType = 'order' | 'invoice' | 'supplier_invoice' | 'payment' | 'account' | 'customer' | 'supplier' | 'product' | 'user' | 'target_store' | 'brand' | 'category' | 'cash' | 'ticket' | 'report' | 'notification';
|