@flowselections/core 1.0.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 (196) hide show
  1. package/dist/auth/useAuth.d.ts +28 -0
  2. package/dist/auth/useAuth.d.ts.map +1 -0
  3. package/dist/auth/useAuth.js +72 -0
  4. package/dist/components/instellingen/NotificationSettingsCard.d.ts +2 -0
  5. package/dist/components/instellingen/NotificationSettingsCard.d.ts.map +1 -0
  6. package/dist/components/instellingen/NotificationSettingsCard.js +63 -0
  7. package/dist/components/layout/BugsDialog.d.ts +7 -0
  8. package/dist/components/layout/BugsDialog.d.ts.map +1 -0
  9. package/dist/components/layout/BugsDialog.js +148 -0
  10. package/dist/components/layout/Header.d.ts +6 -0
  11. package/dist/components/layout/Header.d.ts.map +1 -0
  12. package/dist/components/layout/Header.js +11 -0
  13. package/dist/components/layout/InstellingenPage.d.ts +5 -0
  14. package/dist/components/layout/InstellingenPage.d.ts.map +1 -0
  15. package/dist/components/layout/InstellingenPage.js +79 -0
  16. package/dist/components/layout/LoginPage.d.ts +6 -0
  17. package/dist/components/layout/LoginPage.d.ts.map +1 -0
  18. package/dist/components/layout/LoginPage.js +57 -0
  19. package/dist/components/layout/NotificationBell.d.ts +2 -0
  20. package/dist/components/layout/NotificationBell.d.ts.map +1 -0
  21. package/dist/components/layout/NotificationBell.js +45 -0
  22. package/dist/components/layout/ResetWachtwoordPage.d.ts +6 -0
  23. package/dist/components/layout/ResetWachtwoordPage.d.ts.map +1 -0
  24. package/dist/components/layout/ResetWachtwoordPage.js +51 -0
  25. package/dist/components/layout/Sidebar.d.ts +9 -0
  26. package/dist/components/layout/Sidebar.d.ts.map +1 -0
  27. package/dist/components/layout/Sidebar.js +32 -0
  28. package/dist/components/ui/accordion.d.ts +8 -0
  29. package/dist/components/ui/accordion.d.ts.map +1 -0
  30. package/dist/components/ui/accordion.js +13 -0
  31. package/dist/components/ui/alert-dialog.d.ts +21 -0
  32. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  33. package/dist/components/ui/alert-dialog.js +26 -0
  34. package/dist/components/ui/alert.d.ts +9 -0
  35. package/dist/components/ui/alert.d.ts.map +1 -0
  36. package/dist/components/ui/alert.js +22 -0
  37. package/dist/components/ui/aspect-ratio.d.ts +4 -0
  38. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  39. package/dist/components/ui/aspect-ratio.js +3 -0
  40. package/dist/components/ui/avatar.d.ts +7 -0
  41. package/dist/components/ui/avatar.d.ts.map +1 -0
  42. package/dist/components/ui/avatar.js +12 -0
  43. package/dist/components/ui/badge.d.ts +10 -0
  44. package/dist/components/ui/badge.d.ts.map +1 -0
  45. package/dist/components/ui/badge.js +20 -0
  46. package/dist/components/ui/breadcrumb.d.ts +20 -0
  47. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  48. package/dist/components/ui/breadcrumb.js +23 -0
  49. package/dist/components/ui/button.d.ts +12 -0
  50. package/dist/components/ui/button.d.ts.map +1 -0
  51. package/dist/components/ui/button.js +33 -0
  52. package/dist/components/ui/calendar.d.ts +9 -0
  53. package/dist/components/ui/calendar.d.ts.map +1 -0
  54. package/dist/components/ui/calendar.js +74 -0
  55. package/dist/components/ui/card.d.ts +9 -0
  56. package/dist/components/ui/card.d.ts.map +1 -0
  57. package/dist/components/ui/card.js +16 -0
  58. package/dist/components/ui/carousel.d.ts +19 -0
  59. package/dist/components/ui/carousel.d.ts.map +1 -0
  60. package/dist/components/ui/carousel.js +98 -0
  61. package/dist/components/ui/chart.d.ts +63 -0
  62. package/dist/components/ui/chart.d.ts.map +1 -0
  63. package/dist/components/ui/chart.js +134 -0
  64. package/dist/components/ui/checkbox.d.ts +5 -0
  65. package/dist/components/ui/checkbox.d.ts.map +1 -0
  66. package/dist/components/ui/checkbox.js +8 -0
  67. package/dist/components/ui/collapsible.d.ts +6 -0
  68. package/dist/components/ui/collapsible.d.ts.map +1 -0
  69. package/dist/components/ui/collapsible.js +6 -0
  70. package/dist/components/ui/command.d.ts +81 -0
  71. package/dist/components/ui/command.d.ts.map +1 -0
  72. package/dist/components/ui/command.js +29 -0
  73. package/dist/components/ui/context-menu.d.ts +28 -0
  74. package/dist/components/ui/context-menu.d.ts.map +1 -0
  75. package/dist/components/ui/context-menu.js +33 -0
  76. package/dist/components/ui/dialog.d.ts +20 -0
  77. package/dist/components/ui/dialog.d.ts.map +1 -0
  78. package/dist/components/ui/dialog.js +23 -0
  79. package/dist/components/ui/drawer.d.ts +23 -0
  80. package/dist/components/ui/drawer.d.ts.map +1 -0
  81. package/dist/components/ui/drawer.js +22 -0
  82. package/dist/components/ui/dropdown-menu.d.ts +28 -0
  83. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  84. package/dist/components/ui/dropdown-menu.js +36 -0
  85. package/dist/components/ui/form.d.ts +24 -0
  86. package/dist/components/ui/form.d.ts.map +1 -0
  87. package/dist/components/ui/form.js +65 -0
  88. package/dist/components/ui/hover-card.d.ts +7 -0
  89. package/dist/components/ui/hover-card.d.ts.map +1 -0
  90. package/dist/components/ui/hover-card.js +9 -0
  91. package/dist/components/ui/icon-picker.d.ts +15 -0
  92. package/dist/components/ui/icon-picker.d.ts.map +1 -0
  93. package/dist/components/ui/icon-picker.js +73 -0
  94. package/dist/components/ui/input-otp.d.ts +35 -0
  95. package/dist/components/ui/input-otp.d.ts.map +1 -0
  96. package/dist/components/ui/input-otp.js +18 -0
  97. package/dist/components/ui/input.d.ts +4 -0
  98. package/dist/components/ui/input.d.ts.map +1 -0
  99. package/dist/components/ui/input.js +8 -0
  100. package/dist/components/ui/label.d.ts +6 -0
  101. package/dist/components/ui/label.d.ts.map +1 -0
  102. package/dist/components/ui/label.js +10 -0
  103. package/dist/components/ui/menubar.d.ts +29 -0
  104. package/dist/components/ui/menubar.d.ts.map +1 -0
  105. package/dist/components/ui/menubar.js +45 -0
  106. package/dist/components/ui/navigation-menu.d.ts +13 -0
  107. package/dist/components/ui/navigation-menu.d.ts.map +1 -0
  108. package/dist/components/ui/navigation-menu.js +24 -0
  109. package/dist/components/ui/pagination.d.ts +29 -0
  110. package/dist/components/ui/pagination.d.ts.map +1 -0
  111. package/dist/components/ui/pagination.js +23 -0
  112. package/dist/components/ui/popover.d.ts +8 -0
  113. package/dist/components/ui/popover.d.ts.map +1 -0
  114. package/dist/components/ui/popover.js +10 -0
  115. package/dist/components/ui/progress.d.ts +5 -0
  116. package/dist/components/ui/progress.d.ts.map +1 -0
  117. package/dist/components/ui/progress.js +8 -0
  118. package/dist/components/ui/radio-group.d.ts +6 -0
  119. package/dist/components/ui/radio-group.d.ts.map +1 -0
  120. package/dist/components/ui/radio-group.js +14 -0
  121. package/dist/components/ui/resizable.d.ts +8 -0
  122. package/dist/components/ui/resizable.d.ts.map +1 -0
  123. package/dist/components/ui/resizable.js +8 -0
  124. package/dist/components/ui/scroll-area.d.ts +6 -0
  125. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  126. package/dist/components/ui/scroll-area.js +11 -0
  127. package/dist/components/ui/select.d.ts +14 -0
  128. package/dist/components/ui/select.d.ts.map +1 -0
  129. package/dist/components/ui/select.js +27 -0
  130. package/dist/components/ui/separator.d.ts +5 -0
  131. package/dist/components/ui/separator.d.ts.map +1 -0
  132. package/dist/components/ui/separator.js +7 -0
  133. package/dist/components/ui/sheet.d.ts +26 -0
  134. package/dist/components/ui/sheet.d.ts.map +1 -0
  135. package/dist/components/ui/sheet.js +37 -0
  136. package/dist/components/ui/sidebar.d.ts +66 -0
  137. package/dist/components/ui/sidebar.d.ts.map +1 -0
  138. package/dist/components/ui/sidebar.js +224 -0
  139. package/dist/components/ui/skeleton.d.ts +3 -0
  140. package/dist/components/ui/skeleton.d.ts.map +1 -0
  141. package/dist/components/ui/skeleton.js +6 -0
  142. package/dist/components/ui/slider.d.ts +5 -0
  143. package/dist/components/ui/slider.d.ts.map +1 -0
  144. package/dist/components/ui/slider.js +7 -0
  145. package/dist/components/ui/sonner.d.ts +5 -0
  146. package/dist/components/ui/sonner.d.ts.map +1 -0
  147. package/dist/components/ui/sonner.js +13 -0
  148. package/dist/components/ui/switch.d.ts +5 -0
  149. package/dist/components/ui/switch.d.ts.map +1 -0
  150. package/dist/components/ui/switch.js +7 -0
  151. package/dist/components/ui/table.d.ts +11 -0
  152. package/dist/components/ui/table.d.ts.map +1 -0
  153. package/dist/components/ui/table.js +20 -0
  154. package/dist/components/ui/tabs.d.ts +8 -0
  155. package/dist/components/ui/tabs.d.ts.map +1 -0
  156. package/dist/components/ui/tabs.js +12 -0
  157. package/dist/components/ui/textarea.d.ts +4 -0
  158. package/dist/components/ui/textarea.d.ts.map +1 -0
  159. package/dist/components/ui/textarea.js +8 -0
  160. package/dist/components/ui/toggle-group.d.ts +13 -0
  161. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  162. package/dist/components/ui/toggle-group.js +21 -0
  163. package/dist/components/ui/toggle.d.ts +13 -0
  164. package/dist/components/ui/toggle.d.ts.map +1 -0
  165. package/dist/components/ui/toggle.js +25 -0
  166. package/dist/components/ui/tooltip.d.ts +8 -0
  167. package/dist/components/ui/tooltip.d.ts.map +1 -0
  168. package/dist/components/ui/tooltip.js +11 -0
  169. package/dist/hooks/use-mobile.d.ts +2 -0
  170. package/dist/hooks/use-mobile.d.ts.map +1 -0
  171. package/dist/hooks/use-mobile.js +15 -0
  172. package/dist/index.d.ts +32 -0
  173. package/dist/index.d.ts.map +1 -0
  174. package/dist/index.js +33 -0
  175. package/dist/lib/utils.d.ts +3 -0
  176. package/dist/lib/utils.d.ts.map +1 -0
  177. package/dist/lib/utils.js +5 -0
  178. package/dist/lib/validationSchemas.d.ts +15 -0
  179. package/dist/lib/validationSchemas.d.ts.map +1 -0
  180. package/dist/lib/validationSchemas.js +25 -0
  181. package/dist/supabase/auth-middleware.d.ts +639 -0
  182. package/dist/supabase/auth-middleware.d.ts.map +1 -0
  183. package/dist/supabase/auth-middleware.js +52 -0
  184. package/dist/supabase/client.d.ts +635 -0
  185. package/dist/supabase/client.d.ts.map +1 -0
  186. package/dist/supabase/client.js +13 -0
  187. package/dist/supabase/client.server.d.ts +635 -0
  188. package/dist/supabase/client.server.d.ts.map +1 -0
  189. package/dist/supabase/client.server.js +30 -0
  190. package/dist/supabase/types.d.ts +717 -0
  191. package/dist/supabase/types.d.ts.map +1 -0
  192. package/dist/supabase/types.js +7 -0
  193. package/dist/types/module.d.ts +20 -0
  194. package/dist/types/module.d.ts.map +1 -0
  195. package/dist/types/module.js +1 -0
  196. package/package.json +100 -0
@@ -0,0 +1,639 @@
1
+ import type { Database } from './types';
2
+ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
3
+ supabase: import("@supabase/supabase-js").SupabaseClient<Database, "public", "public", {
4
+ Tables: {
5
+ bugs: {
6
+ Row: {
7
+ attachment_url: string | null;
8
+ created_at: string;
9
+ description: string;
10
+ id: string;
11
+ priority: string;
12
+ status: string;
13
+ title: string;
14
+ updated_at: string;
15
+ user_id: string;
16
+ };
17
+ Insert: {
18
+ attachment_url?: string | null;
19
+ created_at?: string;
20
+ description: string;
21
+ id?: string;
22
+ priority?: string;
23
+ status?: string;
24
+ title: string;
25
+ updated_at?: string;
26
+ user_id: string;
27
+ };
28
+ Update: {
29
+ attachment_url?: string | null;
30
+ created_at?: string;
31
+ description?: string;
32
+ id?: string;
33
+ priority?: string;
34
+ status?: string;
35
+ title?: string;
36
+ updated_at?: string;
37
+ user_id?: string;
38
+ };
39
+ Relationships: [];
40
+ };
41
+ customer_field_options: {
42
+ Row: {
43
+ created_at: string;
44
+ field_setting_id: string;
45
+ id: string;
46
+ label: string;
47
+ sort_order: number;
48
+ };
49
+ Insert: {
50
+ created_at?: string;
51
+ field_setting_id: string;
52
+ id?: string;
53
+ label: string;
54
+ sort_order?: number;
55
+ };
56
+ Update: {
57
+ created_at?: string;
58
+ field_setting_id?: string;
59
+ id?: string;
60
+ label?: string;
61
+ sort_order?: number;
62
+ };
63
+ Relationships: [{
64
+ foreignKeyName: "customer_field_options_field_setting_id_fkey";
65
+ columns: ["field_setting_id"];
66
+ isOneToOne: false;
67
+ referencedRelation: "customer_field_settings";
68
+ referencedColumns: ["id"];
69
+ }];
70
+ };
71
+ customer_field_settings: {
72
+ Row: {
73
+ created_at: string;
74
+ field_key: string;
75
+ field_label: string;
76
+ field_type: string;
77
+ id: string;
78
+ is_custom: boolean;
79
+ sort_order: number;
80
+ updated_at: string;
81
+ };
82
+ Insert: {
83
+ created_at?: string;
84
+ field_key: string;
85
+ field_label: string;
86
+ field_type?: string;
87
+ id?: string;
88
+ is_custom?: boolean;
89
+ sort_order?: number;
90
+ updated_at?: string;
91
+ };
92
+ Update: {
93
+ created_at?: string;
94
+ field_key?: string;
95
+ field_label?: string;
96
+ field_type?: string;
97
+ id?: string;
98
+ is_custom?: boolean;
99
+ sort_order?: number;
100
+ updated_at?: string;
101
+ };
102
+ Relationships: [];
103
+ };
104
+ customers: {
105
+ Row: {
106
+ address: string | null;
107
+ city: string | null;
108
+ company_name: string;
109
+ contact_person: string | null;
110
+ country: string | null;
111
+ created_at: string;
112
+ custom_fields: import("./types").Json;
113
+ email: string | null;
114
+ id: string;
115
+ notes: string | null;
116
+ phone: string | null;
117
+ postal_code: string | null;
118
+ updated_at: string;
119
+ };
120
+ Insert: {
121
+ address?: string | null;
122
+ city?: string | null;
123
+ company_name: string;
124
+ contact_person?: string | null;
125
+ country?: string | null;
126
+ created_at?: string;
127
+ custom_fields?: import("./types").Json;
128
+ email?: string | null;
129
+ id?: string;
130
+ notes?: string | null;
131
+ phone?: string | null;
132
+ postal_code?: string | null;
133
+ updated_at?: string;
134
+ };
135
+ Update: {
136
+ address?: string | null;
137
+ city?: string | null;
138
+ company_name?: string;
139
+ contact_person?: string | null;
140
+ country?: string | null;
141
+ created_at?: string;
142
+ custom_fields?: import("./types").Json;
143
+ email?: string | null;
144
+ id?: string;
145
+ notes?: string | null;
146
+ phone?: string | null;
147
+ postal_code?: string | null;
148
+ updated_at?: string;
149
+ };
150
+ Relationships: [];
151
+ };
152
+ inventory_settings: {
153
+ Row: {
154
+ created_at: string;
155
+ hierarchy_levels: string[];
156
+ id: string;
157
+ updated_at: string;
158
+ visible_columns: string[];
159
+ };
160
+ Insert: {
161
+ created_at?: string;
162
+ hierarchy_levels?: string[];
163
+ id?: string;
164
+ updated_at?: string;
165
+ visible_columns?: string[];
166
+ };
167
+ Update: {
168
+ created_at?: string;
169
+ hierarchy_levels?: string[];
170
+ id?: string;
171
+ updated_at?: string;
172
+ visible_columns?: string[];
173
+ };
174
+ Relationships: [];
175
+ };
176
+ locations: {
177
+ Row: {
178
+ created_at: string;
179
+ id: string;
180
+ name: string;
181
+ sort_order: number;
182
+ updated_at: string;
183
+ };
184
+ Insert: {
185
+ created_at?: string;
186
+ id?: string;
187
+ name: string;
188
+ sort_order?: number;
189
+ updated_at?: string;
190
+ };
191
+ Update: {
192
+ created_at?: string;
193
+ id?: string;
194
+ name?: string;
195
+ sort_order?: number;
196
+ updated_at?: string;
197
+ };
198
+ Relationships: [];
199
+ };
200
+ notifications: {
201
+ Row: {
202
+ created_at: string;
203
+ id: string;
204
+ message: string | null;
205
+ read: boolean;
206
+ title: string;
207
+ updated_at: string;
208
+ user_id: string;
209
+ };
210
+ Insert: {
211
+ created_at?: string;
212
+ id?: string;
213
+ message?: string | null;
214
+ read?: boolean;
215
+ title: string;
216
+ updated_at?: string;
217
+ user_id: string;
218
+ };
219
+ Update: {
220
+ created_at?: string;
221
+ id?: string;
222
+ message?: string | null;
223
+ read?: boolean;
224
+ title?: string;
225
+ updated_at?: string;
226
+ user_id?: string;
227
+ };
228
+ Relationships: [];
229
+ };
230
+ product_categories: {
231
+ Row: {
232
+ color: string;
233
+ created_at: string;
234
+ icon: string | null;
235
+ id: string;
236
+ name: string;
237
+ slug: string;
238
+ sort_order: number;
239
+ updated_at: string;
240
+ };
241
+ Insert: {
242
+ color?: string;
243
+ created_at?: string;
244
+ icon?: string | null;
245
+ id?: string;
246
+ name: string;
247
+ slug: string;
248
+ sort_order?: number;
249
+ updated_at?: string;
250
+ };
251
+ Update: {
252
+ color?: string;
253
+ created_at?: string;
254
+ icon?: string | null;
255
+ id?: string;
256
+ name?: string;
257
+ slug?: string;
258
+ sort_order?: number;
259
+ updated_at?: string;
260
+ };
261
+ Relationships: [];
262
+ };
263
+ product_field_options: {
264
+ Row: {
265
+ created_at: string;
266
+ field_setting_id: string;
267
+ id: string;
268
+ label: string;
269
+ sort_order: number;
270
+ };
271
+ Insert: {
272
+ created_at?: string;
273
+ field_setting_id: string;
274
+ id?: string;
275
+ label: string;
276
+ sort_order?: number;
277
+ };
278
+ Update: {
279
+ created_at?: string;
280
+ field_setting_id?: string;
281
+ id?: string;
282
+ label?: string;
283
+ sort_order?: number;
284
+ };
285
+ Relationships: [{
286
+ foreignKeyName: "product_field_options_field_setting_id_fkey";
287
+ columns: ["field_setting_id"];
288
+ isOneToOne: false;
289
+ referencedRelation: "product_field_settings";
290
+ referencedColumns: ["id"];
291
+ }];
292
+ };
293
+ product_field_settings: {
294
+ Row: {
295
+ active_per_category: import("./types").Json;
296
+ created_at: string;
297
+ field_key: string;
298
+ field_label: string;
299
+ field_type: string;
300
+ id: string;
301
+ is_custom: boolean;
302
+ sort_order: number;
303
+ updated_at: string;
304
+ };
305
+ Insert: {
306
+ active_per_category?: import("./types").Json;
307
+ created_at?: string;
308
+ field_key: string;
309
+ field_label: string;
310
+ field_type?: string;
311
+ id?: string;
312
+ is_custom?: boolean;
313
+ sort_order?: number;
314
+ updated_at?: string;
315
+ };
316
+ Update: {
317
+ active_per_category?: import("./types").Json;
318
+ created_at?: string;
319
+ field_key?: string;
320
+ field_label?: string;
321
+ field_type?: string;
322
+ id?: string;
323
+ is_custom?: boolean;
324
+ sort_order?: number;
325
+ updated_at?: string;
326
+ };
327
+ Relationships: [];
328
+ };
329
+ products: {
330
+ Row: {
331
+ barcode: string | null;
332
+ batch: string;
333
+ created_at: string;
334
+ custom_fields: import("./types").Json;
335
+ id: string;
336
+ image_url: string | null;
337
+ incoming_quantity: number;
338
+ location: string;
339
+ min_quantity: number;
340
+ product: string;
341
+ product_type: string;
342
+ purchase_price: number | null;
343
+ quantity: number;
344
+ sale_price: number | null;
345
+ unit: string;
346
+ updated_at: string;
347
+ weight: string | null;
348
+ };
349
+ Insert: {
350
+ barcode?: string | null;
351
+ batch: string;
352
+ created_at?: string;
353
+ custom_fields?: import("./types").Json;
354
+ id?: string;
355
+ image_url?: string | null;
356
+ incoming_quantity?: number;
357
+ location: string;
358
+ min_quantity?: number;
359
+ product: string;
360
+ product_type?: string;
361
+ purchase_price?: number | null;
362
+ quantity?: number;
363
+ sale_price?: number | null;
364
+ unit?: string;
365
+ updated_at?: string;
366
+ weight?: string | null;
367
+ };
368
+ Update: {
369
+ barcode?: string | null;
370
+ batch?: string;
371
+ created_at?: string;
372
+ custom_fields?: import("./types").Json;
373
+ id?: string;
374
+ image_url?: string | null;
375
+ incoming_quantity?: number;
376
+ location?: string;
377
+ min_quantity?: number;
378
+ product?: string;
379
+ product_type?: string;
380
+ purchase_price?: number | null;
381
+ quantity?: number;
382
+ sale_price?: number | null;
383
+ unit?: string;
384
+ updated_at?: string;
385
+ weight?: string | null;
386
+ };
387
+ Relationships: [];
388
+ };
389
+ profiles: {
390
+ Row: {
391
+ created_at: string;
392
+ display_name: string | null;
393
+ email: string | null;
394
+ id: string;
395
+ notification_preferences: import("./types").Json;
396
+ updated_at: string;
397
+ };
398
+ Insert: {
399
+ created_at?: string;
400
+ display_name?: string | null;
401
+ email?: string | null;
402
+ id: string;
403
+ notification_preferences?: import("./types").Json;
404
+ updated_at?: string;
405
+ };
406
+ Update: {
407
+ created_at?: string;
408
+ display_name?: string | null;
409
+ email?: string | null;
410
+ id?: string;
411
+ notification_preferences?: import("./types").Json;
412
+ updated_at?: string;
413
+ };
414
+ Relationships: [];
415
+ };
416
+ purchase_order_items: {
417
+ Row: {
418
+ created_at: string;
419
+ id: string;
420
+ product_id: string | null;
421
+ product_type: string;
422
+ purchase_order_id: string;
423
+ quantity: number;
424
+ };
425
+ Insert: {
426
+ created_at?: string;
427
+ id?: string;
428
+ product_id?: string | null;
429
+ product_type?: string;
430
+ purchase_order_id: string;
431
+ quantity?: number;
432
+ };
433
+ Update: {
434
+ created_at?: string;
435
+ id?: string;
436
+ product_id?: string | null;
437
+ product_type?: string;
438
+ purchase_order_id?: string;
439
+ quantity?: number;
440
+ };
441
+ Relationships: [{
442
+ foreignKeyName: "purchase_order_items_product_id_fkey";
443
+ columns: ["product_id"];
444
+ isOneToOne: false;
445
+ referencedRelation: "products";
446
+ referencedColumns: ["id"];
447
+ }, {
448
+ foreignKeyName: "purchase_order_items_purchase_order_id_fkey";
449
+ columns: ["purchase_order_id"];
450
+ isOneToOne: false;
451
+ referencedRelation: "purchase_orders";
452
+ referencedColumns: ["id"];
453
+ }];
454
+ };
455
+ purchase_orders: {
456
+ Row: {
457
+ created_at: string;
458
+ expected_delivery_date: string;
459
+ id: string;
460
+ location_id: string | null;
461
+ notes: string | null;
462
+ order_number: string;
463
+ status: string;
464
+ supplier_id: string | null;
465
+ supplier_name: string;
466
+ updated_at: string;
467
+ };
468
+ Insert: {
469
+ created_at?: string;
470
+ expected_delivery_date: string;
471
+ id?: string;
472
+ location_id?: string | null;
473
+ notes?: string | null;
474
+ order_number: string;
475
+ status?: string;
476
+ supplier_id?: string | null;
477
+ supplier_name?: string;
478
+ updated_at?: string;
479
+ };
480
+ Update: {
481
+ created_at?: string;
482
+ expected_delivery_date?: string;
483
+ id?: string;
484
+ location_id?: string | null;
485
+ notes?: string | null;
486
+ order_number?: string;
487
+ status?: string;
488
+ supplier_id?: string | null;
489
+ supplier_name?: string;
490
+ updated_at?: string;
491
+ };
492
+ Relationships: [{
493
+ foreignKeyName: "purchase_orders_location_id_fkey";
494
+ columns: ["location_id"];
495
+ isOneToOne: false;
496
+ referencedRelation: "locations";
497
+ referencedColumns: ["id"];
498
+ }, {
499
+ foreignKeyName: "purchase_orders_supplier_id_fkey";
500
+ columns: ["supplier_id"];
501
+ isOneToOne: false;
502
+ referencedRelation: "suppliers";
503
+ referencedColumns: ["id"];
504
+ }];
505
+ };
506
+ supplier_products: {
507
+ Row: {
508
+ article_number: string | null;
509
+ created_at: string;
510
+ id: string;
511
+ name: string;
512
+ notes: string | null;
513
+ pot_size: string | null;
514
+ price: number | null;
515
+ quantity: number | null;
516
+ supplier_id: string;
517
+ unit: string;
518
+ updated_at: string;
519
+ };
520
+ Insert: {
521
+ article_number?: string | null;
522
+ created_at?: string;
523
+ id?: string;
524
+ name: string;
525
+ notes?: string | null;
526
+ pot_size?: string | null;
527
+ price?: number | null;
528
+ quantity?: number | null;
529
+ supplier_id: string;
530
+ unit?: string;
531
+ updated_at?: string;
532
+ };
533
+ Update: {
534
+ article_number?: string | null;
535
+ created_at?: string;
536
+ id?: string;
537
+ name?: string;
538
+ notes?: string | null;
539
+ pot_size?: string | null;
540
+ price?: number | null;
541
+ quantity?: number | null;
542
+ supplier_id?: string;
543
+ unit?: string;
544
+ updated_at?: string;
545
+ };
546
+ Relationships: [{
547
+ foreignKeyName: "supplier_products_supplier_id_fkey";
548
+ columns: ["supplier_id"];
549
+ isOneToOne: false;
550
+ referencedRelation: "suppliers";
551
+ referencedColumns: ["id"];
552
+ }];
553
+ };
554
+ suppliers: {
555
+ Row: {
556
+ address: string | null;
557
+ column_mappings: import("./types").Json | null;
558
+ contact_person: string | null;
559
+ created_at: string;
560
+ default_product_type: string;
561
+ email: string | null;
562
+ id: string;
563
+ imported_file_name: string | null;
564
+ name: string;
565
+ notes: string | null;
566
+ phone: string | null;
567
+ updated_at: string;
568
+ };
569
+ Insert: {
570
+ address?: string | null;
571
+ column_mappings?: import("./types").Json | null;
572
+ contact_person?: string | null;
573
+ created_at?: string;
574
+ default_product_type?: string;
575
+ email?: string | null;
576
+ id?: string;
577
+ imported_file_name?: string | null;
578
+ name: string;
579
+ notes?: string | null;
580
+ phone?: string | null;
581
+ updated_at?: string;
582
+ };
583
+ Update: {
584
+ address?: string | null;
585
+ column_mappings?: import("./types").Json | null;
586
+ contact_person?: string | null;
587
+ created_at?: string;
588
+ default_product_type?: string;
589
+ email?: string | null;
590
+ id?: string;
591
+ imported_file_name?: string | null;
592
+ name?: string;
593
+ notes?: string | null;
594
+ phone?: string | null;
595
+ updated_at?: string;
596
+ };
597
+ Relationships: [];
598
+ };
599
+ user_roles: {
600
+ Row: {
601
+ created_at: string;
602
+ id: string;
603
+ role: Database["public"]["Enums"]["app_role"];
604
+ user_id: string;
605
+ };
606
+ Insert: {
607
+ created_at?: string;
608
+ id?: string;
609
+ role: Database["public"]["Enums"]["app_role"];
610
+ user_id: string;
611
+ };
612
+ Update: {
613
+ created_at?: string;
614
+ id?: string;
615
+ role?: Database["public"]["Enums"]["app_role"];
616
+ user_id?: string;
617
+ };
618
+ Relationships: [{
619
+ foreignKeyName: "user_roles_user_id_fkey";
620
+ columns: ["user_id"];
621
+ isOneToOne: false;
622
+ referencedRelation: "profiles";
623
+ referencedColumns: ["id"];
624
+ }];
625
+ };
626
+ };
627
+ Views: { [_ in never]: never; };
628
+ Functions: { [_ in never]: never; };
629
+ Enums: {
630
+ app_role: "admin" | "manager" | "warehouse" | "sales" | "developer";
631
+ };
632
+ CompositeTypes: { [_ in never]: never; };
633
+ }, {
634
+ PostgrestVersion: "14.5";
635
+ }>;
636
+ userId: string;
637
+ claims: import("@supabase/auth-js").JwtPayload;
638
+ }, undefined, undefined, undefined>;
639
+ //# sourceMappingURL=auth-middleware.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-middleware.d.ts","sourceRoot":"","sources":["../../src/core/supabase/auth-middleware.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAIvC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;kCASpB,CAAC;8BAIT,CAAD;;sBAEgB,CAAC;4BACF,CAAC;0BAA0B,CAAC;;8BAG1C,CAAD;;;;kCAGG,CAAC;8BAAqC,CAAC;+B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AAC;wCAAwC,CAAC;yBAAyB,CAAC;sBAA6B,CAAC;sCAAsC,CAAC;wBAA+B,CAAC;yBAAyB,CAAC;yBAAgC,CAAC;8BAAqC,CAAC;;;;;;;;0BAAiK,kBAAmB,SAAS;;;;8BAA2F,CAAC;sBAAsB,CAAC;0BAAyB,kBAAmB,SAAS;;;;8BAA2F,CAAC;sBAAsB,CAAC;wBAAwB,CAAC,EAAC,kBAAmB,SAAS;2BAA+B,CAAC;;;;;;;;;;;;;;;;;;;;;;mCAD9oe,CAAA"}
@@ -0,0 +1,52 @@
1
+ // This file is automatically generated. Do not edit it directly.
2
+ import { createMiddleware } from '@tanstack/react-start';
3
+ import { getRequest } from '@tanstack/react-start/server';
4
+ import { createClient } from '@supabase/supabase-js';
5
+ export const requireSupabaseAuth = createMiddleware({ type: 'function' }).server(async ({ next }) => {
6
+ const SUPABASE_URL = process.env.SUPABASE_URL;
7
+ const SUPABASE_PUBLISHABLE_KEY = process.env.SUPABASE_PUBLISHABLE_KEY;
8
+ if (!SUPABASE_URL || !SUPABASE_PUBLISHABLE_KEY) {
9
+ throw new Response('Missing Supabase environment variables. Ensure SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY are set.', { status: 500 });
10
+ }
11
+ const request = getRequest();
12
+ if (!request?.headers) {
13
+ throw new Response('Unauthorized: No request headers available', { status: 401 });
14
+ }
15
+ const authHeader = request.headers.get('authorization');
16
+ if (!authHeader) {
17
+ throw new Response('Unauthorized: No authorization header provided', { status: 401 });
18
+ }
19
+ if (!authHeader.startsWith('Bearer ')) {
20
+ throw new Response('Unauthorized: Only Bearer tokens are supported', { status: 401 });
21
+ }
22
+ const token = authHeader.replace('Bearer ', '');
23
+ if (!token) {
24
+ throw new Response('Unauthorized: No token provided', { status: 401 });
25
+ }
26
+ const supabase = createClient(SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, {
27
+ global: {
28
+ headers: {
29
+ Authorization: `Bearer ${token}`,
30
+ },
31
+ },
32
+ auth: {
33
+ storage: undefined,
34
+ persistSession: false,
35
+ autoRefreshToken: false,
36
+ },
37
+ });
38
+ const { data, error } = await supabase.auth.getClaims(token);
39
+ if (error || !data?.claims) {
40
+ throw new Response('Unauthorized: Invalid token', { status: 401 });
41
+ }
42
+ if (!data.claims.sub) {
43
+ throw new Response('Unauthorized: No user ID found in token', { status: 401 });
44
+ }
45
+ return next({
46
+ context: {
47
+ supabase,
48
+ userId: data.claims.sub,
49
+ claims: data.claims,
50
+ },
51
+ });
52
+ });