@sprinterai/supabase 0.3.0 → 0.5.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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/dist/auth/adapter.js +3 -3
  3. package/dist/auth/guards.d.ts +27 -0
  4. package/dist/auth/guards.d.ts.map +1 -0
  5. package/dist/auth/guards.js +61 -0
  6. package/dist/auth/guards.js.map +1 -0
  7. package/dist/auth/index.d.ts +6 -4
  8. package/dist/auth/index.d.ts.map +1 -1
  9. package/dist/auth/index.js +5 -3
  10. package/dist/auth/index.js.map +1 -1
  11. package/dist/auth/permissions.d.ts +9 -1
  12. package/dist/auth/permissions.d.ts.map +1 -1
  13. package/dist/auth/permissions.js +13 -0
  14. package/dist/auth/permissions.js.map +1 -1
  15. package/dist/clients/admin.d.ts +3 -1
  16. package/dist/clients/admin.d.ts.map +1 -1
  17. package/dist/clients/admin.js +3 -3
  18. package/dist/clients/admin.js.map +1 -1
  19. package/dist/clients/browser.d.ts +3 -1
  20. package/dist/clients/browser.d.ts.map +1 -1
  21. package/dist/clients/browser.js +3 -3
  22. package/dist/clients/browser.js.map +1 -1
  23. package/dist/clients/index.d.ts +3 -3
  24. package/dist/clients/index.js +3 -3
  25. package/dist/clients/server.d.ts +2 -1
  26. package/dist/clients/server.d.ts.map +1 -1
  27. package/dist/clients/server.js +1 -1
  28. package/dist/clients/server.js.map +1 -1
  29. package/dist/generated/database-types.d.ts +4020 -0
  30. package/dist/generated/database-types.d.ts.map +1 -0
  31. package/dist/generated/database-types.js +97 -0
  32. package/dist/generated/database-types.js.map +1 -0
  33. package/dist/generated/index.d.ts +48 -0
  34. package/dist/generated/index.d.ts.map +1 -0
  35. package/dist/generated/index.js +2 -0
  36. package/dist/generated/index.js.map +1 -0
  37. package/dist/index.d.ts +12 -10
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +7 -5
  40. package/dist/index.js.map +1 -1
  41. package/dist/realtime/index.d.ts +2 -2
  42. package/dist/realtime/index.js +1 -1
  43. package/dist/resolvers.d.ts +23 -0
  44. package/dist/resolvers.d.ts.map +1 -0
  45. package/dist/resolvers.js +57 -0
  46. package/dist/resolvers.js.map +1 -0
  47. package/dist/stores/activity-store.d.ts +21 -0
  48. package/dist/stores/activity-store.d.ts.map +1 -0
  49. package/dist/stores/activity-store.js +122 -0
  50. package/dist/stores/activity-store.js.map +1 -0
  51. package/dist/stores/admin-store.d.ts +27 -0
  52. package/dist/stores/admin-store.d.ts.map +1 -0
  53. package/dist/stores/admin-store.js +171 -0
  54. package/dist/stores/admin-store.js.map +1 -0
  55. package/dist/stores/agent-store.d.ts +6 -2
  56. package/dist/stores/agent-store.d.ts.map +1 -1
  57. package/dist/stores/agent-store.js +83 -6
  58. package/dist/stores/agent-store.js.map +1 -1
  59. package/dist/stores/approval-store.d.ts +19 -0
  60. package/dist/stores/approval-store.d.ts.map +1 -0
  61. package/dist/stores/approval-store.js +108 -0
  62. package/dist/stores/approval-store.js.map +1 -0
  63. package/dist/stores/chat-store.d.ts +2 -1
  64. package/dist/stores/chat-store.d.ts.map +1 -1
  65. package/dist/stores/chat-store.js +46 -36
  66. package/dist/stores/chat-store.js.map +1 -1
  67. package/dist/stores/comment-store.d.ts +13 -0
  68. package/dist/stores/comment-store.d.ts.map +1 -0
  69. package/dist/stores/comment-store.js +67 -0
  70. package/dist/stores/comment-store.js.map +1 -0
  71. package/dist/stores/cost-store.d.ts +15 -0
  72. package/dist/stores/cost-store.d.ts.map +1 -0
  73. package/dist/stores/cost-store.js +69 -0
  74. package/dist/stores/cost-store.js.map +1 -0
  75. package/dist/stores/criteria-set-store.d.ts +16 -0
  76. package/dist/stores/criteria-set-store.d.ts.map +1 -0
  77. package/dist/stores/criteria-set-store.js +127 -0
  78. package/dist/stores/criteria-set-store.js.map +1 -0
  79. package/dist/stores/document-store.d.ts +21 -0
  80. package/dist/stores/document-store.d.ts.map +1 -0
  81. package/dist/stores/document-store.js +191 -0
  82. package/dist/stores/document-store.js.map +1 -0
  83. package/dist/stores/embed-store.d.ts +11 -0
  84. package/dist/stores/embed-store.d.ts.map +1 -0
  85. package/dist/stores/embed-store.js +71 -0
  86. package/dist/stores/embed-store.js.map +1 -0
  87. package/dist/stores/entity-store.d.ts +7 -2
  88. package/dist/stores/entity-store.d.ts.map +1 -1
  89. package/dist/stores/entity-store.js +163 -37
  90. package/dist/stores/entity-store.js.map +1 -1
  91. package/dist/stores/extraction-store.d.ts +18 -0
  92. package/dist/stores/extraction-store.d.ts.map +1 -0
  93. package/dist/stores/extraction-store.js +170 -0
  94. package/dist/stores/extraction-store.js.map +1 -0
  95. package/dist/stores/factory.d.ts +29 -2
  96. package/dist/stores/factory.d.ts.map +1 -1
  97. package/dist/stores/factory.js +60 -9
  98. package/dist/stores/factory.js.map +1 -1
  99. package/dist/stores/favorites-store.d.ts +13 -0
  100. package/dist/stores/favorites-store.d.ts.map +1 -0
  101. package/dist/stores/favorites-store.js +53 -0
  102. package/dist/stores/favorites-store.js.map +1 -0
  103. package/dist/stores/feedback-store.d.ts +12 -0
  104. package/dist/stores/feedback-store.d.ts.map +1 -0
  105. package/dist/stores/feedback-store.js +59 -0
  106. package/dist/stores/feedback-store.js.map +1 -0
  107. package/dist/stores/inbound-store.d.ts +16 -0
  108. package/dist/stores/inbound-store.d.ts.map +1 -0
  109. package/dist/stores/inbound-store.js +133 -0
  110. package/dist/stores/inbound-store.js.map +1 -0
  111. package/dist/stores/index.d.ts +36 -10
  112. package/dist/stores/index.d.ts.map +1 -1
  113. package/dist/stores/index.js +35 -9
  114. package/dist/stores/index.js.map +1 -1
  115. package/dist/stores/member-store.d.ts +23 -0
  116. package/dist/stores/member-store.d.ts.map +1 -0
  117. package/dist/stores/member-store.js +121 -0
  118. package/dist/stores/member-store.js.map +1 -0
  119. package/dist/stores/memory-store.d.ts +4 -1
  120. package/dist/stores/memory-store.d.ts.map +1 -1
  121. package/dist/stores/memory-store.js +31 -3
  122. package/dist/stores/memory-store.js.map +1 -1
  123. package/dist/stores/nav-config-store.d.ts +13 -0
  124. package/dist/stores/nav-config-store.d.ts.map +1 -0
  125. package/dist/stores/nav-config-store.js +104 -0
  126. package/dist/stores/nav-config-store.js.map +1 -0
  127. package/dist/stores/notification-store.d.ts +15 -0
  128. package/dist/stores/notification-store.d.ts.map +1 -0
  129. package/dist/stores/notification-store.js +88 -0
  130. package/dist/stores/notification-store.js.map +1 -0
  131. package/dist/stores/recent-view-store.d.ts +11 -0
  132. package/dist/stores/recent-view-store.d.ts.map +1 -0
  133. package/dist/stores/recent-view-store.js +39 -0
  134. package/dist/stores/recent-view-store.js.map +1 -0
  135. package/dist/stores/response-store.d.ts +15 -0
  136. package/dist/stores/response-store.d.ts.map +1 -0
  137. package/dist/stores/response-store.js +294 -0
  138. package/dist/stores/response-store.js.map +1 -0
  139. package/dist/stores/share-store.d.ts +14 -0
  140. package/dist/stores/share-store.d.ts.map +1 -0
  141. package/dist/stores/share-store.js +153 -0
  142. package/dist/stores/share-store.js.map +1 -0
  143. package/dist/stores/shared-context-store.d.ts +12 -0
  144. package/dist/stores/shared-context-store.d.ts.map +1 -0
  145. package/dist/stores/shared-context-store.js +55 -0
  146. package/dist/stores/shared-context-store.js.map +1 -0
  147. package/dist/stores/skill-store.d.ts +21 -0
  148. package/dist/stores/skill-store.d.ts.map +1 -0
  149. package/dist/stores/skill-store.js +163 -0
  150. package/dist/stores/skill-store.js.map +1 -0
  151. package/dist/stores/source-store.d.ts +23 -0
  152. package/dist/stores/source-store.d.ts.map +1 -0
  153. package/dist/stores/source-store.js +111 -0
  154. package/dist/stores/source-store.js.map +1 -0
  155. package/dist/stores/task-store.d.ts +2 -1
  156. package/dist/stores/task-store.d.ts.map +1 -1
  157. package/dist/stores/task-store.js +58 -6
  158. package/dist/stores/task-store.js.map +1 -1
  159. package/dist/stores/template-store.d.ts +16 -0
  160. package/dist/stores/template-store.d.ts.map +1 -0
  161. package/dist/stores/template-store.js +136 -0
  162. package/dist/stores/template-store.js.map +1 -0
  163. package/dist/stores/tenant-store.d.ts +2 -1
  164. package/dist/stores/tenant-store.d.ts.map +1 -1
  165. package/dist/stores/tenant-store.js +2 -2
  166. package/dist/stores/tenant-store.js.map +1 -1
  167. package/dist/stores/theme-store.d.ts +11 -0
  168. package/dist/stores/theme-store.d.ts.map +1 -0
  169. package/dist/stores/theme-store.js +41 -0
  170. package/dist/stores/theme-store.js.map +1 -0
  171. package/dist/stores/tool-definition-store.d.ts +18 -0
  172. package/dist/stores/tool-definition-store.d.ts.map +1 -0
  173. package/dist/stores/tool-definition-store.js +129 -0
  174. package/dist/stores/tool-definition-store.js.map +1 -0
  175. package/dist/stores/tool-store.d.ts +21 -2
  176. package/dist/stores/tool-store.d.ts.map +1 -1
  177. package/dist/stores/tool-store.js +112 -2
  178. package/dist/stores/tool-store.js.map +1 -1
  179. package/dist/stores/view-store.d.ts +8 -4
  180. package/dist/stores/view-store.d.ts.map +1 -1
  181. package/dist/stores/view-store.js +94 -14
  182. package/dist/stores/view-store.js.map +1 -1
  183. package/dist/stores/webhook-endpoint-store.d.ts +18 -0
  184. package/dist/stores/webhook-endpoint-store.d.ts.map +1 -0
  185. package/dist/stores/webhook-endpoint-store.js +56 -0
  186. package/dist/stores/webhook-endpoint-store.js.map +1 -0
  187. package/dist/stores/workflow-run-store.d.ts +23 -0
  188. package/dist/stores/workflow-run-store.d.ts.map +1 -0
  189. package/dist/stores/workflow-run-store.js +201 -0
  190. package/dist/stores/workflow-run-store.js.map +1 -0
  191. package/dist/tenant/actions.js +1 -1
  192. package/dist/tenant/context.js +1 -1
  193. package/dist/tenant/index.d.ts +5 -5
  194. package/dist/tenant/index.js +4 -4
  195. package/dist/types/index.d.ts +5 -4
  196. package/dist/types/index.d.ts.map +1 -1
  197. package/dist/types/index.js +1 -1
  198. package/package.json +19 -14
  199. package/dist/__test-utils__/mock-supabase.d.ts +0 -18
  200. package/dist/__test-utils__/mock-supabase.d.ts.map +0 -1
  201. package/dist/__test-utils__/mock-supabase.js +0 -89
  202. package/dist/__test-utils__/mock-supabase.js.map +0 -1
  203. package/dist/auth/claims.test.d.ts +0 -2
  204. package/dist/auth/claims.test.d.ts.map +0 -1
  205. package/dist/auth/claims.test.js +0 -32
  206. package/dist/auth/claims.test.js.map +0 -1
  207. package/dist/auth/permissions.test.d.ts +0 -2
  208. package/dist/auth/permissions.test.d.ts.map +0 -1
  209. package/dist/auth/permissions.test.js +0 -40
  210. package/dist/auth/permissions.test.js.map +0 -1
  211. package/dist/clients/admin.test.d.ts +0 -2
  212. package/dist/clients/admin.test.d.ts.map +0 -1
  213. package/dist/clients/admin.test.js +0 -31
  214. package/dist/clients/admin.test.js.map +0 -1
  215. package/dist/clients/browser.test.d.ts +0 -2
  216. package/dist/clients/browser.test.d.ts.map +0 -1
  217. package/dist/clients/browser.test.js +0 -29
  218. package/dist/clients/browser.test.js.map +0 -1
  219. package/dist/clients/server.test.d.ts +0 -2
  220. package/dist/clients/server.test.d.ts.map +0 -1
  221. package/dist/clients/server.test.js +0 -26
  222. package/dist/clients/server.test.js.map +0 -1
  223. package/dist/stores/agent-store.test.d.ts +0 -2
  224. package/dist/stores/agent-store.test.d.ts.map +0 -1
  225. package/dist/stores/agent-store.test.js +0 -64
  226. package/dist/stores/agent-store.test.js.map +0 -1
  227. package/dist/stores/chat-store.test.d.ts +0 -2
  228. package/dist/stores/chat-store.test.d.ts.map +0 -1
  229. package/dist/stores/chat-store.test.js +0 -83
  230. package/dist/stores/chat-store.test.js.map +0 -1
  231. package/dist/stores/entity-store.test.d.ts +0 -2
  232. package/dist/stores/entity-store.test.d.ts.map +0 -1
  233. package/dist/stores/entity-store.test.js +0 -125
  234. package/dist/stores/entity-store.test.js.map +0 -1
  235. package/dist/stores/factory.test.d.ts +0 -2
  236. package/dist/stores/factory.test.d.ts.map +0 -1
  237. package/dist/stores/factory.test.js +0 -41
  238. package/dist/stores/factory.test.js.map +0 -1
  239. package/dist/stores/memory-store.test.d.ts +0 -2
  240. package/dist/stores/memory-store.test.d.ts.map +0 -1
  241. package/dist/stores/memory-store.test.js +0 -70
  242. package/dist/stores/memory-store.test.js.map +0 -1
  243. package/dist/stores/task-store.test.d.ts +0 -2
  244. package/dist/stores/task-store.test.d.ts.map +0 -1
  245. package/dist/stores/task-store.test.js +0 -86
  246. package/dist/stores/task-store.test.js.map +0 -1
  247. package/dist/stores/tool-store.test.d.ts +0 -2
  248. package/dist/stores/tool-store.test.d.ts.map +0 -1
  249. package/dist/stores/tool-store.test.js +0 -56
  250. package/dist/stores/tool-store.test.js.map +0 -1
  251. package/dist/stores/view-store.test.d.ts +0 -2
  252. package/dist/stores/view-store.test.d.ts.map +0 -1
  253. package/dist/stores/view-store.test.js +0 -57
  254. package/dist/stores/view-store.test.js.map +0 -1
  255. package/dist/tenant/constants.test.d.ts +0 -2
  256. package/dist/tenant/constants.test.d.ts.map +0 -1
  257. package/dist/tenant/constants.test.js +0 -25
  258. package/dist/tenant/constants.test.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sprinter AI
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.
@@ -10,9 +10,9 @@
10
10
  * is responsible for creating the client with proper cookie handling.
11
11
  */
12
12
  import { isAdminRole } from '@sprinterai/core';
13
- import { getTenantContext } from '../tenant/context';
14
- import { getUserId } from './claims';
15
- import { getUserPermissions } from './permissions';
13
+ import { getTenantContext } from '../tenant/context.js';
14
+ import { getUserId } from './claims.js';
15
+ import { getUserPermissions } from './permissions.js';
16
16
  function createAuthenticationError(message) {
17
17
  const error = new Error(message);
18
18
  error.name = 'AuthenticationError';
@@ -0,0 +1,27 @@
1
+ import type { AppPermission, TenantContext } from '@sprinterai/core';
2
+ import type { SupabaseClient } from '@supabase/supabase-js';
3
+ /** Auth error with HTTP status code. */
4
+ export declare class AuthError extends Error {
5
+ readonly status: 401 | 403;
6
+ constructor(message: string, status: 401 | 403);
7
+ }
8
+ /**
9
+ * Require an authenticated user with a valid tenant context.
10
+ * Returns the tenant context. Throws 401 if not authenticated.
11
+ */
12
+ export declare function requireAuth(client: SupabaseClient): Promise<TenantContext>;
13
+ /**
14
+ * Require admin-level access (owner or admin role).
15
+ * Returns the tenant context. Throws 403 if not admin.
16
+ */
17
+ export declare function requireAdmin(client: SupabaseClient): Promise<TenantContext>;
18
+ /**
19
+ * Require a specific permission for the current user.
20
+ * Returns the tenant context. Throws 403 if permission missing.
21
+ */
22
+ export declare function requirePermission(client: SupabaseClient, permission: AppPermission): Promise<TenantContext>;
23
+ /**
24
+ * Check if user has a specific permission without throwing.
25
+ */
26
+ export declare function hasPermission(client: SupabaseClient, permission: AppPermission): Promise<boolean>;
27
+ //# sourceMappingURL=guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/auth/guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM5D,wCAAwC;AACxC,qBAAa,SAAU,SAAQ,KAAK;aAGhB,MAAM,EAAE,GAAG,GAAG,GAAG;gBADjC,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,GAAG,GAAG,GAAG;CAKpC;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAMhF;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAMjF;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,aAAa,GACxB,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,aAAa,GACxB,OAAO,CAAC,OAAO,CAAC,CAQlB"}
@@ -0,0 +1,61 @@
1
+ import { isAdminRole } from '@sprinterai/core';
2
+ import { getTenantContext } from '../tenant/context.js';
3
+ import { getUserPermissions } from './permissions.js';
4
+ /** Auth error with HTTP status code. */
5
+ export class AuthError extends Error {
6
+ status;
7
+ constructor(message, status) {
8
+ super(message);
9
+ this.status = status;
10
+ this.name = 'AuthError';
11
+ }
12
+ }
13
+ /**
14
+ * Require an authenticated user with a valid tenant context.
15
+ * Returns the tenant context. Throws 401 if not authenticated.
16
+ */
17
+ export async function requireAuth(client) {
18
+ try {
19
+ return await getTenantContext(client);
20
+ }
21
+ catch {
22
+ throw new AuthError('Authentication required', 401);
23
+ }
24
+ }
25
+ /**
26
+ * Require admin-level access (owner or admin role).
27
+ * Returns the tenant context. Throws 403 if not admin.
28
+ */
29
+ export async function requireAdmin(client) {
30
+ const ctx = await requireAuth(client);
31
+ if (!isAdminRole(ctx.role)) {
32
+ throw new AuthError('Admin access required', 403);
33
+ }
34
+ return ctx;
35
+ }
36
+ /**
37
+ * Require a specific permission for the current user.
38
+ * Returns the tenant context. Throws 403 if permission missing.
39
+ */
40
+ export async function requirePermission(client, permission) {
41
+ const ctx = await requireAuth(client);
42
+ const permissions = await getUserPermissions(client, ctx.userId, ctx.tenantId);
43
+ if (!permissions.includes(permission)) {
44
+ throw new AuthError(`Permission required: ${permission}`, 403);
45
+ }
46
+ return ctx;
47
+ }
48
+ /**
49
+ * Check if user has a specific permission without throwing.
50
+ */
51
+ export async function hasPermission(client, permission) {
52
+ try {
53
+ const ctx = await getTenantContext(client);
54
+ const permissions = await getUserPermissions(client, ctx.userId, ctx.tenantId);
55
+ return permissions.includes(permission);
56
+ }
57
+ catch {
58
+ return false;
59
+ }
60
+ }
61
+ //# sourceMappingURL=guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/auth/guards.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,wCAAwC;AACxC,MAAM,OAAO,SAAU,SAAQ,KAAK;IAGhB;IAFlB,YACE,OAAe,EACC,MAAiB;QAEjC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,WAAM,GAAN,MAAM,CAAW;QAGjC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAsB;IACtD,IAAI,CAAC;QACH,OAAO,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,SAAS,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;IACtD,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAsB;IACvD,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,SAAS,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAsB,EACtB,UAAyB;IAEzB,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/E,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,SAAS,CAAC,wBAAwB,UAAU,EAAE,EAAE,GAAG,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAsB,EACtB,UAAyB;IAEzB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC3C,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC/E,OAAO,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -1,5 +1,7 @@
1
- export { getClaims, getUserId } from "./claims";
2
- export type { JwtClaims } from "./claims";
3
- export { getUserPermissions, getPermissionsForRole } from "./permissions";
4
- export { requireAuth, requireAdmin, hasPermission, requirePermission, } from "./adapter";
1
+ export { getClaims, getUserId } from './claims.js';
2
+ export type { JwtClaims } from './claims.js';
3
+ export { getUserPermissions, getPermissionsForRole, resolveSubjectPermissions, } from './permissions.js';
4
+ export { requireAuth, requireAdmin, hasPermission, requirePermission } from './adapter.js';
5
+ export { AuthError } from './guards.js';
6
+ export { requireAuth as requireAuthGuard, requireAdmin as requireAdminGuard, requirePermission as requirePermissionGuard, hasPermission as hasPermissionGuard, } from './guards.js';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,iBAAiB,GAClB,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EACL,WAAW,IAAI,gBAAgB,EAC/B,YAAY,IAAI,iBAAiB,EACjC,iBAAiB,IAAI,sBAAsB,EAC3C,aAAa,IAAI,kBAAkB,GACpC,MAAM,UAAU,CAAC"}
@@ -1,4 +1,6 @@
1
- export { getClaims, getUserId } from "./claims";
2
- export { getUserPermissions, getPermissionsForRole } from "./permissions";
3
- export { requireAuth, requireAdmin, hasPermission, requirePermission, } from "./adapter";
1
+ export { getClaims, getUserId } from './claims.js';
2
+ export { getUserPermissions, getPermissionsForRole, resolveSubjectPermissions, } from './permissions.js';
3
+ export { requireAuth, requireAdmin, hasPermission, requirePermission } from './adapter.js';
4
+ export { AuthError } from './guards.js';
5
+ export { requireAuth as requireAuthGuard, requireAdmin as requireAdminGuard, requirePermission as requirePermissionGuard, hasPermission as hasPermissionGuard, } from './guards.js';
4
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,iBAAiB,GAClB,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EACL,WAAW,IAAI,gBAAgB,EAC/B,YAAY,IAAI,iBAAiB,EACjC,iBAAiB,IAAI,sBAAsB,EAC3C,aAAa,IAAI,kBAAkB,GACpC,MAAM,UAAU,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { AppPermission } from '@sprinterai/core';
1
+ import type { AppPermission, PermissionSubject } from '@sprinterai/core';
2
2
  import type { SupabaseClient } from '@supabase/supabase-js';
3
3
  /**
4
4
  * Get all permissions for a user in a specific tenant.
@@ -11,4 +11,12 @@ export declare function getUserPermissions(client: SupabaseClient, userId: strin
11
11
  * Requires admin client to bypass RLS.
12
12
  */
13
13
  export declare function getPermissionsForRole(adminClient: SupabaseClient, roleId: string): Promise<AppPermission[]>;
14
+ /**
15
+ * Resolve permissions for any subject (user or agent).
16
+ * Provides a single entry point for permission resolution regardless of subject type.
17
+ *
18
+ * For users: queries the denormalized user_permissions table.
19
+ * For agents: queries role_permissions via the agent's assigned role.
20
+ */
21
+ export declare function resolveSubjectPermissions(client: SupabaseClient, subject: PermissionSubject): Promise<AppPermission[]>;
14
22
  //# sourceMappingURL=permissions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/auth/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,EAAE,CAAC,CAQ1B;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,cAAc,EAC3B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,aAAa,EAAE,CAAC,CAO1B"}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/auth/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,EAAE,CAAC,CAQ1B;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,cAAc,EAC3B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,aAAa,EAAE,CAAC,CAO1B;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,aAAa,EAAE,CAAC,CAK1B"}
@@ -22,4 +22,17 @@ export async function getPermissionsForRole(adminClient, roleId) {
22
22
  .eq('role_id', roleId);
23
23
  return (data ?? []).map((row) => row.permission);
24
24
  }
25
+ /**
26
+ * Resolve permissions for any subject (user or agent).
27
+ * Provides a single entry point for permission resolution regardless of subject type.
28
+ *
29
+ * For users: queries the denormalized user_permissions table.
30
+ * For agents: queries role_permissions via the agent's assigned role.
31
+ */
32
+ export async function resolveSubjectPermissions(client, subject) {
33
+ if (subject.type === 'user') {
34
+ return getUserPermissions(client, subject.userId, subject.tenantId);
35
+ }
36
+ return getPermissionsForRole(client, subject.roleId);
37
+ }
25
38
  //# sourceMappingURL=permissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/auth/permissions.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAsB,EACtB,MAAc,EACd,QAAgB;IAEhB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM;SAC1B,IAAI,CAAC,kBAAkB,CAAC;SACxB,MAAM,CAAC,YAAY,CAAC;SACpB,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;SACrB,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAE7B,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAA2B,EAAE,EAAE,CAAC,GAAG,CAAC,UAA2B,CAAC,CAAC;AAC5F,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,WAA2B,EAC3B,MAAc;IAEd,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW;SAC/B,IAAI,CAAC,kBAAkB,CAAC;SACxB,MAAM,CAAC,YAAY,CAAC;SACpB,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAEzB,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAA2B,EAAE,EAAE,CAAC,GAAG,CAAC,UAA2B,CAAC,CAAC;AAC5F,CAAC"}
1
+ {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/auth/permissions.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAsB,EACtB,MAAc,EACd,QAAgB;IAEhB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM;SAC1B,IAAI,CAAC,kBAAkB,CAAC;SACxB,MAAM,CAAC,YAAY,CAAC;SACpB,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;SACrB,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAE7B,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAA2B,EAAE,EAAE,CAAC,GAAG,CAAC,UAA2B,CAAC,CAAC;AAC5F,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,WAA2B,EAC3B,MAAc;IAEd,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW;SAC/B,IAAI,CAAC,kBAAkB,CAAC;SACxB,MAAM,CAAC,YAAY,CAAC;SACpB,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAEzB,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAA2B,EAAE,EAAE,CAAC,GAAG,CAAC,UAA2B,CAAC,CAAC;AAC5F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAsB,EACtB,OAA0B;IAE1B,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC5B,OAAO,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC"}
@@ -1,3 +1,5 @@
1
+ import type { SupabaseClient } from '@supabase/supabase-js';
2
+ import type { Database } from '../generated/index.js';
1
3
  /**
2
4
  * Create a Supabase admin client using the service role key.
3
5
  * Bypasses RLS — use only for system operations.
@@ -5,5 +7,5 @@
5
7
  export declare function createAdminClient(options?: {
6
8
  supabaseUrl?: string;
7
9
  supabaseServiceRoleKey?: string;
8
- }): import("@supabase/supabase-js").SupabaseClient<any, "public", "public", any, any>;
10
+ }): SupabaseClient<Database>;
9
11
  //# sourceMappingURL=admin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/clients/admin.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,qFAUA"}
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/clients/admin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,GAAG,cAAc,CAAC,QAAQ,CAAC,CAS3B"}
@@ -1,14 +1,14 @@
1
- import { createClient } from "@supabase/supabase-js";
1
+ import { createClient } from '@supabase/supabase-js';
2
2
  /**
3
3
  * Create a Supabase admin client using the service role key.
4
4
  * Bypasses RLS — use only for system operations.
5
5
  */
6
6
  export function createAdminClient(options) {
7
- const url = options?.supabaseUrl ?? process.env.NEXT_PUBLIC_SUPABASE_URL ?? "";
7
+ const url = options?.supabaseUrl ?? process.env.NEXT_PUBLIC_SUPABASE_URL ?? '';
8
8
  const key = options?.supabaseServiceRoleKey ??
9
9
  process.env.SUPABASE_SECRET_KEY ??
10
10
  process.env.SUPABASE_SERVICE_ROLE_KEY ??
11
- "";
11
+ '';
12
12
  return createClient(url, key);
13
13
  }
14
14
  //# sourceMappingURL=admin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/clients/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAGjC;IACC,MAAM,GAAG,GACP,OAAO,EAAE,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE,CAAC;IACrE,MAAM,GAAG,GACP,OAAO,EAAE,sBAAsB;QAC/B,OAAO,CAAC,GAAG,CAAC,mBAAmB;QAC/B,OAAO,CAAC,GAAG,CAAC,yBAAyB;QACrC,EAAE,CAAC;IAEL,OAAO,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC"}
1
+ {"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/clients/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAKrD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAGjC;IACC,MAAM,GAAG,GAAG,OAAO,EAAE,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE,CAAC;IAC/E,MAAM,GAAG,GACP,OAAO,EAAE,sBAAsB;QAC/B,OAAO,CAAC,GAAG,CAAC,mBAAmB;QAC/B,OAAO,CAAC,GAAG,CAAC,yBAAyB;QACrC,EAAE,CAAC;IAEL,OAAO,YAAY,CAAW,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,3 +1,5 @@
1
+ import type { SupabaseClient } from '@supabase/supabase-js';
2
+ import type { Database } from '../generated/index.js';
1
3
  /**
2
4
  * Create a Supabase browser client for use in client components.
3
5
  * Reads env vars or accepts explicit URL/key.
@@ -5,5 +7,5 @@
5
7
  export declare function createBrowserClient(options?: {
6
8
  supabaseUrl?: string;
7
9
  supabaseAnonKey?: string;
8
- }): import("@supabase/supabase-js").SupabaseClient<any, "public", "public", any, any>;
10
+ }): SupabaseClient<Database>;
9
11
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/clients/browser.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,qFAUA"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/clients/browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,cAAc,CAAC,QAAQ,CAAC,CAS3B"}
@@ -1,14 +1,14 @@
1
- import { createBrowserClient as createSSRBrowserClient } from "@supabase/ssr";
1
+ import { createBrowserClient as createSSRBrowserClient } from '@supabase/ssr';
2
2
  /**
3
3
  * Create a Supabase browser client for use in client components.
4
4
  * Reads env vars or accepts explicit URL/key.
5
5
  */
6
6
  export function createBrowserClient(options) {
7
- const url = options?.supabaseUrl ?? process.env.NEXT_PUBLIC_SUPABASE_URL ?? "";
7
+ const url = options?.supabaseUrl ?? process.env.NEXT_PUBLIC_SUPABASE_URL ?? '';
8
8
  const key = options?.supabaseAnonKey ??
9
9
  process.env.NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY ??
10
10
  process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ??
11
- "";
11
+ '';
12
12
  return createSSRBrowserClient(url, key);
13
13
  }
14
14
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/clients/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE9E;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAGnC;IACC,MAAM,GAAG,GACP,OAAO,EAAE,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE,CAAC;IACrE,MAAM,GAAG,GACP,OAAO,EAAE,eAAe;QACxB,OAAO,CAAC,GAAG,CAAC,oCAAoC;QAChD,OAAO,CAAC,GAAG,CAAC,6BAA6B;QACzC,EAAE,CAAC;IAEL,OAAO,sBAAsB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC"}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/clients/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAK9E;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAGnC;IACC,MAAM,GAAG,GAAG,OAAO,EAAE,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE,CAAC;IAC/E,MAAM,GAAG,GACP,OAAO,EAAE,eAAe;QACxB,OAAO,CAAC,GAAG,CAAC,oCAAoC;QAChD,OAAO,CAAC,GAAG,CAAC,6BAA6B;QACzC,EAAE,CAAC;IAEL,OAAO,sBAAsB,CAAW,GAAG,EAAE,GAAG,CAAC,CAAC;AACpD,CAAC"}
@@ -1,4 +1,4 @@
1
- export { createServerClient } from "./server";
2
- export { createBrowserClient } from "./browser";
3
- export { createAdminClient } from "./admin";
1
+ export { createServerClient } from "./server.js";
2
+ export { createBrowserClient } from "./browser.js";
3
+ export { createAdminClient } from "./admin.js";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- export { createServerClient } from "./server";
2
- export { createBrowserClient } from "./browser";
3
- export { createAdminClient } from "./admin";
1
+ export { createServerClient } from "./server.js";
2
+ export { createBrowserClient } from "./browser.js";
3
+ export { createAdminClient } from "./admin.js";
4
4
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,4 @@
1
+ import type { SupabaseClient } from '@supabase/supabase-js';
1
2
  /**
2
3
  * Create a Supabase server client for use in Next.js server components and route handlers.
3
4
  * Requires `next/headers` cookies — call within a request context.
@@ -18,5 +19,5 @@ export declare function createServerClient(options: {
18
19
  options: Record<string, unknown>;
19
20
  }>) => void;
20
21
  };
21
- }): import("@supabase/supabase-js").SupabaseClient<any, "public", "public", any, any>;
22
+ }): SupabaseClient;
22
23
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/clients/server.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACrD,MAAM,EAAE,CACN,OAAO,EAAE,KAAK,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;YACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SAClC,CAAC,KACC,IAAI,CAAC;KACX,CAAC;CACH,qFAeA"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/clients/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACrD,MAAM,EAAE,CACN,OAAO,EAAE,KAAK,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;YACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;SAClC,CAAC,KACC,IAAI,CAAC;KACX,CAAC;CACH,GAAG,cAAc,CAejB"}
@@ -1,4 +1,4 @@
1
- import { createServerClient as createSSRServerClient } from "@supabase/ssr";
1
+ import { createServerClient as createSSRServerClient } from '@supabase/ssr';
2
2
  /**
3
3
  * Create a Supabase server client for use in Next.js server components and route handlers.
4
4
  * Requires `next/headers` cookies — call within a request context.
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/clients/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAalC;IACC,OAAO,qBAAqB,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,eAAe,EAAE;QACzE,OAAO,EAAE;YACP,MAAM;gBACJ,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YACtC,CAAC;YACD,MAAM,CAAC,YAAY;gBACjB,IAAI,CAAC;oBACH,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAC3C,CAAC;gBAAC,MAAM,CAAC;oBACP,8DAA8D;gBAChE,CAAC;YACH,CAAC;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/clients/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAG5E;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAalC;IACC,OAAO,qBAAqB,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,eAAe,EAAE;QACzE,OAAO,EAAE;YACP,MAAM;gBACJ,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YACtC,CAAC;YACD,MAAM,CAAC,YAAY;gBACjB,IAAI,CAAC;oBACH,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAC3C,CAAC;gBAAC,MAAM,CAAC;oBACP,8DAA8D;gBAChE,CAAC;YACH,CAAC;SACF;KACF,CAAC,CAAC;AACL,CAAC"}