@credal/actions 0.1.34 → 0.1.36
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/actions/actionMapper.js +24 -0
- package/dist/actions/autogen/templates.d.ts +4 -0
- package/dist/actions/autogen/templates.js +189 -3
- package/dist/actions/autogen/types.d.ts +125 -0
- package/dist/actions/autogen/types.js +44 -1
- package/dist/actions/groups.js +9 -1
- package/dist/actions/providers/microsoft/createDocument.d.ts +3 -0
- package/dist/actions/providers/microsoft/createDocument.js +47 -0
- package/dist/actions/providers/microsoft/getDocument.d.ts +3 -0
- package/dist/actions/providers/microsoft/getDocument.js +45 -0
- package/dist/actions/providers/microsoft/messageTeamsChannel.js +18 -3
- package/dist/actions/providers/microsoft/messageTeamsChat.js +18 -3
- package/dist/actions/providers/microsoft/updateDocument.d.ts +3 -0
- package/dist/actions/providers/microsoft/updateDocument.js +45 -0
- package/dist/actions/providers/microsoft/updateSpreadsheet.d.ts +3 -0
- package/dist/actions/providers/microsoft/updateSpreadsheet.js +56 -0
- package/dist/actions/providers/microsoft/utils.d.ts +7 -2
- package/dist/actions/providers/microsoft/utils.js +26 -14
- package/package.json +2 -1
- package/dist/actions/autogen/definitions.d.ts +0 -5
- package/dist/actions/autogen/definitions.js +0 -132
- package/dist/actions/definitions.js +0 -35
- package/dist/actions/invokeMapper.d.ts +0 -9
- package/dist/actions/invokeMapper.js +0 -33
- package/dist/actions/providers/confluence/updatePage.d.ts +0 -3
- package/dist/actions/providers/confluence/updatePage.js +0 -43
- package/dist/actions/providers/googlemaps/nearbysearch.d.ts +0 -3
- package/dist/actions/providers/googlemaps/nearbysearch.js +0 -96
- package/dist/actions/providers/jira/createTicket.d.ts +0 -3
- package/dist/actions/providers/jira/createTicket.js +0 -34
- package/dist/actions/providers/slack/list_conversations.d.ts +0 -3
- package/dist/actions/providers/slack/list_conversations.js +0 -60
- package/dist/actions/providers/slack/summarizeChannel.d.ts +0 -3
- package/dist/actions/providers/slack/summarizeChannel.js +0 -51
- package/dist/actions/schema.js +0 -6
- package/dist/actions/types.js +0 -2
- package/dist/main.js +0 -11
@@ -67,6 +67,10 @@ const messageTeamsChannel_1 = __importDefault(require("./providers/microsoft/mes
|
|
67
67
|
const createOrUpdateFile_1 = __importDefault(require("./providers/github/createOrUpdateFile"));
|
68
68
|
const createBranch_1 = __importDefault(require("./providers/github/createBranch"));
|
69
69
|
const createPullRequest_1 = __importDefault(require("./providers/github/createPullRequest"));
|
70
|
+
const updateSpreadsheet_2 = __importDefault(require("./providers/microsoft/updateSpreadsheet"));
|
71
|
+
const updateDocument_1 = __importDefault(require("./providers/microsoft/updateDocument"));
|
72
|
+
const createDocument_1 = __importDefault(require("./providers/microsoft/createDocument"));
|
73
|
+
const getDocument_1 = __importDefault(require("./providers/microsoft/getDocument"));
|
70
74
|
exports.ActionMapper = {
|
71
75
|
asana: {
|
72
76
|
commentTask: {
|
@@ -406,6 +410,26 @@ exports.ActionMapper = {
|
|
406
410
|
paramsSchema: types_1.microsoftMessageTeamsChannelParamsSchema,
|
407
411
|
outputSchema: types_1.microsoftMessageTeamsChannelOutputSchema,
|
408
412
|
},
|
413
|
+
updateSpreadsheet: {
|
414
|
+
fn: updateSpreadsheet_2.default,
|
415
|
+
paramsSchema: types_1.microsoftUpdateSpreadsheetParamsSchema,
|
416
|
+
outputSchema: types_1.microsoftUpdateSpreadsheetOutputSchema,
|
417
|
+
},
|
418
|
+
updateDocument: {
|
419
|
+
fn: updateDocument_1.default,
|
420
|
+
paramsSchema: types_1.microsoftUpdateDocumentParamsSchema,
|
421
|
+
outputSchema: types_1.microsoftUpdateDocumentOutputSchema,
|
422
|
+
},
|
423
|
+
createDocument: {
|
424
|
+
fn: createDocument_1.default,
|
425
|
+
paramsSchema: types_1.microsoftUpdateDocumentParamsSchema,
|
426
|
+
outputSchema: types_1.microsoftUpdateDocumentOutputSchema,
|
427
|
+
},
|
428
|
+
getDocument: {
|
429
|
+
fn: getDocument_1.default,
|
430
|
+
paramsSchema: types_1.microsoftGetDocumentParamsSchema,
|
431
|
+
outputSchema: types_1.microsoftGetDocumentOutputSchema,
|
432
|
+
},
|
409
433
|
},
|
410
434
|
github: {
|
411
435
|
createOrUpdateFile: {
|
@@ -56,8 +56,12 @@ export declare const salesforceCreateCaseDefinition: ActionTemplate;
|
|
56
56
|
export declare const salesforceGenerateSalesReportDefinition: ActionTemplate;
|
57
57
|
export declare const salesforceGetSalesforceRecordsByQueryDefinition: ActionTemplate;
|
58
58
|
export declare const salesforceGetRecordDefinition: ActionTemplate;
|
59
|
+
export declare const microsoftCreateDocumentDefinition: ActionTemplate;
|
60
|
+
export declare const microsoftUpdateDocumentDefinition: ActionTemplate;
|
61
|
+
export declare const microsoftUpdateSpreadsheetDefinition: ActionTemplate;
|
59
62
|
export declare const microsoftMessageTeamsChatDefinition: ActionTemplate;
|
60
63
|
export declare const microsoftMessageTeamsChannelDefinition: ActionTemplate;
|
64
|
+
export declare const microsoftGetDocumentDefinition: ActionTemplate;
|
61
65
|
export declare const githubCreateOrUpdateFileDefinition: ActionTemplate;
|
62
66
|
export declare const githubCreateBranchDefinition: ActionTemplate;
|
63
67
|
export declare const githubCreatePullRequestDefinition: ActionTemplate;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.ashbyListCandidateNotesDefinition = exports.ashbySearchCandidatesDefinition = exports.ashbyListCandidatesDefinition = exports.ashbyAddCandidateToProjectDefinition = exports.ashbyGetCandidateInfoDefinition = exports.ashbyCreateNoteDefinition = exports.lookerEnableUserByEmailDefinition = exports.finnhubGetBasicFinancialsDefinition = exports.finnhubSymbolLookupDefinition = exports.googleOauthUpdatePresentationDefinition = exports.googleOauthCreatePresentationDefinition = exports.googleOauthUpdateSpreadsheetDefinition = exports.googleOauthCreateSpreadsheetDefinition = exports.googleOauthScheduleCalendarMeetingDefinition = exports.googleOauthUpdateDocDefinition = exports.googleOauthCreateNewGoogleDocDefinition = exports.resendSendEmailDefinition = exports.firecrawlScrapeTweetDataWithNitterDefinition = exports.firecrawlScrapeUrlDefinition = exports.nwsGetForecastForLocationDefinition = exports.openstreetmapGetLatitudeLongitudeFromLocationDefinition = exports.snowflakeRunSnowflakeQueryDefinition = exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.xCreateShareXPostUrlDefinition = exports.linkedinCreateShareLinkedinPostUrlDefinition = exports.zendeskAssignTicketDefinition = exports.zendeskAddCommentToTicketDefinition = exports.zendeskUpdateTicketStatusDefinition = exports.zendeskGetTicketDetailsDefinition = exports.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = exports.googlemapsNearbysearchRestaurantsDefinition = exports.googlemapsValidateAddressDefinition = exports.jiraUpdateJiraTicketStatusDefinition = exports.jiraUpdateJiraTicketDetailsDefinition = exports.jiraGetJiraTicketHistoryDefinition = exports.jiraGetJiraTicketDetailsDefinition = exports.jiraCreateJiraTicketDefinition = exports.jiraCommentJiraTicketDefinition = exports.jiraAssignJiraTicketDefinition = exports.confluenceFetchPageContentDefinition = exports.confluenceOverwritePageDefinition = exports.mathAddDefinition = exports.slackGetChannelMessagesDefinition = exports.slackListConversationsDefinition = exports.slackSendMessageDefinition = exports.asanaUpdateTaskDefinition = exports.asanaCreateTaskDefinition = exports.asanaCommentTaskDefinition = void 0;
|
4
|
-
exports.githubCreatePullRequestDefinition = exports.githubCreateBranchDefinition = exports.githubCreateOrUpdateFileDefinition = exports.microsoftMessageTeamsChannelDefinition = exports.microsoftMessageTeamsChatDefinition = exports.salesforceGetRecordDefinition = exports.salesforceGetSalesforceRecordsByQueryDefinition = exports.salesforceGenerateSalesReportDefinition = exports.salesforceCreateCaseDefinition = exports.salesforceUpdateRecordDefinition = exports.ashbyUpdateCandidateDefinition = exports.ashbyCreateCandidateDefinition = void 0;
|
4
|
+
exports.githubCreatePullRequestDefinition = exports.githubCreateBranchDefinition = exports.githubCreateOrUpdateFileDefinition = exports.microsoftGetDocumentDefinition = exports.microsoftMessageTeamsChannelDefinition = exports.microsoftMessageTeamsChatDefinition = exports.microsoftUpdateSpreadsheetDefinition = exports.microsoftUpdateDocumentDefinition = exports.microsoftCreateDocumentDefinition = exports.salesforceGetRecordDefinition = exports.salesforceGetSalesforceRecordsByQueryDefinition = exports.salesforceGenerateSalesReportDefinition = exports.salesforceCreateCaseDefinition = exports.salesforceUpdateRecordDefinition = exports.ashbyUpdateCandidateDefinition = exports.ashbyCreateCandidateDefinition = void 0;
|
5
5
|
exports.asanaCommentTaskDefinition = {
|
6
6
|
description: "Comments on an Asana task with specified content",
|
7
7
|
scopes: [],
|
@@ -5387,9 +5387,157 @@ exports.salesforceGetRecordDefinition = {
|
|
5387
5387
|
name: "getRecord",
|
5388
5388
|
provider: "salesforce",
|
5389
5389
|
};
|
5390
|
+
exports.microsoftCreateDocumentDefinition = {
|
5391
|
+
description: "Creates a new Office365 document",
|
5392
|
+
scopes: ["Files.ReadWrite", "Sites.Manage.All", "Sites.ReadWrite.All"],
|
5393
|
+
parameters: {
|
5394
|
+
type: "object",
|
5395
|
+
required: ["name", "content"],
|
5396
|
+
properties: {
|
5397
|
+
siteId: {
|
5398
|
+
type: "string",
|
5399
|
+
description: "The ID of the site where the document will be created",
|
5400
|
+
},
|
5401
|
+
name: {
|
5402
|
+
type: "string",
|
5403
|
+
description: "The name of the new document (include extension like .docx or .xlsx)",
|
5404
|
+
},
|
5405
|
+
content: {
|
5406
|
+
type: "string",
|
5407
|
+
description: "The content to add to the new document",
|
5408
|
+
},
|
5409
|
+
folderId: {
|
5410
|
+
type: "string",
|
5411
|
+
description: "The ID of the folder to create the document in (optional)",
|
5412
|
+
},
|
5413
|
+
},
|
5414
|
+
},
|
5415
|
+
output: {
|
5416
|
+
type: "object",
|
5417
|
+
required: ["success"],
|
5418
|
+
properties: {
|
5419
|
+
documentId: {
|
5420
|
+
type: "string",
|
5421
|
+
description: "The ID of the created document",
|
5422
|
+
},
|
5423
|
+
documentUrl: {
|
5424
|
+
type: "string",
|
5425
|
+
description: "The URL to access the created document",
|
5426
|
+
},
|
5427
|
+
fileName: {
|
5428
|
+
type: "string",
|
5429
|
+
description: "The name of the created document (could be sanitized version of the name)",
|
5430
|
+
},
|
5431
|
+
success: {
|
5432
|
+
type: "boolean",
|
5433
|
+
description: "Whether the document was created successfully",
|
5434
|
+
},
|
5435
|
+
error: {
|
5436
|
+
type: "string",
|
5437
|
+
description: "The error that occurred if the document was not created successfully",
|
5438
|
+
},
|
5439
|
+
},
|
5440
|
+
},
|
5441
|
+
name: "createDocument",
|
5442
|
+
provider: "microsoft",
|
5443
|
+
};
|
5444
|
+
exports.microsoftUpdateDocumentDefinition = {
|
5445
|
+
description: "Updates a Office365 document",
|
5446
|
+
scopes: ["Files.ReadWrite", "Sites.ReadWrite.All"],
|
5447
|
+
parameters: {
|
5448
|
+
type: "object",
|
5449
|
+
required: ["documentId", "content"],
|
5450
|
+
properties: {
|
5451
|
+
siteId: {
|
5452
|
+
type: "string",
|
5453
|
+
description: "The ID of the site where the document is located",
|
5454
|
+
},
|
5455
|
+
documentId: {
|
5456
|
+
type: "string",
|
5457
|
+
description: "The ID of the document",
|
5458
|
+
},
|
5459
|
+
content: {
|
5460
|
+
type: "string",
|
5461
|
+
description: "The new content to update in the document",
|
5462
|
+
},
|
5463
|
+
},
|
5464
|
+
},
|
5465
|
+
output: {
|
5466
|
+
type: "object",
|
5467
|
+
required: ["success"],
|
5468
|
+
properties: {
|
5469
|
+
success: {
|
5470
|
+
type: "boolean",
|
5471
|
+
description: "Whether the document was updated successfully",
|
5472
|
+
},
|
5473
|
+
error: {
|
5474
|
+
type: "string",
|
5475
|
+
description: "The error that occurred if the update was not successful",
|
5476
|
+
},
|
5477
|
+
documentUrl: {
|
5478
|
+
type: "string",
|
5479
|
+
description: "The URL to access the updated document",
|
5480
|
+
},
|
5481
|
+
},
|
5482
|
+
},
|
5483
|
+
name: "updateDocument",
|
5484
|
+
provider: "microsoft",
|
5485
|
+
};
|
5486
|
+
exports.microsoftUpdateSpreadsheetDefinition = {
|
5487
|
+
description: "Updates a Microsoft Excel spreadsheet",
|
5488
|
+
scopes: ["Files.ReadWrite", "Sites.ReadWrite.All"],
|
5489
|
+
parameters: {
|
5490
|
+
type: "object",
|
5491
|
+
required: ["spreadsheetId", "range", "values"],
|
5492
|
+
properties: {
|
5493
|
+
spreadsheetId: {
|
5494
|
+
type: "string",
|
5495
|
+
description: "The ID of the spreadsheet to update",
|
5496
|
+
},
|
5497
|
+
range: {
|
5498
|
+
type: "string",
|
5499
|
+
description: 'The range of cells to update (e.g., "Sheet1!A1:B2")',
|
5500
|
+
},
|
5501
|
+
values: {
|
5502
|
+
type: "array",
|
5503
|
+
description: "The values to update in the specified range",
|
5504
|
+
items: {
|
5505
|
+
type: "array",
|
5506
|
+
items: {
|
5507
|
+
type: "string",
|
5508
|
+
},
|
5509
|
+
},
|
5510
|
+
},
|
5511
|
+
siteId: {
|
5512
|
+
type: "string",
|
5513
|
+
description: "The ID of the site where the spreadsheet is located",
|
5514
|
+
},
|
5515
|
+
},
|
5516
|
+
},
|
5517
|
+
output: {
|
5518
|
+
type: "object",
|
5519
|
+
required: ["success"],
|
5520
|
+
properties: {
|
5521
|
+
success: {
|
5522
|
+
type: "boolean",
|
5523
|
+
description: "Whether the spreadsheet was updated successfully",
|
5524
|
+
},
|
5525
|
+
error: {
|
5526
|
+
type: "string",
|
5527
|
+
description: "The error that occurred if the update was not successful",
|
5528
|
+
},
|
5529
|
+
updatedRange: {
|
5530
|
+
type: "string",
|
5531
|
+
description: "The range that was updated in the spreadsheet",
|
5532
|
+
},
|
5533
|
+
},
|
5534
|
+
},
|
5535
|
+
name: "updateSpreadsheet",
|
5536
|
+
provider: "microsoft",
|
5537
|
+
};
|
5390
5538
|
exports.microsoftMessageTeamsChatDefinition = {
|
5391
5539
|
description: "Sends a message to a Microsoft Teams chat",
|
5392
|
-
scopes: ["
|
5540
|
+
scopes: ["ChatMessage.Send"],
|
5393
5541
|
parameters: {
|
5394
5542
|
type: "object",
|
5395
5543
|
required: ["chatId", "message"],
|
@@ -5427,7 +5575,7 @@ exports.microsoftMessageTeamsChatDefinition = {
|
|
5427
5575
|
};
|
5428
5576
|
exports.microsoftMessageTeamsChannelDefinition = {
|
5429
5577
|
description: "Sends a message to a Microsoft Teams channel",
|
5430
|
-
scopes: ["
|
5578
|
+
scopes: ["ChannelMessage.Send"],
|
5431
5579
|
parameters: {
|
5432
5580
|
type: "object",
|
5433
5581
|
required: ["teamId", "channelId", "message"],
|
@@ -5467,6 +5615,44 @@ exports.microsoftMessageTeamsChannelDefinition = {
|
|
5467
5615
|
name: "messageTeamsChannel",
|
5468
5616
|
provider: "microsoft",
|
5469
5617
|
};
|
5618
|
+
exports.microsoftGetDocumentDefinition = {
|
5619
|
+
description: "Retrieves the content of a Microsoft Office document",
|
5620
|
+
scopes: ["Files.ReadWrite", "Sites.ReadWrite.All"],
|
5621
|
+
parameters: {
|
5622
|
+
type: "object",
|
5623
|
+
required: ["documentId"],
|
5624
|
+
properties: {
|
5625
|
+
siteId: {
|
5626
|
+
type: "string",
|
5627
|
+
description: "The ID of the site where the document is located (optional for OneDrive)",
|
5628
|
+
},
|
5629
|
+
documentId: {
|
5630
|
+
type: "string",
|
5631
|
+
description: "The ID of the document to retrieve",
|
5632
|
+
},
|
5633
|
+
},
|
5634
|
+
},
|
5635
|
+
output: {
|
5636
|
+
type: "object",
|
5637
|
+
required: ["success"],
|
5638
|
+
properties: {
|
5639
|
+
success: {
|
5640
|
+
type: "boolean",
|
5641
|
+
description: "Whether the document was successfully retrieved",
|
5642
|
+
},
|
5643
|
+
content: {
|
5644
|
+
type: "string",
|
5645
|
+
description: "The content of the document",
|
5646
|
+
},
|
5647
|
+
error: {
|
5648
|
+
type: "string",
|
5649
|
+
description: "The error that occurred if the document was not successfully retrieved",
|
5650
|
+
},
|
5651
|
+
},
|
5652
|
+
},
|
5653
|
+
name: "getDocument",
|
5654
|
+
provider: "microsoft",
|
5655
|
+
};
|
5470
5656
|
exports.githubCreateOrUpdateFileDefinition = {
|
5471
5657
|
description: "Create or update a file in a GitHub repository",
|
5472
5658
|
scopes: [],
|
@@ -2410,6 +2410,105 @@ export declare const salesforceGetRecordOutputSchema: z.ZodObject<{
|
|
2410
2410
|
}>;
|
2411
2411
|
export type salesforceGetRecordOutputType = z.infer<typeof salesforceGetRecordOutputSchema>;
|
2412
2412
|
export type salesforceGetRecordFunction = ActionFunction<salesforceGetRecordParamsType, AuthParamsType, salesforceGetRecordOutputType>;
|
2413
|
+
export declare const microsoftCreateDocumentParamsSchema: z.ZodObject<{
|
2414
|
+
siteId: z.ZodOptional<z.ZodString>;
|
2415
|
+
name: z.ZodString;
|
2416
|
+
content: z.ZodString;
|
2417
|
+
folderId: z.ZodOptional<z.ZodString>;
|
2418
|
+
}, "strip", z.ZodTypeAny, {
|
2419
|
+
name: string;
|
2420
|
+
content: string;
|
2421
|
+
siteId?: string | undefined;
|
2422
|
+
folderId?: string | undefined;
|
2423
|
+
}, {
|
2424
|
+
name: string;
|
2425
|
+
content: string;
|
2426
|
+
siteId?: string | undefined;
|
2427
|
+
folderId?: string | undefined;
|
2428
|
+
}>;
|
2429
|
+
export type microsoftCreateDocumentParamsType = z.infer<typeof microsoftCreateDocumentParamsSchema>;
|
2430
|
+
export declare const microsoftCreateDocumentOutputSchema: z.ZodObject<{
|
2431
|
+
documentId: z.ZodOptional<z.ZodString>;
|
2432
|
+
documentUrl: z.ZodOptional<z.ZodString>;
|
2433
|
+
fileName: z.ZodOptional<z.ZodString>;
|
2434
|
+
success: z.ZodBoolean;
|
2435
|
+
error: z.ZodOptional<z.ZodString>;
|
2436
|
+
}, "strip", z.ZodTypeAny, {
|
2437
|
+
success: boolean;
|
2438
|
+
error?: string | undefined;
|
2439
|
+
documentId?: string | undefined;
|
2440
|
+
documentUrl?: string | undefined;
|
2441
|
+
fileName?: string | undefined;
|
2442
|
+
}, {
|
2443
|
+
success: boolean;
|
2444
|
+
error?: string | undefined;
|
2445
|
+
documentId?: string | undefined;
|
2446
|
+
documentUrl?: string | undefined;
|
2447
|
+
fileName?: string | undefined;
|
2448
|
+
}>;
|
2449
|
+
export type microsoftCreateDocumentOutputType = z.infer<typeof microsoftCreateDocumentOutputSchema>;
|
2450
|
+
export type microsoftCreateDocumentFunction = ActionFunction<microsoftCreateDocumentParamsType, AuthParamsType, microsoftCreateDocumentOutputType>;
|
2451
|
+
export declare const microsoftUpdateDocumentParamsSchema: z.ZodObject<{
|
2452
|
+
siteId: z.ZodOptional<z.ZodString>;
|
2453
|
+
documentId: z.ZodString;
|
2454
|
+
content: z.ZodString;
|
2455
|
+
}, "strip", z.ZodTypeAny, {
|
2456
|
+
content: string;
|
2457
|
+
documentId: string;
|
2458
|
+
siteId?: string | undefined;
|
2459
|
+
}, {
|
2460
|
+
content: string;
|
2461
|
+
documentId: string;
|
2462
|
+
siteId?: string | undefined;
|
2463
|
+
}>;
|
2464
|
+
export type microsoftUpdateDocumentParamsType = z.infer<typeof microsoftUpdateDocumentParamsSchema>;
|
2465
|
+
export declare const microsoftUpdateDocumentOutputSchema: z.ZodObject<{
|
2466
|
+
success: z.ZodBoolean;
|
2467
|
+
error: z.ZodOptional<z.ZodString>;
|
2468
|
+
documentUrl: z.ZodOptional<z.ZodString>;
|
2469
|
+
}, "strip", z.ZodTypeAny, {
|
2470
|
+
success: boolean;
|
2471
|
+
error?: string | undefined;
|
2472
|
+
documentUrl?: string | undefined;
|
2473
|
+
}, {
|
2474
|
+
success: boolean;
|
2475
|
+
error?: string | undefined;
|
2476
|
+
documentUrl?: string | undefined;
|
2477
|
+
}>;
|
2478
|
+
export type microsoftUpdateDocumentOutputType = z.infer<typeof microsoftUpdateDocumentOutputSchema>;
|
2479
|
+
export type microsoftUpdateDocumentFunction = ActionFunction<microsoftUpdateDocumentParamsType, AuthParamsType, microsoftUpdateDocumentOutputType>;
|
2480
|
+
export declare const microsoftUpdateSpreadsheetParamsSchema: z.ZodObject<{
|
2481
|
+
spreadsheetId: z.ZodString;
|
2482
|
+
range: z.ZodString;
|
2483
|
+
values: z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">;
|
2484
|
+
siteId: z.ZodOptional<z.ZodString>;
|
2485
|
+
}, "strip", z.ZodTypeAny, {
|
2486
|
+
values: string[][];
|
2487
|
+
range: string;
|
2488
|
+
spreadsheetId: string;
|
2489
|
+
siteId?: string | undefined;
|
2490
|
+
}, {
|
2491
|
+
values: string[][];
|
2492
|
+
range: string;
|
2493
|
+
spreadsheetId: string;
|
2494
|
+
siteId?: string | undefined;
|
2495
|
+
}>;
|
2496
|
+
export type microsoftUpdateSpreadsheetParamsType = z.infer<typeof microsoftUpdateSpreadsheetParamsSchema>;
|
2497
|
+
export declare const microsoftUpdateSpreadsheetOutputSchema: z.ZodObject<{
|
2498
|
+
success: z.ZodBoolean;
|
2499
|
+
error: z.ZodOptional<z.ZodString>;
|
2500
|
+
updatedRange: z.ZodOptional<z.ZodString>;
|
2501
|
+
}, "strip", z.ZodTypeAny, {
|
2502
|
+
success: boolean;
|
2503
|
+
error?: string | undefined;
|
2504
|
+
updatedRange?: string | undefined;
|
2505
|
+
}, {
|
2506
|
+
success: boolean;
|
2507
|
+
error?: string | undefined;
|
2508
|
+
updatedRange?: string | undefined;
|
2509
|
+
}>;
|
2510
|
+
export type microsoftUpdateSpreadsheetOutputType = z.infer<typeof microsoftUpdateSpreadsheetOutputSchema>;
|
2511
|
+
export type microsoftUpdateSpreadsheetFunction = ActionFunction<microsoftUpdateSpreadsheetParamsType, AuthParamsType, microsoftUpdateSpreadsheetOutputType>;
|
2413
2512
|
export declare const microsoftMessageTeamsChatParamsSchema: z.ZodObject<{
|
2414
2513
|
chatId: z.ZodString;
|
2415
2514
|
message: z.ZodString;
|
@@ -2465,6 +2564,32 @@ export declare const microsoftMessageTeamsChannelOutputSchema: z.ZodObject<{
|
|
2465
2564
|
}>;
|
2466
2565
|
export type microsoftMessageTeamsChannelOutputType = z.infer<typeof microsoftMessageTeamsChannelOutputSchema>;
|
2467
2566
|
export type microsoftMessageTeamsChannelFunction = ActionFunction<microsoftMessageTeamsChannelParamsType, AuthParamsType, microsoftMessageTeamsChannelOutputType>;
|
2567
|
+
export declare const microsoftGetDocumentParamsSchema: z.ZodObject<{
|
2568
|
+
siteId: z.ZodOptional<z.ZodString>;
|
2569
|
+
documentId: z.ZodString;
|
2570
|
+
}, "strip", z.ZodTypeAny, {
|
2571
|
+
documentId: string;
|
2572
|
+
siteId?: string | undefined;
|
2573
|
+
}, {
|
2574
|
+
documentId: string;
|
2575
|
+
siteId?: string | undefined;
|
2576
|
+
}>;
|
2577
|
+
export type microsoftGetDocumentParamsType = z.infer<typeof microsoftGetDocumentParamsSchema>;
|
2578
|
+
export declare const microsoftGetDocumentOutputSchema: z.ZodObject<{
|
2579
|
+
success: z.ZodBoolean;
|
2580
|
+
content: z.ZodOptional<z.ZodString>;
|
2581
|
+
error: z.ZodOptional<z.ZodString>;
|
2582
|
+
}, "strip", z.ZodTypeAny, {
|
2583
|
+
success: boolean;
|
2584
|
+
error?: string | undefined;
|
2585
|
+
content?: string | undefined;
|
2586
|
+
}, {
|
2587
|
+
success: boolean;
|
2588
|
+
error?: string | undefined;
|
2589
|
+
content?: string | undefined;
|
2590
|
+
}>;
|
2591
|
+
export type microsoftGetDocumentOutputType = z.infer<typeof microsoftGetDocumentOutputSchema>;
|
2592
|
+
export type microsoftGetDocumentFunction = ActionFunction<microsoftGetDocumentParamsType, AuthParamsType, microsoftGetDocumentOutputType>;
|
2468
2593
|
export declare const githubCreateOrUpdateFileParamsSchema: z.ZodObject<{
|
2469
2594
|
repositoryOwner: z.ZodString;
|
2470
2595
|
repositoryName: z.ZodString;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.linkedinCreateShareLinkedinPostUrlParamsSchema = exports.zendeskAssignTicketOutputSchema = exports.zendeskAssignTicketParamsSchema = exports.zendeskAddCommentToTicketOutputSchema = exports.zendeskAddCommentToTicketParamsSchema = exports.zendeskUpdateTicketStatusOutputSchema = exports.zendeskUpdateTicketStatusParamsSchema = exports.zendeskGetTicketDetailsOutputSchema = exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.jiraUpdateJiraTicketStatusOutputSchema = exports.jiraUpdateJiraTicketStatusParamsSchema = exports.jiraUpdateJiraTicketDetailsOutputSchema = exports.jiraUpdateJiraTicketDetailsParamsSchema = exports.jiraGetJiraTicketHistoryOutputSchema = exports.jiraGetJiraTicketHistoryParamsSchema = exports.jiraGetJiraTicketDetailsOutputSchema = exports.jiraGetJiraTicketDetailsParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.jiraCommentJiraTicketOutputSchema = exports.jiraCommentJiraTicketParamsSchema = exports.jiraAssignJiraTicketOutputSchema = exports.jiraAssignJiraTicketParamsSchema = exports.confluenceFetchPageContentOutputSchema = exports.confluenceFetchPageContentParamsSchema = exports.confluenceOverwritePageOutputSchema = exports.confluenceOverwritePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackGetChannelMessagesOutputSchema = exports.slackGetChannelMessagesParamsSchema = exports.slackListConversationsOutputSchema = exports.slackListConversationsParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.asanaUpdateTaskOutputSchema = exports.asanaUpdateTaskParamsSchema = exports.asanaCreateTaskOutputSchema = exports.asanaCreateTaskParamsSchema = exports.asanaCommentTaskOutputSchema = exports.asanaCommentTaskParamsSchema = exports.AuthParamsSchema = void 0;
|
4
4
|
exports.ashbyListCandidateNotesParamsSchema = exports.ashbySearchCandidatesOutputSchema = exports.ashbySearchCandidatesParamsSchema = exports.ashbyListCandidatesOutputSchema = exports.ashbyListCandidatesParamsSchema = exports.ashbyAddCandidateToProjectOutputSchema = exports.ashbyAddCandidateToProjectParamsSchema = exports.ashbyGetCandidateInfoOutputSchema = exports.ashbyGetCandidateInfoParamsSchema = exports.ashbyCreateNoteOutputSchema = exports.ashbyCreateNoteParamsSchema = exports.lookerEnableUserByEmailOutputSchema = exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.googleOauthUpdatePresentationOutputSchema = exports.googleOauthUpdatePresentationParamsSchema = exports.googleOauthCreatePresentationOutputSchema = exports.googleOauthCreatePresentationParamsSchema = exports.googleOauthUpdateSpreadsheetOutputSchema = exports.googleOauthUpdateSpreadsheetParamsSchema = exports.googleOauthCreateSpreadsheetOutputSchema = exports.googleOauthCreateSpreadsheetParamsSchema = exports.googleOauthScheduleCalendarMeetingOutputSchema = exports.googleOauthScheduleCalendarMeetingParamsSchema = exports.googleOauthUpdateDocOutputSchema = exports.googleOauthUpdateDocParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeTweetDataWithNitterOutputSchema = exports.firecrawlScrapeTweetDataWithNitterParamsSchema = exports.firecrawlScrapeUrlOutputSchema = exports.firecrawlScrapeUrlParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeRunSnowflakeQueryOutputSchema = exports.snowflakeRunSnowflakeQueryParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = void 0;
|
5
|
-
exports.githubCreatePullRequestOutputSchema = exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGetSalesforceRecordsByQueryOutputSchema = exports.salesforceGetSalesforceRecordsByQueryParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = exports.ashbyUpdateCandidateParamsSchema = exports.ashbyCreateCandidateOutputSchema = exports.ashbyCreateCandidateParamsSchema = exports.ashbyListCandidateNotesOutputSchema = void 0;
|
5
|
+
exports.githubCreatePullRequestOutputSchema = exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftGetDocumentOutputSchema = exports.microsoftGetDocumentParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.microsoftUpdateSpreadsheetOutputSchema = exports.microsoftUpdateSpreadsheetParamsSchema = exports.microsoftUpdateDocumentOutputSchema = exports.microsoftUpdateDocumentParamsSchema = exports.microsoftCreateDocumentOutputSchema = exports.microsoftCreateDocumentParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGetSalesforceRecordsByQueryOutputSchema = exports.salesforceGetSalesforceRecordsByQueryParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = exports.ashbyUpdateCandidateParamsSchema = exports.ashbyCreateCandidateOutputSchema = exports.ashbyCreateCandidateParamsSchema = exports.ashbyListCandidateNotesOutputSchema = void 0;
|
6
6
|
const zod_1 = require("zod");
|
7
7
|
exports.AuthParamsSchema = zod_1.z.object({
|
8
8
|
authToken: zod_1.z.string().optional(),
|
@@ -2143,6 +2143,40 @@ exports.salesforceGetRecordOutputSchema = zod_1.z.object({
|
|
2143
2143
|
record: zod_1.z.record(zod_1.z.string()).describe("The retrieved record data").optional(),
|
2144
2144
|
error: zod_1.z.string().describe("The error that occurred if the record was not successfully retrieved").optional(),
|
2145
2145
|
});
|
2146
|
+
exports.microsoftCreateDocumentParamsSchema = zod_1.z.object({
|
2147
|
+
siteId: zod_1.z.string().describe("The ID of the site where the document will be created").optional(),
|
2148
|
+
name: zod_1.z.string().describe("The name of the new document (include extension like .docx or .xlsx)"),
|
2149
|
+
content: zod_1.z.string().describe("The content to add to the new document"),
|
2150
|
+
folderId: zod_1.z.string().describe("The ID of the folder to create the document in (optional)").optional(),
|
2151
|
+
});
|
2152
|
+
exports.microsoftCreateDocumentOutputSchema = zod_1.z.object({
|
2153
|
+
documentId: zod_1.z.string().describe("The ID of the created document").optional(),
|
2154
|
+
documentUrl: zod_1.z.string().describe("The URL to access the created document").optional(),
|
2155
|
+
fileName: zod_1.z.string().describe("The name of the created document (could be sanitized version of the name)").optional(),
|
2156
|
+
success: zod_1.z.boolean().describe("Whether the document was created successfully"),
|
2157
|
+
error: zod_1.z.string().describe("The error that occurred if the document was not created successfully").optional(),
|
2158
|
+
});
|
2159
|
+
exports.microsoftUpdateDocumentParamsSchema = zod_1.z.object({
|
2160
|
+
siteId: zod_1.z.string().describe("The ID of the site where the document is located").optional(),
|
2161
|
+
documentId: zod_1.z.string().describe("The ID of the document"),
|
2162
|
+
content: zod_1.z.string().describe("The new content to update in the document"),
|
2163
|
+
});
|
2164
|
+
exports.microsoftUpdateDocumentOutputSchema = zod_1.z.object({
|
2165
|
+
success: zod_1.z.boolean().describe("Whether the document was updated successfully"),
|
2166
|
+
error: zod_1.z.string().describe("The error that occurred if the update was not successful").optional(),
|
2167
|
+
documentUrl: zod_1.z.string().describe("The URL to access the updated document").optional(),
|
2168
|
+
});
|
2169
|
+
exports.microsoftUpdateSpreadsheetParamsSchema = zod_1.z.object({
|
2170
|
+
spreadsheetId: zod_1.z.string().describe("The ID of the spreadsheet to update"),
|
2171
|
+
range: zod_1.z.string().describe('The range of cells to update (e.g., "Sheet1!A1:B2")'),
|
2172
|
+
values: zod_1.z.array(zod_1.z.array(zod_1.z.string())).describe("The values to update in the specified range"),
|
2173
|
+
siteId: zod_1.z.string().describe("The ID of the site where the spreadsheet is located").optional(),
|
2174
|
+
});
|
2175
|
+
exports.microsoftUpdateSpreadsheetOutputSchema = zod_1.z.object({
|
2176
|
+
success: zod_1.z.boolean().describe("Whether the spreadsheet was updated successfully"),
|
2177
|
+
error: zod_1.z.string().describe("The error that occurred if the update was not successful").optional(),
|
2178
|
+
updatedRange: zod_1.z.string().describe("The range that was updated in the spreadsheet").optional(),
|
2179
|
+
});
|
2146
2180
|
exports.microsoftMessageTeamsChatParamsSchema = zod_1.z.object({
|
2147
2181
|
chatId: zod_1.z.string().describe("The chat ID of the Microsoft Teams chat"),
|
2148
2182
|
message: zod_1.z.string().describe("The text to be messaged to the chat"),
|
@@ -2162,6 +2196,15 @@ exports.microsoftMessageTeamsChannelOutputSchema = zod_1.z.object({
|
|
2162
2196
|
error: zod_1.z.string().describe("The error that occurred if the message was not sent successfully").optional(),
|
2163
2197
|
messageId: zod_1.z.string().describe("The ID of the message that was sent").optional(),
|
2164
2198
|
});
|
2199
|
+
exports.microsoftGetDocumentParamsSchema = zod_1.z.object({
|
2200
|
+
siteId: zod_1.z.string().describe("The ID of the site where the document is located (optional for OneDrive)").optional(),
|
2201
|
+
documentId: zod_1.z.string().describe("The ID of the document to retrieve"),
|
2202
|
+
});
|
2203
|
+
exports.microsoftGetDocumentOutputSchema = zod_1.z.object({
|
2204
|
+
success: zod_1.z.boolean().describe("Whether the document was successfully retrieved"),
|
2205
|
+
content: zod_1.z.string().describe("The content of the document").optional(),
|
2206
|
+
error: zod_1.z.string().describe("The error that occurred if the document was not successfully retrieved").optional(),
|
2207
|
+
});
|
2165
2208
|
exports.githubCreateOrUpdateFileParamsSchema = zod_1.z.object({
|
2166
2209
|
repositoryOwner: zod_1.z.string().describe("The owner of the repository"),
|
2167
2210
|
repositoryName: zod_1.z.string().describe("The name of the repository"),
|
package/dist/actions/groups.js
CHANGED
@@ -105,11 +105,19 @@ exports.ACTION_GROUPS = {
|
|
105
105
|
templates_1.salesforceCreateCaseDefinition,
|
106
106
|
templates_1.salesforceGenerateSalesReportDefinition,
|
107
107
|
templates_1.salesforceGetRecordDefinition,
|
108
|
+
templates_1.salesforceGetSalesforceRecordsByQueryDefinition,
|
108
109
|
],
|
109
110
|
},
|
110
111
|
MICROSOFT: {
|
111
112
|
description: "Actions for interacting with Microsoft 365",
|
112
|
-
actions: [
|
113
|
+
actions: [
|
114
|
+
templates_1.microsoftMessageTeamsChatDefinition,
|
115
|
+
templates_1.microsoftMessageTeamsChannelDefinition,
|
116
|
+
templates_1.microsoftUpdateSpreadsheetDefinition,
|
117
|
+
templates_1.microsoftUpdateDocumentDefinition,
|
118
|
+
templates_1.microsoftCreateDocumentDefinition,
|
119
|
+
templates_1.microsoftGetDocumentDefinition,
|
120
|
+
],
|
113
121
|
},
|
114
122
|
GITHUB: {
|
115
123
|
description: "Actions for interacting with GitHub",
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const templates_1 = require("../../autogen/templates");
|
13
|
+
const utils_1 = require("./utils");
|
14
|
+
const createDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
+
const { folderId, name, content, siteId } = params;
|
16
|
+
let client = undefined;
|
17
|
+
try {
|
18
|
+
client = yield (0, utils_1.getGraphClient)(authParams, templates_1.microsoftCreateDocumentDefinition.scopes.join(" "));
|
19
|
+
}
|
20
|
+
catch (error) {
|
21
|
+
return {
|
22
|
+
success: false,
|
23
|
+
error: "Error while authorizing: " + (error instanceof Error ? error.message : "Unknown error"),
|
24
|
+
};
|
25
|
+
}
|
26
|
+
const apiEndpointPrefix = siteId ? `/sites/${siteId}` : "/me";
|
27
|
+
const sanitizedFileName = (0, utils_1.validateAndSanitizeFileName)(name);
|
28
|
+
const endpoint = `${apiEndpointPrefix}/drive/items/${folderId || "root"}:/${sanitizedFileName}:/content`;
|
29
|
+
try {
|
30
|
+
// Create or update the document
|
31
|
+
const response = yield client.api(endpoint).put(content);
|
32
|
+
return {
|
33
|
+
success: true,
|
34
|
+
documentId: response.id,
|
35
|
+
documentUrl: response.webUrl,
|
36
|
+
fileName: response.name,
|
37
|
+
};
|
38
|
+
}
|
39
|
+
catch (error) {
|
40
|
+
console.error("Error creating or updating document:", error);
|
41
|
+
return {
|
42
|
+
success: false,
|
43
|
+
error: error instanceof Error ? error.message : "Unknown error occurred",
|
44
|
+
};
|
45
|
+
}
|
46
|
+
});
|
47
|
+
exports.default = createDocument;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const utils_1 = require("./utils");
|
13
|
+
const getDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
const { siteId, documentId } = params;
|
15
|
+
let client;
|
16
|
+
try {
|
17
|
+
client = yield (0, utils_1.getGraphClient)(authParams, "Files.ReadWrite Sites.ReadWrite.All");
|
18
|
+
}
|
19
|
+
catch (error) {
|
20
|
+
return {
|
21
|
+
success: false,
|
22
|
+
error: "Error while authorizing: " + (error instanceof Error ? error.message : "Unknown error"),
|
23
|
+
};
|
24
|
+
}
|
25
|
+
try {
|
26
|
+
// Construct the API endpoint
|
27
|
+
const endpoint = siteId
|
28
|
+
? `/sites/${siteId}/drive/items/${documentId}/content`
|
29
|
+
: `/me/drive/items/${documentId}/content`;
|
30
|
+
// Fetch the document content
|
31
|
+
const response = yield client.api(endpoint).get();
|
32
|
+
return {
|
33
|
+
success: true,
|
34
|
+
content: response, // Assuming the response contains the document content
|
35
|
+
};
|
36
|
+
}
|
37
|
+
catch (error) {
|
38
|
+
console.error("Error retrieving document:", error);
|
39
|
+
return {
|
40
|
+
success: false,
|
41
|
+
error: error instanceof Error ? error.message : "Unknown error occurred",
|
42
|
+
};
|
43
|
+
}
|
44
|
+
});
|
45
|
+
exports.default = getDocument;
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
});
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const templates_1 = require("../../autogen/templates");
|
12
13
|
const utils_1 = require("./utils");
|
13
14
|
const sendMessageToTeamsChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
15
|
const { channelId, teamId, message } = params;
|
@@ -27,18 +28,32 @@ const sendMessageToTeamsChannel = (_a) => __awaiter(void 0, [_a], void 0, functi
|
|
27
28
|
error: "Message content is required to send a message",
|
28
29
|
};
|
29
30
|
}
|
31
|
+
let client = undefined;
|
30
32
|
try {
|
31
|
-
|
33
|
+
client = yield (0, utils_1.getGraphClient)(authParams, templates_1.microsoftMessageTeamsChannelDefinition.scopes.join(" "));
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
return {
|
37
|
+
success: false,
|
38
|
+
error: "Error while authorizing: " + (error instanceof Error ? error.message : "Unknown error"),
|
39
|
+
};
|
40
|
+
}
|
41
|
+
try {
|
42
|
+
const response = yield client.api(`/teams/${teamId}/channels/${channelId}/messages`).post({
|
43
|
+
body: {
|
44
|
+
content: message,
|
45
|
+
},
|
46
|
+
});
|
32
47
|
return {
|
33
48
|
success: true,
|
34
|
-
messageId:
|
49
|
+
messageId: response.id,
|
35
50
|
};
|
36
51
|
}
|
37
52
|
catch (error) {
|
38
53
|
console.error(error);
|
39
54
|
return {
|
40
55
|
success: false,
|
41
|
-
error: error instanceof Error ? error.message : "Unknown error",
|
56
|
+
error: "Error sending message: " + (error instanceof Error ? error.message : "Unknown error"),
|
42
57
|
};
|
43
58
|
}
|
44
59
|
});
|