@betterstore/sdk 0.3.33 → 0.3.35

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
@@ -1,5 +1,17 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.35
4
+
5
+ ### Patch Changes
6
+
7
+ - bug type fix
8
+
9
+ ## 0.3.34
10
+
11
+ ### Patch Changes
12
+
13
+ - small tweak
14
+
3
15
  ## 0.3.33
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -222,7 +222,7 @@ declare class Customer {
222
222
  declare class Helpers {
223
223
  proxy?: string;
224
224
  constructor(proxy?: string);
225
- formatPrice(priceInCents: number, currency: string, exchangeRate?: number): string;
225
+ formatPrice(priceInCents: number, currency: string, exchangeRate?: number | null): string;
226
226
  getExchangeRate(baseCurrency: string, targetCurrency: string): Promise<number>;
227
227
  }
228
228
 
@@ -230,7 +230,7 @@ declare class Products {
230
230
  private apiClient;
231
231
  constructor(apiKey: string, proxy?: string);
232
232
  list(): Promise<ProductWithoutVariants[]>;
233
- retrieve(productId: string): Promise<Product>;
233
+ retrieve(productId: string): Promise<Product | null>;
234
234
  }
235
235
 
236
236
  declare function createBetterStore(config: {
package/dist/index.d.ts CHANGED
@@ -222,7 +222,7 @@ declare class Customer {
222
222
  declare class Helpers {
223
223
  proxy?: string;
224
224
  constructor(proxy?: string);
225
- formatPrice(priceInCents: number, currency: string, exchangeRate?: number): string;
225
+ formatPrice(priceInCents: number, currency: string, exchangeRate?: number | null): string;
226
226
  getExchangeRate(baseCurrency: string, targetCurrency: string): Promise<number>;
227
227
  }
228
228
 
@@ -230,7 +230,7 @@ declare class Products {
230
230
  private apiClient;
231
231
  constructor(apiKey: string, proxy?: string);
232
232
  list(): Promise<ProductWithoutVariants[]>;
233
- retrieve(productId: string): Promise<Product>;
233
+ retrieve(productId: string): Promise<Product | null>;
234
234
  }
235
235
 
236
236
  declare function createBetterStore(config: {
package/dist/index.js CHANGED
@@ -422,7 +422,8 @@ var Products = class {
422
422
  return __async(this, null, function* () {
423
423
  const data = yield this.apiClient.get(`/products/${productId}`);
424
424
  if (!data) {
425
- throw new Error("Product not found");
425
+ console.error(`Product with id ${productId} not found`);
426
+ return null;
426
427
  }
427
428
  return data;
428
429
  });
package/dist/index.mjs CHANGED
@@ -384,7 +384,8 @@ var Products = class {
384
384
  return __async(this, null, function* () {
385
385
  const data = yield this.apiClient.get(`/products/${productId}`);
386
386
  if (!data) {
387
- throw new Error("Product not found");
387
+ console.error(`Product with id ${productId} not found`);
388
+ return null;
388
389
  }
389
390
  return data;
390
391
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/sdk",
3
- "version": "0.3.33",
3
+ "version": "0.3.35",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {