|
1 |
| -const YAML = require('yaml'); |
2 |
| -const fs = require('fs'); |
3 |
| -const path = require('path'); |
| 1 | +const YAML = require("yaml"); |
| 2 | +const fs = require("fs"); |
| 3 | +const path = require("path"); |
4 | 4 |
|
5 |
| -const customConfig = require('./custom.config.json'); |
6 |
| -const blogPosts = require('./blogposts.config.json'); |
7 |
| -const ltsVersions = require('./lts.config.json'); |
8 |
| -const numbersSpec = fs.readFileSync('./specs/numbers.yml', 'utf-8'); |
9 |
| -const phoneNumberLookupSpec = fs.readFileSync('./specs/phone-number-lookup.yml', 'utf-8'); |
10 |
| -const voiceSpec = fs.readFileSync('./specs/voice.yml', 'utf-8'); |
11 |
| -const messagingSpec = fs.readFileSync('./specs/messaging.yml', 'utf-8'); |
12 |
| -const webRtcSpec = fs.readFileSync('./specs/webrtc.yml', 'utf-8'); |
13 |
| -const multiFactorAuthSpec = fs.readFileSync('./specs/multi-factor-auth.yml', 'utf-8'); |
14 |
| -const dashSpec = fs.readFileSync('./specs/dash.json', 'utf-8'); |
15 |
| -const dashNotificationsSpec = fs.readFileSync('./specs/dashNotifications.json', 'utf-8'); |
16 |
| -const messagingInternationalSpec = fs.readFileSync('./specs/messagingInternational.json', 'utf-8'); |
17 |
| -const globalSpec = fs.readFileSync('./specs/global.yml', 'utf-8'); |
18 |
| -const globalSpec_v2 = fs.readFileSync('./specs/global-v2.yml', 'utf-8'); |
19 |
| -const globalSpec_v3 = fs.readFileSync('./specs/global-v3.yml', 'utf-8'); |
20 |
| -const globalSpec_beta = fs.readFileSync('./specs/global-beta.yml', 'utf-8'); |
21 |
| -const insightsSpec = fs.readFileSync('./specs/insights.yml', 'utf-8'); |
22 |
| -const pipedream = 'https://eowxoldwz4d7syt.m.pipedream.net'; |
23 |
| -/* TODO ONEID-1304 |
24 |
| -const identitySpec = fs.readFileSync('./specs/one-identity-management.yml', 'utf-8'); |
25 |
| -*/ |
| 5 | +const customConfig = require("./custom.config.json"); |
| 6 | +const blogPosts = require("./blogposts.config.json"); |
| 7 | +const ltsVersions = require("./lts.config.json"); |
| 8 | +const numbersSpec = fs.readFileSync("./specs/numbers.yml", "utf-8"); |
| 9 | +const phoneNumberLookupSpec = fs.readFileSync( |
| 10 | + "./specs/phone-number-lookup.yml", |
| 11 | + "utf-8" |
| 12 | +); |
| 13 | +const voiceSpec = fs.readFileSync("./specs/voice.yml", "utf-8"); |
| 14 | +const messagingSpec = fs.readFileSync("./specs/messaging.yml", "utf-8"); |
| 15 | +const webRtcSpec = fs.readFileSync("./specs/webrtc.yml", "utf-8"); |
| 16 | +const multiFactorAuthSpec = fs.readFileSync( |
| 17 | + "./specs/multi-factor-auth.yml", |
| 18 | + "utf-8" |
| 19 | +); |
| 20 | +const dashSpec = fs.readFileSync("./specs/dash.json", "utf-8"); |
| 21 | +const dashNotificationsSpec = fs.readFileSync( |
| 22 | + "./specs/dashNotifications.json", |
| 23 | + "utf-8" |
| 24 | +); |
| 25 | +const messagingInternationalSpec = fs.readFileSync( |
| 26 | + "./specs/messagingInternational.json", |
| 27 | + "utf-8" |
| 28 | +); |
| 29 | +const globalSpec = fs.readFileSync("./specs/global.yml", "utf-8"); |
| 30 | +const globalSpec_v2 = fs.readFileSync("./specs/global-v2.yml", "utf-8"); |
| 31 | +const globalSpec_v3 = fs.readFileSync("./specs/global-v3.yml", "utf-8"); |
| 32 | +const globalSpec_beta = fs.readFileSync("./specs/global-beta.yml", "utf-8"); |
| 33 | +const insightsSpec = fs.readFileSync("./specs/insights.yml", "utf-8"); |
| 34 | +const pipedream = "https://eowxoldwz4d7syt.m.pipedream.net"; |
| 35 | +/** |
| 36 | + * TODO ONEID-1304 |
| 37 | + * const identitySpec = fs.readFileSync('./specs/one-identity-management.yml', 'utf-8'); |
| 38 | + */ |
26 | 39 |
|
27 | 40 | module.exports = {
|
28 |
| - title: 'Bandwidth API Docs', |
29 |
| - tagline: 'Learn About Bandwidth\'s Product APIs', |
30 |
| - url: 'https://dev.bandwidth.com', |
31 |
| - baseUrl: '/', |
32 |
| - onBrokenLinks: 'warn', |
33 |
| - onBrokenMarkdownLinks: 'warn', |
34 |
| - favicon: 'img/favicon.ico', |
35 |
| - trailingSlash: undefined, |
36 |
| - organizationName: 'bandwidth', |
37 |
| - projectName: 'api-docs', |
38 |
| - themeConfig: { |
39 |
| - image: 'img/bw-icon.svg', // used for meta tag |
40 |
| - colorMode: { |
41 |
| - disableSwitch: false // for disabling dark mode |
42 |
| - }, |
43 |
| - algolia: { |
44 |
| - appId: 'DJ56W2DX1L', |
45 |
| - apiKey: '865921f3caf63083e8d54552b5ab7a79', |
46 |
| - indexName: 'bandwidth', |
47 |
| - contextualSearch: false, // useful for versioned Docusaurus sites |
| 41 | + title: "Bandwidth API Docs", |
| 42 | + tagline: "Learn About Bandwidth's Product APIs", |
| 43 | + url: "https://dev.bandwidth.com", |
| 44 | + baseUrl: "/", |
| 45 | + onBrokenLinks: "warn", |
| 46 | + onBrokenMarkdownLinks: "warn", |
| 47 | + favicon: "img/favicon.ico", |
| 48 | + trailingSlash: undefined, |
| 49 | + organizationName: "bandwidth", |
| 50 | + projectName: "api-docs", |
| 51 | + themeConfig: { |
| 52 | + image: "img/bw-icon.svg", // used for meta tag |
| 53 | + colorMode: { |
| 54 | + disableSwitch: false, // for disabling dark mode |
| 55 | + }, |
| 56 | + algolia: { |
| 57 | + appId: "DJ56W2DX1L", |
| 58 | + apiKey: "865921f3caf63083e8d54552b5ab7a79", |
| 59 | + indexName: "bandwidth", |
| 60 | + contextualSearch: false, // useful for versioned Docusaurus sites |
| 61 | + }, |
| 62 | + navbar: { |
| 63 | + title: "", |
| 64 | + hideOnScroll: false, |
| 65 | + logo: { |
| 66 | + alt: "Bandwidth", |
| 67 | + src: "img/dev-docs-logo.svg", |
| 68 | + }, |
| 69 | + items: [ |
| 70 | + { |
| 71 | + type: "dropdown", |
| 72 | + label: "US & Canada APIs", |
| 73 | + position: "left", |
| 74 | + items: [ |
| 75 | + { |
| 76 | + to: "docs", |
| 77 | + activeBasePath: "docs", |
| 78 | + label: "Guides", |
| 79 | + }, |
| 80 | + { |
| 81 | + to: "apis", |
| 82 | + label: "API Reference", |
| 83 | + activeBasePath: "apis", |
| 84 | + }, |
| 85 | + { |
| 86 | + to: "sdks", |
| 87 | + label: "SDKs", |
| 88 | + activeBasePath: "sdks", |
| 89 | + }, |
| 90 | + { |
| 91 | + to: "https://github.com/Bandwidth-Samples", |
| 92 | + label: "Samples", |
| 93 | + }, |
| 94 | + ], |
48 | 95 | },
|
49 |
| - navbar: { |
50 |
| - title: '', |
51 |
| - hideOnScroll: false, |
52 |
| - logo: { |
53 |
| - alt: 'Bandwidth', |
54 |
| - src: 'img/dev-docs-logo.svg', |
| 96 | + { |
| 97 | + type: "dropdown", |
| 98 | + label: "Global APIs", |
| 99 | + position: "left", |
| 100 | + items: [ |
| 101 | + { |
| 102 | + to: "apis/global", |
| 103 | + label: "Docs & API Reference", |
55 | 104 | },
|
56 |
| - items: [{ |
57 |
| - type: 'dropdown', |
58 |
| - label: 'US & Canada APIs', |
59 |
| - position: 'left', |
60 |
| - items: [ |
61 |
| - { |
62 |
| - to: 'docs', |
63 |
| - activeBasePath: 'docs', |
64 |
| - label: 'Guides', |
65 |
| - }, { |
66 |
| - to: 'apis', |
67 |
| - label: 'API Reference', |
68 |
| - activeBasePath: 'apis' |
69 |
| - }, { |
70 |
| - to: 'sdks', |
71 |
| - label: 'SDKs', |
72 |
| - activeBasePath: 'sdks' |
73 |
| - }, { |
74 |
| - to: 'https://github.com/Bandwidth-Samples', |
75 |
| - label: 'Samples', |
76 |
| - } |
77 |
| - ] |
78 |
| - }, { |
79 |
| - type: 'dropdown', |
80 |
| - label: 'Global APIs', |
81 |
| - position: 'left', |
82 |
| - items: [ |
83 |
| - { |
84 |
| - to: 'apis/global', |
85 |
| - label: 'Docs & API Reference', |
86 |
| - } |
87 |
| - ] |
88 |
| - }, { |
89 |
| - href: 'https://github.com/Bandwidth', |
90 |
| - position: 'right', |
91 |
| - className: 'github-link', |
92 |
| - title: 'Github Organization' |
93 |
| - }, { |
94 |
| - href: 'https://www.postman.com/bandwidth', // TODO: update with real postman url |
95 |
| - position: 'right', |
96 |
| - className: 'postman-link', |
97 |
| - title: 'Postman Collection' |
98 |
| - }, { |
99 |
| - href: 'https://www.bandwidth.com/login/', |
100 |
| - position: 'right', |
101 |
| - className: 'login-link', |
102 |
| - title: 'Login' |
103 |
| - }] |
| 105 | + ], |
104 | 106 | },
|
105 |
| - // prism: { |
106 |
| - // additionalLanguages: ['java'], // Breaks if you try to add more than 1 language. And still breaks redoc :((((( |
107 |
| - // }, |
| 107 | + { |
| 108 | + href: "https://github.com/Bandwidth", |
| 109 | + position: "right", |
| 110 | + className: "github-link", |
| 111 | + title: "Github Organization", |
| 112 | + }, |
| 113 | + { |
| 114 | + href: "https://www.postman.com/bandwidth", // TODO: update with real postman url |
| 115 | + position: "right", |
| 116 | + className: "postman-link", |
| 117 | + title: "Postman Collection", |
| 118 | + }, |
| 119 | + { |
| 120 | + href: "https://www.bandwidth.com/login/", |
| 121 | + position: "right", |
| 122 | + className: "login-link", |
| 123 | + title: "Login", |
| 124 | + }, |
| 125 | + ], |
108 | 126 | },
|
109 |
| - presets: [ |
110 |
| - [ |
111 |
| - '@docusaurus/preset-classic', |
112 |
| - { |
113 |
| - docs: { |
114 |
| - sidebarPath: require.resolve('./sidebar.js'), |
115 |
| - editUrl: 'https://github.com/Bandwidth/api-docs/edit/main/site/', |
116 |
| - sidebarCollapsible: true, |
117 |
| - }, |
118 |
| - blog: { |
119 |
| - showReadingTime: true, |
120 |
| - editUrl: 'https://github.com/Bandwidth/api-docs/edit/main/site/', |
121 |
| - }, |
122 |
| - theme: { |
123 |
| - customCss: require.resolve('./src/css/main.scss'), |
124 |
| - }, |
125 |
| - googleAnalytics: { |
126 |
| - trackingID: 'UA-62651840-1', |
127 |
| - anonymizeIP: false, |
128 |
| - }, |
129 |
| - } |
130 |
| - ], |
| 127 | + // prism: { |
| 128 | + // additionalLanguages: ['java'], // Breaks if you try to add more than 1 language. And still breaks redoc :((((( |
| 129 | + // }, |
| 130 | + }, |
| 131 | + presets: [ |
| 132 | + [ |
| 133 | + "@docusaurus/preset-classic", |
| 134 | + { |
| 135 | + docs: { |
| 136 | + sidebarPath: require.resolve("./sidebar.js"), |
| 137 | + editUrl: "https://github.com/Bandwidth/api-docs/edit/main/site/", |
| 138 | + sidebarCollapsible: true, |
| 139 | + }, |
| 140 | + blog: { |
| 141 | + showReadingTime: true, |
| 142 | + editUrl: "https://github.com/Bandwidth/api-docs/edit/main/site/", |
| 143 | + }, |
| 144 | + theme: { |
| 145 | + customCss: require.resolve("./src/css/main.scss"), |
| 146 | + }, |
| 147 | + googleAnalytics: { |
| 148 | + trackingID: "UA-62651840-1", |
| 149 | + anonymizeIP: false, |
| 150 | + }, |
| 151 | + }, |
131 | 152 | ],
|
132 |
| - customFields: { |
133 |
| - numbersSpec: YAML.parse(numbersSpec), |
134 |
| - numbersSpecLink: `${customConfig.numbersSpecLink}`, |
135 |
| - phoneNumberLookupSpec: YAML.parse(phoneNumberLookupSpec), |
136 |
| - phoneNumberLookupSpecLink: `${customConfig.phoneNumberLookupSpecLink}`, |
137 |
| - voiceSpec: YAML.parse(voiceSpec), |
138 |
| - voiceSpecLink: `${customConfig.voiceSpecLink}`, |
139 |
| - messagingSpec: YAML.parse(messagingSpec), |
140 |
| - messagingSpecLink: `${customConfig.messagingSpecLink}`, |
141 |
| - messagingInternationalSpec: JSON.parse(messagingInternationalSpec), |
142 |
| - messagingInternationalSpecLink: `${customConfig.messagingInternationalSpecLink}`, |
143 |
| - webRTCSpec: YAML.parse(webRtcSpec), |
144 |
| - webRtcSpecLink: `${customConfig.webRtcSpecLink}`, |
145 |
| - multiFactorAuthSpec: YAML.parse(multiFactorAuthSpec), |
146 |
| - multiFactorAuthSpecLink: `${customConfig.multiFactorAuthSpecLink}`, |
147 |
| - dashSpec: JSON.parse(dashSpec), |
148 |
| - dashSpecLink: `${customConfig.dashSpecLink}`, |
149 |
| - dashNotificationsSpec: JSON.parse(dashNotificationsSpec), |
150 |
| - dashNotificationsSpecLink: `${customConfig.dashNotificationsSpecLink}`, |
151 |
| - globalSpec: YAML.parse(globalSpec), |
152 |
| - globalSpec_v2: YAML.parse(globalSpec_v2), |
153 |
| - globalSpec_v3: YAML.parse(globalSpec_v3), |
154 |
| - globalSpec_beta: YAML.parse(globalSpec_beta), |
155 |
| - insightsSpec: YAML.parse(insightsSpec), |
156 |
| - insightsSpecLink: `${customConfig.insightsSpecLink}`, |
157 |
| - // TODO ONEID-1304 |
158 |
| - // identitySpec: YAML.parse(identitySpec), |
| 153 | + ], |
| 154 | + customFields: { |
| 155 | + numbersSpec: YAML.parse(numbersSpec), |
| 156 | + numbersSpecLink: `${customConfig.numbersSpecLink}`, |
| 157 | + phoneNumberLookupSpec: YAML.parse(phoneNumberLookupSpec), |
| 158 | + phoneNumberLookupSpecLink: `${customConfig.phoneNumberLookupSpecLink}`, |
| 159 | + voiceSpec: YAML.parse(voiceSpec), |
| 160 | + voiceSpecLink: `${customConfig.voiceSpecLink}`, |
| 161 | + messagingSpec: YAML.parse(messagingSpec), |
| 162 | + messagingSpecLink: `${customConfig.messagingSpecLink}`, |
| 163 | + messagingInternationalSpec: JSON.parse(messagingInternationalSpec), |
| 164 | + messagingInternationalSpecLink: `${customConfig.messagingInternationalSpecLink}`, |
| 165 | + webRTCSpec: YAML.parse(webRtcSpec), |
| 166 | + webRtcSpecLink: `${customConfig.webRtcSpecLink}`, |
| 167 | + multiFactorAuthSpec: YAML.parse(multiFactorAuthSpec), |
| 168 | + multiFactorAuthSpecLink: `${customConfig.multiFactorAuthSpecLink}`, |
| 169 | + dashSpec: JSON.parse(dashSpec), |
| 170 | + dashSpecLink: `${customConfig.dashSpecLink}`, |
| 171 | + dashNotificationsSpec: JSON.parse(dashNotificationsSpec), |
| 172 | + dashNotificationsSpecLink: `${customConfig.dashNotificationsSpecLink}`, |
| 173 | + globalSpec: YAML.parse(globalSpec), |
| 174 | + globalSpec_v2: YAML.parse(globalSpec_v2), |
| 175 | + globalSpec_v3: YAML.parse(globalSpec_v3), |
| 176 | + globalSpec_beta: YAML.parse(globalSpec_beta), |
| 177 | + insightsSpec: YAML.parse(insightsSpec), |
| 178 | + insightsSpecLink: `${customConfig.insightsSpecLink}`, |
| 179 | + /** |
| 180 | + * identitySpec: YAML.parse(identitySpec), |
| 181 | + */ |
159 | 182 |
|
160 |
| - blogPosts: blogPosts, |
| 183 | + blogPosts: blogPosts, |
161 | 184 |
|
162 |
| - ltsVersions: ltsVersions, |
| 185 | + ltsVersions: ltsVersions, |
163 | 186 |
|
164 |
| - pipedream: pipedream, |
| 187 | + pipedream: pipedream, |
165 | 188 |
|
166 |
| - // CSS Colors |
167 |
| - bwBlue: '#079CEE', |
168 |
| - voicePurple: '#9a59c5', |
169 |
| - messagingGreen: '#00bf8c', |
170 |
| - emergencyOrange: '#ff6f47', |
171 |
| - numbersMaroon: '#652B51', |
172 |
| - webRtcBlue: '#194F7A', |
173 |
| - mfaGreen: '#106149', |
174 |
| - white: '#FFFFFF', |
175 |
| - lightBlue: '#E6F5FD', |
176 |
| - grey: '#9C9A9B', |
177 |
| - midnight: '#084f7A', |
178 |
| - black: '#090306', |
179 |
| - redocCodeBackground: '#263238', |
180 |
| - }, |
181 |
| - plugins: [ |
182 |
| - path.resolve(__dirname, 'redoc-plugin'), |
183 |
| - [ |
184 |
| - '@docusaurus/plugin-content-docs', |
185 |
| - { |
186 |
| - id: 'migration-guides', |
187 |
| - path: 'migration-guides', |
188 |
| - routeBasePath: 'migration-guides', |
189 |
| - sidebarPath: require.resolve('./sidebarsMigrationGuides.js'), |
190 |
| - editUrl: 'https://github.com/Bandwidth/api-docs/edit/main/site/', |
191 |
| - }, |
192 |
| - ], |
193 |
| - 'docusaurus-plugin-sass', |
| 189 | + // CSS Colors |
| 190 | + bwBlue: "#079CEE", |
| 191 | + voicePurple: "#9a59c5", |
| 192 | + messagingGreen: "#00bf8c", |
| 193 | + emergencyOrange: "#ff6f47", |
| 194 | + numbersMaroon: "#652B51", |
| 195 | + webRtcBlue: "#194F7A", |
| 196 | + mfaGreen: "#106149", |
| 197 | + white: "#FFFFFF", |
| 198 | + lightBlue: "#E6F5FD", |
| 199 | + grey: "#9C9A9B", |
| 200 | + midnight: "#084f7A", |
| 201 | + black: "#090306", |
| 202 | + redocCodeBackground: "#263238", |
| 203 | + }, |
| 204 | + plugins: [ |
| 205 | + path.resolve(__dirname, "redoc-plugin"), |
| 206 | + [ |
| 207 | + "@docusaurus/plugin-content-docs", |
| 208 | + { |
| 209 | + id: "migration-guides", |
| 210 | + path: "migration-guides", |
| 211 | + routeBasePath: "migration-guides", |
| 212 | + sidebarPath: require.resolve("./sidebarsMigrationGuides.js"), |
| 213 | + editUrl: "https://github.com/Bandwidth/api-docs/edit/main/site/", |
| 214 | + }, |
194 | 215 | ],
|
| 216 | + "docusaurus-plugin-sass", |
| 217 | + ], |
195 | 218 | };
|
0 commit comments