fix: consolidate version information into constants
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { VERSIONS } from '../constants';
|
||||||
import styles from './Clients.module.css';
|
import styles from './Clients.module.css';
|
||||||
|
|
||||||
export default function Clients({
|
export default function Clients({
|
||||||
@@ -7,76 +8,7 @@ export default function Clients({
|
|||||||
}: {
|
}: {
|
||||||
version: string;
|
version: string;
|
||||||
}) {
|
}) {
|
||||||
const csharpSvg = `
|
const clients = VERSIONS[version].clients;
|
||||||
<svg width="30" height="30" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 456 456" fill="none">
|
|
||||||
<rect width="456" height="456" fill="#512BD4"/>
|
|
||||||
<path d="M81.2738 291.333C78.0496 291.333 75.309 290.259 73.052 288.11C70.795 285.906 69.6665 283.289 69.6665 280.259C69.6665 277.173 70.795 274.529 73.052 272.325C75.309 270.121 78.0496 269.019 81.2738 269.019C84.5518 269.019 87.3193 270.121 89.5763 272.325C91.887 274.529 93.0424 277.173 93.0424 280.259C93.0424 283.289 91.887 285.906 89.5763 288.11C87.3193 290.259 84.5518 291.333 81.2738 291.333Z" fill="white"/>
|
|
||||||
<path d="M210.167 289.515H189.209L133.994 202.406C132.597 200.202 131.441 197.915 130.528 195.546H130.044C130.474 198.081 130.689 203.508 130.689 211.827V289.515H112.149V171H134.477L187.839 256.043C190.096 259.57 191.547 261.994 192.192 263.316H192.514C191.977 260.176 191.708 254.859 191.708 247.365V171H210.167V289.515Z" fill="white"/>
|
|
||||||
<path d="M300.449 289.515H235.561V171H297.87V187.695H254.746V221.249H294.485V237.861H254.746V272.903H300.449V289.515Z" fill="white"/>
|
|
||||||
<path d="M392.667 187.695H359.457V289.515H340.272V187.695H307.143V171H392.667V187.695Z" fill="white"/>
|
|
||||||
</svg>
|
|
||||||
`;
|
|
||||||
|
|
||||||
const versionClients = {
|
|
||||||
1: [
|
|
||||||
{
|
|
||||||
name: 'C#',
|
|
||||||
repoLink:
|
|
||||||
'https://github.com/onspring-technologies/onspring-api-sdk/tree/v1.1',
|
|
||||||
installCommand:
|
|
||||||
'dotnet add package Onspring.API.SDK --version 2.1.0',
|
|
||||||
svg: csharpSvg,
|
|
||||||
official: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
2: [
|
|
||||||
{
|
|
||||||
name: 'C#',
|
|
||||||
repoLink:
|
|
||||||
'https://github.com/onspring-technologies/onspring-api-sdk',
|
|
||||||
installCommand:
|
|
||||||
'dotnet add package Onspring.API.SDK',
|
|
||||||
svg: csharpSvg,
|
|
||||||
official: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Javascript',
|
|
||||||
repoLink:
|
|
||||||
'https://github.com/StevanFreeborn/onspring-api-sdk-javascript',
|
|
||||||
installCommand: 'npm install onspring-api-sdk',
|
|
||||||
svg: `
|
|
||||||
<svg width="30" height="30" xmlns="http://www.w3.org/2000/svg" aria-label="JavaScript" viewBox="0 0 512 512" id="javascript">
|
|
||||||
<rect width="512" height="512" fill="#f7df1e" rx="15%"></rect>
|
|
||||||
<path d="m324,370c10,17 24,29 47,29 20,0 33,-10 33,-24 0,-16 -13,-22 -35,-32l-12,-5c-35,-15 -58,-33 -58,-72 0,-36 27,-64 70,-64 31,0 53,11 68,39l-37,24c-8,-15 -17,-21 -31,-21 -14,0 -23,9 -23,21 0,14 9,20 30,29l12,5c41,18 64,35 64,76 0,43 -34,67 -80,67 -45,0 -74,-21 -88,-49zm-170,4c8,13 14,25 31,25 16,0 26,-6 26,-30V203h48v164c0,50 -29,72 -72,72 -39,0 -61,-20 -72,-44z"></path>
|
|
||||||
</svg>
|
|
||||||
`,
|
|
||||||
official: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Python',
|
|
||||||
repoLink:
|
|
||||||
'https://github.com/StevanFreeborn/onspring-api-sdk-python',
|
|
||||||
installCommand: 'pip install OnspringApiSdk',
|
|
||||||
svg: `
|
|
||||||
<svg width="30" height="30" viewBox="0 0 256 255" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid">
|
|
||||||
<path d="M126.916.072c-64.832 0-60.784 28.115-60.784 28.115l.072 29.128h61.868v8.745H41.631S.145 61.355.145 126.77c0 65.417 36.21 63.097 36.21 63.097h21.61v-30.356s-1.165-36.21 35.632-36.21h61.362s34.475.557 34.475-33.319V33.97S194.67.072 126.916.072zM92.802 19.66a11.12 11.12 0 0111.13 11.13 11.12 11.12 0 01-11.13 11.13 11.12 11.12 0 01-11.13-11.13 11.12 11.12 0 0111.13-11.13z" fill="#3372a7"></path>
|
|
||||||
<path d="M128.757 254.126c64.832 0 60.784-28.115 60.784-28.115l-.072-29.127H127.6v-8.745h86.441s41.486 4.705 41.486-60.712c0-65.416-36.21-63.096-36.21-63.096h-21.61v30.355s1.165 36.21-35.632 36.21h-61.362s-34.475-.557-34.475 33.32v56.013s-5.235 33.897 62.518 33.897zm34.114-19.586a11.12 11.12 0 01-11.13-11.13 11.12 11.12 0 0111.13-11.131 11.12 11.12 0 0111.13 11.13 11.12 11.12 0 01-11.13 11.13z" fill="#ffd235"></path>
|
|
||||||
</svg>
|
|
||||||
`,
|
|
||||||
official: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
} as {
|
|
||||||
[key: string]: {
|
|
||||||
name: string;
|
|
||||||
repoLink: string;
|
|
||||||
installCommand: string;
|
|
||||||
svg: string;
|
|
||||||
official: boolean;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
|
|
||||||
const clients = versionClients[version];
|
|
||||||
const [selectedClient, setSelectedClient] = useState(
|
const [selectedClient, setSelectedClient] = useState(
|
||||||
clients[0]
|
clients[0]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,29 +2,17 @@
|
|||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
import { VERSIONS } from '../constants';
|
||||||
import { themes, useThemeContext } from '../context/theme';
|
import { themes, useThemeContext } from '../context/theme';
|
||||||
import { DocsStructure } from '../types/types';
|
import { DocsStructure, Version } from '../types/types';
|
||||||
import styles from './NavBar.module.css';
|
import styles from './NavBar.module.css';
|
||||||
import SectionDropdown from './SectionDropdown';
|
import SectionDropdown from './SectionDropdown';
|
||||||
|
|
||||||
function VersionsDropdown({
|
function VersionsDropdown({
|
||||||
version,
|
version,
|
||||||
}: {
|
}: {
|
||||||
version: string;
|
version: Version;
|
||||||
}) {
|
}) {
|
||||||
const versions = {
|
|
||||||
version_001: {
|
|
||||||
name: 'Version 1',
|
|
||||||
path: '/version-1',
|
|
||||||
},
|
|
||||||
version_002: {
|
|
||||||
name: 'Version 2',
|
|
||||||
path: '/',
|
|
||||||
},
|
|
||||||
} as { [key: string]: { name: string; path: string } };
|
|
||||||
|
|
||||||
const currentVersion = versions[version];
|
|
||||||
|
|
||||||
const [isDropdownOpen, setIsDropdownOpen] =
|
const [isDropdownOpen, setIsDropdownOpen] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
|
|
||||||
@@ -38,7 +26,7 @@ function VersionsDropdown({
|
|||||||
className={styles.navLink}
|
className={styles.navLink}
|
||||||
onClick={handleDropdownToggle}
|
onClick={handleDropdownToggle}
|
||||||
>
|
>
|
||||||
{currentVersion.name}{' '}
|
{version.name}{' '}
|
||||||
{isDropdownOpen ? (
|
{isDropdownOpen ? (
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@@ -76,18 +64,18 @@ function VersionsDropdown({
|
|||||||
: styles.dropdownMenu
|
: styles.dropdownMenu
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{Object.keys(versions)
|
{Object.keys(VERSIONS)
|
||||||
.filter(v => v !== version)
|
.filter(v => VERSIONS[v].name !== version.name)
|
||||||
.map(v => (
|
.map(v => (
|
||||||
<Link
|
<Link
|
||||||
href={`${versions[v].path}`}
|
href={`${VERSIONS[v].path}`}
|
||||||
key={v}
|
key={v}
|
||||||
className={styles.navLink}
|
className={styles.navLink}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsDropdownOpen(false);
|
setIsDropdownOpen(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{versions[v].name}
|
{VERSIONS[v].name}
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -96,12 +84,14 @@ function VersionsDropdown({
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function NavBar({
|
export default function NavBar({
|
||||||
version,
|
versionDocStructure,
|
||||||
}: {
|
}: {
|
||||||
version: DocsStructure;
|
versionDocStructure: DocsStructure;
|
||||||
}) {
|
}) {
|
||||||
const { theme } = useThemeContext();
|
const { theme } = useThemeContext();
|
||||||
const themeStyles = themes[theme];
|
const themeStyles = themes[theme];
|
||||||
|
const currentVersion =
|
||||||
|
VERSIONS[versionDocStructure.version];
|
||||||
|
|
||||||
const [isNavOpen, setIsNavOpen] =
|
const [isNavOpen, setIsNavOpen] =
|
||||||
useState<boolean>(false);
|
useState<boolean>(false);
|
||||||
@@ -114,7 +104,9 @@ export default function NavBar({
|
|||||||
<nav style={themeStyles} className={styles.nav}>
|
<nav style={themeStyles} className={styles.nav}>
|
||||||
<ul className={styles.navListLeft}>
|
<ul className={styles.navListLeft}>
|
||||||
<li className={styles.sectionDropdown}>
|
<li className={styles.sectionDropdown}>
|
||||||
<SectionDropdown version={version} />
|
<SectionDropdown
|
||||||
|
versionDocStructure={versionDocStructure}
|
||||||
|
/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div>
|
<div>
|
||||||
@@ -134,18 +126,18 @@ export default function NavBar({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<li className={styles.navItem}>
|
<li className={styles.navItem}>
|
||||||
<VersionsDropdown version={version.version} />
|
<VersionsDropdown version={currentVersion} />
|
||||||
</li>
|
</li>
|
||||||
<li className={styles.navItem}>
|
<li className={styles.navItem}>
|
||||||
<Link
|
<Link
|
||||||
href={version.officialDocs}
|
href={currentVersion.officialDocs}
|
||||||
className={styles.navLink}
|
className={styles.navLink}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
Official Docs
|
Official Docs
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
{version.hasSwagger ? (
|
{currentVersion.hasSwagger ? (
|
||||||
<li className={styles.navItem}>
|
<li className={styles.navItem}>
|
||||||
<Link
|
<Link
|
||||||
href="https://api.onspring.com/swagger"
|
href="https://api.onspring.com/swagger"
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ import styles from './Page.module.css';
|
|||||||
import SideBar from './SideBar';
|
import SideBar from './SideBar';
|
||||||
|
|
||||||
export default function Page({
|
export default function Page({
|
||||||
version,
|
versionDocStructure,
|
||||||
versionSections,
|
versionSections,
|
||||||
}: {
|
}: {
|
||||||
version: DocsStructure;
|
versionDocStructure: DocsStructure;
|
||||||
versionSections: DocSection[];
|
versionSections: DocSection[];
|
||||||
}) {
|
}) {
|
||||||
const { theme } = useThemeContext();
|
const { theme } = useThemeContext();
|
||||||
@@ -56,9 +56,9 @@ export default function Page({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrapper} style={themeStyles}>
|
<div className={styles.wrapper} style={themeStyles}>
|
||||||
<SideBar version={version} />
|
<SideBar versionDocStructure={versionDocStructure} />
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<NavBar version={version} />
|
<NavBar versionDocStructure={versionDocStructure} />
|
||||||
<Main versionSections={versionSections} />
|
<Main versionSections={versionSections} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import { toKebabCase } from '../utils/stringUtils';
|
|||||||
import styles from './SectionDropdown.module.css';
|
import styles from './SectionDropdown.module.css';
|
||||||
|
|
||||||
export default function SectionDropdown({
|
export default function SectionDropdown({
|
||||||
version,
|
versionDocStructure,
|
||||||
}: {
|
}: {
|
||||||
version: DocsStructure;
|
versionDocStructure: DocsStructure;
|
||||||
}) {
|
}) {
|
||||||
const { section, setSection } = useSectionContext();
|
const { section, setSection } = useSectionContext();
|
||||||
const handleSelectChange = (e: any) => {
|
const handleSelectChange = (e: any) => {
|
||||||
@@ -28,7 +28,7 @@ export default function SectionDropdown({
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
const docs = getAllDocs(version.docs);
|
const docs = getAllDocs(versionDocStructure.docs);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<select
|
<select
|
||||||
|
|||||||
@@ -107,9 +107,9 @@ function ListTree({ docs }: { docs: Doc[] }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function SideBar({
|
export default function SideBar({
|
||||||
version,
|
versionDocStructure,
|
||||||
}: {
|
}: {
|
||||||
version: DocsStructure;
|
versionDocStructure: DocsStructure;
|
||||||
}) {
|
}) {
|
||||||
const { theme, setTheme } = useThemeContext();
|
const { theme, setTheme } = useThemeContext();
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ export default function SideBar({
|
|||||||
></span>
|
></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<ListTree docs={version.docs} />
|
<ListTree docs={versionDocStructure.docs} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,82 @@
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import { Version } from './types/types';
|
||||||
|
|
||||||
export const DOCS_PATH = path.join(
|
export const DOCS_PATH = path.join(
|
||||||
process.cwd(),
|
process.cwd(),
|
||||||
'src/docs'
|
'src/docs'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const CSHARP_SVG = `
|
||||||
|
<svg width="30" height="30" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 456 456" fill="none">
|
||||||
|
<rect width="456" height="456" fill="#512BD4"/>
|
||||||
|
<path d="M81.2738 291.333C78.0496 291.333 75.309 290.259 73.052 288.11C70.795 285.906 69.6665 283.289 69.6665 280.259C69.6665 277.173 70.795 274.529 73.052 272.325C75.309 270.121 78.0496 269.019 81.2738 269.019C84.5518 269.019 87.3193 270.121 89.5763 272.325C91.887 274.529 93.0424 277.173 93.0424 280.259C93.0424 283.289 91.887 285.906 89.5763 288.11C87.3193 290.259 84.5518 291.333 81.2738 291.333Z" fill="white"/>
|
||||||
|
<path d="M210.167 289.515H189.209L133.994 202.406C132.597 200.202 131.441 197.915 130.528 195.546H130.044C130.474 198.081 130.689 203.508 130.689 211.827V289.515H112.149V171H134.477L187.839 256.043C190.096 259.57 191.547 261.994 192.192 263.316H192.514C191.977 260.176 191.708 254.859 191.708 247.365V171H210.167V289.515Z" fill="white"/>
|
||||||
|
<path d="M300.449 289.515H235.561V171H297.87V187.695H254.746V221.249H294.485V237.861H254.746V272.903H300.449V289.515Z" fill="white"/>
|
||||||
|
<path d="M392.667 187.695H359.457V289.515H340.272V187.695H307.143V171H392.667V187.695Z" fill="white"/>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const VERSIONS: Record<string, Version> = {
|
||||||
|
version_001: {
|
||||||
|
name: 'Version 1',
|
||||||
|
path: '/version-1',
|
||||||
|
officialDocs:
|
||||||
|
'https://software.onspring.com/hubfs/Training/Admin%20Guide%20-%20v1%20API.pdf',
|
||||||
|
hasSwagger: false,
|
||||||
|
clients: [
|
||||||
|
{
|
||||||
|
name: 'C#',
|
||||||
|
repoLink:
|
||||||
|
'https://github.com/onspring-technologies/onspring-api-sdk/tree/v1.1',
|
||||||
|
installCommand:
|
||||||
|
'dotnet add package Onspring.API.SDK --version 2.1.0',
|
||||||
|
svg: CSHARP_SVG,
|
||||||
|
official: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
version_002: {
|
||||||
|
name: 'Version 2',
|
||||||
|
path: '/',
|
||||||
|
officialDocs:
|
||||||
|
'https://software.onspring.com/hubfs/Training/Admin%20Guide%20-%20v2%20API.pdf',
|
||||||
|
hasSwagger: true,
|
||||||
|
clients: [
|
||||||
|
{
|
||||||
|
name: 'C#',
|
||||||
|
repoLink:
|
||||||
|
'https://github.com/onspring-technologies/onspring-api-sdk',
|
||||||
|
installCommand:
|
||||||
|
'dotnet add package Onspring.API.SDK',
|
||||||
|
svg: CSHARP_SVG,
|
||||||
|
official: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Javascript',
|
||||||
|
repoLink:
|
||||||
|
'https://github.com/StevanFreeborn/onspring-api-sdk-javascript',
|
||||||
|
installCommand: 'npm install onspring-api-sdk',
|
||||||
|
svg: `
|
||||||
|
<svg width="30" height="30" xmlns="http://www.w3.org/2000/svg" aria-label="JavaScript" viewBox="0 0 512 512" id="javascript">
|
||||||
|
<rect width="512" height="512" fill="#f7df1e" rx="15%"></rect>
|
||||||
|
<path d="m324,370c10,17 24,29 47,29 20,0 33,-10 33,-24 0,-16 -13,-22 -35,-32l-12,-5c-35,-15 -58,-33 -58,-72 0,-36 27,-64 70,-64 31,0 53,11 68,39l-37,24c-8,-15 -17,-21 -31,-21 -14,0 -23,9 -23,21 0,14 9,20 30,29l12,5c41,18 64,35 64,76 0,43 -34,67 -80,67 -45,0 -74,-21 -88,-49zm-170,4c8,13 14,25 31,25 16,0 26,-6 26,-30V203h48v164c0,50 -29,72 -72,72 -39,0 -61,-20 -72,-44z"></path>
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
official: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Python',
|
||||||
|
repoLink:
|
||||||
|
'https://github.com/StevanFreeborn/onspring-api-sdk-python',
|
||||||
|
installCommand: 'pip install OnspringApiSdk',
|
||||||
|
svg: `
|
||||||
|
<svg width="30" height="30" viewBox="0 0 256 255" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid">
|
||||||
|
<path d="M126.916.072c-64.832 0-60.784 28.115-60.784 28.115l.072 29.128h61.868v8.745H41.631S.145 61.355.145 126.77c0 65.417 36.21 63.097 36.21 63.097h21.61v-30.356s-1.165-36.21 35.632-36.21h61.362s34.475.557 34.475-33.319V33.97S194.67.072 126.916.072zM92.802 19.66a11.12 11.12 0 0111.13 11.13 11.12 11.12 0 01-11.13 11.13 11.12 11.12 0 01-11.13-11.13 11.12 11.12 0 0111.13-11.13z" fill="#3372a7"></path>
|
||||||
|
<path d="M128.757 254.126c64.832 0 60.784-28.115 60.784-28.115l-.072-29.127H127.6v-8.745h86.441s41.486 4.705 41.486-60.712c0-65.416-36.21-63.096-36.21-63.096h-21.61v30.355s1.165 36.21-35.632 36.21h-61.362s-34.475-.557-34.475 33.32v56.013s-5.235 33.897 62.518 33.897zm34.114-19.586a11.12 11.12 0 01-11.13-11.13 11.12 11.12 0 0111.13-11.131 11.12 11.12 0 0111.13 11.13 11.12 11.12 0 01-11.13 11.13z" fill="#ffd235"></path>
|
||||||
|
</svg>
|
||||||
|
`,
|
||||||
|
official: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ export default function VersionTwo() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Page
|
<Page
|
||||||
version={versionTwo}
|
versionDocStructure={versionTwo}
|
||||||
versionSections={versionTwoSections}
|
versionSections={versionTwoSections}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
+16
-2
@@ -2,8 +2,6 @@ import { ReactNode } from 'react';
|
|||||||
|
|
||||||
export type DocsStructure = {
|
export type DocsStructure = {
|
||||||
version: string;
|
version: string;
|
||||||
officialDocs: string;
|
|
||||||
hasSwagger: boolean;
|
|
||||||
docs: Doc[];
|
docs: Doc[];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -20,3 +18,19 @@ export type DocSection = {
|
|||||||
copy: ReactNode;
|
copy: ReactNode;
|
||||||
example: ReactNode;
|
example: ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type Version = {
|
||||||
|
name: string;
|
||||||
|
path: string;
|
||||||
|
officialDocs: string;
|
||||||
|
hasSwagger: boolean;
|
||||||
|
clients: Client[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type Client = {
|
||||||
|
name: string;
|
||||||
|
repoLink: string;
|
||||||
|
installCommand: string;
|
||||||
|
svg: string;
|
||||||
|
official: boolean;
|
||||||
|
};
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default function VersionOne() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Page
|
<Page
|
||||||
version={versionOne}
|
versionDocStructure={versionOne}
|
||||||
versionSections={versionOneSections}
|
versionSections={versionOneSections}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ import { DocsStructure } from '@/app/types/types';
|
|||||||
|
|
||||||
export const versionOne: DocsStructure = {
|
export const versionOne: DocsStructure = {
|
||||||
version: 'version_001',
|
version: 'version_001',
|
||||||
officialDocs:
|
|
||||||
'https://software.onspring.com/hubfs/Training/Admin%20Guide%20-%20v1%20API.pdf',
|
|
||||||
hasSwagger: false,
|
|
||||||
docs: [
|
docs: [
|
||||||
{
|
{
|
||||||
title: 'Introduction',
|
title: 'Introduction',
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ https://api.onspring.com/v1
|
|||||||
|
|
||||||
{% /code %}
|
{% /code %}
|
||||||
|
|
||||||
{% clients version="1" %}
|
{% clients version="version_001" %}
|
||||||
{% /clients %}
|
{% /clients %}
|
||||||
|
|||||||
@@ -2,9 +2,6 @@ import { DocsStructure } from '@/app/types/types';
|
|||||||
|
|
||||||
export const versionTwo: DocsStructure = {
|
export const versionTwo: DocsStructure = {
|
||||||
version: 'version_002',
|
version: 'version_002',
|
||||||
officialDocs:
|
|
||||||
'https://software.onspring.com/hubfs/Training/Admin%20Guide%20-%20v2%20API.pdf',
|
|
||||||
hasSwagger: true,
|
|
||||||
docs: [
|
docs: [
|
||||||
{
|
{
|
||||||
title: 'Introduction',
|
title: 'Introduction',
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ X-Api-Version: 2
|
|||||||
|
|
||||||
{% /code %}
|
{% /code %}
|
||||||
|
|
||||||
{% clients version="2" %}
|
{% clients version="version_002" %}
|
||||||
{% /clients %}
|
{% /clients %}
|
||||||
|
|||||||
Reference in New Issue
Block a user