@qite/tide-booking-component 1.0.34 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
  import { TideClientConfig } from "@qite/tide-client";
2
2
  import { ApiSettingsState } from "../api-settings-slice";
3
3
  export declare function buildTideClientConfig(
4
- settings: ApiSettingsState
4
+ settings?: ApiSettingsState
5
5
  ): TideClientConfig;
@@ -7127,8 +7127,12 @@ build.update = update;
7127
7127
  var validateVoucher_1 = (build.validateVoucher = validateVoucher);
7128
7128
 
7129
7129
  function buildTideClientConfig(settings) {
7130
- var HOST = settings.apiUrl || process.env.REACT_APP_BOOKING_HOST;
7131
- var API_KEY = settings.apiKey || process.env.REACT_APP_BOOKING_API_KEY;
7130
+ var HOST =
7131
+ (settings === null || settings === void 0 ? void 0 : settings.apiUrl) ||
7132
+ process.env.REACT_APP_BOOKING_HOST;
7133
+ var API_KEY =
7134
+ (settings === null || settings === void 0 ? void 0 : settings.apiKey) ||
7135
+ process.env.REACT_APP_BOOKING_API_KEY;
7132
7136
  var token = selectAgentToken();
7133
7137
  if (lodash.isNil(HOST)) {
7134
7138
  throw Error('Environment variable "HOST" was not set.');
@@ -1,5 +1,5 @@
1
1
  import { TideClientConfig } from "@qite/tide-client";
2
2
  import { ApiSettingsState } from "../api-settings-slice";
3
3
  export declare function buildTideClientConfig(
4
- settings: ApiSettingsState
4
+ settings?: ApiSettingsState
5
5
  ): TideClientConfig;
@@ -7136,8 +7136,12 @@ build.update = update;
7136
7136
  var validateVoucher_1 = (build.validateVoucher = validateVoucher);
7137
7137
 
7138
7138
  function buildTideClientConfig(settings) {
7139
- var HOST = settings.apiUrl || process.env.REACT_APP_BOOKING_HOST;
7140
- var API_KEY = settings.apiKey || process.env.REACT_APP_BOOKING_API_KEY;
7139
+ var HOST =
7140
+ (settings === null || settings === void 0 ? void 0 : settings.apiUrl) ||
7141
+ process.env.REACT_APP_BOOKING_HOST;
7142
+ var API_KEY =
7143
+ (settings === null || settings === void 0 ? void 0 : settings.apiKey) ||
7144
+ process.env.REACT_APP_BOOKING_API_KEY;
7141
7145
  var token = selectAgentToken();
7142
7146
  if (isNil(HOST)) {
7143
7147
  throw Error('Environment variable "HOST" was not set.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-booking-component",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "React BookingWizard component for Tide",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "module": "build/build-esm/index.js",
@@ -3,10 +3,10 @@ import { isNil } from "lodash";
3
3
  import { ApiSettingsState } from "../api-settings-slice";
4
4
 
5
5
  export function buildTideClientConfig(
6
- settings: ApiSettingsState
6
+ settings?: ApiSettingsState
7
7
  ): TideClientConfig {
8
- const HOST = settings.apiUrl || process.env.REACT_APP_BOOKING_HOST;
9
- const API_KEY = settings.apiKey || process.env.REACT_APP_BOOKING_API_KEY;
8
+ const HOST = settings?.apiUrl || process.env.REACT_APP_BOOKING_HOST;
9
+ const API_KEY = settings?.apiKey || process.env.REACT_APP_BOOKING_API_KEY;
10
10
  const token = selectAgentToken();
11
11
 
12
12
  if (isNil(HOST)) {