@macro-inc/sdk 0.5.0 → 0.6.0

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 (138) hide show
  1. package/README.md +156 -23
  2. package/dist/{chunk-3SW6QVDV.js → chunk-4MI52GWV.js} +60 -1
  3. package/dist/{chunk-GT5EUYOR.js → chunk-HO75UE4Z.js} +133 -0
  4. package/dist/{chunk-P4DTO6VD.js → chunk-MCSQNZ4E.js} +6 -0
  5. package/dist/{chunk-HIW6KU2I.js → chunk-SJ6S2GAT.js} +712 -14
  6. package/dist/{chunk-J2VK3NOR.js → chunk-SK5CMXRV.js} +44 -14
  7. package/dist/{chunk-UVJLWLSJ.js → chunk-TMTYN2UK.js} +190 -2
  8. package/dist/{chunk-PPR7IWZ7.js → chunk-ZYBAKW25.js} +2 -1
  9. package/dist/generated/agent-fold/index.d.ts +194 -8
  10. package/dist/generated/agent-harness/index.d.ts +1 -1
  11. package/dist/generated/agent-harness/index.js +1 -1
  12. package/dist/generated/agent-harness/sdk.gen.d.ts +33 -2
  13. package/dist/generated/agent-harness/types.gen.d.ts +341 -8
  14. package/dist/generated/agent-reviews/index.d.ts +11 -9
  15. package/dist/generated/auth/index.d.ts +1 -1
  16. package/dist/generated/auth/index.js +1 -1
  17. package/dist/generated/auth/sdk.gen.d.ts +69 -1
  18. package/dist/generated/auth/types.gen.d.ts +734 -3
  19. package/dist/generated/calendar/types.gen.d.ts +10 -3
  20. package/dist/generated/cognition/index.d.ts +1 -1
  21. package/dist/generated/cognition/index.js +1 -1
  22. package/dist/generated/cognition/sdk.gen.d.ts +23 -6
  23. package/dist/generated/cognition/types.gen.d.ts +202 -114
  24. package/dist/generated/contacts/index.d.ts +1 -1
  25. package/dist/generated/contacts/index.js +1 -1
  26. package/dist/generated/contacts/sdk.gen.d.ts +5 -1
  27. package/dist/generated/contacts/types.gen.d.ts +56 -0
  28. package/dist/generated/email/types.gen.d.ts +8 -2
  29. package/dist/generated/notification/index.d.ts +1 -1
  30. package/dist/generated/notification/index.js +1 -1
  31. package/dist/generated/notification/sdk.gen.d.ts +2 -1
  32. package/dist/generated/notification/types.gen.d.ts +138 -0
  33. package/dist/generated/scheduled-action/index.d.ts +1 -1
  34. package/dist/generated/scheduled-action/index.js +1 -1
  35. package/dist/generated/scheduled-action/sdk.gen.d.ts +92 -2
  36. package/dist/generated/scheduled-action/types.gen.d.ts +1455 -21
  37. package/dist/generated/search/index.d.ts +1 -1
  38. package/dist/generated/search/types.gen.d.ts +50 -11
  39. package/dist/generated/storage/index.d.ts +1 -1
  40. package/dist/generated/storage/index.js +1 -1
  41. package/dist/generated/storage/sdk.gen.d.ts +309 -15
  42. package/dist/generated/storage/types.gen.d.ts +12437 -8899
  43. package/dist/src/entities/agent-sessions/activity.d.ts +3 -2
  44. package/dist/src/entities/agent-sessions/agent-session.d.ts +17 -5
  45. package/dist/src/entities/agent-sessions/namespace.d.ts +5 -4
  46. package/dist/src/entities/agent-sessions/review.d.ts +1 -1
  47. package/dist/src/entities/ai/namespace.d.ts +2 -2
  48. package/dist/src/entities/api-keys/namespace.d.ts +5 -2
  49. package/dist/src/entities/bots/bot.d.ts +6 -3
  50. package/dist/src/entities/calendar/booking-namespace.d.ts +1 -1
  51. package/dist/src/entities/calendar/calendar.d.ts +3 -2
  52. package/dist/src/entities/calendar/event.d.ts +9 -0
  53. package/dist/src/entities/calendar/namespace.d.ts +3 -2
  54. package/dist/src/entities/calls/call-record.d.ts +19 -5
  55. package/dist/src/entities/canvases/canvas.d.ts +5 -0
  56. package/dist/src/entities/channels/channel.d.ts +27 -7
  57. package/dist/src/entities/channels/message.d.ts +65 -2
  58. package/dist/src/entities/channels/message.test.d.ts +1 -0
  59. package/dist/src/entities/channels/namespace.d.ts +9 -4
  60. package/dist/src/entities/channels/post.d.ts +13 -7
  61. package/dist/src/entities/channels/share.d.ts +9 -0
  62. package/dist/src/entities/channels/share.test.d.ts +1 -0
  63. package/dist/src/entities/channels/thread.d.ts +5 -1
  64. package/dist/src/entities/chats/chat.d.ts +1 -1
  65. package/dist/src/entities/chats/namespace.d.ts +1 -1
  66. package/dist/src/entities/connected-apps/connected-app.d.ts +2 -1
  67. package/dist/src/entities/connected-apps/namespace.d.ts +2 -0
  68. package/dist/src/entities/crm/company.d.ts +1 -1
  69. package/dist/src/entities/crm/contact.d.ts +44 -3
  70. package/dist/src/entities/crm/namespace.d.ts +30 -13
  71. package/dist/src/entities/crm/pipeline-entry.d.ts +10 -3
  72. package/dist/src/entities/crm/pipeline.d.ts +39 -20
  73. package/dist/src/entities/crm/pipelines.d.ts +33 -5
  74. package/dist/src/entities/crm-email-privacy/email-privacy.d.ts +238 -0
  75. package/dist/src/entities/crm-email-privacy/email-rule-preview.d.ts +55 -0
  76. package/dist/src/entities/crm-email-privacy/email-rule-revision.d.ts +27 -0
  77. package/dist/src/entities/crm-email-privacy/email-rules.d.ts +32 -0
  78. package/dist/src/entities/databases/database.d.ts +34 -6
  79. package/dist/src/entities/databases/namespace.d.ts +26 -6
  80. package/dist/src/entities/databases/saved-query.d.ts +7 -1
  81. package/dist/src/entities/databases/table.d.ts +9 -0
  82. package/dist/src/entities/databases/view.d.ts +10 -0
  83. package/dist/src/entities/documents/create.test.d.ts +1 -0
  84. package/dist/src/entities/documents/document.d.ts +41 -6
  85. package/dist/src/entities/documents/namespace.d.ts +17 -3
  86. package/dist/src/entities/email/draft.d.ts +2 -2
  87. package/dist/src/entities/email/message.d.ts +18 -7
  88. package/dist/src/entities/email/namespace.d.ts +11 -7
  89. package/dist/src/entities/email/thread.d.ts +26 -3
  90. package/dist/src/entities/entity.d.ts +10 -1
  91. package/dist/src/entities/external-chat/chat.d.ts +19 -2
  92. package/dist/src/entities/foreign/namespace.d.ts +1 -1
  93. package/dist/src/entities/forms/form.d.ts +20 -1
  94. package/dist/src/entities/harnesses/namespace.d.ts +1 -1
  95. package/dist/src/entities/harnesses/pairing.d.ts +2 -1
  96. package/dist/src/entities/imports/entry.d.ts +65 -0
  97. package/dist/src/entities/imports/namespace.d.ts +103 -0
  98. package/dist/src/entities/imports/namespace.test.d.ts +1 -0
  99. package/dist/src/entities/initiatives/initiative.d.ts +14 -4
  100. package/dist/src/entities/initiatives/namespace.d.ts +4 -2
  101. package/dist/src/entities/me/namespace.d.ts +1 -1
  102. package/dist/src/entities/meetings/meeting.d.ts +2 -1
  103. package/dist/src/entities/notifications/namespace.d.ts +2 -1
  104. package/dist/src/entities/notifications/notification.d.ts +2 -1
  105. package/dist/src/entities/passwords/item.d.ts +118 -0
  106. package/dist/src/entities/passwords/namespace.d.ts +45 -0
  107. package/dist/src/entities/projects/namespace.d.ts +1 -1
  108. package/dist/src/entities/projects/project.d.ts +11 -1
  109. package/dist/src/entities/referrals/namespace.d.ts +1 -1
  110. package/dist/src/entities/routines/namespace.d.ts +81 -18
  111. package/dist/src/entities/routines/routine.d.ts +65 -4
  112. package/dist/src/entities/routines/suggestion.d.ts +38 -0
  113. package/dist/src/entities/saved-views/namespace.d.ts +2 -1
  114. package/dist/src/entities/search/exclusions.d.ts +6 -0
  115. package/dist/src/entities/search/namespace.d.ts +4 -2
  116. package/dist/src/entities/search/options.d.ts +3 -2
  117. package/dist/src/entities/suggestions/namespace.d.ts +118 -0
  118. package/dist/src/entities/suggestions/suggestion.d.ts +172 -0
  119. package/dist/src/entities/suggestions/suggestion.test.d.ts +1 -0
  120. package/dist/src/entities/tasks/namespace.d.ts +6 -5
  121. package/dist/src/entities/tasks/task.d.ts +14 -2
  122. package/dist/src/entities/teams/team.d.ts +16 -3
  123. package/dist/src/entities/ui/app-link.d.ts +24 -0
  124. package/dist/src/entities/ui/namespace.d.ts +75 -0
  125. package/dist/src/entities/users/namespace.d.ts +7 -3
  126. package/dist/src/entities/web/namespace.d.ts +2 -2
  127. package/dist/src/entities/workspace/namespace.d.ts +5 -3
  128. package/dist/src/entities/workspace/query.test.d.ts +1 -0
  129. package/dist/src/events/hydrate/document.d.ts +5 -0
  130. package/dist/src/macro.d.ts +26 -1
  131. package/dist/src/macro.js +4086 -1234
  132. package/dist/src/utils/activity.d.ts +2 -0
  133. package/dist/src/utils/index.d.ts +1 -1
  134. package/dist/src/utils/lazy.d.ts +13 -0
  135. package/dist/src/utils/options.d.ts +7 -0
  136. package/dist/src/utils/pagination.d.ts +16 -0
  137. package/dist/src/utils/verbs.d.ts +3 -0
  138. package/package.json +1 -1
@@ -839,20 +839,6 @@ var Sdk = class _Sdk extends HeyApiClient {
839
839
  }
840
840
  });
841
841
  }
842
- /**
843
- * Gets or creates an ai projection and the requesting user's instance,
844
- * triggering (or awaiting) materialization when needed.
845
- */
846
- upsertAiProjection(options) {
847
- return (options.client ?? this.client).post({
848
- url: "/ai-projections",
849
- ...options,
850
- headers: {
851
- "Content-Type": "application/json",
852
- ...options.headers
853
- }
854
- });
855
- }
856
842
  getChatsForAttachmentHandler(options) {
857
843
  return (options.client ?? this.client).get({ url: "/attachments/{attachment_id}/chats", ...options });
858
844
  }
@@ -1058,6 +1044,35 @@ var Sdk = class _Sdk extends HeyApiClient {
1058
1044
  }
1059
1045
  });
1060
1046
  }
1047
+ /**
1048
+ * List the caller's import ledger: staged candidates, running and finished
1049
+ * imports (with the team's imports), and declined items.
1050
+ */
1051
+ listImportEntities(options) {
1052
+ return (options?.client ?? this.client).get({ url: "/import/entities", ...options });
1053
+ }
1054
+ /**
1055
+ * Track an external item in the ledger: stage it as a candidate, or record a
1056
+ * Macro entity already created from it. Says when the item was already
1057
+ * imported, so callers do not create a duplicate.
1058
+ */
1059
+ trackImportEntity(options) {
1060
+ return (options.client ?? this.client).post({
1061
+ url: "/import/entities",
1062
+ ...options,
1063
+ headers: {
1064
+ "Content-Type": "application/json",
1065
+ ...options.headers
1066
+ }
1067
+ });
1068
+ }
1069
+ /**
1070
+ * Decline one of the caller's staged candidates; it is remembered as declined
1071
+ * and not proposed again.
1072
+ */
1073
+ declineImportEntity(options) {
1074
+ return (options.client ?? this.client).delete({ url: "/import/entities/{id}", ...options });
1075
+ }
1061
1076
  /**
1062
1077
  * Where the user's Notion workspace import stands.
1063
1078
  */
@@ -1071,6 +1086,21 @@ var Sdk = class _Sdk extends HeyApiClient {
1071
1086
  cancelNotionHandler(options) {
1072
1087
  return (options?.client ?? this.client).post({ url: "/import/notion/cancel", ...options });
1073
1088
  }
1089
+ /**
1090
+ * Import one Notion page as a Macro document through the caller's Notion
1091
+ * connection, deduplicated against the ledger. Notion databases are not
1092
+ * imported; a whole workspace goes through a reviewed import instead.
1093
+ */
1094
+ importNotionPage(options) {
1095
+ return (options.client ?? this.client).post({
1096
+ url: "/import/notion/pages",
1097
+ ...options,
1098
+ headers: {
1099
+ "Content-Type": "application/json",
1100
+ ...options.headers
1101
+ }
1102
+ });
1103
+ }
1074
1104
  /**
1075
1105
  * Accept staged imports (starts import jobs) and/or discard staged rows.
1076
1106
  */
@@ -810,6 +810,11 @@ var Sdk = class _Sdk extends HeyApiClient {
810
810
  listScheduledActions(options) {
811
811
  return (options?.client ?? this.client).get({ url: "/scheduled-actions", ...options });
812
812
  }
813
+ /**
814
+ * Create a routine. A create made by a routine's run, from its code step
815
+ * or its Ask AI step's session, makes that routine's sub-routine: the
816
+ * caller's credential says so, never the body.
817
+ */
813
818
  createScheduledAction(options) {
814
819
  return (options.client ?? this.client).post({
815
820
  url: "/scheduled-actions",
@@ -838,6 +843,25 @@ var Sdk = class _Sdk extends HeyApiClient {
838
843
  }
839
844
  });
840
845
  }
846
+ listRoutineDraftJobs(options) {
847
+ return (options?.client ?? this.client).get({ url: "/scheduled-actions/draft-jobs", ...options });
848
+ }
849
+ startRoutineDraftJob(options) {
850
+ return (options.client ?? this.client).post({
851
+ url: "/scheduled-actions/draft-jobs",
852
+ ...options,
853
+ headers: {
854
+ "Content-Type": "application/json",
855
+ ...options.headers
856
+ }
857
+ });
858
+ }
859
+ discardRoutineDraftJob(options) {
860
+ return (options.client ?? this.client).delete({ url: "/scheduled-actions/draft-jobs/{id}", ...options });
861
+ }
862
+ getRoutineDraftJob(options) {
863
+ return (options.client ?? this.client).get({ url: "/scheduled-actions/draft-jobs/{id}", ...options });
864
+ }
841
865
  draftRoutine(options) {
842
866
  return (options.client ?? this.client).post({
843
867
  url: "/scheduled-actions/drafts",
@@ -866,12 +890,29 @@ var Sdk = class _Sdk extends HeyApiClient {
866
890
  }
867
891
  });
868
892
  }
869
- generateRoutineSuggestions(options) {
870
- return (options.client ?? this.client).post({ url: "/scheduled-actions/suggestions/generate", ...options });
893
+ /**
894
+ * What a routines generation session reads before managing suggestions.
895
+ */
896
+ reviewRoutineSuggestions(options) {
897
+ return (options?.client ?? this.client).get({ url: "/scheduled-actions/suggestions/review", ...options });
871
898
  }
872
899
  dismissRoutineSuggestion(options) {
873
900
  return (options.client ?? this.client).post({ url: "/scheduled-actions/suggestions/{id}/dismiss", ...options });
874
901
  }
902
+ /**
903
+ * Retire an open suggestion that no longer fits, from a routines
904
+ * generation session.
905
+ */
906
+ retireRoutineSuggestion(options) {
907
+ return (options.client ?? this.client).post({
908
+ url: "/scheduled-actions/suggestions/{id}/retire",
909
+ ...options,
910
+ headers: {
911
+ "Content-Type": "application/json",
912
+ ...options.headers
913
+ }
914
+ });
915
+ }
875
916
  deleteScheduledAction(options) {
876
917
  return (options.client ?? this.client).delete({ url: "/scheduled-actions/{id}", ...options });
877
918
  }
@@ -888,9 +929,26 @@ var Sdk = class _Sdk extends HeyApiClient {
888
929
  }
889
930
  });
890
931
  }
932
+ setScheduledActionAppearance(options) {
933
+ return (options.client ?? this.client).put({
934
+ url: "/scheduled-actions/{id}/appearance",
935
+ ...options,
936
+ headers: {
937
+ "Content-Type": "application/json",
938
+ ...options.headers
939
+ }
940
+ });
941
+ }
891
942
  listScheduledActionCodeUpgrades(options) {
892
943
  return (options.client ?? this.client).get({ url: "/scheduled-actions/{id}/code-upgrades", ...options });
893
944
  }
945
+ /**
946
+ * Keep a sub-routine as the owner's own routine: it moves to the main list
947
+ * and no longer follows the routine whose run created it.
948
+ */
949
+ detachScheduledAction(options) {
950
+ return (options.client ?? this.client).post({ url: "/scheduled-actions/{id}/detach", ...options });
951
+ }
894
952
  setScheduledActionEnabled(options) {
895
953
  return (options.client ?? this.client).put({
896
954
  url: "/scheduled-actions/{id}/enabled",
@@ -933,6 +991,136 @@ var Sdk = class _Sdk extends HeyApiClient {
933
991
  }
934
992
  });
935
993
  }
994
+ /**
995
+ * The caller's feed, for them or their own agent.
996
+ */
997
+ listSuggestions(options) {
998
+ return (options?.client ?? this.client).get({ url: "/suggestions", ...options });
999
+ }
1000
+ /**
1001
+ * Add a suggestion from a suggestions generation session, or a new version of the
1002
+ * one with its dedup key.
1003
+ */
1004
+ addSuggestion(options) {
1005
+ return (options.client ?? this.client).post({
1006
+ url: "/suggestions",
1007
+ ...options,
1008
+ headers: {
1009
+ "Content-Type": "application/json",
1010
+ ...options.headers
1011
+ }
1012
+ });
1013
+ }
1014
+ /**
1015
+ * Start the caller's onboarding generation, once their inbox is connected.
1016
+ */
1017
+ startSuggestionGeneration(options) {
1018
+ return (options.client ?? this.client).post({ url: "/suggestions/generate", ...options });
1019
+ }
1020
+ /**
1021
+ * The caller's suggestion generations now.
1022
+ */
1023
+ getSuggestionGeneration(options) {
1024
+ return (options?.client ?? this.client).get({ url: "/suggestions/generation", ...options });
1025
+ }
1026
+ /**
1027
+ * Start fresh suggestions for the caller: at most once an hour, and not
1028
+ * while one of their generations runs.
1029
+ */
1030
+ regenerateSuggestions(options) {
1031
+ return (options.client ?? this.client).post({ url: "/suggestions/regenerate", ...options });
1032
+ }
1033
+ /**
1034
+ * What a suggestions generation session reads before managing suggestions.
1035
+ */
1036
+ reviewSuggestions(options) {
1037
+ return (options?.client ?? this.client).get({ url: "/suggestions/review", ...options });
1038
+ }
1039
+ /**
1040
+ * The caller loaded the app in their time zone.
1041
+ */
1042
+ recordSuggestionsSeen(options) {
1043
+ return (options.client ?? this.client).post({ url: "/suggestions/seen", ...options });
1044
+ }
1045
+ /**
1046
+ * The caller opened their feed: what it showed as new no longer is. The app
1047
+ * sends it once the feed is on screen.
1048
+ */
1049
+ recordSuggestionsViewed(options) {
1050
+ return (options?.client ?? this.client).post({ url: "/suggestions/viewed", ...options });
1051
+ }
1052
+ /**
1053
+ * Change an open suggestion from a suggestions generation session.
1054
+ */
1055
+ rewriteSuggestion(options) {
1056
+ return (options.client ?? this.client).patch({
1057
+ url: "/suggestions/{id}",
1058
+ ...options,
1059
+ headers: {
1060
+ "Content-Type": "application/json",
1061
+ ...options.headers
1062
+ }
1063
+ });
1064
+ }
1065
+ /**
1066
+ * The caller, or someone acting for them, acts on a suggestion: a background
1067
+ * prompt suggestion starts its run when the person accepts it in the app (anyone
1068
+ * else only takes it on); a reply suggestion is only taken on, and is done once
1069
+ * the person replies on its item; any other note or prompt is done once they act
1070
+ * on it (open its item or the composer), and shows in the feed's `done`. A
1071
+ * routine suggestion is refused: the person saves its routine in the app, which
1072
+ * makes it done.
1073
+ */
1074
+ acceptSuggestion(options) {
1075
+ return (options.client ?? this.client).post({
1076
+ url: "/suggestions/{id}/accept",
1077
+ ...options,
1078
+ headers: {
1079
+ "Content-Type": "application/json",
1080
+ ...options.headers
1081
+ }
1082
+ });
1083
+ }
1084
+ /**
1085
+ * The caller, or their own agent, isn't interested in an open suggestion.
1086
+ */
1087
+ dismissSuggestion(options) {
1088
+ return (options.client ?? this.client).post({ url: "/suggestions/{id}/dismiss", ...options });
1089
+ }
1090
+ /**
1091
+ * Make a reply draft a suggestions generation session wrote the draft of an
1092
+ * open reply suggestion. Nothing is sent.
1093
+ */
1094
+ attachSuggestionDraft(options) {
1095
+ return (options.client ?? this.client).put({
1096
+ url: "/suggestions/{id}/draft",
1097
+ ...options,
1098
+ headers: {
1099
+ "Content-Type": "application/json",
1100
+ ...options.headers
1101
+ }
1102
+ });
1103
+ }
1104
+ /**
1105
+ * The caller, or their own agent, takes back dismissing a suggestion, within
1106
+ * five minutes of it.
1107
+ */
1108
+ restoreSuggestion(options) {
1109
+ return (options.client ?? this.client).post({ url: "/suggestions/{id}/restore", ...options });
1110
+ }
1111
+ /**
1112
+ * Retire an open suggestion from a suggestions generation session.
1113
+ */
1114
+ retireSuggestion(options) {
1115
+ return (options.client ?? this.client).post({
1116
+ url: "/suggestions/{id}/retire",
1117
+ ...options,
1118
+ headers: {
1119
+ "Content-Type": "application/json",
1120
+ ...options.headers
1121
+ }
1122
+ });
1123
+ }
936
1124
  };
937
1125
 
938
1126
  export {
@@ -829,7 +829,8 @@ var Sdk = class _Sdk extends HeyApiClient {
829
829
  return (options.client ?? this.client).delete({ url: "/unsubscribe/item/{item_type}/{item_id}", ...options });
830
830
  }
831
831
  /**
832
- * Unsubscribes a user from a given item for notifications.
832
+ * Unsubscribes a user from a given item for notifications, or, with
833
+ * `mentions_only`, from everything on a channel but their direct mentions.
833
834
  */
834
835
  unsubscribeItem(options) {
835
836
  return (options.client ?? this.client).post({ url: "/unsubscribe/item/{item_type}/{item_id}", ...options });