@silexpert/core 1.1.174 → 1.1.176

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 (240) hide show
  1. package/dist/cjs/api/resources/Card.d.ts +10 -0
  2. package/dist/cjs/api/resources/Card.d.ts.map +1 -0
  3. package/dist/cjs/api/resources/Card.js +23 -0
  4. package/dist/cjs/api/resources/Card.js.map +1 -0
  5. package/dist/cjs/api/resources/ExercicePrestation.d.ts +11 -0
  6. package/dist/cjs/api/resources/ExercicePrestation.d.ts.map +1 -0
  7. package/dist/cjs/api/resources/ExercicePrestation.js +16 -0
  8. package/dist/cjs/api/resources/ExercicePrestation.js.map +1 -0
  9. package/dist/cjs/api/resources/Notion.d.ts +5 -4
  10. package/dist/cjs/api/resources/Notion.d.ts.map +1 -1
  11. package/dist/cjs/api/resources/Notion.js +1 -1
  12. package/dist/cjs/api/resources/Notion.js.map +1 -1
  13. package/dist/cjs/api/resources.d.ts +4 -0
  14. package/dist/cjs/api/resources.d.ts.map +1 -1
  15. package/dist/cjs/api/resources.js +4 -0
  16. package/dist/cjs/api/resources.js.map +1 -1
  17. package/dist/cjs/types/Enum/BrandPourcentage.js +14 -14
  18. package/dist/cjs/types/Enum/BrandPourcentage.js.map +1 -1
  19. package/dist/cjs/types/Enum/Card.d.ts +77 -0
  20. package/dist/cjs/types/Enum/Card.d.ts.map +1 -0
  21. package/dist/cjs/types/Enum/Card.js +94 -0
  22. package/dist/cjs/types/Enum/Card.js.map +1 -0
  23. package/dist/cjs/types/Enum/Comment.d.ts +2 -1
  24. package/dist/cjs/types/Enum/Comment.d.ts.map +1 -1
  25. package/dist/cjs/types/Enum/Comment.js +1 -0
  26. package/dist/cjs/types/Enum/Comment.js.map +1 -1
  27. package/dist/cjs/types/Enum/PrestationType.d.ts.map +1 -1
  28. package/dist/cjs/types/Enum/PrestationType.js +175 -0
  29. package/dist/cjs/types/Enum/PrestationType.js.map +1 -1
  30. package/dist/cjs/types/Interface/api/balanceSheet/UpdateBalanceSheet.d.ts +1 -0
  31. package/dist/cjs/types/Interface/api/balanceSheet/UpdateBalanceSheet.d.ts.map +1 -1
  32. package/dist/cjs/types/Interface/api/balanceSheet/UpdateBalanceSheet.js +6 -0
  33. package/dist/cjs/types/Interface/api/balanceSheet/UpdateBalanceSheet.js.map +1 -1
  34. package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEvent.d.ts +1 -0
  35. package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEvent.d.ts.map +1 -1
  36. package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEvent.js +4 -0
  37. package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEvent.js.map +1 -1
  38. package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.d.ts +1 -0
  39. package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.d.ts.map +1 -1
  40. package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.js +4 -0
  41. package/dist/cjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.js.map +1 -1
  42. package/dist/cjs/types/Interface/api/card/QueryUserCards.d.ts +10 -0
  43. package/dist/cjs/types/Interface/api/card/QueryUserCards.d.ts.map +1 -0
  44. package/dist/cjs/types/Interface/api/card/QueryUserCards.js +53 -0
  45. package/dist/cjs/types/Interface/api/card/QueryUserCards.js.map +1 -0
  46. package/dist/cjs/types/Interface/api/card/QueryUserCardsStats.d.ts +6 -0
  47. package/dist/cjs/types/Interface/api/card/QueryUserCardsStats.d.ts.map +1 -0
  48. package/dist/cjs/types/Interface/api/card/QueryUserCardsStats.js +33 -0
  49. package/dist/cjs/types/Interface/api/card/QueryUserCardsStats.js.map +1 -0
  50. package/dist/cjs/types/Interface/api/card/UpdateCard.d.ts +10 -0
  51. package/dist/cjs/types/Interface/api/card/UpdateCard.d.ts.map +1 -0
  52. package/dist/cjs/types/Interface/api/card/UpdateCard.js +57 -0
  53. package/dist/cjs/types/Interface/api/card/UpdateCard.js.map +1 -0
  54. package/dist/cjs/types/Interface/api/exercicePrestation/Query.d.ts +7 -0
  55. package/dist/cjs/types/Interface/api/exercicePrestation/Query.d.ts.map +1 -0
  56. package/dist/cjs/types/Interface/api/exercicePrestation/Query.js +28 -0
  57. package/dist/cjs/types/Interface/api/exercicePrestation/Query.js.map +1 -0
  58. package/dist/cjs/types/Interface/api/notion/NotionResponse.d.ts +1537 -0
  59. package/dist/cjs/types/Interface/api/notion/NotionResponse.d.ts.map +1 -0
  60. package/dist/cjs/types/Interface/api/notion/NotionResponse.js +3 -0
  61. package/dist/cjs/types/Interface/api/notion/NotionResponse.js.map +1 -0
  62. package/dist/cjs/types/Interface/api/webmail/GetPaginatedWhereObjectParams.d.ts +1 -0
  63. package/dist/cjs/types/Interface/api/webmail/GetPaginatedWhereObjectParams.d.ts.map +1 -1
  64. package/dist/cjs/types/Interface/api/webmail/GetPaginatedWhereObjectParams.js +6 -0
  65. package/dist/cjs/types/Interface/api/webmail/GetPaginatedWhereObjectParams.js.map +1 -1
  66. package/dist/cjs/types/Interface/models/IBalanceSheet.d.ts +16 -13
  67. package/dist/cjs/types/Interface/models/IBalanceSheet.d.ts.map +1 -1
  68. package/dist/cjs/types/Interface/models/IBalanceSheet.js.map +1 -1
  69. package/dist/cjs/types/Interface/models/ICalendarEvent.d.ts +3 -0
  70. package/dist/cjs/types/Interface/models/ICalendarEvent.d.ts.map +1 -1
  71. package/dist/cjs/types/Interface/models/ICalendarEvent.js.map +1 -1
  72. package/dist/cjs/types/Interface/models/ICard.d.ts +29 -0
  73. package/dist/cjs/types/Interface/models/ICard.d.ts.map +1 -0
  74. package/dist/cjs/types/Interface/models/ICard.js +3 -0
  75. package/dist/cjs/types/Interface/models/ICard.js.map +1 -0
  76. package/dist/cjs/types/Interface/models/ICardHistory.d.ts +17 -0
  77. package/dist/cjs/types/Interface/models/ICardHistory.d.ts.map +1 -0
  78. package/dist/cjs/types/Interface/models/ICardHistory.js +3 -0
  79. package/dist/cjs/types/Interface/models/ICardHistory.js.map +1 -0
  80. package/dist/cjs/types/Interface/models/IComment.d.ts +3 -1
  81. package/dist/cjs/types/Interface/models/IComment.d.ts.map +1 -1
  82. package/dist/cjs/types/Interface/models/IComment.js.map +1 -1
  83. package/dist/cjs/types/Interface/models/IPrestationList.d.ts +1 -0
  84. package/dist/cjs/types/Interface/models/IPrestationList.d.ts.map +1 -1
  85. package/dist/cjs/types/Interface/models/IPrestationList.js.map +1 -1
  86. package/dist/cjs/types/Interface/models/ISociety.d.ts +9 -0
  87. package/dist/cjs/types/Interface/models/ISociety.d.ts.map +1 -1
  88. package/dist/cjs/types/Interface/models/ISociety.js.map +1 -1
  89. package/dist/cjs/types/Interface/models/IUser.d.ts +2 -0
  90. package/dist/cjs/types/Interface/models/IUser.d.ts.map +1 -1
  91. package/dist/cjs/types/Interface/models/IUser.js.map +1 -1
  92. package/dist/cjs/types/Interface/models/IUserBrand.d.ts +6 -0
  93. package/dist/cjs/types/Interface/models/IUserBrand.d.ts.map +1 -0
  94. package/dist/cjs/types/Interface/models/IUserBrand.js +3 -0
  95. package/dist/cjs/types/Interface/models/IUserBrand.js.map +1 -0
  96. package/dist/cjs/types/index.d.ts +9 -0
  97. package/dist/cjs/types/index.d.ts.map +1 -1
  98. package/dist/cjs/types/index.js +9 -0
  99. package/dist/cjs/types/index.js.map +1 -1
  100. package/dist/cjs/utils/prestation.d.ts +1 -0
  101. package/dist/cjs/utils/prestation.d.ts.map +1 -1
  102. package/dist/cjs/utils/prestation.js +2 -2
  103. package/dist/cjs/utils/prestation.js.map +1 -1
  104. package/dist/cjs/utils/quotation.js +1 -1
  105. package/dist/cjs/utils/quotation.js.map +1 -1
  106. package/dist/mjs/api/resources/Card.d.ts +10 -0
  107. package/dist/mjs/api/resources/Card.d.ts.map +1 -0
  108. package/dist/mjs/api/resources/Card.js +19 -0
  109. package/dist/mjs/api/resources/Card.js.map +1 -0
  110. package/dist/mjs/api/resources/ExercicePrestation.d.ts +11 -0
  111. package/dist/mjs/api/resources/ExercicePrestation.d.ts.map +1 -0
  112. package/dist/mjs/api/resources/ExercicePrestation.js +12 -0
  113. package/dist/mjs/api/resources/ExercicePrestation.js.map +1 -0
  114. package/dist/mjs/api/resources/Notion.d.ts +5 -4
  115. package/dist/mjs/api/resources/Notion.d.ts.map +1 -1
  116. package/dist/mjs/api/resources/Notion.js +1 -1
  117. package/dist/mjs/api/resources/Notion.js.map +1 -1
  118. package/dist/mjs/api/resources.d.ts +4 -0
  119. package/dist/mjs/api/resources.d.ts.map +1 -1
  120. package/dist/mjs/api/resources.js +4 -0
  121. package/dist/mjs/api/resources.js.map +1 -1
  122. package/dist/mjs/types/Enum/BrandPourcentage.js +14 -14
  123. package/dist/mjs/types/Enum/BrandPourcentage.js.map +1 -1
  124. package/dist/mjs/types/Enum/Card.d.ts +77 -0
  125. package/dist/mjs/types/Enum/Card.d.ts.map +1 -0
  126. package/dist/mjs/types/Enum/Card.js +91 -0
  127. package/dist/mjs/types/Enum/Card.js.map +1 -0
  128. package/dist/mjs/types/Enum/Comment.d.ts +2 -1
  129. package/dist/mjs/types/Enum/Comment.d.ts.map +1 -1
  130. package/dist/mjs/types/Enum/Comment.js +1 -0
  131. package/dist/mjs/types/Enum/Comment.js.map +1 -1
  132. package/dist/mjs/types/Enum/PrestationType.d.ts.map +1 -1
  133. package/dist/mjs/types/Enum/PrestationType.js +175 -0
  134. package/dist/mjs/types/Enum/PrestationType.js.map +1 -1
  135. package/dist/mjs/types/Interface/api/balanceSheet/UpdateBalanceSheet.d.ts +1 -0
  136. package/dist/mjs/types/Interface/api/balanceSheet/UpdateBalanceSheet.d.ts.map +1 -1
  137. package/dist/mjs/types/Interface/api/balanceSheet/UpdateBalanceSheet.js +7 -0
  138. package/dist/mjs/types/Interface/api/balanceSheet/UpdateBalanceSheet.js.map +1 -1
  139. package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEvent.d.ts +1 -0
  140. package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEvent.d.ts.map +1 -1
  141. package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEvent.js +5 -0
  142. package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEvent.js.map +1 -1
  143. package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.d.ts +1 -0
  144. package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.d.ts.map +1 -1
  145. package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.js +5 -0
  146. package/dist/mjs/types/Interface/api/calendarEvent/createCalendarEventForUsers.js.map +1 -1
  147. package/dist/mjs/types/Interface/api/card/QueryUserCards.d.ts +10 -0
  148. package/dist/mjs/types/Interface/api/card/QueryUserCards.d.ts.map +1 -0
  149. package/dist/mjs/types/Interface/api/card/QueryUserCards.js +55 -0
  150. package/dist/mjs/types/Interface/api/card/QueryUserCards.js.map +1 -0
  151. package/dist/mjs/types/Interface/api/card/QueryUserCardsStats.d.ts +6 -0
  152. package/dist/mjs/types/Interface/api/card/QueryUserCardsStats.d.ts.map +1 -0
  153. package/dist/mjs/types/Interface/api/card/QueryUserCardsStats.js +32 -0
  154. package/dist/mjs/types/Interface/api/card/QueryUserCardsStats.js.map +1 -0
  155. package/dist/mjs/types/Interface/api/card/UpdateCard.d.ts +10 -0
  156. package/dist/mjs/types/Interface/api/card/UpdateCard.d.ts.map +1 -0
  157. package/dist/mjs/types/Interface/api/card/UpdateCard.js +59 -0
  158. package/dist/mjs/types/Interface/api/card/UpdateCard.js.map +1 -0
  159. package/dist/mjs/types/Interface/api/exercicePrestation/Query.d.ts +7 -0
  160. package/dist/mjs/types/Interface/api/exercicePrestation/Query.d.ts.map +1 -0
  161. package/dist/mjs/types/Interface/api/exercicePrestation/Query.js +26 -0
  162. package/dist/mjs/types/Interface/api/exercicePrestation/Query.js.map +1 -0
  163. package/dist/mjs/types/Interface/api/notion/NotionResponse.d.ts +1537 -0
  164. package/dist/mjs/types/Interface/api/notion/NotionResponse.d.ts.map +1 -0
  165. package/dist/mjs/types/Interface/api/notion/NotionResponse.js +2 -0
  166. package/dist/mjs/types/Interface/api/notion/NotionResponse.js.map +1 -0
  167. package/dist/mjs/types/Interface/api/webmail/GetPaginatedWhereObjectParams.d.ts +1 -0
  168. package/dist/mjs/types/Interface/api/webmail/GetPaginatedWhereObjectParams.d.ts.map +1 -1
  169. package/dist/mjs/types/Interface/api/webmail/GetPaginatedWhereObjectParams.js +7 -0
  170. package/dist/mjs/types/Interface/api/webmail/GetPaginatedWhereObjectParams.js.map +1 -1
  171. package/dist/mjs/types/Interface/models/IBalanceSheet.d.ts +16 -13
  172. package/dist/mjs/types/Interface/models/IBalanceSheet.d.ts.map +1 -1
  173. package/dist/mjs/types/Interface/models/IBalanceSheet.js.map +1 -1
  174. package/dist/mjs/types/Interface/models/ICalendarEvent.d.ts +3 -0
  175. package/dist/mjs/types/Interface/models/ICalendarEvent.d.ts.map +1 -1
  176. package/dist/mjs/types/Interface/models/ICalendarEvent.js.map +1 -1
  177. package/dist/mjs/types/Interface/models/ICard.d.ts +29 -0
  178. package/dist/mjs/types/Interface/models/ICard.d.ts.map +1 -0
  179. package/dist/mjs/types/Interface/models/ICard.js +2 -0
  180. package/dist/mjs/types/Interface/models/ICard.js.map +1 -0
  181. package/dist/mjs/types/Interface/models/ICardHistory.d.ts +17 -0
  182. package/dist/mjs/types/Interface/models/ICardHistory.d.ts.map +1 -0
  183. package/dist/mjs/types/Interface/models/ICardHistory.js +2 -0
  184. package/dist/mjs/types/Interface/models/ICardHistory.js.map +1 -0
  185. package/dist/mjs/types/Interface/models/IComment.d.ts +3 -1
  186. package/dist/mjs/types/Interface/models/IComment.d.ts.map +1 -1
  187. package/dist/mjs/types/Interface/models/IComment.js.map +1 -1
  188. package/dist/mjs/types/Interface/models/IPrestationList.d.ts +1 -0
  189. package/dist/mjs/types/Interface/models/IPrestationList.d.ts.map +1 -1
  190. package/dist/mjs/types/Interface/models/IPrestationList.js.map +1 -1
  191. package/dist/mjs/types/Interface/models/ISociety.d.ts +9 -0
  192. package/dist/mjs/types/Interface/models/ISociety.d.ts.map +1 -1
  193. package/dist/mjs/types/Interface/models/ISociety.js.map +1 -1
  194. package/dist/mjs/types/Interface/models/IUser.d.ts +2 -0
  195. package/dist/mjs/types/Interface/models/IUser.d.ts.map +1 -1
  196. package/dist/mjs/types/Interface/models/IUser.js.map +1 -1
  197. package/dist/mjs/types/Interface/models/IUserBrand.d.ts +6 -0
  198. package/dist/mjs/types/Interface/models/IUserBrand.d.ts.map +1 -0
  199. package/dist/mjs/types/Interface/models/IUserBrand.js +2 -0
  200. package/dist/mjs/types/Interface/models/IUserBrand.js.map +1 -0
  201. package/dist/mjs/types/index.d.ts +9 -0
  202. package/dist/mjs/types/index.d.ts.map +1 -1
  203. package/dist/mjs/types/index.js +9 -0
  204. package/dist/mjs/types/index.js.map +1 -1
  205. package/dist/mjs/utils/prestation.d.ts +1 -0
  206. package/dist/mjs/utils/prestation.d.ts.map +1 -1
  207. package/dist/mjs/utils/prestation.js +2 -2
  208. package/dist/mjs/utils/prestation.js.map +1 -1
  209. package/dist/mjs/utils/quotation.js +1 -1
  210. package/dist/mjs/utils/quotation.js.map +1 -1
  211. package/package.json +1 -1
  212. package/ts/api/resources/Card.ts +25 -0
  213. package/ts/api/resources/ExercicePrestation.ts +16 -0
  214. package/ts/api/resources/Notion.ts +6 -5
  215. package/ts/api/resources.ts +4 -0
  216. package/ts/types/Enum/BrandPourcentage.ts +15 -15
  217. package/ts/types/Enum/Card.ts +110 -0
  218. package/ts/types/Enum/Comment.ts +1 -0
  219. package/ts/types/Enum/PrestationType.ts +175 -0
  220. package/ts/types/Interface/api/balanceSheet/UpdateBalanceSheet.ts +5 -0
  221. package/ts/types/Interface/api/calendarEvent/createCalendarEvent.ts +3 -0
  222. package/ts/types/Interface/api/calendarEvent/createCalendarEventForUsers.ts +3 -0
  223. package/ts/types/Interface/api/card/QueryUserCards.ts +33 -0
  224. package/ts/types/Interface/api/card/QueryUserCardsStats.ts +16 -0
  225. package/ts/types/Interface/api/card/UpdateCard.ts +38 -0
  226. package/ts/types/Interface/api/exercicePrestation/Query.ts +14 -0
  227. package/ts/types/Interface/api/notion/NotionResponse.ts +1288 -0
  228. package/ts/types/Interface/api/webmail/GetPaginatedWhereObjectParams.ts +5 -0
  229. package/ts/types/Interface/models/IBalanceSheet.ts +16 -13
  230. package/ts/types/Interface/models/ICalendarEvent.ts +3 -0
  231. package/ts/types/Interface/models/ICard.ts +31 -0
  232. package/ts/types/Interface/models/ICardHistory.ts +19 -0
  233. package/ts/types/Interface/models/IComment.ts +3 -1
  234. package/ts/types/Interface/models/IPrestationList.ts +1 -0
  235. package/ts/types/Interface/models/ISociety.ts +9 -0
  236. package/ts/types/Interface/models/IUser.ts +2 -0
  237. package/ts/types/Interface/models/IUserBrand.ts +7 -0
  238. package/ts/types/index.ts +11 -0
  239. package/ts/utils/prestation.ts +3 -3
  240. package/ts/utils/quotation.ts +1 -1
@@ -0,0 +1,1288 @@
1
+ /**
2
+ * CUSTOM TYPES (USES IN CONTROLLER)
3
+ */
4
+ export interface NotionLatestArticle {
5
+ infos: PageObjectResponse
6
+ summary: string
7
+ nbVideo: number
8
+ }
9
+
10
+ export interface NotionArticle {
11
+ html: string
12
+ nbVideo: number
13
+ infos: PageObjectResponse
14
+ }
15
+
16
+ export interface NotionFilteredArticle {
17
+ categorie: string;
18
+ subCategories: Record<string, any>;
19
+ }
20
+
21
+ export interface NotionSubCategories {
22
+ id: string;
23
+ icon: string | null;
24
+ label: string | null;
25
+ color: string | null;
26
+ }
27
+
28
+ type ApiColor =
29
+ | 'default'
30
+ | 'gray'
31
+ | 'brown'
32
+ | 'orange'
33
+ | 'yellow'
34
+ | 'green'
35
+ | 'blue'
36
+ | 'purple'
37
+ | 'pink'
38
+ | 'red'
39
+ | 'gray_background'
40
+ | 'brown_background'
41
+ | 'orange_background'
42
+ | 'yellow_background'
43
+ | 'green_background'
44
+ | 'blue_background'
45
+ | 'purple_background'
46
+ | 'pink_background'
47
+ | 'red_background';
48
+
49
+ type SelectColor =
50
+ | 'default'
51
+ | 'gray'
52
+ | 'brown'
53
+ | 'orange'
54
+ | 'yellow'
55
+ | 'green'
56
+ | 'blue'
57
+ | 'purple'
58
+ | 'pink'
59
+ | 'red';
60
+
61
+ type DateResponse = {
62
+ start: string
63
+ end: string | null
64
+ time_zone: string | null
65
+ };
66
+
67
+ /**
68
+ * USER RELATED TYPES
69
+ */
70
+ export type PartialBlockObjectResponse = { object: 'block'; id: string };
71
+ export type PartialUserObjectResponse = { object: 'user'; id: string };
72
+
73
+ export type PersonUserObjectResponse = {
74
+ type: 'person'
75
+ person: { email?: string }
76
+ name: string | null
77
+ avatar_url: string | null
78
+ id: string
79
+ object: 'user'
80
+ };
81
+
82
+ export type BotUserObjectResponse = {
83
+ type: 'bot'
84
+ bot:
85
+ | Record<string, never>
86
+ | {
87
+ owner:
88
+ | {
89
+ type: 'user'
90
+ user:
91
+ | {
92
+ type: 'person'
93
+ person: { email: string }
94
+ name: string | null
95
+ avatar_url: string | null
96
+ id: string
97
+ object: 'user'
98
+ }
99
+ | PartialUserObjectResponse
100
+ }
101
+ | { type: 'workspace'; workspace: true }
102
+ workspace_name: string | null
103
+ }
104
+ name: string | null
105
+ avatar_url: string | null
106
+ id: string
107
+ object: 'user'
108
+ };
109
+
110
+ export type UserObjectResponse =
111
+ | PersonUserObjectResponse
112
+ | BotUserObjectResponse;
113
+
114
+ /**
115
+ * TEXT RELATED TYPES
116
+ */
117
+
118
+ export type AnnotationResponse = {
119
+ bold: boolean
120
+ italic: boolean
121
+ strikethrough: boolean
122
+ underline: boolean
123
+ code: boolean
124
+ color:'default'
125
+ | 'gray'
126
+ | 'brown'
127
+ | 'orange'
128
+ | 'yellow'
129
+ | 'green'
130
+ | 'blue'
131
+ | 'purple'
132
+ | 'pink'
133
+ | 'red'
134
+ | 'gray_background'
135
+ | 'brown_background'
136
+ | 'orange_background'
137
+ | 'yellow_background'
138
+ | 'green_background'
139
+ | 'blue_background'
140
+ | 'purple_background'
141
+ | 'pink_background'
142
+ | 'red_background'
143
+ };
144
+
145
+ export type RichTextItemResponse = {
146
+ type: 'text' | 'mention' | 'equation'
147
+ text?: { content: string; link: { url: string } | null }
148
+ mention?: { type: 'user'; user: PartialUserObjectResponse | UserObjectResponse }
149
+ | { type: 'date'; date: DateResponse }
150
+ | { type: 'link_preview'; link_preview: LinkPreviewMentionResponse }
151
+ | { type: 'template_mention'; template_mention: TemplateMentionResponse }
152
+ | { type: 'page'; page: { id: string } }
153
+ | { type: 'database'; database: { id: string } }
154
+ equation?: { expression: string }
155
+ annotations: AnnotationResponse
156
+ plain_text: string
157
+ href: string | null
158
+ };
159
+
160
+ /**
161
+ * LINKS RELATED TYPES
162
+ */
163
+ type LinkPreviewMentionResponse = { url: string };
164
+
165
+ /**
166
+ * TEMPLATE RELATED TYPES
167
+ */
168
+ type TemplateMentionDateTemplateMentionResponse = {
169
+ type: 'template_mention_date'
170
+ template_mention_date: 'today' | 'now'
171
+ };
172
+
173
+ type TemplateMentionUserTemplateMentionResponse = {
174
+ type: 'template_mention_user'
175
+ template_mention_user: 'me'
176
+ };
177
+
178
+ type TemplateMentionResponse =
179
+ | TemplateMentionDateTemplateMentionResponse
180
+ | TemplateMentionUserTemplateMentionResponse;
181
+
182
+ /**
183
+ * DIFFERENT BLOCKS
184
+ *
185
+ */
186
+ export type ParagraphBlockObjectResponse = {
187
+ type: 'paragraph'
188
+ paragraph: { rich_text: Array<RichTextItemResponse>; color: ApiColor }
189
+ parent:
190
+ | { type: 'database_id'; database_id: string }
191
+ | { type: 'page_id'; page_id: string }
192
+ | { type: 'block_id'; block_id: string }
193
+ | { type: 'workspace'; workspace: true }
194
+ object: 'block'
195
+ id: string
196
+ created_time: string
197
+ created_by: PartialUserObjectResponse
198
+ last_edited_time: string
199
+ last_edited_by: PartialUserObjectResponse
200
+ has_children: boolean
201
+ archived: boolean
202
+ };
203
+
204
+ export type Heading1BlockObjectResponse = {
205
+ type: 'heading_1'
206
+ heading_1: {
207
+ rich_text: Array<RichTextItemResponse>
208
+ color: ApiColor
209
+ is_toggleable: boolean
210
+ }
211
+ parent:
212
+ | { type: 'database_id'; database_id: string }
213
+ | { type: 'page_id'; page_id: string }
214
+ | { type: 'block_id'; block_id: string }
215
+ | { type: 'workspace'; workspace: true }
216
+ object: 'block'
217
+ id: string
218
+ created_time: string
219
+ created_by: PartialUserObjectResponse
220
+ last_edited_time: string
221
+ last_edited_by: PartialUserObjectResponse
222
+ has_children: boolean
223
+ archived: boolean
224
+ };
225
+
226
+ export type Heading2BlockObjectResponse = {
227
+ type: 'heading_2'
228
+ heading_2: {
229
+ rich_text: Array<RichTextItemResponse>
230
+ color: ApiColor
231
+ is_toggleable: boolean
232
+ }
233
+ parent:
234
+ | { type: 'database_id'; database_id: string }
235
+ | { type: 'page_id'; page_id: string }
236
+ | { type: 'block_id'; block_id: string }
237
+ | { type: 'workspace'; workspace: true }
238
+ object: 'block'
239
+ id: string
240
+ created_time: string
241
+ created_by: PartialUserObjectResponse
242
+ last_edited_time: string
243
+ last_edited_by: PartialUserObjectResponse
244
+ has_children: boolean
245
+ archived: boolean
246
+ };
247
+
248
+ export type Heading3BlockObjectResponse = {
249
+ type: 'heading_3'
250
+ heading_3: {
251
+ rich_text: Array<RichTextItemResponse>
252
+ color: ApiColor
253
+ is_toggleable: boolean
254
+ }
255
+ parent:
256
+ | { type: 'database_id'; database_id: string }
257
+ | { type: 'page_id'; page_id: string }
258
+ | { type: 'block_id'; block_id: string }
259
+ | { type: 'workspace'; workspace: true }
260
+ object: 'block'
261
+ id: string
262
+ created_time: string
263
+ created_by: PartialUserObjectResponse
264
+ last_edited_time: string
265
+ last_edited_by: PartialUserObjectResponse
266
+ has_children: boolean
267
+ archived: boolean
268
+ };
269
+
270
+ export type BulletedListItemBlockObjectResponse = {
271
+ type: 'bulleted_list_item'
272
+ bulleted_list_item: {
273
+ rich_text: Array<RichTextItemResponse>
274
+ color: ApiColor
275
+ }
276
+ parent:
277
+ | { type: 'database_id'; database_id: string }
278
+ | { type: 'page_id'; page_id: string }
279
+ | { type: 'block_id'; block_id: string }
280
+ | { type: 'workspace'; workspace: true }
281
+ object: 'block'
282
+ id: string
283
+ created_time: string
284
+ created_by: PartialUserObjectResponse
285
+ last_edited_time: string
286
+ last_edited_by: PartialUserObjectResponse
287
+ has_children: boolean
288
+ archived: boolean
289
+ };
290
+
291
+ export type NumberedListItemBlockObjectResponse = {
292
+ type: 'numbered_list_item'
293
+ numbered_list_item: {
294
+ rich_text: Array<RichTextItemResponse>
295
+ color: ApiColor
296
+ }
297
+ parent:
298
+ | { type: 'database_id'; database_id: string }
299
+ | { type: 'page_id'; page_id: string }
300
+ | { type: 'block_id'; block_id: string }
301
+ | { type: 'workspace'; workspace: true }
302
+ object: 'block'
303
+ id: string
304
+ created_time: string
305
+ created_by: PartialUserObjectResponse
306
+ last_edited_time: string
307
+ last_edited_by: PartialUserObjectResponse
308
+ has_children: boolean
309
+ archived: boolean
310
+ };
311
+
312
+ export type QuoteBlockObjectResponse = {
313
+ type: 'quote'
314
+ quote: { rich_text: Array<RichTextItemResponse>; color: ApiColor }
315
+ parent:
316
+ | { type: 'database_id'; database_id: string }
317
+ | { type: 'page_id'; page_id: string }
318
+ | { type: 'block_id'; block_id: string }
319
+ | { type: 'workspace'; workspace: true }
320
+ object: 'block'
321
+ id: string
322
+ created_time: string
323
+ created_by: PartialUserObjectResponse
324
+ last_edited_time: string
325
+ last_edited_by: PartialUserObjectResponse
326
+ has_children: boolean
327
+ archived: boolean
328
+ };
329
+
330
+ export type ToDoBlockObjectResponse = {
331
+ type: 'to_do'
332
+ to_do: {
333
+ rich_text: Array<RichTextItemResponse>
334
+ color: ApiColor
335
+ checked: boolean
336
+ }
337
+ parent:
338
+ | { type: 'database_id'; database_id: string }
339
+ | { type: 'page_id'; page_id: string }
340
+ | { type: 'block_id'; block_id: string }
341
+ | { type: 'workspace'; workspace: true }
342
+ object: 'block'
343
+ id: string
344
+ created_time: string
345
+ created_by: PartialUserObjectResponse
346
+ last_edited_time: string
347
+ last_edited_by: PartialUserObjectResponse
348
+ has_children: boolean
349
+ archived: boolean
350
+ };
351
+
352
+ export type ToggleBlockObjectResponse = {
353
+ type: 'toggle'
354
+ toggle: { rich_text: Array<RichTextItemResponse>; color: ApiColor }
355
+ parent:
356
+ | { type: 'database_id'; database_id: string }
357
+ | { type: 'page_id'; page_id: string }
358
+ | { type: 'block_id'; block_id: string }
359
+ | { type: 'workspace'; workspace: true }
360
+ object: 'block'
361
+ id: string
362
+ created_time: string
363
+ created_by: PartialUserObjectResponse
364
+ last_edited_time: string
365
+ last_edited_by: PartialUserObjectResponse
366
+ has_children: boolean
367
+ archived: boolean
368
+ };
369
+
370
+ export type TemplateBlockObjectResponse = {
371
+ type: 'template'
372
+ template: { rich_text: Array<RichTextItemResponse> }
373
+ parent:
374
+ | { type: 'database_id'; database_id: string }
375
+ | { type: 'page_id'; page_id: string }
376
+ | { type: 'block_id'; block_id: string }
377
+ | { type: 'workspace'; workspace: true }
378
+ object: 'block'
379
+ id: string
380
+ created_time: string
381
+ created_by: PartialUserObjectResponse
382
+ last_edited_time: string
383
+ last_edited_by: PartialUserObjectResponse
384
+ has_children: boolean
385
+ archived: boolean
386
+ };
387
+
388
+ export type SyncedBlockBlockObjectResponse = {
389
+ type: 'synced_block'
390
+ synced_block: {
391
+ synced_from: { type: 'block_id'; block_id: string } | null
392
+ }
393
+ parent:
394
+ | { type: 'database_id'; database_id: string }
395
+ | { type: 'page_id'; page_id: string }
396
+ | { type: 'block_id'; block_id: string }
397
+ | { type: 'workspace'; workspace: true }
398
+ object: 'block'
399
+ id: string
400
+ created_time: string
401
+ created_by: PartialUserObjectResponse
402
+ last_edited_time: string
403
+ last_edited_by: PartialUserObjectResponse
404
+ has_children: boolean
405
+ archived: boolean
406
+ };
407
+
408
+ export type ChildPageBlockObjectResponse = {
409
+ type: 'child_page'
410
+ child_page: { title: string }
411
+ parent:
412
+ | { type: 'database_id'; database_id: string }
413
+ | { type: 'page_id'; page_id: string }
414
+ | { type: 'block_id'; block_id: string }
415
+ | { type: 'workspace'; workspace: true }
416
+ object: 'block'
417
+ id: string
418
+ created_time: string
419
+ created_by: PartialUserObjectResponse
420
+ last_edited_time: string
421
+ last_edited_by: PartialUserObjectResponse
422
+ has_children: boolean
423
+ archived: boolean
424
+ };
425
+
426
+ export type ChildDatabaseBlockObjectResponse = {
427
+ type: 'child_database'
428
+ child_database: { title: string }
429
+ parent:
430
+ | { type: 'database_id'; database_id: string }
431
+ | { type: 'page_id'; page_id: string }
432
+ | { type: 'block_id'; block_id: string }
433
+ | { type: 'workspace'; workspace: true }
434
+ object: 'block'
435
+ id: string
436
+ created_time: string
437
+ created_by: PartialUserObjectResponse
438
+ last_edited_time: string
439
+ last_edited_by: PartialUserObjectResponse
440
+ has_children: boolean
441
+ archived: boolean
442
+ };
443
+
444
+ export type EquationBlockObjectResponse = {
445
+ type: 'equation'
446
+ equation: { expression: string }
447
+ parent:
448
+ | { type: 'database_id'; database_id: string }
449
+ | { type: 'page_id'; page_id: string }
450
+ | { type: 'block_id'; block_id: string }
451
+ | { type: 'workspace'; workspace: true }
452
+ object: 'block'
453
+ id: string
454
+ created_time: string
455
+ created_by: PartialUserObjectResponse
456
+ last_edited_time: string
457
+ last_edited_by: PartialUserObjectResponse
458
+ has_children: boolean
459
+ archived: boolean
460
+ };
461
+
462
+ export type CalloutBlockObjectResponse = {
463
+ type: 'callout'
464
+ callout: {
465
+ rich_text: Array<RichTextItemResponse>
466
+ color: ApiColor
467
+ icon:
468
+ | { type: 'emoji'; emoji: string }
469
+ | null
470
+ | { type: 'external'; external: { url: string } }
471
+ | null
472
+ | { type: 'file'; file: { url: string; expiry_time: string } }
473
+ | null
474
+ }
475
+ parent:
476
+ | { type: 'database_id'; database_id: string }
477
+ | { type: 'page_id'; page_id: string }
478
+ | { type: 'block_id'; block_id: string }
479
+ | { type: 'workspace'; workspace: true }
480
+ object: 'block'
481
+ id: string
482
+ created_time: string
483
+ created_by: PartialUserObjectResponse
484
+ last_edited_time: string
485
+ last_edited_by: PartialUserObjectResponse
486
+ has_children: boolean
487
+ archived: boolean
488
+ };
489
+
490
+ export type DividerBlockObjectResponse = {
491
+ type: 'divider'
492
+ divider: Record<string, never>
493
+ parent:
494
+ | { type: 'database_id'; database_id: string }
495
+ | { type: 'page_id'; page_id: string }
496
+ | { type: 'block_id'; block_id: string }
497
+ | { type: 'workspace'; workspace: true }
498
+ object: 'block'
499
+ id: string
500
+ created_time: string
501
+ created_by: PartialUserObjectResponse
502
+ last_edited_time: string
503
+ last_edited_by: PartialUserObjectResponse
504
+ has_children: boolean
505
+ archived: boolean
506
+ };
507
+
508
+ export type BreadcrumbBlockObjectResponse = {
509
+ type: 'breadcrumb'
510
+ breadcrumb: Record<string, never>
511
+ parent:
512
+ | { type: 'database_id'; database_id: string }
513
+ | { type: 'page_id'; page_id: string }
514
+ | { type: 'block_id'; block_id: string }
515
+ | { type: 'workspace'; workspace: true }
516
+ object: 'block'
517
+ id: string
518
+ created_time: string
519
+ created_by: PartialUserObjectResponse
520
+ last_edited_time: string
521
+ last_edited_by: PartialUserObjectResponse
522
+ has_children: boolean
523
+ archived: boolean
524
+ };
525
+
526
+ export type TableOfContentsBlockObjectResponse = {
527
+ type: 'table_of_contents'
528
+ table_of_contents: { color: ApiColor }
529
+ parent:
530
+ | { type: 'database_id'; database_id: string }
531
+ | { type: 'page_id'; page_id: string }
532
+ | { type: 'block_id'; block_id: string }
533
+ | { type: 'workspace'; workspace: true }
534
+ object: 'block'
535
+ id: string
536
+ created_time: string
537
+ created_by: PartialUserObjectResponse
538
+ last_edited_time: string
539
+ last_edited_by: PartialUserObjectResponse
540
+ has_children: boolean
541
+ archived: boolean
542
+ };
543
+
544
+ export type ColumnListBlockObjectResponse = {
545
+ type: 'column_list'
546
+ column_list: Record<string, never>
547
+ parent:
548
+ | { type: 'database_id'; database_id: string }
549
+ | { type: 'page_id'; page_id: string }
550
+ | { type: 'block_id'; block_id: string }
551
+ | { type: 'workspace'; workspace: true }
552
+ object: 'block'
553
+ id: string
554
+ created_time: string
555
+ created_by: PartialUserObjectResponse
556
+ last_edited_time: string
557
+ last_edited_by: PartialUserObjectResponse
558
+ has_children: boolean
559
+ archived: boolean
560
+ };
561
+
562
+ export type ColumnBlockObjectResponse = {
563
+ type: 'column'
564
+ column: Record<string, never>
565
+ parent:
566
+ | { type: 'database_id'; database_id: string }
567
+ | { type: 'page_id'; page_id: string }
568
+ | { type: 'block_id'; block_id: string }
569
+ | { type: 'workspace'; workspace: true }
570
+ object: 'block'
571
+ id: string
572
+ created_time: string
573
+ created_by: PartialUserObjectResponse
574
+ last_edited_time: string
575
+ last_edited_by: PartialUserObjectResponse
576
+ has_children: boolean
577
+ archived: boolean
578
+ };
579
+
580
+ export type LinkToPageBlockObjectResponse = {
581
+ type: 'link_to_page'
582
+ link_to_page:
583
+ | { type: 'page_id'; page_id: string }
584
+ | { type: 'database_id'; database_id: string }
585
+ | { type: 'comment_id'; comment_id: string }
586
+ parent:
587
+ | { type: 'database_id'; database_id: string }
588
+ | { type: 'page_id'; page_id: string }
589
+ | { type: 'block_id'; block_id: string }
590
+ | { type: 'workspace'; workspace: true }
591
+ object: 'block'
592
+ id: string
593
+ created_time: string
594
+ created_by: PartialUserObjectResponse
595
+ last_edited_time: string
596
+ last_edited_by: PartialUserObjectResponse
597
+ has_children: boolean
598
+ archived: boolean
599
+ };
600
+
601
+ export type TableBlockObjectResponse = {
602
+ type: 'table'
603
+ table: {
604
+ has_column_header: boolean
605
+ has_row_header: boolean
606
+ table_width: number
607
+ }
608
+ parent:
609
+ | { type: 'database_id'; database_id: string }
610
+ | { type: 'page_id'; page_id: string }
611
+ | { type: 'block_id'; block_id: string }
612
+ | { type: 'workspace'; workspace: true }
613
+ object: 'block'
614
+ id: string
615
+ created_time: string
616
+ created_by: PartialUserObjectResponse
617
+ last_edited_time: string
618
+ last_edited_by: PartialUserObjectResponse
619
+ has_children: boolean
620
+ archived: boolean
621
+ };
622
+
623
+ export type TableRowBlockObjectResponse = {
624
+ type: 'table_row'
625
+ table_row: { cells: Array<Array<RichTextItemResponse>> }
626
+ parent:
627
+ | { type: 'database_id'; database_id: string }
628
+ | { type: 'page_id'; page_id: string }
629
+ | { type: 'block_id'; block_id: string }
630
+ | { type: 'workspace'; workspace: true }
631
+ object: 'block'
632
+ id: string
633
+ created_time: string
634
+ created_by: PartialUserObjectResponse
635
+ last_edited_time: string
636
+ last_edited_by: PartialUserObjectResponse
637
+ has_children: boolean
638
+ archived: boolean
639
+ };
640
+
641
+ export type EmbedBlockObjectResponse = {
642
+ type: 'embed'
643
+ embed: { url: string; caption: Array<RichTextItemResponse> }
644
+ parent:
645
+ | { type: 'database_id'; database_id: string }
646
+ | { type: 'page_id'; page_id: string }
647
+ | { type: 'block_id'; block_id: string }
648
+ | { type: 'workspace'; workspace: true }
649
+ object: 'block'
650
+ id: string
651
+ created_time: string
652
+ created_by: PartialUserObjectResponse
653
+ last_edited_time: string
654
+ last_edited_by: PartialUserObjectResponse
655
+ has_children: boolean
656
+ archived: boolean
657
+ };
658
+
659
+ export type BookmarkBlockObjectResponse = {
660
+ type: 'bookmark'
661
+ bookmark: { url: string; caption: Array<RichTextItemResponse> }
662
+ parent:
663
+ | { type: 'database_id'; database_id: string }
664
+ | { type: 'page_id'; page_id: string }
665
+ | { type: 'block_id'; block_id: string }
666
+ | { type: 'workspace'; workspace: true }
667
+ object: 'block'
668
+ id: string
669
+ created_time: string
670
+ created_by: PartialUserObjectResponse
671
+ last_edited_time: string
672
+ last_edited_by: PartialUserObjectResponse
673
+ has_children: boolean
674
+ archived: boolean
675
+ };
676
+
677
+ export type ImageBlockObjectResponse = {
678
+ type: 'image'
679
+ image:
680
+ | {
681
+ type: 'external'
682
+ external: { url: string }
683
+ caption: Array<RichTextItemResponse>
684
+ }
685
+ | {
686
+ type: 'file'
687
+ file: { url: string; expiry_time: string }
688
+ caption: Array<RichTextItemResponse>
689
+ }
690
+ parent:
691
+ | { type: 'database_id'; database_id: string }
692
+ | { type: 'page_id'; page_id: string }
693
+ | { type: 'block_id'; block_id: string }
694
+ | { type: 'workspace'; workspace: true }
695
+ object: 'block'
696
+ id: string
697
+ created_time: string
698
+ created_by: PartialUserObjectResponse
699
+ last_edited_time: string
700
+ last_edited_by: PartialUserObjectResponse
701
+ has_children: boolean
702
+ archived: boolean
703
+ };
704
+
705
+ export type VideoBlockObjectResponse = {
706
+ type: 'video'
707
+ video:
708
+ | {
709
+ type: 'external'
710
+ external: { url: string }
711
+ caption: Array<RichTextItemResponse>
712
+ }
713
+ | {
714
+ type: 'file'
715
+ file: { url: string; expiry_time: string }
716
+ caption: Array<RichTextItemResponse>
717
+ }
718
+ parent:
719
+ | { type: 'database_id'; database_id: string }
720
+ | { type: 'page_id'; page_id: string }
721
+ | { type: 'block_id'; block_id: string }
722
+ | { type: 'workspace'; workspace: true }
723
+ object: 'block'
724
+ id: string
725
+ created_time: string
726
+ created_by: PartialUserObjectResponse
727
+ last_edited_time: string
728
+ last_edited_by: PartialUserObjectResponse
729
+ has_children: boolean
730
+ archived: boolean
731
+ };
732
+
733
+ export type PdfBlockObjectResponse = {
734
+ type: 'pdf'
735
+ pdf:
736
+ | {
737
+ type: 'external'
738
+ external: { url: string }
739
+ caption: Array<RichTextItemResponse>
740
+ }
741
+ | {
742
+ type: 'file'
743
+ file: { url: string; expiry_time: string }
744
+ caption: Array<RichTextItemResponse>
745
+ }
746
+ parent:
747
+ | { type: 'database_id'; database_id: string }
748
+ | { type: 'page_id'; page_id: string }
749
+ | { type: 'block_id'; block_id: string }
750
+ | { type: 'workspace'; workspace: true }
751
+ object: 'block'
752
+ id: string
753
+ created_time: string
754
+ created_by: PartialUserObjectResponse
755
+ last_edited_time: string
756
+ last_edited_by: PartialUserObjectResponse
757
+ has_children: boolean
758
+ archived: boolean
759
+ };
760
+
761
+ export type FileBlockObjectResponse = {
762
+ type: 'file'
763
+ file:
764
+ | {
765
+ type: 'external'
766
+ external: { url: string }
767
+ caption: Array<RichTextItemResponse>
768
+ name: string
769
+ }
770
+ | {
771
+ type: 'file'
772
+ file: { url: string; expiry_time: string }
773
+ caption: Array<RichTextItemResponse>
774
+ name: string
775
+ }
776
+ parent:
777
+ | { type: 'database_id'; database_id: string }
778
+ | { type: 'page_id'; page_id: string }
779
+ | { type: 'block_id'; block_id: string }
780
+ | { type: 'workspace'; workspace: true }
781
+ object: 'block'
782
+ id: string
783
+ created_time: string
784
+ created_by: PartialUserObjectResponse
785
+ last_edited_time: string
786
+ last_edited_by: PartialUserObjectResponse
787
+ has_children: boolean
788
+ archived: boolean
789
+ };
790
+
791
+ export type AudioBlockObjectResponse = {
792
+ type: 'audio'
793
+ audio:
794
+ | {
795
+ type: 'external'
796
+ external: { url: string }
797
+ caption: Array<RichTextItemResponse>
798
+ }
799
+ | {
800
+ type: 'file'
801
+ file: { url: string; expiry_time: string }
802
+ caption: Array<RichTextItemResponse>
803
+ }
804
+ parent:
805
+ | { type: 'database_id'; database_id: string }
806
+ | { type: 'page_id'; page_id: string }
807
+ | { type: 'block_id'; block_id: string }
808
+ | { type: 'workspace'; workspace: true }
809
+ object: 'block'
810
+ id: string
811
+ created_time: string
812
+ created_by: PartialUserObjectResponse
813
+ last_edited_time: string
814
+ last_edited_by: PartialUserObjectResponse
815
+ has_children: boolean
816
+ archived: boolean
817
+ };
818
+
819
+ export type LinkPreviewBlockObjectResponse = {
820
+ type: 'link_preview'
821
+ link_preview: { url: string }
822
+ parent:
823
+ | { type: 'database_id'; database_id: string }
824
+ | { type: 'page_id'; page_id: string }
825
+ | { type: 'block_id'; block_id: string }
826
+ | { type: 'workspace'; workspace: true }
827
+ object: 'block'
828
+ id: string
829
+ created_time: string
830
+ created_by: PartialUserObjectResponse
831
+ last_edited_time: string
832
+ last_edited_by: PartialUserObjectResponse
833
+ has_children: boolean
834
+ archived: boolean
835
+ };
836
+
837
+ export type UnsupportedBlockObjectResponse = {
838
+ type: 'unsupported'
839
+ unsupported: Record<string, never>
840
+ parent:
841
+ | { type: 'database_id'; database_id: string }
842
+ | { type: 'page_id'; page_id: string }
843
+ | { type: 'block_id'; block_id: string }
844
+ | { type: 'workspace'; workspace: true }
845
+ object: 'block'
846
+ id: string
847
+ created_time: string
848
+ created_by: PartialUserObjectResponse
849
+ last_edited_time: string
850
+ last_edited_by: PartialUserObjectResponse
851
+ has_children: boolean
852
+ archived: boolean
853
+ };
854
+
855
+ /**
856
+ * DATABASE RELATED TYPES
857
+ */
858
+
859
+ type SelectPropertyResponse = {
860
+ id: string
861
+ name: string
862
+ color: SelectColor
863
+ };
864
+
865
+ type StringFormulaPropertyResponse = { type: 'string'; string: string | null };
866
+
867
+ type DateFormulaPropertyResponse = { type: 'date'; date: DateResponse | null };
868
+
869
+ type NumberFormulaPropertyResponse = { type: 'number'; number: number | null };
870
+
871
+ type BooleanFormulaPropertyResponse = {
872
+ type: 'boolean'
873
+ boolean: boolean | null
874
+ };
875
+
876
+ type FormulaPropertyResponse =
877
+ | StringFormulaPropertyResponse
878
+ | DateFormulaPropertyResponse
879
+ | NumberFormulaPropertyResponse
880
+ | BooleanFormulaPropertyResponse;
881
+
882
+ type VerificationPropertyUnverifiedResponse = {
883
+ state: 'unverified'
884
+ date: null
885
+ verified_by: null
886
+ };
887
+
888
+ type VerificationPropertyResponse = {
889
+ state: 'verified' | 'expired'
890
+ date: DateResponse | null
891
+ verified_by:
892
+ | { id: string }
893
+ | null
894
+ | {
895
+ person: { email?: string }
896
+ id: string
897
+ type?: 'person'
898
+ name?: string | null
899
+ avatar_url?: string | null
900
+ object?: 'user'
901
+ }
902
+ | null
903
+ | {
904
+ bot:
905
+ | Record<string, never>
906
+ | {
907
+ owner:
908
+ | {
909
+ type: 'user'
910
+ user:
911
+ | {
912
+ type: 'person'
913
+ person: { email: string }
914
+ name: string | null
915
+ avatar_url: string | null
916
+ id: string
917
+ object: 'user'
918
+ }
919
+ | PartialUserObjectResponse
920
+ }
921
+ | { type: 'workspace'; workspace: true }
922
+ workspace_name: string | null
923
+ }
924
+ id: string
925
+ type?: 'bot'
926
+ name?: string | null
927
+ avatar_url?: string | null
928
+ object?: 'user'
929
+ }
930
+ | null
931
+ };
932
+
933
+ export type PartialPageObjectResponse = { object: 'page'; id: string };
934
+ export type PageObjectResponse = {
935
+ parent: { type: 'database_id'; database_id: string } | { type: 'page_id'; page_id: string } | { type: 'block_id'; block_id: string } | { type: 'workspace'; workspace: true }
936
+ properties: Record<string,
937
+ {
938
+ type: string;
939
+ id?: string;
940
+ url?: string;
941
+ select?: SelectPropertyResponse;
942
+ multi_select?: SelectPropertyResponse[];
943
+ status?: SelectPropertyResponse;
944
+ date?: DateResponse;
945
+ email?:string;
946
+ phone_number?: string;
947
+ checkbox?: boolean;
948
+ files?: Array<{
949
+ file?: { url: string; expiry_time: string };
950
+ external?: { url: string };
951
+ name: string,
952
+ type?: string
953
+ }>;
954
+ created_by?: PartialUserObjectResponse | UserObjectResponse;
955
+ created_time: string;
956
+ last_edited_by?: PartialUserObjectResponse | UserObjectResponse;
957
+ last_edited_time?: string;
958
+ formula?: FormulaPropertyResponse;
959
+ unique_id?: { prefix: string | null; number: number | null };
960
+ verification?: VerificationPropertyUnverifiedResponse | VerificationPropertyResponse;
961
+ title?: Array<RichTextItemResponse>;
962
+ rich_text?: Array<RichTextItemResponse>;
963
+ people?: Array<PartialUserObjectResponse | UserObjectResponse>;
964
+ relation?: Array<{ id: string }>;
965
+ rollup?: {
966
+ type: string;
967
+ number?: number | null;
968
+ date?: DateResponse | null;
969
+ function: string
970
+ };
971
+ array?: Array<{
972
+ type: 'number' | 'url' | 'select' | 'multi_select';
973
+ number?: number | null
974
+ url?: string | null
975
+ select?: SelectPropertyResponse | null
976
+ multi_select?: Array<SelectPropertyResponse>
977
+ }>
978
+ }>;
979
+ icon: { type: 'emoji'; emoji: string } | { type: 'external'; external: { url: string } } | { type: 'file'; file: { url: string; expiry_time: string } } | null
980
+ cover: { type: 'external'; external: { url: string } } | { type: 'file'; file: { url: string; expiry_time: string } } | null
981
+ created_by: PartialUserObjectResponse
982
+ last_edited_by: PartialUserObjectResponse
983
+ object: 'page'
984
+ id: string
985
+ created_time: string
986
+ last_edited_time: string
987
+ archived: boolean
988
+ url: string
989
+ public_url: string | null
990
+ };
991
+
992
+ type NumberDatabasePropertyConfigResponse = {
993
+ type: 'number'
994
+ number: { format: string }
995
+ id: string
996
+ name: string
997
+ };
998
+
999
+ type FormulaDatabasePropertyConfigResponse = {
1000
+ type: 'formula'
1001
+ formula: { expression: string }
1002
+ id: string
1003
+ name: string
1004
+ };
1005
+
1006
+ type SelectDatabasePropertyConfigResponse = {
1007
+ type: 'select'
1008
+ select: { options: Array<SelectPropertyResponse> }
1009
+ id: string
1010
+ name: string
1011
+ };
1012
+
1013
+ type MultiSelectDatabasePropertyConfigResponse = {
1014
+ type: 'multi_select'
1015
+ multi_select: { options: Array<SelectPropertyResponse> }
1016
+ id: string
1017
+ name: string
1018
+ };
1019
+
1020
+ type StatusPropertyResponse = {
1021
+ id: string
1022
+ name: string
1023
+ color: SelectColor
1024
+ };
1025
+
1026
+ type StatusDatabasePropertyConfigResponse = {
1027
+ type: 'status'
1028
+ status: {
1029
+ options: Array<StatusPropertyResponse>
1030
+ groups: Array<{
1031
+ id: string
1032
+ name: string
1033
+ color: SelectColor
1034
+ option_ids: Array<string>
1035
+ }>
1036
+ }
1037
+ id: string
1038
+ name: string
1039
+ };
1040
+
1041
+ type SinglePropertyDatabasePropertyRelationConfigResponse = {
1042
+ type: 'single_property'
1043
+ single_property: string
1044
+ database_id: string
1045
+ };
1046
+
1047
+ type DualPropertyDatabasePropertyRelationConfigResponse = {
1048
+ type: 'dual_property'
1049
+ dual_property: {
1050
+ synced_property_id: string
1051
+ synced_property_name: string
1052
+ }
1053
+ database_id: string
1054
+ };
1055
+
1056
+ type DatabasePropertyRelationConfigResponse =
1057
+ | SinglePropertyDatabasePropertyRelationConfigResponse
1058
+ | DualPropertyDatabasePropertyRelationConfigResponse;
1059
+
1060
+ type RelationDatabasePropertyConfigResponse = {
1061
+ type: 'relation'
1062
+ relation: DatabasePropertyRelationConfigResponse
1063
+ id: string
1064
+ name: string
1065
+ };
1066
+
1067
+ type RollupDatabasePropertyConfigResponse = {
1068
+ type: 'rollup'
1069
+ rollup: {
1070
+ rollup_property_name: string
1071
+ relation_property_name: string
1072
+ rollup_property_id: string
1073
+ relation_property_id: string
1074
+ function: string
1075
+ }
1076
+ id: string
1077
+ name: string
1078
+ };
1079
+
1080
+ type UniqueIdDatabasePropertyConfigResponse = {
1081
+ type: 'unique_id'
1082
+ unique_id: { prefix: string | null }
1083
+ id: string
1084
+ name: string
1085
+ };
1086
+
1087
+ type TitleDatabasePropertyConfigResponse = {
1088
+ type: 'title'
1089
+ title: Record<string, never>
1090
+ id: string
1091
+ name: string
1092
+ };
1093
+
1094
+ type RichTextDatabasePropertyConfigResponse = {
1095
+ type: 'rich_text'
1096
+ rich_text: Record<string, never>
1097
+ id: string
1098
+ name: string
1099
+ };
1100
+
1101
+ type UrlDatabasePropertyConfigResponse = {
1102
+ type: 'url'
1103
+ url: Record<string, never>
1104
+ id: string
1105
+ name: string
1106
+ };
1107
+
1108
+ type PeopleDatabasePropertyConfigResponse = {
1109
+ type: 'people'
1110
+ people: Record<string, never>
1111
+ id: string
1112
+ name: string
1113
+ };
1114
+
1115
+ type FilesDatabasePropertyConfigResponse = {
1116
+ type: 'files'
1117
+ files: Record<string, never>
1118
+ id: string
1119
+ name: string
1120
+ };
1121
+
1122
+ type EmailDatabasePropertyConfigResponse = {
1123
+ type: 'email'
1124
+ email: Record<string, never>
1125
+ id: string
1126
+ name: string
1127
+ };
1128
+
1129
+ type PhoneNumberDatabasePropertyConfigResponse = {
1130
+ type: 'phone_number'
1131
+ phone_number: Record<string, never>
1132
+ id: string
1133
+ name: string
1134
+ };
1135
+
1136
+ type DateDatabasePropertyConfigResponse = {
1137
+ type: 'date'
1138
+ date: Record<string, never>
1139
+ id: string
1140
+ name: string
1141
+ };
1142
+
1143
+ type CheckboxDatabasePropertyConfigResponse = {
1144
+ type: 'checkbox'
1145
+ checkbox: Record<string, never>
1146
+ id: string
1147
+ name: string
1148
+ };
1149
+
1150
+ type CreatedByDatabasePropertyConfigResponse = {
1151
+ type: 'created_by'
1152
+ created_by: Record<string, never>
1153
+ id: string
1154
+ name: string
1155
+ };
1156
+
1157
+ type CreatedTimeDatabasePropertyConfigResponse = {
1158
+ type: 'created_time'
1159
+ created_time: Record<string, never>
1160
+ id: string
1161
+ name: string
1162
+ };
1163
+
1164
+ type LastEditedByDatabasePropertyConfigResponse = {
1165
+ type: 'last_edited_by'
1166
+ last_edited_by: Record<string, never>
1167
+ id: string
1168
+ name: string
1169
+ };
1170
+
1171
+ type LastEditedTimeDatabasePropertyConfigResponse = {
1172
+ type: 'last_edited_time'
1173
+ last_edited_time: Record<string, never>
1174
+ id: string
1175
+ name: string
1176
+ };
1177
+
1178
+ type DatabasePropertyConfigResponse =
1179
+ | NumberDatabasePropertyConfigResponse
1180
+ | FormulaDatabasePropertyConfigResponse
1181
+ | SelectDatabasePropertyConfigResponse
1182
+ | MultiSelectDatabasePropertyConfigResponse
1183
+ | StatusDatabasePropertyConfigResponse
1184
+ | RelationDatabasePropertyConfigResponse
1185
+ | RollupDatabasePropertyConfigResponse
1186
+ | UniqueIdDatabasePropertyConfigResponse
1187
+ | TitleDatabasePropertyConfigResponse
1188
+ | RichTextDatabasePropertyConfigResponse
1189
+ | UrlDatabasePropertyConfigResponse
1190
+ | PeopleDatabasePropertyConfigResponse
1191
+ | FilesDatabasePropertyConfigResponse
1192
+ | EmailDatabasePropertyConfigResponse
1193
+ | PhoneNumberDatabasePropertyConfigResponse
1194
+ | DateDatabasePropertyConfigResponse
1195
+ | CheckboxDatabasePropertyConfigResponse
1196
+ | CreatedByDatabasePropertyConfigResponse
1197
+ | CreatedTimeDatabasePropertyConfigResponse
1198
+ | LastEditedByDatabasePropertyConfigResponse
1199
+ | LastEditedTimeDatabasePropertyConfigResponse;
1200
+
1201
+ export type PartialDatabaseObjectResponse = {
1202
+ object: 'database'
1203
+ id: string
1204
+ properties: Record<string, DatabasePropertyConfigResponse>
1205
+ };
1206
+
1207
+ /**
1208
+ * BLOCK RESPONSES TYPES
1209
+ */
1210
+ export type BlockObjectResponse =
1211
+ | ParagraphBlockObjectResponse
1212
+ | Heading1BlockObjectResponse
1213
+ | Heading2BlockObjectResponse
1214
+ | Heading3BlockObjectResponse
1215
+ | BulletedListItemBlockObjectResponse
1216
+ | NumberedListItemBlockObjectResponse
1217
+ | QuoteBlockObjectResponse
1218
+ | ToDoBlockObjectResponse
1219
+ | ToggleBlockObjectResponse
1220
+ | TemplateBlockObjectResponse
1221
+ | SyncedBlockBlockObjectResponse
1222
+ | ChildPageBlockObjectResponse
1223
+ | ChildDatabaseBlockObjectResponse
1224
+ | EquationBlockObjectResponse
1225
+ | CalloutBlockObjectResponse
1226
+ | DividerBlockObjectResponse
1227
+ | BreadcrumbBlockObjectResponse
1228
+ | TableOfContentsBlockObjectResponse
1229
+ | ColumnListBlockObjectResponse
1230
+ | ColumnBlockObjectResponse
1231
+ | LinkToPageBlockObjectResponse
1232
+ | TableBlockObjectResponse
1233
+ | TableRowBlockObjectResponse
1234
+ | EmbedBlockObjectResponse
1235
+ | BookmarkBlockObjectResponse
1236
+ | ImageBlockObjectResponse
1237
+ | VideoBlockObjectResponse
1238
+ | PdfBlockObjectResponse
1239
+ | FileBlockObjectResponse
1240
+ | AudioBlockObjectResponse
1241
+ | LinkPreviewBlockObjectResponse
1242
+ | UnsupportedBlockObjectResponse;
1243
+
1244
+ export type ListBlockChildrenResponse = {
1245
+ type: 'block'
1246
+ block: Record<string, never>
1247
+ object: 'list'
1248
+ next_cursor: string | null
1249
+ has_more: boolean
1250
+ results: Array<BlockObjectResponse>
1251
+ };
1252
+
1253
+ /**
1254
+ * PAGE RESPONSES TYPES
1255
+ */
1256
+
1257
+ export type DatabaseObjectResponse = {
1258
+ title: Array<RichTextItemResponse>
1259
+ description: Array<RichTextItemResponse>
1260
+ icon: { type: 'emoji'; emoji: string } | { type: 'external'; external: { url: string } } | { type: 'file'; file: { url: string; expiry_time: string } } | null
1261
+ cover: { type: 'external'; external: { url: string } } | { type: 'file'; file: { url: string; expiry_time: string } } | null
1262
+ properties: Record<string, DatabasePropertyConfigResponse>
1263
+ parent: { type: 'database_id'; database_id: string } | { type: 'page_id'; page_id: string } | { type: 'block_id'; block_id: string } | { type: 'workspace'; workspace: true }
1264
+ created_by: PartialUserObjectResponse
1265
+ last_edited_by: PartialUserObjectResponse
1266
+ is_inline: boolean
1267
+ object: 'database'
1268
+ id: string
1269
+ created_time: string
1270
+ last_edited_time: string
1271
+ archived: boolean
1272
+ url: string
1273
+ public_url: string | null
1274
+ };
1275
+
1276
+ export type QueryDatabaseResponse = {
1277
+ type: 'page_or_database'
1278
+ page_or_database: Record<string, never>
1279
+ object: 'list'
1280
+ next_cursor: string | null
1281
+ has_more: boolean
1282
+ results: Array<PageObjectResponse | PartialPageObjectResponse | PartialDatabaseObjectResponse | DatabaseObjectResponse>
1283
+ };
1284
+
1285
+ export type GetDatabaseResponse = PartialDatabaseObjectResponse | DatabaseObjectResponse;
1286
+
1287
+
1288
+