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.
- package/dist/cjs/index.js +50 -21
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Events.d.ts +10 -0
- package/dist/esm/index.js +50 -21
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/package.json +1 -1
- package/src/api/Events.ts +15 -0
- package/src/routes/EventsRoute.ts +1 -0
- package/src/routes/UserRoutes.ts +1 -0
- package/src/util/Storage.ts +37 -19
package/dist/cjs/index.js
CHANGED
|
@@ -15839,7 +15839,11 @@ var Storage = /** @class */ (function () {
|
|
|
15839
15839
|
window.sessionStorage.setItem(Storage.getStorageKey(key), serializedValue);
|
|
15840
15840
|
}
|
|
15841
15841
|
catch (e) {
|
|
15842
|
-
|
|
15842
|
+
try {
|
|
15843
|
+
this.setCookie(key, value, 31);
|
|
15844
|
+
}
|
|
15845
|
+
catch (e) {
|
|
15846
|
+
}
|
|
15843
15847
|
Storage.data[key] = value;
|
|
15844
15848
|
}
|
|
15845
15849
|
}
|
|
@@ -15859,7 +15863,12 @@ var Storage = /** @class */ (function () {
|
|
|
15859
15863
|
}
|
|
15860
15864
|
}
|
|
15861
15865
|
catch (e) {
|
|
15862
|
-
var value =
|
|
15866
|
+
var value = null;
|
|
15867
|
+
try {
|
|
15868
|
+
value = Storage.getCookie(key);
|
|
15869
|
+
}
|
|
15870
|
+
catch (e) {
|
|
15871
|
+
}
|
|
15863
15872
|
if (!value) {
|
|
15864
15873
|
value = Storage.data[key];
|
|
15865
15874
|
}
|
|
@@ -15874,9 +15883,11 @@ var Storage = /** @class */ (function () {
|
|
|
15874
15883
|
return Storage.get('glitch_auth_token');
|
|
15875
15884
|
};
|
|
15876
15885
|
Storage.eraseCookie = function (name) {
|
|
15877
|
-
document
|
|
15878
|
-
|
|
15879
|
-
|
|
15886
|
+
if (document) {
|
|
15887
|
+
document.cookie =
|
|
15888
|
+
name +
|
|
15889
|
+
'=; Secure; HttpOnly=false; SameSite=none; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
15890
|
+
}
|
|
15880
15891
|
};
|
|
15881
15892
|
Storage.setCookie = function (name, value, days) {
|
|
15882
15893
|
var expires = '';
|
|
@@ -15885,24 +15896,28 @@ var Storage = /** @class */ (function () {
|
|
|
15885
15896
|
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
15886
15897
|
expires = '; expires=' + date.toUTCString();
|
|
15887
15898
|
}
|
|
15888
|
-
document
|
|
15889
|
-
|
|
15890
|
-
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15899
|
+
if (document) {
|
|
15900
|
+
document.cookie =
|
|
15901
|
+
name +
|
|
15902
|
+
'=' +
|
|
15903
|
+
(value || '') +
|
|
15904
|
+
expires +
|
|
15905
|
+
'; path=/; domain=' +
|
|
15906
|
+
Storage.rootDomain +
|
|
15907
|
+
'; HttpOnly=false; SameSite=none; Secure';
|
|
15908
|
+
}
|
|
15896
15909
|
};
|
|
15897
15910
|
Storage.getCookie = function (name) {
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
var
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
|
|
15911
|
+
if (document) {
|
|
15912
|
+
var nameEQ = name + '=';
|
|
15913
|
+
var ca = document.cookie.split(';');
|
|
15914
|
+
for (var i = 0; i < ca.length; i++) {
|
|
15915
|
+
var c = ca[i];
|
|
15916
|
+
while (c.charAt(0) == ' ')
|
|
15917
|
+
c = c.substring(1, c.length);
|
|
15918
|
+
if (c.indexOf(nameEQ) == 0)
|
|
15919
|
+
return c.substring(nameEQ.length, c.length);
|
|
15920
|
+
}
|
|
15906
15921
|
}
|
|
15907
15922
|
return null;
|
|
15908
15923
|
};
|
|
@@ -17120,6 +17135,7 @@ var UserRoutes = /** @class */ (function () {
|
|
|
17120
17135
|
clearStripeAuth: { url: '/users/clearStripeAuth', method: HTTP_METHODS.DELETE },
|
|
17121
17136
|
clearTikTokAuth: { url: '/users/clearTikTokAuth', method: HTTP_METHODS.DELETE },
|
|
17122
17137
|
clearYoutubeAuth: { url: '/users/clearYoutubeAuth', method: HTTP_METHODS.DELETE },
|
|
17138
|
+
clearStreamElementsAuth: { url: '/users/clearStreamElementsAuth', method: HTTP_METHODS.DELETE },
|
|
17123
17139
|
getTipsReceivedForMonth: { url: '/users/getTipsReceivedForMonth', method: HTTP_METHODS.GET },
|
|
17124
17140
|
getTipsGivenForMonth: { url: '/users/getTipsGivenForMonth', method: HTTP_METHODS.GET },
|
|
17125
17141
|
aggregateMonthlyReceivedTips: { url: '/users/aggregateMonthlyReceivedTips', method: HTTP_METHODS.GET },
|
|
@@ -17412,6 +17428,7 @@ var EventsRoutes = /** @class */ (function () {
|
|
|
17412
17428
|
getTips: { url: '/events/{event_id}/tips', method: HTTP_METHODS.GET },
|
|
17413
17429
|
setAIAvatarPersonalityAttribute: { url: '/events/{event_id}/setAIAvatarPersonalityAttribute', method: HTTP_METHODS.POST },
|
|
17414
17430
|
setAIAvatarName: { url: '/events/{event_id}/setAIAvatarName', method: HTTP_METHODS.POST },
|
|
17431
|
+
setAIAccent: { url: '/events/{event_id}/setAIAccent', method: HTTP_METHODS.POST },
|
|
17415
17432
|
setAIAvatarRespondToChat: { url: '/events/{event_id}/setAIAvatarRespondToChat', method: HTTP_METHODS.POST },
|
|
17416
17433
|
setAIAvatarRespondToMe: { url: '/events/{event_id}/setAIAvatarRespondToMe', method: HTTP_METHODS.POST },
|
|
17417
17434
|
};
|
|
@@ -17857,6 +17874,18 @@ var Events = /** @class */ (function () {
|
|
|
17857
17874
|
Events.setAIAvatarName = function (event_id, data, params) {
|
|
17858
17875
|
return Requests.processRoute(EventsRoutes.routes.setAIAvatarName, data, { event_id: event_id }, params);
|
|
17859
17876
|
};
|
|
17877
|
+
/**
|
|
17878
|
+
* Sets the AI Avatars accent, that will dictate the void in which it responds.
|
|
17879
|
+
*
|
|
17880
|
+
* @see https://api.glitch.fun/api/documentation#/Event%20Route/disableOverlay
|
|
17881
|
+
*
|
|
17882
|
+
* @param event_id The id of the event.
|
|
17883
|
+
*
|
|
17884
|
+
* @returns promise
|
|
17885
|
+
*/
|
|
17886
|
+
Events.setAIAccent = function (event_id, data, params) {
|
|
17887
|
+
return Requests.processRoute(EventsRoutes.routes.setAIAccent, data, { event_id: event_id }, params);
|
|
17888
|
+
};
|
|
17860
17889
|
/**
|
|
17861
17890
|
* Sets the AI Avatar to that it willr respond to users in the chat.
|
|
17862
17891
|
*
|