tina4-nodejs 3.13.137 → 3.13.138

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 (242) hide show
  1. package/CLAUDE.md +33 -3
  2. package/COMMERCIAL-LICENSE.md +8 -0
  3. package/LICENSE +373 -0
  4. package/NOTICE +11 -0
  5. package/README.md +24 -2
  6. package/package.json +44 -6
  7. package/packages/cli/dist/bin.js +19466 -18048
  8. package/packages/cli/src/bin.ts +8 -0
  9. package/packages/cli/src/commands/build.ts +8 -0
  10. package/packages/cli/src/commands/generate.ts +8 -0
  11. package/packages/cli/src/commands/init.ts +8 -0
  12. package/packages/cli/src/commands/lint.ts +8 -0
  13. package/packages/cli/src/commands/migrate.ts +8 -0
  14. package/packages/cli/src/commands/migrateCreate.ts +8 -0
  15. package/packages/cli/src/commands/migrateRollback.ts +8 -0
  16. package/packages/cli/src/commands/migrateStatus.ts +8 -0
  17. package/packages/cli/src/commands/queue.ts +8 -0
  18. package/packages/cli/src/commands/routes.ts +8 -0
  19. package/packages/cli/src/commands/seed.ts +8 -0
  20. package/packages/cli/src/commands/serve.ts +11 -0
  21. package/packages/cli/src/commands/test.ts +8 -0
  22. package/packages/core/dist/index.js +19458 -18043
  23. package/packages/core/gallery/auth/src/routes/api/gallery/auth/login/post.ts +8 -0
  24. package/packages/core/gallery/auth/src/routes/api/gallery/auth/verify/get.ts +8 -0
  25. package/packages/core/gallery/auth/src/routes/gallery/auth/get.ts +8 -0
  26. package/packages/core/gallery/database/src/routes/api/gallery/db/notes/get.ts +8 -0
  27. package/packages/core/gallery/database/src/routes/api/gallery/db/notes/post.ts +8 -0
  28. package/packages/core/gallery/database/src/routes/api/gallery/db/tables/get.ts +8 -0
  29. package/packages/core/gallery/error-overlay/src/routes/api/gallery/crash/get.ts +8 -0
  30. package/packages/core/gallery/orm/src/routes/api/gallery/products/get.ts +8 -0
  31. package/packages/core/gallery/orm/src/routes/api/gallery/products/post.ts +8 -0
  32. package/packages/core/gallery/queue/src/lib/queueDb.ts +8 -0
  33. package/packages/core/gallery/queue/src/routes/api/gallery/queue/consume/post.ts +8 -0
  34. package/packages/core/gallery/queue/src/routes/api/gallery/queue/fail/post.ts +8 -0
  35. package/packages/core/gallery/queue/src/routes/api/gallery/queue/produce/post.ts +8 -0
  36. package/packages/core/gallery/queue/src/routes/api/gallery/queue/retry/post.ts +8 -0
  37. package/packages/core/gallery/queue/src/routes/api/gallery/queue/status/get.ts +8 -0
  38. package/packages/core/gallery/queue/src/routes/gallery/queue/get.ts +8 -0
  39. package/packages/core/gallery/rest-api/src/routes/api/gallery/hello/get.ts +8 -0
  40. package/packages/core/gallery/rest-api/src/routes/api/gallery/hello/post.ts +8 -0
  41. package/packages/core/gallery/templates/src/routes/gallery/page/get.ts +8 -0
  42. package/packages/core/gallery/templates/src/templates/gallery_page.twig +8 -0
  43. package/packages/core/public/THIRD-PARTY-NOTICES.md +55 -0
  44. package/packages/core/public/bundled-component-provenance.json +48 -0
  45. package/packages/core/public/js/tina4js.min.js +13 -3
  46. package/packages/core/public/licenses/swagger-ui-3.10.0-original-notice.txt +11 -0
  47. package/packages/core/public/licenses/swagger-ui-5.17.14-NOTICE.txt +2 -0
  48. package/packages/core/public/licenses/swagger-ui-Apache-2.0.txt +202 -0
  49. package/packages/core/public/licenses/tina4-css-MIT.txt +21 -0
  50. package/packages/core/public/licenses/tina4-dev-admin-components.json +240 -0
  51. package/packages/core/public/licenses/tina4-dev-admin-third-party.txt +919 -0
  52. package/packages/core/public/licenses/tina4-js-MIT.txt +20 -0
  53. package/packages/core/src/__feedback/widget.js +8 -0
  54. package/packages/core/src/_missing.ts +8 -0
  55. package/packages/core/src/ai.ts +8 -0
  56. package/packages/core/src/aiClient.ts +8 -0
  57. package/packages/core/src/api.ts +15 -3
  58. package/packages/core/src/auth.ts +21 -8
  59. package/packages/core/src/authGate.ts +8 -0
  60. package/packages/core/src/background.ts +8 -0
  61. package/packages/core/src/cache.ts +43 -4
  62. package/packages/core/src/constants.ts +8 -0
  63. package/packages/core/src/container.ts +8 -0
  64. package/packages/core/src/context/chunker.ts +8 -0
  65. package/packages/core/src/context/index.ts +8 -0
  66. package/packages/core/src/devAdmin.ts +185 -59
  67. package/packages/core/src/devMailbox.ts +8 -0
  68. package/packages/core/src/dispatchPipeline.ts +8 -0
  69. package/packages/core/src/docs.ts +8 -0
  70. package/packages/core/src/docsAutoDiscovery.ts +8 -0
  71. package/packages/core/src/docsParser.ts +8 -0
  72. package/packages/core/src/docsScanner.ts +44 -0
  73. package/packages/core/src/docsSignatures.ts +8 -0
  74. package/packages/core/src/dotenv.ts +8 -0
  75. package/packages/core/src/env.ts +8 -0
  76. package/packages/core/src/errorOverlay.ts +8 -0
  77. package/packages/core/src/events.ts +8 -0
  78. package/packages/core/src/fakeData.ts +8 -0
  79. package/packages/core/src/feedback.ts +8 -0
  80. package/packages/core/src/graphql.ts +16 -5
  81. package/packages/core/src/health.ts +8 -0
  82. package/packages/core/src/htmlElement.ts +8 -0
  83. package/packages/core/src/i18n.ts +8 -0
  84. package/packages/core/src/index.ts +8 -0
  85. package/packages/core/src/job.ts +8 -0
  86. package/packages/core/src/logger.ts +8 -0
  87. package/packages/core/src/mcp.test.ts +8 -0
  88. package/packages/core/src/mcp.ts +8 -0
  89. package/packages/core/src/messenger.ts +143 -86
  90. package/packages/core/src/metrics.ts +13 -0
  91. package/packages/core/src/middleware.ts +1178 -1096
  92. package/packages/core/src/mqtt.ts +8 -0
  93. package/packages/core/src/mqttMessage.ts +8 -0
  94. package/packages/core/src/optionalPackage.ts +48 -0
  95. package/packages/core/src/plan.ts +8 -0
  96. package/packages/core/src/portTakeover.ts +8 -0
  97. package/packages/core/src/projectIndex.ts +8 -0
  98. package/packages/core/src/projectIndexExtractors.ts +8 -0
  99. package/packages/core/src/projectIndexStorage.ts +8 -0
  100. package/packages/core/src/push.ts +8 -0
  101. package/packages/core/src/queue.ts +8 -0
  102. package/packages/core/src/queueBackends/kafkaBackend.ts +8 -0
  103. package/packages/core/src/queueBackends/liteBackend.ts +8 -0
  104. package/packages/core/src/queueBackends/mongoBackend.ts +21 -8
  105. package/packages/core/src/queueBackends/rabbitmqBackend.ts +8 -0
  106. package/packages/core/src/rateLimiter.ts +8 -0
  107. package/packages/core/src/request.ts +59 -10
  108. package/packages/core/src/response.ts +79 -5
  109. package/packages/core/src/routeDiscovery.ts +8 -0
  110. package/packages/core/src/router.ts +8 -0
  111. package/packages/core/src/server.ts +73 -24
  112. package/packages/core/src/service.ts +8 -0
  113. package/packages/core/src/session.ts +8 -0
  114. package/packages/core/src/sessionHandlers/childError.ts +8 -0
  115. package/packages/core/src/sessionHandlers/databaseHandler.ts +8 -0
  116. package/packages/core/src/sessionHandlers/memcachedHandler.ts +8 -0
  117. package/packages/core/src/sessionHandlers/mongoClient.ts +8 -0
  118. package/packages/core/src/sessionHandlers/mongoHandler.ts +8 -0
  119. package/packages/core/src/sessionHandlers/respClient.ts +8 -0
  120. package/packages/core/src/sessionHandlers/sqlClient.ts +8 -0
  121. package/packages/core/src/sessionHandlers/syncBridge.ts +8 -0
  122. package/packages/core/src/sessionHandlers/syncSocket.ts +8 -0
  123. package/packages/core/src/sessionHandlers/valkeyHandler.ts +8 -0
  124. package/packages/core/src/sso.ts +8 -0
  125. package/packages/core/src/static.ts +8 -0
  126. package/packages/core/src/test.ts +8 -0
  127. package/packages/core/src/testClient.ts +8 -0
  128. package/packages/core/src/testing.ts +8 -0
  129. package/packages/core/src/transport.ts +369 -0
  130. package/packages/core/src/trustedProxy.ts +8 -0
  131. package/packages/core/src/types.ts +13 -0
  132. package/packages/core/src/validator.ts +8 -0
  133. package/packages/core/src/version.ts +8 -0
  134. package/packages/core/src/websocket.ts +8 -0
  135. package/packages/core/src/websocketBackplane.ts +49 -32
  136. package/packages/core/src/websocketConnection.ts +8 -0
  137. package/packages/core/src/wsdl.ts +197 -115
  138. package/packages/core/templates/errors/302.twig +8 -0
  139. package/packages/core/templates/errors/401.twig +8 -0
  140. package/packages/core/templates/errors/403.twig +8 -0
  141. package/packages/core/templates/errors/404.twig +8 -0
  142. package/packages/core/templates/errors/500.twig +8 -0
  143. package/packages/core/templates/errors/502.twig +8 -0
  144. package/packages/core/templates/errors/503.twig +8 -0
  145. package/packages/core/templates/errors/base.twig +8 -0
  146. package/packages/frond/dist/index.js +151 -17
  147. package/packages/frond/src/engine.ts +177 -17
  148. package/packages/frond/src/index.ts +8 -0
  149. package/packages/orm/dist/index.js +8125 -6708
  150. package/packages/orm/src/adapters/firebird.ts +50 -3
  151. package/packages/orm/src/adapters/mongodb.ts +8 -0
  152. package/packages/orm/src/adapters/mssql.ts +29 -7
  153. package/packages/orm/src/adapters/mysql.ts +17 -1
  154. package/packages/orm/src/adapters/odbc.ts +11 -0
  155. package/packages/orm/src/adapters/pg-types.d.ts +8 -0
  156. package/packages/orm/src/adapters/postgres.ts +34 -8
  157. package/packages/orm/src/adapters/sqlDialect.ts +57 -0
  158. package/packages/orm/src/adapters/sqlite.ts +26 -0
  159. package/packages/orm/src/autoCrud.ts +78 -36
  160. package/packages/orm/src/baseModel.ts +61 -29
  161. package/packages/orm/src/cachedDatabase.ts +67 -1
  162. package/packages/orm/src/connectTimeout.ts +8 -0
  163. package/packages/orm/src/database.ts +649 -401
  164. package/packages/orm/src/databaseResult.ts +8 -0
  165. package/packages/orm/src/databaseUrl.ts +8 -0
  166. package/packages/orm/src/docstore.ts +23 -1
  167. package/packages/orm/src/fakeData.ts +8 -0
  168. package/packages/orm/src/graph/adapters/arango.ts +8 -0
  169. package/packages/orm/src/graph/adapters/bolt.ts +8 -0
  170. package/packages/orm/src/graph/adapters/ultipa.ts +8 -0
  171. package/packages/orm/src/graph/connectTimeout.ts +8 -0
  172. package/packages/orm/src/graph/errors.ts +8 -0
  173. package/packages/orm/src/graph/graphAdapter.ts +8 -0
  174. package/packages/orm/src/graph/graphDatabase.ts +8 -0
  175. package/packages/orm/src/graph/graphUrl.ts +10 -1
  176. package/packages/orm/src/graph/shapes.ts +8 -0
  177. package/packages/orm/src/index.ts +147 -139
  178. package/packages/orm/src/migration.ts +8 -0
  179. package/packages/orm/src/model.ts +8 -0
  180. package/packages/orm/src/modelCollection.ts +8 -0
  181. package/packages/orm/src/point.ts +8 -0
  182. package/packages/orm/src/query.ts +149 -33
  183. package/packages/orm/src/queryBuilder.ts +8 -0
  184. package/packages/orm/src/realtime/index.ts +8 -0
  185. package/packages/orm/src/realtime/models/attachment.ts +8 -0
  186. package/packages/orm/src/realtime/models/channel.ts +8 -0
  187. package/packages/orm/src/realtime/models/channelMember.ts +8 -0
  188. package/packages/orm/src/realtime/models/message.ts +8 -0
  189. package/packages/orm/src/realtime/models/workspace.ts +8 -0
  190. package/packages/orm/src/realtime/realtime.ts +8 -0
  191. package/packages/orm/src/realtime/storage.ts +43 -12
  192. package/packages/orm/src/seeder.ts +8 -0
  193. package/packages/orm/src/seederTable.ts +8 -0
  194. package/packages/orm/src/seederTypes.ts +8 -0
  195. package/packages/orm/src/sqlTranslator.ts +185 -8
  196. package/packages/orm/src/types.ts +15 -0
  197. package/packages/orm/src/validation.ts +8 -0
  198. package/packages/swagger/src/generator.ts +8 -0
  199. package/packages/swagger/src/index.ts +8 -0
  200. package/packages/swagger/src/ui.ts +8 -0
  201. package/types/core/src/background.d.ts +0 -16
  202. package/types/core/src/cache.d.ts +6 -0
  203. package/types/core/src/devAdmin.d.ts +18 -12
  204. package/types/core/src/docs.d.ts +0 -17
  205. package/types/core/src/errorOverlay.d.ts +0 -24
  206. package/types/core/src/events.d.ts +0 -12
  207. package/types/core/src/feedback.d.ts +0 -23
  208. package/types/core/src/graphql.d.ts +0 -21
  209. package/types/core/src/htmlElement.d.ts +0 -15
  210. package/types/core/src/messenger.d.ts +12 -1
  211. package/types/core/src/metrics.d.ts +2 -0
  212. package/types/core/src/middleware.d.ts +45 -1
  213. package/types/core/src/mqtt.d.ts +0 -33
  214. package/types/core/src/optionalPackage.d.ts +25 -0
  215. package/types/core/src/plan.d.ts +0 -10
  216. package/types/core/src/projectIndex.d.ts +0 -10
  217. package/types/core/src/queueBackends/mongoBackend.d.ts +2 -0
  218. package/types/core/src/request.d.ts +12 -0
  219. package/types/core/src/response.d.ts +13 -0
  220. package/types/core/src/server.d.ts +19 -0
  221. package/types/core/src/sessionHandlers/childError.d.ts +0 -15
  222. package/types/core/src/transport.d.ts +28 -0
  223. package/types/core/src/trustedProxy.d.ts +0 -16
  224. package/types/core/src/types.d.ts +5 -0
  225. package/types/core/src/websocketBackplane.d.ts +1 -0
  226. package/types/core/src/wsdl.d.ts +8 -22
  227. package/types/frond/src/engine.d.ts +7 -1
  228. package/types/orm/src/adapters/firebird.d.ts +12 -0
  229. package/types/orm/src/adapters/mssql.d.ts +11 -0
  230. package/types/orm/src/adapters/mysql.d.ts +2 -0
  231. package/types/orm/src/adapters/postgres.d.ts +11 -0
  232. package/types/orm/src/adapters/sqlDialect.d.ts +25 -0
  233. package/types/orm/src/adapters/sqlite.d.ts +7 -0
  234. package/types/orm/src/baseModel.d.ts +5 -0
  235. package/types/orm/src/cachedDatabase.d.ts +27 -0
  236. package/types/orm/src/database.d.ts +46 -7
  237. package/types/orm/src/graph/graphUrl.d.ts +0 -8
  238. package/types/orm/src/index.d.ts +1 -1
  239. package/types/orm/src/query.d.ts +48 -2
  240. package/types/orm/src/realtime/storage.d.ts +2 -1
  241. package/types/orm/src/sqlTranslator.d.ts +70 -18
  242. package/types/orm/src/types.d.ts +6 -0
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  import type { DatabaseAdapter, ColumnInfo } from "./types.js";
2
10
 
3
11
  /** Column metadata returned by columnInfo(). */
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * A parsed database connection URL, as a VALUE.
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * Tina4 DocStore - pymongo-style document storage with a zero-config SQLite (JSON1) fallback.
3
11
  *
@@ -199,9 +207,23 @@ const COMPARATORS: Record<string, string> = {
199
207
  $lte: "<=",
200
208
  };
201
209
 
202
- /** Field name -> a JSON path. Dotted names address nested keys. */
210
+ const SAFE_PATH_SEGMENT = /^[A-Za-z0-9_-]+$/;
211
+
212
+ /**
213
+ * Field name -> a JSON path. Dotted names address nested keys.
214
+ *
215
+ * tina4: ADR-0069 - this is the single chokepoint every field path passes
216
+ * through on its way into SQL (filter keys at any depth, $or/$and members,
217
+ * operator fields, sort keys), so it validates every dot segment here and
218
+ * throws before any SQL is built.
219
+ */
203
220
  function jsonPath(field: string): string {
204
221
  const segments = field.split(".");
222
+ if (!segments.every((s) => SAFE_PATH_SEGMENT.test(s))) {
223
+ throw new Error(
224
+ `DocStore: invalid field path '${field}' - each dot-separated segment must match [A-Za-z0-9_-]+`,
225
+ );
226
+ }
205
227
  const isIdent = (s: string) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(s);
206
228
  return "$." + segments.map((s) => (isIdent(s) ? s : `"${s}"`)).join(".");
207
229
  }
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  // Tina4 ORM FakeData — extends core FakeData with ORM-aware data generation.
2
10
  // Re-exports core FakeData with additional forField() for auto-generating
3
11
  // data based on ORM field definitions.
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * ArangoDB graph adapter — the document/AQL engine behind the same surface.
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * Bolt graph adapter — Neo4j AND Memgraph (both speak Bolt + Cypher).
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * Ultipa graph adapter — the portable core built in GQL over the tina4-ultipa driver.
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * TINA4_GRAPH_CONNECT_TIMEOUT — the graph connect bound.
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * Graph layer errors — the graph siblings of the relational fail-loud contract.
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * The one surface every graph engine implements.
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * The GraphAdapter URL-selected factory — the GraphDatabase sibling of Database.
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * Graph connection URL parser — the DatabaseUrl sibling for graph engines.
3
11
  *
@@ -6,6 +14,7 @@
6
14
  * alias (bolt/neo4j/memgraph all speak Bolt/Cypher and share ONE adapter) resolves
7
15
  * to its engine here. See tina4-documentation/plan/v3/features/139-graph-databases.md.
8
16
  */
17
+ import { redactCredentials } from "../databaseUrl.js";
9
18
 
10
19
  /** The canonical graph engine names. */
11
20
  export type GraphEngine = "ultipa" | "bolt" | "arango";
@@ -55,7 +64,7 @@ export class GraphUrl {
55
64
  parsed = new URL(url);
56
65
  } catch {
57
66
  throw new Error(
58
- `Unsupported graph URL '${url}' — expected scheme://[user[:password]@]host[:port]/graph `
67
+ `Unsupported graph URL '${redactCredentials(url)}' — expected scheme://[user[:password]@]host[:port]/graph `
59
68
  + `(e.g. ultipa://host:60061/mygraph).`,
60
69
  );
61
70
  }
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * Engine-neutral graph shapes — the mirror of the relational DatabaseResult.
3
11
  *
@@ -1,139 +1,147 @@
1
- export type {
2
- FieldType,
3
- FieldDefinition,
4
- ModelDefinition,
5
- DatabaseAdapter,
6
- DatabaseResult as DatabaseWriteResult,
7
- ColumnInfo,
8
- QueryOptions,
9
- RelationshipDefinition,
10
- } from "./types.js";
11
-
12
- export { REQUIRED_ADAPTER_CAPABILITIES, NOT_REQUIRED_ON_ADAPTER } from "./types.js";
13
-
14
- export { DatabaseResult } from "./databaseResult.js";
15
- export type { ColumnInfoResult } from "./databaseResult.js";
16
- export { ModelCollection } from "./modelCollection.js";
17
- export type { PaginateEnvelope } from "./modelCollection.js";
18
- export { Database, initDatabase, getAdapter, setAdapter, bindDatabase, createAdapterFromUrl, closeDatabase, parseDatabaseUrl, setNamedAdapter, getNamedAdapter, resolveDbPool, stripTrailingSemicolons, wrapWithCache, resetRequestCaches } from "./database.js";
19
- export {
20
- adapterFetch, adapterQuery, adapterFetchOne, adapterExecute, adapterInsert,
21
- adapterStartTransaction, adapterCommit, adapterRollback,
22
- adapterTableExists, adapterTables, adapterColumns, adapterCreateTable,
23
- extractLastInsertId,
24
- } from "./database.js";
25
- export type { DatabaseConfig } from "./database.js";
26
- export { DatabaseUrl, redactCredentials } from "./databaseUrl.js";
27
- export type { DatabaseEngine } from "./databaseUrl.js";
28
- export { discoverModels } from "./model.js";
29
- export type { DiscoveredModel } from "./model.js";
30
- export {
31
- syncModels,
32
- ensureMigrationTable,
33
- getNextBatch,
34
- isMigrationApplied,
35
- recordMigration,
36
- applyMigration,
37
- rollback,
38
- getAppliedMigrations,
39
- getLastBatchMigrations,
40
- removeMigrationRecord,
41
- migrate,
42
- createMigration,
43
- status,
44
- Migration,
45
- splitStatements,
46
- parseSetTerm,
47
- normalizeQuotes,
48
- sortMigrationFiles,
49
- shouldSkipCreateTable,
50
- shouldSkipForFirebird,
51
- } from "./migration.js";
52
- export type { MigrationResult, MigrationStatus } from "./migration.js";
53
- export { AutoCrud, generateCrudRoutes, crudEligibleModels } from "./autoCrud.js";
54
- export type { AutoCrudOptions } from "./autoCrud.js";
55
- export { buildQuery, parseQueryString } from "./query.js";
56
- export { validate } from "./validation.js";
57
- export type { ValidationError } from "./validation.js";
58
- export { BaseModel, snakeToCamel, camelToSnake } from "./baseModel.js";
59
- export { QueryBuilder } from "./queryBuilder.js";
60
- export { SQLTranslator, QueryCache } from "./sqlTranslator.js";
61
- export { Point, SpatialNotSupportedError, DEFAULT_SRID } from "./point.js";
62
- export type { GeoJsonPoint } from "./point.js";
63
- export {
64
- DEFAULT_DATABASE_CONNECT_TIMEOUT_SECONDS,
65
- CONNECT_TIMEOUT_TOLERANCE_MS,
66
- connectTimeoutMillis,
67
- driverConnectTimeoutMillis,
68
- connectTarget,
69
- withConnectTimeout,
70
- } from "./connectTimeout.js";
71
- export { CachedDatabaseAdapter } from "./cachedDatabase.js";
72
- export type { CachedAdapterOptions } from "./cachedDatabase.js";
73
- export { FakeData } from "./fakeData.js";
74
- export { seedTable, seedOrm, seedModels, autoFieldMap } from "./seeder.js";
75
- export type { SeedSummary, SeedOptions } from "./seeder.js";
76
-
77
- // DocStore — pymongo-style document store with a zero-config SQLite (JSON1) fallback
78
- export {
79
- ObjectId, InvalidId, DocStoreDriverMissing, SqliteDatabase, SqliteCollection, Cursor,
80
- getCollection, isServerless, resetDefaultStore, closeDocStore,
81
- encodeValue, decodeValue, compileFilter,
82
- } from "./docstore.js";
83
- export type {
84
- InsertOneResult, InsertManyResult, UpdateResult, DeleteResult,
85
- } from "./docstore.js";
86
-
87
- // Database adapters
88
- export { SQLiteAdapter } from "./adapters/sqlite.js";
89
- export { PostgresAdapter } from "./adapters/postgres.js";
90
- export type { PostgresConfig } from "./adapters/postgres.js";
91
- export { MysqlAdapter } from "./adapters/mysql.js";
92
- export type { MysqlConfig } from "./adapters/mysql.js";
93
- export { MssqlAdapter } from "./adapters/mssql.js";
94
- export type { MssqlConfig } from "./adapters/mssql.js";
95
- export { FirebirdAdapter, normalizeFirebirdDbIdentifier, resolveFirebirdCharset } from "./adapters/firebird.js";
96
- export type { FirebirdConfig } from "./adapters/firebird.js";
97
- export { MongodbAdapter } from "./adapters/mongodb.js";
98
- export type { MongoConfig } from "./adapters/mongodb.js";
99
- export { OdbcAdapter } from "./adapters/odbc.js";
100
- export type { OdbcConfig } from "./adapters/odbc.js";
101
-
102
- // Graph data layer (Feature 139) — URL-selected graph databases, shaped like Database.
103
- // The engine adapters (e.g. UltipaGraphAdapter) are deliberately NOT re-exported:
104
- // they import their optional driver, so the factory loads them lazily and the core
105
- // surface below stays driver-free (the zero-dependency-core rule, ADR-0059).
106
- export { GraphDatabase } from "./graph/graphDatabase.js";
107
- export type { GraphCredentials } from "./graph/graphDatabase.js";
108
- export { GraphUrl } from "./graph/graphUrl.js";
109
- export type { GraphEngine } from "./graph/graphUrl.js";
110
- export { GraphNode, GraphEdge, GraphResult } from "./graph/shapes.js";
111
- export { GraphError, GraphConnectTimeout } from "./graph/errors.js";
112
- export type {
113
- GraphAdapter,
114
- GraphDirection,
115
- NeighborOptions,
116
- TraverseOptions,
117
- } from "./graph/graphAdapter.js";
118
- export {
119
- resolveGraphConnectTimeout,
120
- GRAPH_CONNECT_TIMEOUT_VARIABLE,
121
- DEFAULT_GRAPH_CONNECT_TIMEOUT_SECONDS,
122
- } from "./graph/connectTimeout.js";
123
-
124
- // Realtime collaboration mount (calls + chat + files) — parity with the Python master.
125
- export {
126
- realtime,
127
- iceServers,
128
- type RealtimeOptions,
129
- LocalStorage,
130
- S3Storage,
131
- selectStorage,
132
- storageKey,
133
- type StorageBackend,
134
- Workspace as RealtimeWorkspace,
135
- Channel as RealtimeChannel,
136
- ChannelMember as RealtimeChannelMember,
137
- Message as RealtimeMessage,
138
- Attachment as RealtimeAttachment,
139
- } from "./realtime/index.js";
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
9
+ export type {
10
+ FieldType,
11
+ FieldDefinition,
12
+ ModelDefinition,
13
+ DatabaseAdapter,
14
+ DatabaseResult as DatabaseWriteResult,
15
+ ColumnInfo,
16
+ QueryOptions,
17
+ RelationshipDefinition,
18
+ } from "./types.js";
19
+
20
+ export { REQUIRED_ADAPTER_CAPABILITIES, NOT_REQUIRED_ON_ADAPTER } from "./types.js";
21
+
22
+ export { DatabaseResult } from "./databaseResult.js";
23
+ export type { ColumnInfoResult } from "./databaseResult.js";
24
+ export { ModelCollection } from "./modelCollection.js";
25
+ export type { PaginateEnvelope } from "./modelCollection.js";
26
+ export { Database, initDatabase, getAdapter, setAdapter, bindDatabase, createAdapterFromUrl, closeDatabase, parseDatabaseUrl, setNamedAdapter, getNamedAdapter, resolveDbPool, stripTrailingSemicolons, wrapWithCache, resetRequestCaches } from "./database.js";
27
+ export {
28
+ adapterFetch, adapterQuery, adapterFetchOne, adapterExecute, adapterInsert,
29
+ adapterStartTransaction, adapterCommit, adapterRollback,
30
+ adapterTableExists, adapterTables, adapterColumns, adapterCreateTable,
31
+ extractLastInsertId,
32
+ } from "./database.js";
33
+ export type { DatabaseConfig } from "./database.js";
34
+ export { DatabaseUrl, redactCredentials } from "./databaseUrl.js";
35
+ export type { DatabaseEngine } from "./databaseUrl.js";
36
+ export { discoverModels } from "./model.js";
37
+ export type { DiscoveredModel } from "./model.js";
38
+ export {
39
+ syncModels,
40
+ ensureMigrationTable,
41
+ getNextBatch,
42
+ isMigrationApplied,
43
+ recordMigration,
44
+ applyMigration,
45
+ rollback,
46
+ getAppliedMigrations,
47
+ getLastBatchMigrations,
48
+ removeMigrationRecord,
49
+ migrate,
50
+ createMigration,
51
+ status,
52
+ Migration,
53
+ splitStatements,
54
+ parseSetTerm,
55
+ normalizeQuotes,
56
+ sortMigrationFiles,
57
+ shouldSkipCreateTable,
58
+ shouldSkipForFirebird,
59
+ } from "./migration.js";
60
+ export type { MigrationResult, MigrationStatus } from "./migration.js";
61
+ export { AutoCrud, generateCrudRoutes, crudEligibleModels } from "./autoCrud.js";
62
+ export type { AutoCrudOptions } from "./autoCrud.js";
63
+ export { buildQuery, parseQueryString, UnknownFieldError, InvalidQueryParameterError } from "./query.js";
64
+ export { validate } from "./validation.js";
65
+ export type { ValidationError } from "./validation.js";
66
+ export { BaseModel, snakeToCamel, camelToSnake } from "./baseModel.js";
67
+ export { QueryBuilder } from "./queryBuilder.js";
68
+ export { SQLTranslator, QueryCache } from "./sqlTranslator.js";
69
+ export { Point, SpatialNotSupportedError, DEFAULT_SRID } from "./point.js";
70
+ export type { GeoJsonPoint } from "./point.js";
71
+ export {
72
+ DEFAULT_DATABASE_CONNECT_TIMEOUT_SECONDS,
73
+ CONNECT_TIMEOUT_TOLERANCE_MS,
74
+ connectTimeoutMillis,
75
+ driverConnectTimeoutMillis,
76
+ connectTarget,
77
+ withConnectTimeout,
78
+ } from "./connectTimeout.js";
79
+ export { CachedDatabaseAdapter } from "./cachedDatabase.js";
80
+ export type { CachedAdapterOptions } from "./cachedDatabase.js";
81
+ export { FakeData } from "./fakeData.js";
82
+ export { seedTable, seedOrm, seedModels, autoFieldMap } from "./seeder.js";
83
+ export type { SeedSummary, SeedOptions } from "./seeder.js";
84
+
85
+ // DocStore — pymongo-style document store with a zero-config SQLite (JSON1) fallback
86
+ export {
87
+ ObjectId, InvalidId, DocStoreDriverMissing, SqliteDatabase, SqliteCollection, Cursor,
88
+ getCollection, isServerless, resetDefaultStore, closeDocStore,
89
+ encodeValue, decodeValue, compileFilter,
90
+ } from "./docstore.js";
91
+ export type {
92
+ InsertOneResult, InsertManyResult, UpdateResult, DeleteResult,
93
+ } from "./docstore.js";
94
+
95
+ // Database adapters
96
+ export { SQLiteAdapter } from "./adapters/sqlite.js";
97
+ export { PostgresAdapter } from "./adapters/postgres.js";
98
+ export type { PostgresConfig } from "./adapters/postgres.js";
99
+ export { MysqlAdapter } from "./adapters/mysql.js";
100
+ export type { MysqlConfig } from "./adapters/mysql.js";
101
+ export { MssqlAdapter } from "./adapters/mssql.js";
102
+ export type { MssqlConfig } from "./adapters/mssql.js";
103
+ export { FirebirdAdapter, normalizeFirebirdDbIdentifier, resolveFirebirdCharset } from "./adapters/firebird.js";
104
+ export type { FirebirdConfig } from "./adapters/firebird.js";
105
+ export { MongodbAdapter } from "./adapters/mongodb.js";
106
+ export type { MongoConfig } from "./adapters/mongodb.js";
107
+ export { OdbcAdapter } from "./adapters/odbc.js";
108
+ export type { OdbcConfig } from "./adapters/odbc.js";
109
+
110
+ // Graph data layer (Feature 139) — URL-selected graph databases, shaped like Database.
111
+ // The engine adapters (e.g. UltipaGraphAdapter) are deliberately NOT re-exported:
112
+ // they import their optional driver, so the factory loads them lazily and the core
113
+ // surface below stays driver-free (the zero-dependency-core rule, ADR-0059).
114
+ export { GraphDatabase } from "./graph/graphDatabase.js";
115
+ export type { GraphCredentials } from "./graph/graphDatabase.js";
116
+ export { GraphUrl } from "./graph/graphUrl.js";
117
+ export type { GraphEngine } from "./graph/graphUrl.js";
118
+ export { GraphNode, GraphEdge, GraphResult } from "./graph/shapes.js";
119
+ export { GraphError, GraphConnectTimeout } from "./graph/errors.js";
120
+ export type {
121
+ GraphAdapter,
122
+ GraphDirection,
123
+ NeighborOptions,
124
+ TraverseOptions,
125
+ } from "./graph/graphAdapter.js";
126
+ export {
127
+ resolveGraphConnectTimeout,
128
+ GRAPH_CONNECT_TIMEOUT_VARIABLE,
129
+ DEFAULT_GRAPH_CONNECT_TIMEOUT_SECONDS,
130
+ } from "./graph/connectTimeout.js";
131
+
132
+ // Realtime collaboration mount (calls + chat + files) — parity with the Python master.
133
+ export {
134
+ realtime,
135
+ iceServers,
136
+ type RealtimeOptions,
137
+ LocalStorage,
138
+ S3Storage,
139
+ selectStorage,
140
+ storageKey,
141
+ type StorageBackend,
142
+ Workspace as RealtimeWorkspace,
143
+ Channel as RealtimeChannel,
144
+ ChannelMember as RealtimeChannelMember,
145
+ Message as RealtimeMessage,
146
+ Attachment as RealtimeAttachment,
147
+ } from "./realtime/index.js";
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync } from "node:fs";
2
10
  import { join, resolve } from "node:path";
3
11
  import { Log } from "../../core/src/index.js";
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  import { readdirSync, statSync } from "node:fs";
2
10
  import { join, extname } from "node:path";
3
11
  import type { ModelDefinition, FieldDefinition, RelationshipDefinition } from "./types.js";
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  /**
2
10
  * ModelCollection — a list of ORM models that also carries the query total.
3
11
  *
@@ -1,3 +1,11 @@
1
+ /*
2
+ Copyright (c) 2026 Code Infinity
3
+ SPDX-License-Identifier: MPL-2.0
4
+ This Source Code Form is subject to the terms of the Mozilla Public
5
+ License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ file, You can obtain one at https://mozilla.org/MPL/2.0/.
7
+ */
8
+
1
9
  export const DEFAULT_SRID = 4326;
2
10
 
3
11
  export class SpatialNotSupportedError extends Error {