Skip to content

Commit 99be76c

Browse files
committed
build(deps): bump dependencies
1 parent 103e326 commit 99be76c

File tree

4 files changed

+241
-176
lines changed

4 files changed

+241
-176
lines changed

docs/resources/azure.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
draft: true
3-
---
4-
51
# Azure resources
62

73
## `azure_application_gateway`

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"lodash": "4.17.21",
4242
"netlify-plugin-cache": "1.0.3",
4343
"node-fetch": "3.3.2",
44-
"posthog-js": "1.136.8",
44+
"posthog-js": "1.139.3",
4545
"prism-react-renderer": "2.3.1",
4646
"react": "18.3.1",
4747
"react-dom": "18.3.1",
@@ -57,21 +57,21 @@
5757
"@docusaurus/tsconfig": "3.4.0",
5858
"@docusaurus/types": "3.4.0",
5959
"@types/js-cookie": "3.0.6",
60-
"@typescript-eslint/eslint-plugin": "7.12.0",
61-
"@typescript-eslint/parser": "7.12.0",
60+
"@typescript-eslint/eslint-plugin": "7.13.1",
61+
"@typescript-eslint/parser": "7.13.1",
6262
"commitizen": "4.3.0",
6363
"eslint": "8.57.0",
6464
"eslint-config-prettier": "9.1.0",
6565
"eslint-plugin-formatjs": "4.13.3",
6666
"eslint-plugin-jsx-a11y": "6.8.0",
6767
"eslint-plugin-prettier": "5.1.3",
68-
"eslint-plugin-react": "7.34.2",
68+
"eslint-plugin-react": "7.34.3",
6969
"eslint-plugin-react-hooks": "4.6.2",
7070
"eslint-plugin-regexp": "2.6.0",
7171
"husky": "9.0.11",
72-
"lint-staged": "15.2.5",
72+
"lint-staged": "15.2.7",
7373
"postcss": "8.4.38",
74-
"prettier": "3.3.1",
74+
"prettier": "3.3.2",
7575
"prettier-plugin-css-order": "2.1.2",
7676
"svgo": "3.3.2",
7777
"typescript": "5.4.5"
@@ -109,5 +109,6 @@
109109
"**/*.svg": [
110110
"svgo"
111111
]
112-
}
112+
},
113+
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
113114
}

tools/export_models.py

Lines changed: 89 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import time
55
from collections import defaultdict
66
from itertools import takewhile
7-
from typing import Any, Dict, List, Callable, Tuple, Optional
7+
from typing import Any, Callable, Dict, List, Optional, Tuple
88

99
import requests
1010
import urllib3
@@ -18,11 +18,11 @@
1818
# This list is used as filter: only providers listed here get exported
1919
providers = [
2020
"aws",
21+
"azure",
2122
"gcp",
2223
]
2324
# This list is used to filter out unsupported providers from base kind diagrams
2425
unsupported_providers = [
25-
"azure",
2626
"digitalocean",
2727
"dockerhub",
2828
"github",
@@ -36,13 +36,51 @@
3636
]
3737
urllib3.disable_warnings(InsecureRequestWarning)
3838

39-
base_kinds = ["access_key", "account", "autoscaling_group", "bucket", "certificate", "database", "dns_record",
40-
"dns_record_set", "dns_zone", "endpoint", "firewall", "gateway", "group", "health_check", "instance",
41-
"instance_profile", "instance_type", "ip_address", "keypair", "load_balancer",
42-
"managed_kubernetes_cluster_provider", "network", "network_acl", "network_interface", "network_share",
43-
"organizational_root", "organizational_unit", "peering_connection", "policy", "region", "role",
44-
"routing_table", "security_group", "serverless_function", "snapshot", "stack", "subnet", "tunnel", "type",
45-
"user", "volume", "volume_type", "zone"]
39+
base_kinds = [
40+
"access_key",
41+
"account",
42+
"autoscaling_group",
43+
"bucket",
44+
"certificate",
45+
"database",
46+
"dns_record",
47+
"dns_record_set",
48+
"dns_zone",
49+
"endpoint",
50+
"firewall",
51+
"gateway",
52+
"group",
53+
"health_check",
54+
"instance",
55+
"instance_profile",
56+
"instance_type",
57+
"ip_address",
58+
"keypair",
59+
"load_balancer",
60+
"managed_kubernetes_cluster_provider",
61+
"network",
62+
"network_acl",
63+
"network_interface",
64+
"network_share",
65+
"organizational_root",
66+
"organizational_unit",
67+
"peering_connection",
68+
"policy",
69+
"region",
70+
"role",
71+
"routing_table",
72+
"security_group",
73+
"serverless_function",
74+
"snapshot",
75+
"stack",
76+
"subnet",
77+
"tunnel",
78+
"type",
79+
"user",
80+
"volume",
81+
"volume_type",
82+
"zone",
83+
]
4684

4785

4886
def get_url(url: str, params: dict = None) -> Response:
@@ -62,20 +100,26 @@ def get_kinds() -> Tuple[Dict[str, Any], Dict[str, List[Any]]]:
62100
all_kinds: Dict[str, Any] = {}
63101
for kind in get_url(f"{core}/graph/fix/model").json():
64102
all_kinds[kind["fqn"]] = kind
65-
groups = [a for a in providers if kind["fqn"].startswith(f"{a}_") and kind.get("aggregate_root", False)]
103+
groups = [
104+
a
105+
for a in providers
106+
if kind["fqn"].startswith(f"{a}_") and kind.get("aggregate_root", False)
107+
]
66108
if groups:
67109
kinds[groups[0]].append(kind)
68110

69111
return all_kinds, kinds
70112

71113

72-
def write_md(provider: str,
73-
kinds: list,
74-
properties: Callable[[str], Dict[str, str]],
75-
relationship: Optional[Callable[[str], Dict[str, str]]] = None) -> None:
114+
def write_md(
115+
provider: str,
116+
kinds: list,
117+
properties: Callable[[str], Dict[str, str]],
118+
relationship: Optional[Callable[[str], Dict[str, str]]] = None,
119+
) -> None:
76120
if os.path.exists(f"./{provider}.mdx"):
77121
# in case the file exists, read the header section until the first h2 (##)
78-
with (open(f"./{provider}.mdx", "r+")) as file:
122+
with open(f"./{provider}.mdx", "r+") as file:
79123
lines = takewhile(lambda ll: not ll.startswith("## "), file.readlines())
80124
else:
81125
# provider file does not exist, create default header
@@ -91,19 +135,35 @@ def write_md(provider: str,
91135
for name in sorted(a["fqn"] for a in kinds):
92136
file.write(f"## `{name}`\n\n")
93137
file.write(f"<ZoomPanPinch>\n\n")
94-
file.write(f'```kroki imgType="plantuml" imgAlt="Diagram of {name} data model"\n')
95-
img_str = get_url(f"{core}/graph/fix/model/uml", params=properties(name)).text
96-
img_str = re.sub(rf"class\s+({'|'.join(unsupported_providers)})\w+\s+{{\s+}}\s+", "", img_str)
97-
img_str = re.sub(rf"\w+\s+<\|---\s+({'|'.join(unsupported_providers)})\w+\s+", "", img_str)
138+
file.write(
139+
f'```kroki imgType="plantuml" imgAlt="Diagram of {name} data model"\n'
140+
)
141+
img_str = get_url(
142+
f"{core}/graph/fix/model/uml", params=properties(name)
143+
).text
144+
img_str = re.sub(
145+
rf"class\s+({'|'.join(unsupported_providers)})\w+\s+{{\s+}}\s+",
146+
"",
147+
img_str,
148+
)
149+
img_str = re.sub(
150+
rf"\w+\s+<\|---\s+({'|'.join(unsupported_providers)})\w+\s+",
151+
"",
152+
img_str,
153+
)
98154
file.write(re.sub(r"\n+", "\n", img_str).strip())
99155
file.write("\n```\n\n")
100156
file.write("</ZoomPanPinch>\n")
101157
if relationship is not None:
102-
file.write(f"<details>\n<summary>Relationships to other resources</summary>\n<div>\n")
158+
file.write(
159+
f"<details>\n<summary>Relationships to other resources</summary>\n<div>\n"
160+
)
103161
file.write(
104162
f'<ZoomPanPinch>\n\n```kroki imgType="plantuml" imgAlt="Diagram of {name} resource relationships"\n'
105163
)
106-
img_str = get_url(f"{core}/graph/fix/model/uml", params=relationship(name)).text
164+
img_str = get_url(
165+
f"{core}/graph/fix/model/uml", params=relationship(name)
166+
).text
107167
file.write(re.sub(r"\n+", "\n", img_str).strip())
108168
file.write(f"\n```\n\n</ZoomPanPinch>\n</div>\n</details>\n")
109169
file.write("\n")
@@ -156,11 +216,17 @@ def show_base_diagram(name: str) -> Dict[str, str]:
156216

157217
all_kinds, kinds = load_valid_kinds()
158218
print(f"Create base kinds")
159-
write_md("base-kinds", [all_kinds[bk] for bk in base_kinds if bk in all_kinds], show_base_diagram)
219+
write_md(
220+
"base-kinds",
221+
[all_kinds[bk] for bk in base_kinds if bk in all_kinds],
222+
show_base_diagram,
223+
)
160224
for provider in providers:
161225
if len(kinds.get(provider, [])) > 0:
162226
print("---------------------------")
163-
print(f"Create provider file: {provider} with {len(kinds[provider])} service kinds")
227+
print(
228+
f"Create provider file: {provider} with {len(kinds[provider])} service kinds"
229+
)
164230
write_md(provider, kinds[provider], class_diagram, relationship_diagram)
165231

166232

0 commit comments

Comments
 (0)