@01.software/sdk 0.35.0 → 0.37.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/README.md +71 -6
- package/dist/analytics/react.cjs +33 -9
- package/dist/analytics/react.cjs.map +1 -1
- package/dist/analytics/react.d.cts +1 -1
- package/dist/analytics/react.d.ts +1 -1
- package/dist/analytics/react.js +33 -9
- package/dist/analytics/react.js.map +1 -1
- package/dist/analytics.cjs +30 -8
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.d.cts +6 -0
- package/dist/analytics.d.ts +6 -0
- package/dist/analytics.js +30 -8
- package/dist/analytics.js.map +1 -1
- package/dist/client.cjs +94 -114
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +94 -114
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-DkREjhQ9.d.ts → collection-client-DyELGUcL.d.ts} +3 -3
- package/dist/{collection-client-CR2B8c1v.d.cts → collection-client-zOmnxwdA.d.cts} +3 -3
- package/dist/{const-CdqCauHQ.d.ts → const-CK_FPaIn.d.cts} +3 -3
- package/dist/{const-BTvdrXtY.d.cts → const-Dqz05oaG.d.ts} +3 -3
- package/dist/{image-BDz2-AaO.d.cts → image-BDjHp03R.d.cts} +13 -9
- package/dist/{image-BDz2-AaO.d.ts → image-BDjHp03R.d.ts} +13 -9
- package/dist/{index-DK8_NXkh.d.ts → index-DRJs7QIh.d.cts} +9 -6
- package/dist/{index-CjA3U6X3.d.cts → index-DTqoUZk_.d.ts} +9 -6
- package/dist/index.cjs +229 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +229 -136
- package/dist/index.js.map +1 -1
- package/dist/metadata.cjs +5 -3
- package/dist/metadata.cjs.map +1 -1
- package/dist/metadata.js +5 -3
- package/dist/metadata.js.map +1 -1
- package/dist/{payload-types-C7tb7Xbs.d.cts → payload-types-CREOjFNT.d.cts} +281 -128
- package/dist/{payload-types-C7tb7Xbs.d.ts → payload-types-CREOjFNT.d.ts} +281 -128
- package/dist/query.cjs +5 -3
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +5 -3
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +99 -69
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +99 -69
- package/dist/server.js.map +1 -1
- package/dist/{types-DDhtZI6E.d.cts → types-BWMUr3Zw.d.cts} +274 -84
- package/dist/{types-Bx558PU6.d.cts → types-BkZNhuBh.d.cts} +1 -1
- package/dist/{types-1ylMrCuW.d.ts → types-CxzWHspI.d.ts} +1 -1
- package/dist/{types-Byo_Rty4.d.ts → types-DMvVHdb1.d.ts} +274 -84
- package/dist/ui/canvas.cjs +15 -5
- package/dist/ui/canvas.cjs.map +1 -1
- package/dist/ui/canvas.d.cts +1 -1
- package/dist/ui/canvas.d.ts +1 -1
- package/dist/ui/canvas.js +15 -5
- package/dist/ui/canvas.js.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/image.cjs +15 -5
- package/dist/ui/image.cjs.map +1 -1
- package/dist/ui/image.d.cts +1 -1
- package/dist/ui/image.d.ts +1 -1
- package/dist/ui/image.js +15 -5
- package/dist/ui/image.js.map +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.cjs +5 -1
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +4 -4
- package/dist/webhook.d.ts +4 -4
- package/dist/webhook.js +5 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,31 @@
|
|
|
1
|
-
import { P as PublicCollection, S as ServerCollection } from './const-
|
|
2
|
-
import { C as CollectionType, P as PublicProduct } from './types-
|
|
3
|
-
import { O as Order, i as Cart, j as CartItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-
|
|
1
|
+
import { P as PublicCollection, S as ServerCollection } from './const-Dqz05oaG.js';
|
|
2
|
+
import { C as CollectionType, P as PublicProduct } from './types-CxzWHspI.js';
|
|
3
|
+
import { O as Order, i as Cart, j as CartItem, m as Transaction, n as Fulfillment, o as Return } from './payload-types-CREOjFNT.js';
|
|
4
|
+
|
|
5
|
+
interface CustomerScopedApiOptions {
|
|
6
|
+
publishableKey?: string;
|
|
7
|
+
secretKey?: string;
|
|
8
|
+
apiUrl?: string;
|
|
9
|
+
customerToken?: string | (() => string | null);
|
|
10
|
+
onUnauthorized?: () => Promise<string | null>;
|
|
11
|
+
onRequestId?: (id: string | null) => void;
|
|
12
|
+
requiresCredential?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface CustomerScopedRequestOptions {
|
|
15
|
+
method: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
16
|
+
body?: unknown;
|
|
17
|
+
headers?: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
declare class CustomerScopedApi {
|
|
20
|
+
private readonly publishableKey;
|
|
21
|
+
private readonly secretKey?;
|
|
22
|
+
private readonly apiUrl?;
|
|
23
|
+
private readonly customerToken?;
|
|
24
|
+
private readonly onUnauthorized?;
|
|
25
|
+
private readonly onRequestId?;
|
|
26
|
+
constructor(apiName: string, options: CustomerScopedApiOptions);
|
|
27
|
+
protected request<T>(endpoint: string, options: CustomerScopedRequestOptions): Promise<T>;
|
|
28
|
+
}
|
|
4
29
|
|
|
5
30
|
interface CommunityClientOptions {
|
|
6
31
|
publishableKey?: string;
|
|
@@ -60,18 +85,13 @@ interface PaginatedResponse<T> {
|
|
|
60
85
|
prevPage: number | null;
|
|
61
86
|
nextPage: number | null;
|
|
62
87
|
}
|
|
63
|
-
declare class CommunityClient {
|
|
64
|
-
private readonly publishableKey;
|
|
65
|
-
private readonly secretKey?;
|
|
66
|
-
private readonly apiUrl?;
|
|
67
|
-
private readonly customerToken?;
|
|
68
|
-
private readonly onUnauthorized?;
|
|
69
|
-
private readonly onRequestId?;
|
|
88
|
+
declare class CommunityClient extends CustomerScopedApi {
|
|
70
89
|
constructor(options: CommunityClientOptions);
|
|
71
90
|
private buildQuery;
|
|
72
91
|
private buildPostsListQuery;
|
|
73
92
|
private buildCommentsListQuery;
|
|
74
93
|
private execute;
|
|
94
|
+
private executeDoc;
|
|
75
95
|
createPost(params: {
|
|
76
96
|
title?: string | null;
|
|
77
97
|
content?: unknown;
|
|
@@ -441,13 +461,7 @@ type RemoveDiscountParams = {
|
|
|
441
461
|
type ClearCartParams = {
|
|
442
462
|
cartId: string;
|
|
443
463
|
};
|
|
444
|
-
declare class CartApi {
|
|
445
|
-
private readonly publishableKey;
|
|
446
|
-
private readonly secretKey?;
|
|
447
|
-
private readonly apiUrl?;
|
|
448
|
-
private readonly customerToken?;
|
|
449
|
-
private readonly onUnauthorized?;
|
|
450
|
-
private readonly onRequestId?;
|
|
464
|
+
declare class CartApi extends CustomerScopedApi {
|
|
451
465
|
constructor(options: CartApiOptions);
|
|
452
466
|
private execute;
|
|
453
467
|
getCart(cartId: string): Promise<Cart>;
|
|
@@ -805,6 +819,48 @@ type ProductListingCardOptions = {
|
|
|
805
819
|
declare function buildProductHref(product: ProductHrefProduct, group?: ProductHrefGroup | null, options?: ProductHrefOptions): string;
|
|
806
820
|
declare function buildProductListingProjection(product: ProductListingProductShape | null | undefined, variants: ProductVariantShape[]): ProductListingProjection;
|
|
807
821
|
declare function buildProductListingCard(item: ProductListingGroupsItem, options?: ProductListingCardOptions): ProductListingCard;
|
|
822
|
+
/** Shopify `priceRangeV2` naming for persisted listing projection fields. */
|
|
823
|
+
declare function toShopifyPriceRangeV2(listing: {
|
|
824
|
+
minPrice?: number | null;
|
|
825
|
+
maxPrice?: number | null;
|
|
826
|
+
}): {
|
|
827
|
+
minVariantPrice: {
|
|
828
|
+
amount: number | null;
|
|
829
|
+
};
|
|
830
|
+
maxVariantPrice: {
|
|
831
|
+
amount: number | null;
|
|
832
|
+
};
|
|
833
|
+
};
|
|
834
|
+
/**
|
|
835
|
+
* PLP-safe query preset for the `products` collection.
|
|
836
|
+
*
|
|
837
|
+
* Payload's top-level `type: 'join'` fields on `products` (`variants`,
|
|
838
|
+
* `options`) return at most 10 docs by default when queried via the REST API.
|
|
839
|
+
* Storefront PLPs calling `client.collections.from('products').find()` without
|
|
840
|
+
* explicit join limits silently receive truncated variant/option join data.
|
|
841
|
+
* `buildProductListingGroupsByOption()` then drops primary-option values with
|
|
842
|
+
* no matching variant in the response — a common cause of missing color swatches
|
|
843
|
+
* even when the product has more variants than the default join cap.
|
|
844
|
+
*
|
|
845
|
+
* Spread this constant into your `find()` call to raise both top-level limits:
|
|
846
|
+
*
|
|
847
|
+
* ```typescript
|
|
848
|
+
* const { docs } = await client.collections.from('products').find({
|
|
849
|
+
* ...PRODUCT_PLP_FIND_OPTIONS,
|
|
850
|
+
* where: { status: { equals: 'published' } },
|
|
851
|
+
* limit: 24,
|
|
852
|
+
* })
|
|
853
|
+
* ```
|
|
854
|
+
*
|
|
855
|
+
* **Limitation:** This preset cures top-level `products.options` and
|
|
856
|
+
* `products.variants` join truncation. It cannot cure the nested
|
|
857
|
+
* `options[].values.docs` join — the Payload REST `joins` param is flat and
|
|
858
|
+
* nested join limits require the listing-groups endpoint. Prefer
|
|
859
|
+
* `commerce.product.listingGroupsCatalog()` + `buildProductListingCard()` as
|
|
860
|
+
* the primary PLP path; they apply unlimited join fetches server-side and
|
|
861
|
+
* return pre-grouped data ready for rendering.
|
|
862
|
+
*/
|
|
863
|
+
declare const PRODUCT_PLP_FIND_OPTIONS: ApiQueryOptions;
|
|
808
864
|
/**
|
|
809
865
|
* Builds product-first listing groups for one primary option.
|
|
810
866
|
*
|
|
@@ -819,6 +875,95 @@ declare function buildProductListingGroupsByOption<TVariant extends ProductVaria
|
|
|
819
875
|
primaryOptionId?: string | null;
|
|
820
876
|
}): ProductListingGroup<TVariant>[];
|
|
821
877
|
|
|
878
|
+
type ProductUpsertColorSwatchInput = {
|
|
879
|
+
type: 'color';
|
|
880
|
+
color: string;
|
|
881
|
+
mediaItemId?: null;
|
|
882
|
+
};
|
|
883
|
+
type ProductUpsertMediaSwatchInput = {
|
|
884
|
+
type: 'media';
|
|
885
|
+
mediaItemId: string;
|
|
886
|
+
color?: null;
|
|
887
|
+
};
|
|
888
|
+
type ProductUpsertSwatchInput = ProductUpsertColorSwatchInput | ProductUpsertMediaSwatchInput;
|
|
889
|
+
type ProductUpsertOptionValueInput = {
|
|
890
|
+
id?: string;
|
|
891
|
+
value: string;
|
|
892
|
+
slug?: string;
|
|
893
|
+
swatch?: ProductUpsertSwatchInput | null;
|
|
894
|
+
metadata?: unknown;
|
|
895
|
+
};
|
|
896
|
+
type OptionValueInput = ProductUpsertOptionValueInput;
|
|
897
|
+
type OptionInput = {
|
|
898
|
+
id?: string;
|
|
899
|
+
title: string;
|
|
900
|
+
slug?: string;
|
|
901
|
+
values: OptionValueInput[];
|
|
902
|
+
};
|
|
903
|
+
type VariantInput = {
|
|
904
|
+
id?: string;
|
|
905
|
+
optionValues?: Record<string, string | {
|
|
906
|
+
valueSlug?: string;
|
|
907
|
+
valueId?: string;
|
|
908
|
+
value?: string;
|
|
909
|
+
}> | string[];
|
|
910
|
+
sku?: string | null;
|
|
911
|
+
title?: string | null;
|
|
912
|
+
price: number;
|
|
913
|
+
compareAtPrice?: number | null;
|
|
914
|
+
stock?: number;
|
|
915
|
+
isUnlimited?: boolean;
|
|
916
|
+
weight?: number | null;
|
|
917
|
+
requiresShipping?: boolean;
|
|
918
|
+
barcode?: string | null;
|
|
919
|
+
externalId?: string | null;
|
|
920
|
+
isActive?: boolean;
|
|
921
|
+
images?: string[];
|
|
922
|
+
metadata?: unknown;
|
|
923
|
+
};
|
|
924
|
+
type ProductFieldsInput = {
|
|
925
|
+
id?: string;
|
|
926
|
+
title?: string;
|
|
927
|
+
subtitle?: string | null;
|
|
928
|
+
description?: string | null;
|
|
929
|
+
status?: string;
|
|
930
|
+
slug?: string;
|
|
931
|
+
primaryMediaItemId?: string | null;
|
|
932
|
+
thumbnail?: string | null;
|
|
933
|
+
images?: string[];
|
|
934
|
+
vendor?: string | null;
|
|
935
|
+
productType?: string | null;
|
|
936
|
+
brand?: string | null;
|
|
937
|
+
shippingPolicy?: string | null;
|
|
938
|
+
weight?: number | null;
|
|
939
|
+
minOrderQuantity?: number | null;
|
|
940
|
+
maxOrderQuantity?: number | null;
|
|
941
|
+
isFeatured?: boolean;
|
|
942
|
+
publishedAt?: string | null;
|
|
943
|
+
categories?: string[];
|
|
944
|
+
tags?: string[];
|
|
945
|
+
metadata?: unknown;
|
|
946
|
+
};
|
|
947
|
+
type ProductUpsertGraphFields = {
|
|
948
|
+
/** Required when updating an existing product graph if the server graph is non-empty. */
|
|
949
|
+
graphRevision?: string;
|
|
950
|
+
options?: OptionInput[];
|
|
951
|
+
variants?: VariantInput[];
|
|
952
|
+
};
|
|
953
|
+
/** Create a product document and initial graph. */
|
|
954
|
+
type ProductUpsertCreateInput = ProductUpsertGraphFields & {
|
|
955
|
+
productId?: never;
|
|
956
|
+
product: ProductFieldsInput & {
|
|
957
|
+
title: string;
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
/** Graph-only update for an existing product (document fields via Payload save). */
|
|
961
|
+
type ProductUpsertEditInput = ProductUpsertGraphFields & {
|
|
962
|
+
productId: string;
|
|
963
|
+
product?: never;
|
|
964
|
+
};
|
|
965
|
+
type ProductUpsertInput = ProductUpsertCreateInput | ProductUpsertEditInput;
|
|
966
|
+
|
|
822
967
|
type ProductApiOptions = ServerApiOptions;
|
|
823
968
|
type StockCheckParams = {
|
|
824
969
|
items: Array<{
|
|
@@ -842,8 +987,6 @@ type StockCheckResponse = {
|
|
|
842
987
|
type ListingGroupsParams = {
|
|
843
988
|
productIds: string[];
|
|
844
989
|
};
|
|
845
|
-
type ListingGroupingState = 'grouped' | 'no_primary_option' | 'empty';
|
|
846
|
-
type ListingGroupingEmptyReason = 'primary_option_not_linked' | 'primary_option_has_no_values' | 'no_variants_for_primary_option';
|
|
847
990
|
type ProductListingGroupVariant = Pick<ProductVariantShape, 'id' | 'optionValues' | 'price' | 'compareAtPrice' | 'stock' | 'isUnlimited' | 'isActive' | 'thumbnail' | 'images' | '_order'>;
|
|
848
991
|
type ProductListingGroupSummary = ProductListingGroup<ProductListingGroupVariant>;
|
|
849
992
|
type ProductListingGroupsProductVariants = NonNullable<PublicProduct['variants']>;
|
|
@@ -861,10 +1004,6 @@ type ProductListingGroupsProduct = Omit<PublicProduct, 'variants'> & {
|
|
|
861
1004
|
};
|
|
862
1005
|
type ProductListingGroupsItem = {
|
|
863
1006
|
product: ProductListingGroupsProduct;
|
|
864
|
-
primaryOptionId: string | null;
|
|
865
|
-
listingGroupingState: ListingGroupingState;
|
|
866
|
-
/** Present only when `listingGroupingState` is `empty`. */
|
|
867
|
-
listingGroupingEmptyReason: ListingGroupingEmptyReason | null;
|
|
868
1007
|
groups: ProductListingGroupSummary[];
|
|
869
1008
|
};
|
|
870
1009
|
type ProductListingGroupsResponse = {
|
|
@@ -913,7 +1052,6 @@ type ProductOptionValueMediaSwatch<TMedia = ProductDetailMedia> = {
|
|
|
913
1052
|
color?: null;
|
|
914
1053
|
};
|
|
915
1054
|
type ProductOptionValueSwatch<TMedia = ProductDetailMedia> = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<TMedia> | null;
|
|
916
|
-
type ProductUpsertSwatchInput = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<string>;
|
|
917
1055
|
type ProductDetailMediaValue = string | number | ProductDetailMedia | null;
|
|
918
1056
|
type ProductDetailSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
|
|
919
1057
|
interface ProductDetailVariant {
|
|
@@ -1057,49 +1195,7 @@ type ProductDetailCatalogResult = {
|
|
|
1057
1195
|
found: false;
|
|
1058
1196
|
reason: ProductDetailUnavailableReason;
|
|
1059
1197
|
};
|
|
1060
|
-
type
|
|
1061
|
-
id?: string;
|
|
1062
|
-
value: string;
|
|
1063
|
-
slug?: string;
|
|
1064
|
-
swatch?: ProductUpsertSwatchInput | null;
|
|
1065
|
-
metadata?: unknown;
|
|
1066
|
-
};
|
|
1067
|
-
type ProductUpsertOptionInput = {
|
|
1068
|
-
id?: string;
|
|
1069
|
-
title: string;
|
|
1070
|
-
slug?: string;
|
|
1071
|
-
values: ProductUpsertOptionValueInput[];
|
|
1072
|
-
};
|
|
1073
|
-
type ProductUpsertVariantOptionValue = string | {
|
|
1074
|
-
valueSlug?: string;
|
|
1075
|
-
valueId?: string;
|
|
1076
|
-
value?: string;
|
|
1077
|
-
};
|
|
1078
|
-
type ProductUpsertVariantInput = {
|
|
1079
|
-
id?: string;
|
|
1080
|
-
optionValues?: Record<string, ProductUpsertVariantOptionValue> | string[];
|
|
1081
|
-
sku?: string | null;
|
|
1082
|
-
title?: string | null;
|
|
1083
|
-
price: number;
|
|
1084
|
-
compareAtPrice?: number | null;
|
|
1085
|
-
stock?: number;
|
|
1086
|
-
isUnlimited?: boolean;
|
|
1087
|
-
weight?: number | null;
|
|
1088
|
-
requiresShipping?: boolean;
|
|
1089
|
-
barcode?: string | null;
|
|
1090
|
-
externalId?: string | null;
|
|
1091
|
-
isActive?: boolean;
|
|
1092
|
-
images?: string[];
|
|
1093
|
-
metadata?: unknown;
|
|
1094
|
-
};
|
|
1095
|
-
type ProductUpsertParams = {
|
|
1096
|
-
product: Record<string, unknown> & {
|
|
1097
|
-
id?: string;
|
|
1098
|
-
title?: string;
|
|
1099
|
-
};
|
|
1100
|
-
options?: ProductUpsertOptionInput[];
|
|
1101
|
-
variants?: ProductUpsertVariantInput[];
|
|
1102
|
-
};
|
|
1198
|
+
type ProductUpsertParams = ProductUpsertInput;
|
|
1103
1199
|
/** Console `POST /api/products/upsert` field allowlist error reasons. */
|
|
1104
1200
|
declare const PRODUCT_UPSERT_UNKNOWN_FIELD_REASON: "unknown_field";
|
|
1105
1201
|
declare const PRODUCT_UPSERT_READONLY_FIELD_REASON: "product_field_readonly";
|
|
@@ -1208,8 +1304,10 @@ type CustomerSnapshot = {
|
|
|
1208
1304
|
};
|
|
1209
1305
|
type ReturnReason = 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'other';
|
|
1210
1306
|
type ReturnItem = {
|
|
1211
|
-
orderItem: string;
|
|
1307
|
+
orderItem: string | number;
|
|
1212
1308
|
quantity: number;
|
|
1309
|
+
restockAction?: RestockAction;
|
|
1310
|
+
restockingFee?: number;
|
|
1213
1311
|
};
|
|
1214
1312
|
type OrderCreateEntityID = string | number;
|
|
1215
1313
|
type CreateOrderItem = {
|
|
@@ -1228,20 +1326,34 @@ type CreateOrderItem = {
|
|
|
1228
1326
|
*/
|
|
1229
1327
|
totalPrice?: number;
|
|
1230
1328
|
};
|
|
1231
|
-
type
|
|
1329
|
+
type CreateOrderLineItemsInput = {
|
|
1330
|
+
orderItems: CreateOrderItem[];
|
|
1331
|
+
items?: never;
|
|
1332
|
+
} | {
|
|
1333
|
+
/**
|
|
1334
|
+
* Storefront-facing alias for orderItems. The SDK serializes this to
|
|
1335
|
+
* orderItems for the existing create-order endpoint.
|
|
1336
|
+
*/
|
|
1337
|
+
items: CreateOrderItem[];
|
|
1338
|
+
/**
|
|
1339
|
+
* @deprecated Use items for storefront-facing create-order inputs.
|
|
1340
|
+
*/
|
|
1341
|
+
orderItems?: never;
|
|
1342
|
+
};
|
|
1343
|
+
type CreateOrderBodyBase = {
|
|
1232
1344
|
orderNumber: string;
|
|
1233
1345
|
customer?: string;
|
|
1234
1346
|
customerSnapshot: CustomerSnapshot;
|
|
1235
1347
|
shippingAddress: Order['shippingAddress'];
|
|
1236
|
-
orderItems: CreateOrderItem[];
|
|
1237
1348
|
totalAmount: number;
|
|
1238
1349
|
shippingAmount?: number;
|
|
1239
1350
|
pgPaymentId?: string;
|
|
1240
1351
|
discountCode?: string;
|
|
1241
|
-
}
|
|
1352
|
+
};
|
|
1353
|
+
type CreateOrderParams = WithIdempotencyKey<CreateOrderBodyBase & CreateOrderLineItemsInput>;
|
|
1242
1354
|
type UpdateOrderParams = {
|
|
1243
1355
|
orderNumber: string;
|
|
1244
|
-
status:
|
|
1356
|
+
status: 'confirmed';
|
|
1245
1357
|
};
|
|
1246
1358
|
type TransactionStatus = 'pending' | 'paid' | 'failed' | 'canceled';
|
|
1247
1359
|
type UpdateTransactionParams = {
|
|
@@ -1280,41 +1392,99 @@ type CancelOrderReconciliationStatus = Exclude<CancelOrderStatus, 'pending' | 'f
|
|
|
1280
1392
|
type CancelOrderResponseBase = {
|
|
1281
1393
|
orderId: string;
|
|
1282
1394
|
};
|
|
1283
|
-
type
|
|
1395
|
+
type CancelOrderUnpaidCommittedResponseFields = {
|
|
1284
1396
|
refundedAmount: 0;
|
|
1285
1397
|
providerRefunded: false;
|
|
1286
1398
|
};
|
|
1287
|
-
type
|
|
1288
|
-
|
|
1399
|
+
type CancelOrderPaidCommittedResponseFields = {
|
|
1400
|
+
transactionId: string;
|
|
1401
|
+
refundedAmount: 0;
|
|
1289
1402
|
providerRefunded: false;
|
|
1403
|
+
refundPending: true;
|
|
1290
1404
|
};
|
|
1291
|
-
type
|
|
1405
|
+
type CancelOrderLegacyProviderRefundResponseFields = {
|
|
1292
1406
|
transactionId: string;
|
|
1293
1407
|
refundedAmount: number;
|
|
1294
1408
|
refundSeq: number;
|
|
1295
1409
|
providerRefunded: true;
|
|
1296
1410
|
};
|
|
1297
|
-
type
|
|
1411
|
+
type CancelOrderAlreadyCanceledResponseFields = {
|
|
1412
|
+
refundedAmount: number;
|
|
1413
|
+
providerRefunded: false;
|
|
1414
|
+
};
|
|
1415
|
+
type CancelOrderAlreadyCanceledRefundPendingResponseFields = {
|
|
1416
|
+
transactionId: string;
|
|
1417
|
+
refundedAmount: number;
|
|
1418
|
+
providerRefunded: false;
|
|
1419
|
+
refundPending: true;
|
|
1420
|
+
};
|
|
1421
|
+
type CancelOrderPaidCommittedResponse = CancelOrderResponseBase & CancelOrderPaidCommittedResponseFields & {
|
|
1298
1422
|
status: 'canceled';
|
|
1299
1423
|
cancelCommitted: true;
|
|
1300
1424
|
};
|
|
1425
|
+
type CancelOrderUnpaidCommittedResponse = CancelOrderResponseBase & CancelOrderUnpaidCommittedResponseFields & {
|
|
1426
|
+
status: 'canceled';
|
|
1427
|
+
cancelCommitted: true;
|
|
1428
|
+
};
|
|
1429
|
+
type CancelOrderCommittedResponse = CancelOrderPaidCommittedResponse | CancelOrderUnpaidCommittedResponse;
|
|
1301
1430
|
type CancelOrderAlreadyCanceledResponse = CancelOrderResponseBase & CancelOrderAlreadyCanceledResponseFields & {
|
|
1302
1431
|
status: 'canceled';
|
|
1303
1432
|
cancelCommitted: false;
|
|
1304
1433
|
alreadyCanceled: true;
|
|
1305
1434
|
};
|
|
1306
|
-
type
|
|
1435
|
+
type CancelOrderAlreadyCanceledRefundPendingResponse = CancelOrderResponseBase & CancelOrderAlreadyCanceledRefundPendingResponseFields & {
|
|
1436
|
+
status: 'canceled';
|
|
1437
|
+
cancelCommitted: false;
|
|
1438
|
+
alreadyCanceled: true;
|
|
1439
|
+
};
|
|
1440
|
+
/** @deprecated Inline PG cancel reconciliation; retained for legacy API consumers. */
|
|
1441
|
+
type CancelOrderReconciliationResponse = CancelOrderResponseBase & CancelOrderLegacyProviderRefundResponseFields & {
|
|
1307
1442
|
status: CancelOrderReconciliationStatus;
|
|
1308
1443
|
cancelCommitted: false;
|
|
1309
1444
|
reconciliationRequired: true;
|
|
1310
1445
|
};
|
|
1311
|
-
type CancelOrderResponse = CancelOrderCommittedResponse | CancelOrderAlreadyCanceledResponse | CancelOrderReconciliationResponse;
|
|
1446
|
+
type CancelOrderResponse = CancelOrderCommittedResponse | CancelOrderAlreadyCanceledResponse | CancelOrderAlreadyCanceledRefundPendingResponse | CancelOrderReconciliationResponse;
|
|
1312
1447
|
type CancelOrderParams = {
|
|
1313
1448
|
orderNumber: string;
|
|
1314
1449
|
reasonCode?: CancelReasonCode;
|
|
1315
1450
|
reasonDetail?: string;
|
|
1316
1451
|
idempotencyKey?: string;
|
|
1317
1452
|
};
|
|
1453
|
+
type ResolveCancelRefundOutcome = 'succeeded' | 'failed';
|
|
1454
|
+
type ResolveCancelRefundSucceededParams = {
|
|
1455
|
+
orderNumber: string;
|
|
1456
|
+
idempotencyKey: string;
|
|
1457
|
+
outcome: 'succeeded';
|
|
1458
|
+
refundedAmount: number;
|
|
1459
|
+
pgProvider: string;
|
|
1460
|
+
pgRefundId: string;
|
|
1461
|
+
};
|
|
1462
|
+
type ResolveCancelRefundFailedParams = {
|
|
1463
|
+
orderNumber: string;
|
|
1464
|
+
idempotencyKey: string;
|
|
1465
|
+
outcome: 'failed';
|
|
1466
|
+
refundedAmount: 0;
|
|
1467
|
+
pgProvider: string;
|
|
1468
|
+
pgRefundId?: string;
|
|
1469
|
+
};
|
|
1470
|
+
type ResolveCancelRefundParams = ResolveCancelRefundSucceededParams | ResolveCancelRefundFailedParams;
|
|
1471
|
+
type ResolveCancelRefundSucceededResponse = {
|
|
1472
|
+
orderId: string;
|
|
1473
|
+
transactionId: string;
|
|
1474
|
+
refundTransactionId: string;
|
|
1475
|
+
refundedAmount: number;
|
|
1476
|
+
refundStatus: 'succeeded';
|
|
1477
|
+
transactionStatus: 'refunded';
|
|
1478
|
+
};
|
|
1479
|
+
type ResolveCancelRefundFailedResponse = {
|
|
1480
|
+
orderId: string;
|
|
1481
|
+
transactionId: string;
|
|
1482
|
+
refundTransactionId: string;
|
|
1483
|
+
refundedAmount: 0;
|
|
1484
|
+
refundStatus: 'failed';
|
|
1485
|
+
transactionStatus: 'paid';
|
|
1486
|
+
};
|
|
1487
|
+
type ResolveCancelRefundResponse = ResolveCancelRefundSucceededResponse | ResolveCancelRefundFailedResponse;
|
|
1318
1488
|
type RestockAction = 'return_to_stock' | 'discard';
|
|
1319
1489
|
type ReturnWithRefundItem = {
|
|
1320
1490
|
orderItem: string | number;
|
|
@@ -1329,6 +1499,8 @@ type ReturnWithRefundParams = WithIdempotencyKey<{
|
|
|
1329
1499
|
returnItems: ReturnWithRefundItem[];
|
|
1330
1500
|
refundAmount: number;
|
|
1331
1501
|
returnShippingFee?: number;
|
|
1502
|
+
initialShippingRefundAmount?: number;
|
|
1503
|
+
initialShippingRefundOverrideNote?: string;
|
|
1332
1504
|
pgPaymentId: string;
|
|
1333
1505
|
paymentKey?: string;
|
|
1334
1506
|
refundReceiptUrl?: string;
|
|
@@ -1342,24 +1514,35 @@ type CheckoutParams = WithIdempotencyKey<{
|
|
|
1342
1514
|
}>;
|
|
1343
1515
|
type CreateFulfillmentParams = WithIdempotencyKey<{
|
|
1344
1516
|
orderNumber: string;
|
|
1517
|
+
fulfillmentOrderId?: string | number;
|
|
1345
1518
|
carrier?: string;
|
|
1346
1519
|
trackingNumber?: string;
|
|
1347
|
-
items
|
|
1520
|
+
items?: Array<{
|
|
1348
1521
|
orderItem: string;
|
|
1349
1522
|
quantity: number;
|
|
1350
1523
|
}>;
|
|
1351
1524
|
}>;
|
|
1525
|
+
type PrepareFulfillmentOrderParams = {
|
|
1526
|
+
orderNumber: string;
|
|
1527
|
+
};
|
|
1528
|
+
type PrepareFulfillmentOrderResponse = {
|
|
1529
|
+
orderId: string;
|
|
1530
|
+
fulfillmentOrders: Array<{
|
|
1531
|
+
id: string;
|
|
1532
|
+
status: string;
|
|
1533
|
+
}>;
|
|
1534
|
+
};
|
|
1352
1535
|
type UpdateFulfillmentParams = {
|
|
1353
1536
|
fulfillmentId: string;
|
|
1354
|
-
status
|
|
1537
|
+
status?: 'shipped' | 'delivered' | 'failed';
|
|
1355
1538
|
carrier?: string;
|
|
1356
1539
|
trackingNumber?: string;
|
|
1357
1540
|
};
|
|
1358
1541
|
type BulkImportFulfillmentsParams = {
|
|
1359
1542
|
items: Array<{
|
|
1360
1543
|
orderNumber: string;
|
|
1361
|
-
carrier
|
|
1362
|
-
trackingNumber
|
|
1544
|
+
carrier: string;
|
|
1545
|
+
trackingNumber: string;
|
|
1363
1546
|
}>;
|
|
1364
1547
|
};
|
|
1365
1548
|
type BulkImportFulfillmentsResponse = {
|
|
@@ -1378,6 +1561,9 @@ type CreateReturnParams = WithIdempotencyKey<{
|
|
|
1378
1561
|
reasonDetail?: string;
|
|
1379
1562
|
returnItems: ReturnItem[];
|
|
1380
1563
|
refundAmount: number;
|
|
1564
|
+
returnShippingFee?: number;
|
|
1565
|
+
initialShippingRefundAmount?: number;
|
|
1566
|
+
initialShippingRefundOverrideNote?: string;
|
|
1381
1567
|
}>;
|
|
1382
1568
|
type UpdateReturnParams = {
|
|
1383
1569
|
returnId: string;
|
|
@@ -1390,8 +1576,10 @@ declare class OrderApi extends BaseApi {
|
|
|
1390
1576
|
updateTransaction(params: UpdateTransactionParams): Promise<Transaction>;
|
|
1391
1577
|
confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse>;
|
|
1392
1578
|
cancelOrder(params: CancelOrderParams): Promise<CancelOrderResponse>;
|
|
1579
|
+
resolveCancelRefund(params: ResolveCancelRefundParams): Promise<ResolveCancelRefundResponse>;
|
|
1393
1580
|
checkout(params: CheckoutParams): Promise<Order>;
|
|
1394
1581
|
createFulfillment(params: CreateFulfillmentParams): Promise<Fulfillment>;
|
|
1582
|
+
prepareFulfillmentOrder(params: PrepareFulfillmentOrderParams): Promise<PrepareFulfillmentOrderResponse>;
|
|
1395
1583
|
updateFulfillment(params: UpdateFulfillmentParams): Promise<Fulfillment>;
|
|
1396
1584
|
bulkImportFulfillments(params: BulkImportFulfillmentsParams): Promise<BulkImportFulfillmentsResponse>;
|
|
1397
1585
|
returnWithRefund(params: ReturnWithRefundParams): Promise<{
|
|
@@ -1483,7 +1671,9 @@ declare class ServerCommerceClient {
|
|
|
1483
1671
|
updateTransaction: (params: UpdateTransactionParams) => Promise<Transaction>;
|
|
1484
1672
|
confirmPayment: (params: ConfirmPaymentParams) => Promise<ConfirmPaymentResponse>;
|
|
1485
1673
|
cancelOrder: (params: CancelOrderParams) => Promise<CancelOrderResponse>;
|
|
1674
|
+
resolveCancelRefund: (params: ResolveCancelRefundParams) => Promise<ResolveCancelRefundResponse>;
|
|
1486
1675
|
createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
|
|
1676
|
+
prepareFulfillmentOrder: (params: PrepareFulfillmentOrderParams) => Promise<PrepareFulfillmentOrderResponse>;
|
|
1487
1677
|
updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
|
|
1488
1678
|
bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
|
|
1489
1679
|
createReturn: (params: CreateReturnParams) => Promise<Return>;
|
|
@@ -1972,4 +2162,4 @@ type DeepPartial<T> = {
|
|
|
1972
2162
|
};
|
|
1973
2163
|
type ExtractArrayType<T> = T extends (infer U)[] ? U : never;
|
|
1974
2164
|
|
|
1975
|
-
export { type TenantFeatureProgressGroup as $, type ApiQueryOptions as A, BaseApi as B, CommerceClient as C, type DebugConfig as D, EventsClient as E, type EventRegistrationRegisterResponse as F, type EventsCalendarItem as G, type EventsClientOptions as H, type EventsDateParam as I, type EventsExternalSource as J, type EventsLocation as K, type EventsOccurrenceLocation as L, type EventsRangeEvent as M, type EventsRangeOccurrence as N, type EventsRangeParams as O, type PayloadFindResponse as P, type EventsRangeResponse as Q, type RetryConfig as R, type Sort as S, type TenantIntrospectionClient as T, type UnbanCustomerParams as U, type EventsTaxonomyItem as V, type Where as W, ModerationApi as X, type RootServerClient as Y, type TenantFeatureProgressEvidenceValue as Z, type TenantFeatureProgressFeature as _, CommunityClient as a, type
|
|
2165
|
+
export { type TenantFeatureProgressGroup as $, type ApiQueryOptions as A, BaseApi as B, CommerceClient as C, type DebugConfig as D, EventsClient as E, type EventRegistrationRegisterResponse as F, type EventsCalendarItem as G, type EventsClientOptions as H, type EventsDateParam as I, type EventsExternalSource as J, type EventsLocation as K, type EventsOccurrenceLocation as L, type EventsRangeEvent as M, type EventsRangeOccurrence as N, type EventsRangeParams as O, type PayloadFindResponse as P, type EventsRangeResponse as Q, type RetryConfig as R, type Sort as S, type TenantIntrospectionClient as T, type UnbanCustomerParams as U, type EventsTaxonomyItem as V, type Where as W, ModerationApi as X, type RootServerClient as Y, type TenantFeatureProgressEvidenceValue as Z, type TenantFeatureProgressFeature as _, CommunityClient as a, type ListingGroupsParams as a$, type TenantFeatureProgressInput as a0, type TenantFeatureProgressItem as a1, type TenantFeatureProgressItemState as a2, type TenantFeatureProgressResponse as a3, type TenantFeatureProgressSeverity as a4, type TenantFeatureProgressStatus as a5, TenantIntrospectionApi as a6, type TenantIntrospectionApiOptions as a7, CustomerAuth as a8, type CustomerProfile as a9, type CancelOrderResponse as aA, type CancelReasonCode as aB, CartApi as aC, type CartApiOptions as aD, type CheckoutParams as aE, type ClearCartParams as aF, type Comment as aG, type CommerceClientOptions as aH, type CommunityClientOptions as aI, type CommunityComment as aJ, type CommunityCommentListSort as aK, type CommunityPost as aL, type CommunityPostCategory as aM, type CommunityPostListSort as aN, type CommunityPostTag as aO, type CompatibilityProductSelectionParamEvent as aP, type ConfirmPaymentParams as aQ, type ConfirmPaymentResponse as aR, type CreateFulfillmentParams as aS, type CreateOrderItem as aT, type CreateOrderParams as aU, type CreateReturnParams as aV, type CustomerAuthOptions as aW, type CustomerSnapshot as aX, DiscountApi as aY, type DiscountApiOptions as aZ, type LegacyProductSelectionParamEvent as a_, type CustomerAuthResponse as aa, type CustomerLoginData as ab, type CustomerRegisterResponse as ac, type CustomerRegisterData as ad, type CustomerRefreshResponse as ae, type UpdateProfileData as af, type ProductDetailParams as ag, type ProductDetailResult as ah, type ProductListingGroupsItem as ai, type ProductDetail as aj, type ProductDetailCatalog as ak, type StockSnapshotResponse as al, type ProductSelectionMediaSource as am, type ProductDisplayMediaSource as an, type ResolveProductSelectionMediaInput as ao, type ResolveProductSelectionMediaResult as ap, type ProductSelectionMediaPointer as aq, type RootClientWithEvents as ar, type AddItemParams as as, type ApplyDiscountParams as at, type BulkImportFulfillmentsParams as au, type BulkImportFulfillmentsResponse as av, type CalculateShippingParams as aw, type CalculateShippingResult as ax, type CancelOrderParams as ay, type CancelOrderReconciliationStatus as az, CustomerNamespace as b, type ProductSelectionVariant as b$, type ListingPrimaryImageFallbackInput as b0, type MediaValue as b1, type NormalizedOptionSwatch as b2, type NormalizedProductSelection as b3, OrderApi as b4, type OrderApiOptions as b5, PRODUCT_PLP_FIND_OPTIONS as b6, PRODUCT_UPSERT_READONLY_FIELD_REASON as b7, PRODUCT_UPSERT_UNKNOWN_FIELD_REASON as b8, type PrepareFulfillmentOrderParams as b9, type ProductListingGroup as bA, type ProductListingGroupSummary as bB, type ProductListingGroupVariant as bC, type ProductListingGroupsProduct as bD, type ProductListingGroupsResponse as bE, type ProductListingProductShape as bF, type ProductListingProjection as bG, type ProductListingSwatch as bH, type ProductMediaResolutionSource as bI, type ProductOptionMatrix as bJ, type ProductOptionMatrixOption as bK, type ProductOptionMatrixValue as bL, type ProductOptionMatrixVariant as bM, type ProductOptionShape as bN, type ProductOptionValueShape as bO, type ProductOptionValueSwatch as bP, type ProductOptionValueSwatchInput as bQ, type ProductSelectionAvailableSwatch as bR, type ProductSelectionAvailableValue as bS, type ProductSelectionByOptionValue as bT, ProductSelectionCodecError as bU, type ProductSelectionCodecOptions as bV, type ProductSelectionInput as bW, type ProductSelectionOptionValue as bX, type ProductSelectionResolution as bY, type ProductSelectionResolutionContext as bZ, type ProductSelectionUrlEmit as b_, type PrepareFulfillmentOrderResponse as ba, ProductApi as bb, type ProductApiOptions as bc, type ProductDetailBrand as bd, type ProductDetailCatalogListing as be, type ProductDetailCatalogResult as bf, type ProductDetailCatalogVariant as bg, type ProductDetailCategory as bh, type ProductDetailImage as bi, type ProductDetailImageMedia as bj, type ProductDetailListing as bk, type ProductDetailMedia as bl, type ProductDetailOption as bm, type ProductDetailOptionValue as bn, type ProductDetailTag as bo, type ProductDetailUnavailableReason as bp, type ProductDetailVariant as bq, type ProductDetailVariantOptionValue as br, type ProductDetailVideo as bs, type ProductHrefGroup as bt, type ProductHrefOptions as bu, type ProductHrefProduct as bv, type ProductListingCard as bw, type ProductListingCardOptions as bx, type ProductListingCardPriceRange as by, type ProductListingCardRepresentativeVariant as bz, type ClientState as c, type ProductUpsertFieldValidationErrorBody as c0, type ProductUpsertFieldValidationErrorReason as c1, type ProductVariantShape as c2, type RemoveDiscountParams as c3, type RemoveItemParams as c4, type RequestOptions as c5, type ResolveCancelRefundFailedResponse as c6, type ResolveCancelRefundOutcome as c7, type ResolveCancelRefundParams as c8, type ResolveCancelRefundResponse as c9, buildProductOptionMatrix as cA, buildProductOptionMatrixFromDetail as cB, createProductSelectionCodec as cC, getAvailableOptionValues as cD, getProductSelectionImages as cE, getSelectedValueByOptionId as cF, isProductUpsertFieldValidationErrorBody as cG, normalizeProductSelection as cH, normalizeProductSelectionFromMatrix as cI, normalizeSelectedValueIds as cJ, parseProductSelection as cK, resolveListingPrimaryImagePointer as cL, resolveProductDisplayMedia as cM, resolveProductSelection as cN, resolveProductSelectionFromMatrix as cO, resolveProductSelectionMedia as cP, resolveVariantForSelection as cQ, selectNext as cR, selectedSwatchMediaItemId as cS, stringifyProductSelection as cT, toShopifyPriceRangeV2 as cU, type ResolveCancelRefundSucceededResponse as ca, type ResolveProductDisplayMediaInput as cb, type ResolveProductDisplayMediaResult as cc, type ReturnItem as cd, type ReturnReason as ce, type ReturnWithRefundItem as cf, type ReturnWithRefundParams as cg, ShippingApi as ch, type ShippingApiOptions as ci, type StockCheckParams as cj, type StockCheckResponse as ck, type StockCheckResult as cl, type StockSnapshotItem as cm, type StockSnapshotParams as cn, type UpdateFulfillmentParams as co, type UpdateItemParams as cp, type UpdateOrderParams as cq, type UpdateReturnParams as cr, type UpdateTransactionParams as cs, type ValidateDiscountParams as ct, type ValidateDiscountResult as cu, type WithIdempotencyKey as cv, buildProductHref as cw, buildProductListingCard as cx, buildProductListingGroupsByOption as cy, buildProductListingProjection as cz, type ClientConfig as d, type ClientMetadata as e, type DeepPartial as f, type ExtractArrayType as g, type PayloadMutationResponse as h, type RootClient as i, type RootCollectionClient as j, type RootReadOnlyQueryBuilder as k, type ServerApiOptions as l, ServerCommerceClient as m, type BanCustomerParams as n, type CommunityBan as o, type ClientServerConfig as p, type RootServerClientWithEvents as q, type CollectionFieldSchema as r, type CollectionSchemaResponse as s, type EventGuestCancelParams as t, type EventGuestRegistration as u, type EventGuestRegistrationResponse as v, type EventRegistrationAnswerInput as w, type EventRegistrationAttendeeInput as x, type EventRegistrationPublic as y, type EventRegistrationRegisterParams as z };
|
package/dist/ui/canvas.cjs
CHANGED
|
@@ -654,19 +654,29 @@ var import_react6 = __toESM(require("react"), 1);
|
|
|
654
654
|
var import_react5 = __toESM(require("react"), 1);
|
|
655
655
|
|
|
656
656
|
// src/utils/image.ts
|
|
657
|
-
var IMAGE_SIZES = [
|
|
657
|
+
var IMAGE_SIZES = [200, 400, 800, 1200, 1600];
|
|
658
|
+
function imageSizeCandidates(sizes) {
|
|
659
|
+
const keys = new Set(IMAGE_SIZES);
|
|
660
|
+
for (const key of Object.keys(sizes)) {
|
|
661
|
+
const value = Number(key);
|
|
662
|
+
if (Number.isFinite(value) && value > 0) keys.add(value);
|
|
663
|
+
}
|
|
664
|
+
return [...keys].sort((a, b) => a - b);
|
|
665
|
+
}
|
|
658
666
|
function getImageSrcSet(image) {
|
|
659
667
|
const parts = [];
|
|
668
|
+
const emittedWidths = /* @__PURE__ */ new Set();
|
|
660
669
|
const sizes = image.sizes;
|
|
661
670
|
if (sizes) {
|
|
662
|
-
for (const size of
|
|
663
|
-
const entry = sizes[
|
|
664
|
-
if (entry?.url && entry.width) {
|
|
671
|
+
for (const size of imageSizeCandidates(sizes)) {
|
|
672
|
+
const entry = sizes[`${size}`];
|
|
673
|
+
if (entry?.url && entry.width && !emittedWidths.has(entry.width)) {
|
|
674
|
+
emittedWidths.add(entry.width);
|
|
665
675
|
parts.push(`${entry.url} ${entry.width}w`);
|
|
666
676
|
}
|
|
667
677
|
}
|
|
668
678
|
}
|
|
669
|
-
if (image.url && image.width) {
|
|
679
|
+
if (image.url && image.width && !emittedWidths.has(image.width)) {
|
|
670
680
|
parts.push(`${image.url} ${image.width}w`);
|
|
671
681
|
}
|
|
672
682
|
return parts.join(", ");
|