@viu/emporix-sdk 2.12.0 → 2.14.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 (102) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/dist/availability.cjs +3 -1
  4. package/dist/availability.cjs.map +1 -1
  5. package/dist/availability.d.cts +1 -1
  6. package/dist/availability.d.ts +1 -1
  7. package/dist/availability.js +2 -2
  8. package/dist/cart.cjs.map +1 -1
  9. package/dist/cart.d.cts +1 -1
  10. package/dist/cart.d.ts +1 -1
  11. package/dist/cart.js +2 -2
  12. package/dist/category.cjs +3 -1
  13. package/dist/category.cjs.map +1 -1
  14. package/dist/category.d.cts +1 -1
  15. package/dist/category.d.ts +1 -1
  16. package/dist/category.js +1 -1
  17. package/dist/checkout.cjs.map +1 -1
  18. package/dist/checkout.d.cts +1 -1
  19. package/dist/checkout.d.ts +1 -1
  20. package/dist/checkout.js +2 -2
  21. package/dist/{chunk-BFQ732VZ.js → chunk-3BDDYX3V.js} +3 -3
  22. package/dist/{chunk-BFQ732VZ.js.map → chunk-3BDDYX3V.js.map} +1 -1
  23. package/dist/{chunk-BK25FDTH.js → chunk-BDFOD7W3.js} +9 -5
  24. package/dist/chunk-BDFOD7W3.js.map +1 -0
  25. package/dist/{chunk-XMEP74BU.js → chunk-BPVMQFO4.js} +6 -4
  26. package/dist/chunk-BPVMQFO4.js.map +1 -0
  27. package/dist/{chunk-Z6PNI5VT.js → chunk-CR2JRH7T.js} +3 -3
  28. package/dist/{chunk-Z6PNI5VT.js.map → chunk-CR2JRH7T.js.map} +1 -1
  29. package/dist/{chunk-HKPZI7Y5.js → chunk-EINAVCV2.js} +3 -3
  30. package/dist/{chunk-HKPZI7Y5.js.map → chunk-EINAVCV2.js.map} +1 -1
  31. package/dist/{chunk-WSXRUYBE.js → chunk-FU5WQALW.js} +3 -3
  32. package/dist/{chunk-WSXRUYBE.js.map → chunk-FU5WQALW.js.map} +1 -1
  33. package/dist/{chunk-B4UOYJKW.js → chunk-MIUVJEGR.js} +8 -4
  34. package/dist/chunk-MIUVJEGR.js.map +1 -0
  35. package/dist/{chunk-I3YYGSN2.js → chunk-P3UHYMDH.js} +3 -3
  36. package/dist/{chunk-I3YYGSN2.js.map → chunk-P3UHYMDH.js.map} +1 -1
  37. package/dist/{chunk-TLH6SLAF.js → chunk-UOBOFCFU.js} +27 -34
  38. package/dist/chunk-UOBOFCFU.js.map +1 -0
  39. package/dist/{chunk-KTODT6DV.js → chunk-UWGGF4MC.js} +7 -3
  40. package/dist/chunk-UWGGF4MC.js.map +1 -0
  41. package/dist/{chunk-KVBCTXVH.js → chunk-WW3H7VJ5.js} +10 -6
  42. package/dist/chunk-WW3H7VJ5.js.map +1 -0
  43. package/dist/{chunk-AUVJ5V47.js → chunk-WWCCB22A.js} +5 -3
  44. package/dist/chunk-WWCCB22A.js.map +1 -0
  45. package/dist/{chunk-OMYVOOSX.js → chunk-XG2TKFY5.js} +3 -3
  46. package/dist/{chunk-OMYVOOSX.js.map → chunk-XG2TKFY5.js.map} +1 -1
  47. package/dist/companies.d.cts +1 -1
  48. package/dist/companies.d.ts +1 -1
  49. package/dist/contacts.d.cts +1 -1
  50. package/dist/contacts.d.ts +1 -1
  51. package/dist/{context-CD7F_LHT.d.cts → context-DhoFgoKf.d.cts} +13 -0
  52. package/dist/{context-CD7F_LHT.d.ts → context-DhoFgoKf.d.ts} +13 -0
  53. package/dist/customer-groups.d.cts +1 -1
  54. package/dist/customer-groups.d.ts +1 -1
  55. package/dist/customer.cjs +23 -31
  56. package/dist/customer.cjs.map +1 -1
  57. package/dist/customer.d.cts +1 -1
  58. package/dist/customer.d.ts +1 -1
  59. package/dist/customer.js +3 -3
  60. package/dist/index.cjs +144 -64
  61. package/dist/index.cjs.map +1 -1
  62. package/dist/index.d.cts +9 -3
  63. package/dist/index.d.ts +9 -3
  64. package/dist/index.js +114 -48
  65. package/dist/index.js.map +1 -1
  66. package/dist/locations.d.cts +1 -1
  67. package/dist/locations.d.ts +1 -1
  68. package/dist/media.cjs.map +1 -1
  69. package/dist/media.d.cts +1 -1
  70. package/dist/media.d.ts +1 -1
  71. package/dist/media.js +2 -2
  72. package/dist/orders.cjs +8 -4
  73. package/dist/orders.cjs.map +1 -1
  74. package/dist/orders.d.cts +1 -1
  75. package/dist/orders.d.ts +1 -1
  76. package/dist/orders.js +1 -1
  77. package/dist/payment.cjs.map +1 -1
  78. package/dist/payment.d.cts +1 -1
  79. package/dist/payment.d.ts +1 -1
  80. package/dist/payment.js +3 -3
  81. package/dist/price.cjs +6 -2
  82. package/dist/price.cjs.map +1 -1
  83. package/dist/price.d.cts +1 -1
  84. package/dist/price.d.ts +1 -1
  85. package/dist/price.js +2 -2
  86. package/dist/product.cjs +6 -2
  87. package/dist/product.cjs.map +1 -1
  88. package/dist/product.d.cts +1 -1
  89. package/dist/product.d.ts +1 -1
  90. package/dist/product.js +1 -1
  91. package/dist/segment.cjs.map +1 -1
  92. package/dist/segment.d.cts +1 -1
  93. package/dist/segment.d.ts +1 -1
  94. package/dist/segment.js +3 -3
  95. package/package.json +1 -1
  96. package/dist/chunk-AUVJ5V47.js.map +0 -1
  97. package/dist/chunk-B4UOYJKW.js.map +0 -1
  98. package/dist/chunk-BK25FDTH.js.map +0 -1
  99. package/dist/chunk-KTODT6DV.js.map +0 -1
  100. package/dist/chunk-KVBCTXVH.js.map +0 -1
  101. package/dist/chunk-TLH6SLAF.js.map +0 -1
  102. package/dist/chunk-XMEP74BU.js.map +0 -1
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-CD7F_LHT.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-CD7F_LHT.cjs';
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-DhoFgoKf.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-DhoFgoKf.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';
@@ -52,6 +52,12 @@ declare class EmporixValidationError extends EmporixError {
52
52
  /** 5xx — server-side failure. */
53
53
  declare class EmporixServerError extends EmporixError {
54
54
  }
55
+ /** Request aborted by the configured connect/read timeout. No HTTP status. */
56
+ declare class EmporixTimeoutError extends EmporixError {
57
+ }
58
+ /** DNS/TLS/connection-level failure before or during the exchange. No HTTP status. */
59
+ declare class EmporixNetworkError extends EmporixError {
60
+ }
55
61
  /**
56
62
  * 403 with a `missing scope: <name>` hint in the body's `details` array.
57
63
  * Subclasses {@link EmporixForbiddenError} so existing 403 catches still work.
@@ -7177,4 +7183,4 @@ declare class EmporixClient {
7177
7183
  */
7178
7184
  declare function productIdFromYrn(yrn: string | undefined): string;
7179
7185
 
7180
- 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, 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 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, 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 };
7186
+ 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, 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, 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-CD7F_LHT.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-CD7F_LHT.js';
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-DhoFgoKf.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-DhoFgoKf.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';
@@ -52,6 +52,12 @@ declare class EmporixValidationError extends EmporixError {
52
52
  /** 5xx — server-side failure. */
53
53
  declare class EmporixServerError extends EmporixError {
54
54
  }
55
+ /** Request aborted by the configured connect/read timeout. No HTTP status. */
56
+ declare class EmporixTimeoutError extends EmporixError {
57
+ }
58
+ /** DNS/TLS/connection-level failure before or during the exchange. No HTTP status. */
59
+ declare class EmporixNetworkError extends EmporixError {
60
+ }
55
61
  /**
56
62
  * 403 with a `missing scope: <name>` hint in the body's `details` array.
57
63
  * Subclasses {@link EmporixForbiddenError} so existing 403 catches still work.
@@ -7177,4 +7183,4 @@ declare class EmporixClient {
7177
7183
  */
7178
7184
  declare function productIdFromYrn(yrn: string | undefined): string;
7179
7185
 
7180
- 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, 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 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, 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 };
7186
+ 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, 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, 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,37 +1,37 @@
1
1
  import { LocationsService } from './chunk-LGLFJL3S.js';
2
2
  export { LocationsService } from './chunk-LGLFJL3S.js';
3
- import { MediaService } from './chunk-WSXRUYBE.js';
4
- export { MediaService } from './chunk-WSXRUYBE.js';
5
- import { OrdersService, SalesOrdersService } from './chunk-KVBCTXVH.js';
6
- export { OrdersService, SalesOrdersService } from './chunk-KVBCTXVH.js';
7
- import { PaymentGatewayService } from './chunk-HKPZI7Y5.js';
8
- export { PaymentGatewayService } from './chunk-HKPZI7Y5.js';
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
- import { SegmentService } from './chunk-Z6PNI5VT.js';
14
- export { SegmentService } from './chunk-Z6PNI5VT.js';
15
- import { AvailabilityService } from './chunk-XMEP74BU.js';
16
- export { AvailabilityService } from './chunk-XMEP74BU.js';
17
- import { CartService } from './chunk-I3YYGSN2.js';
18
- export { CartService } from './chunk-I3YYGSN2.js';
19
- import { CategoryService } from './chunk-AUVJ5V47.js';
20
- export { CategoryService } from './chunk-AUVJ5V47.js';
3
+ import { MediaService } from './chunk-FU5WQALW.js';
4
+ export { MediaService } from './chunk-FU5WQALW.js';
5
+ import { OrdersService, SalesOrdersService } from './chunk-WW3H7VJ5.js';
6
+ export { OrdersService, SalesOrdersService } from './chunk-WW3H7VJ5.js';
7
+ import { PaymentGatewayService } from './chunk-EINAVCV2.js';
8
+ export { PaymentGatewayService } from './chunk-EINAVCV2.js';
9
+ import { PriceService } from './chunk-BDFOD7W3.js';
10
+ export { PriceService } from './chunk-BDFOD7W3.js';
11
+ import { ProductService } from './chunk-MIUVJEGR.js';
12
+ export { ProductService } from './chunk-MIUVJEGR.js';
13
+ import { SegmentService } from './chunk-CR2JRH7T.js';
14
+ export { SegmentService } from './chunk-CR2JRH7T.js';
15
+ import { AvailabilityService } from './chunk-BPVMQFO4.js';
16
+ export { AvailabilityService } from './chunk-BPVMQFO4.js';
17
+ import { CartService } from './chunk-P3UHYMDH.js';
18
+ export { CartService } from './chunk-P3UHYMDH.js';
19
+ import { CategoryService } from './chunk-WWCCB22A.js';
20
+ export { CategoryService } from './chunk-WWCCB22A.js';
21
21
  export { iterateAll } from './chunk-GWJ2U2CP.js';
22
- import { CheckoutService } from './chunk-OMYVOOSX.js';
23
- export { CheckoutService } from './chunk-OMYVOOSX.js';
22
+ import { CheckoutService } from './chunk-XG2TKFY5.js';
23
+ export { CheckoutService } from './chunk-XG2TKFY5.js';
24
24
  import { CompaniesService } from './chunk-MM6JF3Z7.js';
25
25
  export { CompaniesService } from './chunk-MM6JF3Z7.js';
26
26
  import { ContactsService } from './chunk-HAEVK6IS.js';
27
27
  export { ContactsService } from './chunk-HAEVK6IS.js';
28
28
  import { CustomerGroupsService } from './chunk-LGOC5XOI.js';
29
29
  export { CustomerGroupsService } from './chunk-LGOC5XOI.js';
30
- import { CustomerService } from './chunk-TLH6SLAF.js';
31
- export { CustomerService } from './chunk-TLH6SLAF.js';
32
- import './chunk-BFQ732VZ.js';
33
- import { EmporixAuthError, errorFromResponse, EmporixNotFoundError } from './chunk-KTODT6DV.js';
34
- export { EmporixAuthError, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNotFoundError, EmporixServerError, EmporixValidationError, errorFromResponse } from './chunk-KTODT6DV.js';
30
+ import { CustomerService } from './chunk-UOBOFCFU.js';
31
+ export { CustomerService } from './chunk-UOBOFCFU.js';
32
+ import './chunk-3BDDYX3V.js';
33
+ import { EmporixAuthError, EmporixTimeoutError, EmporixNetworkError, errorFromResponse, EmporixNotFoundError } from './chunk-UWGGF4MC.js';
34
+ export { EmporixAuthError, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, EmporixValidationError, errorFromResponse } from './chunk-UWGGF4MC.js';
35
35
 
36
36
  // src/core/config.ts
37
37
  var DEFAULT_HOST = "https://api.emporix.io";
@@ -407,6 +407,26 @@ var DefaultTokenProvider = class {
407
407
  this.serviceLocks.set(set, p);
408
408
  return p;
409
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
+ }
410
430
  async requestServiceToken(set) {
411
431
  const c = this.creds(set);
412
432
  const body = new URLSearchParams({
@@ -415,7 +435,7 @@ var DefaultTokenProvider = class {
415
435
  client_secret: c.secret
416
436
  });
417
437
  if (c.scope) body.set("scope", c.scope);
418
- const res = await fetch(`${this.cfg.host}/oauth/token`, {
438
+ const res = await this.boundedFetch(`${this.cfg.host}/oauth/token`, {
419
439
  method: "POST",
420
440
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
421
441
  body
@@ -488,7 +508,7 @@ var DefaultTokenProvider = class {
488
508
  url.searchParams.set("refresh_token", this.anon.refreshToken);
489
509
  }
490
510
  try {
491
- const res = await fetch(url, { method: "GET" });
511
+ const res = await this.boundedFetch(url, { method: "GET" });
492
512
  const json = await res.json().catch(() => ({}));
493
513
  if (!res.ok) {
494
514
  this.notifyRefresh("anonymous", false);
@@ -564,10 +584,18 @@ var HttpClient = class {
564
584
  attempt
565
585
  });
566
586
  const controller = new AbortController();
567
- const timer = setTimeout(
568
- () => controller.abort(),
569
- o.timeoutMs ?? this.opts.timeouts.readMs
570
- );
587
+ const overallMs = o.timeoutMs ?? this.opts.timeouts.readMs;
588
+ const connectMs = Math.min(this.opts.timeouts.connectMs, overallMs);
589
+ const timeoutMsg = `${o.method} ${o.path} timed out after ${overallMs}ms (connect budget ${connectMs}ms)`;
590
+ let connectTimer;
591
+ let overallTimer;
592
+ const overallBudget = new Promise((_, reject) => {
593
+ overallTimer = setTimeout(() => {
594
+ controller.abort();
595
+ reject(new EmporixTimeoutError(timeoutMsg));
596
+ }, overallMs);
597
+ });
598
+ connectTimer = setTimeout(() => controller.abort(), connectMs);
571
599
  const isFormData = typeof FormData !== "undefined" && o.body instanceof FormData;
572
600
  const init = {
573
601
  method: o.method,
@@ -578,12 +606,27 @@ var HttpClient = class {
578
606
  init.body = isFormData ? o.body : JSON.stringify(o.body);
579
607
  }
580
608
  let res;
609
+ let text;
581
610
  try {
582
- res = await fetch(url, init);
611
+ res = await Promise.race([fetch(url, init), overallBudget]);
612
+ clearTimeout(connectTimer);
613
+ connectTimer = void 0;
614
+ const body = res.text();
615
+ body.catch(() => {
616
+ });
617
+ text = await Promise.race([body, overallBudget]);
618
+ } catch (err) {
619
+ if (err instanceof EmporixTimeoutError) throw err;
620
+ if (err.name === "AbortError") {
621
+ throw new EmporixTimeoutError(timeoutMsg);
622
+ }
623
+ throw new EmporixNetworkError(
624
+ `${o.method} ${o.path} network failure: ${err.message}`
625
+ );
583
626
  } finally {
584
- clearTimeout(timer);
627
+ if (connectTimer !== void 0) clearTimeout(connectTimer);
628
+ if (overallTimer !== void 0) clearTimeout(overallTimer);
585
629
  }
586
- const text = await res.text();
587
630
  const parsed = text ? safeJson(text) : void 0;
588
631
  if (res.ok) {
589
632
  log.debug("http ok", { status: res.status });
@@ -613,10 +656,12 @@ var HttpClient = class {
613
656
  }
614
657
  throw errorFromResponse(res.status, `${o.method} ${o.path} \u2192 401`, parsed);
615
658
  }
616
- const retryable = res.status >= 500 || res.status === 429;
659
+ const idempotent = o.method === "GET" || o.method === "PUT" || o.method === "DELETE" || o.idempotent === true;
660
+ const retryable = idempotent && (res.status >= 500 || res.status === 429);
617
661
  if (retryable && attempt < maxAttempts) {
618
- const retryAfter = Number(res.headers.get("Retry-After"));
619
- const backoff = Number.isFinite(retryAfter) && retryAfter >= 0 ? retryAfter * 1e3 : Math.min(1e3 * 2 ** (attempt - 1), 8e3) + Math.random() * 100;
662
+ const retryAfterHeader = res.headers.get("Retry-After");
663
+ const retryAfter = retryAfterHeader ? Number(retryAfterHeader) : Number.NaN;
664
+ const backoff = Number.isFinite(retryAfter) && retryAfter >= 0 ? Math.min(retryAfter * 1e3, 8e3) : Math.min(1e3 * 2 ** (attempt - 1), 8e3) + Math.random() * 100;
620
665
  log.warn("retryable failure", { status: res.status, attempt, backoffMs: backoff });
621
666
  await this.sleep(backoff);
622
667
  continue;
@@ -668,6 +713,15 @@ var HttpClient = class {
668
713
  }
669
714
  try {
670
715
  return await fetch(url, init);
716
+ } catch (err) {
717
+ if (err.name === "AbortError") {
718
+ throw new EmporixTimeoutError(
719
+ `${o.method} ${o.path} timed out after ${o.timeoutMs ?? this.opts.timeouts.readMs}ms`
720
+ );
721
+ }
722
+ throw new EmporixNetworkError(
723
+ `${o.method} ${o.path} network failure: ${err.message}`
724
+ );
671
725
  } finally {
672
726
  clearTimeout(timer);
673
727
  }
@@ -2022,19 +2076,31 @@ var RewardPointsService = class {
2022
2076
  // --- Storefront: the signed-in customer's own points (customer token required) ---
2023
2077
  /** The signed-in customer's reward-points balance. Requires a customer `auth`. */
2024
2078
  async getMyPoints(auth2) {
2025
- return this.ctx.http.request({
2026
- method: "GET",
2027
- path: `${this.base()}/public/customer`,
2028
- auth: auth2
2029
- });
2079
+ try {
2080
+ return await this.ctx.http.request({
2081
+ method: "GET",
2082
+ path: `${this.base()}/public/customer`,
2083
+ auth: auth2
2084
+ });
2085
+ } catch (err) {
2086
+ if (err instanceof EmporixNotFoundError) return 0;
2087
+ throw err;
2088
+ }
2030
2089
  }
2031
2090
  /** The signed-in customer's reward-points summary. Requires a customer `auth`. */
2032
2091
  async getMySummary(auth2) {
2033
- return this.ctx.http.request({
2034
- method: "GET",
2035
- path: `${this.base()}/public/customer/summary`,
2036
- auth: auth2
2037
- });
2092
+ try {
2093
+ return await this.ctx.http.request({
2094
+ method: "GET",
2095
+ path: `${this.base()}/public/customer/summary`,
2096
+ auth: auth2
2097
+ });
2098
+ } catch (err) {
2099
+ if (err instanceof EmporixNotFoundError) {
2100
+ return { activePoints: 0, summary: { addedPointsList: [] } };
2101
+ }
2102
+ throw err;
2103
+ }
2038
2104
  }
2039
2105
  /**
2040
2106
  * Redeem the signed-in customer's points for a coupon code. Requires a
@@ -3468,7 +3534,7 @@ var ApprovalService = class {
3468
3534
  };
3469
3535
 
3470
3536
  // package.json
3471
- var version = "2.12.0";
3537
+ var version = "2.14.0";
3472
3538
 
3473
3539
  // src/version.ts
3474
3540
  var SDK_VERSION = version;