@interactive-inc/docs-client 0.0.3 → 0.0.5
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 +228 -0
- package/build/doc-client.d.ts +59 -0
- package/build/doc-client.d.ts.map +1 -0
- package/build/doc-client.js +95 -0
- package/build/doc-client.test.d.ts +2 -0
- package/build/doc-client.test.d.ts.map +1 -0
- package/build/doc-client.test.js +38 -0
- package/build/doc-directory-reference.d.ts +65 -0
- package/build/doc-directory-reference.d.ts.map +1 -0
- package/build/doc-directory-reference.js +292 -0
- package/build/doc-directory-reference.test.d.ts +2 -0
- package/build/doc-directory-reference.test.d.ts.map +1 -0
- package/build/doc-directory-reference.test.js +100 -0
- package/build/doc-file-index-reference.d.ts +72 -0
- package/build/doc-file-index-reference.d.ts.map +1 -0
- package/build/doc-file-index-reference.js +191 -0
- package/build/doc-file-index-reference.test.d.ts +2 -0
- package/build/doc-file-index-reference.test.d.ts.map +1 -0
- package/build/doc-file-index-reference.test.js +77 -0
- package/build/doc-file-md-reference.d.ts +97 -0
- package/build/doc-file-md-reference.d.ts.map +1 -0
- package/build/doc-file-md-reference.js +297 -0
- package/build/doc-file-md-reference.test.d.ts +2 -0
- package/build/doc-file-md-reference.test.d.ts.map +1 -0
- package/build/doc-file-md-reference.test.js +465 -0
- package/build/doc-file-relation-reference.d.ts +54 -0
- package/build/doc-file-relation-reference.d.ts.map +1 -0
- package/build/doc-file-relation-reference.js +109 -0
- package/build/doc-file-system-debug.d.ts +81 -0
- package/build/doc-file-system-debug.d.ts.map +1 -0
- package/build/doc-file-system-debug.js +317 -0
- package/build/doc-file-system.d.ts +100 -0
- package/build/doc-file-system.d.ts.map +1 -0
- package/build/doc-file-system.js +210 -0
- package/build/doc-file-tree-system.d.ts +38 -0
- package/build/doc-file-tree-system.d.ts.map +1 -0
- package/build/doc-file-tree-system.js +153 -0
- package/build/doc-file-tree-system.test.d.ts +2 -0
- package/build/doc-file-tree-system.test.d.ts.map +1 -0
- package/build/doc-file-tree-system.test.js +105 -0
- package/build/doc-file-unknown-reference.d.ts +80 -0
- package/build/doc-file-unknown-reference.d.ts.map +1 -0
- package/build/doc-file-unknown-reference.js +181 -0
- package/build/doc-file-unknown-reference.test.d.ts +2 -0
- package/build/doc-file-unknown-reference.test.d.ts.map +1 -0
- package/build/doc-file-unknown-reference.test.js +73 -0
- package/build/doc-markdown-system.d.ts +44 -0
- package/build/doc-markdown-system.d.ts.map +1 -0
- package/build/doc-markdown-system.js +153 -0
- package/build/doc-markdown-system.test.d.ts +2 -0
- package/build/doc-markdown-system.test.d.ts.map +1 -0
- package/build/doc-markdown-system.test.js +124 -0
- package/build/doc-path-system.d.ts +43 -0
- package/build/doc-path-system.d.ts.map +1 -0
- package/build/doc-path-system.js +148 -0
- package/build/doc-path-system.test.d.ts +2 -0
- package/build/doc-path-system.test.d.ts.map +1 -0
- package/build/doc-path-system.test.js +67 -0
- package/build/entities/doc-file-entity.d.ts +5 -0
- package/build/entities/doc-file-entity.d.ts.map +1 -0
- package/build/entities/doc-file-entity.js +1 -0
- package/build/entities/doc-file-index-entity.d.ts +30 -0
- package/build/entities/doc-file-index-entity.d.ts.map +1 -0
- package/build/entities/doc-file-index-entity.js +49 -0
- package/build/entities/doc-file-index-entity.test.d.ts +2 -0
- package/build/entities/doc-file-index-entity.test.d.ts.map +1 -0
- package/build/entities/doc-file-index-entity.test.js +195 -0
- package/build/entities/doc-file-md-entity.d.ts +30 -0
- package/build/entities/doc-file-md-entity.d.ts.map +1 -0
- package/build/entities/doc-file-md-entity.js +49 -0
- package/build/entities/doc-file-md-entity.test.d.ts +2 -0
- package/build/entities/doc-file-md-entity.test.d.ts.map +1 -0
- package/build/entities/doc-file-md-entity.test.js +178 -0
- package/build/entities/doc-file-unknown-entity.d.ts +26 -0
- package/build/entities/doc-file-unknown-entity.d.ts.map +1 -0
- package/build/entities/doc-file-unknown-entity.js +45 -0
- package/build/entities/doc-file-unknown-entity.test.d.ts +2 -0
- package/build/entities/doc-file-unknown-entity.test.d.ts.map +1 -0
- package/build/entities/doc-file-unknown-entity.test.js +131 -0
- package/build/index.d.ts +42 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +39 -24064
- package/build/models.d.ts +818 -0
- package/build/models.d.ts.map +1 -0
- package/build/models.js +312 -0
- package/build/types.d.ts +154 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +1 -0
- package/build/values/doc-content-md-front-matter-value.d.ts +49 -0
- package/build/values/doc-content-md-front-matter-value.d.ts.map +1 -0
- package/build/values/doc-content-md-front-matter-value.js +94 -0
- package/build/values/doc-content-md-front-matter-value.test.d.ts +2 -0
- package/build/values/doc-content-md-front-matter-value.test.d.ts.map +1 -0
- package/build/values/doc-content-md-front-matter-value.test.js +73 -0
- package/build/values/doc-content-md-value.d.ts +66 -0
- package/build/values/doc-content-md-value.d.ts.map +1 -0
- package/build/values/doc-content-md-value.js +218 -0
- package/build/values/doc-content-md-value.test.d.ts +2 -0
- package/build/values/doc-content-md-value.test.d.ts.map +1 -0
- package/build/values/doc-content-md-value.test.js +179 -0
- package/build/values/doc-directory-path-value.d.ts +89 -0
- package/build/values/doc-directory-path-value.d.ts.map +1 -0
- package/build/values/doc-directory-path-value.js +145 -0
- package/build/values/doc-directory-path-value.test.d.ts +2 -0
- package/build/values/doc-directory-path-value.test.d.ts.map +1 -0
- package/build/values/doc-directory-path-value.test.js +68 -0
- package/build/values/doc-file-content-index-value.d.ts +62 -0
- package/build/values/doc-file-content-index-value.d.ts.map +1 -0
- package/build/values/doc-file-content-index-value.js +134 -0
- package/build/values/doc-file-content-index-value.test.d.ts +2 -0
- package/build/values/doc-file-content-index-value.test.d.ts.map +1 -0
- package/build/values/doc-file-content-index-value.test.js +203 -0
- package/build/values/doc-file-content-md-value.d.ts +62 -0
- package/build/values/doc-file-content-md-value.d.ts.map +1 -0
- package/build/values/doc-file-content-md-value.js +139 -0
- package/build/values/doc-file-content-md-value.test.d.ts +2 -0
- package/build/values/doc-file-content-md-value.test.d.ts.map +1 -0
- package/build/values/doc-file-content-md-value.test.js +160 -0
- package/build/values/doc-file-path-value.d.ts +47 -0
- package/build/values/doc-file-path-value.d.ts.map +1 -0
- package/build/values/doc-file-path-value.js +83 -0
- package/build/values/doc-file-path-value.test.d.ts +2 -0
- package/build/values/doc-file-path-value.test.d.ts.map +1 -0
- package/build/values/doc-file-path-value.test.js +84 -0
- package/build/values/doc-front-matter-index-value.d.ts +66 -0
- package/build/values/doc-front-matter-index-value.d.ts.map +1 -0
- package/build/values/doc-front-matter-index-value.js +185 -0
- package/build/values/doc-front-matter-index-value.test.d.ts +2 -0
- package/build/values/doc-front-matter-index-value.test.d.ts.map +1 -0
- package/build/values/doc-front-matter-index-value.test.js +98 -0
- package/build/values/doc-front-matter-md-value-accessor.test.d.ts +2 -0
- package/build/values/doc-front-matter-md-value-accessor.test.d.ts.map +1 -0
- package/build/values/doc-front-matter-md-value-accessor.test.js +226 -0
- package/build/values/doc-front-matter-md-value.d.ts +80 -0
- package/build/values/doc-front-matter-md-value.d.ts.map +1 -0
- package/build/values/doc-front-matter-md-value.js +257 -0
- package/build/values/doc-front-matter-md-value.test.d.ts +2 -0
- package/build/values/doc-front-matter-md-value.test.d.ts.map +1 -0
- package/build/values/doc-front-matter-md-value.test.js +198 -0
- package/build/values/doc-relation-field-value.d.ts +57 -0
- package/build/values/doc-relation-field-value.d.ts.map +1 -0
- package/build/values/doc-relation-field-value.js +85 -0
- package/build/values/doc-relation-field-value.test.d.ts +2 -0
- package/build/values/doc-relation-field-value.test.d.ts.map +1 -0
- package/build/values/doc-relation-field-value.test.js +115 -0
- package/build/values/doc-relation-file-value.d.ts +33 -0
- package/build/values/doc-relation-file-value.d.ts.map +1 -0
- package/build/values/doc-relation-file-value.js +55 -0
- package/build/values/doc-relation-file-value.test.d.ts +2 -0
- package/build/values/doc-relation-file-value.test.d.ts.map +1 -0
- package/build/values/doc-relation-file-value.test.js +77 -0
- package/build/values/doc-relation-value.d.ts +34 -0
- package/build/values/doc-relation-value.d.ts.map +1 -0
- package/build/values/doc-relation-value.js +56 -0
- package/build/values/doc-relation-value.test.d.ts +2 -0
- package/build/values/doc-relation-value.test.d.ts.map +1 -0
- package/build/values/doc-relation-value.test.js +89 -0
- package/build/values/doc-schema-field-boolean-multiple-value.d.ts +23 -0
- package/build/values/doc-schema-field-boolean-multiple-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-boolean-multiple-value.js +43 -0
- package/build/values/doc-schema-field-boolean-multiple-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-boolean-multiple-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-boolean-multiple-value.test.js +76 -0
- package/build/values/doc-schema-field-boolean-single-value.d.ts +23 -0
- package/build/values/doc-schema-field-boolean-single-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-boolean-single-value.js +39 -0
- package/build/values/doc-schema-field-boolean-single-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-boolean-single-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-boolean-single-value.test.js +73 -0
- package/build/values/doc-schema-field-factory.d.ts +37 -0
- package/build/values/doc-schema-field-factory.d.ts.map +1 -0
- package/build/values/doc-schema-field-factory.js +151 -0
- package/build/values/doc-schema-field-factory.test.d.ts +2 -0
- package/build/values/doc-schema-field-factory.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-factory.test.js +215 -0
- package/build/values/doc-schema-field-number-multiple-value.d.ts +23 -0
- package/build/values/doc-schema-field-number-multiple-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-number-multiple-value.js +43 -0
- package/build/values/doc-schema-field-number-multiple-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-number-multiple-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-number-multiple-value.test.js +79 -0
- package/build/values/doc-schema-field-number-single-value.d.ts +23 -0
- package/build/values/doc-schema-field-number-single-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-number-single-value.js +39 -0
- package/build/values/doc-schema-field-number-single-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-number-single-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-number-single-value.test.js +77 -0
- package/build/values/doc-schema-field-relation-multiple-value.d.ts +24 -0
- package/build/values/doc-schema-field-relation-multiple-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-relation-multiple-value.js +46 -0
- package/build/values/doc-schema-field-relation-multiple-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-relation-multiple-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-relation-multiple-value.test.js +83 -0
- package/build/values/doc-schema-field-relation-single-value.d.ts +24 -0
- package/build/values/doc-schema-field-relation-single-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-relation-single-value.js +42 -0
- package/build/values/doc-schema-field-relation-single-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-relation-single-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-relation-single-value.test.js +83 -0
- package/build/values/doc-schema-field-select-number-multiple-value.d.ts +25 -0
- package/build/values/doc-schema-field-select-number-multiple-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-select-number-multiple-value.js +48 -0
- package/build/values/doc-schema-field-select-number-multiple-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-select-number-multiple-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-select-number-multiple-value.test.js +84 -0
- package/build/values/doc-schema-field-select-number-single-value.d.ts +25 -0
- package/build/values/doc-schema-field-select-number-single-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-select-number-single-value.js +45 -0
- package/build/values/doc-schema-field-select-number-single-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-select-number-single-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-select-number-single-value.test.js +96 -0
- package/build/values/doc-schema-field-select-text-multiple-value.d.ts +25 -0
- package/build/values/doc-schema-field-select-text-multiple-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-select-text-multiple-value.js +48 -0
- package/build/values/doc-schema-field-select-text-multiple-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-select-text-multiple-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-select-text-multiple-value.test.js +84 -0
- package/build/values/doc-schema-field-select-text-single-value.d.ts +25 -0
- package/build/values/doc-schema-field-select-text-single-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-select-text-single-value.js +47 -0
- package/build/values/doc-schema-field-select-text-single-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-select-text-single-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-select-text-single-value.test.js +96 -0
- package/build/values/doc-schema-field-text-multiple-value.d.ts +23 -0
- package/build/values/doc-schema-field-text-multiple-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-text-multiple-value.js +43 -0
- package/build/values/doc-schema-field-text-multiple-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-text-multiple-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-text-multiple-value.test.js +78 -0
- package/build/values/doc-schema-field-text-single-value.d.ts +23 -0
- package/build/values/doc-schema-field-text-single-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-text-single-value.js +39 -0
- package/build/values/doc-schema-field-text-single-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-text-single-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-text-single-value.test.js +76 -0
- package/build/values/doc-schema-field-type-value.d.ts +61 -0
- package/build/values/doc-schema-field-type-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-type-value.js +134 -0
- package/build/values/doc-schema-field-type-value.test.d.ts +2 -0
- package/build/values/doc-schema-field-type-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-field-type-value.test.js +101 -0
- package/build/values/doc-schema-field-value.d.ts +45 -0
- package/build/values/doc-schema-field-value.d.ts.map +1 -0
- package/build/values/doc-schema-field-value.js +1 -0
- package/build/values/doc-schema-value.d.ts +99 -0
- package/build/values/doc-schema-value.d.ts.map +1 -0
- package/build/values/doc-schema-value.js +269 -0
- package/build/values/doc-schema-value.test.d.ts +2 -0
- package/build/values/doc-schema-value.test.d.ts.map +1 -0
- package/build/values/doc-schema-value.test.js +301 -0
- package/build/values/doc-tree-directory-node-value.d.ts +36 -0
- package/build/values/doc-tree-directory-node-value.d.ts.map +1 -0
- package/build/values/doc-tree-directory-node-value.js +71 -0
- package/build/values/doc-tree-directory-node-value.test.d.ts +2 -0
- package/build/values/doc-tree-directory-node-value.test.d.ts.map +1 -0
- package/build/values/doc-tree-directory-node-value.test.js +162 -0
- package/build/values/doc-tree-file-node-value.d.ts +33 -0
- package/build/values/doc-tree-file-node-value.d.ts.map +1 -0
- package/build/values/doc-tree-file-node-value.js +56 -0
- package/build/values/doc-tree-file-node-value.test.d.ts +2 -0
- package/build/values/doc-tree-file-node-value.test.d.ts.map +1 -0
- package/build/values/doc-tree-file-node-value.test.js +113 -0
- package/debug/debug.ts +108 -0
- package/package.json +7 -44
- package/bin/docs.js +0 -3
- package/build/assets/index.css +0 -1
- package/build/assets/index.js +0 -298
- package/build/index.html +0 -13
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
/**
|
|
3
|
+
* ファイルシステム
|
|
4
|
+
*/
|
|
5
|
+
export class DocFileSystem {
|
|
6
|
+
basePath;
|
|
7
|
+
pathSystem;
|
|
8
|
+
constructor(props) {
|
|
9
|
+
this.basePath = props.basePath;
|
|
10
|
+
this.pathSystem = props.pathSystem;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 指定されたパスのファイルの内容を読み込む
|
|
14
|
+
*/
|
|
15
|
+
async readFile(relativePath) {
|
|
16
|
+
const exists = await this.exists(relativePath);
|
|
17
|
+
if (!exists)
|
|
18
|
+
return null;
|
|
19
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
20
|
+
try {
|
|
21
|
+
return await fs.readFile(fullPath, "utf-8");
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 指定されたパスのファイルに内容を書き込む(必要に応じてディレクトリも作成)
|
|
29
|
+
*/
|
|
30
|
+
async writeFile(relativePath, content) {
|
|
31
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
32
|
+
const dirPath = this.pathSystem.dirname(fullPath);
|
|
33
|
+
try {
|
|
34
|
+
// ディレクトリが存在しない場合は作成
|
|
35
|
+
await fs.mkdir(dirPath, { recursive: true });
|
|
36
|
+
await fs.writeFile(fullPath, content, "utf-8");
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (error instanceof Error) {
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
throw new Error(`Failed to write file at ${fullPath}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 指定されたパスのファイルを削除
|
|
47
|
+
*/
|
|
48
|
+
async deleteFile(relativePath) {
|
|
49
|
+
try {
|
|
50
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
51
|
+
await fs.unlink(fullPath);
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
return new Error(`Failed to delete file at ${relativePath}: ${error}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 指定されたパスのファイル名を取得
|
|
60
|
+
*/
|
|
61
|
+
readFileName(relativePath) {
|
|
62
|
+
return this.pathSystem.basename(relativePath);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 指定されたパスのファイル拡張子を取得
|
|
66
|
+
*/
|
|
67
|
+
readFileExtension(relativePath) {
|
|
68
|
+
return this.pathSystem.extname(relativePath);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 指定されたパスのファイルが存在するディレクトリパスを取得
|
|
72
|
+
*/
|
|
73
|
+
readFileDirectory(relativePath) {
|
|
74
|
+
return this.pathSystem.dirname(relativePath);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* ディレクトリ内のエントリ一覧を取得
|
|
78
|
+
*/
|
|
79
|
+
async readDirectoryFileNames(relativePath = "") {
|
|
80
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
81
|
+
try {
|
|
82
|
+
return await fs.readdir(fullPath);
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async readDirectoryFilePaths(relativePath) {
|
|
89
|
+
const fileNames = await this.readDirectoryFileNames(relativePath);
|
|
90
|
+
return fileNames.map((fileName) => this.pathSystem.join(relativePath, fileName));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* 指定パスがディレクトリかチェック
|
|
94
|
+
*/
|
|
95
|
+
async isDirectory(relativePath) {
|
|
96
|
+
try {
|
|
97
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
98
|
+
const stats = await fs.stat(fullPath);
|
|
99
|
+
return stats.isDirectory();
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 指定パスがファイルかチェック
|
|
107
|
+
*/
|
|
108
|
+
async isFile(relativePath) {
|
|
109
|
+
try {
|
|
110
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
111
|
+
const stats = await fs.stat(fullPath);
|
|
112
|
+
return stats.isFile();
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* ファイルまたはディレクトリが存在するかチェック
|
|
120
|
+
*/
|
|
121
|
+
async exists(relativePath) {
|
|
122
|
+
try {
|
|
123
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
124
|
+
await fs.access(fullPath);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* ディレクトリが存在するかチェック
|
|
133
|
+
*/
|
|
134
|
+
async directoryExists(relativePath) {
|
|
135
|
+
return this.isDirectory(relativePath);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* ファイルが存在するかチェック
|
|
139
|
+
*/
|
|
140
|
+
async fileExists(relativePath) {
|
|
141
|
+
return this.isFile(relativePath);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* ベースパスを取得
|
|
145
|
+
*/
|
|
146
|
+
getBasePath() {
|
|
147
|
+
return this.basePath;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* 相対パスを絶対パスに変換
|
|
151
|
+
*/
|
|
152
|
+
resolve(relativePath) {
|
|
153
|
+
return this.pathSystem.join(this.basePath, relativePath);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* ディレクトリを作成する
|
|
157
|
+
*/
|
|
158
|
+
async createDirectory(relativePath) {
|
|
159
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
160
|
+
await fs.mkdir(fullPath, { recursive: true });
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* ファイルのサイズを取得(バイト単位)
|
|
164
|
+
*/
|
|
165
|
+
async getFileSize(relativePath) {
|
|
166
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
167
|
+
const stats = await fs.stat(fullPath);
|
|
168
|
+
return stats.size;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* ディレクトリが存在しない場合は作成する
|
|
172
|
+
*/
|
|
173
|
+
async ensureDirectoryExists(relativePath) {
|
|
174
|
+
if (!(await this.exists(relativePath))) {
|
|
175
|
+
await this.createDirectory(relativePath);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* ファイルをコピー
|
|
180
|
+
*/
|
|
181
|
+
async copyFile(sourcePath, destinationPath) {
|
|
182
|
+
const sourceFullPath = this.pathSystem.join(this.basePath, sourcePath);
|
|
183
|
+
const destFullPath = this.pathSystem.join(this.basePath, destinationPath);
|
|
184
|
+
await fs.copyFile(sourceFullPath, destFullPath);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* ファイルを移動
|
|
188
|
+
*/
|
|
189
|
+
async moveFile(sourcePath, destinationPath) {
|
|
190
|
+
const sourceFullPath = this.pathSystem.join(this.basePath, sourcePath);
|
|
191
|
+
const destFullPath = this.pathSystem.join(this.basePath, destinationPath);
|
|
192
|
+
await fs.rename(sourceFullPath, destFullPath);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* ファイルの最終更新日時を取得
|
|
196
|
+
*/
|
|
197
|
+
async getFileModifiedTime(relativePath) {
|
|
198
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
199
|
+
const stats = await fs.stat(fullPath);
|
|
200
|
+
return stats.mtime;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* ファイルの作成日時を取得
|
|
204
|
+
*/
|
|
205
|
+
async getFileCreatedTime(relativePath) {
|
|
206
|
+
const fullPath = this.pathSystem.join(this.basePath, relativePath);
|
|
207
|
+
const stats = await fs.stat(fullPath);
|
|
208
|
+
return stats.birthtime;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DocFileSystem } from "./doc-file-system";
|
|
2
|
+
import type { DocPathSystem } from "./doc-path-system";
|
|
3
|
+
import { DocTreeDirectoryNodeValue } from "./values/doc-tree-directory-node-value";
|
|
4
|
+
import { DocTreeFileNodeValue } from "./values/doc-tree-file-node-value";
|
|
5
|
+
type Props = {
|
|
6
|
+
fileSystem: DocFileSystem;
|
|
7
|
+
pathSystem: DocPathSystem;
|
|
8
|
+
indexFileName: string;
|
|
9
|
+
archiveDirectoryName: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* ファイルツリー構築システム
|
|
13
|
+
*/
|
|
14
|
+
export declare class DocFileTreeSystem {
|
|
15
|
+
private readonly props;
|
|
16
|
+
constructor(props: Props);
|
|
17
|
+
/**
|
|
18
|
+
* ファイルツリーを再帰的に構築
|
|
19
|
+
*/
|
|
20
|
+
buildFileTree(directoryPath?: string): Promise<(DocTreeFileNodeValue | DocTreeDirectoryNodeValue)[]>;
|
|
21
|
+
private createFileNode;
|
|
22
|
+
private createDirectoryNode;
|
|
23
|
+
/**
|
|
24
|
+
* インデックスファイル参照を作成
|
|
25
|
+
*/
|
|
26
|
+
private createIndexFileReference;
|
|
27
|
+
/**
|
|
28
|
+
* MDファイル参照を作成
|
|
29
|
+
*/
|
|
30
|
+
private createMdFileReference;
|
|
31
|
+
/**
|
|
32
|
+
* ディレクトリツリーを再帰的に構築(ディレクトリのみ)
|
|
33
|
+
*/
|
|
34
|
+
buildDirectoryTree(directoryPath?: string): Promise<DocTreeDirectoryNodeValue[]>;
|
|
35
|
+
private createDirectoryNodeForTree;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=doc-file-tree-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-file-tree-system.d.ts","sourceRoot":"","sources":["../lib/doc-file-tree-system.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAExE,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,aAAa,CAAA;IACzB,UAAU,EAAE,aAAa,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,oBAAoB,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED;;GAEG;AACH,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAlC,YAA6B,KAAK,EAAE,KAAK,EAExC;IAED;;OAEG;IACG,aAAa,CACjB,aAAa,SAAK,GACjB,OAAO,CAAC,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,EAAE,CAAC,CA0B/D;YAKa,cAAc;YAgCd,mBAAmB;IAyBjC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAehC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAQ7B;;OAEG;IACG,kBAAkB,CACtB,aAAa,SAAK,GACjB,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAyBtC;YAKa,0BAA0B;CAwBzC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { DocFileIndexReference } from "./doc-file-index-reference";
|
|
2
|
+
import { DocFileMdReference } from "./doc-file-md-reference";
|
|
3
|
+
import { DocTreeDirectoryNodeValue } from "./values/doc-tree-directory-node-value";
|
|
4
|
+
import { DocTreeFileNodeValue } from "./values/doc-tree-file-node-value";
|
|
5
|
+
/**
|
|
6
|
+
* ファイルツリー構築システム
|
|
7
|
+
*/
|
|
8
|
+
export class DocFileTreeSystem {
|
|
9
|
+
props;
|
|
10
|
+
constructor(props) {
|
|
11
|
+
this.props = props;
|
|
12
|
+
Object.freeze(this);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ファイルツリーを再帰的に構築
|
|
16
|
+
*/
|
|
17
|
+
async buildFileTree(directoryPath = "") {
|
|
18
|
+
const fileNames = await this.props.fileSystem.readDirectoryFileNames(directoryPath);
|
|
19
|
+
const results = [];
|
|
20
|
+
for (const fileName of fileNames) {
|
|
21
|
+
// アーカイブディレクトリ(「_」で始まる)は除外
|
|
22
|
+
if (fileName.startsWith("_"))
|
|
23
|
+
continue;
|
|
24
|
+
const filePath = directoryPath
|
|
25
|
+
? this.props.pathSystem.join(directoryPath, fileName)
|
|
26
|
+
: fileName;
|
|
27
|
+
const isDirectory = await this.props.fileSystem.isDirectory(filePath);
|
|
28
|
+
if (!isDirectory) {
|
|
29
|
+
const fileNode = await this.createFileNode(fileName, filePath);
|
|
30
|
+
results.push(fileNode);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
// ディレクトリの場合
|
|
34
|
+
const directoryNode = await this.createDirectoryNode(fileName, filePath);
|
|
35
|
+
results.push(directoryNode);
|
|
36
|
+
}
|
|
37
|
+
return results;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ファイルノードを作成
|
|
41
|
+
*/
|
|
42
|
+
async createFileNode(fileName, filePath) {
|
|
43
|
+
let title = fileName;
|
|
44
|
+
let icon = "";
|
|
45
|
+
// マークダウンファイルの場合はタイトルを取得
|
|
46
|
+
if (fileName.endsWith(".md")) {
|
|
47
|
+
const mdFile = this.createMdFileReference(filePath);
|
|
48
|
+
if (await mdFile.exists()) {
|
|
49
|
+
const entity = await mdFile.read();
|
|
50
|
+
if (!(entity instanceof Error)) {
|
|
51
|
+
title = entity.value.content.title || fileName;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
icon = "📄";
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
icon = "📄";
|
|
58
|
+
}
|
|
59
|
+
return DocTreeFileNodeValue.from({
|
|
60
|
+
name: fileName,
|
|
61
|
+
path: filePath,
|
|
62
|
+
icon,
|
|
63
|
+
title,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* ディレクトリノードを作成
|
|
68
|
+
*/
|
|
69
|
+
async createDirectoryNode(fileName, filePath) {
|
|
70
|
+
let title = fileName;
|
|
71
|
+
let icon = "📁";
|
|
72
|
+
const indexFile = this.createIndexFileReference(filePath);
|
|
73
|
+
if (await indexFile.exists()) {
|
|
74
|
+
const entity = await indexFile.read();
|
|
75
|
+
title = entity.value.content.title || fileName;
|
|
76
|
+
icon = entity.value.content.frontMatter.icon || "📁";
|
|
77
|
+
}
|
|
78
|
+
const children = await this.buildFileTree(filePath);
|
|
79
|
+
return DocTreeDirectoryNodeValue.from({
|
|
80
|
+
name: fileName,
|
|
81
|
+
path: filePath,
|
|
82
|
+
icon,
|
|
83
|
+
title,
|
|
84
|
+
children,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* インデックスファイル参照を作成
|
|
89
|
+
*/
|
|
90
|
+
createIndexFileReference(directoryPath) {
|
|
91
|
+
const indexPath = directoryPath === ""
|
|
92
|
+
? this.props.indexFileName
|
|
93
|
+
: `${directoryPath}/${this.props.indexFileName}`;
|
|
94
|
+
return new DocFileIndexReference({
|
|
95
|
+
path: indexPath,
|
|
96
|
+
fileSystem: this.props.fileSystem,
|
|
97
|
+
pathSystem: this.props.pathSystem,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* MDファイル参照を作成
|
|
102
|
+
*/
|
|
103
|
+
createMdFileReference(path) {
|
|
104
|
+
return new DocFileMdReference({
|
|
105
|
+
path,
|
|
106
|
+
fileSystem: this.props.fileSystem,
|
|
107
|
+
pathSystem: this.props.pathSystem,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* ディレクトリツリーを再帰的に構築(ディレクトリのみ)
|
|
112
|
+
*/
|
|
113
|
+
async buildDirectoryTree(directoryPath = "") {
|
|
114
|
+
const fileNames = await this.props.fileSystem.readDirectoryFileNames(directoryPath);
|
|
115
|
+
const results = [];
|
|
116
|
+
for (const fileName of fileNames) {
|
|
117
|
+
// アーカイブディレクトリ(「_」で始まる)は除外
|
|
118
|
+
if (fileName.startsWith("_"))
|
|
119
|
+
continue;
|
|
120
|
+
const filePath = directoryPath
|
|
121
|
+
? this.props.pathSystem.join(directoryPath, fileName)
|
|
122
|
+
: fileName;
|
|
123
|
+
const isDirectory = await this.props.fileSystem.isDirectory(filePath);
|
|
124
|
+
// ファイルは無視
|
|
125
|
+
if (!isDirectory)
|
|
126
|
+
continue;
|
|
127
|
+
const directoryNode = await this.createDirectoryNodeForTree(fileName, filePath);
|
|
128
|
+
results.push(directoryNode);
|
|
129
|
+
}
|
|
130
|
+
return results;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* ディレクトリツリー用のディレクトリノードを作成
|
|
134
|
+
*/
|
|
135
|
+
async createDirectoryNodeForTree(fileName, filePath) {
|
|
136
|
+
let title = fileName;
|
|
137
|
+
let icon = "📁";
|
|
138
|
+
const indexFile = this.createIndexFileReference(filePath);
|
|
139
|
+
if (await indexFile.exists()) {
|
|
140
|
+
const entity = await indexFile.read();
|
|
141
|
+
title = entity.value.content.title || fileName;
|
|
142
|
+
icon = entity.value.content.frontMatter.icon || "📁";
|
|
143
|
+
}
|
|
144
|
+
const children = await this.buildDirectoryTree(filePath);
|
|
145
|
+
return DocTreeDirectoryNodeValue.from({
|
|
146
|
+
name: fileName,
|
|
147
|
+
path: filePath,
|
|
148
|
+
icon,
|
|
149
|
+
title,
|
|
150
|
+
children,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-file-tree-system.test.d.ts","sourceRoot":"","sources":["../lib/doc-file-tree-system.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import { DocFileTreeSystem } from "./doc-file-tree-system";
|
|
3
|
+
import { DocPathSystem } from "./doc-path-system";
|
|
4
|
+
test("FileTreeSystem - ファイルツリーを構築できる", async () => {
|
|
5
|
+
const mockFileSystem = {
|
|
6
|
+
getBasePath: () => "/test",
|
|
7
|
+
readDirectoryFileNames: async (path) => {
|
|
8
|
+
if (path === "")
|
|
9
|
+
return ["file1.md", "dir1", "_archive"];
|
|
10
|
+
if (path === "dir1")
|
|
11
|
+
return ["file2.md", "index.md"];
|
|
12
|
+
return [];
|
|
13
|
+
},
|
|
14
|
+
isDirectory: async (path) => {
|
|
15
|
+
return path === "dir1";
|
|
16
|
+
},
|
|
17
|
+
readFile: async (path) => {
|
|
18
|
+
if (path === "file1.md") {
|
|
19
|
+
return `# File 1\n\nContent`;
|
|
20
|
+
}
|
|
21
|
+
if (path === "dir1/file2.md") {
|
|
22
|
+
return `# File 2\n\nContent`;
|
|
23
|
+
}
|
|
24
|
+
if (path === "dir1/index.md") {
|
|
25
|
+
return `---\nicon: 🎯\n---\n# Directory 1\n\nContent`;
|
|
26
|
+
}
|
|
27
|
+
return "";
|
|
28
|
+
},
|
|
29
|
+
exists: async (path) => {
|
|
30
|
+
return ["file1.md", "dir1/file2.md", "dir1/index.md"].includes(path);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const pathSystem = new DocPathSystem();
|
|
34
|
+
const fileTreeSystem = new DocFileTreeSystem({
|
|
35
|
+
fileSystem: mockFileSystem,
|
|
36
|
+
pathSystem,
|
|
37
|
+
indexFileName: "index.md",
|
|
38
|
+
archiveDirectoryName: "_archive",
|
|
39
|
+
});
|
|
40
|
+
const tree = await fileTreeSystem.buildFileTree();
|
|
41
|
+
expect(tree.length).toBe(2); // file1.md と dir1 (_archiveは除外)
|
|
42
|
+
// ファイルノード
|
|
43
|
+
const fileNode = tree[0];
|
|
44
|
+
expect(fileNode.name).toBe("file1.md");
|
|
45
|
+
expect(fileNode.type).toBe("file");
|
|
46
|
+
expect(fileNode.title).toBe("File 1");
|
|
47
|
+
expect(fileNode.icon).toBe("📄");
|
|
48
|
+
// ディレクトリノード
|
|
49
|
+
const dirNode = tree[1];
|
|
50
|
+
expect(dirNode.name).toBe("dir1");
|
|
51
|
+
expect(dirNode.type).toBe("directory");
|
|
52
|
+
expect(dirNode.title).toBe("Directory 1");
|
|
53
|
+
expect(dirNode.icon).toBe("🎯");
|
|
54
|
+
if (dirNode.type === "directory") {
|
|
55
|
+
expect(dirNode.children.length).toBe(2); // file2.md と index.md
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
test("FileTreeSystem - ディレクトリツリーを構築できる(ディレクトリのみ)", async () => {
|
|
59
|
+
const mockFileSystem = {
|
|
60
|
+
getBasePath: () => "/test",
|
|
61
|
+
readDirectoryFileNames: async (path) => {
|
|
62
|
+
if (path === "")
|
|
63
|
+
return ["file1.md", "dir1", "dir2", "_archive"];
|
|
64
|
+
if (path === "dir1")
|
|
65
|
+
return ["subdir1", "file.md"];
|
|
66
|
+
if (path === "dir2")
|
|
67
|
+
return ["index.md"];
|
|
68
|
+
if (path === "dir1/subdir1")
|
|
69
|
+
return [];
|
|
70
|
+
return [];
|
|
71
|
+
},
|
|
72
|
+
isDirectory: async (path) => {
|
|
73
|
+
return ["dir1", "dir2", "dir1/subdir1"].includes(path);
|
|
74
|
+
},
|
|
75
|
+
readFile: async (path) => {
|
|
76
|
+
if (path === "dir2/index.md") {
|
|
77
|
+
return `---\nicon: 📁\n---\n# Directory 2\n\nContent`;
|
|
78
|
+
}
|
|
79
|
+
return "";
|
|
80
|
+
},
|
|
81
|
+
exists: async (path) => {
|
|
82
|
+
return path === "dir2/index.md";
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
const pathSystem = new DocPathSystem();
|
|
86
|
+
const fileTreeSystem = new DocFileTreeSystem({
|
|
87
|
+
fileSystem: mockFileSystem,
|
|
88
|
+
pathSystem,
|
|
89
|
+
indexFileName: "index.md",
|
|
90
|
+
archiveDirectoryName: "_archive",
|
|
91
|
+
});
|
|
92
|
+
const tree = await fileTreeSystem.buildDirectoryTree();
|
|
93
|
+
expect(tree.length).toBe(2); // dir1 と dir2のみ (file1.mdと_archiveは除外)
|
|
94
|
+
const dir1 = tree[0];
|
|
95
|
+
expect(dir1.name).toBe("dir1");
|
|
96
|
+
expect(dir1.type).toBe("directory");
|
|
97
|
+
const dir2 = tree[1];
|
|
98
|
+
expect(dir2.name).toBe("dir2");
|
|
99
|
+
expect(dir2.type).toBe("directory");
|
|
100
|
+
expect(dir2.title).toBe("Directory 2");
|
|
101
|
+
if (dir1.type === "directory") {
|
|
102
|
+
expect(dir1.children.length).toBe(1); // subdir1のみ
|
|
103
|
+
expect(dir1.children[0].name).toBe("subdir1");
|
|
104
|
+
}
|
|
105
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { DocDirectoryReference } from "./doc-directory-reference";
|
|
2
|
+
import type { DocFileSystem } from "./doc-file-system";
|
|
3
|
+
import type { DocPathSystem } from "./doc-path-system";
|
|
4
|
+
import { DocFileMdEntity } from "./entities/doc-file-md-entity";
|
|
5
|
+
import { DocFileUnknownEntity } from "./entities/doc-file-unknown-entity";
|
|
6
|
+
type Props = {
|
|
7
|
+
path: string;
|
|
8
|
+
fileSystem: DocFileSystem;
|
|
9
|
+
pathSystem: DocPathSystem;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* ファイルの参照
|
|
13
|
+
*/
|
|
14
|
+
export declare class DocFileUnknownReference {
|
|
15
|
+
private readonly props;
|
|
16
|
+
private readonly pathSystem;
|
|
17
|
+
constructor(props: Props);
|
|
18
|
+
get fileSystem(): DocFileSystem;
|
|
19
|
+
get basePath(): string;
|
|
20
|
+
get path(): string;
|
|
21
|
+
get directoryPath(): string;
|
|
22
|
+
get fileFullPath(): string;
|
|
23
|
+
get durectoryPath(): string;
|
|
24
|
+
directory(): DocDirectoryReference;
|
|
25
|
+
read(): Promise<Error | DocFileMdEntity | DocFileUnknownEntity>;
|
|
26
|
+
/**
|
|
27
|
+
* ファイルの内容を読み込む
|
|
28
|
+
*/
|
|
29
|
+
readContent(): Promise<Error | string>;
|
|
30
|
+
/**
|
|
31
|
+
* ファイルに内容を書き込む
|
|
32
|
+
*/
|
|
33
|
+
writeContent(content: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Entityを書き込む
|
|
36
|
+
*/
|
|
37
|
+
write(entity: DocFileUnknownEntity): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* 生のコンテンツを書き込む
|
|
40
|
+
*/
|
|
41
|
+
writeRaw(content: string): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* ファイルを削除
|
|
44
|
+
*/
|
|
45
|
+
delete(): Promise<Error | null>;
|
|
46
|
+
/**
|
|
47
|
+
* ファイルが存在するか確認
|
|
48
|
+
*/
|
|
49
|
+
exists(): Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* ファイルをコピー
|
|
52
|
+
*/
|
|
53
|
+
copyTo(destinationPath: string): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* ファイルを移動
|
|
56
|
+
*/
|
|
57
|
+
moveTo(destinationPath: string): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* ファイルのサイズを取得(バイト単位)
|
|
60
|
+
*/
|
|
61
|
+
size(): Promise<number>;
|
|
62
|
+
/**
|
|
63
|
+
* ファイルの最終更新日時を取得
|
|
64
|
+
*/
|
|
65
|
+
lastModified(): Promise<Date>;
|
|
66
|
+
/**
|
|
67
|
+
* ファイルの作成日時を取得
|
|
68
|
+
*/
|
|
69
|
+
createdAt(): Promise<Date>;
|
|
70
|
+
/**
|
|
71
|
+
* ファイルをアーカイブに移動し、新しい参照を返す
|
|
72
|
+
*/
|
|
73
|
+
archive(archiveDirectoryName?: string): Promise<DocFileUnknownReference>;
|
|
74
|
+
/**
|
|
75
|
+
* ファイルをアーカイブから復元し、新しい参照を返す
|
|
76
|
+
*/
|
|
77
|
+
restore(archiveDirectoryName?: string): Promise<DocFileUnknownReference>;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=doc-file-unknown-reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-file-unknown-reference.d.ts","sourceRoot":"","sources":["../lib/doc-file-unknown-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAIzE,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,aAAa,CAAA;IACzB,UAAU,EAAE,aAAa,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,qBAAa,uBAAuB;IAGtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAe;IAE1C,YAA6B,KAAK,EAAE,KAAK,EAGxC;IAED,IAAI,UAAU,IAAI,aAAa,CAE9B;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,SAAS,IAAI,qBAAqB,CAQjC;IAEK,IAAI,IAAI,OAAO,CAAC,KAAK,GAAG,eAAe,GAAG,oBAAoB,CAAC,CAuCpE;IAED;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,CAS3C;IAED;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjD;IAED;;OAEG;IACG,KAAK,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvD;IAED;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7C;IAED;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAEpC;IAED;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,CAE/B;IAED;;OAEG;IACG,MAAM,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnD;IAED;;OAEG;IACG,MAAM,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnD;IAED;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAE5B;IAED;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAElC;IAED;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/B;IAED;;OAEG;IACG,OAAO,CAAC,oBAAoB,SAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAkB1E;IAED;;OAEG;IACG,OAAO,CAAC,oBAAoB,SAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CA0B1E;CACF"}
|