sinfactura-types 1.10.183 → 1.10.185

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/account.d.ts CHANGED
@@ -74,6 +74,24 @@ declare global {
74
74
  * `currencyValue` alone until an Account writer exists.
75
75
  */
76
76
  currencyValueAt?: number;
77
+ /**
78
+ * How the money arrived, for a POS-originated movement — the SAME fixed
79
+ * vocabulary as {@link OrderTender.source}, deliberately coarser than
80
+ * `method` so a reader can branch without knowing the tenant's method
81
+ * table.
82
+ *
83
+ * Absent on a manual account entry, which is every row written to date.
84
+ * Absence is what keeps the free-text `subject` fallback correct for
85
+ * those rows; it does NOT mean cash.
86
+ */
87
+ source?: 'cash' | 'card' | 'qr' | 'transfer' | 'account' | 'other';
88
+ /**
89
+ * FK to a `Store.paymentMethods` entry's `id`, resolved at write time and
90
+ * frozen here — same semantics as {@link OrderTender.method}. The tenant
91
+ * may rename, reorder or remove that method afterwards; the row keeps the
92
+ * id it was written under, so do not read it as a live pointer.
93
+ */
94
+ method?: number;
77
95
  balance?: number;
78
96
  userId?: string;
79
97
  deleted?: boolean;
@@ -179,6 +179,10 @@ exports.SOCKET_ACTIONS = [
179
179
  // ⚠️ A frame for a period whose `periodStatus` is `'OPEN'` carries numbers
180
180
  // ML will still restate; a consumer must not render one as final.
181
181
  'mercadolibre_settlement_period',
182
+ // BE → all store users when an EMPRESA custom domain's provisioning state
183
+ // moves (`CustomDomainSocketPayload`). Status only: the row's
184
+ // `verificationToken` is an ownership credential and is never re-sent here.
185
+ 'customDomain',
182
186
  ];
183
187
  /** Runtime guard — narrows an untrusted string to a known action. */
184
188
  const isSocketAction = (value) => typeof value === 'string' && exports.SOCKET_ACTIONS.includes(value);
package/dist/print.d.ts CHANGED
@@ -45,6 +45,19 @@ declare global {
45
45
  paper?: string;
46
46
  rotate?: 0 | 90 | 180 | 270;
47
47
  }
48
+ /**
49
+ * Who caused a print-job transition. `fullName` is denormalized at write
50
+ * time, matching `OrderAuditActor` — a timeline has to stay readable after
51
+ * the user is renamed or removed, and re-resolving it per row on read would
52
+ * be a lookup per timeline entry.
53
+ *
54
+ * ⚠️ Storing it is not licence to log it: `fullname` is a `SENSITIVE_KEYS`
55
+ * entry, so it is scrubbed out of every log, Sentry event and `ERROR` row.
56
+ */
57
+ interface PrintJobActor {
58
+ userId: string;
59
+ fullName: string;
60
+ }
48
61
  interface PrintJobTransition {
49
62
  jobId: string;
50
63
  state: PrintJobState;
@@ -52,6 +65,12 @@ declare global {
52
65
  source: 'be' | 'agent';
53
66
  detail?: string;
54
67
  errorCode?: string;
68
+ /**
69
+ * Absent on an agent-driven transition, which no person initiates, and on
70
+ * every row written before actor identity shipped. Absence means "not
71
+ * attributed", never "the system" — render a fallback rather than a name.
72
+ */
73
+ actor?: PrintJobActor;
55
74
  }
56
75
  /**
57
76
  * One Cloud Print agent connection in `PrintAgentStatus.agents`.
package/dist/socket.d.ts CHANGED
@@ -26,9 +26,29 @@
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", "baskets", "cart", "brands", "cash", "categories", "customers", "globals", "invoices", "literals", "orders", "products", "returns", "services", "service-templates", "shifts", "stores", "suppliers", "supplier-invoice", "support", "surveys", "users", "favorites", "webhooks", "account-delete", "baskets-delete", "cart-delete", "log-delete", "notifications", "support-message", "whatsapp-message", "payment_received", "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"];
29
+ export declare const SOCKET_ACTIONS: readonly ["account", "baskets", "cart", "brands", "cash", "categories", "customers", "globals", "invoices", "literals", "orders", "products", "returns", "services", "service-templates", "shifts", "stores", "suppliers", "supplier-invoice", "support", "surveys", "users", "favorites", "webhooks", "account-delete", "baskets-delete", "cart-delete", "log-delete", "notifications", "support-message", "whatsapp-message", "payment_received", "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"];
30
30
  /** Union of every server→client data-frame action. */
31
31
  export type SocketAction = (typeof SOCKET_ACTIONS)[number];
32
+ /**
33
+ * Payload of the `'customDomain'` frame — a projection of `DomainRecord`, not
34
+ * the row. Deliberately OMITTED versus the row: `verificationToken` (an
35
+ * ownership credential, returned once at register time and never re-sent),
36
+ * any hosting-provider app id (internal), and `lastCheckedAt` / `startedAt`
37
+ * (operator-only diagnostics).
38
+ */
39
+ export interface CustomDomainSocketPayload {
40
+ storeId: string;
41
+ /** The NORMALIZED host, as stored on the row. */
42
+ host: string;
43
+ provisioning: {
44
+ state: DomainProvisioningState;
45
+ certificateVerificationDnsRecord?: string;
46
+ subDomains?: DomainSubDomainRecord[];
47
+ /** Unix MILLISECONDS. Present once `state` reaches `active`. */
48
+ activatedAt?: number;
49
+ error?: string;
50
+ };
51
+ }
32
52
  /** Runtime guard — narrows an untrusted string to a known action. */
33
53
  export declare const isSocketAction: (value: unknown) => value is SocketAction;
34
54
  /**
package/dist/socket.js CHANGED
@@ -176,6 +176,10 @@ export const SOCKET_ACTIONS = [
176
176
  // ⚠️ A frame for a period whose `periodStatus` is `'OPEN'` carries numbers
177
177
  // ML will still restate; a consumer must not render one as final.
178
178
  'mercadolibre_settlement_period',
179
+ // BE → all store users when an EMPRESA custom domain's provisioning state
180
+ // moves (`CustomDomainSocketPayload`). Status only: the row's
181
+ // `verificationToken` is an ownership credential and is never re-sent here.
182
+ 'customDomain',
179
183
  ];
180
184
  /** Runtime guard — narrows an untrusted string to a known action. */
181
185
  export const isSocketAction = (value) => typeof value === 'string' && SOCKET_ACTIONS.includes(value);
package/dist/store.d.ts CHANGED
@@ -886,6 +886,54 @@ declare global {
886
886
  * domain slots — see `DomainErrorCode`.
887
887
  */
888
888
  type DomainStatus = "PENDING" | "VERIFIED" | "REVOKED";
889
+ /**
890
+ * Where EMPRESA custom-domain provisioning stands for a VERIFIED host. The
891
+ * ownership flow (register → DNS-TXT verify) is unchanged and precedes this;
892
+ * provisioning is what the platform does with a host once it is proven.
893
+ *
894
+ * - `pending_dns` — the association exists; waiting on the tenant to add the
895
+ * CNAME records the hosting provider asked for.
896
+ * - `in_progress` — DNS looks right; the certificate is being issued and the
897
+ * domain deployed.
898
+ * - `active` — the provider reports the domain live.
899
+ * - `failed` — the provider reported a failure, or no progress for 48 h.
900
+ * - `unconfigured` — this stage has no hosting-app id configured, so
901
+ * provisioning cannot start here. A deployment fact, not a tenant fault.
902
+ */
903
+ type DomainProvisioningState = "pending_dns" | "in_progress" | "active" | "failed" | "unconfigured";
904
+ /** One sub-domain of a provisioned host, mirroring the hosting provider's own per-prefix record. */
905
+ interface DomainSubDomainRecord {
906
+ /** `''` for the apex, `'www'` etc. */
907
+ prefix: string;
908
+ /**
909
+ * The provider's CNAME instruction for this prefix, e.g. `"<name> CNAME <value>"`.
910
+ * Present once the provider has computed it — show it verbatim, never re-derive it.
911
+ */
912
+ dnsRecord?: string;
913
+ verified: boolean;
914
+ }
915
+ /**
916
+ * Provisioning sub-state carried on the SAME `DomainRecord` row — a domain is
917
+ * one entity, not two. Absent until provisioning has been attempted for the
918
+ * host, which is every row written before this shipped.
919
+ *
920
+ * Timestamps are **Unix MILLISECONDS**, the same unit as `createdAt` /
921
+ * `verifiedAt` on the enclosing row.
922
+ */
923
+ interface DomainProvisioning {
924
+ state: DomainProvisioningState;
925
+ /** The provider's certificate-validation CNAME instruction — shown to the tenant once, verbatim. */
926
+ certificateVerificationDnsRecord?: string;
927
+ subDomains?: DomainSubDomainRecord[];
928
+ /** Unix MILLISECONDS — last time the poller checked the provider. Operator diagnostic, not tenant-facing. */
929
+ lastCheckedAt?: number;
930
+ /** Unix MILLISECONDS. */
931
+ startedAt?: number;
932
+ /** Unix MILLISECONDS. Present once `state` reaches `active`. */
933
+ activatedAt?: number;
934
+ /** The provider's last reported failure reason. Diagnostic only — never a stable code to branch on. */
935
+ error?: string;
936
+ }
889
937
  /**
890
938
  * One row of `GET /store/domains`, which answers `{ data: DomainRecord[] }`.
891
939
  *
@@ -923,6 +971,8 @@ declare global {
923
971
  revokedAt?: number;
924
972
  /** Unix SECONDS — a DynamoDB TTL. PENDING rows only; removed on verify. */
925
973
  ttl?: number;
974
+ /** Present only once EMPRESA provisioning has been attempted for this VERIFIED host. */
975
+ provisioning?: DomainProvisioning;
926
976
  }
927
977
  /**
928
978
  * `POST /store/domains { mode: 'register' }` — the payload, carried ENVELOPED
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.183",
3
+ "version": "1.10.185",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",