integrate-sdk 0.9.27-dev.2 → 0.9.28-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/auto-routes.js +177 -8
- package/dist/adapters/base-handler.d.ts +4 -2
- package/dist/adapters/base-handler.d.ts.map +1 -1
- package/dist/adapters/base-handler.js +177 -8
- package/dist/adapters/index.js +193 -47
- package/dist/adapters/nextjs.js +177 -8
- package/dist/adapters/solid-start.js +193 -47
- package/dist/adapters/svelte-kit.js +193 -47
- package/dist/index.js +191 -47
- package/dist/oauth.js +177 -8
- package/dist/server.js +196 -55
- package/dist/src/adapters/base-handler.d.ts +4 -2
- package/dist/src/adapters/base-handler.d.ts.map +1 -1
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/integrations/integration-summary.d.ts +24 -0
- package/dist/src/integrations/integration-summary.d.ts.map +1 -0
- package/dist/src/integrations/library-metadata.d.ts +26 -0
- package/dist/src/integrations/library-metadata.d.ts.map +1 -0
- package/dist/src/integrations/server-client.d.ts +4 -0
- package/dist/src/integrations/server-client.d.ts.map +1 -1
- package/dist/src/integrations/types.d.ts +8 -0
- package/dist/src/integrations/types.d.ts.map +1 -1
- package/dist/src/server.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -284,6 +284,180 @@ function getContextCookieFromRequest(request) {
|
|
|
284
284
|
}
|
|
285
285
|
var CONTEXT_COOKIE_NAME = "__integrate_oauth_ctx", CONTEXT_COOKIE_MAX_AGE = 300;
|
|
286
286
|
|
|
287
|
+
// ../integrations/library-metadata.ts
|
|
288
|
+
function integrationLibraryPresentationFields(integration) {
|
|
289
|
+
const id = typeof integration["id"] === "string" ? integration["id"] : String(integration["id"] ?? "");
|
|
290
|
+
const fromCatalog = id ? INTEGRATION_LIBRARY_METADATA[id] : undefined;
|
|
291
|
+
const explicitDescription = integration["description"];
|
|
292
|
+
const explicitCategory = integration["category"];
|
|
293
|
+
const description = typeof explicitDescription === "string" && explicitDescription.trim().length > 0 ? explicitDescription.trim() : fromCatalog?.description;
|
|
294
|
+
const category = typeof explicitCategory === "string" && explicitCategory.trim().length > 0 ? explicitCategory.trim() : fromCatalog?.category;
|
|
295
|
+
const out = {};
|
|
296
|
+
if (description)
|
|
297
|
+
out.description = description;
|
|
298
|
+
if (category)
|
|
299
|
+
out.category = category;
|
|
300
|
+
return out;
|
|
301
|
+
}
|
|
302
|
+
var INTEGRATION_LIBRARY_METADATA;
|
|
303
|
+
var init_library_metadata = __esm(() => {
|
|
304
|
+
INTEGRATION_LIBRARY_METADATA = {
|
|
305
|
+
airtable: {
|
|
306
|
+
description: "Manage Airtable bases, tables, and records",
|
|
307
|
+
category: "Business"
|
|
308
|
+
},
|
|
309
|
+
calcom: {
|
|
310
|
+
description: "Manage Cal.com bookings and schedules",
|
|
311
|
+
category: "Productivity"
|
|
312
|
+
},
|
|
313
|
+
cursor: {
|
|
314
|
+
description: "Manage Cursor Cloud Agents and background tasks",
|
|
315
|
+
category: "Engineering"
|
|
316
|
+
},
|
|
317
|
+
figma: {
|
|
318
|
+
description: "Access Figma files, comments, and components",
|
|
319
|
+
category: "Engineering"
|
|
320
|
+
},
|
|
321
|
+
github: {
|
|
322
|
+
description: "Manage GitHub repos, issues, and pull requests",
|
|
323
|
+
category: "Engineering"
|
|
324
|
+
},
|
|
325
|
+
gmail: {
|
|
326
|
+
description: "Send, read, and search Gmail messages",
|
|
327
|
+
category: "Communication"
|
|
328
|
+
},
|
|
329
|
+
gcal: {
|
|
330
|
+
description: "Manage Google Calendar events and schedules",
|
|
331
|
+
category: "Productivity"
|
|
332
|
+
},
|
|
333
|
+
hubspot: {
|
|
334
|
+
description: "Manage HubSpot contacts, deals, and tickets",
|
|
335
|
+
category: "Business"
|
|
336
|
+
},
|
|
337
|
+
intercom: {
|
|
338
|
+
description: "Manage Intercom contacts and conversations",
|
|
339
|
+
category: "Business"
|
|
340
|
+
},
|
|
341
|
+
linear: {
|
|
342
|
+
description: "Manage Linear issues, projects, and cycles",
|
|
343
|
+
category: "Engineering"
|
|
344
|
+
},
|
|
345
|
+
notion: {
|
|
346
|
+
description: "Manage Notion pages and databases",
|
|
347
|
+
category: "Productivity"
|
|
348
|
+
},
|
|
349
|
+
onedrive: {
|
|
350
|
+
description: "Manage OneDrive files, folders, and sharing",
|
|
351
|
+
category: "Storage"
|
|
352
|
+
},
|
|
353
|
+
outlook: {
|
|
354
|
+
description: "Manage Outlook mail, calendars, and contacts",
|
|
355
|
+
category: "Communication"
|
|
356
|
+
},
|
|
357
|
+
polar: {
|
|
358
|
+
description: "Manage Polar products, orders, and subscriptions",
|
|
359
|
+
category: "Business"
|
|
360
|
+
},
|
|
361
|
+
ramp: {
|
|
362
|
+
description: "Manage Ramp corporate cards, bills, and spend",
|
|
363
|
+
category: "Business"
|
|
364
|
+
},
|
|
365
|
+
slack: {
|
|
366
|
+
description: "Send and manage Slack messages and channels",
|
|
367
|
+
category: "Communication"
|
|
368
|
+
},
|
|
369
|
+
stripe: {
|
|
370
|
+
description: "Manage Stripe customers, payments, and subscriptions",
|
|
371
|
+
category: "Business"
|
|
372
|
+
},
|
|
373
|
+
todoist: {
|
|
374
|
+
description: "Manage Todoist tasks, projects, and labels",
|
|
375
|
+
category: "Productivity"
|
|
376
|
+
},
|
|
377
|
+
gslides: {
|
|
378
|
+
description: "Create and update Google Slides presentations",
|
|
379
|
+
category: "Productivity"
|
|
380
|
+
},
|
|
381
|
+
gsheets: {
|
|
382
|
+
description: "Read and update Google Sheets spreadsheets",
|
|
383
|
+
category: "Productivity"
|
|
384
|
+
},
|
|
385
|
+
gdocs: {
|
|
386
|
+
description: "Create and edit Google Docs documents",
|
|
387
|
+
category: "Productivity"
|
|
388
|
+
},
|
|
389
|
+
gdrive: {
|
|
390
|
+
description: "Manage Google Drive files, folders, and sharing",
|
|
391
|
+
category: "Storage"
|
|
392
|
+
},
|
|
393
|
+
vercel: {
|
|
394
|
+
description: "Manage Vercel projects, deployments, and domains",
|
|
395
|
+
category: "Engineering"
|
|
396
|
+
},
|
|
397
|
+
whatsapp: {
|
|
398
|
+
description: "Send WhatsApp messages and templates",
|
|
399
|
+
category: "Communication"
|
|
400
|
+
},
|
|
401
|
+
youtube: {
|
|
402
|
+
description: "Search and access YouTube videos and channels",
|
|
403
|
+
category: "Communication"
|
|
404
|
+
},
|
|
405
|
+
powerpoint: {
|
|
406
|
+
description: "Manage PowerPoint presentations and sharing",
|
|
407
|
+
category: "Productivity"
|
|
408
|
+
},
|
|
409
|
+
excel: {
|
|
410
|
+
description: "Manage Excel workbooks, worksheets, and tables",
|
|
411
|
+
category: "Productivity"
|
|
412
|
+
},
|
|
413
|
+
word: {
|
|
414
|
+
description: "Manage Word documents and sharing",
|
|
415
|
+
category: "Productivity"
|
|
416
|
+
},
|
|
417
|
+
dropbox: {
|
|
418
|
+
description: "Manage Dropbox files, folders, and sharing",
|
|
419
|
+
category: "Storage"
|
|
420
|
+
},
|
|
421
|
+
granola: {
|
|
422
|
+
description: "List and read Granola meeting notes and folders",
|
|
423
|
+
category: "Productivity"
|
|
424
|
+
},
|
|
425
|
+
mercury: {
|
|
426
|
+
description: "Manage Mercury bank accounts, cards, and transactions",
|
|
427
|
+
category: "Business"
|
|
428
|
+
},
|
|
429
|
+
zendesk: {
|
|
430
|
+
description: "Manage Zendesk tickets, users, and help center content",
|
|
431
|
+
category: "Business"
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// ../integrations/integration-summary.ts
|
|
437
|
+
function toConfiguredIntegrationSummary(integration) {
|
|
438
|
+
const row = integration;
|
|
439
|
+
const pres = integrationLibraryPresentationFields(row);
|
|
440
|
+
return {
|
|
441
|
+
id: integration.id,
|
|
442
|
+
name: row.name || integration.id,
|
|
443
|
+
logoUrl: row.logoUrl,
|
|
444
|
+
tools: integration.tools,
|
|
445
|
+
hasOAuth: !!integration.oauth,
|
|
446
|
+
scopes: integration.oauth?.scopes,
|
|
447
|
+
provider: integration.oauth?.provider,
|
|
448
|
+
...pres
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
function toConfiguredIntegrationWithToolMetadata(integration, toolMetadata) {
|
|
452
|
+
return {
|
|
453
|
+
...toConfiguredIntegrationSummary(integration),
|
|
454
|
+
toolMetadata
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
var init_integration_summary = __esm(() => {
|
|
458
|
+
init_library_metadata();
|
|
459
|
+
});
|
|
460
|
+
|
|
287
461
|
// ../utils/logger.ts
|
|
288
462
|
function shouldLog(level, context) {
|
|
289
463
|
return logLevelHierarchy[level] <= logLevelHierarchy[contextLogLevels[context]];
|
|
@@ -447,14 +621,8 @@ class OAuthHandler {
|
|
|
447
621
|
const integrations = this.config.integrations || [];
|
|
448
622
|
return {
|
|
449
623
|
integrations: integrations.map((integration) => ({
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
logoUrl: integration.logoUrl,
|
|
453
|
-
tools: integration.tools,
|
|
454
|
-
hasOAuth: !!integration.oauth,
|
|
455
|
-
scopes: integration.oauth?.scopes,
|
|
456
|
-
optionalScopes: integration.oauth?.optionalScopes,
|
|
457
|
-
provider: integration.oauth?.provider
|
|
624
|
+
...toConfiguredIntegrationSummary(integration),
|
|
625
|
+
optionalScopes: integration.oauth?.optionalScopes
|
|
458
626
|
}))
|
|
459
627
|
};
|
|
460
628
|
}
|
|
@@ -841,6 +1009,7 @@ class OAuthHandler {
|
|
|
841
1009
|
}
|
|
842
1010
|
var SERVER_LOG_CONTEXT = "server", logger2, MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp";
|
|
843
1011
|
var init_base_handler = __esm(() => {
|
|
1012
|
+
init_integration_summary();
|
|
844
1013
|
init_email_fetcher();
|
|
845
1014
|
init_logger();
|
|
846
1015
|
logger2 = createLogger("OAuthHandler", SERVER_LOG_CONTEXT);
|
|
@@ -240,10 +240,12 @@ export declare class OAuthHandler {
|
|
|
240
240
|
id: string;
|
|
241
241
|
name: string;
|
|
242
242
|
logoUrl?: string;
|
|
243
|
+
description?: string;
|
|
244
|
+
category?: string;
|
|
243
245
|
tools: readonly string[];
|
|
244
246
|
hasOAuth: boolean;
|
|
245
|
-
scopes?: string[];
|
|
246
|
-
optionalScopes?: string[];
|
|
247
|
+
scopes?: readonly string[];
|
|
248
|
+
optionalScopes?: readonly string[];
|
|
247
249
|
provider?: string;
|
|
248
250
|
}>;
|
|
249
251
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-handler.d.ts","sourceRoot":"","sources":["../../../src/adapters/base-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"base-handler.d.ts","sourceRoot":"","sources":["../../../src/adapters/base-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAe3D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE;QACxB,iDAAiD;QACjD,QAAQ,EAAE,MAAM,CAAC;QACjB,qDAAqD;QACrD,YAAY,EAAE,MAAM,CAAC;QACrB,qCAAqC;QACrC,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,8CAA8C;QAC9C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,6DAA6D;QAC7D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,kFAAkF;QAClF,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC9B,CAAC,CAAC;IACH;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,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KIE_MAX_AGE = 300;
|
|
286
286
|
|
|
287
|
+
// ../integrations/library-metadata.ts
|
|
288
|
+
function integrationLibraryPresentationFields(integration) {
|
|
289
|
+
const id = typeof integration["id"] === "string" ? integration["id"] : String(integration["id"] ?? "");
|
|
290
|
+
const fromCatalog = id ? INTEGRATION_LIBRARY_METADATA[id] : undefined;
|
|
291
|
+
const explicitDescription = integration["description"];
|
|
292
|
+
const explicitCategory = integration["category"];
|
|
293
|
+
const description = typeof explicitDescription === "string" && explicitDescription.trim().length > 0 ? explicitDescription.trim() : fromCatalog?.description;
|
|
294
|
+
const category = typeof explicitCategory === "string" && explicitCategory.trim().length > 0 ? explicitCategory.trim() : fromCatalog?.category;
|
|
295
|
+
const out = {};
|
|
296
|
+
if (description)
|
|
297
|
+
out.description = description;
|
|
298
|
+
if (category)
|
|
299
|
+
out.category = category;
|
|
300
|
+
return out;
|
|
301
|
+
}
|
|
302
|
+
var INTEGRATION_LIBRARY_METADATA;
|
|
303
|
+
var init_library_metadata = __esm(() => {
|
|
304
|
+
INTEGRATION_LIBRARY_METADATA = {
|
|
305
|
+
airtable: {
|
|
306
|
+
description: "Manage Airtable bases, tables, and records",
|
|
307
|
+
category: "Business"
|
|
308
|
+
},
|
|
309
|
+
calcom: {
|
|
310
|
+
description: "Manage Cal.com bookings and schedules",
|
|
311
|
+
category: "Productivity"
|
|
312
|
+
},
|
|
313
|
+
cursor: {
|
|
314
|
+
description: "Manage Cursor Cloud Agents and background tasks",
|
|
315
|
+
category: "Engineering"
|
|
316
|
+
},
|
|
317
|
+
figma: {
|
|
318
|
+
description: "Access Figma files, comments, and components",
|
|
319
|
+
category: "Engineering"
|
|
320
|
+
},
|
|
321
|
+
github: {
|
|
322
|
+
description: "Manage GitHub repos, issues, and pull requests",
|
|
323
|
+
category: "Engineering"
|
|
324
|
+
},
|
|
325
|
+
gmail: {
|
|
326
|
+
description: "Send, read, and search Gmail messages",
|
|
327
|
+
category: "Communication"
|
|
328
|
+
},
|
|
329
|
+
gcal: {
|
|
330
|
+
description: "Manage Google Calendar events and schedules",
|
|
331
|
+
category: "Productivity"
|
|
332
|
+
},
|
|
333
|
+
hubspot: {
|
|
334
|
+
description: "Manage HubSpot contacts, deals, and tickets",
|
|
335
|
+
category: "Business"
|
|
336
|
+
},
|
|
337
|
+
intercom: {
|
|
338
|
+
description: "Manage Intercom contacts and conversations",
|
|
339
|
+
category: "Business"
|
|
340
|
+
},
|
|
341
|
+
linear: {
|
|
342
|
+
description: "Manage Linear issues, projects, and cycles",
|
|
343
|
+
category: "Engineering"
|
|
344
|
+
},
|
|
345
|
+
notion: {
|
|
346
|
+
description: "Manage Notion pages and databases",
|
|
347
|
+
category: "Productivity"
|
|
348
|
+
},
|
|
349
|
+
onedrive: {
|
|
350
|
+
description: "Manage OneDrive files, folders, and sharing",
|
|
351
|
+
category: "Storage"
|
|
352
|
+
},
|
|
353
|
+
outlook: {
|
|
354
|
+
description: "Manage Outlook mail, calendars, and contacts",
|
|
355
|
+
category: "Communication"
|
|
356
|
+
},
|
|
357
|
+
polar: {
|
|
358
|
+
description: "Manage Polar products, orders, and subscriptions",
|
|
359
|
+
category: "Business"
|
|
360
|
+
},
|
|
361
|
+
ramp: {
|
|
362
|
+
description: "Manage Ramp corporate cards, bills, and spend",
|
|
363
|
+
category: "Business"
|
|
364
|
+
},
|
|
365
|
+
slack: {
|
|
366
|
+
description: "Send and manage Slack messages and channels",
|
|
367
|
+
category: "Communication"
|
|
368
|
+
},
|
|
369
|
+
stripe: {
|
|
370
|
+
description: "Manage Stripe customers, payments, and subscriptions",
|
|
371
|
+
category: "Business"
|
|
372
|
+
},
|
|
373
|
+
todoist: {
|
|
374
|
+
description: "Manage Todoist tasks, projects, and labels",
|
|
375
|
+
category: "Productivity"
|
|
376
|
+
},
|
|
377
|
+
gslides: {
|
|
378
|
+
description: "Create and update Google Slides presentations",
|
|
379
|
+
category: "Productivity"
|
|
380
|
+
},
|
|
381
|
+
gsheets: {
|
|
382
|
+
description: "Read and update Google Sheets spreadsheets",
|
|
383
|
+
category: "Productivity"
|
|
384
|
+
},
|
|
385
|
+
gdocs: {
|
|
386
|
+
description: "Create and edit Google Docs documents",
|
|
387
|
+
category: "Productivity"
|
|
388
|
+
},
|
|
389
|
+
gdrive: {
|
|
390
|
+
description: "Manage Google Drive files, folders, and sharing",
|
|
391
|
+
category: "Storage"
|
|
392
|
+
},
|
|
393
|
+
vercel: {
|
|
394
|
+
description: "Manage Vercel projects, deployments, and domains",
|
|
395
|
+
category: "Engineering"
|
|
396
|
+
},
|
|
397
|
+
whatsapp: {
|
|
398
|
+
description: "Send WhatsApp messages and templates",
|
|
399
|
+
category: "Communication"
|
|
400
|
+
},
|
|
401
|
+
youtube: {
|
|
402
|
+
description: "Search and access YouTube videos and channels",
|
|
403
|
+
category: "Communication"
|
|
404
|
+
},
|
|
405
|
+
powerpoint: {
|
|
406
|
+
description: "Manage PowerPoint presentations and sharing",
|
|
407
|
+
category: "Productivity"
|
|
408
|
+
},
|
|
409
|
+
excel: {
|
|
410
|
+
description: "Manage Excel workbooks, worksheets, and tables",
|
|
411
|
+
category: "Productivity"
|
|
412
|
+
},
|
|
413
|
+
word: {
|
|
414
|
+
description: "Manage Word documents and sharing",
|
|
415
|
+
category: "Productivity"
|
|
416
|
+
},
|
|
417
|
+
dropbox: {
|
|
418
|
+
description: "Manage Dropbox files, folders, and sharing",
|
|
419
|
+
category: "Storage"
|
|
420
|
+
},
|
|
421
|
+
granola: {
|
|
422
|
+
description: "List and read Granola meeting notes and folders",
|
|
423
|
+
category: "Productivity"
|
|
424
|
+
},
|
|
425
|
+
mercury: {
|
|
426
|
+
description: "Manage Mercury bank accounts, cards, and transactions",
|
|
427
|
+
category: "Business"
|
|
428
|
+
},
|
|
429
|
+
zendesk: {
|
|
430
|
+
description: "Manage Zendesk tickets, users, and help center content",
|
|
431
|
+
category: "Business"
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// ../integrations/integration-summary.ts
|
|
437
|
+
function toConfiguredIntegrationSummary(integration) {
|
|
438
|
+
const row = integration;
|
|
439
|
+
const pres = integrationLibraryPresentationFields(row);
|
|
440
|
+
return {
|
|
441
|
+
id: integration.id,
|
|
442
|
+
name: row.name || integration.id,
|
|
443
|
+
logoUrl: row.logoUrl,
|
|
444
|
+
tools: integration.tools,
|
|
445
|
+
hasOAuth: !!integration.oauth,
|
|
446
|
+
scopes: integration.oauth?.scopes,
|
|
447
|
+
provider: integration.oauth?.provider,
|
|
448
|
+
...pres
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
function toConfiguredIntegrationWithToolMetadata(integration, toolMetadata) {
|
|
452
|
+
return {
|
|
453
|
+
...toConfiguredIntegrationSummary(integration),
|
|
454
|
+
toolMetadata
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
var init_integration_summary = __esm(() => {
|
|
458
|
+
init_library_metadata();
|
|
459
|
+
});
|
|
460
|
+
|
|
287
461
|
// ../utils/logger.ts
|
|
288
462
|
function shouldLog(level, context) {
|
|
289
463
|
return logLevelHierarchy[level] <= logLevelHierarchy[contextLogLevels[context]];
|
|
@@ -447,14 +621,8 @@ class OAuthHandler {
|
|
|
447
621
|
const integrations = this.config.integrations || [];
|
|
448
622
|
return {
|
|
449
623
|
integrations: integrations.map((integration) => ({
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
logoUrl: integration.logoUrl,
|
|
453
|
-
tools: integration.tools,
|
|
454
|
-
hasOAuth: !!integration.oauth,
|
|
455
|
-
scopes: integration.oauth?.scopes,
|
|
456
|
-
optionalScopes: integration.oauth?.optionalScopes,
|
|
457
|
-
provider: integration.oauth?.provider
|
|
624
|
+
...toConfiguredIntegrationSummary(integration),
|
|
625
|
+
optionalScopes: integration.oauth?.optionalScopes
|
|
458
626
|
}))
|
|
459
627
|
};
|
|
460
628
|
}
|
|
@@ -841,6 +1009,7 @@ class OAuthHandler {
|
|
|
841
1009
|
}
|
|
842
1010
|
var SERVER_LOG_CONTEXT = "server", logger2, MCP_SERVER_URL = "https://mcp.integrate.dev/api/v1/mcp";
|
|
843
1011
|
var init_base_handler = __esm(() => {
|
|
1012
|
+
init_integration_summary();
|
|
844
1013
|
init_email_fetcher();
|
|
845
1014
|
init_logger();
|
|
846
1015
|
logger2 = createLogger("OAuthHandler", SERVER_LOG_CONTEXT);
|