diff --git a/packages/types/package.json b/packages/types/package.json new file mode 100644 index 0000000..b52f7dd --- /dev/null +++ b/packages/types/package.json @@ -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" + } +} diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts new file mode 100644 index 0000000..f545587 --- /dev/null +++ b/packages/types/src/index.ts @@ -0,0 +1 @@ +export * from './message'; diff --git a/packages/types/src/message.ts b/packages/types/src/message.ts new file mode 100644 index 0000000..af2ad21 --- /dev/null +++ b/packages/types/src/message.ts @@ -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; +} diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json new file mode 100644 index 0000000..792172f --- /dev/null +++ b/packages/types/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src"] +}