@aurabase/aurabase-js 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/.changeset/config.json +11 -0
  2. package/CHANGELOG.md +30 -0
  3. package/LICENSE +21 -0
  4. package/README.md +833 -0
  5. package/package.json +90 -0
  6. package/packages/ai/LICENSE +21 -0
  7. package/packages/ai/README.md +106 -0
  8. package/packages/ai/dist/index.cjs +229 -0
  9. package/packages/ai/dist/index.d.cts +139 -0
  10. package/packages/ai/dist/index.d.ts +139 -0
  11. package/packages/ai/dist/index.js +226 -0
  12. package/packages/ai/node_modules/.bin/esbuild +19 -0
  13. package/packages/ai/node_modules/.bin/tsc +22 -0
  14. package/packages/ai/node_modules/.bin/tsserver +22 -0
  15. package/packages/ai/node_modules/.bin/tsup +22 -0
  16. package/packages/ai/node_modules/.bin/tsup-node +22 -0
  17. package/packages/ai/node_modules/.bin/vite +22 -0
  18. package/packages/ai/node_modules/.bin/vitest +22 -0
  19. package/packages/ai/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  20. package/packages/ai/package.json +61 -0
  21. package/packages/ai/src/AiService.ts +226 -0
  22. package/packages/ai/src/index.ts +18 -0
  23. package/packages/ai/src/sse.ts +141 -0
  24. package/packages/ai/src/types.ts +30 -0
  25. package/packages/ai/tests/chat-stream.test.ts +151 -0
  26. package/packages/ai/tests/rag-namespaces.test.ts +54 -0
  27. package/packages/ai/tests/sse.test.ts +69 -0
  28. package/packages/ai/tsconfig.json +5 -0
  29. package/packages/ai/tsup.config.ts +11 -0
  30. package/packages/aurabase/LICENSE +21 -0
  31. package/packages/aurabase/README.md +64 -0
  32. package/packages/aurabase/dist/AuraClient-DAtDbfPB.d.cts +77 -0
  33. package/packages/aurabase/dist/AuraClient-DAtDbfPB.d.ts +77 -0
  34. package/packages/aurabase/dist/index.cjs +237 -0
  35. package/packages/aurabase/dist/index.d.cts +46 -0
  36. package/packages/aurabase/dist/index.d.ts +46 -0
  37. package/packages/aurabase/dist/index.js +177 -0
  38. package/packages/aurabase/dist/ssr.cjs +224 -0
  39. package/packages/aurabase/dist/ssr.d.cts +65 -0
  40. package/packages/aurabase/dist/ssr.d.ts +65 -0
  41. package/packages/aurabase/dist/ssr.js +214 -0
  42. package/packages/aurabase/node_modules/.bin/esbuild +19 -0
  43. package/packages/aurabase/node_modules/.bin/tsc +22 -0
  44. package/packages/aurabase/node_modules/.bin/tsserver +22 -0
  45. package/packages/aurabase/node_modules/.bin/tsup +22 -0
  46. package/packages/aurabase/node_modules/.bin/tsup-node +22 -0
  47. package/packages/aurabase/node_modules/.bin/vite +22 -0
  48. package/packages/aurabase/node_modules/.bin/vitest +22 -0
  49. package/packages/aurabase/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  50. package/packages/aurabase/package.json +80 -0
  51. package/packages/aurabase/src/AuraClient.ts +237 -0
  52. package/packages/aurabase/src/index.ts +152 -0
  53. package/packages/aurabase/src/ssr.ts +156 -0
  54. package/packages/aurabase/tests/ai-streaming-rag-e2e.test.ts +82 -0
  55. package/packages/aurabase/tests/ai.test.ts +111 -0
  56. package/packages/aurabase/tests/auth-admin.test.ts +515 -0
  57. package/packages/aurabase/tests/auth-e2e.test.ts +135 -0
  58. package/packages/aurabase/tests/auth-hardening.test.ts +206 -0
  59. package/packages/aurabase/tests/auth.test.ts +947 -0
  60. package/packages/aurabase/tests/database.test.ts +230 -0
  61. package/packages/aurabase/tests/db-types-e2e.test.ts +217 -0
  62. package/packages/aurabase/tests/dispose.test.ts +23 -0
  63. package/packages/aurabase/tests/foreign-token.e2e.test.ts +129 -0
  64. package/packages/aurabase/tests/functions.test.ts +107 -0
  65. package/packages/aurabase/tests/integration.test.ts +413 -0
  66. package/packages/aurabase/tests/live-production-validation.js +241 -0
  67. package/packages/aurabase/tests/live-sdk-production-validation.js +293 -0
  68. package/packages/aurabase/tests/mocks.ts +139 -0
  69. package/packages/aurabase/tests/notifications.test.ts +314 -0
  70. package/packages/aurabase/tests/observability-backup.test.ts +186 -0
  71. package/packages/aurabase/tests/observability-hook.test.ts +130 -0
  72. package/packages/aurabase/tests/production-robustness.test.ts +268 -0
  73. package/packages/aurabase/tests/public-api-surface.test.ts +53 -0
  74. package/packages/aurabase/tests/query-builder.test.ts +329 -0
  75. package/packages/aurabase/tests/readme-smoke-e2e.test.ts +231 -0
  76. package/packages/aurabase/tests/realtime-filter-e2e.test.ts +344 -0
  77. package/packages/aurabase/tests/refresh-locks.test.ts +210 -0
  78. package/packages/aurabase/tests/retry-option.test.ts +17 -0
  79. package/packages/aurabase/tests/rpc-e2e.test.ts +254 -0
  80. package/packages/aurabase/tests/rs256-local-e2e.test.ts +114 -0
  81. package/packages/aurabase/tests/rt-alias-public-e2e.test.ts +235 -0
  82. package/packages/aurabase/tests/rt-http-broadcast-e2e.test.ts +124 -0
  83. package/packages/aurabase/tests/service-role-guard.test.ts +99 -0
  84. package/packages/aurabase/tests/ssr.test.ts +91 -0
  85. package/packages/aurabase/tests/storage-backend-e2e.test.ts +481 -0
  86. package/packages/aurabase/tests/storage-sdk-parity-e2e.test.ts +104 -0
  87. package/packages/aurabase/tests/storage-transform-e2e.test.ts +684 -0
  88. package/packages/aurabase/tests/storage.test.ts +55 -0
  89. package/packages/aurabase/tests/types/client-generic.test-d.ts +79 -0
  90. package/packages/aurabase/tests/types/docs-snippets.test-d.ts +571 -0
  91. package/packages/aurabase/tests/types/error-code.test-d.ts +53 -0
  92. package/packages/aurabase/tsconfig.json +5 -0
  93. package/packages/aurabase/tsconfig.test-d.json +5 -0
  94. package/packages/aurabase/tsup.config.ts +11 -0
  95. package/packages/aurabase/vitest.config.ts +16 -0
  96. package/packages/aurabase/vitest.e2e.config.ts +9 -0
  97. package/packages/auth/LICENSE +21 -0
  98. package/packages/auth/README.md +215 -0
  99. package/packages/auth/dist/index.cjs +1175 -0
  100. package/packages/auth/dist/index.d.cts +397 -0
  101. package/packages/auth/dist/index.d.ts +397 -0
  102. package/packages/auth/dist/index.js +1170 -0
  103. package/packages/auth/node_modules/.bin/esbuild +19 -0
  104. package/packages/auth/node_modules/.bin/tsc +22 -0
  105. package/packages/auth/node_modules/.bin/tsserver +22 -0
  106. package/packages/auth/node_modules/.bin/tsup +22 -0
  107. package/packages/auth/node_modules/.bin/tsup-node +22 -0
  108. package/packages/auth/node_modules/.bin/vite +22 -0
  109. package/packages/auth/node_modules/.bin/vitest +22 -0
  110. package/packages/auth/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  111. package/packages/auth/package.json +61 -0
  112. package/packages/auth/src/AuthAdminService.ts +149 -0
  113. package/packages/auth/src/AuthService.ts +1166 -0
  114. package/packages/auth/src/SessionManager.ts +92 -0
  115. package/packages/auth/src/index.ts +17 -0
  116. package/packages/auth/src/jwks.ts +337 -0
  117. package/packages/auth/src/pkce.ts +27 -0
  118. package/packages/auth/src/types.ts +89 -0
  119. package/packages/auth/tests/auth-lifecycle.test.ts +149 -0
  120. package/packages/auth/tests/detect-session.test.ts +361 -0
  121. package/packages/auth/tests/getclaims.test.ts +780 -0
  122. package/packages/auth/tests/is-mfa-challenge.test.ts +27 -0
  123. package/packages/auth/tests/password-recovery.test.ts +124 -0
  124. package/packages/auth/tests/pkce.test.ts +192 -0
  125. package/packages/auth/tests/session-manager.test.ts +103 -0
  126. package/packages/auth/tests/set-session.test.ts +139 -0
  127. package/packages/auth/tests/verify-otp.test.ts +153 -0
  128. package/packages/auth/tsconfig.json +5 -0
  129. package/packages/auth/tsup.config.ts +11 -0
  130. package/packages/core/LICENSE +21 -0
  131. package/packages/core/README.md +132 -0
  132. package/packages/core/dist/index.cjs +695 -0
  133. package/packages/core/dist/index.d.cts +1137 -0
  134. package/packages/core/dist/index.d.ts +1137 -0
  135. package/packages/core/dist/index.js +673 -0
  136. package/packages/core/node_modules/.bin/esbuild +22 -0
  137. package/packages/core/node_modules/.bin/tsc +22 -0
  138. package/packages/core/node_modules/.bin/tsserver +22 -0
  139. package/packages/core/node_modules/.bin/tsup +22 -0
  140. package/packages/core/node_modules/.bin/tsup-node +22 -0
  141. package/packages/core/node_modules/.bin/vite +22 -0
  142. package/packages/core/node_modules/.bin/vitest +22 -0
  143. package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  144. package/packages/core/package.json +57 -0
  145. package/packages/core/src/AuraError.ts +89 -0
  146. package/packages/core/src/BaseService.ts +44 -0
  147. package/packages/core/src/client.ts +34 -0
  148. package/packages/core/src/cookie-utils.ts +42 -0
  149. package/packages/core/src/fetch.ts +435 -0
  150. package/packages/core/src/index.ts +22 -0
  151. package/packages/core/src/retry.ts +63 -0
  152. package/packages/core/src/serialize.ts +6 -0
  153. package/packages/core/src/stores/BaseAuthStore.ts +164 -0
  154. package/packages/core/src/stores/LocalAuthStore.ts +199 -0
  155. package/packages/core/src/types.ts +1042 -0
  156. package/packages/core/tests/auth-store.test.ts +300 -0
  157. package/packages/core/tests/error-code.test.ts +61 -0
  158. package/packages/core/tests/error.test.ts +24 -0
  159. package/packages/core/tests/fetch.test.ts +286 -0
  160. package/packages/core/tests/mocks.ts +139 -0
  161. package/packages/core/tests/observability.test.ts +86 -0
  162. package/packages/core/tests/refresh-hardening.test.ts +164 -0
  163. package/packages/core/tests/refresh-observability.test.ts +111 -0
  164. package/packages/core/tests/retry.test.ts +106 -0
  165. package/packages/core/tests/serialize.test.ts +12 -0
  166. package/packages/core/tests/timeout.test.ts +79 -0
  167. package/packages/core/tsconfig.json +5 -0
  168. package/packages/core/tsup.config.ts +11 -0
  169. package/packages/db/LICENSE +21 -0
  170. package/packages/db/README.md +152 -0
  171. package/packages/db/VENDORED.md +93 -0
  172. package/packages/db/dist/index.cjs +544 -0
  173. package/packages/db/dist/index.d.cts +1111 -0
  174. package/packages/db/dist/index.d.ts +1111 -0
  175. package/packages/db/dist/index.js +541 -0
  176. package/packages/db/node_modules/.bin/esbuild +19 -0
  177. package/packages/db/node_modules/.bin/tsc +22 -0
  178. package/packages/db/node_modules/.bin/tsserver +22 -0
  179. package/packages/db/node_modules/.bin/tsup +22 -0
  180. package/packages/db/node_modules/.bin/tsup-node +22 -0
  181. package/packages/db/node_modules/.bin/vite +22 -0
  182. package/packages/db/node_modules/.bin/vitest +22 -0
  183. package/packages/db/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  184. package/packages/db/package.json +62 -0
  185. package/packages/db/src/DatabaseService.ts +170 -0
  186. package/packages/db/src/QueryBuilder.ts +830 -0
  187. package/packages/db/src/index.ts +2 -0
  188. package/packages/db/src/pgrst-types/common/common.ts +86 -0
  189. package/packages/db/src/pgrst-types/common/rpc.ts +151 -0
  190. package/packages/db/src/pgrst-types/feature-flags.ts +20 -0
  191. package/packages/db/src/pgrst-types/types.ts +134 -0
  192. package/packages/db/src/select-query-parser/parser.ts +479 -0
  193. package/packages/db/src/select-query-parser/result.ts +553 -0
  194. package/packages/db/src/select-query-parser/types.ts +132 -0
  195. package/packages/db/src/select-query-parser/utils.ts +707 -0
  196. package/packages/db/tests/filters.test.ts +81 -0
  197. package/packages/db/tests/mutations-filtered.e2e.test.ts +132 -0
  198. package/packages/db/tests/mutations-filtered.test.ts +188 -0
  199. package/packages/db/tests/order.test.ts +45 -0
  200. package/packages/db/tests/rpc.test.ts +41 -0
  201. package/packages/db/tests/scale/build-large-schema.ts +94 -0
  202. package/packages/db/tests/scale/scale-compile.test.ts +167 -0
  203. package/packages/db/tests/schema.test.ts +77 -0
  204. package/packages/db/tests/single-accept.e2e.test.ts +123 -0
  205. package/packages/db/tests/single.test.ts +211 -0
  206. package/packages/db/tests/types/filters.test-d.ts +52 -0
  207. package/packages/db/tests/types/fixtures.ts +40 -0
  208. package/packages/db/tests/types/from-views.test-d.ts +18 -0
  209. package/packages/db/tests/types/mutations.test-d.ts +23 -0
  210. package/packages/db/tests/types/rpc.test-d.ts +60 -0
  211. package/packages/db/tests/types/schema-shape.test-d.ts +8 -0
  212. package/packages/db/tests/types/select-inference.test-d.ts +38 -0
  213. package/packages/db/tests/vendored/fixtures.ts +83 -0
  214. package/packages/db/tests/vendored/get-result.test-d.ts +75 -0
  215. package/packages/db/tsconfig.json +5 -0
  216. package/packages/db/tsconfig.test-d.json +5 -0
  217. package/packages/db/tsup.config.ts +11 -0
  218. package/packages/db/vitest.config.ts +8 -0
  219. package/packages/functions/LICENSE +21 -0
  220. package/packages/functions/README.md +96 -0
  221. package/packages/functions/dist/index.cjs +173 -0
  222. package/packages/functions/dist/index.d.cts +81 -0
  223. package/packages/functions/dist/index.d.ts +81 -0
  224. package/packages/functions/dist/index.js +168 -0
  225. package/packages/functions/node_modules/.bin/esbuild +19 -0
  226. package/packages/functions/node_modules/.bin/tsc +22 -0
  227. package/packages/functions/node_modules/.bin/tsserver +22 -0
  228. package/packages/functions/node_modules/.bin/tsup +22 -0
  229. package/packages/functions/node_modules/.bin/tsup-node +22 -0
  230. package/packages/functions/node_modules/.bin/vite +22 -0
  231. package/packages/functions/node_modules/.bin/vitest +22 -0
  232. package/packages/functions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  233. package/packages/functions/package.json +60 -0
  234. package/packages/functions/src/FunctionsService.ts +188 -0
  235. package/packages/functions/src/errors.ts +70 -0
  236. package/packages/functions/src/index.ts +6 -0
  237. package/packages/functions/tests/invoke.test.ts +97 -0
  238. package/packages/functions/tests/response-type-errors.test.ts +135 -0
  239. package/packages/functions/tsconfig.json +5 -0
  240. package/packages/functions/tsup.config.ts +11 -0
  241. package/packages/gen/LICENSE +21 -0
  242. package/packages/gen/README.md +84 -0
  243. package/packages/gen/dist/cli.cjs +334 -0
  244. package/packages/gen/dist/cli.d.cts +1 -0
  245. package/packages/gen/dist/cli.d.ts +1 -0
  246. package/packages/gen/dist/cli.js +332 -0
  247. package/packages/gen/dist/index.cjs +257 -0
  248. package/packages/gen/dist/index.d.cts +12 -0
  249. package/packages/gen/dist/index.d.ts +12 -0
  250. package/packages/gen/dist/index.js +255 -0
  251. package/packages/gen/node_modules/.bin/esbuild +19 -0
  252. package/packages/gen/node_modules/.bin/tsc +22 -0
  253. package/packages/gen/node_modules/.bin/tsserver +22 -0
  254. package/packages/gen/node_modules/.bin/tsup +22 -0
  255. package/packages/gen/node_modules/.bin/tsup-node +22 -0
  256. package/packages/gen/node_modules/.bin/vite +22 -0
  257. package/packages/gen/node_modules/.bin/vitest +22 -0
  258. package/packages/gen/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  259. package/packages/gen/package.json +66 -0
  260. package/packages/gen/src/cli.ts +67 -0
  261. package/packages/gen/src/generate.ts +0 -0
  262. package/packages/gen/src/index.ts +2 -0
  263. package/packages/gen/tests/compile.test.ts +213 -0
  264. package/packages/gen/tests/e2e.test.ts +130 -0
  265. package/packages/gen/tests/generate.test.ts +396 -0
  266. package/packages/gen/tsconfig.json +5 -0
  267. package/packages/gen/tsup.config.ts +11 -0
  268. package/packages/notifications/LICENSE +21 -0
  269. package/packages/notifications/README.md +134 -0
  270. package/packages/notifications/dist/index.cjs +128 -0
  271. package/packages/notifications/dist/index.d.cts +81 -0
  272. package/packages/notifications/dist/index.d.ts +81 -0
  273. package/packages/notifications/dist/index.js +125 -0
  274. package/packages/notifications/node_modules/.bin/esbuild +19 -0
  275. package/packages/notifications/node_modules/.bin/tsc +22 -0
  276. package/packages/notifications/node_modules/.bin/tsserver +22 -0
  277. package/packages/notifications/node_modules/.bin/tsup +22 -0
  278. package/packages/notifications/node_modules/.bin/tsup-node +22 -0
  279. package/packages/notifications/node_modules/.bin/vite +22 -0
  280. package/packages/notifications/node_modules/.bin/vitest +22 -0
  281. package/packages/notifications/package.json +60 -0
  282. package/packages/notifications/src/NotificationsService.ts +230 -0
  283. package/packages/notifications/src/index.ts +19 -0
  284. package/packages/notifications/tsconfig.json +5 -0
  285. package/packages/notifications/tsup.config.ts +11 -0
  286. package/packages/realtime/LICENSE +21 -0
  287. package/packages/realtime/README.md +183 -0
  288. package/packages/realtime/dist/index.cjs +977 -0
  289. package/packages/realtime/dist/index.d.cts +259 -0
  290. package/packages/realtime/dist/index.d.ts +259 -0
  291. package/packages/realtime/dist/index.js +973 -0
  292. package/packages/realtime/node_modules/.bin/esbuild +19 -0
  293. package/packages/realtime/node_modules/.bin/tsc +22 -0
  294. package/packages/realtime/node_modules/.bin/tsserver +22 -0
  295. package/packages/realtime/node_modules/.bin/tsup +22 -0
  296. package/packages/realtime/node_modules/.bin/tsup-node +22 -0
  297. package/packages/realtime/node_modules/.bin/vite +22 -0
  298. package/packages/realtime/node_modules/.bin/vitest +22 -0
  299. package/packages/realtime/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  300. package/packages/realtime/package.json +60 -0
  301. package/packages/realtime/src/AuraChannel.ts +485 -0
  302. package/packages/realtime/src/HeartbeatManager.ts +73 -0
  303. package/packages/realtime/src/RealtimeService.ts +505 -0
  304. package/packages/realtime/src/columnFilter.ts +301 -0
  305. package/packages/realtime/src/index.ts +4 -0
  306. package/packages/realtime/tests/ack-routing.test.ts +81 -0
  307. package/packages/realtime/tests/column-filter.test.ts +144 -0
  308. package/packages/realtime/tests/dispatch.test.ts +191 -0
  309. package/packages/realtime/tests/heartbeat.test.ts +67 -0
  310. package/packages/realtime/tests/http-broadcast.test.ts +68 -0
  311. package/packages/realtime/tests/realtime-token.test.ts +43 -0
  312. package/packages/realtime/tests/reconnect-race.test.ts +149 -0
  313. package/packages/realtime/tests/ref-id.test.ts +34 -0
  314. package/packages/realtime/tests/set-auth.test.ts +70 -0
  315. package/packages/realtime/tsconfig.json +5 -0
  316. package/packages/realtime/tsup.config.ts +11 -0
  317. package/packages/storage/LICENSE +21 -0
  318. package/packages/storage/README.md +141 -0
  319. package/packages/storage/dist/index.cjs +333 -0
  320. package/packages/storage/dist/index.d.cts +185 -0
  321. package/packages/storage/dist/index.d.ts +185 -0
  322. package/packages/storage/dist/index.js +329 -0
  323. package/packages/storage/node_modules/.bin/esbuild +19 -0
  324. package/packages/storage/node_modules/.bin/tsc +22 -0
  325. package/packages/storage/node_modules/.bin/tsserver +22 -0
  326. package/packages/storage/node_modules/.bin/tsup +22 -0
  327. package/packages/storage/node_modules/.bin/tsup-node +22 -0
  328. package/packages/storage/node_modules/.bin/vite +22 -0
  329. package/packages/storage/node_modules/.bin/vitest +22 -0
  330. package/packages/storage/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  331. package/packages/storage/package.json +60 -0
  332. package/packages/storage/src/DownloadBuilder.ts +60 -0
  333. package/packages/storage/src/StorageService.ts +323 -0
  334. package/packages/storage/src/index.ts +2 -0
  335. package/packages/storage/src/path.ts +35 -0
  336. package/packages/storage/src/transform.ts +15 -0
  337. package/packages/storage/tests/download.test.ts +64 -0
  338. package/packages/storage/tests/parity.test.ts +154 -0
  339. package/packages/storage/tests/path.test.ts +87 -0
  340. package/packages/storage/tests/transform.test.ts +79 -0
  341. package/packages/storage/tsconfig.json +5 -0
  342. package/packages/storage/tsup.config.ts +11 -0
  343. package/pnpm-workspace.yaml +24 -0
  344. package/tsconfig.base.json +15 -0
@@ -0,0 +1,541 @@
1
+ import { BaseService, fetchWithAuth, AuraError } from '@aurabase/core';
2
+
3
+ // src/DatabaseService.ts
4
+ function quoteReserved(v) {
5
+ const s = String(v);
6
+ return /[,()"]/.test(s) ? `"${s.replace(/"/g, '""')}"` : s;
7
+ }
8
+ function encodeFilterValue(op, value) {
9
+ if (op === "in" || op === "not.in") {
10
+ const arr = Array.isArray(value) ? value : [value];
11
+ return `${op}.(${arr.map(quoteReserved).join(",")})`;
12
+ }
13
+ if (op === "cs" || op === "cd" || op === "ov") {
14
+ if (Array.isArray(value)) return `${op}.{${value.map(quoteReserved).join(",")}}`;
15
+ if (value !== null && typeof value === "object") return `${op}.${JSON.stringify(value)}`;
16
+ return `${op}.${value}`;
17
+ }
18
+ if (op.endsWith("(all)") || op.endsWith("(any)")) {
19
+ const arr = Array.isArray(value) ? value : [value];
20
+ return `${op}.{${arr.map(quoteReserved).join(",")}}`;
21
+ }
22
+ return `${op}.${value}`;
23
+ }
24
+ var PGRST_OBJECT_ACCEPT = "application/vnd.pgrst.object+json";
25
+ function mentionsZeroRows(err) {
26
+ if (!err) return false;
27
+ const details = typeof err.details === "string" ? err.details : JSON.stringify(err.details ?? "");
28
+ return /\b0 rows\b/.test(`${err.message ?? ""} ${details}`);
29
+ }
30
+ function pgrst116(zeroRows) {
31
+ return new AuraError(406, {
32
+ error: {
33
+ code: "PGRST116",
34
+ message: zeroRows ? "JSON object requested, 0 rows returned" : "JSON object requested, multiple rows returned"
35
+ }
36
+ });
37
+ }
38
+ var AuraPostgrestBuilder = class {
39
+ _client;
40
+ _basePath;
41
+ _filters = [];
42
+ _orGroups = [];
43
+ _selectColumns = null;
44
+ // `select()` a-t-il été appelé ? (distinct de `_selectColumns`, que `select('*')`
45
+ // remet à `null`) — sert à poser `Prefer: return=representation` sur une mutation
46
+ // même avec `select('*')`.
47
+ _selectInvoked = false;
48
+ _sortColumn = null;
49
+ _sortDirection = "asc";
50
+ _limit = null;
51
+ _offset = null;
52
+ _cursor = null;
53
+ _count = null;
54
+ _rawSelect = false;
55
+ _single = false;
56
+ _maybeSingle = false;
57
+ _throwOnError = false;
58
+ _mutation = null;
59
+ _rpc = null;
60
+ constructor(client, basePath) {
61
+ this._client = client;
62
+ this._basePath = basePath;
63
+ }
64
+ throwOnError() {
65
+ this._throwOnError = true;
66
+ return this;
67
+ }
68
+ /**
69
+ * Positionne l'état interne `rpc` (args + verbe HTTP) — méthode package-interne
70
+ * utilisée par `DatabaseService.rpc()` pour éviter un cast sur un champ `protected`.
71
+ *
72
+ * `count` accepte `'planned'` (parité stricte `RpcOptions`, cf. `DatabaseService.rpc`)
73
+ * en plus de `CountMode` (`@aurabase/core`, qui ne connaît que `exact`/`estimated` —
74
+ * package partagé, non modifié ici). Le cast vers `_count` reste sans risque runtime :
75
+ * `buildQueryString` sérialise la valeur telle quelle en query param `count=`.
76
+ */
77
+ _initRpc(args, verb, count) {
78
+ this._rpc = { args, verb };
79
+ if (count) this._count = count;
80
+ return this;
81
+ }
82
+ // -- Query string builder ---------------------------------------------------
83
+ buildQueryString() {
84
+ const params = new URLSearchParams();
85
+ if (this._selectColumns && this._selectColumns.length > 0) {
86
+ params.set("select", this._rawSelect ? this._selectColumns[0] : this._selectColumns.join(","));
87
+ }
88
+ for (const f of this._filters) {
89
+ params.append(f.column, encodeFilterValue(f.op, f.value));
90
+ }
91
+ for (const group of this._orGroups) {
92
+ const parts = group.filters.map((f) => `${f.column}.${encodeFilterValue(f.op, f.value)}`);
93
+ params.append("or", `(${parts.join(",")})`);
94
+ }
95
+ if (this._sortColumn) {
96
+ params.set("sort_by", this._sortColumn);
97
+ params.set("sort_order", this._sortDirection);
98
+ }
99
+ if (this._limit !== null) params.set("limit", String(this._limit));
100
+ if (this._offset !== null) params.set("offset", String(this._offset));
101
+ if (this._cursor !== null) params.set("cursor", this._cursor);
102
+ if (this._count) params.set("count", this._count);
103
+ if (this._rpc && (this._rpc.verb === "GET" || this._rpc.verb === "HEAD") && this._rpc.args && typeof this._rpc.args === "object") {
104
+ for (const [k, v] of Object.entries(this._rpc.args)) {
105
+ params.set(k, typeof v === "string" ? v : JSON.stringify(v));
106
+ }
107
+ }
108
+ return params.toString();
109
+ }
110
+ // -- Execution via PromiseLike ----------------------------------------------
111
+ then(onfulfilled, onrejected) {
112
+ return this._execute().then(onfulfilled, onrejected);
113
+ }
114
+ async _execute() {
115
+ let res;
116
+ const acceptSingle = this._single ? { Accept: PGRST_OBJECT_ACCEPT } : void 0;
117
+ if (this._rpc) {
118
+ const qs = this.buildQueryString();
119
+ const sep = qs ? "?" : "";
120
+ const url = `${this._client.baseUrl}${this._basePath}${sep}${qs}`;
121
+ const init = this._rpc.verb === "POST" ? { method: "POST", body: this._rpc.args, headers: acceptSingle } : { method: this._rpc.verb, headers: acceptSingle };
122
+ res = await fetchWithAuth(url, init, this._client);
123
+ } else if (this._mutation) {
124
+ const m = this._mutation;
125
+ const hasEffectiveFilter = this._filters.some((f) => f.column !== "") || this._orGroups.some((g) => g.filters.length > 0);
126
+ if ((m.type === "update" || m.type === "delete") && m.id === null && !hasEffectiveFilter) {
127
+ return {
128
+ data: null,
129
+ error: new AuraError(0, {
130
+ error: {
131
+ code: "unfiltered_mutation",
132
+ message: "update()/delete() sans filtre refus\xE9 (protection anti-wipe) \u2014 ajoutez un filtre .eq()/... ou utilisez une mutation id-based"
133
+ }
134
+ })
135
+ };
136
+ }
137
+ const prefer = [];
138
+ if (this._selectInvoked) prefer.push("return=representation");
139
+ if (this._count) prefer.push(`count=${this._count}`);
140
+ const merged = { ...acceptSingle };
141
+ if (prefer.length > 0) merged.Prefer = prefer.join(", ");
142
+ const headers = Object.keys(merged).length > 0 ? merged : void 0;
143
+ const qs = this.buildQueryString();
144
+ const sep = qs ? "?" : "";
145
+ switch (m.type) {
146
+ case "insert": {
147
+ res = await fetchWithAuth(
148
+ `${this._client.baseUrl}${this._basePath}${sep}${qs}`,
149
+ { method: "POST", body: m.body, headers },
150
+ this._client
151
+ );
152
+ break;
153
+ }
154
+ case "update": {
155
+ const path = m.id !== null ? `${this._basePath}/${m.id}` : this._basePath;
156
+ res = await fetchWithAuth(
157
+ `${this._client.baseUrl}${path}${sep}${qs}`,
158
+ { method: "PATCH", body: m.body, headers },
159
+ this._client
160
+ );
161
+ break;
162
+ }
163
+ case "delete": {
164
+ const path = m.id !== null ? `${this._basePath}/${m.id}` : this._basePath;
165
+ res = await fetchWithAuth(
166
+ `${this._client.baseUrl}${path}${sep}${qs}`,
167
+ { method: "DELETE", headers },
168
+ this._client
169
+ );
170
+ break;
171
+ }
172
+ case "upsert": {
173
+ const params = new URLSearchParams(qs);
174
+ params.set("on_conflict", m.onConflict);
175
+ res = await fetchWithAuth(
176
+ `${this._client.baseUrl}${this._basePath}?${params.toString()}`,
177
+ { method: "POST", body: m.body, headers },
178
+ this._client
179
+ );
180
+ break;
181
+ }
182
+ }
183
+ } else {
184
+ const qs = this.buildQueryString();
185
+ const sep = qs ? "?" : "";
186
+ res = await fetchWithAuth(
187
+ `${this._client.baseUrl}${this._basePath}${sep}${qs}`,
188
+ { method: "GET", headers: acceptSingle },
189
+ this._client
190
+ );
191
+ }
192
+ if (!this._single && (this._mutation?.type === "insert" || this._mutation?.type === "upsert") && res.data !== null && typeof res.data === "object" && !Array.isArray(res.data)) {
193
+ res = { ...res, data: [res.data] };
194
+ }
195
+ if (this._single) {
196
+ if (res.error) {
197
+ const zero = res.error.status === 406 ? mentionsZeroRows(res.error) : res.error.status === 404 && res.error.code === "RECORD_NOT_FOUND" ? true : null;
198
+ if (zero !== null) {
199
+ res = this._maybeSingle && zero ? { ...res, data: null, error: null } : { ...res, data: null, error: pgrst116(zero) };
200
+ }
201
+ } else if (Array.isArray(res.data)) {
202
+ const rows = res.data;
203
+ if (this._maybeSingle) {
204
+ res = rows.length > 1 ? { ...res, data: null, error: pgrst116(false) } : { ...res, data: rows[0] ?? null };
205
+ } else if (rows.length === 1) {
206
+ res = { ...res, data: rows[0] };
207
+ } else {
208
+ res = { ...res, data: null, error: pgrst116(rows.length === 0) };
209
+ }
210
+ }
211
+ }
212
+ if (this._throwOnError && res.error) {
213
+ const err = new Error(res.error.message);
214
+ err.code = res.error.code;
215
+ err.details = res.error.details;
216
+ throw err;
217
+ }
218
+ return res;
219
+ }
220
+ };
221
+ var AuraTransformBuilder = class extends AuraPostgrestBuilder {
222
+ // -- Column selection & resource embedding -----------------------------------
223
+ /**
224
+ * Select columns and optionally embed related resources (PostgREST parity).
225
+ *
226
+ * @example
227
+ * // Simple columns
228
+ * db.from('users').select('id, name, email')
229
+ *
230
+ * // All columns (default)
231
+ * db.from('users').select('*')
232
+ *
233
+ * // Embed related table (many-to-one)
234
+ * db.from('orders').select('*, customer:customers(name, email)')
235
+ *
236
+ * // Embed related table (one-to-many)
237
+ * db.from('directors').select('last_name, films(title, year)')
238
+ *
239
+ * // FK disambiguation
240
+ * db.from('orders').select('*, billing:addresses!billing_address_id(name)')
241
+ *
242
+ * // Nested embedding
243
+ * db.from('actors').select('first_name, roles(character, films(title))')
244
+ */
245
+ select(columns) {
246
+ this._selectInvoked = true;
247
+ const cols = columns;
248
+ if (cols === void 0 || cols === "*") {
249
+ this._selectColumns = null;
250
+ this._rawSelect = false;
251
+ } else if (typeof cols === "string") {
252
+ if (cols.includes("(")) {
253
+ this._selectColumns = [cols];
254
+ this._rawSelect = true;
255
+ } else {
256
+ this._selectColumns = cols.split(",").map((c) => c.trim());
257
+ this._rawSelect = false;
258
+ }
259
+ } else {
260
+ this._selectColumns = cols;
261
+ this._rawSelect = false;
262
+ }
263
+ return this;
264
+ }
265
+ // -- Sort / pagination ------------------------------------------------------
266
+ order(column, direction = "asc") {
267
+ this._sortColumn = column;
268
+ this._sortDirection = direction;
269
+ return this;
270
+ }
271
+ limit(n) {
272
+ this._limit = n;
273
+ return this;
274
+ }
275
+ offset(n) {
276
+ this._offset = n;
277
+ return this;
278
+ }
279
+ /**
280
+ * Pagination keyset : passer le `next_cursor` opaque de la page précédente (préférable à
281
+ * `offset` sur les grandes tables : stable, sans dup/skip). Renvoyer tel quel `meta.next_cursor` ;
282
+ * ne pas le construire/parser (format opaque).
283
+ */
284
+ cursor(cursor) {
285
+ this._cursor = cursor;
286
+ return this;
287
+ }
288
+ count(mode = "exact") {
289
+ this._count = mode;
290
+ return this;
291
+ }
292
+ // -- Modifiers --------------------------------------------------------------
293
+ single() {
294
+ this._single = true;
295
+ return this;
296
+ }
297
+ maybeSingle() {
298
+ this._single = true;
299
+ this._maybeSingle = true;
300
+ return this;
301
+ }
302
+ };
303
+ var AuraFilterBuilder = class extends AuraTransformBuilder {
304
+ // -- Filter methods (each returns this for chaining) ------------------------
305
+ //
306
+ // Typées sur `Row` : `column` est contraint à `keyof Row & string` (autocomplete +
307
+ // erreur de compilation sur colonne inconnue) et `value`/`values` à `Row[C]` (erreur
308
+ // sur mauvais type). Runtime inchangé — seules les signatures changent.
309
+ eq(column, value) {
310
+ this._filters.push({ column, op: "eq", value });
311
+ return this;
312
+ }
313
+ neq(column, value) {
314
+ this._filters.push({ column, op: "neq", value });
315
+ return this;
316
+ }
317
+ gt(column, value) {
318
+ this._filters.push({ column, op: "gt", value });
319
+ return this;
320
+ }
321
+ gte(column, value) {
322
+ this._filters.push({ column, op: "gte", value });
323
+ return this;
324
+ }
325
+ lt(column, value) {
326
+ this._filters.push({ column, op: "lt", value });
327
+ return this;
328
+ }
329
+ lte(column, value) {
330
+ this._filters.push({ column, op: "lte", value });
331
+ return this;
332
+ }
333
+ like(column, pattern) {
334
+ this._filters.push({ column, op: "like", value: pattern });
335
+ return this;
336
+ }
337
+ ilike(column, pattern) {
338
+ this._filters.push({ column, op: "ilike", value: pattern });
339
+ return this;
340
+ }
341
+ /**
342
+ * IS NULL or IS NOT NULL filter.
343
+ * PostgREST accepts: is.null, is.true, is.false (no "not_null" — use neq for that).
344
+ * For IS NOT NULL, use `neq(column, null)` or `is(column, 'not.null')`.
345
+ */
346
+ is(column, value) {
347
+ if (value === "not.null") {
348
+ this._filters.push({ column, op: "not.is", value: "null" });
349
+ } else {
350
+ this._filters.push({ column, op: "is", value });
351
+ }
352
+ return this;
353
+ }
354
+ in(column, values) {
355
+ this._filters.push({ column, op: "in", value: values });
356
+ return this;
357
+ }
358
+ /**
359
+ * Add an OR group: `or=(col1.eq.val1,col2.gt.val2)`
360
+ */
361
+ or(filters) {
362
+ this._orGroups.push({
363
+ filters: filters.map((f) => ({ column: f.column, op: f.op, value: f.value }))
364
+ });
365
+ return this;
366
+ }
367
+ // -- Filtres étendus (parité PostgREST) -------------------------------------
368
+ notIn(column, values) {
369
+ this._filters.push({ column, op: "not.in", value: values });
370
+ return this;
371
+ }
372
+ contains(column, value) {
373
+ this._filters.push({ column, op: "cs", value });
374
+ return this;
375
+ }
376
+ containedBy(column, value) {
377
+ this._filters.push({ column, op: "cd", value });
378
+ return this;
379
+ }
380
+ overlaps(column, value) {
381
+ this._filters.push({ column, op: "ov", value });
382
+ return this;
383
+ }
384
+ rangeGt(column, range) {
385
+ this._filters.push({ column, op: "sr", value: range });
386
+ return this;
387
+ }
388
+ rangeGte(column, range) {
389
+ this._filters.push({ column, op: "nxl", value: range });
390
+ return this;
391
+ }
392
+ rangeLt(column, range) {
393
+ this._filters.push({ column, op: "sl", value: range });
394
+ return this;
395
+ }
396
+ rangeLte(column, range) {
397
+ this._filters.push({ column, op: "nxr", value: range });
398
+ return this;
399
+ }
400
+ rangeAdjacent(column, range) {
401
+ this._filters.push({ column, op: "adj", value: range });
402
+ return this;
403
+ }
404
+ isDistinct(column, value) {
405
+ this._filters.push({ column, op: "isdistinct", value });
406
+ return this;
407
+ }
408
+ // Échappatoires (parité postgrest-js) : colonne `string` permissive, pas de contrainte sur `Row`.
409
+ not(column, op, value) {
410
+ this._filters.push({ column, op: `not.${op}`, value });
411
+ return this;
412
+ }
413
+ filter(column, op, value) {
414
+ this._filters.push({ column, op, value });
415
+ return this;
416
+ }
417
+ match(query) {
418
+ for (const [column, value] of Object.entries(query)) this._filters.push({ column, op: "eq", value });
419
+ return this;
420
+ }
421
+ textSearch(column, query, options) {
422
+ const t = options?.type;
423
+ const token = t === "plain" ? "plfts" : t === "phrase" ? "phfts" : t === "websearch" ? "wfts" : "fts";
424
+ const op = options?.config ? `${token}(${options.config})` : token;
425
+ this._filters.push({ column, op, value: query });
426
+ return this;
427
+ }
428
+ likeAllOf(column, patterns) {
429
+ this._filters.push({ column, op: "like(all)", value: patterns });
430
+ return this;
431
+ }
432
+ likeAnyOf(column, patterns) {
433
+ this._filters.push({ column, op: "like(any)", value: patterns });
434
+ return this;
435
+ }
436
+ ilikeAllOf(column, patterns) {
437
+ this._filters.push({ column, op: "ilike(all)", value: patterns });
438
+ return this;
439
+ }
440
+ ilikeAnyOf(column, patterns) {
441
+ this._filters.push({ column, op: "ilike(any)", value: patterns });
442
+ return this;
443
+ }
444
+ };
445
+ var AuraQueryBuilder = class extends AuraFilterBuilder {
446
+ // -- Mutations --------------------------------------------------------------
447
+ //
448
+ // Typées sur `Relation['Insert']`/`Relation['Update']` (parité postgrest-js) :
449
+ // un champ requis manquant côté insert/upsert, ou une colonne inconnue côté
450
+ // update, est une erreur de compilation. Runtime inchangé.
451
+ //
452
+ // Extraction par type conditionnel (plutôt qu'un accès indexé direct
453
+ // `Relation['Insert']`) : `Relation` est contraint à `GenericTable | GenericView`
454
+ // et `GenericNonUpdatableView` ne porte pas `Insert`/`Update`. `infer` distribue
455
+ // sur cette union et retombe sur `never` pour la branche non-updatable, ce qui
456
+ // évite l'erreur TS2536 tout en gardant le typage strict pour les tables.
457
+ insert(body) {
458
+ this._mutation = { type: "insert", body };
459
+ return this;
460
+ }
461
+ update(idOrBody, body) {
462
+ if (typeof idOrBody === "string") {
463
+ this._mutation = { type: "update", id: idOrBody, body };
464
+ } else {
465
+ this._mutation = { type: "update", id: null, body: idOrBody };
466
+ }
467
+ return this;
468
+ }
469
+ // COMPAT `delete(id)` → route id-based ; FILTRÉ `delete()` → route Table
470
+ // (exige un filtre, garde-fou anti-wipe).
471
+ delete(id) {
472
+ this._mutation = { type: "delete", id: typeof id === "string" ? id : null };
473
+ return this;
474
+ }
475
+ upsert(body, options) {
476
+ this._mutation = { type: "upsert", body, onConflict: options?.onConflict ?? "id" };
477
+ return this;
478
+ }
479
+ };
480
+
481
+ // src/DatabaseService.ts
482
+ var DatabaseService = class extends BaseService {
483
+ constructor(client) {
484
+ super(client);
485
+ }
486
+ get prefix() {
487
+ return `/v1/db/${this.client.projectId}`;
488
+ }
489
+ from(table) {
490
+ return new AuraQueryBuilder(this.client, `${this.prefix}/${table}`);
491
+ }
492
+ /**
493
+ * Exécute une requête SQL brute (passthrough direct vers Postgres).
494
+ *
495
+ * ⚠️ N'est PAS en lecture seule : SELECT, INSERT, UPDATE, DELETE et DDL
496
+ * s'exécutent réellement et persistent, dans la limite des GRANTs du rôle
497
+ * Postgres connecté pour ce projet (seule barrière de sécurité — il n'y a
498
+ * aucun filtre applicatif par type d'instruction côté serveur). Ne pas
499
+ * exposer cet endpoint sans restriction à des clients non fiables.
500
+ */
501
+ async sql(query, params) {
502
+ return this.request("POST", `${this.prefix}/raw`, { query, params });
503
+ }
504
+ /**
505
+ * Appelle une fonction Postgres exposée par PostgREST (`POST|GET|HEAD /rpc/{fn}`).
506
+ * Signature forte quand `Schema['Functions']` connaît `fn` (typage vendoré
507
+ * `GetRpcFunctionFilterBuilderByArgs`, parité postgrest-js) ; sinon repli permissif.
508
+ *
509
+ * @example
510
+ * const { data } = await db.rpc('add', { a: 1, b: 2 })
511
+ * const { data } = await db.rpc('list_things', {}).eq('id', 2).select('id,name').single()
512
+ */
513
+ rpc(fn, args, options) {
514
+ const verb = options?.head ? "HEAD" : options?.get ? "GET" : "POST";
515
+ const builder = new AuraFilterBuilder(
516
+ this.client,
517
+ `${this.prefix}/rpc/${fn}`
518
+ )._initRpc(args ?? {}, verb, options?.count);
519
+ return builder;
520
+ }
521
+ /**
522
+ * Fetch the schema (tables & colonnes, fonctions Postgres exposées via PostgREST,
523
+ * types enum et vues) pour le projet courant.
524
+ */
525
+ async schema() {
526
+ const res = await this.request("GET", `${this.prefix}/schema`);
527
+ if (res.error) return { data: null, error: res.error, meta: res.meta };
528
+ return {
529
+ data: {
530
+ tables: res.data?.tables ?? [],
531
+ functions: res.data?.functions ?? [],
532
+ enums: res.data?.enums ?? [],
533
+ views: res.data?.views ?? []
534
+ },
535
+ error: null,
536
+ meta: res.meta
537
+ };
538
+ }
539
+ };
540
+
541
+ export { DatabaseService, AuraQueryBuilder as QueryBuilder };
@@ -0,0 +1,19 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ "$basedir/../../../../node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/bin/esbuild" "$@"
18
+ exit $?
19
+ # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/esbuild@0.27.7/node_modules/esbuild/bin/esbuild
@@ -0,0 +1,22 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsc" "$@"
21
+ fi
22
+ # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/db/node_modules/typescript/bin/tsc
@@ -0,0 +1,22 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
19
+ else
20
+ exec node "$basedir/../typescript/bin/tsserver" "$@"
21
+ fi
22
+ # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/db/node_modules/typescript/bin/tsserver
@@ -0,0 +1,22 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../tsup/dist/cli-default.js" "$@"
19
+ else
20
+ exec node "$basedir/../tsup/dist/cli-default.js" "$@"
21
+ fi
22
+ # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/db/node_modules/tsup/dist/cli-default.js
@@ -0,0 +1,22 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules/tsup/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/tsup@8.5.1_postcss@8.5.16_typescript@5.9.3/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../tsup/dist/cli-node.js" "$@"
19
+ else
20
+ exec node "$basedir/../tsup/dist/cli-node.js" "$@"
21
+ fi
22
+ # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/packages/db/node_modules/tsup/dist/cli-node.js
@@ -0,0 +1,22 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -z "$NODE_PATH" ]; then
13
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules"
14
+ else
15
+ export NODE_PATH="/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules:/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/node_modules:$NODE_PATH"
16
+ fi
17
+ if [ -x "$basedir/node" ]; then
18
+ exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js" "$@"
19
+ else
20
+ exec node "$basedir/../../../../node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js" "$@"
21
+ fi
22
+ # cmd-shim-target=/Users/affanedaylami/aurabase/aurabase-js/node_modules/.pnpm/vite@8.1.3_@types+node@20.14.15_esbuild@0.27.7/node_modules/vite/bin/vite.js