diff --git a/samples/graph-activity-feed/csharp/ActivityFeedNotification/Controllers/HomeController.cs b/samples/graph-activity-feed/csharp/ActivityFeedNotification/Controllers/HomeController.cs index 0dc47c3dbe..f6e1cdb558 100644 --- a/samples/graph-activity-feed/csharp/ActivityFeedNotification/Controllers/HomeController.cs +++ b/samples/graph-activity-feed/csharp/ActivityFeedNotification/Controllers/HomeController.cs @@ -93,14 +93,14 @@ public async Task SendNotificationToUser(TaskDetails taskDetails) if (taskDetails.taskInfoAction == "customTopic") { ChatMessageHelper chatMessage = new ChatMessageHelper(_configuration); - var getChannelMessage = await chatMessage.CreateChatMessageForChannel(taskDetails, taskDetails.access_token); + //var getChannelMessage = await chatMessage.CreateChatMessageForChannel(taskDetails, taskDetails.access_token); var requestBody = new Microsoft.Graph.Beta.Users.Item.Teamwork.SendActivityNotification.SendActivityNotificationPostRequestBody { Topic = new TeamworkActivityTopic { Source = TeamworkActivityTopicSource.Text, Value = "Deployment Approvals Channel", - WebUrl = getChannelMessage.WebUrl + WebUrl = "https://teams.microsoft.com/l/entity/" + _configuration["AzureAd:MicrosoftAppId"] }, ActivityType = "taskCreated", PreviewText = new ItemBody @@ -111,15 +111,15 @@ public async Task SendNotificationToUser(TaskDetails taskDetails) { new Microsoft.Graph.Beta.Models.KeyValuePair { - Name = "taskId", - Value = "12322", + Name = "taskName", + Value = taskDetails.taskName ?? "New Task", }, }, IconId = "taskCreatedId" }; try { - await graphClient.Users["{userId}"].Teamwork + await graphClient.Users[_configuration["AzureAd:UserId"]].Teamwork .SendActivityNotification.PostAsync(requestBody); } catch (Exception ex) @@ -148,14 +148,14 @@ await graphClient.Users["{userId}"].Teamwork new KeyValuePair { Name = "taskName", - Value = "12322", + Value = taskDetails.taskName ?? "New Task", }, }, IconId = "taskCreatedId" }; try { - await graphClient.Users["{userId}"].Teamwork + await graphClient.Users[_configuration["AzureAd:UserId"]].Teamwork .SendActivityNotification.PostAsync(requestBody); } catch (Exception ex) @@ -194,7 +194,7 @@ public async Task SendNotificationToGroupChat(TaskDetails taskDeta Recipient = new AadUserNotificationRecipient { OdataType = "microsoft.graph.aadUserNotificationRecipient", - UserId = "{userId}", + UserId = _configuration["AzureAd:UserId"], }, TemplateParameters = new List { @@ -233,7 +233,7 @@ await graphClient.Chats[taskDetails.chatId] Recipient = new AadUserNotificationRecipient { OdataType = "microsoft.graph.aadUserNotificationRecipient", - UserId = "{userid}", + UserId = _configuration["AzureAd:UserId"], }, TemplateParameters = new List { @@ -378,7 +378,7 @@ await graphClientApp.Teams[taskDetails.teamId] Recipient = new AadUserNotificationRecipient { OdataType = "microsoft.graph.aadUserNotificationRecipient", - UserId = "{userId}", + UserId = _configuration["AzureAd:UserId"], }, TemplateParameters = new List { diff --git a/samples/graph-activity-feed/csharp/ActivityFeedNotification/appsettings.json b/samples/graph-activity-feed/csharp/ActivityFeedNotification/appsettings.json index 02bf6d636b..6e48f30078 100644 --- a/samples/graph-activity-feed/csharp/ActivityFeedNotification/appsettings.json +++ b/samples/graph-activity-feed/csharp/ActivityFeedNotification/appsettings.json @@ -1,12 +1,13 @@ { "AzureAd": { "Instance": "https://login.microsoftonline.com/", - "TenantId": "common", + "TenantId": "{TENANT_ID}", "MicrosoftAppId": "", "MicrosoftAppPassword": "", "ApplicationIdURI": "api://{Base_URL}/{MicrosoftAppId}", "AuthUrl": "/oauth2/v2.0/token", - "ValidIssuers": "https://login.microsoftonline.com/TENANT_ID/v2.0,https://sts.windows.net/TENANT_ID/" + "ValidIssuers": "https://login.microsoftonline.com/TENANT_ID/v2.0,https://sts.windows.net/TENANT_ID/", + "UserId": "" }, "Logging": { "LogLevel": { diff --git a/samples/graph-activity-feed/csharp/Images/1.PersonalNotfication.png b/samples/graph-activity-feed/csharp/Images/1.PersonalNotfication.png new file mode 100644 index 0000000000..774fd41c51 Binary files /dev/null and b/samples/graph-activity-feed/csharp/Images/1.PersonalNotfication.png differ diff --git a/samples/graph-activity-feed/csharp/Images/2.ActivityNotificationForUser.png b/samples/graph-activity-feed/csharp/Images/2.ActivityNotificationForUser.png new file mode 100644 index 0000000000..081830f25c Binary files /dev/null and b/samples/graph-activity-feed/csharp/Images/2.ActivityNotificationForUser.png differ diff --git a/samples/graph-activity-feed/csharp/Images/3.GroupChatCustom.png b/samples/graph-activity-feed/csharp/Images/3.GroupChatCustom.png new file mode 100644 index 0000000000..b7575b5e52 Binary files /dev/null and b/samples/graph-activity-feed/csharp/Images/3.GroupChatCustom.png differ diff --git a/samples/graph-activity-feed/csharp/Images/4.NotificationInGroupChat.png b/samples/graph-activity-feed/csharp/Images/4.NotificationInGroupChat.png new file mode 100644 index 0000000000..f7d13f857d Binary files /dev/null and b/samples/graph-activity-feed/csharp/Images/4.NotificationInGroupChat.png differ diff --git a/samples/graph-activity-feed/csharp/Images/5.TeamsNotification.png b/samples/graph-activity-feed/csharp/Images/5.TeamsNotification.png new file mode 100644 index 0000000000..dd864bcc36 Binary files /dev/null and b/samples/graph-activity-feed/csharp/Images/5.TeamsNotification.png differ diff --git a/samples/graph-activity-feed/csharp/Images/6.ActivityFeedNotification.png b/samples/graph-activity-feed/csharp/Images/6.ActivityFeedNotification.png new file mode 100644 index 0000000000..4255836113 Binary files /dev/null and b/samples/graph-activity-feed/csharp/Images/6.ActivityFeedNotification.png differ diff --git a/samples/graph-activity-feed/csharp/Images/ActivityFeed.gif b/samples/graph-activity-feed/csharp/Images/ActivityFeed.gif index fe630bdb8e..c2adeb67e0 100644 Binary files a/samples/graph-activity-feed/csharp/Images/ActivityFeed.gif and b/samples/graph-activity-feed/csharp/Images/ActivityFeed.gif differ diff --git a/samples/graph-activity-feed/csharp/Images/ActivityFeedNotification.png b/samples/graph-activity-feed/csharp/Images/ActivityFeedNotification.png deleted file mode 100644 index e8c3fc7d5c..0000000000 Binary files a/samples/graph-activity-feed/csharp/Images/ActivityFeedNotification.png and /dev/null differ diff --git a/samples/graph-activity-feed/csharp/Images/TeamsNotification.png b/samples/graph-activity-feed/csharp/Images/TeamsNotification.png deleted file mode 100644 index 7f87dee896..0000000000 Binary files a/samples/graph-activity-feed/csharp/Images/TeamsNotification.png and /dev/null differ diff --git a/samples/graph-activity-feed/csharp/README.md b/samples/graph-activity-feed/csharp/README.md index 87bfa7d5b9..124f017083 100644 --- a/samples/graph-activity-feed/csharp/README.md +++ b/samples/graph-activity-feed/csharp/README.md @@ -192,11 +192,19 @@ Teams Activity feed notification API uses activity to which user want a notifica ## Running the sample -![image](Images/TeamsNotification.png) +![image](Images/1.PersonalNotfication.png) + +![image](Images/2.ActivityNotificationForUser.png) + +![image](Images/3.GroupChatCustom.png) + +![image](Images/4.NotificationInGroupChat.png) + +![image](Images/5.TeamsNotification.png) - Notification triggred by Tab App will appear in Teams Activity Feed -![image](Images/ActivityFeedNotification.png) +![image](Images/6.ActivityFeedNotification.png) **Custom Activity Icons** diff --git a/samples/graph-activity-feed/nodejs/.env b/samples/graph-activity-feed/nodejs/.env index 3b1bb8e31b..aa4bfb164c 100644 --- a/samples/graph-activity-feed/nodejs/.env +++ b/samples/graph-activity-feed/nodejs/.env @@ -1,4 +1,7 @@ -ClientId = -ClientSecret = -TenantId = -AllowedHosts = * \ No newline at end of file +ClientId= +ClientSecret= +TenantId= +AllowedHosts=* +applicationIdUri= +UserId= +TeamsAppId= \ No newline at end of file diff --git a/samples/graph-activity-feed/nodejs/Images/activity-feed-personal.png b/samples/graph-activity-feed/nodejs/Images/activity-feed-personal.png index b00f572080..f2a13c2d1c 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/activity-feed-personal.png and b/samples/graph-activity-feed/nodejs/Images/activity-feed-personal.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/activity-feed.gif b/samples/graph-activity-feed/nodejs/Images/activity-feed.gif index e07ee7fe5a..3eca88abb4 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/activity-feed.gif and b/samples/graph-activity-feed/nodejs/Images/activity-feed.gif differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-group-config.png b/samples/graph-activity-feed/nodejs/Images/feed-group-config.png index 4808ab2067..038b453dac 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-group-config.png and b/samples/graph-activity-feed/nodejs/Images/feed-group-config.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-group-custom-notification.png b/samples/graph-activity-feed/nodejs/Images/feed-group-custom-notification.png index 6543a71e4d..4f8d1ff0f7 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-group-custom-notification.png and b/samples/graph-activity-feed/nodejs/Images/feed-group-custom-notification.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-group-page.png b/samples/graph-activity-feed/nodejs/Images/feed-group-page.png index 4a795300c0..d6ebe37c31 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-group-page.png and b/samples/graph-activity-feed/nodejs/Images/feed-group-page.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-notification-personal.png b/samples/graph-activity-feed/nodejs/Images/feed-notification-personal.png index be2ed7f8b4..2e783eee66 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-notification-personal.png and b/samples/graph-activity-feed/nodejs/Images/feed-notification-personal.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-team-config.png b/samples/graph-activity-feed/nodejs/Images/feed-team-config.png index c33dc54483..100ac239df 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-team-config.png and b/samples/graph-activity-feed/nodejs/Images/feed-team-config.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-team-custom-event.png b/samples/graph-activity-feed/nodejs/Images/feed-team-custom-event.png index 1046e97e23..4e0458b779 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-team-custom-event.png and b/samples/graph-activity-feed/nodejs/Images/feed-team-custom-event.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-team-custom-notification.png b/samples/graph-activity-feed/nodejs/Images/feed-team-custom-notification.png index c6d3f7525c..d26c789256 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-team-custom-notification.png and b/samples/graph-activity-feed/nodejs/Images/feed-team-custom-notification.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-team-notify.png b/samples/graph-activity-feed/nodejs/Images/feed-team-notify.png index 4129edb7d6..d7753f0688 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-team-notify.png and b/samples/graph-activity-feed/nodejs/Images/feed-team-notify.png differ diff --git a/samples/graph-activity-feed/nodejs/Images/feed-team-page.png b/samples/graph-activity-feed/nodejs/Images/feed-team-page.png index 7d9dbd7a58..d4baa427e9 100644 Binary files a/samples/graph-activity-feed/nodejs/Images/feed-team-page.png and b/samples/graph-activity-feed/nodejs/Images/feed-team-page.png differ diff --git a/samples/graph-activity-feed/nodejs/aad.manifest.json b/samples/graph-activity-feed/nodejs/aad.manifest.json index 4f03825baa..92c312dea3 100644 --- a/samples/graph-activity-feed/nodejs/aad.manifest.json +++ b/samples/graph-activity-feed/nodejs/aad.manifest.json @@ -51,6 +51,10 @@ { "id": "TeamsTab.Read.All", "type": "Scope" + }, + { + "id": "Directory.Read.All", + "type": "Role" } ] } @@ -130,7 +134,15 @@ "type": "Spa" }, { - "url": "${{TAB_ENDPOINT}}/auth-end", + "url": "${{TAB_ENDPOINT}}/UserNotification", + "type": "Spa" + }, + { + "url": "${{TAB_ENDPOINT}}/GroupChatNotification", + "type": "Spa" + }, + { + "url": "${{TAB_ENDPOINT}}/TeamNotification", "type": "Spa" } ] diff --git a/samples/graph-activity-feed/nodejs/appManifest/manifest.json b/samples/graph-activity-feed/nodejs/appManifest/manifest.json index 021b6aefba..abe0be572c 100644 --- a/samples/graph-activity-feed/nodejs/appManifest/manifest.json +++ b/samples/graph-activity-feed/nodejs/appManifest/manifest.json @@ -68,7 +68,10 @@ { "type": "deploymentApprovalRequired", "description": "New deployment requires your approval", - "templateText": "New deployment requires your approval with {deploymentId}" + "templateText": "New deployment requires your approval with {deploymentId}", + "allowedIconIds": [ + "deploymentApprovalRequiredId" + ] }, { "type": "approvalRequired", @@ -100,6 +103,10 @@ "id": "taskCreatedId", "iconFile": "exclaim.png" }, + { + "id": "deploymentApprovalRequiredId", + "iconFile": "deploymentApprovalRequired.png" + }, { "id": "approvalRequiredId", "iconFile": "approvalRequired.png" diff --git a/samples/graph-activity-feed/nodejs/build-app-package.js b/samples/graph-activity-feed/nodejs/build-app-package.js new file mode 100644 index 0000000000..8da634ac1e --- /dev/null +++ b/samples/graph-activity-feed/nodejs/build-app-package.js @@ -0,0 +1,61 @@ +const fs = require('fs'); +const path = require('path'); +const archiver = require('archiver'); + +// Create build directory if it doesn't exist +const buildDir = path.join(__dirname, 'appManifest', 'build'); +if (!fs.existsSync(buildDir)) { + fs.mkdirSync(buildDir, { recursive: true }); +} + +// Read the manifest file +const manifestPath = path.join(__dirname, 'appManifest', 'manifest.json'); +const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); + +// Replace environment variables in manifest +const envReplacements = { + '{{TEAMS_APP_ID}}': process.env.TEAMS_APP_ID || 'placeholder-teams-app-id', + '{{TAB_DOMAIN}}': process.env.TAB_DOMAIN || 'placeholder-domain', + '{{AAD_APP_CLIENT_ID}}': process.env.AAD_APP_CLIENT_ID || 'placeholder-client-id', + '{{TEAMSFX_ENV}}': process.env.TEAMSFX_ENV || 'local' +}; + +let manifestString = JSON.stringify(manifest, null, 2); +Object.entries(envReplacements).forEach(([placeholder, value]) => { + manifestString = manifestString.replace(new RegExp(`\\$\\{\\{${placeholder.slice(2, -2)}\\}\\}`, 'g'), value); +}); + +// Write the processed manifest +const outputManifestPath = path.join(buildDir, `manifest.${process.env.TEAMSFX_ENV || 'local'}.json`); +fs.writeFileSync(outputManifestPath, manifestString); + +// Create the zip file +const outputZipPath = path.join(buildDir, `appManifest.${process.env.TEAMSFX_ENV || 'local'}.zip`); +const output = fs.createWriteStream(outputZipPath); +const archive = archiver('zip', { zlib: { level: 9 } }); + +output.on('close', () => { + console.log(`App package created: ${outputZipPath} (${archive.pointer()} total bytes)`); +}); + +archive.on('error', (err) => { + throw err; +}); + +archive.pipe(output); + +// Add manifest file +archive.file(outputManifestPath, { name: 'manifest.json' }); + +// Add all PNG files from appManifest directory +const appManifestDir = path.join(__dirname, 'appManifest'); +const files = fs.readdirSync(appManifestDir); +files.forEach(file => { + if (file.endsWith('.png')) { + const filePath = path.join(appManifestDir, file); + archive.file(filePath, { name: file }); + console.log(`Added icon: ${file}`); + } +}); + +archive.finalize(); \ No newline at end of file diff --git a/samples/graph-activity-feed/nodejs/m365agents.local.yml b/samples/graph-activity-feed/nodejs/m365agents.local.yml index 3292a6ebcd..b193404ec0 100644 --- a/samples/graph-activity-feed/nodejs/m365agents.local.yml +++ b/samples/graph-activity-feed/nodejs/m365agents.local.yml @@ -59,13 +59,11 @@ provision: # Path to manifest template manifestPath: ./appManifest/manifest.json - # Build Teams app package with latest env value - - uses: teamsApp/zipAppPackage + # Build Teams app package manually to ensure all icons are included + - uses: cli/runNpmCommand with: - # Path to manifest template - manifestPath: ./appManifest/manifest.json - outputZipPath: ./appManifest/build/appManifest.${{TEAMSFX_ENV}}.zip - outputJsonPath: ./appManifest/build/manifest.${{TEAMSFX_ENV}}.json + workingDirectory: . + args: run build:app-package # Validate app package using validation rules - uses: teamsApp/validateAppPackage with: diff --git a/samples/graph-activity-feed/nodejs/package-lock.json b/samples/graph-activity-feed/nodejs/package-lock.json index a5fc2c6a84..7edc7c4f3e 100644 --- a/samples/graph-activity-feed/nodejs/package-lock.json +++ b/samples/graph-activity-feed/nodejs/package-lock.json @@ -12,6 +12,7 @@ "@azure/msal-node": "^1.14.3", "@microsoft/microsoft-graph-client": "^3.0.4", "@microsoft/teams-js": "^2.34.0", + "archiver": "^5.3.1", "axios": "^0.21.1", "body-parser": "^1.19.0", "dotenv": "^8.2.0", @@ -506,6 +507,75 @@ "node": ">= 8" } }, + "node_modules/archiver": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.2.tgz", + "integrity": "sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==", + "license": "MIT", + "dependencies": { + "archiver-utils": "^2.1.0", + "async": "^3.2.4", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^2.2.0", + "zip-stream": "^4.1.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/archiver-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", + "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "license": "MIT", + "dependencies": { + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/archiver-utils/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/archiver-utils/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/archiver-utils/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -613,6 +683,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", @@ -674,6 +755,39 @@ "node": ">=8" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -794,6 +908,21 @@ "node": ">= 0.8" } }, + "node_modules/compress-commons": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz", + "integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==", + "license": "MIT", + "dependencies": { + "buffer-crc32": "^0.2.13", + "crc32-stream": "^4.0.2", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -842,6 +971,31 @@ "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "license": "MIT" }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/crc32-stream": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.3.tgz", + "integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==", + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -971,6 +1125,15 @@ "node": ">= 0.8" } }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -1277,6 +1440,18 @@ "node": ">= 0.6" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1346,6 +1521,27 @@ "assert-plus": "^1.0.0" } }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -1370,6 +1566,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -1469,12 +1671,43 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "license": "ISC" }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1538,6 +1771,12 @@ "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "license": "MIT" }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -1644,6 +1883,66 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", + "license": "MIT" + }, + "node_modules/lodash.difference": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==", + "license": "MIT" + }, + "node_modules/lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==", + "license": "MIT" + }, "node_modules/lodash.includes": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", @@ -1686,6 +1985,12 @@ "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", "license": "MIT" }, + "node_modules/lodash.union": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", + "integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==", + "license": "MIT" + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -1911,6 +2216,15 @@ "node": ">= 0.8" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -1920,6 +2234,15 @@ "node": ">= 0.8" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-to-regexp": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", @@ -1944,6 +2267,12 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -2034,6 +2363,50 @@ "node": ">= 0.8" } }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdir-glob": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-1.1.3.tgz", + "integrity": "sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==", + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.1.0" + } + }, + "node_modules/readdir-glob/node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/readdir-glob/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -2337,6 +2710,15 @@ "node": ">= 0.8" } }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2349,6 +2731,22 @@ "node": ">=8" } }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -2459,6 +2857,12 @@ "punycode": "^2.1.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -2515,6 +2919,47 @@ "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/zip-stream": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.1.tgz", + "integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==", + "license": "MIT", + "dependencies": { + "archiver-utils": "^3.0.4", + "compress-commons": "^4.1.2", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/zip-stream/node_modules/archiver-utils": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-3.0.4.tgz", + "integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==", + "license": "MIT", + "dependencies": { + "glob": "^7.2.3", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } } } } diff --git a/samples/graph-activity-feed/nodejs/package.json b/samples/graph-activity-feed/nodejs/package.json index 98c5ae8789..43a99165ad 100644 --- a/samples/graph-activity-feed/nodejs/package.json +++ b/samples/graph-activity-feed/nodejs/package.json @@ -7,7 +7,8 @@ "dev": "nodemon --inspect=9239 --signal SIGINT ./server.js", "test": "echo \"Error: no test specified\" && exit 1", "start": "node server.js", - "build": "node build.js" + "build": "node build.js", + "build:app-package": "node build-app-package.js" }, "author": "", "license": "ISC", @@ -25,6 +26,7 @@ "nodemon": "^2.0.7", "q": "^1.5.1", "request": "^2.88.2", - "esbuild": "^0.18.1" + "esbuild": "^0.18.1", + "archiver": "^5.3.1" } } \ No newline at end of file diff --git a/samples/graph-activity-feed/nodejs/server.js b/samples/graph-activity-feed/nodejs/server.js index b56da45cb5..fddf0a69aa 100644 --- a/samples/graph-activity-feed/nodejs/server.js +++ b/samples/graph-activity-feed/nodejs/server.js @@ -244,7 +244,7 @@ app.post('/channelTabTeamNotification', (req, res) => { headers: { "accept": "application/json", "contentType": 'application/json', - "authorization": "bearer " + applicationToken + "authorization": "bearer " + req.body.accessToken } }) .then(res => { @@ -278,7 +278,7 @@ app.post('/channelTabTeamNotification', (req, res) => { headers: { "accept": "application/json", "contentType": 'application/json', - "authorization": "bearer " + applicationToken + "authorization": "bearer " + req.body.accessToken } }).then(response => { console.log(`statusCode: ${response.status}`) @@ -303,7 +303,7 @@ app.post('/customTopicTeamNotification', (req, res) => { headers: { "accept": "application/json", "contentType": 'application/json', - "authorization": "bearer " + delegatedToken + "authorization": "bearer " + req.body.accessToken } }) .then(res => { @@ -319,7 +319,7 @@ app.post('/customTopicTeamNotification', (req, res) => { }, "recipient": { "@odata.type": "microsoft.graph.aadUserNotificationRecipient", - "userId": req.body.userId + "userId": process.env.UserId }, "templateParameters": [ { @@ -333,7 +333,7 @@ app.post('/customTopicTeamNotification', (req, res) => { headers: { "accept": "application/json", "contentType": 'application/json', - "authorization": "bearer " + applicationToken + "authorization": "bearer " + req.body.accessToken } }).then(response => { console.log(`statusCode: ${response.status}`) @@ -360,7 +360,7 @@ app.post('/sendNotificationToUser', (req, res) => { "topic": { "source": "text", "value": "Loop thread", - "webUrl": "https://teams.microsoft.com/l/entity/" + process.env.ClientId + "webUrl": "https://teams.microsoft.com/l/entity/" + process.env.TeamsAppId }, "activityType": "approvalRequired", "previewText": {