@viu/emporix-sdk 2.8.0 → 2.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/CHANGELOG.md +82 -0
- package/dist/availability.d.cts +1 -1
- package/dist/availability.d.ts +1 -1
- package/dist/cart.d.cts +1 -1
- package/dist/cart.d.ts +1 -1
- package/dist/category.d.cts +1 -1
- package/dist/category.d.ts +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/{chunk-5JHTZBOC.js → chunk-B4UOYJKW.js} +12 -2
- package/dist/chunk-B4UOYJKW.js.map +1 -0
- package/dist/{chunk-SCI7D74B.js → chunk-BK25FDTH.js} +17 -5
- package/dist/chunk-BK25FDTH.js.map +1 -0
- package/dist/{chunk-B56JZNI7.js → chunk-HAEVK6IS.js} +6 -3
- package/dist/chunk-HAEVK6IS.js.map +1 -0
- package/dist/{chunk-6UNFMCHZ.js → chunk-KVBCTXVH.js} +2 -2
- package/dist/chunk-KVBCTXVH.js.map +1 -0
- package/dist/{chunk-NM7VDXBR.js → chunk-LGLFJL3S.js} +6 -3
- package/dist/chunk-LGLFJL3S.js.map +1 -0
- package/dist/chunk-LGOC5XOI.js +40 -0
- package/dist/chunk-LGOC5XOI.js.map +1 -0
- package/dist/{chunk-RXVVFNYN.js → chunk-MM6JF3Z7.js} +6 -3
- package/dist/chunk-MM6JF3Z7.js.map +1 -0
- package/dist/companies.cjs +4 -1
- package/dist/companies.cjs.map +1 -1
- package/dist/companies.d.cts +8 -5
- package/dist/companies.d.ts +8 -5
- package/dist/companies.js +1 -1
- package/dist/contacts.cjs +4 -1
- package/dist/contacts.cjs.map +1 -1
- package/dist/contacts.d.cts +7 -5
- package/dist/contacts.d.ts +7 -5
- package/dist/contacts.js +1 -1
- package/dist/{context-DJDTlhLW.d.cts → context-BBKOwNW6.d.cts} +16 -0
- package/dist/{context-DJDTlhLW.d.ts → context-BBKOwNW6.d.ts} +16 -0
- package/dist/customer-groups.cjs +17 -0
- package/dist/customer-groups.cjs.map +1 -1
- package/dist/customer-groups.d.cts +95 -22
- package/dist/customer-groups.d.ts +95 -22
- package/dist/customer-groups.js +1 -1
- package/dist/customer.d.cts +1 -1
- package/dist/customer.d.ts +1 -1
- package/dist/index.cjs +80 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -7
- package/dist/index.d.ts +27 -7
- package/dist/index.js +40 -17
- package/dist/index.js.map +1 -1
- package/dist/locations.cjs +4 -1
- package/dist/locations.cjs.map +1 -1
- package/dist/locations.d.cts +8 -5
- package/dist/locations.d.ts +8 -5
- package/dist/locations.js +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +1727 -81
- package/dist/orders.d.ts +1727 -81
- package/dist/orders.js +1 -1
- package/dist/payment.d.cts +1 -1
- package/dist/payment.d.ts +1 -1
- package/dist/price.cjs +15 -3
- package/dist/price.cjs.map +1 -1
- package/dist/price.d.cts +24 -5
- package/dist/price.d.ts +24 -5
- package/dist/price.js +1 -1
- package/dist/product.cjs +10 -0
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +11 -1
- package/dist/product.d.ts +11 -1
- package/dist/product.js +1 -1
- package/dist/segment.d.cts +1 -1
- package/dist/segment.d.ts +1 -1
- package/dist/types.gen-C_wOXYZB.d.cts +455 -0
- package/dist/types.gen-C_wOXYZB.d.ts +455 -0
- package/package.json +1 -1
- package/dist/chunk-5JHTZBOC.js.map +0 -1
- package/dist/chunk-6UNFMCHZ.js.map +0 -1
- package/dist/chunk-B56JZNI7.js.map +0 -1
- package/dist/chunk-NM7VDXBR.js.map +0 -1
- package/dist/chunk-RXVVFNYN.js.map +0 -1
- package/dist/chunk-SCI7D74B.js.map +0 -1
- package/dist/chunk-SKX7KCMH.js +0 -23
- package/dist/chunk-SKX7KCMH.js.map +0 -1
- package/dist/types.gen-D1QuqPLs.d.cts +0 -166
- package/dist/types.gen-D1QuqPLs.d.ts +0 -166
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext, P as PaginatedItems, T as TokenProvider, n as ResolvedConfig, E as EmporixConfig, j as LogLevel, o as ServiceName, e as CustomerTokenRefresher } from './context-
|
|
2
|
-
export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, L as LEVEL, h as LevelResolver, i as LogFields, k as Logger, l as LoggerConfig, m as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, p as StorefrontCredentials, q as auth, r as createConsoleLogger, s as createNoopLogger, t as iterateAll, u as redact, v as resolveToken, w as validateConfig } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext, P as PaginatedItems, T as TokenProvider, n as ResolvedConfig, E as EmporixConfig, j as LogLevel, o as ServiceName, e as CustomerTokenRefresher } from './context-BBKOwNW6.cjs';
|
|
2
|
+
export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, L as LEVEL, h as LevelResolver, i as LogFields, k as Logger, l as LoggerConfig, m as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, p as StorefrontCredentials, q as auth, r as createConsoleLogger, s as createNoopLogger, t as iterateAll, u as redact, v as resolveToken, w as validateConfig } from './context-BBKOwNW6.cjs';
|
|
3
3
|
import { CustomerService } from './customer.cjs';
|
|
4
4
|
export { Address, AddressCreateInput, AddressUpdateInput, Customer, CustomerSession, CustomerSignupInput, CustomerUpdateInput, PasswordChangeInput, PasswordResetConfirmInput, PasswordResetRequestInput } from './customer.cjs';
|
|
5
5
|
import { ProductService } from './product.cjs';
|
|
@@ -13,7 +13,7 @@ export { CheckoutInput, CheckoutOptions, CheckoutResult, QuoteCheckoutInput } fr
|
|
|
13
13
|
import { PaymentGatewayService } from './payment.cjs';
|
|
14
14
|
export { AuthorizePaymentInput, AuthorizePaymentResult, PaymentMode } from './payment.cjs';
|
|
15
15
|
import { PriceService } from './price.cjs';
|
|
16
|
-
export { MatchByContextChunkedOptions, PriceMatch, PriceMatchByContextInput, PriceMatchInput } from './price.cjs';
|
|
16
|
+
export { MatchByContextChunkedOptions, PriceMatch, PriceMatchByContextInput, PriceMatchInput, PriceMatchItemRef } from './price.cjs';
|
|
17
17
|
import { MediaService } from './media.cjs';
|
|
18
18
|
export { Asset, AssetCreateBlobInput, AssetCreateLinkInput, AssetRefId, AssetUpdateBlobInput, AssetUpdateInput, AssetUpdateLinkInput, DownloadResult, ListAssetsQuery } from './media.cjs';
|
|
19
19
|
import { SegmentService } from './segment.cjs';
|
|
@@ -22,12 +22,12 @@ import { CompaniesService } from './companies.cjs';
|
|
|
22
22
|
import { ContactsService } from './contacts.cjs';
|
|
23
23
|
import { LocationsService } from './locations.cjs';
|
|
24
24
|
import { CustomerGroupsService } from './customer-groups.cjs';
|
|
25
|
-
export { IamGroup,
|
|
25
|
+
export { IamGroup, IamGroupMemberAssignment } from './customer-groups.cjs';
|
|
26
26
|
import { OrdersService, SalesOrdersService } from './orders.cjs';
|
|
27
|
-
export { GetOrderOptions, ListMyOrdersOptions, Order,
|
|
27
|
+
export { GetOrderOptions, ListMyOrdersOptions, Order, OrderEntry, OrderStatus, OrderTransitionOptions, SalesOrder, SalesOrderPatch, Transition, UpdateSalesOrderOptions } from './orders.cjs';
|
|
28
28
|
import { AvailabilityService } from './availability.cjs';
|
|
29
29
|
export { Availability, AvailabilityOptions } from './availability.cjs';
|
|
30
|
-
export { A as AccountLimit, C as ContactAssignment, a as ContactAssignmentCreate, b as
|
|
30
|
+
export { A as AccountLimit, C as ContactAssignment, a as ContactAssignmentCreate, b as ContactAssignmentUpdate, c as ContactDetails, d as CustomerGroup, L as LegalEntity, e as LegalEntityCreate, f as LegalEntityUpdate, g as LegalInfo, h as Location, i as LocationCreate, j as LocationUpdate } from './types.gen-C_wOXYZB.cjs';
|
|
31
31
|
|
|
32
32
|
/** Base class for every error thrown by the SDK. */
|
|
33
33
|
declare class EmporixError extends Error {
|
|
@@ -7110,6 +7110,18 @@ declare class EmporixClient {
|
|
|
7110
7110
|
private readonly resolver;
|
|
7111
7111
|
private readonly customerRefresh;
|
|
7112
7112
|
constructor(config: EmporixConfig);
|
|
7113
|
+
/**
|
|
7114
|
+
* Re-binds the storefront price context (currency / siteCode / targetLocation)
|
|
7115
|
+
* for anonymous pricing and invalidates the current anonymous session, so the
|
|
7116
|
+
* next request re-mints a token bound to the new context. Use this to switch
|
|
7117
|
+
* currency at runtime. Carts are currency-bound — clear the cart after a
|
|
7118
|
+
* currency change (the React `setCurrency` does this for you).
|
|
7119
|
+
*/
|
|
7120
|
+
setStorefrontContext(ctx: {
|
|
7121
|
+
currency?: string;
|
|
7122
|
+
siteCode?: string;
|
|
7123
|
+
targetLocation?: string;
|
|
7124
|
+
}): void;
|
|
7113
7125
|
/** Sets the runtime log level globally or for one service. */
|
|
7114
7126
|
setLogLevel(level: LogLevel, opts?: {
|
|
7115
7127
|
service?: ServiceName;
|
|
@@ -7126,4 +7138,12 @@ declare class EmporixClient {
|
|
|
7126
7138
|
setCustomerTokenRefresher(refresher: CustomerTokenRefresher | null): void;
|
|
7127
7139
|
}
|
|
7128
7140
|
|
|
7129
|
-
|
|
7141
|
+
/**
|
|
7142
|
+
* Extracts the product id from a product `itemYrn`
|
|
7143
|
+
* (`urn:yaas:hybris:product:product:<tenant>;<productId>`). Cart and order line
|
|
7144
|
+
* items carry only the YRN, not a bare product id. Returns "" when the YRN is
|
|
7145
|
+
* missing or has no `;` segment.
|
|
7146
|
+
*/
|
|
7147
|
+
declare function productIdFromYrn(yrn: string | undefined): string;
|
|
7148
|
+
|
|
7149
|
+
export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type Agent, type AgentInput, type AgentPatchOp, type AgentSearchQuery, AiService, type Approval, type ApprovalCreated, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNotFoundError, EmporixServerError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListSchemasQuery, LocationsService, LogLevel, MediaService, type MetadataFilter, type MinimumFee, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type QuoteInput, type QuoteResult, type QuoteSlotInput, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexInput, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, SchemaService, type SchemaTypeName, type SchemaUpdate, SegmentService, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, ServiceName, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteList, SiteService, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, TokenProvider, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, errorFromResponse, productIdFromYrn };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientContext, b as AuthContext, P as PaginatedItems, T as TokenProvider, n as ResolvedConfig, E as EmporixConfig, j as LogLevel, o as ServiceName, e as CustomerTokenRefresher } from './context-
|
|
2
|
-
export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, L as LEVEL, h as LevelResolver, i as LogFields, k as Logger, l as LoggerConfig, m as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, p as StorefrontCredentials, q as auth, r as createConsoleLogger, s as createNoopLogger, t as iterateAll, u as redact, v as resolveToken, w as validateConfig } from './context-
|
|
1
|
+
import { C as ClientContext, b as AuthContext, P as PaginatedItems, T as TokenProvider, n as ResolvedConfig, E as EmporixConfig, j as LogLevel, o as ServiceName, e as CustomerTokenRefresher } from './context-BBKOwNW6.js';
|
|
2
|
+
export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, L as LEVEL, h as LevelResolver, i as LogFields, k as Logger, l as LoggerConfig, m as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, p as StorefrontCredentials, q as auth, r as createConsoleLogger, s as createNoopLogger, t as iterateAll, u as redact, v as resolveToken, w as validateConfig } from './context-BBKOwNW6.js';
|
|
3
3
|
import { CustomerService } from './customer.js';
|
|
4
4
|
export { Address, AddressCreateInput, AddressUpdateInput, Customer, CustomerSession, CustomerSignupInput, CustomerUpdateInput, PasswordChangeInput, PasswordResetConfirmInput, PasswordResetRequestInput } from './customer.js';
|
|
5
5
|
import { ProductService } from './product.js';
|
|
@@ -13,7 +13,7 @@ export { CheckoutInput, CheckoutOptions, CheckoutResult, QuoteCheckoutInput } fr
|
|
|
13
13
|
import { PaymentGatewayService } from './payment.js';
|
|
14
14
|
export { AuthorizePaymentInput, AuthorizePaymentResult, PaymentMode } from './payment.js';
|
|
15
15
|
import { PriceService } from './price.js';
|
|
16
|
-
export { MatchByContextChunkedOptions, PriceMatch, PriceMatchByContextInput, PriceMatchInput } from './price.js';
|
|
16
|
+
export { MatchByContextChunkedOptions, PriceMatch, PriceMatchByContextInput, PriceMatchInput, PriceMatchItemRef } from './price.js';
|
|
17
17
|
import { MediaService } from './media.js';
|
|
18
18
|
export { Asset, AssetCreateBlobInput, AssetCreateLinkInput, AssetRefId, AssetUpdateBlobInput, AssetUpdateInput, AssetUpdateLinkInput, DownloadResult, ListAssetsQuery } from './media.js';
|
|
19
19
|
import { SegmentService } from './segment.js';
|
|
@@ -22,12 +22,12 @@ import { CompaniesService } from './companies.js';
|
|
|
22
22
|
import { ContactsService } from './contacts.js';
|
|
23
23
|
import { LocationsService } from './locations.js';
|
|
24
24
|
import { CustomerGroupsService } from './customer-groups.js';
|
|
25
|
-
export { IamGroup,
|
|
25
|
+
export { IamGroup, IamGroupMemberAssignment } from './customer-groups.js';
|
|
26
26
|
import { OrdersService, SalesOrdersService } from './orders.js';
|
|
27
|
-
export { GetOrderOptions, ListMyOrdersOptions, Order,
|
|
27
|
+
export { GetOrderOptions, ListMyOrdersOptions, Order, OrderEntry, OrderStatus, OrderTransitionOptions, SalesOrder, SalesOrderPatch, Transition, UpdateSalesOrderOptions } from './orders.js';
|
|
28
28
|
import { AvailabilityService } from './availability.js';
|
|
29
29
|
export { Availability, AvailabilityOptions } from './availability.js';
|
|
30
|
-
export { A as AccountLimit, C as ContactAssignment, a as ContactAssignmentCreate, b as
|
|
30
|
+
export { A as AccountLimit, C as ContactAssignment, a as ContactAssignmentCreate, b as ContactAssignmentUpdate, c as ContactDetails, d as CustomerGroup, L as LegalEntity, e as LegalEntityCreate, f as LegalEntityUpdate, g as LegalInfo, h as Location, i as LocationCreate, j as LocationUpdate } from './types.gen-C_wOXYZB.js';
|
|
31
31
|
|
|
32
32
|
/** Base class for every error thrown by the SDK. */
|
|
33
33
|
declare class EmporixError extends Error {
|
|
@@ -7110,6 +7110,18 @@ declare class EmporixClient {
|
|
|
7110
7110
|
private readonly resolver;
|
|
7111
7111
|
private readonly customerRefresh;
|
|
7112
7112
|
constructor(config: EmporixConfig);
|
|
7113
|
+
/**
|
|
7114
|
+
* Re-binds the storefront price context (currency / siteCode / targetLocation)
|
|
7115
|
+
* for anonymous pricing and invalidates the current anonymous session, so the
|
|
7116
|
+
* next request re-mints a token bound to the new context. Use this to switch
|
|
7117
|
+
* currency at runtime. Carts are currency-bound — clear the cart after a
|
|
7118
|
+
* currency change (the React `setCurrency` does this for you).
|
|
7119
|
+
*/
|
|
7120
|
+
setStorefrontContext(ctx: {
|
|
7121
|
+
currency?: string;
|
|
7122
|
+
siteCode?: string;
|
|
7123
|
+
targetLocation?: string;
|
|
7124
|
+
}): void;
|
|
7113
7125
|
/** Sets the runtime log level globally or for one service. */
|
|
7114
7126
|
setLogLevel(level: LogLevel, opts?: {
|
|
7115
7127
|
service?: ServiceName;
|
|
@@ -7126,4 +7138,12 @@ declare class EmporixClient {
|
|
|
7126
7138
|
setCustomerTokenRefresher(refresher: CustomerTokenRefresher | null): void;
|
|
7127
7139
|
}
|
|
7128
7140
|
|
|
7129
|
-
|
|
7141
|
+
/**
|
|
7142
|
+
* Extracts the product id from a product `itemYrn`
|
|
7143
|
+
* (`urn:yaas:hybris:product:product:<tenant>;<productId>`). Cart and order line
|
|
7144
|
+
* items carry only the YRN, not a bare product id. Returns "" when the YRN is
|
|
7145
|
+
* missing or has no `;` segment.
|
|
7146
|
+
*/
|
|
7147
|
+
declare function productIdFromYrn(yrn: string | undefined): string;
|
|
7148
|
+
|
|
7149
|
+
export { type AddedPoints, type AdminCustomer, type AdminCustomerAddress, type AdminCustomerAddressInput, type AdminCustomerAddressList, type AdminCustomerAddressUpdate, type AdminCustomerCreated, type AdminCustomerInput, type AdminCustomerList, type AdminCustomerPatch, type AdminCustomerSearchQuery, type AdminCustomerUpdate, type Agent, type AgentInput, type AgentPatchOp, type AgentSearchQuery, AiService, type Approval, type ApprovalCreated, type ApprovalInput, type ApprovalList, type ApprovalPatch, type ApprovalPermittedInput, type ApprovalPermittedResult, ApprovalService, type ApprovalUsersQuery, type ApprovalUsersResult, type Assignee, AuthContext, AvailabilityService, type BatchNextIdEntry, type Brand, type BrandInput, type BrandList, BrandService, type BrandUpdate, CartService, type Catalog, type CatalogCreated, type CatalogInput, type CatalogList, type CatalogPatch, CatalogService, type CatalogUpdate, CategoryService, type CgRelation, type CgRelationList, type ChatRequest, type ChatResponse, CheckoutService, ClientConfigService, type ClientConfiguration, ClientContext, CompaniesService, type CompletionMessage, type CompletionRequest, type CompletionResponse, type Configuration$1 as Configuration, type ConfigurationDraft, ContactsService, type ConversionFactorInput, type ConversionFactorResult, type ConvertUnitInput, type ConvertUnitResult, type Country, type CountryList, CountryService, type CountryUpdate, type Coupon$1 as Coupon, type CouponCreated, type CouponInput, type CouponList, CouponService, type CouponUpdate, type Currency, type CurrencyCreated, type CurrencyInput, type CurrencyList, CurrencyService, type CurrencyUpdate, type CustomEntity, type CustomEntityDraft, type CustomInstance, type CustomInstanceDraft, CustomerAdminService, CustomerGroupsService, CustomerService, type CustomerSummaryBatch, CustomerTokenRefresher, type DeleteAgentOptions, type DeleteConfigOptions, type DeliveryCreated, type DeliveryCycleInput, type DeliverySlot, type DeliverySlotList, type DeliveryTime$1 as DeliveryTime, type DeliveryTimeInput, type DeliveryTimeList, type DeliveryTimeUpdate, type DeliveryWindow$2 as DeliveryWindow, type DeliveryWindowList, type DeliveryWindowValidation, EmporixAuthError, EmporixClient, EmporixConfig, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNotFoundError, EmporixServerError, EmporixValidationError, type ExchangeRate, type ExchangeRateCreated, type ExchangeRateInput, type ExchangeRateList, type ExchangeRateUpdate, type Fee$1 as Fee, type FeeDraft, FeeService, type FindSiteInput, type IndexConfig, type IndexConfigCreated, type IndexPublicConfig, IndexingService, type InstanceSearchBody, type ItemFee, type ItemFeeDraft, type ItemFeeSearch, type JobIdResponse, type Label, type LabelInput, type LabelList, LabelService, type LabelUpdate, type ListConfigOptions, type ListCustomEntitiesOptions, type ListFeesQuery, type ListInstancesQuery, type ListSchemasQuery, LocationsService, LogLevel, MediaService, type MetadataFilter, type MinimumFee, type NewPointsEntry, type NextIdCommandRequest, type NextIdOptions, type NextIdResponse, type NextIdsBatchRequest, type NextIdsBatchResponse, type OrderCycleList, type OrderEntryEventCreate, type OrderStatusChange, OrdersService, type PackagingProductsChange, type PackingEvent, type PackingEventList, PaginatedItems, PaymentGatewayService, type PickOrder, type PickOrderList, type PickPackAck, PickPackService, type PointsSummary, PriceService, ProductService, type QuoteInput, type QuoteResult, type QuoteSlotInput, RagIndexerService, type RagType, type RecalculationJob, type RecalculationJobCreated, type RecalculationJobInput, type RedeemCouponResult, type RedeemMyPointsInput, type RedeemOption, type RedeemOptionList, type RedeemedPoints, type Redemption, type RedemptionCreated, type RedemptionInput, type ReferralCoupon, type Region, type RegionList, type ReindexInput, ResolvedConfig, type ResourceCreated, type Return, type ReturnCreated, type ReturnInput, type ReturnList, type ReturnPatch, type ReturnUpdate, ReturnsService, RewardPointsService, SalesOrdersService, type Schema, type SchemaAttribute, type SchemaDraft, SchemaService, type SchemaTypeName, type SchemaUpdate, SegmentService, SepaExportService, type SepaJob, type SepaJobCreated, type SepaJobInput, type SequenceSchema, type SequenceSchemaCreate, SequentialIdService, ServiceName, type SessionContext, type SessionContextPatch, SessionContextService, type SetItemFeesOptions, type ShippingGroup, type ShippingGroupList, type ShippingMethod, type ShippingMethodList, type ShippingPatch, ShippingService, type ShoppingList, type ShoppingListDraft, type ShoppingListItem, ShoppingListService, type Site$1 as Site, type SiteList, SiteService, type TaxCalculationInput, type TaxCalculationRequest, type TaxCalculationResult, type TaxClass, type TaxConfig, type TaxConfigCreated, type TaxCreation as TaxConfigInput, type TaxUpdate as TaxConfigUpdate, type TaxLocation, TaxService, TenantConfigService, type TextRequest, type TextResponse, TokenProvider, type Unit, type UnitCreated, UnitHandlingService, type UnitInput, type UnitUpdate, type Vendor, type VendorCreated, type VendorInput, type VendorList, type VendorLocation, type VendorLocationInput, type VendorLocationList, type VendorLocationUpdate, type VendorSearchQuery, VendorService, type VendorUpdate, type WebhookConfig, type WebhookConfigCreated, type WebhookConfigDraft, type WebhookConfigPatch, type WebhookDashboardAccess, WebhookService, type WebhookStatistics, type WebhookStatisticsQuery, type WebhookSubscription, type WebhookSubscriptionUpdateItem, type WebhookSubscriptionUpdateResultItem, type Zone, type ZoneList, errorFromResponse, productIdFromYrn };
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { LocationsService } from './chunk-
|
|
2
|
-
export { LocationsService } from './chunk-
|
|
1
|
+
import { LocationsService } from './chunk-LGLFJL3S.js';
|
|
2
|
+
export { LocationsService } from './chunk-LGLFJL3S.js';
|
|
3
3
|
import { MediaService } from './chunk-WSXRUYBE.js';
|
|
4
4
|
export { MediaService } from './chunk-WSXRUYBE.js';
|
|
5
|
-
import { OrdersService, SalesOrdersService } from './chunk-
|
|
6
|
-
export { OrdersService, SalesOrdersService } from './chunk-
|
|
5
|
+
import { OrdersService, SalesOrdersService } from './chunk-KVBCTXVH.js';
|
|
6
|
+
export { OrdersService, SalesOrdersService } from './chunk-KVBCTXVH.js';
|
|
7
7
|
import { PaymentGatewayService } from './chunk-HKPZI7Y5.js';
|
|
8
8
|
export { PaymentGatewayService } from './chunk-HKPZI7Y5.js';
|
|
9
|
-
import { PriceService } from './chunk-
|
|
10
|
-
export { PriceService } from './chunk-
|
|
11
|
-
import { ProductService } from './chunk-
|
|
12
|
-
export { ProductService } from './chunk-
|
|
9
|
+
import { PriceService } from './chunk-BK25FDTH.js';
|
|
10
|
+
export { PriceService } from './chunk-BK25FDTH.js';
|
|
11
|
+
import { ProductService } from './chunk-B4UOYJKW.js';
|
|
12
|
+
export { ProductService } from './chunk-B4UOYJKW.js';
|
|
13
13
|
import { SegmentService } from './chunk-Z6PNI5VT.js';
|
|
14
14
|
export { SegmentService } from './chunk-Z6PNI5VT.js';
|
|
15
15
|
import { AvailabilityService } from './chunk-XMEP74BU.js';
|
|
@@ -21,12 +21,12 @@ export { CategoryService } from './chunk-AUVJ5V47.js';
|
|
|
21
21
|
export { iterateAll } from './chunk-GWJ2U2CP.js';
|
|
22
22
|
import { CheckoutService } from './chunk-OMYVOOSX.js';
|
|
23
23
|
export { CheckoutService } from './chunk-OMYVOOSX.js';
|
|
24
|
-
import { CompaniesService } from './chunk-
|
|
25
|
-
export { CompaniesService } from './chunk-
|
|
26
|
-
import { ContactsService } from './chunk-
|
|
27
|
-
export { ContactsService } from './chunk-
|
|
28
|
-
import { CustomerGroupsService } from './chunk-
|
|
29
|
-
export { CustomerGroupsService } from './chunk-
|
|
24
|
+
import { CompaniesService } from './chunk-MM6JF3Z7.js';
|
|
25
|
+
export { CompaniesService } from './chunk-MM6JF3Z7.js';
|
|
26
|
+
import { ContactsService } from './chunk-HAEVK6IS.js';
|
|
27
|
+
export { ContactsService } from './chunk-HAEVK6IS.js';
|
|
28
|
+
import { CustomerGroupsService } from './chunk-LGOC5XOI.js';
|
|
29
|
+
export { CustomerGroupsService } from './chunk-LGOC5XOI.js';
|
|
30
30
|
import { CustomerService } from './chunk-TLH6SLAF.js';
|
|
31
31
|
export { CustomerService } from './chunk-TLH6SLAF.js';
|
|
32
32
|
import './chunk-BFQ732VZ.js';
|
|
@@ -346,6 +346,7 @@ var DefaultTokenProvider = class {
|
|
|
346
346
|
anon;
|
|
347
347
|
anonLock;
|
|
348
348
|
anonStore;
|
|
349
|
+
contextOverride;
|
|
349
350
|
refreshListeners = /* @__PURE__ */ new Set();
|
|
350
351
|
onRefresh(listener) {
|
|
351
352
|
this.refreshListeners.add(listener);
|
|
@@ -458,6 +459,11 @@ var DefaultTokenProvider = class {
|
|
|
458
459
|
this.anon = void 0;
|
|
459
460
|
this.anonStore?.write(null);
|
|
460
461
|
}
|
|
462
|
+
setAnonymousContext(ctx) {
|
|
463
|
+
const base = this.contextOverride ?? this.cfg.credentials.storefront?.context ?? {};
|
|
464
|
+
this.contextOverride = { ...base, ...ctx };
|
|
465
|
+
this.invalidateAnonymous();
|
|
466
|
+
}
|
|
461
467
|
/** Force a stale access token while keeping the refresh token + sessionId. */
|
|
462
468
|
expireAnonymous() {
|
|
463
469
|
if (this.anon) this.anon = { ...this.anon, expiresAt: 0 };
|
|
@@ -474,7 +480,7 @@ var DefaultTokenProvider = class {
|
|
|
474
480
|
const url = new URL(`${this.cfg.host}/customerlogin/auth/anonymous/${mode}`);
|
|
475
481
|
url.searchParams.set("tenant", this.cfg.tenant);
|
|
476
482
|
url.searchParams.set("client_id", sf.clientId);
|
|
477
|
-
const c = sf.context;
|
|
483
|
+
const c = this.contextOverride ?? sf.context;
|
|
478
484
|
if (c?.currency) url.searchParams.set("currency", c.currency);
|
|
479
485
|
if (c?.siteCode) url.searchParams.set("siteCode", c.siteCode);
|
|
480
486
|
if (c?.targetLocation) url.searchParams.set("targetLocation", c.targetLocation);
|
|
@@ -3440,7 +3446,7 @@ var ApprovalService = class {
|
|
|
3440
3446
|
};
|
|
3441
3447
|
|
|
3442
3448
|
// package.json
|
|
3443
|
-
var version = "2.
|
|
3449
|
+
var version = "2.10.0";
|
|
3444
3450
|
|
|
3445
3451
|
// src/version.ts
|
|
3446
3452
|
var SDK_VERSION = version;
|
|
@@ -3592,6 +3598,16 @@ var EmporixClient = class {
|
|
|
3592
3598
|
this.customerAdmin = new CustomerAdminService(mk("customer-admin"));
|
|
3593
3599
|
this.approvals = new ApprovalService(mk("approval"));
|
|
3594
3600
|
}
|
|
3601
|
+
/**
|
|
3602
|
+
* Re-binds the storefront price context (currency / siteCode / targetLocation)
|
|
3603
|
+
* for anonymous pricing and invalidates the current anonymous session, so the
|
|
3604
|
+
* next request re-mints a token bound to the new context. Use this to switch
|
|
3605
|
+
* currency at runtime. Carts are currency-bound — clear the cart after a
|
|
3606
|
+
* currency change (the React `setCurrency` does this for you).
|
|
3607
|
+
*/
|
|
3608
|
+
setStorefrontContext(ctx) {
|
|
3609
|
+
this.tokenProvider.setAnonymousContext?.(ctx);
|
|
3610
|
+
}
|
|
3595
3611
|
/** Sets the runtime log level globally or for one service. */
|
|
3596
3612
|
setLogLevel(level, opts = {}) {
|
|
3597
3613
|
this.resolver.set(level, opts.service, opts.force ?? false);
|
|
@@ -3611,6 +3627,13 @@ var EmporixClient = class {
|
|
|
3611
3627
|
}
|
|
3612
3628
|
};
|
|
3613
3629
|
|
|
3614
|
-
|
|
3630
|
+
// src/core/yrn.ts
|
|
3631
|
+
function productIdFromYrn(yrn) {
|
|
3632
|
+
if (!yrn) return "";
|
|
3633
|
+
const semi = yrn.lastIndexOf(";");
|
|
3634
|
+
return semi >= 0 ? yrn.slice(semi + 1) : "";
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CountryService, CouponService, CurrencyService, CustomerAdminService, CustomerRefreshRegistry, DEFAULT_HOST, DefaultTokenProvider, EmporixClient, FeeService, HttpClient, IndexingService, LEVEL, LabelService, LevelResolver, PickPackService, RagIndexerService, ReturnsService, RewardPointsService, SchemaService, SepaExportService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, auth, createConsoleLogger, createNoopLogger, productIdFromYrn, redact, resolveToken, validateConfig };
|
|
3615
3638
|
//# sourceMappingURL=index.js.map
|
|
3616
3639
|
//# sourceMappingURL=index.js.map
|