@knpkv/confluence-to-markdown 0.2.0 → 0.4.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/CHANGELOG.md +60 -0
- package/LICENSE +21 -0
- package/README.md +282 -14
- package/dist/ConfluenceAuth.d.ts +76 -0
- package/dist/ConfluenceAuth.d.ts.map +1 -0
- package/dist/ConfluenceAuth.js +356 -0
- package/dist/ConfluenceAuth.js.map +1 -0
- package/dist/ConfluenceClient.d.ts +26 -2
- package/dist/ConfluenceClient.d.ts.map +1 -1
- package/dist/ConfluenceClient.js +98 -92
- package/dist/ConfluenceClient.js.map +1 -1
- package/dist/ConfluenceConfig.d.ts +4 -24
- package/dist/ConfluenceConfig.d.ts.map +1 -1
- package/dist/ConfluenceConfig.js +45 -7
- package/dist/ConfluenceConfig.js.map +1 -1
- package/dist/ConfluenceError.d.ts +89 -6
- package/dist/ConfluenceError.d.ts.map +1 -1
- package/dist/ConfluenceError.js +88 -5
- package/dist/ConfluenceError.js.map +1 -1
- package/dist/GitError.d.ts +103 -0
- package/dist/GitError.d.ts.map +1 -0
- package/dist/GitError.js +85 -0
- package/dist/GitError.js.map +1 -0
- package/dist/GitService.d.ts +175 -0
- package/dist/GitService.d.ts.map +1 -0
- package/dist/GitService.js +431 -0
- package/dist/GitService.js.map +1 -0
- package/dist/LocalFileSystem.d.ts +29 -4
- package/dist/LocalFileSystem.d.ts.map +1 -1
- package/dist/LocalFileSystem.js +80 -6
- package/dist/LocalFileSystem.js.map +1 -1
- package/dist/MarkdownConverter.d.ts +49 -2
- package/dist/MarkdownConverter.d.ts.map +1 -1
- package/dist/MarkdownConverter.js +73 -111
- package/dist/MarkdownConverter.js.map +1 -1
- package/dist/SchemaConverterError.d.ts +108 -0
- package/dist/SchemaConverterError.d.ts.map +1 -0
- package/dist/SchemaConverterError.js +84 -0
- package/dist/SchemaConverterError.js.map +1 -0
- package/dist/Schemas.d.ts +225 -1
- package/dist/Schemas.d.ts.map +1 -1
- package/dist/Schemas.js +155 -6
- package/dist/Schemas.js.map +1 -1
- package/dist/SyncEngine.d.ts +30 -20
- package/dist/SyncEngine.d.ts.map +1 -1
- package/dist/SyncEngine.js +566 -117
- package/dist/SyncEngine.js.map +1 -1
- package/dist/ast/BlockNode.d.ts +468 -0
- package/dist/ast/BlockNode.d.ts.map +1 -0
- package/dist/ast/BlockNode.js +319 -0
- package/dist/ast/BlockNode.js.map +1 -0
- package/dist/ast/Document.d.ts +244 -0
- package/dist/ast/Document.d.ts.map +1 -0
- package/dist/ast/Document.js +69 -0
- package/dist/ast/Document.js.map +1 -0
- package/dist/ast/InlineNode.d.ts +477 -0
- package/dist/ast/InlineNode.d.ts.map +1 -0
- package/dist/ast/InlineNode.js +263 -0
- package/dist/ast/InlineNode.js.map +1 -0
- package/dist/ast/MacroNode.d.ts +267 -0
- package/dist/ast/MacroNode.d.ts.map +1 -0
- package/dist/ast/MacroNode.js +164 -0
- package/dist/ast/MacroNode.js.map +1 -0
- package/dist/ast/index.d.ts +10 -0
- package/dist/ast/index.d.ts.map +1 -0
- package/dist/ast/index.js +14 -0
- package/dist/ast/index.js.map +1 -0
- package/dist/bin.js +33 -149
- package/dist/bin.js.map +1 -1
- package/dist/commands/auth.d.ts +15 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +86 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/clone.d.ts +12 -0
- package/dist/commands/clone.d.ts.map +1 -0
- package/dist/commands/clone.js +93 -0
- package/dist/commands/clone.js.map +1 -0
- package/dist/commands/delete.d.ts +13 -0
- package/dist/commands/delete.d.ts.map +1 -0
- package/dist/commands/delete.js +48 -0
- package/dist/commands/delete.js.map +1 -0
- package/dist/commands/errorHandler.d.ts +14 -0
- package/dist/commands/errorHandler.d.ts.map +1 -0
- package/dist/commands/errorHandler.js +33 -0
- package/dist/commands/errorHandler.js.map +1 -0
- package/dist/commands/git.d.ts +22 -0
- package/dist/commands/git.d.ts.map +1 -0
- package/dist/commands/git.js +72 -0
- package/dist/commands/git.js.map +1 -0
- package/dist/commands/index.d.ts +11 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +11 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/layers.d.ts +31 -0
- package/dist/commands/layers.d.ts.map +1 -0
- package/dist/commands/layers.js +137 -0
- package/dist/commands/layers.js.map +1 -0
- package/dist/commands/new.d.ts +9 -0
- package/dist/commands/new.d.ts.map +1 -0
- package/dist/commands/new.js +80 -0
- package/dist/commands/new.js.map +1 -0
- package/dist/commands/pageTree.d.ts +18 -0
- package/dist/commands/pageTree.d.ts.map +1 -0
- package/dist/commands/pageTree.js +20 -0
- package/dist/commands/pageTree.js.map +1 -0
- package/dist/commands/shared.d.ts +15 -0
- package/dist/commands/shared.d.ts.map +1 -0
- package/dist/commands/shared.js +27 -0
- package/dist/commands/shared.js.map +1 -0
- package/dist/commands/sync.d.ts +15 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +101 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/NodeLayers.d.ts +7 -0
- package/dist/internal/NodeLayers.d.ts.map +1 -0
- package/dist/internal/NodeLayers.js +19 -0
- package/dist/internal/NodeLayers.js.map +1 -0
- package/dist/internal/frontmatter.d.ts +10 -0
- package/dist/internal/frontmatter.d.ts.map +1 -1
- package/dist/internal/frontmatter.js +16 -0
- package/dist/internal/frontmatter.js.map +1 -1
- package/dist/internal/gitCommands.d.ts +78 -0
- package/dist/internal/gitCommands.d.ts.map +1 -0
- package/dist/internal/gitCommands.js +156 -0
- package/dist/internal/gitCommands.js.map +1 -0
- package/dist/internal/hashUtils.d.ts +42 -1
- package/dist/internal/hashUtils.d.ts.map +1 -1
- package/dist/internal/hashUtils.js +38 -2
- package/dist/internal/hashUtils.js.map +1 -1
- package/dist/internal/oauthServer.d.ts +55 -0
- package/dist/internal/oauthServer.d.ts.map +1 -0
- package/dist/internal/oauthServer.js +110 -0
- package/dist/internal/oauthServer.js.map +1 -0
- package/dist/internal/pathUtils.d.ts +21 -4
- package/dist/internal/pathUtils.d.ts.map +1 -1
- package/dist/internal/pathUtils.js +24 -13
- package/dist/internal/pathUtils.js.map +1 -1
- package/dist/internal/tokenStorage.d.ts +75 -0
- package/dist/internal/tokenStorage.d.ts.map +1 -0
- package/dist/internal/tokenStorage.js +149 -0
- package/dist/internal/tokenStorage.js.map +1 -0
- package/dist/internal/userCache.d.ts +42 -0
- package/dist/internal/userCache.d.ts.map +1 -0
- package/dist/internal/userCache.js +51 -0
- package/dist/internal/userCache.js.map +1 -0
- package/dist/parsers/ConfluenceParser.d.ts +26 -0
- package/dist/parsers/ConfluenceParser.d.ts.map +1 -0
- package/dist/parsers/ConfluenceParser.js +792 -0
- package/dist/parsers/ConfluenceParser.js.map +1 -0
- package/dist/parsers/MarkdownParser.d.ts +26 -0
- package/dist/parsers/MarkdownParser.d.ts.map +1 -0
- package/dist/parsers/MarkdownParser.js +873 -0
- package/dist/parsers/MarkdownParser.js.map +1 -0
- package/dist/parsers/index.d.ts +8 -0
- package/dist/parsers/index.d.ts.map +1 -0
- package/dist/parsers/index.js +8 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/schemas/ConfluenceSchema.d.ts +21 -0
- package/dist/schemas/ConfluenceSchema.d.ts.map +1 -0
- package/dist/schemas/ConfluenceSchema.js +38 -0
- package/dist/schemas/ConfluenceSchema.js.map +1 -0
- package/dist/schemas/ConversionSchema.d.ts +35 -0
- package/dist/schemas/ConversionSchema.d.ts.map +1 -0
- package/dist/schemas/ConversionSchema.js +208 -0
- package/dist/schemas/ConversionSchema.js.map +1 -0
- package/dist/schemas/MarkdownSchema.d.ts +21 -0
- package/dist/schemas/MarkdownSchema.d.ts.map +1 -0
- package/dist/schemas/MarkdownSchema.js +38 -0
- package/dist/schemas/MarkdownSchema.js.map +1 -0
- package/dist/schemas/hast/HastFromHtml.d.ts +27 -0
- package/dist/schemas/hast/HastFromHtml.d.ts.map +1 -0
- package/dist/schemas/hast/HastFromHtml.js +107 -0
- package/dist/schemas/hast/HastFromHtml.js.map +1 -0
- package/dist/schemas/hast/HastSchema.d.ts +195 -0
- package/dist/schemas/hast/HastSchema.d.ts.map +1 -0
- package/dist/schemas/hast/HastSchema.js +183 -0
- package/dist/schemas/hast/HastSchema.js.map +1 -0
- package/dist/schemas/hast/index.d.ts +9 -0
- package/dist/schemas/hast/index.d.ts.map +1 -0
- package/dist/schemas/hast/index.js +3 -0
- package/dist/schemas/hast/index.js.map +1 -0
- package/dist/schemas/index.d.ts +14 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +16 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/mdast/MdastFromMarkdown.d.ts +30 -0
- package/dist/schemas/mdast/MdastFromMarkdown.d.ts.map +1 -0
- package/dist/schemas/mdast/MdastFromMarkdown.js +79 -0
- package/dist/schemas/mdast/MdastFromMarkdown.js.map +1 -0
- package/dist/schemas/mdast/MdastSchema.d.ts +385 -0
- package/dist/schemas/mdast/MdastSchema.d.ts.map +1 -0
- package/dist/schemas/mdast/MdastSchema.js +266 -0
- package/dist/schemas/mdast/MdastSchema.js.map +1 -0
- package/dist/schemas/mdast/index.d.ts +10 -0
- package/dist/schemas/mdast/index.d.ts.map +1 -0
- package/dist/schemas/mdast/index.js +4 -0
- package/dist/schemas/mdast/index.js.map +1 -0
- package/dist/schemas/mdast/mdastToString.d.ts +13 -0
- package/dist/schemas/mdast/mdastToString.d.ts.map +1 -0
- package/dist/schemas/mdast/mdastToString.js +85 -0
- package/dist/schemas/mdast/mdastToString.js.map +1 -0
- package/dist/schemas/nodes/block/BlockSchema.d.ts +43 -0
- package/dist/schemas/nodes/block/BlockSchema.d.ts.map +1 -0
- package/dist/schemas/nodes/block/BlockSchema.js +634 -0
- package/dist/schemas/nodes/block/BlockSchema.js.map +1 -0
- package/dist/schemas/nodes/block/index.d.ts +7 -0
- package/dist/schemas/nodes/block/index.d.ts.map +1 -0
- package/dist/schemas/nodes/block/index.js +7 -0
- package/dist/schemas/nodes/block/index.js.map +1 -0
- package/dist/schemas/nodes/index.d.ts +9 -0
- package/dist/schemas/nodes/index.d.ts.map +1 -0
- package/dist/schemas/nodes/index.js +12 -0
- package/dist/schemas/nodes/index.js.map +1 -0
- package/dist/schemas/nodes/inline/InlineSchema.d.ts +48 -0
- package/dist/schemas/nodes/inline/InlineSchema.d.ts.map +1 -0
- package/dist/schemas/nodes/inline/InlineSchema.js +436 -0
- package/dist/schemas/nodes/inline/InlineSchema.js.map +1 -0
- package/dist/schemas/nodes/inline/index.d.ts +7 -0
- package/dist/schemas/nodes/inline/index.d.ts.map +1 -0
- package/dist/schemas/nodes/inline/index.js +7 -0
- package/dist/schemas/nodes/inline/index.js.map +1 -0
- package/dist/schemas/nodes/macro/MacroSchema.d.ts +27 -0
- package/dist/schemas/nodes/macro/MacroSchema.d.ts.map +1 -0
- package/dist/schemas/nodes/macro/MacroSchema.js +162 -0
- package/dist/schemas/nodes/macro/MacroSchema.js.map +1 -0
- package/dist/schemas/nodes/macro/index.d.ts +7 -0
- package/dist/schemas/nodes/macro/index.d.ts.map +1 -0
- package/dist/schemas/nodes/macro/index.js +7 -0
- package/dist/schemas/nodes/macro/index.js.map +1 -0
- package/dist/schemas/preprocessing/ConfluencePreprocessor.d.ts +24 -0
- package/dist/schemas/preprocessing/ConfluencePreprocessor.d.ts.map +1 -0
- package/dist/schemas/preprocessing/ConfluencePreprocessor.js +351 -0
- package/dist/schemas/preprocessing/ConfluencePreprocessor.js.map +1 -0
- package/dist/schemas/preprocessing/index.d.ts +8 -0
- package/dist/schemas/preprocessing/index.d.ts.map +1 -0
- package/dist/schemas/preprocessing/index.js +2 -0
- package/dist/schemas/preprocessing/index.js.map +1 -0
- package/dist/serializers/ConfluenceSerializer.d.ts +30 -0
- package/dist/serializers/ConfluenceSerializer.d.ts.map +1 -0
- package/dist/serializers/ConfluenceSerializer.js +551 -0
- package/dist/serializers/ConfluenceSerializer.js.map +1 -0
- package/dist/serializers/MarkdownSerializer.d.ts +34 -0
- package/dist/serializers/MarkdownSerializer.d.ts.map +1 -0
- package/dist/serializers/MarkdownSerializer.js +355 -0
- package/dist/serializers/MarkdownSerializer.js.map +1 -0
- package/dist/serializers/index.d.ts +8 -0
- package/dist/serializers/index.d.ts.map +1 -0
- package/dist/serializers/index.js +8 -0
- package/dist/serializers/index.js.map +1 -0
- package/package.json +27 -16
- package/src/ConfluenceAuth.ts +571 -0
- package/src/ConfluenceClient.ts +188 -156
- package/src/ConfluenceConfig.ts +63 -7
- package/src/ConfluenceError.ts +110 -14
- package/src/GitError.ts +92 -0
- package/src/GitService.ts +859 -0
- package/src/LocalFileSystem.ts +179 -9
- package/src/MarkdownConverter.ts +126 -122
- package/src/SchemaConverterError.ts +108 -0
- package/src/Schemas.ts +223 -6
- package/src/SyncEngine.ts +745 -162
- package/src/ast/BlockNode.ts +425 -0
- package/src/ast/Document.ts +90 -0
- package/src/ast/InlineNode.ts +323 -0
- package/src/ast/MacroNode.ts +245 -0
- package/src/ast/index.ts +83 -0
- package/src/bin.ts +50 -249
- package/src/commands/auth.ts +117 -0
- package/src/commands/clone.ts +145 -0
- package/src/commands/delete.ts +57 -0
- package/src/commands/errorHandler.ts +32 -0
- package/src/commands/git.ts +114 -0
- package/src/commands/index.ts +10 -0
- package/src/commands/layers.ts +211 -0
- package/src/commands/new.ts +99 -0
- package/src/commands/pageTree.ts +40 -0
- package/src/commands/shared.ts +35 -0
- package/src/commands/sync.ts +129 -0
- package/src/index.ts +21 -1
- package/src/internal/NodeLayers.ts +21 -0
- package/src/internal/frontmatter.ts +21 -0
- package/src/internal/gitCommands.ts +229 -0
- package/src/internal/hashUtils.ts +65 -3
- package/src/internal/oauthServer.ts +199 -0
- package/src/internal/pathUtils.ts +34 -17
- package/src/internal/tokenStorage.ts +240 -0
- package/src/internal/userCache.ts +90 -0
- package/src/parsers/ConfluenceParser.ts +950 -0
- package/src/parsers/MarkdownParser.ts +1198 -0
- package/src/parsers/index.ts +8 -0
- package/src/schemas/ConfluenceSchema.ts +56 -0
- package/src/schemas/ConversionSchema.ts +318 -0
- package/src/schemas/MarkdownSchema.ts +56 -0
- package/src/schemas/hast/HastFromHtml.ts +153 -0
- package/src/schemas/hast/HastSchema.ts +274 -0
- package/src/schemas/hast/index.ts +35 -0
- package/src/schemas/index.ts +20 -0
- package/src/schemas/mdast/MdastFromMarkdown.ts +118 -0
- package/src/schemas/mdast/MdastSchema.ts +566 -0
- package/src/schemas/mdast/index.ts +59 -0
- package/src/schemas/mdast/mdastToString.ts +102 -0
- package/src/schemas/nodes/block/BlockSchema.ts +773 -0
- package/src/schemas/nodes/block/index.ts +13 -0
- package/src/schemas/nodes/index.ts +20 -0
- package/src/schemas/nodes/inline/InlineSchema.ts +523 -0
- package/src/schemas/nodes/inline/index.ts +14 -0
- package/src/schemas/nodes/macro/MacroSchema.ts +226 -0
- package/src/schemas/nodes/macro/index.ts +6 -0
- package/src/schemas/preprocessing/ConfluencePreprocessor.ts +446 -0
- package/src/schemas/preprocessing/index.ts +8 -0
- package/src/serializers/ConfluenceSerializer.ts +717 -0
- package/src/serializers/MarkdownSerializer.ts +493 -0
- package/src/serializers/index.ts +8 -0
- package/test/GitService.test.ts +209 -0
- package/test/MarkdownConverter.test.ts +37 -3
- package/test/Schemas.test.ts +97 -2
- package/test/ast/BlockNode.test.ts +265 -0
- package/test/ast/Document.test.ts +126 -0
- package/test/ast/InlineNode.test.ts +161 -0
- package/test/fixtures/integration-test.html.fixture +103 -0
- package/test/fixtures/integration-test.md.expected +257 -0
- package/test/integration.test.ts +269 -0
- package/test/oauthServer.test.ts +50 -0
- package/test/parsers/ConfluenceParser.test.ts +283 -0
- package/test/schemas/ConfluencePreprocessor.test.ts +180 -0
- package/test/schemas/ConversionSchema.test.ts +159 -0
- package/test/schemas/HastSchema.test.ts +138 -0
- package/test/schemas/MdastSchema.test.ts +145 -0
- package/test/schemas/nodes/block/BlockSchema.test.ts +173 -0
- package/test/schemas/nodes/inline/InlineSchema.test.ts +198 -0
- package/test/schemas/nodes/macro/MacroSchema.test.ts +142 -0
- package/test/tokenStorage.test.ts +99 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
declare const ParseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
2
|
+
readonly _tag: "ParseError";
|
|
3
|
+
} & Readonly<A>;
|
|
4
|
+
/**
|
|
5
|
+
* Error thrown when parsing HTML or Markdown fails.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { Effect } from "effect"
|
|
10
|
+
* import { ParseError } from "@knpkv/confluence-to-markdown/SchemaConverterError"
|
|
11
|
+
*
|
|
12
|
+
* Effect.gen(function* () {
|
|
13
|
+
* // ... parsing operation
|
|
14
|
+
* }).pipe(
|
|
15
|
+
* Effect.catchTag("ParseError", (error) =>
|
|
16
|
+
* Effect.sync(() => console.error(`Parse error: ${error.message}`))
|
|
17
|
+
* )
|
|
18
|
+
* )
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @category Errors
|
|
22
|
+
*/
|
|
23
|
+
export declare class ParseError extends ParseError_base<{
|
|
24
|
+
readonly source: "confluence" | "markdown";
|
|
25
|
+
readonly message: string;
|
|
26
|
+
readonly position?: {
|
|
27
|
+
readonly line: number;
|
|
28
|
+
readonly column: number;
|
|
29
|
+
};
|
|
30
|
+
readonly rawContent?: string;
|
|
31
|
+
}> {
|
|
32
|
+
}
|
|
33
|
+
declare const SerializeError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
34
|
+
readonly _tag: "SerializeError";
|
|
35
|
+
} & Readonly<A>;
|
|
36
|
+
/**
|
|
37
|
+
* Error thrown when serializing AST to HTML or Markdown fails.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import { Effect } from "effect"
|
|
42
|
+
* import { SerializeError } from "@knpkv/confluence-to-markdown/SchemaConverterError"
|
|
43
|
+
*
|
|
44
|
+
* Effect.gen(function* () {
|
|
45
|
+
* // ... serialization operation
|
|
46
|
+
* }).pipe(
|
|
47
|
+
* Effect.catchTag("SerializeError", (error) =>
|
|
48
|
+
* Effect.sync(() => console.error(`Serialize error: ${error.message}`))
|
|
49
|
+
* )
|
|
50
|
+
* )
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @category Errors
|
|
54
|
+
*/
|
|
55
|
+
export declare class SerializeError extends SerializeError_base<{
|
|
56
|
+
readonly target: "confluence" | "markdown";
|
|
57
|
+
readonly nodeType: string;
|
|
58
|
+
readonly message: string;
|
|
59
|
+
}> {
|
|
60
|
+
}
|
|
61
|
+
declare const MigrationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
62
|
+
readonly _tag: "MigrationError";
|
|
63
|
+
} & Readonly<A>;
|
|
64
|
+
/**
|
|
65
|
+
* Error thrown when migrating between schema versions fails.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* import { Effect } from "effect"
|
|
70
|
+
* import { MigrationError } from "@knpkv/confluence-to-markdown/SchemaConverterError"
|
|
71
|
+
*
|
|
72
|
+
* Effect.gen(function* () {
|
|
73
|
+
* // ... migration operation
|
|
74
|
+
* }).pipe(
|
|
75
|
+
* Effect.catchTag("MigrationError", (error) =>
|
|
76
|
+
* Effect.sync(() =>
|
|
77
|
+
* console.error(`Migration error: ${error.nodeType} v${error.fromVersion} -> v${error.toVersion}`)
|
|
78
|
+
* )
|
|
79
|
+
* )
|
|
80
|
+
* )
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @category Errors
|
|
84
|
+
*/
|
|
85
|
+
export declare class MigrationError extends MigrationError_base<{
|
|
86
|
+
readonly nodeType: string;
|
|
87
|
+
readonly fromVersion: number;
|
|
88
|
+
readonly toVersion: number;
|
|
89
|
+
readonly message: string;
|
|
90
|
+
}> {
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Union of all schema converter errors.
|
|
94
|
+
*
|
|
95
|
+
* @category Errors
|
|
96
|
+
*/
|
|
97
|
+
export type SchemaConverterError = ParseError | SerializeError | MigrationError;
|
|
98
|
+
/**
|
|
99
|
+
* Type guard to check if error is a SchemaConverterError.
|
|
100
|
+
*
|
|
101
|
+
* @param error - The error to check
|
|
102
|
+
* @returns True if error is a SchemaConverterError
|
|
103
|
+
*
|
|
104
|
+
* @category Utilities
|
|
105
|
+
*/
|
|
106
|
+
export declare const isSchemaConverterError: (error: unknown) => error is SchemaConverterError;
|
|
107
|
+
export {};
|
|
108
|
+
//# sourceMappingURL=SchemaConverterError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaConverterError.d.ts","sourceRoot":"","sources":["../src/SchemaConverterError.ts"],"names":[],"mappings":";;;AAOA;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,UAAW,SAAQ,gBAA+B;IAC7D,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAAA;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAC;CAAG;;;;AAEL;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,cAAe,SAAQ,oBAAmC;IACrE,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAAA;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAC;CAAG;;;;AAEL;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAe,SAAQ,oBAAmC;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAC;CAAG;AAEL;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,cAAc,GAAG,cAAc,CAAA;AAE/E;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,oBAM9D,CAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types for schema-based conversion.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import * as Data from "effect/Data";
|
|
7
|
+
/**
|
|
8
|
+
* Error thrown when parsing HTML or Markdown fails.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { Effect } from "effect"
|
|
13
|
+
* import { ParseError } from "@knpkv/confluence-to-markdown/SchemaConverterError"
|
|
14
|
+
*
|
|
15
|
+
* Effect.gen(function* () {
|
|
16
|
+
* // ... parsing operation
|
|
17
|
+
* }).pipe(
|
|
18
|
+
* Effect.catchTag("ParseError", (error) =>
|
|
19
|
+
* Effect.sync(() => console.error(`Parse error: ${error.message}`))
|
|
20
|
+
* )
|
|
21
|
+
* )
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @category Errors
|
|
25
|
+
*/
|
|
26
|
+
export class ParseError extends Data.TaggedError("ParseError") {
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Error thrown when serializing AST to HTML or Markdown fails.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { Effect } from "effect"
|
|
34
|
+
* import { SerializeError } from "@knpkv/confluence-to-markdown/SchemaConverterError"
|
|
35
|
+
*
|
|
36
|
+
* Effect.gen(function* () {
|
|
37
|
+
* // ... serialization operation
|
|
38
|
+
* }).pipe(
|
|
39
|
+
* Effect.catchTag("SerializeError", (error) =>
|
|
40
|
+
* Effect.sync(() => console.error(`Serialize error: ${error.message}`))
|
|
41
|
+
* )
|
|
42
|
+
* )
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @category Errors
|
|
46
|
+
*/
|
|
47
|
+
export class SerializeError extends Data.TaggedError("SerializeError") {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Error thrown when migrating between schema versions fails.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* import { Effect } from "effect"
|
|
55
|
+
* import { MigrationError } from "@knpkv/confluence-to-markdown/SchemaConverterError"
|
|
56
|
+
*
|
|
57
|
+
* Effect.gen(function* () {
|
|
58
|
+
* // ... migration operation
|
|
59
|
+
* }).pipe(
|
|
60
|
+
* Effect.catchTag("MigrationError", (error) =>
|
|
61
|
+
* Effect.sync(() =>
|
|
62
|
+
* console.error(`Migration error: ${error.nodeType} v${error.fromVersion} -> v${error.toVersion}`)
|
|
63
|
+
* )
|
|
64
|
+
* )
|
|
65
|
+
* )
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @category Errors
|
|
69
|
+
*/
|
|
70
|
+
export class MigrationError extends Data.TaggedError("MigrationError") {
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Type guard to check if error is a SchemaConverterError.
|
|
74
|
+
*
|
|
75
|
+
* @param error - The error to check
|
|
76
|
+
* @returns True if error is a SchemaConverterError
|
|
77
|
+
*
|
|
78
|
+
* @category Utilities
|
|
79
|
+
*/
|
|
80
|
+
export const isSchemaConverterError = (error) => typeof error === "object" &&
|
|
81
|
+
error !== null &&
|
|
82
|
+
"_tag" in error &&
|
|
83
|
+
["ParseError", "SerializeError", "MigrationError"].includes(error._tag);
|
|
84
|
+
//# sourceMappingURL=SchemaConverterError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaConverterError.js","sourceRoot":"","sources":["../src/SchemaConverterError.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,UAAW,SAAQ,IAAI,CAAC,WAAW,CAAC,YAAY,CAK3D;CAAG;AAEL;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,cAAe,SAAQ,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAInE;CAAG;AAEL;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,cAAe,SAAQ,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAKnE;CAAG;AASL;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAc,EAAiC,EAAE,CACtF,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACd,MAAM,IAAI,KAAK;IACf,CAAC,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,QAAQ,CACxD,KAA0B,CAAC,IAAI,CACjC,CAAA"}
|
package/dist/Schemas.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const ConfluenceConfigFileSchema: Schema.Struct<{
|
|
|
27
27
|
baseUrl: Schema.filter<typeof Schema.String>;
|
|
28
28
|
/** Optional space key */
|
|
29
29
|
spaceKey: Schema.optional<Schema.brand<Schema.filter<Schema.filter<typeof Schema.String>>, "SpaceKey">>;
|
|
30
|
-
/** Local docs path (default: .docs
|
|
30
|
+
/** Local docs path (default: .confluence/docs) */
|
|
31
31
|
docsPath: Schema.optionalWith<typeof Schema.String, {
|
|
32
32
|
default: () => string;
|
|
33
33
|
}>;
|
|
@@ -35,6 +35,14 @@ export declare const ConfluenceConfigFileSchema: Schema.Struct<{
|
|
|
35
35
|
excludePatterns: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
|
|
36
36
|
default: () => never[];
|
|
37
37
|
}>;
|
|
38
|
+
/** Save original Confluence HTML alongside markdown (default: false) */
|
|
39
|
+
saveSource: Schema.optionalWith<typeof Schema.Boolean, {
|
|
40
|
+
default: () => false;
|
|
41
|
+
}>;
|
|
42
|
+
/** Glob patterns for files to track in git */
|
|
43
|
+
trackedPaths: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
|
|
44
|
+
default: () => string[];
|
|
45
|
+
}>;
|
|
38
46
|
}>;
|
|
39
47
|
/**
|
|
40
48
|
* Type for .confluence.json configuration file.
|
|
@@ -76,6 +84,12 @@ export declare const PageFrontMatterSchema: Schema.Struct<{
|
|
|
76
84
|
position: Schema.optional<typeof Schema.Number>;
|
|
77
85
|
/** SHA256 hash of content for change detection */
|
|
78
86
|
contentHash: Schema.brand<Schema.filter<typeof Schema.String>, "ContentHash">;
|
|
87
|
+
/** Version message from Confluence (used as git commit message) */
|
|
88
|
+
versionMessage: Schema.optional<typeof Schema.String>;
|
|
89
|
+
/** Author display name */
|
|
90
|
+
authorName: Schema.optional<typeof Schema.String>;
|
|
91
|
+
/** Author email */
|
|
92
|
+
authorEmail: Schema.optional<typeof Schema.String>;
|
|
79
93
|
}>;
|
|
80
94
|
/**
|
|
81
95
|
* Type for page front-matter.
|
|
@@ -132,10 +146,13 @@ export type SyncState = Schema.Schema.Type<typeof SyncStateSchema>;
|
|
|
132
146
|
export declare const PageResponseSchema: Schema.Struct<{
|
|
133
147
|
id: typeof Schema.String;
|
|
134
148
|
title: typeof Schema.String;
|
|
149
|
+
spaceId: Schema.optional<typeof Schema.String>;
|
|
135
150
|
status: Schema.optional<typeof Schema.String>;
|
|
136
151
|
version: Schema.Struct<{
|
|
137
152
|
number: typeof Schema.Number;
|
|
138
153
|
createdAt: Schema.optional<typeof Schema.String>;
|
|
154
|
+
message: Schema.optional<typeof Schema.String>;
|
|
155
|
+
authorId: Schema.optional<typeof Schema.String>;
|
|
139
156
|
}>;
|
|
140
157
|
body: Schema.optional<Schema.Struct<{
|
|
141
158
|
storage: Schema.optional<Schema.Struct<{
|
|
@@ -167,6 +184,8 @@ export declare const PageListItemSchema: Schema.Struct<{
|
|
|
167
184
|
version: Schema.optional<Schema.Struct<{
|
|
168
185
|
number: typeof Schema.Number;
|
|
169
186
|
createdAt: Schema.optional<typeof Schema.String>;
|
|
187
|
+
message: Schema.optional<typeof Schema.String>;
|
|
188
|
+
authorId: Schema.optional<typeof Schema.String>;
|
|
170
189
|
}>>;
|
|
171
190
|
body: Schema.optional<Schema.Struct<{
|
|
172
191
|
storage: Schema.optional<Schema.Struct<{
|
|
@@ -199,6 +218,8 @@ export declare const PageChildrenResponseSchema: Schema.Struct<{
|
|
|
199
218
|
version: Schema.optional<Schema.Struct<{
|
|
200
219
|
number: typeof Schema.Number;
|
|
201
220
|
createdAt: Schema.optional<typeof Schema.String>;
|
|
221
|
+
message: Schema.optional<typeof Schema.String>;
|
|
222
|
+
authorId: Schema.optional<typeof Schema.String>;
|
|
202
223
|
}>>;
|
|
203
224
|
body: Schema.optional<Schema.Struct<{
|
|
204
225
|
storage: Schema.optional<Schema.Struct<{
|
|
@@ -222,4 +243,207 @@ export declare const PageChildrenResponseSchema: Schema.Struct<{
|
|
|
222
243
|
* @category Types
|
|
223
244
|
*/
|
|
224
245
|
export type PageChildrenResponse = Schema.Schema.Type<typeof PageChildrenResponseSchema>;
|
|
246
|
+
/**
|
|
247
|
+
* Schema for OAuth user info.
|
|
248
|
+
*
|
|
249
|
+
* @category Schema
|
|
250
|
+
*/
|
|
251
|
+
export declare const OAuthUserSchema: Schema.Struct<{
|
|
252
|
+
/** Atlassian account ID */
|
|
253
|
+
account_id: typeof Schema.String;
|
|
254
|
+
/** Display name */
|
|
255
|
+
name: typeof Schema.String;
|
|
256
|
+
/** Email address */
|
|
257
|
+
email: typeof Schema.String;
|
|
258
|
+
}>;
|
|
259
|
+
/**
|
|
260
|
+
* Type for OAuth user info.
|
|
261
|
+
*
|
|
262
|
+
* @category Types
|
|
263
|
+
*/
|
|
264
|
+
export type OAuthUser = Schema.Schema.Type<typeof OAuthUserSchema>;
|
|
265
|
+
/**
|
|
266
|
+
* Schema for stored OAuth token.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* ```typescript
|
|
270
|
+
* import { OAuthTokenSchema } from "@knpkv/confluence-to-markdown/Schemas"
|
|
271
|
+
* import * as Schema from "effect/Schema"
|
|
272
|
+
*
|
|
273
|
+
* const token = Schema.decodeUnknownSync(OAuthTokenSchema)({
|
|
274
|
+
* access_token: "eyJ...",
|
|
275
|
+
* refresh_token: "eyJ...",
|
|
276
|
+
* expires_at: Date.now() + 3600000,
|
|
277
|
+
* scope: "read:confluence-content.all",
|
|
278
|
+
* cloud_id: "abc123",
|
|
279
|
+
* site_url: "https://mysite.atlassian.net"
|
|
280
|
+
* })
|
|
281
|
+
* ```
|
|
282
|
+
*
|
|
283
|
+
* @category Schema
|
|
284
|
+
*/
|
|
285
|
+
export declare const OAuthTokenSchema: Schema.Struct<{
|
|
286
|
+
/** OAuth access token */
|
|
287
|
+
access_token: typeof Schema.String;
|
|
288
|
+
/** OAuth refresh token */
|
|
289
|
+
refresh_token: typeof Schema.String;
|
|
290
|
+
/** Token expiration timestamp (Unix ms) */
|
|
291
|
+
expires_at: typeof Schema.Number;
|
|
292
|
+
/** Granted scopes */
|
|
293
|
+
scope: typeof Schema.String;
|
|
294
|
+
/** Atlassian Cloud site ID */
|
|
295
|
+
cloud_id: typeof Schema.String;
|
|
296
|
+
/** Confluence site URL */
|
|
297
|
+
site_url: typeof Schema.String;
|
|
298
|
+
/** Cached user info */
|
|
299
|
+
user: Schema.optional<Schema.Struct<{
|
|
300
|
+
/** Atlassian account ID */
|
|
301
|
+
account_id: typeof Schema.String;
|
|
302
|
+
/** Display name */
|
|
303
|
+
name: typeof Schema.String;
|
|
304
|
+
/** Email address */
|
|
305
|
+
email: typeof Schema.String;
|
|
306
|
+
}>>;
|
|
307
|
+
}>;
|
|
308
|
+
/**
|
|
309
|
+
* Type for stored OAuth token.
|
|
310
|
+
*
|
|
311
|
+
* @category Types
|
|
312
|
+
*/
|
|
313
|
+
export type OAuthToken = Schema.Schema.Type<typeof OAuthTokenSchema>;
|
|
314
|
+
/**
|
|
315
|
+
* Schema for OAuth client configuration.
|
|
316
|
+
*
|
|
317
|
+
* @category Schema
|
|
318
|
+
*/
|
|
319
|
+
export declare const OAuthConfigSchema: Schema.Struct<{
|
|
320
|
+
/** OAuth client ID from Atlassian Developer Console */
|
|
321
|
+
clientId: typeof Schema.String;
|
|
322
|
+
/** OAuth client secret */
|
|
323
|
+
clientSecret: typeof Schema.String;
|
|
324
|
+
}>;
|
|
325
|
+
/**
|
|
326
|
+
* Type for OAuth client configuration.
|
|
327
|
+
*
|
|
328
|
+
* @category Types
|
|
329
|
+
*/
|
|
330
|
+
export type OAuthConfig = Schema.Schema.Type<typeof OAuthConfigSchema>;
|
|
331
|
+
/**
|
|
332
|
+
* Schema for Atlassian user info.
|
|
333
|
+
*
|
|
334
|
+
* @category Schema
|
|
335
|
+
*/
|
|
336
|
+
export declare const AtlassianUserSchema: Schema.Struct<{
|
|
337
|
+
/** Atlassian account ID */
|
|
338
|
+
accountId: typeof Schema.String;
|
|
339
|
+
/** Display name */
|
|
340
|
+
displayName: typeof Schema.String;
|
|
341
|
+
/** Email address (may be empty for privacy settings) */
|
|
342
|
+
email: Schema.optional<typeof Schema.String>;
|
|
343
|
+
/** Public name */
|
|
344
|
+
publicName: Schema.optional<typeof Schema.String>;
|
|
345
|
+
}>;
|
|
346
|
+
/**
|
|
347
|
+
* Type for Atlassian user info.
|
|
348
|
+
*
|
|
349
|
+
* @category Types
|
|
350
|
+
*/
|
|
351
|
+
export type AtlassianUser = Schema.Schema.Type<typeof AtlassianUserSchema>;
|
|
352
|
+
/**
|
|
353
|
+
* Schema for page version info (from versions list).
|
|
354
|
+
*
|
|
355
|
+
* @category Schema
|
|
356
|
+
*/
|
|
357
|
+
export declare const PageVersionSchema: Schema.Struct<{
|
|
358
|
+
/** Version number */
|
|
359
|
+
number: typeof Schema.Number;
|
|
360
|
+
/** Author account ID */
|
|
361
|
+
authorId: Schema.optional<typeof Schema.String>;
|
|
362
|
+
/** Creation timestamp */
|
|
363
|
+
createdAt: typeof Schema.String;
|
|
364
|
+
/** Version message/comment */
|
|
365
|
+
message: Schema.optional<typeof Schema.String>;
|
|
366
|
+
/** Page info with title and body (when body-format is requested) */
|
|
367
|
+
page: Schema.optional<Schema.Struct<{
|
|
368
|
+
id: Schema.optional<typeof Schema.String>;
|
|
369
|
+
title: Schema.optional<typeof Schema.String>;
|
|
370
|
+
body: Schema.optional<Schema.Struct<{
|
|
371
|
+
storage: Schema.optional<Schema.Struct<{
|
|
372
|
+
value: typeof Schema.String;
|
|
373
|
+
representation: Schema.optional<typeof Schema.String>;
|
|
374
|
+
}>>;
|
|
375
|
+
}>>;
|
|
376
|
+
}>>;
|
|
377
|
+
}>;
|
|
378
|
+
/**
|
|
379
|
+
* Type for page version info.
|
|
380
|
+
*
|
|
381
|
+
* @category Types
|
|
382
|
+
*/
|
|
383
|
+
export type PageVersion = Schema.Schema.Type<typeof PageVersionSchema>;
|
|
384
|
+
/**
|
|
385
|
+
* Schema for page version with content.
|
|
386
|
+
*
|
|
387
|
+
* @category Schema
|
|
388
|
+
*/
|
|
389
|
+
export declare const PageVersionContentSchema: Schema.Struct<{
|
|
390
|
+
/** Version number */
|
|
391
|
+
number: typeof Schema.Number;
|
|
392
|
+
/** Author account ID */
|
|
393
|
+
authorId: Schema.optional<typeof Schema.String>;
|
|
394
|
+
/** Creation timestamp */
|
|
395
|
+
createdAt: typeof Schema.String;
|
|
396
|
+
/** Version message/comment */
|
|
397
|
+
message: Schema.optional<typeof Schema.String>;
|
|
398
|
+
/** Page content */
|
|
399
|
+
body: Schema.optional<Schema.Struct<{
|
|
400
|
+
storage: Schema.optional<Schema.Struct<{
|
|
401
|
+
value: typeof Schema.String;
|
|
402
|
+
representation: Schema.optional<typeof Schema.String>;
|
|
403
|
+
}>>;
|
|
404
|
+
}>>;
|
|
405
|
+
}>;
|
|
406
|
+
/**
|
|
407
|
+
* Type for page version with content.
|
|
408
|
+
*
|
|
409
|
+
* @category Types
|
|
410
|
+
*/
|
|
411
|
+
export type PageVersionContent = Schema.Schema.Type<typeof PageVersionContentSchema>;
|
|
412
|
+
/**
|
|
413
|
+
* Schema for page versions API response.
|
|
414
|
+
*
|
|
415
|
+
* @category Schema
|
|
416
|
+
*/
|
|
417
|
+
export declare const PageVersionsResponseSchema: Schema.Struct<{
|
|
418
|
+
results: Schema.Array$<Schema.Struct<{
|
|
419
|
+
/** Version number */
|
|
420
|
+
number: typeof Schema.Number;
|
|
421
|
+
/** Author account ID */
|
|
422
|
+
authorId: Schema.optional<typeof Schema.String>;
|
|
423
|
+
/** Creation timestamp */
|
|
424
|
+
createdAt: typeof Schema.String;
|
|
425
|
+
/** Version message/comment */
|
|
426
|
+
message: Schema.optional<typeof Schema.String>;
|
|
427
|
+
/** Page info with title and body (when body-format is requested) */
|
|
428
|
+
page: Schema.optional<Schema.Struct<{
|
|
429
|
+
id: Schema.optional<typeof Schema.String>;
|
|
430
|
+
title: Schema.optional<typeof Schema.String>;
|
|
431
|
+
body: Schema.optional<Schema.Struct<{
|
|
432
|
+
storage: Schema.optional<Schema.Struct<{
|
|
433
|
+
value: typeof Schema.String;
|
|
434
|
+
representation: Schema.optional<typeof Schema.String>;
|
|
435
|
+
}>>;
|
|
436
|
+
}>>;
|
|
437
|
+
}>>;
|
|
438
|
+
}>>;
|
|
439
|
+
_links: Schema.optional<Schema.Struct<{
|
|
440
|
+
next: Schema.optional<typeof Schema.String>;
|
|
441
|
+
}>>;
|
|
442
|
+
}>;
|
|
443
|
+
/**
|
|
444
|
+
* Type for page versions response.
|
|
445
|
+
*
|
|
446
|
+
* @category Types
|
|
447
|
+
*/
|
|
448
|
+
export type PageVersionsResponse = Schema.Schema.Type<typeof PageVersionsResponseSchema>;
|
|
225
449
|
//# sourceMappingURL=Schemas.d.ts.map
|
package/dist/Schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schemas.d.ts","sourceRoot":"","sources":["../src/Schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,0BAA0B;IACrC,gCAAgC;;IAEhC,gCAAgC;;IAIhC,yBAAyB;;IAEzB,kDAAkD;;;;IAElD,yCAAyC;;;;
|
|
1
|
+
{"version":3,"file":"Schemas.d.ts","sourceRoot":"","sources":["../src/Schemas.ts"],"names":[],"mappings":"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"}
|
package/dist/Schemas.js
CHANGED
|
@@ -28,10 +28,14 @@ export const ConfluenceConfigFileSchema = Schema.Struct({
|
|
|
28
28
|
baseUrl: Schema.String.pipe(Schema.pattern(/^https:\/\/[a-z0-9-]+\.atlassian\.net$/)),
|
|
29
29
|
/** Optional space key */
|
|
30
30
|
spaceKey: Schema.optional(SpaceKeySchema),
|
|
31
|
-
/** Local docs path (default: .docs
|
|
32
|
-
docsPath: Schema.optionalWith(Schema.String, { default: () => ".docs
|
|
31
|
+
/** Local docs path (default: .confluence/docs) */
|
|
32
|
+
docsPath: Schema.optionalWith(Schema.String, { default: () => ".confluence/docs" }),
|
|
33
33
|
/** Glob patterns to exclude from sync */
|
|
34
|
-
excludePatterns: Schema.optionalWith(Schema.Array(Schema.String), { default: () => [] })
|
|
34
|
+
excludePatterns: Schema.optionalWith(Schema.Array(Schema.String), { default: () => [] }),
|
|
35
|
+
/** Save original Confluence HTML alongside markdown (default: false) */
|
|
36
|
+
saveSource: Schema.optionalWith(Schema.Boolean, { default: () => false }),
|
|
37
|
+
/** Glob patterns for files to track in git */
|
|
38
|
+
trackedPaths: Schema.optionalWith(Schema.Array(Schema.String), { default: () => ["**/*.md"] })
|
|
35
39
|
});
|
|
36
40
|
/**
|
|
37
41
|
* Schema for page front-matter in markdown files.
|
|
@@ -66,7 +70,13 @@ export const PageFrontMatterSchema = Schema.Struct({
|
|
|
66
70
|
/** Position among siblings (optional) */
|
|
67
71
|
position: Schema.optional(Schema.Number),
|
|
68
72
|
/** SHA256 hash of content for change detection */
|
|
69
|
-
contentHash: ContentHashSchema
|
|
73
|
+
contentHash: ContentHashSchema,
|
|
74
|
+
/** Version message from Confluence (used as git commit message) */
|
|
75
|
+
versionMessage: Schema.optional(Schema.String),
|
|
76
|
+
/** Author display name */
|
|
77
|
+
authorName: Schema.optional(Schema.String),
|
|
78
|
+
/** Author email */
|
|
79
|
+
authorEmail: Schema.optional(Schema.String)
|
|
70
80
|
});
|
|
71
81
|
/**
|
|
72
82
|
* Schema for new page front-matter (no pageId yet).
|
|
@@ -108,10 +118,13 @@ export const SyncStateSchema = Schema.Struct({
|
|
|
108
118
|
export const PageResponseSchema = Schema.Struct({
|
|
109
119
|
id: Schema.String,
|
|
110
120
|
title: Schema.String,
|
|
121
|
+
spaceId: Schema.optional(Schema.String),
|
|
111
122
|
status: Schema.optional(Schema.String),
|
|
112
123
|
version: Schema.Struct({
|
|
113
124
|
number: Schema.Number,
|
|
114
|
-
createdAt: Schema.optional(Schema.String)
|
|
125
|
+
createdAt: Schema.optional(Schema.String),
|
|
126
|
+
message: Schema.optional(Schema.String),
|
|
127
|
+
authorId: Schema.optional(Schema.String)
|
|
115
128
|
}),
|
|
116
129
|
body: Schema.optional(Schema.Struct({
|
|
117
130
|
storage: Schema.optional(Schema.Struct({
|
|
@@ -136,7 +149,9 @@ export const PageListItemSchema = Schema.Struct({
|
|
|
136
149
|
status: Schema.optional(Schema.String),
|
|
137
150
|
version: Schema.optional(Schema.Struct({
|
|
138
151
|
number: Schema.Number,
|
|
139
|
-
createdAt: Schema.optional(Schema.String)
|
|
152
|
+
createdAt: Schema.optional(Schema.String),
|
|
153
|
+
message: Schema.optional(Schema.String),
|
|
154
|
+
authorId: Schema.optional(Schema.String)
|
|
140
155
|
})),
|
|
141
156
|
body: Schema.optional(Schema.Struct({
|
|
142
157
|
storage: Schema.optional(Schema.Struct({
|
|
@@ -161,4 +176,138 @@ export const PageChildrenResponseSchema = Schema.Struct({
|
|
|
161
176
|
next: Schema.optional(Schema.String)
|
|
162
177
|
}))
|
|
163
178
|
});
|
|
179
|
+
/**
|
|
180
|
+
* Schema for OAuth user info.
|
|
181
|
+
*
|
|
182
|
+
* @category Schema
|
|
183
|
+
*/
|
|
184
|
+
export const OAuthUserSchema = Schema.Struct({
|
|
185
|
+
/** Atlassian account ID */
|
|
186
|
+
account_id: Schema.String,
|
|
187
|
+
/** Display name */
|
|
188
|
+
name: Schema.String,
|
|
189
|
+
/** Email address */
|
|
190
|
+
email: Schema.String
|
|
191
|
+
});
|
|
192
|
+
/**
|
|
193
|
+
* Schema for stored OAuth token.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* import { OAuthTokenSchema } from "@knpkv/confluence-to-markdown/Schemas"
|
|
198
|
+
* import * as Schema from "effect/Schema"
|
|
199
|
+
*
|
|
200
|
+
* const token = Schema.decodeUnknownSync(OAuthTokenSchema)({
|
|
201
|
+
* access_token: "eyJ...",
|
|
202
|
+
* refresh_token: "eyJ...",
|
|
203
|
+
* expires_at: Date.now() + 3600000,
|
|
204
|
+
* scope: "read:confluence-content.all",
|
|
205
|
+
* cloud_id: "abc123",
|
|
206
|
+
* site_url: "https://mysite.atlassian.net"
|
|
207
|
+
* })
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* @category Schema
|
|
211
|
+
*/
|
|
212
|
+
export const OAuthTokenSchema = Schema.Struct({
|
|
213
|
+
/** OAuth access token */
|
|
214
|
+
access_token: Schema.String,
|
|
215
|
+
/** OAuth refresh token */
|
|
216
|
+
refresh_token: Schema.String,
|
|
217
|
+
/** Token expiration timestamp (Unix ms) */
|
|
218
|
+
expires_at: Schema.Number,
|
|
219
|
+
/** Granted scopes */
|
|
220
|
+
scope: Schema.String,
|
|
221
|
+
/** Atlassian Cloud site ID */
|
|
222
|
+
cloud_id: Schema.String,
|
|
223
|
+
/** Confluence site URL */
|
|
224
|
+
site_url: Schema.String,
|
|
225
|
+
/** Cached user info */
|
|
226
|
+
user: Schema.optional(OAuthUserSchema)
|
|
227
|
+
});
|
|
228
|
+
/**
|
|
229
|
+
* Schema for OAuth client configuration.
|
|
230
|
+
*
|
|
231
|
+
* @category Schema
|
|
232
|
+
*/
|
|
233
|
+
export const OAuthConfigSchema = Schema.Struct({
|
|
234
|
+
/** OAuth client ID from Atlassian Developer Console */
|
|
235
|
+
clientId: Schema.String,
|
|
236
|
+
/** OAuth client secret */
|
|
237
|
+
clientSecret: Schema.String
|
|
238
|
+
});
|
|
239
|
+
/**
|
|
240
|
+
* Schema for Atlassian user info.
|
|
241
|
+
*
|
|
242
|
+
* @category Schema
|
|
243
|
+
*/
|
|
244
|
+
export const AtlassianUserSchema = Schema.Struct({
|
|
245
|
+
/** Atlassian account ID */
|
|
246
|
+
accountId: Schema.String,
|
|
247
|
+
/** Display name */
|
|
248
|
+
displayName: Schema.String,
|
|
249
|
+
/** Email address (may be empty for privacy settings) */
|
|
250
|
+
email: Schema.optional(Schema.String),
|
|
251
|
+
/** Public name */
|
|
252
|
+
publicName: Schema.optional(Schema.String)
|
|
253
|
+
});
|
|
254
|
+
/**
|
|
255
|
+
* Schema for page version info (from versions list).
|
|
256
|
+
*
|
|
257
|
+
* @category Schema
|
|
258
|
+
*/
|
|
259
|
+
export const PageVersionSchema = Schema.Struct({
|
|
260
|
+
/** Version number */
|
|
261
|
+
number: Schema.Number,
|
|
262
|
+
/** Author account ID */
|
|
263
|
+
authorId: Schema.optional(Schema.String),
|
|
264
|
+
/** Creation timestamp */
|
|
265
|
+
createdAt: Schema.String,
|
|
266
|
+
/** Version message/comment */
|
|
267
|
+
message: Schema.optional(Schema.String),
|
|
268
|
+
/** Page info with title and body (when body-format is requested) */
|
|
269
|
+
page: Schema.optional(Schema.Struct({
|
|
270
|
+
id: Schema.optional(Schema.String),
|
|
271
|
+
title: Schema.optional(Schema.String),
|
|
272
|
+
body: Schema.optional(Schema.Struct({
|
|
273
|
+
storage: Schema.optional(Schema.Struct({
|
|
274
|
+
value: Schema.String,
|
|
275
|
+
representation: Schema.optional(Schema.String)
|
|
276
|
+
}))
|
|
277
|
+
}))
|
|
278
|
+
}))
|
|
279
|
+
});
|
|
280
|
+
/**
|
|
281
|
+
* Schema for page version with content.
|
|
282
|
+
*
|
|
283
|
+
* @category Schema
|
|
284
|
+
*/
|
|
285
|
+
export const PageVersionContentSchema = Schema.Struct({
|
|
286
|
+
/** Version number */
|
|
287
|
+
number: Schema.Number,
|
|
288
|
+
/** Author account ID */
|
|
289
|
+
authorId: Schema.optional(Schema.String),
|
|
290
|
+
/** Creation timestamp */
|
|
291
|
+
createdAt: Schema.String,
|
|
292
|
+
/** Version message/comment */
|
|
293
|
+
message: Schema.optional(Schema.String),
|
|
294
|
+
/** Page content */
|
|
295
|
+
body: Schema.optional(Schema.Struct({
|
|
296
|
+
storage: Schema.optional(Schema.Struct({
|
|
297
|
+
value: Schema.String,
|
|
298
|
+
representation: Schema.optional(Schema.String)
|
|
299
|
+
}))
|
|
300
|
+
}))
|
|
301
|
+
});
|
|
302
|
+
/**
|
|
303
|
+
* Schema for page versions API response.
|
|
304
|
+
*
|
|
305
|
+
* @category Schema
|
|
306
|
+
*/
|
|
307
|
+
export const PageVersionsResponseSchema = Schema.Struct({
|
|
308
|
+
results: Schema.Array(PageVersionSchema),
|
|
309
|
+
_links: Schema.optional(Schema.Struct({
|
|
310
|
+
next: Schema.optional(Schema.String)
|
|
311
|
+
}))
|
|
312
|
+
});
|
|
164
313
|
//# sourceMappingURL=Schemas.js.map
|