@wener/common 2.0.3 → 2.0.6

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.
Files changed (312) hide show
  1. package/lib/ai/qwen3vl/index.js +1 -1
  2. package/lib/ai/qwen3vl/utils.js +15 -15
  3. package/lib/ai/qwen3vl/utils.js.map +1 -1
  4. package/lib/ai/vision/DocLayoutElementTypeSchema.js +22 -22
  5. package/lib/ai/vision/ImageAnnotationSchema.js +63 -47
  6. package/lib/ai/vision/index.js +2 -2
  7. package/lib/ai/vision/resolveImageAnnotation.js +81 -95
  8. package/lib/cn/ChineseResidentIdNo.js +55 -41
  9. package/lib/cn/ChineseResidentIdNo.js.map +1 -1
  10. package/lib/cn/ChineseResidentIdNo.mod.js +6 -1
  11. package/lib/cn/ChineseResidentIdNo.test.js +22 -21
  12. package/lib/cn/DivisionCode.js +220 -235
  13. package/lib/cn/DivisionCode.mod.js +6 -1
  14. package/lib/cn/DivisionCode.test.js +92 -121
  15. package/lib/cn/Mod11.js +18 -37
  16. package/lib/cn/Mod11.js.map +1 -1
  17. package/lib/cn/Mod31.js +23 -41
  18. package/lib/cn/UnifiedSocialCreditCode.js +143 -137
  19. package/lib/cn/UnifiedSocialCreditCode.mod.js +6 -1
  20. package/lib/cn/UnifiedSocialCreditCode.test.js +21 -15
  21. package/lib/cn/formatChineseAmount.js +46 -71
  22. package/lib/cn/index.js +6 -6
  23. package/lib/cn/mod.js +5 -3
  24. package/lib/cn/parseChineseNumber.js +81 -85
  25. package/lib/cn/parseChineseNumber.test.js +183 -261
  26. package/lib/cn/pinyin/cartesianProduct.js +19 -19
  27. package/lib/cn/pinyin/cartesianProduct.test.js +78 -178
  28. package/lib/cn/pinyin/loader.js +13 -11
  29. package/lib/cn/pinyin/preload.js +2 -1
  30. package/lib/cn/pinyin/toPinyin.test.js +149 -161
  31. package/lib/cn/pinyin/toPinyinPure.js +28 -23
  32. package/lib/cn/pinyin/transform.js +11 -11
  33. package/lib/cn/types.d.js +2 -2
  34. package/lib/consola/createStandardConsolaReporter.js +14 -15
  35. package/lib/consola/formatLogObject.js +149 -133
  36. package/lib/consola/formatLogObject.js.map +1 -1
  37. package/lib/consola/formatLogObject.test.js +167 -178
  38. package/lib/consola/index.js +2 -2
  39. package/lib/data/formatSort.js +14 -12
  40. package/lib/data/formatSort.test.js +33 -33
  41. package/lib/data/index.js +3 -3
  42. package/lib/data/maybeNumber.js +23 -23
  43. package/lib/data/maybeNumber.js.map +1 -1
  44. package/lib/data/parseSort.js +75 -68
  45. package/lib/data/parseSort.test.js +196 -187
  46. package/lib/data/resolvePagination.js +38 -39
  47. package/lib/data/resolvePagination.test.js +228 -218
  48. package/lib/data/types.d.js +2 -2
  49. package/lib/data/types.d.js.map +1 -1
  50. package/lib/dayjs/dayjs.js +20 -20
  51. package/lib/dayjs/formatDuration.js +56 -56
  52. package/lib/dayjs/formatDuration.js.map +1 -1
  53. package/lib/dayjs/formatDuration.test.js +63 -77
  54. package/lib/dayjs/index.js +4 -4
  55. package/lib/dayjs/parseDuration.js +21 -26
  56. package/lib/dayjs/parseRelativeTime.js +65 -66
  57. package/lib/dayjs/parseRelativeTime.test.js +227 -243
  58. package/lib/dayjs/resolveRelativeTime.js +74 -144
  59. package/lib/dayjs/resolveRelativeTime.js.map +1 -1
  60. package/lib/dayjs/resolveRelativeTime.test.js +296 -307
  61. package/lib/decimal/index.js +1 -1
  62. package/lib/decimal/parseDecimal.js +12 -12
  63. package/lib/drain3/Drain.js +321 -0
  64. package/lib/drain3/Drain.js.map +1 -0
  65. package/lib/drain3/LogCluster.js +38 -0
  66. package/lib/drain3/LogCluster.js.map +1 -0
  67. package/lib/drain3/Node.js +39 -0
  68. package/lib/drain3/Node.js.map +1 -0
  69. package/lib/drain3/TemplateMiner.js +205 -0
  70. package/lib/drain3/TemplateMiner.js.map +1 -0
  71. package/lib/drain3/index.js +31 -0
  72. package/lib/drain3/index.js.map +1 -0
  73. package/lib/drain3/persistence/FilePersistence.js +24 -0
  74. package/lib/drain3/persistence/FilePersistence.js.map +1 -0
  75. package/lib/drain3/persistence/MemoryPersistence.js +18 -0
  76. package/lib/drain3/persistence/MemoryPersistence.js.map +1 -0
  77. package/lib/drain3/persistence/PersistenceHandler.js +5 -0
  78. package/lib/drain3/persistence/PersistenceHandler.js.map +1 -0
  79. package/lib/drain3/types.js +7 -0
  80. package/lib/drain3/types.js.map +1 -0
  81. package/lib/emittery/emitter.js +7 -7
  82. package/lib/emittery/index.js +1 -1
  83. package/lib/foundation/schema/SexType.js +15 -12
  84. package/lib/foundation/schema/index.js +1 -1
  85. package/lib/foundation/schema/parseSexType.js +15 -16
  86. package/lib/foundation/schema/types.js +8 -6
  87. package/lib/fs/FileSystemError.js +18 -18
  88. package/lib/fs/IFileSystem.d.js +2 -2
  89. package/lib/fs/IFileSystem.d.js.map +1 -1
  90. package/lib/fs/MemoryFileSystem.test.js +172 -181
  91. package/lib/fs/createBrowserFileSystem.js +222 -233
  92. package/lib/fs/createBrowserFileSystem.js.map +1 -1
  93. package/lib/fs/createMemoryFileSystem.js +473 -510
  94. package/lib/fs/createMemoryFileSystem.js.map +1 -1
  95. package/lib/fs/createSandboxFileSystem.js +102 -101
  96. package/lib/fs/createSandboxFileSystem.js.map +1 -1
  97. package/lib/fs/createWebDavFileSystem.js +162 -132
  98. package/lib/fs/createWebDavFileSystem.js.map +1 -1
  99. package/lib/fs/createWebFileSystem.js +202 -0
  100. package/lib/fs/createWebFileSystem.js.map +1 -0
  101. package/lib/fs/findMimeType.js +14 -14
  102. package/lib/fs/findMimeType.js.map +1 -1
  103. package/lib/fs/index.js +7 -7
  104. package/lib/fs/index.js.map +1 -1
  105. package/lib/fs/minio/createMinioFileSystem.js +977 -0
  106. package/lib/fs/minio/createMinioFileSystem.js.map +1 -0
  107. package/lib/fs/minio/index.js +2 -0
  108. package/lib/fs/minio/index.js.map +1 -0
  109. package/lib/fs/orpc/FileSystemContract.js +57 -57
  110. package/lib/fs/orpc/createContractClientFileSystem.js +88 -88
  111. package/lib/fs/orpc/createContractClientFileSystem.js.map +1 -1
  112. package/lib/fs/orpc/index.js +2 -2
  113. package/lib/fs/orpc/server/createFileSystemContractImpl.js +62 -60
  114. package/lib/fs/orpc/server/createFileSystemContractImpl.js.map +1 -1
  115. package/lib/fs/orpc/server/index.js +1 -1
  116. package/lib/fs/s3/createS3MiniFileSystem.js +756 -689
  117. package/lib/fs/s3/createS3MiniFileSystem.js.map +1 -1
  118. package/lib/fs/s3/index.js +1 -1
  119. package/lib/fs/s3/s3mini.test.js +524 -553
  120. package/lib/fs/scandir.js +56 -56
  121. package/lib/fs/server/createDatabaseFileSystem.js +834 -741
  122. package/lib/fs/server/createDatabaseFileSystem.js.map +1 -1
  123. package/lib/fs/server/createNodeFileSystem.js +407 -380
  124. package/lib/fs/server/createNodeFileSystem.js.map +1 -1
  125. package/lib/fs/server/dbfs.test.js +201 -214
  126. package/lib/fs/server/index.js +1 -1
  127. package/lib/fs/server/loadTestDatabase.js +40 -43
  128. package/lib/fs/tests/runFileSystemTest.js +352 -315
  129. package/lib/fs/tests/runFileSystemTest.js.map +1 -1
  130. package/lib/fs/types.js +17 -20
  131. package/lib/fs/utils/getFileUrl.js +24 -30
  132. package/lib/fs/utils.js +17 -17
  133. package/lib/fs/utils.js.map +1 -1
  134. package/lib/fs/webdav/index.js +2 -0
  135. package/lib/fs/webdav/index.js.map +1 -0
  136. package/lib/index.js +2 -2
  137. package/lib/jsonschema/JsonSchema.js +216 -155
  138. package/lib/jsonschema/JsonSchema.js.map +1 -1
  139. package/lib/jsonschema/JsonSchema.test.js +123 -124
  140. package/lib/jsonschema/forEachJsonSchema.js +41 -41
  141. package/lib/jsonschema/forEachJsonSchema.js.map +1 -1
  142. package/lib/jsonschema/index.js +2 -2
  143. package/lib/jsonschema/types.d.js +2 -2
  144. package/lib/jsonschema/types.d.js.map +1 -1
  145. package/lib/meta/defineFileType.js +32 -38
  146. package/lib/meta/defineInit.js +39 -35
  147. package/lib/meta/defineMetadata.js +37 -34
  148. package/lib/meta/defineMetadata.js.map +1 -1
  149. package/lib/meta/defineMetadata.test.js +13 -12
  150. package/lib/meta/index.js +3 -3
  151. package/lib/orpc/createOpenApiContractClient.js +26 -24
  152. package/lib/orpc/createOpenApiContractClient.js.map +1 -1
  153. package/lib/orpc/createRpcContractClient.js +37 -31
  154. package/lib/orpc/index.js +2 -2
  155. package/lib/orpc/resolveLinkPlugins.js +25 -25
  156. package/lib/password/PHC.js +187 -189
  157. package/lib/password/PHC.js.map +1 -1
  158. package/lib/password/PHC.test.js +517 -535
  159. package/lib/password/Password.js +85 -80
  160. package/lib/password/Password.test.js +330 -364
  161. package/lib/password/createArgon2PasswordAlgorithm.js +50 -51
  162. package/lib/password/createArgon2PasswordAlgorithm.js.map +1 -1
  163. package/lib/password/createBase64PasswordAlgorithm.js +11 -11
  164. package/lib/password/createBase64PasswordAlgorithm.js.map +1 -1
  165. package/lib/password/createBcryptPasswordAlgorithm.js +20 -18
  166. package/lib/password/createBcryptPasswordAlgorithm.js.map +1 -1
  167. package/lib/password/createPBKDF2PasswordAlgorithm.js +65 -52
  168. package/lib/password/createPBKDF2PasswordAlgorithm.js.map +1 -1
  169. package/lib/password/createScryptPasswordAlgorithm.js +74 -63
  170. package/lib/password/createScryptPasswordAlgorithm.js.map +1 -1
  171. package/lib/password/index.js +5 -5
  172. package/lib/password/server/index.js +1 -1
  173. package/lib/resource/Identifiable.js +2 -2
  174. package/lib/resource/ListQuery.js +42 -42
  175. package/lib/resource/ListQuery.js.map +1 -1
  176. package/lib/resource/getTitleOfResource.js +5 -5
  177. package/lib/resource/index.js +2 -2
  178. package/lib/resource/index.js.map +1 -1
  179. package/lib/resource/schema/AnyResourceSchema.js +91 -89
  180. package/lib/resource/schema/BaseResourceSchema.js +26 -26
  181. package/lib/resource/schema/ResourceActionType.js +117 -115
  182. package/lib/resource/schema/ResourceStatus.js +94 -92
  183. package/lib/resource/schema/ResourceType.js +25 -23
  184. package/lib/resource/schema/index.js +5 -5
  185. package/lib/resource/schema/types.js +86 -55
  186. package/lib/resource/schema/types.test.js +16 -13
  187. package/lib/s3/formatS3Url.js +60 -60
  188. package/lib/s3/formatS3Url.js.map +1 -1
  189. package/lib/s3/formatS3Url.test.js +238 -261
  190. package/lib/s3/index.js +2 -2
  191. package/lib/s3/parseS3Url.js +61 -60
  192. package/lib/s3/parseS3Url.js.map +1 -1
  193. package/lib/s3/parseS3Url.test.js +270 -269
  194. package/lib/schema/SchemaRegistry.js +41 -42
  195. package/lib/schema/SchemaRegistry.js.map +1 -1
  196. package/lib/schema/SchemaRegistry.mod.js +1 -1
  197. package/lib/schema/TypeSchema.d.js +2 -2
  198. package/lib/schema/TypeSchema.d.js.map +1 -1
  199. package/lib/schema/createSchemaData.js +113 -67
  200. package/lib/schema/createSchemaData.js.map +1 -1
  201. package/lib/schema/findJsonSchemaByPath.js +28 -23
  202. package/lib/schema/findJsonSchemaByPath.js.map +1 -1
  203. package/lib/schema/formatZodError.js +113 -134
  204. package/lib/schema/formatZodError.js.map +1 -1
  205. package/lib/schema/formatZodError.test.js +192 -195
  206. package/lib/schema/getSchemaCache.js +7 -7
  207. package/lib/schema/getSchemaOptions.js +17 -16
  208. package/lib/schema/index.js +6 -6
  209. package/lib/schema/toJsonSchema.js +196 -190
  210. package/lib/schema/toJsonSchema.js.map +1 -1
  211. package/lib/schema/toJsonSchema.test.js +34 -26
  212. package/lib/schema/validate.js +106 -97
  213. package/lib/schema/validate.js.map +1 -1
  214. package/lib/tools/generateSchema.js +40 -40
  215. package/lib/tools/renderJsonSchemaToMarkdownDoc.js +74 -74
  216. package/lib/utils/buildBaseUrl.js +8 -8
  217. package/lib/utils/buildRedactorFormSchema.js +55 -54
  218. package/lib/utils/buildRedactorFormSchema.js.map +1 -1
  219. package/lib/utils/getEstimateProcessTime.js +24 -19
  220. package/lib/utils/index.js +3 -3
  221. package/lib/utils/resolveFeatureOptions.js +9 -9
  222. package/package.json +37 -18
  223. package/src/ai/qwen3vl/utils.ts +1 -1
  224. package/src/ai/vision/index.ts +2 -2
  225. package/src/cn/ChineseResidentIdNo.ts +1 -1
  226. package/src/cn/Mod11.ts +1 -1
  227. package/src/cn/__snapshots__/ChineseResidentIdNo.test.ts.snap +1 -1
  228. package/src/cn/__snapshots__/UnifiedSocialCreditCode.test.ts.snap +0 -23
  229. package/src/cn/index.ts +1 -2
  230. package/src/cn/parseChineseNumber.test.ts +4 -4
  231. package/src/consola/formatLogObject.ts +6 -6
  232. package/src/consola/index.ts +1 -1
  233. package/src/data/index.ts +3 -4
  234. package/src/data/maybeNumber.ts +1 -1
  235. package/src/data/parseSort.test.ts +0 -1
  236. package/src/data/resolvePagination.ts +2 -2
  237. package/src/data/types.d.ts +2 -2
  238. package/src/dayjs/formatDuration.ts +10 -11
  239. package/src/dayjs/index.ts +1 -1
  240. package/src/dayjs/parseRelativeTime.ts +1 -1
  241. package/src/dayjs/resolveRelativeTime.ts +11 -14
  242. package/src/drain3/Drain.test.ts +378 -0
  243. package/src/drain3/Drain.ts +394 -0
  244. package/src/drain3/LogCluster.ts +46 -0
  245. package/src/drain3/Node.ts +53 -0
  246. package/src/drain3/TemplateMiner.ts +246 -0
  247. package/src/drain3/index.ts +34 -0
  248. package/src/drain3/persistence/FilePersistence.ts +24 -0
  249. package/src/drain3/persistence/MemoryPersistence.ts +23 -0
  250. package/src/drain3/persistence/PersistenceHandler.ts +19 -0
  251. package/src/drain3/types.ts +75 -0
  252. package/src/fs/IFileSystem.d.ts +1 -2
  253. package/src/fs/createBrowserFileSystem.ts +7 -5
  254. package/src/fs/createMemoryFileSystem.ts +9 -13
  255. package/src/fs/createSandboxFileSystem.ts +1 -1
  256. package/src/fs/createWebDavFileSystem.ts +30 -17
  257. package/src/fs/createWebFileSystem.ts +242 -0
  258. package/src/fs/findMimeType.ts +1 -4
  259. package/src/fs/index.ts +5 -5
  260. package/src/fs/minio/createMinioFileSystem.ts +1148 -0
  261. package/src/fs/minio/index.ts +1 -0
  262. package/src/fs/orpc/createContractClientFileSystem.ts +5 -5
  263. package/src/fs/orpc/server/createFileSystemContractImpl.ts +1 -1
  264. package/src/fs/s3/createS3MiniFileSystem.ts +120 -79
  265. package/src/fs/s3/s3fs.test.ts +441 -0
  266. package/src/fs/s3/s3mini.test.ts +2 -2
  267. package/src/fs/server/createDatabaseFileSystem.ts +78 -114
  268. package/src/fs/server/createNodeFileSystem.ts +32 -13
  269. package/src/fs/server/dbfs.test.ts +13 -8
  270. package/src/fs/server/index.ts +1 -0
  271. package/src/fs/server/loadTestDatabase.ts +8 -119
  272. package/src/fs/tests/runFileSystemTest.ts +29 -28
  273. package/src/fs/utils.ts +1 -1
  274. package/src/fs/webdav/index.ts +1 -0
  275. package/src/jsonschema/JsonSchema.ts +5 -5
  276. package/src/jsonschema/forEachJsonSchema.ts +1 -1
  277. package/src/jsonschema/index.ts +1 -1
  278. package/src/jsonschema/types.d.ts +1 -1
  279. package/src/meta/defineMetadata.ts +1 -1
  280. package/src/meta/index.ts +2 -3
  281. package/src/orm/createSqliteDialect.ts +17 -0
  282. package/src/orm/index.ts +1 -0
  283. package/src/orpc/createOpenApiContractClient.ts +3 -3
  284. package/src/orpc/index.ts +1 -1
  285. package/src/password/PHC.ts +3 -3
  286. package/src/password/createArgon2PasswordAlgorithm.ts +2 -2
  287. package/src/password/createBase64PasswordAlgorithm.ts +2 -2
  288. package/src/password/createBcryptPasswordAlgorithm.ts +4 -2
  289. package/src/password/createPBKDF2PasswordAlgorithm.ts +2 -2
  290. package/src/password/createScryptPasswordAlgorithm.ts +4 -4
  291. package/src/password/index.ts +2 -2
  292. package/src/resource/ListQuery.ts +4 -1
  293. package/src/resource/index.ts +3 -3
  294. package/src/resource/schema/index.ts +4 -4
  295. package/src/s3/formatS3Url.test.ts +1 -1
  296. package/src/s3/formatS3Url.ts +2 -2
  297. package/src/s3/index.ts +1 -1
  298. package/src/s3/parseS3Url.ts +1 -1
  299. package/src/schema/SchemaRegistry.ts +2 -2
  300. package/src/schema/TypeSchema.d.ts +6 -6
  301. package/src/schema/createSchemaData.ts +5 -5
  302. package/src/schema/findJsonSchemaByPath.ts +5 -5
  303. package/src/schema/formatZodError.test.ts +2 -1
  304. package/src/schema/formatZodError.ts +50 -62
  305. package/src/schema/index.ts +5 -5
  306. package/src/schema/toJsonSchema.ts +6 -6
  307. package/src/schema/validate.ts +2 -2
  308. package/src/utils/buildRedactorFormSchema.ts +4 -4
  309. package/src/utils/formatNumber.ts +18 -0
  310. package/src/utils/formatPercent.ts +17 -0
  311. package/src/utils/index.ts +3 -3
  312. package/src/utils/resolveFeatureOptions.ts +1 -1
@@ -1,131 +1,20 @@
1
- import { inspect } from 'node:util';
2
- import type { Options as BetterSqliteOptions } from '@mikro-orm/better-sqlite';
3
- import { Errors, ulid } from '@wener/utils';
4
- import type { Database } from 'better-sqlite3';
1
+ import { MikroORM } from '@mikro-orm/core';
2
+ import { SqliteDriver } from '@mikro-orm/sql';
3
+ import { createSqliteDialect } from '../../orm/createSqliteDialect';
5
4
  import { FileNodeContentEntity, FileNodeMetaEntity } from './createDatabaseFileSystem';
6
5
 
7
- export async function loadTestDatabase({ options }: { options?: BetterSqliteOptions } = {}) {
8
- const { MikroORM: SqliteMikroORM } = await import('@mikro-orm/better-sqlite');
9
-
10
- const orm = await SqliteMikroORM.init({
6
+ export async function loadTestDatabase() {
7
+ const orm = await MikroORM.init({
8
+ driver: SqliteDriver,
11
9
  dbName: ':memory:',
12
10
  entities: [FileNodeContentEntity, FileNodeMetaEntity],
13
- discovery: {
14
- disableDynamicFileAccess: true,
15
- requireEntitiesArray: true,
16
- },
17
- serialization: {
18
- includePrimaryKeys: true,
19
- forceObject: true,
20
- },
21
- findOneOrFailHandler(entityName, where) {
22
- throw Errors.NotFound.asError(`未找到数据: ${entityName} ${inspect(where)}`);
23
- },
24
- findExactlyOneOrFailHandler(entityName, where) {
25
- throw Errors.BadRequest.asError(`错误的数据数量: ${entityName} ${inspect(where)}`);
26
- },
27
- ...options,
11
+ driverOptions: await createSqliteDialect(':memory:'),
28
12
  });
29
13
 
30
- const knex = orm.em.getKnex();
31
- {
32
- const db: Database = await knex.client.acquireConnection();
33
- db.function('ulid', () => ulid());
34
- await knex.client.releaseConnection(db);
35
- }
36
-
37
- // Execute schema creation
38
- for (const stmt of FileSystemSchema.split(';')) {
39
- const sql = stmt.trim();
40
- if (sql) {
41
- await knex.raw(sql);
42
- }
43
- }
14
+ await orm.schema.create();
44
15
 
45
16
  return {
46
17
  orm,
47
18
  em: orm.em.fork(),
48
19
  };
49
20
  }
50
-
51
- export const FileSystemSchema = `
52
- CREATE TABLE IF NOT EXISTS "file_node_meta"
53
- (
54
- -- Base fields
55
- "id" TEXT PRIMARY KEY NOT NULL DEFAULT (ulid()),
56
- "tid" TEXT,
57
- "uid" TEXT,
58
- "eid" TEXT,
59
- "created_at" TEXT NOT NULL DEFAULT (datetime('now')),
60
- "updated_at" TEXT NOT NULL DEFAULT (datetime('now')),
61
- "deleted_at" TEXT,
62
- "attributes" TEXT,
63
- "properties" TEXT,
64
- "extensions" TEXT,
65
-
66
- -- File identification
67
- "filename" TEXT NOT NULL,
68
- "size" INTEGER NOT NULL DEFAULT 0,
69
- "kind" TEXT NOT NULL,
70
-
71
- -- Timestamps
72
- "atime" TEXT NOT NULL,
73
- "btime" TEXT NOT NULL,
74
- "ctime" TEXT NOT NULL,
75
- "mtime" TEXT NOT NULL,
76
-
77
- -- Metadata
78
- "metadata" TEXT NOT NULL DEFAULT '{}',
79
-
80
- -- Hierarchy
81
- "parent_id" TEXT,
82
-
83
- -- Small file content (for files < 64KB)
84
- "content" BLOB,
85
-
86
- FOREIGN KEY ("parent_id") REFERENCES "file_node_meta" ("id")
87
- );
88
-
89
- CREATE INDEX IF NOT EXISTS "idx_file_node_meta_filename" ON "file_node_meta" ("filename");
90
- CREATE INDEX IF NOT EXISTS "idx_file_node_meta_parent_id" ON "file_node_meta" ("parent_id");
91
- CREATE INDEX IF NOT EXISTS "idx_file_node_meta_tid_parent_filename" ON "file_node_meta" ("tid", "parent_id", "filename");
92
-
93
- CREATE TABLE IF NOT EXISTS "file_node_content"
94
- (
95
- -- Base fields
96
- "id" TEXT PRIMARY KEY NOT NULL DEFAULT (ulid()),
97
- "node_id" TEXT NOT NULL UNIQUE,
98
- "tid" TEXT,
99
- "uid" TEXT,
100
- "eid" TEXT,
101
- "created_at" TEXT NOT NULL DEFAULT (datetime('now')),
102
- "updated_at" TEXT NOT NULL DEFAULT (datetime('now')),
103
- "deleted_at" TEXT,
104
- "attributes" TEXT,
105
- "properties" TEXT,
106
- "extensions" TEXT,
107
-
108
- -- Content information
109
- "size" INTEGER NOT NULL,
110
- "content" BLOB,
111
-
112
- -- File properties
113
- "mime_type" TEXT,
114
-
115
- -- Checksums
116
- "md5" TEXT,
117
- "sha256" TEXT,
118
-
119
- -- Content metadata
120
- "text" TEXT,
121
- "width" INTEGER,
122
- "height" INTEGER,
123
-
124
- -- Additional metadata
125
- "metadata" TEXT NOT NULL DEFAULT '{}',
126
-
127
- FOREIGN KEY ("node_id") REFERENCES "file_node_meta" ("id") ON DELETE CASCADE
128
- );
129
-
130
- CREATE INDEX IF NOT EXISTS "idx_file_node_content_node_id" ON "file_node_content" ("node_id");
131
- `;
@@ -1,6 +1,6 @@
1
1
  import { expect } from 'vitest';
2
2
  import { FileSystemError, FileSystemErrorCode } from '../FileSystemError';
3
- import type { IFileSystem } from '../IFileSystem';
3
+ import type { IFileSystem, IServerFileSystem } from '../IFileSystem';
4
4
 
5
5
  export type RunFileSystemTestOptions = {
6
6
  writableStream?: boolean;
@@ -10,7 +10,7 @@ export type RunFileSystemTestOptions = {
10
10
  abort?: boolean;
11
11
  };
12
12
 
13
- export async function runFileSystemTest(fs: IFileSystem, options: RunFileSystemTestOptions = {}) {
13
+ export async function runFileSystemTest(fs: IFileSystem | IServerFileSystem, options: RunFileSystemTestOptions = {}) {
14
14
  const { writableStream = true, readableStream = true, readStream = true, writeStream = true, abort = true } = options;
15
15
  // should be implemented
16
16
  const stat = await fs.stat('/README.txt');
@@ -65,21 +65,22 @@ export async function runFileSystemTest(fs: IFileSystem, options: RunFileSystemT
65
65
  await expect(fs.writeFile('/', 'test')).rejects.toMatchObject({ code: FileSystemErrorCode.EINVAL });
66
66
 
67
67
  // should support streaming operations
68
- if (readStream && fs.createReadStream) {
68
+ const serverFs = fs as IServerFileSystem;
69
+ if (readStream && 'createReadStream' in fs) {
69
70
  await fs.writeFile('/stream.txt', 'Hello, World!');
70
71
 
71
72
  // Test createReadStream
72
- const readStream = fs.createReadStream('/stream.txt');
73
- expect(readStream).toBeDefined();
73
+ const readStreamObj = serverFs.createReadStream('/stream.txt');
74
+ expect(readStreamObj).toBeDefined();
74
75
 
75
76
  const chunks: Buffer[] = [];
76
- for await (const chunk of readStream) {
77
+ for await (const chunk of readStreamObj) {
77
78
  chunks.push(chunk);
78
79
  }
79
80
  expect(Buffer.concat(chunks).toString()).toBe('Hello, World!');
80
81
 
81
82
  // Test createReadStream with range
82
- const rangeStream = fs.createReadStream('/stream.txt', { range: { start: 0, end: 4 } });
83
+ const rangeStream = serverFs.createReadStream('/stream.txt', { range: { start: 0, end: 4 } });
83
84
  const rangeChunks: Buffer[] = [];
84
85
  for await (const chunk of rangeStream) {
85
86
  rangeChunks.push(chunk);
@@ -87,37 +88,37 @@ export async function runFileSystemTest(fs: IFileSystem, options: RunFileSystemT
87
88
  expect(Buffer.concat(rangeChunks).toString()).toBe('Hello');
88
89
  }
89
90
 
90
- if (writeStream && fs.createWriteStream) {
91
+ if (writeStream && 'createWriteStream' in fs) {
91
92
  // Test createWriteStream
92
- const writeStream = fs.createWriteStream('/write-test.txt');
93
- expect(writeStream).toBeDefined();
93
+ const writeStreamObj = serverFs.createWriteStream('/write-test.txt');
94
+ expect(writeStreamObj).toBeDefined();
94
95
 
95
- writeStream.write('Test content');
96
- writeStream.end();
96
+ writeStreamObj.write('Test content');
97
+ writeStreamObj.end();
97
98
 
98
- await new Promise((resolve) => writeStream.on('finish', resolve));
99
+ await new Promise((resolve) => writeStreamObj.on('finish', resolve));
99
100
  expect(await fs.readFile('/write-test.txt', { encoding: 'text' })).toBe('Test content');
100
101
  }
101
102
 
102
103
  // should support Web Streams API
103
- if (readableStream) {
104
+ if (readableStream && fs.createReadableStream) {
104
105
  await fs.writeFile('/webstream.txt', 'Web Stream Test');
105
106
 
106
107
  // Test createReadableStream
107
- const readableStream = fs.createReadableStream('/webstream.txt');
108
- expect(readableStream).toBeDefined();
108
+ const readableStreamObj = fs.createReadableStream('/webstream.txt');
109
+ expect(readableStreamObj).toBeDefined();
109
110
 
110
- const reader = readableStream.getReader();
111
+ const reader = readableStreamObj.getReader();
111
112
  const { value } = await reader.read();
112
113
  expect(value?.toString()).toBe('Web Stream Test');
113
114
  }
114
115
 
115
- if (writableStream) {
116
+ if (writableStream && fs.createWritableStream) {
116
117
  // Test createWritableStream
117
- const writableStream = fs.createWritableStream('/web-write-test.txt');
118
- expect(writableStream).toBeDefined();
118
+ const writableStreamObj = fs.createWritableStream('/web-write-test.txt');
119
+ expect(writableStreamObj).toBeDefined();
119
120
 
120
- const writer = writableStream.getWriter();
121
+ const writer = writableStreamObj.getWriter();
121
122
  await writer.write(Buffer.from('Web Stream Write Test'));
122
123
  await writer.close();
123
124
 
@@ -125,30 +126,30 @@ export async function runFileSystemTest(fs: IFileSystem, options: RunFileSystemT
125
126
  }
126
127
 
127
128
  // should handle streaming errors
128
- if (abort && readStream && fs.createReadStream) {
129
+ if (abort && readStream && 'createReadStream' in fs) {
129
130
  const controller2 = new AbortController();
130
131
 
131
132
  // Test read stream with abort
132
- const readStream = fs.createReadStream('/README.txt', { signal: controller2.signal });
133
+ const readStreamObj = serverFs.createReadStream('/README.txt', { signal: controller2.signal });
133
134
  controller2.abort();
134
135
 
135
136
  await expect(
136
137
  new Promise((_, reject) => {
137
- readStream.on('error', reject);
138
+ readStreamObj.on('error', reject);
138
139
  }),
139
140
  ).rejects.toThrow(Error);
140
141
  }
141
142
 
142
- if (abort && writeStream && fs.createWriteStream) {
143
+ if (abort && writeStream && 'createWriteStream' in fs) {
143
144
  // Test write stream with abort
144
145
  const controller3 = new AbortController();
145
- const writeStream = fs.createWriteStream('/abort-test.txt', { signal: controller3.signal });
146
+ const writeStreamObj = serverFs.createWriteStream('/abort-test.txt', { signal: controller3.signal });
146
147
  controller3.abort();
147
148
 
148
149
  await expect(
149
150
  new Promise((_, reject) => {
150
- writeStream.on('error', reject);
151
- writeStream.write('test');
151
+ writeStreamObj.on('error', reject);
152
+ writeStreamObj.write('test');
152
153
  }),
153
154
  ).rejects.toThrow(Error);
154
155
  }
package/src/fs/utils.ts CHANGED
@@ -4,7 +4,7 @@ import type { IFileStat, WritableData } from './IFileSystem';
4
4
  export function resolveData(data: WritableData) {
5
5
  let buf: Uint8Array;
6
6
  if (typeof data === 'string') {
7
- buf = ArrayBuffers.toUint8Array(ArrayBuffers.from(data, 'utf8'));
7
+ buf = ArrayBuffers.toUint8Array(ArrayBuffers.from(data, 'utf8') as BufferSource);
8
8
  } else if (data instanceof ArrayBuffer) {
9
9
  buf = new Uint8Array(data);
10
10
  } else if (data instanceof Uint8Array) {
@@ -0,0 +1 @@
1
+ export { createWebDavFileSystem } from '../createWebDavFileSystem';
@@ -72,7 +72,7 @@ function addSchema(
72
72
  onConflict = (_, neo) => neo;
73
73
  break;
74
74
  case 'throw':
75
- onConflict = (old, neo) => {
75
+ onConflict = (_old, neo) => {
76
76
  throw new Error(`Schema ${neo.$id} already exists`);
77
77
  };
78
78
  break;
@@ -119,8 +119,8 @@ function create<S>(schema: S, data?: any): TypeOfSchema<S> {
119
119
  .with({ oneOf: P.nonNullable }, (schema) => {
120
120
  return create(schema.oneOf[0]);
121
121
  })
122
- .with({ type: 'string' }, (schema) => '')
123
- .with({ type: P.union('number', 'integer') }, (schema) => 0)
122
+ .with({ type: 'string' }, (_schema) => '')
123
+ .with({ type: P.union('number', 'integer') }, (_schema) => 0)
124
124
  .with({ type: 'object' }, (schema: JsonSchemaDef) => {
125
125
  let out = validate({ schema, data: data ?? {}, mutate: true });
126
126
  if (!out.success) {
@@ -141,8 +141,8 @@ function create<S>(schema: S, data?: any): TypeOfSchema<S> {
141
141
  return out.data;
142
142
  })
143
143
  .with({ type: 'null' }, () => null)
144
- .with({ type: 'boolean' }, (schema) => false)
145
- .with({ type: 'array' }, (schema) => [])
144
+ .with({ type: 'boolean' }, (_schema) => false)
145
+ .with({ type: 'array' }, (_schema) => [])
146
146
  .otherwise(() => {
147
147
  return undefined;
148
148
  });
@@ -9,7 +9,7 @@ export function forEachJsonSchema(js: JsonSchemaDef, cb: (js: JsonSchemaDef, ctx
9
9
  _f: (js: JsonSchemaDef, ctx: VisitJsonSchemaContext) => void,
10
10
  parent: JsonSchemaDef | undefined,
11
11
  path: string[],
12
- k?: string,
12
+ _k?: string,
13
13
  ) => {
14
14
  if (!js) {
15
15
  return;
@@ -1,3 +1,3 @@
1
+ export { forEachJsonSchema } from './forEachJsonSchema';
1
2
  export { JsonSchema } from './JsonSchema';
2
3
  export type { JsonSchemaDef } from './types';
3
- export { forEachJsonSchema } from './forEachJsonSchema';
@@ -59,7 +59,7 @@ type JsonSchemaFormatName =
59
59
  *
60
60
  * @see https://json-schema.org/specification-links.html
61
61
  */
62
- export type JsonSchemaDef<I = any, O = I> = {
62
+ export type JsonSchemaDef<I = any, _O = I> = {
63
63
  $id?: string;
64
64
  $ref?: string;
65
65
  /**
@@ -30,7 +30,7 @@ export function createMetadataKey<T = never>(a: any, b?: any): MetadataKey<T> {
30
30
 
31
31
  export function defineMetadata<T>(res: HasMetadata, key: MetadataKey<T>, opts: T): void;
32
32
  export function defineMetadata<T>(key: MetadataKey<T>, items: Array<[HasMetadata, T]>): void;
33
- export function defineMetadata<T>(a: any, b: any, c?: any) {
33
+ export function defineMetadata<_T>(a: any, b: any, c?: any) {
34
34
  if (Array.isArray(b)) {
35
35
  const key = a;
36
36
  const items = b;
package/src/meta/index.ts CHANGED
@@ -1,5 +1,4 @@
1
- export { createMetadataKey, defineMetadata, getMetadata } from './defineMetadata';
1
+ export { defineFileType, type FileTypeDef, getFileType } from './defineFileType';
2
2
 
3
3
  export { defineInit, type InitDef, runInit } from './defineInit';
4
-
5
- export { defineFileType, getFileType, type FileTypeDef } from './defineFileType';
4
+ export { createMetadataKey, defineMetadata, getMetadata } from './defineMetadata';
@@ -0,0 +1,17 @@
1
+ import { NodeSqliteDialect } from '@mikro-orm/sql';
2
+
3
+ /**
4
+ * Create a Kysely SQLite dialect based on the current runtime.
5
+ * - Bun: uses bun:sqlite via kysely-bun-sqlite
6
+ * - Node.js 22.5+: uses node:sqlite via NodeSqliteDialect
7
+ */
8
+ export async function createSqliteDialect(dbName: string) {
9
+ if (typeof (globalThis as any).Bun !== 'undefined') {
10
+ // @ts-expect-error bun-only module
11
+ const { BunSqliteDialect } = await import('kysely-bun-sqlite');
12
+ // @ts-expect-error bun-only module
13
+ const { Database } = await import('bun:sqlite');
14
+ return new BunSqliteDialect({ database: new Database(dbName) });
15
+ }
16
+ return new NodeSqliteDialect(dbName);
17
+ }
@@ -0,0 +1 @@
1
+ export { createSqliteDialect } from './createSqliteDialect';
@@ -1,4 +1,4 @@
1
- import { createORPCClient, type ClientContext } from '@orpc/client';
1
+ import { type ClientContext, createORPCClient } from '@orpc/client';
2
2
  import type { LinkFetchClientOptions } from '@orpc/client/fetch';
3
3
  import type { BatchLinkPluginOptions, DedupeRequestsPluginOptions } from '@orpc/client/plugins';
4
4
  import type { StandardLinkPlugin } from '@orpc/client/standard';
@@ -43,8 +43,8 @@ export type CreateContractClientOptions = {
43
43
  baseUrl?: string;
44
44
  apiKey?: string;
45
45
  headers?: Record<string, string> | Headers;
46
- getApiKey?: () => string | void;
47
- getHeaders?: (headers: Headers) => Headers | void;
46
+ getApiKey?: () => string | undefined;
47
+ getHeaders?: (headers: Headers) => Headers | undefined;
48
48
  plugins?: StandardLinkPlugin<any>[];
49
49
  fetch?: LinkFetchClientOptions<any>['fetch'];
50
50
  batch?: BatchLinkPluginOptions<any> | boolean;
package/src/orpc/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { createRpcContractClient } from './createRpcContractClient';
2
1
  export { createOpenApiContractClient } from './createOpenApiContractClient';
2
+ export { createRpcContractClient } from './createRpcContractClient';
@@ -99,7 +99,7 @@ export namespace PHC {
99
99
 
100
100
  // Convert Numbers into Numeric Strings and Buffers into B64 encoded strings.
101
101
  pk.forEach((k) => {
102
- const value = opts.params![k];
102
+ const value = opts.params?.[k];
103
103
  if (typeof value === 'number') {
104
104
  opts.params![k] = value.toString();
105
105
  } else if (value instanceof Uint8Array) {
@@ -143,7 +143,7 @@ export namespace PHC {
143
143
  return phcstr;
144
144
  }
145
145
 
146
- interface DeserializeResult {
146
+ export interface DeserializeResult {
147
147
  id: string;
148
148
  version?: number;
149
149
  params?: Record<string, string | number>;
@@ -223,7 +223,7 @@ export namespace PHC {
223
223
 
224
224
  // Convert Decimal Strings into Numbers
225
225
  Object.keys(params).forEach((k) => {
226
- const value = params![k];
226
+ const value = params?.[k];
227
227
  if (typeof value === 'string' && decimalRegex.test(value)) {
228
228
  params![k] = parseInt(value, 10);
229
229
  }
@@ -1,5 +1,5 @@
1
- import { maybeFunction, type MaybeFunction, type MaybePromise } from '@wener/utils';
2
- import { Password } from './Password';
1
+ import { type MaybeFunction, type MaybePromise, maybeFunction } from '@wener/utils';
2
+ import type { Password } from './Password';
3
3
 
4
4
  type Provide = {
5
5
  hash: (password: string, options: { salt?: Buffer; raw?: boolean; type?: 0 | 1 | 2 }) => Promise<string>;
@@ -1,5 +1,5 @@
1
1
  import { ArrayBuffers } from '@wener/utils';
2
- import { Password } from './Password';
2
+ import type { Password } from './Password';
3
3
 
4
4
  export function createBase64PasswordAlgorithm({ id = 'base64' }: { id?: string } = {}): Password.PasswordAlgorithm {
5
5
  return {
@@ -7,7 +7,7 @@ export function createBase64PasswordAlgorithm({ id = 'base64' }: { id?: string }
7
7
  async hash(password: string) {
8
8
  return `$${id}$$${ArrayBuffers.toBase64(password).replace(/=/g, '')}`;
9
9
  },
10
- async verify(password: string, hash: string, opts) {
10
+ async verify(password: string, _hash: string, opts) {
11
11
  return Boolean(opts.hash) && ArrayBuffers.toString(opts.hash!) === password;
12
12
  },
13
13
  };
@@ -1,5 +1,5 @@
1
1
  import type { MaybePromise } from '@wener/utils';
2
- import { Password } from './Password';
2
+ import type { Password } from './Password';
3
3
 
4
4
  type ProviderType = () => MaybePromise<{
5
5
  hash: (password: string, rounds: number | string) => Promise<string>;
@@ -9,7 +9,9 @@ type ProviderType = () => MaybePromise<{
9
9
  export function createBcryptPasswordAlgorithm({
10
10
  // provider = () => import('bcrypt').then((v) => v.default),
11
11
  provider = () => import('bcryptjs').then((v) => v.default),
12
- }: { provider?: ProviderType } = {}): Password.PasswordAlgorithm {
12
+ }: {
13
+ provider?: ProviderType;
14
+ } = {}): Password.PasswordAlgorithm {
13
15
  // bcrypt or bcryptjs
14
16
  return {
15
17
  name: 'bcrypt',
@@ -1,5 +1,5 @@
1
1
  import { Errors } from '@wener/utils';
2
- import { Password } from './Password';
2
+ import type { Password } from './Password';
3
3
  import { PHC } from './PHC';
4
4
 
5
5
  export function createPBKDF2PasswordAlgorithm({
@@ -55,7 +55,7 @@ export function createPBKDF2PasswordAlgorithm({
55
55
  key,
56
56
  storedHash.length * 8,
57
57
  );
58
- return new Uint8Array(hash).every((v, i) => v === storedHash![i]);
58
+ return new Uint8Array(hash).every((v, i) => v === storedHash?.[i]);
59
59
  },
60
60
  };
61
61
  }
@@ -1,6 +1,6 @@
1
1
  import { randomBytes, scrypt, timingSafeEqual } from 'node:crypto';
2
2
  import { Errors } from '@wener/utils';
3
- import { Password } from './Password';
3
+ import type { Password } from './Password';
4
4
  import { PHC } from './PHC';
5
5
 
6
6
  export function createScryptPasswordAlgorithm(
@@ -14,7 +14,7 @@ export function createScryptPasswordAlgorithm(
14
14
  } = {},
15
15
  ): Password.PasswordAlgorithm {
16
16
  let id = options.id || 'scrypt';
17
- options.cost ||= Math.pow(2, 14);
17
+ options.cost ||= 2 ** 14;
18
18
  options.blocksize ||= 8;
19
19
  options.parallelism ||= 1;
20
20
  options.saltlen ||= 16;
@@ -35,7 +35,7 @@ export function createScryptPasswordAlgorithm(
35
35
  });
36
36
  },
37
37
 
38
- async verify(password: string, hash: string, opts): Promise<boolean> {
38
+ async verify(password: string, _hash: string, opts): Promise<boolean> {
39
39
  try {
40
40
  const salt = Errors.BadRequest.require(opts.salt);
41
41
  const storedHash = Errors.BadRequest.require(opts.hash);
@@ -53,7 +53,7 @@ export function createScryptPasswordAlgorithm(
53
53
  resolve(isMatch);
54
54
  });
55
55
  });
56
- } catch (error) {
56
+ } catch (_error) {
57
57
  return Promise.resolve(false);
58
58
  }
59
59
  },
@@ -1,5 +1,5 @@
1
- export { PHC } from './PHC';
2
- export { Password } from './Password';
3
1
  export { createArgon2PasswordAlgorithm } from './createArgon2PasswordAlgorithm';
4
2
  export { createBase64PasswordAlgorithm } from './createBase64PasswordAlgorithm';
5
3
  export { createBcryptPasswordAlgorithm } from './createBcryptPasswordAlgorithm';
4
+ export { Password } from './Password';
5
+ export { PHC } from './PHC';
@@ -25,7 +25,10 @@ export const ListQuerySchema = z.object({
25
25
  deleted: z.coerce.boolean().optional(),
26
26
  });
27
27
 
28
- type ListQueryOverride = ListQueryInput | undefined | ((input: ListQueryInput) => ListQueryInput | undefined | void);
28
+ type ListQueryOverride =
29
+ | ListQueryInput
30
+ | undefined
31
+ | ((input: ListQueryInput) => ListQueryInput | undefined | undefined);
29
32
 
30
33
  export function resolveListQuery(target: ListQueryInput | undefined, ...args: ListQueryOverride[]): ListQuery {
31
34
  let out = args.reduce((a: ListQueryInput, source) => {
@@ -1,4 +1,4 @@
1
- export { type AnyResource } from './schema/AnyResourceSchema';
2
- export { type Identifiable } from './Identifiable';
3
1
  export { getTitleOfResource } from './getTitleOfResource';
4
- export { type ListQueryInput, type ListQuery, resolveListQuery, ListQuerySchema } from './ListQuery';
2
+ export type { Identifiable } from './Identifiable';
3
+ export { type ListQuery, type ListQueryInput, ListQuerySchema, resolveListQuery } from './ListQuery';
4
+ export type { AnyResource } from './schema/AnyResourceSchema';
@@ -1,5 +1,5 @@
1
- export { ResourceStatus, ResourceStatusSchema } from './ResourceStatus';
2
- export { ResourceActionType, ResourceActionTypeSchema, ResourceActionDataSchema } from './ResourceActionType';
3
- export { AnyResourceSchema, type AnyResource } from './AnyResourceSchema';
4
- export { rz, type EnumValues } from './types';
1
+ export { type AnyResource, AnyResourceSchema } from './AnyResourceSchema';
5
2
  export { BaseResourceSchema } from './BaseResourceSchema';
3
+ export { ResourceActionDataSchema, ResourceActionType, ResourceActionTypeSchema } from './ResourceActionType';
4
+ export { ResourceStatus, ResourceStatusSchema } from './ResourceStatus';
5
+ export { type EnumValues, rz } from './types';
@@ -216,7 +216,7 @@ describe('formatS3Url', () => {
216
216
  endpoint: 's3.amazonaws.com',
217
217
  bucket: 'a'.repeat(64),
218
218
  };
219
- expect(() => formatS3Url(options)).toThrow('Invalid bucket name: ' + 'a'.repeat(64));
219
+ expect(() => formatS3Url(options)).toThrow(`Invalid bucket name: ${'a'.repeat(64)}`);
220
220
  });
221
221
 
222
222
  it('should handle valid bucket names with various formats', () => {
@@ -31,7 +31,7 @@ export function formatS3Url(
31
31
  } else {
32
32
  url = new URL(`https://${ep}`);
33
33
  }
34
- } catch (error) {
34
+ } catch (_error) {
35
35
  throw new Error(`Invalid endpoint: ${ep}`);
36
36
  }
37
37
 
@@ -58,7 +58,7 @@ export function formatS3Url(
58
58
 
59
59
  if (port) {
60
60
  const portNum = Number(port);
61
- if (isNaN(portNum) || portNum < 1 || portNum > 65535) {
61
+ if (Number.isNaN(portNum) || portNum < 1 || portNum > 65535) {
62
62
  throw new Error('Port must be a valid number between 1 and 65535');
63
63
  }
64
64
  url.port = String(portNum);
package/src/s3/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { parseS3Url, type ParseS3UrlOptions } from './parseS3Url';
2
1
  export { formatS3Url } from './formatS3Url';
2
+ export { type ParseS3UrlOptions, parseS3Url } from './parseS3Url';
@@ -27,7 +27,7 @@ export function parseS3Url({ url = process.env.S3_URL, ...rest }: ParseS3UrlOpti
27
27
  let parsed: URL;
28
28
  try {
29
29
  parsed = new URL(normalizedUrl);
30
- } catch (error) {
30
+ } catch (_error) {
31
31
  throw new Error(`Invalid S3 URL: ${url}`);
32
32
  }
33
33
 
@@ -1,6 +1,6 @@
1
1
  import { getGlobalStates } from '@wener/utils';
2
2
  import type { JsonSchemaDef } from '../jsonschema';
3
- import { toJsonSchema, type SchemaOutput, type TypeSchema } from './index';
3
+ import { type SchemaOutput, type TypeSchema, toJsonSchema } from './index';
4
4
 
5
5
  export namespace SchemaRegistry {
6
6
  const types = getGlobalStates('@wener/common/resource/schema/SchemaRegistry', () => new Map<string, JsonSchemaDef>());
@@ -21,7 +21,7 @@ export namespace SchemaRegistry {
21
21
  }
22
22
 
23
23
  function getKey(s: TypeSchema | string) {
24
- let key;
24
+ let key: string | undefined;
25
25
  if (typeof s === 'string') {
26
26
  key = s;
27
27
  } else {