alemonjs 2.1.83 → 2.1.85
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/lib/{app → application}/define-children.js +2 -1
- package/lib/{app → application/format}/message-api.d.ts +2 -2
- package/lib/{app → application/format}/message-api.js +12 -4
- package/lib/{app → application/format}/message-format-old.d.ts +1 -1
- package/lib/{app → application/format}/message-format.d.ts +1 -2
- package/lib/{app → application/format}/message-format.js +0 -2
- package/lib/{app/hook-use → application/hooks}/announce.js +4 -3
- package/lib/{app/hook-use → application/hooks}/channel.js +4 -3
- package/lib/{app/hook-use → application/hooks}/client.d.ts +1 -1
- package/lib/{app/hook-use → application/hooks}/client.js +4 -11
- package/lib/{app/hook-use → application/hooks}/common.d.ts +7 -7
- package/lib/{app/hook-use → application/hooks}/common.js +9 -8
- package/lib/{app/hook-use → application/hooks}/event.js +1 -1
- package/lib/{app/hook-use → application/hooks}/guild.js +4 -3
- package/lib/{app/hook-use → application/hooks}/history.js +4 -3
- package/lib/{app/hook-use → application/hooks}/me.js +12 -7
- package/lib/{app/hook-use → application/hooks}/media.d.ts +3 -3
- package/lib/{app/hook-use → application/hooks}/media.js +4 -3
- package/lib/{app/hook-use → application/hooks}/member.js +4 -3
- package/lib/{app/hook-use → application/hooks}/mention.js +4 -3
- package/lib/{app/hook-use → application/hooks}/message.js +6 -5
- package/lib/{app/hook-use → application/hooks}/permission.js +4 -3
- package/lib/{app/hook-use → application/hooks}/reaction.js +4 -3
- package/lib/{app/hook-use → application/hooks}/request.js +12 -7
- package/lib/{app/hook-use → application/hooks}/role.js +4 -3
- package/lib/{app/hook-use → application/hooks}/subscribe.js +4 -4
- package/lib/{app/hook-use → application/hooks}/user.js +12 -7
- package/lib/application/index.d.ts +29 -0
- package/lib/application/index.js +58 -0
- package/lib/{app → application}/router/dsl.d.ts +1 -1
- package/lib/{app → application}/router/dsl.js +14 -10
- package/lib/{cbp → application/runtime/cbp}/connects/client.d.ts +1 -1
- package/lib/{cbp → application/runtime/cbp}/connects/client.js +43 -50
- package/lib/application/runtime/cbp/index.d.ts +3 -0
- package/lib/application/runtime/cbp/index.js +3 -0
- package/lib/application/runtime/cbp/processor/actions.d.ts +3 -0
- package/lib/application/runtime/cbp/processor/actions.js +58 -0
- package/lib/application/runtime/cbp/processor/api.d.ts +3 -0
- package/lib/application/runtime/cbp/processor/api.js +58 -0
- package/lib/application/runtime/cbp/processor/request-registry.d.ts +8 -0
- package/lib/application/runtime/cbp/processor/request-registry.js +6 -0
- package/lib/application/runtime/client-runtime.d.ts +1 -0
- package/lib/application/runtime/client-runtime.js +95 -0
- package/lib/{app → application/runtime}/event-error.d.ts +1 -1
- package/lib/{app → application/runtime}/event-error.js +1 -1
- package/lib/{app → application/runtime}/event-group.d.ts +1 -1
- package/lib/{app → application/runtime}/event-middleware.d.ts +1 -1
- package/lib/{app → application/runtime}/event-middleware.js +1 -1
- package/lib/{app → application/runtime}/event-processor-callHandler.d.ts +1 -1
- package/lib/{app → application/runtime}/event-processor-callHandler.js +8 -1
- package/lib/{app → application/runtime}/event-processor-cycle.d.ts +1 -1
- package/lib/{app → application/runtime}/event-processor-cycleFiles.d.ts +1 -1
- package/lib/{app → application/runtime}/event-processor-cycleFiles.js +2 -2
- package/lib/{app → application/runtime}/event-processor-cycleRoute.d.ts +1 -1
- package/lib/{app → application/runtime}/event-processor-cycleRoute.js +9 -2
- package/lib/{app → application/runtime}/event-processor-event.d.ts +1 -1
- package/lib/{app → application/runtime}/event-processor-middleware.d.ts +1 -1
- package/lib/{app → application/runtime}/event-processor-subscribe.d.ts +1 -1
- package/lib/{app → application/runtime}/event-processor-subscribe.js +9 -2
- package/lib/{app → application/runtime}/event-processor.d.ts +1 -1
- package/lib/{app → application/runtime}/event-processor.js +4 -3
- package/lib/{app → application/runtime}/event-response.d.ts +1 -1
- package/lib/{app → application/runtime}/event-utils.d.ts +1 -1
- package/lib/{app → application/runtime}/event-utils.js +2 -2
- package/lib/{app → application/runtime}/hook-event-context.d.ts +2 -2
- package/lib/{app → application/runtime}/hook-event-context.js +2 -2
- package/lib/application/runtime/http/index.d.ts +4 -0
- package/lib/application/runtime/http/index.js +4 -0
- package/lib/application/runtime/http/routers/hello.html.d.ts +4 -0
- package/lib/application/runtime/http/routers/hello.html.js +363 -0
- package/lib/{server → application/runtime/http}/routers/router.js +265 -179
- package/lib/{server → application/runtime/http}/routers/utils.d.ts +1 -1
- package/lib/{server → application/runtime/http}/routers/utils.js +22 -8
- package/lib/{server/main.js → application/runtime/http-server.js} +2 -6
- package/lib/{app → application/runtime}/lifecycle-callbacks.d.ts +1 -1
- package/lib/{app → application/runtime}/lifecycle-callbacks.js +2 -7
- package/lib/{app/load_modules → application/runtime/load-modules}/load.js +2 -2
- package/lib/{app/load_modules → application/runtime/load-modules}/loadChild.js +14 -5
- package/lib/{app → application/runtime}/schedule-store.d.ts +1 -1
- package/lib/{app → application/runtime}/schedule-store.js +1 -1
- package/lib/{app → application/runtime}/store.d.ts +14 -19
- package/lib/{app → application/runtime}/store.js +8 -103
- package/lib/application/schedule.d.ts +17 -0
- package/lib/{app/api → application}/schedule.js +1 -1
- package/lib/client.d.ts +1 -1
- package/lib/client.js +1 -117
- package/lib/common/cbp/constants.d.ts +11 -0
- package/lib/common/cbp/constants.js +13 -0
- package/lib/{cbp/connects/connect.js → common/cbp/heartbeat.js} +3 -6
- package/lib/common/cbp/normalize.d.ts +16 -0
- package/lib/common/cbp/normalize.js +324 -0
- package/lib/common/cbp/runtime.d.ts +2 -0
- package/lib/common/cbp/runtime.js +10 -0
- package/lib/common/cbp/typings.d.ts +159 -0
- package/lib/{cbp/connects/base.js → common/cbp/ws-connector.js} +7 -9
- package/lib/{core → common}/config.d.ts +2 -2
- package/lib/{core → common}/config.js +5 -4
- package/lib/common/identity.d.ts +11 -0
- package/lib/common/identity.js +34 -0
- package/lib/common/index.d.ts +15 -0
- package/lib/common/index.js +14 -0
- package/lib/common/logger.d.ts +6 -0
- package/lib/common/logger.js +99 -0
- package/lib/{core → common}/react.js +22 -3
- package/lib/common/result.d.ts +7 -0
- package/lib/common/result.js +19 -0
- package/lib/{core → common}/utils.d.ts +3 -18
- package/lib/{core → common}/utils.js +6 -49
- package/lib/{core → common}/variable.js +1 -1
- package/lib/core/cbp/index.d.ts +1 -0
- package/lib/core/cbp/index.js +1 -0
- package/lib/core/cbp/processor/config.d.ts +8 -0
- package/lib/core/cbp/processor/config.js +29 -0
- package/lib/{cbp → core/cbp}/routers/hello.html.js +1 -1
- package/lib/{cbp → core/cbp}/server/main.js +57 -35
- package/lib/{cbp → core/cbp}/server/testone.d.ts +1 -1
- package/lib/{cbp → core/cbp}/server/testone.js +8 -2
- package/lib/core/index.d.ts +1 -3
- package/lib/core/index.js +1 -3
- package/lib/core/process/index.d.ts +3 -0
- package/lib/{process → core/process}/index.js +0 -1
- package/lib/{process → core/process}/ipc-bridge.js +16 -2
- package/lib/{process → core/process}/module.js +13 -4
- package/lib/{process → core/process}/platform.js +12 -3
- package/lib/core/start.d.ts +2 -0
- package/lib/core/start.js +76 -0
- package/lib/global.d.ts +4 -3
- package/lib/index.d.ts +10 -2
- package/lib/index.js +74 -54
- package/lib/main.d.ts +1 -2
- package/lib/main.js +1 -76
- package/lib/{cbp/connects/platform.d.ts → platform/cbp-platform.d.ts} +2 -2
- package/lib/{cbp/connects/platform.js → platform/cbp-platform.js} +52 -75
- package/lib/{app → platform}/define-platform.js +2 -0
- package/lib/platform/event-value.d.ts +7 -0
- package/lib/platform/event-value.js +5 -0
- package/lib/platform/index.d.ts +5 -0
- package/lib/platform/index.js +5 -0
- package/lib/types/actions.d.ts +20 -1
- package/lib/types/apis.d.ts +2 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/cycle/index.d.ts +1 -1
- package/lib/types/event/index.d.ts +1 -1
- package/lib/types/subscribe/index.d.ts +1 -1
- package/package.json +22 -1
- package/lib/app/api/schedule.d.ts +0 -17
- package/lib/app/index.d.ts +0 -25
- package/lib/app/index.js +0 -47
- package/lib/cbp/index.d.ts +0 -3
- package/lib/cbp/index.js +0 -3
- package/lib/cbp/processor/actions.d.ts +0 -3
- package/lib/cbp/processor/actions.js +0 -48
- package/lib/cbp/processor/api.d.ts +0 -3
- package/lib/cbp/processor/api.js +0 -48
- package/lib/cbp/processor/config.d.ts +0 -29
- package/lib/cbp/processor/config.js +0 -52
- package/lib/cbp/typings.d.ts +0 -20
- package/lib/process/index.d.ts +0 -4
- package/lib/server/routers/hello.html.d.ts +0 -2
- package/lib/server/routers/hello.html.js +0 -31
- /package/lib/{app → application}/define-children.d.ts +0 -0
- /package/lib/{app → application}/define-middleware.d.ts +0 -0
- /package/lib/{app → application}/define-middleware.js +0 -0
- /package/lib/{app → application}/define-response.d.ts +0 -0
- /package/lib/{app → application}/define-response.js +0 -0
- /package/lib/{app → application}/define-router.d.ts +0 -0
- /package/lib/{app → application}/define-router.js +0 -0
- /package/lib/{app → application}/expose.d.ts +0 -0
- /package/lib/{app → application}/expose.js +0 -0
- /package/lib/{app → application/format}/message-format-old.js +0 -0
- /package/lib/{app/hook-use → application/hooks}/announce.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/channel.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/event.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/guild.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/history.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/index.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/index.js +0 -0
- /package/lib/{app/hook-use → application/hooks}/me.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/member.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/mention.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/message.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/permission.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/reaction.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/request.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/role.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/route.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/route.js +0 -0
- /package/lib/{app/hook-use → application/hooks}/subscribe.d.ts +0 -0
- /package/lib/{app/hook-use → application/hooks}/user.d.ts +0 -0
- /package/lib/{app → application}/router/fallback.d.ts +0 -0
- /package/lib/{app → application}/router/fallback.js +0 -0
- /package/lib/{app → application}/router/main.d.ts +0 -0
- /package/lib/{app → application}/router/main.js +0 -0
- /package/lib/{app → application}/router/parser.d.ts +0 -0
- /package/lib/{app → application}/router/parser.js +0 -0
- /package/lib/{app → application}/router/types.d.ts +0 -0
- /package/lib/{app → application}/router/types.js +0 -0
- /package/lib/{app → application}/router/validator.d.ts +0 -0
- /package/lib/{app → application}/router/validator.js +0 -0
- /package/lib/{cbp → application/runtime/cbp}/processor/transport.d.ts +0 -0
- /package/lib/{cbp → application/runtime/cbp}/processor/transport.js +0 -0
- /package/lib/{app → application/runtime}/event-group.js +0 -0
- /package/lib/{app → application/runtime}/event-processor-cycle.js +0 -0
- /package/lib/{app → application/runtime}/event-processor-event.js +0 -0
- /package/lib/{app → application/runtime}/event-processor-middleware.js +0 -0
- /package/lib/{app → application/runtime}/event-response.js +0 -0
- /package/lib/{server → application/runtime/http}/routers/middleware.d.ts +0 -0
- /package/lib/{server → application/runtime/http}/routers/middleware.js +0 -0
- /package/lib/{cbp → application/runtime/http}/routers/router.d.ts +0 -0
- /package/lib/{server/main.d.ts → application/runtime/http-server.d.ts} +0 -0
- /package/lib/{app/load_modules → application/runtime/load-modules}/index.d.ts +0 -0
- /package/lib/{app/load_modules → application/runtime/load-modules}/index.js +0 -0
- /package/lib/{app/load_modules → application/runtime/load-modules}/load.d.ts +0 -0
- /package/lib/{app/load_modules → application/runtime/load-modules}/loadChild.d.ts +0 -0
- /package/lib/{app/config.d.ts → application/runtime/subscribe-status.d.ts} +0 -0
- /package/lib/{app/config.js → application/runtime/subscribe-status.js} +0 -0
- /package/lib/{app → common}/SinglyLinkedList.d.ts +0 -0
- /package/lib/{app → common}/SinglyLinkedList.js +0 -0
- /package/lib/{cbp/connects/connect.d.ts → common/cbp/heartbeat.d.ts} +0 -0
- /package/lib/{cbp → common/cbp}/typings.js +0 -0
- /package/lib/{cbp/connects/base.d.ts → common/cbp/ws-connector.d.ts} +0 -0
- /package/lib/{process → common}/direct-channel.d.ts +0 -0
- /package/lib/{process → common}/direct-channel.js +0 -0
- /package/lib/{core → common}/react.d.ts +0 -0
- /package/lib/{core → common}/variable.d.ts +0 -0
- /package/lib/{cbp → core/cbp}/routers/hello.html.d.ts +0 -0
- /package/lib/{server → core/cbp}/routers/router.d.ts +0 -0
- /package/lib/{cbp → core/cbp}/routers/router.js +0 -0
- /package/lib/{cbp → core/cbp}/server/main.d.ts +0 -0
- /package/lib/{process → core/process}/ipc-bridge.d.ts +0 -0
- /package/lib/{process → core/process}/module.d.ts +0 -0
- /package/lib/{process → core/process}/platform.d.ts +0 -0
- /package/lib/{app → platform}/define-platform.d.ts +0 -0
- /package/lib/{app → platform}/event-format.d.ts +0 -0
- /package/lib/{app → platform}/event-format.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataEnums, OnDataFormatFunc } from '
|
|
2
|
-
import { Result } from '
|
|
1
|
+
import { DataEnums, OnDataFormatFunc } from '../../types/index.js';
|
|
2
|
+
import { Result } from '../../common/index.js';
|
|
3
3
|
import { Format } from './message-format';
|
|
4
4
|
export declare const format: OnDataFormatFunc;
|
|
5
5
|
export declare const createDataFormat: OnDataFormatFunc;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { ResultCode } from '
|
|
2
|
-
import { sendAction } from '../cbp/processor/actions.js';
|
|
1
|
+
import { ResultCode } from '../../common/variable.js';
|
|
2
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
3
3
|
import 'fs';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'yaml';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { logger } from '../../common/logger.js';
|
|
7
|
+
import { createResult } from '../../common/result.js';
|
|
8
|
+
import '../../common/utils.js';
|
|
9
|
+
import 'net';
|
|
10
|
+
import 'v8';
|
|
11
|
+
import 'os';
|
|
12
|
+
import 'flatted';
|
|
13
|
+
import '../../common/cbp/runtime.js';
|
|
14
|
+
import 'ws';
|
|
15
|
+
import { markEventSendAttempt, recordEventSendResults, markEventSendFailure } from '../runtime/hook-event-context.js';
|
|
8
16
|
|
|
9
17
|
const format = (...data) => {
|
|
10
18
|
if (!data || data.length === 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataMention, DataImage, DataText, DataImageURL, DataImageFile, DataButtonRow, DataButtonGroup, DataButton, DataMarkDown, DataMarkdownTitle, DataMarkdownSubtitle, DataMarkdownBold, DataMarkdownItalic, DataMarkdownItalicStar, DataMarkdownStrikethrough, DataMarkdownLink, DataMarkdownImage, DataMarkdownList, DataMarkdownListItem, DataMarkdownBlockquote, DataMarkdownDivider, DataMarkdownNewline, DataLink, DataMarkdownText, DataMarkdownCode, DataMarkdownOriginal, DataAttachment, DataAudio, DataVideo, DataMarkdownMention, DataMarkdownContent, DataMarkdownButton } from '
|
|
1
|
+
import { DataMention, DataImage, DataText, DataImageURL, DataImageFile, DataButtonRow, DataButtonGroup, DataButton, DataMarkDown, DataMarkdownTitle, DataMarkdownSubtitle, DataMarkdownBold, DataMarkdownItalic, DataMarkdownItalicStar, DataMarkdownStrikethrough, DataMarkdownLink, DataMarkdownImage, DataMarkdownList, DataMarkdownListItem, DataMarkdownBlockquote, DataMarkdownDivider, DataMarkdownNewline, DataLink, DataMarkdownText, DataMarkdownCode, DataMarkdownOriginal, DataAttachment, DataAudio, DataVideo, DataMarkdownMention, DataMarkdownContent, DataMarkdownButton } from '../../types/index.js';
|
|
2
2
|
import { Format, FormatMarkDown, FormatButtonGroup } from './message-format.js';
|
|
3
3
|
export declare const Text: (val: DataText["value"], options?: DataText["options"]) => DataText;
|
|
4
4
|
export declare const Link: (val: DataLink["value"], options?: DataText["options"]) => DataText;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { DataMention, DataText, DataImageURL, DataImageFile, DataButtonRow, DataButtonGroup, DataButton, DataMarkDown, DataLink, DataMarkdownCode, DataAttachment, DataMarkdownMention, DataMarkdownButton, DataEnums, DataSelect, DataSelectOption, DataEmbed } from '
|
|
2
|
-
export * from './message-format-old.js';
|
|
1
|
+
import { DataMention, DataText, DataImageURL, DataImageFile, DataButtonRow, DataButtonGroup, DataButton, DataMarkDown, DataLink, DataMarkdownCode, DataAttachment, DataMarkdownMention, DataMarkdownButton, DataEnums, DataSelect, DataSelectOption, DataEmbed } from '../../types';
|
|
3
2
|
export declare class FormatButtonGroup {
|
|
4
3
|
#private;
|
|
5
4
|
get value(): DataButtonGroup;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useAnnounce = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useChannel = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EventKeys, Events } from '
|
|
1
|
+
import { EventKeys, Events } from '../../types/index.js';
|
|
2
2
|
export declare function useClient<T extends object, K extends EventKeys = EventKeys>(eventOrClass?: Events[K] | (new (...args: any[]) => T), _ApiClass?: new (...args: any[]) => T): readonly [T];
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
5
|
-
import 'fs';
|
|
6
|
-
import 'path';
|
|
7
|
-
import 'yaml';
|
|
8
|
-
import '../../cbp/processor/config.js';
|
|
9
|
-
import { sendAPI } from '../../cbp/processor/api.js';
|
|
10
|
-
import '../message-format-old.js';
|
|
11
|
-
import { getCurrentEvent } from '../hook-event-context.js';
|
|
1
|
+
import { logger } from '../../common/logger.js';
|
|
2
|
+
import { ResultCode } from '../../common/variable.js';
|
|
3
|
+
import { sendAPI } from '../runtime/cbp/processor/api.js';
|
|
4
|
+
import { getCurrentEvent } from '../runtime/hook-event-context.js';
|
|
12
5
|
|
|
13
6
|
const createDeepProxy = (event, path = []) => {
|
|
14
7
|
return new Proxy((() => { }), {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DataEnums, EventKeys, Events, User, GuildInfo, ChannelInfo, MemberInfo, RoleInfo, PaginationParams, PaginatedResult } from '../../types';
|
|
2
|
-
import { ResultCode } from '../../
|
|
3
|
-
import { ChildrenApp } from '../store';
|
|
4
|
-
import { createResult, Result } from '../../
|
|
5
|
-
import { sendAction } from '
|
|
6
|
-
import { sendAPI } from '
|
|
7
|
-
import { Format } from '../message-format';
|
|
8
|
-
import { getCurrentEvent, getCurrentNext, recordEventSendResults, markEventSendAttempt, markEventSendFailure } from '../hook-event-context';
|
|
2
|
+
import { ResultCode } from '../../common/variable';
|
|
3
|
+
import { ChildrenApp } from '../runtime/store.js';
|
|
4
|
+
import { createResult, Result } from '../../common/utils';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
6
|
+
import { sendAPI } from '../runtime/cbp/processor/api.js';
|
|
7
|
+
import { Format } from '../format/message-format.js';
|
|
8
|
+
import { getCurrentEvent, getCurrentNext, recordEventSendResults, markEventSendAttempt, markEventSendFailure } from '../runtime/hook-event-context.js';
|
|
9
9
|
export type { DataEnums, EventKeys, Events, User, GuildInfo, ChannelInfo, MemberInfo, RoleInfo, PaginationParams, PaginatedResult, Result };
|
|
10
10
|
export { ResultCode, ChildrenApp, createResult, sendAction, sendAPI, Format, getCurrentEvent, getCurrentNext, recordEventSendResults, markEventSendAttempt, markEventSendFailure };
|
|
11
11
|
export type Options = {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ResultCode } from '../../
|
|
2
|
-
export { ChildrenApp } from '../store.js';
|
|
3
|
-
|
|
4
|
-
export { sendAction } from '
|
|
5
|
-
export { sendAPI } from '
|
|
6
|
-
export { Format } from '../message-format.js';
|
|
7
|
-
import { getCurrentEvent } from '../hook-event-context.js';
|
|
8
|
-
export { getCurrentNext, markEventSendAttempt, markEventSendFailure, recordEventSendResults } from '../hook-event-context.js';
|
|
1
|
+
import { ResultCode } from '../../common/variable.js';
|
|
2
|
+
export { ChildrenApp } from '../runtime/store.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
export { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
|
+
export { sendAPI } from '../runtime/cbp/processor/api.js';
|
|
6
|
+
export { Format } from '../format/message-format.js';
|
|
7
|
+
import { getCurrentEvent } from '../runtime/hook-event-context.js';
|
|
8
|
+
export { getCurrentNext, markEventSendAttempt, markEventSendFailure, recordEventSendResults } from '../runtime/hook-event-context.js';
|
|
9
|
+
export { createResult } from '../../common/result.js';
|
|
9
10
|
|
|
10
11
|
const getEventOrThrow = (event) => {
|
|
11
12
|
const currentEvent = event ?? getCurrentEvent();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useGuild = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useHistory = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { ResultCode } from '../../
|
|
2
|
-
import '../store.js';
|
|
3
|
-
import
|
|
4
|
-
import { sendAction } from '
|
|
1
|
+
import { ResultCode } from '../../common/variable.js';
|
|
2
|
+
import '../runtime/store.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'path';
|
|
7
7
|
import 'yaml';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../common/logger.js';
|
|
9
|
+
import { createResult } from '../../common/result.js';
|
|
10
|
+
import 'net';
|
|
11
|
+
import 'v8';
|
|
12
|
+
import 'os';
|
|
9
13
|
import 'flatted';
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
14
|
+
import '../../common/cbp/runtime.js';
|
|
15
|
+
import 'ws';
|
|
16
|
+
import '../runtime/hook-event-context.js';
|
|
12
17
|
|
|
13
18
|
const useMe = () => {
|
|
14
19
|
const info = async () => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EventKeys, Events, Result } from './common';
|
|
2
2
|
export declare const useMedia: <T extends EventKeys>(event?: Events[T]) => readonly [{
|
|
3
3
|
upload: (params: {
|
|
4
|
-
type: "
|
|
4
|
+
type: "file" | "image" | "audio" | "video";
|
|
5
5
|
url?: string;
|
|
6
6
|
data?: string;
|
|
7
7
|
name?: string;
|
|
8
8
|
}) => Promise<Result>;
|
|
9
9
|
sendChannel: (params: {
|
|
10
|
-
type: "
|
|
10
|
+
type: "file" | "image" | "audio" | "video";
|
|
11
11
|
url?: string;
|
|
12
12
|
data?: string;
|
|
13
13
|
name?: string;
|
|
@@ -15,7 +15,7 @@ export declare const useMedia: <T extends EventKeys>(event?: Events[T]) => reado
|
|
|
15
15
|
}) => Promise<Result>;
|
|
16
16
|
sendUser: (params: {
|
|
17
17
|
userId: string;
|
|
18
|
-
type: "
|
|
18
|
+
type: "file" | "image" | "audio" | "video";
|
|
19
19
|
url?: string;
|
|
20
20
|
data?: string;
|
|
21
21
|
name?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useMedia = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useMember = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { ResultCode } from '../../
|
|
3
|
-
import { createResult } from '../../
|
|
4
|
-
import
|
|
2
|
+
import { ResultCode } from '../../common/variable.js';
|
|
3
|
+
import { createResult } from '../../common/result.js';
|
|
4
|
+
import '../../common/utils.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useMention = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
6
|
+
import { Format } from '../format/message-format.js';
|
|
7
|
+
import { markEventSendAttempt, recordEventSendResults, markEventSendFailure } from '../runtime/hook-event-context.js';
|
|
7
8
|
|
|
8
9
|
const useMessage = (event) => {
|
|
9
10
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const usePermission = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useReaction = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { ResultCode } from '../../
|
|
2
|
-
import '../store.js';
|
|
3
|
-
import
|
|
4
|
-
import { sendAction } from '
|
|
1
|
+
import { ResultCode } from '../../common/variable.js';
|
|
2
|
+
import '../runtime/store.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'path';
|
|
7
7
|
import 'yaml';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../common/logger.js';
|
|
9
|
+
import { createResult } from '../../common/result.js';
|
|
10
|
+
import 'net';
|
|
11
|
+
import 'v8';
|
|
12
|
+
import 'os';
|
|
9
13
|
import 'flatted';
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
14
|
+
import '../../common/cbp/runtime.js';
|
|
15
|
+
import 'ws';
|
|
16
|
+
import '../runtime/hook-event-context.js';
|
|
12
17
|
|
|
13
18
|
const useRequest = () => {
|
|
14
19
|
const friend = async (params) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getEventOrThrow } from './common.js';
|
|
2
|
-
import { createResult } from '../../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { createResult } from '../../common/result.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { ResultCode } from '../../common/variable.js';
|
|
5
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
6
|
|
|
6
7
|
const useRole = (event) => {
|
|
7
8
|
const valueEvent = getEventOrThrow(event);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResultCode } from '../../
|
|
2
|
-
import { SubscribeList } from '../store.js';
|
|
3
|
-
import { SubscribeStatus } from '../
|
|
4
|
-
import { getCurrentEvent, getCurrentAppName } from '../hook-event-context.js';
|
|
1
|
+
import { ResultCode } from '../../common/variable.js';
|
|
2
|
+
import { SubscribeList } from '../runtime/store.js';
|
|
3
|
+
import { SubscribeStatus } from '../runtime/subscribe-status.js';
|
|
4
|
+
import { getCurrentEvent, getCurrentAppName } from '../runtime/hook-event-context.js';
|
|
5
5
|
|
|
6
6
|
function useSubscribe(eventOrSelects, maybeSelects) {
|
|
7
7
|
const selects = (maybeSelects === undefined ? eventOrSelects : maybeSelects);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { ResultCode } from '../../
|
|
2
|
-
import '../store.js';
|
|
3
|
-
import
|
|
4
|
-
import { sendAction } from '
|
|
1
|
+
import { ResultCode } from '../../common/variable.js';
|
|
2
|
+
import '../runtime/store.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
|
+
import { sendAction } from '../runtime/cbp/processor/actions.js';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'path';
|
|
7
7
|
import 'yaml';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../common/logger.js';
|
|
9
|
+
import { createResult } from '../../common/result.js';
|
|
10
|
+
import 'net';
|
|
11
|
+
import 'v8';
|
|
12
|
+
import 'os';
|
|
9
13
|
import 'flatted';
|
|
10
|
-
import '
|
|
11
|
-
import '
|
|
14
|
+
import '../../common/cbp/runtime.js';
|
|
15
|
+
import 'ws';
|
|
16
|
+
import '../runtime/hook-event-context.js';
|
|
12
17
|
|
|
13
18
|
const useUser = () => {
|
|
14
19
|
const info = async (params) => {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from '../types/index.js';
|
|
2
|
+
export { defineChildren } from './define-children.js';
|
|
3
|
+
export { defineResponse } from './define-response.js';
|
|
4
|
+
export { defineMiddleware } from './define-middleware.js';
|
|
5
|
+
export { defineRouter, lazy, runHandler } from './define-router.js';
|
|
6
|
+
export * from './expose.js';
|
|
7
|
+
export * from './hooks/index.js';
|
|
8
|
+
export * from './schedule.js';
|
|
9
|
+
export * from './format/message-api.js';
|
|
10
|
+
export * from './format/message-format.js';
|
|
11
|
+
export * from './format/message-format-old.js';
|
|
12
|
+
export * from './router/main.js';
|
|
13
|
+
export { validateRouteArgsForCommand } from './router/validator.js';
|
|
14
|
+
export * from './runtime/event-response.js';
|
|
15
|
+
export * from './runtime/event-middleware.js';
|
|
16
|
+
export { createSelects, onSelects, onState, unChildren, unState, useState } from './runtime/event-utils.js';
|
|
17
|
+
export { onGroup } from './runtime/event-group.js';
|
|
18
|
+
export { Core, Response, ResponseMiddleware, MiddlewareTree, ResponseTree, ResponseRouter, MiddlewareRouter, Middleware, SubscribeList, StateSubscribe, State, ChildrenApp, registerRuntimeApp, updateRuntimeAppStatus, updateRuntimeAppCapabilities, setRuntimeAppKoaRouters, getRuntimeAppKoaRouters, clearRuntimeAppKoaRouters, listRuntimeAppKoaRouters, getRuntimeApp, toRuntimeAppSnapshot, listRuntimeApps, disposeRuntimeApp, disposeAllRuntimeApps, hasRuntimeAppCapability, bumpStoreVersion, getSubscribeList, getChildrenApp, listChildrenApps, ProcessorEventAutoClearMap, ProcessorEventUserAutoClearMap, core } from './runtime/store.js';
|
|
19
|
+
export type { RuntimeAppStatus, RuntimeAppCapability, RuntimeAppError, RuntimeAppRecord } from './runtime/store.js';
|
|
20
|
+
export { loadChildren, loadChildrenFile } from './runtime/load-modules/loadChild.js';
|
|
21
|
+
export { run, loadModels } from './runtime/load-modules/load.js';
|
|
22
|
+
export { onProcessor, OnProcessor } from './runtime/event-processor.js';
|
|
23
|
+
export { expendCycle } from './runtime/event-processor-cycle.js';
|
|
24
|
+
export { expendEvent } from './runtime/event-processor-event.js';
|
|
25
|
+
export { expendMiddleware } from './runtime/event-processor-middleware.js';
|
|
26
|
+
export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount } from './runtime/event-processor-subscribe.js';
|
|
27
|
+
export { withEventContext, withProcessorTrace, getCurrentEvent, getCurrentNext, getCurrentAppName, getCurrentPhase, finishCurrentTrace, markEventSendAttempt, markEventSendSuccess, markEventSendFailure, recordEventSendResults } from './runtime/hook-event-context.js';
|
|
28
|
+
export { registerAppDir, unregisterAppDir, scheduleInterval, scheduleTimeout, scheduleCron, schedulePause, scheduleResume, scheduleCancel, scheduleCancelByApp, scheduleCancelAll, scheduleList } from './runtime/schedule-store.js';
|
|
29
|
+
export { cbpClient } from './runtime/cbp/index.js';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export { ActionsEventEnum } from '../types/event/actions.js';
|
|
2
|
+
export { defineChildren } from './define-children.js';
|
|
3
|
+
export { defineResponse } from './define-response.js';
|
|
4
|
+
export { defineMiddleware } from './define-middleware.js';
|
|
5
|
+
export { defineRouter, lazy, runHandler } from './define-router.js';
|
|
6
|
+
export { Expose, clearAllExpose, disposeExpose, registerExpose } from './expose.js';
|
|
7
|
+
export { useAnnounce } from './hooks/announce.js';
|
|
8
|
+
export { useChannel } from './hooks/channel.js';
|
|
9
|
+
export { useClient } from './hooks/client.js';
|
|
10
|
+
export { useGuild } from './hooks/guild.js';
|
|
11
|
+
export { useHistory } from './hooks/history.js';
|
|
12
|
+
export { useMedia } from './hooks/media.js';
|
|
13
|
+
export { useMe } from './hooks/me.js';
|
|
14
|
+
export { useMember } from './hooks/member.js';
|
|
15
|
+
export { useMention } from './hooks/mention.js';
|
|
16
|
+
export { useMessage, useSend, useSends } from './hooks/message.js';
|
|
17
|
+
export { usePermission } from './hooks/permission.js';
|
|
18
|
+
export { useReaction } from './hooks/reaction.js';
|
|
19
|
+
export { useRequest } from './hooks/request.js';
|
|
20
|
+
export { useRole } from './hooks/role.js';
|
|
21
|
+
export { useRoute } from './hooks/route.js';
|
|
22
|
+
export { useUser } from './hooks/user.js';
|
|
23
|
+
export { useObserver, useSubscribe } from './hooks/subscribe.js';
|
|
24
|
+
export { createEvent, useEvent } from './hooks/event.js';
|
|
25
|
+
export { clearInterval, clearTimeout, listSchedule, pauseSchedule, resumeSchedule, setCron, setInterval, setTimeout } from './schedule.js';
|
|
26
|
+
export { MessageDirect, createDataFormat, format, getMessageIntent, sendToChannel, sendToUser } from './format/message-api.js';
|
|
27
|
+
export { Format, FormatButtonGroup, FormatMarkDown, FormatSelect } from './format/message-format.js';
|
|
28
|
+
export { Attachment, Audio, BT, Button, Image, ImageFile, ImageURL, Link, MD, Markdown, MarkdownOriginal, Mention, Text, Video } from './format/message-format-old.js';
|
|
29
|
+
export { Router } from './router/dsl.js';
|
|
30
|
+
export { checkFallbackHint } from './router/fallback.js';
|
|
31
|
+
export { normalizeRoutePath, parseMessageText } from './router/parser.js';
|
|
32
|
+
export { validateRouteArgs, validateRouteArgsForCommand } from './router/validator.js';
|
|
33
|
+
export { OnResponse, onResponse } from './runtime/event-response.js';
|
|
34
|
+
export { OnMiddleware, onMiddleware } from './runtime/event-middleware.js';
|
|
35
|
+
export { createSelects, onSelects, onState, unChildren, unState, useState } from './runtime/event-utils.js';
|
|
36
|
+
export { onGroup } from './runtime/event-group.js';
|
|
37
|
+
export { ChildrenApp, Core, Middleware, MiddlewareRouter, MiddlewareTree, ProcessorEventAutoClearMap, ProcessorEventUserAutoClearMap, Response, ResponseMiddleware, ResponseRouter, ResponseTree, State, StateSubscribe, SubscribeList, bumpStoreVersion, clearRuntimeAppKoaRouters, core, disposeAllRuntimeApps, disposeRuntimeApp, getChildrenApp, getRuntimeApp, getRuntimeAppKoaRouters, getSubscribeList, hasRuntimeAppCapability, listChildrenApps, listRuntimeAppKoaRouters, listRuntimeApps, registerRuntimeApp, setRuntimeAppKoaRouters, toRuntimeAppSnapshot, updateRuntimeAppCapabilities, updateRuntimeAppStatus } from './runtime/store.js';
|
|
38
|
+
export { loadChildren, loadChildrenFile } from './runtime/load-modules/loadChild.js';
|
|
39
|
+
export { loadModels, run } from './runtime/load-modules/load.js';
|
|
40
|
+
export { OnProcessor, onProcessor } from './runtime/event-processor.js';
|
|
41
|
+
export { expendCycle } from './runtime/event-processor-cycle.js';
|
|
42
|
+
export { expendEvent } from './runtime/event-processor-event.js';
|
|
43
|
+
export { expendMiddleware } from './runtime/event-processor-middleware.js';
|
|
44
|
+
export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount } from './runtime/event-processor-subscribe.js';
|
|
45
|
+
export { finishCurrentTrace, getCurrentAppName, getCurrentEvent, getCurrentNext, getCurrentPhase, markEventSendAttempt, markEventSendFailure, markEventSendSuccess, recordEventSendResults, withEventContext, withProcessorTrace } from './runtime/hook-event-context.js';
|
|
46
|
+
export { registerAppDir, scheduleCancel, scheduleCancelAll, scheduleCancelByApp, scheduleCron, scheduleInterval, scheduleList, schedulePause, scheduleResume, scheduleTimeout, unregisterAppDir } from './runtime/schedule-store.js';
|
|
47
|
+
export { cbpClient } from './runtime/cbp/connects/client.js';
|
|
48
|
+
import 'flatted';
|
|
49
|
+
import 'fs';
|
|
50
|
+
import 'path';
|
|
51
|
+
import 'yaml';
|
|
52
|
+
import '../common/logger.js';
|
|
53
|
+
import '../common/utils.js';
|
|
54
|
+
import 'net';
|
|
55
|
+
import 'v8';
|
|
56
|
+
import 'os';
|
|
57
|
+
import '../common/cbp/runtime.js';
|
|
58
|
+
import 'ws';
|
|
@@ -38,7 +38,7 @@ export declare class Router<P extends string = string, E extends string = string
|
|
|
38
38
|
}[];
|
|
39
39
|
get values(): any[];
|
|
40
40
|
get define(): {
|
|
41
|
-
current: import("
|
|
41
|
+
current: import("..").ResponseRoute[];
|
|
42
42
|
};
|
|
43
43
|
match(event: {
|
|
44
44
|
name?: string;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { defineRouter } from '../define-router.js';
|
|
2
|
-
import '../store.js';
|
|
3
|
-
import '../../
|
|
2
|
+
import '../runtime/store.js';
|
|
3
|
+
import '../../common/utils.js';
|
|
4
4
|
import 'flatted';
|
|
5
5
|
import 'fs';
|
|
6
6
|
import 'path';
|
|
7
7
|
import 'yaml';
|
|
8
|
-
import '../../
|
|
9
|
-
import
|
|
10
|
-
import '
|
|
11
|
-
import
|
|
12
|
-
import '
|
|
8
|
+
import '../../common/logger.js';
|
|
9
|
+
import 'net';
|
|
10
|
+
import 'v8';
|
|
11
|
+
import 'os';
|
|
12
|
+
import '../../common/cbp/runtime.js';
|
|
13
|
+
import 'ws';
|
|
14
|
+
import { Format } from '../format/message-format.js';
|
|
15
|
+
import '../runtime/hook-event-context.js';
|
|
16
|
+
import { useMessage } from '../hooks/message.js';
|
|
13
17
|
import { checkFallbackHint } from './fallback.js';
|
|
14
18
|
import { normalizeRoutePath, parseMessageText } from './parser.js';
|
|
15
19
|
import { validateRouteArgsForCommand } from './validator.js';
|
|
@@ -685,15 +689,15 @@ class Router {
|
|
|
685
689
|
const md = Format.createMarkdown();
|
|
686
690
|
const format = Format.create();
|
|
687
691
|
const routeEntry = (result.eventName && result.matchedPath
|
|
688
|
-
?
|
|
692
|
+
? this.routes.get(result.eventName)?.one.get(result.matchedPath) ?? this.routes.get(result.eventName)?.two.get(result.matchedPath)
|
|
689
693
|
: undefined) ?? undefined;
|
|
690
694
|
const description = formatRouteDescription(routeEntry?.config.description);
|
|
691
695
|
const schemaHints = buildSchemaHints(routeEntry?.config.schema);
|
|
692
696
|
const replyLines = buildValidationReply({
|
|
693
|
-
error: validation
|
|
697
|
+
error: validation?.valid === false ? validation.error : '参数校验失败',
|
|
694
698
|
commandKey: result.commandKey,
|
|
695
699
|
description,
|
|
696
|
-
usage: validation
|
|
700
|
+
usage: validation?.valid === false ? validation.usage : undefined,
|
|
697
701
|
schemaHints
|
|
698
702
|
});
|
|
699
703
|
replyLines.forEach((line, index) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CBPClientOptions } from '
|
|
1
|
+
import type { CBPClientOptions } from '../../../../common/cbp/typings.js';
|
|
2
2
|
export declare const cbpClient: (url: string, options?: CBPClientOptions) => void;
|