sinfactura-types 1.10.608 → 1.10.609

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/audit.d.ts CHANGED
@@ -9,6 +9,8 @@ declare global {
9
9
  */
10
10
  interface OrderAuditEntry {
11
11
  entity: 'ORDER';
12
+ /** Absent on older API responses; legacy rows carry status: legacy. */
13
+ audit?: PublicAuditMetadata;
12
14
  /** The `orderId`. */
13
15
  entityId: string;
14
16
  storeId: string;
@@ -0,0 +1,73 @@
1
+ declare global {
2
+ type EntityAuditEntity = 'PLAN' | 'STORE' | 'PAYMENT' | 'ORDER' | 'MERCADOPAGO' | 'INVOICE' | 'SUBSCRIPTION' | 'USER' | 'CUSTOMER' | 'INTEGRATION' | 'PLATFORM';
3
+ /** Existing business fields with independently projected public metadata. */
4
+ interface EntityAuditHttpEntry {
5
+ entity: EntityAuditEntity;
6
+ entityId: string;
7
+ storeId?: string;
8
+ timestamp: number;
9
+ actor: OrderAuditActor;
10
+ action: string;
11
+ before: Record<string, unknown>;
12
+ after: Record<string, unknown>;
13
+ reason: string;
14
+ createdAt: number;
15
+ origin?: OrderAuditOrigin;
16
+ audit: PublicAuditMetadata;
17
+ }
18
+ /** Internal, forward-only metadata; independent of each event's schema_version. */
19
+ interface AuditEnvelopeV1 {
20
+ envelopeVersion: 1;
21
+ eventId: string;
22
+ surface: AuditSurface;
23
+ dataClass: AuditDataClass;
24
+ scope: {
25
+ kind: 'tenant';
26
+ tenantId: string;
27
+ } | {
28
+ kind: 'platform';
29
+ } | {
30
+ kind: 'unknown';
31
+ };
32
+ occurredAt: string;
33
+ recordedAt: string;
34
+ actor: {
35
+ principal: {
36
+ kind: 'user' | 'customer' | 'platform-user';
37
+ id: string;
38
+ } | {
39
+ kind: 'system' | 'anonymous' | 'unknown';
40
+ };
41
+ resolution: 'named' | 'name-unresolved' | 'system' | 'anonymous' | 'unknown';
42
+ /** Trusted support context only; never a public projection. */
43
+ support?: {
44
+ operatorId: string;
45
+ sessionId: string;
46
+ };
47
+ };
48
+ subject?: {
49
+ type: string;
50
+ id: string;
51
+ };
52
+ targets?: {
53
+ type: string;
54
+ id: string;
55
+ }[];
56
+ action: string;
57
+ correlationId?: string;
58
+ causationId?: string;
59
+ }
60
+ type AuditSurface = 'storefrontEvents' | 'userActivity' | 'entityAudit' | 'storeLogPartition' | 'errorPartition' | 'fiscalAudit' | 'loginHistory' | 'outboundMessageLog' | 'impersonationAudit' | 'notifyDelivery' | 'orderOutbox';
61
+ type AuditDataClass = 'customer-analytics' | 'operator-audit' | 'entity-diff-history' | 'legacy-mixed-log' | 'operational-error' | 'fiscal-interaction-log' | 'security-audit' | 'outbound-message-forensics' | 'privileged-access-audit' | 'notification-delivery-outcome' | 'delivery-intent';
62
+ /** Public metadata contains no internal attribution, references or bookkeeping. */
63
+ type PublicAuditMetadata = {
64
+ status: 'legacy';
65
+ } | {
66
+ status: 'v1';
67
+ envelopeVersion: 1;
68
+ eventId: string;
69
+ occurredAt: string;
70
+ recordedAt: string;
71
+ };
72
+ }
73
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/cjs/index.js CHANGED
@@ -28,6 +28,7 @@ __exportStar(require("./ai.js"), exports);
28
28
  __exportStar(require("./api.js"), exports);
29
29
  __exportStar(require("./appointment.js"), exports);
30
30
  __exportStar(require("./audit.js"), exports);
31
+ __exportStar(require("./auditEnvelope.js"), exports);
31
32
  __exportStar(require("./attendance.js"), exports);
32
33
  __exportStar(require("./auth.js"), exports);
33
34
  __exportStar(require("./basket.js"), exports);
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './ai.ts';
4
4
  export * from './api.ts';
5
5
  export * from './appointment.ts';
6
6
  export * from './audit.ts';
7
+ export * from './auditEnvelope.ts';
7
8
  export * from './attendance.ts';
8
9
  export * from './auth.ts';
9
10
  export * from './basket.ts';
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ export * from "./ai.js";
12
12
  export * from "./api.js";
13
13
  export * from "./appointment.js";
14
14
  export * from "./audit.js";
15
+ export * from "./auditEnvelope.js";
15
16
  export * from "./attendance.js";
16
17
  export * from "./auth.js";
17
18
  export * from "./basket.js";
@@ -247,6 +247,7 @@ declare global {
247
247
  * `before`/`after` carry only the fields that changed (diff slice).
248
248
  */
249
249
  interface PlanAuditEntry {
250
+ audit?: PublicAuditMetadata;
250
251
  entity: 'PLAN';
251
252
  entityId: string;
252
253
  timestamp: number;
@@ -495,6 +496,7 @@ declare global {
495
496
  * each side structurally rather than trusting every field to be present.
496
497
  */
497
498
  interface SubscriptionAuditEntry {
499
+ audit?: PublicAuditMetadata;
498
500
  storeId: string;
499
501
  timestamp: number;
500
502
  actor: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.608",
3
+ "version": "1.10.609",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",