@40rty/ams-sdk 0.5.25 → 0.5.27
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/index.js +80 -23
- package/dist/types/ecommerce/src/commerce-schemas.d.ts +83 -22
- package/dist/types/ecommerce/src/index.d.ts +1 -0
- package/dist/types/ecommerce/src/review-schemas.d.ts +20 -20
- package/dist/types/ecommerce/src/seller-profile.d.ts +35 -0
- package/dist/types/sdk/src/host/host-modules.d.ts +108 -42
- package/dist/types/sdk/src/verticals/commerce/commerce-context.d.ts +7 -2
- package/dist/types/sdk/src/verticals/commerce/commerce-shapes.d.ts +1 -31
- package/dist/types/sdk/src/verticals/commerce/index.d.ts +2 -2
- package/dist/types/sdk/src/verticals/commerce/store-shapes.d.ts +48 -0
- package/dist/types/spacestation/src/board/board.d.ts +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -391,6 +391,7 @@ __export(src_exports3, {
|
|
|
391
391
|
clearProductFieldReaders: () => clearProductFieldReaders,
|
|
392
392
|
clearProductNameLookups: () => clearProductNameLookups,
|
|
393
393
|
clearProductSectionReaders: () => clearProductSectionReaders,
|
|
394
|
+
clearSellerProfileLookups: () => clearSellerProfileLookups,
|
|
394
395
|
clearShopCheckouts: () => clearShopCheckouts,
|
|
395
396
|
clearStoreArticleLookups: () => clearStoreArticleLookups,
|
|
396
397
|
clearStoreThemeSources: () => clearStoreThemeSources,
|
|
@@ -560,6 +561,7 @@ __export(src_exports3, {
|
|
|
560
561
|
registerProductFieldSource: () => registerProductFieldSource,
|
|
561
562
|
registerProductNameLookup: () => registerProductNameLookup,
|
|
562
563
|
registerProductSectionReader: () => registerProductSectionReader,
|
|
564
|
+
registerSellerProfileLookup: () => registerSellerProfileLookup,
|
|
563
565
|
registerServiceHydrators: () => registerServiceHydrators,
|
|
564
566
|
registerSessionScopedClear: () => registerSessionScopedClear,
|
|
565
567
|
registerShopCheckout: () => registerShopCheckout,
|
|
@@ -589,6 +591,7 @@ __export(src_exports3, {
|
|
|
589
591
|
resolveProductSectionReader: () => resolveProductSectionReader,
|
|
590
592
|
resolveProductVariant: () => resolveProductVariant,
|
|
591
593
|
resolveScope: () => resolveScope,
|
|
594
|
+
resolveSellerProfileLookup: () => resolveSellerProfileLookup,
|
|
592
595
|
resolveServiceHydrators: () => resolveServiceHydrators,
|
|
593
596
|
resolveShopCheckout: () => resolveShopCheckout,
|
|
594
597
|
resolveStanding: () => resolveStanding,
|
|
@@ -780,6 +783,7 @@ __export(src_exports3, {
|
|
|
780
783
|
useScrollHasMoreBelow: () => useScrollHasMoreBelow,
|
|
781
784
|
useSeedLayout: () => useSeedLayout,
|
|
782
785
|
useSelectMessage: () => useSelectMessage,
|
|
786
|
+
useSellerProfile: () => useSellerProfile,
|
|
783
787
|
useSessionId: () => useSessionId,
|
|
784
788
|
useSessionMessages: () => useSessionMessages,
|
|
785
789
|
useSessionState: () => useSessionState,
|
|
@@ -5223,7 +5227,9 @@ var BoardEditSchema = z45.discriminatedUnion("op", [
|
|
|
5223
5227
|
z45.object({ op: z45.literal("fact.set"), label, value }),
|
|
5224
5228
|
z45.object({ op: z45.literal("fact.clear"), label }),
|
|
5225
5229
|
z45.object({ op: z45.literal("item.add"), ref }),
|
|
5226
|
-
z45.object({ op: z45.literal("item.remove"), ref })
|
|
5230
|
+
z45.object({ op: z45.literal("item.remove"), ref }),
|
|
5231
|
+
/** What the member is called on the board: every entry they added, and the member list, show it. */
|
|
5232
|
+
z45.object({ op: z45.literal("name.set"), name: z45.string().trim().min(1).max(BOARD_NAME_MAX) })
|
|
5227
5233
|
]);
|
|
5228
5234
|
var BoardShareSchema = z45.object({
|
|
5229
5235
|
title: z45.string().trim().max(BOARD_TITLE_MAX),
|
|
@@ -5251,6 +5257,13 @@ function previewBoardEdit(board, edit, now) {
|
|
|
5251
5257
|
return board.items.some((i) => i.ref === edit.ref) ? board : { ...board, items: [...board.items, { ref: edit.ref, by, mine: true, at: now }] };
|
|
5252
5258
|
case "item.remove":
|
|
5253
5259
|
return { ...board, items: board.items.filter((i) => i.ref !== edit.ref) };
|
|
5260
|
+
case "name.set":
|
|
5261
|
+
return {
|
|
5262
|
+
...board,
|
|
5263
|
+
members: board.members.map((m) => m.you ? { ...m, name: edit.name } : m),
|
|
5264
|
+
facts: board.facts.map((f) => f.mine ? { ...f, by: edit.name } : f),
|
|
5265
|
+
items: board.items.map((i) => i.mine ? { ...i, by: edit.name } : i)
|
|
5266
|
+
};
|
|
5254
5267
|
}
|
|
5255
5268
|
}
|
|
5256
5269
|
|
|
@@ -5380,6 +5393,7 @@ __export(src_exports2, {
|
|
|
5380
5393
|
clearProductFieldReaders: () => clearProductFieldReaders,
|
|
5381
5394
|
clearProductNameLookups: () => clearProductNameLookups,
|
|
5382
5395
|
clearProductSectionReaders: () => clearProductSectionReaders,
|
|
5396
|
+
clearSellerProfileLookups: () => clearSellerProfileLookups,
|
|
5383
5397
|
clearShopCheckouts: () => clearShopCheckouts,
|
|
5384
5398
|
clearStoreArticleLookups: () => clearStoreArticleLookups,
|
|
5385
5399
|
clearStoreThemeSources: () => clearStoreThemeSources,
|
|
@@ -5411,6 +5425,7 @@ __export(src_exports2, {
|
|
|
5411
5425
|
registerProductFieldSource: () => registerProductFieldSource,
|
|
5412
5426
|
registerProductNameLookup: () => registerProductNameLookup,
|
|
5413
5427
|
registerProductSectionReader: () => registerProductSectionReader,
|
|
5428
|
+
registerSellerProfileLookup: () => registerSellerProfileLookup,
|
|
5414
5429
|
registerShopCheckout: () => registerShopCheckout,
|
|
5415
5430
|
registerStoreArticleLookup: () => registerStoreArticleLookup,
|
|
5416
5431
|
registerStoreThemeSource: () => registerStoreThemeSource,
|
|
@@ -5421,6 +5436,7 @@ __export(src_exports2, {
|
|
|
5421
5436
|
resolveProductFieldSource: () => resolveProductFieldSource,
|
|
5422
5437
|
resolveProductNameLookup: () => resolveProductNameLookup,
|
|
5423
5438
|
resolveProductSectionReader: () => resolveProductSectionReader,
|
|
5439
|
+
resolveSellerProfileLookup: () => resolveSellerProfileLookup,
|
|
5424
5440
|
resolveShopCheckout: () => resolveShopCheckout,
|
|
5425
5441
|
resolveStoreArticleLookup: () => resolveStoreArticleLookup,
|
|
5426
5442
|
resolveStoreThemeSource: () => resolveStoreThemeSource,
|
|
@@ -5586,7 +5602,23 @@ var ProductSchema = z46.object({
|
|
|
5586
5602
|
* Set exclusively by `createUnavailableProduct()` — never by the
|
|
5587
5603
|
* Storefront mapper.
|
|
5588
5604
|
*/
|
|
5589
|
-
unavailable: z46.boolean().default(false)
|
|
5605
|
+
unavailable: z46.boolean().default(false),
|
|
5606
|
+
/**
|
|
5607
|
+
* Who sells it, as a marketplace or cross-store catalog names them: the store's name, its own storefront, and its
|
|
5608
|
+
* policies (returns, shipping, privacy, terms), each a link. Absent for a single store's own products — the space IS
|
|
5609
|
+
* the seller there.
|
|
5610
|
+
*/
|
|
5611
|
+
seller: z46.object({
|
|
5612
|
+
name: z46.string(),
|
|
5613
|
+
url: z46.string().optional(),
|
|
5614
|
+
policies: z46.array(z46.object({ kind: z46.string(), url: z46.string() })).default([])
|
|
5615
|
+
}).optional(),
|
|
5616
|
+
/** What the product is known for, in the seller's or catalog's own words (top features, selling points). */
|
|
5617
|
+
highlights: z46.array(z46.string()).optional(),
|
|
5618
|
+
/** Its specifications, one line each. */
|
|
5619
|
+
specs: z46.array(z46.string()).optional(),
|
|
5620
|
+
/** The product's own page on the seller's site. */
|
|
5621
|
+
productUrl: z46.string().optional()
|
|
5590
5622
|
});
|
|
5591
5623
|
function createUnavailableProduct(gid) {
|
|
5592
5624
|
return {
|
|
@@ -6280,68 +6312,84 @@ function clearStoreArticleLookups() {
|
|
|
6280
6312
|
factories4.length = 0;
|
|
6281
6313
|
}
|
|
6282
6314
|
|
|
6283
|
-
// ../ecommerce/src/
|
|
6315
|
+
// ../ecommerce/src/seller-profile.ts
|
|
6284
6316
|
var factories5 = [];
|
|
6285
|
-
function
|
|
6317
|
+
function registerSellerProfileLookup(factory) {
|
|
6286
6318
|
factories5.push(factory);
|
|
6287
6319
|
}
|
|
6288
|
-
function
|
|
6320
|
+
function resolveSellerProfileLookup(platformConfig) {
|
|
6289
6321
|
for (const factory of factories5) {
|
|
6322
|
+
const lookup = factory(platformConfig);
|
|
6323
|
+
if (lookup !== void 0) return lookup;
|
|
6324
|
+
}
|
|
6325
|
+
return void 0;
|
|
6326
|
+
}
|
|
6327
|
+
function clearSellerProfileLookups() {
|
|
6328
|
+
factories5.length = 0;
|
|
6329
|
+
}
|
|
6330
|
+
|
|
6331
|
+
// ../ecommerce/src/catalog-search.ts
|
|
6332
|
+
var factories6 = [];
|
|
6333
|
+
function registerCatalogSearch(factory) {
|
|
6334
|
+
factories6.push(factory);
|
|
6335
|
+
}
|
|
6336
|
+
function resolveCatalogSearch(platformConfig) {
|
|
6337
|
+
for (const factory of factories6) {
|
|
6290
6338
|
const search = factory(platformConfig);
|
|
6291
6339
|
if (search !== void 0) return search;
|
|
6292
6340
|
}
|
|
6293
6341
|
return void 0;
|
|
6294
6342
|
}
|
|
6295
6343
|
function clearCatalogSearches() {
|
|
6296
|
-
|
|
6344
|
+
factories6.length = 0;
|
|
6297
6345
|
}
|
|
6298
6346
|
|
|
6299
6347
|
// ../ecommerce/src/shop-checkout.ts
|
|
6300
|
-
var
|
|
6348
|
+
var factories7 = [];
|
|
6301
6349
|
function registerShopCheckout(factory) {
|
|
6302
|
-
|
|
6350
|
+
factories7.push(factory);
|
|
6303
6351
|
}
|
|
6304
6352
|
function resolveShopCheckout(platformConfig) {
|
|
6305
|
-
for (const factory of
|
|
6353
|
+
for (const factory of factories7) {
|
|
6306
6354
|
const maker = factory(platformConfig);
|
|
6307
6355
|
if (maker !== void 0) return maker;
|
|
6308
6356
|
}
|
|
6309
6357
|
return void 0;
|
|
6310
6358
|
}
|
|
6311
6359
|
function clearShopCheckouts() {
|
|
6312
|
-
|
|
6360
|
+
factories7.length = 0;
|
|
6313
6361
|
}
|
|
6314
6362
|
|
|
6315
6363
|
// ../ecommerce/src/buyer-sign-in.ts
|
|
6316
|
-
var
|
|
6364
|
+
var factories8 = [];
|
|
6317
6365
|
function registerBuyerSignIn(factory) {
|
|
6318
|
-
|
|
6366
|
+
factories8.push(factory);
|
|
6319
6367
|
}
|
|
6320
6368
|
function resolveBuyerSignIn(platformConfig) {
|
|
6321
|
-
for (const factory of
|
|
6369
|
+
for (const factory of factories8) {
|
|
6322
6370
|
const provider = factory(platformConfig);
|
|
6323
6371
|
if (provider !== void 0) return provider;
|
|
6324
6372
|
}
|
|
6325
6373
|
return void 0;
|
|
6326
6374
|
}
|
|
6327
6375
|
function clearBuyerSignIns() {
|
|
6328
|
-
|
|
6376
|
+
factories8.length = 0;
|
|
6329
6377
|
}
|
|
6330
6378
|
|
|
6331
6379
|
// ../ecommerce/src/code-discounts.ts
|
|
6332
|
-
var
|
|
6380
|
+
var factories9 = [];
|
|
6333
6381
|
function registerCodeDiscountSource(factory) {
|
|
6334
|
-
|
|
6382
|
+
factories9.push(factory);
|
|
6335
6383
|
}
|
|
6336
6384
|
function resolveCodeDiscountSource(options) {
|
|
6337
|
-
for (const factory of
|
|
6385
|
+
for (const factory of factories9) {
|
|
6338
6386
|
const source = factory(options);
|
|
6339
6387
|
if (source !== void 0) return source;
|
|
6340
6388
|
}
|
|
6341
6389
|
return void 0;
|
|
6342
6390
|
}
|
|
6343
6391
|
function clearCodeDiscountSources() {
|
|
6344
|
-
|
|
6392
|
+
factories9.length = 0;
|
|
6345
6393
|
}
|
|
6346
6394
|
|
|
6347
6395
|
// ../ecommerce/src/store-theme.ts
|
|
@@ -6351,19 +6399,19 @@ var StoreThemeAccessError = class extends Error {
|
|
|
6351
6399
|
this.name = "StoreThemeAccessError";
|
|
6352
6400
|
}
|
|
6353
6401
|
};
|
|
6354
|
-
var
|
|
6402
|
+
var factories10 = [];
|
|
6355
6403
|
function registerStoreThemeSource(factory) {
|
|
6356
|
-
|
|
6404
|
+
factories10.push(factory);
|
|
6357
6405
|
}
|
|
6358
6406
|
function resolveStoreThemeSource(options) {
|
|
6359
|
-
for (const factory of
|
|
6407
|
+
for (const factory of factories10) {
|
|
6360
6408
|
const source = factory(options);
|
|
6361
6409
|
if (source !== void 0) return source;
|
|
6362
6410
|
}
|
|
6363
6411
|
return void 0;
|
|
6364
6412
|
}
|
|
6365
6413
|
function clearStoreThemeSources() {
|
|
6366
|
-
|
|
6414
|
+
factories10.length = 0;
|
|
6367
6415
|
}
|
|
6368
6416
|
|
|
6369
6417
|
// ../ecommerce/src/installment-offer.ts
|
|
@@ -11613,6 +11661,7 @@ __export(commerce_exports, {
|
|
|
11613
11661
|
useProducts: () => useProducts,
|
|
11614
11662
|
useQueuedDiscountCodes: () => useQueuedDiscountCodes,
|
|
11615
11663
|
useSafeCart: () => useSafeCart,
|
|
11664
|
+
useSellerProfile: () => useSellerProfile,
|
|
11616
11665
|
useShopCheckout: () => useShopCheckout,
|
|
11617
11666
|
useStoreArticles: () => useStoreArticles,
|
|
11618
11667
|
useStoreCheckouts: () => useStoreCheckouts,
|
|
@@ -11716,6 +11765,7 @@ var INERT_COMMERCE_RUNTIME = {
|
|
|
11716
11765
|
}),
|
|
11717
11766
|
// No commerce, no stores whose articles to read.
|
|
11718
11767
|
useStoreArticles: () => ({ available: false, articles: [], isLoading: false }),
|
|
11768
|
+
useSellerProfile: () => ({ available: false, profile: null, isLoading: false }),
|
|
11719
11769
|
// No commerce, no store to read the field from.
|
|
11720
11770
|
useProductField: () => ({ value: void 0, status: "error" }),
|
|
11721
11771
|
// No commerce, no store page to read the section from.
|
|
@@ -11772,6 +11822,9 @@ function useAskStore() {
|
|
|
11772
11822
|
function useStoreArticles(productIds, topic) {
|
|
11773
11823
|
return useCommerceRuntime().useStoreArticles(productIds, topic);
|
|
11774
11824
|
}
|
|
11825
|
+
function useSellerProfile(productId) {
|
|
11826
|
+
return useCommerceRuntime().useSellerProfile(productId);
|
|
11827
|
+
}
|
|
11775
11828
|
function useShopCheckout() {
|
|
11776
11829
|
return useCommerceRuntime().useShopCheckout();
|
|
11777
11830
|
}
|
|
@@ -13513,7 +13566,7 @@ function useContentActions() {
|
|
|
13513
13566
|
import { useEffect as useEffect19, useState as useState19 } from "react";
|
|
13514
13567
|
|
|
13515
13568
|
// package.json
|
|
13516
|
-
var version = "0.5.
|
|
13569
|
+
var version = "0.5.27";
|
|
13517
13570
|
|
|
13518
13571
|
// src/host/host-modules.ts
|
|
13519
13572
|
import * as react from "react";
|
|
@@ -13986,6 +14039,7 @@ export {
|
|
|
13986
14039
|
clearProductFieldReaders,
|
|
13987
14040
|
clearProductNameLookups,
|
|
13988
14041
|
clearProductSectionReaders,
|
|
14042
|
+
clearSellerProfileLookups,
|
|
13989
14043
|
clearShopCheckouts,
|
|
13990
14044
|
clearStoreArticleLookups,
|
|
13991
14045
|
clearStoreThemeSources,
|
|
@@ -14156,6 +14210,7 @@ export {
|
|
|
14156
14210
|
registerProductFieldSource,
|
|
14157
14211
|
registerProductNameLookup,
|
|
14158
14212
|
registerProductSectionReader,
|
|
14213
|
+
registerSellerProfileLookup,
|
|
14159
14214
|
registerServiceHydrators,
|
|
14160
14215
|
registerSessionScopedClear,
|
|
14161
14216
|
registerShopCheckout,
|
|
@@ -14185,6 +14240,7 @@ export {
|
|
|
14185
14240
|
resolveProductSectionReader,
|
|
14186
14241
|
resolveProductVariant,
|
|
14187
14242
|
resolveScope,
|
|
14243
|
+
resolveSellerProfileLookup,
|
|
14188
14244
|
resolveServiceHydrators,
|
|
14189
14245
|
resolveShopCheckout,
|
|
14190
14246
|
resolveStanding,
|
|
@@ -14376,6 +14432,7 @@ export {
|
|
|
14376
14432
|
useScrollHasMoreBelow,
|
|
14377
14433
|
useSeedLayout,
|
|
14378
14434
|
useSelectMessage,
|
|
14435
|
+
useSellerProfile,
|
|
14379
14436
|
useSessionId,
|
|
14380
14437
|
useSessionMessages,
|
|
14381
14438
|
useSessionState,
|
|
@@ -798,6 +798,45 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
798
798
|
* Storefront mapper.
|
|
799
799
|
*/
|
|
800
800
|
unavailable: z.ZodDefault<z.ZodBoolean>;
|
|
801
|
+
/**
|
|
802
|
+
* Who sells it, as a marketplace or cross-store catalog names them: the store's name, its own storefront, and its
|
|
803
|
+
* policies (returns, shipping, privacy, terms), each a link. Absent for a single store's own products — the space IS
|
|
804
|
+
* the seller there.
|
|
805
|
+
*/
|
|
806
|
+
seller: z.ZodOptional<z.ZodObject<{
|
|
807
|
+
name: z.ZodString;
|
|
808
|
+
url: z.ZodOptional<z.ZodString>;
|
|
809
|
+
policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
810
|
+
kind: z.ZodString;
|
|
811
|
+
url: z.ZodString;
|
|
812
|
+
}, "strip", z.ZodTypeAny, {
|
|
813
|
+
kind: string;
|
|
814
|
+
url: string;
|
|
815
|
+
}, {
|
|
816
|
+
kind: string;
|
|
817
|
+
url: string;
|
|
818
|
+
}>, "many">>;
|
|
819
|
+
}, "strip", z.ZodTypeAny, {
|
|
820
|
+
name: string;
|
|
821
|
+
policies: {
|
|
822
|
+
kind: string;
|
|
823
|
+
url: string;
|
|
824
|
+
}[];
|
|
825
|
+
url?: string | undefined;
|
|
826
|
+
}, {
|
|
827
|
+
name: string;
|
|
828
|
+
url?: string | undefined;
|
|
829
|
+
policies?: {
|
|
830
|
+
kind: string;
|
|
831
|
+
url: string;
|
|
832
|
+
}[] | undefined;
|
|
833
|
+
}>>;
|
|
834
|
+
/** What the product is known for, in the seller's or catalog's own words (top features, selling points). */
|
|
835
|
+
highlights: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
836
|
+
/** Its specifications, one line each. */
|
|
837
|
+
specs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
838
|
+
/** The product's own page on the seller's site. */
|
|
839
|
+
productUrl: z.ZodOptional<z.ZodString>;
|
|
801
840
|
}, "strip", z.ZodTypeAny, {
|
|
802
841
|
id: string;
|
|
803
842
|
title: string;
|
|
@@ -900,6 +939,17 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
900
939
|
value: number;
|
|
901
940
|
count: number;
|
|
902
941
|
} | undefined;
|
|
942
|
+
seller?: {
|
|
943
|
+
name: string;
|
|
944
|
+
policies: {
|
|
945
|
+
kind: string;
|
|
946
|
+
url: string;
|
|
947
|
+
}[];
|
|
948
|
+
url?: string | undefined;
|
|
949
|
+
} | undefined;
|
|
950
|
+
highlights?: string[] | undefined;
|
|
951
|
+
specs?: string[] | undefined;
|
|
952
|
+
productUrl?: string | undefined;
|
|
903
953
|
}, {
|
|
904
954
|
id: string;
|
|
905
955
|
title: string;
|
|
@@ -1002,6 +1052,17 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
1002
1052
|
value: number;
|
|
1003
1053
|
count: number;
|
|
1004
1054
|
} | undefined;
|
|
1055
|
+
seller?: {
|
|
1056
|
+
name: string;
|
|
1057
|
+
url?: string | undefined;
|
|
1058
|
+
policies?: {
|
|
1059
|
+
kind: string;
|
|
1060
|
+
url: string;
|
|
1061
|
+
}[] | undefined;
|
|
1062
|
+
} | undefined;
|
|
1063
|
+
highlights?: string[] | undefined;
|
|
1064
|
+
specs?: string[] | undefined;
|
|
1065
|
+
productUrl?: string | undefined;
|
|
1005
1066
|
}>;
|
|
1006
1067
|
export type Product = z.infer<typeof ProductSchema>;
|
|
1007
1068
|
/**
|
|
@@ -1888,13 +1949,13 @@ export declare const StoreCheckoutSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1888
1949
|
checkoutUrl: z.ZodString;
|
|
1889
1950
|
}, "strip", z.ZodTypeAny, {
|
|
1890
1951
|
status: "ready";
|
|
1891
|
-
checkoutUrl: string;
|
|
1892
1952
|
seller: string;
|
|
1953
|
+
checkoutUrl: string;
|
|
1893
1954
|
lineIds: string[];
|
|
1894
1955
|
}, {
|
|
1895
1956
|
status: "ready";
|
|
1896
|
-
checkoutUrl: string;
|
|
1897
1957
|
seller: string;
|
|
1958
|
+
checkoutUrl: string;
|
|
1898
1959
|
lineIds: string[];
|
|
1899
1960
|
}>, z.ZodObject<{
|
|
1900
1961
|
status: z.ZodLiteral<"failed">;
|
|
@@ -1942,13 +2003,13 @@ export declare const ShopCheckoutResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1942
2003
|
checkoutUrl: z.ZodString;
|
|
1943
2004
|
}, "strip", z.ZodTypeAny, {
|
|
1944
2005
|
status: "ready";
|
|
1945
|
-
checkoutUrl: string;
|
|
1946
2006
|
seller: string;
|
|
2007
|
+
checkoutUrl: string;
|
|
1947
2008
|
lineIds: string[];
|
|
1948
2009
|
}, {
|
|
1949
2010
|
status: "ready";
|
|
1950
|
-
checkoutUrl: string;
|
|
1951
2011
|
seller: string;
|
|
2012
|
+
checkoutUrl: string;
|
|
1952
2013
|
lineIds: string[];
|
|
1953
2014
|
}>, z.ZodObject<{
|
|
1954
2015
|
status: z.ZodLiteral<"failed">;
|
|
@@ -1971,8 +2032,8 @@ export declare const ShopCheckoutResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1971
2032
|
continueUrl: string;
|
|
1972
2033
|
stores: ({
|
|
1973
2034
|
status: "ready";
|
|
1974
|
-
checkoutUrl: string;
|
|
1975
2035
|
seller: string;
|
|
2036
|
+
checkoutUrl: string;
|
|
1976
2037
|
lineIds: string[];
|
|
1977
2038
|
} | {
|
|
1978
2039
|
status: "failed";
|
|
@@ -1985,8 +2046,8 @@ export declare const ShopCheckoutResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1985
2046
|
continueUrl: string;
|
|
1986
2047
|
stores: ({
|
|
1987
2048
|
status: "ready";
|
|
1988
|
-
checkoutUrl: string;
|
|
1989
2049
|
seller: string;
|
|
2050
|
+
checkoutUrl: string;
|
|
1990
2051
|
lineIds: string[];
|
|
1991
2052
|
} | {
|
|
1992
2053
|
status: "failed";
|
|
@@ -2004,13 +2065,13 @@ export declare const ShopCheckoutResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2004
2065
|
checkoutUrl: z.ZodString;
|
|
2005
2066
|
}, "strip", z.ZodTypeAny, {
|
|
2006
2067
|
status: "ready";
|
|
2007
|
-
checkoutUrl: string;
|
|
2008
2068
|
seller: string;
|
|
2069
|
+
checkoutUrl: string;
|
|
2009
2070
|
lineIds: string[];
|
|
2010
2071
|
}, {
|
|
2011
2072
|
status: "ready";
|
|
2012
|
-
checkoutUrl: string;
|
|
2013
2073
|
seller: string;
|
|
2074
|
+
checkoutUrl: string;
|
|
2014
2075
|
lineIds: string[];
|
|
2015
2076
|
}>, z.ZodObject<{
|
|
2016
2077
|
status: z.ZodLiteral<"failed">;
|
|
@@ -2033,8 +2094,8 @@ export declare const ShopCheckoutResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2033
2094
|
reason: string;
|
|
2034
2095
|
stores: ({
|
|
2035
2096
|
status: "ready";
|
|
2036
|
-
checkoutUrl: string;
|
|
2037
2097
|
seller: string;
|
|
2098
|
+
checkoutUrl: string;
|
|
2038
2099
|
lineIds: string[];
|
|
2039
2100
|
} | {
|
|
2040
2101
|
status: "failed";
|
|
@@ -2047,8 +2108,8 @@ export declare const ShopCheckoutResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2047
2108
|
reason: string;
|
|
2048
2109
|
stores: ({
|
|
2049
2110
|
status: "ready";
|
|
2050
|
-
checkoutUrl: string;
|
|
2051
2111
|
seller: string;
|
|
2112
|
+
checkoutUrl: string;
|
|
2052
2113
|
lineIds: string[];
|
|
2053
2114
|
} | {
|
|
2054
2115
|
status: "failed";
|
|
@@ -2077,13 +2138,13 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2077
2138
|
checkoutUrl: z.ZodString;
|
|
2078
2139
|
}, "strip", z.ZodTypeAny, {
|
|
2079
2140
|
status: "ready";
|
|
2080
|
-
checkoutUrl: string;
|
|
2081
2141
|
seller: string;
|
|
2142
|
+
checkoutUrl: string;
|
|
2082
2143
|
lineIds: string[];
|
|
2083
2144
|
}, {
|
|
2084
2145
|
status: "ready";
|
|
2085
|
-
checkoutUrl: string;
|
|
2086
2146
|
seller: string;
|
|
2147
|
+
checkoutUrl: string;
|
|
2087
2148
|
lineIds: string[];
|
|
2088
2149
|
}>, z.ZodObject<{
|
|
2089
2150
|
status: z.ZodLiteral<"failed">;
|
|
@@ -2106,8 +2167,8 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2106
2167
|
continueUrl: string;
|
|
2107
2168
|
stores: ({
|
|
2108
2169
|
status: "ready";
|
|
2109
|
-
checkoutUrl: string;
|
|
2110
2170
|
seller: string;
|
|
2171
|
+
checkoutUrl: string;
|
|
2111
2172
|
lineIds: string[];
|
|
2112
2173
|
} | {
|
|
2113
2174
|
status: "failed";
|
|
@@ -2120,8 +2181,8 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2120
2181
|
continueUrl: string;
|
|
2121
2182
|
stores: ({
|
|
2122
2183
|
status: "ready";
|
|
2123
|
-
checkoutUrl: string;
|
|
2124
2184
|
seller: string;
|
|
2185
|
+
checkoutUrl: string;
|
|
2125
2186
|
lineIds: string[];
|
|
2126
2187
|
} | {
|
|
2127
2188
|
status: "failed";
|
|
@@ -2139,13 +2200,13 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2139
2200
|
checkoutUrl: z.ZodString;
|
|
2140
2201
|
}, "strip", z.ZodTypeAny, {
|
|
2141
2202
|
status: "ready";
|
|
2142
|
-
checkoutUrl: string;
|
|
2143
2203
|
seller: string;
|
|
2204
|
+
checkoutUrl: string;
|
|
2144
2205
|
lineIds: string[];
|
|
2145
2206
|
}, {
|
|
2146
2207
|
status: "ready";
|
|
2147
|
-
checkoutUrl: string;
|
|
2148
2208
|
seller: string;
|
|
2209
|
+
checkoutUrl: string;
|
|
2149
2210
|
lineIds: string[];
|
|
2150
2211
|
}>, z.ZodObject<{
|
|
2151
2212
|
status: z.ZodLiteral<"failed">;
|
|
@@ -2168,8 +2229,8 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2168
2229
|
reason: string;
|
|
2169
2230
|
stores: ({
|
|
2170
2231
|
status: "ready";
|
|
2171
|
-
checkoutUrl: string;
|
|
2172
2232
|
seller: string;
|
|
2233
|
+
checkoutUrl: string;
|
|
2173
2234
|
lineIds: string[];
|
|
2174
2235
|
} | {
|
|
2175
2236
|
status: "failed";
|
|
@@ -2182,8 +2243,8 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2182
2243
|
reason: string;
|
|
2183
2244
|
stores: ({
|
|
2184
2245
|
status: "ready";
|
|
2185
|
-
checkoutUrl: string;
|
|
2186
2246
|
seller: string;
|
|
2247
|
+
checkoutUrl: string;
|
|
2187
2248
|
lineIds: string[];
|
|
2188
2249
|
} | {
|
|
2189
2250
|
status: "failed";
|
|
@@ -2199,8 +2260,8 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2199
2260
|
continueUrl: string;
|
|
2200
2261
|
stores: ({
|
|
2201
2262
|
status: "ready";
|
|
2202
|
-
checkoutUrl: string;
|
|
2203
2263
|
seller: string;
|
|
2264
|
+
checkoutUrl: string;
|
|
2204
2265
|
lineIds: string[];
|
|
2205
2266
|
} | {
|
|
2206
2267
|
status: "failed";
|
|
@@ -2213,8 +2274,8 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2213
2274
|
reason: string;
|
|
2214
2275
|
stores: ({
|
|
2215
2276
|
status: "ready";
|
|
2216
|
-
checkoutUrl: string;
|
|
2217
2277
|
seller: string;
|
|
2278
|
+
checkoutUrl: string;
|
|
2218
2279
|
lineIds: string[];
|
|
2219
2280
|
} | {
|
|
2220
2281
|
status: "failed";
|
|
@@ -2230,8 +2291,8 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2230
2291
|
continueUrl: string;
|
|
2231
2292
|
stores: ({
|
|
2232
2293
|
status: "ready";
|
|
2233
|
-
checkoutUrl: string;
|
|
2234
2294
|
seller: string;
|
|
2295
|
+
checkoutUrl: string;
|
|
2235
2296
|
lineIds: string[];
|
|
2236
2297
|
} | {
|
|
2237
2298
|
status: "failed";
|
|
@@ -2244,8 +2305,8 @@ export declare const ShopCheckoutAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
2244
2305
|
reason: string;
|
|
2245
2306
|
stores: ({
|
|
2246
2307
|
status: "ready";
|
|
2247
|
-
checkoutUrl: string;
|
|
2248
2308
|
seller: string;
|
|
2309
|
+
checkoutUrl: string;
|
|
2249
2310
|
lineIds: string[];
|
|
2250
2311
|
} | {
|
|
2251
2312
|
status: "failed";
|
|
@@ -14,6 +14,7 @@ export { registerProductNameLookup, resolveProductNameLookup, clearProductNameLo
|
|
|
14
14
|
export { buildProductFieldsConfig, readProductFieldsConfig, isDeclaredProductField, ProductFieldIdError, registerProductFieldReader, resolveProductFieldReader, registerProductFieldSource, resolveProductFieldSource, clearProductFieldReaders, type ProductFieldRef, type ProductFieldReader, type ProductFieldReaderFactory, type ProductFieldSourceFactory, } from './product-fields';
|
|
15
15
|
export { buildProductSectionsConfig, readProductSectionsConfig, registerProductSectionReader, resolveProductSectionReader, clearProductSectionReaders, PRODUCT_SECTION_MAX_CHARS, PRODUCT_SECTION_ID_PATTERN, type ProductSectionReader, type ProductSectionReaderFactory, } from './product-sections';
|
|
16
16
|
export { registerStoreArticleLookup, resolveStoreArticleLookup, clearStoreArticleLookups, type StoreArticle, type StoreArticleLookup, type StoreArticleLookupFactory, } from './store-articles';
|
|
17
|
+
export { registerSellerProfileLookup, resolveSellerProfileLookup, clearSellerProfileLookups, type SellerProfile, type SellerProfileLookup, type SellerProfileLookupFactory, } from './seller-profile';
|
|
17
18
|
export { registerCatalogSearch, resolveCatalogSearch, clearCatalogSearches, type CatalogSearch, type CatalogSearchFactory, type CatalogSearchInput, type CatalogSearchPage, } from './catalog-search';
|
|
18
19
|
export { registerShopCheckout, resolveShopCheckout, clearShopCheckouts, type ShopCheckoutLine, type ShopCheckoutMaker, type ShopCheckoutFactory, } from './shop-checkout';
|
|
19
20
|
export { registerBuyerSignIn, resolveBuyerSignIn, clearBuyerSignIns, type BuyerSignIn, type BuyerSignInFactory, type BuyerSignInProvider, type SignedInBuyer, } from './buyer-sign-in';
|
|
@@ -251,11 +251,6 @@ export declare const ProductReviewDataSchema: z.ZodObject<{
|
|
|
251
251
|
verified?: boolean | undefined;
|
|
252
252
|
writtenFor?: string | undefined;
|
|
253
253
|
}[];
|
|
254
|
-
aggregate: {
|
|
255
|
-
value: number;
|
|
256
|
-
count: number;
|
|
257
|
-
};
|
|
258
|
-
distribution: number[];
|
|
259
254
|
highlights: {
|
|
260
255
|
date: string;
|
|
261
256
|
content: string;
|
|
@@ -267,6 +262,11 @@ export declare const ProductReviewDataSchema: z.ZodObject<{
|
|
|
267
262
|
writtenFor?: string | undefined;
|
|
268
263
|
highlight?: string | undefined;
|
|
269
264
|
}[];
|
|
265
|
+
aggregate: {
|
|
266
|
+
value: number;
|
|
267
|
+
count: number;
|
|
268
|
+
};
|
|
269
|
+
distribution: number[];
|
|
270
270
|
unavailable?: boolean | undefined;
|
|
271
271
|
}, {
|
|
272
272
|
id: string;
|
|
@@ -280,11 +280,6 @@ export declare const ProductReviewDataSchema: z.ZodObject<{
|
|
|
280
280
|
verified?: boolean | undefined;
|
|
281
281
|
writtenFor?: string | undefined;
|
|
282
282
|
}[] | undefined;
|
|
283
|
-
aggregate?: {
|
|
284
|
-
value: number;
|
|
285
|
-
count: number;
|
|
286
|
-
} | undefined;
|
|
287
|
-
distribution?: number[] | undefined;
|
|
288
283
|
highlights?: {
|
|
289
284
|
date: string;
|
|
290
285
|
content: string;
|
|
@@ -296,6 +291,11 @@ export declare const ProductReviewDataSchema: z.ZodObject<{
|
|
|
296
291
|
writtenFor?: string | undefined;
|
|
297
292
|
highlight?: string | undefined;
|
|
298
293
|
}[] | undefined;
|
|
294
|
+
aggregate?: {
|
|
295
|
+
value: number;
|
|
296
|
+
count: number;
|
|
297
|
+
} | undefined;
|
|
298
|
+
distribution?: number[] | undefined;
|
|
299
299
|
}>;
|
|
300
300
|
export type ProductReviewData = z.infer<typeof ProductReviewDataSchema>;
|
|
301
301
|
/**
|
|
@@ -423,11 +423,6 @@ export declare const ProductReviewPayloadSchema: z.ZodObject<Omit<{
|
|
|
423
423
|
verified?: boolean | undefined;
|
|
424
424
|
writtenFor?: string | undefined;
|
|
425
425
|
}[];
|
|
426
|
-
aggregate: {
|
|
427
|
-
value: number;
|
|
428
|
-
count: number;
|
|
429
|
-
};
|
|
430
|
-
distribution: number[];
|
|
431
426
|
highlights: {
|
|
432
427
|
date: string;
|
|
433
428
|
content: string;
|
|
@@ -439,6 +434,11 @@ export declare const ProductReviewPayloadSchema: z.ZodObject<Omit<{
|
|
|
439
434
|
writtenFor?: string | undefined;
|
|
440
435
|
highlight?: string | undefined;
|
|
441
436
|
}[];
|
|
437
|
+
aggregate: {
|
|
438
|
+
value: number;
|
|
439
|
+
count: number;
|
|
440
|
+
};
|
|
441
|
+
distribution: number[];
|
|
442
442
|
unavailable?: boolean | undefined;
|
|
443
443
|
}, {
|
|
444
444
|
unavailable?: boolean | undefined;
|
|
@@ -451,11 +451,6 @@ export declare const ProductReviewPayloadSchema: z.ZodObject<Omit<{
|
|
|
451
451
|
verified?: boolean | undefined;
|
|
452
452
|
writtenFor?: string | undefined;
|
|
453
453
|
}[] | undefined;
|
|
454
|
-
aggregate?: {
|
|
455
|
-
value: number;
|
|
456
|
-
count: number;
|
|
457
|
-
} | undefined;
|
|
458
|
-
distribution?: number[] | undefined;
|
|
459
454
|
highlights?: {
|
|
460
455
|
date: string;
|
|
461
456
|
content: string;
|
|
@@ -467,5 +462,10 @@ export declare const ProductReviewPayloadSchema: z.ZodObject<Omit<{
|
|
|
467
462
|
writtenFor?: string | undefined;
|
|
468
463
|
highlight?: string | undefined;
|
|
469
464
|
}[] | undefined;
|
|
465
|
+
aggregate?: {
|
|
466
|
+
value: number;
|
|
467
|
+
count: number;
|
|
468
|
+
} | undefined;
|
|
469
|
+
distribution?: number[] | undefined;
|
|
470
470
|
}>;
|
|
471
471
|
export type ProductReviewPayload = z.infer<typeof ProductReviewPayloadSchema>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who sells a product, as their own site and storefront say — for a space whose products come from many stores, so a
|
|
3
|
+
* product's page can show its brand beside it: the brand's mark, its own line about itself, its colour, and whether its
|
|
4
|
+
* store answers agents (a Storefront MCP endpoint).
|
|
5
|
+
*
|
|
6
|
+
* The lookup is INJECTED (§IX), like the store-article lookup: the platform binding that knows where a product's store
|
|
7
|
+
* lives registers one, and the route that serves it never names a platform. A space whose options no factory claims has
|
|
8
|
+
* no seller profiles.
|
|
9
|
+
*/
|
|
10
|
+
export interface SellerProfile {
|
|
11
|
+
/** The store's name. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Its storefront. */
|
|
14
|
+
url: string;
|
|
15
|
+
/** Its mark (touch icon, else favicon), from its own site; null when it publishes none. */
|
|
16
|
+
icon: string | null;
|
|
17
|
+
/** Its own line about itself (the site's description); null when it sets none. */
|
|
18
|
+
description: string | null;
|
|
19
|
+
/** Its colour (`theme-color`); null when it sets none. */
|
|
20
|
+
color: string | null;
|
|
21
|
+
/** Whether its storefront answers agents over MCP, and where. */
|
|
22
|
+
mcp: {
|
|
23
|
+
available: boolean;
|
|
24
|
+
endpoint: string | null;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** The profile of the store selling `productId`, or null when the product or its store cannot be read. */
|
|
28
|
+
export type SellerProfileLookup = (productId: string) => Promise<SellerProfile | null>;
|
|
29
|
+
/** A lookup for a space's platform config, or `undefined` when the platform is not this factory's. */
|
|
30
|
+
export type SellerProfileLookupFactory = (platformConfig: unknown) => SellerProfileLookup | undefined;
|
|
31
|
+
export declare function registerSellerProfileLookup(factory: SellerProfileLookupFactory): void;
|
|
32
|
+
/** First registered factory that claims this platform config. */
|
|
33
|
+
export declare function resolveSellerProfileLookup(platformConfig: unknown): SellerProfileLookup | undefined;
|
|
34
|
+
/** Test seam: drops every registration. */
|
|
35
|
+
export declare function clearSellerProfileLookups(): void;
|
|
@@ -394,6 +394,7 @@ export declare const HOST_MODULES: {
|
|
|
394
394
|
useStoreCheckouts: typeof sdk.useStoreCheckouts;
|
|
395
395
|
useAskStore: typeof sdk.useAskStore;
|
|
396
396
|
useStoreArticles: typeof sdk.useStoreArticles;
|
|
397
|
+
useSellerProfile: typeof sdk.useSellerProfile;
|
|
397
398
|
useShopCheckout: typeof sdk.useShopCheckout;
|
|
398
399
|
useProductSearch: typeof sdk.useProductSearch;
|
|
399
400
|
useCommerceRuntime: typeof sdk.useCommerceRuntime;
|
|
@@ -5442,6 +5443,15 @@ export declare const HOST_MODULES: {
|
|
|
5442
5443
|
}, {
|
|
5443
5444
|
op: "item.remove";
|
|
5444
5445
|
ref: string;
|
|
5446
|
+
}>, zod.ZodObject<{
|
|
5447
|
+
op: zod.ZodLiteral<"name.set">;
|
|
5448
|
+
name: zod.ZodString;
|
|
5449
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5450
|
+
op: "name.set";
|
|
5451
|
+
name: string;
|
|
5452
|
+
}, {
|
|
5453
|
+
op: "name.set";
|
|
5454
|
+
name: string;
|
|
5445
5455
|
}>]>;
|
|
5446
5456
|
BoardShareSchema: zod.ZodObject<{
|
|
5447
5457
|
title: zod.ZodString;
|
|
@@ -5524,6 +5534,9 @@ export declare const HOST_MODULES: {
|
|
|
5524
5534
|
registerStoreArticleLookup: typeof ecommerce.registerStoreArticleLookup;
|
|
5525
5535
|
resolveStoreArticleLookup: typeof ecommerce.resolveStoreArticleLookup;
|
|
5526
5536
|
clearStoreArticleLookups: typeof ecommerce.clearStoreArticleLookups;
|
|
5537
|
+
registerSellerProfileLookup: typeof ecommerce.registerSellerProfileLookup;
|
|
5538
|
+
resolveSellerProfileLookup: typeof ecommerce.resolveSellerProfileLookup;
|
|
5539
|
+
clearSellerProfileLookups: typeof ecommerce.clearSellerProfileLookups;
|
|
5527
5540
|
registerCatalogSearch: typeof ecommerce.registerCatalogSearch;
|
|
5528
5541
|
resolveCatalogSearch: typeof ecommerce.resolveCatalogSearch;
|
|
5529
5542
|
clearCatalogSearches: typeof ecommerce.clearCatalogSearches;
|
|
@@ -6183,6 +6196,37 @@ export declare const HOST_MODULES: {
|
|
|
6183
6196
|
verified?: boolean | undefined;
|
|
6184
6197
|
}>, "many">>;
|
|
6185
6198
|
unavailable: zod.ZodDefault<zod.ZodBoolean>;
|
|
6199
|
+
seller: zod.ZodOptional<zod.ZodObject<{
|
|
6200
|
+
name: zod.ZodString;
|
|
6201
|
+
url: zod.ZodOptional<zod.ZodString>;
|
|
6202
|
+
policies: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
|
|
6203
|
+
kind: zod.ZodString;
|
|
6204
|
+
url: zod.ZodString;
|
|
6205
|
+
}, "strip", zod.ZodTypeAny, {
|
|
6206
|
+
kind: string;
|
|
6207
|
+
url: string;
|
|
6208
|
+
}, {
|
|
6209
|
+
kind: string;
|
|
6210
|
+
url: string;
|
|
6211
|
+
}>, "many">>;
|
|
6212
|
+
}, "strip", zod.ZodTypeAny, {
|
|
6213
|
+
name: string;
|
|
6214
|
+
policies: {
|
|
6215
|
+
kind: string;
|
|
6216
|
+
url: string;
|
|
6217
|
+
}[];
|
|
6218
|
+
url?: string | undefined;
|
|
6219
|
+
}, {
|
|
6220
|
+
name: string;
|
|
6221
|
+
url?: string | undefined;
|
|
6222
|
+
policies?: {
|
|
6223
|
+
kind: string;
|
|
6224
|
+
url: string;
|
|
6225
|
+
}[] | undefined;
|
|
6226
|
+
}>>;
|
|
6227
|
+
highlights: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
6228
|
+
specs: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
|
|
6229
|
+
productUrl: zod.ZodOptional<zod.ZodString>;
|
|
6186
6230
|
}, "strip", zod.ZodTypeAny, {
|
|
6187
6231
|
id: string;
|
|
6188
6232
|
title: string;
|
|
@@ -6285,6 +6329,17 @@ export declare const HOST_MODULES: {
|
|
|
6285
6329
|
value: number;
|
|
6286
6330
|
count: number;
|
|
6287
6331
|
} | undefined;
|
|
6332
|
+
seller?: {
|
|
6333
|
+
name: string;
|
|
6334
|
+
policies: {
|
|
6335
|
+
kind: string;
|
|
6336
|
+
url: string;
|
|
6337
|
+
}[];
|
|
6338
|
+
url?: string | undefined;
|
|
6339
|
+
} | undefined;
|
|
6340
|
+
highlights?: string[] | undefined;
|
|
6341
|
+
specs?: string[] | undefined;
|
|
6342
|
+
productUrl?: string | undefined;
|
|
6288
6343
|
}, {
|
|
6289
6344
|
id: string;
|
|
6290
6345
|
title: string;
|
|
@@ -6387,6 +6442,17 @@ export declare const HOST_MODULES: {
|
|
|
6387
6442
|
value: number;
|
|
6388
6443
|
count: number;
|
|
6389
6444
|
} | undefined;
|
|
6445
|
+
seller?: {
|
|
6446
|
+
name: string;
|
|
6447
|
+
url?: string | undefined;
|
|
6448
|
+
policies?: {
|
|
6449
|
+
kind: string;
|
|
6450
|
+
url: string;
|
|
6451
|
+
}[] | undefined;
|
|
6452
|
+
} | undefined;
|
|
6453
|
+
highlights?: string[] | undefined;
|
|
6454
|
+
specs?: string[] | undefined;
|
|
6455
|
+
productUrl?: string | undefined;
|
|
6390
6456
|
}>;
|
|
6391
6457
|
ReviewSchema: zod.ZodObject<{
|
|
6392
6458
|
id: zod.ZodString;
|
|
@@ -7057,13 +7123,13 @@ export declare const HOST_MODULES: {
|
|
|
7057
7123
|
checkoutUrl: zod.ZodString;
|
|
7058
7124
|
}, "strip", zod.ZodTypeAny, {
|
|
7059
7125
|
status: "ready";
|
|
7060
|
-
checkoutUrl: string;
|
|
7061
7126
|
seller: string;
|
|
7127
|
+
checkoutUrl: string;
|
|
7062
7128
|
lineIds: string[];
|
|
7063
7129
|
}, {
|
|
7064
7130
|
status: "ready";
|
|
7065
|
-
checkoutUrl: string;
|
|
7066
7131
|
seller: string;
|
|
7132
|
+
checkoutUrl: string;
|
|
7067
7133
|
lineIds: string[];
|
|
7068
7134
|
}>, zod.ZodObject<{
|
|
7069
7135
|
status: zod.ZodLiteral<"failed">;
|
|
@@ -7091,13 +7157,13 @@ export declare const HOST_MODULES: {
|
|
|
7091
7157
|
checkoutUrl: zod.ZodString;
|
|
7092
7158
|
}, "strip", zod.ZodTypeAny, {
|
|
7093
7159
|
status: "ready";
|
|
7094
|
-
checkoutUrl: string;
|
|
7095
7160
|
seller: string;
|
|
7161
|
+
checkoutUrl: string;
|
|
7096
7162
|
lineIds: string[];
|
|
7097
7163
|
}, {
|
|
7098
7164
|
status: "ready";
|
|
7099
|
-
checkoutUrl: string;
|
|
7100
7165
|
seller: string;
|
|
7166
|
+
checkoutUrl: string;
|
|
7101
7167
|
lineIds: string[];
|
|
7102
7168
|
}>, zod.ZodObject<{
|
|
7103
7169
|
status: zod.ZodLiteral<"failed">;
|
|
@@ -7120,8 +7186,8 @@ export declare const HOST_MODULES: {
|
|
|
7120
7186
|
continueUrl: string;
|
|
7121
7187
|
stores: ({
|
|
7122
7188
|
status: "ready";
|
|
7123
|
-
checkoutUrl: string;
|
|
7124
7189
|
seller: string;
|
|
7190
|
+
checkoutUrl: string;
|
|
7125
7191
|
lineIds: string[];
|
|
7126
7192
|
} | {
|
|
7127
7193
|
status: "failed";
|
|
@@ -7134,8 +7200,8 @@ export declare const HOST_MODULES: {
|
|
|
7134
7200
|
continueUrl: string;
|
|
7135
7201
|
stores: ({
|
|
7136
7202
|
status: "ready";
|
|
7137
|
-
checkoutUrl: string;
|
|
7138
7203
|
seller: string;
|
|
7204
|
+
checkoutUrl: string;
|
|
7139
7205
|
lineIds: string[];
|
|
7140
7206
|
} | {
|
|
7141
7207
|
status: "failed";
|
|
@@ -7153,13 +7219,13 @@ export declare const HOST_MODULES: {
|
|
|
7153
7219
|
checkoutUrl: zod.ZodString;
|
|
7154
7220
|
}, "strip", zod.ZodTypeAny, {
|
|
7155
7221
|
status: "ready";
|
|
7156
|
-
checkoutUrl: string;
|
|
7157
7222
|
seller: string;
|
|
7223
|
+
checkoutUrl: string;
|
|
7158
7224
|
lineIds: string[];
|
|
7159
7225
|
}, {
|
|
7160
7226
|
status: "ready";
|
|
7161
|
-
checkoutUrl: string;
|
|
7162
7227
|
seller: string;
|
|
7228
|
+
checkoutUrl: string;
|
|
7163
7229
|
lineIds: string[];
|
|
7164
7230
|
}>, zod.ZodObject<{
|
|
7165
7231
|
status: zod.ZodLiteral<"failed">;
|
|
@@ -7182,8 +7248,8 @@ export declare const HOST_MODULES: {
|
|
|
7182
7248
|
reason: string;
|
|
7183
7249
|
stores: ({
|
|
7184
7250
|
status: "ready";
|
|
7185
|
-
checkoutUrl: string;
|
|
7186
7251
|
seller: string;
|
|
7252
|
+
checkoutUrl: string;
|
|
7187
7253
|
lineIds: string[];
|
|
7188
7254
|
} | {
|
|
7189
7255
|
status: "failed";
|
|
@@ -7196,8 +7262,8 @@ export declare const HOST_MODULES: {
|
|
|
7196
7262
|
reason: string;
|
|
7197
7263
|
stores: ({
|
|
7198
7264
|
status: "ready";
|
|
7199
|
-
checkoutUrl: string;
|
|
7200
7265
|
seller: string;
|
|
7266
|
+
checkoutUrl: string;
|
|
7201
7267
|
lineIds: string[];
|
|
7202
7268
|
} | {
|
|
7203
7269
|
status: "failed";
|
|
@@ -7224,13 +7290,13 @@ export declare const HOST_MODULES: {
|
|
|
7224
7290
|
checkoutUrl: zod.ZodString;
|
|
7225
7291
|
}, "strip", zod.ZodTypeAny, {
|
|
7226
7292
|
status: "ready";
|
|
7227
|
-
checkoutUrl: string;
|
|
7228
7293
|
seller: string;
|
|
7294
|
+
checkoutUrl: string;
|
|
7229
7295
|
lineIds: string[];
|
|
7230
7296
|
}, {
|
|
7231
7297
|
status: "ready";
|
|
7232
|
-
checkoutUrl: string;
|
|
7233
7298
|
seller: string;
|
|
7299
|
+
checkoutUrl: string;
|
|
7234
7300
|
lineIds: string[];
|
|
7235
7301
|
}>, zod.ZodObject<{
|
|
7236
7302
|
status: zod.ZodLiteral<"failed">;
|
|
@@ -7253,8 +7319,8 @@ export declare const HOST_MODULES: {
|
|
|
7253
7319
|
continueUrl: string;
|
|
7254
7320
|
stores: ({
|
|
7255
7321
|
status: "ready";
|
|
7256
|
-
checkoutUrl: string;
|
|
7257
7322
|
seller: string;
|
|
7323
|
+
checkoutUrl: string;
|
|
7258
7324
|
lineIds: string[];
|
|
7259
7325
|
} | {
|
|
7260
7326
|
status: "failed";
|
|
@@ -7267,8 +7333,8 @@ export declare const HOST_MODULES: {
|
|
|
7267
7333
|
continueUrl: string;
|
|
7268
7334
|
stores: ({
|
|
7269
7335
|
status: "ready";
|
|
7270
|
-
checkoutUrl: string;
|
|
7271
7336
|
seller: string;
|
|
7337
|
+
checkoutUrl: string;
|
|
7272
7338
|
lineIds: string[];
|
|
7273
7339
|
} | {
|
|
7274
7340
|
status: "failed";
|
|
@@ -7286,13 +7352,13 @@ export declare const HOST_MODULES: {
|
|
|
7286
7352
|
checkoutUrl: zod.ZodString;
|
|
7287
7353
|
}, "strip", zod.ZodTypeAny, {
|
|
7288
7354
|
status: "ready";
|
|
7289
|
-
checkoutUrl: string;
|
|
7290
7355
|
seller: string;
|
|
7356
|
+
checkoutUrl: string;
|
|
7291
7357
|
lineIds: string[];
|
|
7292
7358
|
}, {
|
|
7293
7359
|
status: "ready";
|
|
7294
|
-
checkoutUrl: string;
|
|
7295
7360
|
seller: string;
|
|
7361
|
+
checkoutUrl: string;
|
|
7296
7362
|
lineIds: string[];
|
|
7297
7363
|
}>, zod.ZodObject<{
|
|
7298
7364
|
status: zod.ZodLiteral<"failed">;
|
|
@@ -7315,8 +7381,8 @@ export declare const HOST_MODULES: {
|
|
|
7315
7381
|
reason: string;
|
|
7316
7382
|
stores: ({
|
|
7317
7383
|
status: "ready";
|
|
7318
|
-
checkoutUrl: string;
|
|
7319
7384
|
seller: string;
|
|
7385
|
+
checkoutUrl: string;
|
|
7320
7386
|
lineIds: string[];
|
|
7321
7387
|
} | {
|
|
7322
7388
|
status: "failed";
|
|
@@ -7329,8 +7395,8 @@ export declare const HOST_MODULES: {
|
|
|
7329
7395
|
reason: string;
|
|
7330
7396
|
stores: ({
|
|
7331
7397
|
status: "ready";
|
|
7332
|
-
checkoutUrl: string;
|
|
7333
7398
|
seller: string;
|
|
7399
|
+
checkoutUrl: string;
|
|
7334
7400
|
lineIds: string[];
|
|
7335
7401
|
} | {
|
|
7336
7402
|
status: "failed";
|
|
@@ -7346,8 +7412,8 @@ export declare const HOST_MODULES: {
|
|
|
7346
7412
|
continueUrl: string;
|
|
7347
7413
|
stores: ({
|
|
7348
7414
|
status: "ready";
|
|
7349
|
-
checkoutUrl: string;
|
|
7350
7415
|
seller: string;
|
|
7416
|
+
checkoutUrl: string;
|
|
7351
7417
|
lineIds: string[];
|
|
7352
7418
|
} | {
|
|
7353
7419
|
status: "failed";
|
|
@@ -7360,8 +7426,8 @@ export declare const HOST_MODULES: {
|
|
|
7360
7426
|
reason: string;
|
|
7361
7427
|
stores: ({
|
|
7362
7428
|
status: "ready";
|
|
7363
|
-
checkoutUrl: string;
|
|
7364
7429
|
seller: string;
|
|
7430
|
+
checkoutUrl: string;
|
|
7365
7431
|
lineIds: string[];
|
|
7366
7432
|
} | {
|
|
7367
7433
|
status: "failed";
|
|
@@ -7377,8 +7443,8 @@ export declare const HOST_MODULES: {
|
|
|
7377
7443
|
continueUrl: string;
|
|
7378
7444
|
stores: ({
|
|
7379
7445
|
status: "ready";
|
|
7380
|
-
checkoutUrl: string;
|
|
7381
7446
|
seller: string;
|
|
7447
|
+
checkoutUrl: string;
|
|
7382
7448
|
lineIds: string[];
|
|
7383
7449
|
} | {
|
|
7384
7450
|
status: "failed";
|
|
@@ -7391,8 +7457,8 @@ export declare const HOST_MODULES: {
|
|
|
7391
7457
|
reason: string;
|
|
7392
7458
|
stores: ({
|
|
7393
7459
|
status: "ready";
|
|
7394
|
-
checkoutUrl: string;
|
|
7395
7460
|
seller: string;
|
|
7461
|
+
checkoutUrl: string;
|
|
7396
7462
|
lineIds: string[];
|
|
7397
7463
|
} | {
|
|
7398
7464
|
status: "failed";
|
|
@@ -7552,11 +7618,6 @@ export declare const HOST_MODULES: {
|
|
|
7552
7618
|
verified?: boolean | undefined;
|
|
7553
7619
|
writtenFor?: string | undefined;
|
|
7554
7620
|
}[];
|
|
7555
|
-
aggregate: {
|
|
7556
|
-
value: number;
|
|
7557
|
-
count: number;
|
|
7558
|
-
};
|
|
7559
|
-
distribution: number[];
|
|
7560
7621
|
highlights: {
|
|
7561
7622
|
date: string;
|
|
7562
7623
|
content: string;
|
|
@@ -7568,6 +7629,11 @@ export declare const HOST_MODULES: {
|
|
|
7568
7629
|
writtenFor?: string | undefined;
|
|
7569
7630
|
highlight?: string | undefined;
|
|
7570
7631
|
}[];
|
|
7632
|
+
aggregate: {
|
|
7633
|
+
value: number;
|
|
7634
|
+
count: number;
|
|
7635
|
+
};
|
|
7636
|
+
distribution: number[];
|
|
7571
7637
|
unavailable?: boolean | undefined;
|
|
7572
7638
|
}, {
|
|
7573
7639
|
id: string;
|
|
@@ -7581,11 +7647,6 @@ export declare const HOST_MODULES: {
|
|
|
7581
7647
|
verified?: boolean | undefined;
|
|
7582
7648
|
writtenFor?: string | undefined;
|
|
7583
7649
|
}[] | undefined;
|
|
7584
|
-
aggregate?: {
|
|
7585
|
-
value: number;
|
|
7586
|
-
count: number;
|
|
7587
|
-
} | undefined;
|
|
7588
|
-
distribution?: number[] | undefined;
|
|
7589
7650
|
highlights?: {
|
|
7590
7651
|
date: string;
|
|
7591
7652
|
content: string;
|
|
@@ -7597,6 +7658,11 @@ export declare const HOST_MODULES: {
|
|
|
7597
7658
|
writtenFor?: string | undefined;
|
|
7598
7659
|
highlight?: string | undefined;
|
|
7599
7660
|
}[] | undefined;
|
|
7661
|
+
aggregate?: {
|
|
7662
|
+
value: number;
|
|
7663
|
+
count: number;
|
|
7664
|
+
} | undefined;
|
|
7665
|
+
distribution?: number[] | undefined;
|
|
7600
7666
|
}>;
|
|
7601
7667
|
ProductReviewPayloadSchema: zod.ZodObject<Omit<{
|
|
7602
7668
|
id: zod.ZodString;
|
|
@@ -7679,11 +7745,6 @@ export declare const HOST_MODULES: {
|
|
|
7679
7745
|
verified?: boolean | undefined;
|
|
7680
7746
|
writtenFor?: string | undefined;
|
|
7681
7747
|
}[];
|
|
7682
|
-
aggregate: {
|
|
7683
|
-
value: number;
|
|
7684
|
-
count: number;
|
|
7685
|
-
};
|
|
7686
|
-
distribution: number[];
|
|
7687
7748
|
highlights: {
|
|
7688
7749
|
date: string;
|
|
7689
7750
|
content: string;
|
|
@@ -7695,6 +7756,11 @@ export declare const HOST_MODULES: {
|
|
|
7695
7756
|
writtenFor?: string | undefined;
|
|
7696
7757
|
highlight?: string | undefined;
|
|
7697
7758
|
}[];
|
|
7759
|
+
aggregate: {
|
|
7760
|
+
value: number;
|
|
7761
|
+
count: number;
|
|
7762
|
+
};
|
|
7763
|
+
distribution: number[];
|
|
7698
7764
|
unavailable?: boolean | undefined;
|
|
7699
7765
|
}, {
|
|
7700
7766
|
unavailable?: boolean | undefined;
|
|
@@ -7707,11 +7773,6 @@ export declare const HOST_MODULES: {
|
|
|
7707
7773
|
verified?: boolean | undefined;
|
|
7708
7774
|
writtenFor?: string | undefined;
|
|
7709
7775
|
}[] | undefined;
|
|
7710
|
-
aggregate?: {
|
|
7711
|
-
value: number;
|
|
7712
|
-
count: number;
|
|
7713
|
-
} | undefined;
|
|
7714
|
-
distribution?: number[] | undefined;
|
|
7715
7776
|
highlights?: {
|
|
7716
7777
|
date: string;
|
|
7717
7778
|
content: string;
|
|
@@ -7723,6 +7784,11 @@ export declare const HOST_MODULES: {
|
|
|
7723
7784
|
writtenFor?: string | undefined;
|
|
7724
7785
|
highlight?: string | undefined;
|
|
7725
7786
|
}[] | undefined;
|
|
7787
|
+
aggregate?: {
|
|
7788
|
+
value: number;
|
|
7789
|
+
count: number;
|
|
7790
|
+
} | undefined;
|
|
7791
|
+
distribution?: number[] | undefined;
|
|
7726
7792
|
}>;
|
|
7727
7793
|
};
|
|
7728
7794
|
'@fourty/sdk/analytics': typeof sdkAnalytics;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { InstallmentOffer, Money, Product } from '../../../../ecommerce/src/index';
|
|
2
|
-
export type { AddToCartApi, CartAddHints, CartAddOptions, CartApi, CustomerAccountApi,
|
|
3
|
-
|
|
2
|
+
export type { AddToCartApi, CartAddHints, CartAddOptions, CartApi, CustomerAccountApi, ProductFieldApi, ProductSectionApi, ShopCheckoutApi, ProductSearchApi, ProductSearchOptions, ProductReviewHighlight, ProductReviewItem, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi, WishlistState, } from './commerce-shapes';
|
|
3
|
+
export type { StoreCheckoutsApi, AskStoreApi, StoreArticlesApi, SellerProfileApi } from './store-shapes';
|
|
4
|
+
import type { AddToCartApi, CartAddHints, CartApi, CustomerAccountApi, ProductFieldApi, ProductSectionApi, ShopCheckoutApi, ProductSearchApi, ProductSearchOptions, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi } from './commerce-shapes';
|
|
5
|
+
import type { StoreCheckoutsApi, AskStoreApi, StoreArticlesApi, SellerProfileApi } from './store-shapes';
|
|
4
6
|
/**
|
|
5
7
|
* FourtyCommerceRuntime — the commerce-hook surface the catalog
|
|
6
8
|
* consumes. Same dependency-inversion pattern as `FourtyRuntime`: these
|
|
@@ -37,6 +39,7 @@ export interface FourtyCommerceRuntime {
|
|
|
37
39
|
useAskStore: () => AskStoreApi;
|
|
38
40
|
/** The selling stores' own articles for an ask. */
|
|
39
41
|
useStoreArticles: (productIds: ReadonlyArray<string>, topic: string) => StoreArticlesApi;
|
|
42
|
+
useSellerProfile: (productId: string | null) => SellerProfileApi;
|
|
40
43
|
/** One store product field the brand declared, read on the server. */
|
|
41
44
|
useProductField: (productId: string | undefined, namespace: string, key: string) => ProductFieldApi;
|
|
42
45
|
/** One section of a product's store page the brand declared, fetched on the server. */
|
|
@@ -98,6 +101,8 @@ export declare function useAskStore(): AskStoreApi;
|
|
|
98
101
|
* to `topic`. Not available (empty) on a single store's space or without a
|
|
99
102
|
* `<CommerceProvider>`. */
|
|
100
103
|
export declare function useStoreArticles(productIds: ReadonlyArray<string>, topic: string): StoreArticlesApi;
|
|
104
|
+
/** The store selling a product (a many-store space): its mark, its own line, its colour, whether it answers MCP. */
|
|
105
|
+
export declare function useSellerProfile(productId: string | null): SellerProfileApi;
|
|
101
106
|
/** The whole bag in ONE checkout through Shop, even across several stores
|
|
102
107
|
* (`combined`), or each store separately with the reason (`separate`). Not
|
|
103
108
|
* available (and `create` rejects) on a single-store backend, without a bag,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { CartOrigin } from '../../../../spacestation/src/analytics/ecommerce/index';
|
|
14
14
|
import type { CartLineAttribute } from '../../../../spacestation/src/index';
|
|
15
|
-
import type { Cart, OptimisticCartLine, Product, ProductReviewItem, ProductReviewHighlight,
|
|
15
|
+
import type { Cart, OptimisticCartLine, Product, ProductReviewItem, ProductReviewHighlight, ShopCheckoutResult } from '../../../../ecommerce/src/index';
|
|
16
16
|
/**
|
|
17
17
|
* One review / one intent-matched review. Both are `z.infer` of the review
|
|
18
18
|
* schemas in `@fourty/ecommerce` — the single source of truth for the shape,
|
|
@@ -195,36 +195,6 @@ export interface CustomerAccountApi {
|
|
|
195
195
|
* as in a console preview. */
|
|
196
196
|
available: boolean;
|
|
197
197
|
}
|
|
198
|
-
/** Return shape of `useStoreCheckouts` — a cart that spans several stores,
|
|
199
|
-
* checked out one store at a time (`CommerceAdapter.createStoreCheckouts`). */
|
|
200
|
-
export interface StoreCheckoutsApi {
|
|
201
|
-
/** False where the backend's cart belongs to one store — that cart exits
|
|
202
|
-
* through `cart.checkoutUrl` (`useCartView().handleCheckout`) instead. */
|
|
203
|
-
available: boolean;
|
|
204
|
-
/** Make one checkout per store in the cart. Places no order; each `ready`
|
|
205
|
-
* entry's `checkoutUrl` is where the visitor pays for that store's lines. */
|
|
206
|
-
create: () => Promise<StoreCheckout[]>;
|
|
207
|
-
/** True while `create` is in flight. */
|
|
208
|
-
pending: boolean;
|
|
209
|
-
}
|
|
210
|
-
/** Return shape of `useAskStore` — a question put to the store that sells a
|
|
211
|
-
* product (`CommerceAdapter.askStore`). The answer is that store's own
|
|
212
|
-
* statement, so a surface credits it to `seller`. */
|
|
213
|
-
export interface AskStoreApi {
|
|
214
|
-
/** False where the space is the only store — there is no one else to ask. */
|
|
215
|
-
available: boolean;
|
|
216
|
-
ask: (productId: string, question: string) => Promise<StoreAnswer>;
|
|
217
|
-
/** True while `ask` is in flight. */
|
|
218
|
-
pending: boolean;
|
|
219
|
-
}
|
|
220
|
-
/** Return shape of `useStoreArticles`: the articles the selling stores published
|
|
221
|
-
* themselves that speak to an ask (their own blogs), best first. */
|
|
222
|
-
export interface StoreArticlesApi {
|
|
223
|
-
/** False where the space has no store articles to read (a single store's space). */
|
|
224
|
-
available: boolean;
|
|
225
|
-
articles: StoreArticle[];
|
|
226
|
-
isLoading: boolean;
|
|
227
|
-
}
|
|
228
198
|
/** Return shape of `useProductField`: one declared store product field. */
|
|
229
199
|
export interface ProductFieldApi {
|
|
230
200
|
/** The field's value as the store holds it; undefined until `ready`, or when the product has no such field. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './chip-relevance';
|
|
2
|
-
export { useCart, useAddToCart, useWishlist, useToggleWishlist, useProducts, useCollectionByHandle, useProductReviews, useCustomerAccount, useInstallmentOffer, useStoreCheckouts, useAskStore, useStoreArticles, useShopCheckout, useProductSearch, useCommerceRuntime, FourtyCommerceRuntimeProvider, } from './commerce-context';
|
|
2
|
+
export { useCart, useAddToCart, useWishlist, useToggleWishlist, useProducts, useCollectionByHandle, useProductReviews, useCustomerAccount, useInstallmentOffer, useStoreCheckouts, useAskStore, useStoreArticles, useSellerProfile, useShopCheckout, useProductSearch, useCommerceRuntime, FourtyCommerceRuntimeProvider, } from './commerce-context';
|
|
3
3
|
export { useProductField, useProductSection } from './product-data-hooks';
|
|
4
|
-
export type { FourtyCommerceRuntime, CartApi, AddToCartApi, WishlistApi, ToggleWishlistApi, ProductsQuery, ProductReviewItem, ProductReviewHighlight, ProductReviewsResult, CustomerAccountApi, StoreCheckoutsApi, AskStoreApi, StoreArticlesApi, ProductFieldApi, ProductSectionApi, ShopCheckoutApi, ProductSearchApi, ProductSearchOptions, CartAddOptions, CartAddHints, WishlistState, } from './commerce-context';
|
|
4
|
+
export type { FourtyCommerceRuntime, CartApi, AddToCartApi, WishlistApi, ToggleWishlistApi, ProductsQuery, ProductReviewItem, ProductReviewHighlight, ProductReviewsResult, CustomerAccountApi, StoreCheckoutsApi, AskStoreApi, StoreArticlesApi, SellerProfileApi, ProductFieldApi, ProductSectionApi, ShopCheckoutApi, ProductSearchApi, ProductSearchOptions, CartAddOptions, CartAddHints, WishlistState, } from './commerce-context';
|
|
5
5
|
export { navigateToExternalCommerceUrl } from './checkout/external-navigation';
|
|
6
6
|
export type { ExternalNavigationResult } from './checkout/external-navigation';
|
|
7
7
|
export { recordVariantSelection, getVariantSelection, useVariantSelections, } from './variant/variant-selection-store';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes of the hooks that reach the STORES behind a space over a marketplace of stores (Shopify's catalog): a
|
|
3
|
+
* checkout per store, a question put to a store, the stores' own articles, the profile of the store selling a product.
|
|
4
|
+
* A single store's space answers each with `available: false` — it is the only store.
|
|
5
|
+
*
|
|
6
|
+
* Kept apart from `commerce-shapes.ts` (the one-store contract: cart, wishlist, products) because these grow with the
|
|
7
|
+
* marketplace and that file sits under the enforced 300-line ceiling. Re-exported from `@fourty/sdk/commerce` through
|
|
8
|
+
* `commerce-context.tsx`; nothing imports this path from outside the SDK.
|
|
9
|
+
*/
|
|
10
|
+
import type { SellerProfile, StoreAnswer, StoreArticle, StoreCheckout } from '../../../../ecommerce/src/index';
|
|
11
|
+
/** Return shape of `useStoreCheckouts` — a cart that spans several stores,
|
|
12
|
+
* checked out one store at a time (`CommerceAdapter.createStoreCheckouts`). */
|
|
13
|
+
export interface StoreCheckoutsApi {
|
|
14
|
+
/** False where the backend's cart belongs to one store — that cart exits
|
|
15
|
+
* through `cart.checkoutUrl` (`useCartView().handleCheckout`) instead. */
|
|
16
|
+
available: boolean;
|
|
17
|
+
/** Make one checkout per store in the cart. Places no order; each `ready`
|
|
18
|
+
* entry's `checkoutUrl` is where the visitor pays for that store's lines. */
|
|
19
|
+
create: () => Promise<StoreCheckout[]>;
|
|
20
|
+
/** True while `create` is in flight. */
|
|
21
|
+
pending: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Return shape of `useAskStore` — a question put to the store that sells a
|
|
24
|
+
* product (`CommerceAdapter.askStore`). The answer is that store's own
|
|
25
|
+
* statement, so a surface credits it to `seller`. */
|
|
26
|
+
export interface AskStoreApi {
|
|
27
|
+
/** False where the space is the only store — there is no one else to ask. */
|
|
28
|
+
available: boolean;
|
|
29
|
+
ask: (productId: string, question: string) => Promise<StoreAnswer>;
|
|
30
|
+
/** True while `ask` is in flight. */
|
|
31
|
+
pending: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Return shape of `useStoreArticles`: the articles the selling stores published
|
|
34
|
+
* themselves that speak to an ask (their own blogs), best first. */
|
|
35
|
+
export interface StoreArticlesApi {
|
|
36
|
+
/** False where the space has no store articles to read (a single store's space). */
|
|
37
|
+
available: boolean;
|
|
38
|
+
articles: StoreArticle[];
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
}
|
|
41
|
+
/** Return shape of `useSellerProfile`: the store selling a product, as its own site and storefront say. */
|
|
42
|
+
export interface SellerProfileApi {
|
|
43
|
+
/** False where the space has no seller profiles (a single store's space: it IS the seller). */
|
|
44
|
+
available: boolean;
|
|
45
|
+
/** Null until it lands, and when the product or its store cannot be read. */
|
|
46
|
+
profile: SellerProfile | null;
|
|
47
|
+
isLoading: boolean;
|
|
48
|
+
}
|
|
@@ -373,6 +373,15 @@ export declare const BoardEditSchema: z.ZodDiscriminatedUnion<"op", [z.ZodObject
|
|
|
373
373
|
}, {
|
|
374
374
|
op: "item.remove";
|
|
375
375
|
ref: string;
|
|
376
|
+
}>, z.ZodObject<{
|
|
377
|
+
op: z.ZodLiteral<"name.set">;
|
|
378
|
+
name: z.ZodString;
|
|
379
|
+
}, "strip", z.ZodTypeAny, {
|
|
380
|
+
op: "name.set";
|
|
381
|
+
name: string;
|
|
382
|
+
}, {
|
|
383
|
+
op: "name.set";
|
|
384
|
+
name: string;
|
|
376
385
|
}>]>;
|
|
377
386
|
export type BoardEdit = z.infer<typeof BoardEditSchema>;
|
|
378
387
|
/** What the sharer chooses to put on the board when they share: only these facts and items leave their session. */
|