Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test upgrading @docusaurus/core and docusaurus-openapi-docs to v3 #667

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
88be705
upgrade docusaurus and firebase
sserrata May 15, 2024
1ddd816
add sidebar.ts to ignore
sserrata May 15, 2024
ef7cbad
mv products sidebars to typescript
sserrata Jul 11, 2024
bb18ed1
fix typescript errors
sserrata Jul 11, 2024
b415a05
upgrade to 4.0.1
sserrata Aug 26, 2024
0f2df42
fix conflicts
sserrata Jul 31, 2024
58bfdc2
resolve conflicts
sserrata Aug 26, 2024
019cc5b
address scss warnings of placing non-nested styles after nested rules
sserrata Jul 12, 2024
0314b98
address more mdx parsing/syntax issues
sserrata Jul 12, 2024
0b83876
address more mdx syntax errors
sserrata Jul 12, 2024
0ca1a8f
more mdx syntax issues
sserrata Jul 12, 2024
ca178e5
more mdx syntax fixes
sserrata Jul 12, 2024
fbafd8e
remove unused page
sserrata Jul 12, 2024
2016207
update deprecated css style
sserrata Jul 12, 2024
61c8975
revert expedition docs
sserrata Aug 26, 2024
a890dfc
revert access docs
sserrata Aug 26, 2024
046586a
revert contributing doc
sserrata Aug 26, 2024
3fcddc6
revert prisma cloud docs
sserrata Aug 26, 2024
839f663
revert sase docs
sserrata Aug 26, 2024
a916cec
revert sdwan docs
sserrata Aug 26, 2024
9a298c3
revert splunk docs
sserrata Aug 26, 2024
153e34f
revert terraform docs
sserrata Aug 26, 2024
841e6f1
restored subscription.mdx
sserrata Aug 26, 2024
7682b69
renamed subscription.mdx to subscription.md
sserrata Aug 26, 2024
8a7a063
ensure latest docusaurus deps are installed
sserrata Aug 26, 2024
e2ac33b
merge markdown config
sserrata Aug 26, 2024
6ccb9db
renamed create-doc-md
sserrata Aug 26, 2024
6874972
fix imports
sserrata Aug 26, 2024
97ac66d
escape all acorns
sserrata Aug 26, 2024
c66d6c7
rename to md
sserrata Aug 26, 2024
63a908b
refactor expedition tabs to use groupId
sserrata Sep 16, 2024
a35eeb8
rename sase docs to md
sserrata Sep 16, 2024
a06893d
test omitting problem endpoint
sserrata Sep 16, 2024
7bb120b
Merge branch 'master' into upgrade-v3
sserrata Sep 17, 2024
d84fb57
Merge branch 'master' into upgrade-v3
sserrata Sep 17, 2024
4e76447
Merge branch 'master' into upgrade-v3
sserrata Sep 17, 2024
bba63eb
Bump loader-utils from 2.0.3 to 2.0.4 (#188)
dependabot[bot] Nov 16, 2022
3a6d12b
testing latest canary release
sserrata Oct 16, 2024
c914a8a
fix curl logo class
sserrata Oct 16, 2024
3ff74cc
add json and bash to additional languages
sserrata Oct 16, 2024
2357ceb
upgrade to latest canary
sserrata Oct 17, 2024
d6c11bd
Update package.json
sserrata Nov 1, 2024
8fa4784
upgrade to latest docusaurus and plugin canary, enable docusaurus faster
sserrata Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ products/**/*.api.mdx
products/**/*.info.mdx
products/**/*.tag.mdx
products/**/sidebar.js
products/**/sidebar.ts
products/**/versions.json
44 changes: 12 additions & 32 deletions docusaurus.config.js → docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Mermaid from "@theme/Mermaid";

/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

let baseUrl
if (process.env.CI_MERGE_REQUEST_IID) {
if (process.env.CI_PROJECT_DIR == "dev") {
baseUrl = "/";
Expand All @@ -18,6 +20,9 @@ if (process.env.CI_MERGE_REQUEST_IID) {
}

const config = {
future: {
experimental_faster: (process.env.DOCUSAURUS_FASTER ?? "true") === "true",
},
title: "Develop with Palo Alto Networks",
tagline:
"Explore our API Doc, Quickstarts, and Blog or dive right in and play in our sandbox. We have all the tools you needs to make the next big security innovation. SDKs in your favorite languages, detailed walk-throughs for sample apps, and all the resources you’ll need to flourish.",
Expand All @@ -28,16 +33,16 @@ const config = {
favicon: "img/PANW_Parent_Glyph_Red.svg",
organizationName: "PaloAltoNetworks",
projectName: "pan.dev",
markdown: { format: "detect" },
markdown: { format: "detect", mermaid: true },
themeConfig: {
prism: {
additionalLanguages: ["csharp", "php", "hcl"],
additionalLanguages: ["csharp", "php", "hcl", "json", "bash"],
},
languageTabs: [
{
highlight: "bash",
language: "curl",
logoClass: "bash",
logoClass: "curl",
},
{
highlight: "python",
Expand Down Expand Up @@ -603,9 +608,6 @@ const config = {
copyright: `Copyright © ${new Date().getFullYear()} Palo Alto Networks, Inc.`,
},
},
markdown: {
mermaid: true,
},
themes: ["docusaurus-theme-openapi-docs", "@docusaurus/theme-mermaid"],
presets: [
[
Expand Down Expand Up @@ -872,7 +874,7 @@ const config = {
id: "default",
routeBasePath: "/",
path: "products",
sidebarPath: "./sidebars.js",
sidebarPath: "./sidebars.ts",
editUrl: "https://github.com/PaloAltoNetworks/pan.dev/tree/master",
include: ["**/*.{md,mdx}"],
docItemComponent: "@theme/ApiItem",
Expand All @@ -896,28 +898,6 @@ const config = {
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
trailingSlash: true,
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve("swc-loader"),
options: {
jsc: {
parser: {
syntax: "typescript",
tsx: true,
},
target: "es2019",
transform: {
react: {
runtime: "automatic",
},
},
},
module: {
type: isServer ? "commonjs" : "es6",
},
},
}),
},
customFields: {
firebaseApiKey: process.env.REACT_APP_FIREBASE_APIKEY,
recaptchaApiKey: process.env.REACT_APP_RECAPTCHA_APIKEY,
Expand All @@ -929,7 +909,7 @@ const config = {
Takes in list of products to filter based on directory, outputs list of globby include for the doc plugin
*/
function docsPluginInclude(filters) {
include = [];
let include = [] as any;
filters.forEach((product) => {
let product_include = product + "/**/*.{md,mdx}";
include.push(product_include);
Expand All @@ -941,7 +921,7 @@ async function createConfig() {
let filters =
process.env.PRODUCTS_INCLUDE && process.env.PRODUCTS_INCLUDE.split(",");
if (filters) {
config.plugins[4][1].include = docsPluginInclude(filters);
config.plugins[4][1]["include"] = docsPluginInclude(filters);
}
return config;
}
Expand Down
89 changes: 0 additions & 89 deletions openapi-specs/cspm/CDEMMicroServices.json
Original file line number Diff line number Diff line change
Expand Up @@ -1067,95 +1067,6 @@
]
}
},
"/asm/api/v1/asset/{asset_id}": {
"get": {
"tags": [
"Discovery and Exposure Management"
],
"summary": "Get Asset Details by ID",
"description": "Get asset overview or details by asset id.",
"operationId": "get-asset-details",
"parameters": [
{
"name": "asset_id",
"in": "path",
"description": "Asset ID",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "snapshot_date",
"in": "query",
"description": "Snapshot date",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "asset_type",
"in": "query",
"description": "Asset type",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "manage_type",
"in": "query",
"description": "Manage type",
"required": false,
"schema": {
"type": "string",
"default": "UNMANAGED"
}
},
{
"name": "all_asset_details",
"in": "query",
"description": "Set it true to fetch all asset details.",
"required": false,
"schema": {
"type": "boolean",
"default": false
}
}
],
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"404": {
"description": "Data not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
}
}
},
"x-public": "true",
"security": [
{
"x-redlock-auth": []
}
]
}
},
"/asm/api/v1/asset/{asset_id}/vulnerability": {
"get": {
"tags": [
Expand Down
27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,25 @@
},
"dependencies": {
"@docsearch/react": "^3.3.0",
"@docusaurus/core": "2.4.3",
"@docusaurus/plugin-client-redirects": "2.4.3",
"@docusaurus/preset-classic": "2.4.3",
"@docusaurus/theme-classic": "2.4.3",
"@docusaurus/theme-mermaid": "2.4.3",
"@docusaurus/core": "3.6.1",
"@docusaurus/faster": "3.6.1",
"@docusaurus/plugin-client-redirects": "3.6.1",
"@docusaurus/preset-classic": "3.6.1",
"@docusaurus/theme-classic": "3.6.1",
"@docusaurus/theme-mermaid": "3.6.1",
"algoliasearch": "^4.14.2",
"clsx": "^1.2.1",
"docusaurus-plugin-openapi-docs": "2.2.3",
"docusaurus-plugin-openapi-docs": "0.0.0-949",
"docusaurus-plugin-sass": "^0.2.2",
"docusaurus-theme-openapi-docs": "2.2.3",
"docusaurus-theme-openapi-docs": "0.0.0-949",
"fast-xml-parser": "^4.0.10",
"firebase": "^9.14.0",
"firebase": "^10.12.0",
"plugin-sitemap-coveo": "./plugin-sitemap-coveo",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-responsive": "^9.0.0",
"react-slick": "^0.29.0",
"sass": "^1.54.1",
"react-responsive": "^10.0.0",
"react-slick": "^0.30.2",
"sass": "^1.77.8",
"slick-carousel": "^1.8.1",
"stackdriver-errors-js": "^0.12.0"
},
Expand All @@ -77,13 +78,11 @@
]
},
"devDependencies": {
"@swc/core": "^1.7.14",
"cross-env": "^7.0.3",
"husky": "^8.0.2",
"lint-staged": "^13.0.3",
"prettier": "2.7.1",
"rimraf": "^3.0.2",
"run-script-os": "^1.1.6",
"swc-loader": "^0.2.6"
"run-script-os": "^1.1.6"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 3 additions & 24 deletions products/expedition/docs/creating_credentials.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,6 @@ image: /expedition/img/expedition.png
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Link from "@docusaurus/Link";
export function SetLanguage(lang) {
if (typeof window !== "undefined") {
localStorage.setItem("defaultLanguage", lang);
window.location.reload();
}
}

**Choose language for code snippet**

<a className="button button--primary" onClick={() => SetLanguage("python")}>
Python
</a>
&nbsp;
<a className="button button--info" onClick={() => SetLanguage("php")}>
Php
</a>
&nbsp;
<a className="button button--danger" onClick={() => SetLanguage("go")}>
Go
</a>
<br />
<br />

In this section we present a workflow example to migrate a third party vendor configuration into a PANOS configuration.

Expand Down Expand Up @@ -74,9 +52,10 @@ API syntax for generate API key:

| Method | EndPoint | Parameters | Example Value |
| ------ | ---------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------ |
| POST | <small>`https://localhost/api/v1/generate_api_key`</small> | <small>username, password</small> | <small>{**"username"**:"admin", **"password"**:"paloalto"}</small> |
| POST | <small>`https://localhost/api/v1/generate_api_key`</small> | <small>username, password</small> | <small>\{**"username"**:"admin", **"password"**:"paloalto"}</small> |

<Tabs defaultValue={typeof window !== 'undefined' && localStorage.getItem('defaultLanguage') ? localStorage.getItem('defaultLanguage') : 'python'}
<Tabs
groupId="expedition-language"
values={[
{ label: 'Python', value: 'python', },
{ label: 'Php', value: 'php', },
Expand Down
34 changes: 8 additions & 26 deletions products/expedition/docs/managing_expedition_agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,7 @@ image: /expedition/img/expedition.png
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Link from "@docusaurus/Link";
export function SetLanguage(lang) {
if (typeof window !== "undefined") {
localStorage.setItem("defaultLanguage", lang);
window.location.reload();
}
}

**Choose language for code snippet**

<a className="button button--primary" onClick={() => SetLanguage("python")}>
Python
</a>
&nbsp;
<a className="button button--info" onClick={() => SetLanguage("php")}>
Php
</a>
&nbsp;
<a className="button button--danger" onClick={() => SetLanguage("go")}>
Go
</a>
<br />
<br />


In this section we describe the Expedition's agent and the calls that we can execute to change its status.

Expand All @@ -59,7 +38,7 @@ The calls comply with the following structure:

| Method | EndPoint | Parameters |
| ------- | -------------------------------------------------------- | ---------------------------------------------------- |
| GET | <small>`https://localhost/api/v1/agent/<action>`</small> | <small>action : { start \| stop \| restart }</small> |
| GET | <small>`https://localhost/api/v1/agent/<action>`</small> | <small>action : \{ start \| stop \| restart }</small> |
| Example | <small>`https://localhost/api/v1/agent/restart`</small> | <small></small> |

### Starting the Agent
Expand All @@ -68,7 +47,8 @@ Starting the agent would require having an authenticated session. If stopped, th
In the provided code, SSL certificate verification is bypassed, so it would run with the defaults Expedition installation in case no SSL certificates have been generated
to certify the HTTPS service.

<Tabs defaultValue={typeof window !== 'undefined' && localStorage.getItem('defaultLanguage') ? localStorage.getItem('defaultLanguage') : 'python'}
<Tabs
groupId="expedition-language"
values={[
{ label: 'Python', value: 'python', },
{ label: 'Php', value: 'php', },
Expand Down Expand Up @@ -122,7 +102,8 @@ curl_close($curl);
Likewise, stopping the agent is simply done with a validated HTTPS GET request to the `stop` route.
Currently, there is no validation on the tasks that an agent may be executing during the stop action, so keep in mind that undergoing execution may become incomplete.

<Tabs defaultValue={typeof window !== 'undefined' && localStorage.getItem('defaultLanguage') ? localStorage.getItem('defaultLanguage') : 'python'}
<Tabs
groupId="expedition-language"
values={[
{ label: 'Python', value: 'python', },
{ label: 'Php', value: 'php', },
Expand Down Expand Up @@ -175,7 +156,8 @@ curl_close($curl);
And to restart, we will require the `restart` route. If the agent is started, `restart` will stop the agent and start it again. If already stopped, the agent will get started.
Currently, there is no validation on the tasks that an agent may be executing during the restart action, so keep in mind that undergoing execution may become incomplete.

<Tabs defaultValue={typeof window !== 'undefined' && localStorage.getItem('defaultLanguage') ? localStorage.getItem('defaultLanguage') : 'python'}
<Tabs
groupId="expedition-language"
values={[
{ label: 'Python', value: 'python', },
{ label: 'Php', value: 'php', },
Expand Down
Loading
Loading