sinfactura-types 1.10.642 → 1.10.643

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.
@@ -581,7 +581,7 @@ exports.SOCKET_ACTIONS = [
581
581
  // ⚠️ A frame for a period whose `periodStatus` is `'OPEN'` carries numbers
582
582
  // ML will still restate; a consumer must not render one as final.
583
583
  'mercadolibre_settlement_period',
584
- // BE → all store users when an EMPRESA custom domain's provisioning state
584
+ // BE → all store users when an avanzado custom domain's provisioning state
585
585
  // moves (`CustomDomainSocketPayload`). Status only: the row's
586
586
  // `verificationToken` is an ownership credential and is never re-sent here.
587
587
  'customDomain',
package/dist/cjs/store.js CHANGED
@@ -1,2 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CUSTOM_DOMAIN_ROW_LIMIT = exports.CUSTOM_DOMAIN_SLOT_LIMIT = void 0;
4
+ /**
5
+ * How many custom-domain rows a store may hold that count: one active domain
6
+ * and one spare, so a replacement can be verified and provisioned before the
7
+ * current domain is revoked. `www` and the apex are one row. REVOKED rows and
8
+ * expired PENDING claims never count. `POST /store/domains { mode: 'register' }`
9
+ * refuses the next one `409 DOMAIN_SLOT_LIMIT` with this value as `limit`.
10
+ */
11
+ exports.CUSTOM_DOMAIN_SLOT_LIMIT = 2;
12
+ /**
13
+ * How many DOMAIN rows a store may hold in total, whatever their status:
14
+ * REVOKED rows free their `CUSTOM_DOMAIN_SLOT_LIMIT` slot but a
15
+ * VERIFIED-then-revoked row is kept, so without this ceiling a store cycling
16
+ * register → verify → revoke over fresh hosts would grow its rows without
17
+ * bound. `POST /store/domains { mode: 'register' }` refuses the next one
18
+ * `409 DOMAIN_ROW_LIMIT` with this value as `limit`.
19
+ */
20
+ exports.CUSTOM_DOMAIN_ROW_LIMIT = 10;
package/dist/socket.d.ts CHANGED
@@ -42,7 +42,15 @@ export interface CustomDomainSocketPayload {
42
42
  host: string;
43
43
  provisioning: {
44
44
  state: DomainProvisioningState;
45
+ /** 1-based; see `DomainProvisioning.step`. */
46
+ step?: number;
47
+ /** See `DomainProvisioning.total`. */
48
+ total?: number;
49
+ /** See `DomainProvisioning.records`. */
50
+ records?: DomainDnsRecord[];
51
+ /** @deprecated Read `records`; see `DomainProvisioning.certificateVerificationDnsRecord`. */
45
52
  certificateVerificationDnsRecord?: string;
53
+ /** @deprecated Read `records`; see `DomainProvisioning.subDomains`. */
46
54
  subDomains?: DomainSubDomainRecord[];
47
55
  /** Unix MILLISECONDS. Present once `state` reaches `active`. */
48
56
  activatedAt?: number;
package/dist/socket.js CHANGED
@@ -578,7 +578,7 @@ export const SOCKET_ACTIONS = [
578
578
  // ⚠️ A frame for a period whose `periodStatus` is `'OPEN'` carries numbers
579
579
  // ML will still restate; a consumer must not render one as final.
580
580
  'mercadolibre_settlement_period',
581
- // BE → all store users when an EMPRESA custom domain's provisioning state
581
+ // BE → all store users when an avanzado custom domain's provisioning state
582
582
  // moves (`CustomDomainSocketPayload`). Status only: the row's
583
583
  // `verificationToken` is an ownership credential and is never re-sent here.
584
584
  'customDomain',
package/dist/store.d.ts CHANGED
@@ -1515,28 +1515,45 @@ declare global {
1515
1515
  * Lifecycle of a tenant custom-domain claim.
1516
1516
  *
1517
1517
  * `REVOKED` is terminal but reclaimable BY THE SAME STORE only: re-registering
1518
- * a REVOKED host the caller already owns succeeds, while a PENDING or
1519
- * VERIFIED row owned by anyone else refuses the write. Revoked rows are kept
1520
- * for audit and squatter-protection and still consume one of the store's
1521
- * domain slots — see `DomainErrorCode`.
1518
+ * a REVOKED or PENDING host the caller already owns succeeds (a PENDING one is
1519
+ * re-minted with a fresh token and a fresh seven-day claim), while a PENDING
1520
+ * or VERIFIED row owned by anyone else — or the caller's own VERIFIED row —
1521
+ * refuses the write. A row revoked AFTER verification is kept for audit and
1522
+ * squatter-protection and does NOT count against the store's domain slots
1523
+ * (`CUSTOM_DOMAIN_SLOT_LIMIT`): revoking a row frees its slot. It does count
1524
+ * against `CUSTOM_DOMAIN_ROW_LIMIT`. A claim revoked by its store BEFORE
1525
+ * verification is deleted instead — it proved no ownership, so it protects
1526
+ * nothing — and stops appearing in the listing.
1527
+ * A PENDING row counts while its seven-day claim is unexpired, and cannot be
1528
+ * verified once that claim has expired; a VERIFIED row always counts — see
1529
+ * `DomainErrorCode`.
1522
1530
  */
1523
1531
  type DomainStatus = 'PENDING' | 'VERIFIED' | 'REVOKED';
1524
1532
  /**
1525
- * Where EMPRESA custom-domain provisioning stands for a VERIFIED host. The
1526
- * ownership flow (register → DNS-TXT verify) is unchanged and precedes this;
1527
- * provisioning is what the platform does with a host once it is proven.
1533
+ * Where custom-domain provisioning stands for a VERIFIED host. The ownership
1534
+ * flow (register → DNS-TXT verify) is unchanged and precedes this;
1535
+ * provisioning is what the platform does with a host once it is proven. The
1536
+ * states name no hosting provider and keep their meaning whichever one serves
1537
+ * the host.
1528
1538
  *
1529
- * - `pending_dns` — the association exists; waiting on the tenant to add the
1530
- * CNAME records the hosting provider asked for.
1539
+ * - `pending_dns` — provisioning has started; waiting on the tenant to publish
1540
+ * the DNS records in `DomainProvisioning.records`.
1531
1541
  * - `in_progress` — DNS looks right; the certificate is being issued and the
1532
1542
  * domain deployed.
1533
- * - `active` — the provider reports the domain live.
1534
- * - `failed` — the provider reported a failure, or no progress for 48 h.
1535
- * - `unconfigured` — this stage has no hosting-app id configured, so
1536
- * provisioning cannot start here. A deployment fact, not a tenant fault.
1543
+ * - `active` — the domain is live.
1544
+ * - `failed` — provisioning failed, including the certificate not issuing
1545
+ * within 72 h. A new `provision` call starts a fresh attempt.
1546
+ * - `unconfigured` — this stage cannot onboard custom domains. A deployment
1547
+ * fact, not a tenant fault: offer no retry.
1537
1548
  */
1538
1549
  type DomainProvisioningState = 'pending_dns' | 'in_progress' | 'active' | 'failed' | 'unconfigured';
1539
- /** One sub-domain of a provisioned host, mirroring the hosting provider's own per-prefix record. */
1550
+ /**
1551
+ * One sub-domain of a provisioned host, mirroring a hosting provider's own
1552
+ * per-prefix record.
1553
+ *
1554
+ * @deprecated Read `DomainProvisioning.records` (`DomainDnsRecord`). Kept
1555
+ * readable until rows written in this shape are gone; no new writer.
1556
+ */
1540
1557
  interface DomainSubDomainRecord {
1541
1558
  /** `''` for the apex, `'www'` etc. */
1542
1559
  prefix: string;
@@ -1547,18 +1564,54 @@ declare global {
1547
1564
  dnsRecord?: string;
1548
1565
  verified: boolean;
1549
1566
  }
1567
+ /**
1568
+ * One DNS record the tenant must publish for a custom domain to provision.
1569
+ * Show `name` and `value` verbatim; never re-derive or re-prefix either.
1570
+ */
1571
+ interface DomainDnsRecord {
1572
+ /**
1573
+ * The normalised host this record serves (`www.example.com`,
1574
+ * `example.com`). Group the records by it.
1575
+ */
1576
+ host: string;
1577
+ type: 'CNAME' | 'TXT' | 'ALIAS';
1578
+ /** Fully qualified: most DNS forms append the zone, so say so when showing it. */
1579
+ name: string;
1580
+ value: string;
1581
+ /** The per-record DNS check. */
1582
+ status: 'pending' | 'verified';
1583
+ }
1550
1584
  /**
1551
1585
  * Provisioning sub-state carried on the SAME `DomainRecord` row — a domain is
1552
1586
  * one entity, not two. Absent until provisioning has been attempted for the
1553
1587
  * host, which is every row written before this shipped.
1554
1588
  *
1589
+ * Provider-neutral: `step`/`total` and `records` describe progress without
1590
+ * naming who serves the host. A row may carry neither, in which case show no
1591
+ * step counter and no record list — never a client-side step constant.
1592
+ *
1555
1593
  * Timestamps are **Unix MILLISECONDS**, the same unit as `createdAt` /
1556
1594
  * `verifiedAt` on the enclosing row.
1557
1595
  */
1558
1596
  interface DomainProvisioning {
1559
1597
  state: DomainProvisioningState;
1560
- /** The provider's certificate-validation CNAME instruction — shown to the tenant once, verbatim. */
1598
+ /** 1-based position of the current step. Hide the counter when this or `total` is absent. */
1599
+ step?: number;
1600
+ /** Number of steps, decided by the server. */
1601
+ total?: number;
1602
+ /** The DNS records the tenant must publish, one or more per host. */
1603
+ records?: DomainDnsRecord[];
1604
+ /**
1605
+ * A certificate-validation CNAME instruction — shown to the tenant once, verbatim.
1606
+ *
1607
+ * @deprecated Read `records`. Kept readable until rows written in this
1608
+ * shape are gone; no new writer.
1609
+ */
1561
1610
  certificateVerificationDnsRecord?: string;
1611
+ /**
1612
+ * @deprecated Read `records`. Kept readable until rows written in this
1613
+ * shape are gone; no new writer.
1614
+ */
1562
1615
  subDomains?: DomainSubDomainRecord[];
1563
1616
  /** Unix MILLISECONDS — last time the poller checked the provider. Operator diagnostic, not tenant-facing. */
1564
1617
  lastCheckedAt?: number;
@@ -1604,7 +1657,7 @@ declare global {
1604
1657
  verifiedAt?: number;
1605
1658
  /** Unix MILLISECONDS. Present once the claim has been revoked. */
1606
1659
  revokedAt?: number;
1607
- /** Present only once EMPRESA provisioning has been attempted for this VERIFIED host. */
1660
+ /** Present only once avanzado provisioning has been attempted for this VERIFIED host. */
1608
1661
  provisioning?: DomainProvisioning;
1609
1662
  }
1610
1663
  /**
@@ -1700,9 +1753,18 @@ declare global {
1700
1753
  * deliberately NOT gated by the unclaimable-host guard that `register` and
1701
1754
  * `verify` apply — a row that should never have existed can always be undone.
1702
1755
  *
1703
- * ⚠️ Revoking does not free a domain slot. The row survives as `REVOKED` for
1704
- * audit and squatter-protection and still counts against the per-store cap,
1705
- * so `DOMAIN_LIMIT_REACHED` cannot be cleared by revoking.
1756
+ * Revoking frees the row's domain slot: a VERIFIED row survives as
1757
+ * `REVOKED` for audit and squatter-protection but no longer counts against
1758
+ * `CUSTOM_DOMAIN_SLOT_LIMIT`, so revoking clears `DOMAIN_SLOT_LIMIT`. A
1759
+ * claim that was never verified is deleted rather than kept — the same 200,
1760
+ * and the host is gone from the next listing — which also gives back its
1761
+ * `CUSTOM_DOMAIN_ROW_LIMIT` row.
1762
+ *
1763
+ * Revoking a provisioned row deprovisions it first, in the same request —
1764
+ * there is no refusal asking the tenant to deprovision before revoking. When
1765
+ * the revoked row was the store's public custom domain, `publicStorefront`
1766
+ * moves to the next active row, else back to the slug host, and one `stores`
1767
+ * frame announces it.
1706
1768
  */
1707
1769
  interface DomainRevokeResult {
1708
1770
  /**
@@ -1721,14 +1783,24 @@ declare global {
1721
1783
  * `body.error` codes a `POST /store/domains` refusal can carry, each verified
1722
1784
  * against a return site in the handler.
1723
1785
  *
1724
- * - `DOMAIN_LIMIT_REACHED` (**429**, `register`) — the store already holds its
1725
- * maximum number of DOMAIN rows. ⚠️ REVOKED rows still occupy a slot, so a
1726
- * store can hit this with no live domain at all, and revoking more does not
1727
- * free capacity. Carries a numeric `limit` alongside `error` and — alone
1728
- * among these codes — NO `message`, so a UI rendering `body.message`
1729
- * verbatim shows an empty error here.
1786
+ * - `DOMAIN_SLOT_LIMIT` (**409**, `register`) — the store already holds
1787
+ * `CUSTOM_DOMAIN_SLOT_LIMIT` rows that count: every row that is not REVOKED,
1788
+ * except a PENDING row whose seven-day claim has expired and the row of the
1789
+ * host being registered. Body `{ message, error, limit }`, `limit` being
1790
+ * `CUSTOM_DOMAIN_SLOT_LIMIT`. Revoking a row frees its slot.
1791
+ * - `DOMAIN_ROW_LIMIT` (**409**, `register`) — the store already holds
1792
+ * `CUSTOM_DOMAIN_ROW_LIMIT` DOMAIN rows of any status, REVOKED and expired
1793
+ * PENDING included, other than the row of the host being registered.
1794
+ * Body `{ message, error, limit }`, `limit` being `CUSTOM_DOMAIN_ROW_LIMIT`.
1795
+ * Checked before `DOMAIN_SLOT_LIMIT`. Revoking a VERIFIED row does not
1796
+ * clear it (that row is kept); revoking a never-verified claim does
1797
+ * (that row is deleted). Otherwise it needs support, not a retry.
1798
+ * - `DOMAIN_LIMIT_REACHED` (**429**, `register`) — the previous cap's code.
1799
+ * No current writer; a stage one release behind still answers it, with a
1800
+ * `message` and a numeric `limit`, and counted REVOKED rows too.
1730
1801
  * - `DOMAIN_OWNED_BY_OTHER_STORE` (**409**, `register`) — a PENDING or
1731
- * VERIFIED row for this host belongs to a different store.
1802
+ * VERIFIED row for this host belongs to a different store, or the host is
1803
+ * already this store's VERIFIED domain.
1732
1804
  * - `DOMAIN_NOT_CLAIMABLE` (**409**, `register` AND `verify`) — the host is
1733
1805
  * not any single store's: a storefront apex serving many tenants, or a
1734
1806
  * platform origin already on the static CORS allowlist. Permanent for that
@@ -1743,6 +1815,24 @@ declare global {
1743
1815
  * present at all. A consumer switching on `body.error` alone silently misses
1744
1816
  * the verify case and falls through to a generic message.
1745
1817
  */
1746
- type DomainErrorCode = 'DOMAIN_LIMIT_REACHED' | 'DOMAIN_OWNED_BY_OTHER_STORE' | 'DOMAIN_NOT_CLAIMABLE' | 'NOT_OWNER';
1818
+ type DomainErrorCode = 'DOMAIN_SLOT_LIMIT' | 'DOMAIN_ROW_LIMIT'
1819
+ /** @deprecated No writer; answered only by a stage one release behind. Map it like `DOMAIN_SLOT_LIMIT`. */
1820
+ | 'DOMAIN_LIMIT_REACHED' | 'DOMAIN_OWNED_BY_OTHER_STORE' | 'DOMAIN_NOT_CLAIMABLE' | 'NOT_OWNER';
1747
1821
  }
1748
- export {};
1822
+ /**
1823
+ * How many custom-domain rows a store may hold that count: one active domain
1824
+ * and one spare, so a replacement can be verified and provisioned before the
1825
+ * current domain is revoked. `www` and the apex are one row. REVOKED rows and
1826
+ * expired PENDING claims never count. `POST /store/domains { mode: 'register' }`
1827
+ * refuses the next one `409 DOMAIN_SLOT_LIMIT` with this value as `limit`.
1828
+ */
1829
+ export declare const CUSTOM_DOMAIN_SLOT_LIMIT = 2;
1830
+ /**
1831
+ * How many DOMAIN rows a store may hold in total, whatever their status:
1832
+ * REVOKED rows free their `CUSTOM_DOMAIN_SLOT_LIMIT` slot but a
1833
+ * VERIFIED-then-revoked row is kept, so without this ceiling a store cycling
1834
+ * register → verify → revoke over fresh hosts would grow its rows without
1835
+ * bound. `POST /store/domains { mode: 'register' }` refuses the next one
1836
+ * `409 DOMAIN_ROW_LIMIT` with this value as `limit`.
1837
+ */
1838
+ export declare const CUSTOM_DOMAIN_ROW_LIMIT = 10;
package/dist/store.js CHANGED
@@ -1 +1,17 @@
1
- export {};
1
+ /**
2
+ * How many custom-domain rows a store may hold that count: one active domain
3
+ * and one spare, so a replacement can be verified and provisioned before the
4
+ * current domain is revoked. `www` and the apex are one row. REVOKED rows and
5
+ * expired PENDING claims never count. `POST /store/domains { mode: 'register' }`
6
+ * refuses the next one `409 DOMAIN_SLOT_LIMIT` with this value as `limit`.
7
+ */
8
+ export const CUSTOM_DOMAIN_SLOT_LIMIT = 2;
9
+ /**
10
+ * How many DOMAIN rows a store may hold in total, whatever their status:
11
+ * REVOKED rows free their `CUSTOM_DOMAIN_SLOT_LIMIT` slot but a
12
+ * VERIFIED-then-revoked row is kept, so without this ceiling a store cycling
13
+ * register → verify → revoke over fresh hosts would grow its rows without
14
+ * bound. `POST /store/domains { mode: 'register' }` refuses the next one
15
+ * `409 DOMAIN_ROW_LIMIT` with this value as `limit`.
16
+ */
17
+ export const CUSTOM_DOMAIN_ROW_LIMIT = 10;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinfactura-types",
3
- "version": "1.10.642",
3
+ "version": "1.10.643",
4
4
  "description": "Shared wire and entity contracts for the SINFACTURA platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",