@justins-home/types 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,361 @@
1
+ interface ApiResponse<T> {
2
+ message: string;
3
+ data?: T;
4
+ event?: string | null;
5
+ }
6
+ interface PaginatedResponse<T> {
7
+ message: string;
8
+ data: T[];
9
+ meta: {
10
+ current_page: number;
11
+ last_page: number;
12
+ per_page: number;
13
+ total: number;
14
+ };
15
+ links: {
16
+ first?: string;
17
+ last?: string;
18
+ prev?: string | null;
19
+ next?: string | null;
20
+ };
21
+ event?: string | null;
22
+ }
23
+ interface ApiErrorResponse {
24
+ message: string;
25
+ errors?: Record<string, any>;
26
+ event?: string | null;
27
+ }
28
+
29
+ interface UserSummary {
30
+ uid: string;
31
+ name: string;
32
+ }
33
+ interface PricePayload {
34
+ amount: string;
35
+ currency: string;
36
+ period?: string;
37
+ }
38
+ interface MediaPayload {
39
+ cover?: string | null;
40
+ count?: number;
41
+ }
42
+ interface WorkflowState {
43
+ current_step: string;
44
+ can_submit?: boolean;
45
+ missing_requirements?: string[];
46
+ }
47
+ interface ListingRef {
48
+ id: number;
49
+ uid: string;
50
+ }
51
+ interface PlanRef {
52
+ key: string;
53
+ name: string;
54
+ }
55
+ interface ConversationRef {
56
+ id: number;
57
+ }
58
+ interface InspectionRef {
59
+ uid: string;
60
+ }
61
+
62
+ interface UserResource {
63
+ uid: string;
64
+ name: string;
65
+ email: string;
66
+ avatar?: string;
67
+ }
68
+ interface UserType {
69
+ id: number;
70
+ uid: string;
71
+ name: string;
72
+ }
73
+
74
+ interface ComplianceDefinition {
75
+ id: number;
76
+ compliance_key: string;
77
+ name: string;
78
+ description?: string | null;
79
+ enforcement_level: string;
80
+ validity_type?: string | null;
81
+ grace_period_days?: number | null;
82
+ status?: string | null;
83
+ requirements?: string[];
84
+ }
85
+ interface ComplianceRequirement {
86
+ verification_layer_key: string;
87
+ }
88
+ interface ComplianceStatus {
89
+ overall: string;
90
+ breakdown: ComplianceBreakdown[];
91
+ }
92
+ interface ComplianceBreakdown {
93
+ compliance_key: string;
94
+ state: string;
95
+ valid_until?: string | null;
96
+ }
97
+ interface ListingComplianceStateResource {
98
+ listing_uid: string;
99
+ compliances: ComplianceStatus;
100
+ }
101
+ interface ComplianceSubmissionCompliance {
102
+ id: number;
103
+ key: string;
104
+ name: string;
105
+ }
106
+ interface ListingComplianceSubmissionResource {
107
+ id: number;
108
+ listing_id: number;
109
+ compliance: ComplianceSubmissionCompliance;
110
+ verification_layer_key: string;
111
+ status: string;
112
+ submitted_data: Record<string, any>;
113
+ rejection_reason?: string | null;
114
+ reviewed_by?: number | null;
115
+ reviewed_at?: string | null;
116
+ created_at: string;
117
+ }
118
+ interface TenancyComplianceSubmissionResource {
119
+ id: number;
120
+ tenancy_id: number;
121
+ compliance: ComplianceSubmissionCompliance;
122
+ verification_layer_key: string;
123
+ status: string;
124
+ submitted_data: Record<string, any>;
125
+ rejection_reason?: string | null;
126
+ reviewed_by?: number | null;
127
+ reviewed_at?: string | null;
128
+ created_at: string;
129
+ }
130
+
131
+ interface PropertyListingSummary {
132
+ property_type?: string;
133
+ bedrooms?: number;
134
+ bathrooms?: number;
135
+ city?: string;
136
+ availability?: string;
137
+ }
138
+ interface UsedItemListingSummary {
139
+ item_name?: string;
140
+ condition?: string;
141
+ category?: string;
142
+ availability?: string;
143
+ }
144
+ interface BaseListingResource {
145
+ uid: string;
146
+ listing_type: string;
147
+ state: string;
148
+ is_visible: boolean;
149
+ price: PricePayload;
150
+ owner?: UserType;
151
+ created_by?: UserType;
152
+ workflow?: WorkflowState;
153
+ media?: MediaPayload;
154
+ }
155
+ interface PropertyListingResource extends BaseListingResource {
156
+ vertical: 'property';
157
+ summary?: PropertyListingSummary;
158
+ }
159
+ interface UsedItemListingResource extends BaseListingResource {
160
+ vertical: 'used_item';
161
+ summary?: UsedItemListingSummary;
162
+ }
163
+ type ListingResource = PropertyListingResource | UsedItemListingResource;
164
+ type ListingWithComplianceResource = ListingResource & {
165
+ compliances: ComplianceDefinition[];
166
+ compliance_status: ComplianceStatus;
167
+ };
168
+
169
+ interface TenancyResource {
170
+ uid: string;
171
+ listing_id: number;
172
+ landlord_id: number;
173
+ tenant_id: number;
174
+ rent_amount: string | number;
175
+ deposit_amount: string | number;
176
+ state: string;
177
+ start_date: string | null;
178
+ end_date: string | null;
179
+ is_periodic: boolean;
180
+ created_at: string;
181
+ }
182
+ interface TenancyTransitionResource {
183
+ from_state: string;
184
+ to_state: string;
185
+ changed_by_user_id: number;
186
+ changed_by_name?: string | null;
187
+ comment?: string | null;
188
+ created_at: string;
189
+ }
190
+ interface TenancyWithComplianceResource extends TenancyResource {
191
+ compliances: ComplianceDefinition[];
192
+ compliance_status: ComplianceStatus;
193
+ }
194
+
195
+ interface InspectionMedia {
196
+ uid: string;
197
+ file_type: string;
198
+ caption?: string | null;
199
+ path: string;
200
+ }
201
+ interface InspectionResource {
202
+ uid: string;
203
+ inspection_type?: string | null;
204
+ status?: string | null;
205
+ scheduled_date?: string | null;
206
+ completed_date?: string | null;
207
+ condition_rating?: string | null;
208
+ summary?: string | null;
209
+ next_inspection_date?: string | null;
210
+ inspector?: UserType;
211
+ media?: InspectionMedia[];
212
+ created_at?: string | null;
213
+ updated_at?: string | null;
214
+ }
215
+
216
+ interface MaintenanceAttachmentResource {
217
+ uid: string;
218
+ file_type: string;
219
+ url: string;
220
+ uploaded_by?: UserType;
221
+ created_at: string;
222
+ }
223
+ interface MaintenanceUpdateResource {
224
+ uid: string;
225
+ note?: string | null;
226
+ user: UserType;
227
+ created_at: string;
228
+ }
229
+ interface MaintenanceRequestResource {
230
+ uid: string;
231
+ title: string;
232
+ description?: string | null;
233
+ status: string;
234
+ priority: string;
235
+ reported_at?: string | null;
236
+ assigned_at?: string | null;
237
+ completed_at?: string | null;
238
+ sla_deadline?: string | null;
239
+ listing?: ListingRef;
240
+ reporter?: UserType;
241
+ technician?: UserType;
242
+ updates?: MaintenanceUpdateResource[];
243
+ attachments?: MaintenanceAttachmentResource[];
244
+ created_at: string;
245
+ updated_at: string;
246
+ }
247
+
248
+ interface ConversationResource {
249
+ id: number;
250
+ type: string;
251
+ listing?: ListingRef;
252
+ created_by?: UserType;
253
+ last_message_at?: string | null;
254
+ created_at: string;
255
+ }
256
+ interface MessageResource {
257
+ id: number;
258
+ conversation_id: number;
259
+ sender?: UserType;
260
+ body?: string | null;
261
+ attachment_url?: string | null;
262
+ is_system: boolean;
263
+ state: string;
264
+ read_at?: string | null;
265
+ created_at: string;
266
+ }
267
+
268
+ interface NotificationResource {
269
+ id: string;
270
+ type: string;
271
+ title: string;
272
+ body: string;
273
+ data?: Record<string, any>;
274
+ read_at?: string | null;
275
+ created_at: string;
276
+ }
277
+
278
+ interface VerificationLayerResource {
279
+ id: number;
280
+ key: string;
281
+ name: string;
282
+ description?: string | null;
283
+ requires_review: boolean;
284
+ metadata_schema?: Record<string, any> | null;
285
+ is_active: boolean;
286
+ created_at: string;
287
+ updated_at: string;
288
+ }
289
+ interface VerificationFlowResource {
290
+ order: number;
291
+ is_required: boolean;
292
+ layer?: VerificationLayerResource;
293
+ }
294
+ interface VerificationFlowGroupResource {
295
+ user_type: string;
296
+ user_type_class: string;
297
+ layers: VerificationFlowResource[];
298
+ }
299
+ interface UserVerificationResource {
300
+ id: number;
301
+ status: string;
302
+ submitted_data?: Record<string, any>;
303
+ rejection_reason?: string | null;
304
+ layer?: VerificationLayerResource;
305
+ reviewed_by?: number | null;
306
+ reviewed_at?: string | null;
307
+ created_at: string;
308
+ updated_at: string;
309
+ }
310
+ interface UserVerificationStateResource {
311
+ current_level: number;
312
+ completed_layers: string[];
313
+ pending_layers: string[];
314
+ last_calculated_at?: string | null;
315
+ }
316
+
317
+ interface CapabilityResource {
318
+ key: string;
319
+ name: string;
320
+ description?: string | null;
321
+ }
322
+ interface EntitlementResource {
323
+ key: string;
324
+ name: string;
325
+ description?: string | null;
326
+ value_type: string;
327
+ }
328
+ interface PlanEntitlementResource {
329
+ key: string;
330
+ name: string;
331
+ description?: string | null;
332
+ value: number | string | boolean | null;
333
+ }
334
+ interface PlanResource {
335
+ key: string;
336
+ name: string;
337
+ user_type: string;
338
+ is_active: boolean;
339
+ capabilities?: CapabilityResource[];
340
+ entitlements?: PlanEntitlementResource[];
341
+ verification_requirements?: string[];
342
+ }
343
+
344
+ interface WishlistResource {
345
+ wishlist_uid: string;
346
+ listing?: ListingResource;
347
+ }
348
+
349
+ interface ReviewResource {
350
+ id: number;
351
+ rating: number;
352
+ comment?: string;
353
+ reviewer: {
354
+ id: number;
355
+ name: string;
356
+ };
357
+ created_at?: string;
358
+ updated_at?: string;
359
+ }
360
+
361
+ export type { ApiErrorResponse, ApiResponse, BaseListingResource, CapabilityResource, ComplianceBreakdown, ComplianceDefinition, ComplianceRequirement, ComplianceStatus, ComplianceSubmissionCompliance, ConversationRef, ConversationResource, EntitlementResource, InspectionMedia, InspectionRef, InspectionResource, ListingComplianceStateResource, ListingComplianceSubmissionResource, ListingRef, ListingResource, ListingWithComplianceResource, MaintenanceAttachmentResource, MaintenanceRequestResource, MaintenanceUpdateResource, MediaPayload, MessageResource, NotificationResource, PaginatedResponse, PlanEntitlementResource, PlanRef, PlanResource, PricePayload, PropertyListingResource, PropertyListingSummary, ReviewResource, TenancyComplianceSubmissionResource, TenancyResource, TenancyTransitionResource, TenancyWithComplianceResource, UsedItemListingResource, UsedItemListingSummary, UserResource, UserSummary, UserType, UserVerificationResource, UserVerificationStateResource, VerificationFlowGroupResource, VerificationFlowResource, VerificationLayerResource, WishlistResource, WorkflowState };
@@ -0,0 +1,361 @@
1
+ interface ApiResponse<T> {
2
+ message: string;
3
+ data?: T;
4
+ event?: string | null;
5
+ }
6
+ interface PaginatedResponse<T> {
7
+ message: string;
8
+ data: T[];
9
+ meta: {
10
+ current_page: number;
11
+ last_page: number;
12
+ per_page: number;
13
+ total: number;
14
+ };
15
+ links: {
16
+ first?: string;
17
+ last?: string;
18
+ prev?: string | null;
19
+ next?: string | null;
20
+ };
21
+ event?: string | null;
22
+ }
23
+ interface ApiErrorResponse {
24
+ message: string;
25
+ errors?: Record<string, any>;
26
+ event?: string | null;
27
+ }
28
+
29
+ interface UserSummary {
30
+ uid: string;
31
+ name: string;
32
+ }
33
+ interface PricePayload {
34
+ amount: string;
35
+ currency: string;
36
+ period?: string;
37
+ }
38
+ interface MediaPayload {
39
+ cover?: string | null;
40
+ count?: number;
41
+ }
42
+ interface WorkflowState {
43
+ current_step: string;
44
+ can_submit?: boolean;
45
+ missing_requirements?: string[];
46
+ }
47
+ interface ListingRef {
48
+ id: number;
49
+ uid: string;
50
+ }
51
+ interface PlanRef {
52
+ key: string;
53
+ name: string;
54
+ }
55
+ interface ConversationRef {
56
+ id: number;
57
+ }
58
+ interface InspectionRef {
59
+ uid: string;
60
+ }
61
+
62
+ interface UserResource {
63
+ uid: string;
64
+ name: string;
65
+ email: string;
66
+ avatar?: string;
67
+ }
68
+ interface UserType {
69
+ id: number;
70
+ uid: string;
71
+ name: string;
72
+ }
73
+
74
+ interface ComplianceDefinition {
75
+ id: number;
76
+ compliance_key: string;
77
+ name: string;
78
+ description?: string | null;
79
+ enforcement_level: string;
80
+ validity_type?: string | null;
81
+ grace_period_days?: number | null;
82
+ status?: string | null;
83
+ requirements?: string[];
84
+ }
85
+ interface ComplianceRequirement {
86
+ verification_layer_key: string;
87
+ }
88
+ interface ComplianceStatus {
89
+ overall: string;
90
+ breakdown: ComplianceBreakdown[];
91
+ }
92
+ interface ComplianceBreakdown {
93
+ compliance_key: string;
94
+ state: string;
95
+ valid_until?: string | null;
96
+ }
97
+ interface ListingComplianceStateResource {
98
+ listing_uid: string;
99
+ compliances: ComplianceStatus;
100
+ }
101
+ interface ComplianceSubmissionCompliance {
102
+ id: number;
103
+ key: string;
104
+ name: string;
105
+ }
106
+ interface ListingComplianceSubmissionResource {
107
+ id: number;
108
+ listing_id: number;
109
+ compliance: ComplianceSubmissionCompliance;
110
+ verification_layer_key: string;
111
+ status: string;
112
+ submitted_data: Record<string, any>;
113
+ rejection_reason?: string | null;
114
+ reviewed_by?: number | null;
115
+ reviewed_at?: string | null;
116
+ created_at: string;
117
+ }
118
+ interface TenancyComplianceSubmissionResource {
119
+ id: number;
120
+ tenancy_id: number;
121
+ compliance: ComplianceSubmissionCompliance;
122
+ verification_layer_key: string;
123
+ status: string;
124
+ submitted_data: Record<string, any>;
125
+ rejection_reason?: string | null;
126
+ reviewed_by?: number | null;
127
+ reviewed_at?: string | null;
128
+ created_at: string;
129
+ }
130
+
131
+ interface PropertyListingSummary {
132
+ property_type?: string;
133
+ bedrooms?: number;
134
+ bathrooms?: number;
135
+ city?: string;
136
+ availability?: string;
137
+ }
138
+ interface UsedItemListingSummary {
139
+ item_name?: string;
140
+ condition?: string;
141
+ category?: string;
142
+ availability?: string;
143
+ }
144
+ interface BaseListingResource {
145
+ uid: string;
146
+ listing_type: string;
147
+ state: string;
148
+ is_visible: boolean;
149
+ price: PricePayload;
150
+ owner?: UserType;
151
+ created_by?: UserType;
152
+ workflow?: WorkflowState;
153
+ media?: MediaPayload;
154
+ }
155
+ interface PropertyListingResource extends BaseListingResource {
156
+ vertical: 'property';
157
+ summary?: PropertyListingSummary;
158
+ }
159
+ interface UsedItemListingResource extends BaseListingResource {
160
+ vertical: 'used_item';
161
+ summary?: UsedItemListingSummary;
162
+ }
163
+ type ListingResource = PropertyListingResource | UsedItemListingResource;
164
+ type ListingWithComplianceResource = ListingResource & {
165
+ compliances: ComplianceDefinition[];
166
+ compliance_status: ComplianceStatus;
167
+ };
168
+
169
+ interface TenancyResource {
170
+ uid: string;
171
+ listing_id: number;
172
+ landlord_id: number;
173
+ tenant_id: number;
174
+ rent_amount: string | number;
175
+ deposit_amount: string | number;
176
+ state: string;
177
+ start_date: string | null;
178
+ end_date: string | null;
179
+ is_periodic: boolean;
180
+ created_at: string;
181
+ }
182
+ interface TenancyTransitionResource {
183
+ from_state: string;
184
+ to_state: string;
185
+ changed_by_user_id: number;
186
+ changed_by_name?: string | null;
187
+ comment?: string | null;
188
+ created_at: string;
189
+ }
190
+ interface TenancyWithComplianceResource extends TenancyResource {
191
+ compliances: ComplianceDefinition[];
192
+ compliance_status: ComplianceStatus;
193
+ }
194
+
195
+ interface InspectionMedia {
196
+ uid: string;
197
+ file_type: string;
198
+ caption?: string | null;
199
+ path: string;
200
+ }
201
+ interface InspectionResource {
202
+ uid: string;
203
+ inspection_type?: string | null;
204
+ status?: string | null;
205
+ scheduled_date?: string | null;
206
+ completed_date?: string | null;
207
+ condition_rating?: string | null;
208
+ summary?: string | null;
209
+ next_inspection_date?: string | null;
210
+ inspector?: UserType;
211
+ media?: InspectionMedia[];
212
+ created_at?: string | null;
213
+ updated_at?: string | null;
214
+ }
215
+
216
+ interface MaintenanceAttachmentResource {
217
+ uid: string;
218
+ file_type: string;
219
+ url: string;
220
+ uploaded_by?: UserType;
221
+ created_at: string;
222
+ }
223
+ interface MaintenanceUpdateResource {
224
+ uid: string;
225
+ note?: string | null;
226
+ user: UserType;
227
+ created_at: string;
228
+ }
229
+ interface MaintenanceRequestResource {
230
+ uid: string;
231
+ title: string;
232
+ description?: string | null;
233
+ status: string;
234
+ priority: string;
235
+ reported_at?: string | null;
236
+ assigned_at?: string | null;
237
+ completed_at?: string | null;
238
+ sla_deadline?: string | null;
239
+ listing?: ListingRef;
240
+ reporter?: UserType;
241
+ technician?: UserType;
242
+ updates?: MaintenanceUpdateResource[];
243
+ attachments?: MaintenanceAttachmentResource[];
244
+ created_at: string;
245
+ updated_at: string;
246
+ }
247
+
248
+ interface ConversationResource {
249
+ id: number;
250
+ type: string;
251
+ listing?: ListingRef;
252
+ created_by?: UserType;
253
+ last_message_at?: string | null;
254
+ created_at: string;
255
+ }
256
+ interface MessageResource {
257
+ id: number;
258
+ conversation_id: number;
259
+ sender?: UserType;
260
+ body?: string | null;
261
+ attachment_url?: string | null;
262
+ is_system: boolean;
263
+ state: string;
264
+ read_at?: string | null;
265
+ created_at: string;
266
+ }
267
+
268
+ interface NotificationResource {
269
+ id: string;
270
+ type: string;
271
+ title: string;
272
+ body: string;
273
+ data?: Record<string, any>;
274
+ read_at?: string | null;
275
+ created_at: string;
276
+ }
277
+
278
+ interface VerificationLayerResource {
279
+ id: number;
280
+ key: string;
281
+ name: string;
282
+ description?: string | null;
283
+ requires_review: boolean;
284
+ metadata_schema?: Record<string, any> | null;
285
+ is_active: boolean;
286
+ created_at: string;
287
+ updated_at: string;
288
+ }
289
+ interface VerificationFlowResource {
290
+ order: number;
291
+ is_required: boolean;
292
+ layer?: VerificationLayerResource;
293
+ }
294
+ interface VerificationFlowGroupResource {
295
+ user_type: string;
296
+ user_type_class: string;
297
+ layers: VerificationFlowResource[];
298
+ }
299
+ interface UserVerificationResource {
300
+ id: number;
301
+ status: string;
302
+ submitted_data?: Record<string, any>;
303
+ rejection_reason?: string | null;
304
+ layer?: VerificationLayerResource;
305
+ reviewed_by?: number | null;
306
+ reviewed_at?: string | null;
307
+ created_at: string;
308
+ updated_at: string;
309
+ }
310
+ interface UserVerificationStateResource {
311
+ current_level: number;
312
+ completed_layers: string[];
313
+ pending_layers: string[];
314
+ last_calculated_at?: string | null;
315
+ }
316
+
317
+ interface CapabilityResource {
318
+ key: string;
319
+ name: string;
320
+ description?: string | null;
321
+ }
322
+ interface EntitlementResource {
323
+ key: string;
324
+ name: string;
325
+ description?: string | null;
326
+ value_type: string;
327
+ }
328
+ interface PlanEntitlementResource {
329
+ key: string;
330
+ name: string;
331
+ description?: string | null;
332
+ value: number | string | boolean | null;
333
+ }
334
+ interface PlanResource {
335
+ key: string;
336
+ name: string;
337
+ user_type: string;
338
+ is_active: boolean;
339
+ capabilities?: CapabilityResource[];
340
+ entitlements?: PlanEntitlementResource[];
341
+ verification_requirements?: string[];
342
+ }
343
+
344
+ interface WishlistResource {
345
+ wishlist_uid: string;
346
+ listing?: ListingResource;
347
+ }
348
+
349
+ interface ReviewResource {
350
+ id: number;
351
+ rating: number;
352
+ comment?: string;
353
+ reviewer: {
354
+ id: number;
355
+ name: string;
356
+ };
357
+ created_at?: string;
358
+ updated_at?: string;
359
+ }
360
+
361
+ export type { ApiErrorResponse, ApiResponse, BaseListingResource, CapabilityResource, ComplianceBreakdown, ComplianceDefinition, ComplianceRequirement, ComplianceStatus, ComplianceSubmissionCompliance, ConversationRef, ConversationResource, EntitlementResource, InspectionMedia, InspectionRef, InspectionResource, ListingComplianceStateResource, ListingComplianceSubmissionResource, ListingRef, ListingResource, ListingWithComplianceResource, MaintenanceAttachmentResource, MaintenanceRequestResource, MaintenanceUpdateResource, MediaPayload, MessageResource, NotificationResource, PaginatedResponse, PlanEntitlementResource, PlanRef, PlanResource, PricePayload, PropertyListingResource, PropertyListingSummary, ReviewResource, TenancyComplianceSubmissionResource, TenancyResource, TenancyTransitionResource, TenancyWithComplianceResource, UsedItemListingResource, UsedItemListingSummary, UserResource, UserSummary, UserType, UserVerificationResource, UserVerificationStateResource, VerificationFlowGroupResource, VerificationFlowResource, VerificationLayerResource, WishlistResource, WorkflowState };
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;