@heybejs/core 0.0.0-stage → 1.2.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 (173) hide show
  1. package/LICENSE +21 -0
  2. package/THIRD_PARTY_NOTICES.md +97 -0
  3. package/package.json +46 -3
  4. package/src/app.ts +560 -0
  5. package/src/auth/alerts.ts +90 -0
  6. package/src/auth/apple.ts +113 -0
  7. package/src/auth/flows.ts +162 -0
  8. package/src/auth/jwt.ts +79 -0
  9. package/src/auth/mfa.ts +123 -0
  10. package/src/auth/oauth2/flow.ts +1021 -0
  11. package/src/auth/oauth2/http.ts +139 -0
  12. package/src/auth/oauth2/jwk.ts +156 -0
  13. package/src/auth/oauth2/mappers.ts +615 -0
  14. package/src/auth/oauth2/providers.ts +376 -0
  15. package/src/auth/otp.ts +91 -0
  16. package/src/auth/password.ts +10 -0
  17. package/src/auth/tokens.ts +117 -0
  18. package/src/backups/auto.ts +80 -0
  19. package/src/backups/create.ts +180 -0
  20. package/src/backups/restore.ts +197 -0
  21. package/src/backups/vacuum-worker.ts +21 -0
  22. package/src/backups/zip.ts +442 -0
  23. package/src/binary/checkpoint-worker.ts +3 -0
  24. package/src/binary/embedded.ts +5 -0
  25. package/src/binary/entry.ts +33 -0
  26. package/src/binary/log-worker.ts +3 -0
  27. package/src/binary/sharp-native.ts +69 -0
  28. package/src/binary/vacuum-worker.ts +3 -0
  29. package/src/checkpoint-worker.ts +45 -0
  30. package/src/cli.ts +4 -0
  31. package/src/collections/auth-options.ts +263 -0
  32. package/src/collections/codec.ts +64 -0
  33. package/src/collections/ddl.ts +263 -0
  34. package/src/collections/errors.ts +96 -0
  35. package/src/collections/field-settings.ts +561 -0
  36. package/src/collections/import.ts +9 -0
  37. package/src/collections/model.ts +61 -0
  38. package/src/collections/scaffold.ts +306 -0
  39. package/src/collections/store.ts +1092 -0
  40. package/src/collections/view.ts +516 -0
  41. package/src/commands/args.ts +21 -0
  42. package/src/commands/help.ts +215 -0
  43. package/src/commands/import.ts +37 -0
  44. package/src/commands/migrate.ts +127 -0
  45. package/src/commands/serve.ts +179 -0
  46. package/src/commands/superuser.ts +208 -0
  47. package/src/commands/typegen.ts +26 -0
  48. package/src/cron/schedule.ts +165 -0
  49. package/src/cron/scheduler.ts +131 -0
  50. package/src/cron/system.ts +88 -0
  51. package/src/db.ts +530 -0
  52. package/src/extend/cron.ts +9 -0
  53. package/src/extend/hooks-dir.ts +32 -0
  54. package/src/extend/record-hooks.ts +130 -0
  55. package/src/extend/route.ts +9 -0
  56. package/src/fields/autodate.ts +11 -0
  57. package/src/fields/bool.ts +21 -0
  58. package/src/fields/date.ts +71 -0
  59. package/src/fields/editor.ts +32 -0
  60. package/src/fields/email.ts +47 -0
  61. package/src/fields/file.ts +146 -0
  62. package/src/fields/geo-point.ts +55 -0
  63. package/src/fields/index.ts +37 -0
  64. package/src/fields/json.ts +46 -0
  65. package/src/fields/number.ts +52 -0
  66. package/src/fields/password.ts +69 -0
  67. package/src/fields/relation.ts +55 -0
  68. package/src/fields/select.ts +38 -0
  69. package/src/fields/shared.ts +126 -0
  70. package/src/fields/text.ts +145 -0
  71. package/src/fields/url.ts +50 -0
  72. package/src/files/fixtures/a.gif +0 -0
  73. package/src/files/fixtures/a.jpg +0 -0
  74. package/src/files/fixtures/a.json +1 -0
  75. package/src/files/fixtures/a.pdf +7 -0
  76. package/src/files/fixtures/a.png +0 -0
  77. package/src/files/fixtures/a.svg +1 -0
  78. package/src/files/fixtures/a.txt +1 -0
  79. package/src/files/fixtures/a.webp +0 -0
  80. package/src/files/fixtures/a.zip +0 -0
  81. package/src/files/fixtures/prolog.svg +2 -0
  82. package/src/files/markup.ts +241 -0
  83. package/src/files/mime.ts +260 -0
  84. package/src/files/name.ts +55 -0
  85. package/src/files/s3.ts +212 -0
  86. package/src/files/storage.ts +235 -0
  87. package/src/files/test-s3.ts +238 -0
  88. package/src/files/thumbs.ts +151 -0
  89. package/src/filter/compile.ts +502 -0
  90. package/src/filter/fexpr.ts +504 -0
  91. package/src/filter/macros.ts +50 -0
  92. package/src/filter/parse.ts +215 -0
  93. package/src/filter/resolve.ts +747 -0
  94. package/src/filter/simple.ts +123 -0
  95. package/src/hooks/events.ts +271 -0
  96. package/src/hooks/hook.ts +92 -0
  97. package/src/hooks/registry.ts +248 -0
  98. package/src/hooks/system.ts +382 -0
  99. package/src/http/autocert.ts +177 -0
  100. package/src/http/errors.ts +130 -0
  101. package/src/http/form-bind.ts +142 -0
  102. package/src/http/list-query.ts +45 -0
  103. package/src/http/middlewares.ts +366 -0
  104. package/src/http/multipart.ts +578 -0
  105. package/src/http/rate-limit.ts +170 -0
  106. package/src/http/router.ts +836 -0
  107. package/src/http/routes/backups.ts +200 -0
  108. package/src/http/routes/batch.ts +506 -0
  109. package/src/http/routes/collections.ts +578 -0
  110. package/src/http/routes/crons.ts +33 -0
  111. package/src/http/routes/files.ts +634 -0
  112. package/src/http/routes/health.ts +23 -0
  113. package/src/http/routes/installer.ts +58 -0
  114. package/src/http/routes/logs.ts +123 -0
  115. package/src/http/routes/realtime.ts +210 -0
  116. package/src/http/routes/record-auth-flows.ts +669 -0
  117. package/src/http/routes/record-auth-oauth2.ts +195 -0
  118. package/src/http/routes/record-auth.ts +424 -0
  119. package/src/http/routes/records.ts +816 -0
  120. package/src/http/routes/settings.ts +371 -0
  121. package/src/http/routes/sql.ts +224 -0
  122. package/src/http/server.ts +236 -0
  123. package/src/http/static.ts +228 -0
  124. package/src/import/decrypt.ts +21 -0
  125. package/src/import/pocketbase.ts +231 -0
  126. package/src/index.ts +76 -0
  127. package/src/ip.ts +26 -0
  128. package/src/logs/aux-db.ts +26 -0
  129. package/src/logs/log-worker.ts +50 -0
  130. package/src/logs/logger.ts +339 -0
  131. package/src/mail/html2text.ts +85 -0
  132. package/src/mail/mailer.ts +233 -0
  133. package/src/mail/system-alert.ts +119 -0
  134. package/src/mail/templates.ts +190 -0
  135. package/src/migrations/automigrate.ts +246 -0
  136. package/src/migrations/loader.ts +46 -0
  137. package/src/migrations/migration.ts +30 -0
  138. package/src/migrations/runner.ts +158 -0
  139. package/src/realtime/broadcast.ts +305 -0
  140. package/src/realtime/broker.ts +153 -0
  141. package/src/records/excerpt.ts +215 -0
  142. package/src/records/expand.ts +350 -0
  143. package/src/records/internal.ts +51 -0
  144. package/src/records/model.ts +129 -0
  145. package/src/records/pattern.ts +145 -0
  146. package/src/records/read.ts +50 -0
  147. package/src/records/rules.ts +156 -0
  148. package/src/records/serialize.ts +139 -0
  149. package/src/records/service.ts +974 -0
  150. package/src/settings.ts +644 -0
  151. package/src/test-app.ts +28 -0
  152. package/src/test-clock.ts +37 -0
  153. package/src/test-db.ts +15 -0
  154. package/src/timers.ts +10 -0
  155. package/src/tokenizer.ts +84 -0
  156. package/src/typegen.ts +79 -0
  157. package/src/util.ts +60 -0
  158. package/ui/dist/assets/Popover-BKknruJI.js +34 -0
  159. package/ui/dist/assets/RichTextEditor-1oGZgu61.js +135 -0
  160. package/ui/dist/assets/index-1C-fUCFr.css +1 -0
  161. package/ui/dist/assets/index-BN20YYeA.js +23 -0
  162. package/ui/dist/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  163. package/ui/dist/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  164. package/ui/dist/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  165. package/ui/dist/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  166. package/ui/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  167. package/ui/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  168. package/ui/dist/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  169. package/ui/dist/assets/lib-C_lvLDN7.js +968 -0
  170. package/ui/dist/assets/rolldown-runtime-BWaJ3C7D.js +1 -0
  171. package/ui/dist/favicon.svg +1 -0
  172. package/ui/dist/index.html +16 -0
  173. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mr.san
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,97 @@
1
+ # Third-party notices
2
+
3
+ Heybe includes code ported from these projects. The ported code has since diverged from upstream with its own features, performance optimizations and security fixes.
4
+
5
+ ## PocketBase
6
+
7
+ https://ganigeorgiev.com/pocketbase/pocketbase
8
+
9
+ Ported from v0.41.1.
10
+
11
+ ```
12
+ The MIT License (MIT)
13
+ Copyright (c) 2022 - present, Gani Georgiev
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software
16
+ and associated documentation files (the "Software"), to deal in the Software without restriction,
17
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
18
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
19
+ is furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all copies or
22
+ substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
25
+ BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
+ ```
30
+
31
+ ## fexpr
32
+
33
+ https://ganigeorgiev.com/fexpr
34
+
35
+ Ported from v0.6.0.
36
+
37
+ ```
38
+ BSD 3-Clause License
39
+
40
+ Copyright (c) 2022-present, Gani Georgiev
41
+ All rights reserved.
42
+
43
+ Redistribution and use in source and binary forms, with or without
44
+ modification, are permitted provided that the following conditions are met:
45
+
46
+ 1. Redistributions of source code must retain the above copyright notice, this
47
+ list of conditions and the following disclaimer.
48
+
49
+ 2. Redistributions in binary form must reproduce the above copyright notice,
50
+ this list of conditions and the following disclaimer in the documentation
51
+ and/or other materials provided with the distribution.
52
+
53
+ 3. Neither the name of the copyright holder nor the names of its
54
+ contributors may be used to endorse or promote products derived from
55
+ this software without specific prior written permission.
56
+
57
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
58
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
59
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
60
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
61
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
62
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
63
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
64
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
65
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
66
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67
+ ```
68
+
69
+ ## mimetype
70
+
71
+ https://github.com/gabriel-vasile/mimetype
72
+
73
+ Ported from v1.4.15.
74
+
75
+ ```
76
+ MIT License
77
+
78
+ Copyright (c) 2018 Gabriel Vasile
79
+
80
+ Permission is hereby granted, free of charge, to any person obtaining a copy
81
+ of this software and associated documentation files (the "Software"), to deal
82
+ in the Software without restriction, including without limitation the rights
83
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
84
+ copies of the Software, and to permit persons to whom the Software is
85
+ furnished to do so, subject to the following conditions:
86
+
87
+ The above copyright notice and this permission notice shall be included in all
88
+ copies or substantial portions of the Software.
89
+
90
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
91
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
92
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
93
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
94
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
95
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
96
+ SOFTWARE.
97
+ ```
package/package.json CHANGED
@@ -1,6 +1,49 @@
1
1
  {
2
2
  "name": "@heybejs/core",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.2.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "exports": "./src/index.ts",
7
+ "bin": {
8
+ "heybe": "./src/cli.ts"
9
+ },
10
+ "files": [
11
+ "src",
12
+ "!src/**/*.test.ts",
13
+ "!src/**/*.fixture*.ts",
14
+ "!src/import/pb-fixture.ts",
15
+ "!src/**/testdata",
16
+ "ui/dist",
17
+ "THIRD_PARTY_NOTICES.md"
18
+ ],
19
+ "engines": {
20
+ "bun": ">=1.4.4"
21
+ },
22
+ "author": "emresandikci",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/emresandikci/heybe.git",
26
+ "directory": "packages/core"
27
+ },
28
+ "devDependencies": {
29
+ "@types/nodemailer": "^8.0.2",
30
+ "autocannon": "^9.0.0",
31
+ "@heybejs/configs": "0.0.0"
32
+ },
33
+ "dependencies": {
34
+ "acme-client": "^5.4.0",
35
+ "file-type": "^22.3.0",
36
+ "nodemailer": "^10.4.0",
37
+ "parse5": "^8.1.1",
38
+ "sharp": "^0.35.5",
39
+ "@heybejs/query": "^1.0.0"
40
+ },
41
+ "scripts": {
42
+ "release": "semantic-release -e semantic-release-monorepo",
43
+ "test": "bun test src",
44
+ "test:contract": "bun test ./contract/*.contract.ts",
45
+ "bench": "bun bench/run.ts",
46
+ "build:binary": "bun scripts/build-binary.ts",
47
+ "smoke:binary": "bun scripts/smoke-binary.ts"
48
+ }
6
49
  }