@inappstory/react-sdk 1.8.0-rc.10 → 1.8.0-rc.12
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.esm.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isFunction_js_8e5fd566__ from "lodash/isFunction.js";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_uuid__ from "uuid";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isObject_js_84bb7d23__ from "lodash/isObject.js";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isNil_js_d3a2677a__ from "lodash/isNil.js";
|
|
5
3
|
import * as __WEBPACK_EXTERNAL_MODULE_mobx__ from "mobx";
|
|
6
4
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isString_js_204e00fb__ from "lodash/isString.js";
|
|
7
5
|
import * as __WEBPACK_EXTERNAL_MODULE_bowser__ from "bowser";
|
|
@@ -12,6 +10,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_js_35379ba8__ from "lodash
|
|
|
12
10
|
import * as __WEBPACK_EXTERNAL_MODULE__inappstory_slide_api_2e636188__ from "@inappstory/slide-api";
|
|
13
11
|
import * as __WEBPACK_EXTERNAL_MODULE_async_mutex_052338b1__ from "async-mutex";
|
|
14
12
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isEmpty_js_f1e1789b__ from "lodash/isEmpty.js";
|
|
13
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isObject_js_84bb7d23__ from "lodash/isObject.js";
|
|
15
14
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_isNumber_js_09f2ee09__ from "lodash/isNumber.js";
|
|
16
15
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_179142b8__ from "react/jsx-runtime";
|
|
17
16
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
@@ -2175,7 +2174,7 @@ function convertModelToFormData(formData, data, previousKey) {
|
|
|
2175
2174
|
;// CONCATENATED MODULE: ../core/src/api/exceptions/apiRequestError.ts
|
|
2176
2175
|
class ApiRequestError extends Error {
|
|
2177
2176
|
constructor(networkStatus, networkMessage, response) {
|
|
2178
|
-
super();
|
|
2177
|
+
super(networkMessage);
|
|
2179
2178
|
Object.defineProperty(this, "name", {
|
|
2180
2179
|
enumerable: true,
|
|
2181
2180
|
configurable: true,
|
|
@@ -2204,7 +2203,7 @@ class ApiRequestError extends Error {
|
|
|
2204
2203
|
this.networkStatus = networkStatus;
|
|
2205
2204
|
this.networkMessage = networkMessage;
|
|
2206
2205
|
this.response = response !== null && response !== void 0 ? response : null;
|
|
2207
|
-
console.error({ name: this.name, networkStatus, networkMessage, response });
|
|
2206
|
+
/* console.error({ name: this.name, networkStatus, networkMessage, response }); */
|
|
2208
2207
|
}
|
|
2209
2208
|
static createByRequestError(response) {
|
|
2210
2209
|
return new ApiRequestError(null, JSON.stringify(response.data), response);
|
|
@@ -2212,23 +2211,13 @@ class ApiRequestError extends Error {
|
|
|
2212
2211
|
static createByFetchError(error) {
|
|
2213
2212
|
const isOnline = window.navigator && window.navigator.onLine;
|
|
2214
2213
|
if (isOnline)
|
|
2215
|
-
return new ApiRequestError(null, error.
|
|
2214
|
+
return new ApiRequestError(null, error.name === "AbortError"
|
|
2215
|
+
? "The operation was aborted by the AbortController signal. Make sure you don't destroy the InAppStoryManager while it's running."
|
|
2216
|
+
: error.message);
|
|
2216
2217
|
return new ApiRequestError(null, "net::ERR_INTERNET_DISCONNECTED");
|
|
2217
2218
|
}
|
|
2218
2219
|
}
|
|
2219
2220
|
|
|
2220
|
-
;// CONCATENATED MODULE: external "lodash/isObject.js"
|
|
2221
|
-
var isObject_js_x = (y) => {
|
|
2222
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
|
2223
|
-
}
|
|
2224
|
-
var isObject_js_y = (x) => (() => (x))
|
|
2225
|
-
const isObject_js_namespaceObject = isObject_js_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash_isObject_js_84bb7d23__["default"]) });
|
|
2226
|
-
;// CONCATENATED MODULE: external "lodash/isNil.js"
|
|
2227
|
-
var isNil_js_x = (y) => {
|
|
2228
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
|
2229
|
-
}
|
|
2230
|
-
var isNil_js_y = (x) => (() => (x))
|
|
2231
|
-
const isNil_js_namespaceObject = isNil_js_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash_isNil_js_d3a2677a__["default"]) });
|
|
2232
2221
|
;// CONCATENATED MODULE: ../core/src/helpers/classificators/isNumeric.ts
|
|
2233
2222
|
function isNumeric(str) {
|
|
2234
2223
|
if (typeof str != "string")
|
|
@@ -3116,6 +3105,41 @@ class DeviceDescriptor {
|
|
|
3116
3105
|
}
|
|
3117
3106
|
const deviceDescriptor = new DeviceDescriptor();
|
|
3118
3107
|
|
|
3108
|
+
;// CONCATENATED MODULE: ../core/src/api/InterceptorManager.ts
|
|
3109
|
+
class InterceptorManager {
|
|
3110
|
+
constructor() {
|
|
3111
|
+
Object.defineProperty(this, "handlers", {
|
|
3112
|
+
enumerable: true,
|
|
3113
|
+
configurable: true,
|
|
3114
|
+
writable: true,
|
|
3115
|
+
value: []
|
|
3116
|
+
});
|
|
3117
|
+
}
|
|
3118
|
+
use(fulfilled, rejected) {
|
|
3119
|
+
this.handlers.push({ fulfilled, rejected });
|
|
3120
|
+
return this.handlers.length - 1;
|
|
3121
|
+
}
|
|
3122
|
+
async run(value) {
|
|
3123
|
+
let current = Promise.resolve(value);
|
|
3124
|
+
for (const h of this.handlers) {
|
|
3125
|
+
current = current.then(h.fulfilled, h.rejected);
|
|
3126
|
+
}
|
|
3127
|
+
return current;
|
|
3128
|
+
}
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
;// CONCATENATED MODULE: ../core/src/api/exceptions/apiAbortRequestError.ts
|
|
3132
|
+
class IasAbortRequestError extends Error {
|
|
3133
|
+
constructor(url) {
|
|
3134
|
+
super(`The request with URL <${url}> was aborted. Make sure you don't destroy the InAppStoryManager while it's running.`);
|
|
3135
|
+
this.name = "IasAbortRequestError";
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
;// CONCATENATED MODULE: ../core/src/api/exceptions/index.ts
|
|
3140
|
+
|
|
3141
|
+
|
|
3142
|
+
|
|
3119
3143
|
;// CONCATENATED MODULE: ../core/src/api/api.ts
|
|
3120
3144
|
|
|
3121
3145
|
|
|
@@ -3124,9 +3148,6 @@ const deviceDescriptor = new DeviceDescriptor();
|
|
|
3124
3148
|
|
|
3125
3149
|
|
|
3126
3150
|
|
|
3127
|
-
function mergeObjects(obj1, obj2) {
|
|
3128
|
-
return Object.assign(Object.assign({}, obj1), obj2);
|
|
3129
|
-
}
|
|
3130
3151
|
class API {
|
|
3131
3152
|
constructor(config) {
|
|
3132
3153
|
var _a;
|
|
@@ -3136,54 +3157,101 @@ class API {
|
|
|
3136
3157
|
writable: true,
|
|
3137
3158
|
value: void 0
|
|
3138
3159
|
});
|
|
3139
|
-
Object.defineProperty(this, "_deviceInfoPromise", {
|
|
3140
|
-
enumerable: true,
|
|
3141
|
-
configurable: true,
|
|
3142
|
-
writable: true,
|
|
3143
|
-
value: null
|
|
3144
|
-
});
|
|
3145
3160
|
Object.defineProperty(this, "_baseHeaders", {
|
|
3146
3161
|
enumerable: true,
|
|
3147
3162
|
configurable: true,
|
|
3148
3163
|
writable: true,
|
|
3149
3164
|
value: {}
|
|
3150
3165
|
});
|
|
3151
|
-
Object.defineProperty(this, "requestInterceptors", {
|
|
3152
|
-
enumerable: true,
|
|
3153
|
-
configurable: true,
|
|
3154
|
-
writable: true,
|
|
3155
|
-
value: []
|
|
3156
|
-
});
|
|
3157
3166
|
Object.defineProperty(this, "interceptors", {
|
|
3158
3167
|
enumerable: true,
|
|
3159
3168
|
configurable: true,
|
|
3160
3169
|
writable: true,
|
|
3161
3170
|
value: {
|
|
3162
|
-
request:
|
|
3163
|
-
|
|
3164
|
-
this.requestInterceptors.push(cb);
|
|
3165
|
-
}
|
|
3166
|
-
}
|
|
3171
|
+
request: new InterceptorManager(),
|
|
3172
|
+
response: new InterceptorManager()
|
|
3167
3173
|
}
|
|
3168
3174
|
});
|
|
3169
3175
|
this._baseURL = (_a = config === null || config === void 0 ? void 0 : config.baseURL) !== null && _a !== void 0 ? _a : "";
|
|
3170
3176
|
}
|
|
3171
|
-
set deviceInfoPromise(promise) {
|
|
3172
|
-
this._deviceInfoPromise = promise;
|
|
3173
|
-
}
|
|
3174
|
-
set baseHeaders(headers) {
|
|
3175
|
-
this._baseHeaders = headers;
|
|
3176
|
-
}
|
|
3177
3177
|
get baseURL() {
|
|
3178
3178
|
return this._baseURL;
|
|
3179
3179
|
}
|
|
3180
3180
|
set baseURL(value) {
|
|
3181
3181
|
this._baseURL = value;
|
|
3182
3182
|
}
|
|
3183
|
+
set baseHeaders(headers) {
|
|
3184
|
+
this._baseHeaders = headers;
|
|
3185
|
+
}
|
|
3186
|
+
async request(config) {
|
|
3187
|
+
try {
|
|
3188
|
+
const processedConfig = await this.interceptors.request.run(config);
|
|
3189
|
+
const response = await this.dispatchRequest(processedConfig);
|
|
3190
|
+
return await this.interceptors.response.run(response);
|
|
3191
|
+
}
|
|
3192
|
+
catch (error) {
|
|
3193
|
+
if (error instanceof ApiRequestError)
|
|
3194
|
+
throw error;
|
|
3195
|
+
throw ApiRequestError.createByFetchError(error);
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
get(url, config = {}) {
|
|
3199
|
+
return this.request(Object.assign(Object.assign({}, config), { method: "get", url }));
|
|
3200
|
+
}
|
|
3201
|
+
post(url, data, config = {}) {
|
|
3202
|
+
return this.request(Object.assign(Object.assign({}, config), { method: "post", url, data }));
|
|
3203
|
+
}
|
|
3204
|
+
put(url, data, config = {}) {
|
|
3205
|
+
return this.request(Object.assign(Object.assign({}, config), { method: "put", url, data }));
|
|
3206
|
+
}
|
|
3207
|
+
patch(url, data, config = {}) {
|
|
3208
|
+
return this.request(Object.assign(Object.assign({}, config), { method: "patch", url, data }));
|
|
3209
|
+
}
|
|
3210
|
+
async dispatchRequest(config) {
|
|
3211
|
+
const headers = Object.assign(Object.assign({}, this._baseHeaders), config.headers);
|
|
3212
|
+
const url = this.buildURL(config.url, config.params);
|
|
3213
|
+
const method = config.method ? config.method.toUpperCase() : "GET";
|
|
3214
|
+
let body = null;
|
|
3215
|
+
if (config.data) {
|
|
3216
|
+
body = JSON.stringify(this.buildBody(config.data));
|
|
3217
|
+
headers["Content-Type"] = "application/json";
|
|
3218
|
+
}
|
|
3219
|
+
const response = await fetch(url.toString(), {
|
|
3220
|
+
method,
|
|
3221
|
+
body: method === "GET" || method === "HEAD" ? null : body, // If the request method is GET or HEAD and the body is non-null or not undefined <fetch> throws a network error..
|
|
3222
|
+
headers,
|
|
3223
|
+
credentials: "omit",
|
|
3224
|
+
signal: config.signal
|
|
3225
|
+
});
|
|
3226
|
+
let data = {};
|
|
3227
|
+
if (response.status !== 204) {
|
|
3228
|
+
try {
|
|
3229
|
+
data = await response.json();
|
|
3230
|
+
}
|
|
3231
|
+
catch (_a) {
|
|
3232
|
+
data = {};
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
const result = {
|
|
3236
|
+
data,
|
|
3237
|
+
status: response.status,
|
|
3238
|
+
statusText: response.statusText,
|
|
3239
|
+
headersRaw: response.headers,
|
|
3240
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
3241
|
+
ok: response.ok
|
|
3242
|
+
};
|
|
3243
|
+
if (!response.ok)
|
|
3244
|
+
throw ApiRequestError.createByRequestError(result);
|
|
3245
|
+
return result;
|
|
3246
|
+
}
|
|
3247
|
+
buildURL(url, params) {
|
|
3248
|
+
const qs = params ? new URLSearchParams(this.buildQuery(params)).toString() : "";
|
|
3249
|
+
return new URL(`${trimStartSlash(url)}${qs ? "?" + qs : ""}`, this._baseURL);
|
|
3250
|
+
}
|
|
3183
3251
|
buildQuery(obj, prefix) {
|
|
3184
3252
|
const pairs = [];
|
|
3185
3253
|
for (const [key, value] of Object.entries(obj)) {
|
|
3186
|
-
if (value == null || value === "")
|
|
3254
|
+
if (value == null || value === "" || Number.isNaN(value))
|
|
3187
3255
|
continue;
|
|
3188
3256
|
const fullKey = prefix ? `${prefix}[${key}]` : key;
|
|
3189
3257
|
if (typeof value === "object" && !Array.isArray(value)) {
|
|
@@ -3213,79 +3281,6 @@ class API {
|
|
|
3213
3281
|
}
|
|
3214
3282
|
return result;
|
|
3215
3283
|
}
|
|
3216
|
-
async request(config) {
|
|
3217
|
-
return new Promise((resolve, reject) => {
|
|
3218
|
-
const cb = async () => {
|
|
3219
|
-
try {
|
|
3220
|
-
if (!(0,isObject_js_namespaceObject["default"])(config.headers) || config.headers == null) {
|
|
3221
|
-
config.headers = {};
|
|
3222
|
-
}
|
|
3223
|
-
config.headers = mergeObjects(this._baseHeaders, config.headers);
|
|
3224
|
-
if (this.requestInterceptors.length) {
|
|
3225
|
-
for (const interceptor of this.requestInterceptors) {
|
|
3226
|
-
interceptor(config);
|
|
3227
|
-
}
|
|
3228
|
-
}
|
|
3229
|
-
let search = "";
|
|
3230
|
-
if (!(0,isNil_js_namespaceObject["default"])(config.params) && (0,isObject_js_namespaceObject["default"])(config.params)) {
|
|
3231
|
-
search = new URLSearchParams(this.buildQuery(config.params)).toString();
|
|
3232
|
-
}
|
|
3233
|
-
let url = new URL(`${trimStartSlash(config.url)}${search ? "?" + search : ""}`, this._baseURL);
|
|
3234
|
-
let method = "GET";
|
|
3235
|
-
if (!(0,isNil_js_namespaceObject["default"])(config.method)) {
|
|
3236
|
-
method = config.method.toUpperCase();
|
|
3237
|
-
}
|
|
3238
|
-
let headers = {};
|
|
3239
|
-
if (!(0,isNil_js_namespaceObject["default"])(config.headers) && (0,isObject_js_namespaceObject["default"])(config.headers)) {
|
|
3240
|
-
headers = config.headers;
|
|
3241
|
-
}
|
|
3242
|
-
let body = null;
|
|
3243
|
-
if (!(0,isNil_js_namespaceObject["default"])(config.data) && (0,isObject_js_namespaceObject["default"])(config.data)) {
|
|
3244
|
-
body = JSON.stringify(this.buildBody(config.data));
|
|
3245
|
-
headers["Content-Type"] = "application/json";
|
|
3246
|
-
}
|
|
3247
|
-
const response = await fetch(url.toString(), {
|
|
3248
|
-
method,
|
|
3249
|
-
body: method === "GET" || method === "HEAD" ? null : body, // If the request method is GET or HEAD and the body is non-null or not undefined <fetch> throws a network error..
|
|
3250
|
-
headers,
|
|
3251
|
-
credentials: "omit"
|
|
3252
|
-
});
|
|
3253
|
-
let json = {};
|
|
3254
|
-
if (response.status !== 204)
|
|
3255
|
-
json = await response.json();
|
|
3256
|
-
const apiResponse = {
|
|
3257
|
-
data: json,
|
|
3258
|
-
headersRaw: response.headers,
|
|
3259
|
-
// @ts-ignore
|
|
3260
|
-
headers: Object.fromEntries([...response.headers]),
|
|
3261
|
-
status: response.status,
|
|
3262
|
-
statusText: response.statusText,
|
|
3263
|
-
ok: response.ok
|
|
3264
|
-
};
|
|
3265
|
-
if (!response.ok) {
|
|
3266
|
-
reject(ApiRequestError.createByRequestError(apiResponse));
|
|
3267
|
-
return;
|
|
3268
|
-
}
|
|
3269
|
-
resolve(apiResponse);
|
|
3270
|
-
}
|
|
3271
|
-
catch (error) {
|
|
3272
|
-
reject(ApiRequestError.createByFetchError(error));
|
|
3273
|
-
}
|
|
3274
|
-
};
|
|
3275
|
-
if (this._deviceInfoPromise) {
|
|
3276
|
-
this._deviceInfoPromise.finally(cb);
|
|
3277
|
-
}
|
|
3278
|
-
else {
|
|
3279
|
-
cb();
|
|
3280
|
-
}
|
|
3281
|
-
});
|
|
3282
|
-
}
|
|
3283
|
-
async post(path, data, params = {}) {
|
|
3284
|
-
return this.request({ method: "post", url: path, data, params });
|
|
3285
|
-
}
|
|
3286
|
-
async get(path, params = {}) {
|
|
3287
|
-
return this.request({ method: "get", url: path, params });
|
|
3288
|
-
}
|
|
3289
3284
|
}
|
|
3290
3285
|
const APIInstance = new API();
|
|
3291
3286
|
APIInstance.interceptors.request.use(config => {
|
|
@@ -3293,14 +3288,13 @@ APIInstance.interceptors.request.use(config => {
|
|
|
3293
3288
|
const storyManagerConfig = storyManager.config;
|
|
3294
3289
|
const session = storyManager.rootStore.sessionStore.session;
|
|
3295
3290
|
const sessionId = session === null || session === void 0 ? void 0 : session.id;
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
});
|
|
3291
|
+
if (!storyManagerConfig.apiKey)
|
|
3292
|
+
throw new IasAbortRequestError(config.url);
|
|
3293
|
+
if (!Boolean((_a = config.meta) === null || _a === void 0 ? void 0 : _a.public) && !sessionId)
|
|
3294
|
+
throw new IasAbortRequestError(config.url);
|
|
3295
|
+
config.headers = Object.assign(Object.assign({}, config.headers), { Authorization: `Bearer ${storyManagerConfig.apiKey}`, "Accept-Language": storyManagerConfig.lang.toString(), "X-Request-Id": (0,external_uuid_namespaceObject.v4)(), "X-User-Agent": storyManager.userAgent });
|
|
3302
3296
|
if (storyManagerConfig.userId && !storyManagerConfig.anonymous) {
|
|
3303
|
-
config.headers["X-User-Id"] = storyManagerConfig.userId;
|
|
3297
|
+
config.headers["X-User-Id"] = storyManagerConfig.userId.toString();
|
|
3304
3298
|
}
|
|
3305
3299
|
if (sessionId) {
|
|
3306
3300
|
config.headers["Auth-Session-Id"] = sessionId;
|
|
@@ -3508,20 +3502,24 @@ let IamApi = (() => {
|
|
|
3508
3502
|
tags: tags.join(","),
|
|
3509
3503
|
options
|
|
3510
3504
|
}, {
|
|
3511
|
-
|
|
3505
|
+
params: {
|
|
3506
|
+
fields: messageFieldsWithPrefix
|
|
3507
|
+
}
|
|
3512
3508
|
});
|
|
3513
3509
|
return response.data.messages;
|
|
3514
3510
|
}
|
|
3515
3511
|
async fetchContext() {
|
|
3516
3512
|
const response = await api.get("inappmessaging/message-context", {
|
|
3517
|
-
fields: "style,widgetsData"
|
|
3513
|
+
params: { fields: "style,widgetsData" }
|
|
3518
3514
|
});
|
|
3519
3515
|
return response.data;
|
|
3520
3516
|
}
|
|
3521
3517
|
async fetchById(messageId) {
|
|
3522
3518
|
const response = await api.get(`inappmessaging/message/${messageId}`, {
|
|
3523
|
-
|
|
3524
|
-
|
|
3519
|
+
params: {
|
|
3520
|
+
expand: "slides_html",
|
|
3521
|
+
fields: messageFields
|
|
3522
|
+
}
|
|
3525
3523
|
});
|
|
3526
3524
|
const messageDto = response.data;
|
|
3527
3525
|
if (!messageDto)
|
|
@@ -3538,7 +3536,9 @@ let IamApi = (() => {
|
|
|
3538
3536
|
});
|
|
3539
3537
|
return;
|
|
3540
3538
|
}
|
|
3541
|
-
await api.post(`/inappmessaging/message/${messageId}/event/${messageEvent.type}`, {},
|
|
3539
|
+
await api.post(`/inappmessaging/message/${messageId}/event/${messageEvent.type}`, {}, {
|
|
3540
|
+
params: messageEvent.toQueryParams()
|
|
3541
|
+
});
|
|
3542
3542
|
}
|
|
3543
3543
|
catch (error) {
|
|
3544
3544
|
console.error(error);
|
|
@@ -3919,8 +3919,13 @@ class SessionApi {
|
|
|
3919
3919
|
async open(payload) {
|
|
3920
3920
|
const data = await this.getOpenSessionPayload(payload);
|
|
3921
3921
|
const response = await api.post("session/open", data, {
|
|
3922
|
-
|
|
3923
|
-
|
|
3922
|
+
params: {
|
|
3923
|
+
expand: "cache",
|
|
3924
|
+
fields: openFields
|
|
3925
|
+
},
|
|
3926
|
+
meta: {
|
|
3927
|
+
public: true
|
|
3928
|
+
}
|
|
3924
3929
|
});
|
|
3925
3930
|
return response.data;
|
|
3926
3931
|
}
|
|
@@ -4493,25 +4498,25 @@ class StoriesApi {
|
|
|
4493
4498
|
}
|
|
4494
4499
|
async fetchStorySlides({ id, feedSlug }) {
|
|
4495
4500
|
const { url, params } = this.getStoryRequestConfig(id, feedSlug);
|
|
4496
|
-
const response = await api.get(url,
|
|
4501
|
+
const response = await api.get(url, { params });
|
|
4497
4502
|
return response.data;
|
|
4498
4503
|
}
|
|
4499
4504
|
async fetchStory({ id, feedSlug, fetchShareUrl, once }) {
|
|
4500
4505
|
const { url, params } = this.getStoryRequestConfig(id, feedSlug, true, fetchShareUrl, once);
|
|
4501
|
-
const response = await api.get(url,
|
|
4506
|
+
const response = await api.get(url, { params });
|
|
4502
4507
|
if (response.status === 204 && once)
|
|
4503
4508
|
throw new IasStoryAlreadyShownError(id.toString());
|
|
4504
4509
|
return response.data;
|
|
4505
4510
|
}
|
|
4506
4511
|
async fetchStoryContext({ ids }) {
|
|
4507
4512
|
const { url, params } = this.getStoryContextRequestConfig(ids);
|
|
4508
|
-
const response = await api.get(url,
|
|
4513
|
+
const response = await api.get(url, { params });
|
|
4509
4514
|
return response.data;
|
|
4510
4515
|
}
|
|
4511
4516
|
async fetchStoryCSS() {
|
|
4512
4517
|
var _a;
|
|
4513
4518
|
const { url, params } = this.getStoryCSSRequestConfig();
|
|
4514
|
-
const response = await api.get(url,
|
|
4519
|
+
const response = await api.get(url, { params });
|
|
4515
4520
|
return (_a = response.data.style) !== null && _a !== void 0 ? _a : "";
|
|
4516
4521
|
}
|
|
4517
4522
|
async setStoryLike(storyId, like) {
|
|
@@ -4543,7 +4548,7 @@ class StoriesApi {
|
|
|
4543
4548
|
localStorageSet(key, data);
|
|
4544
4549
|
}
|
|
4545
4550
|
async fetchStorySharePath(storyId) {
|
|
4546
|
-
const response = await api.get(`story-share/${storyId}
|
|
4551
|
+
const response = await api.get(`story-share/${storyId}`);
|
|
4547
4552
|
if (!response.data.url)
|
|
4548
4553
|
throw new IasShareUrlUndefinedError(storyId);
|
|
4549
4554
|
return response.data.url;
|
|
@@ -4617,7 +4622,7 @@ class StoryFeedsApi {
|
|
|
4617
4622
|
f: filter && JSON.stringify(filter),
|
|
4618
4623
|
options
|
|
4619
4624
|
};
|
|
4620
|
-
const response = await api.get(url,
|
|
4625
|
+
const response = await api.get(url, { params });
|
|
4621
4626
|
return response.data;
|
|
4622
4627
|
}
|
|
4623
4628
|
async fetchDefaultFeed({ feedSlug, tags, testKey, options }) {
|
|
@@ -4626,7 +4631,9 @@ class StoryFeedsApi {
|
|
|
4626
4631
|
tags: tags.join(","),
|
|
4627
4632
|
options
|
|
4628
4633
|
}, {
|
|
4629
|
-
|
|
4634
|
+
params: {
|
|
4635
|
+
test: testKey
|
|
4636
|
+
}
|
|
4630
4637
|
});
|
|
4631
4638
|
response.data.feedSlug = feedSlug;
|
|
4632
4639
|
return response.data;
|
|
@@ -4634,8 +4641,10 @@ class StoryFeedsApi {
|
|
|
4634
4641
|
async fetchFavoriteFeed({ tags }) {
|
|
4635
4642
|
const url = "story";
|
|
4636
4643
|
const response = await api.get(url, {
|
|
4637
|
-
|
|
4638
|
-
|
|
4644
|
+
params: {
|
|
4645
|
+
tags: tags.join(","),
|
|
4646
|
+
favorite: 1
|
|
4647
|
+
}
|
|
4639
4648
|
});
|
|
4640
4649
|
return response.data;
|
|
4641
4650
|
}
|
|
@@ -4645,7 +4654,9 @@ class StoryFeedsApi {
|
|
|
4645
4654
|
tags: payload.tags.join(","),
|
|
4646
4655
|
options: payload.options
|
|
4647
4656
|
}, {
|
|
4648
|
-
|
|
4657
|
+
params: {
|
|
4658
|
+
limit: payload.limit
|
|
4659
|
+
}
|
|
4649
4660
|
});
|
|
4650
4661
|
response.data.feedSlug = payload.feedSlug;
|
|
4651
4662
|
return response.data;
|
|
@@ -4712,7 +4723,7 @@ class StatisticV2Api {
|
|
|
4712
4723
|
}
|
|
4713
4724
|
async sendFallbackFetch(path, params) {
|
|
4714
4725
|
const api = new API({ baseURL: domains.apiUrl });
|
|
4715
|
-
await api.get(path, params);
|
|
4726
|
+
await api.get(path, { params });
|
|
4716
4727
|
}
|
|
4717
4728
|
}
|
|
4718
4729
|
|
|
@@ -7963,9 +7974,6 @@ let StorySlideViewModel = (() => {
|
|
|
7963
7974
|
}
|
|
7964
7975
|
});
|
|
7965
7976
|
}
|
|
7966
|
-
get state() {
|
|
7967
|
-
return this.slideApi.state;
|
|
7968
|
-
}
|
|
7969
7977
|
get index() {
|
|
7970
7978
|
return this._index;
|
|
7971
7979
|
}
|
|
@@ -8195,17 +8203,20 @@ let StorySlideViewModel = (() => {
|
|
|
8195
8203
|
}
|
|
8196
8204
|
}
|
|
8197
8205
|
async destroy() {
|
|
8206
|
+
const release = await this.mutex.acquire();
|
|
8198
8207
|
try {
|
|
8199
8208
|
this.isStarted = false;
|
|
8200
8209
|
this.isInited = false;
|
|
8201
8210
|
this.story.touchController.off(TouchControllerEvent.TouchEnd, this.handleTouchEnd);
|
|
8202
8211
|
if (this.cacheManager)
|
|
8203
8212
|
this.slide.restoreOriginalResourceUrls();
|
|
8204
|
-
await this.slideApi.destroy();
|
|
8205
8213
|
}
|
|
8206
8214
|
catch (error) {
|
|
8207
8215
|
console.error(error);
|
|
8208
8216
|
}
|
|
8217
|
+
finally {
|
|
8218
|
+
release();
|
|
8219
|
+
}
|
|
8209
8220
|
}
|
|
8210
8221
|
getNavigationDirection(event, currentTarget) {
|
|
8211
8222
|
const xPercent = this.getClickPosition(event, currentTarget);
|
|
@@ -10161,8 +10172,6 @@ let StoryViewModel = (() => {
|
|
|
10161
10172
|
async onSlideChange(index) {
|
|
10162
10173
|
var _b;
|
|
10163
10174
|
try {
|
|
10164
|
-
if (!this.isInited || !this.isStarted)
|
|
10165
|
-
return;
|
|
10166
10175
|
const lastSlide = this.getSlideByIndex(this._activeSlideIndex);
|
|
10167
10176
|
const activeSlide = this.getSlideByIndex(index);
|
|
10168
10177
|
this._activeSlideIndex = index;
|
|
@@ -10257,6 +10266,12 @@ var isEmpty_js_x = (y) => {
|
|
|
10257
10266
|
}
|
|
10258
10267
|
var isEmpty_js_y = (x) => (() => (x))
|
|
10259
10268
|
const isEmpty_js_namespaceObject = isEmpty_js_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash_isEmpty_js_f1e1789b__["default"]) });
|
|
10269
|
+
;// CONCATENATED MODULE: external "lodash/isObject.js"
|
|
10270
|
+
var isObject_js_x = (y) => {
|
|
10271
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
10272
|
+
}
|
|
10273
|
+
var isObject_js_y = (x) => (() => (x))
|
|
10274
|
+
const isObject_js_namespaceObject = isObject_js_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash_isObject_js_84bb7d23__["default"]) });
|
|
10260
10275
|
;// CONCATENATED MODULE: ../core/src/readers/gameReader/gameSessionHandlers/gameInstanceLocalDataHandlers/gameInstanceStorage.ts
|
|
10261
10276
|
|
|
10262
10277
|
|
|
@@ -10599,7 +10614,7 @@ class GameCenterApi {
|
|
|
10599
10614
|
const body = {};
|
|
10600
10615
|
if (gameOptions && (0,isObject_js_namespaceObject["default"])(gameOptions) && gameOptions.demoMode != null)
|
|
10601
10616
|
body.demoMode = Boolean(gameOptions.demoMode);
|
|
10602
|
-
const response = await api.post(`game/${gameInstanceId}/launch`, body, params);
|
|
10617
|
+
const response = await api.post(`game/${gameInstanceId}/launch`, body, { params });
|
|
10603
10618
|
return response.data;
|
|
10604
10619
|
}
|
|
10605
10620
|
}
|
|
@@ -10692,7 +10707,7 @@ class GameClientConfig {
|
|
|
10692
10707
|
value: void 0
|
|
10693
10708
|
});
|
|
10694
10709
|
const storyManagerConfig = this.storyManager.config;
|
|
10695
|
-
const sdkVersion = "1.8.0-rc.
|
|
10710
|
+
const sdkVersion = "1.8.0-rc.12";
|
|
10696
10711
|
const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
|
|
10697
10712
|
const session = this.storyManager.rootStore.sessionStore.session;
|
|
10698
10713
|
this.sessionId = session.id;
|
|
@@ -20965,7 +20980,7 @@ class UgcEditorStore {
|
|
|
20965
20980
|
const session = await this.storyManager.rootStore.sessionStore.open();
|
|
20966
20981
|
const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
|
|
20967
20982
|
const storyManagerConfig = this.storyManager.config;
|
|
20968
|
-
const sdkVersion = "1.8.0-rc.
|
|
20983
|
+
const sdkVersion = "1.8.0-rc.12";
|
|
20969
20984
|
this._config = {
|
|
20970
20985
|
sessionId: session.id,
|
|
20971
20986
|
apiKey: storyManagerConfig.apiKey,
|
|
@@ -20998,7 +21013,6 @@ class UgcEditorApi {
|
|
|
20998
21013
|
const requestConfig = {
|
|
20999
21014
|
method: "GET",
|
|
21000
21015
|
url: "ugc/editor-config",
|
|
21001
|
-
params: {}
|
|
21002
21016
|
};
|
|
21003
21017
|
const response = await api.request(requestConfig);
|
|
21004
21018
|
return response.data;
|
|
@@ -21397,7 +21411,7 @@ class StoryManager extends TypedEventEmitter {
|
|
|
21397
21411
|
return this._userAgent;
|
|
21398
21412
|
}
|
|
21399
21413
|
get sdkVersionName() {
|
|
21400
|
-
const sdkVersionName = "1.8.0-rc.
|
|
21414
|
+
const sdkVersionName = "1.8.0-rc.12";
|
|
21401
21415
|
return sdkVersionName || "0.0.0";
|
|
21402
21416
|
}
|
|
21403
21417
|
get sdkVersionCode() {
|
|
@@ -26902,7 +26916,7 @@ const messageViewsByType = {
|
|
|
26902
26916
|
|
|
26903
26917
|
;// CONCATENATED MODULE: ./src/InAppMessaging/components/BottomSheet/BottomSheet.styles.ts
|
|
26904
26918
|
|
|
26905
|
-
const bottomSheetStyles = (0,external_lit_namespaceObject.css) `.bottom-sheet{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:999}.bottom-sheet__backdrop{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:-1;background-color:rgba(0,0,0,var(--backdrop-opacity,.5));opacity:0;transition:opacity 225ms cubic-bezier(.4,0,.2,1);pointer-events:none}.bottom-sheet__backdrop--visible{animation:fade-in .3s forwards}.bottom-sheet__backdrop--hidden{animation:fade-out .3s forwards}.bottom-sheet__box{position:absolute;left:0;right:0;bottom:0;will-change:transform;border-top-left-radius:var(--slide-border-top-left-radius,0);border-top-right-radius:var(--slide-border-top-right-radius,0);background-color:transparent;transition:opacity .3s ease,transform .3s ease;transform:translate3d(0,120%,0);pointer-events:all}.bottom-sheet__box-wrapper{position:absolute;inset:0;pointer-events:none}.bottom-sheet__box-wrapper.bottom-sheet__box-wrapper--desktop-mode{position:absolute;bottom:0;left:50%;transform:translate3d(-50%,0,0)}.bottom-sheet__box.bottom-sheet__box--open{opacity:1;transform:translate3d(0,0,0)}.bottom-sheet__backdrop.bottom-sheet__backdrop--open{opacity:1;pointer-events:all}.bottom-sheet__header .close-strip-btn{margin-top:8px;width:32px;height:4px;background-color:#00000080;border-radius:var(--close-strip-btn-border-radius);position:absolute;z-index:10000;left:50%;transform:translate3d(-50%,0,0)}`;
|
|
26919
|
+
const bottomSheetStyles = (0,external_lit_namespaceObject.css) `.bottom-sheet{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:999}.bottom-sheet__backdrop{position:fixed;inset:0;left:0;bottom:0;right:0;z-index:-1;background-color:rgba(0,0,0,var(--backdrop-opacity,.5));opacity:0;transition:opacity 225ms cubic-bezier(.4,0,.2,1);pointer-events:none}.bottom-sheet__backdrop--visible{animation:fade-in .3s forwards}.bottom-sheet__backdrop--hidden{animation:fade-out .3s forwards}.bottom-sheet__box{position:absolute;left:0;right:0;bottom:0;will-change:transform;border-top-left-radius:var(--slide-border-top-left-radius,0);border-top-right-radius:var(--slide-border-top-right-radius,0);background-color:transparent;transition:opacity .3s ease,transform .3s ease;transform:translate3d(0,120%,0);pointer-events:all;overflow:hidden}.bottom-sheet__box-wrapper{position:absolute;inset:0;pointer-events:none}.bottom-sheet__box-wrapper.bottom-sheet__box-wrapper--desktop-mode{position:absolute;bottom:0;left:50%;transform:translate3d(-50%,0,0)}.bottom-sheet__box.bottom-sheet__box--open{opacity:1;transform:translate3d(0,0,0)}.bottom-sheet__backdrop.bottom-sheet__backdrop--open{opacity:1;pointer-events:all}.bottom-sheet__header .close-strip-btn{margin-top:8px;width:32px;height:4px;background-color:#00000080;border-radius:var(--close-strip-btn-border-radius);position:absolute;z-index:10000;left:50%;transform:translate3d(-50%,0,0)}`;
|
|
26906
26920
|
|
|
26907
26921
|
;// CONCATENATED MODULE: external "lit/directives/style-map.js"
|
|
26908
26922
|
var style_map_js_x = (y) => {
|
|
@@ -28618,7 +28632,7 @@ const IASContainer = (0,external_mobx_react_lite_namespaceObject.observer)((prop
|
|
|
28618
28632
|
const gameReader = useGameReaderViewModel({ storyManager: storyManager });
|
|
28619
28633
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
28620
28634
|
if (iasContainerMounted)
|
|
28621
|
-
throw new Error("There can only be one instance of <IASContainer /> per application");
|
|
28635
|
+
throw new Error("[IAS]: There can only be one instance of <IASContainer /> per application");
|
|
28622
28636
|
iasContainerMounted = true;
|
|
28623
28637
|
return () => {
|
|
28624
28638
|
iasContainerMounted = false;
|