@eldrajs/sdk 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,7 @@ platform repository.
9
9
 
10
10
  ## Unreleased
11
11
 
12
+ - **A store's default currency (WS-1399; contract 6.22.0).** `EldraOrganizationCommerce` carries `defaultCurrency`, what pages are built in and a visitor starts in. A store may turn its own currency off: `currency` stays ISK, and `currencies` then leaves it out.
12
13
  - **Selling in more than one currency (WS-1391; contracts 6.19.0, 6.20.0, 6.21.0).** `createCurrencyPreference()` keeps the currency a visitor picked (`read`, `remember`, `forget`; `localStorage` `eldra.currency`); `cart.setCurrency(cartId, currency)` changes a cart's currency (`PUT /shopping-cart/v1/cart/{cartID}/currency`); `catalog.getProduct` takes `currency`; `EldraOrganizationCommerce` carries `currencies` (what the storefront may offer, the store currency first); `paymentProviders` on the organisation is typed as `EldraOrganizationPaymentProvider[]`, each with the `currencies` it takes (missing means ISK only).
13
14
  - **A 3840 px image variant, `uhd`.** A full-width image on a high-density screen wants about 3840 px, and
14
15
  `full` stops at 2560. `imageSrcset` now lists `…/uhd 3840w` after `full`, `imageVariantFor` falls back to
package/README.md CHANGED
@@ -171,7 +171,9 @@ storefront should treat all three as "no Check out to show" rather than somethin
171
171
  shopper.
172
172
 
173
173
  `features.getCommerce()` answers what the store sells in — `{ currency, taxInclusivePricing,
174
- defaultTaxRate }` — or `null` when the organisation publishes no commerce settings, which is the
174
+ defaultTaxRate, currencies?, defaultCurrency? }`, where `currency` is the store's own and
175
+ `defaultCurrency` (contract 6.22.0) what pages are built in, which differs once the store turns its
176
+ own off — or `null` when the organisation publishes no commerce settings, which is the
175
177
  honest answer for a store that has not configured any: a storefront can then render a price as a
176
178
  number rather than under a currency symbol nobody chose. It reads the same organisation document the
177
179
  rest of the group reads, so a caller already holding an `EldraOrganizationDetails` should take
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as EldraFormSubmitResult, $t as EldraShopUser, A as EldraCollection, At as EldraProductVariant, B as EldraCustomerMembership, Bt as EldraSalesOrderLine, C as EldraCmsEntryListFilterCriterion, Cn as EldraCurrencyPreference, Ct as EldraProductExtensions, D as EldraCmsResolveEntryListOptions, Dn as createCartSession, Dt as EldraProductOption, E as EldraCmsListOptions, En as EldraOrderAccessTokens, Et as EldraProductMediaLink, F as EldraCreateSalesOrderOptions, Ft as EldraRetryOptions, G as EldraFeatureClient, Gt as EldraSalesOrderPreviewInput, H as EldraErrorId, Ht as EldraSalesOrderListItem, I as EldraCustomerClient, It as EldraSalesOrder, J as EldraFormField, Jt as EldraSalesOrderWarning, K as EldraFormActionKind, Kt as EldraSalesOrderPreviewLine, L as EldraCustomerLocation, Lt as EldraSalesOrderCredit, M as EldraCollectionListOptions, Mt as EldraRecoveredBasketItem, N as EldraCollectionProductsOptions, Nt as EldraRequestContext, O as EldraCmsResolveEntryListResponse, On as createCurrencyPreference, Ot as EldraProductOptionValue, P as EldraCreateSalesOrderInput, Pt as EldraRequestOptions, Q as EldraFormSubmitInput, Qt as EldraShopErrorId, R as EldraCustomerLocationList, Rt as EldraSalesOrderDelivery, S as EldraCmsEntryListEntry, Sn as EldraCartSessionOptions, St as EldraProductDetails, T as EldraCmsGetOptions, Tn as EldraOrderAccessTokenOptions, Tt as EldraProductListItem, U as EldraFeature, Ut as EldraSalesOrderListOptions, V as EldraDiscountResult, Vt as EldraSalesOrderList, W as EldraFeatureCapabilities, Wt as EldraSalesOrderPreview, X as EldraFormFieldType, Xt as EldraSearchOptions, Y as EldraFormFieldOption, Yt as EldraSalesOrdersClient, Z as EldraFormLocalized, Zt as EldraSearchResponse, _ as EldraClient, _n as clearCampaignAttribution, _t as EldraPaginated, a as EldraCartClient, an as EldraContract, at as EldraLocaleOptions, b as EldraCmsEntryList, bn as withdrawCampaignAttributionConsent, bt as EldraPlatformReadOptions, c as EldraCartGiftCardEntry, cn as EldraContractMethod, ct as EldraOrderLine, d as EldraCatalogClient, dn as EldraContractProp, dt as EldraOrganizationCommerce, en as EldraStockAvailability, et as EldraFormTokenResult, f as EldraCatalogGetProductOptions, fn as EldraContractQuery, ft as EldraOrganizationDetails, g as EldraCheckoutUrlOptions, gn as captureCampaignAttribution, gt as EldraPageMeta, h as EldraCheckoutClient, hn as EldraCampaignAttributionOptions, ht as EldraOrganizationOptions, i as EldraCartAppliedCode, in as RuntimeValue, it as EldraInventoryClient, j as EldraCollectionList, jt as EldraRecoveredBasket, k as EldraCmsResolvedEntryList, kn as createOrderAccessTokens, kt as EldraProductThumbnail, l as EldraCartItem, ln as EldraContractPath, lt as EldraOrderReadOptions, m as EldraCategory, mn as EldraCampaignAttribution, mt as EldraOrganizationLocales, n as EldraBrand, nn as EldraStockAvailabilityItem, nt as EldraHttpClient, o as EldraCartDiscountCodeEntry, on as EldraContractBody, ot as EldraOrder, p as EldraCatalogListProductsOptions, pn as EldraContractResponse, pt as EldraOrganizationFeature, q as EldraFormDefinition, qt as EldraSalesOrderStatus, r as EldraCart, rn as RuntimeEnv, rt as EldraHttpRequest, s as EldraCartGiftCard, sn as EldraContractItem, st as EldraOrderDiscountCode, t as EldraAddCartItemInput, tn as EldraStockAvailabilityInput, tt as EldraFormsClient, u as EldraCartTotals, un as EldraContractPaths, ut as EldraOrdersClient, v as EldraClientOptions, vn as grantCampaignAttributionConsent, vt as EldraPlatformClient, w as EldraCmsGetEntryByUniqueFieldOptions, wn as EldraKeyValueStorage, wt as EldraProductList, x as EldraCmsEntryListDisplayMode, xn as EldraCartSession, xt as EldraProblemErrors, y as EldraCmsClient, yn as readCampaignAttribution, yt as EldraPlatformConfig, z as EldraCustomerMe, zt as EldraSalesOrderErrorId } from "./types-COJLLz9z.js";
1
+ import { $ as EldraFormSubmitResult, $t as EldraShopUser, A as EldraCollection, At as EldraProductVariant, B as EldraCustomerMembership, Bt as EldraSalesOrderLine, C as EldraCmsEntryListFilterCriterion, Cn as EldraCurrencyPreference, Ct as EldraProductExtensions, D as EldraCmsResolveEntryListOptions, Dn as createCartSession, Dt as EldraProductOption, E as EldraCmsListOptions, En as EldraOrderAccessTokens, Et as EldraProductMediaLink, F as EldraCreateSalesOrderOptions, Ft as EldraRetryOptions, G as EldraFeatureClient, Gt as EldraSalesOrderPreviewInput, H as EldraErrorId, Ht as EldraSalesOrderListItem, I as EldraCustomerClient, It as EldraSalesOrder, J as EldraFormField, Jt as EldraSalesOrderWarning, K as EldraFormActionKind, Kt as EldraSalesOrderPreviewLine, L as EldraCustomerLocation, Lt as EldraSalesOrderCredit, M as EldraCollectionListOptions, Mt as EldraRecoveredBasketItem, N as EldraCollectionProductsOptions, Nt as EldraRequestContext, O as EldraCmsResolveEntryListResponse, On as createCurrencyPreference, Ot as EldraProductOptionValue, P as EldraCreateSalesOrderInput, Pt as EldraRequestOptions, Q as EldraFormSubmitInput, Qt as EldraShopErrorId, R as EldraCustomerLocationList, Rt as EldraSalesOrderDelivery, S as EldraCmsEntryListEntry, Sn as EldraCartSessionOptions, St as EldraProductDetails, T as EldraCmsGetOptions, Tn as EldraOrderAccessTokenOptions, Tt as EldraProductListItem, U as EldraFeature, Ut as EldraSalesOrderListOptions, V as EldraDiscountResult, Vt as EldraSalesOrderList, W as EldraFeatureCapabilities, Wt as EldraSalesOrderPreview, X as EldraFormFieldType, Xt as EldraSearchOptions, Y as EldraFormFieldOption, Yt as EldraSalesOrdersClient, Z as EldraFormLocalized, Zt as EldraSearchResponse, _ as EldraClient, _n as clearCampaignAttribution, _t as EldraPaginated, a as EldraCartClient, an as EldraContract, at as EldraLocaleOptions, b as EldraCmsEntryList, bn as withdrawCampaignAttributionConsent, bt as EldraPlatformReadOptions, c as EldraCartGiftCardEntry, cn as EldraContractMethod, ct as EldraOrderLine, d as EldraCatalogClient, dn as EldraContractProp, dt as EldraOrganizationCommerce, en as EldraStockAvailability, et as EldraFormTokenResult, f as EldraCatalogGetProductOptions, fn as EldraContractQuery, ft as EldraOrganizationDetails, g as EldraCheckoutUrlOptions, gn as captureCampaignAttribution, gt as EldraPageMeta, h as EldraCheckoutClient, hn as EldraCampaignAttributionOptions, ht as EldraOrganizationOptions, i as EldraCartAppliedCode, in as RuntimeValue, it as EldraInventoryClient, j as EldraCollectionList, jt as EldraRecoveredBasket, k as EldraCmsResolvedEntryList, kn as createOrderAccessTokens, kt as EldraProductThumbnail, l as EldraCartItem, ln as EldraContractPath, lt as EldraOrderReadOptions, m as EldraCategory, mn as EldraCampaignAttribution, mt as EldraOrganizationLocales, n as EldraBrand, nn as EldraStockAvailabilityItem, nt as EldraHttpClient, o as EldraCartDiscountCodeEntry, on as EldraContractBody, ot as EldraOrder, p as EldraCatalogListProductsOptions, pn as EldraContractResponse, pt as EldraOrganizationFeature, q as EldraFormDefinition, qt as EldraSalesOrderStatus, r as EldraCart, rn as RuntimeEnv, rt as EldraHttpRequest, s as EldraCartGiftCard, sn as EldraContractItem, st as EldraOrderDiscountCode, t as EldraAddCartItemInput, tn as EldraStockAvailabilityInput, tt as EldraFormsClient, u as EldraCartTotals, un as EldraContractPaths, ut as EldraOrdersClient, v as EldraClientOptions, vn as grantCampaignAttributionConsent, vt as EldraPlatformClient, w as EldraCmsGetEntryByUniqueFieldOptions, wn as EldraKeyValueStorage, wt as EldraProductList, x as EldraCmsEntryListDisplayMode, xn as EldraCartSession, xt as EldraProblemErrors, y as EldraCmsClient, yn as readCampaignAttribution, yt as EldraPlatformConfig, z as EldraCustomerMe, zt as EldraSalesOrderErrorId } from "./types-BrMiT2QA.js";
2
2
  export declare const DEFAULT_ELDRA_API_BASE_URL = "https://web.eldra.app/api";
3
3
  export declare class EldraHttpError extends Error {
4
4
  readonly status: number;
@@ -252,14 +252,16 @@ interface EldraOrganizationFeature {
252
252
  * generated `contract.ts` augmentation.
253
253
  */
254
254
  interface EldraOrganizationCommerce {
255
- /** ISO 4217 code every catalog price is quoted in, e.g. `ISK`. */
255
+ /** The shop's own currency, ISO 4217, e.g. `ISK`: offered or not, every product has a price in it. */
256
256
  currency: string;
257
257
  /** Prices already contain VAT; a storefront shows them as they are. */
258
258
  taxInclusivePricing: boolean;
259
259
  /** Fraction, e.g. `0.24` — applies to shipping and to products without their own rate. */
260
260
  defaultTaxRate: number;
261
- /** Contract 6.21.0: the currencies the storefront may offer, `currency` first. */
261
+ /** Contract 6.21.0: the currencies the storefront may offer; `currency` first while it is offered. */
262
262
  currencies?: string[];
263
+ /** Contract 6.22.0: what pages are built in and a visitor starts in, the first of `currencies`. */
264
+ defaultCurrency?: string;
263
265
  }
264
266
  /** One of the organisation's payment providers (contract 6.20.0). */
265
267
  interface EldraOrganizationPaymentProvider {
package/dist/vite.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { in as RuntimeValue, rn as RuntimeEnv } from "./types-COJLLz9z.js";
1
+ import { in as RuntimeValue, rn as RuntimeEnv } from "./types-BrMiT2QA.js";
2
2
  import { Plugin } from "vite";
3
3
  export interface EldraVitePluginOptions {
4
4
  apiBaseUrl?: RuntimeValue<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eldrajs/sdk",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Framework-free client for the Eldra Web Studio public storefront API: CMS, catalog, cart, checkout handoff, orders, inventory. Types generated from your gateway's OpenAPI document and CMS schemas at build time.",
5
5
  "keywords": [
6
6
  "cms",