@btst/stack 1.6.0 → 1.8.0
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/dist/api/index.cjs +7 -1
- package/dist/api/index.d.cts +2 -2
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.mjs +7 -1
- package/dist/client/index.cjs +6 -2
- package/dist/client/index.d.cts +2 -1
- package/dist/client/index.d.mts +2 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.mjs +6 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/packages/better-stack/src/plugins/open-api/api/generator.cjs +300 -0
- package/dist/packages/better-stack/src/plugins/open-api/api/generator.mjs +284 -0
- package/dist/packages/better-stack/src/plugins/open-api/api/plugin.cjs +115 -0
- package/dist/packages/better-stack/src/plugins/open-api/api/plugin.mjs +113 -0
- package/dist/packages/better-stack/src/plugins/open-api/db.cjs +7 -0
- package/dist/packages/better-stack/src/plugins/open-api/db.mjs +5 -0
- package/dist/packages/better-stack/src/plugins/open-api/logo.cjs +8 -0
- package/dist/packages/better-stack/src/plugins/open-api/logo.mjs +6 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/components/loading/docs-skeleton.cjs +43 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/components/loading/docs-skeleton.mjs +41 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/components/pages/docs-page.cjs +794 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/components/pages/docs-page.mjs +788 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/plugin.cjs +111 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/plugin.mjs +106 -0
- package/dist/packages/better-stack/src/plugins/route-docs/generator.cjs +244 -0
- package/dist/packages/better-stack/src/plugins/route-docs/generator.mjs +227 -0
- package/dist/packages/ui/src/components/sheet.cjs +25 -0
- package/dist/packages/ui/src/components/sheet.mjs +24 -1
- package/dist/plugins/api/index.d.cts +2 -2
- package/dist/plugins/api/index.d.mts +2 -2
- package/dist/plugins/api/index.d.ts +2 -2
- package/dist/plugins/blog/api/index.d.cts +1 -1
- package/dist/plugins/blog/api/index.d.mts +1 -1
- package/dist/plugins/blog/api/index.d.ts +1 -1
- package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
- package/dist/plugins/blog/client/index.d.cts +1 -1
- package/dist/plugins/blog/client/index.d.mts +1 -1
- package/dist/plugins/blog/client/index.d.ts +1 -1
- package/dist/plugins/blog/query-keys.d.cts +2 -2
- package/dist/plugins/blog/query-keys.d.mts +2 -2
- package/dist/plugins/blog/query-keys.d.ts +2 -2
- package/dist/plugins/client/index.d.cts +2 -2
- package/dist/plugins/client/index.d.mts +2 -2
- package/dist/plugins/client/index.d.ts +2 -2
- package/dist/plugins/open-api/api/index.cjs +9 -0
- package/dist/plugins/open-api/api/index.d.cts +95 -0
- package/dist/plugins/open-api/api/index.d.mts +95 -0
- package/dist/plugins/open-api/api/index.d.ts +95 -0
- package/dist/plugins/open-api/api/index.mjs +2 -0
- package/dist/plugins/route-docs/client/index.cjs +10 -0
- package/dist/plugins/route-docs/client/index.d.cts +126 -0
- package/dist/plugins/route-docs/client/index.d.mts +126 -0
- package/dist/plugins/route-docs/client/index.d.ts +126 -0
- package/dist/plugins/route-docs/client/index.mjs +1 -0
- package/dist/plugins/route-docs/client.css +3 -0
- package/dist/plugins/route-docs/style.css +19 -0
- package/dist/shared/{stack.ByOugz9d.d.cts → stack.u9iYV6vt.d.cts} +28 -3
- package/dist/shared/{stack.ByOugz9d.d.mts → stack.u9iYV6vt.d.mts} +28 -3
- package/dist/shared/{stack.ByOugz9d.d.ts → stack.u9iYV6vt.d.ts} +28 -3
- package/package.json +28 -1
- package/src/api/index.ts +14 -2
- package/src/client/index.ts +11 -4
- package/src/plugins/open-api/api/generator.ts +433 -0
- package/src/plugins/open-api/api/index.ts +8 -0
- package/src/plugins/open-api/api/plugin.ts +243 -0
- package/src/plugins/open-api/db.ts +7 -0
- package/src/plugins/open-api/logo.ts +7 -0
- package/src/plugins/route-docs/client/components/loading/docs-skeleton.tsx +82 -0
- package/src/plugins/route-docs/client/components/loading/index.tsx +1 -0
- package/src/plugins/route-docs/client/components/pages/docs-page.tsx +1240 -0
- package/src/plugins/route-docs/client/index.ts +7 -0
- package/src/plugins/route-docs/client/plugin.tsx +187 -0
- package/src/plugins/route-docs/client.css +3 -0
- package/src/plugins/route-docs/generator.ts +385 -0
- package/src/plugins/route-docs/index.ts +12 -0
- package/src/plugins/route-docs/style.css +19 -0
- package/src/types.ts +34 -2
- package/dist/shared/{stack.CcI4sYJP.d.mts → stack.DLhzx1-D.d.cts} +1 -1
- package/dist/shared/{stack.CcI4sYJP.d.ts → stack.DLhzx1-D.d.mts} +1 -1
- package/dist/shared/{stack.CcI4sYJP.d.cts → stack.DLhzx1-D.d.ts} +1 -1
|
@@ -81,7 +81,32 @@ function SheetContent({
|
|
|
81
81
|
)
|
|
82
82
|
] });
|
|
83
83
|
}
|
|
84
|
+
function SheetHeader({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "sheet-header",
|
|
89
|
+
className: utils.cn("flex flex-col gap-1.5 p-4", className),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function SheetTitle({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
+
DialogPrimitive__namespace.Title,
|
|
100
|
+
{
|
|
101
|
+
"data-slot": "sheet-title",
|
|
102
|
+
className: utils.cn("text-foreground font-semibold", className),
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
84
107
|
|
|
85
108
|
exports.Sheet = Sheet;
|
|
86
109
|
exports.SheetContent = SheetContent;
|
|
110
|
+
exports.SheetHeader = SheetHeader;
|
|
111
|
+
exports.SheetTitle = SheetTitle;
|
|
87
112
|
exports.SheetTrigger = SheetTrigger;
|
|
@@ -65,5 +65,28 @@ function SheetContent({
|
|
|
65
65
|
)
|
|
66
66
|
] });
|
|
67
67
|
}
|
|
68
|
+
function SheetHeader({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "sheet-header",
|
|
73
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function SheetTitle({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}) {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
DialogPrimitive.Title,
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "sheet-title",
|
|
86
|
+
className: cn("text-foreground font-semibold", className),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
68
91
|
|
|
69
|
-
export { Sheet, SheetContent, SheetTrigger };
|
|
92
|
+
export { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BackendPlugin } from '../../shared/stack.
|
|
2
|
-
export { C as ClientPlugin } from '../../shared/stack.
|
|
1
|
+
import { B as BackendPlugin } from '../../shared/stack.u9iYV6vt.cjs';
|
|
2
|
+
export { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.cjs';
|
|
3
3
|
import { Endpoint } from 'better-call';
|
|
4
4
|
export { Endpoint, Router, createEndpoint, createRouter } from 'better-call';
|
|
5
5
|
export { Adapter, DatabaseDefinition, DbPlugin, createDbPlugin } from '@btst/db';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BackendPlugin } from '../../shared/stack.
|
|
2
|
-
export { C as ClientPlugin } from '../../shared/stack.
|
|
1
|
+
import { B as BackendPlugin } from '../../shared/stack.u9iYV6vt.mjs';
|
|
2
|
+
export { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.mjs';
|
|
3
3
|
import { Endpoint } from 'better-call';
|
|
4
4
|
export { Endpoint, Router, createEndpoint, createRouter } from 'better-call';
|
|
5
5
|
export { Adapter, DatabaseDefinition, DbPlugin, createDbPlugin } from '@btst/db';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BackendPlugin } from '../../shared/stack.
|
|
2
|
-
export { C as ClientPlugin } from '../../shared/stack.
|
|
1
|
+
import { B as BackendPlugin } from '../../shared/stack.u9iYV6vt.js';
|
|
2
|
+
export { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.js';
|
|
3
3
|
import { Endpoint } from 'better-call';
|
|
4
4
|
export { Endpoint, Router, createEndpoint, createRouter } from 'better-call';
|
|
5
5
|
export { Adapter, DatabaseDefinition, DbPlugin, createDbPlugin } from '@btst/db';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.DLhzx1-D.cjs';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.DLhzx1-D.mjs';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.DLhzx1-D.js';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
published: boolean;
|
|
132
131
|
title: string;
|
|
132
|
+
published: boolean;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
published: boolean;
|
|
132
131
|
title: string;
|
|
132
|
+
published: boolean;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
published: boolean;
|
|
132
131
|
title: string;
|
|
132
|
+
published: boolean;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.cjs';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.cjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.mjs';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.mjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.js';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.js';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.cjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
+
title: z.ZodString;
|
|
147
148
|
slug: z.ZodOptional<z.ZodString>;
|
|
148
149
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
149
150
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
-
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.mjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
+
title: z.ZodString;
|
|
147
148
|
slug: z.ZodOptional<z.ZodString>;
|
|
148
149
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
149
150
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
-
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.js';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
+
title: z.ZodString;
|
|
147
148
|
slug: z.ZodOptional<z.ZodString>;
|
|
148
149
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
149
150
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
-
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientPlugin } from '../../shared/stack.
|
|
2
|
-
export { P as PluginOverrides } from '../../shared/stack.
|
|
1
|
+
import { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.cjs';
|
|
2
|
+
export { P as PluginOverrides } from '../../shared/stack.u9iYV6vt.cjs';
|
|
3
3
|
import { Route } from '@btst/yar';
|
|
4
4
|
export { Route, createRoute, createRouter } from '@btst/yar';
|
|
5
5
|
import { createClient } from 'better-call/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientPlugin } from '../../shared/stack.
|
|
2
|
-
export { P as PluginOverrides } from '../../shared/stack.
|
|
1
|
+
import { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.mjs';
|
|
2
|
+
export { P as PluginOverrides } from '../../shared/stack.u9iYV6vt.mjs';
|
|
3
3
|
import { Route } from '@btst/yar';
|
|
4
4
|
export { Route, createRoute, createRouter } from '@btst/yar';
|
|
5
5
|
import { createClient } from 'better-call/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientPlugin } from '../../shared/stack.
|
|
2
|
-
export { P as PluginOverrides } from '../../shared/stack.
|
|
1
|
+
import { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.js';
|
|
2
|
+
export { P as PluginOverrides } from '../../shared/stack.u9iYV6vt.js';
|
|
3
3
|
import { Route } from '@btst/yar';
|
|
4
4
|
export { Route, createRoute, createRouter } from '@btst/yar';
|
|
5
5
|
import { createClient } from 'better-call/client';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const plugin = require('../../../packages/better-stack/src/plugins/open-api/api/plugin.cjs');
|
|
4
|
+
const generator = require('../../../packages/better-stack/src/plugins/open-api/api/generator.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.openApiBackendPlugin = plugin.openApiBackendPlugin;
|
|
9
|
+
exports.generateOpenAPISchema = generator.generateOpenAPISchema;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
|
+
import * as better_call from 'better-call';
|
|
3
|
+
import { a as BetterStackContext } from '../../../shared/stack.u9iYV6vt.cjs';
|
|
4
|
+
import '@btst/yar';
|
|
5
|
+
import '@btst/db';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Scalar API Reference themes
|
|
9
|
+
*/
|
|
10
|
+
type ScalarTheme = "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "saturn" | "kepler" | "mars" | "deepSpace" | "laserwave" | "none";
|
|
11
|
+
/**
|
|
12
|
+
* OpenAPI plugin configuration options
|
|
13
|
+
*/
|
|
14
|
+
interface OpenAPIOptions {
|
|
15
|
+
/**
|
|
16
|
+
* The path to the OpenAPI reference page
|
|
17
|
+
* This path is relative to the API base path
|
|
18
|
+
* @default "/reference"
|
|
19
|
+
*/
|
|
20
|
+
path?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Disable the default HTML reference page
|
|
23
|
+
* Only the JSON schema endpoint will be available
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disableDefaultReference?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Theme for the Scalar API Reference page
|
|
29
|
+
* @default "default"
|
|
30
|
+
*/
|
|
31
|
+
theme?: ScalarTheme;
|
|
32
|
+
/**
|
|
33
|
+
* CSP nonce for inline scripts
|
|
34
|
+
* Required for strict Content Security Policy
|
|
35
|
+
*/
|
|
36
|
+
nonce?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Custom title for the API documentation
|
|
39
|
+
* @default "Better Stack API"
|
|
40
|
+
*/
|
|
41
|
+
title?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Custom description for the API documentation
|
|
44
|
+
*/
|
|
45
|
+
description?: string;
|
|
46
|
+
/**
|
|
47
|
+
* API version string
|
|
48
|
+
* @default "1.0.0"
|
|
49
|
+
*/
|
|
50
|
+
version?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* OpenAPI plugin for Better Stack
|
|
54
|
+
*
|
|
55
|
+
* Automatically generates OpenAPI 3.1 documentation for all registered plugins.
|
|
56
|
+
* Provides both a JSON schema endpoint and an interactive Scalar UI reference page.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const { handler } = betterStack({
|
|
61
|
+
* basePath: "/api/data",
|
|
62
|
+
* plugins: {
|
|
63
|
+
* blog: blogBackendPlugin(),
|
|
64
|
+
* cms: cmsBackendPlugin({ ... }),
|
|
65
|
+
* openApi: openApiBackendPlugin({ theme: "moon" }),
|
|
66
|
+
* },
|
|
67
|
+
* adapter: (db) => createMemoryAdapter(db)({}),
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* // Access:
|
|
71
|
+
* // - GET /api/data/open-api/schema - JSON schema
|
|
72
|
+
* // - GET /api/data/reference - Interactive Scalar UI
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
declare const openApiBackendPlugin: (options?: OpenAPIOptions) => _btst_stack_plugins_api.BackendPlugin<{
|
|
76
|
+
readonly generateSchema: better_call.StrictEndpoint<"/open-api/schema", {
|
|
77
|
+
method: "GET";
|
|
78
|
+
}, Record<string, any>>;
|
|
79
|
+
readonly reference: better_call.StrictEndpoint<string, {
|
|
80
|
+
method: "GET";
|
|
81
|
+
}, Response>;
|
|
82
|
+
}>;
|
|
83
|
+
type OpenApiRouter = ReturnType<ReturnType<typeof openApiBackendPlugin>["routes"]>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Generate OpenAPI 3.1 schema from Better Stack context
|
|
87
|
+
*/
|
|
88
|
+
declare function generateOpenAPISchema(context: BetterStackContext, options?: {
|
|
89
|
+
title?: string;
|
|
90
|
+
description?: string;
|
|
91
|
+
version?: string;
|
|
92
|
+
}): Record<string, any>;
|
|
93
|
+
|
|
94
|
+
export { generateOpenAPISchema, openApiBackendPlugin };
|
|
95
|
+
export type { OpenAPIOptions, OpenApiRouter, ScalarTheme };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
|
+
import * as better_call from 'better-call';
|
|
3
|
+
import { a as BetterStackContext } from '../../../shared/stack.u9iYV6vt.mjs';
|
|
4
|
+
import '@btst/yar';
|
|
5
|
+
import '@btst/db';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Scalar API Reference themes
|
|
9
|
+
*/
|
|
10
|
+
type ScalarTheme = "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "saturn" | "kepler" | "mars" | "deepSpace" | "laserwave" | "none";
|
|
11
|
+
/**
|
|
12
|
+
* OpenAPI plugin configuration options
|
|
13
|
+
*/
|
|
14
|
+
interface OpenAPIOptions {
|
|
15
|
+
/**
|
|
16
|
+
* The path to the OpenAPI reference page
|
|
17
|
+
* This path is relative to the API base path
|
|
18
|
+
* @default "/reference"
|
|
19
|
+
*/
|
|
20
|
+
path?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Disable the default HTML reference page
|
|
23
|
+
* Only the JSON schema endpoint will be available
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disableDefaultReference?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Theme for the Scalar API Reference page
|
|
29
|
+
* @default "default"
|
|
30
|
+
*/
|
|
31
|
+
theme?: ScalarTheme;
|
|
32
|
+
/**
|
|
33
|
+
* CSP nonce for inline scripts
|
|
34
|
+
* Required for strict Content Security Policy
|
|
35
|
+
*/
|
|
36
|
+
nonce?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Custom title for the API documentation
|
|
39
|
+
* @default "Better Stack API"
|
|
40
|
+
*/
|
|
41
|
+
title?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Custom description for the API documentation
|
|
44
|
+
*/
|
|
45
|
+
description?: string;
|
|
46
|
+
/**
|
|
47
|
+
* API version string
|
|
48
|
+
* @default "1.0.0"
|
|
49
|
+
*/
|
|
50
|
+
version?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* OpenAPI plugin for Better Stack
|
|
54
|
+
*
|
|
55
|
+
* Automatically generates OpenAPI 3.1 documentation for all registered plugins.
|
|
56
|
+
* Provides both a JSON schema endpoint and an interactive Scalar UI reference page.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const { handler } = betterStack({
|
|
61
|
+
* basePath: "/api/data",
|
|
62
|
+
* plugins: {
|
|
63
|
+
* blog: blogBackendPlugin(),
|
|
64
|
+
* cms: cmsBackendPlugin({ ... }),
|
|
65
|
+
* openApi: openApiBackendPlugin({ theme: "moon" }),
|
|
66
|
+
* },
|
|
67
|
+
* adapter: (db) => createMemoryAdapter(db)({}),
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* // Access:
|
|
71
|
+
* // - GET /api/data/open-api/schema - JSON schema
|
|
72
|
+
* // - GET /api/data/reference - Interactive Scalar UI
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
declare const openApiBackendPlugin: (options?: OpenAPIOptions) => _btst_stack_plugins_api.BackendPlugin<{
|
|
76
|
+
readonly generateSchema: better_call.StrictEndpoint<"/open-api/schema", {
|
|
77
|
+
method: "GET";
|
|
78
|
+
}, Record<string, any>>;
|
|
79
|
+
readonly reference: better_call.StrictEndpoint<string, {
|
|
80
|
+
method: "GET";
|
|
81
|
+
}, Response>;
|
|
82
|
+
}>;
|
|
83
|
+
type OpenApiRouter = ReturnType<ReturnType<typeof openApiBackendPlugin>["routes"]>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Generate OpenAPI 3.1 schema from Better Stack context
|
|
87
|
+
*/
|
|
88
|
+
declare function generateOpenAPISchema(context: BetterStackContext, options?: {
|
|
89
|
+
title?: string;
|
|
90
|
+
description?: string;
|
|
91
|
+
version?: string;
|
|
92
|
+
}): Record<string, any>;
|
|
93
|
+
|
|
94
|
+
export { generateOpenAPISchema, openApiBackendPlugin };
|
|
95
|
+
export type { OpenAPIOptions, OpenApiRouter, ScalarTheme };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
|
+
import * as better_call from 'better-call';
|
|
3
|
+
import { a as BetterStackContext } from '../../../shared/stack.u9iYV6vt.js';
|
|
4
|
+
import '@btst/yar';
|
|
5
|
+
import '@btst/db';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Scalar API Reference themes
|
|
9
|
+
*/
|
|
10
|
+
type ScalarTheme = "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "saturn" | "kepler" | "mars" | "deepSpace" | "laserwave" | "none";
|
|
11
|
+
/**
|
|
12
|
+
* OpenAPI plugin configuration options
|
|
13
|
+
*/
|
|
14
|
+
interface OpenAPIOptions {
|
|
15
|
+
/**
|
|
16
|
+
* The path to the OpenAPI reference page
|
|
17
|
+
* This path is relative to the API base path
|
|
18
|
+
* @default "/reference"
|
|
19
|
+
*/
|
|
20
|
+
path?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Disable the default HTML reference page
|
|
23
|
+
* Only the JSON schema endpoint will be available
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disableDefaultReference?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Theme for the Scalar API Reference page
|
|
29
|
+
* @default "default"
|
|
30
|
+
*/
|
|
31
|
+
theme?: ScalarTheme;
|
|
32
|
+
/**
|
|
33
|
+
* CSP nonce for inline scripts
|
|
34
|
+
* Required for strict Content Security Policy
|
|
35
|
+
*/
|
|
36
|
+
nonce?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Custom title for the API documentation
|
|
39
|
+
* @default "Better Stack API"
|
|
40
|
+
*/
|
|
41
|
+
title?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Custom description for the API documentation
|
|
44
|
+
*/
|
|
45
|
+
description?: string;
|
|
46
|
+
/**
|
|
47
|
+
* API version string
|
|
48
|
+
* @default "1.0.0"
|
|
49
|
+
*/
|
|
50
|
+
version?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* OpenAPI plugin for Better Stack
|
|
54
|
+
*
|
|
55
|
+
* Automatically generates OpenAPI 3.1 documentation for all registered plugins.
|
|
56
|
+
* Provides both a JSON schema endpoint and an interactive Scalar UI reference page.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const { handler } = betterStack({
|
|
61
|
+
* basePath: "/api/data",
|
|
62
|
+
* plugins: {
|
|
63
|
+
* blog: blogBackendPlugin(),
|
|
64
|
+
* cms: cmsBackendPlugin({ ... }),
|
|
65
|
+
* openApi: openApiBackendPlugin({ theme: "moon" }),
|
|
66
|
+
* },
|
|
67
|
+
* adapter: (db) => createMemoryAdapter(db)({}),
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* // Access:
|
|
71
|
+
* // - GET /api/data/open-api/schema - JSON schema
|
|
72
|
+
* // - GET /api/data/reference - Interactive Scalar UI
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
declare const openApiBackendPlugin: (options?: OpenAPIOptions) => _btst_stack_plugins_api.BackendPlugin<{
|
|
76
|
+
readonly generateSchema: better_call.StrictEndpoint<"/open-api/schema", {
|
|
77
|
+
method: "GET";
|
|
78
|
+
}, Record<string, any>>;
|
|
79
|
+
readonly reference: better_call.StrictEndpoint<string, {
|
|
80
|
+
method: "GET";
|
|
81
|
+
}, Response>;
|
|
82
|
+
}>;
|
|
83
|
+
type OpenApiRouter = ReturnType<ReturnType<typeof openApiBackendPlugin>["routes"]>;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Generate OpenAPI 3.1 schema from Better Stack context
|
|
87
|
+
*/
|
|
88
|
+
declare function generateOpenAPISchema(context: BetterStackContext, options?: {
|
|
89
|
+
title?: string;
|
|
90
|
+
description?: string;
|
|
91
|
+
version?: string;
|
|
92
|
+
}): Record<string, any>;
|
|
93
|
+
|
|
94
|
+
export { generateOpenAPISchema, openApiBackendPlugin };
|
|
95
|
+
export type { OpenAPIOptions, OpenApiRouter, ScalarTheme };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const plugin = require('../../../packages/better-stack/src/plugins/route-docs/client/plugin.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.ROUTE_DOCS_QUERY_KEY = plugin.ROUTE_DOCS_QUERY_KEY;
|
|
8
|
+
exports.generateSchema = plugin.generateSchema;
|
|
9
|
+
exports.getStoredContext = plugin.getStoredContext;
|
|
10
|
+
exports.routeDocsClientPlugin = plugin.routeDocsClientPlugin;
|