@01.software/sdk 0.36.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-Bq5Zd7p7.d.ts → collection-client-DyELGUcL.d.ts} +3 -3
- package/dist/{collection-client-Cv0D2w1Q.d.cts → collection-client-zOmnxwdA.d.cts} +3 -3
- package/dist/{const-DVcM7Ac_.d.cts → const-CK_FPaIn.d.cts} +3 -3
- package/dist/{const-BDUKFP9w.d.ts → 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-DTSXUYkr.d.ts → index-DRJs7QIh.d.cts} +9 -6
- package/dist/{index-BHDKJ6B3.d.cts → index-DTqoUZk_.d.ts} +9 -6
- package/dist/index.cjs +172 -132
- 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 +172 -132
- 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-BCui2Oml.d.cts → payload-types-CREOjFNT.d.cts} +281 -108
- package/dist/{payload-types-BCui2Oml.d.ts → payload-types-CREOjFNT.d.ts} +281 -108
- 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 +84 -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 +84 -69
- package/dist/server.js.map +1 -1
- package/dist/{types-Dib-zdK6.d.cts → types-BWMUr3Zw.d.cts} +195 -71
- package/dist/{types-CEzLf3PX.d.cts → types-BkZNhuBh.d.cts} +1 -1
- package/dist/{types-3qV6sY7T.d.ts → types-CxzWHspI.d.ts} +1 -1
- package/dist/{types-DK9EnLwJ.d.ts → types-DMvVHdb1.d.ts} +195 -71
- 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 +1 -1
|
@@ -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>;
|
|
@@ -817,6 +831,36 @@ declare function toShopifyPriceRangeV2(listing: {
|
|
|
817
831
|
amount: number | null;
|
|
818
832
|
};
|
|
819
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;
|
|
820
864
|
/**
|
|
821
865
|
* Builds product-first listing groups for one primary option.
|
|
822
866
|
*
|
|
@@ -831,6 +875,95 @@ declare function buildProductListingGroupsByOption<TVariant extends ProductVaria
|
|
|
831
875
|
primaryOptionId?: string | null;
|
|
832
876
|
}): ProductListingGroup<TVariant>[];
|
|
833
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
|
+
|
|
834
967
|
type ProductApiOptions = ServerApiOptions;
|
|
835
968
|
type StockCheckParams = {
|
|
836
969
|
items: Array<{
|
|
@@ -919,7 +1052,6 @@ type ProductOptionValueMediaSwatch<TMedia = ProductDetailMedia> = {
|
|
|
919
1052
|
color?: null;
|
|
920
1053
|
};
|
|
921
1054
|
type ProductOptionValueSwatch<TMedia = ProductDetailMedia> = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<TMedia> | null;
|
|
922
|
-
type ProductUpsertSwatchInput = ProductOptionValueColorSwatch | ProductOptionValueMediaSwatch<string>;
|
|
923
1055
|
type ProductDetailMediaValue = string | number | ProductDetailMedia | null;
|
|
924
1056
|
type ProductDetailSelectionMediaSource = 'variant_media_selected' | 'variant_media_matching' | 'option_swatch' | 'none';
|
|
925
1057
|
interface ProductDetailVariant {
|
|
@@ -1063,49 +1195,7 @@ type ProductDetailCatalogResult = {
|
|
|
1063
1195
|
found: false;
|
|
1064
1196
|
reason: ProductDetailUnavailableReason;
|
|
1065
1197
|
};
|
|
1066
|
-
type
|
|
1067
|
-
id?: string;
|
|
1068
|
-
value: string;
|
|
1069
|
-
slug?: string;
|
|
1070
|
-
swatch?: ProductUpsertSwatchInput | null;
|
|
1071
|
-
metadata?: unknown;
|
|
1072
|
-
};
|
|
1073
|
-
type ProductUpsertOptionInput = {
|
|
1074
|
-
id?: string;
|
|
1075
|
-
title: string;
|
|
1076
|
-
slug?: string;
|
|
1077
|
-
values: ProductUpsertOptionValueInput[];
|
|
1078
|
-
};
|
|
1079
|
-
type ProductUpsertVariantOptionValue = string | {
|
|
1080
|
-
valueSlug?: string;
|
|
1081
|
-
valueId?: string;
|
|
1082
|
-
value?: string;
|
|
1083
|
-
};
|
|
1084
|
-
type ProductUpsertVariantInput = {
|
|
1085
|
-
id?: string;
|
|
1086
|
-
optionValues?: Record<string, ProductUpsertVariantOptionValue> | string[];
|
|
1087
|
-
sku?: string | null;
|
|
1088
|
-
title?: string | null;
|
|
1089
|
-
price: number;
|
|
1090
|
-
compareAtPrice?: number | null;
|
|
1091
|
-
stock?: number;
|
|
1092
|
-
isUnlimited?: boolean;
|
|
1093
|
-
weight?: number | null;
|
|
1094
|
-
requiresShipping?: boolean;
|
|
1095
|
-
barcode?: string | null;
|
|
1096
|
-
externalId?: string | null;
|
|
1097
|
-
isActive?: boolean;
|
|
1098
|
-
images?: string[];
|
|
1099
|
-
metadata?: unknown;
|
|
1100
|
-
};
|
|
1101
|
-
type ProductUpsertParams = {
|
|
1102
|
-
product: Record<string, unknown> & {
|
|
1103
|
-
id?: string;
|
|
1104
|
-
title?: string;
|
|
1105
|
-
};
|
|
1106
|
-
options?: ProductUpsertOptionInput[];
|
|
1107
|
-
variants?: ProductUpsertVariantInput[];
|
|
1108
|
-
};
|
|
1198
|
+
type ProductUpsertParams = ProductUpsertInput;
|
|
1109
1199
|
/** Console `POST /api/products/upsert` field allowlist error reasons. */
|
|
1110
1200
|
declare const PRODUCT_UPSERT_UNKNOWN_FIELD_REASON: "unknown_field";
|
|
1111
1201
|
declare const PRODUCT_UPSERT_READONLY_FIELD_REASON: "product_field_readonly";
|
|
@@ -1214,8 +1304,10 @@ type CustomerSnapshot = {
|
|
|
1214
1304
|
};
|
|
1215
1305
|
type ReturnReason = 'change_of_mind' | 'defective' | 'wrong_delivery' | 'damaged' | 'other';
|
|
1216
1306
|
type ReturnItem = {
|
|
1217
|
-
orderItem: string;
|
|
1307
|
+
orderItem: string | number;
|
|
1218
1308
|
quantity: number;
|
|
1309
|
+
restockAction?: RestockAction;
|
|
1310
|
+
restockingFee?: number;
|
|
1219
1311
|
};
|
|
1220
1312
|
type OrderCreateEntityID = string | number;
|
|
1221
1313
|
type CreateOrderItem = {
|
|
@@ -1234,20 +1326,34 @@ type CreateOrderItem = {
|
|
|
1234
1326
|
*/
|
|
1235
1327
|
totalPrice?: number;
|
|
1236
1328
|
};
|
|
1237
|
-
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 = {
|
|
1238
1344
|
orderNumber: string;
|
|
1239
1345
|
customer?: string;
|
|
1240
1346
|
customerSnapshot: CustomerSnapshot;
|
|
1241
1347
|
shippingAddress: Order['shippingAddress'];
|
|
1242
|
-
orderItems: CreateOrderItem[];
|
|
1243
1348
|
totalAmount: number;
|
|
1244
1349
|
shippingAmount?: number;
|
|
1245
1350
|
pgPaymentId?: string;
|
|
1246
1351
|
discountCode?: string;
|
|
1247
|
-
}
|
|
1352
|
+
};
|
|
1353
|
+
type CreateOrderParams = WithIdempotencyKey<CreateOrderBodyBase & CreateOrderLineItemsInput>;
|
|
1248
1354
|
type UpdateOrderParams = {
|
|
1249
1355
|
orderNumber: string;
|
|
1250
|
-
status:
|
|
1356
|
+
status: 'confirmed';
|
|
1251
1357
|
};
|
|
1252
1358
|
type TransactionStatus = 'pending' | 'paid' | 'failed' | 'canceled';
|
|
1253
1359
|
type UpdateTransactionParams = {
|
|
@@ -1393,6 +1499,8 @@ type ReturnWithRefundParams = WithIdempotencyKey<{
|
|
|
1393
1499
|
returnItems: ReturnWithRefundItem[];
|
|
1394
1500
|
refundAmount: number;
|
|
1395
1501
|
returnShippingFee?: number;
|
|
1502
|
+
initialShippingRefundAmount?: number;
|
|
1503
|
+
initialShippingRefundOverrideNote?: string;
|
|
1396
1504
|
pgPaymentId: string;
|
|
1397
1505
|
paymentKey?: string;
|
|
1398
1506
|
refundReceiptUrl?: string;
|
|
@@ -1406,24 +1514,35 @@ type CheckoutParams = WithIdempotencyKey<{
|
|
|
1406
1514
|
}>;
|
|
1407
1515
|
type CreateFulfillmentParams = WithIdempotencyKey<{
|
|
1408
1516
|
orderNumber: string;
|
|
1517
|
+
fulfillmentOrderId?: string | number;
|
|
1409
1518
|
carrier?: string;
|
|
1410
1519
|
trackingNumber?: string;
|
|
1411
|
-
items
|
|
1520
|
+
items?: Array<{
|
|
1412
1521
|
orderItem: string;
|
|
1413
1522
|
quantity: number;
|
|
1414
1523
|
}>;
|
|
1415
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
|
+
};
|
|
1416
1535
|
type UpdateFulfillmentParams = {
|
|
1417
1536
|
fulfillmentId: string;
|
|
1418
|
-
status
|
|
1537
|
+
status?: 'shipped' | 'delivered' | 'failed';
|
|
1419
1538
|
carrier?: string;
|
|
1420
1539
|
trackingNumber?: string;
|
|
1421
1540
|
};
|
|
1422
1541
|
type BulkImportFulfillmentsParams = {
|
|
1423
1542
|
items: Array<{
|
|
1424
1543
|
orderNumber: string;
|
|
1425
|
-
carrier
|
|
1426
|
-
trackingNumber
|
|
1544
|
+
carrier: string;
|
|
1545
|
+
trackingNumber: string;
|
|
1427
1546
|
}>;
|
|
1428
1547
|
};
|
|
1429
1548
|
type BulkImportFulfillmentsResponse = {
|
|
@@ -1442,6 +1561,9 @@ type CreateReturnParams = WithIdempotencyKey<{
|
|
|
1442
1561
|
reasonDetail?: string;
|
|
1443
1562
|
returnItems: ReturnItem[];
|
|
1444
1563
|
refundAmount: number;
|
|
1564
|
+
returnShippingFee?: number;
|
|
1565
|
+
initialShippingRefundAmount?: number;
|
|
1566
|
+
initialShippingRefundOverrideNote?: string;
|
|
1445
1567
|
}>;
|
|
1446
1568
|
type UpdateReturnParams = {
|
|
1447
1569
|
returnId: string;
|
|
@@ -1457,6 +1579,7 @@ declare class OrderApi extends BaseApi {
|
|
|
1457
1579
|
resolveCancelRefund(params: ResolveCancelRefundParams): Promise<ResolveCancelRefundResponse>;
|
|
1458
1580
|
checkout(params: CheckoutParams): Promise<Order>;
|
|
1459
1581
|
createFulfillment(params: CreateFulfillmentParams): Promise<Fulfillment>;
|
|
1582
|
+
prepareFulfillmentOrder(params: PrepareFulfillmentOrderParams): Promise<PrepareFulfillmentOrderResponse>;
|
|
1460
1583
|
updateFulfillment(params: UpdateFulfillmentParams): Promise<Fulfillment>;
|
|
1461
1584
|
bulkImportFulfillments(params: BulkImportFulfillmentsParams): Promise<BulkImportFulfillmentsResponse>;
|
|
1462
1585
|
returnWithRefund(params: ReturnWithRefundParams): Promise<{
|
|
@@ -1550,6 +1673,7 @@ declare class ServerCommerceClient {
|
|
|
1550
1673
|
cancelOrder: (params: CancelOrderParams) => Promise<CancelOrderResponse>;
|
|
1551
1674
|
resolveCancelRefund: (params: ResolveCancelRefundParams) => Promise<ResolveCancelRefundResponse>;
|
|
1552
1675
|
createFulfillment: (params: CreateFulfillmentParams) => Promise<Fulfillment>;
|
|
1676
|
+
prepareFulfillmentOrder: (params: PrepareFulfillmentOrderParams) => Promise<PrepareFulfillmentOrderResponse>;
|
|
1553
1677
|
updateFulfillment: (params: UpdateFulfillmentParams) => Promise<Fulfillment>;
|
|
1554
1678
|
bulkImportFulfillments: (params: BulkImportFulfillmentsParams) => Promise<BulkImportFulfillmentsResponse>;
|
|
1555
1679
|
createReturn: (params: CreateReturnParams) => Promise<Return>;
|
|
@@ -2038,4 +2162,4 @@ type DeepPartial<T> = {
|
|
|
2038
2162
|
};
|
|
2039
2163
|
type ExtractArrayType<T> = T extends (infer U)[] ? U : never;
|
|
2040
2164
|
|
|
2041
|
-
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
|
|
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(", ");
|