@commandable/integration-data 0.0.1 → 0.0.4

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 (79) hide show
  1. package/dist/credentials-index.d.ts +4 -21
  2. package/dist/credentials-index.d.ts.map +1 -1
  3. package/dist/credentials-index.js +407 -215
  4. package/dist/credentials-index.js.map +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/loader.d.ts +38 -2
  10. package/dist/loader.d.ts.map +1 -1
  11. package/dist/loader.js +70 -16
  12. package/dist/loader.js.map +1 -1
  13. package/integrations/__tests__/liveHarness.ts +84 -0
  14. package/integrations/__tests__/usageParity.ts +54 -0
  15. package/integrations/airtable/__tests__/get_handlers.test.ts +18 -15
  16. package/integrations/airtable/__tests__/usage_parity.test.ts +3 -29
  17. package/integrations/airtable/__tests__/write_and_admin_handlers.test.ts +20 -17
  18. package/integrations/airtable/credentials.json +21 -16
  19. package/integrations/github/__tests__/get_handlers.test.ts +101 -108
  20. package/integrations/github/__tests__/usage_parity.test.ts +15 -27
  21. package/integrations/github/__tests__/write_handlers.test.ts +219 -306
  22. package/integrations/github/credentials.json +40 -15
  23. package/integrations/github/credentials_hint_classic_pat.md +8 -0
  24. package/integrations/github/credentials_hint_fine_grained_pat.md +9 -0
  25. package/integrations/github/manifest.json +2 -2
  26. package/integrations/google-calendar/__tests__/get_handlers.test.ts +21 -13
  27. package/integrations/google-calendar/__tests__/usage_parity.test.ts +3 -28
  28. package/integrations/google-calendar/__tests__/write_and_admin_handlers.test.ts +24 -17
  29. package/integrations/google-calendar/credentials.json +50 -29
  30. package/integrations/google-calendar/credentials_hint_oauth_token.md +8 -0
  31. package/integrations/google-calendar/credentials_hint_service_account.md +10 -0
  32. package/integrations/google-docs/__tests__/get_handlers.test.ts +87 -61
  33. package/integrations/google-docs/__tests__/usage_parity.test.ts +3 -28
  34. package/integrations/google-docs/__tests__/write_handlers.test.ts +248 -245
  35. package/integrations/google-docs/credentials.json +50 -29
  36. package/integrations/google-docs/credentials_hint_oauth_token.md +8 -0
  37. package/integrations/google-docs/credentials_hint_service_account.md +10 -0
  38. package/integrations/google-drive/credentials.json +57 -0
  39. package/integrations/google-drive/credentials_hint_oauth_token.md +8 -0
  40. package/integrations/google-drive/credentials_hint_service_account.md +10 -0
  41. package/integrations/google-drive/handlers/create_file.js +15 -0
  42. package/integrations/google-drive/handlers/create_folder.js +15 -0
  43. package/integrations/google-drive/handlers/delete_file.js +14 -0
  44. package/integrations/google-drive/handlers/get_file.js +7 -0
  45. package/integrations/google-drive/handlers/move_file.js +12 -0
  46. package/integrations/google-drive/manifest.json +42 -0
  47. package/integrations/google-drive/schemas/create_file.json +12 -0
  48. package/integrations/google-drive/schemas/create_folder.json +11 -0
  49. package/integrations/google-drive/schemas/delete_file.json +10 -0
  50. package/integrations/google-drive/schemas/get_file.json +10 -0
  51. package/integrations/google-drive/schemas/move_file.json +12 -0
  52. package/integrations/google-sheet/__tests__/get_handlers.test.ts +47 -55
  53. package/integrations/google-sheet/__tests__/usage_parity.test.ts +3 -29
  54. package/integrations/google-sheet/__tests__/write_handlers.test.ts +64 -63
  55. package/integrations/google-sheet/credentials.json +50 -29
  56. package/integrations/google-sheet/credentials_hint_oauth_token.md +8 -0
  57. package/integrations/google-sheet/credentials_hint_service_account.md +10 -0
  58. package/integrations/google-slides/__tests__/get_handlers.test.ts +37 -36
  59. package/integrations/google-slides/__tests__/usage_parity.test.ts +3 -28
  60. package/integrations/google-slides/__tests__/write_handlers.test.ts +65 -58
  61. package/integrations/google-slides/credentials.json +50 -29
  62. package/integrations/google-slides/credentials_hint_oauth_token.md +8 -0
  63. package/integrations/google-slides/credentials_hint_service_account.md +10 -0
  64. package/integrations/notion/__tests__/get_handlers.test.ts +18 -15
  65. package/integrations/notion/__tests__/usage_parity.test.ts +3 -28
  66. package/integrations/notion/__tests__/write_and_admin_handlers.test.ts +56 -60
  67. package/integrations/notion/credentials.json +22 -17
  68. package/integrations/trello/__tests__/get_handlers.test.ts +58 -73
  69. package/integrations/trello/__tests__/usage_parity.test.ts +3 -28
  70. package/integrations/trello/__tests__/write_and_admin_handlers.test.ts +49 -67
  71. package/integrations/trello/credentials.json +26 -21
  72. package/integrations/trello/handlers/close_board.js +6 -0
  73. package/integrations/trello/handlers/create_board.js +11 -0
  74. package/integrations/trello/handlers/delete_board.js +13 -0
  75. package/integrations/trello/manifest.json +21 -0
  76. package/integrations/trello/schemas/close_board.json +10 -0
  77. package/integrations/trello/schemas/create_board.json +12 -0
  78. package/integrations/trello/schemas/delete_board.json +10 -0
  79. package/package.json +1 -1
@@ -5,288 +5,480 @@
5
5
  */
6
6
  export const credentialConfigs = {
7
7
  airtable: {
8
- config: {
9
- schema: {
10
- type: 'object',
11
- properties: {
12
- token: {
13
- type: 'string',
14
- title: 'Personal Access Token',
15
- description: 'Airtable personal access token.',
8
+ variants: {
9
+ variants: {
10
+ personal_access_token: {
11
+ label: 'Personal Access Token',
12
+ schema: {
13
+ type: 'object',
14
+ properties: {
15
+ token: {
16
+ type: 'string',
17
+ title: 'Personal Access Token',
18
+ description: 'Airtable personal access token.',
19
+ },
20
+ },
21
+ required: ['token'],
22
+ additionalProperties: false,
16
23
  },
24
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
17
25
  },
18
- required: ['token'],
19
- additionalProperties: false,
20
- },
21
- injection: {
22
- headers: { Authorization: 'Bearer {{token}}' },
23
26
  },
27
+ default: 'personal_access_token',
24
28
  },
25
- hint: `Create an Airtable personal access token and paste it here.
29
+ hints: {
30
+ personal_access_token: `Create an Airtable personal access token and paste it here.
26
31
 
27
- You can generate one in Airtable account settings under developer tools / personal access tokens.
28
- `,
32
+ You can generate one in Airtable account settings under developer tools / personal access tokens.`,
33
+ },
29
34
  },
30
35
  github: {
31
- config: {
32
- schema: {
33
- type: 'object',
34
- properties: {
35
- token: {
36
- type: 'string',
37
- title: 'Personal Access Token',
38
- description: 'GitHub personal access token (classic or fine-grained) with appropriate scopes.',
36
+ variants: {
37
+ variants: {
38
+ classic_pat: {
39
+ label: 'Classic Personal Access Token',
40
+ schema: {
41
+ type: 'object',
42
+ properties: {
43
+ token: {
44
+ type: 'string',
45
+ title: 'Classic PAT',
46
+ description: 'GitHub classic personal access token. Supports all GitHub API operations including creating and deleting repositories.',
47
+ },
48
+ },
49
+ required: ['token'],
50
+ additionalProperties: false,
39
51
  },
52
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
53
+ },
54
+ fine_grained_pat: {
55
+ label: 'Fine-Grained Personal Access Token',
56
+ schema: {
57
+ type: 'object',
58
+ properties: {
59
+ token: {
60
+ type: 'string',
61
+ title: 'Fine-Grained PAT',
62
+ description: 'GitHub fine-grained personal access token scoped to specific repositories and permissions.',
63
+ },
64
+ },
65
+ required: ['token'],
66
+ additionalProperties: false,
67
+ },
68
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
40
69
  },
41
- required: ['token'],
42
- additionalProperties: false,
43
- },
44
- injection: {
45
- headers: { Authorization: 'Bearer {{token}}' },
46
70
  },
71
+ default: 'classic_pat',
47
72
  },
48
- hint: `Create a GitHub personal access token and paste it here.
73
+ hints: {
74
+ classic_pat: `Create a GitHub Classic Personal Access Token:
75
+
76
+ 1. Go to https://github.com/settings/tokens → Tokens (classic)
77
+ 2. Click Generate new token (classic)
78
+ 3. Select the scopes you need: \`repo\`, \`delete_repo\` (if needed), \`read:user\`, etc.
79
+ 4. Copy the token and paste it here.
49
80
 
50
- - Fine-grained PAT: Settings Developer settings Personal access tokens → Fine-grained tokens
51
- - Classic PAT: Settings Developer settings Personal access tokens → Tokens (classic)
81
+ Classic PATs support all GitHub API operations including creating and deleting repositories.`,
82
+ fine_grained_pat: `Create a GitHub Fine-Grained Personal Access Token:
52
83
 
53
- Minimum scopes depend on the tools you use (repo read/write, issues, pull requests, etc.).
54
- `,
84
+ 1. Go to https://github.com/settings/tokens Fine-grained tokens
85
+ 2. Click Generate new token
86
+ 3. Set the resource owner and repository access
87
+ 4. Grant the permissions your use case requires
88
+ 5. Copy the token and paste it here.
89
+
90
+ Note: Fine-grained PATs do not support creating or deleting repositories.`,
91
+ },
55
92
  },
56
93
  'google-calendar': {
57
- config: {
58
- schema: {
59
- type: 'object',
60
- properties: {
61
- token: {
62
- type: 'string',
63
- title: 'OAuth Access Token (optional)',
64
- description: 'Google OAuth access token to use as a Bearer token (typically short-lived).',
65
- },
66
- serviceAccountJson: {
67
- type: 'string',
68
- title: 'Service Account JSON (recommended)',
69
- description: 'Full service account key JSON (contents of the downloaded JSON file).',
94
+ variants: {
95
+ variants: {
96
+ service_account: {
97
+ label: 'Service Account (recommended)',
98
+ schema: {
99
+ type: 'object',
100
+ properties: {
101
+ serviceAccountJson: {
102
+ type: 'string',
103
+ title: 'Service Account JSON',
104
+ description: 'Full service account key JSON (contents of the downloaded JSON file from Google Cloud).',
105
+ },
106
+ subject: {
107
+ type: 'string',
108
+ title: 'Subject / impersonated user (optional)',
109
+ description: 'User email to impersonate via Google Workspace domain-wide delegation.',
110
+ },
111
+ scopes: {
112
+ type: 'array',
113
+ title: 'OAuth scopes (optional)',
114
+ description: 'Optional override for OAuth scopes. Defaults to calendar.',
115
+ items: { type: 'string' },
116
+ },
117
+ },
118
+ required: ['serviceAccountJson'],
119
+ additionalProperties: false,
70
120
  },
71
- subject: {
72
- type: 'string',
73
- title: 'Subject / impersonated user (optional)',
74
- description: 'Optional user email to impersonate when using Google Workspace domain-wide delegation.',
75
- },
76
- scopes: {
77
- type: 'array',
78
- title: 'OAuth scopes (optional)',
79
- description: 'Optional override for OAuth scopes.',
80
- items: { type: 'string' },
121
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
122
+ preprocess: 'google_service_account',
123
+ },
124
+ oauth_token: {
125
+ label: 'OAuth Access Token (short-lived)',
126
+ schema: {
127
+ type: 'object',
128
+ properties: {
129
+ token: {
130
+ type: 'string',
131
+ title: 'OAuth Access Token',
132
+ description: 'Short-lived Google OAuth access token with calendar scope.',
133
+ },
134
+ },
135
+ required: ['token'],
136
+ additionalProperties: false,
81
137
  },
138
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
82
139
  },
83
- required: [],
84
- additionalProperties: false,
85
- },
86
- injection: {
87
- headers: { Authorization: 'Bearer {{token}}' },
88
140
  },
141
+ default: 'service_account',
89
142
  },
90
- hint: `Recommended: use a Google service account.
143
+ hints: {
144
+ service_account: `Set up a Google Cloud Service Account:
91
145
 
92
- - Create a service account in Google Cloud
93
- - Download a JSON key
94
- - Paste the JSON into \`serviceAccountJson\` (or use \`env:GOOGLE_SERVICE_ACCOUNT_JSON\`)
146
+ 1. Enable the Google Calendar API for your project
147
+ 2. Go to IAM & Admin → Service Accounts and create a new service account
148
+ 3. Download a JSON key and paste its full contents here
149
+ 4. For Google Workspace: configure domain-wide delegation and set \`subject\` to the calendar owner's email.`,
150
+ oauth_token: `Obtain a short-lived Google OAuth access token with the scope:
151
+ https://www.googleapis.com/auth/calendar
95
152
 
96
- Note: Calendar often needs Google Workspace domain-wide delegation if you want to impersonate a user (\`subject\`).
97
- For simple setups, use a short-lived OAuth access token in \`token\`.
98
- `,
153
+ Note: OAuth access tokens expire (typically after 1 hour). Prefer Service Account for long-running use.`,
154
+ },
99
155
  },
100
156
  'google-docs': {
101
- config: {
102
- schema: {
103
- type: 'object',
104
- properties: {
105
- token: {
106
- type: 'string',
107
- title: 'OAuth Access Token (optional)',
108
- description: 'Google OAuth access token to use as a Bearer token (typically short-lived).',
157
+ variants: {
158
+ variants: {
159
+ service_account: {
160
+ label: 'Service Account (recommended)',
161
+ schema: {
162
+ type: 'object',
163
+ properties: {
164
+ serviceAccountJson: {
165
+ type: 'string',
166
+ title: 'Service Account JSON',
167
+ description: 'Full service account key JSON (contents of the downloaded JSON file from Google Cloud).',
168
+ },
169
+ subject: {
170
+ type: 'string',
171
+ title: 'Subject / impersonated user (optional)',
172
+ description: 'Optional user email to impersonate when using Google Workspace domain-wide delegation.',
173
+ },
174
+ scopes: {
175
+ type: 'array',
176
+ title: 'OAuth scopes (optional)',
177
+ description: 'Optional override for OAuth scopes. Defaults to documents + drive.',
178
+ items: { type: 'string' },
179
+ },
180
+ },
181
+ required: ['serviceAccountJson'],
182
+ additionalProperties: false,
109
183
  },
110
- serviceAccountJson: {
111
- type: 'string',
112
- title: 'Service Account JSON (recommended)',
113
- description: 'Full service account key JSON (contents of the downloaded JSON file).',
184
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
185
+ preprocess: 'google_service_account',
186
+ },
187
+ oauth_token: {
188
+ label: 'OAuth Access Token (short-lived)',
189
+ schema: {
190
+ type: 'object',
191
+ properties: {
192
+ token: {
193
+ type: 'string',
194
+ title: 'OAuth Access Token',
195
+ description: 'Short-lived Google OAuth access token with documents and drive scopes.',
196
+ },
197
+ },
198
+ required: ['token'],
199
+ additionalProperties: false,
114
200
  },
115
- subject: {
116
- type: 'string',
117
- title: 'Subject / impersonated user (optional)',
118
- description: 'Optional user email to impersonate when using Google Workspace domain-wide delegation.',
201
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
202
+ },
203
+ },
204
+ default: 'service_account',
205
+ },
206
+ hints: {
207
+ service_account: `Set up a Google Cloud Service Account:
208
+
209
+ 1. Enable the Google Docs API and Google Drive API
210
+ 2. Go to IAM & Admin → Service Accounts and create a new service account
211
+ 3. Download a JSON key and paste its full contents here
212
+ 4. Share your target Google Docs documents with the service account's \`client_email\``,
213
+ oauth_token: `Obtain a short-lived Google OAuth access token with the scopes:
214
+ https://www.googleapis.com/auth/documents
215
+ https://www.googleapis.com/auth/drive
216
+
217
+ Note: OAuth access tokens expire (typically after 1 hour). Prefer Service Account for long-running use.`,
218
+ },
219
+ },
220
+ 'google-drive': {
221
+ variants: {
222
+ variants: {
223
+ service_account: {
224
+ label: 'Service Account (recommended)',
225
+ schema: {
226
+ type: 'object',
227
+ properties: {
228
+ serviceAccountJson: {
229
+ type: 'string',
230
+ title: 'Service Account JSON',
231
+ description: 'Full service account key JSON (contents of the downloaded JSON file from Google Cloud).',
232
+ },
233
+ subject: {
234
+ type: 'string',
235
+ title: 'Subject / impersonated user (optional)',
236
+ description: 'Optional user email to impersonate when using Google Workspace domain-wide delegation.',
237
+ },
238
+ scopes: {
239
+ type: 'array',
240
+ title: 'OAuth scopes (optional)',
241
+ description: 'Optional override for OAuth scopes. Defaults to drive.',
242
+ items: { type: 'string' },
243
+ },
244
+ },
245
+ required: ['serviceAccountJson'],
246
+ additionalProperties: false,
119
247
  },
120
- scopes: {
121
- type: 'array',
122
- title: 'OAuth scopes (optional)',
123
- description: 'Optional override for OAuth scopes.',
124
- items: { type: 'string' },
248
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
249
+ preprocess: 'google_service_account',
250
+ },
251
+ oauth_token: {
252
+ label: 'OAuth Access Token (short-lived)',
253
+ schema: {
254
+ type: 'object',
255
+ properties: {
256
+ token: {
257
+ type: 'string',
258
+ title: 'OAuth Access Token',
259
+ description: 'Short-lived Google OAuth access token with drive scope.',
260
+ },
261
+ },
262
+ required: ['token'],
263
+ additionalProperties: false,
125
264
  },
265
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
126
266
  },
127
- required: [],
128
- additionalProperties: false,
129
- },
130
- injection: {
131
- headers: { Authorization: 'Bearer {{token}}' },
132
267
  },
268
+ default: 'service_account',
133
269
  },
134
- hint: `Recommended: use a Google service account.
270
+ hints: {
271
+ service_account: `Set up a Google Cloud Service Account:
135
272
 
136
- - Create a service account in Google Cloud
137
- - Download a JSON key
138
- - Paste the JSON into \`serviceAccountJson\` (or use \`env:GOOGLE_SERVICE_ACCOUNT_JSON\`)
139
- - Share your test document with the service account \`client_email\`
273
+ 1. Enable the Google Drive API
274
+ 2. Go to IAM & Admin → Service Accounts and create a new service account
275
+ 3. Download a JSON key and paste its full contents here
276
+ 4. Share the Drive folders/files you want to access with the service account's \`client_email\``,
277
+ oauth_token: `Obtain a short-lived Google OAuth access token with the scope:
278
+ https://www.googleapis.com/auth/drive
140
279
 
141
- You can also paste a short-lived OAuth access token into \`token\`, but it will expire.
142
- `,
280
+ Note: OAuth access tokens expire (typically after 1 hour). Prefer Service Account for long-running use.`,
281
+ },
143
282
  },
144
283
  'google-sheet': {
145
- config: {
146
- schema: {
147
- type: 'object',
148
- properties: {
149
- token: {
150
- type: 'string',
151
- title: 'OAuth Access Token (optional)',
152
- description: 'Google OAuth access token to use as a Bearer token (typically short-lived).',
153
- },
154
- serviceAccountJson: {
155
- type: 'string',
156
- title: 'Service Account JSON (recommended)',
157
- description: 'Full service account key JSON (contents of the downloaded JSON file).',
158
- },
159
- subject: {
160
- type: 'string',
161
- title: 'Subject / impersonated user (optional)',
162
- description: 'Optional user email to impersonate when using Google Workspace domain-wide delegation.',
284
+ variants: {
285
+ variants: {
286
+ service_account: {
287
+ label: 'Service Account (recommended)',
288
+ schema: {
289
+ type: 'object',
290
+ properties: {
291
+ serviceAccountJson: {
292
+ type: 'string',
293
+ title: 'Service Account JSON',
294
+ description: 'Full service account key JSON (contents of the downloaded JSON file from Google Cloud).',
295
+ },
296
+ subject: {
297
+ type: 'string',
298
+ title: 'Subject / impersonated user (optional)',
299
+ description: 'Optional user email to impersonate when using Google Workspace domain-wide delegation.',
300
+ },
301
+ scopes: {
302
+ type: 'array',
303
+ title: 'OAuth scopes (optional)',
304
+ description: 'Optional override for OAuth scopes. Defaults to spreadsheets.',
305
+ items: { type: 'string' },
306
+ },
307
+ },
308
+ required: ['serviceAccountJson'],
309
+ additionalProperties: false,
163
310
  },
164
- scopes: {
165
- type: 'array',
166
- title: 'OAuth scopes (optional)',
167
- description: 'Optional override for OAuth scopes.',
168
- items: { type: 'string' },
311
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
312
+ preprocess: 'google_service_account',
313
+ },
314
+ oauth_token: {
315
+ label: 'OAuth Access Token (short-lived)',
316
+ schema: {
317
+ type: 'object',
318
+ properties: {
319
+ token: {
320
+ type: 'string',
321
+ title: 'OAuth Access Token',
322
+ description: 'Short-lived Google OAuth access token with spreadsheets scope.',
323
+ },
324
+ },
325
+ required: ['token'],
326
+ additionalProperties: false,
169
327
  },
328
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
170
329
  },
171
- required: [],
172
- additionalProperties: false,
173
- },
174
- injection: {
175
- headers: { Authorization: 'Bearer {{token}}' },
176
330
  },
331
+ default: 'service_account',
177
332
  },
178
- hint: `Recommended: use a Google service account.
333
+ hints: {
334
+ service_account: `Set up a Google Cloud Service Account:
179
335
 
180
- - Create a service account in Google Cloud
181
- - Download a JSON key
182
- - Paste the JSON into \`serviceAccountJson\` (or use \`env:GOOGLE_SERVICE_ACCOUNT_JSON\`)
183
- - Share your test spreadsheet with the service account \`client_email\`
336
+ 1. Enable the Google Sheets API
337
+ 2. Go to IAM & Admin → Service Accounts and create a new service account
338
+ 3. Download a JSON key and paste its full contents here
339
+ 4. Share your target spreadsheets with the service account's \`client_email\``,
340
+ oauth_token: `Obtain a short-lived Google OAuth access token with the scope:
341
+ https://www.googleapis.com/auth/spreadsheets
184
342
 
185
- You can also paste a short-lived OAuth access token into \`token\`, but it will expire.
186
- `,
343
+ Note: OAuth access tokens expire (typically after 1 hour). Prefer Service Account for long-running use.`,
344
+ },
187
345
  },
188
346
  'google-slides': {
189
- config: {
190
- schema: {
191
- type: 'object',
192
- properties: {
193
- token: {
194
- type: 'string',
195
- title: 'OAuth Access Token (optional)',
196
- description: 'Google OAuth access token to use as a Bearer token (typically short-lived).',
197
- },
198
- serviceAccountJson: {
199
- type: 'string',
200
- title: 'Service Account JSON (recommended)',
201
- description: 'Full service account key JSON (contents of the downloaded JSON file).',
202
- },
203
- subject: {
204
- type: 'string',
205
- title: 'Subject / impersonated user (optional)',
206
- description: 'Optional user email to impersonate when using Google Workspace domain-wide delegation.',
347
+ variants: {
348
+ variants: {
349
+ service_account: {
350
+ label: 'Service Account (recommended)',
351
+ schema: {
352
+ type: 'object',
353
+ properties: {
354
+ serviceAccountJson: {
355
+ type: 'string',
356
+ title: 'Service Account JSON',
357
+ description: 'Full service account key JSON (contents of the downloaded JSON file from Google Cloud).',
358
+ },
359
+ subject: {
360
+ type: 'string',
361
+ title: 'Subject / impersonated user (optional)',
362
+ description: 'Optional user email to impersonate when using Google Workspace domain-wide delegation.',
363
+ },
364
+ scopes: {
365
+ type: 'array',
366
+ title: 'OAuth scopes (optional)',
367
+ description: 'Optional override for OAuth scopes. Defaults to presentations + drive.',
368
+ items: { type: 'string' },
369
+ },
370
+ },
371
+ required: ['serviceAccountJson'],
372
+ additionalProperties: false,
207
373
  },
208
- scopes: {
209
- type: 'array',
210
- title: 'OAuth scopes (optional)',
211
- description: 'Optional override for OAuth scopes.',
212
- items: { type: 'string' },
374
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
375
+ preprocess: 'google_service_account',
376
+ },
377
+ oauth_token: {
378
+ label: 'OAuth Access Token (short-lived)',
379
+ schema: {
380
+ type: 'object',
381
+ properties: {
382
+ token: {
383
+ type: 'string',
384
+ title: 'OAuth Access Token',
385
+ description: 'Short-lived Google OAuth access token with presentations and drive scopes.',
386
+ },
387
+ },
388
+ required: ['token'],
389
+ additionalProperties: false,
213
390
  },
391
+ injection: { headers: { Authorization: 'Bearer {{token}}' } },
214
392
  },
215
- required: [],
216
- additionalProperties: false,
217
- },
218
- injection: {
219
- headers: { Authorization: 'Bearer {{token}}' },
220
393
  },
394
+ default: 'service_account',
221
395
  },
222
- hint: `Recommended: use a Google service account.
396
+ hints: {
397
+ service_account: `Set up a Google Cloud Service Account:
223
398
 
224
- - Create a service account in Google Cloud
225
- - Download a JSON key
226
- - Paste the JSON into \`serviceAccountJson\` (or use \`env:GOOGLE_SERVICE_ACCOUNT_JSON\`)
227
- - Share your test presentation with the service account \`client_email\`
399
+ 1. Enable the Google Slides API and Google Drive API
400
+ 2. Go to IAM & Admin → Service Accounts and create a new service account
401
+ 3. Download a JSON key and paste its full contents here
402
+ 4. Share your target presentations with the service account's \`client_email\``,
403
+ oauth_token: `Obtain a short-lived Google OAuth access token with the scopes:
404
+ https://www.googleapis.com/auth/presentations
405
+ https://www.googleapis.com/auth/drive
228
406
 
229
- You can also paste a short-lived OAuth access token into \`token\`, but it will expire.
230
- `,
407
+ Note: OAuth access tokens expire (typically after 1 hour). Prefer Service Account for long-running use.`,
408
+ },
231
409
  },
232
410
  notion: {
233
- config: {
234
- schema: {
235
- type: 'object',
236
- properties: {
237
- token: {
238
- type: 'string',
239
- title: 'Internal Integration Token',
240
- description: 'Notion internal integration token (starts with "secret_").',
411
+ variants: {
412
+ variants: {
413
+ internal_integration: {
414
+ label: 'Internal Integration Token',
415
+ schema: {
416
+ type: 'object',
417
+ properties: {
418
+ token: {
419
+ type: 'string',
420
+ title: 'Internal Integration Token',
421
+ description: 'Notion internal integration token (starts with "secret_").',
422
+ },
423
+ },
424
+ required: ['token'],
425
+ additionalProperties: false,
426
+ },
427
+ injection: {
428
+ headers: {
429
+ Authorization: 'Bearer {{token}}',
430
+ 'Notion-Version': '2022-06-28',
431
+ },
241
432
  },
242
- },
243
- required: ['token'],
244
- additionalProperties: false,
245
- },
246
- injection: {
247
- headers: {
248
- Authorization: 'Bearer {{token}}',
249
- 'Notion-Version': '2022-06-28',
250
433
  },
251
434
  },
435
+ default: 'internal_integration',
252
436
  },
253
- hint: `1. Go to \`https://www.notion.so/profile/integrations/internal\`
437
+ hints: {
438
+ internal_integration: `1. Go to https://www.notion.so/profile/integrations/internal
254
439
  2. Create a Notion integration in Notion's developer settings
255
440
  3. Share your target pages/databases with that integration so it has access
256
- 4. Copy the **Internal Integration Token** (usually starts with \`secret_\`)
257
- `,
441
+ 4. Copy the Internal Integration Token (usually starts with \`secret_\`)`,
442
+ },
258
443
  },
259
444
  trello: {
260
- config: {
261
- schema: {
262
- type: 'object',
263
- properties: {
264
- apiKey: {
265
- type: 'string',
266
- title: 'API Key',
267
- description: 'Your Trello API key from https://trello.com/power-ups/admin',
445
+ variants: {
446
+ variants: {
447
+ api_key_token: {
448
+ label: 'API Key + Token',
449
+ schema: {
450
+ type: 'object',
451
+ properties: {
452
+ apiKey: {
453
+ type: 'string',
454
+ title: 'API Key',
455
+ description: 'Your Trello API key from https://trello.com/power-ups/admin',
456
+ },
457
+ apiToken: {
458
+ type: 'string',
459
+ title: 'API Token',
460
+ description: 'Your Trello API token ("token" param). Generate one via Trello\'s authorize flow.',
461
+ },
462
+ },
463
+ required: ['apiKey', 'apiToken'],
464
+ additionalProperties: false,
268
465
  },
269
- apiToken: {
270
- type: 'string',
271
- title: 'API Token',
272
- description: 'Your Trello API token ("token" param). Generate one via Trello\'s authorize flow.',
466
+ injection: {
467
+ query: {
468
+ key: '{{apiKey}}',
469
+ token: '{{apiToken}}',
470
+ },
273
471
  },
274
472
  },
275
- required: ['apiKey', 'apiToken'],
276
- additionalProperties: false,
277
- },
278
- injection: {
279
- query: {
280
- key: '{{apiKey}}',
281
- token: '{{apiToken}}',
282
- },
283
473
  },
474
+ default: 'api_key_token',
284
475
  },
285
- hint: `1. Go to \`https://trello.com/power-ups/admin\`
476
+ hints: {
477
+ api_key_token: `1. Go to https://trello.com/power-ups/admin
286
478
  2. Create a new app
287
- 3. Navigate to **API Key** and copy your API key
288
- 4. Click **Generate a Token** and copy the token value
289
- `,
479
+ 3. Navigate to API Key and copy your API key
480
+ 4. Click Generate a Token and copy the token value`,
481
+ },
290
482
  },
291
483
  };
292
484
  //# sourceMappingURL=credentials-index.js.map