Skip to content

Commit

Permalink
Update TS types
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles committed Nov 15, 2024
1 parent 166526b commit ee14726
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
29 changes: 20 additions & 9 deletions frontend/openchat-agent/src/typebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4208,15 +4208,6 @@ export const OptionUpdateOptionalMessagePermissions = Type.Union(
{ default: "NoChange" },
);

export type AccessTokenType = Static<typeof AccessTokenType>;
export const AccessTokenType = Type.Union([
Type.Object({
StartVideoCallV2: VideoCallAccessTokenArgs,
}),
Type.Literal("JoinVideoCall"),
Type.Literal("MarkVideoCallAsEnded"),
]);

export type PendingCryptoTransactionICRC2 = Static<typeof PendingCryptoTransactionICRC2>;
export const PendingCryptoTransactionICRC2 = Type.Object({
ledger: TSBytes,
Expand Down Expand Up @@ -4526,6 +4517,14 @@ export const DiamondMembershipDetails = Type.Object({
subscription: DiamondMembershipSubscription,
});

export type BotCommandArgs = Static<typeof BotCommandArgs>;
export const BotCommandArgs = Type.Object({
user_id: UserId,
bot: UserId,
thread_root_message_index: Type.Optional(Type.Union([MessageIndex, Type.Undefined()])),
message_id: MessageId,
});

export type MemberLeft = Static<typeof MemberLeft>;
export const MemberLeft = Type.Object({
user_id: UserId,
Expand Down Expand Up @@ -6074,6 +6073,18 @@ export const GroupFrozen = Type.Object({
reason: Type.Optional(Type.Union([Type.String(), Type.Undefined()])),
});

export type AccessTokenType = Static<typeof AccessTokenType>;
export const AccessTokenType = Type.Union([
Type.Object({
StartVideoCallV2: VideoCallAccessTokenArgs,
}),
Type.Literal("JoinVideoCall"),
Type.Literal("MarkVideoCallAsEnded"),
Type.Object({
BotCommand: BotCommandArgs,
}),
]);

export type FailedCryptoTransactionICRC2 = Static<typeof FailedCryptoTransactionICRC2>;
export const FailedCryptoTransactionICRC2 = Type.Object({
ledger: TSBytes,
Expand Down
3 changes: 2 additions & 1 deletion tsBindings/shared/AccessTokenType.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { BotCommandArgs } from "./BotCommandArgs";
import type { VideoCallAccessTokenArgs } from "./VideoCallAccessTokenArgs";

export type AccessTokenType = { "StartVideoCallV2": VideoCallAccessTokenArgs } | "JoinVideoCall" | "MarkVideoCallAsEnded";
export type AccessTokenType = { "StartVideoCallV2": VideoCallAccessTokenArgs } | "JoinVideoCall" | "MarkVideoCallAsEnded" | { "BotCommand": BotCommandArgs };
6 changes: 6 additions & 0 deletions tsBindings/shared/BotCommandArgs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { MessageId } from "./MessageId";
import type { MessageIndex } from "./MessageIndex";
import type { UserId } from "./UserId";

export type BotCommandArgs = { user_id: UserId, bot: UserId, thread_root_message_index?: MessageIndex | undefined, message_id: MessageId, };
2 changes: 2 additions & 0 deletions tsBindings/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ export type ThreadSummary = { participant_ids: Array<UserId>, followed_by_me: bo
export type OptionUpdateDocument = "NoChange" | "SetToNone" | { "SetToSome": Document };
export type SuspensionDetails = { reason: string, action: SuspensionAction, suspended_by: UserId, };
export type DiamondMembershipDetails = { expires_at: bigint, pay_in_chat: boolean, subscription: DiamondMembershipSubscription, };
export type BotCommandArgs = { user_id: UserId, bot: UserId, thread_root_message_index?: MessageIndex | undefined, message_id: MessageId, };
export type MemberLeft = { user_id: UserId, };
export type UserGroupDetails = { user_group_id: number, name: string, members: Array<UserId>, };
export type GroupIndexRecommendedGroupsArgs = { count: number, exclusions: Array<ChatId>, };
Expand Down Expand Up @@ -643,6 +644,7 @@ export type Tips = Array<[TSBytes, Array<[UserId, bigint]>]>;
export type CallParticipant = { user_id: UserId, joined: bigint, };
export type PermissionsChanged = { old_permissions_v2: GroupPermissions, new_permissions_v2: GroupPermissions, changed_by: UserId, };
export type GroupFrozen = { frozen_by: UserId, reason?: string | undefined, };
export type AccessTokenType = { "StartVideoCallV2": VideoCallAccessTokenArgs } | "JoinVideoCall" | "MarkVideoCallAsEnded" | { "BotCommand": BotCommandArgs };
export type FailedCryptoTransactionICRC2 = { ledger: TSBytes, token: Cryptocurrency, amount: bigint, fee: bigint, spender: UserId, from: CryptoAccountICRC1, to: CryptoAccountICRC1, memo?: TSBytes | undefined, created: bigint, error_message: string, };
export type Proposal = { "NNS": NnsProposal } | { "SNS": SnsProposal };
export type UsersInvited = { user_ids: Array<UserId>, invited_by: UserId, };
Expand Down

0 comments on commit ee14726

Please sign in to comment.