rivia 0.0.59 → 0.0.61
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 +22 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -82,9 +82,9 @@ function Onboarding(topTitle = "Get Started", subtitle, completion = 0, checklis
|
|
|
82
82
|
user_var1 = "User_" + Math.random().toString(36).substring(2, 8);
|
|
83
83
|
sessionStorage.setItem(user_var, user_var1);
|
|
84
84
|
}
|
|
85
|
-
const backendUrl = `
|
|
85
|
+
const backendUrl = `https://demoapi.rivia.ai/clients/${checklist_id}/${user_var1}`;
|
|
86
86
|
async function getUserProgress22() {
|
|
87
|
-
const backendUrl2 = `
|
|
87
|
+
const backendUrl2 = `https://demoapi.rivia.ai/clients/${checklist_id}/${user_var1}`;
|
|
88
88
|
try {
|
|
89
89
|
const res = await fetch(backendUrl2, { credentials: "include" });
|
|
90
90
|
if (!res.ok) console.warn(`GET failed: ${res.status}`);
|
|
@@ -122,7 +122,7 @@ function Onboarding(topTitle = "Get Started", subtitle, completion = 0, checklis
|
|
|
122
122
|
}
|
|
123
123
|
storedVisited2 = sessionStorage.getItem("onboardingVisited");
|
|
124
124
|
async function getUserProgress22() {
|
|
125
|
-
const backendUrl2 = `
|
|
125
|
+
const backendUrl2 = `https://demoapi.rivia.ai/clients/${checklist_id}/${user_var1}`;
|
|
126
126
|
try {
|
|
127
127
|
const res = await fetch(backendUrl2, { credentials: "include" });
|
|
128
128
|
if (!res.ok) console.warn(`GET failed: ${res.status}`);
|
|
@@ -862,7 +862,7 @@ transform: translateY(-20%);
|
|
|
862
862
|
function uploadVisitedPagesInBackground(completed2, touched = false) {
|
|
863
863
|
let activeStepId2 = sessionStorage.getItem("activeStepId") || null;
|
|
864
864
|
let user_var22 = user_var;
|
|
865
|
-
const backendUrl22 = `
|
|
865
|
+
const backendUrl22 = `https://demoapi.rivia.ai/clients/${checklist_id}`;
|
|
866
866
|
try {
|
|
867
867
|
const payload = {
|
|
868
868
|
name: user_var22,
|
|
@@ -893,7 +893,7 @@ transform: translateY(-20%);
|
|
|
893
893
|
storedVisited2 = sessionStorage.getItem("onboardingVisited");
|
|
894
894
|
if (!storedVisited2 || storedVisited2 == "[]") {
|
|
895
895
|
async function getUserProgress22() {
|
|
896
|
-
const backendUrl2 = `
|
|
896
|
+
const backendUrl2 = `https://demoapi.rivia.ai/clients/${checklist_id}/${user_var}`;
|
|
897
897
|
try {
|
|
898
898
|
const res = await fetch(backendUrl2, { credentials: "include" });
|
|
899
899
|
if (!res.ok) console.warn(`GET failed: ${res.status}`);
|
|
@@ -1223,32 +1223,39 @@ function evaluateRule(rule, context) {
|
|
|
1223
1223
|
case "not_in":
|
|
1224
1224
|
return Array.isArray(rightValue) && !rightValue.includes(leftValue);
|
|
1225
1225
|
case "equals":
|
|
1226
|
-
|
|
1227
|
-
return new Date(leftValue).getTime() === new Date(rightValue).getTime();
|
|
1228
|
-
else
|
|
1229
|
-
return leftValue === rightValue;
|
|
1226
|
+
return leftValue === rightValue;
|
|
1230
1227
|
case "not_equals":
|
|
1231
1228
|
return leftValue != rightValue;
|
|
1232
1229
|
case "greater_than":
|
|
1233
|
-
if (
|
|
1230
|
+
if (rule.name == "sign_up_at")
|
|
1234
1231
|
return new Date(leftValue).getTime() > new Date(rightValue).getTime();
|
|
1235
1232
|
else
|
|
1236
1233
|
return leftValue > rightValue;
|
|
1237
1234
|
case "less_than":
|
|
1238
|
-
if (
|
|
1235
|
+
if (rule.name == "sign_up_at")
|
|
1239
1236
|
return new Date(leftValue).getTime() < new Date(rightValue).getTime();
|
|
1240
1237
|
else
|
|
1241
1238
|
return leftValue < rightValue;
|
|
1242
1239
|
case "greater_or_equals":
|
|
1243
|
-
if (
|
|
1240
|
+
if (rule.name == "sign_up_at")
|
|
1244
1241
|
return new Date(leftValue).getTime() >= new Date(rightValue).getTime();
|
|
1245
1242
|
else
|
|
1246
1243
|
return leftValue >= rightValue;
|
|
1247
1244
|
case "less_or_equals":
|
|
1248
|
-
if (
|
|
1245
|
+
if (rule.name == "sign_up_at")
|
|
1249
1246
|
return new Date(leftValue).getTime() <= new Date(rightValue).getTime();
|
|
1250
1247
|
else
|
|
1251
1248
|
return leftValue <= rightValue;
|
|
1249
|
+
case "is_empty":
|
|
1250
|
+
if (leftValue == "")
|
|
1251
|
+
return true;
|
|
1252
|
+
else
|
|
1253
|
+
return false;
|
|
1254
|
+
case "is_not_empty":
|
|
1255
|
+
if (leftValue != "")
|
|
1256
|
+
return true;
|
|
1257
|
+
else
|
|
1258
|
+
return false;
|
|
1252
1259
|
default:
|
|
1253
1260
|
return false;
|
|
1254
1261
|
}
|
|
@@ -1283,7 +1290,7 @@ async function Checklist(workspace_id, obj) {
|
|
|
1283
1290
|
console.log("");
|
|
1284
1291
|
try {
|
|
1285
1292
|
let doesRouteMatch2 = function(routes) {
|
|
1286
|
-
if (!Array.isArray(routes)) return
|
|
1293
|
+
if (!Array.isArray(routes)) return true;
|
|
1287
1294
|
const currentPath2 = window.location.pathname.toLowerCase();
|
|
1288
1295
|
return routes.some((route) => {
|
|
1289
1296
|
if (!route) return false;
|
|
@@ -1311,7 +1318,7 @@ async function Checklist(workspace_id, obj) {
|
|
|
1311
1318
|
};
|
|
1312
1319
|
var doesRouteMatch = doesRouteMatch2, escapeRegex = escapeRegex2, buildContext = buildContext2;
|
|
1313
1320
|
const res = await fetch(
|
|
1314
|
-
`
|
|
1321
|
+
`https://demoapi.rivia.ai/checklist_by_workspace2/${workspace_id}`,
|
|
1315
1322
|
{
|
|
1316
1323
|
method: "GET",
|
|
1317
1324
|
headers: { "Content-Type": "application/json" }
|