@viu/emporix-sdk 2.15.0 → 2.18.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +19 -0
  3. package/dist/category.cjs +28 -0
  4. package/dist/category.cjs.map +1 -1
  5. package/dist/category.d.cts +10 -0
  6. package/dist/category.d.ts +10 -0
  7. package/dist/category.js +2 -1
  8. package/dist/{chunk-62PCCHZ2.js → chunk-36T4YPQJ.js} +7 -2
  9. package/dist/chunk-36T4YPQJ.js.map +1 -0
  10. package/dist/{chunk-GIZS4BY3.js → chunk-6XND7SYV.js} +20 -2
  11. package/dist/chunk-6XND7SYV.js.map +1 -0
  12. package/dist/{chunk-5VTBLBXJ.js → chunk-FZMP5NQZ.js} +10 -4
  13. package/dist/chunk-FZMP5NQZ.js.map +1 -0
  14. package/dist/chunk-PYLWZZC4.js +280 -0
  15. package/dist/chunk-PYLWZZC4.js.map +1 -0
  16. package/dist/chunk-S5HEIQDK.js +14 -0
  17. package/dist/chunk-S5HEIQDK.js.map +1 -0
  18. package/dist/index.cjs +68 -24
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +13 -7
  21. package/dist/index.d.ts +13 -7
  22. package/dist/index.js +19 -258
  23. package/dist/index.js.map +1 -1
  24. package/dist/orders.cjs +14 -0
  25. package/dist/orders.cjs.map +1 -1
  26. package/dist/orders.d.cts +3 -0
  27. package/dist/orders.d.ts +3 -0
  28. package/dist/orders.js +2 -1
  29. package/dist/payment.cjs +24 -7
  30. package/dist/payment.cjs.map +1 -1
  31. package/dist/payment.d.cts +7 -3
  32. package/dist/payment.d.ts +7 -3
  33. package/dist/payment.js +1 -1
  34. package/dist/product.cjs +14 -2
  35. package/dist/product.cjs.map +1 -1
  36. package/dist/product.d.cts +7 -2
  37. package/dist/product.d.ts +7 -2
  38. package/dist/product.js +2 -1
  39. package/dist/query-mLQs2WFr.d.cts +28 -0
  40. package/dist/query-mLQs2WFr.d.ts +28 -0
  41. package/dist/segment.d.cts +1 -0
  42. package/dist/segment.d.ts +1 -0
  43. package/package.json +1 -1
  44. package/dist/chunk-5VTBLBXJ.js.map +0 -1
  45. package/dist/chunk-62PCCHZ2.js.map +0 -1
  46. package/dist/chunk-GIZS4BY3.js.map +0 -1
  47. package/dist/chunk-XEJPH6UN.js +0 -31
  48. package/dist/chunk-XEJPH6UN.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -27,6 +27,8 @@ import { OrdersService, SalesOrdersService } from './orders.cjs';
27
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
+ import { a as QueryFor } from './query-mLQs2WFr.cjs';
31
+ export { B as BuiltQuery, Q as QueryCapability, r as resolveQuery } from './query-mLQs2WFr.cjs';
30
32
  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
33
 
32
34
  /** Base class for every error thrown by the SDK. */
@@ -5755,8 +5757,10 @@ type VendorInput = VendorCreate;
5755
5757
  type VendorUpdate = VendorUpdate$1;
5756
5758
  /** Create response — a resource id. */
5757
5759
  type VendorCreated = ResourceId;
5758
- /** Search body (`POST /vendors/search`). */
5759
- type VendorSearchQuery = Record<string, unknown>;
5760
+ /** Search body (`POST /vendors/search`). `q` accepts a raw DSL string or a built filter. */
5761
+ type VendorSearchQuery = Record<string, unknown> & {
5762
+ q?: QueryFor<"VENDOR">;
5763
+ };
5760
5764
  /** A vendor location (read shape). */
5761
5765
  type VendorLocation = Location$1;
5762
5766
  /** List of vendor locations. */
@@ -5781,7 +5785,7 @@ declare class VendorService {
5781
5785
  listVendors(query?: Record<string, string | number>, auth?: AuthContext): Promise<VendorList>;
5782
5786
  /** Retrieve a vendor by id. */
5783
5787
  getVendor(vendorId: string, auth?: AuthContext): Promise<Vendor>;
5784
- /** Search vendors (`POST /vendors/search`). */
5788
+ /** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
5785
5789
  searchVendors(query: VendorSearchQuery, auth?: AuthContext): Promise<VendorList>;
5786
5790
  /** Create a vendor. */
5787
5791
  createVendor(input: VendorInput, auth?: AuthContext): Promise<VendorCreated>;
@@ -6584,8 +6588,10 @@ type AdminCustomerUpdate = CustomerUpdateBySellerDto;
6584
6588
  type AdminCustomerPatch = CustomerPatchBySellerDto;
6585
6589
  /** Create/upsert response — a resource location. */
6586
6590
  type AdminCustomerCreated = ResourceLocation;
6587
- /** Search body (`POST /customers/search`). */
6588
- type AdminCustomerSearchQuery = Record<string, unknown>;
6591
+ /** Search body (`POST /customers/search`). `q` accepts a raw DSL string or a built filter. */
6592
+ type AdminCustomerSearchQuery = Record<string, unknown> & {
6593
+ q?: QueryFor<"CUSTOMER">;
6594
+ };
6589
6595
  /** A customer address (read). */
6590
6596
  type AdminCustomerAddress = Address$1;
6591
6597
  /** List of customer addresses. */
@@ -6609,7 +6615,7 @@ declare class CustomerAdminService {
6609
6615
  private addressPath;
6610
6616
  /** List customers. */
6611
6617
  listCustomers(query?: Record<string, string | number>, auth?: AuthContext): Promise<AdminCustomerList>;
6612
- /** Search customers (`POST /customers/search`). */
6618
+ /** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
6613
6619
  searchCustomers(query: AdminCustomerSearchQuery, auth?: AuthContext): Promise<AdminCustomerList>;
6614
6620
  /** Retrieve a customer profile by number. */
6615
6621
  getCustomer(customerNumber: string, auth?: AuthContext): Promise<AdminCustomer>;
@@ -7255,4 +7261,4 @@ declare function createEmporixClient<S extends Record<string, ServiceClass<unkno
7255
7261
  */
7256
7262
  declare function productIdFromYrn(yrn: string | undefined): string;
7257
7263
 
7258
- 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, CloudFunctionsService, 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, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, 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 InvokeCloudFunctionOptions, 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, type ServiceClass, 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, createCore, createEmporixClient, errorFromResponse, productIdFromYrn };
7264
+ 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, CloudFunctionsService, 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, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, 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 InvokeCloudFunctionOptions, 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, QueryFor, 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, type ServiceClass, 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, createCore, createEmporixClient, errorFromResponse, productIdFromYrn };
package/dist/index.d.ts CHANGED
@@ -27,6 +27,8 @@ import { OrdersService, SalesOrdersService } from './orders.js';
27
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
+ import { a as QueryFor } from './query-mLQs2WFr.js';
31
+ export { B as BuiltQuery, Q as QueryCapability, r as resolveQuery } from './query-mLQs2WFr.js';
30
32
  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
33
 
32
34
  /** Base class for every error thrown by the SDK. */
@@ -5755,8 +5757,10 @@ type VendorInput = VendorCreate;
5755
5757
  type VendorUpdate = VendorUpdate$1;
5756
5758
  /** Create response — a resource id. */
5757
5759
  type VendorCreated = ResourceId;
5758
- /** Search body (`POST /vendors/search`). */
5759
- type VendorSearchQuery = Record<string, unknown>;
5760
+ /** Search body (`POST /vendors/search`). `q` accepts a raw DSL string or a built filter. */
5761
+ type VendorSearchQuery = Record<string, unknown> & {
5762
+ q?: QueryFor<"VENDOR">;
5763
+ };
5760
5764
  /** A vendor location (read shape). */
5761
5765
  type VendorLocation = Location$1;
5762
5766
  /** List of vendor locations. */
@@ -5781,7 +5785,7 @@ declare class VendorService {
5781
5785
  listVendors(query?: Record<string, string | number>, auth?: AuthContext): Promise<VendorList>;
5782
5786
  /** Retrieve a vendor by id. */
5783
5787
  getVendor(vendorId: string, auth?: AuthContext): Promise<Vendor>;
5784
- /** Search vendors (`POST /vendors/search`). */
5788
+ /** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
5785
5789
  searchVendors(query: VendorSearchQuery, auth?: AuthContext): Promise<VendorList>;
5786
5790
  /** Create a vendor. */
5787
5791
  createVendor(input: VendorInput, auth?: AuthContext): Promise<VendorCreated>;
@@ -6584,8 +6588,10 @@ type AdminCustomerUpdate = CustomerUpdateBySellerDto;
6584
6588
  type AdminCustomerPatch = CustomerPatchBySellerDto;
6585
6589
  /** Create/upsert response — a resource location. */
6586
6590
  type AdminCustomerCreated = ResourceLocation;
6587
- /** Search body (`POST /customers/search`). */
6588
- type AdminCustomerSearchQuery = Record<string, unknown>;
6591
+ /** Search body (`POST /customers/search`). `q` accepts a raw DSL string or a built filter. */
6592
+ type AdminCustomerSearchQuery = Record<string, unknown> & {
6593
+ q?: QueryFor<"CUSTOMER">;
6594
+ };
6589
6595
  /** A customer address (read). */
6590
6596
  type AdminCustomerAddress = Address$1;
6591
6597
  /** List of customer addresses. */
@@ -6609,7 +6615,7 @@ declare class CustomerAdminService {
6609
6615
  private addressPath;
6610
6616
  /** List customers. */
6611
6617
  listCustomers(query?: Record<string, string | number>, auth?: AuthContext): Promise<AdminCustomerList>;
6612
- /** Search customers (`POST /customers/search`). */
6618
+ /** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
6613
6619
  searchCustomers(query: AdminCustomerSearchQuery, auth?: AuthContext): Promise<AdminCustomerList>;
6614
6620
  /** Retrieve a customer profile by number. */
6615
6621
  getCustomer(customerNumber: string, auth?: AuthContext): Promise<AdminCustomer>;
@@ -7255,4 +7261,4 @@ declare function createEmporixClient<S extends Record<string, ServiceClass<unkno
7255
7261
  */
7256
7262
  declare function productIdFromYrn(yrn: string | undefined): string;
7257
7263
 
7258
- 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, CloudFunctionsService, 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, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, 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 InvokeCloudFunctionOptions, 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, type ServiceClass, 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, createCore, createEmporixClient, errorFromResponse, productIdFromYrn };
7264
+ 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, CloudFunctionsService, 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, type EmporixCore, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, 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 InvokeCloudFunctionOptions, 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, QueryFor, 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, type ServiceClass, 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, createCore, createEmporixClient, errorFromResponse, productIdFromYrn };
package/dist/index.js CHANGED
@@ -2,23 +2,25 @@ import { LocationsService } from './chunk-DUVIIWFG.js';
2
2
  export { LocationsService } from './chunk-DUVIIWFG.js';
3
3
  import { MediaService } from './chunk-OTG2S2L4.js';
4
4
  export { MediaService } from './chunk-OTG2S2L4.js';
5
- import { OrdersService, SalesOrdersService } from './chunk-62PCCHZ2.js';
6
- export { OrdersService, SalesOrdersService } from './chunk-62PCCHZ2.js';
7
- import { PaymentGatewayService } from './chunk-XEJPH6UN.js';
8
- export { PaymentGatewayService } from './chunk-XEJPH6UN.js';
5
+ import { OrdersService, SalesOrdersService } from './chunk-36T4YPQJ.js';
6
+ export { OrdersService, SalesOrdersService } from './chunk-36T4YPQJ.js';
7
+ import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-PYLWZZC4.js';
8
+ export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-PYLWZZC4.js';
9
9
  import { PriceService } from './chunk-A3LYJUD4.js';
10
10
  export { PriceService } from './chunk-A3LYJUD4.js';
11
- import { ProductService } from './chunk-5VTBLBXJ.js';
12
- export { ProductService } from './chunk-5VTBLBXJ.js';
11
+ import { ProductService } from './chunk-FZMP5NQZ.js';
12
+ export { ProductService } from './chunk-FZMP5NQZ.js';
13
13
  import { SegmentService } from './chunk-NE7MIZPR.js';
14
14
  export { SegmentService } from './chunk-NE7MIZPR.js';
15
15
  import { AvailabilityService } from './chunk-K3VQLW3P.js';
16
16
  export { AvailabilityService } from './chunk-K3VQLW3P.js';
17
17
  import { CartService } from './chunk-PAT4CS36.js';
18
18
  export { CartService } from './chunk-PAT4CS36.js';
19
- import { CategoryService } from './chunk-GIZS4BY3.js';
20
- export { CategoryService } from './chunk-GIZS4BY3.js';
19
+ import { CategoryService } from './chunk-6XND7SYV.js';
20
+ export { CategoryService } from './chunk-6XND7SYV.js';
21
21
  export { iterateAll } from './chunk-GWJ2U2CP.js';
22
+ import { resolveQuery } from './chunk-S5HEIQDK.js';
23
+ export { resolveQuery } from './chunk-S5HEIQDK.js';
22
24
  import { CheckoutService } from './chunk-RYQVMR26.js';
23
25
  export { CheckoutService } from './chunk-RYQVMR26.js';
24
26
  import { CompaniesService } from './chunk-BNX3JULF.js';
@@ -30,7 +32,7 @@ export { CustomerGroupsService } from './chunk-3BTPX7IJ.js';
30
32
  import { CustomerService } from './chunk-NEXUWPHW.js';
31
33
  export { CustomerService } from './chunk-NEXUWPHW.js';
32
34
  import './chunk-3BDDYX3V.js';
33
- import { EmporixAuthError, EmporixTimeoutError, EmporixNetworkError, errorFromResponse, EmporixNotFoundError, EmporixError } from './chunk-UWGGF4MC.js';
35
+ import { EmporixTimeoutError, EmporixNetworkError, errorFromResponse, EmporixNotFoundError, EmporixError } from './chunk-UWGGF4MC.js';
34
36
  export { EmporixAuthError, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, EmporixValidationError, errorFromResponse } from './chunk-UWGGF4MC.js';
35
37
 
36
38
  // src/core/config.ts
@@ -294,249 +296,6 @@ function createNoopLogger() {
294
296
  return new NoopLogger();
295
297
  }
296
298
 
297
- // src/core/auth.ts
298
- var auth = {
299
- /** Service/custom credential set (default `backend`). */
300
- service: (credentials) => credentials === void 0 ? { kind: "service" } : { kind: "service", credentials },
301
- /** Cached anonymous storefront token. */
302
- anonymous: () => ({ kind: "anonymous" }),
303
- /** Caller-owned customer bearer token. */
304
- customer: (token) => ({ kind: "customer", token }),
305
- /** Exact token, no transformation (SSO / token-exchange). */
306
- raw: (token) => ({ kind: "raw", token })
307
- };
308
- async function resolveToken(ctx, provider) {
309
- switch (ctx.kind) {
310
- case "service":
311
- return provider.getToken(ctx.credentials ?? "backend");
312
- case "anonymous":
313
- return (await provider.getAnonymousToken()).accessToken;
314
- case "customer":
315
- case "raw":
316
- return ctx.token;
317
- }
318
- }
319
- var CustomerRefreshRegistry = class {
320
- refresher = null;
321
- inflight = null;
322
- set(refresher) {
323
- this.refresher = refresher;
324
- }
325
- get enabled() {
326
- return this.refresher !== null;
327
- }
328
- /** Concurrent callers share one in-flight refresh. */
329
- refresh(expiredToken) {
330
- if (!this.refresher) return Promise.resolve(null);
331
- if (this.inflight) return this.inflight;
332
- const p = Promise.resolve(this.refresher.refresh(expiredToken)).finally(() => {
333
- this.inflight = null;
334
- });
335
- this.inflight = p;
336
- return p;
337
- }
338
- };
339
- var DefaultTokenProvider = class {
340
- constructor(cfg) {
341
- this.cfg = cfg;
342
- }
343
- cfg;
344
- serviceCache = /* @__PURE__ */ new Map();
345
- serviceLocks = /* @__PURE__ */ new Map();
346
- anon;
347
- anonLock;
348
- anonStore;
349
- contextOverride;
350
- refreshListeners = /* @__PURE__ */ new Set();
351
- onRefresh(listener) {
352
- this.refreshListeners.add(listener);
353
- return () => {
354
- this.refreshListeners.delete(listener);
355
- };
356
- }
357
- notifyRefresh(kind, success) {
358
- for (const l of this.refreshListeners) {
359
- try {
360
- l({ kind, success });
361
- } catch {
362
- }
363
- }
364
- }
365
- attachAnonymousStore(store) {
366
- this.anonStore = store;
367
- if (!this.anon) {
368
- const persisted = store.read();
369
- if (persisted) {
370
- this.anon = {
371
- accessToken: "",
372
- refreshToken: persisted.refreshToken,
373
- sessionId: persisted.sessionId,
374
- expiresIn: 0,
375
- expiresAt: 0
376
- };
377
- }
378
- }
379
- }
380
- creds(set) {
381
- if (set === "backend") {
382
- const b = this.cfg.credentials.backend;
383
- if (!b?.clientId || !b.secret) {
384
- throw new EmporixAuthError(
385
- "A 'service' AuthContext was used but credentials.backend is not configured"
386
- );
387
- }
388
- return b;
389
- }
390
- const c = this.cfg.credentials.custom?.[set];
391
- if (!c) throw new Error(`Unknown credential set "${set}"`);
392
- return c;
393
- }
394
- fresh(e) {
395
- if (!e) return false;
396
- const now = Date.now();
397
- if (now - e.obtainedAt >= this.cfg.cache.maxLifetimeSeconds * 1e3) return false;
398
- return now < e.expiresAt;
399
- }
400
- async getToken(set) {
401
- this.creds(set);
402
- const cached = this.serviceCache.get(set);
403
- if (this.fresh(cached)) return cached.token;
404
- const inflight = this.serviceLocks.get(set);
405
- if (inflight) return inflight;
406
- const p = this.requestServiceToken(set).finally(() => this.serviceLocks.delete(set));
407
- this.serviceLocks.set(set, p);
408
- return p;
409
- }
410
- /**
411
- * fetch with the configured read timeout. Token endpoints sit in front of
412
- * single-flight locks — one hung call would otherwise block every request
413
- * on this credential set forever.
414
- */
415
- async boundedFetch(url, init = {}) {
416
- const ms = this.cfg.timeouts?.readMs ?? 6e4;
417
- const controller = new AbortController();
418
- const timer = setTimeout(() => controller.abort(), ms);
419
- try {
420
- return await fetch(url, { ...init, signal: controller.signal });
421
- } catch (err) {
422
- if (err.name === "AbortError") {
423
- throw new EmporixTimeoutError(`token request timed out after ${ms}ms`);
424
- }
425
- throw new EmporixNetworkError(`token request network failure: ${err.message}`);
426
- } finally {
427
- clearTimeout(timer);
428
- }
429
- }
430
- async requestServiceToken(set) {
431
- const c = this.creds(set);
432
- const body = new URLSearchParams({
433
- grant_type: "client_credentials",
434
- client_id: c.clientId,
435
- client_secret: c.secret
436
- });
437
- if (c.scope) body.set("scope", c.scope);
438
- const res = await this.boundedFetch(`${this.cfg.host}/oauth/token`, {
439
- method: "POST",
440
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
441
- body
442
- });
443
- const json = await res.json().catch(() => ({}));
444
- if (!res.ok) {
445
- throw new EmporixAuthError(`Token request failed for "${set}"`, res.status, json);
446
- }
447
- const obtainedAt = Date.now();
448
- const ttl = Number(json.expires_in ?? 3600);
449
- this.serviceCache.set(set, {
450
- token: json.access_token,
451
- obtainedAt,
452
- expiresAt: obtainedAt + (ttl - this.cfg.cache.expirationBufferSeconds) * 1e3
453
- });
454
- return this.serviceCache.get(set).token;
455
- }
456
- invalidate(set) {
457
- this.serviceCache.delete(set);
458
- }
459
- anonFresh() {
460
- return !!this.anon && Date.now() < this.anon.expiresAt;
461
- }
462
- async getAnonymousToken() {
463
- if (this.anonFresh()) return this.stripExpiry(this.anon);
464
- if (this.anonLock) return this.anonLock;
465
- const canRefresh = !!this.anon?.refreshToken;
466
- const obtain = canRefresh ? this.fetchAnonymous("refresh").catch(() => this.fetchAnonymous("login")) : this.fetchAnonymous("login");
467
- const p = obtain.finally(() => {
468
- this.anonLock = void 0;
469
- });
470
- this.anonLock = p;
471
- return p;
472
- }
473
- /** Refreshes the anonymous session, preserving its sessionId. */
474
- async refreshAnonymous() {
475
- if (!this.anon) return this.getAnonymousToken();
476
- return this.fetchAnonymous("refresh");
477
- }
478
- invalidateAnonymous() {
479
- this.anon = void 0;
480
- this.anonStore?.write(null);
481
- }
482
- setAnonymousContext(ctx) {
483
- const base = this.contextOverride ?? this.cfg.credentials.storefront?.context ?? {};
484
- this.contextOverride = { ...base, ...ctx };
485
- this.invalidateAnonymous();
486
- }
487
- /** Force a stale access token while keeping the refresh token + sessionId. */
488
- expireAnonymous() {
489
- if (this.anon) this.anon = { ...this.anon, expiresAt: 0 };
490
- }
491
- stripExpiry(s) {
492
- const { expiresAt: _expiresAt, ...rest } = s;
493
- return rest;
494
- }
495
- async fetchAnonymous(mode) {
496
- const sf = this.cfg.credentials.storefront;
497
- if (!sf?.clientId) {
498
- throw new Error("credentials.storefront.clientId is required for anonymous tokens");
499
- }
500
- const url = new URL(`${this.cfg.host}/customerlogin/auth/anonymous/${mode}`);
501
- url.searchParams.set("tenant", this.cfg.tenant);
502
- url.searchParams.set("client_id", sf.clientId);
503
- const c = this.contextOverride ?? sf.context;
504
- if (c?.currency) url.searchParams.set("currency", c.currency);
505
- if (c?.siteCode) url.searchParams.set("siteCode", c.siteCode);
506
- if (c?.targetLocation) url.searchParams.set("targetLocation", c.targetLocation);
507
- if (mode === "refresh" && this.anon) {
508
- url.searchParams.set("refresh_token", this.anon.refreshToken);
509
- }
510
- try {
511
- const res = await this.boundedFetch(url, { method: "GET" });
512
- const json = await res.json().catch(() => ({}));
513
- if (!res.ok) {
514
- this.notifyRefresh("anonymous", false);
515
- throw new EmporixAuthError(`Anonymous token ${mode} failed`, res.status, json);
516
- }
517
- const obtainedAt = Date.now();
518
- this.anon = {
519
- accessToken: json.access_token,
520
- refreshToken: json.refresh_token,
521
- sessionId: json.sessionId,
522
- expiresIn: json.expires_in,
523
- expiresAt: obtainedAt + (json.expires_in - this.cfg.cache.expirationBufferSeconds) * 1e3
524
- };
525
- this.anonStore?.write({
526
- refreshToken: this.anon.refreshToken,
527
- sessionId: this.anon.sessionId
528
- });
529
- this.notifyRefresh("anonymous", true);
530
- return this.stripExpiry(this.anon);
531
- } catch (err) {
532
- if (!(err instanceof EmporixAuthError)) {
533
- this.notifyRefresh("anonymous", false);
534
- }
535
- throw err;
536
- }
537
- }
538
- };
539
-
540
299
  // src/core/http.ts
541
300
  var requestSeq = 0;
542
301
  function safeJson(text) {
@@ -729,7 +488,7 @@ var HttpClient = class {
729
488
  };
730
489
 
731
490
  // package.json
732
- var version = "2.15.0";
491
+ var version = "2.18.0";
733
492
 
734
493
  // src/version.ts
735
494
  var SDK_VERSION = version;
@@ -3289,13 +3048,14 @@ var VendorService = class {
3289
3048
  auth: auth2
3290
3049
  });
3291
3050
  }
3292
- /** Search vendors (`POST /vendors/search`). */
3051
+ /** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
3293
3052
  async searchVendors(query, auth2 = SERVICE22) {
3053
+ const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
3294
3054
  return this.ctx.http.request({
3295
3055
  method: "POST",
3296
3056
  path: `${this.base()}/vendors/search`,
3297
3057
  auth: auth2,
3298
- body: query
3058
+ body
3299
3059
  });
3300
3060
  }
3301
3061
  /** Create a vendor. */
@@ -3479,9 +3239,10 @@ var CustomerAdminService = class {
3479
3239
  ...Object.keys(query).length ? { query } : {}
3480
3240
  });
3481
3241
  }
3482
- /** Search customers (`POST /customers/search`). */
3242
+ /** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
3483
3243
  async searchCustomers(query, auth2 = SERVICE24) {
3484
- return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body: query });
3244
+ const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
3245
+ return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
3485
3246
  }
3486
3247
  /** Retrieve a customer profile by number. */
3487
3248
  async getCustomer(customerNumber, auth2 = SERVICE24) {
@@ -3813,6 +3574,6 @@ function productIdFromYrn(yrn) {
3813
3574
  return semi >= 0 ? yrn.slice(semi + 1) : "";
3814
3575
  }
3815
3576
 
3816
- export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, 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, createCore, createEmporixClient, createNoopLogger, productIdFromYrn, redact, resolveToken, validateConfig };
3577
+ export { AiService, ApprovalService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, IndexingService, LEVEL, LabelService, LevelResolver, PickPackService, RagIndexerService, ReturnsService, RewardPointsService, SchemaService, SepaExportService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, createConsoleLogger, createCore, createEmporixClient, createNoopLogger, productIdFromYrn, redact, validateConfig };
3817
3578
  //# sourceMappingURL=index.js.map
3818
3579
  //# sourceMappingURL=index.js.map