Skip to content

Commit 4316453

Browse files
authored
Initial commit
0 parents  commit 4316453

File tree

459 files changed

+165098
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

459 files changed

+165098
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'status: investigate'
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Screenshots**
20+
If applicable, add screenshots to help explain your problem.
21+
22+
**Details**
23+
Please provide details around your solution, what you are trying to achieve with our shared controls, and where you believe the bug exists. The more details you can share the easier it is for us to investigate the issue. Thanks!
24+
25+
**Additional context**
26+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: SharePoint Framework Issues
4+
url: https://aka.ms/spfx-issues
5+
about: For SharePoint Framework related questions please report issues here
6+
- name: Microsoft Graph Docs
7+
url: https://developer.microsoft.com/graph
8+
about: For more information on working with Micrsoft Graph, please review the public documentation before asking general questions
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'status: investigate'
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This workflow will build and push a node.js application to an Azure Web App when a release is created.
2+
#
3+
# This workflow assumes you have already created the target Azure App Service web app.
4+
# For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan
5+
#
6+
# To configure this workflow:
7+
#
8+
# 1. For Linux apps, add an app setting called WEBSITE_WEBDEPLOY_USE_SCM and set it to true in your app **before downloading the file**.
9+
# For more instructions see: https://docs.microsoft.com/azure/app-service/configure-common#configure-app-settings
10+
#
11+
# 2. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile.
12+
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret
13+
#
14+
# 3. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below).
15+
#
16+
# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions
17+
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples
18+
on:
19+
workflow_dispatch:
20+
21+
env:
22+
AZURE_WEBAPP_NAME: filehandlerdemo # set this to your application's name
23+
AZURE_WEBAPP_PACKAGE_PATH: './filehandler' # set this to the path to your web app project, defaults to the repository root
24+
NODE_VERSION: '14.15.1' # set this to the node version to use
25+
ENV_FILE_NAME: ".env.local"
26+
NODE_ENV: "production"
27+
28+
jobs:
29+
build-and-deploy:
30+
name: Build and Deploy
31+
runs-on: ubuntu-latest
32+
environment: production
33+
defaults:
34+
run:
35+
working-directory: samples/file-handler
36+
steps:
37+
- uses: azure/login@v1
38+
with:
39+
creds: ${{ secrets.AZURE_CREDENTIALS }}
40+
- uses: actions/checkout@v2
41+
- name: Use Node.js ${{ env.NODE_VERSION }}
42+
uses: actions/setup-node@v1
43+
with:
44+
node-version: ${{ env.NODE_VERSION }}
45+
- name: Create ${{ env.ENV_FILE_NAME }} file
46+
run: |
47+
touch ${{ env.ENV_FILE_NAME }}
48+
echo IRON_SESSION_PASSWORD='${{ secrets.IRON_SESSION_PASSWORD }}' >> ${{ env.ENV_FILE_NAME }}
49+
echo NODE_ENV='production' >> ${{ env.ENV_FILE_NAME }}
50+
echo AAD_MSAL_AUTH_TENANT_ID='${{ secrets.AAD_MSAL_AUTH_TENANT_ID }}' >> ${{ env.ENV_FILE_NAME }}
51+
echo AAD_MSAL_AUTH_ID='${{ secrets.AAD_MSAL_AUTH_ID }}' >> ${{ env.ENV_FILE_NAME }}
52+
echo AAD_MSAL_AUTH_SECRET='${{ secrets.AAD_MSAL_AUTH_SECRET }}' >> ${{ env.ENV_FILE_NAME }}
53+
echo FILEHANDLER_SITE_HOST_URL='${{ secrets.FILEHANDLER_SITE_HOST_URL }}' >> ${{ env.ENV_FILE_NAME }}
54+
cat ${{ env.ENV_FILE_NAME }}
55+
- name: npm install, build, remove node_modules
56+
run: |
57+
npm install --production=false
58+
npm run build
59+
find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +
60+
npm install
61+
- name: 'Deploy to Azure WebApp'
62+
uses: azure/webapps-deploy@v2
63+
with:
64+
app-name: ${{ env.AZURE_WEBAPP_NAME }}
65+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
66+
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
67+
- name: 'debug: list dir'
68+
if: always()
69+
run: |
70+
# Build and test the project, then
71+
# deploy to Azure Web App.
72+
find .

.gitignore

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Microbundle cache
57+
.rpt2_cache/
58+
.rts2_cache_cjs/
59+
.rts2_cache_es/
60+
.rts2_cache_umd/
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
78+
# Next.js build output
79+
.next
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
85+
# Gatsby files
86+
.cache/
87+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88+
# https://nextjs.org/blog/next-9-1#public-directory-support
89+
# public
90+
91+
# vuepress build output
92+
.vuepress/dist
93+
94+
# Serverless directories
95+
.serverless/
96+
97+
# FuseBox cache
98+
.fusebox/
99+
100+
# DynamoDB Local files
101+
.dynamodb/
102+
103+
# TernJS port file
104+
.tern-port

CODE_OF_CONDUCT.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [[email protected]](mailto:[email protected]) with questions or concerns

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

README.md

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# OneDrive : Samples and Scenarios
2+
3+
This repository contains Microsoft authored sample code to help you integrate with OneDrive and SharePoint files, drives, and drive items.
4+
5+
> You can browse Microsoft and community created samples across many repositories through the [unified sample gallery](https://adoption.microsoft.com/sample-solution-gallery).
6+
7+
## Samples
8+
9+
Samples demonstrate specific integration techniques to connect with OneDrive or SharePoint. Please see the readme files for each sample for full details.
10+
11+
|Name|Description|
12+
|---|---|
13+
|[file-handler](https://aka.ms/onedrive/samples/file-handler)|Shows how to build a OneDrive/SharePoint file handler. This allows you to provide custom open, edit, and create actions for various file types.|
14+
|[file-picker](https://aka.ms/onedrive/samples/file-picking)|demonstrating how to use the latest service provided file picker for M365 allowing your users to easily and consistently open files stored within OneDrive and SharePoint.|
15+
16+
## Scenarios
17+
18+
|Name|Description|
19+
|---|---|
20+
|[list-view-service-integration](https://github.com/OneDrive/samples/tree/master/scenarios/list-view-service-integration)|Demonstration of securely calling a remote AAD secured service from an SPFx list view command. Includes full setup instructions.|
21+
|[onedrive-files-hooks](https://aka.ms/OneDrive/samples/files-hooks)|This sample application shows how an application (desktop application) can connect with either OneDrive for Business (ODB) or the OneDrive consumer (ODC) service.|
22+
|[throttling-ratelimit-handling](scenarios/throttling-ratelimit-handling/) | Sample showing how to use the RateLimit response headers to avoid getting throttled. |
23+
24+
## Helpful Links
25+
26+
These topics and links are often helpful when building applications accessing files stored in OneDrive or SharePoint.
27+
28+
<details>
29+
<summary>Getting Started</summary>
30+
31+
### M365 Development
32+
33+
- [Microsoft 365 Development](https://developer.microsoft.com)
34+
- [Microsoft Partner Network](https://partner.microsoft.com)
35+
- [App Source](https://appsource.microsoft.com)
36+
37+
### SharePoint
38+
39+
- [Overview](https://www.microsoft.com/microsoft-365/sharepoint/collaboration/)
40+
- [SharePoint Development](https://developer.microsoft.com/sharepoint)
41+
- [SharePoint Framework](https://aka.ms/spfx)
42+
43+
### Teams
44+
45+
- [Overview](https://www.microsoft.com/microsoft-teams/group-chat-software)
46+
- [Teams development](https://developer.microsoft.com/microsoft-teams)
47+
48+
</details>
49+
50+
<details>
51+
<summary>Viva Connections Development</summary>
52+
53+
- [Overview](https://docs.microsoft.com/SharePoint/viva-connections)
54+
- [Setup Home Site](https://docs.microsoft.com/sharepoint/home-site)
55+
56+
</details>
57+
58+
<details>
59+
<summary>SharePoint Development</summary>
60+
61+
- [SharePoint Framework](https://aka.ms/spfx)
62+
- [Publish SPFx Apps to AppSource](https://docs.microsoft.com/sharepoint/dev/spfx/publish-to-marketplace-overview)
63+
- [Site Collection App Catalog](https://docs.microsoft.com/sharepoint/dev/general-development/site-collection-app-catalog)
64+
65+
</details>
66+
67+
<details>
68+
<summary>Microsoft Teams Development</summary>
69+
70+
- [Building a Teams tab with SharePoint Framework](https://docs.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/using-web-part-as-ms-teams-tab)
71+
- [Update Teams Manifest for SharePoint]()
72+
</details>
73+
74+
<details>
75+
<summary>One Drive & Graph Files</summary>
76+
77+
- [Microsoft Graph Overview](https://docs.microsoft.com/graph/use-the-api)
78+
- [Drives](https://docs.microsoft.com/graph/api/resources/drive?view=graph-rest-1.0)
79+
- [Drive Items](https://docs.microsoft.com/graph/api/resources/driveitem?view=graph-rest-1.0)
80+
- [Sharing URL Trick](https://docs.microsoft.com/graph/api/shares-get?view=graph-rest-1.0&tabs=http#encoding-sharing-urls)
81+
82+
</details>
83+
84+
<details>
85+
<summary>File Handlers</summary>
86+
87+
- [Overview](https://docs.microsoft.com/onedrive/developer/file-handlers)
88+
- [Clearing Cached Manifets](https://docs.microsoft.com/onedrive/developer/file-handlers/reset-cache)
89+
- [Sample](https://github.com/pnp/contoso/tree/main/filehandler)
90+
91+
</details>
92+
93+
</details>
94+
95+
<details>
96+
<summary>Authentication</summary>
97+
98+
- [AAD: On Behalf of Authentication](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow)
99+
100+
</details>
101+
102+
## Trademarks
103+
104+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
105+
trademarks or logos is subject to and must follow
106+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general).
107+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
108+
Any use of third-party trademarks or logos are subject to those third-party's policies.

0 commit comments

Comments
 (0)