@commerce-ai-tool/angular 2.4.0
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/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +16 -0
- package/dist/index.cjs +2811 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1015 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2780 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/camera.util.d.ts +7 -0
- package/dist/lib/camera.util.d.ts.map +1 -0
- package/dist/lib/commerce-ai-api.service.d.ts +35 -0
- package/dist/lib/commerce-ai-api.service.d.ts.map +1 -0
- package/dist/lib/commerce-ai-cart-panel.component.d.ts +34 -0
- package/dist/lib/commerce-ai-cart-panel.component.d.ts.map +1 -0
- package/dist/lib/commerce-ai-cart.service.d.ts +61 -0
- package/dist/lib/commerce-ai-cart.service.d.ts.map +1 -0
- package/dist/lib/commerce-ai-mission-results.component.d.ts +26 -0
- package/dist/lib/commerce-ai-mission-results.component.d.ts.map +1 -0
- package/dist/lib/commerce-ai-search.component.d.ts +141 -0
- package/dist/lib/commerce-ai-search.component.d.ts.map +1 -0
- package/dist/lib/mission.util.d.ts +6 -0
- package/dist/lib/mission.util.d.ts.map +1 -0
- package/dist/vendor-core/client.d.cts +12 -0
- package/dist/vendor-core/client.d.ts +12 -0
- package/dist/vendor-core/commercetools/facet-color.d.ts +12 -0
- package/dist/vendor-core/commercetools/facets.d.ts +31 -0
- package/dist/vendor-core/messages/index.d.ts +110 -0
- package/dist/vendor-core/payments/types.d.ts +35 -0
- package/dist/vendor-core/search/compound-shopping-list.d.ts +6 -0
- package/dist/vendor-core/types/index.d.ts +510 -0
- package/package.json +83 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy } from "@angular/core";
|
|
2
|
+
import type { AddToCartLineItem, CommerceAISearchMessages, MissionSearchResult, ProductCard } from "../vendor-core/client.js";
|
|
3
|
+
export declare class CommerceAiMissionResultsComponent implements OnChanges, OnDestroy {
|
|
4
|
+
mission: MissionSearchResult;
|
|
5
|
+
messages: CommerceAISearchMessages;
|
|
6
|
+
enableCart: boolean;
|
|
7
|
+
isMutating: boolean;
|
|
8
|
+
addedProductIds: Record<string, true>;
|
|
9
|
+
addAllHandler?: (items: AddToCartLineItem[]) => Promise<unknown>;
|
|
10
|
+
productSelect: EventEmitter<ProductCard>;
|
|
11
|
+
addItem: EventEmitter<ProductCard>;
|
|
12
|
+
addAll: EventEmitter<AddToCartLineItem[]>;
|
|
13
|
+
readonly titleId: string;
|
|
14
|
+
justAddedAll: boolean;
|
|
15
|
+
private addedAllTimeout;
|
|
16
|
+
private lastMission;
|
|
17
|
+
private cachedBundleMission;
|
|
18
|
+
private cachedBundleItems;
|
|
19
|
+
get bundleItems(): AddToCartLineItem[];
|
|
20
|
+
get addAllLabel(): string;
|
|
21
|
+
ngOnChanges(): void;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
addLabel(product: ProductCard): string;
|
|
24
|
+
onAddAllClick(): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=commerce-ai-mission-results.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commerce-ai-mission-results.component.d.ts","sourceRoot":"","sources":["../../src/lib/commerce-ai-mission-results.component.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,YAAY,EAAS,SAAS,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAC7F,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAKvC,qBAuIa,iCAAkC,YAAW,SAAS,EAAE,SAAS;IACjD,OAAO,EAAG,mBAAmB,CAAC;IAC9B,QAAQ,EAAG,wBAAwB,CAAC;IACtD,UAAU,UAAS;IACnB,UAAU,UAAS;IACnB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAM;IAC3C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhE,aAAa,4BAAmC;IAChD,OAAO,4BAAmC;IAC1C,MAAM,oCAA2C;IAE3D,QAAQ,CAAC,OAAO,SAAqD;IACrE,YAAY,UAAS;IACrB,OAAO,CAAC,eAAe,CAA8C;IACrE,OAAO,CAAC,WAAW,CAAoC;IACvD,OAAO,CAAC,mBAAmB,CAAoC;IAC/D,OAAO,CAAC,iBAAiB,CAA2B;IAEpD,IAAI,WAAW,IAAI,iBAAiB,EAAE,CAMrC;IAED,IAAI,WAAW,IAAI,MAAM,CAGxB;IAED,WAAW,IAAI,IAAI,CAKlB;IAED,WAAW,IAAI,IAAI,CAKlB;IAED,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAKrC;IAED,aAAa,IAAI,IAAI,CAgBpB;CACF"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import type { AddToCartLineItem, CartSnapshot, CommerceAISearchMessages, InterpretedSearchFilters, MissionSearchResult, ProductCard, SearchFacetGroup, SuggestedFacet, ThemeMode } from "../vendor-core/client.js";
|
|
3
|
+
import { CommerceAiCartService } from "./commerce-ai-cart.service.js";
|
|
4
|
+
import { type CameraFacingMode } from "./camera.util.js";
|
|
5
|
+
type SearchMode = "text" | "image" | "voice" | null;
|
|
6
|
+
export declare class CommerceAiSearchComponent implements OnInit, OnChanges, OnDestroy {
|
|
7
|
+
private readonly api;
|
|
8
|
+
private readonly cdr;
|
|
9
|
+
readonly cart: CommerceAiCartService;
|
|
10
|
+
apiBaseUrl: string;
|
|
11
|
+
theme: ThemeMode;
|
|
12
|
+
catalogLocale?: string;
|
|
13
|
+
queryLocale?: string;
|
|
14
|
+
/** @deprecated Use queryLocale */
|
|
15
|
+
locale?: string;
|
|
16
|
+
placeholder: string;
|
|
17
|
+
messages?: Partial<CommerceAISearchMessages>;
|
|
18
|
+
enableAutocomplete: boolean;
|
|
19
|
+
enableFacets: boolean;
|
|
20
|
+
/** Show microphone search controls. */
|
|
21
|
+
enableVoice: boolean;
|
|
22
|
+
/** Show local image upload and drag-and-drop search controls. */
|
|
23
|
+
enableImageSearch: boolean;
|
|
24
|
+
/** Show camera capture search controls independently of image upload. */
|
|
25
|
+
enableCameraSearch: boolean;
|
|
26
|
+
cameraFacingMode: CameraFacingMode;
|
|
27
|
+
enableTts: boolean;
|
|
28
|
+
/** Enable built-in add-to-cart buttons and cart preview panel. Default false. */
|
|
29
|
+
enableCart: boolean;
|
|
30
|
+
/** Enable multi-item shopping missions on text, voice, and image search. Default false. */
|
|
31
|
+
enableMissions: boolean;
|
|
32
|
+
/** Currency for cart creation. Required when `enableCart` is true unless the server has a default. */
|
|
33
|
+
currency?: string;
|
|
34
|
+
/** Optional ISO country code used for commercetools price selection. */
|
|
35
|
+
country?: string;
|
|
36
|
+
productSelect: EventEmitter<ProductCard>;
|
|
37
|
+
/** Fires after every cart fetch or mutation when `enableCart` is true. */
|
|
38
|
+
cartChange: EventEmitter<CartSnapshot | null>;
|
|
39
|
+
/** Opens the host-owned checkout route for the current non-empty cart. */
|
|
40
|
+
checkout: EventEmitter<CartSnapshot>;
|
|
41
|
+
cameraInputRef?: ElementRef<HTMLInputElement>;
|
|
42
|
+
cameraVideoRef?: ElementRef<HTMLVideoElement>;
|
|
43
|
+
query: string;
|
|
44
|
+
suggestions: string[];
|
|
45
|
+
activeSuggestionIndex: number;
|
|
46
|
+
isLoadingSuggestions: boolean;
|
|
47
|
+
suggestionsError: string | null;
|
|
48
|
+
suggestionsReady: boolean;
|
|
49
|
+
suggestionsDismissed: boolean;
|
|
50
|
+
results: ProductCard[];
|
|
51
|
+
mission: MissionSearchResult | null;
|
|
52
|
+
hasFacetSession: boolean;
|
|
53
|
+
addedProductIds: Record<string, true>;
|
|
54
|
+
meta: {
|
|
55
|
+
queryInterpretation?: string;
|
|
56
|
+
searchTerms?: string[];
|
|
57
|
+
appliedFilters?: InterpretedSearchFilters;
|
|
58
|
+
} | null;
|
|
59
|
+
facets: SearchFacetGroup[];
|
|
60
|
+
suggestedFacets: SuggestedFacet[];
|
|
61
|
+
isLoading: boolean;
|
|
62
|
+
hasSearched: boolean;
|
|
63
|
+
error: string | null;
|
|
64
|
+
isDragging: boolean;
|
|
65
|
+
isRecording: boolean;
|
|
66
|
+
isProcessing: boolean;
|
|
67
|
+
isCameraOpen: boolean;
|
|
68
|
+
cameraError: string | null;
|
|
69
|
+
lastSearchMode: SearchMode;
|
|
70
|
+
audioSummary: string | null;
|
|
71
|
+
private mediaRecorder;
|
|
72
|
+
private audioChunks;
|
|
73
|
+
private cameraStream;
|
|
74
|
+
private debounceTimer;
|
|
75
|
+
private suggestionsTimer;
|
|
76
|
+
private searchAbort;
|
|
77
|
+
private suggestionsAbort;
|
|
78
|
+
private searchRequestId;
|
|
79
|
+
private suggestionsRequestId;
|
|
80
|
+
private addedTimeouts;
|
|
81
|
+
private destroyed;
|
|
82
|
+
readonly addMissionItems: (items: AddToCartLineItem[]) => Promise<CartSnapshot | null>;
|
|
83
|
+
ngOnInit(): void;
|
|
84
|
+
ngOnChanges(): void;
|
|
85
|
+
ngOnDestroy(): void;
|
|
86
|
+
get resolvedMessages(): CommerceAISearchMessages;
|
|
87
|
+
get showSuggestions(): boolean;
|
|
88
|
+
get activeSuggestionId(): string | null;
|
|
89
|
+
get showMission(): boolean;
|
|
90
|
+
get showMissionVisible(): boolean;
|
|
91
|
+
get missionLaneCount(): number;
|
|
92
|
+
get cartQuantity(): number;
|
|
93
|
+
get cartBadgeLabel(): string;
|
|
94
|
+
get cartAriaLabel(): string;
|
|
95
|
+
get showResults(): boolean;
|
|
96
|
+
get showVoiceReplay(): boolean;
|
|
97
|
+
onQueryChange(value: string): void;
|
|
98
|
+
onSuggestionSelect(suggestion: string): void;
|
|
99
|
+
onInputKeyDown(event: KeyboardEvent): void;
|
|
100
|
+
private fetchSuggestions;
|
|
101
|
+
private clearResults;
|
|
102
|
+
private get localeFields();
|
|
103
|
+
isFacetSelected(facetId: string, key: string): boolean;
|
|
104
|
+
facetSwatch(facetId: string, key: string): string | undefined;
|
|
105
|
+
get hasAppliedFilters(): boolean;
|
|
106
|
+
toggleFacet(facetId: string, key: string): void;
|
|
107
|
+
clearFacetFilters(): void;
|
|
108
|
+
startNewSearch(): void;
|
|
109
|
+
private searchWithFacets;
|
|
110
|
+
onSubmit(): void;
|
|
111
|
+
onFileSelected(event: Event): void;
|
|
112
|
+
onCameraFileSelected(event: Event): void;
|
|
113
|
+
openCamera(): void;
|
|
114
|
+
openCameraOverlay(): Promise<void>;
|
|
115
|
+
capturePhoto(): Promise<void>;
|
|
116
|
+
closeCamera(): void;
|
|
117
|
+
clearCameraError(): void;
|
|
118
|
+
onDragOver(event: DragEvent): void;
|
|
119
|
+
onDrop(event: DragEvent): void;
|
|
120
|
+
searchByImage(file: File): void;
|
|
121
|
+
toggleRecording(): Promise<void>;
|
|
122
|
+
replayVoiceSummary(): void;
|
|
123
|
+
addToCartLabel(product: ProductCard): string;
|
|
124
|
+
onAddItem(product: ProductCard): void;
|
|
125
|
+
onCartRemove(lineItemId: string): void;
|
|
126
|
+
onCartQuantityChange(event: {
|
|
127
|
+
lineItemId: string;
|
|
128
|
+
quantity: number;
|
|
129
|
+
}): void;
|
|
130
|
+
onCartLogin(input: {
|
|
131
|
+
email: string;
|
|
132
|
+
password: string;
|
|
133
|
+
}): void;
|
|
134
|
+
onCartLogout(): void;
|
|
135
|
+
private applySearchResult;
|
|
136
|
+
private syncCart;
|
|
137
|
+
private handleAddToCart;
|
|
138
|
+
private clearVoiceAudio;
|
|
139
|
+
}
|
|
140
|
+
export {};
|
|
141
|
+
//# sourceMappingURL=commerce-ai-search.component.d.ts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AAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAE5D;IAED,YAAY,IAAI,IAAI,CAEnB;IAED,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,QAAQ;YAWF,eAAe;IA4B7B,OAAO,CAAC,eAAe;CAGxB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AddToCartLineItem, MissionSearchResult, ProductCard } from "../vendor-core/client.js";
|
|
2
|
+
export declare function formatMissionAddAll(template: string, count: number): string;
|
|
3
|
+
export declare function toCartItem(product: ProductCard, quantity: number): AddToCartLineItem;
|
|
4
|
+
export declare function lineItemKey(item: AddToCartLineItem): string;
|
|
5
|
+
export declare function starterBundleItems(mission: MissionSearchResult): AddToCartLineItem[];
|
|
6
|
+
//# sourceMappingURL=mission.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mission.util.d.ts","sourceRoot":"","sources":["../../src/lib/mission.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEzG,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM3E;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAIpF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAK3D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,iBAAiB,EAAE,CAoBpF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe core surface for the React and Angular widgets.
|
|
3
|
+
* Do not re-export AI, commercetools, or observability from this entry.
|
|
4
|
+
*/
|
|
5
|
+
export type * from "./types/index.js";
|
|
6
|
+
export { CART_SESSION_HEADER, MAX_LINE_ITEM_QUANTITY } from "./types/index.js";
|
|
7
|
+
export { DEFAULT_COMMERCE_AI_SEARCH_MESSAGES, resolveCommerceAISearchMessages, } from "./messages/index.js";
|
|
8
|
+
export type { CommerceAISearchMessages } from "./messages/index.js";
|
|
9
|
+
export { looksLikeCompoundShoppingList } from "./search/compound-shopping-list.js";
|
|
10
|
+
export { isFacetFilterSelected, toggleFacetFilter, } from "./commercetools/facets.js";
|
|
11
|
+
export { hexColorSwatchValue, isColorLikeFacetName, } from "./commercetools/facet-color.js";
|
|
12
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-safe core surface for the React and Angular widgets.
|
|
3
|
+
* Do not re-export AI, commercetools, or observability from this entry.
|
|
4
|
+
*/
|
|
5
|
+
export type * from "./types/index.js";
|
|
6
|
+
export { CART_SESSION_HEADER, MAX_LINE_ITEM_QUANTITY } from "./types/index.js";
|
|
7
|
+
export { DEFAULT_COMMERCE_AI_SEARCH_MESSAGES, resolveCommerceAISearchMessages, } from "./messages/index.js";
|
|
8
|
+
export type { CommerceAISearchMessages } from "./messages/index.js";
|
|
9
|
+
export { looksLikeCompoundShoppingList } from "./search/compound-shopping-list.js";
|
|
10
|
+
export { isFacetFilterSelected, toggleFacetFilter, } from "./commercetools/facets.js";
|
|
11
|
+
export { hexColorSwatchValue, isColorLikeFacetName, } from "./commercetools/facet-color.js";
|
|
12
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** True when a facet id looks like a color/finish attribute (`color-code`, `finish-code`). */
|
|
2
|
+
export declare function isColorLikeFacetName(name: string): boolean;
|
|
3
|
+
/** True when a facet bucket key is a CSS hex color (`#RGB` or `#RRGGBB`). */
|
|
4
|
+
export declare function isHexColorFacetKey(value: string): boolean;
|
|
5
|
+
/** Normalized `#rrggbb` for a hex facet key, or `undefined` when not a color. */
|
|
6
|
+
export declare function hexColorSwatchValue(value: string): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Human-readable facet chip label. Hex keys on color/finish facets become the
|
|
9
|
+
* nearest CSS color name when close enough; other keys are unchanged.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatFacetBucketLabel(key: string, facetName?: string): string;
|
|
12
|
+
//# sourceMappingURL=facet-color.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FacetAttributeDefinition, InterpretedSearchFilters, ResolvedFacetSchema, SearchFacetGroup, SuggestedFacet } from "../types/index.js";
|
|
2
|
+
export declare const PRICE_FACET_ID = "price";
|
|
3
|
+
export declare const CATEGORIES_FACET_ID = "categories";
|
|
4
|
+
export declare const DEFAULT_PRICE_RANGES: readonly [{
|
|
5
|
+
readonly key: "under-50";
|
|
6
|
+
readonly to: 5000;
|
|
7
|
+
}, {
|
|
8
|
+
readonly key: "50-to-100";
|
|
9
|
+
readonly from: 5000;
|
|
10
|
+
readonly to: 10000;
|
|
11
|
+
}, {
|
|
12
|
+
readonly key: "100-plus";
|
|
13
|
+
readonly from: 10000;
|
|
14
|
+
}];
|
|
15
|
+
export type PriceRangeDefinition = (typeof DEFAULT_PRICE_RANGES)[number];
|
|
16
|
+
/** Major currency units (e.g. EUR) corresponding to a price range bucket. */
|
|
17
|
+
export declare function priceRangeToFilterValues(range: PriceRangeDefinition): Pick<InterpretedSearchFilters, "priceMin" | "priceMax">;
|
|
18
|
+
export declare function priceBucketKeyFromFilters(filters: InterpretedSearchFilters): string | undefined;
|
|
19
|
+
export declare function isFacetFilterSelected(filters: InterpretedSearchFilters, facetId: string, bucketKey: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Toggle a facet chip into filter state. Price buckets map to priceMin/priceMax;
|
|
22
|
+
* categories map to `category`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toggleFacetFilter(filters: InterpretedSearchFilters, facetId: string, bucketKey: string): InterpretedSearchFilters;
|
|
25
|
+
export declare function buildProductSearchFacets(schema: ResolvedFacetSchema, suggestedFacets?: SuggestedFacet[]): unknown[];
|
|
26
|
+
/** Product Projection Search `facet` query parameter expressions. */
|
|
27
|
+
export declare function buildProjectionFacetParams(schema: ResolvedFacetSchema, suggestedFacets?: SuggestedFacet[]): string[];
|
|
28
|
+
export declare function normalizeProductSearchFacets(rawFacets: unknown, schema: ResolvedFacetSchema, suggestedFacets?: SuggestedFacet[], filters?: InterpretedSearchFilters): SearchFacetGroup[];
|
|
29
|
+
export declare function filterFacetSuggestions(suggestedFacets: SuggestedFacet[] | undefined, schema: ResolvedFacetSchema): SuggestedFacet[];
|
|
30
|
+
export declare function getFacetAttribute(schema: ResolvedFacetSchema, name: string): FacetAttributeDefinition | undefined;
|
|
31
|
+
//# sourceMappingURL=facets.d.ts.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export interface CommerceAISearchMessages {
|
|
2
|
+
placeholder: string;
|
|
3
|
+
searchAriaLabel: string;
|
|
4
|
+
productSearchAriaLabel: string;
|
|
5
|
+
searchResultsAriaLabel: string;
|
|
6
|
+
searching: string;
|
|
7
|
+
noProductsFound: string;
|
|
8
|
+
searchedFor: string;
|
|
9
|
+
dropImageToSearch: string;
|
|
10
|
+
voiceSearch: string;
|
|
11
|
+
stopRecording: string;
|
|
12
|
+
searchByCamera: string;
|
|
13
|
+
searchByImage: string;
|
|
14
|
+
replayVoiceSummary: string;
|
|
15
|
+
listening: string;
|
|
16
|
+
tapMicToStop: string;
|
|
17
|
+
understandingQuery: string;
|
|
18
|
+
preparingAudioSummary: string;
|
|
19
|
+
cameraCapture: string;
|
|
20
|
+
cameraPreview: string;
|
|
21
|
+
capturePhoto: string;
|
|
22
|
+
cancel: string;
|
|
23
|
+
dismiss: string;
|
|
24
|
+
searchFailed: string;
|
|
25
|
+
imageSearchFailed: string;
|
|
26
|
+
couldNotCapturePhoto: string;
|
|
27
|
+
suggestionsAriaLabel: string;
|
|
28
|
+
loadingSuggestions: string;
|
|
29
|
+
noSuggestions: string;
|
|
30
|
+
filtersAriaLabel: string;
|
|
31
|
+
clearFilters: string;
|
|
32
|
+
narrowResults: string;
|
|
33
|
+
newSearch: string;
|
|
34
|
+
addToCart: string;
|
|
35
|
+
cart: string;
|
|
36
|
+
emptyCart: string;
|
|
37
|
+
removeItem: string;
|
|
38
|
+
total: string;
|
|
39
|
+
each: string;
|
|
40
|
+
cartAriaLabel: string;
|
|
41
|
+
itemAdded: string;
|
|
42
|
+
increaseQuantity: string;
|
|
43
|
+
decreaseQuantity: string;
|
|
44
|
+
closeCart: string;
|
|
45
|
+
unableToAddToCart: string;
|
|
46
|
+
missionTitle: string;
|
|
47
|
+
missionQuantity: string;
|
|
48
|
+
/** Adds the first (recommended) product from each filled lane. Use `{count}` for the number of picks. */
|
|
49
|
+
missionAddAll: string;
|
|
50
|
+
missionItemsAdded: string;
|
|
51
|
+
missionSelectProduct: string;
|
|
52
|
+
missionIntentEmpty: string;
|
|
53
|
+
missionIntentFailed: string;
|
|
54
|
+
signIn: string;
|
|
55
|
+
signInToSyncCart: string;
|
|
56
|
+
signOut: string;
|
|
57
|
+
email: string;
|
|
58
|
+
password: string;
|
|
59
|
+
signedInAs: string;
|
|
60
|
+
invalidCredentials: string;
|
|
61
|
+
signInFailed: string;
|
|
62
|
+
checkout: string;
|
|
63
|
+
checkoutTitle: string;
|
|
64
|
+
orderSummary: string;
|
|
65
|
+
shippingAddress: string;
|
|
66
|
+
billingAddress: string;
|
|
67
|
+
billingSameAsShipping: string;
|
|
68
|
+
continueToDelivery: string;
|
|
69
|
+
shippingMethod: string;
|
|
70
|
+
selectShippingMethod: string;
|
|
71
|
+
noShippingMethods: string;
|
|
72
|
+
completeAddressToContinue: string;
|
|
73
|
+
selectDeliveryToContinue: string;
|
|
74
|
+
selectPaymentToContinue: string;
|
|
75
|
+
checkoutStepAddress: string;
|
|
76
|
+
checkoutStepDelivery: string;
|
|
77
|
+
checkoutStepPayment: string;
|
|
78
|
+
paymentMethod: string;
|
|
79
|
+
selectPaymentMethod: string;
|
|
80
|
+
paymentAuthorized: string;
|
|
81
|
+
paymentDeclined: string;
|
|
82
|
+
continueToPayment: string;
|
|
83
|
+
placeOrder: string;
|
|
84
|
+
placingOrder: string;
|
|
85
|
+
orderPlaced: string;
|
|
86
|
+
viewOrderStatus: string;
|
|
87
|
+
continueShopping: string;
|
|
88
|
+
checkoutFailed: string;
|
|
89
|
+
orderStatus: string;
|
|
90
|
+
orderPlacedAt: string;
|
|
91
|
+
paymentStateLabel: string;
|
|
92
|
+
shipmentStateLabel: string;
|
|
93
|
+
trackingNumber: string;
|
|
94
|
+
carrier: string;
|
|
95
|
+
noTrackingYet: string;
|
|
96
|
+
orderNotFound: string;
|
|
97
|
+
noOrdersYet: string;
|
|
98
|
+
yourOrders: string;
|
|
99
|
+
firstName: string;
|
|
100
|
+
lastName: string;
|
|
101
|
+
streetName: string;
|
|
102
|
+
additionalAddress: string;
|
|
103
|
+
postalCode: string;
|
|
104
|
+
city: string;
|
|
105
|
+
region: string;
|
|
106
|
+
country: string;
|
|
107
|
+
}
|
|
108
|
+
export declare const DEFAULT_COMMERCE_AI_SEARCH_MESSAGES: CommerceAISearchMessages;
|
|
109
|
+
export declare function resolveCommerceAISearchMessages(overrides?: Partial<CommerceAISearchMessages>): CommerceAISearchMessages;
|
|
110
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface PaymentMethodOption {
|
|
2
|
+
method: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PaymentAuthorizationRequest {
|
|
7
|
+
cartId: string;
|
|
8
|
+
/** Shared with order creation so retries stay idempotent. */
|
|
9
|
+
orderNumber: string;
|
|
10
|
+
method: string;
|
|
11
|
+
amount: {
|
|
12
|
+
centAmount: number;
|
|
13
|
+
currencyCode: string;
|
|
14
|
+
};
|
|
15
|
+
locale: string;
|
|
16
|
+
country?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PaymentAuthorizationResult {
|
|
20
|
+
status: "authorized" | "pending" | "failed";
|
|
21
|
+
/** PSP charge / intent / transaction reference. */
|
|
22
|
+
interfaceId?: string;
|
|
23
|
+
failureReason?: string;
|
|
24
|
+
/** Opaque client payload (redirect / SCA). Never include secrets. */
|
|
25
|
+
clientData?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
export interface PaymentProvider {
|
|
28
|
+
readonly paymentInterface: string;
|
|
29
|
+
listMethods(context: {
|
|
30
|
+
locale: string;
|
|
31
|
+
country?: string;
|
|
32
|
+
}): Promise<PaymentMethodOption[]>;
|
|
33
|
+
authorize(request: PaymentAuthorizationRequest): Promise<PaymentAuthorizationResult>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heuristic for the search box: a new multi-item query should not be treated as
|
|
3
|
+
* a facet NL refine of the previous session.
|
|
4
|
+
*/
|
|
5
|
+
export declare function looksLikeCompoundShoppingList(query: string): boolean;
|
|
6
|
+
//# sourceMappingURL=compound-shopping-list.d.ts.map
|