bertrand 0.24.0 → 0.25.0

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.
@@ -19,7 +19,7 @@
19
19
  } catch (e) {}
20
20
  })();
21
21
  </script>
22
- <script type="module" crossorigin src="/assets/index-DM4zHgCh.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-BDGI5s-V.js"></script>
23
23
  <link rel="stylesheet" crossorigin href="/assets/index-BXNZ0sJ0.css">
24
24
  </head>
25
25
  <body>
@@ -893,11 +893,10 @@ function parseSessionName(input) {
893
893
  }
894
894
 
895
895
  // src/db/queries/sessions.ts
896
- function getSession(id) {
897
- return getDb().select().from(sessions).where(eq2(sessions.id, id)).get();
896
+ function getSession(id, db = getDb()) {
897
+ return db.select().from(sessions).where(eq2(sessions.id, id)).get();
898
898
  }
899
- function getAllSessions(opts) {
900
- const db = getDb();
899
+ function selectSessions(db, opts) {
901
900
  const query = db.select({ session: sessions, categoryPath: categories.path }).from(sessions).innerJoin(categories, eq2(sessions.categoryId, categories.id));
902
901
  if (opts?.excludeArchived) {
903
902
  return query.where(inArray(sessions.status, [
@@ -908,6 +907,9 @@ function getAllSessions(opts) {
908
907
  }
909
908
  return query.all();
910
909
  }
910
+ function getAllSessions(opts) {
911
+ return selectSessions(getDb(), opts);
912
+ }
911
913
  function updateSessionStatus(id, status) {
912
914
  return getDb().update(sessions).set({ status, updatedAt: sql2`(datetime('now'))` }).where(eq2(sessions.id, id)).returning().get();
913
915
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bertrand",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },