Skip to content

Commit

Permalink
Update candid type definitions in the JS code (#2510)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles committed Oct 6, 2022
1 parent 37eab1e commit 9be9dde
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 3 deletions.
3 changes: 3 additions & 0 deletions frontend/src/services/group/candid/idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ export const idlFactory = ({ IDL }) => {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : IDL.Nat64,
});
const EventsSuccessResult = IDL.Record({
'affected_events' : IDL.Vec(ChatEventWrapper),
Expand Down Expand Up @@ -568,6 +569,7 @@ export const idlFactory = ({ IDL }) => {
'event' : Message,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : IDL.Nat64,
});
const MessagesByMessageIndexResponse = IDL.Variant({
'ThreadMessageNotFound' : IDL.Null,
Expand Down Expand Up @@ -794,6 +796,7 @@ export const idlFactory = ({ IDL }) => {
'CallerNotInGroup' : IDL.Null,
'Success' : IDL.Record({
'threads' : IDL.Vec(ThreadPreview),
'timestamp' : TimestampMillis,
}),
});
const UnblockUserArgs = IDL.Record({
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/services/group/candid/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export interface ChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type ChatId = CanisterId;
export interface ChatMetrics {
Expand Down Expand Up @@ -202,6 +203,7 @@ export interface DirectChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export interface DirectChatSummary {
'date_created' : TimestampMillis,
Expand Down Expand Up @@ -517,6 +519,7 @@ export interface MessageEventWrapper {
'event' : Message,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type MessageId = bigint;
export type MessageIndex = number;
Expand Down Expand Up @@ -639,6 +642,7 @@ export interface OwnershipTransferred {
export interface PartialUserSummary {
'username' : [] | [string],
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down Expand Up @@ -914,6 +918,7 @@ export type ThreadPreviewsResponse = {
{
'Success' : {
'threads' : Array<ThreadPreview>,
'timestamp' : TimestampMillis,
}
};
export interface ThreadSummary {
Expand Down Expand Up @@ -989,6 +994,7 @@ export type UserId = CanisterId;
export interface UserSummary {
'username' : string,
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/services/groupIndex/candid/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface ChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type ChatId = CanisterId;
export interface ChatMetrics {
Expand Down Expand Up @@ -134,6 +135,7 @@ export interface DirectChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export interface DirectChatSummary {
'date_created' : TimestampMillis,
Expand Down Expand Up @@ -395,6 +397,7 @@ export interface MessageEventWrapper {
'event' : Message,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type MessageId = bigint;
export type MessageIndex = number;
Expand Down Expand Up @@ -485,6 +488,7 @@ export interface OwnershipTransferred {
export interface PartialUserSummary {
'username' : [] | [string],
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down Expand Up @@ -660,6 +664,7 @@ export type UserId = CanisterId;
export interface UserSummary {
'username' : string,
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/services/notifications/candid/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export const Notification = IDL.Variant({
}),
'timestamp' : IDL.Nat64,
'index' : IDL.Nat32,
'correlation_id' : IDL.Nat64,
}),
'timestamp' : IDL.Nat64,
'reaction' : IDL.Text,
Expand Down Expand Up @@ -582,6 +583,7 @@ export const Notification = IDL.Variant({
}),
'timestamp' : IDL.Nat64,
'index' : IDL.Nat32,
'correlation_id' : IDL.Nat64,
}),
'sender_name' : IDL.Text,
'thread_root_message_index' : IDL.Opt(IDL.Nat32),
Expand Down Expand Up @@ -877,6 +879,7 @@ export const Notification = IDL.Variant({
}),
'timestamp' : IDL.Nat64,
'index' : IDL.Nat32,
'correlation_id' : IDL.Nat64,
}),
'sender_name' : IDL.Text,
'chat_id' : IDL.Principal,
Expand Down Expand Up @@ -1172,6 +1175,7 @@ export const Notification = IDL.Variant({
}),
'timestamp' : IDL.Nat64,
'index' : IDL.Nat32,
'correlation_id' : IDL.Nat64,
}),
'timestamp' : IDL.Nat64,
'chat_id' : IDL.Principal,
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/services/notifications/candid/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface ChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type ChatId = CanisterId;
export interface ChatMetrics {
Expand Down Expand Up @@ -134,6 +135,7 @@ export interface DirectChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export interface DirectChatSummary {
'date_created' : TimestampMillis,
Expand Down Expand Up @@ -389,6 +391,7 @@ export interface MessageEventWrapper {
'event' : Message,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type MessageId = bigint;
export type MessageIndex = number;
Expand Down Expand Up @@ -479,6 +482,7 @@ export interface OwnershipTransferred {
export interface PartialUserSummary {
'username' : [] | [string],
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down Expand Up @@ -658,6 +662,7 @@ export type UserId = CanisterId;
export interface UserSummary {
'username' : string,
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/services/user/candid/idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ export const idlFactory = ({ IDL }) => {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : IDL.Nat64,
});
const EventsSuccessResult = IDL.Record({
'affected_events' : IDL.Vec(ChatEventWrapper),
Expand Down Expand Up @@ -616,6 +617,7 @@ export const idlFactory = ({ IDL }) => {
'event' : Message,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : IDL.Nat64,
});
const GroupChatSummary = IDL.Record({
'is_public' : IDL.Bool,
Expand Down Expand Up @@ -853,7 +855,7 @@ export const idlFactory = ({ IDL }) => {
});
const SendMessageResponse = IDL.Variant({
'TextTooLong' : IDL.Nat32,
'TransferLimitExceeded' : IDL.Nat64,
'TransferLimitExceeded' : IDL.Nat,
'TransferSuccessV2' : IDL.Record({
'timestamp' : TimestampMillis,
'chat_id' : ChatId,
Expand Down Expand Up @@ -899,7 +901,7 @@ export const idlFactory = ({ IDL }) => {
});
const TransferCryptoWithinGroupResponse = IDL.Variant({
'TextTooLong' : IDL.Nat32,
'TransferLimitExceeded' : Tokens,
'TransferLimitExceeded' : IDL.Nat,
'CallerNotInGroup' : IDL.Opt(CompletedCryptoTransaction),
'TransferCannotBeZero' : IDL.Null,
'Success' : IDL.Record({
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/services/user/candid/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export interface ChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type ChatId = CanisterId;
export interface ChatMessagesRead {
Expand Down Expand Up @@ -208,6 +209,7 @@ export interface DirectChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export interface DirectChatSummary {
'date_created' : TimestampMillis,
Expand Down Expand Up @@ -555,6 +557,7 @@ export interface MessageEventWrapper {
'event' : Message,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type MessageId = bigint;
export type MessageIndex = number;
Expand Down Expand Up @@ -671,6 +674,7 @@ export interface OwnershipTransferred {
export interface PartialUserSummary {
'username' : [] | [string],
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down Expand Up @@ -946,7 +950,7 @@ export interface TransferCryptoWithinGroupArgs {
'thread_root_message_index' : [] | [MessageIndex],
}
export type TransferCryptoWithinGroupResponse = { 'TextTooLong' : number } |
{ 'TransferLimitExceeded' : Tokens } |
{ 'TransferLimitExceeded' : bigint } |
{ 'CallerNotInGroup' : [] | [CompletedCryptoTransaction] } |
{ 'TransferCannotBeZero' : null } |
{
Expand Down Expand Up @@ -1003,6 +1007,7 @@ export type UserId = CanisterId;
export interface UserSummary {
'username' : string,
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/services/userIndex/candid/idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const idlFactory = ({ IDL }) => {
const UserSummary = IDL.Record({
'username' : IDL.Text,
'user_id' : UserId,
'is_bot' : IDL.Bool,
'avatar_id' : IDL.Opt(IDL.Nat),
'seconds_since_last_online' : IDL.Nat32,
});
Expand Down Expand Up @@ -180,6 +181,7 @@ export const idlFactory = ({ IDL }) => {
const PartialUserSummary = IDL.Record({
'username' : IDL.Opt(IDL.Text),
'user_id' : UserId,
'is_bot' : IDL.Bool,
'avatar_id' : IDL.Opt(IDL.Nat),
'seconds_since_last_online' : IDL.Nat32,
});
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/services/userIndex/candid/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export interface ChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type ChatId = CanisterId;
export interface ChatMetrics {
Expand Down Expand Up @@ -171,6 +172,7 @@ export interface DirectChatEventWrapper {
'event' : ChatEvent,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export interface DirectChatSummary {
'date_created' : TimestampMillis,
Expand Down Expand Up @@ -426,6 +428,7 @@ export interface MessageEventWrapper {
'event' : Message,
'timestamp' : TimestampMillis,
'index' : EventIndex,
'correlation_id' : bigint,
}
export type MessageId = bigint;
export type MessageIndex = number;
Expand Down Expand Up @@ -516,6 +519,7 @@ export interface OwnershipTransferred {
export interface PartialUserSummary {
'username' : [] | [string],
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down Expand Up @@ -762,6 +766,7 @@ export type UserResponse = { 'Success' : UserSummary } |
export interface UserSummary {
'username' : string,
'user_id' : UserId,
'is_bot' : boolean,
'avatar_id' : [] | [bigint],
'seconds_since_last_online' : number,
}
Expand Down

0 comments on commit 9be9dde

Please sign in to comment.