x-openapi-flow 1.3.7 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -331
- package/adapters/collections/insomnia-adapter.js +211 -15
- package/adapters/collections/postman-adapter.js +195 -15
- package/adapters/ui/redoc/x-openapi-flow-redoc-plugin.js +620 -91
- package/adapters/ui/redoc-adapter.js +132 -5
- package/package.json +2 -2
|
@@ -14,19 +14,146 @@ function buildRedocHtml(model, specFileName) {
|
|
|
14
14
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
15
15
|
<title>x-openapi-flow Redoc</title>
|
|
16
16
|
<style>
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
:root {
|
|
18
|
+
color-scheme: light;
|
|
19
|
+
--x-openapi-flow-bg: #f3f4f6;
|
|
20
|
+
--x-openapi-flow-surface: #ffffff;
|
|
21
|
+
--x-openapi-flow-text: #111827;
|
|
22
|
+
--x-openapi-flow-muted: #6b7280;
|
|
23
|
+
--x-openapi-flow-border: #e5e7eb;
|
|
24
|
+
--x-openapi-flow-accent: #0f766e;
|
|
25
|
+
--x-openapi-flow-accent-soft: #ccfbf1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
* { box-sizing: border-box; }
|
|
29
|
+
|
|
30
|
+
body {
|
|
31
|
+
margin: 0;
|
|
32
|
+
background: var(--x-openapi-flow-bg);
|
|
33
|
+
color: var(--x-openapi-flow-text);
|
|
34
|
+
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.x-openapi-flow-shell-header {
|
|
38
|
+
position: sticky;
|
|
39
|
+
top: 0;
|
|
40
|
+
z-index: 20;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
gap: 16px;
|
|
45
|
+
padding: 14px 20px;
|
|
46
|
+
border-bottom: 1px solid var(--x-openapi-flow-border);
|
|
47
|
+
background: rgba(255, 255, 255, 0.94);
|
|
48
|
+
backdrop-filter: blur(10px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.x-openapi-flow-shell-brand {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
gap: 2px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.x-openapi-flow-shell-brand strong {
|
|
58
|
+
font-size: 14px;
|
|
59
|
+
letter-spacing: 0.04em;
|
|
60
|
+
text-transform: uppercase;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.x-openapi-flow-shell-brand span {
|
|
64
|
+
color: var(--x-openapi-flow-muted);
|
|
65
|
+
font-size: 13px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.x-openapi-flow-shell-menu {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 10px;
|
|
72
|
+
flex-wrap: wrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.x-openapi-flow-shell-link {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
min-height: 38px;
|
|
80
|
+
padding: 0 14px;
|
|
81
|
+
border: 1px solid var(--x-openapi-flow-border);
|
|
82
|
+
border-radius: 999px;
|
|
83
|
+
color: var(--x-openapi-flow-text);
|
|
84
|
+
background: var(--x-openapi-flow-surface);
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.x-openapi-flow-shell-link.is-active {
|
|
91
|
+
border-color: var(--x-openapi-flow-accent);
|
|
92
|
+
background: var(--x-openapi-flow-accent-soft);
|
|
93
|
+
color: #134e4a;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-x-openapi-flow-view][hidden] {
|
|
97
|
+
display: none !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
#x-openapi-flow-view-reference {
|
|
101
|
+
min-height: calc(100vh - 67px);
|
|
102
|
+
background: #ffffff;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
#x-openapi-flow-view-flow {
|
|
106
|
+
min-height: calc(100vh - 67px);
|
|
107
|
+
padding: 28px 16px 48px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
#x-openapi-flow-panel {
|
|
111
|
+
max-width: 1200px;
|
|
112
|
+
margin: 0 auto;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@media (max-width: 720px) {
|
|
116
|
+
.x-openapi-flow-shell-header {
|
|
117
|
+
align-items: flex-start;
|
|
118
|
+
flex-direction: column;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.x-openapi-flow-shell-menu {
|
|
122
|
+
width: 100%;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.x-openapi-flow-shell-link {
|
|
126
|
+
flex: 1 1 180px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
19
129
|
</style>
|
|
20
130
|
</head>
|
|
21
131
|
<body>
|
|
22
|
-
<
|
|
23
|
-
|
|
132
|
+
<header class="x-openapi-flow-shell-header">
|
|
133
|
+
<div class="x-openapi-flow-shell-brand">
|
|
134
|
+
<strong>x-openapi-flow</strong>
|
|
135
|
+
<span>Static ReDoc package with dedicated flow navigation</span>
|
|
136
|
+
</div>
|
|
137
|
+
<nav id="x-openapi-flow-menu" class="x-openapi-flow-shell-menu" aria-label="Documentation sections">
|
|
138
|
+
<a class="x-openapi-flow-shell-link" href="#reference" data-x-openapi-flow-target="reference">API Reference</a>
|
|
139
|
+
<a class="x-openapi-flow-shell-link" href="#flow" data-x-openapi-flow-target="flow">Flow / Lifecycle</a>
|
|
140
|
+
</nav>
|
|
141
|
+
</header>
|
|
142
|
+
<section id="x-openapi-flow-view-reference" data-x-openapi-flow-view="reference">
|
|
143
|
+
<redoc spec-url="./${specFileName}"></redoc>
|
|
144
|
+
</section>
|
|
145
|
+
<section id="x-openapi-flow-view-flow" data-x-openapi-flow-view="flow" hidden>
|
|
146
|
+
<div id="x-openapi-flow-panel"></div>
|
|
147
|
+
</section>
|
|
24
148
|
<script src="https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js"></script>
|
|
25
149
|
<script src="./x-openapi-flow-redoc-plugin.js"></script>
|
|
26
150
|
<script>
|
|
27
151
|
window.XOpenApiFlowRedocPlugin.mount({
|
|
28
152
|
model: ${modelPayload},
|
|
29
|
-
targetSelector: "#x-openapi-flow-panel"
|
|
153
|
+
targetSelector: "#x-openapi-flow-panel",
|
|
154
|
+
navigationSelector: "[data-x-openapi-flow-target]",
|
|
155
|
+
viewSelector: "[data-x-openapi-flow-view]",
|
|
156
|
+
defaultView: "reference"
|
|
30
157
|
});
|
|
31
158
|
</script>
|
|
32
159
|
</body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-openapi-flow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "OpenAPI extension for resource workflow and lifecycle management",
|
|
5
5
|
"main": "lib/validator.js",
|
|
6
6
|
"repository": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"prepack": "npm run sync:readme",
|
|
36
36
|
"test": "npm run test:cli && npm run test:ui && npm run test:integration && npm run test:smoke",
|
|
37
37
|
"test:cli": "node --test tests/cli/cli.test.js",
|
|
38
|
-
"test:ui": "node --test tests/plugins
|
|
38
|
+
"test:ui": "node --test tests/plugins/*.test.js",
|
|
39
39
|
"test:integration": "node --test tests/integration/*.test.js",
|
|
40
40
|
"test:examples": "node --test tests/integration/examples.test.js",
|
|
41
41
|
"test:smoke": "node bin/x-openapi-flow.js validate examples/payment-api.yaml --profile strict"
|