@40rty/ams-sdk 0.5.27 → 0.5.28
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
CHANGED
|
@@ -391,7 +391,7 @@ __export(src_exports3, {
|
|
|
391
391
|
clearProductFieldReaders: () => clearProductFieldReaders,
|
|
392
392
|
clearProductNameLookups: () => clearProductNameLookups,
|
|
393
393
|
clearProductSectionReaders: () => clearProductSectionReaders,
|
|
394
|
-
|
|
394
|
+
clearSellerDirectories: () => clearSellerDirectories,
|
|
395
395
|
clearShopCheckouts: () => clearShopCheckouts,
|
|
396
396
|
clearStoreArticleLookups: () => clearStoreArticleLookups,
|
|
397
397
|
clearStoreThemeSources: () => clearStoreThemeSources,
|
|
@@ -561,7 +561,7 @@ __export(src_exports3, {
|
|
|
561
561
|
registerProductFieldSource: () => registerProductFieldSource,
|
|
562
562
|
registerProductNameLookup: () => registerProductNameLookup,
|
|
563
563
|
registerProductSectionReader: () => registerProductSectionReader,
|
|
564
|
-
|
|
564
|
+
registerSellerDirectory: () => registerSellerDirectory,
|
|
565
565
|
registerServiceHydrators: () => registerServiceHydrators,
|
|
566
566
|
registerSessionScopedClear: () => registerSessionScopedClear,
|
|
567
567
|
registerShopCheckout: () => registerShopCheckout,
|
|
@@ -591,7 +591,7 @@ __export(src_exports3, {
|
|
|
591
591
|
resolveProductSectionReader: () => resolveProductSectionReader,
|
|
592
592
|
resolveProductVariant: () => resolveProductVariant,
|
|
593
593
|
resolveScope: () => resolveScope,
|
|
594
|
-
|
|
594
|
+
resolveSellerDirectory: () => resolveSellerDirectory,
|
|
595
595
|
resolveServiceHydrators: () => resolveServiceHydrators,
|
|
596
596
|
resolveShopCheckout: () => resolveShopCheckout,
|
|
597
597
|
resolveStanding: () => resolveStanding,
|
|
@@ -5393,7 +5393,7 @@ __export(src_exports2, {
|
|
|
5393
5393
|
clearProductFieldReaders: () => clearProductFieldReaders,
|
|
5394
5394
|
clearProductNameLookups: () => clearProductNameLookups,
|
|
5395
5395
|
clearProductSectionReaders: () => clearProductSectionReaders,
|
|
5396
|
-
|
|
5396
|
+
clearSellerDirectories: () => clearSellerDirectories,
|
|
5397
5397
|
clearShopCheckouts: () => clearShopCheckouts,
|
|
5398
5398
|
clearStoreArticleLookups: () => clearStoreArticleLookups,
|
|
5399
5399
|
clearStoreThemeSources: () => clearStoreThemeSources,
|
|
@@ -5425,7 +5425,7 @@ __export(src_exports2, {
|
|
|
5425
5425
|
registerProductFieldSource: () => registerProductFieldSource,
|
|
5426
5426
|
registerProductNameLookup: () => registerProductNameLookup,
|
|
5427
5427
|
registerProductSectionReader: () => registerProductSectionReader,
|
|
5428
|
-
|
|
5428
|
+
registerSellerDirectory: () => registerSellerDirectory,
|
|
5429
5429
|
registerShopCheckout: () => registerShopCheckout,
|
|
5430
5430
|
registerStoreArticleLookup: () => registerStoreArticleLookup,
|
|
5431
5431
|
registerStoreThemeSource: () => registerStoreThemeSource,
|
|
@@ -5436,7 +5436,7 @@ __export(src_exports2, {
|
|
|
5436
5436
|
resolveProductFieldSource: () => resolveProductFieldSource,
|
|
5437
5437
|
resolveProductNameLookup: () => resolveProductNameLookup,
|
|
5438
5438
|
resolveProductSectionReader: () => resolveProductSectionReader,
|
|
5439
|
-
|
|
5439
|
+
resolveSellerDirectory: () => resolveSellerDirectory,
|
|
5440
5440
|
resolveShopCheckout: () => resolveShopCheckout,
|
|
5441
5441
|
resolveStoreArticleLookup: () => resolveStoreArticleLookup,
|
|
5442
5442
|
resolveStoreThemeSource: () => resolveStoreThemeSource,
|
|
@@ -6314,17 +6314,17 @@ function clearStoreArticleLookups() {
|
|
|
6314
6314
|
|
|
6315
6315
|
// ../ecommerce/src/seller-profile.ts
|
|
6316
6316
|
var factories5 = [];
|
|
6317
|
-
function
|
|
6317
|
+
function registerSellerDirectory(factory) {
|
|
6318
6318
|
factories5.push(factory);
|
|
6319
6319
|
}
|
|
6320
|
-
function
|
|
6320
|
+
function resolveSellerDirectory(platformConfig) {
|
|
6321
6321
|
for (const factory of factories5) {
|
|
6322
|
-
const
|
|
6323
|
-
if (
|
|
6322
|
+
const directory = factory(platformConfig);
|
|
6323
|
+
if (directory !== void 0) return directory;
|
|
6324
6324
|
}
|
|
6325
6325
|
return void 0;
|
|
6326
6326
|
}
|
|
6327
|
-
function
|
|
6327
|
+
function clearSellerDirectories() {
|
|
6328
6328
|
factories5.length = 0;
|
|
6329
6329
|
}
|
|
6330
6330
|
|
|
@@ -13566,7 +13566,7 @@ function useContentActions() {
|
|
|
13566
13566
|
import { useEffect as useEffect19, useState as useState19 } from "react";
|
|
13567
13567
|
|
|
13568
13568
|
// package.json
|
|
13569
|
-
var version = "0.5.
|
|
13569
|
+
var version = "0.5.28";
|
|
13570
13570
|
|
|
13571
13571
|
// src/host/host-modules.ts
|
|
13572
13572
|
import * as react from "react";
|
|
@@ -14039,7 +14039,7 @@ export {
|
|
|
14039
14039
|
clearProductFieldReaders,
|
|
14040
14040
|
clearProductNameLookups,
|
|
14041
14041
|
clearProductSectionReaders,
|
|
14042
|
-
|
|
14042
|
+
clearSellerDirectories,
|
|
14043
14043
|
clearShopCheckouts,
|
|
14044
14044
|
clearStoreArticleLookups,
|
|
14045
14045
|
clearStoreThemeSources,
|
|
@@ -14210,7 +14210,7 @@ export {
|
|
|
14210
14210
|
registerProductFieldSource,
|
|
14211
14211
|
registerProductNameLookup,
|
|
14212
14212
|
registerProductSectionReader,
|
|
14213
|
-
|
|
14213
|
+
registerSellerDirectory,
|
|
14214
14214
|
registerServiceHydrators,
|
|
14215
14215
|
registerSessionScopedClear,
|
|
14216
14216
|
registerShopCheckout,
|
|
@@ -14240,7 +14240,7 @@ export {
|
|
|
14240
14240
|
resolveProductSectionReader,
|
|
14241
14241
|
resolveProductVariant,
|
|
14242
14242
|
resolveScope,
|
|
14243
|
-
|
|
14243
|
+
resolveSellerDirectory,
|
|
14244
14244
|
resolveServiceHydrators,
|
|
14245
14245
|
resolveShopCheckout,
|
|
14246
14246
|
resolveStanding,
|
|
@@ -1974,15 +1974,25 @@ export declare const StoreCheckoutSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
1974
1974
|
lineIds: string[];
|
|
1975
1975
|
}>]>;
|
|
1976
1976
|
export type StoreCheckout = z.infer<typeof StoreCheckoutSchema>;
|
|
1977
|
+
/** One of a store's own published answers (its FAQ, its policies), as its storefront serves it. */
|
|
1978
|
+
export interface StoreFaq {
|
|
1979
|
+
question: string;
|
|
1980
|
+
answer: string;
|
|
1981
|
+
}
|
|
1977
1982
|
/**
|
|
1978
1983
|
* A store's own answer to a visitor's question about one of its products —
|
|
1979
1984
|
* what `CommerceAdapter.askStore` returns. It is the STORE's statement (its
|
|
1980
1985
|
* policies, its listing), never a fact the platform checked, so a surface
|
|
1981
|
-
* credits it to `seller`.
|
|
1986
|
+
* credits it to `seller`. Two voices of the same store: its agent's reply, and
|
|
1987
|
+
* the answers it published itself that match the question.
|
|
1982
1988
|
*/
|
|
1983
1989
|
export interface StoreAnswer {
|
|
1984
1990
|
seller: string;
|
|
1985
|
-
answer
|
|
1991
|
+
/** The store's agent's reply; null when it could not answer but `faqs` did. */
|
|
1992
|
+
answer: string | null;
|
|
1993
|
+
/** The store's own published answers that match the question, read from its storefront's MCP; [] when it has
|
|
1994
|
+
* none, or its storefront speaks no MCP. */
|
|
1995
|
+
faqs: StoreFaq[];
|
|
1986
1996
|
}
|
|
1987
1997
|
/**
|
|
1988
1998
|
* A whole bag paid in ONE checkout through Shop, what a marketplace space's
|
|
@@ -14,7 +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 {
|
|
17
|
+
export { registerSellerDirectory, resolveSellerDirectory, clearSellerDirectories, type SellerProfile, type SellerDirectory, type SellerDirectoryFactory, } from './seller-profile';
|
|
18
18
|
export { registerCatalogSearch, resolveCatalogSearch, clearCatalogSearches, type CatalogSearch, type CatalogSearchFactory, type CatalogSearchInput, type CatalogSearchPage, } from './catalog-search';
|
|
19
19
|
export { registerShopCheckout, resolveShopCheckout, clearShopCheckouts, type ShopCheckoutLine, type ShopCheckoutMaker, type ShopCheckoutFactory, } from './shop-checkout';
|
|
20
20
|
export { registerBuyerSignIn, resolveBuyerSignIn, clearBuyerSignIns, type BuyerSignIn, type BuyerSignInFactory, type BuyerSignInProvider, type SignedInBuyer, } from './buyer-sign-in';
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Who sells a product, as their own site and storefront say — for a space whose products come from many stores, so a
|
|
3
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)
|
|
4
|
+
* store answers agents (a Storefront MCP endpoint) — and, when it does, the answers it published itself to a visitor's
|
|
5
|
+
* question.
|
|
5
6
|
*
|
|
6
|
-
* The
|
|
7
|
-
* lives registers one, and the
|
|
8
|
-
* no seller
|
|
7
|
+
* The directory is INJECTED (§IX), like the store-article lookup: the platform binding that knows where a product's
|
|
8
|
+
* store lives registers one, and the routes that serve it never name a platform. A space whose options no factory
|
|
9
|
+
* claims has no seller directory.
|
|
9
10
|
*/
|
|
11
|
+
import type { StoreFaq } from './commerce-schemas';
|
|
10
12
|
export interface SellerProfile {
|
|
11
13
|
/** The store's name. */
|
|
12
14
|
name: string;
|
|
@@ -24,12 +26,18 @@ export interface SellerProfile {
|
|
|
24
26
|
endpoint: string | null;
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
|
-
/** The
|
|
28
|
-
export
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
/** The stores behind a space's products. */
|
|
30
|
+
export interface SellerDirectory {
|
|
31
|
+
/** The profile of the store selling `productId`, or null when the product or its store cannot be read. */
|
|
32
|
+
profile(productId: string): Promise<SellerProfile | null>;
|
|
33
|
+
/** The answers that store published itself (its FAQ, its policies) that match `question`, best first; [] when it has
|
|
34
|
+
* none or its storefront speaks no MCP. Never throws for a store that cannot be reached: that store has none. */
|
|
35
|
+
answers(productId: string, question: string): Promise<StoreFaq[]>;
|
|
36
|
+
}
|
|
37
|
+
/** A directory for a space's platform config, or `undefined` when the platform is not this factory's. */
|
|
38
|
+
export type SellerDirectoryFactory = (platformConfig: unknown) => SellerDirectory | undefined;
|
|
39
|
+
export declare function registerSellerDirectory(factory: SellerDirectoryFactory): void;
|
|
32
40
|
/** First registered factory that claims this platform config. */
|
|
33
|
-
export declare function
|
|
41
|
+
export declare function resolveSellerDirectory(platformConfig: unknown): SellerDirectory | undefined;
|
|
34
42
|
/** Test seam: drops every registration. */
|
|
35
|
-
export declare function
|
|
43
|
+
export declare function clearSellerDirectories(): void;
|
|
@@ -5534,9 +5534,9 @@ export declare const HOST_MODULES: {
|
|
|
5534
5534
|
registerStoreArticleLookup: typeof ecommerce.registerStoreArticleLookup;
|
|
5535
5535
|
resolveStoreArticleLookup: typeof ecommerce.resolveStoreArticleLookup;
|
|
5536
5536
|
clearStoreArticleLookups: typeof ecommerce.clearStoreArticleLookups;
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5537
|
+
registerSellerDirectory: typeof ecommerce.registerSellerDirectory;
|
|
5538
|
+
resolveSellerDirectory: typeof ecommerce.resolveSellerDirectory;
|
|
5539
|
+
clearSellerDirectories: typeof ecommerce.clearSellerDirectories;
|
|
5540
5540
|
registerCatalogSearch: typeof ecommerce.registerCatalogSearch;
|
|
5541
5541
|
resolveCatalogSearch: typeof ecommerce.resolveCatalogSearch;
|
|
5542
5542
|
clearCatalogSearches: typeof ecommerce.clearCatalogSearches;
|