@xyd-js/core 0.1.0-xyd.1

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.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @xyd-js/core
2
+
3
+ xyd core kit
@@ -0,0 +1,183 @@
1
+ interface FrontMatter {
2
+ title: string | {
3
+ code: string;
4
+ };
5
+ group?: string[];
6
+ }
7
+ type PageFrontMatter = {
8
+ [page: string]: FrontMatter;
9
+ };
10
+
11
+ interface Settings {
12
+ styling?: Styling;
13
+ structure?: Structure;
14
+ api?: API;
15
+ integrations?: Integrations;
16
+ redirects?: Redirects[];
17
+ seo?: SEO;
18
+ }
19
+ interface Styling {
20
+ name: string;
21
+ logo?: string | Logo | JSX.Element;
22
+ favicon?: string;
23
+ colors?: Colors;
24
+ theme?: ThemeType;
25
+ layout?: LayoutType;
26
+ background?: Background;
27
+ backgroundImage?: string;
28
+ font?: FontDetailsType | {
29
+ headings?: FontDetailsType;
30
+ body?: FontDetailsType;
31
+ };
32
+ modeToggle?: ModeToggle;
33
+ sidebar?: StyleSidebar;
34
+ topbar?: Topbar;
35
+ search?: SearchType;
36
+ rounded?: Rounded;
37
+ }
38
+ interface Logo {
39
+ light?: string;
40
+ dark?: string;
41
+ href?: string;
42
+ }
43
+ interface Colors {
44
+ primary: string;
45
+ light?: string;
46
+ dark?: string;
47
+ background?: {
48
+ light: string;
49
+ dark: string;
50
+ };
51
+ }
52
+ interface Background {
53
+ style?: "gradient" | "grid" | "windows";
54
+ }
55
+ interface FontDetailsType {
56
+ family: string;
57
+ weight?: number;
58
+ url?: string;
59
+ format?: "woff" | "woff2";
60
+ }
61
+ interface ModeToggle {
62
+ default?: "light" | "dark";
63
+ isHidden?: boolean;
64
+ }
65
+ interface StyleSidebar {
66
+ items: "container" | "card" | "border" | "undecorated";
67
+ }
68
+ interface Topbar {
69
+ style: "default" | "gradient";
70
+ }
71
+ type ThemeType = "gusto" | "poetry" | "plato" | "picasso";
72
+ type LayoutType = "app" | "default";
73
+ type SearchType = "side" | "top";
74
+ type Rounded = "default" | "sharp";
75
+ interface Structure {
76
+ sidebar: (SidebarMulti | Sidebar)[];
77
+ header?: Header[];
78
+ topbarCtaButton?: CallToAction;
79
+ versions?: string[];
80
+ anchors?: AnchorRoot;
81
+ footerSocials?: FooterSocials;
82
+ feedback?: Feedback;
83
+ search?: Search;
84
+ }
85
+ interface SidebarMulti {
86
+ match: string;
87
+ items: Sidebar[];
88
+ }
89
+ interface Sidebar {
90
+ group?: string;
91
+ pages?: (string | Sidebar)[];
92
+ icon?: string;
93
+ iconType?: string;
94
+ }
95
+ interface SubHeader {
96
+ match: string;
97
+ name: string;
98
+ items: Header[];
99
+ }
100
+ interface Header {
101
+ name?: string;
102
+ url?: string;
103
+ sub?: SubHeader;
104
+ }
105
+ interface CallToAction {
106
+ type?: "link" | "github";
107
+ url?: string;
108
+ name?: string;
109
+ style?: "pill" | "roundedRectangle";
110
+ arrow?: boolean;
111
+ }
112
+ interface Anchor {
113
+ icon?: string | JSX.Element;
114
+ name?: string;
115
+ url?: string;
116
+ }
117
+ interface AnchorRoot {
118
+ bottom: Anchor[];
119
+ }
120
+ interface FooterSocials {
121
+ [key: string]: string;
122
+ property: string;
123
+ }
124
+ interface Feedback {
125
+ thumbsRating?: boolean;
126
+ suggestEdit?: boolean;
127
+ raiseIssue?: boolean;
128
+ }
129
+ interface Search {
130
+ prompt?: string;
131
+ }
132
+ type APIFile = string | string[] | {
133
+ [id: string]: string;
134
+ };
135
+ interface API {
136
+ info?: APIInfo;
137
+ openapi?: APIFile;
138
+ graphql?: APIFile;
139
+ match?: {
140
+ graphql?: string;
141
+ openapi?: string;
142
+ };
143
+ }
144
+ interface APIInfo {
145
+ baseUrl?: string;
146
+ auth?: APIAuth;
147
+ name?: string;
148
+ inputPrefix?: string;
149
+ playground?: APIPlayground;
150
+ request?: APIInfoRequest;
151
+ paramFields?: ApiParamFields;
152
+ }
153
+ interface APIAuth {
154
+ method: "bearer" | "basic" | "key";
155
+ }
156
+ interface APIPlayground {
157
+ mode?: "show" | "simple" | "hide";
158
+ }
159
+ interface APIInfoRequest {
160
+ example?: {
161
+ languages?: string[];
162
+ };
163
+ }
164
+ interface ApiParamFields {
165
+ expanded: "all" | "topLevel" | "topLevelOneOfs" | "none";
166
+ }
167
+ interface Integrations {
168
+ analytics?: Analytics;
169
+ }
170
+ interface Analytics {
171
+ livesession: {
172
+ trackId: string;
173
+ };
174
+ }
175
+ interface Redirects {
176
+ source: string;
177
+ destination: string;
178
+ }
179
+ interface SEO {
180
+ indexHiddenPages: boolean;
181
+ }
182
+
183
+ export type { API, APIAuth, APIFile, APIInfo, APIInfoRequest, APIPlayground, Analytics, Anchor, AnchorRoot, ApiParamFields, Background, CallToAction, Colors, Feedback, FontDetailsType, FooterSocials, FrontMatter, Header, Integrations, LayoutType, Logo, ModeToggle, PageFrontMatter, Redirects, Rounded, SEO, Search, SearchType, Settings, Sidebar, SidebarMulti, Structure, StyleSidebar, Styling, SubHeader, ThemeType, Topbar };
@@ -0,0 +1,183 @@
1
+ interface FrontMatter {
2
+ title: string | {
3
+ code: string;
4
+ };
5
+ group?: string[];
6
+ }
7
+ type PageFrontMatter = {
8
+ [page: string]: FrontMatter;
9
+ };
10
+
11
+ interface Settings {
12
+ styling?: Styling;
13
+ structure?: Structure;
14
+ api?: API;
15
+ integrations?: Integrations;
16
+ redirects?: Redirects[];
17
+ seo?: SEO;
18
+ }
19
+ interface Styling {
20
+ name: string;
21
+ logo?: string | Logo | JSX.Element;
22
+ favicon?: string;
23
+ colors?: Colors;
24
+ theme?: ThemeType;
25
+ layout?: LayoutType;
26
+ background?: Background;
27
+ backgroundImage?: string;
28
+ font?: FontDetailsType | {
29
+ headings?: FontDetailsType;
30
+ body?: FontDetailsType;
31
+ };
32
+ modeToggle?: ModeToggle;
33
+ sidebar?: StyleSidebar;
34
+ topbar?: Topbar;
35
+ search?: SearchType;
36
+ rounded?: Rounded;
37
+ }
38
+ interface Logo {
39
+ light?: string;
40
+ dark?: string;
41
+ href?: string;
42
+ }
43
+ interface Colors {
44
+ primary: string;
45
+ light?: string;
46
+ dark?: string;
47
+ background?: {
48
+ light: string;
49
+ dark: string;
50
+ };
51
+ }
52
+ interface Background {
53
+ style?: "gradient" | "grid" | "windows";
54
+ }
55
+ interface FontDetailsType {
56
+ family: string;
57
+ weight?: number;
58
+ url?: string;
59
+ format?: "woff" | "woff2";
60
+ }
61
+ interface ModeToggle {
62
+ default?: "light" | "dark";
63
+ isHidden?: boolean;
64
+ }
65
+ interface StyleSidebar {
66
+ items: "container" | "card" | "border" | "undecorated";
67
+ }
68
+ interface Topbar {
69
+ style: "default" | "gradient";
70
+ }
71
+ type ThemeType = "gusto" | "poetry" | "plato" | "picasso";
72
+ type LayoutType = "app" | "default";
73
+ type SearchType = "side" | "top";
74
+ type Rounded = "default" | "sharp";
75
+ interface Structure {
76
+ sidebar: (SidebarMulti | Sidebar)[];
77
+ header?: Header[];
78
+ topbarCtaButton?: CallToAction;
79
+ versions?: string[];
80
+ anchors?: AnchorRoot;
81
+ footerSocials?: FooterSocials;
82
+ feedback?: Feedback;
83
+ search?: Search;
84
+ }
85
+ interface SidebarMulti {
86
+ match: string;
87
+ items: Sidebar[];
88
+ }
89
+ interface Sidebar {
90
+ group?: string;
91
+ pages?: (string | Sidebar)[];
92
+ icon?: string;
93
+ iconType?: string;
94
+ }
95
+ interface SubHeader {
96
+ match: string;
97
+ name: string;
98
+ items: Header[];
99
+ }
100
+ interface Header {
101
+ name?: string;
102
+ url?: string;
103
+ sub?: SubHeader;
104
+ }
105
+ interface CallToAction {
106
+ type?: "link" | "github";
107
+ url?: string;
108
+ name?: string;
109
+ style?: "pill" | "roundedRectangle";
110
+ arrow?: boolean;
111
+ }
112
+ interface Anchor {
113
+ icon?: string | JSX.Element;
114
+ name?: string;
115
+ url?: string;
116
+ }
117
+ interface AnchorRoot {
118
+ bottom: Anchor[];
119
+ }
120
+ interface FooterSocials {
121
+ [key: string]: string;
122
+ property: string;
123
+ }
124
+ interface Feedback {
125
+ thumbsRating?: boolean;
126
+ suggestEdit?: boolean;
127
+ raiseIssue?: boolean;
128
+ }
129
+ interface Search {
130
+ prompt?: string;
131
+ }
132
+ type APIFile = string | string[] | {
133
+ [id: string]: string;
134
+ };
135
+ interface API {
136
+ info?: APIInfo;
137
+ openapi?: APIFile;
138
+ graphql?: APIFile;
139
+ match?: {
140
+ graphql?: string;
141
+ openapi?: string;
142
+ };
143
+ }
144
+ interface APIInfo {
145
+ baseUrl?: string;
146
+ auth?: APIAuth;
147
+ name?: string;
148
+ inputPrefix?: string;
149
+ playground?: APIPlayground;
150
+ request?: APIInfoRequest;
151
+ paramFields?: ApiParamFields;
152
+ }
153
+ interface APIAuth {
154
+ method: "bearer" | "basic" | "key";
155
+ }
156
+ interface APIPlayground {
157
+ mode?: "show" | "simple" | "hide";
158
+ }
159
+ interface APIInfoRequest {
160
+ example?: {
161
+ languages?: string[];
162
+ };
163
+ }
164
+ interface ApiParamFields {
165
+ expanded: "all" | "topLevel" | "topLevelOneOfs" | "none";
166
+ }
167
+ interface Integrations {
168
+ analytics?: Analytics;
169
+ }
170
+ interface Analytics {
171
+ livesession: {
172
+ trackId: string;
173
+ };
174
+ }
175
+ interface Redirects {
176
+ source: string;
177
+ destination: string;
178
+ }
179
+ interface SEO {
180
+ indexHiddenPages: boolean;
181
+ }
182
+
183
+ export type { API, APIAuth, APIFile, APIInfo, APIInfoRequest, APIPlayground, Analytics, Anchor, AnchorRoot, ApiParamFields, Background, CallToAction, Colors, Feedback, FontDetailsType, FooterSocials, FrontMatter, Header, Integrations, LayoutType, Logo, ModeToggle, PageFrontMatter, Redirects, Rounded, SEO, Search, SearchType, Settings, Sidebar, SidebarMulti, Structure, StyleSidebar, Styling, SubHeader, ThemeType, Topbar };
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // index.ts
16
+ var index_exports = {};
17
+ module.exports = __toCommonJS(index_exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../index.ts"],"sourcesContent":["export * from \"./src/types/content\";\n\nexport * from \"./src/types/settings\";\n\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./src/types/content";
2
+
3
+ export * from "./src/types/settings";
4
+
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@xyd-js/core",
3
+ "version": "0.1.0-xyd.1",
4
+ "description": "",
5
+ "main": "./dist/index.js",
6
+ "dependencies": {},
7
+ "devDependencies": {
8
+ "tsup": "^8.3.0"
9
+ },
10
+ "scripts": {
11
+ "clean": "rimraf build",
12
+ "prebuild": "pnpm clean",
13
+ "build": "tsup",
14
+ "watch": "tsup --watch"
15
+ }
16
+ }
@@ -0,0 +1,8 @@
1
+ export interface FrontMatter {
2
+ title: string | {
3
+ code: string // TODO: in the future mechanism similar to codehike
4
+ }
5
+ group?: string[]
6
+ }
7
+
8
+ export type PageFrontMatter = { [page: string]: FrontMatter }
@@ -0,0 +1,374 @@
1
+ export interface Settings {
2
+ // styling configurations for the documentation
3
+ styling?: Styling
4
+
5
+ structure?: Structure
6
+
7
+ api?: API
8
+
9
+ integrations?: Integrations
10
+
11
+ redirects?: Redirects[]
12
+
13
+ seo?: SEO
14
+ }
15
+
16
+ // ------ START setting for styling START ------
17
+ export interface Styling {
18
+ // Name of your company or project. Used for the global title.
19
+ name: string;
20
+
21
+ // Path to logo image or object with path to “light” and “dark” mode logo images, and where the logo links to. SVG format is recommended.
22
+ // It does not pixelate and the file size is generally smaller.
23
+ logo?: string | Logo | JSX.Element
24
+
25
+ // Path to the favicon image. For example: /path/to/favicon.svg
26
+ favicon?: string;
27
+
28
+ // Hex color codes for your global theme
29
+ colors?: Colors
30
+
31
+ // A preset theme configuration that changes the look and feel of the project. A theme is a set of default styling configurations. Examples: gusto, poetry, plato, picasso
32
+ theme?: ThemeType
33
+
34
+ // The global layout style of the documentation.
35
+ layout?: LayoutType
36
+
37
+ // Set a decorative background.
38
+ background?: Background
39
+
40
+ // Set a custom background image to be displayed behind every page.
41
+ backgroundImage?: string
42
+
43
+ // Custom fonts. Apply globally or set different fonts for headings and the body text.
44
+ font?: FontDetailsType | { headings?: FontDetailsType, body?: FontDetailsType }
45
+
46
+ // Customize the dark mode toggle.
47
+ modeToggle?: ModeToggle
48
+
49
+ // Customize the styling of components within the sidebar.
50
+ sidebar?: StyleSidebar
51
+
52
+ // Styling configurations for the topbar.
53
+ topbar?: Topbar
54
+
55
+ // The location of the search bar entry.
56
+ search?: SearchType
57
+
58
+ // The style of the rounded edges.
59
+ rounded?: Rounded
60
+ }
61
+
62
+ export interface Logo {
63
+ // Path to the logo in light mode. For example: `/path/to/logo.svg`
64
+ light?: string;
65
+
66
+ // Path to the logo in dark mode. For example: `/path/to/logo.svg`
67
+ dark?: string;
68
+
69
+ // Where clicking on the logo links you to
70
+ href?: string;
71
+ }
72
+
73
+ export interface Colors {
74
+ // The primary color. Used most often for highlighted content, section headers, accents, in light mode
75
+ primary: string
76
+
77
+ // The primary color for dark mode. Used most often for highlighted content, section headers, accents, in dark mode
78
+ light?: string
79
+
80
+ // The primary color for important buttons
81
+ dark?: string
82
+
83
+ // The color of the background in both light and dark mode
84
+ background?: {
85
+ light: string
86
+
87
+ dark: string
88
+ }
89
+ }
90
+
91
+ export interface Background {
92
+ // The style of the decorative background.
93
+ style?: "gradient" | "grid" | "windows"
94
+ }
95
+
96
+
97
+ export interface FontDetailsType {
98
+ // The font family name. Custom fonts and all Google Fonts are supported. e.g. “Open Sans”, “Playfair Display”
99
+ family: string
100
+
101
+ // The font weight. Precise values such as 560 are also supported for variable fonts. Check under the Styles section for your Google Font for the available weights.
102
+ weight?: number
103
+
104
+ // The URL to the font file. Can be used to specify a font that is not from Google Fonts.
105
+ url?: string
106
+
107
+ // The font format. Required if using a custom font source (url).
108
+ format?: "woff" | "woff2"
109
+
110
+ }
111
+
112
+ export interface ModeToggle {
113
+ // Set if you always want to show light or dark mode for new users. When not set, we default to the same mode as the user’s operating system.
114
+ default?: "light" | "dark"
115
+
116
+ // Set to true to hide the dark/light mode toggle. You can combine isHidden with default to force your docs to only use light or dark mode.
117
+ isHidden?: boolean
118
+ }
119
+
120
+ export interface StyleSidebar {
121
+ // The styling of the sidebar item.
122
+ items: "container" | "card" | "border" | "undecorated"
123
+ }
124
+
125
+ export interface Topbar {
126
+ // Styling configurations for the topbar.
127
+ style: "default" | "gradient"
128
+ }
129
+
130
+ export type ThemeType = "gusto" | "poetry" | "plato" | "picasso"
131
+
132
+ export type LayoutType = "app" | "default"
133
+
134
+ export type SearchType = "side" | "top"
135
+
136
+ export type Rounded = "default" | "sharp"
137
+ // ------ END setting for styling END ------
138
+
139
+
140
+ // ------ START setting for structure START ------
141
+ export interface Structure {
142
+ // Definition of sidebar - an array of groups with all the pages within that group
143
+ sidebar: (SidebarMulti | Sidebar) []
144
+
145
+ // Array of headers
146
+ header?: Header[]
147
+
148
+ // The call to action button in the topbar
149
+ topbarCtaButton?: CallToAction
150
+
151
+ // Array of version names. Only use this if you want to show different versions of docs with a dropdown in the navigation bar.
152
+ versions?: string[]
153
+
154
+ // Anchors, includes the icon, name, and url.
155
+ anchors?: AnchorRoot
156
+
157
+ // An object of social media accounts where the key:property pair represents the social media platform and the account url.
158
+ footerSocials?: FooterSocials
159
+
160
+ // Configurations to enable feedback buttons
161
+ feedback?: Feedback
162
+
163
+ // Configurations to change the search prompt
164
+ search?: Search
165
+ }
166
+
167
+ export interface SidebarMulti {
168
+ // routing match
169
+ match: string
170
+
171
+ // sidebar items
172
+ items: Sidebar[]
173
+ }
174
+
175
+ export interface Sidebar {
176
+ // The name of the group.
177
+ group?: string
178
+
179
+ // The relative paths to the markdown files that will serve as pages.
180
+ // Note: groups are recursive, so to add a sub-folder add another group object in the page array.
181
+ pages?: (string | Sidebar)[]
182
+
183
+ // The Fontawesome icon for the group. Note: this only applies to sub-folders.
184
+ icon?: string
185
+
186
+ // The type of Fontawesome icon. Must be one of: brands, duotone, light, sharp-solid, solid, thin
187
+ iconType?: string
188
+ }
189
+
190
+ export interface SubHeader {
191
+ match: string
192
+ name: string
193
+ items: Header[]
194
+ }
195
+
196
+ export interface Header {
197
+ // The name of the button.
198
+ name?: string
199
+
200
+ // The url once you click on the button. Example: https://mintlify.com/contact
201
+ url?: string
202
+
203
+ sub?: SubHeader
204
+ }
205
+
206
+ export interface CallToAction {
207
+ // Link shows a button. GitHub shows the repo information at the url provided including the number of GitHub stars.
208
+ type?: "link" | "github"
209
+
210
+ // If type is a link: What the button links to. If type is a github: Link to the repository to load GitHub information from.
211
+ url?: string
212
+
213
+ // Text inside the button. Only required if type is a link.
214
+ name?: string
215
+
216
+ // The style of the button.
217
+ style?: "pill" | "roundedRectangle"
218
+
219
+ // Whether to display the arrow
220
+ arrow?: boolean
221
+ }
222
+
223
+ export interface Anchor {
224
+ // The Font Awesome or JSX icon used to feature the anchor.
225
+ icon?: string | JSX.Element
226
+
227
+ // The name of the anchor label.
228
+ name?: string
229
+
230
+ // The start of the URL that marks what pages go in the anchor. Generally, this is the name of the folder you put your pages in.
231
+ url?: string
232
+ }
233
+
234
+ export interface AnchorRoot {
235
+ bottom: Anchor[]
236
+ }
237
+
238
+ export interface FooterSocials {
239
+ // One of the following values website, facebook, x, youtube, discord, slack, github, linkedin, instagram, hacker-news
240
+ [key: string]: string
241
+
242
+ // The URL to the social platform.
243
+ property: string
244
+ }
245
+
246
+ export interface Feedback {
247
+ // Enables a rating system for users to indicate whether the page has been helpful
248
+ thumbsRating?: boolean
249
+
250
+ // Enables a button to allow users to suggest edits via pull requests
251
+ suggestEdit?: boolean
252
+
253
+ // Enables a button to allow users to raise an issue about the documentation
254
+ raiseIssue?: boolean
255
+ }
256
+
257
+ export interface Search {
258
+ // Set the prompt for the search bar. Default is Search...
259
+ prompt?: string
260
+ }
261
+
262
+ // ------ END setting for structure END ------
263
+
264
+
265
+ // ------ START setting for API START ------
266
+ export type APIFile = string | string[] | { [id: string]: string }
267
+
268
+ export interface API {
269
+ info?: APIInfo
270
+
271
+ // A string/array/map of strings of URL(s) or relative path(s) pointing to your OpenAPI file.
272
+ openapi?: APIFile
273
+
274
+ // A string or an array of strings of URL(s) or relative path(s) pointing to your GraphQL file.
275
+ graphql?: APIFile
276
+
277
+ // TODO: better in the future?
278
+ match?: {
279
+ graphql?: string
280
+ openapi?: string
281
+ }
282
+ }
283
+
284
+ export interface APIInfo {
285
+ // The base url for all API endpoints. If baseUrl is an array, it will enable for multiple base url options that the user can toggle.
286
+ baseUrl?: string
287
+
288
+ // auth info
289
+ auth?: APIAuth
290
+
291
+ // The name of the authentication parameter used in the API playground.
292
+ // If method is basic, the format should be [usernameName]:[passwordName]
293
+ name?: string
294
+
295
+ /*
296
+ The default value that’s designed to be a prefix for the authentication input field.
297
+
298
+ E.g. If an inputPrefix of AuthKey would inherit the default input result of the authentication field as AuthKey.
299
+ */
300
+ inputPrefix?: string
301
+
302
+ // Configurations for the API playground
303
+ playground?: APIPlayground
304
+
305
+ request?: APIInfoRequest
306
+
307
+ paramFields?: ApiParamFields
308
+ }
309
+
310
+ export interface APIAuth {
311
+ // The authentication strategy used for all API endpoints.
312
+ method: "bearer" | "basic" | "key"
313
+ }
314
+
315
+ export interface APIPlayground {
316
+ mode?: "show" | "simple" | "hide"
317
+ }
318
+
319
+ export interface APIInfoRequest {
320
+ // Configurations for the auto-generated API request examples
321
+ example?: {
322
+ /*
323
+ An array of strings that determine the order of the languages of the auto-generated request examples.
324
+ You can either define custom languages utilizing x-codeSamples or use our default languages which include bash, python, javascript, php, go, java
325
+ */
326
+ languages?: string[]
327
+ }
328
+ }
329
+
330
+ export interface ApiParamFields {
331
+ /*
332
+ The default expanded state of expandable options in the API playground.
333
+
334
+ "all" - every expandable component is expanded
335
+
336
+ "topLevel" - every top-level expandable component is expanded
337
+
338
+ "topLevelOneOfs" - every top-level oneOf type is expanded
339
+
340
+ "none" - every expandable component is closed (default behavior)
341
+ */
342
+ expanded: "all" | "topLevel" | "topLevelOneOfs" | "none"
343
+ }
344
+
345
+ // ------ END setting for API END ------
346
+
347
+
348
+ // ------ START setting for integrations START ------
349
+ export interface Integrations {
350
+ // Configurations to add third-party analytics integrations. See full list of supported analytics here.
351
+ analytics?: Analytics
352
+ }
353
+
354
+ export interface Analytics {
355
+ livesession: {
356
+ trackId: string
357
+ }
358
+ }
359
+
360
+ // ------ END setting for integrations END ------
361
+
362
+
363
+ // ------ START setting for redirecs START ------
364
+ export interface Redirects {
365
+ source: string
366
+
367
+ destination: string
368
+ }
369
+
370
+ export interface SEO {
371
+ indexHiddenPages: boolean
372
+ }
373
+
374
+ // ------ END setting for redirects END ------
package/tsconfig.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "esnext",
4
+ "esModuleInterop": true,
5
+ "moduleResolution": "node",
6
+ "target": "ES6",
7
+ "lib": [
8
+ "dom",
9
+ "dom.iterable",
10
+ "esnext"
11
+ ],
12
+ "allowJs": true,
13
+ "skipLibCheck": true,
14
+ "strict": false,
15
+ "noEmit": true,
16
+ "incremental": false,
17
+ "resolveJsonModule": true,
18
+ "isolatedModules": true,
19
+ "jsx": "preserve",
20
+ "plugins": [
21
+ {
22
+ "name": "next"
23
+ }
24
+ ],
25
+ "strictNullChecks": true
26
+ },
27
+ "include": [
28
+ "next-env.d.ts",
29
+ "**/*.ts",
30
+ "**/*.tsx",
31
+ ".next/types/**/*.ts"
32
+ ],
33
+ "exclude": [
34
+ "node_modules"
35
+ ]
36
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,22 @@
1
+ import {defineConfig, Options} from 'tsup';
2
+
3
+ const config: Options = {
4
+ entry: ['index.ts'],
5
+ format: ['esm', 'cjs'], // Output both ESM and CJS formats
6
+ target: 'node16', // Ensure compatibility with Node.js 16
7
+ dts: {
8
+ entry: 'index.ts', // Specify the entry for DTS
9
+ resolve: true, // Resolve external types
10
+ },
11
+ splitting: false, // Disable code splitting
12
+ sourcemap: true, // Generate source maps
13
+ clean: true, // Clean the output directory before each build
14
+ esbuildOptions: (options) => {
15
+ options.platform = 'node'; // Ensure the platform is set to Node.js
16
+ options.external = ['node:fs/promises']; // Mark 'node:fs/promises' as external
17
+ options.loader = {'.js': 'jsx'}; // Ensure proper handling of .js files
18
+ },
19
+ ignoreWatch: ['node_modules', 'dist', '.git', 'build'] // Exclude unnecessary directories
20
+ }
21
+
22
+ export default defineConfig(config);