@m5kdev/backend 0.1.0 → 0.1.1

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 (199) hide show
  1. package/.cursor/rules/backend.mdc +70 -0
  2. package/.turbo/turbo-build.log +5 -0
  3. package/.turbo/turbo-check-types.log +5 -0
  4. package/.turbo/turbo-lint$colon$fix.log +255 -0
  5. package/CHANGELOG.md +10 -0
  6. package/dist/src/lib/posthog.d.ts +3 -0
  7. package/dist/src/lib/posthog.d.ts.map +1 -0
  8. package/dist/src/lib/sentry.d.ts +2 -0
  9. package/dist/src/lib/sentry.d.ts.map +1 -0
  10. package/dist/src/modules/access/access.repository.d.ts +2348 -0
  11. package/dist/src/modules/access/access.repository.d.ts.map +1 -0
  12. package/dist/src/modules/access/access.service.d.ts +22 -0
  13. package/dist/src/modules/access/access.service.d.ts.map +1 -0
  14. package/dist/src/modules/access/access.test.d.ts +2 -0
  15. package/dist/src/modules/access/access.test.d.ts.map +1 -0
  16. package/dist/src/modules/access/access.utils.d.ts +17 -0
  17. package/dist/src/modules/access/access.utils.d.ts.map +1 -0
  18. package/dist/src/modules/ai/ai.db.d.ts +396 -0
  19. package/dist/src/modules/ai/ai.db.d.ts.map +1 -0
  20. package/dist/src/modules/ai/ai.prompt.d.ts +28 -0
  21. package/dist/src/modules/ai/ai.prompt.d.ts.map +1 -0
  22. package/dist/src/modules/ai/ai.repository.d.ts +424 -0
  23. package/dist/src/modules/ai/ai.repository.d.ts.map +1 -0
  24. package/dist/src/modules/ai/ai.router.d.ts +2 -0
  25. package/dist/src/modules/ai/ai.router.d.ts.map +1 -0
  26. package/dist/src/modules/ai/ai.service.d.ts +115 -0
  27. package/dist/src/modules/ai/ai.service.d.ts.map +1 -0
  28. package/dist/src/modules/ai/ai.trpc.d.ts +59 -0
  29. package/dist/src/modules/ai/ai.trpc.d.ts.map +1 -0
  30. package/dist/src/modules/ai/ideogram/ideogram.constants.d.ts +8 -0
  31. package/dist/src/modules/ai/ideogram/ideogram.constants.d.ts.map +1 -0
  32. package/dist/src/modules/ai/ideogram/ideogram.dto.d.ts +230 -0
  33. package/dist/src/modules/ai/ideogram/ideogram.dto.d.ts.map +1 -0
  34. package/dist/src/modules/ai/ideogram/ideogram.prompt.d.ts +3 -0
  35. package/dist/src/modules/ai/ideogram/ideogram.prompt.d.ts.map +1 -0
  36. package/dist/src/modules/ai/ideogram/ideogram.repository.d.ts +7 -0
  37. package/dist/src/modules/ai/ideogram/ideogram.repository.d.ts.map +1 -0
  38. package/dist/src/modules/ai/ideogram/ideogram.service.d.ts +10 -0
  39. package/dist/src/modules/ai/ideogram/ideogram.service.d.ts.map +1 -0
  40. package/dist/src/modules/auth/auth.db.d.ts +2336 -0
  41. package/dist/src/modules/auth/auth.db.d.ts.map +1 -0
  42. package/dist/src/modules/auth/auth.dto.d.ts +66 -0
  43. package/dist/src/modules/auth/auth.dto.d.ts.map +1 -0
  44. package/dist/src/modules/auth/auth.lib.d.ts +4874 -0
  45. package/dist/src/modules/auth/auth.lib.d.ts.map +1 -0
  46. package/dist/src/modules/auth/auth.middleware.d.ts +615 -0
  47. package/dist/src/modules/auth/auth.middleware.d.ts.map +1 -0
  48. package/dist/src/modules/auth/auth.repository.d.ts +2417 -0
  49. package/dist/src/modules/auth/auth.repository.d.ts.map +1 -0
  50. package/dist/src/modules/auth/auth.service.d.ts +104 -0
  51. package/dist/src/modules/auth/auth.service.d.ts.map +1 -0
  52. package/dist/src/modules/auth/auth.trpc.d.ts +309 -0
  53. package/dist/src/modules/auth/auth.trpc.d.ts.map +1 -0
  54. package/dist/src/modules/auth/auth.utils.d.ts +2352 -0
  55. package/dist/src/modules/auth/auth.utils.d.ts.map +1 -0
  56. package/dist/src/modules/base/base.abstract.d.ts +19 -0
  57. package/dist/src/modules/base/base.abstract.d.ts.map +1 -0
  58. package/dist/src/modules/base/base.dto.d.ts +70 -0
  59. package/dist/src/modules/base/base.dto.d.ts.map +1 -0
  60. package/dist/src/modules/base/base.grants.d.ts +29 -0
  61. package/dist/src/modules/base/base.grants.d.ts.map +1 -0
  62. package/dist/src/modules/base/base.grants.test.d.ts +2 -0
  63. package/dist/src/modules/base/base.grants.test.d.ts.map +1 -0
  64. package/dist/src/modules/base/base.repository.d.ts +97 -0
  65. package/dist/src/modules/base/base.repository.d.ts.map +1 -0
  66. package/dist/src/modules/base/base.service.d.ts +42 -0
  67. package/dist/src/modules/base/base.service.d.ts.map +1 -0
  68. package/dist/src/modules/base/base.types.d.ts +2 -0
  69. package/dist/src/modules/base/base.types.d.ts.map +1 -0
  70. package/dist/src/modules/billing/billing.db.d.ts +366 -0
  71. package/dist/src/modules/billing/billing.db.d.ts.map +1 -0
  72. package/dist/src/modules/billing/billing.repository.d.ts +2764 -0
  73. package/dist/src/modules/billing/billing.repository.d.ts.map +1 -0
  74. package/dist/src/modules/billing/billing.router.d.ts +5 -0
  75. package/dist/src/modules/billing/billing.router.d.ts.map +1 -0
  76. package/dist/src/modules/billing/billing.service.d.ts +60 -0
  77. package/dist/src/modules/billing/billing.service.d.ts.map +1 -0
  78. package/dist/src/modules/billing/billing.trpc.d.ts +75 -0
  79. package/dist/src/modules/billing/billing.trpc.d.ts.map +1 -0
  80. package/dist/src/modules/clay/clay.repository.d.ts +6 -0
  81. package/dist/src/modules/clay/clay.repository.d.ts.map +1 -0
  82. package/dist/src/modules/clay/clay.service.d.ts +29 -0
  83. package/dist/src/modules/clay/clay.service.d.ts.map +1 -0
  84. package/dist/src/modules/connect/connect.db.d.ts +357 -0
  85. package/dist/src/modules/connect/connect.db.d.ts.map +1 -0
  86. package/dist/src/modules/connect/connect.dto.d.ts +75 -0
  87. package/dist/src/modules/connect/connect.dto.d.ts.map +1 -0
  88. package/dist/src/modules/connect/connect.linkedin.d.ts +3 -0
  89. package/dist/src/modules/connect/connect.linkedin.d.ts.map +1 -0
  90. package/dist/src/modules/connect/connect.oauth.d.ts +28 -0
  91. package/dist/src/modules/connect/connect.oauth.d.ts.map +1 -0
  92. package/dist/src/modules/connect/connect.repository.d.ts +414 -0
  93. package/dist/src/modules/connect/connect.repository.d.ts.map +1 -0
  94. package/dist/src/modules/connect/connect.router.d.ts +5 -0
  95. package/dist/src/modules/connect/connect.router.d.ts.map +1 -0
  96. package/dist/src/modules/connect/connect.service.d.ts +89 -0
  97. package/dist/src/modules/connect/connect.service.d.ts.map +1 -0
  98. package/dist/src/modules/connect/connect.trpc.d.ts +81 -0
  99. package/dist/src/modules/connect/connect.trpc.d.ts.map +1 -0
  100. package/dist/src/modules/connect/connect.types.d.ts +26 -0
  101. package/dist/src/modules/connect/connect.types.d.ts.map +1 -0
  102. package/dist/src/modules/crypto/crypto.db.d.ts +152 -0
  103. package/dist/src/modules/crypto/crypto.db.d.ts.map +1 -0
  104. package/dist/src/modules/crypto/crypto.repository.d.ts +160 -0
  105. package/dist/src/modules/crypto/crypto.repository.d.ts.map +1 -0
  106. package/dist/src/modules/crypto/crypto.service.d.ts +11 -0
  107. package/dist/src/modules/crypto/crypto.service.d.ts.map +1 -0
  108. package/dist/src/modules/email/email.service.d.ts +57 -0
  109. package/dist/src/modules/email/email.service.d.ts.map +1 -0
  110. package/dist/src/modules/file/file.repository.d.ts +13 -0
  111. package/dist/src/modules/file/file.repository.d.ts.map +1 -0
  112. package/dist/src/modules/file/file.router.d.ts +4 -0
  113. package/dist/src/modules/file/file.router.d.ts.map +1 -0
  114. package/dist/src/modules/file/file.service.d.ts +25 -0
  115. package/dist/src/modules/file/file.service.d.ts.map +1 -0
  116. package/dist/src/modules/recurrence/recurrence.db.d.ts +563 -0
  117. package/dist/src/modules/recurrence/recurrence.db.d.ts.map +1 -0
  118. package/dist/src/modules/recurrence/recurrence.repository.d.ts +585 -0
  119. package/dist/src/modules/recurrence/recurrence.repository.d.ts.map +1 -0
  120. package/dist/src/modules/recurrence/recurrence.service.d.ts +30 -0
  121. package/dist/src/modules/recurrence/recurrence.service.d.ts.map +1 -0
  122. package/dist/src/modules/recurrence/recurrence.trpc.d.ts +243 -0
  123. package/dist/src/modules/recurrence/recurrence.trpc.d.ts.map +1 -0
  124. package/dist/src/modules/social/social.dto.d.ts +35 -0
  125. package/dist/src/modules/social/social.dto.d.ts.map +1 -0
  126. package/dist/src/modules/social/social.linkedin.d.ts +11 -0
  127. package/dist/src/modules/social/social.linkedin.d.ts.map +1 -0
  128. package/dist/src/modules/social/social.linkedin.test.d.ts +2 -0
  129. package/dist/src/modules/social/social.linkedin.test.d.ts.map +1 -0
  130. package/dist/src/modules/social/social.service.d.ts +29 -0
  131. package/dist/src/modules/social/social.service.d.ts.map +1 -0
  132. package/dist/src/modules/social/social.types.d.ts +36 -0
  133. package/dist/src/modules/social/social.types.d.ts.map +1 -0
  134. package/dist/src/modules/tag/tag.db.d.ts +347 -0
  135. package/dist/src/modules/tag/tag.db.d.ts.map +1 -0
  136. package/dist/src/modules/tag/tag.dto.d.ts +1019 -0
  137. package/dist/src/modules/tag/tag.dto.d.ts.map +1 -0
  138. package/dist/src/modules/tag/tag.repository.d.ts +384 -0
  139. package/dist/src/modules/tag/tag.repository.d.ts.map +1 -0
  140. package/dist/src/modules/tag/tag.service.d.ts +36 -0
  141. package/dist/src/modules/tag/tag.service.d.ts.map +1 -0
  142. package/dist/src/modules/tag/tag.trpc.d.ts +191 -0
  143. package/dist/src/modules/tag/tag.trpc.d.ts.map +1 -0
  144. package/dist/src/modules/utils/applyPagination.d.ts +7 -0
  145. package/dist/src/modules/utils/applyPagination.d.ts.map +1 -0
  146. package/dist/src/modules/utils/applySorting.d.ts +9 -0
  147. package/dist/src/modules/utils/applySorting.d.ts.map +1 -0
  148. package/dist/src/modules/utils/getConditionsFromFilters.d.ts +5 -0
  149. package/dist/src/modules/utils/getConditionsFromFilters.d.ts.map +1 -0
  150. package/dist/src/modules/video/video.service.d.ts +8 -0
  151. package/dist/src/modules/video/video.service.d.ts.map +1 -0
  152. package/dist/src/modules/webhook/webhook.constants.d.ts +9 -0
  153. package/dist/src/modules/webhook/webhook.constants.d.ts.map +1 -0
  154. package/dist/src/modules/webhook/webhook.db.d.ts +137 -0
  155. package/dist/src/modules/webhook/webhook.db.d.ts.map +1 -0
  156. package/dist/src/modules/webhook/webhook.dto.d.ts +395 -0
  157. package/dist/src/modules/webhook/webhook.dto.d.ts.map +1 -0
  158. package/dist/src/modules/webhook/webhook.repository.d.ts +149 -0
  159. package/dist/src/modules/webhook/webhook.repository.d.ts.map +1 -0
  160. package/dist/src/modules/webhook/webhook.router.d.ts +4 -0
  161. package/dist/src/modules/webhook/webhook.router.d.ts.map +1 -0
  162. package/dist/src/modules/webhook/webhook.service.d.ts +10 -0
  163. package/dist/src/modules/webhook/webhook.service.d.ts.map +1 -0
  164. package/dist/src/modules/workflow/workflow.db.d.ts +297 -0
  165. package/dist/src/modules/workflow/workflow.db.d.ts.map +1 -0
  166. package/dist/src/modules/workflow/workflow.repository.d.ts +344 -0
  167. package/dist/src/modules/workflow/workflow.repository.d.ts.map +1 -0
  168. package/dist/src/modules/workflow/workflow.service.d.ts +22 -0
  169. package/dist/src/modules/workflow/workflow.service.d.ts.map +1 -0
  170. package/dist/src/modules/workflow/workflow.trpc.d.ts +93 -0
  171. package/dist/src/modules/workflow/workflow.trpc.d.ts.map +1 -0
  172. package/dist/src/modules/workflow/workflow.types.d.ts +21 -0
  173. package/dist/src/modules/workflow/workflow.types.d.ts.map +1 -0
  174. package/dist/src/modules/workflow/workflow.utils.d.ts +22 -0
  175. package/dist/src/modules/workflow/workflow.utils.d.ts.map +1 -0
  176. package/dist/src/test/stubs/utils.d.ts +3 -0
  177. package/dist/src/test/stubs/utils.d.ts.map +1 -0
  178. package/dist/src/trpc/context.d.ts +42 -0
  179. package/dist/src/trpc/context.d.ts.map +1 -0
  180. package/dist/src/trpc/index.d.ts +4 -0
  181. package/dist/src/trpc/index.d.ts.map +1 -0
  182. package/dist/src/trpc/procedures.d.ts +234 -0
  183. package/dist/src/trpc/procedures.d.ts.map +1 -0
  184. package/dist/src/trpc/utils.d.ts +5 -0
  185. package/dist/src/trpc/utils.d.ts.map +1 -0
  186. package/dist/src/types.d.ts +486 -0
  187. package/dist/src/types.d.ts.map +1 -0
  188. package/dist/src/utils/errors.d.ts +50 -0
  189. package/dist/src/utils/errors.d.ts.map +1 -0
  190. package/dist/src/utils/logger.d.ts +2 -0
  191. package/dist/src/utils/logger.d.ts.map +1 -0
  192. package/dist/src/utils/posthog.d.ts +14 -0
  193. package/dist/src/utils/posthog.d.ts.map +1 -0
  194. package/dist/src/utils/types.d.ts +5 -0
  195. package/dist/src/utils/types.d.ts.map +1 -0
  196. package/dist/tsconfig.tsbuildinfo +1 -0
  197. package/jest.config.ts +19 -0
  198. package/package.json +3 -6
  199. package/tsconfig.json +19 -0
@@ -0,0 +1,70 @@
1
+ ---
2
+ alwaysApply: true
3
+ ---
4
+
5
+ # Backend Stack Rules (`#modules`)
6
+
7
+ ## Intent
8
+
9
+ `#modules` is a composable backend stack, not a closed framework.
10
+
11
+ - Prefer extensible classes and factories.
12
+ - Keep module contracts open for app-level composition.
13
+ - Do not hide wiring behind global initialization.
14
+
15
+ ## Module Shape
16
+
17
+ For backend modules in `src/modules/<name>/`, prefer:
18
+
19
+ - `<name>.db.ts` for tables/schema
20
+ - `<name>.dto.ts` for IO contracts/select helpers
21
+ - `<name>.repository.ts` for persistence
22
+ - `<name>.service.ts` for orchestration/business rules
23
+ - `<name>.trpc.ts` and optional `<name>.router.ts` for transport adapters
24
+ - optional `<name>.types.ts`, `<name>.utils.ts`, `<name>.constants.ts`
25
+
26
+ ## Layer Boundaries
27
+
28
+ - Repository layer is data access only.
29
+ - Service layer orchestrates repositories and other services.
30
+ - Transport layer (`.trpc.ts`, `.router.ts`) validates/authenticates and delegates to services.
31
+ - Worker/job glue should invoke services; business rules stay in services.
32
+
33
+ Do not import services into repositories.
34
+
35
+ ## Dependency Injection and Composition
36
+
37
+ - Services should declare explicit dependency maps:
38
+ - `BaseService<{ ...repositories }, { ...services }>`
39
+ - `BasePermissionService<{ ...repositories }, { ...services }>`
40
+ - Instantiate repositories/services in app composition roots:
41
+ - `apps/*/server/src/repository.ts`
42
+ - `apps/*/server/src/service.ts`
43
+ - Routers should receive service instances via function params; do not instantiate repositories/services inside router files.
44
+
45
+ ## Result and Error Discipline
46
+
47
+ - Use `ServerResult`/`ServerResultAsync` and `throwable`/`throwableAsync` from base classes.
48
+ - Prefer `this.error(...)`/`ServerError` instead of raw exceptions for expected failures.
49
+ - In tRPC handlers, unwrap results with `handleTRPCResult`.
50
+
51
+ ## Transactions
52
+
53
+ - Repository methods may accept optional `tx`.
54
+ - Inside transaction blocks, use the transaction handle (`tx`) consistently; avoid mixing `this.orm` calls in the same transactional flow.
55
+
56
+ ## Grants and Permission Services
57
+
58
+ - Keep grants declarations separate from service logic.
59
+ - If a service extends `BasePermissionService`, action names passed to `accessGuard`/`accessGuardAsync` must match declared grant actions exactly.
60
+ - Prefer canonical actions (`read`, `write`, `delete`, `publish`) unless the module exports a typed action union.
61
+
62
+ ## Jobs and Queue Payloads
63
+
64
+ - Queue payloads should use stable primitives (e.g., `userId`, entity IDs, typed input), not full HTTP context/session objects.
65
+ - Job modules should avoid importing global service singletons directly when a composed registry can be injected.
66
+
67
+ ## Configuration and Side Effects
68
+
69
+ - Keep env access and SDK client initialization isolated to infra/lib files.
70
+ - Avoid import-time side effects that crash optional modules for unrelated consumers.
@@ -0,0 +1,5 @@
1
+
2
+ 
3
+ > @m5kdev/backend@0.1.0 build /Users/michalkow/Projects/m5kdev/packages/backend
4
+ > tsc --build
5
+
@@ -0,0 +1,5 @@
1
+
2
+ 
3
+ > #modules@0.1.0 check-types /Users/michalkow/Projects/m5-new/packages/backend
4
+ > tsc --noEmit
5
+
@@ -0,0 +1,255 @@
1
+
2
+ 
3
+ > @repo/backend@1.0.0 lint:fix /Users/michalkow/Projects/m5/packages/backend
4
+ > biome check . --write
5
+
6
+ src/lib/posthog.ts:3:42 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
7
+
8
+  ⚠ Forbidden non-null assertion.
9
+  
10
+   1 │ import { PostHog } from "posthog-node";
11
+   2 │ 
12
+  > 3 │ export const posthogClient = new PostHog(process.env.VITE_PUBLIC_POSTHOG_KEY!, {
13
+    │                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
+   4 │   host: process.env.VITE_PUBLIC_POSTHOG_HOST!,
15
+   5 │ });
16
+  
17
+ 
18
+ src/lib/posthog.ts:4:9 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
19
+
20
+  ⚠ Forbidden non-null assertion.
21
+  
22
+   3 │ export const posthogClient = new PostHog(process.env.VITE_PUBLIC_POSTHOG_KEY!, {
23
+  > 4 │   host: process.env.VITE_PUBLIC_POSTHOG_HOST!,
24
+    │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25
+   5 │ });
26
+   6 │ 
27
+  
28
+ 
29
+ src/modules/auth/auth.lib.ts:28:14 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30
+
31
+  ⚠ Forbidden non-null assertion.
32
+  
33
+   26 │ ): BetterAuth {
34
+   27 │   return betterAuth({
35
+  > 28 │     baseURL: process.env.VITE_SERVER_URL!,
36
+     │              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37
+   29 │     session: {
38
+   30 │       expiresIn: 60 * 60 * 24 * 7, // 7 days
39
+  
40
+ 
41
+ src/modules/auth/auth.lib.ts:93:22 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
42
+
43
+  ⚠ Forbidden non-null assertion.
44
+  
45
+   91 │     },
46
+   92 │     plugins: [admin(), organization(), apiKey()],
47
+  > 93 │     trustedOrigins: [process.env.VITE_APP_URL!, process.env.VITE_SERVER_URL!],
48
+     │                      ^^^^^^^^^^^^^^^^^^^^^^^^^
49
+   94 │   });
50
+   95 │ }
51
+  
52
+ 
53
+ src/modules/auth/auth.lib.ts:93:49 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
54
+
55
+  ⚠ Forbidden non-null assertion.
56
+  
57
+   91 │     },
58
+   92 │     plugins: [admin(), organization(), apiKey()],
59
+  > 93 │     trustedOrigins: [process.env.VITE_APP_URL!, process.env.VITE_SERVER_URL!],
60
+     │                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61
+   94 │   });
62
+   95 │ }
63
+  
64
+ 
65
+ src/modules/base/base.dto.ts:78:18 ]8;;https://biomejs.dev/linter/rules/no-explicit-any\lint/suspicious/noExplicitAny]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
66
+
67
+  ⚠ Unexpected any. Specify a different type.
68
+  
69
+   76 │   for (const key of schemaKeys) {
70
+   77 │     if (key in allColumns) {
71
+  > 78 │       (result as any)[key] = allColumns[key as keyof typeof allColumns];
72
+     │                  ^^^
73
+   79 │     }
74
+   80 │   }
75
+  
76
+  ℹ any disables many type checking rules. Its use should be avoided.
77
+  
78
+ 
79
+ src/modules/base/base.repository.ts:27:54 ]8;;https://biomejs.dev/linter/rules/no-explicit-any\lint/suspicious/noExplicitAny]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
80
+
81
+  ⚠ Unexpected any. Specify a different type.
82
+  
83
+   25 │ };
84
+   26 │ 
85
+  > 27 │ export class BaseRepository<O extends LibSQLDatabase<any>, S> {
86
+     │                                                      ^^^
87
+   28 │   protected orm: O;
88
+   29 │   protected schema: S;
89
+  
90
+  ℹ any disables many type checking rules. Its use should be avoided.
91
+  
92
+ 
93
+ src/modules/base/base.service.ts:4:54 ]8;;https://biomejs.dev/linter/rules/no-explicit-any\lint/suspicious/noExplicitAny]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
94
+
95
+  ⚠ Unexpected any. Specify a different type.
96
+  
97
+   3 │ export class BaseService<
98
+  > 4 │   Repositories extends Record<string, BaseRepository<any, any> | BaseExternaRepository>,
99
+    │                                                      ^^^
100
+   5 │   Services extends Record<string, BaseService<any, any>>,
101
+   6 │ > {
102
+  
103
+  ℹ any disables many type checking rules. Its use should be avoided.
104
+  
105
+ 
106
+ src/modules/base/base.service.ts:4:59 ]8;;https://biomejs.dev/linter/rules/no-explicit-any\lint/suspicious/noExplicitAny]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
107
+
108
+  ⚠ Unexpected any. Specify a different type.
109
+  
110
+   3 │ export class BaseService<
111
+  > 4 │   Repositories extends Record<string, BaseRepository<any, any> | BaseExternaRepository>,
112
+    │                                                           ^^^
113
+   5 │   Services extends Record<string, BaseService<any, any>>,
114
+   6 │ > {
115
+  
116
+  ℹ any disables many type checking rules. Its use should be avoided.
117
+  
118
+ 
119
+ src/modules/base/base.service.ts:5:47 ]8;;https://biomejs.dev/linter/rules/no-explicit-any\lint/suspicious/noExplicitAny]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
120
+
121
+  ⚠ Unexpected any. Specify a different type.
122
+  
123
+   3 │ export class BaseService<
124
+   4 │   Repositories extends Record<string, BaseRepository<any, any> | BaseExternaRepository>,
125
+  > 5 │   Services extends Record<string, BaseService<any, any>>,
126
+    │                                               ^^^
127
+   6 │ > {
128
+   7 │   constructor(
129
+  
130
+  ℹ any disables many type checking rules. Its use should be avoided.
131
+  
132
+ 
133
+ src/modules/base/base.service.ts:5:52 ]8;;https://biomejs.dev/linter/rules/no-explicit-any\lint/suspicious/noExplicitAny]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
134
+
135
+  ⚠ Unexpected any. Specify a different type.
136
+  
137
+   3 │ export class BaseService<
138
+   4 │   Repositories extends Record<string, BaseRepository<any, any> | BaseExternaRepository>,
139
+  > 5 │   Services extends Record<string, BaseService<any, any>>,
140
+    │                                                    ^^^
141
+   6 │ > {
142
+   7 │   constructor(
143
+  
144
+  ℹ any disables many type checking rules. Its use should be avoided.
145
+  
146
+ 
147
+ src/modules/billing/billing.router.ts:32:18 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
148
+
149
+  ⚠ Forbidden non-null assertion.
150
+  
151
+   31 │   billingRouter.get("/checkout/:priceId", authMiddleware, async (req: AuthRequest, res) => {
152
+  > 32 │     const user = req.user!;
153
+     │                  ^^^^^^^^^
154
+   33 │     const { priceId } = req.params;
155
+   34 │     let stripeCustomerId = user.paymentCustomerId;
156
+  
157
+ 
158
+ src/modules/billing/billing.router.ts:81:18 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
159
+
160
+  ⚠ Forbidden non-null assertion.
161
+  
162
+   80 │   billingRouter.get("/success", authMiddleware, async (req: AuthRequest, res) => {
163
+  > 81 │     const user = req.user!;
164
+     │                  ^^^^^^^^^
165
+   82 │     const stripeCustomerId = user.paymentCustomerId;
166
+   83 │     if (!stripeCustomerId) {
167
+  
168
+ 
169
+ src/modules/billing/billing.router.ts:120:7 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
170
+
171
+  ⚠ Forbidden non-null assertion.
172
+  
173
+   118 │       body,
174
+   119 │       signature,
175
+  > 120 │       process.env.STRIPE_WEBHOOK_SECRET!
176
+      │       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177
+   121 │     );
178
+   122 │ 
179
+  
180
+ 
181
+ src/utils/mail.ts:3:20 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
182
+
183
+  ⚠ Forbidden non-null assertion.
184
+  
185
+   1 │ import sendgrid from "@sendgrid/mail";
186
+   2 │ 
187
+  > 3 │ sendgrid.setApiKey(process.env.SENDGRID_API_KEY!);
188
+    │                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189
+   4 │ 
190
+   5 │ const authFrom = {
191
+  
192
+ 
193
+ src/utils/mail.ts:6:9 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
194
+
195
+  ⚠ Forbidden non-null assertion.
196
+  
197
+   5 │ const authFrom = {
198
+  > 6 │   name: process.env.SENDGRID_AUTH_FROM_NAME!,
199
+    │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200
+   7 │   email: process.env.SENDGRID_AUTH_FROM_EMAIL!,
201
+   8 │ };
202
+  
203
+ 
204
+ src/utils/mail.ts:7:10 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
205
+
206
+  ⚠ Forbidden non-null assertion.
207
+  
208
+   5 │ const authFrom = {
209
+   6 │   name: process.env.SENDGRID_AUTH_FROM_NAME!,
210
+  > 7 │   email: process.env.SENDGRID_AUTH_FROM_EMAIL!,
211
+    │          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
212
+   8 │ };
213
+   9 │ 
214
+  
215
+ 
216
+ src/utils/mail.ts:31:17 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
217
+
218
+  ⚠ Forbidden non-null assertion.
219
+  
220
+   29 │     ],
221
+   30 │     from: authFrom,
222
+  > 31 │     templateId: process.env.SENDGRID_AUTH_VERIFY_TEMPLATE_ID!,
223
+     │                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
224
+   32 │     trackingSettings: {
225
+   33 │       clickTracking: {
226
+  
227
+ 
228
+ src/utils/mail.ts:59:17 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
229
+
230
+  ⚠ Forbidden non-null assertion.
231
+  
232
+   57 │     ],
233
+   58 │     from: authFrom,
234
+  > 59 │     templateId: process.env.SENDGRID_AUTH_RESET_TEMPLATE_ID!,
235
+     │                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
236
+   60 │     trackingSettings: {
237
+   61 │       clickTracking: {
238
+  
239
+ 
240
+ src/utils/mail.ts:87:17 ]8;;https://biomejs.dev/linter/rules/no-non-null-assertion\lint/style/noNonNullAssertion]8;;\ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
241
+
242
+  ⚠ Forbidden non-null assertion.
243
+  
244
+   85 │     ],
245
+   86 │     from: authFrom,
246
+  > 87 │     templateId: process.env.SENDGRID_AUTH_DELETE_TEMPLATE_ID!,
247
+     │                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
248
+   88 │     trackingSettings: {
249
+   89 │       clickTracking: {
250
+  
251
+ 
252
+ The number of diagnostics exceeds the limit allowed. Use --max-diagnostics to increase it.
253
+ Diagnostics not shown: 2.
254
+ Checked 41 files in 56ms. No fixes applied.
255
+ Found 22 warnings.
package/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ # @m5kdev/backend
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - exports
8
+ - Updated dependencies
9
+ - @m5kdev/commons@0.1.1
10
+ - @m5kdev/config@0.1.1
@@ -0,0 +1,3 @@
1
+ import { PostHog } from "posthog-node";
2
+ export declare const posthogClient: PostHog;
3
+ //# sourceMappingURL=posthog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posthog.d.ts","sourceRoot":"","sources":["../../../src/lib/posthog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,eAAO,MAAM,aAAa,SAExB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sentry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry.d.ts","sourceRoot":"","sources":["../../../src/lib/sentry.ts"],"names":[],"mappings":""}