@notionhq/apps 0.0.12 → 0.0.14

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 (137) hide show
  1. package/README.md +32 -0
  2. package/dist/box.generated.d.ts +164 -0
  3. package/dist/box.generated.d.ts.map +1 -0
  4. package/dist/box.generated.js +24 -0
  5. package/dist/calendar.generated.d.ts +1036 -0
  6. package/dist/calendar.generated.d.ts.map +1 -0
  7. package/dist/calendar.generated.js +42 -0
  8. package/dist/cli/build.d.ts.map +1 -1
  9. package/dist/cli/build.js +41 -10
  10. package/dist/cli/codegen.d.ts +2 -0
  11. package/dist/cli/codegen.d.ts.map +1 -1
  12. package/dist/cli/codegen.js +13 -2
  13. package/dist/cli/discover.d.ts +2 -0
  14. package/dist/cli/discover.d.ts.map +1 -1
  15. package/dist/cli/discover.js +4 -2
  16. package/dist/cli/emit-manifest.d.ts +3 -1
  17. package/dist/cli/emit-manifest.d.ts.map +1 -1
  18. package/dist/cli/emit-manifest.js +10 -4
  19. package/dist/cli/index.js +33 -1
  20. package/dist/confluence.generated.d.ts +98 -0
  21. package/dist/confluence.generated.d.ts.map +1 -0
  22. package/dist/confluence.generated.js +18 -0
  23. package/dist/connection-actions.d.ts +2 -0
  24. package/dist/connection-actions.d.ts.map +1 -0
  25. package/dist/connection-actions.js +0 -0
  26. package/dist/connection-trigger-definitions.generated.d.ts +34 -0
  27. package/dist/connection-trigger-definitions.generated.d.ts.map +1 -0
  28. package/dist/connection-trigger-definitions.generated.js +45 -0
  29. package/dist/connections.d.ts +15 -0
  30. package/dist/connections.d.ts.map +1 -0
  31. package/dist/connections.js +79 -0
  32. package/dist/connections.test.d.ts +2 -0
  33. package/dist/connections.test.d.ts.map +1 -0
  34. package/dist/cursor.generated.d.ts +154 -0
  35. package/dist/cursor.generated.d.ts.map +1 -0
  36. package/dist/cursor.generated.js +18 -0
  37. package/dist/custom-block.d.ts +54 -0
  38. package/dist/custom-block.d.ts.map +1 -0
  39. package/dist/custom-block.js +30 -0
  40. package/dist/custom-block.test.d.ts +2 -0
  41. package/dist/custom-block.test.d.ts.map +1 -0
  42. package/dist/custom-blocks.d.ts +2 -0
  43. package/dist/custom-blocks.d.ts.map +1 -0
  44. package/dist/custom-blocks.js +1 -0
  45. package/dist/discord.generated.d.ts +279 -0
  46. package/dist/discord.generated.d.ts.map +1 -0
  47. package/dist/discord.generated.js +33 -0
  48. package/dist/gmail.generated.d.ts +184 -0
  49. package/dist/gmail.generated.d.ts.map +1 -0
  50. package/dist/gmail.generated.js +21 -0
  51. package/dist/googleCalendar.generated.d.ts +83 -0
  52. package/dist/googleCalendar.generated.d.ts.map +1 -0
  53. package/dist/googleCalendar.generated.js +15 -0
  54. package/dist/googleDrive.generated.d.ts +210 -0
  55. package/dist/googleDrive.generated.d.ts.map +1 -0
  56. package/dist/googleDrive.generated.js +27 -0
  57. package/dist/googleDriveOauth.generated.d.ts +851 -0
  58. package/dist/googleDriveOauth.generated.d.ts.map +1 -0
  59. package/dist/googleDriveOauth.generated.js +84 -0
  60. package/dist/manifest.d.ts +1 -1
  61. package/dist/manifest.d.ts.map +1 -1
  62. package/dist/nds.css +1 -0
  63. package/dist/notion-as-code/database.d.ts +4 -3
  64. package/dist/notion-as-code/database.d.ts.map +1 -1
  65. package/dist/notion-as-code/database.js +11 -2
  66. package/dist/notion-as-code/intents.d.ts +4 -1
  67. package/dist/notion-as-code/intents.d.ts.map +1 -1
  68. package/dist/notion-as-code/page.d.ts +4 -4
  69. package/dist/notion-as-code/page.d.ts.map +1 -1
  70. package/dist/notion-as-code/page.js +11 -2
  71. package/dist/outlook.generated.d.ts +224 -0
  72. package/dist/outlook.generated.d.ts.map +1 -0
  73. package/dist/outlook.generated.js +24 -0
  74. package/dist/providers.generated.d.ts +117 -0
  75. package/dist/providers.generated.d.ts.map +1 -0
  76. package/dist/providers.generated.js +108 -0
  77. package/dist/react.d.ts +2 -0
  78. package/dist/react.d.ts.map +1 -0
  79. package/dist/react.js +1 -0
  80. package/dist/salesforce.generated.d.ts +151 -0
  81. package/dist/salesforce.generated.d.ts.map +1 -0
  82. package/dist/salesforce.generated.js +24 -0
  83. package/dist/slack.generated.d.ts +290 -0
  84. package/dist/slack.generated.d.ts.map +1 -0
  85. package/dist/slack.generated.js +30 -0
  86. package/dist/triggers.generated.d.ts +107 -32
  87. package/dist/triggers.generated.d.ts.map +1 -1
  88. package/dist/triggers.generated.js +36 -24
  89. package/dist/workflow-connections-types.test.d.ts +2 -0
  90. package/dist/workflow-connections-types.test.d.ts.map +1 -0
  91. package/dist/workflow-types.test.d.ts +2 -0
  92. package/dist/workflow-types.test.d.ts.map +1 -0
  93. package/dist/workflow.d.ts +20 -16
  94. package/dist/workflow.d.ts.map +1 -1
  95. package/dist/workflow.js +14 -17
  96. package/docs/BUILD.md +83 -14
  97. package/docs/CONNECTIONS.md +129 -0
  98. package/package.json +16 -2
  99. package/src/box.generated.ts +187 -0
  100. package/src/calendar.generated.ts +1117 -0
  101. package/src/cli/build.test.ts +87 -0
  102. package/src/cli/build.ts +47 -9
  103. package/src/cli/codegen.test.ts +2 -0
  104. package/src/cli/codegen.ts +25 -7
  105. package/src/cli/discover.test.ts +12 -0
  106. package/src/cli/discover.ts +6 -2
  107. package/src/cli/emit-manifest.ts +13 -3
  108. package/src/cli/index.ts +33 -1
  109. package/src/confluence.generated.ts +109 -0
  110. package/src/connection-actions.ts +2 -0
  111. package/src/connection-trigger-definitions.generated.ts +48 -0
  112. package/src/connections.test.ts +157 -0
  113. package/src/connections.ts +126 -0
  114. package/src/cursor.generated.ts +167 -0
  115. package/src/custom-block.test.ts +19 -0
  116. package/src/custom-block.ts +41 -0
  117. package/src/custom-blocks.ts +1 -0
  118. package/src/discord.generated.ts +318 -0
  119. package/src/gmail.generated.ts +205 -0
  120. package/src/googleCalendar.generated.ts +95 -0
  121. package/src/googleDrive.generated.ts +235 -0
  122. package/src/googleDriveOauth.generated.ts +980 -0
  123. package/src/manifest.ts +1 -1
  124. package/src/nds.css +1 -0
  125. package/src/notion-as-code/database.ts +19 -11
  126. package/src/notion-as-code/intents.ts +2 -1
  127. package/src/notion-as-code/page.ts +17 -11
  128. package/src/outlook.generated.ts +249 -0
  129. package/src/providers.generated.ts +207 -0
  130. package/src/react.ts +1 -0
  131. package/src/salesforce.generated.ts +170 -0
  132. package/src/slack.generated.ts +330 -0
  133. package/src/triggers.generated.ts +112 -32
  134. package/src/workflow-connections-types.test.ts +59 -0
  135. package/src/workflow-types.test.ts +144 -0
  136. package/src/workflow.test.ts +112 -2
  137. package/src/workflow.ts +58 -29
@@ -0,0 +1,235 @@
1
+ // Generated by notion tool-core codegen-script-types --connections. Do not edit.
2
+ import type { ConnectionActionInvoker } from "./connection-actions.js"
3
+ /**
4
+ * Script input for the "Get Google Drive file comments" effect (`googleDrive.getFileComments`),
5
+ * derived from its Tool Core definition's call_function input projection.
6
+ *
7
+ * Load comments from a Google Drive file.
8
+ */
9
+ export type GetFileCommentsScriptInput = {
10
+ /**
11
+ * Google Drive file ID.
12
+ */
13
+ fileId: string
14
+ /**
15
+ * Optional shared drive IDs that may contain the file being loaded.
16
+ */
17
+ sharedDriveIds?: Array<string>
18
+ }
19
+
20
+ /**
21
+ * Canonical Tool Core output for the "Get Google Drive file comments" effect (`googleDrive.getFileComments`).
22
+ * This is the definition's output schema; the effect's script surface may
23
+ * re-encode it before returning.
24
+ */
25
+ export type GetFileCommentsScriptOutput = Array<{
26
+ author: string
27
+ bodyText: string
28
+ lastEdited: string
29
+ }>
30
+
31
+ /**
32
+ * Script input for the "Grep Google Drive files" effect (`googleDrive.grepFiles`),
33
+ * derived from its Tool Core definition's call_function input projection.
34
+ *
35
+ * Search for files in Google Drive.
36
+ */
37
+ export type GrepFilesScriptInput = {
38
+ /**
39
+ * Search query for Google Drive title and content.
40
+ */
41
+ query: string
42
+ /**
43
+ * Maximum number of results to return.
44
+ */
45
+ maxResults?: number
46
+ /**
47
+ * Optional shared drive IDs to scope the search to specific shared drives.
48
+ */
49
+ sharedDriveIds?: Array<string>
50
+ }
51
+
52
+ /**
53
+ * Canonical Tool Core output for the "Grep Google Drive files" effect (`googleDrive.grepFiles`).
54
+ * This is the definition's output schema; the effect's script surface may
55
+ * re-encode it before returning.
56
+ */
57
+ export type GrepFilesScriptOutput = Array<{
58
+ type: "googleDrive"
59
+ blocks: Array<string>
60
+ title: string
61
+ fileId: string
62
+ fileType: string
63
+ timestamp: number
64
+ comments?: Array<{
65
+ author: string
66
+ bodyText: string
67
+ lastEdited: string
68
+ }>
69
+ }>
70
+
71
+ /**
72
+ * Script input for the "Load a Google Drive file" effect (`googleDrive.loadFile`),
73
+ * derived from its Tool Core definition's call_function input projection.
74
+ *
75
+ * Load a Google Drive file.
76
+ */
77
+ export type LoadFileScriptInput = {
78
+ /**
79
+ * Google Drive file ID.
80
+ */
81
+ fileId: string
82
+ /**
83
+ * Optional shared drive IDs that may contain the file being loaded.
84
+ */
85
+ sharedDriveIds?: Array<string>
86
+ /**
87
+ * Whether to include comments in the file. Defaults to false unless user requests it.
88
+ */
89
+ includeComments?: boolean
90
+ }
91
+
92
+ /**
93
+ * Canonical Tool Core output for the "Load a Google Drive file" effect (`googleDrive.loadFile`).
94
+ * This is the definition's output schema; the effect's script surface may
95
+ * re-encode it before returning.
96
+ */
97
+ export type LoadFileScriptOutput = {
98
+ title: string
99
+ fileId: string
100
+ fileType: string
101
+ timestamp: number
102
+ }
103
+
104
+ /**
105
+ * Script input for the "Load a Google Drive ZIP file" effect (`googleDrive.loadZipFile`),
106
+ * derived from its Tool Core definition's call_function input projection.
107
+ *
108
+ * Load the top-level files and folders in a zip file on Google Drive, including readable text content when available.
109
+ */
110
+ export type LoadZipFileScriptInput = {
111
+ /**
112
+ * Google Drive file ID for the zip file.
113
+ */
114
+ fileId: string
115
+ /**
116
+ * Optional shared drive IDs to scope listing to specific shared drives.
117
+ */
118
+ sharedDriveIds?: Array<string>
119
+ }
120
+
121
+ /**
122
+ * Canonical Tool Core output for the "Load a Google Drive ZIP file" effect (`googleDrive.loadZipFile`).
123
+ * This is the definition's output schema; the effect's script surface may
124
+ * re-encode it before returning.
125
+ */
126
+ export type LoadZipFileScriptOutput = Array<{
127
+ blocks: Array<string>
128
+ title: string
129
+ path: string
130
+ fileType: string
131
+ timestamp: number
132
+ }>
133
+
134
+ /**
135
+ * Script input for the "List a Google Drive folder" effect (`googleDrive.lsFolder`),
136
+ * derived from its Tool Core definition's call_function input projection.
137
+ *
138
+ * List files in a Google Drive folder.
139
+ */
140
+ export type LsFolderScriptInput = {
141
+ /**
142
+ * Google Drive folder ID.
143
+ */
144
+ folderId: string
145
+ /**
146
+ * Optional shared drive IDs to scope listing to specific shared drives.
147
+ */
148
+ sharedDriveIds?: Array<string>
149
+ }
150
+
151
+ /**
152
+ * Canonical Tool Core output for the "List a Google Drive folder" effect (`googleDrive.lsFolder`).
153
+ * This is the definition's output schema; the effect's script surface may
154
+ * re-encode it before returning.
155
+ */
156
+ export type LsFolderScriptOutput = Array<{
157
+ type: "googleDrive"
158
+ blocks: Array<string>
159
+ title: string
160
+ fileId: string
161
+ fileType: string
162
+ timestamp: number
163
+ comments?: Array<{
164
+ author: string
165
+ bodyText: string
166
+ lastEdited: string
167
+ }>
168
+ }>
169
+
170
+ /**
171
+ * Script input for the "Search Google Drive" effect (`googleDrive.search`),
172
+ * derived from its Tool Core definition's call_function input projection.
173
+ *
174
+ * Search Google Drive via the configured connector.
175
+ */
176
+ export type SearchScriptInput = {
177
+ /**
178
+ * A single, focused question to search for.
179
+ */
180
+ question: string
181
+ /**
182
+ * Brief keywords capturing the core entities.
183
+ */
184
+ keywords?: string
185
+ /**
186
+ * Optional time window. Use only "default", "all_time", a duration matching /^\d+[dwmy]$/ (for example, "7d", "2w", "3m", or "1y"), or a date in "YYYY-MM-DD" format. Do not use natural-language durations or combine units.
187
+ */
188
+ lookback?: string
189
+ /**
190
+ * Optional shared drive IDs to scope search to specific shared drives.
191
+ */
192
+ sharedDriveIds?: Array<string>
193
+ }
194
+
195
+ /**
196
+ * Canonical Tool Core output for the "Search Google Drive" effect (`googleDrive.search`).
197
+ * This is the definition's output schema; the effect's script surface may
198
+ * re-encode it before returning.
199
+ */
200
+ export type SearchScriptOutput = {
201
+ results: Array<{
202
+ id: string
203
+ title: string
204
+ path: string
205
+ text: string
206
+ lastEdited: string
207
+ isPrivate: boolean
208
+ pageId: string
209
+ fileType: string
210
+ }>
211
+ }
212
+
213
+ export class GoogleDriveConnectionClient {
214
+ constructor(private readonly invoke: ConnectionActionInvoker) {}
215
+ getFileComments(
216
+ args: GetFileCommentsScriptInput,
217
+ ): Promise<GetFileCommentsScriptOutput> {
218
+ return this.invoke<GetFileCommentsScriptOutput>("getFileComments", args)
219
+ }
220
+ grepFiles(args: GrepFilesScriptInput): Promise<GrepFilesScriptOutput> {
221
+ return this.invoke<GrepFilesScriptOutput>("grepFiles", args)
222
+ }
223
+ loadFile(args: LoadFileScriptInput): Promise<LoadFileScriptOutput> {
224
+ return this.invoke<LoadFileScriptOutput>("loadFile", args)
225
+ }
226
+ loadZipFile(args: LoadZipFileScriptInput): Promise<LoadZipFileScriptOutput> {
227
+ return this.invoke<LoadZipFileScriptOutput>("loadZipFile", args)
228
+ }
229
+ lsFolder(args: LsFolderScriptInput): Promise<LsFolderScriptOutput> {
230
+ return this.invoke<LsFolderScriptOutput>("lsFolder", args)
231
+ }
232
+ search(args: SearchScriptInput): Promise<SearchScriptOutput> {
233
+ return this.invoke<SearchScriptOutput>("search", args)
234
+ }
235
+ }