import db in ui project

This commit is contained in:
geekgeekrun
2024-03-17 23:45:04 +08:00
parent 26cf20addb
commit 3967c26ebc
4 changed files with 10 additions and 3 deletions

View File

@@ -30,6 +30,7 @@
"@geekgeekrun/dingtalk-plugin": "workspace:*",
"@geekgeekrun/geek-auto-start-chat-with-boss": "workspace:*",
"@geekgeekrun/launch-bosszhipin-login-page-with-preload-extension": "workspace:*",
"@geekgeekrun/sqlite-plugin": "workspace:*",
"@geekgeekrun/utils": "workspace:*",
"@puppeteer/browsers": "^2.0.0",
"JSONStream": "^1.3.5",

View File

@@ -1,5 +1,3 @@
import path from 'node:path'
import * as url from 'url'
import { sleep } from '@geekgeekrun/utils/sleep.mjs'
import childProcess from 'node:child_process'
import { AUTO_CHAT_ERROR_EXIT_CODE } from '../../../common/enums/auto-start-chat'

View File

@@ -8,10 +8,14 @@ import { getAnyAvailablePuppeteerExecutable } from '../CHECK_AND_DOWNLOAD_DEPEND
import { sleep } from '@geekgeekrun/utils/sleep.mjs'
import { AUTO_CHAT_ERROR_EXIT_CODE } from '../../../common/enums/auto-start-chat'
import SqlitePluginModule from '@geekgeekrun/sqlite-plugin'
const { default: SqlitePlugin } = SqlitePluginModule
const { groupRobotAccessToken: dingTalkAccessToken } = readConfigFile('dingtalk.json')
const initPlugins = (hooks) => {
new DingtalkPlugin(dingTalkAccessToken).apply(hooks)
new SqlitePlugin().apply(hooks)
}
let isParentProcessDisconnect = false
@@ -62,8 +66,9 @@ export const runAutoChat = async () => {
puppeteerLaunched: new SyncHook(),
pageLoaded: new SyncHook(),
cookieWillSet: new SyncHook(['cookies']),
userInfoResponse: new AsyncSeriesHook(['userInfo']),
newChatWillStartup: new AsyncSeriesHook(['positionInfoDetail']),
newChatStartup: new SyncHook(['positionInfoDetail']),
newChatStartup: new AsyncSeriesHook(['positionInfoDetail']),
noPositionFoundForCurrentJob: new SyncHook(),
noPositionFoundAfterTraverseAllJob: new SyncHook(),
errorEncounter: new SyncHook(['errorInfo'])

3
pnpm-lock.yaml generated
View File

@@ -103,6 +103,9 @@ importers:
'@geekgeekrun/launch-bosszhipin-login-page-with-preload-extension':
specifier: workspace:*
version: link:../launch-bosszhipin-login-page-with-preload-extension
'@geekgeekrun/sqlite-plugin':
specifier: workspace:*
version: link:../sqlite-plugin
'@geekgeekrun/utils':
specifier: workspace:*
version: link:../utils