mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
chore: refactor clientService
This commit is contained in:
parent
3f942e2507
commit
f3e4af798a
@ -1,7 +1,7 @@
|
||||
import { logger } from '@pockethost/common'
|
||||
import { clientService } from './clientService/clientService'
|
||||
import { DEBUG, PH_BIN_CACHE, PUBLIC_PB_SUBDOMAIN } from './constants'
|
||||
import { backupService } from './services/BackupService'
|
||||
import { clientService } from './services/clientService/clientService'
|
||||
import { ftpService } from './services/FtpService/FtpService'
|
||||
import { instanceService } from './services/InstanceService'
|
||||
import { pocketbase } from './services/PocketBaseService'
|
||||
|
@ -14,8 +14,8 @@ import {
|
||||
RpcCommands,
|
||||
} from '@pockethost/common'
|
||||
import Bottleneck from 'bottleneck'
|
||||
import { clientService } from '../clientService/clientService'
|
||||
import { backupInstance } from '../util/backupInstance'
|
||||
import { clientService } from './clientService/clientService'
|
||||
import { rpcService } from './RpcService'
|
||||
|
||||
export const backupService = mkSingleton(async () => {
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { logger, mkSingleton } from '@pockethost/common'
|
||||
import { readFileSync } from 'fs'
|
||||
import { FtpSrv } from 'ftp-srv'
|
||||
import { clientService } from '../../clientService/clientService'
|
||||
import { createPbClient } from '../../clientService/PbClient'
|
||||
import {
|
||||
PH_FTP_PASV_IP,
|
||||
PH_FTP_PASV_PORT_MAX,
|
||||
@ -11,6 +9,8 @@ import {
|
||||
SSL_CERT,
|
||||
SSL_KEY,
|
||||
} from '../../constants'
|
||||
import { clientService } from '../clientService/clientService'
|
||||
import { createPbClient } from '../clientService/PbClient'
|
||||
import { PhFs } from './PhFs'
|
||||
|
||||
export type FtpConfig = {}
|
||||
|
@ -3,8 +3,8 @@ import { existsSync, mkdirSync } from 'fs'
|
||||
import { FileStat, FileSystem, FtpConnection } from 'ftp-srv'
|
||||
import { join } from 'path'
|
||||
import { Readable } from 'stream'
|
||||
import { PocketbaseClientApi } from '../../clientService/PbClient'
|
||||
import { DAEMON_PB_DATA_DIR } from '../../constants'
|
||||
import { PocketbaseClientApi } from '../clientService/PbClient'
|
||||
import {
|
||||
FOLDER_NAMES,
|
||||
isFolder,
|
||||
|
@ -14,7 +14,6 @@ import { forEachRight, map } from '@s-libs/micro-dash'
|
||||
import Bottleneck from 'bottleneck'
|
||||
import getPort from 'get-port'
|
||||
import { AsyncReturnType } from 'type-fest'
|
||||
import { clientService } from '../clientService/clientService'
|
||||
import {
|
||||
DAEMON_PB_IDLE_TTL,
|
||||
DAEMON_PB_PORT_BASE,
|
||||
@ -24,6 +23,7 @@ import {
|
||||
import { mkInternalUrl } from '../util/internal'
|
||||
import { now } from '../util/now'
|
||||
import { safeCatch } from '../util/promiseHelper'
|
||||
import { clientService } from './clientService/clientService'
|
||||
import { pocketbase, PocketbaseProcess } from './PocketBaseService'
|
||||
import { rpcService } from './RpcService'
|
||||
|
||||
|
@ -13,7 +13,7 @@ import Bottleneck from 'bottleneck'
|
||||
import { default as knexFactory } from 'knex'
|
||||
import pocketbaseEs from 'pocketbase'
|
||||
import { AsyncReturnType, JsonObject } from 'type-fest'
|
||||
import { clientService } from '../clientService/clientService'
|
||||
import { clientService } from './clientService/clientService'
|
||||
|
||||
export type RpcServiceApi = AsyncReturnType<typeof rpcService>
|
||||
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
InstanceId,
|
||||
logger,
|
||||
} from '@pockethost/common'
|
||||
import { safeCatch } from '../util/promiseHelper'
|
||||
import { safeCatch } from '../../util/promiseHelper'
|
||||
import { MixinContext } from './PbClient'
|
||||
|
||||
export type BackupApi = ReturnType<typeof createBackupMixin>
|
@ -10,7 +10,7 @@ import {
|
||||
import { reduce } from '@s-libs/micro-dash'
|
||||
import Bottleneck from 'bottleneck'
|
||||
import { endOfMonth, startOfMonth } from 'date-fns'
|
||||
import { safeCatch } from '../util/promiseHelper'
|
||||
import { safeCatch } from '../../util/promiseHelper'
|
||||
import { MixinContext } from './PbClient'
|
||||
|
||||
export type InstanceApi = ReturnType<typeof createInstanceMixin>
|
@ -4,7 +4,7 @@ import {
|
||||
logger,
|
||||
pocketNow,
|
||||
} from '@pockethost/common'
|
||||
import { safeCatch } from '../util/promiseHelper'
|
||||
import { safeCatch } from '../../util/promiseHelper'
|
||||
import { InstanceApi } from './InstanceMIxin'
|
||||
import { MixinContext } from './PbClient'
|
||||
|
@ -5,9 +5,9 @@ import {
|
||||
default as PocketBase,
|
||||
default as pocketbaseEs,
|
||||
} from 'pocketbase'
|
||||
import { DAEMON_PB_DATA_DIR, PUBLIC_PB_SUBDOMAIN } from '../constants'
|
||||
import { Collection_Serialized } from '../migrate/schema'
|
||||
import { safeCatch } from '../util/promiseHelper'
|
||||
import { DAEMON_PB_DATA_DIR, PUBLIC_PB_SUBDOMAIN } from '../../constants'
|
||||
import { Collection_Serialized } from '../../migrate/schema'
|
||||
import { safeCatch } from '../../util/promiseHelper'
|
||||
import { createBackupMixin } from './BackupMixin'
|
||||
import { createInstanceMixin } from './InstanceMIxin'
|
||||
import { createInvocationMixin } from './InvocationMixin'
|
@ -1,6 +1,6 @@
|
||||
import { RpcFields, RpcStatus, RPC_COLLECTION } from '@pockethost/common'
|
||||
import { JsonObject } from 'type-fest'
|
||||
import { safeCatch } from '../util/promiseHelper'
|
||||
import { safeCatch } from '../../util/promiseHelper'
|
||||
import { MixinContext } from './PbClient'
|
||||
|
||||
export enum RecordSubscriptionActions {
|
@ -5,7 +5,7 @@ import {
|
||||
PUBLIC_PB_DOMAIN,
|
||||
PUBLIC_PB_PROTOCOL,
|
||||
PUBLIC_PB_SUBDOMAIN,
|
||||
} from '../constants'
|
||||
} from '../../constants'
|
||||
import { createPbClient } from './PbClient'
|
||||
|
||||
export const clientService = mkSingleton(async (url: string) => {
|
Loading…
x
Reference in New Issue
Block a user