sinfactura-types 1.6.22 → 1.6.23

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.
@@ -328,7 +328,61 @@ declare global {
328
328
  event: 'Impersonation UI Ended';
329
329
  target_store_id: string;
330
330
  }
331
- type UserActivityEvent = UserLoggedInEvent | UserLoggedOutEvent | UserPasswordChangedEvent | UserSuspendedEvent | TwoFactorEnrolledEvent | TwoFactorDisabledEvent | TwoFactorResetEvent | TwoFactorRecoveryCodesGeneratedEvent | StorePaletteChangedEvent | StoreSettingsUpdatedEvent | PlanChangedEvent | InvoiceCreatedEvent | OrderCreatedEvent | OrderCancelledEvent | ProductPriceChangedEvent | CustomerCreatedEvent | CustomerEditedEvent | CashDrawerOpenedEvent | CashDrawerClosedEvent | TenantImpersonatedEvent | SecretRotatedEvent | UserCreatedEvent | UserUpdatedEvent | ProductCreatedEvent | ProductUpdatedEvent | StockIncomeCreatedEvent | CategoryCreatedEvent | CategoryUpdatedEvent | BrandCreatedEvent | BrandUpdatedEvent | SupplierCreatedEvent | SupplierUpdatedEvent | SupplierInvoiceCreatedEvent | SupplierAccountCreatedEvent | SupplierAccountUpdatedEvent | AccountCreatedEvent | AccountDeletedEvent | BasketUpdatedEvent | BasketDeletedEvent | CashDrawerMovementEvent | PaymentCreatedEvent | PaymentLinkedEvent | PaymentUnlinkedEvent | PaymentLinkageUpdatedEvent | NotificationReadEvent | LogDeletedEvent | PlanCreatedEvent | StoreMaintenanceToggledEvent | PlatformMaintenanceToggledEvent | TenantCreatedEvent | LiteralUpdatedEvent | SupportTicketCreatedEvent | SupportTicketUpdatedEvent | AuditTrailViewedEvent | ReportViewedEvent | CustomerPiiViewedEvent | CashDrawerUiOpenedEvent | CashDrawerUiClosedEvent | ExportInitiatedEvent | ImpersonationUiStartedEvent | ImpersonationUiEndedEvent;
331
+ interface PaymentViewedEvent extends UserActivityEventBase {
332
+ event: 'Payment Viewed';
333
+ payment_id: string;
334
+ source?: string;
335
+ linked_status?: 'linked' | 'unlinked';
336
+ }
337
+ interface InvoiceViewedEvent extends UserActivityEventBase {
338
+ event: 'Invoice Viewed';
339
+ invoice_id: string;
340
+ fiscal_status?: string;
341
+ }
342
+ interface CustomerDetailViewedEvent extends UserActivityEventBase {
343
+ event: 'Customer Detail Viewed';
344
+ customer_id: string;
345
+ }
346
+ interface SupplierAccountViewedEvent extends UserActivityEventBase {
347
+ event: 'Supplier Account Viewed';
348
+ supplier_id: string;
349
+ }
350
+ interface SearchPerformedEvent extends UserActivityEventBase {
351
+ event: 'Search Performed';
352
+ scope: 'customers' | 'audit' | 'suppliers' | 'invoices' | 'payments';
353
+ query_hash?: string;
354
+ result_count?: number;
355
+ }
356
+ interface ActionDeniedEvent extends UserActivityEventBase {
357
+ event: 'Action Denied';
358
+ attempted_action: string;
359
+ resource_type: string;
360
+ resource_id?: string;
361
+ reason: 'permission' | 'subscription' | 'maintenance';
362
+ }
363
+ interface TwoFactorChallengeShownEvent extends UserActivityEventBase {
364
+ event: 'Two-Factor Challenge Shown';
365
+ method: 'password' | 'social';
366
+ provider?: string;
367
+ }
368
+ interface TwoFactorCodeValidationFailedEvent extends UserActivityEventBase {
369
+ event: 'Two-Factor Code Validation Failed';
370
+ method: 'totp' | 'recovery';
371
+ attempt_number?: number;
372
+ }
373
+ interface TwoFactorEnrollmentStartedEvent extends UserActivityEventBase {
374
+ event: 'Two-Factor Enrollment Started';
375
+ }
376
+ interface TwoFactorRecoveryCodesRevealedEvent extends UserActivityEventBase {
377
+ event: 'Two-Factor Recovery Codes Revealed';
378
+ code_count: number;
379
+ }
380
+ interface TwoFactorResetInitiatedEvent extends UserActivityEventBase {
381
+ event: 'Two-Factor Reset Initiated';
382
+ target_user_id: string;
383
+ initiator_role: string;
384
+ }
385
+ type UserActivityEvent = UserLoggedInEvent | UserLoggedOutEvent | UserPasswordChangedEvent | UserSuspendedEvent | TwoFactorEnrolledEvent | TwoFactorDisabledEvent | TwoFactorResetEvent | TwoFactorRecoveryCodesGeneratedEvent | StorePaletteChangedEvent | StoreSettingsUpdatedEvent | PlanChangedEvent | InvoiceCreatedEvent | OrderCreatedEvent | OrderCancelledEvent | ProductPriceChangedEvent | CustomerCreatedEvent | CustomerEditedEvent | CashDrawerOpenedEvent | CashDrawerClosedEvent | TenantImpersonatedEvent | SecretRotatedEvent | UserCreatedEvent | UserUpdatedEvent | ProductCreatedEvent | ProductUpdatedEvent | StockIncomeCreatedEvent | CategoryCreatedEvent | CategoryUpdatedEvent | BrandCreatedEvent | BrandUpdatedEvent | SupplierCreatedEvent | SupplierUpdatedEvent | SupplierInvoiceCreatedEvent | SupplierAccountCreatedEvent | SupplierAccountUpdatedEvent | AccountCreatedEvent | AccountDeletedEvent | BasketUpdatedEvent | BasketDeletedEvent | CashDrawerMovementEvent | PaymentCreatedEvent | PaymentLinkedEvent | PaymentUnlinkedEvent | PaymentLinkageUpdatedEvent | NotificationReadEvent | LogDeletedEvent | PlanCreatedEvent | StoreMaintenanceToggledEvent | PlatformMaintenanceToggledEvent | TenantCreatedEvent | LiteralUpdatedEvent | SupportTicketCreatedEvent | SupportTicketUpdatedEvent | AuditTrailViewedEvent | ReportViewedEvent | CustomerPiiViewedEvent | CashDrawerUiOpenedEvent | CashDrawerUiClosedEvent | ExportInitiatedEvent | ImpersonationUiStartedEvent | ImpersonationUiEndedEvent | PaymentViewedEvent | InvoiceViewedEvent | CustomerDetailViewedEvent | SupplierAccountViewedEvent | SearchPerformedEvent | ActionDeniedEvent | TwoFactorChallengeShownEvent | TwoFactorCodeValidationFailedEvent | TwoFactorEnrollmentStartedEvent | TwoFactorRecoveryCodesRevealedEvent | TwoFactorResetInitiatedEvent;
332
386
  }
333
387
  /**
334
388
  * Canonical whitelist of UI-only `UserActivityEvent` variant names — the 8
@@ -340,5 +394,5 @@ declare global {
340
394
  * Source of truth lives here so the api whitelist can't drift from the
341
395
  * actual UI-only variant taxonomy.
342
396
  */
343
- 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"];
397
+ 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"];
344
398
  export type UiOnlyUserActivityVariant = (typeof UI_ONLY_USER_ACTIVITY_VARIANTS)[number];
@@ -40,4 +40,18 @@ export const UI_ONLY_USER_ACTIVITY_VARIANTS = [
40
40
  'Export Initiated',
41
41
  'Impersonation UI Started',
42
42
  'Impersonation UI Ended',
43
+ // Phase 4 (api#1266) — FE emits each through the ingest gate. `Action Denied`
44
+ // is whitelisted for the FE-gate path (pre-roundtrip maintenance/subscription/
45
+ // permission denials); the real BE 403 row is written server-side, not POSTed.
46
+ 'Payment Viewed',
47
+ 'Invoice Viewed',
48
+ 'Customer Detail Viewed',
49
+ 'Supplier Account Viewed',
50
+ 'Search Performed',
51
+ 'Action Denied',
52
+ 'Two-Factor Challenge Shown',
53
+ 'Two-Factor Code Validation Failed',
54
+ 'Two-Factor Enrollment Started',
55
+ 'Two-Factor Recovery Codes Revealed',
56
+ 'Two-Factor Reset Initiated',
43
57
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.6.22",
3
+ "version": "1.6.23",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",