core-outline 1.1.11 → 1.1.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/package.json
CHANGED
|
@@ -40,11 +40,11 @@ const CoreOutline = ({ children, data_source_id, data_source_secret }) => {
|
|
|
40
40
|
}
|
|
41
41
|
useEffect(async () => {
|
|
42
42
|
await authorizeApp(data_source_id, data_source_secret);
|
|
43
|
-
let
|
|
44
|
-
setSessionId(
|
|
45
|
-
localStorage.setItem("coreOutlineSessionId",
|
|
43
|
+
let sessId = v4();
|
|
44
|
+
setSessionId(sessId);
|
|
45
|
+
localStorage.setItem("coreOutlineSessionId", sessId);
|
|
46
46
|
localStorage.setItem("coreOutlineDataSourceIdId", data_source_id);
|
|
47
|
-
console.log("Session",
|
|
47
|
+
console.log("Session", sessId);
|
|
48
48
|
socket.send({
|
|
49
49
|
topic: "session-data",
|
|
50
50
|
data_source_id: data_source_id,
|
|
@@ -242,19 +242,19 @@ const CoreOutline = ({ children, data_source_id, data_source_secret }) => {
|
|
|
242
242
|
}, []);
|
|
243
243
|
|
|
244
244
|
function saveEvents(events) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
245
|
+
const requestOptions = {
|
|
246
|
+
method: "PUT",
|
|
247
|
+
headers: {
|
|
248
|
+
"Content-Type": "application/json",
|
|
249
|
+
},
|
|
250
|
+
body: JSON.stringify(events),
|
|
251
|
+
};
|
|
252
|
+
fetch(`http://localhost:5000/generate-s3-url/${data_source_id}/${sessionId}`)
|
|
253
|
+
.then((response) => response.json())
|
|
254
|
+
.then((data) => {
|
|
255
|
+
const uploadURL = data.signed_url;
|
|
256
|
+
return fetch(uploadURL, requestOptions);
|
|
257
|
+
});
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
function saveEventsLocally(type = "formatted" || "raw") {
|