hububb-models 1.0.34 → 1.0.36

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "hububb-models",
3
- "version": "1.0.34",
3
+ "version": "1.0.36",
4
4
  "description": "Models for Hububb application",
5
5
  "main": "index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1"
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "prepublishOnly": "tsc src/index.ts -d",
10
+ "build": "tsc src/index.ts -d"
9
11
  },
10
12
  "author": "Exelerate",
11
13
  "license": "ISC",
package/src/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export type { Listing, Picture, Address } from "./models/listing";
2
-
3
- export type { Reservation } from "./models/reservation";
4
- export type { User } from "./models/user"
5
- export type {Thread, Message} from "./models/thread"
1
+ export type { Listing, Picture, Address } from './models/listing/listing';
2
+ export type { Reservation } from './models/reservation/reservation';
3
+ export type { User } from './models/user/user';
4
+ export type { ChatMessage } from './models/thread/message';
5
+ export type { ChatThread } from './models/thread/thread';
@@ -1,107 +1,103 @@
1
1
  import { Timestamp } from "@firebase/firestore-types";
2
-
3
2
  export interface Listing {
4
- id?: string;
5
- guestyId?: string;
6
- accountId?: string;
7
- createdAt: Timestamp;
8
- isVirtual?: boolean;
9
- isListed: boolean;
10
- title?: string;
11
- propertyType?: string;
12
- roomType?: string;
13
- bedType?: string;
14
- accommodates?: number;
15
- bedrooms?: number;
16
- bathrooms?: number;
17
- beds?: number;
18
- areaSquareFeet?: number;
19
- address: Address;
20
- publishedAddress?: {
21
- full: string;
22
- lng: number;
23
- lat: number;
24
- street: string;
25
- city: string;
26
- country: string;
27
- };
28
- timezone?: string;
29
- defaultCheckInTime?: string;
30
- defaultCheckOutTime?: string;
31
-
32
- picture?: Picture;
33
- pictures: Picture[];
34
- amenities: string[];
35
-
36
- terms: {
37
- minNights: number;
38
- maxNights: number;
39
- cancellation: string;
40
- };
41
- prices: {
42
- guestsIncludedInRegularFee: number;
43
- extraPersonFee: number;
44
- basePrice: number;
45
- basePriceUSD: number;
46
- monthlyPriceFactor: number;
47
- weeklyPriceFactor: number;
48
- weeendBasePrice: number;
49
- securityDepositFee: number;
50
- currency: string;
51
- cleaningFee: number;
52
- };
53
- netIncomeFormula?: string;
54
- commissionFormula?: string;
55
- commissionTaxPrecentage?: string;
56
-
57
- paymentProcessing?: {
58
- active: boolean;
59
- paymentProviders: {
60
- stripe: {
3
+ id?: string;
4
+ guestyId?: string;
5
+ accountId?: string;
6
+ createdAt: Timestamp;
7
+ isVirtual?: boolean;
8
+ isListed: boolean;
9
+ title?: string;
10
+ propertyType?: string;
11
+ roomType?: string;
12
+ bedType?: string;
13
+ accommodates?: number;
14
+ bedrooms?: number;
15
+ bathrooms?: number;
16
+ beds?: number;
17
+ areaSquareFeet?: number;
18
+ address: Address;
19
+ publishedAddress?: {
20
+ full: string;
21
+ lng: number;
22
+ lat: number;
23
+ street: string;
24
+ city: string;
25
+ country: string;
26
+ };
27
+ timezone?: string;
28
+ defaultCheckInTime?: string;
29
+ defaultCheckOutTime?: string;
30
+ picture?: Picture;
31
+ pictures: Picture[];
32
+ amenities: string[];
33
+ terms: {
34
+ minNights: number;
35
+ maxNights: number;
36
+ cancellation: string;
37
+ };
38
+ prices: {
39
+ guestsIncludedInRegularFee: number;
40
+ extraPersonFee: number;
41
+ basePrice: number;
42
+ basePriceUSD: number;
43
+ monthlyPriceFactor: number;
44
+ weeklyPriceFactor: number;
45
+ weeendBasePrice: number;
46
+ securityDepositFee: number;
47
+ currency: string;
48
+ cleaningFee: number;
49
+ };
50
+ netIncomeFormula?: string;
51
+ commissionFormula?: string;
52
+ commissionTaxPrecentage?: string;
53
+ paymentProcessing?: {
61
54
  active: boolean;
62
- status: string;
63
- accountName: string;
64
- defaultCurrency: string;
65
- syncedAt: Timestamp;
66
- payload: {
67
- id: string;
68
- livemode: boolean;
69
- token_type: string;
70
- stripe_publishable_key: string;
71
- stripe_user_id: string;
72
- scope: string;
55
+ paymentProviders: {
56
+ stripe: {
57
+ active: boolean;
58
+ status: string;
59
+ accountName: string;
60
+ defaultCurrency: string;
61
+ syncedAt: Timestamp;
62
+ payload: {
63
+ id: string;
64
+ livemode: boolean;
65
+ token_type: string;
66
+ stripe_publishable_key: string;
67
+ stripe_user_id: string;
68
+ scope: string;
69
+ };
70
+ };
73
71
  };
74
- };
75
72
  };
76
- };
77
- active: boolean;
78
- publicDescription: any;
79
- frontDoor?: Door;
80
- mainDoor?: Door;
81
- noAptKey?: boolean;
82
- aptKey?: string;
83
- keyMethod?: "unlock" | "open";
84
- externalId?: string;
73
+ active: boolean;
74
+ publicDescription: any;
75
+ frontDoor?: Door;
76
+ mainDoor?: Door;
77
+ noAptKey?: boolean;
78
+ aptKey?: string;
79
+ keyMethod?: "unlock" | "open";
80
+ externalId?: string;
85
81
  }
86
82
  export interface Door {
87
- id?: string;
88
- method?: "unlock" | "open";
83
+ id?: string;
84
+ method?: "unlock" | "open";
89
85
  }
90
86
  export interface Address {
91
- full: string;
92
- lng: number;
93
- lat: number;
94
- street: string;
95
- city: string;
96
- country: string;
87
+ full: string;
88
+ lng: number;
89
+ lat: number;
90
+ street: string;
91
+ city: string;
92
+ country: string;
97
93
  }
98
94
  export interface Picture {
99
- regular?: string;
100
- thumbnail?: string;
101
- large?: string;
102
- caption?: string;
103
- original?: string;
104
- height?: number;
105
- size?: number;
106
- width?: number;
95
+ regular?: string;
96
+ thumbnail?: string;
97
+ large?: string;
98
+ caption?: string;
99
+ original?: string;
100
+ height?: number;
101
+ size?: number;
102
+ width?: number;
107
103
  }
@@ -1,37 +1,36 @@
1
1
  import { Timestamp } from "@firebase/firestore-types";
2
-
3
2
  export interface Reservation {
4
- id: string;
5
- externalId?: string;
6
- checkIn?: Timestamp;
7
- checkOut?: Timestamp;
8
- status?: string;
9
- statusDescription?: string;
10
- guest?: {
11
- id?: string;
3
+ id: string;
12
4
  externalId?: string;
13
- fullName?: string;
14
- email?: string;
15
- };
16
- listing?: {
17
- id?: string;
18
- externalId?: string;
19
- title?: string;
20
- };
21
- klevio?: {
22
- keyId?: string;
23
- from?: Timestamp;
24
- to?: Timestamp;
25
- keyholderId?: string;
26
- keyholderEmail?: string;
27
- propertyId?: string;
28
- };
29
- refNumber?: string;
30
- money?: any;
31
- source?: string;
32
- total?: number;
33
- guests?: number;
34
- adults?: number;
35
- children?: number;
36
- inboxId?: number;
5
+ checkIn?: Timestamp;
6
+ checkOut?: Timestamp;
7
+ status?: string;
8
+ statusDescription?: string;
9
+ guest?: {
10
+ id?: string;
11
+ externalId?: string;
12
+ fullName?: string;
13
+ email?: string;
14
+ };
15
+ listing?: {
16
+ id?: string;
17
+ externalId?: string;
18
+ title?: string;
19
+ };
20
+ klevio?: {
21
+ keyId?: string;
22
+ from?: Timestamp;
23
+ to?: Timestamp;
24
+ keyholderId?: string;
25
+ keyholderEmail?: string;
26
+ propertyId?: string;
27
+ };
28
+ refNumber?: string;
29
+ money?: any;
30
+ source?: string;
31
+ total?: number;
32
+ guests?: number;
33
+ adults?: number;
34
+ children?: number;
35
+ inboxId?: number;
37
36
  }
@@ -1,14 +1,9 @@
1
- import { Timestamp } from "@firebase/firestore-types";
2
- interface Attachment {
1
+ import { ChatMember } from './thread';
2
+ export interface ChatMessage {
3
3
  id: string;
4
- url: string;
5
- }
6
-
7
- export interface Message {
8
- id: string;
9
- attachments: Attachment[];
4
+ threadId: string;
5
+ authorId: string;
6
+ author: ChatMember;
10
7
  body: string;
11
8
  contentType: string;
12
- createdAt: Timestamp;
13
- authorId: string;
14
- }
9
+ }
@@ -1,13 +1,10 @@
1
1
  import { ChatMember } from './thread';
2
2
 
3
- type SeenBy = Record<string, number>;
4
-
5
3
  export interface ChatMessage {
6
4
  id: string;
7
5
  threadId: string;
6
+ authorId: string;
8
7
  author: ChatMember;
9
- content: string;
10
- seen: SeenBy;
11
- lastSeen?: number;
12
- createdAt: number;
8
+ body: string;
9
+ contentType: string;
13
10
  }
@@ -1,18 +1,16 @@
1
- import { Timestamp } from "@firebase/firestore-types"
2
- import { Message } from "./message";
3
-
4
- export interface Contact {
5
- id: string;
6
- avatar: string;
7
- lastActivity?: number;
8
- fullName: string;
1
+ import { ChatMessage } from './message';
2
+ export interface ChatMember {
3
+ id: string;
4
+ avatar: string;
5
+ email?: string;
6
+ fullName: string;
7
+ }
8
+ export interface ChatThread {
9
+ id?: string;
10
+ messages: ChatMessage[];
11
+ lastMessage?: ChatMessage;
12
+ participantIds: string[];
13
+ participants?: ChatMember[];
14
+ type: 'ONE_TO_ONE' | 'GROUP';
15
+ unreadCount?: number;
9
16
  }
10
- export interface Thread {
11
- id?: string;
12
- messages: Message[];
13
- lastMessage?: Message;
14
- participantIds: string[];
15
- participants?: Contact[];
16
- type: "ONE_TO_ONE" | "GROUP";
17
- unreadCount?: number;
18
- }
@@ -8,10 +8,11 @@ export interface ChatMember {
8
8
  }
9
9
 
10
10
  export interface ChatThread {
11
- id: string;
12
- subject: string;
11
+ id?: string;
12
+ messages: ChatMessage[];
13
13
  lastMessage?: ChatMessage;
14
- members: ChatMember[];
15
- updatedAt: number;
16
- createdAt: number;
14
+ participantIds: string[];
15
+ participants?: ChatMember[];
16
+ type: 'ONE_TO_ONE' | 'GROUP';
17
+ unreadCount?: number;
17
18
  }
@@ -1,25 +1,25 @@
1
1
  export interface User {
2
- id: string;
3
- phoneNumber: string;
4
- fullName: string;
5
- email: string;
6
- verified?:boolean;
7
- kyc?:{
8
- verified?:boolean,
9
- state?: 'processing'| 'success' | "declined",
10
- declinedReason?:string,
11
- form:{
12
- firstName?:string,
13
- lastName?:string,
14
- dob?:string,
15
- document?:string,
16
- face?:string,
17
- country?:{
18
- code?:string;
19
- name?:string;
20
- }
21
- documentType?:string
22
- }
23
- };
24
- klevioId?: string;
2
+ id: string;
3
+ phoneNumber: string;
4
+ fullName: string;
5
+ email: string;
6
+ verified?: boolean;
7
+ kyc?: {
8
+ verified?: boolean;
9
+ state?: 'processing' | 'success' | "declined";
10
+ declinedReason?: string;
11
+ form: {
12
+ firstName?: string;
13
+ lastName?: string;
14
+ dob?: string;
15
+ document?: string;
16
+ face?: string;
17
+ country?: {
18
+ code?: string;
19
+ name?: string;
20
+ };
21
+ documentType?: string;
22
+ };
23
+ };
24
+ klevioId?: string;
25
25
  }