eionet2-dashboard 1.4.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.
Files changed (111) hide show
  1. package/.fx/configs/azure.parameters.Prod_EEA.json +15 -0
  2. package/.fx/configs/azure.parameters.dev.json +15 -0
  3. package/.fx/configs/config.Prod_EEA.json +10 -0
  4. package/.fx/configs/config.dev.json +10 -0
  5. package/.fx/configs/projectSettings.json +83 -0
  6. package/.fx/states/state.Prod_EEA.json +47 -0
  7. package/.fx/states/state.dev.json +47 -0
  8. package/.vscode/launch.json +91 -0
  9. package/.vscode/settings.json +6 -0
  10. package/.vscode/tasks.json +63 -0
  11. package/CHANGELOG.md +140 -0
  12. package/Jenkinsfile +166 -0
  13. package/LICENSE.md +9 -0
  14. package/README.md +55 -0
  15. package/api/.funcignore +11 -0
  16. package/api/extensions.csproj +11 -0
  17. package/api/getGraphData/function.json +27 -0
  18. package/api/getGraphData/index.js +147 -0
  19. package/api/host.json +11 -0
  20. package/api/package-lock.json +1546 -0
  21. package/api/package.json +17 -0
  22. package/api/proxies.json +4 -0
  23. package/package.json +25 -0
  24. package/tabs/.env.teamsfx.Prod_EEA +11 -0
  25. package/tabs/.env.teamsfx.dev +11 -0
  26. package/tabs/.eslintrc.json +48 -0
  27. package/tabs/.prettierrc +7 -0
  28. package/tabs/.stylelintrc.json +6 -0
  29. package/tabs/babel.config.js +3 -0
  30. package/tabs/package-lock.json +15564 -0
  31. package/tabs/package.json +88 -0
  32. package/tabs/public/auth-end.html +76 -0
  33. package/tabs/public/auth-start.html +178 -0
  34. package/tabs/public/deploy.png +0 -0
  35. package/tabs/public/favicon.ico +0 -0
  36. package/tabs/public/hello.png +0 -0
  37. package/tabs/public/index.html +20 -0
  38. package/tabs/public/publish.png +0 -0
  39. package/tabs/src/components/App.jsx +36 -0
  40. package/tabs/src/components/CustomColumnResizeIcon.jsx +68 -0
  41. package/tabs/src/components/CustomDrawer.jsx +51 -0
  42. package/tabs/src/components/EventDialogTitle.jsx +29 -0
  43. package/tabs/src/components/HtmlBox.jsx +18 -0
  44. package/tabs/src/components/Privacy.jsx +17 -0
  45. package/tabs/src/components/ResizableGrid.jsx +44 -0
  46. package/tabs/src/components/Tab.jsx +477 -0
  47. package/tabs/src/components/Tab.scss +138 -0
  48. package/tabs/src/components/TabConfig.jsx +51 -0
  49. package/tabs/src/components/TabPanel.jsx +29 -0
  50. package/tabs/src/components/TermsOfUse.jsx +17 -0
  51. package/tabs/src/components/UnderConstruction.jsx +24 -0
  52. package/tabs/src/components/UserMenu.jsx +109 -0
  53. package/tabs/src/components/_variables.scss +10 -0
  54. package/tabs/src/components/activity/Activity.jsx +301 -0
  55. package/tabs/src/components/activity/ConsultationList.jsx +297 -0
  56. package/tabs/src/components/activity/EventList.jsx +463 -0
  57. package/tabs/src/components/activity/GroupsTags.jsx +26 -0
  58. package/tabs/src/components/activity/Reporting.jsx +13 -0
  59. package/tabs/src/components/activity/activity.scss +153 -0
  60. package/tabs/src/components/event_rating/EventRating.jsx +92 -0
  61. package/tabs/src/components/event_rating/EventRatingDialog.jsx +46 -0
  62. package/tabs/src/components/event_registration/Approval.jsx +80 -0
  63. package/tabs/src/components/event_registration/ApprovalDialog.jsx +30 -0
  64. package/tabs/src/components/event_registration/ApprovalList.jsx +62 -0
  65. package/tabs/src/components/event_registration/EventRegistration.jsx +214 -0
  66. package/tabs/src/components/lib/useData.js +33 -0
  67. package/tabs/src/components/lib/useGraph.js +39 -0
  68. package/tabs/src/components/lib/useTeamsFx.js +55 -0
  69. package/tabs/src/components/my_country/AtAGlance.jsx +151 -0
  70. package/tabs/src/components/my_country/CountryProgress.jsx +92 -0
  71. package/tabs/src/components/my_country/DataReporters.jsx +13 -0
  72. package/tabs/src/components/my_country/GroupView.jsx +54 -0
  73. package/tabs/src/components/my_country/GroupsBoard.jsx +52 -0
  74. package/tabs/src/components/my_country/IndicatorCard.jsx +60 -0
  75. package/tabs/src/components/my_country/ManagementBoard.jsx +109 -0
  76. package/tabs/src/components/my_country/MyCountry.jsx +186 -0
  77. package/tabs/src/components/my_country/ProgressGauge.jsx +125 -0
  78. package/tabs/src/components/my_country/ScientificCommittee.jsx +13 -0
  79. package/tabs/src/components/my_country/YearlyProgress.jsx +41 -0
  80. package/tabs/src/components/my_country/my_country.scss +81 -0
  81. package/tabs/src/components/publications/Publications.jsx +13 -0
  82. package/tabs/src/components/self_service/UserEdit.jsx +334 -0
  83. package/tabs/src/components/self_service/UserEdit.scss +107 -0
  84. package/tabs/src/data/apiProvider.js +153 -0
  85. package/tabs/src/data/constants.json +7 -0
  86. package/tabs/src/data/hooks/useConfiguration.js +18 -0
  87. package/tabs/src/data/icsHelper.js +38 -0
  88. package/tabs/src/data/messages.json +39 -0
  89. package/tabs/src/data/provider.js +199 -0
  90. package/tabs/src/data/selfServiceProvider.js +59 -0
  91. package/tabs/src/data/selfServiceSharepointProvider.js +68 -0
  92. package/tabs/src/data/sharepointProvider.js +729 -0
  93. package/tabs/src/data/validator.js +25 -0
  94. package/tabs/src/data/validator.test.js +9 -0
  95. package/tabs/src/index.css +16 -0
  96. package/tabs/src/index.jsx +6 -0
  97. package/tabs/src/static/images/teams-icon.svg +1 -0
  98. package/tabs/src/utils/uiHelper.js +6 -0
  99. package/templates/appPackage/aad.template.json +133 -0
  100. package/templates/appPackage/manifest.template.json +58 -0
  101. package/templates/appPackage/resources/color.png +0 -0
  102. package/templates/appPackage/resources/outline.png +0 -0
  103. package/templates/azure/config.bicep +27 -0
  104. package/templates/azure/main.bicep +20 -0
  105. package/templates/azure/provision/frontendHosting.bicep +23 -0
  106. package/templates/azure/provision/function.bicep +82 -0
  107. package/templates/azure/provision/identity.bicep +14 -0
  108. package/templates/azure/provision/simpleAuth.bicep +44 -0
  109. package/templates/azure/provision.bicep +58 -0
  110. package/templates/azure/teamsFx/function.bicep +76 -0
  111. package/templates/azure/teamsFx/simpleAuth.bicep +43 -0
package/Jenkinsfile ADDED
@@ -0,0 +1,166 @@
1
+ pipeline {
2
+ agent {
3
+ node { label "docker-host" }
4
+ }
5
+ environment {
6
+ GIT_NAME = "eionet2-dashboard"
7
+ SONARQUBE_TAGS = "eionet2"
8
+ PATH = "${tool 'NodeJS'}/bin:${tool 'SonarQubeScanner'}/bin:$PATH"
9
+ }
10
+ stages{
11
+
12
+
13
+ stage('Release') {
14
+ when {
15
+ allOf {
16
+ environment name: 'CHANGE_ID', value: ''
17
+ branch 'master'
18
+ }
19
+ }
20
+ steps {
21
+ withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
22
+ sh '''docker pull eeacms/gitflow'''
23
+ sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
24
+ }
25
+ }
26
+ }
27
+
28
+
29
+ stage("Installation for Testing") {
30
+ when {
31
+ allOf {
32
+ environment name: 'CHANGE_ID', value: ''
33
+ not { changelog '.*^Automated release [0-9\\.]+$' }
34
+ not { branch 'master' }
35
+ }
36
+ }
37
+ steps {
38
+ script{
39
+ checkout scm
40
+ tool 'NodeJS'
41
+ tool 'SonarQubeScanner'
42
+ sh "cd tabs; yarn install"
43
+ }
44
+ }
45
+ }
46
+
47
+ stage("Code Quality") {
48
+ when {
49
+ allOf {
50
+ environment name: 'CHANGE_ID', value: ''
51
+ not { changelog '.*^Automated release [0-9\\.]+$' }
52
+ not { branch 'master' }
53
+ }
54
+ }
55
+ steps {
56
+ sh "cd tabs; yarn run prettier"
57
+ sh "cd tabs; yarn run lint"
58
+ sh "cd tabs; yarn run stylelint"
59
+ }
60
+ }
61
+
62
+ stage("Unit tests") {
63
+ when {
64
+ allOf {
65
+ environment name: 'CHANGE_ID', value: ''
66
+ not { changelog '.*^Automated release [0-9\\.]+$' }
67
+ not { branch 'master' }
68
+ }
69
+ }
70
+ steps {
71
+ sh '''set -o pipefail;cd tabs; yarn test --watchAll=false --reporters=default --reporters=jest-junit --collectCoverage --coverageReporters lcov cobertura text 2>&1 | tee -a unit_tests_log.txt'''
72
+
73
+ }
74
+ post {
75
+ always {
76
+
77
+ catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
78
+ junit 'tabs/junit.xml'
79
+ publishHTML (target : [allowMissing: false,
80
+ alwaysLinkToLastBuild: true,
81
+ keepAll: true,
82
+ reportDir: 'tabs/coverage/lcov-report',
83
+ reportFiles: 'index.html',
84
+ reportName: 'UTCoverage',
85
+ reportTitles: 'Unit Tests Code Coverage'])
86
+
87
+
88
+ }
89
+ }
90
+ failure {
91
+ catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
92
+ archiveArtifacts artifacts: 'tabs/unit_tests_log.txt', fingerprint: true
93
+ }
94
+ }
95
+ }
96
+ }
97
+
98
+
99
+
100
+ stage('Report to SonarQube') {
101
+ when {
102
+ allOf {
103
+ environment name: 'CHANGE_ID', value: ''
104
+ anyOf {
105
+ branch 'master'
106
+ allOf {
107
+ branch 'develop'
108
+ not { changelog '.*^Automated release [0-9\\.]+$' }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ steps {
114
+ script{
115
+ withSonarQubeEnv('Sonarqube') {
116
+ sh "sonar-scanner -Dsonar.javascript.lcov.reportPaths=./tabs/coverage/lcov.info -Dsonar.sources=./tabs,./api -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
117
+ sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ stage('Pull Request') {
124
+ when {
125
+ not {
126
+ environment name: 'CHANGE_ID', value: ''
127
+ }
128
+ environment name: 'CHANGE_TARGET', value: 'master'
129
+ }
130
+ steps {
131
+ script {
132
+ if ( env.CHANGE_BRANCH != "develop" ) {
133
+ error "Pipeline aborted due to PR not made from develop branch"
134
+ }
135
+ withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
136
+ sh '''docker pull eeacms/gitflow'''
137
+ sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_TARGET="$CHANGE_TARGET" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e LANGUAGE=javascript eeacms/gitflow'''
138
+ }
139
+ }
140
+ }
141
+ }
142
+
143
+ }
144
+
145
+
146
+
147
+ post {
148
+ always {
149
+ cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
150
+ }
151
+ changed {
152
+ script {
153
+ def details = """<h1>${env.JOB_NAME} - Build #${env.BUILD_NUMBER} - ${currentBuild.currentResult}</h1>
154
+ <p>Check console output at <a href="${env.BUILD_URL}/display/redirect">${env.JOB_BASE_NAME} - #${env.BUILD_NUMBER}</a></p>
155
+ """
156
+ emailext(
157
+ subject: '$DEFAULT_SUBJECT',
158
+ body: details,
159
+ attachLog: true,
160
+ compressLog: true,
161
+ recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider']]
162
+ )
163
+ }
164
+ }
165
+ }
166
+ }
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 European Environment Agency
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # eionet2-dashboard
2
+
3
+ [![GitHub release](https://img.shields.io/github/v/release/eea/eionet2-dashboard)](https://github.com/eea/eionet2-dashboard/releases)
4
+
5
+ This (MS Teams) application implements dashboard type (view-at-a-glance) functionalities for Eionet 2.0.
6
+ Through this application, the user have access to information regarding:
7
+ - General Eionet activity (events, consultations, surveys, reports)
8
+ - Specific country information (management board, NFPs, ETCs, Eionet groups etc.) - Eionet in my country
9
+ - Publications
10
+
11
+ The application is available to all Eionet 2.0 users.
12
+ The data displayed is retrieved from the EEA Azure tenant and from an internal EEA SharePoint Online instance.
13
+
14
+ ### General Eionet activity
15
+
16
+ This tab is available for all users. In this tab, the users can find information about:
17
+ - Events.
18
+ - Consultations.
19
+ - The (Admin or NFP) user enters the user attributes (contact data, roles, organizations etc.).
20
+ - Inquiries.
21
+ - Reports.
22
+ The displayed information is a selected subtype of the full list, ordered by (expiration/closing) date. The full list can be accessed from the tab through a link, which will point the user to the corresponding repository folders.
23
+
24
+ ### Eionet in my country
25
+
26
+ In this country the users have access to statistical information regarding:
27
+ - Active and pending invitation users
28
+ - The management board
29
+ - The number of groups, organisations
30
+ - Information about NFPs, ETCs etc.
31
+ - Specific country information about events, consultations, surveys, reports
32
+
33
+ ## Publications
34
+
35
+ In this tab the users have access to information about Eionet publications.
36
+
37
+ ## Getting started
38
+
39
+ The application is available as a "tab" application in the MS Teams Eionet 2.0 teams.
40
+ When opening this tab, the users will see the Dashboard application, with two sets of tabs, corresponding to the functionalities presented above.
41
+
42
+ ## Release
43
+
44
+ See [RELEASE.md](https://github.com/eea/eionet2-dashboard/blob/master/RELEASE.md).
45
+
46
+ ## How to contribute
47
+
48
+ For now the contributions are not open outside the internal EEA project team.
49
+
50
+ ## Copyright and license
51
+
52
+ The Initial Owner of the Original Code is [European Environment Agency (EEA)](http://eea.europa.eu).
53
+ All Rights Reserved.
54
+
55
+ See [LICENSE.md](https://github.com/eea/eionet2-dashboard/blob/master/LICENSE.md) for details.
@@ -0,0 +1,11 @@
1
+ *.js.map
2
+ *.ts
3
+ .git*
4
+ .vscode
5
+ local.settings.json
6
+ test
7
+ tsconfig.json
8
+ .DS_Store
9
+ .deployment
10
+ node_modules/.bin
11
+ node_modules/azure-functions-core-tools
@@ -0,0 +1,11 @@
1
+ <Project Sdk="Microsoft.NET.Sdk">
2
+ <PropertyGroup>
3
+ <TargetFramework>netcoreapp3.1</TargetFramework>
4
+ <WarningsAsErrors></WarningsAsErrors>
5
+ <DefaultItemExcludes>**</DefaultItemExcludes>
6
+ </PropertyGroup>
7
+ <ItemGroup>
8
+ <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.TeamsFx" Version="0.1.*" />
9
+ <PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.1.3" />
10
+ </ItemGroup>
11
+ </Project>
@@ -0,0 +1,27 @@
1
+ {
2
+ "bindings": [
3
+ {
4
+ "authLevel": "anonymous",
5
+ "type": "httpTrigger",
6
+ "direction": "in",
7
+ "name": "req",
8
+ "methods": [
9
+ "get",
10
+ "patch",
11
+ "post",
12
+ "delete"
13
+ ],
14
+ "route": "graphData"
15
+ },
16
+ {
17
+ "type": "http",
18
+ "direction": "out",
19
+ "name": "$return"
20
+ },
21
+ {
22
+ "direction": "in",
23
+ "name": "teamsfxContext",
24
+ "type": "TeamsFx"
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,147 @@
1
+ require("isomorphic-fetch");
2
+ const teamsfx = require("@microsoft/teamsfx");
3
+
4
+ /**
5
+ * This function handles requests from teamsfx client.
6
+ * The HTTP request should contain an SSO token queried from Teams in the header.
7
+ * Before trigger this function, teamsfx binding would process the SSO token and generate teamsfx configuration.
8
+ *
9
+ * This function initializes the teamsfx SDK with the configuration and calls these APIs:
10
+ * - OnBehalfOfUserCredential() - Construct credential with the received SSO token and initialized configuration.
11
+ * - getUserInfo() - Get the user's information from the received SSO token.
12
+ * - createMicrosoftGraphClient() - Get a graph client to access user's Microsoft 365 data.
13
+ *
14
+ * The response contains multiple message blocks constructed into a JSON object, including:
15
+ * - An echo of the request body.
16
+ * - The display name encoded in the SSO token.
17
+ * - Current user's Microsoft 365 profile if the user has consented.
18
+ *
19
+ * @param {Context} context - The Azure Functions context object.
20
+ * @param {HttpRequest} req - The HTTP request.
21
+ * @param {teamsfxContext} { [key: string]: any; } - The context generated by teamsfx binding.
22
+ */
23
+ module.exports = async function (context, req, teamsfxContext) {
24
+ context.log("HTTP trigger function processed a request.");
25
+
26
+ // Initialize response.
27
+ const res = {
28
+ status: 200,
29
+ body: {},
30
+ };
31
+
32
+ // Put an echo into response body.
33
+ res.body.receivedHTTPRequestBody = req.body || "";
34
+
35
+
36
+ // Set default configuration for teamsfx SDK.
37
+ try {
38
+ teamsfx.loadConfiguration();
39
+ } catch (e) {
40
+ context.log.error(e);
41
+ return {
42
+ status: 500,
43
+ body: {
44
+ error: "Failed to load app configuration.",
45
+ },
46
+ };
47
+ }
48
+
49
+ // Prepare access token.
50
+ const accessToken = teamsfxContext["AccessToken"];
51
+ if (!accessToken) {
52
+ return {
53
+ status: 400,
54
+ body: {
55
+ error: "No access token was found in request header.",
56
+ },
57
+ };
58
+ }
59
+
60
+
61
+
62
+ // Construct credential.
63
+ let credential;
64
+ const method = req.method.toLowerCase();
65
+ const credentialType = method != "get" ? req.body && req.body.credentialType : req.query.credentialType;
66
+ const eTag = method == 'patch' ? req.body.eTag : undefined;
67
+ try {
68
+ if (!credentialType) {
69
+ return {
70
+ status: 500,
71
+ body: {
72
+ error: "Specify the type of credential in the body using field credentialType.",
73
+ },
74
+ };
75
+ }
76
+
77
+ switch (credentialType) {
78
+ case ("user"):
79
+ credential = new teamsfx.OnBehalfOfUserCredential(accessToken);
80
+ break;
81
+ case ("app"):
82
+ credential = new teamsfx.M365TenantCredential();
83
+ break;
84
+ }
85
+
86
+ } catch (e) {
87
+ context.log.error(e);
88
+ return {
89
+ status: 500,
90
+ body: {
91
+ error:
92
+ "Failed to obtain on-behalf-of credential using your accessToken. " +
93
+ "Ensure your function app is configured with the right Azure AD App registration.",
94
+ },
95
+ };
96
+ }
97
+
98
+ // Create a graph client to access user's Microsoft 365 data after user has consented.
99
+ try {
100
+ const graphClient = teamsfx.createMicrosoftGraphClient(credential);
101
+ graphClient.config.defaultVersion = 'beta';
102
+ let path = "";
103
+ let result = undefined;
104
+
105
+ let headers = {
106
+ 'Content-Type': 'application/json'
107
+ }
108
+
109
+ switch (method) {
110
+ case "get":
111
+ path = req.query.path;
112
+ result = await graphClient.api(path).get(req.query.path)
113
+ break;
114
+ case "put":
115
+ break;
116
+ case "patch":
117
+ path = req.body.path;
118
+ eTag && (headers['If-Match'] = eTag);
119
+ result = await graphClient.api(path)
120
+ .headers(headers)
121
+ .patch(req.body.data);
122
+ break;
123
+ case "post":
124
+ path = req.body.path;
125
+ result = await graphClient.api(path)
126
+ .headers(headers)
127
+ .post(req.body.data);
128
+ break;
129
+ case "delete":
130
+ path = req.body.path;
131
+ result = await graphClient.api(path)
132
+ .headers(headers)
133
+ .delete();
134
+ break;
135
+ }
136
+
137
+ res.body.graphClientMessage = result;
138
+
139
+ } catch (e) {
140
+ return {
141
+ status: e.statusCode,
142
+ body: e.body
143
+ };
144
+ }
145
+
146
+ return res;
147
+ };
package/api/host.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": "2.0",
3
+ "logging": {
4
+ "applicationInsights": {
5
+ "samplingSettings": {
6
+ "isEnabled": true,
7
+ "excludedTypes": "Request"
8
+ }
9
+ }
10
+ }
11
+ }