mirror of
https://github.com/hexastack/hexabot
synced 2025-02-22 20:38:32 +00:00
refactor: remove unecessary type
This commit is contained in:
parent
0737cd99c6
commit
b57e4693c5
@ -28,8 +28,3 @@ export interface AttachmentPayload<
|
||||
type: FileType;
|
||||
payload: A;
|
||||
}
|
||||
|
||||
export interface IncomingAttachmentPayload {
|
||||
type: FileType;
|
||||
payload: AttachmentForeignKey;
|
||||
}
|
||||
|
@ -11,11 +11,7 @@ import { PluginName } from '@/plugins/types';
|
||||
|
||||
import { Message } from '../message.schema';
|
||||
|
||||
import {
|
||||
AttachmentForeignKey,
|
||||
AttachmentPayload,
|
||||
IncomingAttachmentPayload,
|
||||
} from './attachment';
|
||||
import { AttachmentForeignKey, AttachmentPayload } from './attachment';
|
||||
import { Button } from './button';
|
||||
import { ContentOptions } from './options';
|
||||
import { StdQuickReply } from './quick-reply';
|
||||
@ -146,7 +142,9 @@ export type StdIncomingLocationMessage = {
|
||||
export type StdIncomingAttachmentMessage = {
|
||||
type: PayloadType.attachments;
|
||||
serialized_text: string;
|
||||
attachment: IncomingAttachmentPayload | IncomingAttachmentPayload[];
|
||||
attachment:
|
||||
| AttachmentPayload<AttachmentForeignKey>
|
||||
| AttachmentPayload<AttachmentForeignKey>[];
|
||||
};
|
||||
|
||||
export type StdIncomingMessage =
|
||||
|
@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
||||
*/
|
||||
|
||||
import { IncomingAttachmentPayload } from './attachment';
|
||||
import { AttachmentForeignKey, AttachmentPayload } from './attachment';
|
||||
import { PayloadType } from './message';
|
||||
|
||||
export type Payload =
|
||||
@ -19,7 +19,7 @@ export type Payload =
|
||||
}
|
||||
| {
|
||||
type: PayloadType.attachments;
|
||||
attachments: IncomingAttachmentPayload;
|
||||
attachments: AttachmentPayload<AttachmentForeignKey>;
|
||||
};
|
||||
|
||||
export enum QuickReplyType {
|
||||
|
@ -63,15 +63,7 @@ export interface AttachmentPayload<
|
||||
payload?: A;
|
||||
}
|
||||
|
||||
export interface IncomingAttachmentPayload {
|
||||
type: FileType;
|
||||
payload: {
|
||||
url: string;
|
||||
};
|
||||
}
|
||||
|
||||
// Content
|
||||
|
||||
export interface ContentOptions {
|
||||
display: OutgoingMessageFormat.list | OutgoingMessageFormat.carousel;
|
||||
fields: {
|
||||
@ -104,7 +96,7 @@ export type Payload =
|
||||
}
|
||||
| {
|
||||
type: PayloadType.attachments;
|
||||
attachments: IncomingAttachmentPayload;
|
||||
attachments: AttachmentPayload<AttachmentForeignKey>;
|
||||
};
|
||||
|
||||
export enum QuickReplyType {
|
||||
@ -198,7 +190,9 @@ export type StdIncomingLocationMessage = {
|
||||
export type StdIncomingAttachmentMessage = {
|
||||
type: PayloadType.attachments;
|
||||
serialized_text: string;
|
||||
attachment: IncomingAttachmentPayload | IncomingAttachmentPayload[];
|
||||
attachment:
|
||||
| AttachmentPayload<AttachmentForeignKey>
|
||||
| AttachmentPayload<AttachmentForeignKey>[];
|
||||
};
|
||||
|
||||
export type StdPluginMessage = {
|
||||
|
Loading…
Reference in New Issue
Block a user