feat: add @tower/types shared package
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "@tower/types",
|
||||
"version": "0.0.1",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "tsc --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.7.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from './message';
|
||||
@@ -0,0 +1,40 @@
|
||||
export type Platform = 'whatsapp' | 'telegram' | 'discord';
|
||||
|
||||
export type MessageStatus =
|
||||
| 'PENDING'
|
||||
| 'APPROVED'
|
||||
| 'REJECTED'
|
||||
| 'DISTRIBUTED'
|
||||
| 'ARCHIVED';
|
||||
|
||||
export type ApprovalDecision = 'APPROVED' | 'REJECTED';
|
||||
|
||||
export interface CanonicalMessage {
|
||||
messageId: string;
|
||||
platform: Platform;
|
||||
platformMsgId: string;
|
||||
sourceGroupId: string;
|
||||
senderJid: string;
|
||||
senderName?: string;
|
||||
content: string;
|
||||
mediaUrl?: string;
|
||||
tags: string[];
|
||||
status: MessageStatus;
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export interface Group {
|
||||
id: string;
|
||||
platform: Platform;
|
||||
platformId: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
export interface SyncRoute {
|
||||
id: string;
|
||||
sourceGroupId: string;
|
||||
targetGroupId: string;
|
||||
isActive: boolean;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user