@vue-skuilder/db 0.1.13-8 → 0.1.13

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.
@@ -1,4 +1,4 @@
1
- import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './userDB-aPdG17B4.js';
1
+ import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './userDB-DNa0XPtn.js';
2
2
 
3
3
  /**
4
4
  * Main factory interface for data access
@@ -1,4 +1,4 @@
1
- import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './userDB-zzBUpIzY.mjs';
1
+ import { U as UserDBInterface, a as UserDBReader, C as CourseDBInterface, b as CoursesDBInterface, c as ClassroomDBInterface, A as AdminDBInterface } from './userDB-BqwxtJ_7.mjs';
2
2
 
3
3
  /**
4
4
  * Main factory interface for data access
@@ -1,7 +1,7 @@
1
1
  import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-6ettoclI.mjs';
2
2
  import { Moment } from 'moment';
3
- import { A as AdminDBInterface, h as AssignedContent, i as StudyContentSource, j as StudentClassroomDBInterface, U as UserDBInterface, f as StudySessionReviewItem, g as ScheduledCard, S as StudySessionNewItem, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, k as StudySessionItem } from '../../userDB-zzBUpIzY.mjs';
4
- export { p as ContentSourceID, l as StudySessionFailedItem, m as StudySessionFailedNewItem, n as StudySessionFailedReviewItem, q as getStudySource, o as isReview } from '../../userDB-zzBUpIzY.mjs';
3
+ import { A as AdminDBInterface, h as AssignedContent, i as StudyContentSource, j as StudentClassroomDBInterface, U as UserDBInterface, f as StudySessionReviewItem, g as ScheduledCard, S as StudySessionNewItem, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, k as StudySessionItem } from '../../userDB-BqwxtJ_7.mjs';
4
+ export { p as ContentSourceID, l as StudySessionFailedItem, m as StudySessionFailedNewItem, n as StudySessionFailedReviewItem, q as getStudySource, o as isReview } from '../../userDB-BqwxtJ_7.mjs';
5
5
  import * as _vue_skuilder_common from '@vue-skuilder/common';
6
6
  import { ClassroomConfig, DataShape, CourseElo, CourseConfig as CourseConfig$1 } from '@vue-skuilder/common';
7
7
  import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.mjs';
@@ -1,7 +1,7 @@
1
1
  import { T as TagStub, a as Tag, S as SkuilderCourseData, Q as QualifiedCardID } from '../../types-legacy-6ettoclI.js';
2
2
  import { Moment } from 'moment';
3
- import { A as AdminDBInterface, h as AssignedContent, i as StudyContentSource, j as StudentClassroomDBInterface, U as UserDBInterface, f as StudySessionReviewItem, g as ScheduledCard, S as StudySessionNewItem, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, k as StudySessionItem } from '../../userDB-aPdG17B4.js';
4
- export { p as ContentSourceID, l as StudySessionFailedItem, m as StudySessionFailedNewItem, n as StudySessionFailedReviewItem, q as getStudySource, o as isReview } from '../../userDB-aPdG17B4.js';
3
+ import { A as AdminDBInterface, h as AssignedContent, i as StudyContentSource, j as StudentClassroomDBInterface, U as UserDBInterface, f as StudySessionReviewItem, g as ScheduledCard, S as StudySessionNewItem, T as TeacherClassroomDBInterface, b as CoursesDBInterface, C as CourseDBInterface, d as CourseInfo, D as DataLayerResult, e as ContentNavigationStrategyData, k as StudySessionItem } from '../../userDB-DNa0XPtn.js';
4
+ export { p as ContentSourceID, l as StudySessionFailedItem, m as StudySessionFailedNewItem, n as StudySessionFailedReviewItem, q as getStudySource, o as isReview } from '../../userDB-DNa0XPtn.js';
5
5
  import * as _vue_skuilder_common from '@vue-skuilder/common';
6
6
  import { ClassroomConfig, DataShape, CourseElo, CourseConfig as CourseConfig$1 } from '@vue-skuilder/common';
7
7
  import { S as SyncStrategy, A as AccountCreationResult, a as AuthenticationResult } from '../../SyncStrategy-CyATpyLQ.js';
@@ -2068,18 +2068,37 @@ function accomodateGuest() {
2068
2068
  };
2069
2069
  function generateUUID() {
2070
2070
  logger.log("[funnel] Inside generateUUID()");
2071
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
2072
+ const uuid2 = crypto.randomUUID();
2073
+ logger.log("[funnel] Generated UUID using crypto.randomUUID():", uuid2);
2074
+ return uuid2;
2075
+ }
2076
+ if (typeof crypto !== "undefined" && typeof crypto.getRandomValues === "function") {
2077
+ const bytes = new Uint8Array(16);
2078
+ crypto.getRandomValues(bytes);
2079
+ bytes[6] = bytes[6] & 15 | 64;
2080
+ bytes[8] = bytes[8] & 63 | 128;
2081
+ const uuid2 = [
2082
+ Array.from(bytes.slice(0, 4)).map((b) => b.toString(16).padStart(2, "0")).join(""),
2083
+ Array.from(bytes.slice(4, 6)).map((b) => b.toString(16).padStart(2, "0")).join(""),
2084
+ Array.from(bytes.slice(6, 8)).map((b) => b.toString(16).padStart(2, "0")).join(""),
2085
+ Array.from(bytes.slice(8, 10)).map((b) => b.toString(16).padStart(2, "0")).join(""),
2086
+ Array.from(bytes.slice(10, 16)).map((b) => b.toString(16).padStart(2, "0")).join("")
2087
+ ].join("-");
2088
+ logger.log("[funnel] Generated UUID using crypto.getRandomValues():", uuid2);
2089
+ return uuid2;
2090
+ }
2091
+ logger.warn("[funnel] crypto API not available, using timestamp-based UUID (NOT SECURE)");
2071
2092
  let d = (/* @__PURE__ */ new Date()).getTime();
2072
- logger.log("[funnel] Date timestamp:", d);
2073
2093
  if (typeof performance !== "undefined" && typeof performance.now === "function") {
2074
2094
  d += performance.now();
2075
- logger.log("[funnel] After adding performance.now():", d);
2076
2095
  }
2077
2096
  const uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
2078
2097
  const r = (d + Math.random() * 16) % 16 | 0;
2079
2098
  d = Math.floor(d / 16);
2080
2099
  return (c === "x" ? r : r & 3 | 8).toString(16);
2081
2100
  });
2082
- logger.log("[funnel] Generated UUID inside function:", uuid);
2101
+ logger.log("[funnel] Generated UUID (fallback):", uuid);
2083
2102
  return uuid;
2084
2103
  }
2085
2104
  }