5v{f^_a(}>xNNlaZ8aIaf
z{M=anKwoiQ-M+G)pjJZMLAJ6t<4QX1m)kSo{W1C3yH?`4_WeK~&c_AIR$YnHYu)UC
z;@L@g!I2ma-mG`u=K}-1ZHGW3mOB*%PdFu$;Mlt<2mN8g#nCV7u6>gR_~%?0rOPji
zachT|=AB5H`Gn`;heM)a7YjA&dfr65xY(nbr6=a}yYLeVTKI`p!aT>+u7GrXiJ5qX
z>eB$6h!YTOg`AP}1z$)#~TtMy4y@1gzf4>xSXMDORwE2ok
zm{Fb=SXC$|IBp7zEqJA|lh;2hDhOD4e`=N2CAwC?Yf{1EkIm-Kd9SrO+iLrKSAOV5
zMmv~Wku7xO5r%+ffyY_g5;9H(wlSb9{OgDUwai+_{Oe>1yI@&)H@wp=C`pTcECSS(
Lb(EefScUu_39i@=
diff --git a/src/languages.ts b/src/languages.ts
deleted file mode 100644
index 0b73f8287..000000000
--- a/src/languages.ts
+++ /dev/null
@@ -1,235 +0,0 @@
-type IndentStyle = 'space' | 'tab';
-
-interface IPrismSettings {
- cli?: {
- 'data-filter-output'?: string;
- 'data-host'?: string;
- 'data-user'?: string;
- };
- importScript?: boolean;
- whitespace: {
- indentSize: number;
- indentStyle: 'space' | 'tab';
- };
-}
-
-export interface ILanguage {
- id: string;
- label: string;
- prismSettings: IPrismSettings;
-}
-
-export const languages: ILanguage[] = [
- {
- id: '*',
- label: '*',
- prismSettings: {
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'bash',
- label: 'Bash',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'css',
- label: 'CSS',
- prismSettings: {
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'curl',
- label: 'Curl',
- prismSettings: {
- cli: {
- 'data-filter-output': '> ',
- 'data-host': 'maxmind',
- 'data-user': 'docs',
- },
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'cli',
- label: 'CLI',
- prismSettings: {
- cli: {
- 'data-filter-output': ' >',
- },
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'c',
- label: 'C',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'csharp',
- label: 'C#',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 4,
- indentStyle: 'tab' as IndentStyle,
- },
- },
- },
- {
- id: 'csv',
- label: 'CSV',
- prismSettings: {
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'go',
- label: 'Go',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'tab' as IndentStyle,
- },
- },
- },
- {
- id: 'java',
- label: 'Java',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'javascript',
- label: 'Node',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'json',
- label: 'JSON',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'markdown',
- label: 'Markdown',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'perl',
- label: 'Perl',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 4,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'php',
- label: 'PHP',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 4,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'python',
- label: 'Python',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 4,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'ruby',
- label: 'Ruby',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'sql',
- label: 'Sql',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
- {
- id: 'typescript',
- label: 'TypeScript',
- prismSettings: {
- importScript: true,
- whitespace: {
- indentSize: 2,
- indentStyle: 'space' as IndentStyle,
- },
- },
- },
-];
diff --git a/src/pages/search-results.module.scss b/src/pages/search-results.module.scss
deleted file mode 100644
index 0b2b425be..000000000
--- a/src/pages/search-results.module.scss
+++ /dev/null
@@ -1,91 +0,0 @@
-@use '../styles/variables';
-
-.loading {
- align-items: center;
- display: flex;
- height: 50vh;
- justify-content: center;
-}
-
-.wrapper {
- margin: 0 var(--mm-spacing);
- max-width: 960px;
- min-height: 500px;
-}
-
-.header {
- margin-bottom: calc(var(--mm-spacing) / 2);
-}
-
-.heading {
- font-size: 20px;
- margin: 0;
-
- strong {
- font-weight: bold;
- }
-}
-
-@include variables.breakpoint('lg') {
- .heading {
- font-size: 30px;
- }
-}
-
-.query {
- font-weight: bold;
-}
-
-.count {
- font-size: 14px;
-}
-
-.results {
- margin-bottom: var(--mm-spacing);
-}
-
-.result {
- margin-bottom: calc(var(--mm-spacing) / 1.5);
-}
-
-.pagination {
- margin-bottom: var(--mm-spacing);
-
- &::after {
- clear: both;
- content: '';
- display: table;
- }
-}
-
-.spellingLink,
-.previous,
-.next {
- border-bottom: 2px dotted var(--mm-color-display-text);
- color: var(--mm-color-display-text);
- text-decoration: none;
-}
-
-.previous {
- float: left;
-
- &::before {
- content: '<';
- margin-right: 5px;
- }
-}
-
-.next {
- float: right;
-
- &::after {
- content: '>';
- margin-left: 5px;
- }
-}
-
-.spellingLink:hover,
-.previous:hover,
-.next:hover {
- border-bottom-style: solid;
-}
diff --git a/src/pages/search-results.tsx b/src/pages/search-results.tsx
deleted file mode 100644
index fac04d96e..000000000
--- a/src/pages/search-results.tsx
+++ /dev/null
@@ -1,261 +0,0 @@
-/* eslint-disable react/prop-types */
-
-import { globalHistory } from '@reach/router';
-import { RouteUpdateArgs } from 'gatsby';
-import React, { useEffect, useState } from 'react';
-
-import Layout from '../components/Layout/Layout';
-import Link from '../components/Link';
-import Loading from '../components/Loading';
-import H1 from '../components/Mdx/H1';
-import SearchResult from '../components/SearchResult';
-import GoogleSearch, { ISearchResults } from '../services/GoogleSearch';
-
-import * as styles from './search-results.module.scss';
-
-type queryValue = number | string | undefined;
-
-const SearchResultsPage: React.FC = (props) => {
- const urlParams = new URLSearchParams(props.location.search);
-
- const getQueryUrl = (param: string, q: queryValue): string => {
- if (!q) {
- return '';
- }
-
- const urlParams = new URLSearchParams(props.location.search);
- urlParams.set(param, q.toString());
-
- return `${props.uri}?${urlParams.toString()}`;
- };
-
- const [
- query,
- setQuery,
- ] = useState(urlParams.get('q') as string);
-
- const [
- startIndex,
- setStartIndex,
- ] = useState(urlParams.get('start') as string);
-
- const [
- results,
- setResults,
- ] = useState({} as ISearchResults);
-
- const [
- isLoading,
- setIsLoading,
- ] = useState(true);
-
- const [
- hasError,
- setHasError,
- ] = useState(false);
-
- useEffect(() => {
- globalHistory.listen((history) => {
- const historyParams = new URLSearchParams(history.location.search);
- setQuery(historyParams.get('q') as string);
- setStartIndex(historyParams.get('start') as string);
- props.location.search = history.location.search;
- });
- });
-
- useEffect(() => {
- const fetchResults = async () => {
- window.scrollTo(0,0);
- try {
- setHasError(false);
- setIsLoading(true);
- setResults(await GoogleSearch(query, startIndex));
- } catch {
- setHasError(true);
- }
- setIsLoading(false);
- };
-
- if (query) {
- fetchResults();
- }
- }, [
- query,
- startIndex,
- ]);
-
-
- return (
-
- {
- // Loading
- isLoading && query &&
-
-
-
- }
-
- {
- // No Query
- !query &&
-
-
-
- Please enter a search query
-
-
-
- }
-
- {
- // There's a server error
- hasError &&
-
-
-
- There was an issue performing the search.
-
-
- Please try again.
-
-
-
- }
-
- {
- // There's no search results
- !isLoading && !hasError && !results.items && query &&
-
-
- }
-
- {
- // We found stuff
- !isLoading && results.items && query &&
-
-
- <>
-
- Search results for
- {' '}
-
- {query}
-
-
-
- Displaying results
- {' '}
- {results.queries.request[0].startIndex}
- -
- {results.queries.request[0].startIndex
- + results.queries.request[0].count
- - 1}
- {' '}
- of
- {' '}
- {results.queries.request[0].totalResults}
-
- >
-
-
- {
- results.items?.map((result) => {
- return (
-
- );
- })
- }
-
-
- {results.queries.previousPage &&
-
- Previous
-
- }
- {results.queries.nextPage &&
-
- Next
-
- }
-
-
- }
-
- );};
-
-export default SearchResultsPage;
diff --git a/src/services/GoogleSearch.ts b/src/services/GoogleSearch.ts
deleted file mode 100644
index 98e998090..000000000
--- a/src/services/GoogleSearch.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-interface IItems {
- cacheId: string;
- htmlSnippet: string;
- htmlTitle: string;
- link: string;
-}
-
-interface IQuery {
- count: number;
- startIndex: number;
- totalResults: string;
-}
-
-export interface ISearchResults {
- items?: IItems[];
- queries: {
- nextPage?: IQuery[];
- previousPage?: IQuery[];
- request: IQuery[];
- }
- spelling?: {
- correctedQuery: string;
- }
-}
-
-const endpoint =
- 'https://www.googleapis.com/customsearch/v1/siterestrict?cx={cx}&key={key}';
-
-const cx = 'cde039a7678700a13';
-const key = 'AIzaSyAI4atAz3I5ujXCjoEXRvdwqcYn3AIsCA8';
-
-const url = endpoint
- .replace('{cx}', cx)
- .replace('{key}', key);
-
-
-const GoogleSearch =
- async (query: string, startIndex: string | null): Promise => {
- let requestUrl = `${url}&q=${query}`;
-
- if (startIndex) {
- requestUrl = requestUrl + `&start=${startIndex}`;
- }
- const response = await fetch(requestUrl);
-
- if (!response.ok) {
- throw new Error(`There was an error searching for ${query}`);
- }
-
- return await response.json() as ISearchResults;
- };
-
-export default GoogleSearch;
diff --git a/src/store/index.tsx b/src/store/index.tsx
deleted file mode 100644
index b7dd0ce20..000000000
--- a/src/store/index.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-import React from 'react';
-
-interface IContext {
- selectedLanguage: string;
-}
-
-interface IAction {
- payload: string;
- type: 'change_language' | undefined;
-}
-
-let initialContext: IContext;
-if (typeof window !== 'undefined') {
- initialContext = {
- selectedLanguage: window.localStorage.getItem('mm-selected-language') || '',
- };
-} else {
- initialContext = {
- selectedLanguage: '',
- };
-}
-
-const reducer = (context: IContext, action: IAction): IContext => {
- switch (action.type) {
- case 'change_language':
- window.localStorage.setItem('mm-selected-language', action.payload);
- return {
- ...context,
- selectedLanguage: action.payload,
- };
- default:
- return context;
- }
-};
-
-export const Store =
- React.createContext<
- {
- context: IContext;
- dispatch: React.Dispatch;
- }>({
- context: initialContext,
- dispatch: () => null,
- });
-
-export const StoreProvider: React.FC = (props) => {
- const [
- context,
- dispatch,
- ] = React.useReducer(reducer, initialContext);
-
- return (
-
- {props.children}
-
- );
-};
diff --git a/src/styles/_reset.scss b/src/styles/_reset.scss
deleted file mode 100644
index f8fedd640..000000000
--- a/src/styles/_reset.scss
+++ /dev/null
@@ -1,136 +0,0 @@
-/* stylelint-disable */
-/* http://meyerweb.com/eric/tools/css/reset/
- v2.0 | 20110126
- License: none (public domain)
-*/
-
-html,
-body,
-div,
-span,
-applet,
-object,
-iframe,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-p,
-blockquote,
-pre,
-a,
-abbr,
-acronym,
-address,
-big,
-cite,
-code,
-del,
-dfn,
-em,
-img,
-ins,
-kbd,
-q,
-s,
-samp,
-small,
-strike,
-strong,
-sub,
-sup,
-tt,
-var,
-b,
-u,
-i,
-center,
-dl,
-dt,
-dd,
-ol,
-ul,
-li,
-fieldset,
-form,
-label,
-legend,
-table,
-caption,
-tbody,
-tfoot,
-thead,
-tr,
-th,
-td,
-article,
-aside,
-canvas,
-details,
-embed,
-figure,
-figcaption,
-footer,
-header,
-hgroup,
-menu,
-nav,
-output,
-ruby,
-section,
-summary,
-time,
-mark,
-audio,
-video {
- border: 0;
- font: inherit;
- font-size: 100%;
- margin: 0;
- padding: 0;
- vertical-align: baseline;
-}
-
-/* HTML5 display-role reset for older browsers */
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-menu,
-nav,
-section {
- display: block;
-}
-
-body {
- line-height: 1;
-}
-
-ol,
-ul {
- list-style: none;
-}
-
-blockquote,
-q {
- quotes: none;
-}
-
-blockquote::before,
-blockquote::after,
-q::before,
-q::after {
- content: '';
- content: none;
-}
-
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss
deleted file mode 100644
index 1cae19e91..000000000
--- a/src/styles/_variables.scss
+++ /dev/null
@@ -1,198 +0,0 @@
-$breakpoints: (
- xs: 360px,
- sm: 576px,
- md: 768px,
- lg: 992px,
- xl: 1200px,
- xxl: 1400px,
- xxxl: 1660px
-);
-
-@mixin breakpoint($size) {
- $width: map-get($breakpoints, $size);
-
- @media only screen and (min-width: $width) {
- @content;
- }
-}
-
-@mixin max-breakpoint($size) {
- $width: map-get($breakpoints, $size);
-
- @media only screen and (max-width: $width) {
- @content;
- }
-}
-
-$containers: (
- sm: 540px,
- md: 720px,
- lg: 960px,
- xl: 1140px,
- xxl: 1320px,
- xxxl: 1600px
-);
-
-@mixin container($size) {
- $width: map-get($containers, $size);
- max-width: $width;
- padding: 0;
-}
-
-@mixin max-width {
- @include breakpoint('xl') {
- max-width: 880px;
- width: 100%;
- }
-}
-
-@mixin heading {
- color: #00374c;
- font-family: var(--mm-font-stack-display);
- font-weight: 500;
- line-height: 1.2em;
- margin: calc(var(--mm-spacing) * 2) 0 calc(var(--mm-spacing) / 4);
- position: relative;
- scroll-margin-top: calc(var(--page-header-height) + var(--mm-spacing));
-
- + [id^='toc-'] {
- h3,
- h4,
- h5,
- h6 {
- margin-top: calc(var(--mm-spacing) / 4);
- }
- }
-
- + [class^='Table-module'] {
- margin-top: calc(var(--mm-spacing) / 4);
- }
-
- .link {
- color: #00374c;
- text-decoration: none;
- }
-
- .icon {
- font-size: 12px;
- left: -5px;
- margin-bottom: 0 !important;
- opacity: 0.2;
- position: absolute;
- top: 50%;
- transform: translate(-100%, -50%);
- transition: all 0.15s ease-out;
- }
-
- .link:hover .icon {
- font-size: 14px;
- opacity: 0.75;
- }
-}
-
-@mixin scrollbars($scroll-color: rgba(255, 255, 255, 0.2)) {
- scrollbar-color: $scroll-color transparent;
- scrollbar-width: thin;
-
- &::-webkit-scrollbar {
- height: var(--mm-border-radius);
- width: var(--mm-border-radius);
- }
-
- &::-webkit-scrollbar-thumb {
- background-color: $scroll-color;
- border-radius: var(--mm-border-radius);
- }
-
- &::-webkit-scrollbar-corner {
- background: transparent;
- }
-}
-
-$pattern-scale: 1;
-
-@mixin pattern-base {
- background-color: #00a7e5;
- background-image: url('/static/svg/bg-pattern.svg');
- background-position: center center;
- background-size: (80px * $pattern-scale) (140px * $pattern-scale);
- content: ' ';
- height: 100%;
- left: 0;
- position: absolute;
- top: 0;
- transform: translateZ(0);
- width: 100%;
- will-change: transform; /* stylelint-disable-line */
-}
-
-@mixin pattern-gradient {
- background: rgb(0, 119, 194);
- background: linear-gradient(90deg, rgba(0, 119, 194, 0.5) 0%, var(--page-type-color));
- content: ' ';
- height: 100%;
- left: 0;
- position: absolute;
- top: 0;
- width: 100%;
-}
-
-@mixin pattern {
- position: relative;
-
- &::before {
- @include pattern-base;
- }
-
- &::after {
- @include pattern-gradient;
- }
-}
-
-@mixin pattern-border {
- &::before,
- &::after {
- display: block;
- height: 10px !important;
- overflow: hidden;
- }
-
- &::before {
- @include pattern-base;
- }
-
- &::after {
- @include pattern-gradient;
- }
-}
-
-@mixin menu-button {
- background: var(--mm-color-background);
- border: 1px solid var(--mm-color-border);
- border-radius: var(--mm-border-radius);
- box-sizing: border-box;
- color: var(--mm-color-primary-color);
- cursor: pointer;
- font-size: 12px;
- height: 30px;
- min-width: 30px;
- padding: 0;
- width: 30px;
-
- &:hover {
- background-color: var(--mm-color-sidebar);
- }
-
- @media only screen and (min-width: 420px) {
- font-size: 16px;
- height: 50px;
- min-width: 50px;
- width: 50px;
- }
-}
-
-
-@mixin opaque-overlay {
- backdrop-filter: blur(3px);
- background-color: rgba(255, 255, 255, 0.7);
-}
diff --git a/src/styles/global.scss b/src/styles/global.scss
deleted file mode 100644
index 3e9950b45..000000000
--- a/src/styles/global.scss
+++ /dev/null
@@ -1,91 +0,0 @@
-@use './reset';
-
-/* stylelint-disable no-invalid-position-at-import-rule */
-@import '~normalize.css/normalize.css';
-@import '~@fontsource/montserrat/500.css';
-@import '~@fontsource/montserrat/700.css';
-@import '~@fontsource/montserrat/900.css';
-@import '~@fontsource/roboto/500.css';
-@import '~@fontsource/roboto/700.css';
-@import '~@fontsource/source-code-pro/500.css';
-@import '~@fontsource/source-code-pro/700.css';
-/* stylelint-enable no-invalid-position-at-import-rule */
-
-:host {
- --gatsby: #274958;
-}
-
-:root {
- --gatsby: #274958;
- --mm-color-active-blue: #2b7ec6;
- --mm-color-background: #fff;
- --mm-color-background-code: #274958;
- --mm-color-sidebar: #f5f6f7;
- --mm-color-border: #ddd;
- --mm-color-logo-blue-light: #00aeef;
- --mm-color-logo-blue-dark: #005f83;
- --mm-color-primary-text: #595959;
- --mm-color-display-text: #005f83;
- --mm-border-radius: 6px;
- --mm-font-stack-default: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Ubuntu, sans-serif;
- --mm-font-stack-display: 'montserrat', var(--mm-font-stack-default);
- --mm-font-stack-monospace: 'Source Code Pro', monospace;
- --mm-layout-toc-width: 290px;
- --mm-layout-sidebar-width: 350px;
- --mm-outline: 2px solid var(--mm-color-logo-blue-light);
- --mm-spacing: 40px;
- --page-header-height: 80px;
- --page-type-color: rgba(255, 255, 255, 0.3);
-}
-
-:global(.fa-icon) {
- vertical-align: middle;
-}
-
-:global(#___gatsby) {
- min-height: 100vh;
-}
-
-:global(#gatsby-focus-wrapper) {
- display: flex;
- flex-direction: column;
- min-height: 100vh;
-}
-
-/* Not sure why .page-type--minfraud does not work here */
-[class='page-type--minfraud'] {
- --page-type-color: rgba(255, 0, 136, 0.5);
-}
-
-/* Not sure why .page-type--geoip does not work here */
-[class='page-type--geoip'] {
- --page-type-color: rgba(0, 255, 102, 0.5);
-}
-
-html {
- min-width: 360px;
-}
-
-body {
- color: var(--mm-color-primary-text);
- font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Ubuntu, sans-serif;
- font-size: 1.1rem;
- line-height: 1.3em;
- min-height: 100vh;
- min-width: 360px;
- position: relative;
-}
-
-* {
- box-sizing: border-box;
-}
-
-*:focus {
- outline-color: var(--mm-color-logo-blue-light);
- outline-style: solid;
- outline-width: 2px;
-}
-
-[class='geoip-icon-st0'] {
- fill: none;
-}
diff --git a/src/templates/Home/Home.module.scss b/src/templates/Home/Home.module.scss
deleted file mode 100644
index 4390cbe75..000000000
--- a/src/templates/Home/Home.module.scss
+++ /dev/null
@@ -1,76 +0,0 @@
-@use '../../styles/variables';
-
-.layout [class^='Layout-module--content'] {
- --mm-spacing: 20px;
- background-color: var(--mm-color-sidebar);
- display: grid;
- grid-auto-rows: minmax(min-content, max-content);
- justify-items: center;
-}
-
-.callout {
- padding: var(--mm-spacing) var(--mm-spacing) 0;
- text-align: center;
-}
-
-.calloutHeading {
- font-family: var(--mm-font-stack-display);
- font-size: 20px;
- font-weight: 700;
- line-height: 1.2em;
- margin-bottom: calc(var(--mm-spacing) / 2);
-}
-
-.noWrap {
- white-space: nowrap;
-}
-
-.calloutSubheading {
- font-family: var(--mm-font-stack-monospace);
- font-size: 14px;
- font-weight: 700;
-}
-
-.products {
- display: grid;
- gap: var(--mm-spacing);
- padding: var(--mm-spacing);
-}
-
-.signUp {
- padding: 0 var(--mm-spacing) var(--mm-spacing) var(--mm-spacing);
-
- h3 {
- font-size: 16px !important;
- }
-
- svg {
- width: 25px !important;
- }
-
- > * {
- --page-type-color: rgba(0, 255, 102, 0.5);
- }
-}
-
-
-@include variables.breakpoint('md') {
- .layout [class^='Layout-module--content'] {
- --mm-spacing: 40px;
- background-color: var(--mm-color-sidebar);
- }
-
- .calloutHeading {
- font-size: 35px;
- }
-
- .calloutSubheading {
- font-size: 20px;
- }
-
- .products {
- gap: var(--mm-spacing);
- grid-template-columns: repeat(2, minmax(0, 600px));
- justify-content: center;
- }
-}
diff --git a/src/templates/Home/Home.tsx b/src/templates/Home/Home.tsx
deleted file mode 100644
index e89cee3dc..000000000
--- a/src/templates/Home/Home.tsx
+++ /dev/null
@@ -1,174 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-import {
- FaBookOpen as ViewDocsIcon,
- FaRocket as QuickstartIcon,
- FaUserCheck as SignUpIcon,
-} from 'react-icons/fa';
-
-import Layout from '../../components/Layout/Layout';
-import LinkButton from '../../components/LinkButton';
-import {
- a as A,
- LinkGroupCard,
-} from '../../components/Mdx';
-import Product from './Product';
-import { IHomeContext } from './query';
-
-import * as styles from './Home.module.scss';
-
-interface IHome {
- pageContext: IHomeContext;
-}
-
-const Home: React.FC = (props) => {
- const { pageContext } = props;
- const { frontmatter } = pageContext;
- const { description, keywords, title } = frontmatter;
-
- return (
-
-
-
-
- 👋
-
- {' '}
- Welcome to the
- {' '}
-
- MaxMind Developer Portal
-
- !
-
-
- Develop applications using industry-leading
- {' '}
-
- IP intelligence and risk scoring.
-
-
-
-
-
- Learn more about
- {' '}
-
- minFraud Web Services
-
- .
- >
- )}
- heading="minFraud Web Services"
- icon="MinFraudIcon"
- links={(
- <>
-
-
- >
- )}
- subheading="Transaction Risk API"
- >
- Use risk scoring and data to identify high-risk activity in
- e-commerce payments, platform user activity, incentivized traffic,
- and more.
-
-
- Learn more about
- {' '}
-
- GeoIP2
-
- {' '}
- and
- {' '}
-
- GeoLite2
-
- .
- >
- )}
- heading="GeoIP2 and GeoLite2"
- icon="GeoIPIcon"
- links={(
- <>
-
-
- >
- )}
- subheading="Databases and Web Services"
- >
- Use GeoIP intelligence for content customization, advertising,
- digital rights management, compliance, fraud detection, security and
- more.
-
-
-
-
-
-
- );
-};
-
-Home.propTypes = {
- pageContext: PropTypes.any,
-};
-
-export default Home;
diff --git a/src/templates/Home/Product.module.scss b/src/templates/Home/Product.module.scss
deleted file mode 100644
index 994230ce8..000000000
--- a/src/templates/Home/Product.module.scss
+++ /dev/null
@@ -1,211 +0,0 @@
-@use '../../styles/variables';
-
-.container {
- --mm-spacing: 20px;
- background-color: var(--mm-color-background);
- border-radius: var(--mm-border-radius);
- box-shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
- display: grid;
- grid-template-rows: max-content auto max-content max-content;
- overflow: hidden;
- position: relative;
-}
-
-.container__geoip {
- --page-type-color: rgba(0, 255, 102, 0.5);
-}
-
-.container__minfraud {
- --page-type-color: rgba(255, 0, 136, 0.5);
-}
-
-.header {
- padding: var(--mm-spacing);
- @include variables.pattern;
-}
-
-.lockup {
- --mm-overview-heading-drop-shadow: 1px 3px 0 rgba(0, 0, 0, 0.25);
- display: grid;
- grid-auto-flow: column;
- grid-template-areas:
- 'logo'
- 'heading'
- 'subheading';
- position: relative;
- z-index: 1;
-}
-
-.lockup > * {
- align-self: center;
- justify-self: center;
-}
-
-.icon {
- grid-area: logo;
- height: 90px;
- margin-bottom: var(--mm-spacing);
- width: 90px;
-}
-
-.heading {
- color: #fff;
- font-family: var(--mm-font-stack-display);
- font-size: 20px;
- font-weight: 700;
- grid-area: heading;
- line-height: 1em;
- margin-bottom: 5px;
- text-align: center;
- text-shadow: var(--mm-overview-heading-drop-shadow);
-}
-
-.subheading {
- color: #fff;
- font-family: var(--mm-font-stack-display);
- font-size: 16px;
- font-weight: 700;
- grid-area: subheading;
- line-height: 1em;
- text-align: center;
- text-shadow: var(--mm-overview-heading-drop-shadow);
-}
-
-.content {
- background-color: var(--mm-color-background);
- font-size: 14px;
- padding: var(--mm-spacing);
- text-align: center;
-}
-
-.content * {
- font-size: 14px;
-}
-
-.links {
- background-color: var(--mm-color-sidebar);
- border-top: 1px solid var(--mm-color-border);
- display: grid;
- gap: var(--mm-spacing);
- grid-auto-flow: column;
- grid-template-columns: repeat(2, max-content);
- justify-content: center;
- padding: var(--mm-spacing);
- width: 100%;
-}
-
-.footer {
- background-color: #f0f8ff;
- border-top: 1px solid #cfdee8;
- display: grid;
- gap: calc(var(--mm-spacing) / 4);
- grid-auto-flow: column;
- grid-template-columns: max-content max-content;
- grid-template-rows: max-content;
- justify-content: center;
- padding: calc(var(--mm-spacing) / 2);
- text-align: center;
-}
-
-.footer * {
- align-self: center;
- font-size: 12px;
-}
-
-.infoIcon {
- color: var(--mm-color-active-blue);
- font-size: 16px;
-}
-
-.learnMore {
- color: #545454;
- margin: 0;
-}
-
-.learnMore [class^='A-module'] {
- color: #005270;
- font-weight: 600;
-}
-
-.links > * {
- justify-self: center;
-}
-
-.content > *:first-child {
- margin-top: 0;
-}
-
-.content > *:last-child {
- margin-bottom: 0;
-}
-
-@include variables.breakpoint('xl') {
- .container {
- --mm-spacing: 40px;
- display: grid;
- grid-template-areas:
- 'header header'
- 'content links'
- 'learnMore learnMore';
- }
-
- .header {
- --mm-spacing: 40px;
- display: grid;
- grid-area: header;
- justify-content: center;
- }
-
- .lockup {
- column-gap: calc(var(--mm-spacing) / 2);
- grid-template-areas:
- 'logo heading'
- 'logo subheading';
- grid-template-columns: max-content max-content;
- }
-
- .lockup > * {
- justify-self: left;
- }
-
- .icon {
- margin-bottom: 0;
- }
-
- .heading {
- align-self: end;
- font-size: 24px;
- }
-
- .subheading {
- align-self: start;
- font-size: 18px;
- }
-
- .content {
- grid-area: content;
- text-align: left;
- }
-
- .content * {
- font-size: initial;
- }
-
- .links {
- border-left: 1px solid var(--mm-color-border);
- border-top: 0;
- display: grid;
- gap: calc(var(--mm-spacing) / 2);
- grid-area: links;
- grid-template-columns: auto;
- grid-template-rows: max-content max-content;
- }
-
- .links > * {
- justify-self: auto;
- }
-
- .footer {
- grid-area: learnMore;
- }
-}
diff --git a/src/templates/Home/Product.tsx b/src/templates/Home/Product.tsx
deleted file mode 100644
index cad7de875..000000000
--- a/src/templates/Home/Product.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import classNames from 'classnames';
-import PropTypes from 'prop-types';
-import * as React from 'react';
-import { FaInfoCircle as InfoIcon } from 'react-icons/fa';
-
-import { p as P } from '../../components/Mdx';
-import ProductIcon from '../../components/ProductIcon';
-
-import * as styles from './Product.module.scss';
-
-interface IProduct {
- children: React.ReactNode;
- family: ProductFamily;
- footer: React.ReactNode,
- heading: string;
- icon: string;
- links: React.ReactNode,
- subheading: string;
-}
-
-const Product: React.FC = (props) => {
- const {
- children,
- family,
- icon,
- heading,
- footer,
- links,
- subheading,
- } = props;
-
- return (
-
-
-
-
-
- {heading}
-
-
- {subheading}
-
-
-
-
-
- {links}
-
-
-
- );
-};
-
-Product.propTypes = {
- children: PropTypes.node.isRequired,
- family: PropTypes.oneOf([
- 'minfraud',
- 'geoip',
- ] as const).isRequired,
- footer: PropTypes.node.isRequired,
- heading: PropTypes.string.isRequired,
- icon: PropTypes.string.isRequired,
- links: PropTypes.node.isRequired,
- subheading: PropTypes.string.isRequired,
-};
-
-export default Product;
diff --git a/src/templates/Home/index.ts b/src/templates/Home/index.ts
deleted file mode 100644
index 30c358a55..000000000
--- a/src/templates/Home/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as default } from './Home';
diff --git a/src/templates/Home/query.ts b/src/templates/Home/query.ts
deleted file mode 100644
index dac36d2b3..000000000
--- a/src/templates/Home/query.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/* eslint-disable filenames/match-exported */
-import { BaseQuery, IBaseQuery } from '../../baseQuery';
-
-export type IHomeContext = Pick;
-
-const query: QueryFn = (
- graphql: GraphqlFn
-) => graphql(`
- ${BaseQuery}
-
- query PageTemplateQuery {
- allMdx(filter: {fields: {layout: {eq: "home"}}}) {
- nodes {
- ... BaseQuery
- }
- }
- }
-`);
-
-export default query;
diff --git a/src/templates/Overview/Overview.module.scss b/src/templates/Overview/Overview.module.scss
deleted file mode 100644
index 8a7ea15b2..000000000
--- a/src/templates/Overview/Overview.module.scss
+++ /dev/null
@@ -1,121 +0,0 @@
-@use '../../styles/variables';
-
-.header {
- --mm-overview-heading-drop-shadow: 2px 4px 0 rgba(0, 0, 0, 0.25);
- @include variables.pattern;
- display: grid;
- padding: var(--mm-spacing);
-
- > * {
- position: relative;
- z-index: 2;
- }
-
- &::before {
- background-attachment: fixed;
- }
-}
-
-.lockup {
- column-gap: 20px;
- display: grid;
- grid-template-areas:
- 'logo'
- 'heading'
- 'subheading';
- grid-template-columns: auto auto;
- justify-self: center;
- row-gap: 10px;
-}
-
-.lockup > * {
- align-self: center;
- justify-self: center;
-}
-
-.icon {
- grid-area: logo;
- margin-bottom: 25px;
-}
-
-.heading {
- color: #fff;
- font-family: var(--mm-font-stack-display);
- font-size: 30px;
- font-weight: 700;
- grid-area: heading;
- line-height: 1em;
- text-align: center;
- text-shadow: var(--mm-overview-heading-drop-shadow);
-}
-
-.subheading {
- color: #fff;
- font-family: var(--mm-font-stack-display);
- font-size: 18px;
- font-weight: 700;
- grid-area: subheading;
- line-height: 1em;
- text-align: center;
- text-shadow: var(--mm-overview-heading-drop-shadow);
-}
-
-.content {
- padding: var(--mm-spacing);
-}
-
-.content > *:first-child {
- margin-top: 0;
-}
-
-@include variables.breakpoint('sm') {
- .lockup {
- grid-template-areas:
- 'logo heading'
- 'logo subheading';
- }
-
- .lockup > * {
- justify-self: left;
- }
-
- .icon {
- margin-bottom: 0;
- }
-
- .heading {
- align-self: end;
- text-align: left;
- }
-
- .subheading {
- align-self: start;
- text-align: left;
- }
-}
-
-@include variables.breakpoint('xl') {
- .heading {
- font-size: 40px;
- }
-
- .subheading {
- font-size: 25px;
- }
-
- .content {
- display: grid;
- }
-
- .content > * {
- justify-self: center;
- }
-
- .content [class^='LinkGroupContainer-module'] {
- max-width: calc(680px + 300px);
- }
-
- .content > *:not([class^='LinkGroupContainer-module']) {
- @include variables.max-width;
- }
-}
diff --git a/src/templates/Overview/Overview.tsx b/src/templates/Overview/Overview.tsx
deleted file mode 100644
index 45d1c6699..000000000
--- a/src/templates/Overview/Overview.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { useLocation } from '@reach/router';
-import PropTypes from 'prop-types';
-import React from 'react';
-
-import Layout from '../../components/Layout/Layout';
-import ProductIcon from '../../components/ProductIcon';
-import { IOverviewContext } from './query';
-
-import * as styles from './Overview.module.scss';
-
-interface IOverview {
- children: React.ReactNode;
- pageContext: IOverviewContext;
-}
-
-const Overview: React.FC = (props) => {
- const { frontmatter } = props.pageContext;
- const location = useLocation();
- const { description, icon, keywords, title } = frontmatter;
-
- let type;
-
- if (location.pathname.startsWith('/minfraud')) {
- type = 'minfraud';
- }
-
- if (location.pathname.startsWith('/geoip')) {
- type = 'geoip';
- }
-
- return (
-
-
-
-
-
-
-
-
-
- {frontmatter.subtitle}
-
-
-
-
-
- {props.children}
-
-
-
- );
-};
-
-Overview.propTypes = {
- children: PropTypes.node.isRequired,
- pageContext: PropTypes.any,
-};
-
-export default Overview;
diff --git a/src/templates/Overview/index.ts b/src/templates/Overview/index.ts
deleted file mode 100644
index 6be1bace8..000000000
--- a/src/templates/Overview/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as default } from './Overview';
diff --git a/src/templates/Overview/query.ts b/src/templates/Overview/query.ts
deleted file mode 100644
index 55f9a3da5..000000000
--- a/src/templates/Overview/query.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/* eslint-disable filenames/match-exported */
-import { BaseQuery, IBaseQuery } from '../../baseQuery';
-
-export type IOverviewContext = Pick & {
- readonly frontmatter: {
- readonly icon: string;
- readonly subtitle: string;
- };
-}
-
-const query: QueryFn = (
- graphql: GraphqlFn
-) => graphql(`
- ${BaseQuery}
-
- query OverviewTemplateQuery {
- allMdx(filter: {fields: {layout: {eq: "overviews"}}}) {
- nodes {
- ... BaseQuery
- frontmatter {
- subtitle
- icon
- }
- }
- }
- }
-`);
-
-export default query;
diff --git a/src/templates/Page/Page.module.scss b/src/templates/Page/Page.module.scss
deleted file mode 100644
index 0d16fad98..000000000
--- a/src/templates/Page/Page.module.scss
+++ /dev/null
@@ -1,294 +0,0 @@
-@use '../../styles/variables';
-
-.article {
- padding: var(--mm-spacing);
-}
-
-.header {
- background: var(--mm-color-background);
- z-index: 5;
- @include variables.max-width;
-}
-
-.heading {
- margin: 0;
- padding: 0 0 var(--mm-spacing);
-}
-
-.aside {
- background: var(--mm-color-sidebar);
- margin: var(--mm-spacing) 0;
- padding: var(--mm-spacing);
- position: relative;
-
- @include variables.pattern-border;
-}
-
-.header + .aside {
- margin-top: 0;
-}
-
-.content {
- @include variables.max-width;
-}
-
-.content > [id^='toc-']:first-child > *:first-child {
- margin-top: 0;
-}
-
-.footer {
- border-top: 1px solid var(--mm-color-border);
- display: grid;
- gap: 20px;
- grid-template-columns: 1fr;
- grid-template-rows: auto;
- padding: var(--mm-spacing) 0;
-}
-
-.lastUpdated {
- font-size: 12px;
- font-style: italic;
- font-weight: 400;
- margin-top: calc(var(--mm-spacing) * 2);
- text-align: center;
-}
-
-.footerNext,
-.footerPrevious {
- border-radius: var(--mm-border-radius);
- color: var(--mm-color-display-text);
- column-gap: calc(var(--mm-spacing) / 2);
- display: grid;
- font-size: 18px;
- font-weight: 500;
- grid-template-columns: auto;
- grid-template-rows: max-content 1fr;
- padding: calc(var(--mm-spacing) / 4) calc(var(--mm-spacing) / 2);
- text-decoration: none;
- transition: padding 0.2s ease-in-out, background 0.1s ease-in-out;
-
- &:hover {
- background: var(--mm-color-sidebar);
- }
-}
-
-/* stylelint-disable no-descending-specificity */
-.footerNext {
- grid-template-areas:
- 'direction arrow'
- 'title arrow';
- grid-template-columns: 1fr min-content;
- padding-right: var(--mm-spacing);
- text-align: right;
-
- &:hover {
- padding-right: calc(var(--mm-spacing) / 2);
- }
-}
-
-.footerPrevious {
- grid-template-areas:
- 'arrow direction'
- 'arrow title';
- grid-template-columns: min-content 1fr;
- padding-left: var(--mm-spacing);
-
- &:hover {
- padding-left: calc(var(--mm-spacing) / 2);
- }
-}
-/* stylelint-enable no-descending-specificity */
-
-.footerDirection {
- color: var(--mm-color-primary-text);
- display: block;
- font-size: 12px;
- font-weight: 500;
- grid-area: direction;
- text-decoration: none;
-}
-
-.footerTitle {
- grid-area: title;
-}
-
-.footerArrow {
- align-self: center;
- grid-area: arrow;
- justify-self: center;
-}
-
-@include variables.breakpoint('sm') {
- .footer {
- grid-template-areas: 'previous next';
- grid-template-columns: 1fr 1fr;
- }
-
- .footerNext {
- grid-area: next;
- text-align: right;
- }
-
- .footerPrevious {
- grid-area: previous;
- }
-}
-
-@include variables.breakpoint('md') {
- .article {
- display: flex;
- flex-direction: column;
- height: 100%;
- }
-
- .header,
- .aside,
- .content,
- .footer {
- justify-self: center;
- }
-}
-
-@include variables.breakpoint('xl') {
- .article {
- display: grid;
- grid-template-areas:
- 'header header'
- 'aside aside'
- 'content content'
- 'last-updated last-updated'
- 'footer footer';
- grid-template-columns: 50% 50%;
- grid-template-rows: min-content min-content 1fr min-content;
- height: 100%;
- padding: var(--mm-spacing) 0;
- }
-
- .header {
- grid-area: header;
- padding: 0 var(--mm-spacing) 0;
- }
-
- .header ~ .content > *:first-child {
- margin-top: 0;
- }
-
- .aside {
- grid-area: aside;
- max-width: 800px;
- width: 100%;
- }
-
- .content {
- grid-area: content;
- padding: 0 var(--mm-spacing);
- }
-
- .lastUpdated {
- grid-area: last-updated;
- }
-
- .footer {
- grid-area: footer;
- @include variables.max-width;
- }
-}
-
-@include variables.max-breakpoint('xl') {
- .article.releaseNotes .aside,
- .article.releaseNotes .header {
- justify-self: auto;
- }
-}
-
-
-@include variables.max-breakpoint('xxl') {
- .article.releaseNotes {
- display: grid;
- grid-template-areas:
- 'header header'
- 'content content'
- 'aside aside'
- 'footer footer';
- grid-template-columns: 50% 50%;
- grid-template-rows: min-content min-content 1fr min-content;
- height: 100%;
- }
-
- .article.releaseNotes .header {
- grid-area: header;
- }
-
- .article.releaseNotes .header ~ .content > *:first-child {
- margin-top: 0;
- }
-
- .article.releaseNotes .aside {
- grid-area: aside;
- @include variables.max-width;
- }
-
- .article.releaseNotes .content {
- grid-area: content;
- }
-
- .article.releaseNotes .footer {
- grid-area: footer;
- }
-}
-
-@include variables.breakpoint('xxl') {
- .article {
- grid-template-areas:
- 'header aside'
- 'content aside'
- 'footer aside';
- grid-template-columns: calc(100vw - 640px) var(--mm-layout-toc-width);
- grid-template-rows: min-content auto min-content;
- /* autoprefixer: ignore next */
- justify-items: start;
- }
-
- .header {
- grid-area: header;
- }
-
- .aside {
- background: var(--mm-color-background);
- border-bottom: 0;
- grid-area: aside;
- height: auto;
- margin: 0;
- min-width: auto;
- padding: 0;
- width: 100%;
- }
-
- .aside::before,
- .aside::after {
- display: none;
- }
-
- .tableOfContents {
- max-height: calc(100vh - var(--page-header-height));
- overflow-y: scroll;
- padding: var(--mm-spacing) var(--mm-spacing) 120px 20px;
- position: sticky;
- top: calc(var(--page-header-height));
- width: 100%;
- }
-
- .content {
- grid-area: content;
- }
-}
-
-@include variables.breakpoint('xxxl') {
- .content {
- margin: 0 auto;
- }
-
- .content > [id^='toc-'] {
- margin: calc(var(--mm-spacing) * 3) 0;
- }
-}
diff --git a/src/templates/Page/Page.tsx b/src/templates/Page/Page.tsx
deleted file mode 100644
index 2292e4214..000000000
--- a/src/templates/Page/Page.tsx
+++ /dev/null
@@ -1,178 +0,0 @@
-import { useLocation } from '@reach/router';
-import classNames from 'classnames';
-import PropTypes from 'prop-types';
-import React from 'react';
-import { FaArrowLeft, FaArrowRight } from 'react-icons/fa';
-
-import Layout from '../../components/Layout/Layout';
-import Link from '../../components/Link';
-import { h1 as H1, p as P } from '../../components/Mdx';
-import { getNextPage, getPreviousPage } from '../../utils/pagination';
-import { IPageContext } from './query';
-import ReleaseNotesArchiveList from './ReleaseNotesArchiveList';
-import TableOfContents from './TableOfContents';
-
-import * as styles from './Page.module.scss';
-
-interface IPage {
- children: React.ReactNode;
- pageContext: IPageContext;
-}
-
-const Page: React.FC = (props) => {
- const {
- frontmatter,
- parent,
- customTableOfContents: tableOfContents,
- } = props.pageContext;
- const location = useLocation();
- const { description, keywords, image, title } = frontmatter;
- const { modifiedTime } = parent || {};
-
- let type;
-
- if (location.pathname.startsWith('/minfraud')) {
- type = 'minfraud';
- }
-
- if (location.pathname.startsWith('/geoip')) {
- type = 'geoip';
- }
-
- let isReleaseNotesPage = false;
-
- if (location.pathname.split('/')[2] === 'release-notes' && type) {
- isReleaseNotesPage = true;
- }
-
- const nextPage = getNextPage(location.pathname);
- const previousPage = getPreviousPage(location.pathname);
-
- return (
-
-
-
-
- <>
- {tableOfContents !== null && (
-
- {!isReleaseNotesPage &&
- tableOfContents &&
- tableOfContents.items?.length > 0 && (
-
- )}
- {isReleaseNotesPage && (
-
- )}
-
- )}
- >
-
-
- {props.children}
-
- {modifiedTime && (
-
- This page was last updated on
- {' '}
- {modifiedTime}
- .
-
- )}
-
-
- <>
- {(previousPage || nextPage) && (
-
- <>
- {previousPage && (
-
-
-
- Previous
-
-
- {previousPage.title}
-
-
- )}
- >
-
- <>
- {nextPage && (
-
-
-
- Next
-
-
- {nextPage.title}
-
-
- )}
- >
-
- )}
- >
-
-
- );
-};
-
-Page.propTypes = {
- children: PropTypes.node.isRequired,
- pageContext: PropTypes.any,
-};
-
-export default Page;
diff --git a/src/templates/Page/ReleaseNotesArchiveList.tsx b/src/templates/Page/ReleaseNotesArchiveList.tsx
deleted file mode 100644
index 4146d07aa..000000000
--- a/src/templates/Page/ReleaseNotesArchiveList.tsx
+++ /dev/null
@@ -1,75 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-
-import TableOfContents from './TableOfContents';
-
-type ProductSlug = 'geoip' | 'minfraud';
-
-export interface IReleaseNotesArchiveList {
- type: ProductSlug;
-}
-
-const years: Record = {
- geoip: [
- 2023,
- 2022,
- 2021,
- 2020,
- 2019,
- 2018,
- 2017,
- 2016,
- 2015,
- 2014,
- 2013,
- ],
- minfraud: [
- 2023,
- 2022,
- 2021,
- 2020,
- 2019,
- 2018,
- 2017,
- 2016,
- 2015,
- 2014,
- 2013,
- ],
-};
-
-const generateItems = (type: ProductSlug) => {
- // eslint-disable-next-line security/detect-object-injection
- const items = years[type].map((year: number) => ({
- items: [],
- title: year.toString(),
- url: `/${type}/release-notes/${year}`,
- }));
-
- return items;
-};
-
-
-const ReleaseNotesArchiveList: React.FC<
- IReleaseNotesArchiveList & React.HTMLProps
-> = (props) => {
- const { className, type } = props;
-
- return (
-
- );
-};
-
-ReleaseNotesArchiveList.propTypes = {
- className: PropTypes.string,
- type: PropTypes.oneOf([
- 'geoip',
- 'minfraud',
- ]).isRequired,
-};
-
-export default ReleaseNotesArchiveList;
diff --git a/src/templates/Page/TableOfContents.module.scss b/src/templates/Page/TableOfContents.module.scss
deleted file mode 100644
index deaf9370f..000000000
--- a/src/templates/Page/TableOfContents.module.scss
+++ /dev/null
@@ -1,117 +0,0 @@
-@use '../../styles/variables';
-
-.heading {
- border-bottom: 1px dashed var(--mm-color-border);
- color: var(--mm-color-display-text);
- display: inline-block;
- font-family: var(--mm-font-stack-display);
- font-size: 20px;
- font-weight: 500;
- margin: calc(var(--mm-spacing) / 2) 0;
- padding-bottom: calc(var(--mm-spacing) / 2);
- width: 100%;
-}
-
-.list {
- font-family: var(--mm-font-stack-display);
- margin: calc(var(--mm-spacing) / 2) 0 0;
-}
-
-.list * {
- vertical-align: top !important;
-}
-
-.list:last-child {
- margin-bottom: 0;
-}
-
-.list .list {
- margin-left: 14px;
-}
-
-.listItem {
- color: #aaa;
- font-size: 14px;
- line-height: 1.2em;
- margin-bottom: calc(var(--mm-spacing) * 0.75);
- position: relative;
-
- &::before {
- content: attr(data-item-number);
- position: absolute;
- transform: translateX(calc(-100% - 6px));
- }
-}
-
-.listItem:last-child {
- margin-bottom: 0;
-}
-
-.listItem .listItem {
- font-size: 12px;
- margin-bottom: calc(var(--mm-spacing) / 2);
-}
-
-.listItem .listItem:last-child {
- margin-bottom: 0;
-}
-
-.listItem a {
- --psuedo-padding: 8px;
- color: #555;
- display: inline-block;
- font-weight: 500;
- position: relative;
- text-decoration: none;
- width: calc(100% - var(--mm-spacing));
-
- &::before,
- &::after {
- content: ' ';
- display: block;
- height: 100%;
- padding: var(--psuedo-padding) 0;
- position: absolute;
- right: 0;
- top: 0;
- transform: translate(calc(var(--mm-spacing) * 0.5), calc(var(--psuedo-padding) * -1));
- width: calc(100% + var(--mm-spacing) * 2);
- z-index: -1;
- }
-
- &::before {
- left: 0;
- right: initial;
- transform: translate(-14px, calc(var(--psuedo-padding) * -1));
- }
-
- &:hover {
- color: var(--mm-color-display-text);
- }
-}
-
-.listItem.item__active > a {
- color: var(--mm-color-display-text);
-
- &::before {
- border-left: 4px solid rgb(43, 126, 198);
- }
-}
-
-.listItem .listItem a::before {
- transform: translate(-28px, calc(var(--psuedo-padding) * -1));
-}
-
-.listItem .listItem .listItem a::before {
- transform: translate(-42px, calc(var(--psuedo-padding) * -1));
-}
-
-.listItem .listItem .listItem .listItem a::before {
- transform: translate(-56px, calc(var(--psuedo-padding) * -1));
-}
-
-@include variables.breakpoint('xl') {
- .list {
- list-style-position: outside;
- }
-}
diff --git a/src/templates/Page/TableOfContents.tsx b/src/templates/Page/TableOfContents.tsx
deleted file mode 100644
index 3856cf293..000000000
--- a/src/templates/Page/TableOfContents.tsx
+++ /dev/null
@@ -1,119 +0,0 @@
-import { useLocation } from '@reach/router';
-import classNames from 'classnames';
-import PropTypes from 'prop-types';
-import React from 'react';
-
-import Link from '../../components/Link';
-import useActiveHeading from '../../hooks/useActiveHeading';
-
-import * as styles from './TableOfContents.module.scss';
-
-export interface IItem {
- items: IItem[];
- title: string;
- url: string;
-}
-
-export interface ITableOfContents {
- heading?: string;
- items: IItem[];
-}
-
-const getIds = (
- items: IItem[]
-): string[] => items.reduce((accumulator: string[], item: IItem) => {
- const itemIds = item.items ? getIds(item.items) : [];
-
- return [
- ...accumulator,
- item.url.slice(1),
- ...itemIds,
- ];
-}, []);
-
-const isActive = (url: string, pathname: string, currentItem?: string) => {
- if (
- url === pathname
- || (
- currentItem && (
- currentItem === `toc-${url.slice(1)}`
- || currentItem === url.slice(1)
- )
- )
- ) {
- return true;
- }
-
- return false;
-};
-
-const renderItems = (
- items: IItem[],
- pathname: string,
- currentItem?: string,
-): React.ReactElement => (
-
- {items.map((item, index) => {
- let itemNumber;
- let { title } = item;
- const regex = new RegExp(/^(\d+)\.\s+([\s|\w|\W]*)$/);
- const matches = title.match(regex);
-
- if (matches) {
- itemNumber = `${matches[1]}. `;
- title = matches[2];
- }
-
- return (
-
-
- {title}
-
- {item.items && renderItems(item.items, pathname, currentItem)}
-
- );
- })}
-
-);
-
-const TableOfContents: React.FC<
- ITableOfContents & React.HTMLProps
-> = (props) => {
- const { heading, items, ...rest } = props;
-
- const pathname = useLocation().pathname;
- const itemIds = getIds(items);
- const currentItem = useActiveHeading(itemIds);
-
- return (
-
-
- {heading || 'On this Page'}
-
- {renderItems(items, pathname, currentItem)}
-
- );
-};
-
-TableOfContents.propTypes = {
- heading: PropTypes.string,
- items: PropTypes.any,
-};
-
-export default TableOfContents;
diff --git a/src/templates/Page/index.ts b/src/templates/Page/index.ts
deleted file mode 100644
index 2855c64f9..000000000
--- a/src/templates/Page/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as default } from './Page';
diff --git a/src/templates/Page/query.ts b/src/templates/Page/query.ts
deleted file mode 100644
index 96c0bd95a..000000000
--- a/src/templates/Page/query.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/* eslint-disable filenames/match-exported */
-import { BaseQuery, IBaseQuery } from '../../baseQuery';
-import { ITableOfContents } from './TableOfContents';
-
-export type IPageContext = IBaseQuery & {
- readonly customTableOfContents: ITableOfContents;
- readonly parent: {
- readonly modifiedTime: string;
- };
- readonly timeToRead: number;
-};
-
-const query: QueryFn = (graphql: GraphqlFn) =>
- graphql(`
- ${BaseQuery}
-
- query PageTemplateQuery {
- allMdx(filter: { fields: { layout: { eq: "pages" } } }) {
- nodes {
- ...BaseQuery
- customTableOfContents(maxDepth: 4)
- timeToRead
- parent {
- ... on File {
- modifiedTime(formatString: "MMMM D, YYYY", locale: "en-US")
- }
- }
- }
- }
- }
- `);
-
-export default query;
diff --git a/src/types/Item.ts b/src/types/Item.ts
deleted file mode 100644
index 2a924b53e..000000000
--- a/src/types/Item.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-interface IBaseItem {
- hasDivider?: boolean;
- icon?: React.ReactElement;
- title: string;
-}
-
-export interface IInternalItem extends IBaseItem {
- items?: IItem[];
- secondaryItems?: IItem[];
- to: string;
-}
-
-export interface IExternalItem extends IBaseItem {
- url: string;
-}
-
-export type IItem = IExternalItem | IInternalItem;
-
-export const isInternalItem = (
- item: IItem
- // eslint-disable-next-line no-prototype-builtins
-): item is IInternalItem => item.hasOwnProperty('to');
diff --git a/src/types/globals/index.d.ts b/src/types/globals/index.d.ts
deleted file mode 100644
index 566ed72fb..000000000
--- a/src/types/globals/index.d.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
-declare type GraphqlFn = (
- query: string,
- variables?: TVariables
-) => Promise<{
- data?: {
- allMdx: {
- nodes: TData[],
- };
- };
- errors?: any,
-}>
-
-declare type QueryFn = {
- (graphql: GraphqlFn): Promise<{
- data?: {
- allMdx: {
- nodes: T[];
- };
- };
- errors?: any;
- }>;
-}
-
-declare type JsonPrimitive = string | number | boolean | null
-
-// eslint-disable-next-line @typescript-eslint/no-empty-interface
-declare interface IJsonObject extends Record<
- string,
- JsonPrimitive | IJsonArray | IJsonObject
-> {}
-
-// eslint-disable-next-line @typescript-eslint/no-empty-interface
-declare interface IJsonArray extends Array<
- JsonPrimitive | IJsonArray | IJsonObject
-> {}
-
-declare type Json = JsonPrimitive | IJsonObject | IJsonArray;
diff --git a/src/types/openapi-types/index.d.ts b/src/types/openapi-types/index.d.ts
deleted file mode 100644
index 1503cbb86..000000000
--- a/src/types/openapi-types/index.d.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-/* eslint-disable @typescript-eslint/naming-convention */
-/* eslint-disable max-len */
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import { OpenAPIV3 as OriginalOpenAPIV3 } from 'openapi-types';
-
-declare module 'openapi-types' {
- export namespace OpenAPIV3 {
- interface BaseSchemaObject {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- 'x-compiled-example'?: any;
- 'x-line-numbers'?: string;
- }
-
- type PropertyObject = OriginalOpenAPIV3.ReferenceObject | OriginalOpenAPIV3.SchemaObject;
-
- interface PropertiesObject {
- [name: string]: PropertyObject;
- }
-
- type SchemaComponentObject = OriginalOpenAPIV3.ReferenceObject | OriginalOpenAPIV3.SchemaObject;
-
- interface SchemaComponentsObject {
- [key: string]: SchemaComponentObject;
- }
-
- type CompositeSchemaObject = OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
- type CompositeSchemaObjects = CompositeSchemaObject[];
- }
-}
-
diff --git a/src/types/remark/index.d.ts b/src/types/remark/index.d.ts
deleted file mode 100644
index 0a2be09c7..000000000
--- a/src/types/remark/index.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-declare module 'remark';
diff --git a/src/types/vfile-message/index.d.ts b/src/types/vfile-message/index.d.ts
deleted file mode 100644
index 7581e7bc1..000000000
--- a/src/types/vfile-message/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare module 'vfile-message' {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- export type VFileMessage = any;
-}
diff --git a/src/utils/get-toc-items--direct.fixture.json b/src/utils/get-toc-items--direct.fixture.json
deleted file mode 100644
index 04e07eedc..000000000
--- a/src/utils/get-toc-items--direct.fixture.json
+++ /dev/null
@@ -1,1303 +0,0 @@
-{
- "data": {
- "allMdx": {
- "nodes": [
- {
- "customTableOfContents": {
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 12,
- "line": 2,
- "offset": 12
- },
- "indent": [],
- "start": {
- "column": 4,
- "line": 2,
- "offset": 4
- }
- },
- "type": "text",
- "value": "Level 1a"
- }
- ],
- "depth": 2,
- "position": {
- "end": {
- "column": 12,
- "line": 2,
- "offset": 12
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 2,
- "offset": 1
- }
- },
- "type": "heading"
- },
- {
- "attributes": [
- {
- "name": "name",
- "position": {
- "end": {
- "column": 33,
- "line": 4,
- "offset": 46
- },
- "start": {
- "column": 9,
- "line": 4,
- "offset": 22
- }
- },
- "type": "mdxAttribute",
- "value": "Level 1a - Link 1"
- },
- {
- "name": "services",
- "position": {
- "end": {
- "column": 46,
- "line": 4,
- "offset": 59
- },
- "start": {
- "column": 34,
- "line": 4,
- "offset": 47
- }
- },
- "type": "mdxAttribute",
- "value": "*"
- }
- ],
- "children": [
- {
- "attributes": [
- {
- "name": "example",
- "position": {
- "end": {
- "column": 15,
- "line": 6,
- "offset": 87
- },
- "start": {
- "column": 5,
- "line": 6,
- "offset": 77
- }
- },
- "type": "mdxAttribute",
- "value": ""
- },
- {
- "name": "name",
- "position": {
- "end": {
- "column": 15,
- "line": 7,
- "offset": 102
- },
- "start": {
- "column": 5,
- "line": 7,
- "offset": 92
- }
- },
- "type": "mdxAttribute",
- "value": "foo"
- },
- {
- "name": "type",
- "position": {
- "end": {
- "column": 18,
- "line": 8,
- "offset": 120
- },
- "start": {
- "column": 5,
- "line": 8,
- "offset": 107
- }
- },
- "type": "mdxAttribute",
- "value": "string"
- }
- ],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 3,
- "line": 11,
- "offset": 135
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 10,
- "offset": 125
- }
- },
- "type": "text",
- "value": "Foo"
- }
- ],
- "position": {
- "end": {
- "column": 3,
- "line": 11,
- "offset": 135
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 10,
- "offset": 125
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "Property",
- "position": {
- "end": {
- "column": 14,
- "line": 11,
- "offset": 146
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 5,
- "offset": 61
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "Schema",
- "position": {
- "end": {
- "column": 10,
- "line": 12,
- "offset": 156
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 4,
- "offset": 14
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 13,
- "line": 14,
- "offset": 170
- },
- "indent": [],
- "start": {
- "column": 5,
- "line": 14,
- "offset": 162
- }
- },
- "type": "text",
- "value": "Level 2a"
- }
- ],
- "depth": 3,
- "position": {
- "end": {
- "column": 13,
- "line": 14,
- "offset": 170
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 14,
- "offset": 158
- }
- },
- "type": "heading"
- },
- {
- "attributes": [
- {
- "name": "name",
- "position": {
- "end": {
- "column": 33,
- "line": 16,
- "offset": 204
- },
- "start": {
- "column": 9,
- "line": 16,
- "offset": 180
- }
- },
- "type": "mdxAttribute",
- "value": "Level 2a - Link 1"
- },
- {
- "name": "services",
- "position": {
- "end": {
- "column": 46,
- "line": 16,
- "offset": 217
- },
- "start": {
- "column": 34,
- "line": 16,
- "offset": 205
- }
- },
- "type": "mdxAttribute",
- "value": "*"
- }
- ],
- "children": [
- {
- "attributes": [
- {
- "name": "example",
- "position": {
- "end": {
- "column": 15,
- "line": 18,
- "offset": 245
- },
- "start": {
- "column": 5,
- "line": 18,
- "offset": 235
- }
- },
- "type": "mdxAttribute",
- "value": ""
- },
- {
- "name": "name",
- "position": {
- "end": {
- "column": 15,
- "line": 19,
- "offset": 260
- },
- "start": {
- "column": 5,
- "line": 19,
- "offset": 250
- }
- },
- "type": "mdxAttribute",
- "value": "foo"
- },
- {
- "name": "type",
- "position": {
- "end": {
- "column": 18,
- "line": 20,
- "offset": 278
- },
- "start": {
- "column": 5,
- "line": 20,
- "offset": 265
- }
- },
- "type": "mdxAttribute",
- "value": "string"
- }
- ],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 3,
- "line": 23,
- "offset": 293
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 22,
- "offset": 283
- }
- },
- "type": "text",
- "value": "Foo"
- }
- ],
- "position": {
- "end": {
- "column": 3,
- "line": 23,
- "offset": 293
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 22,
- "offset": 283
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "Property",
- "position": {
- "end": {
- "column": 14,
- "line": 23,
- "offset": 304
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 17,
- "offset": 219
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "Schema",
- "position": {
- "end": {
- "column": 10,
- "line": 24,
- "offset": 314
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 16,
- "offset": 172
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [
- {
- "name": "name",
- "position": {
- "end": {
- "column": 33,
- "line": 26,
- "offset": 348
- },
- "start": {
- "column": 9,
- "line": 26,
- "offset": 324
- }
- },
- "type": "mdxAttribute",
- "value": "Level 2a - Link 2"
- },
- {
- "name": "services",
- "position": {
- "end": {
- "column": 46,
- "line": 26,
- "offset": 361
- },
- "start": {
- "column": 34,
- "line": 26,
- "offset": 349
- }
- },
- "type": "mdxAttribute",
- "value": "*"
- }
- ],
- "children": [
- {
- "attributes": [
- {
- "name": "example",
- "position": {
- "end": {
- "column": 15,
- "line": 28,
- "offset": 389
- },
- "start": {
- "column": 5,
- "line": 28,
- "offset": 379
- }
- },
- "type": "mdxAttribute",
- "value": ""
- },
- {
- "name": "name",
- "position": {
- "end": {
- "column": 15,
- "line": 29,
- "offset": 404
- },
- "start": {
- "column": 5,
- "line": 29,
- "offset": 394
- }
- },
- "type": "mdxAttribute",
- "value": "foo"
- },
- {
- "name": "type",
- "position": {
- "end": {
- "column": 18,
- "line": 30,
- "offset": 422
- },
- "start": {
- "column": 5,
- "line": 30,
- "offset": 409
- }
- },
- "type": "mdxAttribute",
- "value": "string"
- }
- ],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 3,
- "line": 33,
- "offset": 437
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 32,
- "offset": 427
- }
- },
- "type": "text",
- "value": "Foo"
- }
- ],
- "position": {
- "end": {
- "column": 3,
- "line": 33,
- "offset": 437
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 32,
- "offset": 427
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "Property",
- "position": {
- "end": {
- "column": 14,
- "line": 33,
- "offset": 448
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 27,
- "offset": 363
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "Schema",
- "position": {
- "end": {
- "column": 10,
- "line": 34,
- "offset": 458
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 26,
- "offset": 316
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 13,
- "line": 36,
- "offset": 472
- },
- "indent": [],
- "start": {
- "column": 5,
- "line": 36,
- "offset": 464
- }
- },
- "type": "text",
- "value": "Level 2b"
- }
- ],
- "depth": 3,
- "position": {
- "end": {
- "column": 13,
- "line": 36,
- "offset": 472
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 36,
- "offset": 460
- }
- },
- "type": "heading"
- },
- {
- "attributes": [
- {
- "name": "name",
- "position": {
- "end": {
- "column": 33,
- "line": 38,
- "offset": 506
- },
- "start": {
- "column": 9,
- "line": 38,
- "offset": 482
- }
- },
- "type": "mdxAttribute",
- "value": "Level 2b - Link 1"
- },
- {
- "name": "services",
- "position": {
- "end": {
- "column": 46,
- "line": 38,
- "offset": 519
- },
- "start": {
- "column": 34,
- "line": 38,
- "offset": 507
- }
- },
- "type": "mdxAttribute",
- "value": "*"
- }
- ],
- "children": [
- {
- "attributes": [
- {
- "name": "example",
- "position": {
- "end": {
- "column": 15,
- "line": 40,
- "offset": 547
- },
- "start": {
- "column": 5,
- "line": 40,
- "offset": 537
- }
- },
- "type": "mdxAttribute",
- "value": ""
- },
- {
- "name": "name",
- "position": {
- "end": {
- "column": 15,
- "line": 41,
- "offset": 562
- },
- "start": {
- "column": 5,
- "line": 41,
- "offset": 552
- }
- },
- "type": "mdxAttribute",
- "value": "foo"
- },
- {
- "name": "type",
- "position": {
- "end": {
- "column": 18,
- "line": 42,
- "offset": 580
- },
- "start": {
- "column": 5,
- "line": 42,
- "offset": 567
- }
- },
- "type": "mdxAttribute",
- "value": "string"
- }
- ],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 3,
- "line": 45,
- "offset": 595
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 44,
- "offset": 585
- }
- },
- "type": "text",
- "value": "Foo"
- }
- ],
- "position": {
- "end": {
- "column": 3,
- "line": 45,
- "offset": 595
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 44,
- "offset": 585
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "Property",
- "position": {
- "end": {
- "column": 14,
- "line": 45,
- "offset": 606
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 39,
- "offset": 521
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "Schema",
- "position": {
- "end": {
- "column": 10,
- "line": 46,
- "offset": 616
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 38,
- "offset": 474
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [
- {
- "name": "name",
- "position": {
- "end": {
- "column": 33,
- "line": 48,
- "offset": 650
- },
- "start": {
- "column": 9,
- "line": 48,
- "offset": 626
- }
- },
- "type": "mdxAttribute",
- "value": "Level 2b - Link 2"
- },
- {
- "name": "services",
- "position": {
- "end": {
- "column": 46,
- "line": 48,
- "offset": 663
- },
- "start": {
- "column": 34,
- "line": 48,
- "offset": 651
- }
- },
- "type": "mdxAttribute",
- "value": "*"
- }
- ],
- "children": [
- {
- "attributes": [
- {
- "name": "example",
- "position": {
- "end": {
- "column": 15,
- "line": 50,
- "offset": 691
- },
- "start": {
- "column": 5,
- "line": 50,
- "offset": 681
- }
- },
- "type": "mdxAttribute",
- "value": ""
- },
- {
- "name": "name",
- "position": {
- "end": {
- "column": 15,
- "line": 51,
- "offset": 706
- },
- "start": {
- "column": 5,
- "line": 51,
- "offset": 696
- }
- },
- "type": "mdxAttribute",
- "value": "foo"
- },
- {
- "name": "type",
- "position": {
- "end": {
- "column": 18,
- "line": 52,
- "offset": 724
- },
- "start": {
- "column": 5,
- "line": 52,
- "offset": 711
- }
- },
- "type": "mdxAttribute",
- "value": "string"
- }
- ],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 3,
- "line": 55,
- "offset": 739
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 54,
- "offset": 729
- }
- },
- "type": "text",
- "value": "Foo"
- }
- ],
- "position": {
- "end": {
- "column": 3,
- "line": 55,
- "offset": 739
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 54,
- "offset": 729
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "Property",
- "position": {
- "end": {
- "column": 14,
- "line": 55,
- "offset": 750
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 49,
- "offset": 665
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "Schema",
- "position": {
- "end": {
- "column": 10,
- "line": 56,
- "offset": 760
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 48,
- "offset": 618
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 12,
- "line": 58,
- "offset": 773
- },
- "indent": [],
- "start": {
- "column": 4,
- "line": 58,
- "offset": 765
- }
- },
- "type": "text",
- "value": "Level 1b"
- }
- ],
- "depth": 2,
- "position": {
- "end": {
- "column": 12,
- "line": 58,
- "offset": 773
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 58,
- "offset": 762
- }
- },
- "type": "heading"
- },
- {
- "attributes": [
- {
- "name": "name",
- "position": {
- "end": {
- "column": 33,
- "line": 60,
- "offset": 807
- },
- "start": {
- "column": 9,
- "line": 60,
- "offset": 783
- }
- },
- "type": "mdxAttribute",
- "value": "Level 1b - Link 1"
- },
- {
- "name": "services",
- "position": {
- "end": {
- "column": 46,
- "line": 60,
- "offset": 820
- },
- "start": {
- "column": 34,
- "line": 60,
- "offset": 808
- }
- },
- "type": "mdxAttribute",
- "value": "*"
- }
- ],
- "children": [
- {
- "attributes": [
- {
- "name": "example",
- "position": {
- "end": {
- "column": 15,
- "line": 62,
- "offset": 848
- },
- "start": {
- "column": 5,
- "line": 62,
- "offset": 838
- }
- },
- "type": "mdxAttribute",
- "value": ""
- },
- {
- "name": "name",
- "position": {
- "end": {
- "column": 15,
- "line": 63,
- "offset": 863
- },
- "start": {
- "column": 5,
- "line": 63,
- "offset": 853
- }
- },
- "type": "mdxAttribute",
- "value": "foo"
- },
- {
- "name": "type",
- "position": {
- "end": {
- "column": 18,
- "line": 64,
- "offset": 881
- },
- "start": {
- "column": 5,
- "line": 64,
- "offset": 868
- }
- },
- "type": "mdxAttribute",
- "value": "string"
- }
- ],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 3,
- "line": 67,
- "offset": 896
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 66,
- "offset": 886
- }
- },
- "type": "text",
- "value": "Foo"
- }
- ],
- "position": {
- "end": {
- "column": 3,
- "line": 67,
- "offset": 896
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 66,
- "offset": 886
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "Property",
- "position": {
- "end": {
- "column": 14,
- "line": 67,
- "offset": 907
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 61,
- "offset": 822
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "Schema",
- "position": {
- "end": {
- "column": 10,
- "line": 68,
- "offset": 917
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 60,
- "offset": 775
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "position": {
- "end": {
- "column": 59,
- "line": 71,
- "offset": 978
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 71,
- "offset": 920
- }
- },
- "type": "export",
- "value": "export const _frontmatter = {\"draft\":false,\"title\":\"Test\"}"
- }
- ],
- "position": {
- "end": {
- "column": 59,
- "line": 71,
- "offset": 978
- },
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0
- }
- },
- "type": "root"
- },
- "tableOfContents": {
- "items": [
- {
- "items": [
- {
- "title": "Level 2a",
- "url": "#level-2a"
- },
- {
- "title": "Level 2b",
- "url": "#level-2b"
- }
- ],
- "title": "Level 1a",
- "url": "#level-1a"
- },
- {
- "title": "Level 1b",
- "url": "#level-1b"
- }
- ]
- }
- }
- ]
- }
- },
- "extensions": {}
-}
diff --git a/src/utils/get-toc-items--indirect.fixture.json b/src/utils/get-toc-items--indirect.fixture.json
deleted file mode 100644
index 226aac33d..000000000
--- a/src/utils/get-toc-items--indirect.fixture.json
+++ /dev/null
@@ -1,4028 +0,0 @@
-{
- "data": {
- "allMdx": {
- "nodes": [
- {
- "customTableOfContents": {
- "children": [
- {
- "position": {
- "end": {
- "column": 40,
- "line": 3,
- "offset": 87
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 2,
- "offset": 1
- }
- },
- "type": "import",
- "value": "import requestJson from './_examples/request';\nimport * as Schemas from './_schemas/';"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 30,
- "line": 5,
- "offset": 118
- },
- "indent": [],
- "start": {
- "column": 4,
- "line": 5,
- "offset": 92
- }
- },
- "type": "text",
- "value": "Authorization and Security"
- }
- ],
- "depth": 2,
- "position": {
- "end": {
- "column": 30,
- "line": 5,
- "offset": 118
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 5,
- "offset": 89
- }
- },
- "type": "heading"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 10,
- "line": 7,
- "offset": 129
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 7,
- "offset": 120
- }
- },
- "type": "text",
- "value": "The HTTP "
- },
- {
- "position": {
- "end": {
- "column": 25,
- "line": 7,
- "offset": 144
- },
- "indent": [],
- "start": {
- "column": 10,
- "line": 7,
- "offset": 129
- }
- },
- "type": "inlineCode",
- "value": "Authorization"
- },
- {
- "position": {
- "end": {
- "column": 6,
- "line": 8,
- "offset": 204
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 25,
- "line": 7,
- "offset": 144
- }
- },
- "type": "text",
- "value": " header is required for authorization. The username is\nyour "
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 25,
- "line": 8,
- "offset": 223
- },
- "indent": [],
- "start": {
- "column": 7,
- "line": 8,
- "offset": 205
- }
- },
- "type": "text",
- "value": "MaxMind account ID"
- }
- ],
- "position": {
- "end": {
- "column": 83,
- "line": 8,
- "offset": 281
- },
- "indent": [],
- "start": {
- "column": 6,
- "line": 8,
- "offset": 204
- }
- },
- "title": null,
- "type": "link",
- "url": "https://www.maxmind.com/en/accounts/current/license-key"
- },
- {
- "position": {
- "end": {
- "column": 22,
- "line": 9,
- "offset": 304
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 83,
- "line": 8,
- "offset": 281
- }
- },
- "type": "text",
- "value": ".\nThe password is your "
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 42,
- "line": 9,
- "offset": 324
- },
- "indent": [],
- "start": {
- "column": 23,
- "line": 9,
- "offset": 305
- }
- },
- "type": "text",
- "value": "MaxMind license key"
- }
- ],
- "position": {
- "end": {
- "column": 100,
- "line": 9,
- "offset": 382
- },
- "indent": [],
- "start": {
- "column": 22,
- "line": 9,
- "offset": 304
- }
- },
- "title": null,
- "type": "link",
- "url": "https://www.maxmind.com/en/accounts/current/license-key"
- },
- {
- "position": {
- "end": {
- "column": 101,
- "line": 9,
- "offset": 383
- },
- "indent": [],
- "start": {
- "column": 100,
- "line": 9,
- "offset": 382
- }
- },
- "type": "text",
- "value": "."
- }
- ],
- "position": {
- "end": {
- "column": 101,
- "line": 9,
- "offset": 383
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 7,
- "offset": 120
- }
- },
- "type": "paragraph"
- },
- {
- "attributes": [
- {
- "name": "type",
- "position": {
- "end": {
- "column": 22,
- "line": 11,
- "offset": 406
- },
- "start": {
- "column": 8,
- "line": 11,
- "offset": 392
- }
- },
- "type": "mdxAttribute",
- "value": "warning"
- }
- ],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 62,
- "line": 13,
- "offset": 544
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 12,
- "offset": 408
- }
- },
- "type": "text",
- "value": "You must be approved for a trial or purchase credit for use with our web\nservices in order to receive an account ID and license key."
- }
- ],
- "position": {
- "end": {
- "column": 62,
- "line": 13,
- "offset": 544
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 12,
- "offset": 408
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "Alert",
- "position": {
- "end": {
- "column": 9,
- "line": 14,
- "offset": 553
- },
- "indent": [
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 11,
- "offset": 385
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 8,
- "line": 16,
- "offset": 562
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 16,
- "offset": 555
- }
- },
- "type": "text",
- "value": "We use "
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 34,
- "line": 16,
- "offset": 588
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 16,
- "offset": 563
- }
- },
- "type": "text",
- "value": "basic HTTP authentication"
- }
- ],
- "position": {
- "end": {
- "column": 94,
- "line": 16,
- "offset": 648
- },
- "indent": [],
- "start": {
- "column": 8,
- "line": 16,
- "offset": 562
- }
- },
- "title": null,
- "type": "link",
- "url": "https://en.wikipedia.org/wiki/Basic_access_authentication"
- },
- {
- "position": {
- "end": {
- "column": 38,
- "line": 19,
- "offset": 836
- },
- "indent": [
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 94,
- "line": 16,
- "offset": 648
- }
- },
- "type": "text",
- "value": ".\nThe APIs which require authentication are only available via HTTPS. The\ncredentials are never transmitted unencrypted. If you attempt to access this\nservice via HTTP, you will receive a "
- },
- {
- "position": {
- "end": {
- "column": 53,
- "line": 19,
- "offset": 851
- },
- "indent": [],
- "start": {
- "column": 38,
- "line": 19,
- "offset": 836
- }
- },
- "type": "inlineCode",
- "value": "403 Forbidden"
- },
- {
- "position": {
- "end": {
- "column": 68,
- "line": 19,
- "offset": 866
- },
- "indent": [],
- "start": {
- "column": 53,
- "line": 19,
- "offset": 851
- }
- },
- "type": "text",
- "value": " HTTP response."
- }
- ],
- "position": {
- "end": {
- "column": 68,
- "line": 19,
- "offset": 866
- },
- "indent": [
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 16,
- "offset": 555
- }
- },
- "type": "paragraph"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 8,
- "line": 22,
- "offset": 955
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 21,
- "offset": 868
- }
- },
- "type": "text",
- "value": "We require TLS 1.2 or greater for all requests to our servers to keep your data\nsecure."
- }
- ],
- "position": {
- "end": {
- "column": 8,
- "line": 22,
- "offset": 955
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 21,
- "offset": 868
- }
- },
- "type": "paragraph"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 21,
- "line": 24,
- "offset": 977
- },
- "indent": [],
- "start": {
- "column": 4,
- "line": 24,
- "offset": 960
- }
- },
- "type": "text",
- "value": "Service Endpoints"
- }
- ],
- "depth": 2,
- "position": {
- "end": {
- "column": 21,
- "line": 24,
- "offset": 977
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 24,
- "offset": 957
- }
- },
- "type": "heading"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 53,
- "line": 26,
- "offset": 1031
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 26,
- "offset": 979
- }
- },
- "type": "text",
- "value": "The endpoint for each service is as specified below."
- }
- ],
- "position": {
- "end": {
- "column": 53,
- "line": 26,
- "offset": 1031
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 26,
- "offset": 979
- }
- },
- "type": "paragraph"
- },
- {
- "align": [
- null,
- null,
- null
- ],
- "children": [
- {
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 10,
- "line": 28,
- "offset": 1042
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 28,
- "offset": 1035
- }
- },
- "type": "text",
- "value": "Service"
- }
- ],
- "position": {
- "end": {
- "column": 11,
- "line": 28,
- "offset": 1043
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 28,
- "offset": 1035
- }
- },
- "type": "tableCell"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 25,
- "line": 28,
- "offset": 1057
- },
- "indent": [],
- "start": {
- "column": 14,
- "line": 28,
- "offset": 1046
- }
- },
- "type": "text",
- "value": "HTTP Method"
- }
- ],
- "position": {
- "end": {
- "column": 25,
- "line": 28,
- "offset": 1057
- },
- "indent": [],
- "start": {
- "column": 14,
- "line": 28,
- "offset": 1046
- }
- },
- "type": "tableCell"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 36,
- "line": 28,
- "offset": 1068
- },
- "indent": [],
- "start": {
- "column": 28,
- "line": 28,
- "offset": 1060
- }
- },
- "type": "text",
- "value": "Endpoint"
- }
- ],
- "position": {
- "end": {
- "column": 81,
- "line": 28,
- "offset": 1113
- },
- "indent": [],
- "start": {
- "column": 28,
- "line": 28,
- "offset": 1060
- }
- },
- "type": "tableCell"
- }
- ],
- "position": {
- "end": {
- "column": 83,
- "line": 28,
- "offset": 1115
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 28,
- "offset": 1033
- }
- },
- "type": "tableRow"
- },
- {
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 8,
- "line": 30,
- "offset": 1206
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 30,
- "offset": 1201
- }
- },
- "type": "text",
- "value": "Score"
- }
- ],
- "position": {
- "end": {
- "column": 11,
- "line": 30,
- "offset": 1209
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 30,
- "offset": 1201
- }
- },
- "type": "tableCell"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 20,
- "line": 30,
- "offset": 1218
- },
- "indent": [],
- "start": {
- "column": 14,
- "line": 30,
- "offset": 1212
- }
- },
- "type": "inlineCode",
- "value": "POST"
- }
- ],
- "position": {
- "end": {
- "column": 25,
- "line": 30,
- "offset": 1223
- },
- "indent": [],
- "start": {
- "column": 14,
- "line": 30,
- "offset": 1212
- }
- },
- "type": "tableCell"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 78,
- "line": 30,
- "offset": 1276
- },
- "indent": [],
- "start": {
- "column": 28,
- "line": 30,
- "offset": 1226
- }
- },
- "type": "inlineCode",
- "value": "https://minfraud.maxmind.com/minfraud/v2.0/score"
- }
- ],
- "position": {
- "end": {
- "column": 81,
- "line": 30,
- "offset": 1279
- },
- "indent": [],
- "start": {
- "column": 28,
- "line": 30,
- "offset": 1226
- }
- },
- "type": "tableCell"
- }
- ],
- "position": {
- "end": {
- "column": 83,
- "line": 30,
- "offset": 1281
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 30,
- "offset": 1199
- }
- },
- "type": "tableRow"
- },
- {
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 11,
- "line": 31,
- "offset": 1292
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 31,
- "offset": 1284
- }
- },
- "type": "text",
- "value": "Insights"
- }
- ],
- "position": {
- "end": {
- "column": 11,
- "line": 31,
- "offset": 1292
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 31,
- "offset": 1284
- }
- },
- "type": "tableCell"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 20,
- "line": 31,
- "offset": 1301
- },
- "indent": [],
- "start": {
- "column": 14,
- "line": 31,
- "offset": 1295
- }
- },
- "type": "inlineCode",
- "value": "POST"
- }
- ],
- "position": {
- "end": {
- "column": 25,
- "line": 31,
- "offset": 1306
- },
- "indent": [],
- "start": {
- "column": 14,
- "line": 31,
- "offset": 1295
- }
- },
- "type": "tableCell"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 81,
- "line": 31,
- "offset": 1362
- },
- "indent": [],
- "start": {
- "column": 28,
- "line": 31,
- "offset": 1309
- }
- },
- "type": "inlineCode",
- "value": "https://minfraud.maxmind.com/minfraud/v2.0/insights"
- }
- ],
- "position": {
- "end": {
- "column": 81,
- "line": 31,
- "offset": 1362
- },
- "indent": [],
- "start": {
- "column": 28,
- "line": 31,
- "offset": 1309
- }
- },
- "type": "tableCell"
- }
- ],
- "position": {
- "end": {
- "column": 83,
- "line": 31,
- "offset": 1364
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 31,
- "offset": 1282
- }
- },
- "type": "tableRow"
- },
- {
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 10,
- "line": 32,
- "offset": 1374
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 32,
- "offset": 1367
- }
- },
- "type": "text",
- "value": "Factors"
- }
- ],
- "position": {
- "end": {
- "column": 11,
- "line": 32,
- "offset": 1375
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 32,
- "offset": 1367
- }
- },
- "type": "tableCell"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 20,
- "line": 32,
- "offset": 1384
- },
- "indent": [],
- "start": {
- "column": 14,
- "line": 32,
- "offset": 1378
- }
- },
- "type": "inlineCode",
- "value": "POST"
- }
- ],
- "position": {
- "end": {
- "column": 25,
- "line": 32,
- "offset": 1389
- },
- "indent": [],
- "start": {
- "column": 14,
- "line": 32,
- "offset": 1378
- }
- },
- "type": "tableCell"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 80,
- "line": 32,
- "offset": 1444
- },
- "indent": [],
- "start": {
- "column": 28,
- "line": 32,
- "offset": 1392
- }
- },
- "type": "inlineCode",
- "value": "https://minfraud.maxmind.com/minfraud/v2.0/factors"
- }
- ],
- "position": {
- "end": {
- "column": 81,
- "line": 32,
- "offset": 1445
- },
- "indent": [],
- "start": {
- "column": 28,
- "line": 32,
- "offset": 1392
- }
- },
- "type": "tableCell"
- }
- ],
- "position": {
- "end": {
- "column": 83,
- "line": 32,
- "offset": 1447
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 32,
- "offset": 1365
- }
- },
- "type": "tableRow"
- }
- ],
- "position": {
- "end": {
- "column": 83,
- "line": 32,
- "offset": 1447
- },
- "indent": [
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 28,
- "offset": 1033
- }
- },
- "type": "table"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 5,
- "line": 34,
- "offset": 1453
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 34,
- "offset": 1449
- }
- },
- "type": "text",
- "value": "The "
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 27,
- "line": 34,
- "offset": 1475
- },
- "indent": [],
- "start": {
- "column": 7,
- "line": 34,
- "offset": 1455
- }
- },
- "type": "text",
- "value": "minfraud.maxmind.com"
- }
- ],
- "position": {
- "end": {
- "column": 29,
- "line": 34,
- "offset": 1477
- },
- "indent": [],
- "start": {
- "column": 5,
- "line": 34,
- "offset": 1453
- }
- },
- "type": "strong"
- },
- {
- "position": {
- "end": {
- "column": 31,
- "line": 35,
- "offset": 1553
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 29,
- "line": 34,
- "offset": 1477
- }
- },
- "type": "text",
- "value": " hostname automatically picks the data center\ngeographically closest to you."
- }
- ],
- "position": {
- "end": {
- "column": 31,
- "line": 35,
- "offset": 1553
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 34,
- "offset": 1449
- }
- },
- "type": "paragraph"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 11,
- "line": 37,
- "offset": 1565
- },
- "indent": [],
- "start": {
- "column": 4,
- "line": 37,
- "offset": 1558
- }
- },
- "type": "text",
- "value": "Headers"
- }
- ],
- "depth": 2,
- "position": {
- "end": {
- "column": 11,
- "line": 37,
- "offset": 1565
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 37,
- "offset": 1555
- }
- },
- "type": "heading"
- },
- {
- "attributes": [],
- "children": [
- {
- "attributes": [],
- "children": [
- {
- "attributes": [],
- "children": [
- {
- "attributes": [],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 17,
- "line": 42,
- "offset": 1610
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 42,
- "offset": 1604
- }
- },
- "type": "text",
- "value": "Header"
- }
- ],
- "position": {
- "end": {
- "column": 17,
- "line": 42,
- "offset": 1610
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 42,
- "offset": 1604
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "th",
- "position": {
- "end": {
- "column": 22,
- "line": 42,
- "offset": 1615
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 42,
- "offset": 1594
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 16,
- "line": 43,
- "offset": 1631
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 43,
- "offset": 1626
- }
- },
- "type": "text",
- "value": "Notes"
- }
- ],
- "position": {
- "end": {
- "column": 16,
- "line": 43,
- "offset": 1631
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 43,
- "offset": 1626
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "th",
- "position": {
- "end": {
- "column": 21,
- "line": 43,
- "offset": 1636
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 43,
- "offset": 1616
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "tr",
- "position": {
- "end": {
- "column": 10,
- "line": 44,
- "offset": 1646
- },
- "indent": [
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 41,
- "offset": 1585
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "thead",
- "position": {
- "end": {
- "column": 11,
- "line": 45,
- "offset": 1657
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 40,
- "offset": 1575
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [
- {
- "attributes": [],
- "children": [
- {
- "attributes": [],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 24,
- "line": 49,
- "offset": 1711
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 49,
- "offset": 1696
- }
- },
- "type": "inlineCode",
- "value": "Authorization"
- }
- ],
- "position": {
- "end": {
- "column": 7,
- "line": 50,
- "offset": 1718
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 49,
- "offset": 1688
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "td",
- "position": {
- "end": {
- "column": 12,
- "line": 50,
- "offset": 1723
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 48,
- "offset": 1677
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [
- {
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 19,
- "line": 52,
- "offset": 1753
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 52,
- "offset": 1745
- }
- },
- "type": "text",
- "value": "Required"
- }
- ],
- "position": {
- "end": {
- "column": 21,
- "line": 52,
- "offset": 1755
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 52,
- "offset": 1743
- }
- },
- "type": "strong"
- },
- {
- "position": {
- "end": {
- "column": 9,
- "line": 53,
- "offset": 1788
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 21,
- "line": 52,
- "offset": 1755
- }
- },
- "type": "text",
- "value": " – For more details, see\n"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 36,
- "line": 53,
- "offset": 1815
- },
- "indent": [],
- "start": {
- "column": 10,
- "line": 53,
- "offset": 1789
- }
- },
- "type": "text",
- "value": "Authorization and Security"
- }
- ],
- "position": {
- "end": {
- "column": 66,
- "line": 53,
- "offset": 1845
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 53,
- "offset": 1788
- }
- },
- "title": null,
- "type": "link",
- "url": "#authorization-and-security"
- },
- {
- "position": {
- "end": {
- "column": 7,
- "line": 54,
- "offset": 1853
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 66,
- "line": 53,
- "offset": 1845
- }
- },
- "type": "text",
- "value": "."
- }
- ],
- "position": {
- "end": {
- "column": 7,
- "line": 54,
- "offset": 1853
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 52,
- "offset": 1735
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "td",
- "position": {
- "end": {
- "column": 12,
- "line": 54,
- "offset": 1858
- },
- "indent": [
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 51,
- "offset": 1724
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "tr",
- "position": {
- "end": {
- "column": 10,
- "line": 55,
- "offset": 1868
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 47,
- "offset": 1668
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [
- {
- "attributes": [],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 17,
- "line": 58,
- "offset": 1905
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 58,
- "offset": 1897
- }
- },
- "type": "inlineCode",
- "value": "Accept"
- }
- ],
- "position": {
- "end": {
- "column": 7,
- "line": 59,
- "offset": 1912
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 58,
- "offset": 1889
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "td",
- "position": {
- "end": {
- "column": 12,
- "line": 59,
- "offset": 1917
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 57,
- "offset": 1878
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [
- {
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 19,
- "line": 61,
- "offset": 1947
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 61,
- "offset": 1939
- }
- },
- "type": "text",
- "value": "Optional"
- }
- ],
- "position": {
- "end": {
- "column": 21,
- "line": 61,
- "offset": 1949
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 61,
- "offset": 1937
- }
- },
- "type": "strong"
- },
- {
- "position": {
- "end": {
- "column": 49,
- "line": 62,
- "offset": 2054
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 21,
- "line": 61,
- "offset": 1949
- }
- },
- "type": "text",
- "value": " – If you do set this header, you must accept any of the\nfollowing, substituting the appropriate "
- },
- {
- "position": {
- "end": {
- "column": 65,
- "line": 62,
- "offset": 2070
- },
- "indent": [],
- "start": {
- "column": 49,
- "line": 62,
- "offset": 2054
- }
- },
- "type": "inlineCode",
- "value": "[SERVICE TYPE]"
- },
- {
- "position": {
- "end": {
- "column": 9,
- "line": 63,
- "offset": 2090
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 65,
- "line": 62,
- "offset": 2070
- }
- },
- "type": "text",
- "value": " for either\n"
- },
- {
- "position": {
- "end": {
- "column": 16,
- "line": 63,
- "offset": 2097
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 63,
- "offset": 2090
- }
- },
- "type": "inlineCode",
- "value": "score"
- },
- {
- "position": {
- "end": {
- "column": 18,
- "line": 63,
- "offset": 2099
- },
- "indent": [],
- "start": {
- "column": 16,
- "line": 63,
- "offset": 2097
- }
- },
- "type": "text",
- "value": ", "
- },
- {
- "position": {
- "end": {
- "column": 27,
- "line": 63,
- "offset": 2108
- },
- "indent": [],
- "start": {
- "column": 18,
- "line": 63,
- "offset": 2099
- }
- },
- "type": "inlineCode",
- "value": "factors"
- },
- {
- "position": {
- "end": {
- "column": 32,
- "line": 63,
- "offset": 2113
- },
- "indent": [],
- "start": {
- "column": 27,
- "line": 63,
- "offset": 2108
- }
- },
- "type": "text",
- "value": ", or "
- },
- {
- "position": {
- "end": {
- "column": 42,
- "line": 63,
- "offset": 2123
- },
- "indent": [],
- "start": {
- "column": 32,
- "line": 63,
- "offset": 2113
- }
- },
- "type": "inlineCode",
- "value": "insights"
- },
- {
- "position": {
- "end": {
- "column": 43,
- "line": 63,
- "offset": 2124
- },
- "indent": [],
- "start": {
- "column": 42,
- "line": 63,
- "offset": 2123
- }
- },
- "type": "text",
- "value": ":"
- }
- ],
- "position": {
- "end": {
- "column": 43,
- "line": 63,
- "offset": 2124
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 61,
- "offset": 1929
- }
- },
- "type": "paragraph"
- },
- {
- "children": [
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 29,
- "line": 65,
- "offset": 2154
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 65,
- "offset": 2136
- }
- },
- "type": "inlineCode",
- "value": "application/json"
- }
- ],
- "position": {
- "end": {
- "column": 29,
- "line": 65,
- "offset": 2154
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 65,
- "offset": 2136
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 29,
- "line": 65,
- "offset": 2154
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 65,
- "offset": 2126
- }
- },
- "spread": false,
- "type": "listItem"
- },
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 69,
- "line": 66,
- "offset": 2223
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 66,
- "offset": 2165
- }
- },
- "type": "inlineCode",
- "value": "application/vnd.maxmind.com-minfraud-[SERVICE TYPE]+json"
- }
- ],
- "position": {
- "end": {
- "column": 69,
- "line": 66,
- "offset": 2223
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 66,
- "offset": 2165
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 69,
- "line": 66,
- "offset": 2223
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 66,
- "offset": 2155
- }
- },
- "spread": false,
- "type": "listItem"
- },
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 97,
- "line": 67,
- "offset": 2320
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 67,
- "offset": 2234
- }
- },
- "type": "inlineCode",
- "value": "application/vnd.maxmind.com-minfraud-[SERVICE TYPE]+json; charset=UTF-8; version=2.0"
- }
- ],
- "position": {
- "end": {
- "column": 97,
- "line": 67,
- "offset": 2320
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 67,
- "offset": 2234
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 97,
- "line": 67,
- "offset": 2320
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 67,
- "offset": 2224
- }
- },
- "spread": false,
- "type": "listItem"
- }
- ],
- "ordered": false,
- "position": {
- "end": {
- "column": 97,
- "line": 67,
- "offset": 2320
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 65,
- "offset": 2126
- }
- },
- "spread": false,
- "start": null,
- "type": "list"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 60,
- "line": 70,
- "offset": 2382
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 70,
- "offset": 2323
- }
- },
- "type": "text",
- "value": "A request for any other MIME type will result in a "
- },
- {
- "position": {
- "end": {
- "column": 88,
- "line": 70,
- "offset": 2410
- },
- "indent": [],
- "start": {
- "column": 60,
- "line": 70,
- "offset": 2382
- }
- },
- "type": "inlineCode",
- "value": "415 Unsupported Media Type"
- },
- {
- "position": {
- "end": {
- "column": 7,
- "line": 71,
- "offset": 2424
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 88,
- "line": 70,
- "offset": 2410
- }
- },
- "type": "text",
- "value": " error."
- }
- ],
- "position": {
- "end": {
- "column": 7,
- "line": 71,
- "offset": 2424
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 70,
- "offset": 2323
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "td",
- "position": {
- "end": {
- "column": 12,
- "line": 71,
- "offset": 2429
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 11,
- 11,
- 11,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 60,
- "offset": 1918
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "tr",
- "position": {
- "end": {
- "column": 10,
- "line": 72,
- "offset": 2439
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 11,
- 11,
- 11,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 56,
- "offset": 1869
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [
- {
- "attributes": [],
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 25,
- "line": 75,
- "offset": 2484
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 75,
- "offset": 2468
- }
- },
- "type": "inlineCode",
- "value": "Accept-Charset"
- }
- ],
- "position": {
- "end": {
- "column": 7,
- "line": 76,
- "offset": 2491
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 75,
- "offset": 2460
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "td",
- "position": {
- "end": {
- "column": 12,
- "line": 76,
- "offset": 2496
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 74,
- "offset": 2449
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [
- {
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 19,
- "line": 78,
- "offset": 2526
- },
- "indent": [],
- "start": {
- "column": 11,
- "line": 78,
- "offset": 2518
- }
- },
- "type": "text",
- "value": "Optional"
- }
- ],
- "position": {
- "end": {
- "column": 21,
- "line": 78,
- "offset": 2528
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 78,
- "offset": 2516
- }
- },
- "type": "strong"
- },
- {
- "position": {
- "end": {
- "column": 71,
- "line": 78,
- "offset": 2578
- },
- "indent": [],
- "start": {
- "column": 21,
- "line": 78,
- "offset": 2528
- }
- },
- "type": "text",
- "value": " – If you do set this header, you must accept the "
- },
- {
- "position": {
- "end": {
- "column": 78,
- "line": 78,
- "offset": 2585
- },
- "indent": [],
- "start": {
- "column": 71,
- "line": 78,
- "offset": 2578
- }
- },
- "type": "inlineCode",
- "value": "UTF-8"
- },
- {
- "position": {
- "end": {
- "column": 56,
- "line": 79,
- "offset": 2641
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 78,
- "line": 78,
- "offset": 2585
- }
- },
- "type": "text",
- "value": "\ncharacter set. If you don't you will receive a "
- },
- {
- "position": {
- "end": {
- "column": 76,
- "line": 79,
- "offset": 2661
- },
- "indent": [],
- "start": {
- "column": 56,
- "line": 79,
- "offset": 2641
- }
- },
- "type": "inlineCode",
- "value": "406 Not Acceptable"
- },
- {
- "position": {
- "end": {
- "column": 58,
- "line": 80,
- "offset": 2719
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 76,
- "line": 79,
- "offset": 2661
- }
- },
- "type": "text",
- "value": "\nresponse, because this data is only available in "
- },
- {
- "position": {
- "end": {
- "column": 65,
- "line": 80,
- "offset": 2726
- },
- "indent": [],
- "start": {
- "column": 58,
- "line": 80,
- "offset": 2719
- }
- },
- "type": "inlineCode",
- "value": "UTF-8"
- },
- {
- "position": {
- "end": {
- "column": 7,
- "line": 81,
- "offset": 2734
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 65,
- "line": 80,
- "offset": 2726
- }
- },
- "type": "text",
- "value": "."
- }
- ],
- "position": {
- "end": {
- "column": 7,
- "line": 81,
- "offset": 2734
- },
- "indent": [
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 78,
- "offset": 2508
- }
- },
- "type": "paragraph"
- }
- ],
- "name": "td",
- "position": {
- "end": {
- "column": 12,
- "line": 81,
- "offset": 2739
- },
- "indent": [
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 77,
- "offset": 2497
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "tr",
- "position": {
- "end": {
- "column": 10,
- "line": 82,
- "offset": 2749
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 73,
- "offset": 2440
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "tbody",
- "position": {
- "end": {
- "column": 11,
- "line": 83,
- "offset": 2760
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 11,
- 11,
- 11,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 46,
- "offset": 1658
- }
- },
- "type": "mdxBlockElement"
- }
- ],
- "name": "table",
- "position": {
- "end": {
- "column": 9,
- "line": 84,
- "offset": 2769
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 11,
- 11,
- 11,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 39,
- "offset": 1567
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 10,
- "line": 86,
- "offset": 2780
- },
- "indent": [],
- "start": {
- "column": 4,
- "line": 86,
- "offset": 2774
- }
- },
- "type": "text",
- "value": "Bodies"
- }
- ],
- "depth": 2,
- "position": {
- "end": {
- "column": 10,
- "line": 86,
- "offset": 2780
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 86,
- "offset": 2771
- }
- },
- "type": "heading"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 1,
- "line": 90,
- "offset": 2994
- },
- "indent": [
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 87,
- "offset": 2781
- }
- },
- "type": "text",
- "value": "minFraud Score, Factors and Insights share the same request body format. Below\nis a full example of the JSON body document. For detailed explainations of each\nproperty within the request body, please refer to the\n"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 18,
- "line": 90,
- "offset": 3011
- },
- "indent": [],
- "start": {
- "column": 2,
- "line": 90,
- "offset": 2995
- }
- },
- "type": "text",
- "value": "object reference"
- }
- ],
- "position": {
- "end": {
- "column": 38,
- "line": 90,
- "offset": 3031
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 90,
- "offset": 2994
- }
- },
- "title": null,
- "type": "link",
- "url": "#object-reference"
- },
- {
- "position": {
- "end": {
- "column": 53,
- "line": 90,
- "offset": 3046
- },
- "indent": [],
- "start": {
- "column": 38,
- "line": 90,
- "offset": 3031
- }
- },
- "type": "text",
- "value": " section below."
- }
- ],
- "position": {
- "end": {
- "column": 53,
- "line": 90,
- "offset": 3046
- },
- "indent": [
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 87,
- "offset": 2781
- }
- },
- "type": "paragraph"
- },
- {
- "attributes": [
- {
- "name": "language",
- "position": {
- "end": {
- "column": 25,
- "line": 92,
- "offset": 3072
- },
- "start": {
- "column": 10,
- "line": 92,
- "offset": 3057
- }
- },
- "type": "mdxAttribute",
- "value": "json"
- }
- ],
- "children": [
- {
- "position": {
- "end": {
- "column": 41,
- "line": 93,
- "offset": 3114
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 93,
- "offset": 3074
- }
- },
- "type": "mdxBlockExpression",
- "value": "JSON.stringify(requestJson, null, 2)"
- }
- ],
- "name": "Example",
- "position": {
- "end": {
- "column": 11,
- "line": 94,
- "offset": 3125
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 92,
- "offset": 3048
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 20,
- "line": 96,
- "offset": 3146
- },
- "indent": [],
- "start": {
- "column": 4,
- "line": 96,
- "offset": 3130
- }
- },
- "type": "text",
- "value": "Object Reference"
- }
- ],
- "depth": 2,
- "position": {
- "end": {
- "column": 20,
- "line": 96,
- "offset": 3146
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 96,
- "offset": 3127
- }
- },
- "type": "heading"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 8,
- "line": 99,
- "offset": 3230
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 98,
- "offset": 3148
- }
- },
- "type": "text",
- "value": "Below are the schema definitions of that make up the minFraud request body\nobject."
- }
- ],
- "position": {
- "end": {
- "column": 8,
- "line": 99,
- "offset": 3230
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 98,
- "offset": 3148
- }
- },
- "type": "paragraph"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 22,
- "line": 103,
- "offset": 3412
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 101,
- "offset": 3232
- }
- },
- "type": "text",
- "value": "Each schema definition contains a description of an object, along with a list of\nproperties that belong to the object. The following information is listed for\neach object property:"
- }
- ],
- "position": {
- "end": {
- "column": 22,
- "line": 103,
- "offset": 3412
- },
- "indent": [
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 101,
- "offset": 3232
- }
- },
- "type": "paragraph"
- },
- {
- "children": [
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 7,
- "line": 105,
- "offset": 3420
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 105,
- "offset": 3416
- }
- },
- "type": "text",
- "value": "name"
- }
- ],
- "position": {
- "end": {
- "column": 7,
- "line": 105,
- "offset": 3420
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 105,
- "offset": 3416
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 7,
- "line": 105,
- "offset": 3420
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 105,
- "offset": 3414
- }
- },
- "spread": false,
- "type": "listItem"
- },
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 9,
- "line": 106,
- "offset": 3429
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 106,
- "offset": 3423
- }
- },
- "type": "text",
- "value": "type ("
- },
- {
- "position": {
- "end": {
- "column": 22,
- "line": 106,
- "offset": 3442
- },
- "indent": [],
- "start": {
- "column": 9,
- "line": 106,
- "offset": 3429
- }
- },
- "type": "inlineCode",
- "value": "array"
- },
- {
- "position": {
- "end": {
- "column": 24,
- "line": 106,
- "offset": 3444
- },
- "indent": [],
- "start": {
- "column": 22,
- "line": 106,
- "offset": 3442
- }
- },
- "type": "text",
- "value": ", "
- },
- {
- "position": {
- "end": {
- "column": 33,
- "line": 106,
- "offset": 3453
- },
- "indent": [],
- "start": {
- "column": 24,
- "line": 106,
- "offset": 3444
- }
- },
- "type": "inlineCode",
- "value": "boolean"
- },
- {
- "position": {
- "end": {
- "column": 35,
- "line": 106,
- "offset": 3455
- },
- "indent": [],
- "start": {
- "column": 33,
- "line": 106,
- "offset": 3453
- }
- },
- "type": "text",
- "value": ", "
- },
- {
- "position": {
- "end": {
- "column": 43,
- "line": 106,
- "offset": 3463
- },
- "indent": [],
- "start": {
- "column": 35,
- "line": 106,
- "offset": 3455
- }
- },
- "type": "inlineCode",
- "value": "number"
- },
- {
- "position": {
- "end": {
- "column": 45,
- "line": 106,
- "offset": 3465
- },
- "indent": [],
- "start": {
- "column": 43,
- "line": 106,
- "offset": 3463
- }
- },
- "type": "text",
- "value": ", "
- },
- {
- "position": {
- "end": {
- "column": 54,
- "line": 106,
- "offset": 3474
- },
- "indent": [],
- "start": {
- "column": 45,
- "line": 106,
- "offset": 3465
- }
- },
- "type": "inlineCode",
- "value": "integer"
- },
- {
- "position": {
- "end": {
- "column": 56,
- "line": 106,
- "offset": 3476
- },
- "indent": [],
- "start": {
- "column": 54,
- "line": 106,
- "offset": 3474
- }
- },
- "type": "text",
- "value": ", "
- },
- {
- "position": {
- "end": {
- "column": 64,
- "line": 106,
- "offset": 3484
- },
- "indent": [],
- "start": {
- "column": 56,
- "line": 106,
- "offset": 3476
- }
- },
- "type": "inlineCode",
- "value": "object"
- },
- {
- "position": {
- "end": {
- "column": 66,
- "line": 106,
- "offset": 3486
- },
- "indent": [],
- "start": {
- "column": 64,
- "line": 106,
- "offset": 3484
- }
- },
- "type": "text",
- "value": ", "
- },
- {
- "position": {
- "end": {
- "column": 74,
- "line": 106,
- "offset": 3494
- },
- "indent": [],
- "start": {
- "column": 66,
- "line": 106,
- "offset": 3486
- }
- },
- "type": "inlineCode",
- "value": "string"
- },
- {
- "position": {
- "end": {
- "column": 75,
- "line": 106,
- "offset": 3495
- },
- "indent": [],
- "start": {
- "column": 74,
- "line": 106,
- "offset": 3494
- }
- },
- "type": "text",
- "value": ")"
- }
- ],
- "position": {
- "end": {
- "column": 75,
- "line": 106,
- "offset": 3495
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 106,
- "offset": 3423
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 75,
- "line": 106,
- "offset": 3495
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 106,
- "offset": 3421
- }
- },
- "spread": false,
- "type": "listItem"
- },
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 14,
- "line": 107,
- "offset": 3509
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 107,
- "offset": 3498
- }
- },
- "type": "text",
- "value": "description"
- }
- ],
- "position": {
- "end": {
- "column": 14,
- "line": 107,
- "offset": 3509
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 107,
- "offset": 3498
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 14,
- "line": 107,
- "offset": 3509
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 107,
- "offset": 3496
- }
- },
- "spread": false,
- "type": "listItem"
- },
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 10,
- "line": 108,
- "offset": 3519
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 108,
- "offset": 3512
- }
- },
- "type": "text",
- "value": "example"
- }
- ],
- "position": {
- "end": {
- "column": 10,
- "line": 108,
- "offset": 3519
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 108,
- "offset": 3512
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 10,
- "line": 108,
- "offset": 3519
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 108,
- "offset": 3510
- }
- },
- "spread": false,
- "type": "listItem"
- },
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 13,
- "line": 109,
- "offset": 3532
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 109,
- "offset": 3522
- }
- },
- "type": "text",
- "value": "formatting"
- }
- ],
- "position": {
- "end": {
- "column": 13,
- "line": 109,
- "offset": 3532
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 109,
- "offset": 3522
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 13,
- "line": 109,
- "offset": 3532
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 109,
- "offset": 3520
- }
- },
- "spread": false,
- "type": "listItem"
- },
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 50,
- "line": 110,
- "offset": 3582
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 110,
- "offset": 3535
- }
- },
- "type": "text",
- "value": "constraints (format, min/max, max length, etc.)"
- }
- ],
- "position": {
- "end": {
- "column": 50,
- "line": 110,
- "offset": 3582
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 110,
- "offset": 3535
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 50,
- "line": 110,
- "offset": 3582
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 110,
- "offset": 3533
- }
- },
- "spread": false,
- "type": "listItem"
- },
- {
- "checked": null,
- "children": [
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 23,
- "line": 111,
- "offset": 3605
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 111,
- "offset": 3585
- }
- },
- "type": "text",
- "value": "supported services ("
- },
- {
- "position": {
- "end": {
- "column": 30,
- "line": 111,
- "offset": 3612
- },
- "indent": [],
- "start": {
- "column": 23,
- "line": 111,
- "offset": 3605
- }
- },
- "type": "inlineCode",
- "value": "Score"
- },
- {
- "position": {
- "end": {
- "column": 32,
- "line": 111,
- "offset": 3614
- },
- "indent": [],
- "start": {
- "column": 30,
- "line": 111,
- "offset": 3612
- }
- },
- "type": "text",
- "value": ", "
- },
- {
- "position": {
- "end": {
- "column": 41,
- "line": 111,
- "offset": 3623
- },
- "indent": [],
- "start": {
- "column": 32,
- "line": 111,
- "offset": 3614
- }
- },
- "type": "inlineCode",
- "value": "Factors"
- },
- {
- "position": {
- "end": {
- "column": 43,
- "line": 111,
- "offset": 3625
- },
- "indent": [],
- "start": {
- "column": 41,
- "line": 111,
- "offset": 3623
- }
- },
- "type": "text",
- "value": ", "
- },
- {
- "position": {
- "end": {
- "column": 53,
- "line": 111,
- "offset": 3635
- },
- "indent": [],
- "start": {
- "column": 43,
- "line": 111,
- "offset": 3625
- }
- },
- "type": "inlineCode",
- "value": "Insights"
- },
- {
- "position": {
- "end": {
- "column": 54,
- "line": 111,
- "offset": 3636
- },
- "indent": [],
- "start": {
- "column": 53,
- "line": 111,
- "offset": 3635
- }
- },
- "type": "text",
- "value": ")"
- }
- ],
- "position": {
- "end": {
- "column": 54,
- "line": 111,
- "offset": 3636
- },
- "indent": [],
- "start": {
- "column": 3,
- "line": 111,
- "offset": 3585
- }
- },
- "type": "paragraph"
- }
- ],
- "position": {
- "end": {
- "column": 54,
- "line": 111,
- "offset": 3636
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 111,
- "offset": 3583
- }
- },
- "spread": false,
- "type": "listItem"
- }
- ],
- "ordered": false,
- "position": {
- "end": {
- "column": 54,
- "line": 111,
- "offset": 3636
- },
- "indent": [
- 1,
- 1,
- 1,
- 1,
- 1,
- 1
- ],
- "start": {
- "column": 1,
- "line": 105,
- "offset": 3414
- }
- },
- "spread": false,
- "start": null,
- "type": "list"
- },
- {
- "children": [
- {
- "position": {
- "end": {
- "column": 19,
- "line": 113,
- "offset": 3656
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 113,
- "offset": 3638
- }
- },
- "type": "text",
- "value": "Additionally, for "
- },
- {
- "position": {
- "end": {
- "column": 27,
- "line": 113,
- "offset": 3664
- },
- "indent": [],
- "start": {
- "column": 19,
- "line": 113,
- "offset": 3656
- }
- },
- "type": "inlineCode",
- "value": "object"
- },
- {
- "position": {
- "end": {
- "column": 56,
- "line": 114,
- "offset": 3768
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 27,
- "line": 113,
- "offset": 3664
- }
- },
- "type": "text",
- "value": " properties, a link is provided to view a schema\ndefinition that further describes that specific object."
- }
- ],
- "position": {
- "end": {
- "column": 56,
- "line": 114,
- "offset": 3768
- },
- "indent": [
- 1
- ],
- "start": {
- "column": 1,
- "line": 113,
- "offset": 3638
- }
- },
- "type": "paragraph"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.Request",
- "position": {
- "end": {
- "column": 20,
- "line": 116,
- "offset": 3789
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 116,
- "offset": 3770
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestDevice",
- "position": {
- "end": {
- "column": 26,
- "line": 117,
- "offset": 3815
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 117,
- "offset": 3790
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestEvent",
- "position": {
- "end": {
- "column": 25,
- "line": 118,
- "offset": 3840
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 118,
- "offset": 3816
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestAccount",
- "position": {
- "end": {
- "column": 27,
- "line": 119,
- "offset": 3867
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 119,
- "offset": 3841
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestEmail",
- "position": {
- "end": {
- "column": 25,
- "line": 120,
- "offset": 3892
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 120,
- "offset": 3868
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestBilling",
- "position": {
- "end": {
- "column": 27,
- "line": 121,
- "offset": 3919
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 121,
- "offset": 3893
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestShipping",
- "position": {
- "end": {
- "column": 28,
- "line": 122,
- "offset": 3947
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 122,
- "offset": 3920
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestPayment",
- "position": {
- "end": {
- "column": 27,
- "line": 123,
- "offset": 3974
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 123,
- "offset": 3948
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestCreditCard",
- "position": {
- "end": {
- "column": 30,
- "line": 124,
- "offset": 4004
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 124,
- "offset": 3975
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestOrder",
- "position": {
- "end": {
- "column": 25,
- "line": 125,
- "offset": 4029
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 125,
- "offset": 4005
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestShoppingCart",
- "position": {
- "end": {
- "column": 32,
- "line": 126,
- "offset": 4061
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 126,
- "offset": 4030
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestShoppingCartItem",
- "position": {
- "end": {
- "column": 36,
- "line": 127,
- "offset": 4097
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 127,
- "offset": 4062
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "attributes": [],
- "children": [],
- "name": "Schemas.RequestCustomInputs",
- "position": {
- "end": {
- "column": 32,
- "line": 128,
- "offset": 4129
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 128,
- "offset": 4098
- }
- },
- "type": "mdxBlockElement"
- },
- {
- "position": {
- "end": {
- "column": 76,
- "line": 131,
- "offset": 4207
- },
- "indent": [],
- "start": {
- "column": 1,
- "line": 131,
- "offset": 4132
- }
- },
- "type": "export",
- "value": "export const _frontmatter = {\"draft\":false,\"title\":\"minFraud API Requests\"}"
- }
- ],
- "position": {
- "end": {
- "column": 76,
- "line": 131,
- "offset": 4207
- },
- "start": {
- "column": 1,
- "line": 1,
- "offset": 0
- }
- },
- "type": "root"
- }
- }
- ]
- }
- },
- "extensions": {}
-}
diff --git a/src/utils/get-toc-items.spec.ts b/src/utils/get-toc-items.spec.ts
deleted file mode 100644
index 502564dda..000000000
--- a/src/utils/get-toc-items.spec.ts
+++ /dev/null
@@ -1,160 +0,0 @@
-import generateTableOfContents, { createImportPathMap } from './get-toc-items';
-import directSchemas from './get-toc-items--direct.fixture.json';
-import indirectSchemas from './get-toc-items--indirect.fixture.json';
-
-const minFraudImportPathMap = createImportPathMap(
- `${process.cwd()}/content/minfraud/api-documentation/_schemas`
-);
-
-describe('getTocItems()', () => {
- it('works with direct `Schema` component usage', async () => {
- const mdast = (
- directSchemas as any
- ).data.allMdx.nodes[0].customTableOfContents;
-
- const toc = generateTableOfContents(mdast, minFraudImportPathMap);
-
- const expected = {
- items: [
- {
- items: [
- {
- title: 'Level 1a - Link 1',
- url: '#schema--level-1a---link-1',
- },
- {
- items: [
- {
- title: 'Level 2a - Link 1',
- url: '#schema--level-2a---link-1',
- },
- {
- title: 'Level 2a - Link 2',
- url: '#schema--level-2a---link-2',
- },
- ],
- title: 'Level 2a',
- url: '#level-2a',
- },
- {
- items: [
- {
- title: 'Level 2b - Link 1',
- url: '#schema--level-2b---link-1',
- },
- {
- title: 'Level 2b - Link 2',
- url: '#schema--level-2b---link-2',
- },
- ],
- title: 'Level 2b',
- url: '#level-2b',
- },
- ],
- title: 'Level 1a',
- url: '#level-1a',
- },
- {
- items: [
- {
- title: 'Level 1b - Link 1',
- url: '#schema--level-1b---link-1',
- },
- ],
- title: 'Level 1b',
- url: '#level-1b',
- },
- ],
- };
-
- expect(toc).toEqual(expected);
- });
-
- it('works with indirect `Schema` component usage', async () => {
- const mdast = (indirectSchemas as any)
- .data.allMdx.nodes[0].customTableOfContents;
-
- const toc = generateTableOfContents(mdast, minFraudImportPathMap);
-
- const expected = {
- items: [
- {
- title: 'Authorization and Security',
- url: '#authorization-and-security',
- },
- {
- title: 'Service Endpoints',
- url: '#service-endpoints',
- },
- {
- title: 'Headers',
- url: '#headers',
- },
- {
- title: 'Bodies',
- url: '#bodies',
- },
- {
- items: [
- {
- title: 'Request',
- url: '#schema--request',
- },
- {
- title: 'Request › Device',
- url: '#schema--request--device',
- },
- {
- title: 'Request › Event',
- url: '#schema--request--event',
- },
- {
- title: 'Request › Account',
- url: '#schema--request--account',
- },
- {
- title: 'Request › Email',
- url: '#schema--request--email',
- },
- {
- title: 'Request › Billing',
- url: '#schema--request--billing',
- },
- {
- title: 'Request › Shipping',
- url: '#schema--request--shipping',
- },
- {
- title: 'Request › Payment',
- url: '#schema--request--payment',
- },
- {
- title: 'Request › Credit Card',
- url: '#schema--request--credit-card',
- },
- {
- title: 'Request › Order',
- url: '#schema--request--order',
- },
- {
- title: 'Request › Shopping Cart',
- url: '#schema--request--shopping-cart',
- },
- {
- title: 'Request › Shopping Cart › Item',
- url: '#schema--request--shopping-cart--item',
- },
- {
- title: 'Request › Custom Inputs',
- url: '#schema--request--custom-inputs',
- },
- ],
- title: 'Object Reference',
- url: '#object-reference',
- },
- ],
- };
-
- expect(toc).toEqual(expected);
- });
-});
diff --git a/src/utils/get-toc-items.ts b/src/utils/get-toc-items.ts
deleted file mode 100644
index ccbdd578d..000000000
--- a/src/utils/get-toc-items.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-import fs from 'fs';
-import path from 'path';
-// eslint-disable-next-line import/no-unresolved
-import { Parent } from 'unist';
-
-/* eslint-disable @typescript-eslint/no-var-requires */
-// eslint-disable-next-line max-len
-const getTableOfContents = require('gatsby-plugin-mdx/utils/get-table-of-content');
-const generateTOC = require('mdast-util-toc');
-const parse = require('remark-parse');
-const mdx = require('remark-mdx');
-const stringify = require('remark-stringify');
-const unified = require('unified');
-const map = require('unist-util-map');
-const find = require('unist-util-find');
-const findBefore = require('unist-util-find-before');
-const visitParents = require('unist-util-visit-parents');
-
-/**
- * To get the add `Schema` component names to the table of contents, the
- * abstract syntax tree (AST) needs to be modified so that `mdast-util-toc`
- * and `gatsby-plugin-mdx/utils/get-table-of-content` think `Schema` nodes are
- * heading nodes.
- *
- * This code searches for AST nodes of direct `Schema` usage (node name of
- * `Schema`) or indirect Schema usage (node name of `Schemas.*`), gets the
- * `name` attribute value, and then replaces the node with a heading node that
- * is one deeper than the closest heading.
- */
-
-/* eslint-disable security/detect-non-literal-fs-filename */
-export const createImportPathMap = (
- schemaDir: string
-): Record =>
- fs.readdirSync(schemaDir).reduce((acc, file) => {
- if (fs.lstatSync(path.resolve(schemaDir, file)).isDirectory()) {
- return acc;
- }
-
- return {
- ...acc,
- [`Schemas.${path.basename(file, '.mdx')}`]: path.resolve(
- schemaDir,
- file
- ),
- };
- }, {});
-/* eslint-enable security/detect-non-literal-fs-filename */
-
-export default (
- sourceTree: any,
- importPathMap: Record,
-): any => {
- const newTree = map(
- sourceTree,
- (node: any) => {
- if (
- node.type !== 'mdxBlockElement'
- || !(node.name as string).startsWith('Schema')
- ) {
- return node;
- }
-
- let schemaNode: any = node;
-
- /**
- * Schema component instances can either be used directly in an MDX file,
- * or indirectly via an imported MDX file. Indirect instances require
- * additional processing to find the imported MDX file and create it's own
- * abstract syntax tree.
- *
- */
- if ((node.name as string).startsWith('Schemas')) {
- const importedComponentName = node.name as string;
-
- // eslint-disable-next-line security/detect-object-injection
- const importedFilePath = importPathMap[importedComponentName];
-
- if (importedFilePath) {
- let importedComponentTree;
-
- // eslint-disable-next-line security/detect-non-literal-fs-filename
- const fileContents = fs.readFileSync(importedFilePath);
-
- unified()
- .use(parse, {
- position: false,
- })
- .use(stringify)
- .use(mdx)
- .use(() => (node: any) => {
- importedComponentTree = node;
- })
- .processSync(fileContents);
-
- if (importedComponentTree) {
- const foundNode = find(
- importedComponentTree,
- (node: any) => node.name
- && (node.name as string).endsWith('Schema')
- );
-
- if (foundNode) {
- schemaNode = foundNode;
- }
- }
- }
- }
-
- const schemaHeadingName = (schemaNode as any).attributes.find(
- (attr: any) => attr.name === 'name'
- )?.value;
-
- if (!schemaHeadingName) {
- return;
- }
-
- let closestHeadingNode;
-
- visitParents(
- sourceTree,
- node,
- (node: any, ancestors: Parent[]) => {
- ancestors.forEach((ancestor: Parent) => {
- closestHeadingNode = findBefore(ancestor, node, 'heading');
- });
- }
- );
-
- node = {
- ...node,
- data: {
- hProperties: {
- id: `schema--${schemaHeadingName}`,
- },
- },
- depth: closestHeadingNode ? (closestHeadingNode as any).depth + 1 : 1,
- type: 'heading',
- value: schemaHeadingName.split(' | ')
- .map((part: string) => part.trim())
- .join(' › '),
- };
-
- return node;
- }
- );
-
- const toc = generateTOC(newTree, {
- maxDepth: 6,
- });
-
- return getTableOfContents(toc.map, {});
-};
diff --git a/src/utils/json.spec.ts b/src/utils/json.spec.ts
deleted file mode 100644
index 1a8e558be..000000000
--- a/src/utils/json.spec.ts
+++ /dev/null
@@ -1,191 +0,0 @@
-import {
- inferType,
- isArray,
- isBoolean,
- isNumber,
- isObject,
- isString,
-} from './json';
-
-describe('json utils', () => {
- describe('isArray()', () => {
- it('returns `true` if value is an array', () => {
- expect(isArray([])).toBe(true);
- });
-
- describe('returns `false` when', () => {
- it('value is null', () => {
- expect(isArray(null)).toBe(false);
- });
-
- it('value is a string', () => {
- expect(isArray('')).toBe(false);
- });
-
- it('value is a boolean', () => {
- expect(isArray(true)).toBe(false);
- });
-
- it('value is a number', () => {
- expect(isArray(1)).toBe(false);
- });
-
- it('value is a object', () => {
- expect(isArray({})).toBe(false);
- });
-
- });
- });
-
- describe('isBoolean()', () => {
- it('returns `true` if value is a boolean', () => {
- expect(isBoolean(true)).toBe(true);
- expect(isBoolean(false)).toBe(true);
- });
-
- describe('returns `false` when', () => {
- it('value is null', () => {
- expect(isBoolean(null)).toBe(false);
- });
-
- it('value is a string', () => {
- expect(isBoolean('')).toBe(false);
- });
-
- it('value is a number', () => {
- expect(isBoolean(1)).toBe(false);
- });
-
- it('value is a object', () => {
- expect(isBoolean({})).toBe(false);
- });
-
- it('value is an array', () => {
- expect(isBoolean([])).toBe(false);
- });
- });
- });
-
- describe('isNumber()', () => {
- it('returns `true` if value is a number', () => {
- expect(isNumber(0)).toBe(true);
- expect(isNumber(1)).toBe(true);
- expect(isNumber(1.1)).toBe(true);
- });
-
- describe('returns `false` when', () => {
- it('value is null', () => {
- expect(isNumber(null)).toBe(false);
- });
-
- it('value is a string', () => {
- expect(isNumber('')).toBe(false);
- });
-
- it('value is a boolean', () => {
- expect(isNumber(true)).toBe(false);
- });
-
- it('value is an object', () => {
- expect(isNumber({})).toBe(false);
- });
-
- it('value is an array', () => {
- expect(isNumber([])).toBe(false);
- });
- });
- });
-
- describe('isObject()', () => {
- it('returns `true` if value is a boolean', () => {
- expect(isObject({})).toBe(true);
- });
-
- describe('returns `false` when', () => {
- it('value is null', () => {
- expect(isObject(null)).toBe(false);
- });
-
- it('value is a string', () => {
- expect(isObject('')).toBe(false);
- });
-
- it('value is a number', () => {
- expect(isObject(1)).toBe(false);
- });
-
- it('value is a boolean', () => {
- expect(isObject(false)).toBe(false);
- });
-
- it('value is an array', () => {
- expect(isObject([])).toBe(false);
- });
- });
- });
-
- describe('isString()', () => {
- it('returns `true` if value is a string', () => {
- expect(isString('')).toBe(true);
- });
-
- describe('returns `false` when', () => {
- it('value is null', () => {
- expect(isString(null)).toBe(false);
- });
-
- it('value is a number', () => {
- expect(isString(1)).toBe(false);
- });
-
- it('value is a boolean', () => {
- expect(isString(false)).toBe(false);
- });
-
- it('value is an object', () => {
- expect(isString({})).toBe(false);
- });
-
- it('value is an array', () => {
- expect(isString([])).toBe(false);
- });
- });
- });
-
- describe('inferType()', () => {
- it('returns `array` when given an array', () => {
- expect(inferType([])).toBe('array');
- });
-
- it('returns `boolean` when given an boolean', () => {
- expect(inferType(true)).toBe('boolean');
- });
-
- it('returns `number` when given a number', () => {
- expect(inferType(1)).toBe('number');
- });
-
- it('returns `object` when given an object', () => {
- expect(inferType({})).toBe('object');
- });
-
- it('returns `string` when given a string', () => {
- expect(inferType('')).toBe('string');
- });
-
- it('throws an error if a type cannot be inferred', () => {
- const spy = jest.spyOn(console, 'error').mockImplementation();
-
- expect(() => inferType(null)).toThrowError(
- // eslint-disable-next-line max-len
- 'Cannot infer type from value. See console error labeled: `Invalid Type`'
- );
-
- expect(console.error).toHaveBeenLastCalledWith('Invalid Type', null);
-
- spy.mockRestore();
- });
- });
-});
-
-
diff --git a/src/utils/json.ts b/src/utils/json.ts
deleted file mode 100644
index 2041b0337..000000000
--- a/src/utils/json.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import _isBoolean from 'lodash.isboolean';
-import _isNumber from 'lodash.isnumber';
-import isPlainObject from 'lodash.isplainobject';
-
-export const isArray = (
- value: Json
-): value is IJsonArray => Array.isArray(value);
-
-export const isBoolean = (
- value: Json
-): value is boolean => _isBoolean(value);
-
-export const isNumber = (
- value: Json
-): value is number => _isNumber(value);
-
-export const isObject = (
- value: Json
-): value is IJsonObject => isPlainObject(value);
-
-export const isString = (
- value: Json
-): value is string => typeof value === 'string';
-
-export const inferType = (value: Json): string => {
- if (isArray(value)) {
- return 'array';
- }
-
- if (isBoolean(value)) {
- return 'boolean';
- }
-
- if (isObject(value)) {
- return 'object';
- }
-
- if (isNumber(value)) {
- return 'number';
- }
-
- if (isString(value)) {
- return 'string';
- }
-
- console.error('Invalid Type', value);
-
- throw new Error(
- 'Cannot infer type from value. See console error labeled: `Invalid Type`'
- );
-};
diff --git a/src/utils/markdown.tsx b/src/utils/markdown.tsx
deleted file mode 100644
index 2b2b970ab..000000000
--- a/src/utils/markdown.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { MDXProvider } from '@mdx-js/react';
-import MDX from '@mdx-js/runtime';
-import React from 'react';
-
-import * as components from '../components/Mdx';
-
-export const renderMarkdown = (
- content: any
-): React.ReactElement => {
- return (
- /* eslint-disable-next-line max-len */
- /* @ts-expect-error: @type for @mdx-js/react has implicit children which is incompat with react 18 */
-
-
- {content}
-
-
- );
-};
diff --git a/src/utils/openapi.spec.ts b/src/utils/openapi.spec.ts
deleted file mode 100644
index 3f54a710c..000000000
--- a/src/utils/openapi.spec.ts
+++ /dev/null
@@ -1,140 +0,0 @@
-import { OpenAPIV3 } from 'openapi-types';
-
-import {
- formatSchemaName,
- isArraySchemaObject,
- isDocumentObject,
- isNonArraySchemaObject,
- isReferenceObject,
- isSchemaObject,
-} from './openapi';
-
-describe('formatSchemaName()', () => {
- describe(
- 'replaces `|` with `›`, ensuring proper spacing before and after',
- () => {
- it.each([
- [
- 'foo',
- 'foo',
- ],
- [
- ' foo ',
- 'foo',
- ],
- [
- 'foo |',
- 'foo |',
- ],
- [
- 'foo | bar',
- 'foo › bar',
- ],
- ])('given `%s`, returns `%s`', (given: string, expected: string) => {
- expect(formatSchemaName(given)).toBe(expected);
- });
- }
- );
-});
-
-describe('isArraySchemaObject()', () => {
- it('array type schema objects return true', () => {
- const obj: OpenAPIV3.SchemaObject = {
- items: {
- type: 'string',
- },
- type: 'array',
- };
- expect(isArraySchemaObject(obj)).toBe(true);
- });
-
- it('non-array type schema objects return false', () => {
- const obj: OpenAPIV3.SchemaObject = {
- type: 'string',
- };
- expect(isArraySchemaObject(obj)).toBe(false);
- });
-});
-
-describe('isDocumentObject()', () => {
- it('document objects return true', () => {
- const obj: OpenAPIV3.Document = {
- info: {
- title: '',
- version: '',
- },
- openapi: '',
- paths: {},
- };
- expect(isDocumentObject(obj)).toBe(true);
- });
-
- it('non-document objects return false', () => {
- const obj: OpenAPIV3.SchemaObject = {
- type: 'string',
- };
- expect(isDocumentObject(obj)).toBe(false);
- });
-});
-
-describe('isNonArraySchemaObject', () => {
- it('array type schema objects return false', () => {
- const obj: OpenAPIV3.SchemaObject = {
- items: {
- type: 'string',
- },
- type: 'array',
- };
- expect(isNonArraySchemaObject(obj)).toBe(false);
- });
-
- it('non-array type schema objects return true', () => {
- const obj: OpenAPIV3.NonArraySchemaObject = {
- type: 'string',
- };
- expect(isNonArraySchemaObject(obj)).toBe(true);
- });
-});
-
-describe('isReferenceObject()', () => {
- it('objects containing a `$ref` property are reference objects', () => {
- const obj: OpenAPIV3.ReferenceObject = {
- $ref: '',
- };
- expect(isReferenceObject(obj)).toBe(true);
- });
-
- it(
- 'objects that don\'t contain a `$ref` property are not reference objects',
- () => {
- const obj: OpenAPIV3.SchemaObject = {};
- expect(isReferenceObject(obj)).toBe(false);
- }
- );
-});
-
-describe('isSchemaObject()', () => {
- it('document objects are not schema objects', () => {
- const obj: OpenAPIV3.Document = {
- info: {
- title: '',
- version: '',
- },
- openapi: '',
- paths: {},
- };
- expect(isSchemaObject(obj)).toBe(false);
- });
-
- it('reference objects are not schema objects', () => {
- const obj: OpenAPIV3.ReferenceObject = {
- $ref: '',
- };
- expect(isSchemaObject(obj)).toBe(false);
- });
-
- it('any non-reference, non-document objects are schema objects', () => {
- const obj = {};
- expect(isSchemaObject(obj)).toBe(true);
- });
-});
diff --git a/src/utils/openapi.ts b/src/utils/openapi.ts
deleted file mode 100644
index 485ed7a8a..000000000
--- a/src/utils/openapi.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-/* eslint-disable no-prototype-builtins */
-import { OpenAPIV3 } from 'openapi-types';
-
-export const formatSchemaName = (schemaPath: string): string => schemaPath
- .split(' | ')
- .map((part: string) => part.trim())
- .join(' › ');
-
-export const isReferenceObject = (
- obj: OpenAPIV3.Document
- | OpenAPIV3.SchemaObject
- | OpenAPIV3.ReferenceObject
-): obj is OpenAPIV3.ReferenceObject => obj.hasOwnProperty('$ref');
-
-export const isDocumentObject = (
- obj: OpenAPIV3.Document
- | OpenAPIV3.SchemaObject
- | OpenAPIV3.ReferenceObject
-): obj is OpenAPIV3.Document => obj.hasOwnProperty('openapi');
-
-export const isSchemaObject = (
- obj: OpenAPIV3.Document
- | OpenAPIV3.SchemaObject
- | OpenAPIV3.ReferenceObject
-): obj is OpenAPIV3.SchemaObject => !isReferenceObject(obj)
- && !isDocumentObject(obj);
-
-export const isArraySchemaObject = (
- obj: OpenAPIV3.SchemaObject
-): obj is OpenAPIV3.ArraySchemaObject => isSchemaObject(obj)
- && obj.type === 'array';
-
-export const isNonArraySchemaObject = (
- obj: OpenAPIV3.SchemaObject
-): obj is OpenAPIV3.NonArraySchemaObject => !isArraySchemaObject(obj);
diff --git a/src/utils/pagination.spec.ts b/src/utils/pagination.spec.ts
deleted file mode 100644
index f2ba49d0b..000000000
--- a/src/utils/pagination.spec.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import { getNextPage, getPreviousPage } from './pagination';
-
-jest.mock('../../content/navigation', () => ([
- {
- to: 'foo',
- },
- {
- items: [
- {
- to: 'bar-item-foo',
- },
- {
- to: 'bar-item-bar',
- },
- ],
- to: 'bar',
- },
- {
- url: '#',
- },
- {
- items: [
- {
- to: 'baz-item-foo',
- },
- {
- to: 'baz-item-bar',
- },
- ],
- secondaryItems: [
- {
- to: 'baz-secondary-foo',
- },
- {
- to: 'baz-secondary-bar',
- },
- ],
- to: 'baz',
- },
-]));
-
-describe('pagination', () => {
- describe('getPreviousPage()', () => {
- it('returns previous page', () => {
- expect(getPreviousPage('bar')).toHaveProperty('to', 'foo');
- });
-
- it('returns previous page when current url ends with a slash', () => {
- expect(getPreviousPage('bar/')).toHaveProperty('to', 'foo');
- });
-
- it('returns nothing if previous page does not exist', () => {
- expect(getPreviousPage('foo')).toBeUndefined;
- });
-
- it('skips non-internal nodes', () => {
- expect(getPreviousPage('baz')).toHaveProperty('to', 'bar-item-bar');
- });
-
- it('considers `items` child pages', () => {
- expect(getPreviousPage('baz')).toHaveProperty('to', 'bar-item-bar');
- });
-
- it('considers `secondaryItems` child pages', () => {
- expect(getPreviousPage('baz-secondary-bar'))
- .toHaveProperty('to', 'baz-secondary-foo');
- });
- });
-
- describe('getNextPage()', () => {
- it('returns next page', () => {
- expect(getNextPage('foo')).toHaveProperty('to', 'bar');
- });
-
- it('returns nothing if next page does not exist', () => {
- expect(getNextPage('baz-secondary-bar')).toBeUndefined();
- });
-
- it('skips non-internal nodes', () => {
- expect(getNextPage('bar-item-bar')).toHaveProperty('to', 'baz');
- });
-
- it('considers `items` child pages', () => {
- expect(getNextPage('bar')).toHaveProperty('to', 'bar-item-foo');
- });
-
- it('considers `secondaryItems` child pages', () => {
- expect(getNextPage('baz-item-bar'))
- .toHaveProperty('to', 'baz-secondary-foo');
- });
- });
-});
diff --git a/src/utils/pagination.ts b/src/utils/pagination.ts
deleted file mode 100644
index 4b6bb041e..000000000
--- a/src/utils/pagination.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import findIndex from 'lodash.findindex';
-
-import navigation from '../../content/navigation';
-import {
- IInternalItem,
- IItem,
- isInternalItem,
-} from '../types/Item';
-
-// eslint-disable-next-line @typescript-eslint/no-explicit-any
-const flattenDeep = (arr: any[]) : any[] => Array.isArray(arr)
- ? arr.reduce( (a, b) => a.concat(flattenDeep(b)) , [])
- : [
- arr,
- ];
-
-const flattenTree = (tree: IItem[]) : IInternalItem[] => flattenDeep(
- tree.map((node: IItem) => {
- if (!isInternalItem(node)) {
- return [];
- }
-
- return [
- node,
- ...(node.items ? flattenTree(node?.items) : []),
- ...(node.secondaryItems ? flattenTree(node?.secondaryItems) : []),
- ];
- }));
-
-const flattenedNav = flattenTree(navigation);
-
-const findNodeIndex = (currentPath: string): number => findIndex(
- flattenedNav,
- (item: IInternalItem) => item.to === currentPath.replace(/\/$/, '')
-);
-
-export const getPreviousPage = (currentPath: string): void | IInternalItem => {
- const nodeIndex = findNodeIndex(currentPath);
-
- if (flattenedNav[nodeIndex - 1]) {
- return flattenedNav[nodeIndex - 1];
- }
-};
-
-export const getNextPage = (currentPath: string): void | IInternalItem => {
- const nodeIndex = findNodeIndex(currentPath);
-
- if (flattenedNav[nodeIndex + 1]) {
- return flattenedNav[nodeIndex + 1];
- }
-};