feat: plugins v1.5
This commit is contained in:
@@ -87,6 +87,7 @@ export interface ChatEventBase {
|
||||
directMessage?: DirectMessageEventPayload;
|
||||
directMessageStatus?: DirectMessageStatusEventPayload;
|
||||
directMessageMutation?: DirectMessageMutationEventPayload;
|
||||
pluginMessage?: unknown;
|
||||
}
|
||||
|
||||
export interface ChatMessageEvent extends ChatEventBase {
|
||||
@@ -390,6 +391,11 @@ export interface DirectMessageMutationPeerEvent extends ChatEventBase {
|
||||
directMessageMutation: DirectMessageMutationEventPayload;
|
||||
}
|
||||
|
||||
export interface PluginMessageBusPeerEvent extends ChatEventBase {
|
||||
type: 'plugin-message-bus';
|
||||
pluginMessage: unknown;
|
||||
}
|
||||
|
||||
/** Discriminated union of all P2P chat events. Narrow via `event.type`. */
|
||||
export type ChatEvent =
|
||||
| ChatMessageEvent
|
||||
@@ -442,7 +448,8 @@ export type ChatEvent =
|
||||
| ChannelsUpdateEvent
|
||||
| DirectMessagePeerEvent
|
||||
| DirectMessageStatusPeerEvent
|
||||
| DirectMessageMutationPeerEvent;
|
||||
| DirectMessageMutationPeerEvent
|
||||
| PluginMessageBusPeerEvent;
|
||||
|
||||
/** All possible `type` values, derived from the union. */
|
||||
export type ChatEventType = ChatEvent['type'];
|
||||
|
||||
@@ -24,6 +24,7 @@ export const PLUGIN_EVENT_SCOPES = [
|
||||
] as const;
|
||||
|
||||
export type PluginEventScope = typeof PLUGIN_EVENT_SCOPES[number];
|
||||
export type TojuPluginInstallScope = 'client' | 'server';
|
||||
|
||||
export const PLUGIN_CAPABILITIES = [
|
||||
'profile.read',
|
||||
@@ -67,8 +68,11 @@ export const PLUGIN_CAPABILITIES = [
|
||||
export type PluginCapabilityId = typeof PLUGIN_CAPABILITIES[number];
|
||||
|
||||
export interface PluginRequirementSummary {
|
||||
installUrl?: string;
|
||||
manifest?: TojuPluginManifest;
|
||||
pluginId: string;
|
||||
reason?: string;
|
||||
sourceUrl?: string;
|
||||
status: PluginRequirementStatus;
|
||||
updatedAt: number;
|
||||
versionRange?: string;
|
||||
@@ -186,6 +190,7 @@ export interface TojuPluginManifest {
|
||||
requires?: { id: string; versionRange?: string }[];
|
||||
};
|
||||
schemaVersion: 1;
|
||||
scope?: TojuPluginInstallScope;
|
||||
settings?: Record<string, unknown>;
|
||||
title: string;
|
||||
ui?: Record<string, unknown>;
|
||||
|
||||
Reference in New Issue
Block a user