@kontextso/sdk-react-native 0.0.5-rc.0 → 0.0.5-rc.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.d.mts CHANGED
@@ -140,6 +140,7 @@ interface AdsProviderProps {
140
140
  logLevel?: any;
141
141
  conversationId?: string;
142
142
  styles?: AdStyles;
143
+ throwError?: boolean;
143
144
  }
144
145
  declare const VISITOR_ID_KEY = "brain-visitor-id";
145
146
  declare const AdsProviderWithoutBoundary: ({ children, messages, publisherToken, isLoading, adserverUrl, isDisabled, character, conversationId, userId, logLevel, onAdView, onAdClick, ...props }: AdsProviderProps) => react_jsx_runtime.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -140,6 +140,7 @@ interface AdsProviderProps {
140
140
  logLevel?: any;
141
141
  conversationId?: string;
142
142
  styles?: AdStyles;
143
+ throwError?: boolean;
143
144
  }
144
145
  declare const VISITOR_ID_KEY = "brain-visitor-id";
145
146
  declare const AdsProviderWithoutBoundary: ({ children, messages, publisherToken, isLoading, adserverUrl, isDisabled, character, conversationId, userId, logLevel, onAdView, onAdClick, ...props }: AdsProviderProps) => react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -202,7 +202,7 @@ var parseMessageText = (text) => {
202
202
  var import_loglevel = __toESM(require("loglevel"));
203
203
 
204
204
  // package.json
205
- var version = "0.0.4";
205
+ var version = "0.0.5-rc.0";
206
206
 
207
207
  // src/hooks/useInitializeAds.tsx
208
208
  async function initialize(adServerUrl, publisherToken, userId, conversationId, legacyVisitorId, character) {
@@ -885,6 +885,9 @@ var AdsProviderWithoutBoundary = ({
885
885
  publisherToken
886
886
  });
887
887
  const ads = mergeAds({ initAds, preloadAds, streamAds, viewedAds });
888
+ if (props.throwError && Math.random() < 0.5) {
889
+ throw new Error("Test error");
890
+ }
888
891
  const markAdAsViewed = (ad) => {
889
892
  import_loglevel4.default.debug("[Brain] Calling onAdView");
890
893
  onAdView && onAdView({
@@ -974,7 +977,8 @@ var AdsProvider = ({
974
977
  userId,
975
978
  logLevel,
976
979
  onAdView,
977
- onAdClick
980
+ onAdClick,
981
+ throwError: props.throwError
978
982
  }
979
983
  )
980
984
  }
package/dist/index.mjs CHANGED
@@ -175,7 +175,7 @@ var parseMessageText = (text) => {
175
175
  import log from "loglevel";
176
176
 
177
177
  // package.json
178
- var version = "0.0.4";
178
+ var version = "0.0.5-rc.0";
179
179
 
180
180
  // src/hooks/useInitializeAds.tsx
181
181
  async function initialize(adServerUrl, publisherToken, userId, conversationId, legacyVisitorId, character) {
@@ -858,6 +858,9 @@ var AdsProviderWithoutBoundary = ({
858
858
  publisherToken
859
859
  });
860
860
  const ads = mergeAds({ initAds, preloadAds, streamAds, viewedAds });
861
+ if (props.throwError && Math.random() < 0.5) {
862
+ throw new Error("Test error");
863
+ }
861
864
  const markAdAsViewed = (ad) => {
862
865
  log4.debug("[Brain] Calling onAdView");
863
866
  onAdView && onAdView({
@@ -947,7 +950,8 @@ var AdsProvider = ({
947
950
  userId,
948
951
  logLevel,
949
952
  onAdView,
950
- onAdClick
953
+ onAdClick,
954
+ throwError: props.throwError
951
955
  }
952
956
  )
953
957
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontextso/sdk-react-native",
3
- "version": "0.0.5-rc.0",
3
+ "version": "0.0.5-rc.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",