glitch-javascript-sdk 0.5.6 → 0.5.8

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.
@@ -352,6 +352,16 @@ declare class Events {
352
352
  * @returns promise
353
353
  */
354
354
  static setAIAvatarName<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
355
+ /**
356
+ * Sets the AI Avatars accent, that will dictate the void in which it responds.
357
+ *
358
+ * @see https://api.glitch.fun/api/documentation#/Event%20Route/disableOverlay
359
+ *
360
+ * @param event_id The id of the event.
361
+ *
362
+ * @returns promise
363
+ */
364
+ static setAIAccent<T>(event_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
355
365
  /**
356
366
  * Sets the AI Avatar to that it willr respond to users in the chat.
357
367
  *
package/dist/esm/index.js CHANGED
@@ -30061,7 +30061,11 @@ var Storage = /** @class */ (function () {
30061
30061
  window.sessionStorage.setItem(Storage.getStorageKey(key), serializedValue);
30062
30062
  }
30063
30063
  catch (e) {
30064
- this.setCookie(key, value, 31);
30064
+ try {
30065
+ this.setCookie(key, value, 31);
30066
+ }
30067
+ catch (e) {
30068
+ }
30065
30069
  Storage.data[key] = value;
30066
30070
  }
30067
30071
  }
@@ -30081,7 +30085,12 @@ var Storage = /** @class */ (function () {
30081
30085
  }
30082
30086
  }
30083
30087
  catch (e) {
30084
- var value = Storage.getCookie(key);
30088
+ var value = null;
30089
+ try {
30090
+ value = Storage.getCookie(key);
30091
+ }
30092
+ catch (e) {
30093
+ }
30085
30094
  if (!value) {
30086
30095
  value = Storage.data[key];
30087
30096
  }
@@ -30096,9 +30105,11 @@ var Storage = /** @class */ (function () {
30096
30105
  return Storage.get('glitch_auth_token');
30097
30106
  };
30098
30107
  Storage.eraseCookie = function (name) {
30099
- document.cookie =
30100
- name +
30101
- '=; Secure; HttpOnly=false; SameSite=none; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
30108
+ if (document) {
30109
+ document.cookie =
30110
+ name +
30111
+ '=; Secure; HttpOnly=false; SameSite=none; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
30112
+ }
30102
30113
  };
30103
30114
  Storage.setCookie = function (name, value, days) {
30104
30115
  var expires = '';
@@ -30107,24 +30118,28 @@ var Storage = /** @class */ (function () {
30107
30118
  date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
30108
30119
  expires = '; expires=' + date.toUTCString();
30109
30120
  }
30110
- document.cookie =
30111
- name +
30112
- '=' +
30113
- (value || '') +
30114
- expires +
30115
- '; path=/; domain=' +
30116
- Storage.rootDomain +
30117
- '; HttpOnly=false; SameSite=none; Secure';
30121
+ if (document) {
30122
+ document.cookie =
30123
+ name +
30124
+ '=' +
30125
+ (value || '') +
30126
+ expires +
30127
+ '; path=/; domain=' +
30128
+ Storage.rootDomain +
30129
+ '; HttpOnly=false; SameSite=none; Secure';
30130
+ }
30118
30131
  };
30119
30132
  Storage.getCookie = function (name) {
30120
- var nameEQ = name + '=';
30121
- var ca = document.cookie.split(';');
30122
- for (var i = 0; i < ca.length; i++) {
30123
- var c = ca[i];
30124
- while (c.charAt(0) == ' ')
30125
- c = c.substring(1, c.length);
30126
- if (c.indexOf(nameEQ) == 0)
30127
- return c.substring(nameEQ.length, c.length);
30133
+ if (document) {
30134
+ var nameEQ = name + '=';
30135
+ var ca = document.cookie.split(';');
30136
+ for (var i = 0; i < ca.length; i++) {
30137
+ var c = ca[i];
30138
+ while (c.charAt(0) == ' ')
30139
+ c = c.substring(1, c.length);
30140
+ if (c.indexOf(nameEQ) == 0)
30141
+ return c.substring(nameEQ.length, c.length);
30142
+ }
30128
30143
  }
30129
30144
  return null;
30130
30145
  };
@@ -31342,6 +31357,7 @@ var UserRoutes = /** @class */ (function () {
31342
31357
  clearStripeAuth: { url: '/users/clearStripeAuth', method: HTTP_METHODS.DELETE },
31343
31358
  clearTikTokAuth: { url: '/users/clearTikTokAuth', method: HTTP_METHODS.DELETE },
31344
31359
  clearYoutubeAuth: { url: '/users/clearYoutubeAuth', method: HTTP_METHODS.DELETE },
31360
+ clearStreamElementsAuth: { url: '/users/clearStreamElementsAuth', method: HTTP_METHODS.DELETE },
31345
31361
  getTipsReceivedForMonth: { url: '/users/getTipsReceivedForMonth', method: HTTP_METHODS.GET },
31346
31362
  getTipsGivenForMonth: { url: '/users/getTipsGivenForMonth', method: HTTP_METHODS.GET },
31347
31363
  aggregateMonthlyReceivedTips: { url: '/users/aggregateMonthlyReceivedTips', method: HTTP_METHODS.GET },
@@ -31634,6 +31650,7 @@ var EventsRoutes = /** @class */ (function () {
31634
31650
  getTips: { url: '/events/{event_id}/tips', method: HTTP_METHODS.GET },
31635
31651
  setAIAvatarPersonalityAttribute: { url: '/events/{event_id}/setAIAvatarPersonalityAttribute', method: HTTP_METHODS.POST },
31636
31652
  setAIAvatarName: { url: '/events/{event_id}/setAIAvatarName', method: HTTP_METHODS.POST },
31653
+ setAIAccent: { url: '/events/{event_id}/setAIAccent', method: HTTP_METHODS.POST },
31637
31654
  setAIAvatarRespondToChat: { url: '/events/{event_id}/setAIAvatarRespondToChat', method: HTTP_METHODS.POST },
31638
31655
  setAIAvatarRespondToMe: { url: '/events/{event_id}/setAIAvatarRespondToMe', method: HTTP_METHODS.POST },
31639
31656
  };
@@ -32079,6 +32096,18 @@ var Events = /** @class */ (function () {
32079
32096
  Events.setAIAvatarName = function (event_id, data, params) {
32080
32097
  return Requests.processRoute(EventsRoutes.routes.setAIAvatarName, data, { event_id: event_id }, params);
32081
32098
  };
32099
+ /**
32100
+ * Sets the AI Avatars accent, that will dictate the void in which it responds.
32101
+ *
32102
+ * @see https://api.glitch.fun/api/documentation#/Event%20Route/disableOverlay
32103
+ *
32104
+ * @param event_id The id of the event.
32105
+ *
32106
+ * @returns promise
32107
+ */
32108
+ Events.setAIAccent = function (event_id, data, params) {
32109
+ return Requests.processRoute(EventsRoutes.routes.setAIAccent, data, { event_id: event_id }, params);
32110
+ };
32082
32111
  /**
32083
32112
  * Sets the AI Avatar to that it willr respond to users in the chat.
32084
32113
  *