@ecomweb/sdk 0.12.1 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +57 -22
- package/dist/index.js +27 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -391,7 +391,7 @@ type UpdateEmbeddedScript = z.infer<typeof updateEmbeddedScriptSchema>;
|
|
|
391
391
|
*/
|
|
392
392
|
declare const storeSchema: z.ZodObject<{
|
|
393
393
|
id: z.ZodInt32;
|
|
394
|
-
user_id: z.ZodUUID
|
|
394
|
+
user_id: z.ZodOptional<z.ZodUUID>;
|
|
395
395
|
name: z.ZodString;
|
|
396
396
|
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
397
397
|
status: z.ZodDefault<z.ZodEnum<{
|
|
@@ -456,7 +456,7 @@ declare const storeSettingsSchema: z.ZodObject<{
|
|
|
456
456
|
}, z.core.$strip>;
|
|
457
457
|
declare const createStoreSchema: z.ZodObject<{
|
|
458
458
|
name: z.ZodString;
|
|
459
|
-
user_id: z.ZodUUID
|
|
459
|
+
user_id: z.ZodOptional<z.ZodUUID>;
|
|
460
460
|
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
461
461
|
status: z.ZodDefault<z.ZodEnum<{
|
|
462
462
|
active: "active";
|
|
@@ -466,7 +466,7 @@ declare const createStoreSchema: z.ZodObject<{
|
|
|
466
466
|
}, z.core.$strip>;
|
|
467
467
|
declare const updateStoreSchema: z.ZodObject<{
|
|
468
468
|
name: z.ZodOptional<z.ZodString>;
|
|
469
|
-
user_id: z.ZodOptional<z.ZodUUID
|
|
469
|
+
user_id: z.ZodOptional<z.ZodOptional<z.ZodUUID>>;
|
|
470
470
|
description: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
471
471
|
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
472
472
|
active: "active";
|
|
@@ -554,7 +554,7 @@ declare const updateStoreSettingsSchema: z.ZodObject<{
|
|
|
554
554
|
}, z.core.$strip>;
|
|
555
555
|
declare const storeWithRelationsSchema: z.ZodObject<{
|
|
556
556
|
id: z.ZodInt32;
|
|
557
|
-
user_id: z.ZodUUID
|
|
557
|
+
user_id: z.ZodOptional<z.ZodUUID>;
|
|
558
558
|
name: z.ZodString;
|
|
559
559
|
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
560
560
|
status: z.ZodDefault<z.ZodEnum<{
|
|
@@ -626,7 +626,8 @@ declare const storeWithRelationsSchema: z.ZodObject<{
|
|
|
626
626
|
}, z.core.$strip>;
|
|
627
627
|
type Store = {
|
|
628
628
|
ref: string;
|
|
629
|
-
|
|
629
|
+
/** @deprecated Public store endpoints no longer send it; do not rely on it. */
|
|
630
|
+
user_id?: string;
|
|
630
631
|
name: string;
|
|
631
632
|
description: string | null;
|
|
632
633
|
status: StoreStatus;
|
|
@@ -2439,7 +2440,8 @@ interface BlogComment {
|
|
|
2439
2440
|
blog_post_id: Id | null;
|
|
2440
2441
|
parent_comment_id: Id | null;
|
|
2441
2442
|
author_name: string;
|
|
2442
|
-
|
|
2443
|
+
/** Never on public reads (the API hides commenter emails); admin reads only. */
|
|
2444
|
+
author_email?: string;
|
|
2443
2445
|
author_website: string | null;
|
|
2444
2446
|
content: string;
|
|
2445
2447
|
is_approved: boolean;
|
|
@@ -2516,7 +2518,7 @@ declare const blogCommentSchema: z.ZodObject<{
|
|
|
2516
2518
|
blog_post_id: z.ZodNullable<z.ZodOptional<z.ZodInt32>>;
|
|
2517
2519
|
parent_comment_id: z.ZodNullable<z.ZodOptional<z.ZodInt32>>;
|
|
2518
2520
|
author_name: z.ZodString;
|
|
2519
|
-
author_email: z.ZodEmail
|
|
2521
|
+
author_email: z.ZodOptional<z.ZodEmail>;
|
|
2520
2522
|
author_website: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
|
2521
2523
|
content: z.ZodString;
|
|
2522
2524
|
is_approved: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -2583,11 +2585,11 @@ declare const createBlogPostSchema: z.ZodObject<{
|
|
|
2583
2585
|
declare const createBlogCommentSchema: z.ZodObject<{
|
|
2584
2586
|
content: z.ZodString;
|
|
2585
2587
|
author_name: z.ZodString;
|
|
2586
|
-
author_email: z.ZodEmail;
|
|
2587
2588
|
blog_post_id: z.ZodNullable<z.ZodOptional<z.ZodInt32>>;
|
|
2588
2589
|
parent_comment_id: z.ZodNullable<z.ZodOptional<z.ZodInt32>>;
|
|
2589
2590
|
author_website: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
|
2590
2591
|
is_approved: z.ZodDefault<z.ZodBoolean>;
|
|
2592
|
+
author_email: z.ZodEmail;
|
|
2591
2593
|
}, z.core.$strip>;
|
|
2592
2594
|
declare const createBlogSettingsSchema: z.ZodObject<{
|
|
2593
2595
|
blog_title: z.ZodDefault<z.ZodString>;
|
|
@@ -2639,8 +2641,8 @@ declare const updateBlogPostSchema: z.ZodObject<{
|
|
|
2639
2641
|
declare const updateBlogCommentSchema: z.ZodObject<{
|
|
2640
2642
|
content: z.ZodOptional<z.ZodString>;
|
|
2641
2643
|
author_name: z.ZodOptional<z.ZodString>;
|
|
2642
|
-
author_email: z.ZodOptional<z.ZodEmail>;
|
|
2643
2644
|
parent_comment_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodInt32>>>;
|
|
2645
|
+
author_email: z.ZodOptional<z.ZodEmail>;
|
|
2644
2646
|
author_website: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodURL>>>;
|
|
2645
2647
|
is_approved: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
2646
2648
|
}, z.core.$strip>;
|
|
@@ -2669,7 +2671,9 @@ declare const blogCommentWithRepliesSchema: z.ZodType<BlogCommentWithReplies, un
|
|
|
2669
2671
|
type CreateBlogCategory = Omit<BlogCategory, "id" | keyof OptionalTimestamp>;
|
|
2670
2672
|
type CreateBlogTag = Omit<BlogTag, "id" | keyof OptionalTimestamp>;
|
|
2671
2673
|
type CreateBlogPost = Omit<BlogPost$1, "id" | "view_count" | keyof OptionalTimestamp>;
|
|
2672
|
-
type CreateBlogComment = Omit<BlogComment, "id" | "created_at"
|
|
2674
|
+
type CreateBlogComment = Omit<BlogComment, "id" | "created_at" | "author_email"> & {
|
|
2675
|
+
author_email: string;
|
|
2676
|
+
};
|
|
2673
2677
|
type CreateBlogSettings = Omit<BlogSettings, "id" | keyof OptionalTimestamp>;
|
|
2674
2678
|
type UpdateBlogCategory = Partial<CreateBlogCategory>;
|
|
2675
2679
|
type UpdateBlogTag = Partial<CreateBlogTag>;
|
|
@@ -4123,7 +4127,13 @@ declare class CartApi {
|
|
|
4123
4127
|
clear(storeRef: string, sessionId: string, isAuth: boolean): Promise<{
|
|
4124
4128
|
cart_id: string;
|
|
4125
4129
|
}>;
|
|
4126
|
-
|
|
4130
|
+
/**
|
|
4131
|
+
* Merge the guest cart into the signed-in cart. Resolves to
|
|
4132
|
+
* `{ merged: false }` when neither cart exists.
|
|
4133
|
+
*/
|
|
4134
|
+
merge(storeRef: string, sessionId: string): Promise<CartApiResponse | {
|
|
4135
|
+
merged: false;
|
|
4136
|
+
}>;
|
|
4127
4137
|
}
|
|
4128
4138
|
|
|
4129
4139
|
interface CustomerOrderFilter extends BaseQueryParams {
|
|
@@ -4196,6 +4206,8 @@ interface CreateOrderRequest {
|
|
|
4196
4206
|
notes?: string;
|
|
4197
4207
|
customer_address_id?: number;
|
|
4198
4208
|
promotion_id?: number;
|
|
4209
|
+
/** The code the shopper entered for `promotion_id`; storefront checkout must send it for a discount-code promotion. */
|
|
4210
|
+
promotion_code?: string;
|
|
4199
4211
|
/** Omit to default to 'online'. Staff keying in a walk-in order must send 'pos', 'phone', or 'admin'. */
|
|
4200
4212
|
source?: AdminOrderSource;
|
|
4201
4213
|
items: CreateOrderItemRequest[];
|
|
@@ -4212,17 +4224,17 @@ interface GuestOrderLookupParams {
|
|
|
4212
4224
|
customer_email?: string;
|
|
4213
4225
|
customer_phone?: string;
|
|
4214
4226
|
}
|
|
4215
|
-
interface GuestOrderLookupResult {
|
|
4216
|
-
order: OrderWithItems | null;
|
|
4217
|
-
found: boolean;
|
|
4218
|
-
message?: string;
|
|
4219
|
-
}
|
|
4220
4227
|
|
|
4221
4228
|
declare class OrdersApi {
|
|
4222
4229
|
private publicHttp;
|
|
4223
4230
|
private authHttp;
|
|
4224
4231
|
constructor(publicHttp: IHttpClient, authHttp: IHttpClient);
|
|
4225
|
-
|
|
4232
|
+
/**
|
|
4233
|
+
* Look up a guest order. The API answers with the bare order when it
|
|
4234
|
+
* matches and `{ message }` (HTTP 200) when it does not; a 404 is treated
|
|
4235
|
+
* the same way. Returns null for "not found".
|
|
4236
|
+
*/
|
|
4237
|
+
lookupGuest(storeRef: string, params: GuestOrderLookupParams): Promise<OrderWithItems | null>;
|
|
4226
4238
|
create(storeRef: string, data: CreateOrderRequest, isAuth: boolean): Promise<OrderWithItems>;
|
|
4227
4239
|
listCustomerOrders(storeRef: string, params?: Partial<CustomerOrderFilter> & {
|
|
4228
4240
|
page?: number;
|
|
@@ -5116,6 +5128,15 @@ interface AuthResult {
|
|
|
5116
5128
|
expires_in: number;
|
|
5117
5129
|
identity: AuthIdentity | null;
|
|
5118
5130
|
}
|
|
5131
|
+
/**
|
|
5132
|
+
* What register answers. `verification_binding` ties the mailed verification
|
|
5133
|
+
* link to this client: keep it (never show or mail it) and present it on
|
|
5134
|
+
* verify-email, or the click verifies the address but drops the password set
|
|
5135
|
+
* at registration. Absent on APIs that predate the binding.
|
|
5136
|
+
*/
|
|
5137
|
+
interface RegisterResult extends AuthResult {
|
|
5138
|
+
verification_binding?: string;
|
|
5139
|
+
}
|
|
5119
5140
|
interface AuthIdentity {
|
|
5120
5141
|
id: string;
|
|
5121
5142
|
email: string | null;
|
|
@@ -5188,6 +5209,14 @@ interface VerifyOtpPayload {
|
|
|
5188
5209
|
interface SentResult {
|
|
5189
5210
|
sent: boolean;
|
|
5190
5211
|
}
|
|
5212
|
+
/**
|
|
5213
|
+
* What change-email answers. `confirmation_binding` must accompany the
|
|
5214
|
+
* emailed confirm token (see confirmEmailChange); newer APIs refuse a confirm
|
|
5215
|
+
* without it. Absent on APIs that predate the binding.
|
|
5216
|
+
*/
|
|
5217
|
+
interface ChangeEmailResult extends SentResult {
|
|
5218
|
+
confirmation_binding?: string;
|
|
5219
|
+
}
|
|
5191
5220
|
interface VerifiedResult {
|
|
5192
5221
|
verified: boolean;
|
|
5193
5222
|
}
|
|
@@ -5221,14 +5250,20 @@ declare class AuthApi {
|
|
|
5221
5250
|
private tenantPath;
|
|
5222
5251
|
private auth;
|
|
5223
5252
|
/** Never returns tokens: a new email and an existing one respond identically. */
|
|
5224
|
-
register(payload: RegisterPayload): Promise<ApiResponse<
|
|
5253
|
+
register(payload: RegisterPayload): Promise<ApiResponse<RegisterResult>>;
|
|
5225
5254
|
login(payload: LoginPayload): Promise<ApiResponse<AuthResult>>;
|
|
5226
5255
|
refresh(refresh_token: string): Promise<ApiResponse<AuthResult>>;
|
|
5227
|
-
|
|
5256
|
+
/**
|
|
5257
|
+
* `binding` is the register response's `verification_binding`, when this
|
|
5258
|
+
* client still has it. Omitted, the address is verified but the password
|
|
5259
|
+
* set at registration is dropped.
|
|
5260
|
+
*/
|
|
5261
|
+
verifyEmail(token: string, binding?: string): Promise<ApiResponse<VerifiedResult>>;
|
|
5228
5262
|
resendVerification(email: string): Promise<ApiResponse<SentResult>>;
|
|
5229
5263
|
forgotPassword(email: string): Promise<ApiResponse<SentResult>>;
|
|
5230
5264
|
resetPassword(payload: ResetPasswordPayload): Promise<ApiResponse<ResetResult>>;
|
|
5231
|
-
|
|
5265
|
+
/** `binding` is the change-email response's `confirmation_binding`. */
|
|
5266
|
+
confirmEmailChange(token: string, binding?: string): Promise<ApiResponse<ChangedResult>>;
|
|
5232
5267
|
requestOtp(email: string): Promise<ApiResponse<SentResult>>;
|
|
5233
5268
|
verifyOtp(payload: VerifyOtpPayload): Promise<ApiResponse<AuthResult>>;
|
|
5234
5269
|
anonymous(): Promise<ApiResponse<AuthResult>>;
|
|
@@ -5240,7 +5275,7 @@ declare class AuthApi {
|
|
|
5240
5275
|
logout(access_token: string, refresh_token: string): Promise<ApiResponse<unknown>>;
|
|
5241
5276
|
logoutAll(access_token: string): Promise<ApiResponse<unknown>>;
|
|
5242
5277
|
changePassword(access_token: string, payload: ChangePasswordPayload): Promise<ApiResponse<unknown>>;
|
|
5243
|
-
changeEmail(access_token: string, payload: ChangeEmailPayload): Promise<ApiResponse<
|
|
5278
|
+
changeEmail(access_token: string, payload: ChangeEmailPayload): Promise<ApiResponse<ChangeEmailResult>>;
|
|
5244
5279
|
}
|
|
5245
5280
|
|
|
5246
5281
|
/**
|
|
@@ -5306,4 +5341,4 @@ declare function createEcomwebSdk(options: EcomwebSdkOptions): {
|
|
|
5306
5341
|
};
|
|
5307
5342
|
type EcomwebSdk = ReturnType<typeof createEcomwebSdk>;
|
|
5308
5343
|
|
|
5309
|
-
export { ADJUSTABLE_STATES, ADMIN_ORDER_SOURCES, type AddToCartRequest, type Address, AddressesApi, type AdjustQuantitiesRequest, type AdjustableState, type AdminOrderSource, ApiClientError, type ApiError, type ApiResponse, type AppliedPromotion, type AttributeLink, AuthApi, type AuthErrorCode, type AuthIdentity, type AuthResult, type AuthTokens, type AutocompleteParams, type BankAccount, type BaseDeleteOptions, type BaseDeleteResult, type BaseQueryParams, type BatchOrderReviewInvitationsResult, BlogApi, type BlogCategory, type BlogCategoryQueryParams, type BlogComment, type BlogCommentWithReplies, type BlogPost, type BlogPostCategory, type BlogPostQueryParams, type BlogPostStatus, type BlogPostTag, type BlogPostWithRelations, type BlogSearchParams, type BlogSearchResponse, type BlogSettings, type BlogTag, type BlogTagQueryParams, COLLECTION_RULE_MATRIX, CONDITION_TYPE_LABELS, CartApi, type CartApiItem, type CartApiResponse, CategoriesApi, type Category, type CategoryQueryParams, type CategorySearchResponse, type CategoryTree, type CategoryWithChildren, type ChangeEmailPayload, type ChangePasswordPayload, type ChangedResult, type Collection, type CollectionQueryParams, type CollectionRule, type CollectionRuleSet, type CollectionRuleSetCriteria, type CollectionSearchCriteria, CollectionsApi, ConditionType, ConditionTypeSchema, type ConditionTypeType, type ContentPage, ContentPagesApi, type CreateAddressDto, type CreateBlogCategory, type CreateBlogComment, type CreateBlogPost, type CreateBlogSettings, type CreateBlogTag, type CreateCategory, type CreateContentPage, type CreateEmbeddedScript, type CreateOrder, type CreateOrderItem, type CreateOrderItemRequest, type CreateOrderRequest, type CreateProduct, type CreateProductReview, type CreateProductReviewReply, type CreateProductVariant, type CreatePromotion, CreatePromotionSchema, type CreateStore, type CreateStoreConfig, type CreateStoreSettings, type CreateVariantOption, type CreateVariantOptionValue, type CurrentIdentity, type Customer, type CustomerAccess, type CustomerOrderFilter, type CustomerOrderSummary, CustomersApi, DEFAULT_BUCKET, DISCOUNT_METHOD_LABELS, type DeleteApiFunction, type DeletedAt, DiscountMethod, DiscountMethodSchema, type DiscountMethodType, EMAIL_COLOR_PATTERN, EMAIL_PALETTE_DEFAULTS, ENTRY_HANDLE_PATTERN, type EcomwebSdk, type EcomwebSdkOptions, type EmbeddedScript, type EmbeddedScriptPlacement, type EngineResult, FILTERABLE_TYPES, type FileKind, type FulfillmentStatus, type GoogleAuthUrl, type GuestOrderLookupParams, type GuestOrderLookupResult, type IHttpClient, INVENTORY_ADJUSTMENT_REASONS, INVENTORY_ERROR_CODES, INVENTORY_POLICIES, INVENTORY_STATES, INVENTORY_STATUS_LABELS, type Id, type ImageFormat, type ImageTransformOptions, type InitiatePaymentResult, type InsufficientInventoryItem, type IntegrationStatus, type InventoryActor, type InventoryAdjustmentReason, type InventoryErrorCode, type InventoryHistoryEntry, type InventoryImportResponse, type InventoryLevelRow, type InventoryLocation, type InventoryPolicy, type InventoryQuantities, type InventoryState, InventoryStatus, KNOWN_PAYMENT_METHODS, LEGACY_STATUS_MIGRATION_MAP, LEVEL_PROVINCE, LEVEL_WARD, type LegacyOrderStatus, type LegacyProductStatus, type LinkValue, type LocationArea, type LocationAreaQuery, type LocationAreasResponse, type LoginPayload, MAX_RULES_PER_SET, MAX_RULE_VALUE_ENTRIES, MEASUREMENT_UNITS, MEDIA_TYPES, MERCHANT_ADJUSTMENT_REASONS, METAFIELD_BASE_TYPES, METAFIELD_KEY_PATTERN, METAFIELD_LIMITS, METAFIELD_OWNER_TYPES, METAFIELD_TYPE_GROUPS, METAOBJECT_REFERENCE_TYPES, METAOBJECT_TYPE_PATTERN, type MeasurementType, type MeasurementValue, MemoryTokenStorage, MenusApi, type MerchantAdjustmentReason, type MessageOutboxStatus, type MetafieldBaseType, type MetafieldBound, type MetafieldContext, type MetafieldDefinitionShape, type MetafieldIssue, type MetafieldIssueCode, type MetafieldListType, type MetafieldOwnerType, type MetafieldType, type MetafieldTypeGroup, type MetafieldValidationKey, type MetafieldValidations, type MetafieldWrite, type MetaobjectDefinitionShape, type MetaobjectFieldShape, type MetaobjectListParams, type MetaobjectListResult, MetaobjectsApi, type MoneyValue, type MoveQuantitiesRequest, type MutationApiFunction, OBJECT_PREFIX, ORDER_ACTOR_TYPES, ORDER_EVENT_TYPES, ORDER_SHIPMENT_ERROR_CODES, ORDER_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, type OrderShipmentEvent, type OrderShipmentSummary, type OrderSource, type OrderStatus, type OrderTimelineActor, type OrderTimelineComment, type OrderTimelineCommentAuthor, type OrderTimelineEntry, type OrderTimelineEvent, type OrderTimelineResponse, type OrderWithItems, OrdersApi, PAGINATION_DEFAULTS, PRIVATE_REFERENCE_TYPES, PRODUCT_STATUS_LABELS, PROMOTION_MODE_COLORS, PROMOTION_MODE_LABELS, PROMOTION_STATUS_COLORS, PROMOTION_STATUS_LABELS, PROMOTION_TYPE_COLORS, PROMOTION_TYPE_LABELS, type PaginatedApiFunction, type PaginatedPromotionsResponse, PaginatedPromotionsResponseSchema, type PaginatedResponse, type PaginatedReviewsResponse, type PaginationMeta, type PasswordPolicy, type PaymentCredentialStatus, type PaymentMethod$1 as PaymentMethod, PaymentMethodsApi, type PaymentStateResult, type PaymentStatus, PaymentsApi, type Product, type ProductDetail, type ProductImage, type ProductQueryParams, type ProductReview, type ProductReviewFilters, type ProductReviewReply, type ProductReviewReplyFilters, type ProductReviewStats, type ProductReviewWithReplies, type ProductSearchParams, type ProductSearchResponse, type ProductService, ProductStatus, type ProductVariant, type ProductVariantCombination, type ProductVariantCombinationEntry, type ProductVariantWithCombinations, type ProductVideo, type ProductWithReviewStats, type ProductWithVariants, ProductsApi, type Promotion, type PromotionData, PromotionMode, PromotionModeSchema, type PromotionModeType, type PromotionQueryParams, PromotionQueryParamsSchema, PromotionSchema, type PromotionStatistics, PromotionStatisticsSchema, PromotionStatus, PromotionStatusSchema, type PromotionStatusType, type PromotionSuggestion, type PromotionSuggestionsResponse, PromotionType, PromotionTypeSchema, type PromotionTypeType, type PromotionWithDiscount, PromotionWithDiscountSchema, PromotionsApi, type PublicAuthConfig, type PublishedStoreTheme, type QuantitiesResponse, RENDER_PREFIX, RESOURCE_REFERENCE_TYPES, RULE_FIELDS, type RatingValue, RedirectsApi, type RegisterPayload, type RequestOptions, type ResetPasswordPayload, type ResetResult, type ResizeMode, type ResolvedAsset, type ResolvedBlogPostRef, type ResolvedCollectionRef, type ResolvedImage, type ResolvedMetaobjectRef, type ResolvedMetaobjectStub, type ResolvedPageRef, type ResolvedProductRef, type ResolvedVariantRef, type ReviewInvitationPublicData, type ReviewStatus, ReviewsApi, type RichTextBlock, type RichTextHeading, type RichTextInline, type RichTextLink, type RichTextList, type RichTextListItem, type RichTextNode, type RichTextParagraph, type RichTextRoot, type RichTextText, type RuleField, type RuleFieldSpec, type RuleOperator, type RuleOperatorSpec, type RuleValueKind, SHIPMENT_STATUSES, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_ERROR_CODES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, type ShipmentStatus, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, type ShippingQuoteChangedDetails, type ShippingRate, type ShippingRateType, type ShippingStatus, type ShippingZone, type SingleEntityApiFunction, type StaleQuantity, type Store, type StoreByDomainInfo, type StoreConfig, type StoreConfigurationInfo, type StoreEmailBrandingSettings, type StoreMenu, type StoreMenuItem, type PaymentMethod as StorePaymentMethod, type StoreSettings, type StoreStatus, type StoreWithRelations, type StorefrontMetafield, type StorefrontMetafields, type StorefrontMetaobjectEntry, StoresApi, type SubmitReviewInvitationPayload, THEME_HEX_COLOR, type ThemeDisplayItem, type ThemeMigration, type ThemeMigrationReport, type ThemeMigrationStep, type ThemeSchema, type ThemeSchemaGroup, type ThemeSchemaItem, type ThemeSetting, type ThemeSettingType, type ThemeSettingsOf, type ThemeValue, type ThemeValueError, type ThemeValues, type ThemeVisibleIf, ThemesApi, type Timestamp, type TocItem, type TokenStorage, UNAVAILABLE_STATES, type UnavailableState, type UpdateAddressDto, type UpdateBlogCategory, type UpdateBlogComment, type UpdateBlogPost, type UpdateBlogSettings, type UpdateBlogTag, type UpdateCartItemRequest, type UpdateCategory, type UpdateContentPage, type UpdateEmbeddedScript, type UpdateOrder, type UpdateOrderItem, type UpdateProduct, type UpdateProductReview, type UpdateProductReviewReply, type UpdateProductVariant, type UpdatePromotion, UpdatePromotionSchema, type UpdateStore, type UpdateStoreConfig, type UpdateStoreSettings, type UpdateVariantOption, type UpdateVariantOptionValue, type UpsertCustomerForAuthPayload, type UrlRedirect, VALIDATION_KEYS, type ValidatePromotionCodeRequest, type ValidatePromotionCodeResponse, type VariantOption, type VariantOptionValue, type VariantStatus, type VerifiedResult, type VerifyOtpPayload, type WithMetafields, type WithSeoMetadata$3 as WithSeoMetadata, allowedCustomerAccess, allowedFileKinds, allowedValuesFor, appliedPromotionSchema, applyThemeMigration, assetBaseUrl, attributeLinkSchema, attributeLinkValueSchema, baseDeleteOptionsSchema, baseDeleteResultSchema, baseQueryParamsSchema, baseTypeOf, blogCategorySchema, blogCommentSchema, blogCommentWithRepliesSchema, blogPostCategorySchema, blogPostSchema, blogPostStatusSchema, blogPostTagSchema, blogPostWithRelationsSchema, blogSettingsSchema, blogTagSchema, buildTransformQuery, categorySchema, categoryTreeSchema, categoryWithChildrenSchema, checkMetaobjectFieldChanges, colorSchema, compareDecimal, contentPageSchema, createAuthAwareHttpClient, createBlogCategorySchema, createBlogCommentSchema, createBlogPostSchema, createBlogSettingsSchema, createBlogTagSchema, createCategorySchema, createContentPageSchema, createEcomwebSdk, createEmbeddedScriptSchema, createOrderItemSchema, createOrderSchema, createProductReviewReplySchema, createProductReviewSchema, createProductSchema, createProductVariantSchema, createStoreConfigSchema, createStoreSchema, createStoreSettingsSchema, createVariantOptionSchema, createVariantOptionValueSchema, customerOrderSummarySchema, decimalSchema, deletedAtSchema, dimensionsSchema, emailBrandingSchema, emailBrandingShape, emailSchema, embeddedScriptPlacementSchema, embeddedScriptSchema, ensureSuccess, entryDisplayName, fromObjectPublicUrlToRender, fulfillmentStatusSchema, idSchema, integrationStatusSchema, inventoryStatusSchema, isBlankValue, isBlankValueFor, isEditableStatus, isListType, isMetafieldType, isPublishableStatus, isRuleField, isSafeRegex, isSettingVisible, isUnpublishedStatus, isValidEntryHandle, jsonSchema, legacyOrderStatusSchema, legacyProductStatusSchema, legalLinksSchema, measurementInBaseUnit, messageOutboxStatusSchema, metafieldIdentifier, moneySchema, normalizeDate, normalizeDateTime, normalizeDecimal, normalizeId, onHand, operatorsForField, optionalTimestampSchema, optionalUrlSchema, orderItemSchema, orderSchema, orderStatusSchema, orderWithItemsSchema, paginatedResponseSchema, paginationMetaSchema, paginationSchema, parseMetafieldIdentifier, parseStorageUrl, parseThemeMigration, parseThemeSchema, paymentMethodSchema, paymentStatusSchema, phoneSchema, positionOrderSchema, productReviewFiltersSchema, productReviewReplyFiltersSchema, productReviewReplySchema, productReviewSchema, productReviewStatsSchema, productReviewWithRepliesSchema, productSchema, productStatusSchema, productVariantCombinationEntrySchema, productVariantCombinationSchema, productVariantSchema, productVariantWithCombinationsSchema, productWithReviewStatsSchema, productWithVariantsAndReviewStatsSchema, productWithVariantsSchema, resolveAssetUrl, resolveThemeSettings, reviewStatusSchema, rewriteSupabaseUrl, richTextLength, safeParseBaseQueryParams, safeParsePaginationMeta, shippingStatusSchema, slugSchema, sortOrderSchema, storeConfigSchema, storeIdSchema, storeSchema, storeSettingsSchema, storeStatusSchema, storeWithRelationsSchema, storefrontAccessAllowed, strictUrlSchema, themeDefaults, themeMajor, themeMigrationSchema, themeSchemaSchema, themeSettings, timestampSchema, toEntryHandle, toMetafieldKey, toObjectUrl, toRenderUrl, tocItemSchema, transformationsEnabled, unavailable, unwrap, unwrapOrNull, updateBlogCategorySchema, updateBlogCommentSchema, updateBlogPostSchema, updateBlogSettingsSchema, updateBlogTagSchema, updateCategorySchema, updateContentPageSchema, updateEmbeddedScriptSchema, updateOrderItemSchema, updateOrderSchema, updateProductReviewReplySchema, updateProductReviewSchema, updateProductSchema, updateProductVariantSchema, updateStoreConfigSchema, updateStoreSchema, updateStoreSettingsSchema, updateVariantOptionSchema, updateVariantOptionValueSchema, urlSchema, uuidSchema, validateMetafieldDefinition, validateMetafieldValue, validateMetaobjectDefinition, validateMetaobjectEntry, validatePaginationMeta, validateRichText, validateThemeValues, validateValidations, valueKindFor, variantOptionSchema, variantOptionValueSchema, variantStatusSchema };
|
|
5344
|
+
export { ADJUSTABLE_STATES, ADMIN_ORDER_SOURCES, type AddToCartRequest, type Address, AddressesApi, type AdjustQuantitiesRequest, type AdjustableState, type AdminOrderSource, ApiClientError, type ApiError, type ApiResponse, type AppliedPromotion, type AttributeLink, AuthApi, type AuthErrorCode, type AuthIdentity, type AuthResult, type AuthTokens, type AutocompleteParams, type BankAccount, type BaseDeleteOptions, type BaseDeleteResult, type BaseQueryParams, type BatchOrderReviewInvitationsResult, BlogApi, type BlogCategory, type BlogCategoryQueryParams, type BlogComment, type BlogCommentWithReplies, type BlogPost, type BlogPostCategory, type BlogPostQueryParams, type BlogPostStatus, type BlogPostTag, type BlogPostWithRelations, type BlogSearchParams, type BlogSearchResponse, type BlogSettings, type BlogTag, type BlogTagQueryParams, COLLECTION_RULE_MATRIX, CONDITION_TYPE_LABELS, CartApi, type CartApiItem, type CartApiResponse, CategoriesApi, type Category, type CategoryQueryParams, type CategorySearchResponse, type CategoryTree, type CategoryWithChildren, type ChangeEmailPayload, type ChangeEmailResult, type ChangePasswordPayload, type ChangedResult, type Collection, type CollectionQueryParams, type CollectionRule, type CollectionRuleSet, type CollectionRuleSetCriteria, type CollectionSearchCriteria, CollectionsApi, ConditionType, ConditionTypeSchema, type ConditionTypeType, type ContentPage, ContentPagesApi, type CreateAddressDto, type CreateBlogCategory, type CreateBlogComment, type CreateBlogPost, type CreateBlogSettings, type CreateBlogTag, type CreateCategory, type CreateContentPage, type CreateEmbeddedScript, type CreateOrder, type CreateOrderItem, type CreateOrderItemRequest, type CreateOrderRequest, type CreateProduct, type CreateProductReview, type CreateProductReviewReply, type CreateProductVariant, type CreatePromotion, CreatePromotionSchema, type CreateStore, type CreateStoreConfig, type CreateStoreSettings, type CreateVariantOption, type CreateVariantOptionValue, type CurrentIdentity, type Customer, type CustomerAccess, type CustomerOrderFilter, type CustomerOrderSummary, CustomersApi, DEFAULT_BUCKET, DISCOUNT_METHOD_LABELS, type DeleteApiFunction, type DeletedAt, DiscountMethod, DiscountMethodSchema, type DiscountMethodType, EMAIL_COLOR_PATTERN, EMAIL_PALETTE_DEFAULTS, ENTRY_HANDLE_PATTERN, type EcomwebSdk, type EcomwebSdkOptions, type EmbeddedScript, type EmbeddedScriptPlacement, type EngineResult, FILTERABLE_TYPES, type FileKind, type FulfillmentStatus, type GoogleAuthUrl, type GuestOrderLookupParams, type IHttpClient, INVENTORY_ADJUSTMENT_REASONS, INVENTORY_ERROR_CODES, INVENTORY_POLICIES, INVENTORY_STATES, INVENTORY_STATUS_LABELS, type Id, type ImageFormat, type ImageTransformOptions, type InitiatePaymentResult, type InsufficientInventoryItem, type IntegrationStatus, type InventoryActor, type InventoryAdjustmentReason, type InventoryErrorCode, type InventoryHistoryEntry, type InventoryImportResponse, type InventoryLevelRow, type InventoryLocation, type InventoryPolicy, type InventoryQuantities, type InventoryState, InventoryStatus, KNOWN_PAYMENT_METHODS, LEGACY_STATUS_MIGRATION_MAP, LEVEL_PROVINCE, LEVEL_WARD, type LegacyOrderStatus, type LegacyProductStatus, type LinkValue, type LocationArea, type LocationAreaQuery, type LocationAreasResponse, type LoginPayload, MAX_RULES_PER_SET, MAX_RULE_VALUE_ENTRIES, MEASUREMENT_UNITS, MEDIA_TYPES, MERCHANT_ADJUSTMENT_REASONS, METAFIELD_BASE_TYPES, METAFIELD_KEY_PATTERN, METAFIELD_LIMITS, METAFIELD_OWNER_TYPES, METAFIELD_TYPE_GROUPS, METAOBJECT_REFERENCE_TYPES, METAOBJECT_TYPE_PATTERN, type MeasurementType, type MeasurementValue, MemoryTokenStorage, MenusApi, type MerchantAdjustmentReason, type MessageOutboxStatus, type MetafieldBaseType, type MetafieldBound, type MetafieldContext, type MetafieldDefinitionShape, type MetafieldIssue, type MetafieldIssueCode, type MetafieldListType, type MetafieldOwnerType, type MetafieldType, type MetafieldTypeGroup, type MetafieldValidationKey, type MetafieldValidations, type MetafieldWrite, type MetaobjectDefinitionShape, type MetaobjectFieldShape, type MetaobjectListParams, type MetaobjectListResult, MetaobjectsApi, type MoneyValue, type MoveQuantitiesRequest, type MutationApiFunction, OBJECT_PREFIX, ORDER_ACTOR_TYPES, ORDER_EVENT_TYPES, ORDER_SHIPMENT_ERROR_CODES, ORDER_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, type OrderShipmentEvent, type OrderShipmentSummary, type OrderSource, type OrderStatus, type OrderTimelineActor, type OrderTimelineComment, type OrderTimelineCommentAuthor, type OrderTimelineEntry, type OrderTimelineEvent, type OrderTimelineResponse, type OrderWithItems, OrdersApi, PAGINATION_DEFAULTS, PRIVATE_REFERENCE_TYPES, PRODUCT_STATUS_LABELS, PROMOTION_MODE_COLORS, PROMOTION_MODE_LABELS, PROMOTION_STATUS_COLORS, PROMOTION_STATUS_LABELS, PROMOTION_TYPE_COLORS, PROMOTION_TYPE_LABELS, type PaginatedApiFunction, type PaginatedPromotionsResponse, PaginatedPromotionsResponseSchema, type PaginatedResponse, type PaginatedReviewsResponse, type PaginationMeta, type PasswordPolicy, type PaymentCredentialStatus, type PaymentMethod$1 as PaymentMethod, PaymentMethodsApi, type PaymentStateResult, type PaymentStatus, PaymentsApi, type Product, type ProductDetail, type ProductImage, type ProductQueryParams, type ProductReview, type ProductReviewFilters, type ProductReviewReply, type ProductReviewReplyFilters, type ProductReviewStats, type ProductReviewWithReplies, type ProductSearchParams, type ProductSearchResponse, type ProductService, ProductStatus, type ProductVariant, type ProductVariantCombination, type ProductVariantCombinationEntry, type ProductVariantWithCombinations, type ProductVideo, type ProductWithReviewStats, type ProductWithVariants, ProductsApi, type Promotion, type PromotionData, PromotionMode, PromotionModeSchema, type PromotionModeType, type PromotionQueryParams, PromotionQueryParamsSchema, PromotionSchema, type PromotionStatistics, PromotionStatisticsSchema, PromotionStatus, PromotionStatusSchema, type PromotionStatusType, type PromotionSuggestion, type PromotionSuggestionsResponse, PromotionType, PromotionTypeSchema, type PromotionTypeType, type PromotionWithDiscount, PromotionWithDiscountSchema, PromotionsApi, type PublicAuthConfig, type PublishedStoreTheme, type QuantitiesResponse, RENDER_PREFIX, RESOURCE_REFERENCE_TYPES, RULE_FIELDS, type RatingValue, RedirectsApi, type RegisterPayload, type RegisterResult, type RequestOptions, type ResetPasswordPayload, type ResetResult, type ResizeMode, type ResolvedAsset, type ResolvedBlogPostRef, type ResolvedCollectionRef, type ResolvedImage, type ResolvedMetaobjectRef, type ResolvedMetaobjectStub, type ResolvedPageRef, type ResolvedProductRef, type ResolvedVariantRef, type ReviewInvitationPublicData, type ReviewStatus, ReviewsApi, type RichTextBlock, type RichTextHeading, type RichTextInline, type RichTextLink, type RichTextList, type RichTextListItem, type RichTextNode, type RichTextParagraph, type RichTextRoot, type RichTextText, type RuleField, type RuleFieldSpec, type RuleOperator, type RuleOperatorSpec, type RuleValueKind, SHIPMENT_STATUSES, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_ERROR_CODES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, type ShipmentStatus, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, type ShippingQuoteChangedDetails, type ShippingRate, type ShippingRateType, type ShippingStatus, type ShippingZone, type SingleEntityApiFunction, type StaleQuantity, type Store, type StoreByDomainInfo, type StoreConfig, type StoreConfigurationInfo, type StoreEmailBrandingSettings, type StoreMenu, type StoreMenuItem, type PaymentMethod as StorePaymentMethod, type StoreSettings, type StoreStatus, type StoreWithRelations, type StorefrontMetafield, type StorefrontMetafields, type StorefrontMetaobjectEntry, StoresApi, type SubmitReviewInvitationPayload, THEME_HEX_COLOR, type ThemeDisplayItem, type ThemeMigration, type ThemeMigrationReport, type ThemeMigrationStep, type ThemeSchema, type ThemeSchemaGroup, type ThemeSchemaItem, type ThemeSetting, type ThemeSettingType, type ThemeSettingsOf, type ThemeValue, type ThemeValueError, type ThemeValues, type ThemeVisibleIf, ThemesApi, type Timestamp, type TocItem, type TokenStorage, UNAVAILABLE_STATES, type UnavailableState, type UpdateAddressDto, type UpdateBlogCategory, type UpdateBlogComment, type UpdateBlogPost, type UpdateBlogSettings, type UpdateBlogTag, type UpdateCartItemRequest, type UpdateCategory, type UpdateContentPage, type UpdateEmbeddedScript, type UpdateOrder, type UpdateOrderItem, type UpdateProduct, type UpdateProductReview, type UpdateProductReviewReply, type UpdateProductVariant, type UpdatePromotion, UpdatePromotionSchema, type UpdateStore, type UpdateStoreConfig, type UpdateStoreSettings, type UpdateVariantOption, type UpdateVariantOptionValue, type UpsertCustomerForAuthPayload, type UrlRedirect, VALIDATION_KEYS, type ValidatePromotionCodeRequest, type ValidatePromotionCodeResponse, type VariantOption, type VariantOptionValue, type VariantStatus, type VerifiedResult, type VerifyOtpPayload, type WithMetafields, type WithSeoMetadata$3 as WithSeoMetadata, allowedCustomerAccess, allowedFileKinds, allowedValuesFor, appliedPromotionSchema, applyThemeMigration, assetBaseUrl, attributeLinkSchema, attributeLinkValueSchema, baseDeleteOptionsSchema, baseDeleteResultSchema, baseQueryParamsSchema, baseTypeOf, blogCategorySchema, blogCommentSchema, blogCommentWithRepliesSchema, blogPostCategorySchema, blogPostSchema, blogPostStatusSchema, blogPostTagSchema, blogPostWithRelationsSchema, blogSettingsSchema, blogTagSchema, buildTransformQuery, categorySchema, categoryTreeSchema, categoryWithChildrenSchema, checkMetaobjectFieldChanges, colorSchema, compareDecimal, contentPageSchema, createAuthAwareHttpClient, createBlogCategorySchema, createBlogCommentSchema, createBlogPostSchema, createBlogSettingsSchema, createBlogTagSchema, createCategorySchema, createContentPageSchema, createEcomwebSdk, createEmbeddedScriptSchema, createOrderItemSchema, createOrderSchema, createProductReviewReplySchema, createProductReviewSchema, createProductSchema, createProductVariantSchema, createStoreConfigSchema, createStoreSchema, createStoreSettingsSchema, createVariantOptionSchema, createVariantOptionValueSchema, customerOrderSummarySchema, decimalSchema, deletedAtSchema, dimensionsSchema, emailBrandingSchema, emailBrandingShape, emailSchema, embeddedScriptPlacementSchema, embeddedScriptSchema, ensureSuccess, entryDisplayName, fromObjectPublicUrlToRender, fulfillmentStatusSchema, idSchema, integrationStatusSchema, inventoryStatusSchema, isBlankValue, isBlankValueFor, isEditableStatus, isListType, isMetafieldType, isPublishableStatus, isRuleField, isSafeRegex, isSettingVisible, isUnpublishedStatus, isValidEntryHandle, jsonSchema, legacyOrderStatusSchema, legacyProductStatusSchema, legalLinksSchema, measurementInBaseUnit, messageOutboxStatusSchema, metafieldIdentifier, moneySchema, normalizeDate, normalizeDateTime, normalizeDecimal, normalizeId, onHand, operatorsForField, optionalTimestampSchema, optionalUrlSchema, orderItemSchema, orderSchema, orderStatusSchema, orderWithItemsSchema, paginatedResponseSchema, paginationMetaSchema, paginationSchema, parseMetafieldIdentifier, parseStorageUrl, parseThemeMigration, parseThemeSchema, paymentMethodSchema, paymentStatusSchema, phoneSchema, positionOrderSchema, productReviewFiltersSchema, productReviewReplyFiltersSchema, productReviewReplySchema, productReviewSchema, productReviewStatsSchema, productReviewWithRepliesSchema, productSchema, productStatusSchema, productVariantCombinationEntrySchema, productVariantCombinationSchema, productVariantSchema, productVariantWithCombinationsSchema, productWithReviewStatsSchema, productWithVariantsAndReviewStatsSchema, productWithVariantsSchema, resolveAssetUrl, resolveThemeSettings, reviewStatusSchema, rewriteSupabaseUrl, richTextLength, safeParseBaseQueryParams, safeParsePaginationMeta, shippingStatusSchema, slugSchema, sortOrderSchema, storeConfigSchema, storeIdSchema, storeSchema, storeSettingsSchema, storeStatusSchema, storeWithRelationsSchema, storefrontAccessAllowed, strictUrlSchema, themeDefaults, themeMajor, themeMigrationSchema, themeSchemaSchema, themeSettings, timestampSchema, toEntryHandle, toMetafieldKey, toObjectUrl, toRenderUrl, tocItemSchema, transformationsEnabled, unavailable, unwrap, unwrapOrNull, updateBlogCategorySchema, updateBlogCommentSchema, updateBlogPostSchema, updateBlogSettingsSchema, updateBlogTagSchema, updateCategorySchema, updateContentPageSchema, updateEmbeddedScriptSchema, updateOrderItemSchema, updateOrderSchema, updateProductReviewReplySchema, updateProductReviewSchema, updateProductSchema, updateProductVariantSchema, updateStoreConfigSchema, updateStoreSchema, updateStoreSettingsSchema, updateVariantOptionSchema, updateVariantOptionValueSchema, urlSchema, uuidSchema, validateMetafieldDefinition, validateMetafieldValue, validateMetaobjectDefinition, validateMetaobjectEntry, validatePaginationMeta, validateRichText, validateThemeValues, validateValidations, valueKindFor, variantOptionSchema, variantOptionValueSchema, variantStatusSchema };
|
package/dist/index.js
CHANGED
|
@@ -271,7 +271,8 @@ var updateEmbeddedScriptSchema = createEmbeddedScriptSchema.partial();
|
|
|
271
271
|
// src/types/store.ts
|
|
272
272
|
var storeSchema = z5.object({
|
|
273
273
|
id: idSchema,
|
|
274
|
-
|
|
274
|
+
// The public store endpoints no longer send it.
|
|
275
|
+
user_id: uuidSchema.optional(),
|
|
275
276
|
name: z5.string().min(1),
|
|
276
277
|
description: z5.string().optional().nullable(),
|
|
277
278
|
status: storeStatusSchema.default("pending")
|
|
@@ -1158,7 +1159,8 @@ var blogCommentSchema = z12.object({
|
|
|
1158
1159
|
blog_post_id: idSchema.optional().nullable(),
|
|
1159
1160
|
parent_comment_id: idSchema.optional().nullable(),
|
|
1160
1161
|
author_name: z12.string().min(1).max(100),
|
|
1161
|
-
|
|
1162
|
+
// Optional on reads: the public comment list no longer returns it.
|
|
1163
|
+
author_email: emailSchema.optional(),
|
|
1162
1164
|
author_website: z12.url().max(255).optional().nullable(),
|
|
1163
1165
|
content: z12.string().min(1),
|
|
1164
1166
|
is_approved: z12.boolean().default(false),
|
|
@@ -1204,7 +1206,7 @@ var createBlogPostSchema = blogPostSchema.omit({
|
|
|
1204
1206
|
var createBlogCommentSchema = blogCommentSchema.omit({
|
|
1205
1207
|
id: true,
|
|
1206
1208
|
created_at: true
|
|
1207
|
-
});
|
|
1209
|
+
}).extend({ author_email: emailSchema });
|
|
1208
1210
|
var createBlogSettingsSchema = blogSettingsSchema.omit({
|
|
1209
1211
|
id: true,
|
|
1210
1212
|
created_at: true,
|
|
@@ -3044,6 +3046,10 @@ var CartApi = class {
|
|
|
3044
3046
|
);
|
|
3045
3047
|
return unwrap(res);
|
|
3046
3048
|
}
|
|
3049
|
+
/**
|
|
3050
|
+
* Merge the guest cart into the signed-in cart. Resolves to
|
|
3051
|
+
* `{ merged: false }` when neither cart exists.
|
|
3052
|
+
*/
|
|
3047
3053
|
async merge(storeRef, sessionId) {
|
|
3048
3054
|
const res = await this.authHttp.post(
|
|
3049
3055
|
`/stores/${storeRef}/cart/merge`,
|
|
@@ -3060,6 +3066,11 @@ var OrdersApi = class {
|
|
|
3060
3066
|
this.publicHttp = publicHttp;
|
|
3061
3067
|
this.authHttp = authHttp;
|
|
3062
3068
|
}
|
|
3069
|
+
/**
|
|
3070
|
+
* Look up a guest order. The API answers with the bare order when it
|
|
3071
|
+
* matches and `{ message }` (HTTP 200) when it does not; a 404 is treated
|
|
3072
|
+
* the same way. Returns null for "not found".
|
|
3073
|
+
*/
|
|
3063
3074
|
async lookupGuest(storeRef, params) {
|
|
3064
3075
|
const query = stringify({
|
|
3065
3076
|
order_code: params.order_code,
|
|
@@ -3070,7 +3081,9 @@ var OrdersApi = class {
|
|
|
3070
3081
|
const res = await this.publicHttp.get(
|
|
3071
3082
|
`/public/stores/${storeRef}/orders/lookup?${query}`
|
|
3072
3083
|
);
|
|
3073
|
-
|
|
3084
|
+
const data = unwrapOrNull(res);
|
|
3085
|
+
if (!data || !("id" in data) || data.id == null) return null;
|
|
3086
|
+
return data;
|
|
3074
3087
|
}
|
|
3075
3088
|
async create(storeRef, data, isAuth) {
|
|
3076
3089
|
if (isAuth) {
|
|
@@ -3598,10 +3611,15 @@ var AuthApi = class {
|
|
|
3598
3611
|
void 0
|
|
3599
3612
|
);
|
|
3600
3613
|
}
|
|
3601
|
-
|
|
3614
|
+
/**
|
|
3615
|
+
* `binding` is the register response's `verification_binding`, when this
|
|
3616
|
+
* client still has it. Omitted, the address is verified but the password
|
|
3617
|
+
* set at registration is dropped.
|
|
3618
|
+
*/
|
|
3619
|
+
async verifyEmail(token, binding) {
|
|
3602
3620
|
return this.http.post(
|
|
3603
3621
|
this.publicPath("verify-email"),
|
|
3604
|
-
{ token },
|
|
3622
|
+
binding ? { token, binding } : { token },
|
|
3605
3623
|
void 0
|
|
3606
3624
|
);
|
|
3607
3625
|
}
|
|
@@ -3626,10 +3644,11 @@ var AuthApi = class {
|
|
|
3626
3644
|
void 0
|
|
3627
3645
|
);
|
|
3628
3646
|
}
|
|
3629
|
-
|
|
3647
|
+
/** `binding` is the change-email response's `confirmation_binding`. */
|
|
3648
|
+
async confirmEmailChange(token, binding) {
|
|
3630
3649
|
return this.http.post(
|
|
3631
3650
|
this.publicPath("change-email/confirm"),
|
|
3632
|
-
{ token },
|
|
3651
|
+
binding ? { token, binding } : { token },
|
|
3633
3652
|
void 0
|
|
3634
3653
|
);
|
|
3635
3654
|
}
|