zele 0.3.15 → 0.3.17
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/README.md +113 -33
- package/dist/api-utils.d.ts +7 -0
- package/dist/api-utils.js +12 -0
- package/dist/api-utils.js.map +1 -1
- package/dist/auth.d.ts +71 -9
- package/dist/auth.js +187 -11
- package/dist/auth.js.map +1 -1
- package/dist/calendar-time.js +6 -0
- package/dist/calendar-time.js.map +1 -1
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/attachment.js +2 -0
- package/dist/commands/attachment.js.map +1 -1
- package/dist/commands/auth-cmd.js +104 -6
- package/dist/commands/auth-cmd.js.map +1 -1
- package/dist/commands/calendar.js +1 -1
- package/dist/commands/calendar.js.map +1 -1
- package/dist/commands/draft.js +9 -3
- package/dist/commands/draft.js.map +1 -1
- package/dist/commands/filter.d.ts +2 -0
- package/dist/commands/filter.js +64 -0
- package/dist/commands/filter.js.map +1 -0
- package/dist/commands/label.js +19 -9
- package/dist/commands/label.js.map +1 -1
- package/dist/commands/mail-actions.js +12 -2
- package/dist/commands/mail-actions.js.map +1 -1
- package/dist/commands/mail.js +194 -84
- package/dist/commands/mail.js.map +1 -1
- package/dist/commands/profile.js +25 -18
- package/dist/commands/profile.js.map +1 -1
- package/dist/db.js +24 -0
- package/dist/db.js.map +1 -1
- package/dist/generated/internal/class.js +2 -2
- package/dist/generated/internal/class.js.map +1 -1
- package/dist/generated/internal/prismaNamespace.d.ts +2 -0
- package/dist/generated/internal/prismaNamespace.js +2 -0
- package/dist/generated/internal/prismaNamespace.js.map +1 -1
- package/dist/generated/internal/prismaNamespaceBrowser.d.ts +2 -0
- package/dist/generated/internal/prismaNamespaceBrowser.js +2 -0
- package/dist/generated/internal/prismaNamespaceBrowser.js.map +1 -1
- package/dist/generated/models/Account.d.ts +97 -1
- package/dist/gmail-client.d.ts +42 -0
- package/dist/gmail-client.js +175 -9
- package/dist/gmail-client.js.map +1 -1
- package/dist/imap-smtp-client.d.ts +235 -0
- package/dist/imap-smtp-client.js +1225 -0
- package/dist/imap-smtp-client.js.map +1 -0
- package/dist/mail-tui.js +3 -2
- package/dist/mail-tui.js.map +1 -1
- package/dist/output.d.ts +2 -0
- package/dist/output.js +4 -0
- package/dist/output.js.map +1 -1
- package/package.json +9 -5
- package/schema.prisma +7 -5
- package/skills/zele/SKILL.md +141 -0
- package/src/api-utils.ts +13 -0
- package/src/auth.ts +283 -15
- package/src/calendar-time.test.ts +35 -0
- package/src/calendar-time.ts +5 -0
- package/src/cli.ts +6 -1
- package/src/commands/attachment.ts +1 -0
- package/src/commands/auth-cmd.ts +112 -6
- package/src/commands/calendar.ts +1 -1
- package/src/commands/draft.ts +7 -3
- package/src/commands/filter.ts +74 -0
- package/src/commands/label.ts +22 -11
- package/src/commands/mail-actions.ts +16 -3
- package/src/commands/mail.ts +207 -89
- package/src/commands/profile.ts +27 -17
- package/src/db.ts +28 -0
- package/src/generated/internal/class.ts +2 -2
- package/src/generated/internal/prismaNamespace.ts +2 -0
- package/src/generated/internal/prismaNamespaceBrowser.ts +2 -0
- package/src/generated/models/Account.ts +97 -1
- package/src/gmail-client.test.ts +155 -2
- package/src/gmail-client.ts +221 -16
- package/src/imap-smtp-client.ts +1381 -0
- package/src/mail-tui.tsx +3 -3
- package/src/output.ts +8 -1
- package/src/schema.sql +2 -0
package/src/mail-tui.tsx
CHANGED
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
useNavigation,
|
|
35
35
|
showFailureToast,
|
|
36
36
|
} from 'termcast'
|
|
37
|
-
// @ts-expect-error https://github.com/anomalyco/opentui/pull/614
|
|
38
37
|
import { useTerminalDimensions } from '@opentui/react'
|
|
39
38
|
import { useCachedPromise, useCachedState } from '@termcast/utils'
|
|
40
39
|
import { useState, useMemo, useCallback, useEffect } from 'react'
|
|
@@ -48,6 +47,7 @@ import {
|
|
|
48
47
|
type AuthStatus,
|
|
49
48
|
} from './auth.js'
|
|
50
49
|
import type { GmailClient, ThreadListItem, ThreadData } from './gmail-client.js'
|
|
50
|
+
import type { ImapSmtpClient } from './imap-smtp-client.js'
|
|
51
51
|
import { AuthError, ApiError, isTruthy } from './api-utils.js'
|
|
52
52
|
import {
|
|
53
53
|
renderEmailBody,
|
|
@@ -919,7 +919,7 @@ export default function Command() {
|
|
|
919
919
|
const handleBulkAction = useCallback(
|
|
920
920
|
async (
|
|
921
921
|
actionName: string,
|
|
922
|
-
fn: (client: GmailClient, ids: string[]) => Promise<void | Error>,
|
|
922
|
+
fn: (client: GmailClient | ImapSmtpClient, ids: string[]) => Promise<void | Error>,
|
|
923
923
|
) => {
|
|
924
924
|
if (selectedThreads.length === 0) return
|
|
925
925
|
|
|
@@ -1195,7 +1195,7 @@ export default function Command() {
|
|
|
1195
1195
|
<Action
|
|
1196
1196
|
title={thread.unread ? 'Mark as Read' : 'Mark as Unread'}
|
|
1197
1197
|
icon={thread.unread ? Icon.Eye : Icon.EyeDisabled}
|
|
1198
|
-
shortcut={{ modifiers: ['ctrl'], key: 'u' }}
|
|
1198
|
+
// shortcut={{ modifiers: ['ctrl'], key: 'u' }}
|
|
1199
1199
|
onAction={() => withMutation(async () => {
|
|
1200
1200
|
const { client } = await getClient([thread.account])
|
|
1201
1201
|
const result = thread.unread
|
package/src/output.ts
CHANGED
|
@@ -326,10 +326,17 @@ export function formatSender(sender: { name?: string; email: string }): string {
|
|
|
326
326
|
// Status indicators
|
|
327
327
|
// ---------------------------------------------------------------------------
|
|
328
328
|
|
|
329
|
-
export function formatFlags(item: {
|
|
329
|
+
export function formatFlags(item: {
|
|
330
|
+
unread?: boolean
|
|
331
|
+
starred?: boolean
|
|
332
|
+
hasAttachments?: boolean
|
|
333
|
+
inReplyTo?: string | null
|
|
334
|
+
}): string {
|
|
330
335
|
const parts: string[] = []
|
|
331
336
|
if (item.starred) parts.push('starred')
|
|
332
337
|
if (item.unread) parts.push('unread')
|
|
338
|
+
if (item.hasAttachments) parts.push('attachment')
|
|
339
|
+
if (item.inReplyTo) parts.push('reply')
|
|
333
340
|
return parts.join(', ')
|
|
334
341
|
}
|
|
335
342
|
|
package/src/schema.sql
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
CREATE TABLE IF NOT EXISTS "Account" (
|
|
3
3
|
"email" TEXT NOT NULL,
|
|
4
4
|
"appId" TEXT NOT NULL,
|
|
5
|
+
"accountType" TEXT NOT NULL DEFAULT 'google',
|
|
6
|
+
"capabilities" TEXT NOT NULL DEFAULT '',
|
|
5
7
|
"accountStatus" TEXT NOT NULL,
|
|
6
8
|
"tokens" TEXT NOT NULL,
|
|
7
9
|
"createdAt" DATETIME NOT NULL,
|