mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Merge pull request #11014 from ToolJet/release-sharepoint
Release: Marketplace - Sharepoint plugin ( v2.67.1 )
This commit is contained in:
commit
a00db3ec9d
18 changed files with 1091 additions and 6 deletions
2
.version
2
.version
|
|
@ -1 +1 @@
|
|||
2.67.1
|
||||
2.67.2
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.67.1
|
||||
2.67.2
|
||||
|
|
|
|||
|
|
@ -40,6 +40,14 @@ class AuthorizeComponent extends React.Component {
|
|||
localStorage.setItem('OAuthCode', code);
|
||||
this.setState({ isLoading: false, authSuccess: true });
|
||||
}
|
||||
|
||||
this.timer = setTimeout(() => {
|
||||
window.close();
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
clearTimeout(this.timer);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
@ -105,7 +113,14 @@ class AuthorizeComponent extends React.Component {
|
|||
Success
|
||||
</h4>
|
||||
<div>
|
||||
<div>Authorization successful, you can close this tab now.</div>
|
||||
<div>Authorization successful! You will be redirected in a few seconds.</div>
|
||||
<div>
|
||||
Don’t want to wait?{' '}
|
||||
<span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => window.close()}>
|
||||
Click here
|
||||
</span>{' '}
|
||||
to go now.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import { orgEnvironmentVariableService, orgEnvironmentConstantService } from '..
|
|||
import { find, isEmpty } from 'lodash';
|
||||
import { ButtonSolid } from './AppButton';
|
||||
import { Constants } from '@/_helpers/utils';
|
||||
import Sharepoint from '@/_components/Sharepoint';
|
||||
|
||||
const DynamicForm = ({
|
||||
schema,
|
||||
|
|
@ -160,6 +161,8 @@ const DynamicForm = ({
|
|||
return CondtionSort;
|
||||
case 'react-component-salesforce':
|
||||
return Salesforce;
|
||||
case 'react-component-sharepoint':
|
||||
return Sharepoint;
|
||||
default:
|
||||
return <div>Type is invalid</div>;
|
||||
}
|
||||
|
|
@ -304,6 +307,7 @@ const DynamicForm = ({
|
|||
case 'react-component-slack':
|
||||
case 'react-component-zendesk':
|
||||
case 'react-component-salesforce':
|
||||
case 'react-component-sharepoint':
|
||||
return {
|
||||
optionchanged,
|
||||
createDataSource,
|
||||
|
|
|
|||
146
frontend/src/_components/Sharepoint.jsx
Normal file
146
frontend/src/_components/Sharepoint.jsx
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
import React, { useState } from 'react';
|
||||
import { datasourceService } from '@/_services';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { toast } from 'react-hot-toast';
|
||||
import Button from '@/_ui/Button';
|
||||
import Input from '@/_ui/Input';
|
||||
import cx from 'classnames';
|
||||
|
||||
const Sharepoint = ({
|
||||
optionchanged,
|
||||
createDataSource,
|
||||
options,
|
||||
isSaving,
|
||||
selectedDataSource,
|
||||
currentAppEnvironmentId,
|
||||
workspaceConstants,
|
||||
isDisabled,
|
||||
}) => {
|
||||
const [authStatus, setAuthStatus] = useState(null);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const hostUrl = window.public_config?.TOOLJET_HOST;
|
||||
const subPathUrl = window.public_config?.SUB_PATH;
|
||||
const fullUrl = `${hostUrl}${subPathUrl ? subPathUrl : '/'}oauth2/authorize`;
|
||||
const redirectUri = fullUrl;
|
||||
|
||||
function authSharepoint() {
|
||||
const provider = 'sharepoint';
|
||||
const plugin_id = selectedDataSource?.plugin?.id;
|
||||
const source_options = options;
|
||||
setAuthStatus('waiting_for_url');
|
||||
|
||||
const scope = 'https://graph.microsoft.com/.default+offline_access';
|
||||
|
||||
datasourceService
|
||||
.fetchOauth2BaseUrl(provider, plugin_id, source_options)
|
||||
.then((data) => {
|
||||
const authUrl = `${data.url}&scope=${scope}&state=12345&response_mode=query`;
|
||||
localStorage.setItem('sourceWaitingForOAuth', 'newSource');
|
||||
localStorage.setItem('currentAppEnvironmentIdForOauth', currentAppEnvironmentId);
|
||||
optionchanged('provider', provider).then(() => {
|
||||
optionchanged('oauth2', true);
|
||||
optionchanged('plugin_id', plugin_id);
|
||||
});
|
||||
setAuthStatus('waiting_for_token');
|
||||
openUrl(authUrl);
|
||||
})
|
||||
.catch(({ error }) => {
|
||||
toast.error(error);
|
||||
setAuthStatus(null);
|
||||
});
|
||||
}
|
||||
|
||||
function saveDataSource() {
|
||||
optionchanged('code', localStorage.getItem('OAuthCode')).then(() => {
|
||||
createDataSource();
|
||||
});
|
||||
}
|
||||
|
||||
function openUrl(url) {
|
||||
const width = window.innerWidth * 0.4;
|
||||
const height = window.innerHeight * 0.8;
|
||||
const left = window.screenX + (window.innerWidth - width) / 2;
|
||||
const top = window.screenY + (window.innerHeight - height) / 2;
|
||||
const windowFeatures = `width=${width},height=${height},top=${top},left=${left},resizable=yes,scrollbars=yes`;
|
||||
const authWindow = window.open(url, '_blank', windowFeatures);
|
||||
if (authWindow) {
|
||||
authWindow.focus();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
<label className="form-label mt-3">Client ID (App ID)</label>
|
||||
<Input
|
||||
type="text"
|
||||
className="form-control"
|
||||
onChange={(e) => optionchanged('sp_client_id', e.target.value)}
|
||||
value={options?.sp_client_id?.value ?? ''}
|
||||
placeholder="Enter client ID"
|
||||
workspaceConstants={workspaceConstants}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="form-label mt-3">Client secret</label>
|
||||
<Input
|
||||
type="password"
|
||||
className="form-control dynamic-form-encrypted-field"
|
||||
onChange={(e) => optionchanged('sp_client_secret', e.target.value)}
|
||||
value={options?.sp_client_secret?.value || ''}
|
||||
placeholder="**************"
|
||||
workspaceConstants={workspaceConstants}
|
||||
encrypted={true}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="form-label mt-3">Tenant ID</label>
|
||||
<Input
|
||||
type="text"
|
||||
className="form-control"
|
||||
onChange={(e) => optionchanged('sp_tenant_id', e.target.value)}
|
||||
value={options?.sp_tenant_id?.value ?? ''}
|
||||
placeholder="Enter tenant ID"
|
||||
workspaceConstants={workspaceConstants}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label className="form-label mt-3">Redirect URI</label>
|
||||
<Input
|
||||
value={redirectUri}
|
||||
helpText="In Microsoft Entra admin center, use the URL above when prompted to enter an redirect URI"
|
||||
type="copyToClipboard"
|
||||
disabled="true"
|
||||
className="form-control"
|
||||
/>
|
||||
</div>
|
||||
<div className="row mt-3">
|
||||
<center>
|
||||
{authStatus === 'waiting_for_token' && (
|
||||
<div>
|
||||
<Button
|
||||
className={`m2 ${isSaving ? ' loading' : ''}`}
|
||||
disabled={isSaving || isDisabled}
|
||||
onClick={() => saveDataSource()}
|
||||
>
|
||||
{isSaving ? t('globals.saving', 'Saving...') : t('globals.saveDatasource', 'Save data source')}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(!authStatus || authStatus === 'waiting_for_url') && (
|
||||
<Button
|
||||
className={cx('m2', { 'btn-loading': authStatus === 'waiting_for_url' })}
|
||||
disabled={isSaving || isDisabled}
|
||||
onClick={() => authSharepoint()}
|
||||
>
|
||||
{t('globals.connect', 'Connect')} {t('sharepoint.toSharepoint', 'to Sharepoint')}
|
||||
</Button>
|
||||
)}
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Sharepoint;
|
||||
15
marketplace/package-lock.json
generated
15
marketplace/package-lock.json
generated
|
|
@ -5880,6 +5880,10 @@
|
|||
"resolved": "plugins/salesforce",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@tooljet-marketplace/sharepoint": {
|
||||
"resolved": "plugins/sharepoint",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@tooljet-marketplace/supabase": {
|
||||
"resolved": "plugins/supabase",
|
||||
"link": true
|
||||
|
|
@ -17323,6 +17327,17 @@
|
|||
"typescript": "^4.7.4"
|
||||
}
|
||||
},
|
||||
"plugins/sharepoint": {
|
||||
"name": "@tooljet-marketplace/sharepoint",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@tooljet-marketplace/common": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"typescript": "^4.7.4"
|
||||
}
|
||||
},
|
||||
"plugins/supabase": {
|
||||
"name": "@tooljet-marketplace/supabase",
|
||||
"version": "1.0.0",
|
||||
|
|
|
|||
5
marketplace/plugins/sharepoint/.gitignore
vendored
Normal file
5
marketplace/plugins/sharepoint/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
node_modules
|
||||
lib/*.d.*
|
||||
lib/*.js
|
||||
lib/*.js.map
|
||||
dist/*
|
||||
4
marketplace/plugins/sharepoint/README.md
Normal file
4
marketplace/plugins/sharepoint/README.md
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
# Sharepoint
|
||||
|
||||
Documentation on: https://docs.tooljet.com/docs/data-sources/sharepoint
|
||||
7
marketplace/plugins/sharepoint/__tests__/index.js
Normal file
7
marketplace/plugins/sharepoint/__tests__/index.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const sharepoint = require('../lib');
|
||||
|
||||
describe('sharepoint', () => {
|
||||
it.todo('needs tests');
|
||||
});
|
||||
23
marketplace/plugins/sharepoint/lib/icon.svg
Normal file
23
marketplace/plugins/sharepoint/lib/icon.svg
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_507_12450)">
|
||||
<path d="M12.2328 13.3955C15.3153 13.3955 17.8142 10.8966 17.8142 7.81406C17.8142 4.73154 15.3153 2.23267 12.2328 2.23267C9.15024 2.23267 6.65137 4.73154 6.65137 7.81406C6.65137 10.8966 9.15024 13.3955 12.2328 13.3955Z" fill="#036C70"/>
|
||||
<path d="M16.8839 18.0465C19.7095 18.0465 22.0001 15.7559 22.0001 12.9302C22.0001 10.1046 19.7095 7.81396 16.8839 7.81396C14.0582 7.81396 11.7676 10.1046 11.7676 12.9302C11.7676 15.7559 14.0582 18.0465 16.8839 18.0465Z" fill="#1A9BA1"/>
|
||||
<path d="M12.93 21.7676C15.1135 21.7676 16.8835 19.9975 16.8835 17.8141C16.8835 15.6306 15.1135 13.8606 12.93 13.8606C10.7466 13.8606 8.97656 15.6306 8.97656 17.8141C8.97656 19.9975 10.7466 21.7676 12.93 21.7676Z" fill="#37C6D0"/>
|
||||
<path opacity="0.1" d="M13.1628 7.26986V17.1954C13.1605 17.5403 12.9515 17.8502 12.6326 17.9815C12.5311 18.0244 12.4219 18.0466 12.3117 18.0466H8.98144C8.9768 17.9675 8.97679 17.8931 8.97679 17.814C8.97525 17.7364 8.97835 17.6588 8.9861 17.5815C9.07123 16.0947 9.98715 14.7829 11.3535 14.1908V13.3257C8.31257 12.8438 6.23802 9.98792 6.71991 6.94695C6.72326 6.92589 6.72671 6.90483 6.73029 6.88381C6.75344 6.72695 6.78607 6.57163 6.82797 6.4187H12.3117C12.781 6.42049 13.1611 6.80052 13.1628 7.26986Z" fill="black"/>
|
||||
<path opacity="0.2" d="M11.8467 6.88379H6.73038C6.21354 9.91929 8.25531 12.799 11.2908 13.3159C11.3827 13.3315 11.475 13.3449 11.5676 13.3559C10.1257 14.0396 9.07503 15.9815 8.98573 17.5815C8.97799 17.6587 8.97488 17.7364 8.97642 17.814C8.97642 17.8931 8.97642 17.9675 8.98107 18.0466C8.98946 18.2029 9.00968 18.3584 9.04153 18.5117H11.8462C12.1911 18.5094 12.5009 18.3004 12.6322 17.9815C12.6752 17.8799 12.6973 17.7708 12.6973 17.6605V7.73495C12.6956 7.26579 12.3158 6.88584 11.8467 6.88379Z" fill="black"/>
|
||||
<path opacity="0.2" d="M11.8466 6.88379H6.73034C6.21361 9.91957 8.25569 12.7994 11.2915 13.3162C11.3536 13.3267 11.4158 13.3363 11.4783 13.3447C10.0829 14.0777 9.07361 16.015 8.98616 17.5815H11.8466C12.3152 17.5779 12.6942 17.1989 12.6978 16.7303V7.73495C12.696 7.26561 12.316 6.88558 11.8466 6.88379Z" fill="black"/>
|
||||
<path opacity="0.2" d="M11.3814 6.88379H6.73019C6.24226 9.7496 8.03799 12.5094 10.8558 13.2243C9.78883 14.4433 9.13442 15.9683 8.98601 17.5815H11.3814C11.8507 17.5797 12.2307 17.1996 12.2325 16.7303V7.73495C12.2323 7.26498 11.8513 6.88405 11.3814 6.88379Z" fill="black"/>
|
||||
<path d="M2.85256 6.88379H11.38C11.8509 6.88379 12.2326 7.26549 12.2326 7.73635V16.2638C12.2326 16.7346 11.8509 17.1163 11.38 17.1163H2.85256C2.3817 17.1163 2 16.7346 2 16.2638V7.73635C2 7.26549 2.3817 6.88379 2.85256 6.88379Z" fill="url(#paint0_linear_507_12450)"/>
|
||||
<path d="M5.80776 11.8958C5.60797 11.7633 5.44108 11.5869 5.31985 11.38C5.20239 11.1638 5.14385 10.9204 5.15008 10.6744C5.13962 10.3413 5.25202 10.016 5.46589 9.76048C5.69064 9.5046 5.98113 9.31511 6.30589 9.21257C6.67602 9.09074 7.0637 9.03071 7.45333 9.0349C7.96573 9.01617 8.47741 9.08782 8.96496 9.24653V10.3163C8.75312 10.188 8.52238 10.0938 8.28124 10.0372C8.01958 9.97306 7.7511 9.94089 7.4817 9.94141C7.19761 9.93098 6.91534 9.99073 6.65984 10.1154C6.46259 10.2004 6.33467 10.3945 6.33426 10.6093C6.33346 10.7396 6.38352 10.8651 6.4738 10.9591C6.58043 11.0699 6.70656 11.1601 6.84589 11.2251C7.00093 11.3023 7.23349 11.405 7.54357 11.5331C7.57771 11.5438 7.61099 11.5572 7.6431 11.5731C7.94828 11.6923 8.24269 11.8375 8.5231 12.007C8.73546 12.1379 8.91368 12.3174 9.04311 12.5307C9.1758 12.7725 9.24011 13.0459 9.22915 13.3214C9.2443 13.6634 9.13968 13.9999 8.93334 14.2731C8.72767 14.5241 8.45269 14.7092 8.14264 14.8051C7.77795 14.9195 7.39733 14.9747 7.01519 14.9689C6.67234 14.9704 6.32999 14.9424 5.99194 14.8851C5.70651 14.8384 5.42796 14.7566 5.16264 14.6414V13.5135C5.41625 13.6946 5.69959 13.83 5.99985 13.9135C6.2991 14.0068 6.61017 14.0566 6.92357 14.0614C7.21363 14.0798 7.50318 14.0183 7.76078 13.8838C7.94123 13.7819 8.05098 13.589 8.04637 13.3819C8.04757 13.2377 7.99055 13.0992 7.88823 12.9977C7.76098 12.8728 7.61366 12.7701 7.45242 12.694C7.26638 12.601 6.99242 12.4783 6.63056 12.3261C6.34269 12.2103 6.06706 12.0662 5.80776 11.8958Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_507_12450" x1="3.7776" y1="6.21762" x2="10.455" y2="17.7825" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#058F92"/>
|
||||
<stop offset="0.5" stop-color="#038489"/>
|
||||
<stop offset="1" stop-color="#026D71"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_507_12450">
|
||||
<rect width="20" height="19.5349" fill="white" transform="translate(2 2.23267)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.5 KiB |
353
marketplace/plugins/sharepoint/lib/index.ts
Normal file
353
marketplace/plugins/sharepoint/lib/index.ts
Normal file
|
|
@ -0,0 +1,353 @@
|
|||
import { OAuthUnauthorizedClientError, QueryError, QueryResult, QueryService } from '@tooljet-marketplace/common';
|
||||
import { SourceOptions, QueryOptions } from './types';
|
||||
|
||||
export default class Sharepoint implements QueryService {
|
||||
authUrl(sourceOptions): string {
|
||||
const host = process.env.TOOLJET_HOST;
|
||||
const subpath = process.env.SUB_PATH;
|
||||
const fullUrl = `${host}${subpath ? subpath : '/'}`;
|
||||
const clientId = sourceOptions.sp_client_id;
|
||||
const clientSecret = sourceOptions.sp_client_secret.value;
|
||||
const tenant = sourceOptions.sp_tenant_id;
|
||||
|
||||
if (!clientId || !clientSecret || !tenant) {
|
||||
throw Error('You need to enter the client ID, client secret and tenant ID for authentication.');
|
||||
}
|
||||
|
||||
return (
|
||||
'https://login.microsoftonline.com/common/oauth2/v2.0/authorize' +
|
||||
`?client_id=${clientId.value}&response_type=code` +
|
||||
`&redirect_uri=${fullUrl}oauth2/authorize`
|
||||
);
|
||||
}
|
||||
|
||||
async accessDetailsFrom(authCode: string, sourceOptions: any, resetSecureData = false): Promise<object> {
|
||||
if (resetSecureData) {
|
||||
return [
|
||||
['access_token', ''],
|
||||
['refresh_token', ''],
|
||||
];
|
||||
}
|
||||
|
||||
let sp_client_id = '';
|
||||
let sp_client_secret = '';
|
||||
let tenant = '';
|
||||
|
||||
for (const item of sourceOptions) {
|
||||
if (item.key === 'sp_client_id') {
|
||||
sp_client_id = item.value;
|
||||
}
|
||||
if (item.key === 'sp_client_secret') {
|
||||
sp_client_secret = item.value;
|
||||
}
|
||||
if (item.key === 'sp_tenant_id') {
|
||||
tenant = item.value;
|
||||
}
|
||||
}
|
||||
|
||||
const accessTokenUrl = `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token`;
|
||||
const host = process.env.TOOLJET_HOST;
|
||||
const subpath = process.env.SUB_PATH;
|
||||
const fullUrl = `${host}${subpath ? subpath : '/'}`;
|
||||
const redirectUri = `${fullUrl}oauth2/authorize`;
|
||||
|
||||
const data = new URLSearchParams({
|
||||
code: authCode,
|
||||
client_id: sp_client_id,
|
||||
client_secret: sp_client_secret,
|
||||
grant_type: 'authorization_code',
|
||||
redirect_uri: redirectUri,
|
||||
scope: 'https://graph.microsoft.com/.default+offline_access',
|
||||
});
|
||||
|
||||
const authDetails = [];
|
||||
|
||||
try {
|
||||
const response = await fetch(accessTokenUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: data.toString(),
|
||||
});
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
if (!response.ok) {
|
||||
console.error(`Error occurred: `, result);
|
||||
throw new Error(result.error_description);
|
||||
}
|
||||
|
||||
if (result['access_token']) {
|
||||
authDetails.push(['access_token', result['access_token']]);
|
||||
}
|
||||
|
||||
if (result['refresh_token']) {
|
||||
authDetails.push(['refresh_token', result['refresh_token']]);
|
||||
}
|
||||
} catch (error) {
|
||||
throw Error(`Could not connect to Sharepoint:\n${error?.message}`);
|
||||
}
|
||||
|
||||
return authDetails;
|
||||
}
|
||||
|
||||
async run(sourceOptions: SourceOptions, queryOptions: QueryOptions, dataSourceId: string): Promise<QueryResult> {
|
||||
const rootApiUrl = 'https://graph.microsoft.com/v1.0/sites';
|
||||
const accessToken = sourceOptions.access_token;
|
||||
let response = null;
|
||||
let data = null;
|
||||
|
||||
try {
|
||||
const requestOptions = await this.fetchRequestOptsForOperation(accessToken, queryOptions);
|
||||
const endpoint = requestOptions?.endpoint;
|
||||
const apiUrl = `${rootApiUrl}${endpoint}`;
|
||||
const method = requestOptions?.method;
|
||||
const header = requestOptions?.headers;
|
||||
const body = requestOptions.body || {};
|
||||
|
||||
if (requestOptions?.paginationFeature && queryOptions.sp_page) {
|
||||
const regex = /^[1-9]\d*(\.\d+)?$/;
|
||||
if (regex.test(queryOptions.sp_page)) {
|
||||
const pageNo = parseInt(queryOptions.sp_page || '1');
|
||||
const paginatedResponse = await this.getPageData(apiUrl, pageNo, header);
|
||||
response = paginatedResponse.response;
|
||||
data = paginatedResponse.data;
|
||||
} else {
|
||||
throw new Error('Page field value should be a number >= 1.');
|
||||
}
|
||||
} else {
|
||||
response = await fetch(apiUrl, {
|
||||
method: method,
|
||||
headers: header,
|
||||
...(Object.keys(body).length !== 0 && { body: JSON.stringify(body) }),
|
||||
});
|
||||
|
||||
if (
|
||||
!response.ok &&
|
||||
response.status !== 401 &&
|
||||
response.status !== 403 &&
|
||||
response.status !== 204 &&
|
||||
response.status !== 201
|
||||
) {
|
||||
const data = await response.json();
|
||||
const errorMessage = data?.error?.message || 'An unknown error occurred';
|
||||
throw new QueryError('Query could not be completed', errorMessage, {
|
||||
statusCode: response.status,
|
||||
...data?.error,
|
||||
});
|
||||
}
|
||||
|
||||
if (response.status === 204) {
|
||||
return {
|
||||
status: 'ok',
|
||||
data: {
|
||||
code: response.status,
|
||||
status: response.statusText,
|
||||
message: `Item having id '${queryOptions.sp_item_id}' in List '${queryOptions.sp_list_id}' has been deleted.`,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
data = await response.json();
|
||||
}
|
||||
} catch (error) {
|
||||
const errorMessage = error?.message === 'Query could not be completed' ? error?.description : error?.message;
|
||||
throw new QueryError('Query could not be completed', errorMessage, error?.data || {});
|
||||
}
|
||||
|
||||
if (response.status === 401 || response.status === 403) {
|
||||
throw new OAuthUnauthorizedClientError('Unauthorized client error', response.statusText, data);
|
||||
}
|
||||
|
||||
return {
|
||||
status: 'ok',
|
||||
data: data,
|
||||
};
|
||||
}
|
||||
|
||||
async getPageData(apiUrl: string, pageNo: number, header: any): Promise<any> {
|
||||
let currentPage = 1;
|
||||
let nextApiUrl = apiUrl;
|
||||
let result = null;
|
||||
|
||||
while (currentPage <= pageNo) {
|
||||
const response = await fetch(nextApiUrl, {
|
||||
method: 'GET',
|
||||
headers: header,
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok && response.status !== 401 && response.status !== 403) {
|
||||
throw new QueryError('Query could not be completed', data?.error?.message || 'An unknown error occurred', {
|
||||
statusCode: response.status,
|
||||
...data?.error,
|
||||
});
|
||||
}
|
||||
|
||||
if (currentPage === pageNo) {
|
||||
result = { response: response, data: data };
|
||||
break;
|
||||
}
|
||||
|
||||
if (!data['@odata.nextLink']) {
|
||||
throw new Error('No more pages available.');
|
||||
}
|
||||
|
||||
nextApiUrl = data['@odata.nextLink'];
|
||||
currentPage++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async fetchRequestOptsForOperation(accessToken: string, queryOptions: QueryOptions): Promise<any> {
|
||||
const {
|
||||
sp_operation,
|
||||
sp_site_id,
|
||||
sp_time_interval,
|
||||
sp_list_id,
|
||||
sp_list_name,
|
||||
sp_item_id,
|
||||
sp_list_object,
|
||||
sp_item_object,
|
||||
sp_top,
|
||||
} = queryOptions;
|
||||
|
||||
const authHeader = {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
};
|
||||
|
||||
switch (sp_operation) {
|
||||
case 'get_sites':
|
||||
return {
|
||||
method: 'GET',
|
||||
endpoint: `?search=*${sp_top ? `&$top=${sp_top}` : ''}`,
|
||||
headers: { ...authHeader },
|
||||
paginationFeature: true,
|
||||
};
|
||||
case 'get_site':
|
||||
return {
|
||||
method: 'GET',
|
||||
endpoint: `/${sp_site_id}`,
|
||||
headers: { ...authHeader },
|
||||
};
|
||||
case 'get_analytics':
|
||||
return {
|
||||
method: 'GET',
|
||||
endpoint: `/${sp_site_id}/analytics/${sp_time_interval}`,
|
||||
headers: { ...authHeader },
|
||||
};
|
||||
case 'get_pages':
|
||||
return {
|
||||
method: 'GET',
|
||||
endpoint: `/${sp_site_id}/pages${sp_top ? `?&$top=${sp_top}` : ''}`,
|
||||
headers: { ...authHeader, 'Content-Type': 'application/json' },
|
||||
paginationFeature: true,
|
||||
};
|
||||
case 'get_lists':
|
||||
return {
|
||||
method: 'GET',
|
||||
endpoint: `/${sp_site_id}/lists`,
|
||||
headers: { ...authHeader },
|
||||
paginationFeature: true,
|
||||
};
|
||||
case 'get_metadata':
|
||||
return {
|
||||
method: 'GET',
|
||||
endpoint: `/${sp_site_id}/lists/${sp_list_id || sp_list_name}?expand=columns,items(expand=fields)`,
|
||||
headers: { ...authHeader },
|
||||
};
|
||||
case 'get_items':
|
||||
return {
|
||||
method: 'GET',
|
||||
endpoint: `/${sp_site_id}/lists/${sp_list_id}/items?$expand=fields${sp_top ? `&$top=${sp_top}` : ''}`,
|
||||
headers: { ...authHeader },
|
||||
paginationFeature: true,
|
||||
};
|
||||
case 'create_list':
|
||||
return {
|
||||
method: 'POST',
|
||||
endpoint: `/${sp_site_id}/lists`,
|
||||
headers: { ...authHeader, 'Content-Type': 'application/json' },
|
||||
body: JSON.parse(sp_list_object),
|
||||
};
|
||||
case 'add_item':
|
||||
return {
|
||||
method: 'POST',
|
||||
endpoint: `/${sp_site_id}/lists/${sp_list_id}/items`,
|
||||
headers: { ...authHeader, 'Content-Type': 'application/json' },
|
||||
body: JSON.parse(sp_item_object),
|
||||
};
|
||||
case 'update_item':
|
||||
return {
|
||||
method: 'PATCH',
|
||||
endpoint: `/${sp_site_id}/lists/${sp_list_id}/items/${sp_item_id}/fields`,
|
||||
headers: { ...authHeader, 'Content-Type': 'application/json' },
|
||||
body: JSON.parse(sp_item_object),
|
||||
};
|
||||
case 'delete_item':
|
||||
return {
|
||||
method: 'DELETE',
|
||||
endpoint: `/${sp_site_id}/lists/${sp_list_id}/items/${sp_item_id}`,
|
||||
headers: { ...authHeader },
|
||||
};
|
||||
default:
|
||||
return { method: '', endpoint: '', headers: {}, body: {} };
|
||||
}
|
||||
}
|
||||
|
||||
async refreshToken(sourceOptions) {
|
||||
if (!sourceOptions['refresh_token']) {
|
||||
throw new QueryError('Query could not be completed', 'Refresh token empty', {});
|
||||
}
|
||||
|
||||
const tenant = sourceOptions.sp_tenant_id;
|
||||
const accessTokenUrl = `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token`;
|
||||
const clientId = sourceOptions.sp_client_id;
|
||||
const clientSecret = sourceOptions.sp_client_secret;
|
||||
|
||||
const data = new URLSearchParams({
|
||||
client_id: clientId,
|
||||
client_secret: clientSecret,
|
||||
grant_type: 'refresh_token',
|
||||
refresh_token: sourceOptions['refresh_token'],
|
||||
scope: 'https://graph.microsoft.com/.default',
|
||||
});
|
||||
|
||||
const accessTokenDetails = {};
|
||||
|
||||
try {
|
||||
const response = await fetch(accessTokenUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body: data.toString(),
|
||||
});
|
||||
const result = await response.json();
|
||||
|
||||
if (result['access_token']) {
|
||||
accessTokenDetails['access_token'] = result['access_token'];
|
||||
accessTokenDetails['refresh_token'] = result['refresh_token'];
|
||||
} else {
|
||||
throw new QueryError(
|
||||
'access_token not found in the response',
|
||||
{},
|
||||
{
|
||||
responseObject: {
|
||||
statusCode: response.status,
|
||||
responseBody: result,
|
||||
},
|
||||
responseHeaders: response.headers,
|
||||
}
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error while Sharepoint refresh token call. ${JSON.stringify(error)}`);
|
||||
throw new QueryError('could not connect to Sharepoint', JSON.stringify(error), {});
|
||||
}
|
||||
return accessTokenDetails;
|
||||
}
|
||||
}
|
||||
56
marketplace/plugins/sharepoint/lib/manifest.json
Normal file
56
marketplace/plugins/sharepoint/lib/manifest.json
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/ToolJet/ToolJet/develop/plugins/schemas/manifest.schema.json",
|
||||
"title": "Sharepoint datasource",
|
||||
"description": "A schema defining Sharepoint datasource",
|
||||
"type": "api",
|
||||
"source": {
|
||||
"name": "Sharepoint",
|
||||
"kind": "sharepoint",
|
||||
"exposedVariables": {
|
||||
"isLoading": false,
|
||||
"data": {},
|
||||
"rawData": {}
|
||||
},
|
||||
"options": {
|
||||
"sp_client_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"sp_client_secret": {
|
||||
"type": "string",
|
||||
"encrypted": true
|
||||
},
|
||||
"sp_tenant_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"redirect_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"provider": {
|
||||
"type": "string"
|
||||
},
|
||||
"oauth2": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"plugin_id": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"customTesting": true,
|
||||
"hideSave": true
|
||||
},
|
||||
"defaults": {
|
||||
"redirect_url":{
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"sharepoint": {
|
||||
"label": "",
|
||||
"key": "sharepoint",
|
||||
"type": "react-component-sharepoint",
|
||||
"description": "A component for sharepoint"
|
||||
}
|
||||
},
|
||||
"required": []
|
||||
}
|
||||
377
marketplace/plugins/sharepoint/lib/operations.json
Normal file
377
marketplace/plugins/sharepoint/lib/operations.json
Normal file
|
|
@ -0,0 +1,377 @@
|
|||
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/ToolJet/ToolJet/develop/plugins/schemas/operations.schema.json",
|
||||
"title": "Sharepoint datasource",
|
||||
"description": "A schema defining Sharepoint datasource",
|
||||
"type": "api",
|
||||
"defaults": {},
|
||||
"properties": {
|
||||
"operation": {
|
||||
"label": "Operation",
|
||||
"key": "sp_operation",
|
||||
"type": "dropdown-component-flip",
|
||||
"description": "Select operation",
|
||||
"list": [
|
||||
{
|
||||
"name": "Get all sites",
|
||||
"value": "get_sites"
|
||||
},
|
||||
{
|
||||
"name": "Get site",
|
||||
"value": "get_site"
|
||||
},
|
||||
{
|
||||
"name": "Get analytics",
|
||||
"value": "get_analytics"
|
||||
},
|
||||
{
|
||||
"name": "Get pages of a site",
|
||||
"value": "get_pages"
|
||||
},
|
||||
{
|
||||
"name": "Get all lists",
|
||||
"value": "get_lists"
|
||||
},
|
||||
{
|
||||
"name": "Get metadata of a list",
|
||||
"value": "get_metadata"
|
||||
},
|
||||
{
|
||||
"name": "Create a list",
|
||||
"value": "create_list"
|
||||
},
|
||||
{
|
||||
"name": "Get items of a list",
|
||||
"value": "get_items"
|
||||
},
|
||||
{
|
||||
"name": "Update item of a list",
|
||||
"value": "update_item"
|
||||
},
|
||||
{
|
||||
"name": "Delete item of a list",
|
||||
"value": "delete_item"
|
||||
},
|
||||
{
|
||||
"name": "Add item to a list",
|
||||
"value": "add_item"
|
||||
}
|
||||
]
|
||||
},
|
||||
"get_sites": {
|
||||
"top": {
|
||||
"label": "Top",
|
||||
"key": "sp_top",
|
||||
"description": "Enter the number of items a response page should contain",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter the number of items a response page should contain",
|
||||
"height": "36px"
|
||||
},
|
||||
"page": {
|
||||
"label": "Page",
|
||||
"key": "sp_page",
|
||||
"description": "Enter the page number",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter the page number",
|
||||
"height": "36px"
|
||||
}
|
||||
},
|
||||
"get_site": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
}
|
||||
},
|
||||
"get_analytics": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"time_interval": {
|
||||
"label": "Time interval",
|
||||
"key": "sp_time_interval",
|
||||
"description": "Select time interval",
|
||||
"type": "dropdown",
|
||||
"list": [
|
||||
{
|
||||
"name": "Last 7 days",
|
||||
"value": "lastSevenDays"
|
||||
},
|
||||
{
|
||||
"name": "All time",
|
||||
"value": "allTime"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"get_pages": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"top": {
|
||||
"label": "Top",
|
||||
"key": "sp_top",
|
||||
"description": "Enter the number of items a response page should contain",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter the number of items a response page should contain",
|
||||
"height": "36px"
|
||||
},
|
||||
"page": {
|
||||
"label": "Page",
|
||||
"key": "sp_page",
|
||||
"description": "Enter the page number",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter the page number",
|
||||
"height": "36px"
|
||||
}
|
||||
},
|
||||
"get_lists": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"page": {
|
||||
"label": "Page",
|
||||
"key": "sp_page",
|
||||
"description": "Enter the page number",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter the page number",
|
||||
"height": "36px"
|
||||
}
|
||||
},
|
||||
"get_metadata": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"list_name": {
|
||||
"label": "List Name",
|
||||
"key": "sp_list_name",
|
||||
"description": "Enter list name",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter list name",
|
||||
"height": "36px"
|
||||
},
|
||||
"list_id": {
|
||||
"label": "List id",
|
||||
"key": "sp_list_id",
|
||||
"description": "Enter list id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter list id",
|
||||
"height": "36px"
|
||||
}
|
||||
},
|
||||
"create_list": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"list_object": {
|
||||
"label": "Body",
|
||||
"key": "sp_list_object",
|
||||
"type": "codehinter",
|
||||
"mode": "javascript",
|
||||
"placeholder": "{\n \"displayName\": \"Books\",\n \"columns\": [\n {\n \"name\": \"Author\",\n \"text\": { }\n },\n {\n \"name\": \"PageCount\",\n \"number\": { }\n }\n ],\n \"list\": {\n \"template\": \"genericList\"\n }\n}",
|
||||
"description": "Enter list object",
|
||||
"height": "200px"
|
||||
}
|
||||
},
|
||||
"get_items": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"list_id": {
|
||||
"label": "List id",
|
||||
"key": "sp_list_id",
|
||||
"description": "Enter list id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter list id",
|
||||
"height": "36px"
|
||||
},
|
||||
"top": {
|
||||
"label": "Top",
|
||||
"key": "sp_top",
|
||||
"description": "Enter the number of items a response page should contain",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter the number of items a response page should contain",
|
||||
"height": "36px"
|
||||
},
|
||||
"page": {
|
||||
"label": "Page",
|
||||
"key": "sp_page",
|
||||
"description": "Enter the page number",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter the page number",
|
||||
"height": "36px"
|
||||
}
|
||||
},
|
||||
"update_item": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"list_id": {
|
||||
"label": "List id",
|
||||
"key": "sp_list_id",
|
||||
"description": "Enter list id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter list id",
|
||||
"height": "36px"
|
||||
},
|
||||
"item_id": {
|
||||
"label": "Item id",
|
||||
"key": "sp_item_id",
|
||||
"description": "Enter item id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter item id",
|
||||
"height": "36px"
|
||||
},
|
||||
"item_object": {
|
||||
"label": "Body",
|
||||
"key": "sp_item_object",
|
||||
"type": "codehinter",
|
||||
"mode": "javascript",
|
||||
"placeholder": "{\n \"Color\": \"Fuchsia\",\n \"Quantity\": 934\n}",
|
||||
"description": "Enter item object",
|
||||
"height": "200px"
|
||||
}
|
||||
},
|
||||
"delete_item": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"list_id": {
|
||||
"label": "List id",
|
||||
"key": "sp_list_id",
|
||||
"description": "Enter list id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter list id",
|
||||
"height": "36px"
|
||||
},
|
||||
"item_id": {
|
||||
"label": "Item id",
|
||||
"key": "sp_item_id",
|
||||
"description": "Enter item id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter item id",
|
||||
"height": "36px"
|
||||
}
|
||||
},
|
||||
"add_item": {
|
||||
"site_id": {
|
||||
"label": "Site id",
|
||||
"key": "sp_site_id",
|
||||
"description": "Enter site id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter site id",
|
||||
"height": "36px"
|
||||
},
|
||||
"list_id": {
|
||||
"label": "List id",
|
||||
"key": "sp_list_id",
|
||||
"description": "Enter list id",
|
||||
"type": "codehinter",
|
||||
"lineNumbers": false,
|
||||
"className": "codehinter-plugins",
|
||||
"placeholder": "Enter list id",
|
||||
"height": "36px"
|
||||
},
|
||||
"item_object": {
|
||||
"label": "Body",
|
||||
"key": "sp_item_object",
|
||||
"type": "codehinter",
|
||||
"mode": "javascript",
|
||||
"placeholder": "{\n \"fields\": {\n \"Title\": \"Widget\",\n \"Color\": \"Purple\",\n \"Weight\": 32\n }\n}",
|
||||
"description": "Enter item object",
|
||||
"height": "200px"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
marketplace/plugins/sharepoint/lib/types.ts
Normal file
19
marketplace/plugins/sharepoint/lib/types.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
export type SourceOptions = {
|
||||
sp_client_id: string;
|
||||
sp_client_secret: string;
|
||||
sp_tenant_id: string;
|
||||
access_token: string;
|
||||
};
|
||||
export type QueryOptions = {
|
||||
operation: string;
|
||||
sp_operation: string;
|
||||
sp_site_id: string;
|
||||
sp_time_interval: string;
|
||||
sp_list_name: string;
|
||||
sp_list_id: string;
|
||||
sp_list_object: string;
|
||||
sp_item_id: string;
|
||||
sp_item_object: string;
|
||||
sp_top: string;
|
||||
sp_page: string;
|
||||
};
|
||||
26
marketplace/plugins/sharepoint/package.json
Normal file
26
marketplace/plugins/sharepoint/package.json
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "@tooljet-marketplace/sharepoint",
|
||||
"version": "1.0.0",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||
"build": "ncc build lib/index.ts -o dist",
|
||||
"watch": "ncc build lib/index.ts -o dist --watch"
|
||||
},
|
||||
"homepage": "https://github.com/tooljet/tooljet#readme",
|
||||
"dependencies": {
|
||||
"@tooljet-marketplace/common": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^4.7.4",
|
||||
"@vercel/ncc": "^0.34.0"
|
||||
}
|
||||
}
|
||||
11
marketplace/plugins/sharepoint/tsconfig.json
Normal file
11
marketplace/plugins/sharepoint/tsconfig.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": "lib"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
2.67.1
|
||||
2.67.2
|
||||
|
|
|
|||
|
|
@ -87,5 +87,29 @@
|
|||
"id": "salesforce",
|
||||
"author": "Tooljet",
|
||||
"timestamp": "Wed, 06 Mar 2024 11:34:26 GMT"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Presto",
|
||||
"description": "Plugin for PrestoDB data source",
|
||||
"version": "1.0.0",
|
||||
"id": "presto",
|
||||
"author": "Tooljet",
|
||||
"timestamp": "Thu, 08 Aug 2024 11:04:36 GMT"
|
||||
},
|
||||
{
|
||||
"name": "Sharepoint",
|
||||
"description": "Plugin for Sharepoint API",
|
||||
"version": "1.0.0",
|
||||
"id": "sharepoint",
|
||||
"author": "Tooljet",
|
||||
"timestamp": "Wed, 04 Sep 2024 20:18:30 GMT"
|
||||
},
|
||||
{
|
||||
"name": "Jira",
|
||||
"description": "Plugin for Jira data source",
|
||||
"version": "1.0.0",
|
||||
"id": "jira",
|
||||
"author": "Tooljet",
|
||||
"timestamp": "Thu, 08 Aug 2024 11:04:36 GMT"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue