Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
321402e
refactor(types): swap `sub_type` and `summary`, making nullable value…
Wesley-Young Nov 7, 2025
179cd14
feat(types): add set profile APIs
Wesley-Young Nov 7, 2025
944250b
feat(types): add delete_friend API
Wesley-Young Nov 14, 2025
45e0104
feat(types): add type counterparts for new APIs
Wesley-Young Nov 17, 2025
b8e4a12
feat(types): add get_custom_face_url_list endpoint
Wesley-Young Nov 17, 2025
7be0260
feat(types): add metainfo fields for market face segment
Wesley-Young Nov 17, 2025
2dc7c39
feat(types): add is_large attribute to `face` segment
Wesley-Young Dec 5, 2025
4f60384
feat(types): add `normal` default value to OutgoingSegment.image.sub_…
Wesley-Young Dec 5, 2025
bedebcc
feat(communication): add authentication to WebHook
Wesley-Young Dec 5, 2025
c72b9ca
chore: remove deprecated `baseUrl` usage
Wesley-Young Dec 6, 2025
7dd108d
Merge branch 'main' into 1.1
Wesley-Young Dec 13, 2025
80c714b
refactor(types): enforce positive integers, remove hard bounds for int32
Wesley-Young Dec 14, 2025
fd576d5
Merge branch 'main' into 1.1
Wesley-Young Dec 15, 2025
76c64ee
Merge branch 'main' into 1.1
Wesley-Young Dec 15, 2025
4deb7c7
refactor(tyoes): replace ZInt64 with ZUin for user and group id acros…
Wesley-Young Dec 15, 2025
c72d44e
refactor(types): remove redundant describe calls
Wesley-Young Dec 15, 2025
83a1e47
feat(types): append metadata for incoming forwards
Wesley-Young Dec 15, 2025
e95bece
feat(docs): add Q&A on forward fields
Wesley-Young Dec 15, 2025
966b8b9
update(types): bump version to 1.1.0-rc.1
Wesley-Young Dec 16, 2025
00a86af
update: upgrade `types` deps
Wesley-Young Dec 16, 2025
359ef43
chore: fix ts and eslint config, run reformat
Wesley-Young Dec 16, 2025
cdc98a6
fix(docs): upgrade zod, resolve type and eslint errors
Wesley-Young Dec 16, 2025
2ef0237
feat(docs): add 1.1.0 changelog
Wesley-Young Dec 16, 2025
f22d82b
Merge remote-tracking branch 'origin/main' into 1.1
Wesley-Young Dec 17, 2025
6610db2
feat(types): add operator_id to GroupAdminChangeEvent and GroupEssenc…
Wesley-Young Dec 17, 2025
dca566f
update: update changelog; bump version to 1.1.0-rc.2
Wesley-Young Dec 17, 2025
504713c
fix(types): ZUin should extend ZInt64
Wesley-Young Dec 17, 2025
f4d5197
fix(types): append correct meta to ZUin
Wesley-Young Dec 17, 2025
c9ab543
fix(types): emoji_id should be string
Wesley-Young Dec 17, 2025
63a25a3
update(types): bump version to 1.1.0-rc.3
Wesley-Young Dec 17, 2025
c2ad077
chore: migrate to tsdown
Wesley-Young Dec 17, 2025
e34e79c
fix(types): repair exports, bump to rc.4
Wesley-Young Dec 19, 2025
224d775
fix(types): correct SetNicknameInput param name
Wesley-Young Dec 23, 2025
ca6dd71
update(types): bump version to 1.1.0-rc.5
Wesley-Young Dec 23, 2025
0baf3bf
feat(docs): annotate defaults with @LiteralDefault in kt src gen
Wesley-Young Dec 25, 2025
72057fa
Merge branch 'main' into 1.1
Wesley-Young Dec 25, 2025
7f5902e
fix(types): change ZInt32 and ZInt64 from positive to non-negative
Wesley-Young Dec 27, 2025
a0a8de0
update(types): bump version to 1.1.0-rc.6
Wesley-Young Dec 27, 2025
7ee83b3
feat(docs): add experimental dart codegen
Wesley-Young Dec 28, 2025
d1e2125
feat(docs): add headers configuration for raw content
Wesley-Young Dec 29, 2025
2960d7d
feat(docs): add raw preview page and replace links in awesome.md
Wesley-Young Dec 30, 2025
3cd10ee
chore(docs): revise generated file headers
Wesley-Young Dec 30, 2025
e3ca91a
fix(docs): wrap raw preview into suspense
Wesley-Young Dec 30, 2025
9e15de5
refactor(docs): migrate FAQ to Issue #46
Wesley-Young Jan 9, 2026
e28320b
update: bump version to 1.1.0
Wesley-Young Jan 9, 2026
2f3dab8
update: bump dependency versions
Wesley-Young Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/app/[[...mdxPath]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateStaticParamsFor, importPage } from 'nextra/pages';
import { useMDXComponents as getMDXComponents } from '../../mdx-components';
import { useMDXComponents as getMDXComponents } from '@/mdx-components';
import { Metadata } from 'next';

export const generateStaticParams = generateStaticParamsFor('mdxPath');
Expand Down
2 changes: 1 addition & 1 deletion docs/app/api/[apiCategoryId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import StructRenderer from '@/component/StructRenderer';
import { apiCategories } from '@/app/common';
import { useMDXComponents as getMDXComponents } from '../../../mdx-components';
import { useMDXComponents as getMDXComponents } from '@/mdx-components';
import { ZodVoid } from 'zod';
import { Metadata } from 'next';

Expand Down
2 changes: 1 addition & 1 deletion docs/app/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Object.entries(commonStructs).forEach(([name, schema]) => {

if (schema instanceof z.ZodDiscriminatedUnion) {
schema.options.forEach((option) => {
const optionAsZodObject = option as z.ZodObject<any>;
const optionAsZodObject = option as z.ZodObject;
z.globalRegistry.add(optionAsZodObject, {
title: optionAsZodObject.description,
description: optionAsZodObject.description,
Expand Down
4 changes: 2 additions & 2 deletions docs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
<body>
<Layout
banner={
<Banner storageKey={'milky-1.0-draft'}>🎉 Milky 1.0.0 已发布! 🎉</Banner>
<Banner storageKey={'milky-1.1.0'}>🎉 Milky 1.1 已发布! 🎉</Banner>
}
navbar={
<Navbar
Expand All @@ -42,7 +42,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
></Navbar>
}
pageMap={[
...(await getPageMap()),
...(await getPageMap()).filter(p => !('route' in p) || p.route !== '/raw-preview'),
{
name: 'api',
route: '/api',
Expand Down
151 changes: 151 additions & 0 deletions docs/app/raw-preview/RawPreviewClient.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
'use client';

import { useEffect, useMemo, useState } from 'react';
import { useSearchParams } from 'next/navigation';
import { Code, Pre } from 'nextra/components';
import { useMDXComponents as getMDXComponents } from '@/mdx-components';
import { Link } from 'nextra-theme-docs';

type FetchState = {
content: string;
error: string | null;
loading: boolean;
};

const Wrapper = getMDXComponents().wrapper;

function isValidPath(value: string) {
if (!value) return false;
if (value.startsWith('/')) return false;
if (value.includes('..')) return false;
return true;
}

function buildRawUrl(rawPath: string) {
const encoded = rawPath
.split('/')
.filter(Boolean)
.map((segment) => encodeURIComponent(segment))
.join('/');
return `/raw/${encoded}`;
}

async function copyText(text: string): Promise<boolean> {
try {
await navigator.clipboard.writeText(text);
console.log('复制成功');
return true;
} catch (err) {
console.error('复制失败:', err);
return false;
}
}

export default function RawPreviewClient() {
const searchParams = useSearchParams();
const rawPath = useMemo(() => searchParams.get('path')?.trim() ?? '', [searchParams]);
const [state, setState] = useState<FetchState>({
content: '',
error: null,
loading: false,
});
const pathWithOrigin = useMemo(() => {
if (typeof window === 'undefined') return '';
return new URL(window.location.origin + `/raw/${rawPath}`).toString();
}, [rawPath]);
const [contentCopySuccess, setContentCopySuccess] = useState<boolean | null>(null);
const [pathCopySuccess, setPathCopySuccess] = useState<boolean | null>(null);

useEffect(() => {
if (!rawPath) {
setState({ content: '', error: '请提供 path 查询参数。', loading: false });
return;
}
if (!isValidPath(rawPath)) {
setState({ content: '', error: 'path 不合法,请使用相对路径且不要包含 .. 。', loading: false });
return;
}

const url = buildRawUrl(rawPath);
let cancelled = false;
setState((prev) => ({ ...prev, loading: true, error: null }));
fetch(url)
.then((res) => {
if (!res.ok) throw new Error(`请求失败: ${res.status}`);
let text = res.text();
if (rawPath.endsWith('.json')) {
// Format JSON for better readability
text = text.then((t) => {
try {
const obj = JSON.parse(t);
return JSON.stringify(obj, null, 2);
} catch {
return t;
}
});
}
return text;
})
.then((text) => {
if (cancelled) return;
setState({ content: text, error: null, loading: false });
})
.catch((err: Error) => {
if (cancelled) return;
setState({ content: '', error: err.message, loading: false });
});

return () => {
cancelled = true;
};
}, [rawPath]);

return (
<Wrapper toc={[]} metadata={{ title: 'Raw Preview' }}>
<p
className="x:tracking-tight x:text-slate-900 x:dark:text-slate-100 x:mt-2 x:text-4xl"
style={{ fontSize: '2.25rem', marginBottom: '0.5em' }}
>
<b>Raw Preview</b>
</p>
{state.loading ? (
<div>Loading...</div>
) : state.error ? (
<div style={{ color: '#b42318' }}>{state.error}</div>
) : (
<>
<div>
<Link
onClick={async () => {
const success = await copyText(state.content);
setContentCopySuccess(success);
setTimeout(() => setContentCopySuccess(null), 2000);
}}
>
复制内容
</Link>
{contentCopySuccess === true && <span style={{ marginLeft: '8px', color: 'green' }}>复制成功</span>}
{contentCopySuccess === false && <span style={{ marginLeft: '8px', color: 'red' }}>复制失败</span>}
</div>
<div>
<Link
onClick={async () => {
const success = await copyText(pathWithOrigin);
setPathCopySuccess(success);
setTimeout(() => setPathCopySuccess(null), 2000);
}}
>
复制路径
</Link>
{pathCopySuccess === true && <span style={{ marginLeft: '8px', color: 'green' }}>复制成功</span>}
{pathCopySuccess === false && <span style={{ marginLeft: '8px', color: 'red' }}>复制失败</span>}
<Code style={{ marginLeft: '8px' }}>{pathWithOrigin}</Code>
</div>
<Pre style={{ padding: '16px' }} data-pagefind-ignore={'true'}>
<Code>{state.content}</Code>
</Pre>
</>
)}
</Wrapper>
);
}
10 changes: 10 additions & 0 deletions docs/app/raw-preview/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Suspense } from 'react';
import RawPreviewClient from './RawPreviewClient';

export default function RawPreviewPage() {
return (
<Suspense fallback={<div style={{ padding: '1.5rem 1.25rem' }}>加载中...</div>}>
<RawPreviewClient />
</Suspense>
);
}
Loading