rivia 0.0.28 → 0.0.30
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.js +17 -17
- package/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -79,9 +79,9 @@ function Onboarding(topTitle = "Get Started", subtitle, completion = 0, checklis
|
|
|
79
79
|
user_var12 = "User_" + Math.random().toString(36).substring(2, 8);
|
|
80
80
|
sessionStorage.setItem(user_var, user_var12);
|
|
81
81
|
}
|
|
82
|
-
const backendUrl = `
|
|
82
|
+
const backendUrl = `https://demoapi.rivia.ai/clients/${checklist_id}/${user_var12}`;
|
|
83
83
|
async function getUserProgress22() {
|
|
84
|
-
const backendUrl2 = `
|
|
84
|
+
const backendUrl2 = `https://demoapi.rivia.ai/clients/${checklist_id}/${user_var12}`;
|
|
85
85
|
try {
|
|
86
86
|
const res = await fetch(backendUrl2, { credentials: "include" });
|
|
87
87
|
if (!res.ok) console.warn(`GET failed: ${res.status}`);
|
|
@@ -119,7 +119,7 @@ function Onboarding(topTitle = "Get Started", subtitle, completion = 0, checklis
|
|
|
119
119
|
}
|
|
120
120
|
storedVisited = sessionStorage.getItem("onboardingVisited");
|
|
121
121
|
async function getUserProgress22() {
|
|
122
|
-
const backendUrl2 = `
|
|
122
|
+
const backendUrl2 = `https://demoapi.rivia.ai/clients/${checklist_id}/${user_var12}`;
|
|
123
123
|
try {
|
|
124
124
|
const res = await fetch(backendUrl2, { credentials: "include" });
|
|
125
125
|
if (!res.ok) console.warn(`GET failed: ${res.status}`);
|
|
@@ -528,7 +528,7 @@ async function fetchWithTimeout(topTitle = "Get Started", subtitle, completion =
|
|
|
528
528
|
}
|
|
529
529
|
let check = 0;
|
|
530
530
|
console.log("before");
|
|
531
|
-
const EVENT_SRC_URL = "
|
|
531
|
+
const EVENT_SRC_URL = "https://demoapi.rivia.ai/events";
|
|
532
532
|
if (!window._onboardingEventSource) {
|
|
533
533
|
window._onboardingEventSource = new EventSource(EVENT_SRC_URL);
|
|
534
534
|
}
|
|
@@ -754,7 +754,7 @@ async function fetchWithTimeout(topTitle = "Get Started", subtitle, completion =
|
|
|
754
754
|
}
|
|
755
755
|
const eventId = data.event_id;
|
|
756
756
|
try {
|
|
757
|
-
fetch("
|
|
757
|
+
fetch("https://demoapi.rivia.ai/ack-event", {
|
|
758
758
|
method: "POST",
|
|
759
759
|
headers: { "Content-Type": "application/json" },
|
|
760
760
|
body: JSON.stringify({ event_id: eventId })
|
|
@@ -806,7 +806,7 @@ async function fetchWithTimeout(topTitle = "Get Started", subtitle, completion =
|
|
|
806
806
|
function uploadVisitedPagesInBackground(completed2, touched = false) {
|
|
807
807
|
let activeStepId2 = sessionStorage.getItem("activeStepId") || null;
|
|
808
808
|
let user_var22 = user_var;
|
|
809
|
-
const backendUrl22 = `
|
|
809
|
+
const backendUrl22 = `https://demoapi.rivia.ai/clients/${checklist_id}`;
|
|
810
810
|
try {
|
|
811
811
|
const payload = {
|
|
812
812
|
name: user_var22,
|
|
@@ -838,7 +838,7 @@ async function fetchWithTimeout(topTitle = "Get Started", subtitle, completion =
|
|
|
838
838
|
storedVisited = sessionStorage.getItem("onboardingVisited");
|
|
839
839
|
if (!storedVisited || storedVisited == "[]") {
|
|
840
840
|
async function getUserProgress22() {
|
|
841
|
-
const backendUrl2 = `
|
|
841
|
+
const backendUrl2 = `https://demoapi.rivia.ai/clients/${checklist_id}/${user_var}`;
|
|
842
842
|
try {
|
|
843
843
|
const res = await fetch(backendUrl2, { credentials: "include" });
|
|
844
844
|
if (!res.ok) console.warn(`GET failed: ${res.status}`);
|
|
@@ -1162,7 +1162,7 @@ async function Checklist(checklist_id, user_var) {
|
|
|
1162
1162
|
return checklist2;
|
|
1163
1163
|
}
|
|
1164
1164
|
const res = await fetch(
|
|
1165
|
-
`
|
|
1165
|
+
`https://demoapi.rivia.ai/checklists2/${checklist_id}`,
|
|
1166
1166
|
{
|
|
1167
1167
|
method: "GET",
|
|
1168
1168
|
headers: { "Content-Type": "application/json" }
|
|
@@ -1469,7 +1469,7 @@ var RIVIA_TOUR = function() {
|
|
|
1469
1469
|
function uploadVisitedPagesInBackground(tourId, user_var, tourIndex) {
|
|
1470
1470
|
console.log("Uploading visited pages in background for tour ID:", tourIndex, "and user_var:", user_var12);
|
|
1471
1471
|
let user_var2 = user_var12;
|
|
1472
|
-
const backendUrl22 = `
|
|
1472
|
+
const backendUrl22 = `https://demoapi.rivia.ai/tours_clients/${tourId}`;
|
|
1473
1473
|
try {
|
|
1474
1474
|
const payload = {
|
|
1475
1475
|
name: user_var2,
|
|
@@ -1501,7 +1501,7 @@ var RIVIA_TOUR = function() {
|
|
|
1501
1501
|
console.log("Loading tips for tour ID:", tourId, "and user_var:", user_var12);
|
|
1502
1502
|
try {
|
|
1503
1503
|
if (!tourId) console.warn("Tour ID is required");
|
|
1504
|
-
const res = await fetch(`
|
|
1504
|
+
const res = await fetch(`https://demoapi.rivia.ai/tours2/${tourId}`, {
|
|
1505
1505
|
method: "GET",
|
|
1506
1506
|
headers: { "Content-Type": "application/json" }
|
|
1507
1507
|
});
|
|
@@ -2999,7 +2999,7 @@ var RIVIA_TOUR = function() {
|
|
|
2999
2999
|
document.querySelectorAll("[data-rivia-tip-id]").forEach((n) => n.remove());
|
|
3000
3000
|
STATE.tourIndex = 0;
|
|
3001
3001
|
const user_var2 = user_var12;
|
|
3002
|
-
const backendUrl = `
|
|
3002
|
+
const backendUrl = `https://demoapi.rivia.ai/tours_clients/${STATE.tour_id}`;
|
|
3003
3003
|
const payload = {
|
|
3004
3004
|
name: user_var2,
|
|
3005
3005
|
is_completed: true
|
|
@@ -3384,7 +3384,7 @@ var RIVIA_TOUR = function() {
|
|
|
3384
3384
|
}
|
|
3385
3385
|
return { loadTips, playTour, endTour, STATE };
|
|
3386
3386
|
}();
|
|
3387
|
-
async function
|
|
3387
|
+
async function Tours(tourId, userId) {
|
|
3388
3388
|
if (!sessionStorage.getItem("rivia_tour_state")) {
|
|
3389
3389
|
RIVIA_TOUR.loadTips(tourId, userId).then(() => {
|
|
3390
3390
|
try {
|
|
@@ -3394,7 +3394,7 @@ async function tours(tourId, userId) {
|
|
|
3394
3394
|
});
|
|
3395
3395
|
}
|
|
3396
3396
|
}
|
|
3397
|
-
var rivia_tour_default =
|
|
3397
|
+
var rivia_tour_default = Tours;
|
|
3398
3398
|
|
|
3399
3399
|
// src/utils/banner.js
|
|
3400
3400
|
function injectBanner(banner = {}, opts = {}, userId, bannerId) {
|
|
@@ -3402,7 +3402,7 @@ function injectBanner(banner = {}, opts = {}, userId, bannerId) {
|
|
|
3402
3402
|
let uploadVisitedPagesInBackground2 = function(bannerId2) {
|
|
3403
3403
|
console.log("Uploading visited pages in background for banner ID: and user_var:", userId);
|
|
3404
3404
|
let user_var2 = userId;
|
|
3405
|
-
const backendUrl22 = `
|
|
3405
|
+
const backendUrl22 = `https://demoapi.rivia.ai/banners_clients/${bannerId2}`;
|
|
3406
3406
|
try {
|
|
3407
3407
|
const payload = {
|
|
3408
3408
|
name: user_var2,
|
|
@@ -3613,7 +3613,7 @@ async function Banner(bannerId, userId) {
|
|
|
3613
3613
|
if (!userId)
|
|
3614
3614
|
return;
|
|
3615
3615
|
try {
|
|
3616
|
-
const response = await fetch(`
|
|
3616
|
+
const response = await fetch(`https://demoapi.rivia.ai/banners2/${bannerId}`);
|
|
3617
3617
|
if (!response.ok) {
|
|
3618
3618
|
if (response.status === 404) {
|
|
3619
3619
|
console.warn("Invalid Banner id");
|
|
@@ -3639,11 +3639,11 @@ var banner_default = Banner;
|
|
|
3639
3639
|
// src/utils/index.js
|
|
3640
3640
|
if (typeof window !== "undefined") {
|
|
3641
3641
|
window.Checklist = rivia_default;
|
|
3642
|
-
window.
|
|
3642
|
+
window.Tours = rivia_tour_default;
|
|
3643
3643
|
window.Banner = banner_default;
|
|
3644
3644
|
}
|
|
3645
3645
|
export {
|
|
3646
3646
|
banner_default as Banner,
|
|
3647
3647
|
rivia_default as Checklist,
|
|
3648
|
-
rivia_tour_default as
|
|
3648
|
+
rivia_tour_default as Tours
|
|
3649
3649
|
};
|
package/index.d.ts
CHANGED