@devdash/bofrid-api-types 0.1.5

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 (163) hide show
  1. package/README.md +24 -0
  2. package/dist/app.d.ts +23 -0
  3. package/dist/dev.d.ts +6 -0
  4. package/dist/export-openapi.d.ts +9 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/lib/auth.d.ts +20 -0
  7. package/dist/lib/criipto-bankid.d.ts +45 -0
  8. package/dist/lib/datalake.d.ts +7 -0
  9. package/dist/lib/docs-filter.d.ts +15 -0
  10. package/dist/lib/email-action-token.d.ts +26 -0
  11. package/dist/lib/email-utm.d.ts +42 -0
  12. package/dist/lib/email.d.ts +94 -0
  13. package/dist/lib/env.d.ts +18 -0
  14. package/dist/lib/errors.d.ts +6 -0
  15. package/dist/lib/helpers.d.ts +6 -0
  16. package/dist/lib/logger.d.ts +25 -0
  17. package/dist/lib/markets.d.ts +1 -0
  18. package/dist/lib/org-number.d.ts +5 -0
  19. package/dist/lib/ownership.d.ts +47 -0
  20. package/dist/lib/pdf-watermark.d.ts +25 -0
  21. package/dist/lib/personnummer.d.ts +14 -0
  22. package/dist/lib/posthog.d.ts +51 -0
  23. package/dist/lib/premium.d.ts +13 -0
  24. package/dist/lib/profile-resolver.d.ts +14 -0
  25. package/dist/lib/redirect-state.d.ts +40 -0
  26. package/dist/lib/revalidate.d.ts +23 -0
  27. package/dist/lib/schemas.d.ts +21 -0
  28. package/dist/lib/sentry.d.ts +31 -0
  29. package/dist/lib/slug.d.ts +5 -0
  30. package/dist/lib/sms.d.ts +22 -0
  31. package/dist/lib/system-log.d.ts +31 -0
  32. package/dist/lib/webhook-events.d.ts +26 -0
  33. package/dist/lib/webhooks.d.ts +28 -0
  34. package/dist/middleware/auth-debug.d.ts +17 -0
  35. package/dist/middleware/auth.d.ts +19 -0
  36. package/dist/middleware/bibi-logger.d.ts +6 -0
  37. package/dist/middleware/cors.d.ts +1 -0
  38. package/dist/middleware/request-id.d.ts +10 -0
  39. package/dist/middleware/sentry-context.d.ts +8 -0
  40. package/dist/routes/activity-feed.d.ts +64 -0
  41. package/dist/routes/admin-bevakningar.d.ts +200 -0
  42. package/dist/routes/admin-companies.d.ts +381 -0
  43. package/dist/routes/admin-email-jobs.d.ts +257 -0
  44. package/dist/routes/admin-email-logs.d.ts +9 -0
  45. package/dist/routes/admin-fb-leads.d.ts +32 -0
  46. package/dist/routes/admin-import.d.ts +188 -0
  47. package/dist/routes/admin-login-history.d.ts +9 -0
  48. package/dist/routes/admin-marketing.d.ts +15 -0
  49. package/dist/routes/admin-metabase.d.ts +9 -0
  50. package/dist/routes/admin-notifications.d.ts +7 -0
  51. package/dist/routes/admin-paying-customers.d.ts +74 -0
  52. package/dist/routes/admin-sessions.d.ts +10 -0
  53. package/dist/routes/admin-stats.d.ts +380 -0
  54. package/dist/routes/admin-system-logs.d.ts +10 -0
  55. package/dist/routes/admin-users.d.ts +299 -0
  56. package/dist/routes/admin-webhooks.d.ts +276 -0
  57. package/dist/routes/api-keys.d.ts +123 -0
  58. package/dist/routes/applications.d.ts +385 -0
  59. package/dist/routes/auth.d.ts +15 -0
  60. package/dist/routes/billing.d.ts +369 -0
  61. package/dist/routes/bostadsmerit.d.ts +51 -0
  62. package/dist/routes/companies.d.ts +842 -0
  63. package/dist/routes/contact-reveals.d.ts +102 -0
  64. package/dist/routes/conversations/handlers/conversation.d.ts +5 -0
  65. package/dist/routes/conversations/handlers/initiate.d.ts +4 -0
  66. package/dist/routes/conversations/handlers/messages.d.ts +5 -0
  67. package/dist/routes/conversations/handlers/state.d.ts +5 -0
  68. package/dist/routes/conversations/helpers/access.d.ts +11 -0
  69. package/dist/routes/conversations/helpers/enrich-conversation.d.ts +58 -0
  70. package/dist/routes/conversations/helpers/identity.d.ts +43 -0
  71. package/dist/routes/conversations/helpers/notify-recipient.d.ts +10 -0
  72. package/dist/routes/conversations/helpers/reconcile-reveal.d.ts +10 -0
  73. package/dist/routes/conversations/helpers/scrub-contact.d.ts +1 -0
  74. package/dist/routes/conversations/index.d.ts +422 -0
  75. package/dist/routes/conversations/routes.d.ts +924 -0
  76. package/dist/routes/conversations/schemas.d.ts +216 -0
  77. package/dist/routes/cron.d.ts +27 -0
  78. package/dist/routes/documents.d.ts +493 -0
  79. package/dist/routes/email-actions.d.ts +8 -0
  80. package/dist/routes/fastighetslista.d.ts +94 -0
  81. package/dist/routes/geo.d.ts +518 -0
  82. package/dist/routes/geocoding.d.ts +192 -0
  83. package/dist/routes/health.d.ts +43 -0
  84. package/dist/routes/housing-history.d.ts +381 -0
  85. package/dist/routes/index.d.ts +15321 -0
  86. package/dist/routes/leads.d.ts +281 -0
  87. package/dist/routes/listing-helpers.d.ts +33 -0
  88. package/dist/routes/listing-publications.d.ts +636 -0
  89. package/dist/routes/listings.d.ts +1846 -0
  90. package/dist/routes/location-interests.d.ts +754 -0
  91. package/dist/routes/lookup.d.ts +109 -0
  92. package/dist/routes/mejl.d.ts +377 -0
  93. package/dist/routes/profiles.d.ts +281 -0
  94. package/dist/routes/properties.d.ts +1266 -0
  95. package/dist/routes/public-listings.d.ts +1137 -0
  96. package/dist/routes/public-profiles.d.ts +293 -0
  97. package/dist/routes/references.d.ts +695 -0
  98. package/dist/routes/search-partners.d.ts +4 -0
  99. package/dist/routes/site-config.d.ts +103 -0
  100. package/dist/routes/storage.d.ts +367 -0
  101. package/dist/routes/tenant-boost.d.ts +229 -0
  102. package/dist/routes/tenants.d.ts +336 -0
  103. package/dist/routes/track.d.ts +19 -0
  104. package/dist/routes/translate.d.ts +51 -0
  105. package/dist/routes/users.d.ts +517 -0
  106. package/dist/routes/verification.d.ts +175 -0
  107. package/dist/routes/webhooks.d.ts +9 -0
  108. package/dist/rpc.d.ts +11 -0
  109. package/dist/serve.d.ts +5 -0
  110. package/dist/services/activity-feed/activity-feed.service.d.ts +26 -0
  111. package/dist/services/applications/approval.service.d.ts +17 -0
  112. package/dist/services/auth/bankid-login.service.d.ts +40 -0
  113. package/dist/services/billing/constants.d.ts +2 -0
  114. package/dist/services/billing/contact-billing.service.d.ts +59 -0
  115. package/dist/services/billing/customer.service.d.ts +14 -0
  116. package/dist/services/billing/invoice-item.service.d.ts +49 -0
  117. package/dist/services/billing/invoice.service.d.ts +21 -0
  118. package/dist/services/billing/listing-upgrade-checkout.service.d.ts +45 -0
  119. package/dist/services/billing/purchase-receipt-email.d.ts +23 -0
  120. package/dist/services/billing/reveal-allowance.service.d.ts +33 -0
  121. package/dist/services/billing/stripe.d.ts +6 -0
  122. package/dist/services/billing/subscription.service.d.ts +21 -0
  123. package/dist/services/billing/types.d.ts +64 -0
  124. package/dist/services/billing/verify-session.service.d.ts +17 -0
  125. package/dist/services/billing/webhook.service.d.ts +8 -0
  126. package/dist/services/bostadsmerit/calculator.d.ts +51 -0
  127. package/dist/services/bostadsmerit/couple-calculator.d.ts +46 -0
  128. package/dist/services/bostadsmerit/tracker.service.d.ts +45 -0
  129. package/dist/services/chat-access/unlock-chat.service.d.ts +62 -0
  130. package/dist/services/conversations/upsert-conversation.d.ts +11 -0
  131. package/dist/services/email-jobs/email-job-sender.d.ts +7 -0
  132. package/dist/services/email-jobs/email-job.service.d.ts +67 -0
  133. package/dist/services/geo/bevakning-matching.service.d.ts +67 -0
  134. package/dist/services/geo/geo-listings.service.d.ts +38 -0
  135. package/dist/services/geo/geo.service.d.ts +233 -0
  136. package/dist/services/geo/geocode.service.d.ts +16 -0
  137. package/dist/services/geo/market-insights-by-coords.service.d.ts +67 -0
  138. package/dist/services/geo/market-insights.service.d.ts +44 -0
  139. package/dist/services/geo/market-overview.service.d.ts +42 -0
  140. package/dist/services/homii/image.d.ts +24 -0
  141. package/dist/services/homii/index.d.ts +12 -0
  142. package/dist/services/homii/location.d.ts +32 -0
  143. package/dist/services/homii/mapper.d.ts +41 -0
  144. package/dist/services/homii/types.d.ts +91 -0
  145. package/dist/services/leads/constants.d.ts +32 -0
  146. package/dist/services/leads/generate-leads.service.d.ts +38 -0
  147. package/dist/services/leads/matching.service.d.ts +55 -0
  148. package/dist/services/leads/tier.service.d.ts +6 -0
  149. package/dist/services/leads/types.d.ts +27 -0
  150. package/dist/services/listings/seo.service.d.ts +57 -0
  151. package/dist/services/listings/status.d.ts +37 -0
  152. package/dist/services/mejl/client.d.ts +38 -0
  153. package/dist/services/mrkoll/client.d.ts +95 -0
  154. package/dist/services/mrkoll/import.d.ts +38 -0
  155. package/dist/services/mrkoll/match.d.ts +35 -0
  156. package/dist/services/notifications/bibi-projects.d.ts +43 -0
  157. package/dist/services/notifications/bibi.d.ts +229 -0
  158. package/dist/services/profiles/bankid-verify.d.ts +23 -0
  159. package/dist/services/realtime.d.ts +14 -0
  160. package/dist/services/references/history-linker.d.ts +19 -0
  161. package/dist/services/tenant-boost/constants.d.ts +120 -0
  162. package/dist/services/tenant-boost/tenant-boost.service.d.ts +59 -0
  163. package/package.json +29 -0
@@ -0,0 +1,381 @@
1
+ /**
2
+ * Admin company management routes.
3
+ *
4
+ * Provides endpoints for listing/searching companies with aggregated stats.
5
+ * All routes are protected by authMiddleware + adminMiddleware.
6
+ */
7
+ import { OpenAPIHono } from "@hono/zod-openapi";
8
+ import type { AppBindings } from "../app";
9
+ export declare const adminCompaniesApp: OpenAPIHono<AppBindings, {
10
+ "/admin/companies/:id": {
11
+ $get: {
12
+ input: {
13
+ param: {
14
+ id: string;
15
+ };
16
+ };
17
+ output: {
18
+ description: string | null;
19
+ properties: {
20
+ status: string;
21
+ id: string;
22
+ shortId: string | null;
23
+ createdAt: string;
24
+ street: string;
25
+ streetNumber: string | null;
26
+ postalCode: string | null;
27
+ city: string;
28
+ propertyType: string | null;
29
+ propertySize: number | null;
30
+ totalRooms: number | null;
31
+ baseMonthlyRent: number | null;
32
+ listing: {
33
+ status: string;
34
+ id: string;
35
+ slug: string | null;
36
+ publicUrl: string | null;
37
+ viewCount: number;
38
+ pendingReview: boolean;
39
+ publishedAt: string | null;
40
+ } | null;
41
+ }[];
42
+ email: string | null;
43
+ id: string;
44
+ phoneNumber: string | null;
45
+ stripeCustomerId: string | null;
46
+ createdAt: string;
47
+ updatedAt: string;
48
+ freeRevealsPerMonth: number | null;
49
+ ownerId: string;
50
+ companyName: string;
51
+ organizationNumber: string | null;
52
+ isActive: boolean;
53
+ slug: string;
54
+ isProfilePublished: boolean;
55
+ isFastighetsbolag: boolean;
56
+ logoUrl: string | null;
57
+ websiteUrl: string | null;
58
+ addressStreet: string | null;
59
+ addressCity: string | null;
60
+ addressPostalCode: string | null;
61
+ members: {
62
+ status: string;
63
+ email: string | null;
64
+ displayName: string;
65
+ phoneNumber: string | null;
66
+ profilePictureUrl: string | null;
67
+ role: string;
68
+ authUserId: string | null;
69
+ userId: string;
70
+ joinedAt: string | null;
71
+ invitedByName: string | null;
72
+ }[];
73
+ invitations: {
74
+ email: string;
75
+ id: string;
76
+ role: string;
77
+ createdAt: string;
78
+ invitedByName: string | null;
79
+ }[];
80
+ ownerName: string | null;
81
+ ownerAuthUserId: string | null;
82
+ };
83
+ outputFormat: "json";
84
+ status: 200;
85
+ } | {
86
+ input: {
87
+ param: {
88
+ id: string;
89
+ };
90
+ };
91
+ output: {
92
+ error: string;
93
+ };
94
+ outputFormat: "json";
95
+ status: 401;
96
+ } | {
97
+ input: {
98
+ param: {
99
+ id: string;
100
+ };
101
+ };
102
+ output: {
103
+ error: string;
104
+ };
105
+ outputFormat: "json";
106
+ status: 403;
107
+ } | {
108
+ input: {
109
+ param: {
110
+ id: string;
111
+ };
112
+ };
113
+ output: {
114
+ error: string;
115
+ };
116
+ outputFormat: "json";
117
+ status: 404;
118
+ };
119
+ };
120
+ } & {
121
+ "/admin/companies/:id": {
122
+ $patch: {
123
+ input: {
124
+ param: {
125
+ id: string;
126
+ };
127
+ } & {
128
+ json: {
129
+ isActive?: boolean | undefined;
130
+ isProfilePublished?: boolean | undefined;
131
+ isFastighetsbolag?: boolean | undefined;
132
+ };
133
+ };
134
+ output: {
135
+ error: string;
136
+ };
137
+ outputFormat: "json";
138
+ status: 404;
139
+ } | {
140
+ input: {
141
+ param: {
142
+ id: string;
143
+ };
144
+ } & {
145
+ json: {
146
+ isActive?: boolean | undefined;
147
+ isProfilePublished?: boolean | undefined;
148
+ isFastighetsbolag?: boolean | undefined;
149
+ };
150
+ };
151
+ output: {
152
+ success: boolean;
153
+ };
154
+ outputFormat: "json";
155
+ status: 200;
156
+ } | {
157
+ input: {
158
+ param: {
159
+ id: string;
160
+ };
161
+ } & {
162
+ json: {
163
+ isActive?: boolean | undefined;
164
+ isProfilePublished?: boolean | undefined;
165
+ isFastighetsbolag?: boolean | undefined;
166
+ };
167
+ };
168
+ output: {
169
+ error: string;
170
+ };
171
+ outputFormat: "json";
172
+ status: 400;
173
+ };
174
+ };
175
+ } & {
176
+ "/admin/companies/:id/invite-member": {
177
+ $post: {
178
+ input: {
179
+ param: {
180
+ id: string;
181
+ };
182
+ } & {
183
+ json: {
184
+ email: string;
185
+ role?: "member" | "admin" | undefined;
186
+ };
187
+ };
188
+ output: {
189
+ error: string;
190
+ };
191
+ outputFormat: "json";
192
+ status: 404;
193
+ } | {
194
+ input: {
195
+ param: {
196
+ id: string;
197
+ };
198
+ } & {
199
+ json: {
200
+ email: string;
201
+ role?: "member" | "admin" | undefined;
202
+ };
203
+ };
204
+ output: {
205
+ message: string;
206
+ status: "invited" | "pending";
207
+ };
208
+ outputFormat: "json";
209
+ status: 200;
210
+ } | {
211
+ input: {
212
+ param: {
213
+ id: string;
214
+ };
215
+ } & {
216
+ json: {
217
+ email: string;
218
+ role?: "member" | "admin" | undefined;
219
+ };
220
+ };
221
+ output: {
222
+ message: string;
223
+ status: "invited" | "pending";
224
+ };
225
+ outputFormat: "json";
226
+ status: 201;
227
+ } | {
228
+ input: {
229
+ param: {
230
+ id: string;
231
+ };
232
+ } & {
233
+ json: {
234
+ email: string;
235
+ role?: "member" | "admin" | undefined;
236
+ };
237
+ };
238
+ output: {
239
+ error: string;
240
+ };
241
+ outputFormat: "json";
242
+ status: 409;
243
+ };
244
+ };
245
+ } & {
246
+ "/admin/companies": {
247
+ $get: {
248
+ input: {
249
+ query: {
250
+ status?: "active" | "all" | "inactive" | undefined;
251
+ limit?: number | undefined;
252
+ offset?: number | undefined;
253
+ sortField?: "createdAt" | "companyName" | "listingCount" | "propertyCount" | "memberCount" | undefined;
254
+ sortDir?: "asc" | "desc" | undefined;
255
+ q?: string | undefined;
256
+ };
257
+ };
258
+ output: {
259
+ error: string;
260
+ };
261
+ outputFormat: "json";
262
+ status: 401;
263
+ } | {
264
+ input: {
265
+ query: {
266
+ status?: "active" | "all" | "inactive" | undefined;
267
+ limit?: number | undefined;
268
+ offset?: number | undefined;
269
+ sortField?: "createdAt" | "companyName" | "listingCount" | "propertyCount" | "memberCount" | undefined;
270
+ sortDir?: "asc" | "desc" | undefined;
271
+ q?: string | undefined;
272
+ };
273
+ };
274
+ output: {
275
+ error: string;
276
+ };
277
+ outputFormat: "json";
278
+ status: 403;
279
+ } | {
280
+ input: {
281
+ query: {
282
+ status?: "active" | "all" | "inactive" | undefined;
283
+ limit?: number | undefined;
284
+ offset?: number | undefined;
285
+ sortField?: "createdAt" | "companyName" | "listingCount" | "propertyCount" | "memberCount" | undefined;
286
+ sortDir?: "asc" | "desc" | undefined;
287
+ q?: string | undefined;
288
+ };
289
+ };
290
+ output: {
291
+ items: {
292
+ email: string | null;
293
+ id: string;
294
+ phoneNumber: string | null;
295
+ createdAt: string;
296
+ updatedAt: string;
297
+ ownerId: string;
298
+ companyName: string;
299
+ organizationNumber: string | null;
300
+ isActive: boolean;
301
+ slug: string;
302
+ isProfilePublished: boolean;
303
+ isFastighetsbolag: boolean;
304
+ logoUrl: string | null;
305
+ addressCity: string | null;
306
+ listingCount: number;
307
+ propertyCount: number;
308
+ ownerName: string | null;
309
+ memberCount: number;
310
+ }[];
311
+ limit: number;
312
+ offset: number;
313
+ total: number;
314
+ };
315
+ outputFormat: "json";
316
+ status: 200;
317
+ };
318
+ };
319
+ } & {
320
+ "/admin/companies/:id/reveal-allowance": {
321
+ $get: {
322
+ input: {
323
+ param: {
324
+ id: string;
325
+ };
326
+ };
327
+ output: {
328
+ error: string;
329
+ };
330
+ outputFormat: "json";
331
+ status: 404;
332
+ } | {
333
+ input: {
334
+ param: {
335
+ id: string;
336
+ };
337
+ };
338
+ output: {
339
+ limit: number | null;
340
+ globalDefault: number;
341
+ };
342
+ outputFormat: "json";
343
+ status: 200;
344
+ };
345
+ };
346
+ } & {
347
+ "/admin/companies/:id/reveal-allowance": {
348
+ $put: {
349
+ input: {
350
+ param: {
351
+ id: string;
352
+ };
353
+ } & {
354
+ json: {
355
+ limit: number | null;
356
+ };
357
+ };
358
+ output: {
359
+ error: string;
360
+ };
361
+ outputFormat: "json";
362
+ status: 404;
363
+ } | {
364
+ input: {
365
+ param: {
366
+ id: string;
367
+ };
368
+ } & {
369
+ json: {
370
+ limit: number | null;
371
+ };
372
+ };
373
+ output: {
374
+ limit: number | null;
375
+ globalDefault: number;
376
+ };
377
+ outputFormat: "json";
378
+ status: 200;
379
+ };
380
+ };
381
+ }, "/">;
@@ -0,0 +1,257 @@
1
+ /**
2
+ * Admin email job routes — create, monitor, cancel bulk email jobs.
3
+ *
4
+ * All routes require auth + admin.
5
+ */
6
+ import { OpenAPIHono } from "@hono/zod-openapi";
7
+ import type { AppBindings } from "../app";
8
+ export declare const adminEmailJobsApp: OpenAPIHono<AppBindings, {
9
+ "/admin/email-jobs": {
10
+ $get: {
11
+ input: {
12
+ query: {
13
+ limit?: string | undefined;
14
+ referenceId?: string | undefined;
15
+ };
16
+ };
17
+ output: {
18
+ items: {
19
+ type: string;
20
+ status: string;
21
+ id: string;
22
+ createdAt: string;
23
+ createdBy: string | null;
24
+ referenceId: string | null;
25
+ totalItems: number;
26
+ sentCount: number;
27
+ failedCount: number;
28
+ startedAt: string | null;
29
+ completedAt: string | null;
30
+ cancelledAt: string | null;
31
+ pendingCount: number;
32
+ referenceLabel: string | null;
33
+ cancelledCount: number;
34
+ }[];
35
+ };
36
+ outputFormat: "json";
37
+ status: 200;
38
+ };
39
+ };
40
+ } & {
41
+ "/admin/email-jobs/active": {
42
+ $get: {
43
+ input: {};
44
+ output: {
45
+ job: {
46
+ type: string;
47
+ status: string;
48
+ id: string;
49
+ createdAt: string;
50
+ createdBy: string | null;
51
+ referenceId: string | null;
52
+ totalItems: number;
53
+ sentCount: number;
54
+ failedCount: number;
55
+ startedAt: string | null;
56
+ completedAt: string | null;
57
+ cancelledAt: string | null;
58
+ pendingCount: number;
59
+ referenceLabel: string | null;
60
+ cancelledCount: number;
61
+ } | null;
62
+ };
63
+ outputFormat: "json";
64
+ status: 200;
65
+ };
66
+ };
67
+ } & {
68
+ "/admin/email-jobs/:id": {
69
+ $get: {
70
+ input: {
71
+ param: {
72
+ id: string;
73
+ };
74
+ };
75
+ output: {
76
+ type: string;
77
+ status: string;
78
+ id: string;
79
+ createdAt: string;
80
+ createdBy: string | null;
81
+ referenceId: string | null;
82
+ totalItems: number;
83
+ sentCount: number;
84
+ failedCount: number;
85
+ startedAt: string | null;
86
+ completedAt: string | null;
87
+ cancelledAt: string | null;
88
+ pendingCount: number;
89
+ referenceLabel: string | null;
90
+ cancelledCount: number;
91
+ };
92
+ outputFormat: "json";
93
+ status: 200;
94
+ } | {
95
+ input: {
96
+ param: {
97
+ id: string;
98
+ };
99
+ };
100
+ output: {
101
+ error: string;
102
+ };
103
+ outputFormat: "json";
104
+ status: 404;
105
+ };
106
+ };
107
+ } & {
108
+ "/admin/email-jobs/:id/cancel": {
109
+ $post: {
110
+ input: {
111
+ param: {
112
+ id: string;
113
+ };
114
+ };
115
+ output: {
116
+ type: string;
117
+ status: string;
118
+ id: string;
119
+ createdAt: string;
120
+ createdBy: string | null;
121
+ referenceId: string | null;
122
+ totalItems: number;
123
+ sentCount: number;
124
+ failedCount: number;
125
+ startedAt: string | null;
126
+ completedAt: string | null;
127
+ cancelledAt: string | null;
128
+ pendingCount: number;
129
+ referenceLabel: string | null;
130
+ cancelledCount: number;
131
+ };
132
+ outputFormat: "json";
133
+ status: 200;
134
+ } | {
135
+ input: {
136
+ param: {
137
+ id: string;
138
+ };
139
+ };
140
+ output: {
141
+ error: string;
142
+ };
143
+ outputFormat: "json";
144
+ status: 404;
145
+ } | {
146
+ input: {
147
+ param: {
148
+ id: string;
149
+ };
150
+ };
151
+ output: {
152
+ error: string;
153
+ };
154
+ outputFormat: "json";
155
+ status: 400;
156
+ };
157
+ };
158
+ } & {
159
+ "/admin/email-jobs/:id/retry": {
160
+ $post: {
161
+ input: {
162
+ param: {
163
+ id: string;
164
+ };
165
+ };
166
+ output: {
167
+ type: string;
168
+ status: string;
169
+ id: string;
170
+ createdAt: string;
171
+ createdBy: string | null;
172
+ referenceId: string | null;
173
+ totalItems: number;
174
+ sentCount: number;
175
+ failedCount: number;
176
+ startedAt: string | null;
177
+ completedAt: string | null;
178
+ cancelledAt: string | null;
179
+ pendingCount: number;
180
+ referenceLabel: string | null;
181
+ cancelledCount: number;
182
+ };
183
+ outputFormat: "json";
184
+ status: 200;
185
+ } | {
186
+ input: {
187
+ param: {
188
+ id: string;
189
+ };
190
+ };
191
+ output: {
192
+ error: string;
193
+ };
194
+ outputFormat: "json";
195
+ status: 404;
196
+ } | {
197
+ input: {
198
+ param: {
199
+ id: string;
200
+ };
201
+ };
202
+ output: {
203
+ error: string;
204
+ };
205
+ outputFormat: "json";
206
+ status: 400;
207
+ };
208
+ };
209
+ } & {
210
+ "/admin/email-jobs/:id/items": {
211
+ $get: {
212
+ input: {
213
+ param: {
214
+ id: string;
215
+ };
216
+ } & {
217
+ query: {
218
+ status?: string | undefined;
219
+ limit?: string | undefined;
220
+ offset?: string | undefined;
221
+ };
222
+ };
223
+ output: {
224
+ error: string;
225
+ };
226
+ outputFormat: "json";
227
+ status: 404;
228
+ } | {
229
+ input: {
230
+ param: {
231
+ id: string;
232
+ };
233
+ } & {
234
+ query: {
235
+ status?: string | undefined;
236
+ limit?: string | undefined;
237
+ offset?: string | undefined;
238
+ };
239
+ };
240
+ output: {
241
+ items: {
242
+ status: string;
243
+ id: string;
244
+ recipientEmail: string;
245
+ recipientUserId: string | null;
246
+ attempts: number;
247
+ lastError: string | null;
248
+ processedAt: string | null;
249
+ recipientName: string | null;
250
+ }[];
251
+ total: number;
252
+ };
253
+ outputFormat: "json";
254
+ status: 200;
255
+ };
256
+ };
257
+ }, "/">;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Admin email logs routes — view all transactional email logs.
3
+ *
4
+ * All routes require auth + admin.
5
+ */
6
+ import { OpenAPIHono } from "@hono/zod-openapi";
7
+ import type { AppBindings } from "../app";
8
+ declare const app: OpenAPIHono<AppBindings, {}, "/">;
9
+ export { app as adminEmailLogsApp };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Admin Facebook leads import routes.
3
+ *
4
+ * Imports tenant leads scraped from Bofrid's Facebook groups (stored in the
5
+ * self-hosted Supabase datalake at supabase.bofrid.dev) into the main Bofrid
6
+ * system as ghost profiles with city-based bevakningar.
7
+ *
8
+ * ## Endpoints
9
+ *
10
+ * - `POST /admin/fb-leads/import` — Import new fb_leads as ghost profiles + bevakningar
11
+ * - `GET /admin/fb-leads/stats` — Overview of imported vs pending fb_leads
12
+ *
13
+ * ## How it works
14
+ *
15
+ * 1. Fetches tenant fb_leads (with email) from the datalake, joined with
16
+ * `fb_groups` to get kommun/län slugs.
17
+ * 2. For each lead not yet in Bofrid (by email match), creates:
18
+ * - A `bofrid_profiles` record with `authProvider = 'facebook_import'` and no `authUserId`.
19
+ * - A `bofrid_location_interests` record (bevakning) tied to the lead's city.
20
+ * 3. The existing bevakning email pipeline picks up these profiles automatically
21
+ * when a matching listing is published in their city.
22
+ * 4. When they register on Bofrid, the Better Auth `afterUserCreated` hook
23
+ * auto-links the existing profile by email — bevakning carries over seamlessly.
24
+ *
25
+ * ## Idempotency
26
+ *
27
+ * Safe to call repeatedly. Leads whose email already exists in `bofrid_profiles`
28
+ * are skipped. New leads added to the datalake since the last import are picked up.
29
+ */
30
+ import { OpenAPIHono } from "@hono/zod-openapi";
31
+ import type { AppBindings } from "../app";
32
+ export declare const adminFbLeadsApp: OpenAPIHono<AppBindings, {}, "/">;