kecare-tools 1.0.0-beta.43 → 1.0.0-beta.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/__VERSION__.ts +1 -1
  2. package/index.ts +103 -49
  3. package/package.json +1 -1
package/__VERSION__.ts CHANGED
@@ -1 +1 @@
1
- export const __VERSION__ = '1.0.0-beta.43'
1
+ export const __VERSION__ = '1.0.0-beta.49'
package/index.ts CHANGED
@@ -1,49 +1,103 @@
1
- export type Article = {
2
- id: string;
3
- title: string;
4
- sticky?: number;
5
- desc?: string;
6
- coverSrc?: string;
7
- contentHtml: string;
8
- date: string;
9
- author?: string;
10
- to: string;
11
- menu?: string | null;
12
- menudata?: NavItem[] | null;
13
- headings: Heading[];
14
- hidden?: boolean;
15
- filename?: string;
16
- };
17
-
18
- export type HeadingH1 = {
19
- depth: 1;
20
- text: string;
21
- id: string;
22
- children: HeadingH2[];
23
- };
24
- export type HeadingH2 = {
25
- depth: 2;
26
- text: string;
27
- id: string;
28
- };
29
- export type Heading = HeadingH1 | HeadingH2;
30
-
31
- export type ArticleListGenerator = (params: { projectPath: string; article: Article; articles: Article[]; NavItems: NavItem[] }) => Promise<{
32
- path: string;
33
- template: string;
34
- }>;
35
-
36
- export type PagesListGenerator = (params: { projectPath: string; page: number; cards: []; isIndex: number; pageSize: number; totalPages: number; totalArticles: number; listTitle: number }) => Promise<{
37
- path: string;
38
- template: string;
39
- }>;
40
-
41
- export type NavItem = { text: string; link: string; level: number; desc?: string; icon?: string } | { text: string; items: NavItem[]; level: number };
42
-
43
- export function defineArticleListGenerator<Generator extends ArticleListGenerator>(yourGenerator: Generator) {
44
- return yourGenerator;
45
- }
46
-
47
- export function PagesListGenerator<Generator extends PagesListGenerator>(yourGenerator: Generator) {
48
- return yourGenerator;
49
- }
1
+ export type Article = {
2
+ id: string;
3
+ title: string;
4
+ sticky?: number;
5
+ desc?: string;
6
+ coverSrc?: string;
7
+ contentHtml: string;
8
+ date: string;
9
+ author?: string;
10
+ to: string;
11
+ menu?: string | null;
12
+ menudata?: NavItem[] | null;
13
+ headings: Heading[];
14
+ hidden?: boolean;
15
+ filename?: string;
16
+ translate?: boolean;
17
+ targetLanguage?: string;
18
+ Variant: ArticleVariant;
19
+ };
20
+
21
+ type ArticleVariant = {
22
+ title: string | undefined;
23
+ contentHtml: string | undefined;
24
+ language: string | undefined;
25
+ };
26
+
27
+ export type HeadingH1 = {
28
+ depth: 1;
29
+ text: string;
30
+ id: string;
31
+ children: HeadingH2[];
32
+ };
33
+ export type HeadingH2 = {
34
+ depth: 2;
35
+ text: string;
36
+ id: string;
37
+ };
38
+ export type Heading = HeadingH1 | HeadingH2;
39
+
40
+ /**
41
+ * Translation configuration (user-configurable settings)
42
+ */
43
+ export type TranslationConfigOptions = {
44
+ /**
45
+ * Model name (e.g., 'deepseek-chat', 'gpt-4', etc.)
46
+ */
47
+ model?: string;
48
+ /**
49
+ * API base URL
50
+ */
51
+ baseUrl?: string;
52
+ /**
53
+ * API key
54
+ */
55
+ apiKey?: string;
56
+ /**
57
+ * Additional system prompts
58
+ */
59
+ additionalPrompts?: string[];
60
+ };
61
+
62
+ export type TranslateCallOptions = {
63
+ /**
64
+ * Text to translate
65
+ */
66
+ text: string;
67
+ /**
68
+ * Target language (optional, defaults to TranslationConfig.targetLanguage)
69
+ */
70
+ targetLanguage?: string;
71
+ /**
72
+ * Model name (optional, defaults to TranslationConfig.model)
73
+ */
74
+ model?: string;
75
+ /**
76
+ * Additional system prompts (optional, defaults to TranslationConfig.additionalPrompts)
77
+ */
78
+ additionalPrompts?: string[];
79
+ /*
80
+ *
81
+ */
82
+ title: string;
83
+ };
84
+
85
+ export type ArticleListGenerator = (params: { projectPath: string; article: Article; articles: Article[]; NavItems: NavItem[] }) => Promise<{
86
+ path: string;
87
+ template: string;
88
+ }>;
89
+
90
+ export type PagesListGenerator = (params: { projectPath: string; page: number; cards: []; isIndex: number; pageSize: number; totalPages: number; totalArticles: number; listTitle: number }) => Promise<{
91
+ path: string;
92
+ template: string;
93
+ }>;
94
+
95
+ export type NavItem = { text: string; link: string; level: number; desc?: string; icon?: string } | { text: string; items: NavItem[]; level: number };
96
+
97
+ export function defineArticleListGenerator<Generator extends ArticleListGenerator>(yourGenerator: Generator) {
98
+ return yourGenerator;
99
+ }
100
+
101
+ export function PagesListGenerator<Generator extends PagesListGenerator>(yourGenerator: Generator) {
102
+ return yourGenerator;
103
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kecare-tools",
3
- "version": "1.0.0-beta.43",
3
+ "version": "1.0.0-beta.49",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "repository": {