mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
refactor: remove unecessary type
This commit is contained in:
parent
0737cd99c6
commit
b57e4693c5
@ -28,8 +28,3 @@ export interface AttachmentPayload<
|
|||||||
type: FileType;
|
type: FileType;
|
||||||
payload: A;
|
payload: A;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IncomingAttachmentPayload {
|
|
||||||
type: FileType;
|
|
||||||
payload: AttachmentForeignKey;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -11,11 +11,7 @@ import { PluginName } from '@/plugins/types';
|
|||||||
|
|
||||||
import { Message } from '../message.schema';
|
import { Message } from '../message.schema';
|
||||||
|
|
||||||
import {
|
import { AttachmentForeignKey, AttachmentPayload } from './attachment';
|
||||||
AttachmentForeignKey,
|
|
||||||
AttachmentPayload,
|
|
||||||
IncomingAttachmentPayload,
|
|
||||||
} from './attachment';
|
|
||||||
import { Button } from './button';
|
import { Button } from './button';
|
||||||
import { ContentOptions } from './options';
|
import { ContentOptions } from './options';
|
||||||
import { StdQuickReply } from './quick-reply';
|
import { StdQuickReply } from './quick-reply';
|
||||||
@ -146,7 +142,9 @@ export type StdIncomingLocationMessage = {
|
|||||||
export type StdIncomingAttachmentMessage = {
|
export type StdIncomingAttachmentMessage = {
|
||||||
type: PayloadType.attachments;
|
type: PayloadType.attachments;
|
||||||
serialized_text: string;
|
serialized_text: string;
|
||||||
attachment: IncomingAttachmentPayload | IncomingAttachmentPayload[];
|
attachment:
|
||||||
|
| AttachmentPayload<AttachmentForeignKey>
|
||||||
|
| AttachmentPayload<AttachmentForeignKey>[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type StdIncomingMessage =
|
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:
|
* 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.
|
* 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).
|
* 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';
|
import { PayloadType } from './message';
|
||||||
|
|
||||||
export type Payload =
|
export type Payload =
|
||||||
@ -19,7 +19,7 @@ export type Payload =
|
|||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: PayloadType.attachments;
|
type: PayloadType.attachments;
|
||||||
attachments: IncomingAttachmentPayload;
|
attachments: AttachmentPayload<AttachmentForeignKey>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum QuickReplyType {
|
export enum QuickReplyType {
|
||||||
|
|||||||
@ -63,15 +63,7 @@ export interface AttachmentPayload<
|
|||||||
payload?: A;
|
payload?: A;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IncomingAttachmentPayload {
|
|
||||||
type: FileType;
|
|
||||||
payload: {
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Content
|
// Content
|
||||||
|
|
||||||
export interface ContentOptions {
|
export interface ContentOptions {
|
||||||
display: OutgoingMessageFormat.list | OutgoingMessageFormat.carousel;
|
display: OutgoingMessageFormat.list | OutgoingMessageFormat.carousel;
|
||||||
fields: {
|
fields: {
|
||||||
@ -104,7 +96,7 @@ export type Payload =
|
|||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: PayloadType.attachments;
|
type: PayloadType.attachments;
|
||||||
attachments: IncomingAttachmentPayload;
|
attachments: AttachmentPayload<AttachmentForeignKey>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum QuickReplyType {
|
export enum QuickReplyType {
|
||||||
@ -198,7 +190,9 @@ export type StdIncomingLocationMessage = {
|
|||||||
export type StdIncomingAttachmentMessage = {
|
export type StdIncomingAttachmentMessage = {
|
||||||
type: PayloadType.attachments;
|
type: PayloadType.attachments;
|
||||||
serialized_text: string;
|
serialized_text: string;
|
||||||
attachment: IncomingAttachmentPayload | IncomingAttachmentPayload[];
|
attachment:
|
||||||
|
| AttachmentPayload<AttachmentForeignKey>
|
||||||
|
| AttachmentPayload<AttachmentForeignKey>[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type StdPluginMessage = {
|
export type StdPluginMessage = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user