@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.
- package/README.md +24 -0
- package/dist/app.d.ts +23 -0
- package/dist/dev.d.ts +6 -0
- package/dist/export-openapi.d.ts +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/lib/auth.d.ts +20 -0
- package/dist/lib/criipto-bankid.d.ts +45 -0
- package/dist/lib/datalake.d.ts +7 -0
- package/dist/lib/docs-filter.d.ts +15 -0
- package/dist/lib/email-action-token.d.ts +26 -0
- package/dist/lib/email-utm.d.ts +42 -0
- package/dist/lib/email.d.ts +94 -0
- package/dist/lib/env.d.ts +18 -0
- package/dist/lib/errors.d.ts +6 -0
- package/dist/lib/helpers.d.ts +6 -0
- package/dist/lib/logger.d.ts +25 -0
- package/dist/lib/markets.d.ts +1 -0
- package/dist/lib/org-number.d.ts +5 -0
- package/dist/lib/ownership.d.ts +47 -0
- package/dist/lib/pdf-watermark.d.ts +25 -0
- package/dist/lib/personnummer.d.ts +14 -0
- package/dist/lib/posthog.d.ts +51 -0
- package/dist/lib/premium.d.ts +13 -0
- package/dist/lib/profile-resolver.d.ts +14 -0
- package/dist/lib/redirect-state.d.ts +40 -0
- package/dist/lib/revalidate.d.ts +23 -0
- package/dist/lib/schemas.d.ts +21 -0
- package/dist/lib/sentry.d.ts +31 -0
- package/dist/lib/slug.d.ts +5 -0
- package/dist/lib/sms.d.ts +22 -0
- package/dist/lib/system-log.d.ts +31 -0
- package/dist/lib/webhook-events.d.ts +26 -0
- package/dist/lib/webhooks.d.ts +28 -0
- package/dist/middleware/auth-debug.d.ts +17 -0
- package/dist/middleware/auth.d.ts +19 -0
- package/dist/middleware/bibi-logger.d.ts +6 -0
- package/dist/middleware/cors.d.ts +1 -0
- package/dist/middleware/request-id.d.ts +10 -0
- package/dist/middleware/sentry-context.d.ts +8 -0
- package/dist/routes/activity-feed.d.ts +64 -0
- package/dist/routes/admin-bevakningar.d.ts +200 -0
- package/dist/routes/admin-companies.d.ts +381 -0
- package/dist/routes/admin-email-jobs.d.ts +257 -0
- package/dist/routes/admin-email-logs.d.ts +9 -0
- package/dist/routes/admin-fb-leads.d.ts +32 -0
- package/dist/routes/admin-import.d.ts +188 -0
- package/dist/routes/admin-login-history.d.ts +9 -0
- package/dist/routes/admin-marketing.d.ts +15 -0
- package/dist/routes/admin-metabase.d.ts +9 -0
- package/dist/routes/admin-notifications.d.ts +7 -0
- package/dist/routes/admin-paying-customers.d.ts +74 -0
- package/dist/routes/admin-sessions.d.ts +10 -0
- package/dist/routes/admin-stats.d.ts +380 -0
- package/dist/routes/admin-system-logs.d.ts +10 -0
- package/dist/routes/admin-users.d.ts +299 -0
- package/dist/routes/admin-webhooks.d.ts +276 -0
- package/dist/routes/api-keys.d.ts +123 -0
- package/dist/routes/applications.d.ts +385 -0
- package/dist/routes/auth.d.ts +15 -0
- package/dist/routes/billing.d.ts +369 -0
- package/dist/routes/bostadsmerit.d.ts +51 -0
- package/dist/routes/companies.d.ts +842 -0
- package/dist/routes/contact-reveals.d.ts +102 -0
- package/dist/routes/conversations/handlers/conversation.d.ts +5 -0
- package/dist/routes/conversations/handlers/initiate.d.ts +4 -0
- package/dist/routes/conversations/handlers/messages.d.ts +5 -0
- package/dist/routes/conversations/handlers/state.d.ts +5 -0
- package/dist/routes/conversations/helpers/access.d.ts +11 -0
- package/dist/routes/conversations/helpers/enrich-conversation.d.ts +58 -0
- package/dist/routes/conversations/helpers/identity.d.ts +43 -0
- package/dist/routes/conversations/helpers/notify-recipient.d.ts +10 -0
- package/dist/routes/conversations/helpers/reconcile-reveal.d.ts +10 -0
- package/dist/routes/conversations/helpers/scrub-contact.d.ts +1 -0
- package/dist/routes/conversations/index.d.ts +422 -0
- package/dist/routes/conversations/routes.d.ts +924 -0
- package/dist/routes/conversations/schemas.d.ts +216 -0
- package/dist/routes/cron.d.ts +27 -0
- package/dist/routes/documents.d.ts +493 -0
- package/dist/routes/email-actions.d.ts +8 -0
- package/dist/routes/fastighetslista.d.ts +94 -0
- package/dist/routes/geo.d.ts +518 -0
- package/dist/routes/geocoding.d.ts +192 -0
- package/dist/routes/health.d.ts +43 -0
- package/dist/routes/housing-history.d.ts +381 -0
- package/dist/routes/index.d.ts +15321 -0
- package/dist/routes/leads.d.ts +281 -0
- package/dist/routes/listing-helpers.d.ts +33 -0
- package/dist/routes/listing-publications.d.ts +636 -0
- package/dist/routes/listings.d.ts +1846 -0
- package/dist/routes/location-interests.d.ts +754 -0
- package/dist/routes/lookup.d.ts +109 -0
- package/dist/routes/mejl.d.ts +377 -0
- package/dist/routes/profiles.d.ts +281 -0
- package/dist/routes/properties.d.ts +1266 -0
- package/dist/routes/public-listings.d.ts +1137 -0
- package/dist/routes/public-profiles.d.ts +293 -0
- package/dist/routes/references.d.ts +695 -0
- package/dist/routes/search-partners.d.ts +4 -0
- package/dist/routes/site-config.d.ts +103 -0
- package/dist/routes/storage.d.ts +367 -0
- package/dist/routes/tenant-boost.d.ts +229 -0
- package/dist/routes/tenants.d.ts +336 -0
- package/dist/routes/track.d.ts +19 -0
- package/dist/routes/translate.d.ts +51 -0
- package/dist/routes/users.d.ts +517 -0
- package/dist/routes/verification.d.ts +175 -0
- package/dist/routes/webhooks.d.ts +9 -0
- package/dist/rpc.d.ts +11 -0
- package/dist/serve.d.ts +5 -0
- package/dist/services/activity-feed/activity-feed.service.d.ts +26 -0
- package/dist/services/applications/approval.service.d.ts +17 -0
- package/dist/services/auth/bankid-login.service.d.ts +40 -0
- package/dist/services/billing/constants.d.ts +2 -0
- package/dist/services/billing/contact-billing.service.d.ts +59 -0
- package/dist/services/billing/customer.service.d.ts +14 -0
- package/dist/services/billing/invoice-item.service.d.ts +49 -0
- package/dist/services/billing/invoice.service.d.ts +21 -0
- package/dist/services/billing/listing-upgrade-checkout.service.d.ts +45 -0
- package/dist/services/billing/purchase-receipt-email.d.ts +23 -0
- package/dist/services/billing/reveal-allowance.service.d.ts +33 -0
- package/dist/services/billing/stripe.d.ts +6 -0
- package/dist/services/billing/subscription.service.d.ts +21 -0
- package/dist/services/billing/types.d.ts +64 -0
- package/dist/services/billing/verify-session.service.d.ts +17 -0
- package/dist/services/billing/webhook.service.d.ts +8 -0
- package/dist/services/bostadsmerit/calculator.d.ts +51 -0
- package/dist/services/bostadsmerit/couple-calculator.d.ts +46 -0
- package/dist/services/bostadsmerit/tracker.service.d.ts +45 -0
- package/dist/services/chat-access/unlock-chat.service.d.ts +62 -0
- package/dist/services/conversations/upsert-conversation.d.ts +11 -0
- package/dist/services/email-jobs/email-job-sender.d.ts +7 -0
- package/dist/services/email-jobs/email-job.service.d.ts +67 -0
- package/dist/services/geo/bevakning-matching.service.d.ts +67 -0
- package/dist/services/geo/geo-listings.service.d.ts +38 -0
- package/dist/services/geo/geo.service.d.ts +233 -0
- package/dist/services/geo/geocode.service.d.ts +16 -0
- package/dist/services/geo/market-insights-by-coords.service.d.ts +67 -0
- package/dist/services/geo/market-insights.service.d.ts +44 -0
- package/dist/services/geo/market-overview.service.d.ts +42 -0
- package/dist/services/homii/image.d.ts +24 -0
- package/dist/services/homii/index.d.ts +12 -0
- package/dist/services/homii/location.d.ts +32 -0
- package/dist/services/homii/mapper.d.ts +41 -0
- package/dist/services/homii/types.d.ts +91 -0
- package/dist/services/leads/constants.d.ts +32 -0
- package/dist/services/leads/generate-leads.service.d.ts +38 -0
- package/dist/services/leads/matching.service.d.ts +55 -0
- package/dist/services/leads/tier.service.d.ts +6 -0
- package/dist/services/leads/types.d.ts +27 -0
- package/dist/services/listings/seo.service.d.ts +57 -0
- package/dist/services/listings/status.d.ts +37 -0
- package/dist/services/mejl/client.d.ts +38 -0
- package/dist/services/mrkoll/client.d.ts +95 -0
- package/dist/services/mrkoll/import.d.ts +38 -0
- package/dist/services/mrkoll/match.d.ts +35 -0
- package/dist/services/notifications/bibi-projects.d.ts +43 -0
- package/dist/services/notifications/bibi.d.ts +229 -0
- package/dist/services/profiles/bankid-verify.d.ts +23 -0
- package/dist/services/realtime.d.ts +14 -0
- package/dist/services/references/history-linker.d.ts +19 -0
- package/dist/services/tenant-boost/constants.d.ts +120 -0
- package/dist/services/tenant-boost/tenant-boost.service.d.ts +59 -0
- package/package.json +29 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import type { AppBindings } from "../app";
|
|
3
|
+
declare const _routes: OpenAPIHono<AppBindings, {
|
|
4
|
+
"/contact-reveals/history": {
|
|
5
|
+
$get: {
|
|
6
|
+
input: {};
|
|
7
|
+
output: {
|
|
8
|
+
transactions: {
|
|
9
|
+
description: string;
|
|
10
|
+
type: "reveal" | "listing_upgrade";
|
|
11
|
+
date: string;
|
|
12
|
+
id: string;
|
|
13
|
+
listingAddress: string;
|
|
14
|
+
free: boolean;
|
|
15
|
+
priceOre: number;
|
|
16
|
+
source?: string | undefined;
|
|
17
|
+
listingUpgraded?: boolean | undefined;
|
|
18
|
+
}[];
|
|
19
|
+
reveals: {
|
|
20
|
+
id: string;
|
|
21
|
+
revealedAt: string;
|
|
22
|
+
source: string;
|
|
23
|
+
tenantName: string;
|
|
24
|
+
listingAddress: string;
|
|
25
|
+
free: boolean;
|
|
26
|
+
priceOre: number;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
outputFormat: "json";
|
|
30
|
+
status: 200;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
} & {
|
|
34
|
+
"/contact-reveals/allowance": {
|
|
35
|
+
$get: {
|
|
36
|
+
input: {};
|
|
37
|
+
output: {
|
|
38
|
+
limit: number;
|
|
39
|
+
used: number;
|
|
40
|
+
remaining: number;
|
|
41
|
+
resetDate: string;
|
|
42
|
+
};
|
|
43
|
+
outputFormat: "json";
|
|
44
|
+
status: 200;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
} & {
|
|
48
|
+
"/contact-reveals/listing-upgrade/checkout": {
|
|
49
|
+
$post: {
|
|
50
|
+
input: {
|
|
51
|
+
json: {
|
|
52
|
+
listingId: string;
|
|
53
|
+
returnUrl: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
output: {
|
|
57
|
+
error: string;
|
|
58
|
+
};
|
|
59
|
+
outputFormat: "json";
|
|
60
|
+
status: 400;
|
|
61
|
+
} | {
|
|
62
|
+
input: {
|
|
63
|
+
json: {
|
|
64
|
+
listingId: string;
|
|
65
|
+
returnUrl: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
output: {
|
|
69
|
+
alreadyUpgraded: true;
|
|
70
|
+
} | {
|
|
71
|
+
checkoutUrl: string;
|
|
72
|
+
};
|
|
73
|
+
outputFormat: "json";
|
|
74
|
+
status: 200;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
} & {
|
|
78
|
+
"/contact-reveals/listing-upgrade/:listingId": {
|
|
79
|
+
$get: {
|
|
80
|
+
input: {
|
|
81
|
+
param: {
|
|
82
|
+
listingId: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
output: {
|
|
86
|
+
tier: number | null;
|
|
87
|
+
priceOre: number;
|
|
88
|
+
upgraded: boolean;
|
|
89
|
+
priceDisplay: string;
|
|
90
|
+
isFirstListing: boolean;
|
|
91
|
+
discountPercent: number;
|
|
92
|
+
discountedPriceOre: number | null;
|
|
93
|
+
discountedPriceDisplay: string | null;
|
|
94
|
+
};
|
|
95
|
+
outputFormat: "json";
|
|
96
|
+
status: 200;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
}, "/">;
|
|
100
|
+
export type ContactRevealsApp = typeof _routes;
|
|
101
|
+
export declare const contactRevealsApp: OpenAPIHono<AppBindings, {}, "/">;
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RouteHandler } from "@hono/zod-openapi";
|
|
2
|
+
import type { AppBindings } from "../../../app";
|
|
3
|
+
import type { getConversationRoute, listConversationsRoute } from "../routes";
|
|
4
|
+
export declare const handleListConversations: RouteHandler<typeof listConversationsRoute, AppBindings>;
|
|
5
|
+
export declare const handleGetConversation: RouteHandler<typeof getConversationRoute, AppBindings>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RouteHandler } from "@hono/zod-openapi";
|
|
2
|
+
import type { AppBindings } from "../../../app";
|
|
3
|
+
import type { initiateConversationRoute } from "../routes";
|
|
4
|
+
export declare const handleInitiateConversation: RouteHandler<typeof initiateConversationRoute, AppBindings>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RouteHandler } from "@hono/zod-openapi";
|
|
2
|
+
import type { AppBindings } from "../../../app";
|
|
3
|
+
import type { listMessagesRoute, sendMessageRoute } from "../routes";
|
|
4
|
+
export declare const handleListMessages: RouteHandler<typeof listMessagesRoute, AppBindings>;
|
|
5
|
+
export declare const handleSendMessage: RouteHandler<typeof sendMessageRoute, AppBindings>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RouteHandler } from "@hono/zod-openapi";
|
|
2
|
+
import type { AppBindings } from "../../../app";
|
|
3
|
+
import type { archiveConversationRoute, markReadRoute } from "../routes";
|
|
4
|
+
export declare const handleMarkRead: RouteHandler<typeof markReadRoute, AppBindings>;
|
|
5
|
+
export declare const handleArchiveConversation: RouteHandler<typeof archiveConversationRoute, AppBindings>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a user can access a conversation.
|
|
3
|
+
* Access is granted if the user is a direct participant OR an active member
|
|
4
|
+
* of the company that owns the listing's property.
|
|
5
|
+
*/
|
|
6
|
+
export declare function verifyParticipant(conversationId: string, profileId: string): Promise<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Ensure a participant row exists for a user in a conversation.
|
|
9
|
+
* Used to lazily create participant records for company members on first interaction.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ensureParticipant(conversationId: string, profileId: string): Promise<void>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a single conversation list item with all enrichment.
|
|
3
|
+
* Used by both list and get-single handlers.
|
|
4
|
+
*/
|
|
5
|
+
export declare function enrichConversation(conv: {
|
|
6
|
+
id: string;
|
|
7
|
+
listingId: string;
|
|
8
|
+
tenantId: string;
|
|
9
|
+
landlordId: string;
|
|
10
|
+
isLocked: boolean;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
propertyId?: string | null;
|
|
14
|
+
street: string | null;
|
|
15
|
+
streetNumber: string | null;
|
|
16
|
+
city: string | null;
|
|
17
|
+
totalRooms?: number | null;
|
|
18
|
+
propertySize?: number | null;
|
|
19
|
+
publicUrl?: string | null;
|
|
20
|
+
publicUrlEn?: string | null;
|
|
21
|
+
upgradedAt?: Date | null;
|
|
22
|
+
}, profileId: string,
|
|
23
|
+
/** Viewer-specific archived state; defaults to false if no participant row yet. */
|
|
24
|
+
archived?: boolean): Promise<{
|
|
25
|
+
id: string;
|
|
26
|
+
listingId: string;
|
|
27
|
+
tenantId: string;
|
|
28
|
+
landlordId: string;
|
|
29
|
+
userRole: "tenant" | "landlord";
|
|
30
|
+
isLocked: boolean;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
otherParticipant: {
|
|
34
|
+
id: string;
|
|
35
|
+
displayName: string | null;
|
|
36
|
+
fullName: string | null;
|
|
37
|
+
profilePictureUrl: string | null;
|
|
38
|
+
};
|
|
39
|
+
listing: {
|
|
40
|
+
propertyId: string | null;
|
|
41
|
+
street: string | null;
|
|
42
|
+
streetNumber: string | null;
|
|
43
|
+
city: string | null;
|
|
44
|
+
totalRooms: number | null;
|
|
45
|
+
propertySize: number | null;
|
|
46
|
+
publicUrl: string | null;
|
|
47
|
+
publicUrlEn: string | null;
|
|
48
|
+
upgradedAt: string | null;
|
|
49
|
+
};
|
|
50
|
+
lastMessage: {
|
|
51
|
+
body: string;
|
|
52
|
+
senderId: string;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
} | null;
|
|
55
|
+
unreadCount: number;
|
|
56
|
+
otherParticipantLastReadAt: string | null;
|
|
57
|
+
archived: boolean;
|
|
58
|
+
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Privacy masking rules for chat identities.
|
|
3
|
+
*
|
|
4
|
+
* Tenants viewing a private (non-company) landlord only ever see the landlord's
|
|
5
|
+
* first name — full name is never exposed to tenants in chat.
|
|
6
|
+
* Landlords viewing a tenant only see the first name while the chat is locked;
|
|
7
|
+
* unlocking reveals the full name.
|
|
8
|
+
* Company listings always render as the company name + logo (the landlord's
|
|
9
|
+
* personal identity is exposed only via `memberName` for landlord-side viewers).
|
|
10
|
+
*
|
|
11
|
+
* This is the SINGLE source of truth — `enrichConversation` and the message
|
|
12
|
+
* list handler both call into here. Drift across two copies would silently
|
|
13
|
+
* leak names; don't reimplement.
|
|
14
|
+
*/
|
|
15
|
+
export declare function firstNameOnly(name: string | null | undefined): string | null;
|
|
16
|
+
export interface MaskIdentityArgs {
|
|
17
|
+
/** Role of the identity being rendered (NOT the viewer's role). */
|
|
18
|
+
subjectRole: "landlord" | "tenant";
|
|
19
|
+
/** Viewer's role in the conversation. */
|
|
20
|
+
viewerRole: "landlord" | "tenant";
|
|
21
|
+
/** Whether the listing is owned by a company. */
|
|
22
|
+
isCompanyListing: boolean;
|
|
23
|
+
/** Effective locked state (with upgradedAt override applied). */
|
|
24
|
+
isLocked: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface MaskedIdentity {
|
|
27
|
+
/** Show full personal name (or company name) as-is. */
|
|
28
|
+
showFullName: boolean;
|
|
29
|
+
/** Render company branding instead of personal identity. */
|
|
30
|
+
showAsCompany: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function resolveIdentityMasking(args: MaskIdentityArgs): MaskedIdentity;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a profile's display identity.
|
|
35
|
+
* When role is "tenant", always returns personal identity — the person is a
|
|
36
|
+
* separate legal entity from any company they may belong to.
|
|
37
|
+
* When role is "landlord" and the person is a company member, returns company identity.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveSenderIdentity(profileId: string, role: "landlord" | "tenant", listingId?: string): Promise<{
|
|
40
|
+
displayName: string;
|
|
41
|
+
profilePictureUrl: string | null;
|
|
42
|
+
memberName: string | null;
|
|
43
|
+
} | undefined>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Send a "new message" email notification to the recipient if they had
|
|
3
|
+
* 0 unread messages before this one (i.e. they were "caught up").
|
|
4
|
+
* Runs fire-and-forget — never blocks the response.
|
|
5
|
+
*
|
|
6
|
+
* De-duplicates on `(conversationId, recipientId)` over a 60s window to
|
|
7
|
+
* absorb the unread-count race when two messages from the same sender land
|
|
8
|
+
* within milliseconds.
|
|
9
|
+
*/
|
|
10
|
+
export declare function notifyRecipientIfCaughtUp(conversationId: string, senderId: string, messageBody: string): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-heal drift: if chat is unlocked, the candidate must be revealed too.
|
|
3
|
+
* Covers legacy rows created before the apply-time reveal fix. Idempotent.
|
|
4
|
+
*
|
|
5
|
+
* Runs fire-and-forget: the handler doesn't await this, since the reconciled
|
|
6
|
+
* state only matters for downstream reveal queries and not for the immediate
|
|
7
|
+
* response. Cheap existence-check first so we don't issue two updates on the
|
|
8
|
+
* hot path when there is nothing to heal.
|
|
9
|
+
*/
|
|
10
|
+
export declare function reconcileChatReveal(conversationId: string, listingId: string, tenantId: string, isLocked: boolean): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function scrubContactInfo(body: string): string;
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
+
import type { AppBindings } from "../../app";
|
|
3
|
+
export declare const conversationsApp: OpenAPIHono<AppBindings, {
|
|
4
|
+
"/conversations": {
|
|
5
|
+
$get: {
|
|
6
|
+
input: {
|
|
7
|
+
query: {
|
|
8
|
+
filter?: "archived" | "all" | "unread" | undefined;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
output: {
|
|
12
|
+
error: string;
|
|
13
|
+
};
|
|
14
|
+
outputFormat: "json";
|
|
15
|
+
status: 401;
|
|
16
|
+
} | {
|
|
17
|
+
input: {
|
|
18
|
+
query: {
|
|
19
|
+
filter?: "archived" | "all" | "unread" | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
output: {
|
|
23
|
+
id: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
landlordId: string;
|
|
27
|
+
isLocked: boolean;
|
|
28
|
+
listingId: string;
|
|
29
|
+
tenantId: string;
|
|
30
|
+
archived: boolean;
|
|
31
|
+
listing: {
|
|
32
|
+
street: string | null;
|
|
33
|
+
streetNumber: string | null;
|
|
34
|
+
city: string | null;
|
|
35
|
+
propertySize: number | null;
|
|
36
|
+
totalRooms: number | null;
|
|
37
|
+
publicUrl: string | null;
|
|
38
|
+
publicUrlEn: string | null;
|
|
39
|
+
upgradedAt: string | null;
|
|
40
|
+
};
|
|
41
|
+
userRole: "tenant" | "landlord";
|
|
42
|
+
otherParticipant: {
|
|
43
|
+
id: string;
|
|
44
|
+
displayName: string | null;
|
|
45
|
+
fullName: string | null;
|
|
46
|
+
profilePictureUrl: string | null;
|
|
47
|
+
};
|
|
48
|
+
lastMessage: {
|
|
49
|
+
body: string;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
senderId: string;
|
|
52
|
+
} | null;
|
|
53
|
+
unreadCount: number;
|
|
54
|
+
otherParticipantLastReadAt: string | null;
|
|
55
|
+
}[];
|
|
56
|
+
outputFormat: "json";
|
|
57
|
+
status: 200;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
} & {
|
|
61
|
+
"/conversations/:id": {
|
|
62
|
+
$get: {
|
|
63
|
+
input: {
|
|
64
|
+
param: {
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
output: {
|
|
69
|
+
error: string;
|
|
70
|
+
};
|
|
71
|
+
outputFormat: "json";
|
|
72
|
+
status: 401;
|
|
73
|
+
} | {
|
|
74
|
+
input: {
|
|
75
|
+
param: {
|
|
76
|
+
id: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
output: {
|
|
80
|
+
error: string;
|
|
81
|
+
};
|
|
82
|
+
outputFormat: "json";
|
|
83
|
+
status: 404;
|
|
84
|
+
} | {
|
|
85
|
+
input: {
|
|
86
|
+
param: {
|
|
87
|
+
id: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
output: {
|
|
91
|
+
id: string;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
updatedAt: string;
|
|
94
|
+
landlordId: string;
|
|
95
|
+
isLocked: boolean;
|
|
96
|
+
listingId: string;
|
|
97
|
+
tenantId: string;
|
|
98
|
+
archived: boolean;
|
|
99
|
+
listing: {
|
|
100
|
+
street: string | null;
|
|
101
|
+
streetNumber: string | null;
|
|
102
|
+
city: string | null;
|
|
103
|
+
propertySize: number | null;
|
|
104
|
+
totalRooms: number | null;
|
|
105
|
+
publicUrl: string | null;
|
|
106
|
+
publicUrlEn: string | null;
|
|
107
|
+
upgradedAt: string | null;
|
|
108
|
+
};
|
|
109
|
+
userRole: "tenant" | "landlord";
|
|
110
|
+
otherParticipant: {
|
|
111
|
+
id: string;
|
|
112
|
+
displayName: string | null;
|
|
113
|
+
fullName: string | null;
|
|
114
|
+
profilePictureUrl: string | null;
|
|
115
|
+
};
|
|
116
|
+
lastMessage: {
|
|
117
|
+
body: string;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
senderId: string;
|
|
120
|
+
} | null;
|
|
121
|
+
unreadCount: number;
|
|
122
|
+
otherParticipantLastReadAt: string | null;
|
|
123
|
+
};
|
|
124
|
+
outputFormat: "json";
|
|
125
|
+
status: 200;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
} & {
|
|
129
|
+
"/conversations/:id/messages": {
|
|
130
|
+
$get: {
|
|
131
|
+
input: {
|
|
132
|
+
param: {
|
|
133
|
+
id: string;
|
|
134
|
+
};
|
|
135
|
+
} & {
|
|
136
|
+
query: {
|
|
137
|
+
limit?: number | undefined;
|
|
138
|
+
cursor?: string | undefined;
|
|
139
|
+
since?: string | undefined;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
output: {
|
|
143
|
+
error: string;
|
|
144
|
+
};
|
|
145
|
+
outputFormat: "json";
|
|
146
|
+
status: 401;
|
|
147
|
+
} | {
|
|
148
|
+
input: {
|
|
149
|
+
param: {
|
|
150
|
+
id: string;
|
|
151
|
+
};
|
|
152
|
+
} & {
|
|
153
|
+
query: {
|
|
154
|
+
limit?: number | undefined;
|
|
155
|
+
cursor?: string | undefined;
|
|
156
|
+
since?: string | undefined;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
output: {
|
|
160
|
+
error: string;
|
|
161
|
+
};
|
|
162
|
+
outputFormat: "json";
|
|
163
|
+
status: 404;
|
|
164
|
+
} | {
|
|
165
|
+
input: {
|
|
166
|
+
param: {
|
|
167
|
+
id: string;
|
|
168
|
+
};
|
|
169
|
+
} & {
|
|
170
|
+
query: {
|
|
171
|
+
limit?: number | undefined;
|
|
172
|
+
cursor?: string | undefined;
|
|
173
|
+
since?: string | undefined;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
output: {
|
|
177
|
+
messages: {
|
|
178
|
+
type: string;
|
|
179
|
+
body: string;
|
|
180
|
+
id: string;
|
|
181
|
+
createdAt: string;
|
|
182
|
+
conversationId: string;
|
|
183
|
+
senderId: string;
|
|
184
|
+
editedAt: string | null;
|
|
185
|
+
deletedAt: string | null;
|
|
186
|
+
senderRole: "tenant" | "landlord";
|
|
187
|
+
sender?: {
|
|
188
|
+
displayName: string | null;
|
|
189
|
+
profilePictureUrl: string | null;
|
|
190
|
+
memberName: string | null;
|
|
191
|
+
} | undefined;
|
|
192
|
+
clientMessageId?: string | null | undefined;
|
|
193
|
+
}[];
|
|
194
|
+
nextCursor: string | null;
|
|
195
|
+
};
|
|
196
|
+
outputFormat: "json";
|
|
197
|
+
status: 200;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
} & {
|
|
201
|
+
"/conversations/:id/messages": {
|
|
202
|
+
$post: {
|
|
203
|
+
input: {
|
|
204
|
+
param: {
|
|
205
|
+
id: string;
|
|
206
|
+
};
|
|
207
|
+
} & {
|
|
208
|
+
json: {
|
|
209
|
+
body: string;
|
|
210
|
+
clientMessageId?: string | undefined;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
output: {
|
|
214
|
+
error: string;
|
|
215
|
+
};
|
|
216
|
+
outputFormat: "json";
|
|
217
|
+
status: 401;
|
|
218
|
+
} | {
|
|
219
|
+
input: {
|
|
220
|
+
param: {
|
|
221
|
+
id: string;
|
|
222
|
+
};
|
|
223
|
+
} & {
|
|
224
|
+
json: {
|
|
225
|
+
body: string;
|
|
226
|
+
clientMessageId?: string | undefined;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
output: {
|
|
230
|
+
error: string;
|
|
231
|
+
};
|
|
232
|
+
outputFormat: "json";
|
|
233
|
+
status: 404;
|
|
234
|
+
} | {
|
|
235
|
+
input: {
|
|
236
|
+
param: {
|
|
237
|
+
id: string;
|
|
238
|
+
};
|
|
239
|
+
} & {
|
|
240
|
+
json: {
|
|
241
|
+
body: string;
|
|
242
|
+
clientMessageId?: string | undefined;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
output: {
|
|
246
|
+
error: string;
|
|
247
|
+
};
|
|
248
|
+
outputFormat: "json";
|
|
249
|
+
status: 403;
|
|
250
|
+
} | {
|
|
251
|
+
input: {
|
|
252
|
+
param: {
|
|
253
|
+
id: string;
|
|
254
|
+
};
|
|
255
|
+
} & {
|
|
256
|
+
json: {
|
|
257
|
+
body: string;
|
|
258
|
+
clientMessageId?: string | undefined;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
output: {
|
|
262
|
+
type: string;
|
|
263
|
+
body: string;
|
|
264
|
+
id: string;
|
|
265
|
+
createdAt: string;
|
|
266
|
+
conversationId: string;
|
|
267
|
+
senderId: string;
|
|
268
|
+
editedAt: string | null;
|
|
269
|
+
deletedAt: string | null;
|
|
270
|
+
senderRole: "tenant" | "landlord";
|
|
271
|
+
sender?: {
|
|
272
|
+
displayName: string | null;
|
|
273
|
+
profilePictureUrl: string | null;
|
|
274
|
+
memberName: string | null;
|
|
275
|
+
} | undefined;
|
|
276
|
+
clientMessageId?: string | null | undefined;
|
|
277
|
+
};
|
|
278
|
+
outputFormat: "json";
|
|
279
|
+
status: 201;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
} & {
|
|
283
|
+
"/conversations/:id/read": {
|
|
284
|
+
$post: {
|
|
285
|
+
input: {
|
|
286
|
+
param: {
|
|
287
|
+
id: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
output: {
|
|
291
|
+
error: string;
|
|
292
|
+
};
|
|
293
|
+
outputFormat: "json";
|
|
294
|
+
status: 401;
|
|
295
|
+
} | {
|
|
296
|
+
input: {
|
|
297
|
+
param: {
|
|
298
|
+
id: string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
output: {
|
|
302
|
+
error: string;
|
|
303
|
+
};
|
|
304
|
+
outputFormat: "json";
|
|
305
|
+
status: 404;
|
|
306
|
+
} | {
|
|
307
|
+
input: {
|
|
308
|
+
param: {
|
|
309
|
+
id: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
output: {
|
|
313
|
+
success: boolean;
|
|
314
|
+
};
|
|
315
|
+
outputFormat: "json";
|
|
316
|
+
status: 200;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
} & {
|
|
320
|
+
"/conversations/:id/archive": {
|
|
321
|
+
$post: {
|
|
322
|
+
input: {
|
|
323
|
+
param: {
|
|
324
|
+
id: string;
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
output: {
|
|
328
|
+
error: string;
|
|
329
|
+
};
|
|
330
|
+
outputFormat: "json";
|
|
331
|
+
status: 401;
|
|
332
|
+
} | {
|
|
333
|
+
input: {
|
|
334
|
+
param: {
|
|
335
|
+
id: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
output: {
|
|
339
|
+
error: string;
|
|
340
|
+
};
|
|
341
|
+
outputFormat: "json";
|
|
342
|
+
status: 404;
|
|
343
|
+
} | {
|
|
344
|
+
input: {
|
|
345
|
+
param: {
|
|
346
|
+
id: string;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
output: {
|
|
350
|
+
archived: boolean;
|
|
351
|
+
};
|
|
352
|
+
outputFormat: "json";
|
|
353
|
+
status: 200;
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
} & {
|
|
357
|
+
"/conversations/initiate": {
|
|
358
|
+
$post: {
|
|
359
|
+
input: {
|
|
360
|
+
json: {
|
|
361
|
+
listingId: string;
|
|
362
|
+
message?: string | undefined;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
output: {
|
|
366
|
+
error: string;
|
|
367
|
+
};
|
|
368
|
+
outputFormat: "json";
|
|
369
|
+
status: 401;
|
|
370
|
+
} | {
|
|
371
|
+
input: {
|
|
372
|
+
json: {
|
|
373
|
+
listingId: string;
|
|
374
|
+
message?: string | undefined;
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
output: {
|
|
378
|
+
error: string;
|
|
379
|
+
};
|
|
380
|
+
outputFormat: "json";
|
|
381
|
+
status: 404;
|
|
382
|
+
} | {
|
|
383
|
+
input: {
|
|
384
|
+
json: {
|
|
385
|
+
listingId: string;
|
|
386
|
+
message?: string | undefined;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
output: {
|
|
390
|
+
error: string;
|
|
391
|
+
};
|
|
392
|
+
outputFormat: "json";
|
|
393
|
+
status: 403;
|
|
394
|
+
} | {
|
|
395
|
+
input: {
|
|
396
|
+
json: {
|
|
397
|
+
listingId: string;
|
|
398
|
+
message?: string | undefined;
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
output: {
|
|
402
|
+
conversationId: string;
|
|
403
|
+
created: boolean;
|
|
404
|
+
};
|
|
405
|
+
outputFormat: "json";
|
|
406
|
+
status: 200;
|
|
407
|
+
} | {
|
|
408
|
+
input: {
|
|
409
|
+
json: {
|
|
410
|
+
listingId: string;
|
|
411
|
+
message?: string | undefined;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
output: {
|
|
415
|
+
conversationId: string;
|
|
416
|
+
created: boolean;
|
|
417
|
+
};
|
|
418
|
+
outputFormat: "json";
|
|
419
|
+
status: 201;
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
}, "/">;
|