@homespot-sdk/core 0.0.359 → 0.0.361

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.
@@ -322,7 +322,11 @@ export type OauthConnectionResponse = {
322
322
  */
323
323
  canReadStats: boolean;
324
324
  /**
325
- * The token is dead, or the grant lacks a scope the connect flow asks for — re-running the connect flow is what fixes it
325
+ * Views and reach of a post. Facebook reports them only for Pages with 100 or more likes
326
+ */
327
+ canReadInsights: boolean;
328
+ /**
329
+ * The token is dead, or the grant lacks a scope the connect flow asks for (insights aside: without them canReadInsights is false and nothing else) — re-running the connect flow is what fixes it
326
330
  */
327
331
  reconnectRequired: boolean;
328
332
  };
@@ -478,6 +482,67 @@ export type SocialPostView = {
478
482
  createdBy: string;
479
483
  createdAt: Date;
480
484
  };
485
+ export type MemberPeekResponse = {
486
+ memberId: string;
487
+ firstName: string;
488
+ lastName: string;
489
+ photo?: string;
490
+ phone?: string;
491
+ email: string;
492
+ };
493
+ export type SocialCommentAuthor = {
494
+ name?: string;
495
+ username?: string;
496
+ };
497
+ export type SocialCommentResponse = {
498
+ commentId: string;
499
+ /**
500
+ * Who wrote it, as far as Facebook / Instagram say; null on the agency's own comments, and when Meta does not say
501
+ */
502
+ author?: SocialCommentAuthor;
503
+ /**
504
+ * Null on a sticker or a photo on its own, and once the comment is REMOVED
505
+ */
506
+ text?: string;
507
+ /**
508
+ * When it was written; for a reply sent from HomeSpot, when it was sent
509
+ */
510
+ commentedAt: Date;
511
+ state: 'VISIBLE' | 'HIDDEN' | 'REMOVED';
512
+ /**
513
+ * Changed by its author after it was written
514
+ */
515
+ edited: boolean;
516
+ /**
517
+ * Written by the agency: shown as the agency's reply
518
+ */
519
+ own: boolean;
520
+ /**
521
+ * Own comments only
522
+ */
523
+ sentBy?: SocialCommentSender;
524
+ /**
525
+ * Own comments only: PENDING while HomeSpot gets it onto Facebook / Instagram, SENT once there, FAILED if Meta refused it
526
+ */
527
+ delivery?: 'PENDING' | 'SENT' | 'FAILED';
528
+ /**
529
+ * Why it FAILED; retrying sends it again as it is
530
+ */
531
+ failureReason?: 'COMMENT_DELETED' | 'RECONNECT_REQUIRED' | 'PERMISSION_MISSING' | 'RATE_LIMITED' | 'UNKNOWN';
532
+ };
533
+ export type SocialCommentSender = {
534
+ type: 'AGENT' | 'AI' | 'PAGE';
535
+ /**
536
+ * AGENT only; also once they have left the agency
537
+ */
538
+ member?: MemberPeekResponse;
539
+ };
540
+ export type ReplyToSocialCommentRequest = {
541
+ /**
542
+ * Posted exactly as written; how long it may be is the channel's rule
543
+ */
544
+ text: string;
545
+ };
481
546
  export type CloseListingRequest = {
482
547
  withdrawExternal?: boolean;
483
548
  };
@@ -612,17 +677,13 @@ export type CommentView = {
612
677
  authorLastName: string;
613
678
  profilePictureUrl?: string;
614
679
  body: string;
680
+ mentionedMembers: Array<MemberPeekResponse>;
681
+ mentionedContacts: Array<ContactMentionView>;
615
682
  createdAt: Date;
616
683
  editedAt?: Date;
617
684
  };
618
- export type CursorPageCommentView = {
619
- items?: Array<CommentView>;
620
- nextCursor?: string;
621
- hasNext?: boolean;
622
- };
623
- export type ContactLink = {
685
+ export type ContactMentionView = {
624
686
  contactId: number;
625
- primary: boolean;
626
687
  personalDetails: ContactPersonalDetailsRestricted | ContactPersonalDetailsVisible;
627
688
  contactAssignedTo?: string;
628
689
  };
@@ -637,6 +698,17 @@ export type ContactPersonalDetailsVisible = {
637
698
  email?: string;
638
699
  status: 'VISIBLE';
639
700
  };
701
+ export type CursorPageCommentView = {
702
+ items?: Array<CommentView>;
703
+ nextCursor?: string;
704
+ hasNext?: boolean;
705
+ };
706
+ export type ContactLink = {
707
+ contactId: number;
708
+ primary: boolean;
709
+ personalDetails: ContactPersonalDetailsRestricted | ContactPersonalDetailsVisible;
710
+ contactAssignedTo?: string;
711
+ };
640
712
  export type InterestLink = {
641
713
  interestId: number;
642
714
  contactId: number;
@@ -658,14 +730,6 @@ export type LocationResponse = {
658
730
  id: number;
659
731
  names: Array<LangTextResponse>;
660
732
  };
661
- export type MemberPeekResponse = {
662
- memberId: string;
663
- firstName: string;
664
- lastName: string;
665
- photo?: string;
666
- phone?: string;
667
- email: string;
668
- };
669
733
  export type Participant = {
670
734
  memberId: string;
671
735
  firstName: string;
@@ -736,37 +800,42 @@ export type TodoItem = {
736
800
  completedAt?: Date;
737
801
  completedBy?: string;
738
802
  };
739
- export type ContactTaskResponse = {
803
+ export type ContactTaskCardResponse = {
740
804
  taskId: string;
741
- title: string;
742
- boardId: string;
743
- boardName: string;
744
805
  stageId: string;
745
806
  stageName: string;
746
- outcome?: 'WON' | 'LOST';
807
+ title: string;
808
+ hasDescription: boolean;
809
+ commentCount: number;
810
+ contactCount: number;
811
+ priority: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
747
812
  value?: number;
813
+ commissionType?: 'NOT_SET' | 'FIXED' | 'PERCENTAGE' | 'MONTHS_OF_RENT';
814
+ commissionValue?: number;
815
+ ownerId?: string;
816
+ primaryContactId?: number;
817
+ primaryContact?: ContactPersonalDetailsRestricted | ContactPersonalDetailsVisible;
818
+ contactAssignedTo?: string;
819
+ primaryContent?: TaskContentInterest | TaskContentProperty;
820
+ participants: Array<string>;
821
+ rank: string;
822
+ stageEnteredAt: Date;
823
+ daysInStage: number;
824
+ openTodos: number;
825
+ totalTodos: number;
826
+ hasLeftoverOpenTodos: boolean;
827
+ expectedCloseDate?: Date;
828
+ outcome?: 'WON' | 'LOST';
829
+ lostReason?: 'NOT_WORKING_WITH_AGENTS' | 'NOT_RESPONDING' | 'ALREADY_SOLD' | 'COULD_NOT_NEGOTIATE_PRICE' | 'CHOSE_ANOTHER_AGENCY' | 'CHANGED_PLANS' | 'OUT_OF_BUDGET' | 'SPAM' | 'OTHER';
830
+ closedAt?: Date;
831
+ boardId: string;
832
+ boardName: string;
833
+ stageColor: string;
748
834
  primary: boolean;
749
835
  };
750
- export type BoardCardsResponse = {
751
- boardId: string;
752
- name: string;
753
- kind?: 'OWNER' | 'SEEKER';
836
+ export type ContactTasksResponse = {
754
837
  members: Array<MemberPeekResponse>;
755
- columns: Array<Column>;
756
- };
757
- export type Column = {
758
- stageId: string;
759
- name: string;
760
- color: string;
761
- position: number;
762
- totalTasks: number;
763
- totalValue: number;
764
- cards: CursorPageTaskCardResponse;
765
- };
766
- export type CursorPageTaskCardResponse = {
767
- items?: Array<TaskCardResponse>;
768
- nextCursor?: string;
769
- hasNext?: boolean;
838
+ items: Array<ContactTaskCardResponse>;
770
839
  };
771
840
  export type TaskCardResponse = {
772
841
  taskId: string;
@@ -813,6 +882,27 @@ export type TaskContentProperty = Omit<TaskContent, 'type'> & {
813
882
  title?: string;
814
883
  type: 'PROPERTY';
815
884
  };
885
+ export type BoardCardsResponse = {
886
+ boardId: string;
887
+ name: string;
888
+ kind?: 'OWNER' | 'SEEKER';
889
+ members: Array<MemberPeekResponse>;
890
+ columns: Array<Column>;
891
+ };
892
+ export type Column = {
893
+ stageId: string;
894
+ name: string;
895
+ color: string;
896
+ position: number;
897
+ totalTasks: number;
898
+ totalValue: number;
899
+ cards: CursorPageTaskCardResponse;
900
+ };
901
+ export type CursorPageTaskCardResponse = {
902
+ items?: Array<TaskCardResponse>;
903
+ nextCursor?: string;
904
+ hasNext?: boolean;
905
+ };
816
906
  export type StageCardsResponse = {
817
907
  members: Array<MemberPeekResponse>;
818
908
  data: CursorPageTaskCardResponse;
@@ -1187,6 +1277,10 @@ export type PropertyListingResponse = {
1187
1277
  * Facebook / Instagram posts of this listing, newest first
1188
1278
  */
1189
1279
  socialPosts: Array<SocialPostResponse>;
1280
+ /**
1281
+ * Comment threads waiting for an answer from the agency, across the listing's posts
1282
+ */
1283
+ unansweredComments: number;
1190
1284
  createdAt: Date;
1191
1285
  closedAt?: Date;
1192
1286
  };
@@ -1232,16 +1326,34 @@ export type SocialPostResponse = {
1232
1326
  createdBy: MemberPeekResponse;
1233
1327
  failureReason?: 'RECONNECT_REQUIRED' | 'PERMISSION_MISSING' | 'PAGE_PUBLISHING_AUTHORIZATION' | 'RATE_LIMITED' | 'BAD_MEDIA' | 'UNCONFIRMED' | 'UNKNOWN';
1234
1328
  /**
1235
- * The post's public counts as last read from Facebook / Instagram; null until the first read
1329
+ * The post's numbers as last read from Facebook / Instagram; null until the first read
1236
1330
  */
1237
1331
  stats?: SocialPostStats;
1332
+ /**
1333
+ * Comment threads under the post waiting for an answer from the agency; 0 unless PUBLISHED
1334
+ */
1335
+ unansweredComments: number;
1238
1336
  };
1239
1337
  export type SocialPostStats = {
1240
- likes: number;
1241
- comments: number;
1242
- shares: number;
1243
1338
  /**
1244
- * When the counts were read — show how old they are
1339
+ * On Facebook all reactions, as Facebook shows them under the post
1340
+ */
1341
+ likes?: number;
1342
+ /**
1343
+ * Replies included
1344
+ */
1345
+ comments?: number;
1346
+ shares?: number;
1347
+ /**
1348
+ * How many times the post was seen
1349
+ */
1350
+ views?: number;
1351
+ /**
1352
+ * How many people saw the post
1353
+ */
1354
+ reach?: number;
1355
+ /**
1356
+ * When the numbers were read — show how old they are. Likes and comments are read every 15 minutes on the post's first day, then less often; Meta updates views and reach about once a day
1245
1357
  */
1246
1358
  fetchedAt: Date;
1247
1359
  };
@@ -1298,6 +1410,15 @@ export type ListingExpired = {
1298
1410
  export type MemberId = {
1299
1411
  value?: string;
1300
1412
  };
1413
+ export type MemberMentioned = {
1414
+ commentId?: CommentId;
1415
+ contactId?: ContactId;
1416
+ taskId?: TaskId;
1417
+ authorId?: MemberId;
1418
+ author?: string;
1419
+ commentSnippet?: string;
1420
+ kind: 'MEMBER_MENTIONED';
1421
+ };
1301
1422
  export type NewMessage = {
1302
1423
  contactId?: ContactId;
1303
1424
  conversationId?: ConversationId;
@@ -1324,15 +1445,34 @@ export type NotificationFeed = {
1324
1445
  export type NotificationView = {
1325
1446
  id: string;
1326
1447
  seq: number;
1327
- type: 'AGENT_COMMENTED' | 'TASK_COMMENTED' | 'EXTERNAL_LISTING_EXPIRED' | 'LISTING_EXPIRED' | 'NEW_SEEKER_RATING' | 'NEW_MESSAGE' | 'CONTACT_ASSIGNED' | 'SUBSCRIPTION_PAYMENT_FAILED' | 'SUBSCRIPTION_ENDING' | 'SUBSCRIPTION_EXPIRED' | 'SUBSCRIPTION_PAYMENT_REVERSED' | 'CHANNEL_REAUTH_REQUIRED' | 'SOCIAL_POST_FAILED';
1448
+ type: 'AGENT_COMMENTED' | 'TASK_COMMENTED' | 'MEMBER_MENTIONED' | 'EXTERNAL_LISTING_EXPIRED' | 'LISTING_EXPIRED' | 'NEW_SEEKER_RATING' | 'NEW_MESSAGE' | 'CONTACT_ASSIGNED' | 'SUBSCRIPTION_PAYMENT_FAILED' | 'SUBSCRIPTION_ENDING' | 'SUBSCRIPTION_EXPIRED' | 'SUBSCRIPTION_PAYMENT_REVERSED' | 'CHANNEL_REAUTH_REQUIRED' | 'SOCIAL_POST_FAILED' | 'SOCIAL_POST_COMMENTED';
1328
1449
  targetId?: string;
1329
- payload: AgentCommented | ChannelReauthRequired | ContactAssigned | ListingExpired | NewMessage | NewSeekerRating | SocialPostFailed | SubscriptionEnding | SubscriptionExpired | SubscriptionPaymentFailed | SubscriptionPaymentReversed | TaskCommented;
1450
+ payload: AgentCommented | ChannelReauthRequired | ContactAssigned | ListingExpired | MemberMentioned | NewMessage | NewSeekerRating | SocialPostCommented | SocialPostFailed | SubscriptionEnding | SubscriptionExpired | SubscriptionPaymentFailed | SubscriptionPaymentReversed | TaskCommented;
1451
+ /**
1452
+ * How many times this came while unread; the payload is the latest. For SOCIAL_POST_COMMENTED: the new comments on the post since its notification was last read. Starts again at 1 once read
1453
+ */
1454
+ count: number;
1330
1455
  createdAt: Date;
1331
1456
  read: boolean;
1332
1457
  };
1333
1458
  export type PropertyId = {
1334
1459
  value?: number;
1335
1460
  };
1461
+ export type SocialCommentId = {
1462
+ value?: string;
1463
+ };
1464
+ export type SocialPostCommented = {
1465
+ postId?: SocialPostId;
1466
+ commentId?: SocialCommentId;
1467
+ contactId?: ContactId;
1468
+ propertyId?: PropertyId;
1469
+ listingId?: number;
1470
+ propertyTitle?: string;
1471
+ channel?: 'FACEBOOK' | 'INSTAGRAM';
1472
+ author?: string;
1473
+ commentSnippet?: string;
1474
+ kind: 'SOCIAL_POST_COMMENTED';
1475
+ };
1336
1476
  export type SocialPostFailed = {
1337
1477
  postId?: SocialPostId;
1338
1478
  contactId?: ContactId;
@@ -1679,6 +1819,39 @@ export type ComposerPreview = {
1679
1819
  */
1680
1820
  access: 'ALLOWED' | 'NOT_CONNECTED' | 'RECONNECT_REQUIRED';
1681
1821
  };
1822
+ export type CursorPageSocialCommentThreadResponse = {
1823
+ items?: Array<SocialCommentThreadResponse>;
1824
+ nextCursor?: string;
1825
+ hasNext?: boolean;
1826
+ };
1827
+ export type SocialCommentPost = {
1828
+ postId: string;
1829
+ channel: 'FACEBOOK' | 'INSTAGRAM';
1830
+ /**
1831
+ * PUBLISHED, or REMOVED once gone from Facebook / Instagram: its comments stay, and can no longer be answered
1832
+ */
1833
+ status: 'PUBLISHING' | 'PUBLISHED' | 'FAILED' | 'REMOVED';
1834
+ permalink: string;
1835
+ publishedAt: Date;
1836
+ };
1837
+ export type SocialCommentThreadResponse = {
1838
+ /**
1839
+ * The post the thread is under
1840
+ */
1841
+ post: SocialCommentPost;
1842
+ /**
1843
+ * The comment that started the thread
1844
+ */
1845
+ comment: SocialCommentResponse;
1846
+ /**
1847
+ * Oldest first, one level deep as Facebook and Instagram show it: a reply to a reply is listed here too
1848
+ */
1849
+ replies: Array<SocialCommentResponse>;
1850
+ /**
1851
+ * False while the thread's latest comment from someone else has no reply from the agency after it. Hidden and removed comments need no answer, and a FAILED reply is none
1852
+ */
1853
+ answered: boolean;
1854
+ };
1682
1855
  export type ContactGridResponse = {
1683
1856
  id: number;
1684
1857
  createdBy?: string;
@@ -1719,7 +1892,7 @@ export type Client360Response = {
1719
1892
  updatedAt: Date;
1720
1893
  interests: Array<ContactInterestResponse>;
1721
1894
  properties: Array<ContactPropertyResponse>;
1722
- tasks: Array<ContactTaskResponse>;
1895
+ tasks: ContactTasksResponse;
1723
1896
  };
1724
1897
  export type CommunicationPreferenceResponse = {
1725
1898
  preferredContactMethod?: 'WHATSAPP' | 'VIBER' | 'PHONE_CALL';
@@ -3692,6 +3865,42 @@ export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSoci
3692
3865
  202: SocialPostView;
3693
3866
  };
3694
3867
  export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialPostsByPostIdRetryResponse = PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialPostsByPostIdRetryResponses[keyof PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialPostsByPostIdRetryResponses];
3868
+ export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRetryData = {
3869
+ body?: never;
3870
+ path: {
3871
+ contactId: number;
3872
+ propertyId: number;
3873
+ listingId: number;
3874
+ commentId: string;
3875
+ };
3876
+ query?: never;
3877
+ url: '/contacts/{contactId}/properties/{propertyId}/listings/{listingId}/social-comments/{commentId}/retry';
3878
+ };
3879
+ export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRetryResponses = {
3880
+ /**
3881
+ * Accepted
3882
+ */
3883
+ 202: SocialCommentResponse;
3884
+ };
3885
+ export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRetryResponse = PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRetryResponses[keyof PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRetryResponses];
3886
+ export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRepliesData = {
3887
+ body: ReplyToSocialCommentRequest;
3888
+ path: {
3889
+ contactId: number;
3890
+ propertyId: number;
3891
+ listingId: number;
3892
+ commentId: string;
3893
+ };
3894
+ query?: never;
3895
+ url: '/contacts/{contactId}/properties/{propertyId}/listings/{listingId}/social-comments/{commentId}/replies';
3896
+ };
3897
+ export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRepliesResponses = {
3898
+ /**
3899
+ * Accepted
3900
+ */
3901
+ 202: SocialCommentResponse;
3902
+ };
3903
+ export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRepliesResponse = PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRepliesResponses[keyof PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsByCommentIdRepliesResponses];
3695
3904
  export type PostContactsByContactIdPropertiesByPropertyIdListingsByListingIdResumeData = {
3696
3905
  body?: never;
3697
3906
  path: {
@@ -4140,7 +4349,7 @@ export type GetTaskByContactByContactIdResponses = {
4140
4349
  /**
4141
4350
  * OK
4142
4351
  */
4143
- 200: Array<ContactTaskResponse>;
4352
+ 200: ContactTasksResponse;
4144
4353
  };
4145
4354
  export type GetTaskByContactByContactIdResponse = GetTaskByContactByContactIdResponses[keyof GetTaskByContactByContactIdResponses];
4146
4355
  export type GetTaskBoardByBoardIdData = {
@@ -5006,6 +5215,28 @@ export type GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocia
5006
5215
  200: ComposerPreview;
5007
5216
  };
5008
5217
  export type GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialPostsPreviewResponse = GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialPostsPreviewResponses[keyof GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialPostsPreviewResponses];
5218
+ export type GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsData = {
5219
+ body?: never;
5220
+ path: {
5221
+ contactId: number;
5222
+ propertyId: number;
5223
+ listingId: number;
5224
+ };
5225
+ query?: {
5226
+ postId?: string;
5227
+ channel?: 'FACEBOOK' | 'INSTAGRAM';
5228
+ cursor?: string;
5229
+ limit?: number;
5230
+ };
5231
+ url: '/contacts/{contactId}/properties/{propertyId}/listings/{listingId}/social-comments';
5232
+ };
5233
+ export type GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsResponses = {
5234
+ /**
5235
+ * OK
5236
+ */
5237
+ 200: CursorPageSocialCommentThreadResponse;
5238
+ };
5239
+ export type GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsResponse = GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsResponses[keyof GetContactsByContactIdPropertiesByPropertyIdListingsByListingIdSocialCommentsResponses];
5009
5240
  export type GetContactsByContactIdInterestsByInterestIdRecommendationsDecisionsData = {
5010
5241
  body?: never;
5011
5242
  path: {
@@ -5126,6 +5357,22 @@ export type GetContactGroupsResponses = {
5126
5357
  200: Array<GroupCount>;
5127
5358
  };
5128
5359
  export type GetContactGroupsResponse = GetContactGroupsResponses[keyof GetContactGroupsResponses];
5360
+ export type GetCommentsMentionsData = {
5361
+ body?: never;
5362
+ path?: never;
5363
+ query?: {
5364
+ cursor?: string;
5365
+ limit?: number;
5366
+ };
5367
+ url: '/comments/mentions';
5368
+ };
5369
+ export type GetCommentsMentionsResponses = {
5370
+ /**
5371
+ * OK
5372
+ */
5373
+ 200: CursorPageCommentView;
5374
+ };
5375
+ export type GetCommentsMentionsResponse = GetCommentsMentionsResponses[keyof GetCommentsMentionsResponses];
5129
5376
  export type DeleteBoardByBoardIdData = {
5130
5377
  body?: never;
5131
5378
  path: {