@automagik/omni 2.260421.6 → 2.260422.1

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 CHANGED
@@ -113804,7 +113804,7 @@ import { fileURLToPath } from "url";
113804
113804
  // package.json
113805
113805
  var package_default = {
113806
113806
  name: "@automagik/omni",
113807
- version: "2.260421.6",
113807
+ version: "2.260422.1",
113808
113808
  description: "LLM-optimized CLI for Omni",
113809
113809
  type: "module",
113810
113810
  bin: {
@@ -224451,7 +224451,7 @@ var init_sentry_scrub = __esm(() => {
224451
224451
  var require_package8 = __commonJS((exports, module) => {
224452
224452
  module.exports = {
224453
224453
  name: "@omni/api",
224454
- version: "2.260421.6",
224454
+ version: "2.260422.1",
224455
224455
  type: "module",
224456
224456
  exports: {
224457
224457
  ".": {
@@ -236782,7 +236782,7 @@ function validatePgserveDataDir(config4) {
236782
236782
  }
236783
236783
  function isAddressInUse(error2) {
236784
236784
  const msg = error2 instanceof Error ? error2.message : String(error2);
236785
- return msg.includes("EADDRINUSE") || msg.includes("address already in use") || msg.includes("Failed to listen on");
236785
+ return msg.includes("EADDRINUSE") || msg.includes("address already in use") || msg.includes("Failed to listen on") || msg.includes("Failed to listen at");
236786
236786
  }
236787
236787
  function buildDatabaseUrl(port) {
236788
236788
  return `postgresql://postgres:postgres@localhost:${port}/omni`;
@@ -363740,7 +363740,19 @@ function resolveContactName2(chat2, contactNames) {
363740
363740
  }
363741
363741
  return;
363742
363742
  }
363743
- var chatsRoutes, ChatTypeSchema, listQuerySchema6, createChatSchema, updateChatSchema, addParticipantSchema, updateParticipantRoleSchema, chatChannelActionSchema, muteActionSchema, labelBodySchema, markChatReadSchema, disappearingSchema, DISAPPEARING_DURATIONS, syncNamesSchema, clearSessionSchema;
363743
+ var chatsRoutes, ChatTypeSchema, listQuerySchema6, createChatSchema, updateChatSchema, addParticipantSchema, updateParticipantRoleSchema, chatChannelActionSchema, muteActionSchema, labelBodySchema, optionalDateParam = (paramName) => exports_external.string().optional().transform((v2, ctx) => {
363744
+ if (v2 === undefined || v2 === "")
363745
+ return;
363746
+ const parsed = new Date(v2);
363747
+ if (Number.isNaN(parsed.getTime())) {
363748
+ ctx.addIssue({
363749
+ code: exports_external.ZodIssueCode.custom,
363750
+ message: `invalid ${paramName} parameter: expected ISO 8601 date string, got "${v2}"`
363751
+ });
363752
+ return exports_external.NEVER;
363753
+ }
363754
+ return parsed;
363755
+ }), listMessagesQuerySchema, markChatReadSchema, disappearingSchema, DISAPPEARING_DURATIONS, syncNamesSchema, clearSessionSchema;
363744
363756
  var init_chats2 = __esm(() => {
363745
363757
  init_dist6();
363746
363758
  init_src();
@@ -363991,17 +364003,20 @@ var init_chats2 = __esm(() => {
363991
364003
  const participant = await services.chats.updateParticipantRole(chatId, platformUserId, role);
363992
364004
  return c.json({ data: participant });
363993
364005
  });
363994
- chatsRoutes.get("/:id/messages", async (c) => {
364006
+ listMessagesQuerySchema = exports_external.object({
364007
+ limit: exports_external.coerce.number().int().min(1).max(1000).default(100),
364008
+ before: optionalDateParam("before"),
364009
+ after: optionalDateParam("after"),
364010
+ mediaOnly: exports_external.string().optional().transform((v2) => v2 === "true")
364011
+ });
364012
+ chatsRoutes.get("/:id/messages", zValidator("query", listMessagesQuerySchema), async (c) => {
363995
364013
  const chatId = c.req.param("id");
363996
- const limit2 = Number.parseInt(c.req.query("limit") ?? "100", 10);
363997
- const before = c.req.query("before");
363998
- const after = c.req.query("after");
363999
- const mediaOnly = c.req.query("mediaOnly") === "true";
364014
+ const { limit: limit2, before, after, mediaOnly } = c.req.valid("query");
364000
364015
  const services = c.get("services");
364001
364016
  const messages4 = await services.messages.getChatMessages(chatId, {
364002
364017
  limit: limit2,
364003
- before: before ? new Date(before) : undefined,
364004
- after: after ? new Date(after) : undefined,
364018
+ before,
364019
+ after,
364005
364020
  mediaOnly
364006
364021
  });
364007
364022
  return c.json({ items: messages4 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/omni",
3
- "version": "2.260421.6",
3
+ "version": "2.260422.1",
4
4
  "description": "LLM-optimized CLI for Omni",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,14 +36,14 @@
36
36
  "qrcode-terminal": "^0.12.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@omni/api": "2.260421.5",
40
- "@omni/channel-discord": "2.260421.5",
41
- "@omni/channel-sdk": "2.260421.5",
42
- "@omni/channel-slack": "2.260421.5",
43
- "@omni/channel-telegram": "2.260421.5",
44
- "@omni/channel-whatsapp": "2.260421.5",
45
- "@omni/core": "2.260421.5",
46
- "@omni/sdk": "2.260421.5",
39
+ "@omni/api": "2.260421.6",
40
+ "@omni/channel-discord": "2.260421.6",
41
+ "@omni/channel-sdk": "2.260421.6",
42
+ "@omni/channel-slack": "2.260421.6",
43
+ "@omni/channel-telegram": "2.260421.6",
44
+ "@omni/channel-whatsapp": "2.260421.6",
45
+ "@omni/core": "2.260421.6",
46
+ "@omni/sdk": "2.260421.6",
47
47
  "@types/node": "^22.10.3",
48
48
  "@types/qrcode-terminal": "^0.12.2",
49
49
  "typescript": "^5.7.3"