@ecomweb/sdk 0.9.0 → 0.10.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/dist/index.d.ts +86 -7
- package/dist/index.js +29 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -920,14 +920,14 @@ type ProductReviewReplyFilters = z.infer<typeof productReviewReplyFiltersSchema>
|
|
|
920
920
|
* The order timeline: status history plus internal staff comments, served to
|
|
921
921
|
* admin clients by `GET stores/:storeRef/orders/:id/timeline`.
|
|
922
922
|
*
|
|
923
|
-
*
|
|
924
|
-
*
|
|
925
|
-
*
|
|
923
|
+
* The vocabulary is owned by `ecomweb-contracts/src/types/order-timeline.ts`;
|
|
924
|
+
* this copy is kept in parity, and the API pins it in
|
|
925
|
+
* `order-event-type-vocabulary.contract.spec.ts`. Types only: the dashboard calls the admin routes through its own
|
|
926
926
|
* client.
|
|
927
927
|
*/
|
|
928
|
-
declare const ORDER_EVENT_TYPES: readonly ["placed", "order_status_changed", "fulfillment_status_changed", "shipping_status_changed", "payment_status_changed", "tracking_number_updated"];
|
|
928
|
+
declare const ORDER_EVENT_TYPES: readonly ["placed", "order_status_changed", "fulfillment_status_changed", "shipping_status_changed", "payment_status_changed", "tracking_number_updated", "shipment_booked", "shipment_cancelled", "shipment_failed"];
|
|
929
929
|
type OrderEventType = (typeof ORDER_EVENT_TYPES)[number];
|
|
930
|
-
declare const ORDER_ACTOR_TYPES: readonly ["staff", "customer", "api_key", "gateway", "system"];
|
|
930
|
+
declare const ORDER_ACTOR_TYPES: readonly ["staff", "customer", "api_key", "gateway", "system", "carrier"];
|
|
931
931
|
type OrderActorType = (typeof ORDER_ACTOR_TYPES)[number];
|
|
932
932
|
interface OrderTimelineActor {
|
|
933
933
|
type: OrderActorType;
|
|
@@ -1660,6 +1660,36 @@ declare const updateCategorySchema: z.ZodObject<{
|
|
|
1660
1660
|
declare const categoryWithChildrenSchema: z.ZodType<CategoryWithChildren>;
|
|
1661
1661
|
declare const categoryTreeSchema: z.ZodType<CategoryTree>;
|
|
1662
1662
|
|
|
1663
|
+
/**
|
|
1664
|
+
* The buyer-facing shipment summary carried on an order, plus its error codes.
|
|
1665
|
+
* The API builds it from the carrier booking; this is the wire shape only.
|
|
1666
|
+
*/
|
|
1667
|
+
declare const SHIPMENT_STATUSES: readonly ["booked", "picked_up", "in_transit", "out_for_delivery", "delivered", "failed", "returned", "cancelled"];
|
|
1668
|
+
type ShipmentStatus = (typeof SHIPMENT_STATUSES)[number];
|
|
1669
|
+
/** One tracking event on a shipment. */
|
|
1670
|
+
interface OrderShipmentEvent {
|
|
1671
|
+
/** ISO 8601. */
|
|
1672
|
+
occurred_at: string;
|
|
1673
|
+
/** Carrier status text, ready to show. */
|
|
1674
|
+
label: string;
|
|
1675
|
+
location: string | null;
|
|
1676
|
+
}
|
|
1677
|
+
/** What a buyer sees of their shipment. */
|
|
1678
|
+
interface OrderShipmentSummary {
|
|
1679
|
+
carrier_name: string | null;
|
|
1680
|
+
carrier_logo_url: string | null;
|
|
1681
|
+
service_name: string | null;
|
|
1682
|
+
tracking_number: string | null;
|
|
1683
|
+
track_link: string | null;
|
|
1684
|
+
status: ShipmentStatus | null;
|
|
1685
|
+
events: OrderShipmentEvent[];
|
|
1686
|
+
}
|
|
1687
|
+
/** Error codes the order endpoints return for shipment-related refusals. */
|
|
1688
|
+
declare const ORDER_SHIPMENT_ERROR_CODES: {
|
|
1689
|
+
/** Cancelling is refused because a carrier shipment is already in progress. */
|
|
1690
|
+
readonly CANCEL_BLOCKED_BY_SHIPMENT: "ORDER_CANCEL_BLOCKED_BY_SHIPMENT";
|
|
1691
|
+
};
|
|
1692
|
+
|
|
1663
1693
|
/**
|
|
1664
1694
|
* Order-related schemas based on Prisma models
|
|
1665
1695
|
*/
|
|
@@ -1743,6 +1773,18 @@ interface Order extends OptionalTimestamp {
|
|
|
1743
1773
|
/** Display names resolved server-side from the shippings module. */
|
|
1744
1774
|
shipping_city_name?: string | null;
|
|
1745
1775
|
shipping_ward_name?: string | null;
|
|
1776
|
+
/** Carrier name chosen at checkout, when a carrier option was picked. */
|
|
1777
|
+
shipping_carrier?: string | null;
|
|
1778
|
+
/**
|
|
1779
|
+
* The buyer-facing shipment (carrier, tracking, events). Present on the
|
|
1780
|
+
* customer detail and guest lookup responses.
|
|
1781
|
+
*/
|
|
1782
|
+
shipment?: OrderShipmentSummary | null;
|
|
1783
|
+
/**
|
|
1784
|
+
* Whether the buyer may still cancel this order. Present on the customer
|
|
1785
|
+
* detail and guest lookup responses.
|
|
1786
|
+
*/
|
|
1787
|
+
can_cancel?: boolean;
|
|
1746
1788
|
source: OrderSource;
|
|
1747
1789
|
/**
|
|
1748
1790
|
* The staff member who keyed this order in. Present on the detail
|
|
@@ -1784,7 +1826,7 @@ interface CustomerOrderSummary {
|
|
|
1784
1826
|
* compatibility but ignored — never rely on a value sent here.
|
|
1785
1827
|
*/
|
|
1786
1828
|
type ServerComputedOrderAmounts = "subtotal" | "original_subtotal" | "shipping_fee" | "original_shipping_fee" | "shipping_discount" | "discount" | "total";
|
|
1787
|
-
type CreateOrder = Omit<Order, "id" | "order_number" | "order_code" | keyof OptionalTimestamp | "applied_promotions" | "shipping_method_name" | "shipping_city_name" | "shipping_ward_name" | "tax" | ServerComputedOrderAmounts | "source" | "created_by"> & Partial<Pick<Order, ServerComputedOrderAmounts>> & {
|
|
1829
|
+
type CreateOrder = Omit<Order, "id" | "order_number" | "order_code" | keyof OptionalTimestamp | "applied_promotions" | "shipping_method_name" | "shipping_city_name" | "shipping_ward_name" | "shipping_carrier" | "shipment" | "can_cancel" | "tax" | ServerComputedOrderAmounts | "source" | "created_by"> & Partial<Pick<Order, ServerComputedOrderAmounts>> & {
|
|
1788
1830
|
/**
|
|
1789
1831
|
* Which shipping method the shopper picked. Write-only: the API prices it
|
|
1790
1832
|
* from the store's shipping rules and rejects a method with no available
|
|
@@ -4118,6 +4160,18 @@ interface CreateOrderRequest {
|
|
|
4118
4160
|
* option.
|
|
4119
4161
|
*/
|
|
4120
4162
|
shipping_rate_id?: number;
|
|
4163
|
+
/**
|
|
4164
|
+
* The `carrier_service_id` of the chosen option when it is a carrier
|
|
4165
|
+
* option; send it with `shipping_rate_id`.
|
|
4166
|
+
*/
|
|
4167
|
+
shipping_service_id?: string;
|
|
4168
|
+
/**
|
|
4169
|
+
* The chosen carrier option's `amount`, as the buyer saw it. When the API
|
|
4170
|
+
* had to requote and the price differs (or this is absent), it answers
|
|
4171
|
+
* `SHIPPING_QUOTE_CHANGED` with fresh options; send the new amount to
|
|
4172
|
+
* confirm.
|
|
4173
|
+
*/
|
|
4174
|
+
shipping_quoted_amount?: number;
|
|
4121
4175
|
payment_method: PaymentMethod$1;
|
|
4122
4176
|
notes?: string;
|
|
4123
4177
|
customer_address_id?: number;
|
|
@@ -4586,6 +4640,8 @@ interface ShippingCalculationRequest {
|
|
|
4586
4640
|
method?: "standard" | "express" | "pickup" | "cod";
|
|
4587
4641
|
distance_km?: number;
|
|
4588
4642
|
tags?: string[];
|
|
4643
|
+
/** Opt in to live carrier rates alongside fixed ones. Not defaulted by the SDK. */
|
|
4644
|
+
include_carrier_options?: boolean;
|
|
4589
4645
|
}
|
|
4590
4646
|
declare const SHIPPING_DELIVERY_TYPES: readonly ["STANDARD", "EXPRESS", "SAME_DAY", "ECONOMY", "PICKUP"];
|
|
4591
4647
|
type ShippingDeliveryType = (typeof SHIPPING_DELIVERY_TYPES)[number];
|
|
@@ -4621,10 +4677,24 @@ interface ShippingOption {
|
|
|
4621
4677
|
amount: number;
|
|
4622
4678
|
currency: string;
|
|
4623
4679
|
rate_id: number;
|
|
4680
|
+
/** `<rate_id>` for fixed, `<rate_id>:<service_id>` for carrier; absent from APIs before carrier rates. */
|
|
4681
|
+
option_id?: string;
|
|
4624
4682
|
delivery_type: ShippingDeliveryType;
|
|
4625
4683
|
display_name: string;
|
|
4626
4684
|
estimated_days_min?: number | null;
|
|
4627
4685
|
estimated_days_max?: number | null;
|
|
4686
|
+
/** Set on carrier-quoted options only. */
|
|
4687
|
+
carrier_code?: "allingo";
|
|
4688
|
+
/** The carrier's own id for the chosen service. */
|
|
4689
|
+
carrier_service_id?: string;
|
|
4690
|
+
/** Carrier display name, e.g. for a label beside the price. */
|
|
4691
|
+
carrier_name?: string;
|
|
4692
|
+
/** The carrier's service, e.g. "Giao chuẩn"; tells two options of one carrier apart. */
|
|
4693
|
+
carrier_service_name?: string;
|
|
4694
|
+
/** Carrier logo, or null when the carrier has none. */
|
|
4695
|
+
carrier_logo_url?: string | null;
|
|
4696
|
+
/** Human-readable delivery estimate from the carrier, or null. */
|
|
4697
|
+
estimated_label?: string | null;
|
|
4628
4698
|
/** Populated only when the caller asks for debug output. */
|
|
4629
4699
|
zone_id?: number;
|
|
4630
4700
|
zone_name?: string;
|
|
@@ -4634,6 +4704,15 @@ interface ShippingOption {
|
|
|
4634
4704
|
rank: number;
|
|
4635
4705
|
}>;
|
|
4636
4706
|
}
|
|
4707
|
+
/** Error codes the shipping endpoints and order creation can return. */
|
|
4708
|
+
declare const SHIPPING_ERROR_CODES: {
|
|
4709
|
+
readonly QUOTE_CHANGED: "SHIPPING_QUOTE_CHANGED";
|
|
4710
|
+
readonly RATE_UNAVAILABLE: "ORDER_SHIPPING_RATE_UNAVAILABLE";
|
|
4711
|
+
};
|
|
4712
|
+
/** `details` of a SHIPPING_QUOTE_CHANGED error: the options now on offer. */
|
|
4713
|
+
interface ShippingQuoteChangedDetails {
|
|
4714
|
+
options: ShippingOption[];
|
|
4715
|
+
}
|
|
4637
4716
|
|
|
4638
4717
|
declare class ShippingApi {
|
|
4639
4718
|
private http;
|
|
@@ -5193,4 +5272,4 @@ declare function createEcomwebSdk(options: EcomwebSdkOptions): {
|
|
|
5193
5272
|
};
|
|
5194
5273
|
type EcomwebSdk = ReturnType<typeof createEcomwebSdk>;
|
|
5195
5274
|
|
|
5196
|
-
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_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, 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, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, 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 };
|
|
5275
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -877,6 +877,22 @@ var customerOrderSummarySchema = z10.object({
|
|
|
877
877
|
last_order_date: z10.iso.datetime().optional().nullable()
|
|
878
878
|
});
|
|
879
879
|
|
|
880
|
+
// src/types/shipment.ts
|
|
881
|
+
var SHIPMENT_STATUSES = [
|
|
882
|
+
"booked",
|
|
883
|
+
"picked_up",
|
|
884
|
+
"in_transit",
|
|
885
|
+
"out_for_delivery",
|
|
886
|
+
"delivered",
|
|
887
|
+
"failed",
|
|
888
|
+
"returned",
|
|
889
|
+
"cancelled"
|
|
890
|
+
];
|
|
891
|
+
var ORDER_SHIPMENT_ERROR_CODES = {
|
|
892
|
+
/** Cancelling is refused because a carrier shipment is already in progress. */
|
|
893
|
+
CANCEL_BLOCKED_BY_SHIPMENT: "ORDER_CANCEL_BLOCKED_BY_SHIPMENT"
|
|
894
|
+
};
|
|
895
|
+
|
|
880
896
|
// src/types/order-timeline.ts
|
|
881
897
|
var ORDER_EVENT_TYPES = [
|
|
882
898
|
"placed",
|
|
@@ -884,14 +900,18 @@ var ORDER_EVENT_TYPES = [
|
|
|
884
900
|
"fulfillment_status_changed",
|
|
885
901
|
"shipping_status_changed",
|
|
886
902
|
"payment_status_changed",
|
|
887
|
-
"tracking_number_updated"
|
|
903
|
+
"tracking_number_updated",
|
|
904
|
+
"shipment_booked",
|
|
905
|
+
"shipment_cancelled",
|
|
906
|
+
"shipment_failed"
|
|
888
907
|
];
|
|
889
908
|
var ORDER_ACTOR_TYPES = [
|
|
890
909
|
"staff",
|
|
891
910
|
"customer",
|
|
892
911
|
"api_key",
|
|
893
912
|
"gateway",
|
|
894
|
-
"system"
|
|
913
|
+
"system",
|
|
914
|
+
"carrier"
|
|
895
915
|
];
|
|
896
916
|
|
|
897
917
|
// src/types/promotion.ts
|
|
@@ -3878,6 +3898,10 @@ var SHIPPING_CONDITION_TYPES = [
|
|
|
3878
3898
|
"ORDER_VALUE",
|
|
3879
3899
|
"WEIGHT"
|
|
3880
3900
|
];
|
|
3901
|
+
var SHIPPING_ERROR_CODES = {
|
|
3902
|
+
QUOTE_CHANGED: "SHIPPING_QUOTE_CHANGED",
|
|
3903
|
+
RATE_UNAVAILABLE: "ORDER_SHIPPING_RATE_UNAVAILABLE"
|
|
3904
|
+
};
|
|
3881
3905
|
|
|
3882
3906
|
// src/index.ts
|
|
3883
3907
|
function createEcomwebSdk(options) {
|
|
@@ -3958,6 +3982,7 @@ export {
|
|
|
3958
3982
|
OBJECT_PREFIX,
|
|
3959
3983
|
ORDER_ACTOR_TYPES,
|
|
3960
3984
|
ORDER_EVENT_TYPES,
|
|
3985
|
+
ORDER_SHIPMENT_ERROR_CODES,
|
|
3961
3986
|
ORDER_SOURCES,
|
|
3962
3987
|
OrdersApi,
|
|
3963
3988
|
PAGINATION_DEFAULTS,
|
|
@@ -3990,8 +4015,10 @@ export {
|
|
|
3990
4015
|
RULE_FIELDS,
|
|
3991
4016
|
RedirectsApi,
|
|
3992
4017
|
ReviewsApi,
|
|
4018
|
+
SHIPMENT_STATUSES,
|
|
3993
4019
|
SHIPPING_CONDITION_TYPES,
|
|
3994
4020
|
SHIPPING_DELIVERY_TYPES,
|
|
4021
|
+
SHIPPING_ERROR_CODES,
|
|
3995
4022
|
SHIPPING_RATE_TYPES,
|
|
3996
4023
|
SearchApi,
|
|
3997
4024
|
ShippingApi,
|