platform-types 1.10.806 → 1.10.808
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/cjs/product.js +7 -1
- package/dist/cjs/store.js +2 -0
- package/dist/product.d.ts +45 -0
- package/dist/product.js +6 -0
- package/dist/store.d.ts +32 -3
- package/dist/store.js +2 -0
- package/dist/storefrontDesign.d.ts +2 -0
- package/package.json +1 -1
package/dist/cjs/product.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PRODUCT_MEDIA_INVALID_REASONS = exports.MAX_PRODUCT_PICTURE_ALT_CHARS = exports.PRODUCT_UPSERT_ERROR_CODES = exports.PRODUCT_UPSERT_ROW_ERROR_CODES = exports.PRODUCT_UPSERT_ROW_CAP = exports.PUBLIC_PRODUCT_SUGGEST_ERROR_CODES = exports.PUBLIC_PRODUCT_BY_SLUG_ERROR_CODES = exports.PRODUCT_PUBLISH_OVERDUE_AFTER_MS = exports.PRODUCT_PUBLISH_AT_MAX_AHEAD_MS = exports.PRODUCT_POST_ERROR_CODES = exports.PRODUCT_IDENTITY_ERROR_CODES = exports.PRODUCT_EXPORT_ERROR_CODES = exports.PRODUCT_CATALOG_EXPORT_COLUMNS = exports.RECENT_PURCHASES_MAX = exports.BEST_SELLERS_MAX = exports.DISCOVERY_SORTS = exports.MAX_BASE_QUANTITY = exports.BASE_QUANTITY_DECIMAL_PLACES = void 0;
|
|
3
|
+
exports.PRODUCT_MEDIA_INVALID_REASONS = exports.MAX_PRODUCT_PICTURE_ALT_CHARS = exports.PRODUCT_UPSERT_ERROR_CODES = exports.PRODUCT_UPSERT_ROW_ERROR_CODES = exports.PRODUCT_UPSERT_ROW_CAP = exports.PUBLIC_PRODUCT_SUGGEST_ERROR_CODES = exports.PUBLIC_PRODUCT_BY_SLUG_ERROR_CODES = exports.PRODUCT_PUBLISH_OVERDUE_AFTER_MS = exports.PRODUCT_PUBLISH_AT_MAX_AHEAD_MS = exports.PRODUCT_POST_ERROR_CODES = exports.PRODUCT_IDENTITY_ERROR_CODES = exports.PRODUCT_EXPORT_ERROR_CODES = exports.PRODUCT_CATALOG_EXPORT_COLUMNS = exports.RECENT_PURCHASES_MAX = exports.BEST_SELLERS_MAX = exports.DISCOVERY_FACETS = exports.DISCOVERY_SORTS = exports.MAX_BASE_QUANTITY = exports.BASE_QUANTITY_DECIMAL_PLACES = void 0;
|
|
4
4
|
/** Maximum decimal places in a canonical base quantity; inputs are exact, never rounded. */
|
|
5
5
|
exports.BASE_QUANTITY_DECIMAL_PLACES = 6;
|
|
6
6
|
/** Absolute base-quantity input bound; signed adjustments admit the negative of this value. */
|
|
@@ -11,6 +11,12 @@ exports.MAX_BASE_QUANTITY = 1_000_000;
|
|
|
11
11
|
* order them inside one bounded request).
|
|
12
12
|
*/
|
|
13
13
|
exports.DISCOVERY_SORTS = ['newest'];
|
|
14
|
+
/**
|
|
15
|
+
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
16
|
+
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
|
|
17
|
+
* (the filter matches no descendants, so a rolled-up parent would select nothing).
|
|
18
|
+
*/
|
|
19
|
+
exports.DISCOVERY_FACETS = ['brand', 'tag', 'category'];
|
|
14
20
|
/** Most products the store's best-seller ranking holds, and web `mode=best-sellers` returns. */
|
|
15
21
|
exports.BEST_SELLERS_MAX = 50;
|
|
16
22
|
/** Most distinct products a buyer's recent-purchases row holds, and web `mode=recently-bought` returns. */
|
package/dist/cjs/store.js
CHANGED
package/dist/product.d.ts
CHANGED
|
@@ -9,6 +9,13 @@ export declare const MAX_BASE_QUANTITY = 1000000;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const DISCOVERY_SORTS: readonly ["newest"];
|
|
11
11
|
export type DiscoverySort = (typeof DISCOVERY_SORTS)[number];
|
|
12
|
+
/**
|
|
13
|
+
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
14
|
+
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
|
|
15
|
+
* (the filter matches no descendants, so a rolled-up parent would select nothing).
|
|
16
|
+
*/
|
|
17
|
+
export declare const DISCOVERY_FACETS: readonly ["brand", "tag", "category"];
|
|
18
|
+
export type DiscoveryFacet = (typeof DISCOVERY_FACETS)[number];
|
|
12
19
|
/** Most products the store's best-seller ranking holds, and web `mode=best-sellers` returns. */
|
|
13
20
|
export declare const BEST_SELLERS_MAX = 50;
|
|
14
21
|
/** Most distinct products a buyer's recent-purchases row holds, and web `mode=recently-bought` returns. */
|
|
@@ -281,6 +288,38 @@ declare global {
|
|
|
281
288
|
sort?: string;
|
|
282
289
|
/** The previous response's `LastEvaluatedKey`, under the SAME filters and sort; else 400 INVALID_CURSOR. */
|
|
283
290
|
startKey?: string;
|
|
291
|
+
/**
|
|
292
|
+
* Comma-separated `DISCOVERY_FACETS` members to count. Unknown members are
|
|
293
|
+
* ignored; a value outside `^[\w,-]{1,128}$` is 400 `INVALID_DISCOVERY_QUERY`.
|
|
294
|
+
* Honoured only on a first page (no `startKey`), ignored after it. Never bound
|
|
295
|
+
* into the cursor.
|
|
296
|
+
*/
|
|
297
|
+
facets?: string;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* One facet value: applied as its filter with the other current filters, it returns at
|
|
301
|
+
* least `count` rows across the walk — exactly `count` unless the facets are `truncated`.
|
|
302
|
+
*/
|
|
303
|
+
interface DiscoveryFacetValue {
|
|
304
|
+
id: string;
|
|
305
|
+
count: number;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* The values each requested facet can take under the current query, count
|
|
309
|
+
* descending. Disjunctive: a facet is counted with every other filter applied
|
|
310
|
+
* but not its own, so the picked brand still lists its sibling brands. A
|
|
311
|
+
* facet absent from the request is absent here.
|
|
312
|
+
*/
|
|
313
|
+
interface DiscoveryFacets {
|
|
314
|
+
brand?: DiscoveryFacetValue[];
|
|
315
|
+
tag?: DiscoveryFacetValue[];
|
|
316
|
+
category?: DiscoveryFacetValue[];
|
|
317
|
+
/**
|
|
318
|
+
* The count walk hit its read budget before the catalogue ended: every
|
|
319
|
+
* listed value still returns rows, but counts are lower bounds and a value
|
|
320
|
+
* may be missing — fall back to the store-wide list for anything unlisted.
|
|
321
|
+
*/
|
|
322
|
+
truncated?: true;
|
|
284
323
|
}
|
|
285
324
|
/** One page of a discovery walk; `data` can be empty while `LastEvaluatedKey` is set. */
|
|
286
325
|
interface PublicProductDiscoverResponse {
|
|
@@ -291,6 +330,12 @@ declare global {
|
|
|
291
330
|
sort?: (typeof DISCOVERY_SORTS)[number];
|
|
292
331
|
/** Present while rows remain; absent means the walk is complete. */
|
|
293
332
|
LastEvaluatedKey?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Only on a first page whose request named a known facet. Also absent when the
|
|
335
|
+
* count failed (the rows still answer) — read absence as "fall back to the
|
|
336
|
+
* store-wide lists", never as "no values".
|
|
337
|
+
*/
|
|
338
|
+
facets?: DiscoveryFacets;
|
|
294
339
|
}
|
|
295
340
|
/**
|
|
296
341
|
* Web `GET /products?mode=best-sellers` and `mode=recently-bought`: at most 50 rows, no cursor,
|
package/dist/product.js
CHANGED
|
@@ -8,6 +8,12 @@ export const MAX_BASE_QUANTITY = 1_000_000;
|
|
|
8
8
|
* order them inside one bounded request).
|
|
9
9
|
*/
|
|
10
10
|
export const DISCOVERY_SORTS = ['newest'];
|
|
11
|
+
/**
|
|
12
|
+
* The facets Web `GET /products?mode=discover` can count (`facets=brand,tag,category`).
|
|
13
|
+
* `brand` tallies `brandId`, `tag` each of `tagIds`, `category` the EXACT `categoryId`
|
|
14
|
+
* (the filter matches no descendants, so a rolled-up parent would select nothing).
|
|
15
|
+
*/
|
|
16
|
+
export const DISCOVERY_FACETS = ['brand', 'tag', 'category'];
|
|
11
17
|
/** Most products the store's best-seller ranking holds, and web `mode=best-sellers` returns. */
|
|
12
18
|
export const BEST_SELLERS_MAX = 50;
|
|
13
19
|
/** Most distinct products a buyer's recent-purchases row holds, and web `mode=recently-bought` returns. */
|
package/dist/store.d.ts
CHANGED
|
@@ -528,8 +528,8 @@ declare global {
|
|
|
528
528
|
/** Unix ms — when the retired label's redirect ends (its reservation end). */
|
|
529
529
|
redirectUntil?: number;
|
|
530
530
|
}
|
|
531
|
-
/** An identity or
|
|
532
|
-
type StorePublicLegalMissing = 'razonSocial' | 'fiscalAddress' | 'email' | 'phone' | 'withdrawalChannel';
|
|
531
|
+
/** An identity, withdrawal or Data Fiscal fact {@link StorePublicLegal} could not resolve; the storefront warns or degrades on it. */
|
|
532
|
+
type StorePublicLegalMissing = 'razonSocial' | 'fiscalAddress' | 'email' | 'phone' | 'withdrawalChannel' | 'dataFiscal';
|
|
533
533
|
/**
|
|
534
534
|
* The consumer-law facts a storefront renders: the merchant identity disclosure, the
|
|
535
535
|
* Botón de Arrepentimiento and the privacy-text variants. Built by the api at read time
|
|
@@ -572,6 +572,16 @@ declare global {
|
|
|
572
572
|
/** `['mercadopago']` while any `paymentMethods` row is `storefront: 'mp-checkout-pro'`, whatever its audience rule; else `[]`. */
|
|
573
573
|
onlinePayment: Array<'mercadopago'>;
|
|
574
574
|
};
|
|
575
|
+
/**
|
|
576
|
+
* The shop's Formulario 960/D (Data Fiscal) link, from `integrations.afip.dataFiscal`.
|
|
577
|
+
* Absent when none is recorded, and `missing` then names `dataFiscal`.
|
|
578
|
+
* `matchesCurrentDomain` is `false` once the shop's public host is no longer the one the
|
|
579
|
+
* link was recorded for (RG 1415 art. 25 asks for a new form after a domain change).
|
|
580
|
+
*/
|
|
581
|
+
dataFiscal?: {
|
|
582
|
+
url: string;
|
|
583
|
+
matchesCurrentDomain: boolean;
|
|
584
|
+
};
|
|
575
585
|
missing: StorePublicLegalMissing[];
|
|
576
586
|
}
|
|
577
587
|
interface Store {
|
|
@@ -1780,6 +1790,21 @@ declare global {
|
|
|
1780
1790
|
* clears it back to the default.
|
|
1781
1791
|
*/
|
|
1782
1792
|
freight?: AfipFreightFiscal;
|
|
1793
|
+
/**
|
|
1794
|
+
* The shop's Formulario 960/D (Data Fiscal) link (RG 1415 art. 25). ADMIN-tier on
|
|
1795
|
+
* `PATCH /store`, which takes `{ url }` only: `url` is `https:` on an ARCA host
|
|
1796
|
+
* (`afip.gob.ar` or `arca.gob.ar`, subdomains included), and `domain` is STAMPED by the
|
|
1797
|
+
* api with the shop's public host at write time, never taken from the body. `null`
|
|
1798
|
+
* clears it. Published as `StorePublicLegal.dataFiscal`.
|
|
1799
|
+
*/
|
|
1800
|
+
dataFiscal?: AfipDataFiscal;
|
|
1801
|
+
}
|
|
1802
|
+
/** {@link Afip.dataFiscal}: the link as recorded and the public host it was recorded for. */
|
|
1803
|
+
interface AfipDataFiscal {
|
|
1804
|
+
/** `https:` on `afip.gob.ar` / `arca.gob.ar` or a subdomain, normalised by the URL parser. */
|
|
1805
|
+
url: string;
|
|
1806
|
+
/** The shop's canonical public host when the link was written — bare host, no scheme. */
|
|
1807
|
+
domain: string;
|
|
1783
1808
|
}
|
|
1784
1809
|
/**
|
|
1785
1810
|
* Write shape for the `afip` key of `PATCH /store`'s body. The wire accepts an
|
|
@@ -1795,6 +1820,10 @@ declare global {
|
|
|
1795
1820
|
iibbJurisdictions?: IibbJurisdictionConfig[] | null;
|
|
1796
1821
|
actividades?: number[] | null;
|
|
1797
1822
|
freight?: AfipFreightFiscal | null;
|
|
1823
|
+
/** The link alone — the api stamps `domain` with the shop's public host and refuses one sent. */
|
|
1824
|
+
dataFiscal?: {
|
|
1825
|
+
url: string;
|
|
1826
|
+
} | null;
|
|
1798
1827
|
}
|
|
1799
1828
|
/**
|
|
1800
1829
|
* Write shape for the `config` key of `PATCH /store`'s body. Two things the
|
|
@@ -2591,5 +2620,5 @@ export type StoreModuleRefusalBody = {
|
|
|
2591
2620
|
* checks, the display-currency lock, the storefront fence) are not listed
|
|
2592
2621
|
* either. Cross-cutting refusals: check `GATING_ERROR_CODES` as well.
|
|
2593
2622
|
*/
|
|
2594
|
-
export declare const STORE_PATCH_ERROR_CODES: readonly ["STORE_CONFIG_FORBIDDEN", "STORE_ECOMMERCE_FORBIDDEN", "STORE_FISCAL_FIELD_FORBIDDEN", "STORE_JURISDICTION_FORBIDDEN", "AFIP_RELACION_FLAG_FORBIDDEN", "FX_TABLE_FORBIDDEN", "FX_AUTO_UPDATE_FORBIDDEN", "FIELD_NOT_WRITABLE_HERE", "AFIP_POINT_OF_SALE_NOT_CLEARABLE", "CURRENCY_CATALOG_ID_UNKNOWN", "ARS_RATE_MUST_BE_ONE", "CURRENCY_RATE_ABOVE_CEILING", "FX_CATALOG_ID_UNKNOWN", "FX_SOURCE_ID_UNKNOWN", "DISPLAY_CURRENCY_NOT_INVOICEABLE", "PRODUCT_CURRENCY_NOT_INVOICEABLE", "PRICE_LIST_NOT_FOUND", "DELIVERY_FEE_INVALID", "WHOLESALE_LIST_REQUIRED", "FORBIDDEN", "STORE_NOT_FOUND"];
|
|
2623
|
+
export declare const STORE_PATCH_ERROR_CODES: readonly ["STORE_CONFIG_FORBIDDEN", "STORE_ECOMMERCE_FORBIDDEN", "STORE_FISCAL_FIELD_FORBIDDEN", "STORE_JURISDICTION_FORBIDDEN", "AFIP_RELACION_FLAG_FORBIDDEN", "FX_TABLE_FORBIDDEN", "FX_AUTO_UPDATE_FORBIDDEN", "FIELD_NOT_WRITABLE_HERE", "AFIP_POINT_OF_SALE_NOT_CLEARABLE", "CURRENCY_CATALOG_ID_UNKNOWN", "ARS_RATE_MUST_BE_ONE", "CURRENCY_RATE_ABOVE_CEILING", "FX_CATALOG_ID_UNKNOWN", "FX_SOURCE_ID_UNKNOWN", "DISPLAY_CURRENCY_NOT_INVOICEABLE", "PRODUCT_CURRENCY_NOT_INVOICEABLE", "PRICE_LIST_NOT_FOUND", "DELIVERY_FEE_INVALID", "WHOLESALE_LIST_REQUIRED", "DATA_FISCAL_URL_INVALID", "STORE_PUBLIC_HOST_MISSING", "FORBIDDEN", "STORE_NOT_FOUND"];
|
|
2595
2624
|
export type StorePatchErrorCode = (typeof STORE_PATCH_ERROR_CODES)[number];
|
package/dist/store.js
CHANGED
|
@@ -762,6 +762,8 @@ declare global {
|
|
|
762
762
|
/** Web `mode=discover`'s `sort`; an unserved one answers 400 `DISCOVERY_SORT_UNSUPPORTED`. */
|
|
763
763
|
sort?: DiscoverySort;
|
|
764
764
|
startKey?: string;
|
|
765
|
+
/** Web `mode=discover`'s `facets`: counted on a first page only, answered as `facets`. */
|
|
766
|
+
facets?: string;
|
|
765
767
|
}
|
|
766
768
|
/**
|
|
767
769
|
* Web `GET /products?updatedAt=`'s recency listing (the shop's «Ingresos» page), with the
|