@viu/emporix-sdk 2.12.0 → 2.13.1

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/dist/index.js CHANGED
@@ -2,8 +2,8 @@ import { LocationsService } from './chunk-LGLFJL3S.js';
2
2
  export { LocationsService } from './chunk-LGLFJL3S.js';
3
3
  import { MediaService } from './chunk-WSXRUYBE.js';
4
4
  export { MediaService } from './chunk-WSXRUYBE.js';
5
- import { OrdersService, SalesOrdersService } from './chunk-KVBCTXVH.js';
6
- export { OrdersService, SalesOrdersService } from './chunk-KVBCTXVH.js';
5
+ import { OrdersService, SalesOrdersService } from './chunk-WW3H7VJ5.js';
6
+ export { OrdersService, SalesOrdersService } from './chunk-WW3H7VJ5.js';
7
7
  import { PaymentGatewayService } from './chunk-HKPZI7Y5.js';
8
8
  export { PaymentGatewayService } from './chunk-HKPZI7Y5.js';
9
9
  import { PriceService } from './chunk-BK25FDTH.js';
@@ -2022,19 +2022,31 @@ var RewardPointsService = class {
2022
2022
  // --- Storefront: the signed-in customer's own points (customer token required) ---
2023
2023
  /** The signed-in customer's reward-points balance. Requires a customer `auth`. */
2024
2024
  async getMyPoints(auth2) {
2025
- return this.ctx.http.request({
2026
- method: "GET",
2027
- path: `${this.base()}/public/customer`,
2028
- auth: auth2
2029
- });
2025
+ try {
2026
+ return await this.ctx.http.request({
2027
+ method: "GET",
2028
+ path: `${this.base()}/public/customer`,
2029
+ auth: auth2
2030
+ });
2031
+ } catch (err) {
2032
+ if (err instanceof EmporixNotFoundError) return 0;
2033
+ throw err;
2034
+ }
2030
2035
  }
2031
2036
  /** The signed-in customer's reward-points summary. Requires a customer `auth`. */
2032
2037
  async getMySummary(auth2) {
2033
- return this.ctx.http.request({
2034
- method: "GET",
2035
- path: `${this.base()}/public/customer/summary`,
2036
- auth: auth2
2037
- });
2038
+ try {
2039
+ return await this.ctx.http.request({
2040
+ method: "GET",
2041
+ path: `${this.base()}/public/customer/summary`,
2042
+ auth: auth2
2043
+ });
2044
+ } catch (err) {
2045
+ if (err instanceof EmporixNotFoundError) {
2046
+ return { activePoints: 0, summary: { addedPointsList: [] } };
2047
+ }
2048
+ throw err;
2049
+ }
2038
2050
  }
2039
2051
  /**
2040
2052
  * Redeem the signed-in customer's points for a coupon code. Requires a
@@ -3468,7 +3480,7 @@ var ApprovalService = class {
3468
3480
  };
3469
3481
 
3470
3482
  // package.json
3471
- var version = "2.12.0";
3483
+ var version = "2.13.1";
3472
3484
 
3473
3485
  // src/version.ts
3474
3486
  var SDK_VERSION = version;