@shahadpichen/docpush 1.0.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/README.md +129 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +116 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/start.d.ts +4 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/commands/start.js +58 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +22 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/config/index.d.ts +3 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +9 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/config/loader.d.ts +6 -0
- package/dist/core/config/loader.d.ts.map +1 -0
- package/dist/core/config/loader.js +50 -0
- package/dist/core/config/loader.js.map +1 -0
- package/dist/core/config/schema.d.ts +134 -0
- package/dist/core/config/schema.d.ts.map +1 -0
- package/dist/core/config/schema.js +106 -0
- package/dist/core/config/schema.js.map +1 -0
- package/dist/core/errors.d.ts +45 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +76 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/github/client.d.ts +47 -0
- package/dist/core/github/client.d.ts.map +1 -0
- package/dist/core/github/client.js +159 -0
- package/dist/core/github/client.js.map +1 -0
- package/dist/core/github/index.d.ts +4 -0
- package/dist/core/github/index.d.ts.map +1 -0
- package/dist/core/github/index.js +9 -0
- package/dist/core/github/index.js.map +1 -0
- package/dist/core/github/retry.d.ts +15 -0
- package/dist/core/github/retry.d.ts.map +1 -0
- package/dist/core/github/retry.js +61 -0
- package/dist/core/github/retry.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/react/components/comments-panel.d.ts +14 -0
- package/dist/react/components/comments-panel.d.ts.map +1 -0
- package/dist/react/components/comments-panel.js +62 -0
- package/dist/react/components/comments-panel.js.map +1 -0
- package/dist/react/components/docs-sidebar.d.ts +13 -0
- package/dist/react/components/docs-sidebar.d.ts.map +1 -0
- package/dist/react/components/docs-sidebar.js +70 -0
- package/dist/react/components/docs-sidebar.js.map +1 -0
- package/dist/react/components/drafts-list.d.ts +18 -0
- package/dist/react/components/drafts-list.d.ts.map +1 -0
- package/dist/react/components/drafts-list.js +38 -0
- package/dist/react/components/drafts-list.js.map +1 -0
- package/dist/react/components/markdown-editor.d.ts +8 -0
- package/dist/react/components/markdown-editor.d.ts.map +1 -0
- package/dist/react/components/markdown-editor.js +59 -0
- package/dist/react/components/markdown-editor.js.map +1 -0
- package/dist/react/components/markdown-viewer.d.ts +7 -0
- package/dist/react/components/markdown-viewer.d.ts.map +1 -0
- package/dist/react/components/markdown-viewer.js +58 -0
- package/dist/react/components/markdown-viewer.js.map +1 -0
- package/dist/react/components/search-bar.d.ts +14 -0
- package/dist/react/components/search-bar.d.ts.map +1 -0
- package/dist/react/components/search-bar.js +80 -0
- package/dist/react/components/search-bar.js.map +1 -0
- package/dist/react/components/ui/badge.d.ts +10 -0
- package/dist/react/components/ui/badge.d.ts.map +1 -0
- package/dist/react/components/ui/badge.js +27 -0
- package/dist/react/components/ui/badge.js.map +1 -0
- package/dist/react/components/ui/button.d.ts +12 -0
- package/dist/react/components/ui/button.d.ts.map +1 -0
- package/dist/react/components/ui/button.js +71 -0
- package/dist/react/components/ui/button.js.map +1 -0
- package/dist/react/components/ui/card.d.ts +7 -0
- package/dist/react/components/ui/card.d.ts.map +1 -0
- package/dist/react/components/ui/card.js +52 -0
- package/dist/react/components/ui/card.js.map +1 -0
- package/dist/react/components/ui/input.d.ts +6 -0
- package/dist/react/components/ui/input.d.ts.map +1 -0
- package/dist/react/components/ui/input.js +45 -0
- package/dist/react/components/ui/input.js.map +1 -0
- package/dist/react/components/ui/scroll-area.d.ts +6 -0
- package/dist/react/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/react/components/ui/scroll-area.js +48 -0
- package/dist/react/components/ui/scroll-area.js.map +1 -0
- package/dist/react/components/ui/textarea.d.ts +6 -0
- package/dist/react/components/ui/textarea.d.ts.map +1 -0
- package/dist/react/components/ui/textarea.js +45 -0
- package/dist/react/components/ui/textarea.js.map +1 -0
- package/dist/react/context/docpush-provider.d.ts +17 -0
- package/dist/react/context/docpush-provider.d.ts.map +1 -0
- package/dist/react/context/docpush-provider.js +72 -0
- package/dist/react/context/docpush-provider.js.map +1 -0
- package/dist/react/hooks/use-auth.d.ts +16 -0
- package/dist/react/hooks/use-auth.d.ts.map +1 -0
- package/dist/react/hooks/use-auth.js +72 -0
- package/dist/react/hooks/use-auth.js.map +1 -0
- package/dist/react/hooks/use-comments.d.ts +15 -0
- package/dist/react/hooks/use-comments.d.ts.map +1 -0
- package/dist/react/hooks/use-comments.js +67 -0
- package/dist/react/hooks/use-comments.js.map +1 -0
- package/dist/react/hooks/use-docs.d.ts +13 -0
- package/dist/react/hooks/use-docs.d.ts.map +1 -0
- package/dist/react/hooks/use-docs.js +69 -0
- package/dist/react/hooks/use-docs.js.map +1 -0
- package/dist/react/hooks/use-drafts.d.ts +25 -0
- package/dist/react/hooks/use-drafts.d.ts.map +1 -0
- package/dist/react/hooks/use-drafts.js +99 -0
- package/dist/react/hooks/use-drafts.js.map +1 -0
- package/dist/react/index.d.ts +19 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +52 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/lib/utils.d.ts +3 -0
- package/dist/react/lib/utils.d.ts.map +1 -0
- package/dist/react/lib/utils.js +9 -0
- package/dist/react/lib/utils.js.map +1 -0
- package/dist/server/auth/index.d.ts +18 -0
- package/dist/server/auth/index.d.ts.map +1 -0
- package/dist/server/auth/index.js +50 -0
- package/dist/server/auth/index.js.map +1 -0
- package/dist/server/auth/magic-link.d.ts +10 -0
- package/dist/server/auth/magic-link.d.ts.map +1 -0
- package/dist/server/auth/magic-link.js +94 -0
- package/dist/server/auth/magic-link.js.map +1 -0
- package/dist/server/auth/oauth.d.ts +6 -0
- package/dist/server/auth/oauth.d.ts.map +1 -0
- package/dist/server/auth/oauth.js +90 -0
- package/dist/server/auth/oauth.js.map +1 -0
- package/dist/server/auth/public.d.ts +7 -0
- package/dist/server/auth/public.d.ts.map +1 -0
- package/dist/server/auth/public.js +43 -0
- package/dist/server/auth/public.js.map +1 -0
- package/dist/server/index.d.ts +12 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +107 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/middleware/auth.d.ts +20 -0
- package/dist/server/middleware/auth.d.ts.map +1 -0
- package/dist/server/middleware/auth.js +49 -0
- package/dist/server/middleware/auth.js.map +1 -0
- package/dist/server/routes/auth.d.ts +3 -0
- package/dist/server/routes/auth.d.ts.map +1 -0
- package/dist/server/routes/auth.js +105 -0
- package/dist/server/routes/auth.js.map +1 -0
- package/dist/server/routes/docs.d.ts +3 -0
- package/dist/server/routes/docs.d.ts.map +1 -0
- package/dist/server/routes/docs.js +58 -0
- package/dist/server/routes/docs.js.map +1 -0
- package/dist/server/routes/drafts.d.ts +3 -0
- package/dist/server/routes/drafts.d.ts.map +1 -0
- package/dist/server/routes/drafts.js +264 -0
- package/dist/server/routes/drafts.js.map +1 -0
- package/dist/server/routes/index.d.ts +4 -0
- package/dist/server/routes/index.d.ts.map +1 -0
- package/dist/server/routes/index.js +13 -0
- package/dist/server/routes/index.js.map +1 -0
- package/dist/server/storage/index.d.ts +40 -0
- package/dist/server/storage/index.d.ts.map +1 -0
- package/dist/server/storage/index.js +199 -0
- package/dist/server/storage/index.js.map +1 -0
- package/package.json +109 -0
- package/templates/.env.example +20 -0
- package/templates/docs.config.js +21 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface DocTreeItem {
|
|
2
|
+
path: string;
|
|
3
|
+
type: 'file' | 'dir';
|
|
4
|
+
}
|
|
5
|
+
export declare function useDocs(path?: string): {
|
|
6
|
+
tree: DocTreeItem[];
|
|
7
|
+
content: string | null;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
refetch: () => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=use-docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-docs.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-docs.ts"],"names":[],"mappings":"AAKA,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;CACtB;AAED,wBAAgB,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM;;;;;;EA8BpC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.useDocs = useDocs;
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const docpush_provider_1 = require("../context/docpush-provider");
|
|
40
|
+
function useDocs(path) {
|
|
41
|
+
const { fetcher } = (0, docpush_provider_1.useDocPush)();
|
|
42
|
+
const [tree, setTree] = React.useState([]);
|
|
43
|
+
const [content, setContent] = React.useState(null);
|
|
44
|
+
const [loading, setLoading] = React.useState(true);
|
|
45
|
+
const [error, setError] = React.useState(null);
|
|
46
|
+
const fetchData = React.useCallback(async () => {
|
|
47
|
+
setLoading(true);
|
|
48
|
+
setError(null);
|
|
49
|
+
try {
|
|
50
|
+
const treeRes = await fetcher('/api/docs/tree');
|
|
51
|
+
setTree(treeRes.tree);
|
|
52
|
+
if (path) {
|
|
53
|
+
const contentRes = await fetcher(`/api/docs/${path}`);
|
|
54
|
+
setContent(contentRes.content);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
setError(err instanceof Error ? err.message : 'Failed to load docs');
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
setLoading(false);
|
|
62
|
+
}
|
|
63
|
+
}, [path, fetcher]);
|
|
64
|
+
React.useEffect(() => {
|
|
65
|
+
fetchData();
|
|
66
|
+
}, [fetchData]);
|
|
67
|
+
return { tree, content, loading, error, refetch: fetchData };
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=use-docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-docs.js","sourceRoot":"","sources":["../../../src/react/hooks/use-docs.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUb,0BA8BC;AAtCD,6CAA+B;AAC/B,kEAAyD;AAOzD,SAAgB,OAAO,CAAC,IAAa;IACnC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAU,GAAE,CAAC;IACjC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,EAAE,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAClE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAE9D,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;QAC7C,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAA0B,gBAAgB,CAAC,CAAC;YACzE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAEtB,IAAI,IAAI,EAAE,CAAC;gBACT,MAAM,UAAU,GAAG,MAAM,OAAO,CAAsB,aAAa,IAAI,EAAE,CAAC,CAAC;gBAC3E,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;QACvE,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpB,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,SAAS,EAAE,CAAC;IACd,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface Draft {
|
|
2
|
+
id: string;
|
|
3
|
+
docPath: string;
|
|
4
|
+
branchName: string;
|
|
5
|
+
title: string;
|
|
6
|
+
status: 'pending' | 'approved' | 'rejected';
|
|
7
|
+
createdAt: number;
|
|
8
|
+
updatedAt: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function useDrafts(status?: string): {
|
|
11
|
+
drafts: Draft[];
|
|
12
|
+
loading: boolean;
|
|
13
|
+
error: string | null;
|
|
14
|
+
createDraft: (data: {
|
|
15
|
+
docPath: string;
|
|
16
|
+
title: string;
|
|
17
|
+
content?: string;
|
|
18
|
+
}) => Promise<Draft>;
|
|
19
|
+
updateDraft: (id: string, content: string, message?: string) => Promise<void>;
|
|
20
|
+
approveDraft: (id: string) => Promise<void>;
|
|
21
|
+
rejectDraft: (id: string, reason?: string) => Promise<void>;
|
|
22
|
+
refetch: () => Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=use-drafts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-drafts.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/use-drafts.ts"],"names":[],"mappings":"AAKA,UAAU,KAAK;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM;;;;wBAuBN;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;sBAStD,MAAM,WAAW,MAAM,YAAY,MAAM;uBAQxC,MAAM;sBAKP,MAAM,WAAW,MAAM;;EAkBvD"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.useDrafts = useDrafts;
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const docpush_provider_1 = require("../context/docpush-provider");
|
|
40
|
+
function useDrafts(status) {
|
|
41
|
+
const { fetcher } = (0, docpush_provider_1.useDocPush)();
|
|
42
|
+
const [drafts, setDrafts] = React.useState([]);
|
|
43
|
+
const [loading, setLoading] = React.useState(true);
|
|
44
|
+
const [error, setError] = React.useState(null);
|
|
45
|
+
const fetchDrafts = React.useCallback(async () => {
|
|
46
|
+
setLoading(true);
|
|
47
|
+
try {
|
|
48
|
+
const url = status ? `/api/drafts?status=${status}` : '/api/drafts';
|
|
49
|
+
const res = await fetcher(url);
|
|
50
|
+
setDrafts(res.drafts);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
setError(err instanceof Error ? err.message : 'Failed to load drafts');
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
setLoading(false);
|
|
57
|
+
}
|
|
58
|
+
}, [status, fetcher]);
|
|
59
|
+
React.useEffect(() => {
|
|
60
|
+
fetchDrafts();
|
|
61
|
+
}, [fetchDrafts]);
|
|
62
|
+
const createDraft = async (data) => {
|
|
63
|
+
const res = await fetcher('/api/drafts', {
|
|
64
|
+
method: 'POST',
|
|
65
|
+
body: JSON.stringify(data),
|
|
66
|
+
});
|
|
67
|
+
await fetchDrafts();
|
|
68
|
+
return res.draft;
|
|
69
|
+
};
|
|
70
|
+
const updateDraft = async (id, content, message) => {
|
|
71
|
+
await fetcher(`/api/drafts/${id}`, {
|
|
72
|
+
method: 'PUT',
|
|
73
|
+
body: JSON.stringify({ content, message }),
|
|
74
|
+
});
|
|
75
|
+
await fetchDrafts();
|
|
76
|
+
};
|
|
77
|
+
const approveDraft = async (id) => {
|
|
78
|
+
await fetcher(`/api/drafts/${id}/approve`, { method: 'POST' });
|
|
79
|
+
await fetchDrafts();
|
|
80
|
+
};
|
|
81
|
+
const rejectDraft = async (id, reason) => {
|
|
82
|
+
await fetcher(`/api/drafts/${id}/reject`, {
|
|
83
|
+
method: 'POST',
|
|
84
|
+
body: JSON.stringify({ reason }),
|
|
85
|
+
});
|
|
86
|
+
await fetchDrafts();
|
|
87
|
+
};
|
|
88
|
+
return {
|
|
89
|
+
drafts,
|
|
90
|
+
loading,
|
|
91
|
+
error,
|
|
92
|
+
createDraft,
|
|
93
|
+
updateDraft,
|
|
94
|
+
approveDraft,
|
|
95
|
+
rejectDraft,
|
|
96
|
+
refetch: fetchDrafts,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=use-drafts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-drafts.js","sourceRoot":"","sources":["../../../src/react/hooks/use-drafts.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeb,8BA+DC;AA5ED,6CAA+B;AAC/B,kEAAyD;AAYzD,SAAgB,SAAS,CAAC,MAAe;IACvC,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,6BAAU,GAAE,CAAC;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AE,CAAC;QACpB,OAAO,GAAG,CAAC,KAAK,CAAC;IACnB,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,KAAK,EAAE,EAAU,EAAE,OAAe,EAAE,OAAgB,EAAE,EAAE;QAC1E,MAAM,OAAO,CAAC,eAAe,EAAE,EAAE,EAAE;YACjC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;SAC3C,CAAC,CAAC;QACH,MAAM,WAAW,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,EAAE,EAAU,EAAE,EAAE;QACxC,MAAM,OAAO,CAAC,eAAe,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/D,MAAM,WAAW,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,KAAK,EAAE,EAAU,EAAE,MAAe,EAAE,EAAE;QACxD,MAAM,OAAO,CAAC,eAAe,EAAE,SAAS,EAAE;YACxC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;SACjC,CAAC,CAAC;QACH,MAAM,WAAW,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,OAAO;QACP,KAAK;QACL,WAAW;QACX,WAAW;QACX,YAAY;QACZ,WAAW;QACX,OAAO,EAAE,WAAW;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { Button, buttonVariants } from './components/ui/button';
|
|
2
|
+
export { Input } from './components/ui/input';
|
|
3
|
+
export { Textarea } from './components/ui/textarea';
|
|
4
|
+
export { Badge, badgeVariants } from './components/ui/badge';
|
|
5
|
+
export { Card, CardHeader, CardTitle, CardContent } from './components/ui/card';
|
|
6
|
+
export { ScrollArea, ScrollBar } from './components/ui/scroll-area';
|
|
7
|
+
export { DocsSidebar } from './components/docs-sidebar';
|
|
8
|
+
export { MarkdownViewer } from './components/markdown-viewer';
|
|
9
|
+
export { MarkdownEditor } from './components/markdown-editor';
|
|
10
|
+
export { CommentsPanel } from './components/comments-panel';
|
|
11
|
+
export { DraftsList } from './components/drafts-list';
|
|
12
|
+
export { SearchBar } from './components/search-bar';
|
|
13
|
+
export { useDocs } from './hooks/use-docs';
|
|
14
|
+
export { useDrafts } from './hooks/use-drafts';
|
|
15
|
+
export { useComments } from './hooks/use-comments';
|
|
16
|
+
export { useAuth } from './hooks/use-auth';
|
|
17
|
+
export { DocPushProvider, useDocPush } from './context/docpush-provider';
|
|
18
|
+
export { cn } from './lib/utils';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cn = exports.useDocPush = exports.DocPushProvider = exports.useAuth = exports.useComments = exports.useDrafts = exports.useDocs = exports.SearchBar = exports.DraftsList = exports.CommentsPanel = exports.MarkdownEditor = exports.MarkdownViewer = exports.DocsSidebar = exports.ScrollBar = exports.ScrollArea = exports.CardContent = exports.CardTitle = exports.CardHeader = exports.Card = exports.badgeVariants = exports.Badge = exports.Textarea = exports.Input = exports.buttonVariants = exports.Button = void 0;
|
|
4
|
+
// UI Components (shadcn/ui)
|
|
5
|
+
var button_1 = require("./components/ui/button");
|
|
6
|
+
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return button_1.Button; } });
|
|
7
|
+
Object.defineProperty(exports, "buttonVariants", { enumerable: true, get: function () { return button_1.buttonVariants; } });
|
|
8
|
+
var input_1 = require("./components/ui/input");
|
|
9
|
+
Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return input_1.Input; } });
|
|
10
|
+
var textarea_1 = require("./components/ui/textarea");
|
|
11
|
+
Object.defineProperty(exports, "Textarea", { enumerable: true, get: function () { return textarea_1.Textarea; } });
|
|
12
|
+
var badge_1 = require("./components/ui/badge");
|
|
13
|
+
Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return badge_1.Badge; } });
|
|
14
|
+
Object.defineProperty(exports, "badgeVariants", { enumerable: true, get: function () { return badge_1.badgeVariants; } });
|
|
15
|
+
var card_1 = require("./components/ui/card");
|
|
16
|
+
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return card_1.Card; } });
|
|
17
|
+
Object.defineProperty(exports, "CardHeader", { enumerable: true, get: function () { return card_1.CardHeader; } });
|
|
18
|
+
Object.defineProperty(exports, "CardTitle", { enumerable: true, get: function () { return card_1.CardTitle; } });
|
|
19
|
+
Object.defineProperty(exports, "CardContent", { enumerable: true, get: function () { return card_1.CardContent; } });
|
|
20
|
+
var scroll_area_1 = require("./components/ui/scroll-area");
|
|
21
|
+
Object.defineProperty(exports, "ScrollArea", { enumerable: true, get: function () { return scroll_area_1.ScrollArea; } });
|
|
22
|
+
Object.defineProperty(exports, "ScrollBar", { enumerable: true, get: function () { return scroll_area_1.ScrollBar; } });
|
|
23
|
+
// DocPush Components
|
|
24
|
+
var docs_sidebar_1 = require("./components/docs-sidebar");
|
|
25
|
+
Object.defineProperty(exports, "DocsSidebar", { enumerable: true, get: function () { return docs_sidebar_1.DocsSidebar; } });
|
|
26
|
+
var markdown_viewer_1 = require("./components/markdown-viewer");
|
|
27
|
+
Object.defineProperty(exports, "MarkdownViewer", { enumerable: true, get: function () { return markdown_viewer_1.MarkdownViewer; } });
|
|
28
|
+
var markdown_editor_1 = require("./components/markdown-editor");
|
|
29
|
+
Object.defineProperty(exports, "MarkdownEditor", { enumerable: true, get: function () { return markdown_editor_1.MarkdownEditor; } });
|
|
30
|
+
var comments_panel_1 = require("./components/comments-panel");
|
|
31
|
+
Object.defineProperty(exports, "CommentsPanel", { enumerable: true, get: function () { return comments_panel_1.CommentsPanel; } });
|
|
32
|
+
var drafts_list_1 = require("./components/drafts-list");
|
|
33
|
+
Object.defineProperty(exports, "DraftsList", { enumerable: true, get: function () { return drafts_list_1.DraftsList; } });
|
|
34
|
+
var search_bar_1 = require("./components/search-bar");
|
|
35
|
+
Object.defineProperty(exports, "SearchBar", { enumerable: true, get: function () { return search_bar_1.SearchBar; } });
|
|
36
|
+
// Hooks
|
|
37
|
+
var use_docs_1 = require("./hooks/use-docs");
|
|
38
|
+
Object.defineProperty(exports, "useDocs", { enumerable: true, get: function () { return use_docs_1.useDocs; } });
|
|
39
|
+
var use_drafts_1 = require("./hooks/use-drafts");
|
|
40
|
+
Object.defineProperty(exports, "useDrafts", { enumerable: true, get: function () { return use_drafts_1.useDrafts; } });
|
|
41
|
+
var use_comments_1 = require("./hooks/use-comments");
|
|
42
|
+
Object.defineProperty(exports, "useComments", { enumerable: true, get: function () { return use_comments_1.useComments; } });
|
|
43
|
+
var use_auth_1 = require("./hooks/use-auth");
|
|
44
|
+
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return use_auth_1.useAuth; } });
|
|
45
|
+
// Context
|
|
46
|
+
var docpush_provider_1 = require("./context/docpush-provider");
|
|
47
|
+
Object.defineProperty(exports, "DocPushProvider", { enumerable: true, get: function () { return docpush_provider_1.DocPushProvider; } });
|
|
48
|
+
Object.defineProperty(exports, "useDocPush", { enumerable: true, get: function () { return docpush_provider_1.useDocPush; } });
|
|
49
|
+
// Utils
|
|
50
|
+
var utils_1 = require("./lib/utils");
|
|
51
|
+
Object.defineProperty(exports, "cn", { enumerable: true, get: function () { return utils_1.cn; } });
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":";;;AAAA,4BAA4B;AAC5B,iDAAgE;AAAvD,gGAAA,MAAM,OAAA;AAAE,wGAAA,cAAc,OAAA;AAC/B,+CAA8C;AAArC,8FAAA,KAAK,OAAA;AACd,qDAAoD;AAA3C,oGAAA,QAAQ,OAAA;AACjB,+CAA6D;AAApD,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,6CAAgF;AAAvE,4FAAA,IAAI,OAAA;AAAE,kGAAA,UAAU,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,mGAAA,WAAW,OAAA;AACjD,2DAAoE;AAA3D,yGAAA,UAAU,OAAA;AAAE,wGAAA,SAAS,OAAA;AAE9B,qBAAqB;AACrB,0DAAwD;AAA/C,2GAAA,WAAW,OAAA;AACpB,gEAA8D;AAArD,iHAAA,cAAc,OAAA;AACvB,gEAA8D;AAArD,iHAAA,cAAc,OAAA;AACvB,8DAA4D;AAAnD,+GAAA,aAAa,OAAA;AACtB,wDAAsD;AAA7C,yGAAA,UAAU,OAAA;AACnB,sDAAoD;AAA3C,uGAAA,SAAS,OAAA;AAElB,QAAQ;AACR,6CAA2C;AAAlC,mGAAA,OAAO,OAAA;AAChB,iDAA+C;AAAtC,uGAAA,SAAS,OAAA;AAClB,qDAAmD;AAA1C,2GAAA,WAAW,OAAA;AACpB,6CAA2C;AAAlC,mGAAA,OAAO,OAAA;AAEhB,UAAU;AACV,+DAAyE;AAAhE,mHAAA,eAAe,OAAA;AAAE,8GAAA,UAAU,OAAA;AAEpC,QAAQ;AACR,qCAAiC;AAAxB,2FAAA,EAAE,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/react/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cn = cn;
|
|
4
|
+
const clsx_1 = require("clsx");
|
|
5
|
+
const tailwind_merge_1 = require("tailwind-merge");
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/react/lib/utils.ts"],"names":[],"mappings":";;AAGA,gBAEC;AALD,+BAA6C;AAC7C,mDAAyC;AAEzC,SAAgB,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,IAAA,wBAAO,EAAC,IAAA,WAAI,EAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DocsConfig } from '../../core/config';
|
|
2
|
+
export interface AuthUser {
|
|
3
|
+
id: string;
|
|
4
|
+
email: string | null;
|
|
5
|
+
name?: string;
|
|
6
|
+
avatar?: string;
|
|
7
|
+
role: 'editor' | 'admin';
|
|
8
|
+
provider?: string;
|
|
9
|
+
sessionToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Set up authentication based on config mode
|
|
13
|
+
*/
|
|
14
|
+
export declare function setupAuth(config: DocsConfig): void;
|
|
15
|
+
export { setupPublicAuth } from './public';
|
|
16
|
+
export { setupMagicLinkAuth, sendMagicLink } from './magic-link';
|
|
17
|
+
export { setupOAuth } from './oauth';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKpD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,QA6B3C;AAED,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setupOAuth = exports.sendMagicLink = exports.setupMagicLinkAuth = exports.setupPublicAuth = void 0;
|
|
7
|
+
exports.setupAuth = setupAuth;
|
|
8
|
+
const passport_1 = __importDefault(require("passport"));
|
|
9
|
+
const magic_link_1 = require("./magic-link");
|
|
10
|
+
const oauth_1 = require("./oauth");
|
|
11
|
+
const public_1 = require("./public");
|
|
12
|
+
/**
|
|
13
|
+
* Set up authentication based on config mode
|
|
14
|
+
*/
|
|
15
|
+
function setupAuth(config) {
|
|
16
|
+
// Session serialization
|
|
17
|
+
passport_1.default.serializeUser((user, done) => {
|
|
18
|
+
const authUser = user;
|
|
19
|
+
done(null, {
|
|
20
|
+
id: authUser.id,
|
|
21
|
+
email: authUser.email,
|
|
22
|
+
name: authUser.name,
|
|
23
|
+
role: authUser.role,
|
|
24
|
+
avatar: authUser.avatar,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
passport_1.default.deserializeUser((user, done) => {
|
|
28
|
+
done(null, user);
|
|
29
|
+
});
|
|
30
|
+
// Set up strategy based on auth mode
|
|
31
|
+
switch (config.auth.mode) {
|
|
32
|
+
case 'public':
|
|
33
|
+
(0, public_1.setupPublicAuth)(config);
|
|
34
|
+
break;
|
|
35
|
+
case 'domain-restricted':
|
|
36
|
+
(0, magic_link_1.setupMagicLinkAuth)(config);
|
|
37
|
+
break;
|
|
38
|
+
case 'oauth':
|
|
39
|
+
(0, oauth_1.setupOAuth)(config);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
var public_2 = require("./public");
|
|
44
|
+
Object.defineProperty(exports, "setupPublicAuth", { enumerable: true, get: function () { return public_2.setupPublicAuth; } });
|
|
45
|
+
var magic_link_2 = require("./magic-link");
|
|
46
|
+
Object.defineProperty(exports, "setupMagicLinkAuth", { enumerable: true, get: function () { return magic_link_2.setupMagicLinkAuth; } });
|
|
47
|
+
Object.defineProperty(exports, "sendMagicLink", { enumerable: true, get: function () { return magic_link_2.sendMagicLink; } });
|
|
48
|
+
var oauth_2 = require("./oauth");
|
|
49
|
+
Object.defineProperty(exports, "setupOAuth", { enumerable: true, get: function () { return oauth_2.setupOAuth; } });
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/auth/index.ts"],"names":[],"mappings":";;;;;;AAmBA,8BA6BC;AAhDD,wDAAgC;AAEhC,6CAAkD;AAClD,mCAAqC;AACrC,qCAA2C;AAY3C;;GAEG;AACH,SAAgB,SAAS,CAAC,MAAkB;IAC1C,wBAAwB;IACxB,kBAAQ,CAAC,aAAa,CAAC,CAAC,IAAkB,EAAE,IAAI,EAAE,EAAE;QAClD,MAAM,QAAQ,GAAG,IAAgB,CAAC;QAClC,IAAI,CAAC,IAAI,EAAE;YACT,EAAE,EAAE,QAAQ,CAAC,EAAE;YACf,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,kBAAQ,CAAC,eAAe,CAAC,CAAC,IAAc,EAAE,IAAI,EAAE,EAAE;QAChD,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,qCAAqC;IACrC,QAAQ,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,KAAK,QAAQ;YACX,IAAA,wBAAe,EAAC,MAAM,CAAC,CAAC;YACxB,MAAM;QACR,KAAK,mBAAmB;YACtB,IAAA,+BAAkB,EAAC,MAAM,CAAC,CAAC;YAC3B,MAAM;QACR,KAAK,OAAO;YACV,IAAA,kBAAU,EAAC,MAAM,CAAC,CAAC;YACnB,MAAM;IACV,CAAC;AACH,CAAC;AAED,mCAA2C;AAAlC,yGAAA,eAAe,OAAA;AACxB,2CAAiE;AAAxD,gHAAA,kBAAkB,OAAA;AAAE,2GAAA,aAAa,OAAA;AAC1C,iCAAqC;AAA5B,mGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DocsConfig } from '../../core/config';
|
|
2
|
+
/**
|
|
3
|
+
* Domain-restricted authentication via magic link emails
|
|
4
|
+
*/
|
|
5
|
+
export declare function setupMagicLinkAuth(config: DocsConfig): void;
|
|
6
|
+
/**
|
|
7
|
+
* Send magic link email
|
|
8
|
+
*/
|
|
9
|
+
export declare function sendMagicLink(email: string, config: DocsConfig): Promise<boolean>;
|
|
10
|
+
//# sourceMappingURL=magic-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-link.d.ts","sourceRoot":"","sources":["../../../src/server/auth/magic-link.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKpD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,QA4CpD;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CA0CvF"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setupMagicLinkAuth = setupMagicLinkAuth;
|
|
7
|
+
exports.sendMagicLink = sendMagicLink;
|
|
8
|
+
const passport_1 = __importDefault(require("passport"));
|
|
9
|
+
const passport_custom_1 = require("passport-custom");
|
|
10
|
+
const resend_1 = require("resend");
|
|
11
|
+
const storage_1 = require("../storage");
|
|
12
|
+
let resend = null;
|
|
13
|
+
/**
|
|
14
|
+
* Domain-restricted authentication via magic link emails
|
|
15
|
+
*/
|
|
16
|
+
function setupMagicLinkAuth(config) {
|
|
17
|
+
if (config.auth.mode !== 'domain-restricted')
|
|
18
|
+
return;
|
|
19
|
+
// Initialize Resend
|
|
20
|
+
if (process.env.RESEND_API_KEY) {
|
|
21
|
+
resend = new resend_1.Resend(process.env.RESEND_API_KEY);
|
|
22
|
+
}
|
|
23
|
+
// Magic link verification strategy
|
|
24
|
+
passport_1.default.use('magic-link', new passport_custom_1.Strategy(async (req, done) => {
|
|
25
|
+
const { token } = req.body;
|
|
26
|
+
if (!token) {
|
|
27
|
+
return done(null, false);
|
|
28
|
+
}
|
|
29
|
+
const email = await (0, storage_1.verifyMagicLink)(token);
|
|
30
|
+
if (!email) {
|
|
31
|
+
return done(null, false);
|
|
32
|
+
}
|
|
33
|
+
// Check if email domain is allowed
|
|
34
|
+
if (config.auth.mode === 'domain-restricted') {
|
|
35
|
+
const domain = email.split('@')[1];
|
|
36
|
+
if (!config.auth.allowedDomains.includes(domain)) {
|
|
37
|
+
return done(null, false);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// Create user session
|
|
41
|
+
const sessionToken = await (0, storage_1.createSession)(email, email);
|
|
42
|
+
return done(null, {
|
|
43
|
+
id: email,
|
|
44
|
+
email,
|
|
45
|
+
name: email.split('@')[0],
|
|
46
|
+
role: config.admins.emails.includes(email) ? 'admin' : 'editor',
|
|
47
|
+
sessionToken,
|
|
48
|
+
});
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Send magic link email
|
|
53
|
+
*/
|
|
54
|
+
async function sendMagicLink(email, config) {
|
|
55
|
+
if (config.auth.mode !== 'domain-restricted') {
|
|
56
|
+
throw new Error('Magic link only available in domain-restricted mode');
|
|
57
|
+
}
|
|
58
|
+
// Check domain
|
|
59
|
+
const domain = email.split('@')[1];
|
|
60
|
+
if (!config.auth.allowedDomains.includes(domain)) {
|
|
61
|
+
throw new Error(`Email domain @${domain} is not allowed`);
|
|
62
|
+
}
|
|
63
|
+
// Create magic link token
|
|
64
|
+
const token = await (0, storage_1.createMagicLink)(email);
|
|
65
|
+
const loginUrl = `${process.env.APP_URL}/auth/verify?token=${token}`;
|
|
66
|
+
// Send email via Resend
|
|
67
|
+
if (!resend) {
|
|
68
|
+
console.log('[DEV] Magic link for', email, ':', loginUrl);
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
await resend.emails.send({
|
|
73
|
+
from: config.auth.emailFrom,
|
|
74
|
+
to: email,
|
|
75
|
+
subject: 'Sign in to Documentation',
|
|
76
|
+
html: `
|
|
77
|
+
<h2>Sign in to Documentation</h2>
|
|
78
|
+
<p>Click the link below to sign in. This link expires in 15 minutes.</p>
|
|
79
|
+
<a href="${loginUrl}" style="display: inline-block; padding: 12px 24px; background: #0070f3; color: white; text-decoration: none; border-radius: 6px;">
|
|
80
|
+
Sign In
|
|
81
|
+
</a>
|
|
82
|
+
<p style="color: #666; font-size: 12px; margin-top: 20px;">
|
|
83
|
+
If you didn't request this email, you can safely ignore it.
|
|
84
|
+
</p>
|
|
85
|
+
`,
|
|
86
|
+
});
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error('Failed to send magic link email:', error);
|
|
91
|
+
throw new Error('Failed to send email');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=magic-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-link.js","sourceRoot":"","sources":["../../../src/server/auth/magic-link.ts"],"names":[],"mappings":";;;;;AAWA,gDA4CC;AAKD,sCA0CC;AAtGD,wDAAgC;AAChC,qDAA6D;AAC7D,mCAAgC;AAEhC,wCAA6E;AAE7E,IAAI,MAAM,GAAkB,IAAI,CAAC;AAEjC;;GAEG;AACH,SAAgB,kBAAkB,CAAC,MAAkB;IACnD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,mBAAmB;QAAE,OAAO;IAErD,oBAAoB;IACpB,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;QAC/B,MAAM,GAAG,IAAI,eAAM,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAClD,CAAC;IAED,mCAAmC;IACnC,kBAAQ,CAAC,GAAG,CACV,YAAY,EACZ,IAAI,0BAAc,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACrC,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;QAE3B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3B,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAA,yBAAe,EAAC,KAAK,CAAC,CAAC;QAE3C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC3B,CAAC;QAED,mCAAmC;QACnC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;YAC7C,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC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,wBAAwB;IACxB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;YAC3B,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,0BAA0B;YACnC,IAAI,EAAE;;;mBAGO,QAAQ;;;;;;OAMpB;SACF,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/server/auth/oauth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAWpD;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,QA2G5C"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setupOAuth = setupOAuth;
|
|
7
|
+
const passport_1 = __importDefault(require("passport"));
|
|
8
|
+
const passport_github2_1 = require("passport-github2");
|
|
9
|
+
const passport_google_oauth20_1 = require("passport-google-oauth20");
|
|
10
|
+
/**
|
|
11
|
+
* OAuth authentication (GitHub, Google)
|
|
12
|
+
*/
|
|
13
|
+
function setupOAuth(config) {
|
|
14
|
+
if (config.auth.mode !== 'oauth')
|
|
15
|
+
return;
|
|
16
|
+
// Get allowed domains from oauth config (optional)
|
|
17
|
+
const allowedDomains = config.auth.allowedDomains || [];
|
|
18
|
+
// GitHub OAuth
|
|
19
|
+
if (config.auth.providers.includes('github') &&
|
|
20
|
+
process.env.GITHUB_CLIENT_ID &&
|
|
21
|
+
process.env.GITHUB_CLIENT_SECRET) {
|
|
22
|
+
passport_1.default.use(new passport_github2_1.Strategy({
|
|
23
|
+
clientID: process.env.GITHUB_CLIENT_ID,
|
|
24
|
+
clientSecret: process.env.GITHUB_CLIENT_SECRET,
|
|
25
|
+
callbackURL: `${process.env.APP_URL}/api/auth/github/callback`,
|
|
26
|
+
scope: ['user:email'],
|
|
27
|
+
}, async (accessToken, refreshToken, profile, done) => {
|
|
28
|
+
try {
|
|
29
|
+
const email = profile.emails?.[0]?.value || `${profile.username}@github.com`;
|
|
30
|
+
// Check domain restriction if configured
|
|
31
|
+
if (allowedDomains.length > 0) {
|
|
32
|
+
const domain = email.split('@')[1];
|
|
33
|
+
if (!allowedDomains.includes(domain)) {
|
|
34
|
+
return done(null, false);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const user = {
|
|
38
|
+
id: `github:${profile.id}`,
|
|
39
|
+
email,
|
|
40
|
+
name: profile.displayName || profile.username || 'GitHub User',
|
|
41
|
+
avatar: profile.photos?.[0]?.value,
|
|
42
|
+
provider: 'github',
|
|
43
|
+
role: config.admins.emails.includes(email) ? 'admin' : 'editor',
|
|
44
|
+
};
|
|
45
|
+
return done(null, user);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
return done(error instanceof Error ? error : new Error('Unknown error'));
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
// Google OAuth
|
|
53
|
+
if (config.auth.providers.includes('google') &&
|
|
54
|
+
process.env.GOOGLE_CLIENT_ID &&
|
|
55
|
+
process.env.GOOGLE_CLIENT_SECRET) {
|
|
56
|
+
passport_1.default.use(new passport_google_oauth20_1.Strategy({
|
|
57
|
+
clientID: process.env.GOOGLE_CLIENT_ID,
|
|
58
|
+
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
|
59
|
+
callbackURL: `${process.env.APP_URL}/api/auth/google/callback`,
|
|
60
|
+
scope: ['profile', 'email'],
|
|
61
|
+
}, async (accessToken, refreshToken, profile, done) => {
|
|
62
|
+
try {
|
|
63
|
+
const email = profile.emails?.[0]?.value;
|
|
64
|
+
if (!email) {
|
|
65
|
+
return done(null, false);
|
|
66
|
+
}
|
|
67
|
+
// Check domain restriction if configured
|
|
68
|
+
if (allowedDomains.length > 0) {
|
|
69
|
+
const domain = email.split('@')[1];
|
|
70
|
+
if (!allowedDomains.includes(domain)) {
|
|
71
|
+
return done(null, false);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const user = {
|
|
75
|
+
id: `google:${profile.id}`,
|
|
76
|
+
email,
|
|
77
|
+
name: profile.displayName || 'Google User',
|
|
78
|
+
avatar: profile.photos?.[0]?.value,
|
|
79
|
+
provider: 'google',
|
|
80
|
+
role: config.admins.emails.includes(email) ? 'admin' : 'editor',
|
|
81
|
+
};
|
|
82
|
+
return done(null, user);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
return done(error instanceof Error ? error : new Error('Unknown error'));
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=oauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/server/auth/oauth.ts"],"names":[],"mappings":";;;;;AAiBA,gCA2GC;AA5HD,wDAAgC;AAChC,uDAA6F;AAC7F,qEAAoG;AAYpG;;GAEG;AACH,SAAgB,UAAU,CAAC,MAAkB;IAC3C,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,K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