refactor(packages): rename @snowluma/bridge → @snowluma/protocol
The package previously named "bridge" houses the protocol-byte layer (OIDB cmds, msg-push decoders, highway uploaders, element-builder, event bus). The name "bridge" suggested transport/lifecycle, which it isn't — that role lives in core/hook and core/bridge/manager. Rename to match what's actually inside. This is a pure rename: zero logic changes, all 73 import sites updated mechanically and TS-verified. core/onebot dependencies key updated. ESLint override path adjusted for the moved oidb-services directory. Rename detection threshold: git log --find-renames=20% recommended when following history across this commit — content-replacement (@snowluma/bridge → @snowluma/protocol) dropped per-file similarity below git's default 50% on import-heavy files.
This commit is contained in:
238 files changed
+247
-284
No files matched your search
@@ -13,14 +13,14 @@ import type {
|
||||
GroupRequestInfo,
|
||||
QQGroupInfo,
|
||||
UserProfileInfo,
|
||||
} from '@snowluma/bridge/qq-info';
|
||||
import { FetchFriendListPage } from '@snowluma/bridge/oidb-services/contacts/fetch-friend-list-page';
|
||||
import { FetchGroupList } from '@snowluma/bridge/oidb-services/contacts/fetch-group-list';
|
||||
import { FetchGroupMemberListPage } from '@snowluma/bridge/oidb-services/contacts/fetch-group-member-list-page';
|
||||
import { FetchUserProfile } from '@snowluma/bridge/oidb-services/contacts/fetch-user-profile';
|
||||
import { FetchUserProfileByUid } from '@snowluma/bridge/oidb-services/contacts/fetch-user-profile-by-uid';
|
||||
import { FetchGroupRequests } from '@snowluma/bridge/oidb-services/contacts/fetch-group-requests';
|
||||
import { FetchDownloadRkeys } from '@snowluma/bridge/oidb-services/contacts/fetch-download-rkeys';
|
||||
} from '@snowluma/protocol/qq-info';
|
||||
import { FetchFriendListPage } from '@snowluma/protocol/oidb-services/contacts/fetch-friend-list-page';
|
||||
import { FetchGroupList } from '@snowluma/protocol/oidb-services/contacts/fetch-group-list';
|
||||
import { FetchGroupMemberListPage } from '@snowluma/protocol/oidb-services/contacts/fetch-group-member-list-page';
|
||||
import { FetchUserProfile } from '@snowluma/protocol/oidb-services/contacts/fetch-user-profile';
|
||||
import { FetchUserProfileByUid } from '@snowluma/protocol/oidb-services/contacts/fetch-user-profile-by-uid';
|
||||
import { FetchGroupRequests } from '@snowluma/protocol/oidb-services/contacts/fetch-group-requests';
|
||||
import { FetchDownloadRkeys } from '@snowluma/protocol/oidb-services/contacts/fetch-download-rkeys';
|
||||
|
||||
// ─── Helpers (previously in bridge-contacts.ts) ───────────────────
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
// ExtrasApi — facade over Tier-2 napcat-parity OIDB cmds (group
|
||||
// todo CRUD / stranger status decode / AI voice list + synthesis).
|
||||
// Every method is a one-line forwarder to a self-contained namespace
|
||||
// under @snowluma/bridge/oidb-services/extras.
|
||||
// under @snowluma/protocol/oidb-services/extras.
|
||||
|
||||
import type { MediaIndexNode } from './shared';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import { GroupTodo } from '@snowluma/bridge/oidb-services/extras/group-todo';
|
||||
import { GetStrangerStatus, type StrangerStatus as NamespaceStrangerStatus } from '@snowluma/bridge/oidb-services/extras/get-stranger-status';
|
||||
import { GroupTodo } from '@snowluma/protocol/oidb-services/extras/group-todo';
|
||||
import { GetStrangerStatus, type StrangerStatus as NamespaceStrangerStatus } from '@snowluma/protocol/oidb-services/extras/get-stranger-status';
|
||||
import {
|
||||
FetchAiVoiceList,
|
||||
type AiVoiceCategory as NamespaceAiVoiceCategory,
|
||||
} from '@snowluma/bridge/oidb-services/extras/fetch-ai-voice-list';
|
||||
import { FetchAiVoice } from '@snowluma/bridge/oidb-services/extras/fetch-ai-voice';
|
||||
} from '@snowluma/protocol/oidb-services/extras/fetch-ai-voice-list';
|
||||
import { FetchAiVoice } from '@snowluma/protocol/oidb-services/extras/fetch-ai-voice';
|
||||
|
||||
// ─────────────── public types (re-exported from bridge.ts as before) ───
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ import type { FileExtra, PushMsg, PushMsgBody } from '@snowluma/proto-defs/messa
|
||||
import type { PacketInfo } from '@snowluma/common/protocol-types';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import type { Bridge } from '../bridge';
|
||||
import { buildSendElems } from '@snowluma/bridge/element-builder';
|
||||
import type { ForwardNodePayload, MessageElement } from '@snowluma/bridge/events';
|
||||
import { parseMsgPush } from '@snowluma/bridge/msg-push';
|
||||
import { buildSendElems } from '@snowluma/protocol/element-builder';
|
||||
import type { ForwardNodePayload, MessageElement } from '@snowluma/protocol/events';
|
||||
import { parseMsgPush } from '@snowluma/protocol/msg-push';
|
||||
import { resolveSelfUid, toInt } from './shared';
|
||||
|
||||
function asBridge(ctx: BridgeContext): Bridge { return ctx as unknown as Bridge; }
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
// FriendApi — facade over friend-roster OIDB cmds. Every method is a
|
||||
// one-line forwarder to a self-contained namespace under
|
||||
// @snowluma/bridge/oidb-services/friend. The `delete()` facade method
|
||||
// @snowluma/protocol/oidb-services/friend. The `delete()` facade method
|
||||
// adds a best-effort friend-list cache invalidation after the OIDB
|
||||
// call succeeds — that side-effect stays on the facade because it
|
||||
// reaches into `ctx.apis.contacts`, which the namespace deliberately
|
||||
// can't see.
|
||||
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import { HandleFriendRequest } from '@snowluma/bridge/oidb-services/friend/handle-friend-request';
|
||||
import { DeleteFriend } from '@snowluma/bridge/oidb-services/friend/delete-friend';
|
||||
import { SetFriendRemark } from '@snowluma/bridge/oidb-services/friend/set-friend-remark';
|
||||
import { HandleFriendRequest } from '@snowluma/protocol/oidb-services/friend/handle-friend-request';
|
||||
import { DeleteFriend } from '@snowluma/protocol/oidb-services/friend/delete-friend';
|
||||
import { SetFriendRemark } from '@snowluma/protocol/oidb-services/friend/set-friend-remark';
|
||||
|
||||
export class FriendApi {
|
||||
constructor(private readonly ctx: BridgeContext) {}
|
||||
|
||||
@@ -2,27 +2,27 @@
|
||||
// cmds (mute / kick / admin / card / name / title / leave / join-policy
|
||||
// / add-request handling / @everyone budget). Every method is a
|
||||
// one-line forwarder to a self-contained namespace under
|
||||
// @snowluma/bridge/oidb-services/group-admin.
|
||||
// @snowluma/protocol/oidb-services/group-admin.
|
||||
//
|
||||
// The Apis facade keeps `bridge.apis.groupAdmin.X()` as the ergonomic
|
||||
// call site; the per-(cmd, subcmd) namespaces own the wire shape and
|
||||
// minimal capability surface.
|
||||
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import { MuteMember } from '@snowluma/bridge/oidb-services/group-admin/mute-member';
|
||||
import { MuteAll } from '@snowluma/bridge/oidb-services/group-admin/mute-all';
|
||||
import { SetAddOption } from '@snowluma/bridge/oidb-services/group-admin/set-add-option';
|
||||
import { SetSearch } from '@snowluma/bridge/oidb-services/group-admin/set-search';
|
||||
import { SetAddRequest } from '@snowluma/bridge/oidb-services/group-admin/set-add-request';
|
||||
import { KickMember } from '@snowluma/bridge/oidb-services/group-admin/kick-member';
|
||||
import { KickMembers } from '@snowluma/bridge/oidb-services/group-admin/kick-members';
|
||||
import { LeaveGroup } from '@snowluma/bridge/oidb-services/group-admin/leave-group';
|
||||
import { SetAdmin } from '@snowluma/bridge/oidb-services/group-admin/set-admin';
|
||||
import { SetMemberCard } from '@snowluma/bridge/oidb-services/group-admin/set-member-card';
|
||||
import { SetGroupName } from '@snowluma/bridge/oidb-services/group-admin/set-group-name';
|
||||
import { SetSpecialTitle } from '@snowluma/bridge/oidb-services/group-admin/set-special-title';
|
||||
import { SetGroupRemark } from '@snowluma/bridge/oidb-services/group-admin/set-group-remark';
|
||||
import { GetAtAllRemain } from '@snowluma/bridge/oidb-services/group-admin/get-at-all-remain';
|
||||
import { MuteMember } from '@snowluma/protocol/oidb-services/group-admin/mute-member';
|
||||
import { MuteAll } from '@snowluma/protocol/oidb-services/group-admin/mute-all';
|
||||
import { SetAddOption } from '@snowluma/protocol/oidb-services/group-admin/set-add-option';
|
||||
import { SetSearch } from '@snowluma/protocol/oidb-services/group-admin/set-search';
|
||||
import { SetAddRequest } from '@snowluma/protocol/oidb-services/group-admin/set-add-request';
|
||||
import { KickMember } from '@snowluma/protocol/oidb-services/group-admin/kick-member';
|
||||
import { KickMembers } from '@snowluma/protocol/oidb-services/group-admin/kick-members';
|
||||
import { LeaveGroup } from '@snowluma/protocol/oidb-services/group-admin/leave-group';
|
||||
import { SetAdmin } from '@snowluma/protocol/oidb-services/group-admin/set-admin';
|
||||
import { SetMemberCard } from '@snowluma/protocol/oidb-services/group-admin/set-member-card';
|
||||
import { SetGroupName } from '@snowluma/protocol/oidb-services/group-admin/set-group-name';
|
||||
import { SetSpecialTitle } from '@snowluma/protocol/oidb-services/group-admin/set-special-title';
|
||||
import { SetGroupRemark } from '@snowluma/protocol/oidb-services/group-admin/set-group-remark';
|
||||
import { GetAtAllRemain } from '@snowluma/protocol/oidb-services/group-admin/get-at-all-remain';
|
||||
|
||||
export class GroupAdminApi {
|
||||
constructor(private readonly ctx: BridgeContext) {}
|
||||
|
||||
@@ -17,7 +17,7 @@ import type {
|
||||
} from '@snowluma/proto-defs/oidb-actions/group-album';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import type { Bridge } from '../bridge';
|
||||
import { getGroupAlbumList, uploadImageToGroupAlbum } from '@snowluma/bridge/web/group-album';
|
||||
import { getGroupAlbumList, uploadImageToGroupAlbum } from '@snowluma/protocol/web/group-album';
|
||||
// `getCookies` is part of WebApi — go through the hub so we don't
|
||||
// duplicate the cookie acquisition flow.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// download URL resolvers.
|
||||
//
|
||||
// Single-OIDB-call methods are one-line forwarders to namespaces
|
||||
// under @snowluma/bridge/oidb-services/group-file. The multi-stage
|
||||
// under @snowluma/protocol/oidb-services/group-file. The multi-stage
|
||||
// methods (`upload` / `uploadPrivate`) stay here because they
|
||||
// orchestrate three discrete legs (OIDB preflight → highway PUT →
|
||||
// follow-on OIDB publish or message send) plus the upload-cache
|
||||
@@ -13,28 +13,28 @@ import { toHexUpper } from '@snowluma/common/hex';
|
||||
import { createLogger } from '@snowluma/common/logger';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import type { Bridge } from '../bridge';
|
||||
import { fetchHighwaySession, uploadHighwayHttp } from '@snowluma/bridge/highway';
|
||||
import { computeHashes, computeMd5, FILE_UPLOAD_MAX_BYTES, loadBinarySource } from '@snowluma/bridge/highway/utils';
|
||||
import { fetchHighwaySession, uploadHighwayHttp } from '@snowluma/protocol/highway';
|
||||
import { computeHashes, computeMd5, FILE_UPLOAD_MAX_BYTES, loadBinarySource } from '@snowluma/protocol/highway/utils';
|
||||
import type { FileUploadExt } from '@snowluma/proto-defs/highway';
|
||||
import { resolveSelfUid, toInt, type MediaIndexNode } from './shared';
|
||||
|
||||
import { PublishGroupFile } from '@snowluma/bridge/oidb-services/group-file/publish-group-file';
|
||||
import { GetGroupFileCount } from '@snowluma/bridge/oidb-services/group-file/get-group-file-count';
|
||||
import { UploadGroupFileRequest } from '@snowluma/bridge/oidb-services/group-file/upload-group-file-request';
|
||||
import { UploadPrivateFileRequest } from '@snowluma/bridge/oidb-services/group-file/upload-private-file-request';
|
||||
import { ListGroupFilesPage } from '@snowluma/bridge/oidb-services/group-file/list-group-files-page';
|
||||
import { GetGroupFileUrl } from '@snowluma/bridge/oidb-services/group-file/get-group-file-url';
|
||||
import { GetPrivateFileUrl } from '@snowluma/bridge/oidb-services/group-file/get-private-file-url';
|
||||
import { DeleteGroupFile } from '@snowluma/bridge/oidb-services/group-file/delete-group-file';
|
||||
import { MoveGroupFile } from '@snowluma/bridge/oidb-services/group-file/move-group-file';
|
||||
import { CreateGroupFolder } from '@snowluma/bridge/oidb-services/group-file/create-group-folder';
|
||||
import { DeleteGroupFolder } from '@snowluma/bridge/oidb-services/group-file/delete-group-folder';
|
||||
import { RenameGroupFolder } from '@snowluma/bridge/oidb-services/group-file/rename-group-folder';
|
||||
import { GetGroupPttUrl } from '@snowluma/bridge/oidb-services/group-file/get-group-ptt-url';
|
||||
import { GetPrivatePttUrl } from '@snowluma/bridge/oidb-services/group-file/get-private-ptt-url';
|
||||
import { GetGroupVideoUrl } from '@snowluma/bridge/oidb-services/group-file/get-group-video-url';
|
||||
import { GetPrivateVideoUrl } from '@snowluma/bridge/oidb-services/group-file/get-private-video-url';
|
||||
import { ensureRetCodeZero } from '@snowluma/bridge/oidb-services/shared';
|
||||
import { PublishGroupFile } from '@snowluma/protocol/oidb-services/group-file/publish-group-file';
|
||||
import { GetGroupFileCount } from '@snowluma/protocol/oidb-services/group-file/get-group-file-count';
|
||||
import { UploadGroupFileRequest } from '@snowluma/protocol/oidb-services/group-file/upload-group-file-request';
|
||||
import { UploadPrivateFileRequest } from '@snowluma/protocol/oidb-services/group-file/upload-private-file-request';
|
||||
import { ListGroupFilesPage } from '@snowluma/protocol/oidb-services/group-file/list-group-files-page';
|
||||
import { GetGroupFileUrl } from '@snowluma/protocol/oidb-services/group-file/get-group-file-url';
|
||||
import { GetPrivateFileUrl } from '@snowluma/protocol/oidb-services/group-file/get-private-file-url';
|
||||
import { DeleteGroupFile } from '@snowluma/protocol/oidb-services/group-file/delete-group-file';
|
||||
import { MoveGroupFile } from '@snowluma/protocol/oidb-services/group-file/move-group-file';
|
||||
import { CreateGroupFolder } from '@snowluma/protocol/oidb-services/group-file/create-group-folder';
|
||||
import { DeleteGroupFolder } from '@snowluma/protocol/oidb-services/group-file/delete-group-folder';
|
||||
import { RenameGroupFolder } from '@snowluma/protocol/oidb-services/group-file/rename-group-folder';
|
||||
import { GetGroupPttUrl } from '@snowluma/protocol/oidb-services/group-file/get-group-ptt-url';
|
||||
import { GetPrivatePttUrl } from '@snowluma/protocol/oidb-services/group-file/get-private-ptt-url';
|
||||
import { GetGroupVideoUrl } from '@snowluma/protocol/oidb-services/group-file/get-group-video-url';
|
||||
import { GetPrivateVideoUrl } from '@snowluma/protocol/oidb-services/group-file/get-private-video-url';
|
||||
import { ensureRetCodeZero } from '@snowluma/protocol/oidb-services/shared';
|
||||
|
||||
const log = createLogger('GroupFile');
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// InteractionApi — facade over interactive-engagement OIDB cmds
|
||||
// (poke / like / reaction / essence / emoji-like-list). Every method
|
||||
// is a one-line forwarder to a self-contained namespace under
|
||||
// @snowluma/bridge/oidb-services. The facade exists purely to keep
|
||||
// @snowluma/protocol/oidb-services. The facade exists purely to keep
|
||||
// the `bridge.apis.interaction.X(...)` ergonomic call style; all wire
|
||||
// work (envelope build / encode / send / decode) lives in the
|
||||
// namespace files.
|
||||
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import { SendPoke } from '@snowluma/bridge/oidb-services/interaction/send-poke';
|
||||
import { SendLike } from '@snowluma/bridge/oidb-services/interaction/send-like';
|
||||
import { SetEssence } from '@snowluma/bridge/oidb-services/interaction/set-essence';
|
||||
import { SetReaction } from '@snowluma/bridge/oidb-services/reaction/set-reaction';
|
||||
import { FetchReactionSummary } from '@snowluma/bridge/oidb-services/reaction/fetch-reaction-summary';
|
||||
import { GetEmojiLikes } from '@snowluma/bridge/oidb-services/reaction/get-emoji-likes';
|
||||
import { SendPoke } from '@snowluma/protocol/oidb-services/interaction/send-poke';
|
||||
import { SendLike } from '@snowluma/protocol/oidb-services/interaction/send-like';
|
||||
import { SetEssence } from '@snowluma/protocol/oidb-services/interaction/set-essence';
|
||||
import { SetReaction } from '@snowluma/protocol/oidb-services/reaction/set-reaction';
|
||||
import { FetchReactionSummary } from '@snowluma/protocol/oidb-services/reaction/fetch-reaction-summary';
|
||||
import { GetEmojiLikes } from '@snowluma/protocol/oidb-services/reaction/get-emoji-likes';
|
||||
|
||||
export class InteractionApi {
|
||||
constructor(private readonly ctx: BridgeContext) {}
|
||||
|
||||
@@ -22,8 +22,8 @@ import type {
|
||||
GroupRecallRequest,
|
||||
SsoReadedReportReq,
|
||||
} from '@snowluma/proto-defs/oidb-actions/base';
|
||||
import type { MessageElement } from '@snowluma/bridge/events';
|
||||
import { buildSendElems } from '@snowluma/bridge/element-builder';
|
||||
import type { MessageElement } from '@snowluma/protocol/events';
|
||||
import { buildSendElems } from '@snowluma/protocol/element-builder';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
// `Bridge` is imported as a type only so we can narrow `ctx` back to
|
||||
// the concrete Bridge instance when passing it to `buildSendElems`
|
||||
|
||||
@@ -10,9 +10,9 @@ import type {
|
||||
} from '@snowluma/proto-defs/oidb-actions/base';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
// Migrated OIDB cmds — facade methods are one-line forwarders.
|
||||
import { TranslateEnToZh } from '@snowluma/bridge/oidb-services/misc/translate-en-to-zh';
|
||||
import { ClickInlineKeyboardButton } from '@snowluma/bridge/oidb-services/misc/click-inline-keyboard-button';
|
||||
import { SendGroupSign } from '@snowluma/bridge/oidb-services/misc/send-group-sign';
|
||||
import { TranslateEnToZh } from '@snowluma/protocol/oidb-services/misc/translate-en-to-zh';
|
||||
import { ClickInlineKeyboardButton } from '@snowluma/protocol/oidb-services/misc/click-inline-keyboard-button';
|
||||
import { SendGroupSign } from '@snowluma/protocol/oidb-services/misc/send-group-sign';
|
||||
|
||||
export class MiscApi {
|
||||
constructor(private readonly ctx: BridgeContext) {}
|
||||
|
||||
@@ -12,14 +12,14 @@ import type {
|
||||
} from '@snowluma/proto-defs/oidb-actions/base';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import type { Bridge } from '../bridge';
|
||||
import { fetchHighwaySession, uploadHighwayHttp } from '@snowluma/bridge/highway';
|
||||
import { computeHashes, loadBinarySource } from '@snowluma/bridge/highway/utils';
|
||||
import { fetchHighwaySession, uploadHighwayHttp } from '@snowluma/protocol/highway';
|
||||
import { computeHashes, loadBinarySource } from '@snowluma/protocol/highway/utils';
|
||||
// Migrated OIDB cmds — facade methods are one-line forwarders.
|
||||
import { SetProfile } from '@snowluma/bridge/oidb-services/profile/set-profile';
|
||||
import { SetSelfLongNick } from '@snowluma/bridge/oidb-services/profile/set-self-long-nick';
|
||||
import { SetInputStatus } from '@snowluma/bridge/oidb-services/profile/set-input-status';
|
||||
import { GetLike } from '@snowluma/bridge/oidb-services/profile/get-like';
|
||||
import { GetUnidirectionalFriendList } from '@snowluma/bridge/oidb-services/profile/get-unidirectional-friend-list';
|
||||
import { SetProfile } from '@snowluma/protocol/oidb-services/profile/set-profile';
|
||||
import { SetSelfLongNick } from '@snowluma/protocol/oidb-services/profile/set-self-long-nick';
|
||||
import { SetInputStatus } from '@snowluma/protocol/oidb-services/profile/set-input-status';
|
||||
import { GetLike } from '@snowluma/protocol/oidb-services/profile/get-like';
|
||||
import { GetUnidirectionalFriendList } from '@snowluma/protocol/oidb-services/profile/get-unidirectional-friend-list';
|
||||
|
||||
function asBridge(ctx: BridgeContext): Bridge { return ctx as unknown as Bridge; }
|
||||
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
import type { Bridge } from '../bridge';
|
||||
import { getGroupEssenceMsg, getGroupEssenceMsgAll } from '@snowluma/bridge/web/group-essence';
|
||||
import { getHonorListWebAPI, WebHonorType } from '@snowluma/bridge/web/group-honor';
|
||||
import { getGroupEssenceMsg, getGroupEssenceMsgAll } from '@snowluma/protocol/web/group-essence';
|
||||
import { getHonorListWebAPI, WebHonorType } from '@snowluma/protocol/web/group-honor';
|
||||
import {
|
||||
deleteGroupNotice as deleteGroupNoticeHttp,
|
||||
getGroupNoticeWebAPI,
|
||||
setGroupNoticeWebAPI,
|
||||
uploadGroupNoticeImage,
|
||||
} from '@snowluma/bridge/web/group-notice';
|
||||
import { RequestUtil } from '@snowluma/bridge/web/request-util';
|
||||
} from '@snowluma/protocol/web/group-notice';
|
||||
import { RequestUtil } from '@snowluma/protocol/web/request-util';
|
||||
// Migrated OIDB cmds — the two private helpers below are thin
|
||||
// forwarders into the namespaces.
|
||||
import { ForceFetchClientKey, type ClientKeyInfo as NamespaceClientKeyInfo } from '@snowluma/bridge/oidb-services/web/force-fetch-client-key';
|
||||
import { GetPskey } from '@snowluma/bridge/oidb-services/web/get-pskey';
|
||||
import { ForceFetchClientKey, type ClientKeyInfo as NamespaceClientKeyInfo } from '@snowluma/protocol/oidb-services/web/force-fetch-client-key';
|
||||
import { GetPskey } from '@snowluma/protocol/oidb-services/web/get-pskey';
|
||||
|
||||
function asBridge(ctx: BridgeContext): Bridge { return ctx as unknown as Bridge; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Api-layer extension of @snowluma/bridge's slim BridgeContext.
|
||||
// Api-layer extension of @snowluma/protocol's slim BridgeContext.
|
||||
//
|
||||
// The slim interface in @snowluma/bridge has the protocol-layer
|
||||
// The slim interface in @snowluma/protocol has the protocol-layer
|
||||
// surface (identity / events / sendRawPacket / resolveUserUid / next*
|
||||
// sequence helpers / upload-metadata cache). This file extends it
|
||||
// with `apis: ApiHub` — the typed bag of Api classes that lives ONLY
|
||||
@@ -10,10 +10,10 @@
|
||||
// The 13 Api classes (apis/<area>.ts) import `BridgeContext` from
|
||||
// here, which gives them `this.ctx.apis.message.sendGroup(...)` type-
|
||||
// safety alongside the protocol-layer fields. Highway uploaders,
|
||||
// element-builder, msg-push parsers (all in @snowluma/bridge) import
|
||||
// the slim version directly from `@snowluma/bridge/bridge-context`.
|
||||
// element-builder, msg-push parsers (all in @snowluma/protocol) import
|
||||
// the slim version directly from `@snowluma/protocol/bridge-context`.
|
||||
|
||||
import type { BridgeContext as BaseBridgeContext } from '@snowluma/bridge/bridge-context';
|
||||
import type { BridgeContext as BaseBridgeContext } from '@snowluma/protocol/bridge-context';
|
||||
import type { ApiHub } from './apis';
|
||||
|
||||
export interface BridgeContext extends BaseBridgeContext {
|
||||
@@ -24,4 +24,4 @@ export interface BridgeContext extends BaseBridgeContext {
|
||||
// `import type { UploadedFileMeta } from '<…>/bridge-context'` (or
|
||||
// from bridge.ts via re-export) keeps working without callers having
|
||||
// to learn the new package path.
|
||||
export type { UploadedFileMeta } from '@snowluma/bridge/bridge-context';
|
||||
export type { UploadedFileMeta } from '@snowluma/protocol/bridge-context';
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { PacketSender, SendPacketResult } from '@snowluma/common/packet-sender';
|
||||
import type { PacketInfo } from '@snowluma/common/protocol-types';
|
||||
import type { BridgeInterface } from './bridge-interface';
|
||||
import { IdentityService } from '@snowluma/bridge/identity-service';
|
||||
import { MSG_PUSH_CMD, parseMsgPush } from '@snowluma/bridge/msg-push';
|
||||
import { IncomingPacketPipeline, type CmdParser } from '@snowluma/bridge/packet-pipeline';
|
||||
import { IdentityService } from '@snowluma/protocol/identity-service';
|
||||
import { MSG_PUSH_CMD, parseMsgPush } from '@snowluma/protocol/msg-push';
|
||||
import { IncomingPacketPipeline, type CmdParser } from '@snowluma/protocol/packet-pipeline';
|
||||
// qq-info types are no longer used directly in this file — they live
|
||||
// inside the Api classes that own those fetches (apis/contacts.ts).
|
||||
import { type ApiHub, buildApiHub } from './apis';
|
||||
@@ -35,7 +35,7 @@ import type { GroupFilesResult } from './apis/group-file';
|
||||
// actions/profile.ts removed — moved to apis/profile.ts::ProfileApi.
|
||||
// `bridge-contacts.ts` removed — its 6 functions are now methods on
|
||||
// `apis.contacts` (see `apis/contacts.ts::ContactsApi`).
|
||||
import { BridgeEventBus } from '@snowluma/bridge/event-bus';
|
||||
import { BridgeEventBus } from '@snowluma/protocol/event-bus';
|
||||
// web-actions/* removed — moved to apis/web.ts::WebApi.
|
||||
export { AiVoiceChatType };
|
||||
export type { AiVoiceCategory, StrangerStatus };
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { PacketSender } from '@snowluma/common/packet-sender';
|
||||
import type { PacketInfo } from '@snowluma/common/protocol-types';
|
||||
import { createLogger } from '@snowluma/common/logger';
|
||||
import { Bridge } from './bridge';
|
||||
import { IdentityService } from '@snowluma/bridge/identity-service';
|
||||
import { IdentityService } from '@snowluma/protocol/identity-service';
|
||||
|
||||
export type SessionStartedCallback = (uin: string, bridge: Bridge) => void;
|
||||
export type SessionClosedCallback = (uin: string) => void;
|
||||
|
||||
Reference in new issue
Block a user