@mx-cartographer/experiences 3.7.0-alpha.sms1 → 3.7.0-alpha.sms2

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,8 +1,7 @@
1
1
  export declare class Fetch {
2
2
  endpoint: string;
3
3
  headers: {};
4
- propagateError?: boolean;
5
- constructor(endpoint: string, token: string, propagateError?: boolean);
4
+ constructor(endpoint: string, token: string);
6
5
  get: (url: string) => Promise<any>;
7
6
  post: (url: string, data?: any) => Promise<any>;
8
7
  put: (url: string, data: any) => Promise<any>;
package/dist/index.es.js CHANGED
@@ -197,15 +197,13 @@ const Rs = async (A, e, n = "1.0.0", a = "Experiences") => {
197
197
  class UA {
198
198
  endpoint = "/";
199
199
  headers = {};
200
- propagateError;
201
- // todo can we get rid of this? related to Connect
202
- constructor(e, n, a) {
200
+ constructor(e, n) {
203
201
  this.endpoint = e, this.headers = {
204
202
  Accept: "application/json",
205
203
  "Accept-Language": Me(),
206
204
  "Content-Type": "application/json",
207
205
  "MD-Session-Token": n
208
- }, this.propagateError = a;
206
+ };
209
207
  }
210
208
  get = async (e) => {
211
209
  const n = {
@@ -217,7 +215,7 @@ class UA {
217
215
  return a.text();
218
216
  throw a;
219
217
  }).then((a) => a.length ? JSON.parse(a) : {}).then((a) => a).catch((a) => {
220
- throw xt.notify(a), this.propagateError ? new Error(a) : a;
218
+ throw xt.notify(a), a;
221
219
  });
222
220
  };
223
221
  post = async (e, n) => {
@@ -231,7 +229,7 @@ class UA {
231
229
  throw i;
232
230
  return i.text();
233
231
  }).then((i) => i.length ? JSON.parse(i) : {}).then((i) => i).catch((i) => {
234
- throw xt.notify(i), this.propagateError ? new Error(i) : i;
232
+ throw xt.notify(i), i;
235
233
  });
236
234
  };
237
235
  put = async (e, n) => {
@@ -243,7 +241,7 @@ class UA {
243
241
  return fetch(`${this.endpoint}${e}`, r).then((i) => i.ok ? i.text() : i.text().then((o) => {
244
242
  throw new Error(o);
245
243
  })).then((i) => i.length ? JSON.parse(i) : {}).then((i) => i).catch((i) => {
246
- throw xt.notify(i), this.propagateError ? new Error(i) : i;
244
+ throw xt.notify(i), i;
247
245
  });
248
246
  };
249
247
  delete = async (e) => {
@@ -254,7 +252,7 @@ class UA {
254
252
  return fetch(`${this.endpoint}${e}`, n).then((a) => a.ok ? a.text() : a.text().then((r) => {
255
253
  throw new Error(r);
256
254
  })).then((a) => a.length ? JSON.parse(a) : {}).then((a) => a).catch((a) => {
257
- throw xt.notify(a), this.propagateError ? new Error(a) : a;
255
+ throw xt.notify(a), a;
258
256
  });
259
257
  };
260
258
  }
@@ -12606,7 +12604,7 @@ class mh {
12606
12604
  token = "";
12607
12605
  isInitialized = !1;
12608
12606
  constructor() {
12609
- bA(this), this.copyStore = new gh(), this.insightsMicroWidgetStore = new ph();
12607
+ this.copyStore = new gh(), this.insightsMicroWidgetStore = new ph(), bA(this);
12610
12608
  }
12611
12609
  initialize = async (e, n, a) => {
12612
12610
  await this.copyStore.initialize(e, n), await this.insightsMicroWidgetStore.initialize(e, n, a), this.session = await Rs(e, n, "1.0.0", "Micro Insights Carousel"), tA(() => {