@bubblelab/bubble-core 0.1.103 → 0.1.106
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.
- package/dist/bubble-bundle.d.ts +100 -55
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +4 -0
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubbles/service-bubble/ai-agent.d.ts +4 -4
- package/dist/bubbles/service-bubble/apify/apify.d.ts +4 -4
- package/dist/bubbles/service-bubble/confluence/confluence.d.ts +1957 -0
- package/dist/bubbles/service-bubble/confluence/confluence.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/confluence/confluence.integration.flow.d.ts +35 -0
- package/dist/bubbles/service-bubble/confluence/confluence.integration.flow.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/confluence/confluence.integration.flow.js +327 -0
- package/dist/bubbles/service-bubble/confluence/confluence.integration.flow.js.map +1 -0
- package/dist/bubbles/service-bubble/confluence/confluence.js +534 -0
- package/dist/bubbles/service-bubble/confluence/confluence.js.map +1 -0
- package/dist/bubbles/service-bubble/confluence/confluence.schema.d.ts +2435 -0
- package/dist/bubbles/service-bubble/confluence/confluence.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/confluence/confluence.schema.js +467 -0
- package/dist/bubbles/service-bubble/confluence/confluence.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/confluence/confluence.utils.d.ts +49 -0
- package/dist/bubbles/service-bubble/confluence/confluence.utils.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/confluence/confluence.utils.js +337 -0
- package/dist/bubbles/service-bubble/confluence/confluence.utils.js.map +1 -0
- package/dist/bubbles/service-bubble/confluence/index.d.ts +5 -0
- package/dist/bubbles/service-bubble/confluence/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/confluence/index.js +5 -0
- package/dist/bubbles/service-bubble/confluence/index.js.map +1 -0
- package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +8 -8
- package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts +16 -16
- package/dist/bubbles/service-bubble/firecrawl.d.ts +4 -4
- package/dist/bubbles/service-bubble/gmail.d.ts +84 -84
- package/dist/bubbles/service-bubble/google-drive.d.ts +32 -32
- package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/google-drive.js +22 -2
- package/dist/bubbles/service-bubble/google-drive.js.map +1 -1
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.js +6 -6
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.js.map +1 -1
- package/dist/bubbles/service-bubble/jira/jira.d.ts +12 -12
- package/dist/bubbles/service-bubble/jira/jira.schema.d.ts +14 -14
- package/dist/bubbles/service-bubble/resend.d.ts +4 -4
- package/dist/bubbles/service-bubble/salesforce/index.d.ts +4 -0
- package/dist/bubbles/service-bubble/salesforce/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/index.js +4 -0
- package/dist/bubbles/service-bubble/salesforce/index.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.d.ts +1331 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.js +618 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.d.ts +1445 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.js +609 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.utils.d.ts +87 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.utils.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.utils.js +181 -0
- package/dist/bubbles/service-bubble/salesforce/salesforce.utils.js.map +1 -0
- package/dist/bubbles/service-bubble/slack/slack.d.ts +36 -36
- package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/twitter-tool.d.ts +10 -10
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +8 -8
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +16 -16
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +16 -16
- package/dist/bubbles.json +1247 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import { ServiceBubble } from '../../../types/service-bubble-class.js';
|
|
2
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
3
|
+
import { ConfluenceParamsSchema, ConfluenceResultSchema, } from './confluence.schema.js';
|
|
4
|
+
import { markdownToConfluenceStorage, storageToText, enhanceErrorMessage, } from './confluence.utils.js';
|
|
5
|
+
/**
|
|
6
|
+
* Confluence Service Bubble
|
|
7
|
+
*
|
|
8
|
+
* Integration with Confluence Cloud for wiki and content management.
|
|
9
|
+
*
|
|
10
|
+
* Operations:
|
|
11
|
+
* - list_spaces: List spaces with optional filtering
|
|
12
|
+
* - get_space: Get space details by ID
|
|
13
|
+
* - list_pages: List pages with filtering (by space, title, status)
|
|
14
|
+
* - get_page: Get page by ID with body content
|
|
15
|
+
* - create_page: Create a new page in a space
|
|
16
|
+
* - update_page: Update page (auto-fetches current version)
|
|
17
|
+
* - delete_page: Delete/trash a page
|
|
18
|
+
* - search: Search via CQL (v1 endpoint)
|
|
19
|
+
* - add_comment: Add footer comment to a page
|
|
20
|
+
* - get_comments: List footer comments for a page
|
|
21
|
+
*
|
|
22
|
+
* Features:
|
|
23
|
+
* - Markdown content auto-converted to Confluence storage format (XHTML)
|
|
24
|
+
* - Auto-version management for page updates
|
|
25
|
+
* - Uses REST API v2 for most operations, v1 for search/labels
|
|
26
|
+
*/
|
|
27
|
+
export class ConfluenceBubble extends ServiceBubble {
|
|
28
|
+
static type = 'service';
|
|
29
|
+
static service = 'confluence';
|
|
30
|
+
static authType = 'oauth';
|
|
31
|
+
static bubbleName = 'confluence';
|
|
32
|
+
static schema = ConfluenceParamsSchema;
|
|
33
|
+
static resultSchema = ConfluenceResultSchema;
|
|
34
|
+
static shortDescription = 'Confluence integration for wiki pages and content management';
|
|
35
|
+
static longDescription = `
|
|
36
|
+
Confluence Cloud integration for managing wiki content, spaces, and pages.
|
|
37
|
+
|
|
38
|
+
Operations:
|
|
39
|
+
- list_spaces: List Confluence spaces with filtering
|
|
40
|
+
- get_space: Get space details by ID
|
|
41
|
+
- list_pages: List pages (filter by space, title, status)
|
|
42
|
+
- get_page: Get page by ID with body content
|
|
43
|
+
- create_page: Create a new page in a space
|
|
44
|
+
- update_page: Update page content (auto-increments version)
|
|
45
|
+
- delete_page: Delete/trash a page
|
|
46
|
+
- search: Search via CQL (Confluence Query Language)
|
|
47
|
+
- add_comment: Add footer comment to a page
|
|
48
|
+
- get_comments: List footer comments for a page
|
|
49
|
+
|
|
50
|
+
Features:
|
|
51
|
+
- Markdown content auto-converted to Confluence storage format (XHTML)
|
|
52
|
+
- Auto-version management for page updates
|
|
53
|
+
- CQL search support for powerful content discovery
|
|
54
|
+
|
|
55
|
+
Authentication:
|
|
56
|
+
- OAuth 2.0 via Atlassian Cloud (same provider as Jira)
|
|
57
|
+
`;
|
|
58
|
+
static alias = 'confluence';
|
|
59
|
+
constructor(params, context) {
|
|
60
|
+
super(params, context);
|
|
61
|
+
}
|
|
62
|
+
async testCredential() {
|
|
63
|
+
const apiToken = this.chooseCredential();
|
|
64
|
+
if (!apiToken) {
|
|
65
|
+
throw new Error('Confluence credentials are required');
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const response = await this.makeConfluenceApiRequest('/wiki/api/v2/spaces?limit=1', 'GET');
|
|
69
|
+
return Boolean(response && 'results' in response);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Parse Confluence credentials: base64-encoded JSON { accessToken, cloudId, siteUrl }
|
|
77
|
+
* Same format as Jira since both use Atlassian Cloud OAuth.
|
|
78
|
+
*/
|
|
79
|
+
parseCredentials() {
|
|
80
|
+
const { credentials } = this.params;
|
|
81
|
+
if (!credentials || typeof credentials !== 'object') {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
const confluenceCredRaw = credentials[CredentialType.CONFLUENCE_CRED];
|
|
85
|
+
if (!confluenceCredRaw) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const decoded = Buffer.from(confluenceCredRaw, 'base64').toString('utf-8');
|
|
90
|
+
const parsed = JSON.parse(decoded);
|
|
91
|
+
if (parsed.accessToken && parsed.cloudId) {
|
|
92
|
+
return {
|
|
93
|
+
accessToken: parsed.accessToken,
|
|
94
|
+
baseUrl: `https://api.atlassian.com/ex/confluence/${parsed.cloudId}`,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// Invalid credential format
|
|
100
|
+
}
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Resolve a space_key to a space_id via the Confluence API.
|
|
105
|
+
*/
|
|
106
|
+
async resolveSpaceKey(spaceKey) {
|
|
107
|
+
const response = await this.makeConfluenceApiRequest(`/wiki/api/v2/spaces?keys=${encodeURIComponent(spaceKey)}&limit=1`, 'GET');
|
|
108
|
+
const results = Array.isArray(response.results) ? response.results : [];
|
|
109
|
+
if (results.length === 0) {
|
|
110
|
+
throw new Error(`Space not found for key: ${spaceKey}`);
|
|
111
|
+
}
|
|
112
|
+
return results[0].id;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get the space_id from params, resolving space_key if needed.
|
|
116
|
+
*/
|
|
117
|
+
async getSpaceId(params) {
|
|
118
|
+
if (params.space_id)
|
|
119
|
+
return params.space_id;
|
|
120
|
+
if (params.space_key)
|
|
121
|
+
return this.resolveSpaceKey(params.space_key);
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Make a request to the Confluence REST API v2.
|
|
126
|
+
*/
|
|
127
|
+
async makeConfluenceApiRequest(endpoint, method = 'GET', body) {
|
|
128
|
+
const creds = this.parseCredentials();
|
|
129
|
+
if (!creds) {
|
|
130
|
+
throw new Error('Invalid Confluence credentials. Expected base64-encoded JSON with { accessToken, cloudId }.');
|
|
131
|
+
}
|
|
132
|
+
const url = `${creds.baseUrl}${endpoint}`;
|
|
133
|
+
const requestHeaders = {
|
|
134
|
+
Authorization: `Bearer ${creds.accessToken}`,
|
|
135
|
+
'Content-Type': 'application/json',
|
|
136
|
+
Accept: 'application/json',
|
|
137
|
+
};
|
|
138
|
+
const requestInit = {
|
|
139
|
+
method,
|
|
140
|
+
headers: requestHeaders,
|
|
141
|
+
};
|
|
142
|
+
if (body && method !== 'GET') {
|
|
143
|
+
requestInit.body = JSON.stringify(body);
|
|
144
|
+
}
|
|
145
|
+
const response = await fetch(url, requestInit);
|
|
146
|
+
if (!response.ok) {
|
|
147
|
+
const errorText = await response.text();
|
|
148
|
+
const enhancedError = enhanceErrorMessage(errorText, response.status, response.statusText);
|
|
149
|
+
throw new Error(enhancedError);
|
|
150
|
+
}
|
|
151
|
+
if (response.status === 204) {
|
|
152
|
+
return {};
|
|
153
|
+
}
|
|
154
|
+
const contentType = response.headers.get('content-type');
|
|
155
|
+
if (contentType && contentType.includes('application/json')) {
|
|
156
|
+
return (await response.json());
|
|
157
|
+
}
|
|
158
|
+
return {};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Make a request to the Confluence REST API v1 (used for search and labels).
|
|
162
|
+
*/
|
|
163
|
+
async makeConfluenceV1ApiRequest(endpoint, method = 'GET', body) {
|
|
164
|
+
const creds = this.parseCredentials();
|
|
165
|
+
if (!creds) {
|
|
166
|
+
throw new Error('Invalid Confluence credentials. Expected base64-encoded JSON with { accessToken, cloudId }.');
|
|
167
|
+
}
|
|
168
|
+
const url = `${creds.baseUrl}${endpoint}`;
|
|
169
|
+
const requestHeaders = {
|
|
170
|
+
Authorization: `Bearer ${creds.accessToken}`,
|
|
171
|
+
'Content-Type': 'application/json',
|
|
172
|
+
Accept: 'application/json',
|
|
173
|
+
};
|
|
174
|
+
const requestInit = {
|
|
175
|
+
method,
|
|
176
|
+
headers: requestHeaders,
|
|
177
|
+
};
|
|
178
|
+
if (body && method !== 'GET') {
|
|
179
|
+
requestInit.body = JSON.stringify(body);
|
|
180
|
+
}
|
|
181
|
+
const response = await fetch(url, requestInit);
|
|
182
|
+
if (!response.ok) {
|
|
183
|
+
const errorText = await response.text();
|
|
184
|
+
const enhancedError = enhanceErrorMessage(errorText, response.status, response.statusText);
|
|
185
|
+
throw new Error(enhancedError);
|
|
186
|
+
}
|
|
187
|
+
if (response.status === 204) {
|
|
188
|
+
return {};
|
|
189
|
+
}
|
|
190
|
+
const contentType = response.headers.get('content-type');
|
|
191
|
+
if (contentType && contentType.includes('application/json')) {
|
|
192
|
+
return (await response.json());
|
|
193
|
+
}
|
|
194
|
+
return {};
|
|
195
|
+
}
|
|
196
|
+
async performAction(context) {
|
|
197
|
+
void context;
|
|
198
|
+
const { operation } = this.params;
|
|
199
|
+
try {
|
|
200
|
+
const result = await (async () => {
|
|
201
|
+
const parsedParams = this.params;
|
|
202
|
+
switch (operation) {
|
|
203
|
+
case 'list_spaces':
|
|
204
|
+
return await this.listSpaces(parsedParams);
|
|
205
|
+
case 'get_space':
|
|
206
|
+
return await this.getSpace(parsedParams);
|
|
207
|
+
case 'list_pages':
|
|
208
|
+
return await this.listPages(parsedParams);
|
|
209
|
+
case 'get_page':
|
|
210
|
+
return await this.getPage(parsedParams);
|
|
211
|
+
case 'create_page':
|
|
212
|
+
return await this.createPage(parsedParams);
|
|
213
|
+
case 'update_page':
|
|
214
|
+
return await this.updatePage(parsedParams);
|
|
215
|
+
case 'delete_page':
|
|
216
|
+
return await this.deletePage(parsedParams);
|
|
217
|
+
case 'search':
|
|
218
|
+
return await this.search(parsedParams);
|
|
219
|
+
case 'add_comment':
|
|
220
|
+
return await this.addComment(parsedParams);
|
|
221
|
+
case 'get_comments':
|
|
222
|
+
return await this.getComments(parsedParams);
|
|
223
|
+
default:
|
|
224
|
+
throw new Error(`Unsupported operation: ${operation}`);
|
|
225
|
+
}
|
|
226
|
+
})();
|
|
227
|
+
return result;
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
return {
|
|
231
|
+
operation,
|
|
232
|
+
success: false,
|
|
233
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// -------------------------------------------------------------------------
|
|
238
|
+
// OPERATION 1: list_spaces
|
|
239
|
+
// -------------------------------------------------------------------------
|
|
240
|
+
async listSpaces(params) {
|
|
241
|
+
const queryParams = new URLSearchParams();
|
|
242
|
+
queryParams.set('limit', String(params.limit ?? 25));
|
|
243
|
+
if (params.cursor) {
|
|
244
|
+
queryParams.set('cursor', params.cursor);
|
|
245
|
+
}
|
|
246
|
+
if (params.type) {
|
|
247
|
+
queryParams.set('type', params.type);
|
|
248
|
+
}
|
|
249
|
+
if (params.status) {
|
|
250
|
+
queryParams.set('status', params.status);
|
|
251
|
+
}
|
|
252
|
+
const response = await this.makeConfluenceApiRequest(`/wiki/api/v2/spaces?${queryParams.toString()}`, 'GET');
|
|
253
|
+
const results = Array.isArray(response.results) ? response.results : [];
|
|
254
|
+
const links = response._links;
|
|
255
|
+
const nextCursor = links?.next
|
|
256
|
+
? (new URL(links.next, 'https://placeholder.com').searchParams.get('cursor') ?? undefined)
|
|
257
|
+
: undefined;
|
|
258
|
+
return {
|
|
259
|
+
operation: 'list_spaces',
|
|
260
|
+
success: true,
|
|
261
|
+
spaces: results,
|
|
262
|
+
cursor: nextCursor,
|
|
263
|
+
error: '',
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
// -------------------------------------------------------------------------
|
|
267
|
+
// OPERATION 2: get_space
|
|
268
|
+
// -------------------------------------------------------------------------
|
|
269
|
+
async getSpace(params) {
|
|
270
|
+
const response = await this.makeConfluenceApiRequest(`/wiki/api/v2/spaces/${encodeURIComponent(params.space_id)}?description-format=plain`, 'GET');
|
|
271
|
+
return {
|
|
272
|
+
operation: 'get_space',
|
|
273
|
+
success: true,
|
|
274
|
+
space: response,
|
|
275
|
+
error: '',
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
// -------------------------------------------------------------------------
|
|
279
|
+
// OPERATION 3: list_pages
|
|
280
|
+
// -------------------------------------------------------------------------
|
|
281
|
+
async listPages(params) {
|
|
282
|
+
const queryParams = new URLSearchParams();
|
|
283
|
+
queryParams.set('limit', String(params.limit ?? 25));
|
|
284
|
+
const spaceId = await this.getSpaceId(params);
|
|
285
|
+
if (spaceId) {
|
|
286
|
+
queryParams.set('space-id', spaceId);
|
|
287
|
+
}
|
|
288
|
+
if (params.title) {
|
|
289
|
+
queryParams.set('title', params.title);
|
|
290
|
+
}
|
|
291
|
+
if (params.status) {
|
|
292
|
+
queryParams.set('status', params.status);
|
|
293
|
+
}
|
|
294
|
+
if (params.cursor) {
|
|
295
|
+
queryParams.set('cursor', params.cursor);
|
|
296
|
+
}
|
|
297
|
+
const response = await this.makeConfluenceApiRequest(`/wiki/api/v2/pages?${queryParams.toString()}`, 'GET');
|
|
298
|
+
const results = Array.isArray(response.results) ? response.results : [];
|
|
299
|
+
const links = response._links;
|
|
300
|
+
const nextCursor = links?.next
|
|
301
|
+
? (new URL(links.next, 'https://placeholder.com').searchParams.get('cursor') ?? undefined)
|
|
302
|
+
: undefined;
|
|
303
|
+
return {
|
|
304
|
+
operation: 'list_pages',
|
|
305
|
+
success: true,
|
|
306
|
+
pages: results,
|
|
307
|
+
cursor: nextCursor,
|
|
308
|
+
error: '',
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
// -------------------------------------------------------------------------
|
|
312
|
+
// OPERATION 4: get_page
|
|
313
|
+
// -------------------------------------------------------------------------
|
|
314
|
+
async getPage(params) {
|
|
315
|
+
const queryParams = new URLSearchParams();
|
|
316
|
+
if (params.include_body !== false) {
|
|
317
|
+
queryParams.set('body-format', 'storage');
|
|
318
|
+
}
|
|
319
|
+
const queryString = queryParams.toString();
|
|
320
|
+
const endpoint = `/wiki/api/v2/pages/${encodeURIComponent(params.page_id)}${queryString ? `?${queryString}` : ''}`;
|
|
321
|
+
const response = await this.makeConfluenceApiRequest(endpoint, 'GET');
|
|
322
|
+
// Convert storage body to plain text for easier consumption
|
|
323
|
+
if (response.body &&
|
|
324
|
+
typeof response.body === 'object' &&
|
|
325
|
+
'storage' in response.body) {
|
|
326
|
+
const body = response.body;
|
|
327
|
+
if (body.storage?.value) {
|
|
328
|
+
// Keep original storage format and add a plain text version
|
|
329
|
+
response.bodyText = storageToText(body.storage.value);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return {
|
|
333
|
+
operation: 'get_page',
|
|
334
|
+
success: true,
|
|
335
|
+
page: response,
|
|
336
|
+
error: '',
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
// -------------------------------------------------------------------------
|
|
340
|
+
// OPERATION 5: create_page
|
|
341
|
+
// -------------------------------------------------------------------------
|
|
342
|
+
async createPage(params) {
|
|
343
|
+
const spaceId = await this.getSpaceId(params);
|
|
344
|
+
if (!spaceId) {
|
|
345
|
+
throw new Error('Either space_id or space_key is required');
|
|
346
|
+
}
|
|
347
|
+
const requestBody = {
|
|
348
|
+
spaceId,
|
|
349
|
+
status: params.status ?? 'current',
|
|
350
|
+
title: params.title,
|
|
351
|
+
};
|
|
352
|
+
if (params.body) {
|
|
353
|
+
requestBody.body = {
|
|
354
|
+
representation: 'storage',
|
|
355
|
+
value: markdownToConfluenceStorage(params.body),
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
if (params.parent_id) {
|
|
359
|
+
requestBody.parentId = params.parent_id;
|
|
360
|
+
}
|
|
361
|
+
const response = await this.makeConfluenceApiRequest('/wiki/api/v2/pages', 'POST', requestBody);
|
|
362
|
+
return {
|
|
363
|
+
operation: 'create_page',
|
|
364
|
+
success: true,
|
|
365
|
+
page: {
|
|
366
|
+
id: response.id,
|
|
367
|
+
title: response.title,
|
|
368
|
+
status: response.status,
|
|
369
|
+
_links: response._links,
|
|
370
|
+
},
|
|
371
|
+
error: '',
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
// -------------------------------------------------------------------------
|
|
375
|
+
// OPERATION 6: update_page
|
|
376
|
+
// -------------------------------------------------------------------------
|
|
377
|
+
async updatePage(params) {
|
|
378
|
+
// Fetch current page to get version number, title, and body (for preservation)
|
|
379
|
+
const currentPage = await this.makeConfluenceApiRequest(`/wiki/api/v2/pages/${encodeURIComponent(params.page_id)}?body-format=storage`, 'GET');
|
|
380
|
+
const currentVersion = currentPage.version;
|
|
381
|
+
if (!currentVersion) {
|
|
382
|
+
throw new Error('Could not determine current page version');
|
|
383
|
+
}
|
|
384
|
+
const requestBody = {
|
|
385
|
+
id: params.page_id,
|
|
386
|
+
status: params.status ?? 'current',
|
|
387
|
+
title: params.title ?? currentPage.title,
|
|
388
|
+
version: {
|
|
389
|
+
number: currentVersion.number + 1,
|
|
390
|
+
message: params.version_message,
|
|
391
|
+
},
|
|
392
|
+
};
|
|
393
|
+
if (params.body !== undefined) {
|
|
394
|
+
// User provided new body — convert markdown to storage format
|
|
395
|
+
requestBody.body = {
|
|
396
|
+
representation: 'storage',
|
|
397
|
+
value: markdownToConfluenceStorage(params.body),
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
// Preserve existing body when only updating title/status
|
|
402
|
+
const currentBody = currentPage.body;
|
|
403
|
+
if (currentBody?.storage?.value) {
|
|
404
|
+
requestBody.body = {
|
|
405
|
+
representation: 'storage',
|
|
406
|
+
value: currentBody.storage.value,
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
const response = await this.makeConfluenceApiRequest(`/wiki/api/v2/pages/${encodeURIComponent(params.page_id)}`, 'PUT', requestBody);
|
|
411
|
+
return {
|
|
412
|
+
operation: 'update_page',
|
|
413
|
+
success: true,
|
|
414
|
+
page: {
|
|
415
|
+
id: response.id,
|
|
416
|
+
title: response.title,
|
|
417
|
+
version: response.version,
|
|
418
|
+
},
|
|
419
|
+
error: '',
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
// -------------------------------------------------------------------------
|
|
423
|
+
// OPERATION 7: delete_page
|
|
424
|
+
// -------------------------------------------------------------------------
|
|
425
|
+
async deletePage(params) {
|
|
426
|
+
await this.makeConfluenceApiRequest(`/wiki/api/v2/pages/${encodeURIComponent(params.page_id)}`, 'DELETE');
|
|
427
|
+
return {
|
|
428
|
+
operation: 'delete_page',
|
|
429
|
+
success: true,
|
|
430
|
+
page_id: params.page_id,
|
|
431
|
+
error: '',
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
// -------------------------------------------------------------------------
|
|
435
|
+
// OPERATION 8: search (uses v1 CQL endpoint)
|
|
436
|
+
// -------------------------------------------------------------------------
|
|
437
|
+
async search(params) {
|
|
438
|
+
const queryParams = new URLSearchParams({
|
|
439
|
+
cql: params.cql,
|
|
440
|
+
limit: String(params.limit ?? 25),
|
|
441
|
+
start: String(params.start ?? 0),
|
|
442
|
+
});
|
|
443
|
+
const response = await this.makeConfluenceV1ApiRequest(`/wiki/rest/api/search?${queryParams.toString()}`, 'GET');
|
|
444
|
+
const rawResults = Array.isArray(response.results) ? response.results : [];
|
|
445
|
+
const results = rawResults.map((r) => ({
|
|
446
|
+
id: r.content?.id,
|
|
447
|
+
type: r.content?.type,
|
|
448
|
+
title: r.content?.title ?? r.title,
|
|
449
|
+
status: r.content?.status,
|
|
450
|
+
excerpt: r.excerpt,
|
|
451
|
+
url: r.url,
|
|
452
|
+
lastModified: r.lastModified,
|
|
453
|
+
_links: r.content?._links,
|
|
454
|
+
content: r.content,
|
|
455
|
+
}));
|
|
456
|
+
return {
|
|
457
|
+
operation: 'search',
|
|
458
|
+
success: true,
|
|
459
|
+
results: results,
|
|
460
|
+
total: (response.totalSize ?? response.size),
|
|
461
|
+
start: response.start,
|
|
462
|
+
limit: response.limit,
|
|
463
|
+
error: '',
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
// -------------------------------------------------------------------------
|
|
467
|
+
// OPERATION 9: add_comment
|
|
468
|
+
// -------------------------------------------------------------------------
|
|
469
|
+
async addComment(params) {
|
|
470
|
+
const requestBody = {
|
|
471
|
+
pageId: params.page_id,
|
|
472
|
+
body: {
|
|
473
|
+
representation: 'storage',
|
|
474
|
+
value: markdownToConfluenceStorage(params.body),
|
|
475
|
+
},
|
|
476
|
+
};
|
|
477
|
+
const response = await this.makeConfluenceApiRequest('/wiki/api/v2/footer-comments', 'POST', requestBody);
|
|
478
|
+
return {
|
|
479
|
+
operation: 'add_comment',
|
|
480
|
+
success: true,
|
|
481
|
+
comment: {
|
|
482
|
+
id: response.id,
|
|
483
|
+
body: {
|
|
484
|
+
storage: {
|
|
485
|
+
value: params.body, // Return original text for readability
|
|
486
|
+
representation: 'storage',
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
createdAt: response.version?.createdAt,
|
|
490
|
+
},
|
|
491
|
+
error: '',
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
// -------------------------------------------------------------------------
|
|
495
|
+
// OPERATION 10: get_comments
|
|
496
|
+
// -------------------------------------------------------------------------
|
|
497
|
+
async getComments(params) {
|
|
498
|
+
const queryParams = new URLSearchParams();
|
|
499
|
+
queryParams.set('limit', String(params.limit ?? 25));
|
|
500
|
+
queryParams.set('body-format', 'storage');
|
|
501
|
+
if (params.cursor) {
|
|
502
|
+
queryParams.set('cursor', params.cursor);
|
|
503
|
+
}
|
|
504
|
+
const response = await this.makeConfluenceApiRequest(`/wiki/api/v2/pages/${encodeURIComponent(params.page_id)}/footer-comments?${queryParams.toString()}`, 'GET');
|
|
505
|
+
const results = Array.isArray(response.results) ? response.results : [];
|
|
506
|
+
const links = response._links;
|
|
507
|
+
const nextCursor = links?.next
|
|
508
|
+
? (new URL(links.next, 'https://placeholder.com').searchParams.get('cursor') ?? undefined)
|
|
509
|
+
: undefined;
|
|
510
|
+
// Convert storage format to plain text for each comment
|
|
511
|
+
const comments = results.map((comment) => {
|
|
512
|
+
const body = comment.body;
|
|
513
|
+
if (body?.storage?.value) {
|
|
514
|
+
comment.bodyText = storageToText(body.storage.value);
|
|
515
|
+
}
|
|
516
|
+
return comment;
|
|
517
|
+
});
|
|
518
|
+
return {
|
|
519
|
+
operation: 'get_comments',
|
|
520
|
+
success: true,
|
|
521
|
+
comments: comments,
|
|
522
|
+
cursor: nextCursor,
|
|
523
|
+
error: '',
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
chooseCredential() {
|
|
527
|
+
const { credentials } = this.params;
|
|
528
|
+
if (!credentials || typeof credentials !== 'object') {
|
|
529
|
+
return undefined;
|
|
530
|
+
}
|
|
531
|
+
return credentials[CredentialType.CONFLUENCE_CRED];
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
//# sourceMappingURL=confluence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confluence.js","sourceRoot":"","sources":["../../../../src/bubbles/service-bubble/confluence/confluence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GAcvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2BAA2B,EAC3B,aAAa,EACb,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;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