diff --git a/.cargo/config.toml b/.cargo/config.toml index b23105b..ba0a868 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,6 @@ [registries.crates-io] -protocol = "sparse" \ No newline at end of file +protocol = "sparse" + +[target.x86_64-unknown-linux-gnu] +linker = "clang" +rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"] diff --git a/fe_calckey/frontend/magnetar-common/src/be-api.ts b/fe_calckey/frontend/magnetar-common/src/be-api.ts new file mode 100644 index 0000000..063c0cc --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/be-api.ts @@ -0,0 +1,112 @@ +import {FrontendApiEndpoint, FrontendApiEndpoints} from "./fe-api"; +import {GetNoteById} from "./types/endpoints/GetNoteById"; + +type Method = "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; + +export interface BackendApiEndpoint { + method: M; + endpoint: string; + pathParams: [string], + request?: T; + response?: R; +} + +function nestedUrlSearchParams(data: any, topLevel: boolean = true): string { + switch (typeof data) { + case "string": + case "bigint": + case "boolean": + case "number": + case "symbol": + if (topLevel) + return encodeURIComponent(data.toString()) + "="; + + return data.toString(); + case "object": + if (data === null) + return "null"; + + if (Array.isArray(data)) + return data.map(d => nestedUrlSearchParams(d, true)) + .map(encodeURIComponent) + .join("&"); + + const inner = Object.entries(data) + .map(([k, v]) => [k, nestedUrlSearchParams(v, false)]); + + return new URLSearchParams(inner).toString(); + + default: + return ""; + } +} + +type MagApiErrorCode = "Client:GenericApiError" | string; + +export interface MagApiError { + status: number; + code: MagApiErrorCode, + message: string, +} + +export class MagApiClient { + private readonly baseUrl: string; + + constructor(baseUrl: string) { + this.baseUrl = baseUrl; + } + + async call>( + endpoint: T["endpoint"], + method: M, + data: T["request"], + pathParams: Record, + token?: string | null | undefined + ): Promise { + type Response = T["response"]; + + const authorizationToken = token ?? undefined; + const authorization = authorizationToken + ? `Bearer ${authorizationToken}` + : undefined; + + let url = `${this.baseUrl}/${endpoint}`; + + if (method === "GET") { + const query = nestedUrlSearchParams(data as any); + if (query) { + url += `?${query}`; + } + } + + return await fetch(url, { + method, + body: method !== "GET" ? JSON.stringify(data) : undefined, + credentials: "omit", + cache: "no-cache", + headers: authorization ? {authorization} : {}, + }) + .then(async (res) => { + const body = res.status === 204 ? null : await res.json(); + + if (res.status === 200) { + return body as Response; + } else if (res.status === 204) { + return null as any as Response; + } else { + throw body as MagApiError; + } + }) + .catch((e) => { + throw ({ + status: -1, + code: "Client:GenericApiError", + message: e + }) as MagApiError; + }); + } +} + + +const a = new MagApiClient("https://aaa"); +a.call<"GET", GetNoteById>("", "",{}, {}) diff --git a/fe_calckey/frontend/magnetar-common/src/types/AvatarDecoration.ts b/fe_calckey/frontend/magnetar-common/src/types/AvatarDecoration.ts new file mode 100644 index 0000000..8121ee6 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/AvatarDecoration.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AvatarDecoration = "None" | "CatEars"; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/DriveFileBase.ts b/fe_calckey/frontend/magnetar-common/src/types/DriveFileBase.ts new file mode 100644 index 0000000..8662b0a --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/DriveFileBase.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ImageMeta } from "./ImageMeta"; + +export interface DriveFileBase { name: string, created_at: string, size: bigint, hash: string | null, mime_type: string, media_metadata: ImageMeta, url: string | null, thumbnail_url: string | null, sensitive: boolean, comment: string | null, folder_id: string | null, user_id: string | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/DriveFileFolderExt.ts b/fe_calckey/frontend/magnetar-common/src/types/DriveFileFolderExt.ts new file mode 100644 index 0000000..0f209f5 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/DriveFileFolderExt.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackDriveFolderBase } from "./packed/PackDriveFolderBase"; + +export interface DriveFileFolderExt { folder: PackDriveFolderBase, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/DriveFileUserExt.ts b/fe_calckey/frontend/magnetar-common/src/types/DriveFileUserExt.ts new file mode 100644 index 0000000..c5e96a5 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/DriveFileUserExt.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackUserBase } from "./packed/PackUserBase"; + +export interface DriveFileUserExt { user: PackUserBase, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/DriveFolderBase.ts b/fe_calckey/frontend/magnetar-common/src/types/DriveFolderBase.ts new file mode 100644 index 0000000..4ab23d2 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/DriveFolderBase.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface DriveFolderBase { name: string, created_at: string, comment: string | null, file_count: bigint, folder_count: bigint, parent_id: string | null, user_id: string, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/DriveFolderParentExt.ts b/fe_calckey/frontend/magnetar-common/src/types/DriveFolderParentExt.ts new file mode 100644 index 0000000..86ef03b --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/DriveFolderParentExt.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DriveFolderBase } from "./DriveFolderBase"; + +export interface DriveFolderParentExt { folder: DriveFolderBase, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/EmojiBase.ts b/fe_calckey/frontend/magnetar-common/src/types/EmojiBase.ts new file mode 100644 index 0000000..b7e2704 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/EmojiBase.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface EmojiBase { shortcode: string, url: string, category: string | null, width: number | null, height: number | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/EmojiContext.ts b/fe_calckey/frontend/magnetar-common/src/types/EmojiContext.ts new file mode 100644 index 0000000..a1ee4b6 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/EmojiContext.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackEmojiBase } from "./packed/PackEmojiBase"; + +export type EmojiContext = Array; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/FollowVisibility.ts b/fe_calckey/frontend/magnetar-common/src/types/FollowVisibility.ts new file mode 100644 index 0000000..a04d682 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/FollowVisibility.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type FollowVisibility = "Public" | "Followers" | "Private"; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/GetTimelineReq.ts b/fe_calckey/frontend/magnetar-common/src/types/GetTimelineReq.ts new file mode 100644 index 0000000..f084102 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/GetTimelineReq.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { NoteListFilter } from "./NoteListFilter"; + +export interface GetTimelineReq { limit: bigint, filter: NoteListFilter | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/Id.ts b/fe_calckey/frontend/magnetar-common/src/types/Id.ts new file mode 100644 index 0000000..14270f1 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/Id.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface Id { id: string, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/ImageMeta.ts b/fe_calckey/frontend/magnetar-common/src/types/ImageMeta.ts new file mode 100644 index 0000000..e7fefb6 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/ImageMeta.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface ImageMeta { width: bigint | null, height: bigint | null, orientation: bigint | null, color: string | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/MmXml.ts b/fe_calckey/frontend/magnetar-common/src/types/MmXml.ts new file mode 100644 index 0000000..2addd37 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/MmXml.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type MmXml = string; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/NoteAttachmentExt.ts b/fe_calckey/frontend/magnetar-common/src/types/NoteAttachmentExt.ts new file mode 100644 index 0000000..35efeeb --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/NoteAttachmentExt.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackDriveFileBase } from "./packed/PackDriveFileBase"; +import type { PackPollBase } from "./packed/PackPollBase"; + +export interface NoteAttachmentExt { poll: PackPollBase | null, attachments: Array, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/NoteBase.ts b/fe_calckey/frontend/magnetar-common/src/types/NoteBase.ts new file mode 100644 index 0000000..99aca93 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/NoteBase.ts @@ -0,0 +1,8 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { EmojiContext } from "./EmojiContext"; +import type { MmXml } from "./MmXml"; +import type { NoteVisibility } from "./NoteVisibility"; +import type { PackUserBase } from "./packed/PackUserBase"; +import type { ReactionPair } from "./ReactionPair"; + +export interface NoteBase { created_at: string, cw: string | null, cw_mm: MmXml | null, uri: string | null, url: string | null, text: string, text_mm: MmXml | null, visibility: NoteVisibility, user: PackUserBase, parent_note_id: string | null, renoted_note_id: string | null, reply_count: bigint, renote_count: bigint, mentions: Array, hashtags: Array, reactions: Array, local_only: boolean, has_poll: boolean, file_ids: Array, emojis: EmojiContext, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/NoteByIdReq.ts b/fe_calckey/frontend/magnetar-common/src/types/NoteByIdReq.ts new file mode 100644 index 0000000..afa4fa8 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/NoteByIdReq.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface NoteByIdReq { context: boolean, attachments: boolean, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/NoteListFilter.ts b/fe_calckey/frontend/magnetar-common/src/types/NoteListFilter.ts new file mode 100644 index 0000000..7cc828b --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/NoteListFilter.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface NoteListFilter { show_renotes: boolean | null, show_replies: boolean | null, show_files_only: boolean | null, uncwed_sensitive: boolean | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/NoteSelfContextExt.ts b/fe_calckey/frontend/magnetar-common/src/types/NoteSelfContextExt.ts new file mode 100644 index 0000000..f14a08a --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/NoteSelfContextExt.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface NoteSelfContextExt { self_renote_count: bigint | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/NoteVisibility.ts b/fe_calckey/frontend/magnetar-common/src/types/NoteVisibility.ts new file mode 100644 index 0000000..06ce891 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/NoteVisibility.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type NoteVisibility = "Public" | "Home" | "Followers" | "Direct"; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/NotificationSettings.ts b/fe_calckey/frontend/magnetar-common/src/types/NotificationSettings.ts new file mode 100644 index 0000000..d7e440c --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/NotificationSettings.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { NotificationType } from "./NotificationType"; + +export interface NotificationSettings { enabled: Array, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/NotificationType.ts b/fe_calckey/frontend/magnetar-common/src/types/NotificationType.ts new file mode 100644 index 0000000..8a53267 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/NotificationType.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type NotificationType = "Follow" | "Mention" | "Reply" | "Renote" | "Quote" | "Reaction" | "PollVote" | "PollEnded" | "FollowRequest" | "FollowRequestAccepted" | "App"; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/PollBase.ts b/fe_calckey/frontend/magnetar-common/src/types/PollBase.ts new file mode 100644 index 0000000..5547095 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/PollBase.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PollChoice } from "./PollChoice"; + +export interface PollBase { expires_at: string | null, expired: boolean, multiple_choice: boolean, options: Array, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/PollChoice.ts b/fe_calckey/frontend/magnetar-common/src/types/PollChoice.ts new file mode 100644 index 0000000..5a3677e --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/PollChoice.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface PollChoice { title: string, votes_count: bigint, voted: boolean | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/ProfileField.ts b/fe_calckey/frontend/magnetar-common/src/types/ProfileField.ts new file mode 100644 index 0000000..d174e42 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/ProfileField.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { MmXml } from "./MmXml"; + +export interface ProfileField { name: string, value: string, value_mm: MmXml | null, verified_at: string | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/Reaction.ts b/fe_calckey/frontend/magnetar-common/src/types/Reaction.ts new file mode 100644 index 0000000..f78902e --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/Reaction.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Reaction = string | { name: string, host: string | null, url: string, } | { raw: string, }; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/ReactionPair.ts b/fe_calckey/frontend/magnetar-common/src/types/ReactionPair.ts new file mode 100644 index 0000000..5cb8f91 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/ReactionPair.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Reaction } from "./Reaction"; + +export type ReactionPair = [Reaction, bigint] | [Reaction, bigint, boolean]; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/SecurityKeyBase.ts b/fe_calckey/frontend/magnetar-common/src/types/SecurityKeyBase.ts new file mode 100644 index 0000000..4c43089 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/SecurityKeyBase.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface SecurityKeyBase { name: string, last_used_at: string | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/SpeechTransform.ts b/fe_calckey/frontend/magnetar-common/src/types/SpeechTransform.ts new file mode 100644 index 0000000..dfd5930 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/SpeechTransform.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type SpeechTransform = "None" | "Cat"; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserAuthOverviewExt.ts b/fe_calckey/frontend/magnetar-common/src/types/UserAuthOverviewExt.ts new file mode 100644 index 0000000..7aa93fa --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserAuthOverviewExt.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface UserAuthOverviewExt { has_two_factor_enabled: boolean, has_passwordless_login: boolean, has_security_keys: boolean, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserBase.ts b/fe_calckey/frontend/magnetar-common/src/types/UserBase.ts new file mode 100644 index 0000000..ee510e6 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserBase.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AvatarDecoration } from "./AvatarDecoration"; +import type { EmojiContext } from "./EmojiContext"; +import type { MmXml } from "./MmXml"; +import type { SpeechTransform } from "./SpeechTransform"; + +export interface UserBase { acct: string, username: string, display_name: string, display_name_mm: MmXml | null, host: string | null, speech_transform: SpeechTransform, created_at: string, avatar_url: string | null, avatar_blurhash: string | null, avatar_color: string | null, avatar_decoration: AvatarDecoration, is_admin: boolean, is_moderator: boolean, is_bot: boolean, emojis: EmojiContext, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserByIdReq.ts b/fe_calckey/frontend/magnetar-common/src/types/UserByIdReq.ts new file mode 100644 index 0000000..1da49a6 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserByIdReq.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface UserByIdReq { profile: boolean, pins: boolean, detail: boolean, relation: boolean, auth: boolean, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserDetailExt.ts b/fe_calckey/frontend/magnetar-common/src/types/UserDetailExt.ts new file mode 100644 index 0000000..adfd2bb --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserDetailExt.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface UserDetailExt { last_fetched_at: string | null, uri: string | null, updated_at: string | null, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserProfileExt.ts b/fe_calckey/frontend/magnetar-common/src/types/UserProfileExt.ts new file mode 100644 index 0000000..37976c0 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserProfileExt.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { MmXml } from "./MmXml"; +import type { ProfileField } from "./ProfileField"; + +export interface UserProfileExt { is_locked: boolean, is_silenced: boolean, is_suspended: boolean, description: string | null, description_mm: MmXml | null, location: string | null, birthday: string | null, fields: Array, follower_count: bigint | null, following_count: bigint | null, note_count: bigint | null, url: string | null, moved_to_uri: string | null, also_known_as: string | null, banner_url: string | null, banner_color: string | null, banner_blurhash: string | null, has_public_reactions: boolean, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserProfilePinsEx.ts b/fe_calckey/frontend/magnetar-common/src/types/UserProfilePinsEx.ts new file mode 100644 index 0000000..18f6842 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserProfilePinsEx.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackNoteMaybeFull } from "./packed/PackNoteMaybeFull"; + +export interface UserProfilePinsEx { pinned_notes: Array, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserRelationExt.ts b/fe_calckey/frontend/magnetar-common/src/types/UserRelationExt.ts new file mode 100644 index 0000000..04b9e29 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserRelationExt.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface UserRelationExt { follows_you: boolean, you_follow: boolean, blocks_you: boolean, you_block: boolean, mute: boolean, mute_renotes: boolean, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserSecretsExt.ts b/fe_calckey/frontend/magnetar-common/src/types/UserSecretsExt.ts new file mode 100644 index 0000000..4ba1e2c --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserSecretsExt.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackSecurityKeyBase } from "./packed/PackSecurityKeyBase"; + +export interface UserSecretsExt { email: string | null, email_verified: boolean, security_keys: Array, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserSelfExt.ts b/fe_calckey/frontend/magnetar-common/src/types/UserSelfExt.ts new file mode 100644 index 0000000..64c179c --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserSelfExt.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { NotificationSettings } from "./NotificationSettings"; + +export interface UserSelfExt { avatar_id: string | null, banner_id: string | null, email_announcements: boolean, always_mark_sensitive: boolean, reject_bot_follow_requests: boolean, reject_crawlers: boolean, reject_ai_training: boolean, has_unread_announcements: boolean, has_unread_antenna: boolean, has_unread_notifications: boolean, has_pending_follow_requests: boolean, word_mutes: Array, instance_mutes: Array, notification_settings: NotificationSettings, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/UserSelfReq.ts b/fe_calckey/frontend/magnetar-common/src/types/UserSelfReq.ts new file mode 100644 index 0000000..b0527fc --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/UserSelfReq.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface UserSelfReq { profile: boolean, pins: boolean, detail: boolean, secrets: boolean, } \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetNoteById.ts b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetNoteById.ts new file mode 100644 index 0000000..6c96a1f --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetNoteById.ts @@ -0,0 +1,11 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { NoteByIdReq } from "../NoteByIdReq"; +import type { PackNoteMaybeFull } from "../packed/PackNoteMaybeFull"; + +interface GetNoteById { + endpoint: "/notes/:id", + pathParams: ["id"], + method: "GET", + request: NoteByIdReq, + response: PackNoteMaybeFull +} diff --git a/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetTimeline.ts b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetTimeline.ts new file mode 100644 index 0000000..6ef7183 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetTimeline.ts @@ -0,0 +1,12 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { GetTimelineReq } from "../GetTimelineReq"; +import type { PackNoteMaybeFull } from "../packed/PackNoteMaybeFull"; + +export interface GetTimeline { + endpoint: "/timeline"; + pathParams: []; + method: "GET"; + request: GetTimelineReq; + response: Array; +} + \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserByAcct.ts b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserByAcct.ts new file mode 100644 index 0000000..5846031 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserByAcct.ts @@ -0,0 +1,12 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackUserMaybeAll } from "../packed/PackUserMaybeAll"; +import type { UserByIdReq } from "../UserByIdReq"; + +export interface GetUserByAcct { + endpoint: "/users/by-acct/:user_id"; + pathParams: ["user_id"]; + method: "GET"; + request: UserByIdReq; + response: PackUserMaybeAll; +} + \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserById.ts b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserById.ts new file mode 100644 index 0000000..b951f3f --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserById.ts @@ -0,0 +1,12 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackUserMaybeAll } from "../packed/PackUserMaybeAll"; +import type { UserByIdReq } from "../UserByIdReq"; + +export interface GetUserById { + endpoint: "/users/:user_id"; + pathParams: ["user_id"]; + method: "GET"; + request: UserByIdReq; + response: PackUserMaybeAll; +} + \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserSelf.ts b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserSelf.ts new file mode 100644 index 0000000..2702509 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/endpoints/GetUserSelf.ts @@ -0,0 +1,12 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PackUserSelfMaybeAll } from "../packed/PackUserSelfMaybeAll"; +import type { UserSelfReq } from "../UserSelfReq"; + +export interface GetUserSelf { + endpoint: "/users/@self"; + pathParams: []; + method: "GET"; + request: UserSelfReq; + response: PackUserSelfMaybeAll; +} + \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileBase.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileBase.ts new file mode 100644 index 0000000..187eec5 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileBase.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DriveFileBase } from "../DriveFileBase"; +import type { Id } from "../Id"; + +export type PackDriveFileBase = Id & DriveFileBase; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileFull.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileFull.ts new file mode 100644 index 0000000..5536c92 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileFull.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DriveFileBase } from "../DriveFileBase"; +import type { DriveFileFolderExt } from "../DriveFileFolderExt"; +import type { DriveFileUserExt } from "../DriveFileUserExt"; +import type { Id } from "../Id"; + +export type PackDriveFileFull = Id & DriveFileBase & DriveFileFolderExt & DriveFileUserExt; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileWithFolder.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileWithFolder.ts new file mode 100644 index 0000000..c888ebf --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileWithFolder.ts @@ -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 { DriveFileBase } from "../DriveFileBase"; +import type { DriveFileFolderExt } from "../DriveFileFolderExt"; +import type { Id } from "../Id"; + +export type PackDriveFileWithFolder = Id & DriveFileBase & DriveFileFolderExt; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileWithUser.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileWithUser.ts new file mode 100644 index 0000000..65baaab --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFileWithUser.ts @@ -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 { DriveFileBase } from "../DriveFileBase"; +import type { DriveFileUserExt } from "../DriveFileUserExt"; +import type { Id } from "../Id"; + +export type PackDriveFileWithUser = Id & DriveFileBase & DriveFileUserExt; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFolderBase.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFolderBase.ts new file mode 100644 index 0000000..4a9429d --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFolderBase.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DriveFolderBase } from "../DriveFolderBase"; +import type { Id } from "../Id"; + +export type PackDriveFolderBase = Id & DriveFolderBase; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFolderWithParent.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFolderWithParent.ts new file mode 100644 index 0000000..2b6af70 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackDriveFolderWithParent.ts @@ -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 { DriveFolderBase } from "../DriveFolderBase"; +import type { DriveFolderParentExt } from "../DriveFolderParentExt"; +import type { Id } from "../Id"; + +export type PackDriveFolderWithParent = Id & DriveFolderBase & DriveFolderParentExt; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackEmojiBase.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackEmojiBase.ts new file mode 100644 index 0000000..7ad8c7a --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackEmojiBase.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { EmojiBase } from "../EmojiBase"; +import type { Id } from "../Id"; + +export type PackEmojiBase = Id & EmojiBase; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteBase.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteBase.ts new file mode 100644 index 0000000..2586669 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteBase.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Id } from "../Id"; +import type { NoteBase } from "../NoteBase"; + +export type PackNoteBase = Id & NoteBase; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteMaybeAttachments.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteMaybeAttachments.ts new file mode 100644 index 0000000..1b7f8bf --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteMaybeAttachments.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Id } from "../Id"; +import type { NoteAttachmentExt } from "../NoteAttachmentExt"; +import type { NoteBase } from "../NoteBase"; +import type { NoteSelfContextExt } from "../NoteSelfContextExt"; + +export type PackNoteMaybeAttachments = Id & NoteBase & Partial & Partial; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteMaybeFull.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteMaybeFull.ts new file mode 100644 index 0000000..bb834c7 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackNoteMaybeFull.ts @@ -0,0 +1,8 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Id } from "../Id"; +import type { NoteAttachmentExt } from "../NoteAttachmentExt"; +import type { NoteBase } from "../NoteBase"; +import type { NoteDetailExt } from "../NoteDetailExt"; +import type { NoteSelfContextExt } from "../NoteSelfContextExt"; + +export type PackNoteMaybeFull = Id & NoteBase & Partial & Partial & Partial; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackPollBase.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackPollBase.ts new file mode 100644 index 0000000..4a28cf3 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackPollBase.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Id } from "../Id"; +import type { PollBase } from "../PollBase"; + +export type PackPollBase = Id & PollBase; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackSecurityKeyBase.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackSecurityKeyBase.ts new file mode 100644 index 0000000..db208c8 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackSecurityKeyBase.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Id } from "../Id"; +import type { SecurityKeyBase } from "../SecurityKeyBase"; + +export type PackSecurityKeyBase = Id & SecurityKeyBase; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserBase.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserBase.ts new file mode 100644 index 0000000..d00fac6 --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserBase.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Id } from "../Id"; +import type { UserBase } from "../UserBase"; + +export type PackUserBase = Id & UserBase; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserMaybeAll.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserMaybeAll.ts new file mode 100644 index 0000000..7869d9d --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserMaybeAll.ts @@ -0,0 +1,10 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Id } from "../Id"; +import type { UserAuthOverviewExt } from "../UserAuthOverviewExt"; +import type { UserBase } from "../UserBase"; +import type { UserDetailExt } from "../UserDetailExt"; +import type { UserProfileExt } from "../UserProfileExt"; +import type { UserProfilePinsEx } from "../UserProfilePinsEx"; +import type { UserRelationExt } from "../UserRelationExt"; + +export type PackUserMaybeAll = Id & UserBase & Partial & Partial & Partial & Partial & Partial; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserSelf.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserSelf.ts new file mode 100644 index 0000000..477f13e --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserSelf.ts @@ -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 { Id } from "../Id"; +import type { UserBase } from "../UserBase"; +import type { UserSelfExt } from "../UserSelfExt"; + +export type PackUserSelf = Id & UserBase & UserSelfExt; \ No newline at end of file diff --git a/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserSelfMaybeAll.ts b/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserSelfMaybeAll.ts new file mode 100644 index 0000000..0b4169b --- /dev/null +++ b/fe_calckey/frontend/magnetar-common/src/types/packed/PackUserSelfMaybeAll.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Id } from "../Id"; +import type { UserBase } from "../UserBase"; +import type { UserDetailExt } from "../UserDetailExt"; +import type { UserProfileExt } from "../UserProfileExt"; +import type { UserProfilePinsEx } from "../UserProfilePinsEx"; +import type { UserSecretsExt } from "../UserSecretsExt"; + +export type PackUserSelfMaybeAll = Id & UserBase & Partial & Partial & Partial & Partial; \ No newline at end of file diff --git a/fe_calckey/frontend/package.json b/fe_calckey/frontend/package.json index 22c0e0f..0e18aa3 100644 --- a/fe_calckey/frontend/package.json +++ b/fe_calckey/frontend/package.json @@ -9,8 +9,9 @@ "packageManager": "pnpm@8.6.3", "private": true, "scripts": { - "rebuild": "pnpm run clean && pnpm -r run build && pnpm run gulp", - "build": "pnpm -r run build && pnpm run gulp", + "magnetar-types": "pnpm node ./scripts/magnetar-types.js", + "rebuild": "pnpm run clean && pnpm run magnetar-types && pnpm -r run build && pnpm run gulp", + "build": "pnpm run magnetar-types && pnpm -r run build && pnpm run gulp", "gulp": "gulp build", "dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development pnpm run build && pnpm run start", "lint": "pnpm -r run lint", diff --git a/fe_calckey/frontend/scripts/magnetar-types.js b/fe_calckey/frontend/scripts/magnetar-types.js new file mode 100644 index 0000000..b9af35d --- /dev/null +++ b/fe_calckey/frontend/scripts/magnetar-types.js @@ -0,0 +1,33 @@ +const fs = require("node:fs"); +const execa = require("execa"); +const chalk = require("chalk"); +const { join } = require("node:path"); + +(async () => { + console.log(chalk.italic`Generating Magnetar types, this may take a while...`) + + const { failed } = await execa.command("cargo test --release --package magnetar_sdk", { + cwd: "../../magnetar_sdk", + stdout: "inherit" + }); + + if (failed) { + console.error(chalk.red`Type generation failed.`); + return; + } + + console.log(chalk.green`Successfully generated Magnetar types`); + + const srcPath = "../../magnetar_sdk/bindings"; + const destPath = "magnetar-common/src/types"; + + + console.log(chalk.italic`Deleting old`, `"${destPath}"`); + fs.rmSync(destPath, { recursive: true, force: true }); + console.log(chalk.italic`Copying generated Magnetar types...`); + console.log(chalk.italic`From`, `"${srcPath}"`, chalk.italic`to`, `"${destPath}"`); + fs.cpSync(`${srcPath}/`, `${destPath}/`, { recursive: true }); + console.log(chalk.italic`Deleting`, `"${srcPath}"`); + fs.rmSync(srcPath, { recursive: true, force: true }); + +})(); diff --git a/magnetar_sdk/macros/src/lib.rs b/magnetar_sdk/macros/src/lib.rs index 4792975..be482da 100644 --- a/magnetar_sdk/macros/src/lib.rs +++ b/magnetar_sdk/macros/src/lib.rs @@ -272,6 +272,24 @@ pub fn derive_endpoint(item: TokenStream) -> TokenStream { let request = request.expect("missing request attribute"); let response = response.expect("missing response attribute"); + let mut endpoint_chars = endpoint.chars(); + let mut path_params = String::from("["); + while let Some(c) = endpoint_chars.next() { + if c == ':' { + if !path_params.ends_with('[') { + path_params += ", "; + } + + path_params += "\""; + path_params += &endpoint_chars + .clone() + .take_while(|c| c.is_ascii_alphanumeric() || *c == '_') + .collect::(); + path_params += "\""; + } + } + path_params += "]"; + let ts_path = format!("bindings/endpoints/{}.ts", name); let export_name = Ident::new( &format!("export_bindings_{}", struct_name.to_string().to_lowercase()), @@ -340,6 +358,7 @@ pub fn derive_endpoint(item: TokenStream) -> TokenStream { format!( "interface {} {{\n \ endpoint: \"{}\";\n \ + pathParams: {};\n \ method: \"{}\";\n \ request: {};\n \ response: {};\n\ @@ -347,6 +366,7 @@ pub fn derive_endpoint(item: TokenStream) -> TokenStream { ", Self::name(), Self::ENDPOINT, + #path_params, Self::METHOD, #call_name_req, #call_name_res diff --git a/magnetar_sdk/src/types/note.rs b/magnetar_sdk/src/types/note.rs index 30de780..3c43b76 100644 --- a/magnetar_sdk/src/types/note.rs +++ b/magnetar_sdk/src/types/note.rs @@ -93,6 +93,7 @@ pack!( ); #[derive(Clone, Debug, Deserialize, Serialize, TS)] +#[ts(export)] pub struct NoteDetailExt { pub parent_note: Option>, pub renoted_note: Option>,