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.
@@ -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 {};
@@ -39,6 +39,8 @@ declare global {
39
39
  paymentMethod: number;
40
40
  phone: string;
41
41
  photoURL: string;
42
+ photoData?: string;
43
+ removePhotoURL?: string;
42
44
  postalCode: string;
43
45
  /**
44
46
  * FK to PriceList.id (NOT a positional ordinal). Picks which PriceSlot /
@@ -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
@@ -44,10 +44,6 @@ declare global {
44
44
  isService: boolean;
45
45
  cost: number;
46
46
  prices?: PriceSlot[];
47
- price1?: number;
48
- price2?: number;
49
- price3?: number;
50
- price4?: number;
51
47
  }
52
48
  }
53
49
  export {};
@@ -5,6 +5,8 @@ declare global {
5
5
  supplierId: string;
6
6
  createdAt: number;
7
7
  photoURL: string;
8
+ photoData?: string;
9
+ removePhotoURL?: string;
8
10
  company: string;
9
11
  cuit: string;
10
12
  razonSocial: string;
package/dist/user.d.ts CHANGED
@@ -10,6 +10,8 @@ declare global {
10
10
  password?: string;
11
11
  roles: string;
12
12
  photoURL: string;
13
+ photoData?: string;
14
+ removePhotoURL?: string;
13
15
  disabled: boolean;
14
16
  search: string;
15
17
  accessToken: string;
@@ -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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.6.30",
3
+ "version": "1.6.32",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",