platform-types 1.10.682 → 1.10.684

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isStorefrontEditorLiteralKey = exports.STOREFRONT_EDITOR_LITERAL_DEFAULTS = exports.resolveStorefrontLiveSettings = exports.isStorefrontLiveSettingKey = exports.STOREFRONT_LIVE_SETTING_KEYS = exports.STOREFRONT_DESIGN_REGISTRY = exports.resolveStorefrontDesignSettings = exports.resolveStorefrontDesignSettingsLayers = exports.STOREFRONT_DESIGN_LITERAL_MAX_CODE_POINTS = exports.validateStorefrontDesignSetting = exports.validateStorefrontSettingValue = exports.isStorefrontDesignSettingKey = exports.STOREFRONT_DESIGN_SETTINGS = void 0;
3
+ exports.isStorefrontEditorLiteralKey = exports.STOREFRONT_EDITOR_LITERAL_DEFAULTS = exports.resolveStorefrontLiveSettings = exports.isStorefrontLiveSettingKey = exports.STOREFRONT_LIVE_SETTING_KEYS = exports.STOREFRONT_DESIGN_REGISTRY = exports.resolveStorefrontDesignSettings = exports.resolveStorefrontDesignSettingsLayers = exports.STOREFRONT_DESIGN_LITERAL_MAX_CODE_POINTS = exports.validateStorefrontDesignSetting = exports.validateStorefrontSettingValue = exports.isStorefrontDesignSettingKey = exports.STOREFRONT_DESIGN_SETTINGS = exports.STOREFRONT_DEFAULTS_VERSION = void 0;
4
+ exports.STOREFRONT_DEFAULTS_VERSION = '1';
4
5
  const DESIGN_METADATA = {
5
6
  scope: 'storefront',
6
7
  allowedLayers: ['GLOBAL', 'WEB', 'WEB#store'],
package/dist/store.d.ts CHANGED
@@ -484,9 +484,8 @@ declare global {
484
484
  * Response-time join, not a persisted Store attribute — and TWO different
485
485
  * shapes depending on the endpoint: `GET /tenants` (SUPERVISOR) attaches the
486
486
  * compact `StoreRowSubscriptionSummary`; the tenant's own `GET /store`
487
- * embeds a near-`SubscriptionSyncPayload` (today still missing `currency`
488
- * and `freeUntil` — treat both as possibly absent until the api aligns the
489
- * embed). Discriminate structurally (`'entitlements' in subscription`).
487
+ * embeds a near-`SubscriptionSyncPayload`, including `currency` and
488
+ * `freeUntil`. Discriminate structurally (`'entitlements' in subscription`).
490
489
  */
491
490
  subscription?: StoreRowSubscriptionSummary | SubscriptionSyncPayload;
492
491
  config: {
@@ -892,6 +891,13 @@ declare global {
892
891
  * value refetches `GET /store` to see those.
893
892
  */
894
893
  publicStorefront?: PublicStorefront | null;
894
+ /**
895
+ * True once the shop has a published storefront design; legacy presentation fields are then
896
+ * owned by the design editor. Read-time, never stored: sent on app `GET /store` (both views)
897
+ * and `GET /tenants?storeId=`, never on the `GET /tenants` list, echoes or frames. Absent means
898
+ * "not read here", never "not adopted": keep the value from the last of those two reads.
899
+ */
900
+ storefrontAdopted?: boolean;
895
901
  /**
896
902
  * Server-built public contact on web GET /store and customer STORE frames.
897
903
  * Absent means an older API; an empty object means no validated public
@@ -901,6 +907,15 @@ declare global {
901
907
  publicContact?: StorefrontPublicContact;
902
908
  /** Read-only legacy editor seed, available only to the entitled tenant ADMIN. */
903
909
  storefrontEditorBaseline?: StorefrontEditorBaseline;
910
+ /** Public aggregate from the immutable publication and live platform layers. */
911
+ storefrontDesign?: PublicStorefrontDesignResult;
912
+ /**
913
+ * Customer STORE frame hint: re-read the public aggregate; carries no private identity. Set by
914
+ * an adopted shop's frame when the write reached `ecommerce` or `config`, by the frame a fresh
915
+ * publish sends, and by any frame whose publication contact could not be read (that frame
916
+ * carries no contact keys at all).
917
+ */
918
+ storefrontDesignInvalidated?: true;
904
919
  photoURL: string;
905
920
  /** @deprecated Request-only upload control, never persisted or returned — use `StoreUpdateInput.photoData`. */
906
921
  photoData?: string;
@@ -1000,6 +1015,16 @@ declare global {
1000
1015
  */
1001
1016
  requireEmailVerification?: boolean;
1002
1017
  }
1018
+ /**
1019
+ * `data` of a `stores` frame on a CUSTOMER socket — `dynamoUpdate`'s customer fan-out of a
1020
+ * STORE write and the frame a fresh storefront publish sends. The public STORE allow-list,
1021
+ * each value narrowed as web `GET /store` narrows it, plus the contact pair and `storeId`.
1022
+ * Partial by design: a client merges it over its cached store and refetches `GET /store`, so
1023
+ * an absent key means "unchanged", never "cleared".
1024
+ */
1025
+ type StoreCustomerFrameData = {
1026
+ storeId: string;
1027
+ } & Partial<Pick<Store, 'name' | 'photoURL' | 'brands' | 'deliveryMethods' | 'cuit' | 'config' | 'currencies' | 'address' | 'categories' | 'paymentMethods' | 'ecommerce' | 'email' | 'phone' | 'publicContact' | 'storefrontDesignInvalidated'>>;
1003
1028
  interface StoreIntegrations {
1004
1029
  afip?: Afip;
1005
1030
  mercadopago?: Mercadopago;
@@ -1,3 +1,4 @@
1
+ import type { StorefrontThemeWarning } from './storefrontTheme.ts';
1
2
  export declare const STOREFRONT_DESIGN_LIMITS: {
2
3
  readonly customPages: 20;
3
4
  readonly sectionsPerPage: 10;
@@ -66,14 +67,20 @@ declare global {
66
67
  type StorefrontDesignProductSource = {
67
68
  kind: 'offers' | 'new';
68
69
  } | {
69
- kind: 'category' | 'brand' | 'collection';
70
+ kind: 'category' | 'brand';
71
+ id: string;
72
+ } | {
73
+ kind: 'collection';
70
74
  id: string;
71
75
  };
72
76
  type StorefrontDesignLinkTarget = {
73
77
  kind: 'builtin';
74
78
  id: (typeof STOREFRONT_BUILTIN_DESTINATIONS)[number];
75
79
  } | {
76
- kind: 'page' | 'category' | 'brand' | 'collection';
80
+ kind: 'page' | 'category' | 'brand';
81
+ id: string;
82
+ } | {
83
+ kind: 'collection';
77
84
  id: string;
78
85
  } | {
79
86
  kind: 'external';
@@ -254,6 +261,37 @@ declare global {
254
261
  type StorefrontDesignPublic = Omit<StorefrontDesignV1, 'contact'> & {
255
262
  contact: StorefrontPublicContact;
256
263
  };
264
+ /**
265
+ * Image placements gain `url`/`mobileUrl`: the variant-LESS base
266
+ * `/sf-media/{stage}/{storeId}/{publicationId}/{assetId}`, a path on the images host. Append
267
+ * `/${StorefrontAssetVariant}` (one of `STOREFRONT_ASSET_VARIANTS`) to request it; the base
268
+ * alone is not servable. Never route it through `/fit-in/`: the media path is refused there.
269
+ */
270
+ type PublicStorefrontDesignValue<T> = T extends StorefrontDesignImagePlacement ? T & {
271
+ url: string;
272
+ mobileUrl?: string;
273
+ } : T extends {
274
+ kind: 'collection';
275
+ id: string;
276
+ } ? T & {
277
+ slug: string;
278
+ } : T extends readonly (infer V)[] ? PublicStorefrontDesignValue<V>[] : T extends object ? {
279
+ [K in keyof T]: PublicStorefrontDesignValue<T[K]>;
280
+ } : T;
281
+ type PublicStorefrontDesign = PublicStorefrontDesignValue<Omit<StorefrontDesignPublic, 'literalOverrides'>>;
282
+ type PublicStorefrontDesignResult = {
283
+ mode: 'legacy';
284
+ } | {
285
+ mode: 'published';
286
+ publicationId: string;
287
+ document: PublicStorefrontDesign;
288
+ literalLayers: {
289
+ scope: LiteralScope;
290
+ literals: Record<string, string>;
291
+ }[];
292
+ effectiveSettings: StorefrontDesignSettings;
293
+ defaultsVersion: string;
294
+ };
257
295
  interface StorefrontDesignV1 {
258
296
  schemaVersion: 1;
259
297
  templateId: 'standard';
@@ -274,13 +312,16 @@ declare global {
274
312
  path: string;
275
313
  code: StorefrontDesignFieldErrorCode;
276
314
  }
277
- type StorefrontDesignErrorCode = 'STOREFRONT_DESIGN_INVALID' | 'STOREFRONT_SCHEMA_UNSUPPORTED' | 'STOREFRONT_REVISION_CONFLICT' | 'STOREFRONT_DRAFT_NOT_INITIALIZED' | 'STOREFRONT_REQUEST_EXPIRED' | 'STOREFRONT_PUBLICATION_NOT_FOUND' | 'STOREFRONT_DRAFT_UNAVAILABLE' | 'IDEMPOTENCY_CONFLICT' | 'STOREFRONT_EDITOR_REQUIRED' | 'STOREFRONT_ASSET_NOT_READY' | 'STOREFRONT_PREVIEW_EXPIRED' | 'STOREFRONT_PREVIEW_REVOKED' | 'STOREFRONT_PREVIEW_FORBIDDEN';
315
+ type StorefrontDesignErrorCode = 'STOREFRONT_DESIGN_INVALID' | 'STOREFRONT_SCHEMA_UNSUPPORTED' | 'STOREFRONT_REVISION_CONFLICT' | 'STOREFRONT_DRAFT_NOT_INITIALIZED' | 'STOREFRONT_REQUEST_EXPIRED' | 'STOREFRONT_PUBLICATION_NOT_FOUND'
316
+ /** Web `GET /store` and `GET /literals` `503`: the stored publication cannot be served; retry later. */
317
+ | 'STOREFRONT_PUBLICATION_UNAVAILABLE' | 'STOREFRONT_OPERATION_NOT_FOUND' | 'STOREFRONT_DRAFT_UNAVAILABLE' | 'IDEMPOTENCY_CONFLICT' | 'STOREFRONT_EDITOR_REQUIRED' | 'STOREFRONT_ASSET_NOT_READY' | 'STOREFRONT_PREVIEW_EXPIRED' | 'STOREFRONT_PREVIEW_REVOKED' | 'STOREFRONT_PREVIEW_FORBIDDEN';
278
318
  interface StorefrontDesignMappingConflict {
279
319
  path: string;
280
320
  code: 'LEGACY_MULTIPLE_PRODUCT_FEEDS' | 'LEGACY_UNMAPPED_CONTENT';
281
321
  sources?: StorefrontDesignProductSource[];
282
322
  }
283
323
  interface StorefrontEditorBaseline {
324
+ legacyRevision?: number;
284
325
  document: StorefrontDesignV1;
285
326
  mappingConflicts: StorefrontDesignMappingConflict[];
286
327
  legacySourceRevision: string;
@@ -352,11 +393,19 @@ declare global {
352
393
  legacySourceRevision: string;
353
394
  }
354
395
  interface StorefrontDesignDeliveryTarget {
396
+ /**
397
+ * Opaque per-target key, stable for one publication (`platform`, `customDomain-1`, …).
398
+ * Never a provider or CDN id; clients may only compare it, never parse it.
399
+ */
355
400
  targetId: string;
356
401
  state: 'pending' | 'retrying' | 'completed' | 'notProvisioned';
357
- providerOperationId?: string;
358
402
  }
403
+ type StorefrontDesignPublishOperationResult = StorefrontDesignPublishResult;
404
+ type StorefrontDesignPublishOperationResponse = StorefrontDesignPublishResponse;
359
405
  interface StorefrontDesignPublishResult {
406
+ changeSummary: {
407
+ contrastAdjustments: StorefrontThemeWarning[];
408
+ };
360
409
  publicationId: string;
361
410
  committedRevision: string;
362
411
  draftRevision: string;
@@ -1,3 +1,4 @@
1
+ export declare const STOREFRONT_DEFAULTS_VERSION = "1";
1
2
  export type StorefrontResolutionLayer = 'GLOBAL' | 'WEB' | 'WEB#store';
2
3
  export type StorefrontRegistryAudience = 'internal' | 'app' | 'public';
3
4
  export type StorefrontRegistryLifecycle = 'live' | 'release-owned';
@@ -1,3 +1,4 @@
1
+ export const STOREFRONT_DEFAULTS_VERSION = '1';
1
2
  const DESIGN_METADATA = {
2
3
  scope: 'storefront',
3
4
  allowedLayers: ['GLOBAL', 'WEB', 'WEB#store'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "platform-types",
3
- "version": "1.10.682",
3
+ "version": "1.10.684",
4
4
  "description": "Shared wire and entity contracts for the platform.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",