sinfactura-types 1.10.607 → 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 +2 -0
- package/dist/auditEnvelope.d.ts +73 -0
- package/dist/auditEnvelope.js +1 -0
- package/dist/cjs/auditEnvelope.js +2 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/socket.js +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/notification.d.ts +7 -6
- package/dist/socket.d.ts +1 -1
- package/dist/socket.js +0 -1
- package/dist/subscription.d.ts +2 -0
- package/package.json +1 -1
package/dist/audit.d.ts
CHANGED
|
@@ -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 {};
|
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/cjs/socket.js
CHANGED
|
@@ -503,7 +503,6 @@ exports.SOCKET_ACTIONS = [
|
|
|
503
503
|
// Notifications & messaging.
|
|
504
504
|
'notifications',
|
|
505
505
|
'support-message',
|
|
506
|
-
'whatsapp-message',
|
|
507
506
|
/**
|
|
508
507
|
* An automatic WhatsApp order draft settled (`ready` or `failed`). Admin
|
|
509
508
|
* sockets of the store only; `data` is a `WhatsAppStoredOrderDraft`.
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/notification.d.ts
CHANGED
|
@@ -284,12 +284,13 @@ declare global {
|
|
|
284
284
|
* What the outbound seam (`notify()`) knew about one call the moment its
|
|
285
285
|
* transport returned. It is never a delivery receipt: `enqueued` and
|
|
286
286
|
* `handed-off` say a queue or a sender took the message, and `sent` says the
|
|
287
|
-
* provider accepted it.
|
|
288
|
-
* `
|
|
287
|
+
* provider accepted it. Later SES events arrive through `EMAILEVENT#`;
|
|
288
|
+
* WhatsApp status callbacks update the established `WHATSAPP#` history.
|
|
289
289
|
*/
|
|
290
|
-
type NotifyDeliveryOutcome = 'sent' | 'not-sent' | 'enqueued' | 'handed-off' | 'failed';
|
|
290
|
+
type NotifyDeliveryOutcome = 'sent' | 'suppressed' | 'not-sent' | 'enqueued' | 'handed-off' | 'failed';
|
|
291
291
|
/** Why a channel did not deliver, including send-time preference refusals. */
|
|
292
292
|
type NotifyNotSentReason = 'skipped-by-preference' | 'demo' | 'suppressed' | 'refused';
|
|
293
|
+
type NotifyWhatsAppSuppressionReason = 'allowlist-missing' | 'recipient-malformed' | 'recipient-not-allowlisted';
|
|
293
294
|
/**
|
|
294
295
|
* A recorded transport outcome or send-time preference refusal — the
|
|
295
296
|
* wire half of the `NOTIFY#{storeId}` delivery row. The stored row,
|
|
@@ -304,14 +305,14 @@ declare global {
|
|
|
304
305
|
* `transport`, plus a count.
|
|
305
306
|
*/
|
|
306
307
|
interface NotifyDelivery {
|
|
307
|
-
transport: 'email' | 'queue' | 'ses' | 'ses-marketing' | 'push';
|
|
308
|
+
transport: 'email' | 'queue' | 'ses' | 'ses-marketing' | 'push' | 'whatsapp';
|
|
308
309
|
/** The closed audience enum `notify()` accepts. */
|
|
309
310
|
audience: 'store-customer' | 'account-holder' | 'store-operator' | 'platform-staff' | 'marketing-recipient';
|
|
310
311
|
/** The producer's event name. Never recipient data. */
|
|
311
312
|
logTag: string;
|
|
312
313
|
outcome: NotifyDeliveryOutcome;
|
|
313
|
-
/** Only when `outcome` is `'not-sent'`. */
|
|
314
|
-
reason?: NotifyNotSentReason;
|
|
314
|
+
/** Only when `outcome` is `'not-sent'` or `'suppressed'`. */
|
|
315
|
+
reason?: NotifyNotSentReason | NotifyWhatsAppSuppressionReason;
|
|
315
316
|
/** Provider channel for sent email; semantic channel for preference skips. */
|
|
316
317
|
channel?: 'gmail' | 'ses' | NotificationPreferenceChannel;
|
|
317
318
|
/** Only when SES returned one. The join key to `EMAILEVENT#`. */
|
package/dist/socket.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* A client must ignore actions it does not own rather than assume it
|
|
27
27
|
* receives all of them.
|
|
28
28
|
*/
|
|
29
|
-
export declare const SOCKET_ACTIONS: readonly ["account", "appointments", "appointmentWaitlist", "attendance", "attributes", "automation-rules", "baskets", "cart", "brands", "cash", "catalogOperation", "categories", "campaigns", "customers", "customerNote", "customerAddress", "customerContact", "deliveries", "globals", "inventory", "invoices", "literals", "loyalty", "orders", "presupuestos", "products", "promotions", "segments", "returns", "rma", "templates", "services", "service-templates", "shifts", "stores", "suppliers", "supplier-invoice", "support", "surveys", "users", "warehouses", "zones", "favorites", "webhooks", "account-delete", "baskets-delete", "cart-delete", "log-delete", "notifications", "support-message", "whatsapp-
|
|
29
|
+
export declare const SOCKET_ACTIONS: readonly ["account", "appointments", "appointmentWaitlist", "attendance", "attributes", "automation-rules", "baskets", "cart", "brands", "cash", "catalogOperation", "categories", "campaigns", "customers", "customerNote", "customerAddress", "customerContact", "deliveries", "globals", "inventory", "invoices", "literals", "loyalty", "orders", "presupuestos", "products", "promotions", "segments", "returns", "rma", "templates", "services", "service-templates", "shifts", "stores", "suppliers", "supplier-invoice", "support", "surveys", "users", "warehouses", "zones", "favorites", "webhooks", "account-delete", "baskets-delete", "cart-delete", "log-delete", "notifications", "support-message", "whatsapp-order-draft", "payment_received", "mp_payment_status_changed", "payment_linked", "payment_unlinked", "mercadopago", "mercadopago_dynamic_qr_created", "mercadopago_static_qr_created", "mp_hook_log_appended", "mp_ipn_log_appended", "stripe", "subscription", "caea", "print", "print-order", "print-invoice", "print-product", "print-tag", "print_job_failed", "request_printers", "printers_changed", "agent_status_changed", "print_rules_changed", "printers_active", "agent_command", "maintenance", "currency_auto_updated", "drain_progress", "integration_event_appended", "userActivityRecorded", "mercadolibre_settlement_period", "customDomain", "purchaseOrders", "cycleCounts", "stockTransfers"];
|
|
30
30
|
/** Union of every server→client data-frame action. */
|
|
31
31
|
export type SocketAction = (typeof SOCKET_ACTIONS)[number];
|
|
32
32
|
/**
|
package/dist/socket.js
CHANGED
|
@@ -500,7 +500,6 @@ export const SOCKET_ACTIONS = [
|
|
|
500
500
|
// Notifications & messaging.
|
|
501
501
|
'notifications',
|
|
502
502
|
'support-message',
|
|
503
|
-
'whatsapp-message',
|
|
504
503
|
/**
|
|
505
504
|
* An automatic WhatsApp order draft settled (`ready` or `failed`). Admin
|
|
506
505
|
* sockets of the store only; `data` is a `WhatsAppStoredOrderDraft`.
|
package/dist/subscription.d.ts
CHANGED
|
@@ -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: {
|