New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@chatally/core

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chatally/core - npm Package Compare versions

Comparing version
0.0.5
to
0.0.6
+7
-1
.turbo/turbo-lint.log
> @chatally/core@0.0.5 lint
> @chatally/core@0.0.6 lint
> eslint .

@@ -8,1 +8,7 @@

}
/home/runner/work/chatally/chatally/packages/core/lib/messages.d.ts
46:20 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
✖ 1 problem (0 errors, 1 warning)
+4
-4
> @chatally/core@0.0.5 test
> @chatally/core@0.0.6 test
> vitest run

@@ -8,8 +8,8 @@

✓ lib/application.test.js  (7 tests) 10ms
✓ lib/application.test.js  (7 tests) 11ms
 Test Files  1 passed (1)
 Tests  7 passed (7)
 Start at  08:12:45
 Duration  609ms (transform 121ms, setup 0ms, collect 135ms, tests 10ms, environment 0ms, prepare 123ms)
 Start at  14:32:46
 Duration  971ms (transform 218ms, setup 0ms, collect 221ms, tests 11ms, environment 0ms, prepare 214ms)
# @chatally/core
## 0.0.6
### Patch Changes
- cd44088: WhatsApp Cloud server implementation
## 0.0.5

@@ -4,0 +10,0 @@

@@ -46,10 +46,12 @@ import { BaseLogger, NoLogger } from "@chatally/logger";

*
* @param {Object} [options={}] Optional options
* @param {Object} [options={}]
* @param {D} [options.data]
* Arbitrary data to put into the context for each request
* [Optional] Arbitrary data to put into the context for each request
* [`default=undefined`]
* @param {import("@chatally/logger").Logger | boolean} [options.log]
* Your logger or flag if you want to use a default logger,
* default is the BaseLogger
* [Optional] Custom logger or flag if you want to use a default logger
* [`default=new BaseLogger()`]
* @param {boolean} [options.dev]
* Run in development mode
* [Optional] Flag to run application in development mode
* [`default=false`]
*/

@@ -72,3 +74,3 @@ constructor(options = {}) {

/**
* Register a middleware function
* Register a middleware function or a server
*

@@ -89,2 +91,5 @@ * Middlewares are executed in order of registration, but can `await next()`

m.dispatch = this.dispatch;
if (m.log === undefined || m.log === true) {
m.log = this.#log.child({ name: m.name });
}
this.#servers.push(m);

@@ -91,0 +96,0 @@ this.#log.info("Registered server '%s'", name);

@@ -1,9 +0,65 @@

export type Message = Text | Image | Audio;
export type Message =
| Audio
| Buttons
| Custom
| Document
| Image
| Location
| Menu
| Reaction
| Select
| Text
| Video;
export type Text = {
readonly type: "text";
export type Action = {
id: string;
title: string;
description?: string;
};
export type Audio = {
readonly type: "audio";
readonly audio: {
/** Location of audio data */
url: string;
/** MIME type */
mimeType: string;
/** [Optional] Caption */
caption?: string;
/** [Optional] transcript of the audio */
transcript?: string;
};
};
export type Buttons = {
readonly type: "buttons";
/** The content of the message */
readonly text: string;
readonly buttons: {
text: string;
actions: Action[];
};
};
export type Custom = {
readonly type: "custom";
readonly schema: string;
readonly custom: any;
};
export type Document = {
readonly type: "document";
readonly document: {
/** Location of document data */
url: string;
/** MIME type */
mimeType: string;
/** [Optional] Caption */
caption?: string;
/** [Optional] Name for the file on the device. */
filename?: string;
/** [Optional] description of the document */
description?: string;
};
};
export type Image = {

@@ -14,15 +70,71 @@ readonly type: "image";

url: string;
/** MIME type */
mimeType: string;
/** [Optional] Caption */
caption?: string;
/** [Optional] Image description */
description?: string;
};
};
export type Audio = {
readonly type: "audio";
readonly audio: {
/** Location of audio data */
export type Location = {
readonly type: "location";
readonly location: {
/** Longitude of the location. */
longitude: number;
/** Latitude of the location. */
latitude: number;
/** Name of the location. */
name?: string;
/** Address of the location. */
address?: string;
};
};
export type Menu = {
readonly type: "menu";
/** The content of the message */
readonly menu: {
title: string;
text: string;
sections: Array<{
title?: string;
actions: Action[];
}>;
};
};
export type Reaction = {
readonly type: "reaction";
readonly reaction: {
/** The ID of the message the customer reacted to. */
replyTo: string;
/** The emoji the customer reacted with. */
emoji: string;
};
};
export type Select = {
readonly type: "select";
readonly select: Action;
};
export type Text = {
readonly type: "text";
/** The content of the message */
readonly text: string;
};
export type Video = {
readonly type: "video";
readonly video: {
/** Location of video data */
url: string;
/** [Optional] transcript of the audio */
/** MIME type */
mimeType: string;
/** [Optional] Caption */
caption?: string;
/** [Optional] transcript of the video */
transcript?: string;
};
};

@@ -15,2 +15,6 @@ /**

* @property {Dispatch} dispatch Registers the application as dispatcher
* @property {import("@chatally/logger").Logger | boolean | undefined} log
* The logger to use during runtime. Set this explicitly to false or
* NoLogger, if the registered server shall not log, otherwise the
* application will register a child logger
* @property {() => void} listen Starts the server

@@ -17,0 +21,0 @@ */

@@ -7,9 +7,50 @@ /**

switch (msg.type) {
case "audio":
return (
msg.audio.transcript ||
msg.audio.caption ||
`audio: ${msg.audio.url} (${msg.audio.mimeType})`
);
case "buttons":
return (
msg.buttons.text ||
msg.buttons.actions.map((a) => a.title).join(", ") ||
"<buttons>"
);
case "custom":
return "custom:" + JSON.stringify(msg.custom);
case "document":
return (
msg.document.description ||
msg.document.caption ||
msg.document.filename ||
"<document>"
);
case "image":
return (
msg.image.description ||
msg.image.caption ||
`image: ${msg.image.url} (${msg.image.mimeType}))`
);
case "location":
return (
msg.location.name ||
msg.location.address ||
`location: lon ${msg.location.longitude} lat ${msg.location.latitude}`
);
case "menu":
return `${msg.menu.title}: ${msg.menu.text}`;
case "reaction":
return msg.reaction.emoji;
case "select":
return `${msg.select.id}: ${msg.select.title}`;
case "text":
return msg.text;
case "image":
return msg.image.caption || "<image>";
case "audio":
return msg.audio.transcript || "<audio>";
case "video":
return (
msg.video.transcript ||
msg.video.caption ||
`video: ${msg.video.url} (${msg.video.mimeType})`
);
}
}
{
"name": "@chatally/core",
"version": "0.0.5",
"version": "0.0.6",
"description": "ChatAlly Core Modules",

@@ -5,0 +5,0 @@ "license": "MIT",