rapipdf 2.1.1 → 3.0.0

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.
Files changed (173) hide show
  1. package/README.md +66 -14
  2. package/dist/chunks/generate-BQLGaRvK.js +386 -0
  3. package/dist/chunks/generate-BQLGaRvK.js.LICENSE.txt +224 -0
  4. package/dist/chunks/localize-CRvDVkIz.js +8 -0
  5. package/dist/node.js +13096 -0
  6. package/dist/node.js.LICENSE.txt +195 -0
  7. package/dist/rapipdf-min.js +352 -90
  8. package/dist/rapipdf-min.js.LICENSE.txt +224 -0
  9. package/dist/rapipdf.js +69 -0
  10. package/package.json +58 -52
  11. package/src/node.d.ts +82 -0
  12. package/src/rapipdf.d.ts +50 -0
  13. package/.babelrc +0 -11
  14. package/.eslintrc +0 -28
  15. package/dist/index.html +0 -48
  16. package/dist/index.html.gz +0 -0
  17. package/dist/rapipdf-min.js.gz +0 -0
  18. package/dist/rapipdf-min.js.map +0 -1
  19. package/dist/rapipdf-min.js.map.gz +0 -0
  20. package/dist/report.html +0 -67
  21. package/docs/examples/example1.html +0 -68
  22. package/docs/examples/list.html +0 -27
  23. package/docs/examples/rapidoc-regular.woff2 +0 -0
  24. package/docs/examples/rapidoc-semi-bold.woff2 +0 -0
  25. package/docs/examples/roboto-mono-bold.woff2 +0 -0
  26. package/docs/examples/roboto-mono-regular.woff2 +0 -0
  27. package/docs/highlight/CHANGES.md +0 -1803
  28. package/docs/highlight/LICENSE +0 -24
  29. package/docs/highlight/README.md +0 -188
  30. package/docs/highlight/README.ru.md +0 -142
  31. package/docs/highlight/highlight.pack.js +0 -2
  32. package/docs/highlight/styles/a11y-dark.css +0 -99
  33. package/docs/highlight/styles/a11y-light.css +0 -99
  34. package/docs/highlight/styles/agate.css +0 -108
  35. package/docs/highlight/styles/an-old-hope.css +0 -89
  36. package/docs/highlight/styles/androidstudio.css +0 -66
  37. package/docs/highlight/styles/arduino-light.css +0 -88
  38. package/docs/highlight/styles/arta.css +0 -73
  39. package/docs/highlight/styles/ascetic.css +0 -45
  40. package/docs/highlight/styles/atelier-cave-dark.css +0 -83
  41. package/docs/highlight/styles/atelier-cave-light.css +0 -85
  42. package/docs/highlight/styles/atelier-dune-dark.css +0 -69
  43. package/docs/highlight/styles/atelier-dune-light.css +0 -69
  44. package/docs/highlight/styles/atelier-estuary-dark.css +0 -84
  45. package/docs/highlight/styles/atelier-estuary-light.css +0 -84
  46. package/docs/highlight/styles/atelier-forest-dark.css +0 -69
  47. package/docs/highlight/styles/atelier-forest-light.css +0 -69
  48. package/docs/highlight/styles/atelier-heath-dark.css +0 -69
  49. package/docs/highlight/styles/atelier-heath-light.css +0 -69
  50. package/docs/highlight/styles/atelier-lakeside-dark.css +0 -69
  51. package/docs/highlight/styles/atelier-lakeside-light.css +0 -69
  52. package/docs/highlight/styles/atelier-plateau-dark.css +0 -84
  53. package/docs/highlight/styles/atelier-plateau-light.css +0 -84
  54. package/docs/highlight/styles/atelier-savanna-dark.css +0 -84
  55. package/docs/highlight/styles/atelier-savanna-light.css +0 -84
  56. package/docs/highlight/styles/atelier-seaside-dark.css +0 -69
  57. package/docs/highlight/styles/atelier-seaside-light.css +0 -69
  58. package/docs/highlight/styles/atelier-sulphurpool-dark.css +0 -69
  59. package/docs/highlight/styles/atelier-sulphurpool-light.css +0 -69
  60. package/docs/highlight/styles/atom-one-dark-reasonable.css +0 -77
  61. package/docs/highlight/styles/atom-one-dark.css +0 -96
  62. package/docs/highlight/styles/atom-one-light.css +0 -96
  63. package/docs/highlight/styles/brown-paper.css +0 -64
  64. package/docs/highlight/styles/brown-papersq.png +0 -0
  65. package/docs/highlight/styles/codepen-embed.css +0 -60
  66. package/docs/highlight/styles/color-brewer.css +0 -71
  67. package/docs/highlight/styles/darcula.css +0 -77
  68. package/docs/highlight/styles/dark.css +0 -63
  69. package/docs/highlight/styles/darkula.css +0 -6
  70. package/docs/highlight/styles/default.css +0 -99
  71. package/docs/highlight/styles/docco.css +0 -97
  72. package/docs/highlight/styles/dracula.css +0 -76
  73. package/docs/highlight/styles/far.css +0 -71
  74. package/docs/highlight/styles/foundation.css +0 -88
  75. package/docs/highlight/styles/github-gist.css +0 -71
  76. package/docs/highlight/styles/github.css +0 -99
  77. package/docs/highlight/styles/gml.css +0 -78
  78. package/docs/highlight/styles/googlecode.css +0 -89
  79. package/docs/highlight/styles/grayscale.css +0 -101
  80. package/docs/highlight/styles/gruvbox-dark.css +0 -108
  81. package/docs/highlight/styles/gruvbox-light.css +0 -108
  82. package/docs/highlight/styles/hopscotch.css +0 -83
  83. package/docs/highlight/styles/hybrid.css +0 -102
  84. package/docs/highlight/styles/idea.css +0 -97
  85. package/docs/highlight/styles/ir-black.css +0 -73
  86. package/docs/highlight/styles/isbl-editor-dark.css +0 -112
  87. package/docs/highlight/styles/isbl-editor-light.css +0 -112
  88. package/docs/highlight/styles/kimbie.dark.css +0 -74
  89. package/docs/highlight/styles/kimbie.light.css +0 -74
  90. package/docs/highlight/styles/lightfair.css +0 -87
  91. package/docs/highlight/styles/magula.css +0 -70
  92. package/docs/highlight/styles/mono-blue.css +0 -59
  93. package/docs/highlight/styles/monokai-sublime.css +0 -83
  94. package/docs/highlight/styles/monokai.css +0 -70
  95. package/docs/highlight/styles/nord.css +0 -309
  96. package/docs/highlight/styles/obsidian.css +0 -88
  97. package/docs/highlight/styles/ocean.css +0 -74
  98. package/docs/highlight/styles/paraiso-dark.css +0 -72
  99. package/docs/highlight/styles/paraiso-light.css +0 -72
  100. package/docs/highlight/styles/pojoaque.css +0 -83
  101. package/docs/highlight/styles/pojoaque.jpg +0 -0
  102. package/docs/highlight/styles/purebasic.css +0 -96
  103. package/docs/highlight/styles/qtcreator_dark.css +0 -83
  104. package/docs/highlight/styles/qtcreator_light.css +0 -83
  105. package/docs/highlight/styles/railscasts.css +0 -106
  106. package/docs/highlight/styles/rainbow.css +0 -85
  107. package/docs/highlight/styles/routeros.css +0 -108
  108. package/docs/highlight/styles/school-book.css +0 -72
  109. package/docs/highlight/styles/school-book.png +0 -0
  110. package/docs/highlight/styles/shades-of-purple.css +0 -97
  111. package/docs/highlight/styles/solarized-dark.css +0 -84
  112. package/docs/highlight/styles/solarized-light.css +0 -84
  113. package/docs/highlight/styles/sunburst.css +0 -102
  114. package/docs/highlight/styles/tomorrow-night-blue.css +0 -75
  115. package/docs/highlight/styles/tomorrow-night-bright.css +0 -74
  116. package/docs/highlight/styles/tomorrow-night-eighties.css +0 -74
  117. package/docs/highlight/styles/tomorrow-night.css +0 -75
  118. package/docs/highlight/styles/tomorrow.css +0 -72
  119. package/docs/highlight/styles/vs.css +0 -68
  120. package/docs/highlight/styles/vs2015.css +0 -115
  121. package/docs/highlight/styles/xcode.css +0 -104
  122. package/docs/highlight/styles/xt256.css +0 -92
  123. package/docs/highlight/styles/zenburn.css +0 -80
  124. package/docs/images/console.svg +0 -12
  125. package/docs/images/dark_ss.png +0 -0
  126. package/docs/images/easy.svg +0 -14
  127. package/docs/images/fast.svg +0 -8
  128. package/docs/images/gears.svg +0 -11
  129. package/docs/images/light_ss.png +0 -0
  130. package/docs/images/logo.png +0 -0
  131. package/docs/images/love.svg +0 -8
  132. package/docs/images/mask.svg +0 -16
  133. package/docs/images/mouse.svg +0 -7
  134. package/docs/images/pdf_sample1.png +0 -0
  135. package/docs/images/pdf_sample2.png +0 -0
  136. package/docs/images/webcomponent.svg +0 -13
  137. package/docs/index.css +0 -254
  138. package/docs/index.html +0 -376
  139. package/docs/rapipdf-min.js +0 -95
  140. package/docs/specs/allof-primitives.json +0 -80
  141. package/docs/specs/allof.json +0 -73
  142. package/docs/specs/anyof.json +0 -84
  143. package/docs/specs/basic.json +0 -75
  144. package/docs/specs/bitbucket.json +0 -12916
  145. package/docs/specs/data-types.yaml +0 -168
  146. package/docs/specs/gcloud.json +0 -1347
  147. package/docs/specs/no-server.json +0 -1
  148. package/docs/specs/oneof.json +0 -64
  149. package/docs/specs/petstore.json +0 -1042
  150. package/docs/specs/petstore_extended.yaml +0 -889
  151. package/docs/specs/temp.json +0 -53
  152. package/docs/specs/test-specs/large-models.json +0 -5998
  153. package/docs/specs/test-specs/long-descriptions.json +0 -5443
  154. package/docs/specs/test-specs/long-paths.json +0 -9562
  155. package/docs/specs/test-specs/oneof-allof-nested.yaml +0 -105
  156. package/docs/specs/test-specs/partial-spec-main.json +0 -29
  157. package/docs/specs/test-specs/partial.json +0 -17
  158. package/docs/specs/test-specs/petstore_complex_request.yaml +0 -335
  159. package/docs/specs/test-specs/petstore_experimental.yaml +0 -167
  160. package/docs/specs/test-specs/xxx-of-with-primitives-and-recursive-model.yaml +0 -952
  161. package/docs/welcome.html +0 -369
  162. package/index.html +0 -48
  163. package/logo.png +0 -0
  164. package/src/index.js +0 -3
  165. package/src/markdown.js +0 -120
  166. package/src/object-tree-gen.js +0 -370
  167. package/src/pdf-gen.js +0 -113
  168. package/src/pdf-parts-gen.js +0 -488
  169. package/src/rapipdf.js +0 -246
  170. package/src/spec-parser.js +0 -162
  171. package/src/table-layouts.js +0 -35
  172. package/src/vfs_fonts.js +0 -7
  173. package/webpack.config.js +0 -118
@@ -0,0 +1,224 @@
1
+ Third-party software bundled in rapipdf-min.js (rapipdf 3.0.0)
2
+ ==============================================================
3
+
4
+ rapipdf-min.js contains code from the packages below. Their licenses require their
5
+ copyright and license notices to accompany the code; they follow in full.
6
+
7
+ - @scalar/helpers 0.17.1 (MIT)
8
+ - @scalar/json-magic 0.19.0 (MIT)
9
+ - @scalar/openapi-parser 0.29.21 (MIT)
10
+ - @scalar/openapi-upgrader 0.4.8 (MIT)
11
+ - marked 18.2.0 (MIT)
12
+ - pdfmake 0.3.14 (MIT)
13
+ - yaml 2.9.1 (ISC)
14
+
15
+ ========================================================================
16
+
17
+ @scalar/helpers 0.17.1
18
+ License: MIT
19
+ https://github.com/scalar/scalar
20
+ ------------------------------------------------------------------------
21
+ MIT License
22
+
23
+ Copyright (c) 2023-present Scalar
24
+
25
+ Permission is hereby granted, free of charge, to any person obtaining a copy
26
+ of this software and associated documentation files (the "Software"), to deal
27
+ in the Software without restriction, including without limitation the rights
28
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
+ copies of the Software, and to permit persons to whom the Software is
30
+ furnished to do so, subject to the following conditions:
31
+
32
+ The above copyright notice and this permission notice shall be included in all
33
+ copies or substantial portions of the Software.
34
+
35
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
+ SOFTWARE.
42
+
43
+ ========================================================================
44
+
45
+ @scalar/json-magic 0.19.0
46
+ License: MIT
47
+ https://github.com/scalar/scalar
48
+ ------------------------------------------------------------------------
49
+ MIT License
50
+
51
+ Copyright (c) 2023-present Scalar
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a copy
54
+ of this software and associated documentation files (the "Software"), to deal
55
+ in the Software without restriction, including without limitation the rights
56
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57
+ copies of the Software, and to permit persons to whom the Software is
58
+ furnished to do so, subject to the following conditions:
59
+
60
+ The above copyright notice and this permission notice shall be included in all
61
+ copies or substantial portions of the Software.
62
+
63
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
69
+ SOFTWARE.
70
+
71
+ ========================================================================
72
+
73
+ @scalar/openapi-parser 0.29.21
74
+ License: MIT
75
+ https://github.com/scalar/scalar
76
+ ------------------------------------------------------------------------
77
+ MIT License
78
+
79
+ Copyright (c) 2023-present Scalar
80
+
81
+ Permission is hereby granted, free of charge, to any person obtaining a copy
82
+ of this software and associated documentation files (the "Software"), to deal
83
+ in the Software without restriction, including without limitation the rights
84
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
85
+ copies of the Software, and to permit persons to whom the Software is
86
+ furnished to do so, subject to the following conditions:
87
+
88
+ The above copyright notice and this permission notice shall be included in all
89
+ copies or substantial portions of the Software.
90
+
91
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
92
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
94
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
95
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
96
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
97
+ SOFTWARE.
98
+
99
+ ========================================================================
100
+
101
+ @scalar/openapi-upgrader 0.4.8
102
+ License: MIT
103
+ https://github.com/scalar/scalar
104
+ ------------------------------------------------------------------------
105
+ MIT License
106
+
107
+ Copyright (c) 2023-present Scalar
108
+
109
+ Permission is hereby granted, free of charge, to any person obtaining a copy
110
+ of this software and associated documentation files (the "Software"), to deal
111
+ in the Software without restriction, including without limitation the rights
112
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
113
+ copies of the Software, and to permit persons to whom the Software is
114
+ furnished to do so, subject to the following conditions:
115
+
116
+ The above copyright notice and this permission notice shall be included in all
117
+ copies or substantial portions of the Software.
118
+
119
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
120
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
121
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
122
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
123
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
124
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
125
+ SOFTWARE.
126
+
127
+ ========================================================================
128
+
129
+ marked 18.2.0
130
+ License: MIT
131
+ https://marked.js.org
132
+ ------------------------------------------------------------------------
133
+ # License information
134
+
135
+ ## Contribution License Agreement
136
+
137
+ If you contribute code to this project, you are implicitly allowing your code
138
+ to be distributed under the MIT license. You are also implicitly verifying that
139
+ all code is your original work. `</legalese>`
140
+
141
+ ## Marked
142
+
143
+ Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
144
+ Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
145
+
146
+ Permission is hereby granted, free of charge, to any person obtaining a copy
147
+ of this software and associated documentation files (the "Software"), to deal
148
+ in the Software without restriction, including without limitation the rights
149
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
150
+ copies of the Software, and to permit persons to whom the Software is
151
+ furnished to do so, subject to the following conditions:
152
+
153
+ The above copyright notice and this permission notice shall be included in
154
+ all copies or substantial portions of the Software.
155
+
156
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
157
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
158
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
159
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
160
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
161
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
162
+ THE SOFTWARE.
163
+
164
+ ## Markdown
165
+
166
+ Copyright © 2004, John Gruber
167
+ http://daringfireball.net/
168
+ All rights reserved.
169
+
170
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
171
+
172
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
173
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
174
+ * Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
175
+
176
+ This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
177
+
178
+ ========================================================================
179
+
180
+ pdfmake 0.3.14
181
+ License: MIT
182
+ http://pdfmake.org
183
+ ------------------------------------------------------------------------
184
+ The MIT License (MIT)
185
+
186
+ Copyright (c) 2014-2015 bpampuch
187
+ 2016-2026 liborm85
188
+
189
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
190
+ this software and associated documentation files (the "Software"), to deal in
191
+ the Software without restriction, including without limitation the rights to
192
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
193
+ the Software, and to permit persons to whom the Software is furnished to do so,
194
+ subject to the following conditions:
195
+
196
+ The above copyright notice and this permission notice shall be included in all
197
+ copies or substantial portions of the Software.
198
+
199
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
200
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
201
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
202
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
203
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
204
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
205
+
206
+ ========================================================================
207
+
208
+ yaml 2.9.1
209
+ License: ISC
210
+ https://eemeli.org/yaml/
211
+ ------------------------------------------------------------------------
212
+ Copyright Eemeli Aro <eemeli@gmail.com>
213
+
214
+ Permission to use, copy, modify, and/or distribute this software for any purpose
215
+ with or without fee is hereby granted, provided that the above copyright notice
216
+ and this permission notice appear in all copies.
217
+
218
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
219
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
220
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
221
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
222
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
223
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
224
+ THIS SOFTWARE.
@@ -0,0 +1,69 @@
1
+ /*!
2
+ * @license
3
+ * rapipdf v3.0.0
4
+ * (c) 2026 Mrinmoy Majumdar <mrin9@yahoo.com>
5
+ * SPDX-License-Identifier: MIT
6
+ * Bundled third-party code and its licenses: rapipdf.js.LICENSE.txt
7
+ */
8
+ import{t as o}from"./chunks/localize-CRvDVkIz.js";var l=document.createElement("template");l.innerHTML=`
9
+ <style>
10
+ :host{
11
+ --primary-color:#0078d7;
12
+ --border-radius:2px;
13
+ --input-bg:#fff;
14
+ --fg:#333;
15
+ --primary-text:#fff;
16
+ --font-size:13px;
17
+ display:block;
18
+ width:350px;
19
+ }
20
+
21
+ .spec-input {
22
+ border-radius:var(--border-radius);
23
+ border:1px solid var(--primary-color);
24
+ background:var(--input-bg);
25
+ font-size: inherit;
26
+ color:var(--fg);
27
+ transition: border .2s;
28
+ outline: none;
29
+ padding:6px 5px;
30
+ box-sizing: border-box;
31
+ flex:1;
32
+ }
33
+ .spec-input:focus {
34
+ outline: 1px dotted var(--fg);
35
+ outline-offset: -3px;
36
+ }
37
+
38
+ .btn-default {
39
+ border-radius: 0 var(--border-radius) var(--border-radius) 0;
40
+ font-size: 85%;
41
+ font-weight: 600;
42
+ display: inline-block;
43
+ padding: 8px 16px;
44
+ outline: none;
45
+ outline-offset: -2px;
46
+ line-height: 1;
47
+ text-align: center;
48
+ white-space: nowrap;
49
+ background-color:var(--primary-color);
50
+ color:var(--primary-text);
51
+ border: 0px solid var(--primary-color);
52
+ transition: background-color 0.2s;
53
+ user-select: none;
54
+ cursor: pointer;
55
+ }
56
+ .btn-default:focus{
57
+ outline: 1px solid var(--primary-text);
58
+ }
59
+ .btn-default:disabled{
60
+ opacity: 0.6;
61
+ cursor: progress;
62
+ }
63
+
64
+ </style>
65
+ <div style='display:flex; width:100%; height: 100%;'>
66
+ <input class="spec-input" id="spec-url" type="text" placeholder="Spec URL" value="" tabindex="0">
67
+ <button class="btn-default" type="button" style="margin-left:-1px" tabindex="0">GENERATE PDF</button>
68
+ </div>
69
+ `;var r=class extends HTMLElement{constructor(){super();let t=this.attachShadow({mode:"open"}),e=l.content.cloneNode(!0);this.inputEl=e.querySelector(".spec-input"),this.btnEl=e.querySelector(".btn-default"),t.appendChild(e),this.onChangeInput=this.onChangeInput.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onButtonClick=()=>this.generateFromUi(),this.localize={...o},this.pending=0}connectedCallback(){this.inputEl.addEventListener("change",this.onChangeInput),this.inputEl.addEventListener("keyup",this.onKeyUp),this.btnEl.addEventListener("click",this.onButtonClick);let t={},e=this.children[0]?.content?.textContent;if(e)try{t=JSON.parse(e)}catch{t={}}this.localize={...o,...t}}disconnectedCallback(){this.inputEl.removeEventListener("change",this.onChangeInput),this.inputEl.removeEventListener("keyup",this.onKeyUp),this.btnEl.removeEventListener("click",this.onButtonClick)}static get observedAttributes(){return["spec-url","button-bg","input-bg","button-color","input-color","button-label","hide-input"]}attributeChangedCallback(t,e,n){switch(t){case"spec-url":if(e!==n)return this.inputEl.value=n,!0;break;case"button-label":if(e!==n)return this.btnEl.innerText=n,!0;break;case"hide-input":if(e!==n)return n==="true"?(this.inputEl.style.display="none",this.btnEl.style.borderRadius="var(--border-radius)"):(this.inputEl.style.display="block",this.btnEl.style.borderRadius="0 var(--border-radius) var(--border-radius) 0"),!0;break;case"button-bg":return this.btnEl.style.backgroundColor=n,this.inputEl.style.borderColor=n,!0;case"button-color":return this.btnEl.style.color=n,!0;case"input-bg":return this.inputEl.style.backgroundColor=n,!0;case"input-color":return this.inputEl.style.color=n,!0;default:return!0}return!0}get specUrl(){return this.getAttribute("spec-url")}set specUrl(t){this.setAttribute("spec-url",t)}onChangeInput(t){this.specUrl=t.target.value}onKeyUp(t){t.keyCode===13&&this.generateFromUi()}generateFromUi(){this.generatePdf().catch(t=>{console.error("RapiPdf: the PDF could not be generated",t)})}pdfOptions(){let t=e=>this.getAttribute(e);return{pdfSortTags:t("pdf-sort-tags")!=="false",pdfPrimaryColor:t("pdf-primary-color"),pdfAlternateColor:t("pdf-alternate-color"),pdfTitle:t("pdf-title")===null?"API Reference":t("pdf-title"),pdfSchemaStyle:t("pdf-schema-style")==="table"?"table":"object",pdfFooterText:t("pdf-footer-text")||"",includeInfo:t("include-info")!=="false",includeToc:t("include-toc")!=="false",includeSecurity:t("include-security")!=="false",includeExample:t("include-example")==="true",includeApiDetails:t("include-api-details")!=="false",includeApiList:t("include-api-list")==="true",localize:this.localize}}get fileName(){let t=(this.getAttribute("file-name")||"api-reference").trim();return/\.pdf$/i.test(t)?t:`${t}.pdf`}async run(t,e,n){this.pending+=1,this.setAttribute("generating",""),this.btnEl.disabled=!0;try{let i=t??this.specUrl;if(i==null||i==="")throw Error("No spec: set spec-url or pass a spec to generatePdf()");let{createPdfDocument:s}=await import("./chunks/generate-BQLGaRvK.js"),a=await n(await s(i,this.pdfOptions()));return this.dispatchEvent(new CustomEvent("pdf-generated",{detail:{output:e},bubbles:!0,composed:!0})),a}catch(i){throw this.dispatchEvent(new CustomEvent("pdf-error",{detail:{error:i},bubbles:!0,composed:!0})),i}finally{--this.pending,this.pending===0&&(this.removeAttribute("generating"),this.btnEl.disabled=!1)}}async generatePdf(t){let e=this.getAttribute("output")==="download"?"download":"open",n=null;e==="open"&&(n=window.open("","_blank"),n||(e="download"));try{await this.run(t,e,i=>e==="open"?i.open(n):i.download(this.fileName))}catch(i){throw n?.close(),i}}getPdfBlob(t){return this.run(t,"blob",e=>e.getBlob())}};customElements.get("rapi-pdf")||customElements.define("rapi-pdf",r);export{r as RapiPdf,r as default};
package/package.json CHANGED
@@ -1,65 +1,71 @@
1
1
  {
2
2
  "name": "rapipdf",
3
- "version": "2.1.1",
4
- "description": "RapiPdf - Generate PDF from Open API spec",
5
- "author": "Mrinmoy Majumdar <mrin9@yahoo.com>",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/mrin9/RapiPdf"
9
- },
10
- "license": "MIT",
3
+ "version": "3.0.0",
4
+ "description": "RapiPdf - Generate PDF from an OpenAPI spec",
11
5
  "keywords": [
12
- "OpenAPI",
13
- "OpenAPI Specification",
14
- "Swagger",
15
- "JSON-Schema",
16
- "API",
17
- "REST",
6
+ "api",
7
+ "custom-element",
18
8
  "documentation",
19
- "Custom Element",
20
- "Web Component",
9
+ "openapi",
10
+ "openapi-pdf",
11
+ "pdf",
12
+ "rapidoc",
21
13
  "rapipdf",
22
14
  "swagger",
23
- "swagger ui",
24
- "pdf",
25
- "swagger pdf",
26
- "openapi pdf"
15
+ "swagger-pdf",
16
+ "web-component"
27
17
  ],
28
- "main": "./src/rapipdf.js",
29
- "module": "./src/rapipdf.js",
30
- "dependencies": {
31
- "marked": "^0.8.0",
32
- "pdfmake": "^0.1.64",
33
- "swagger-client": "^3.10.0",
34
- "swagger2openapi": "^5.3.3"
18
+ "homepage": "https://rapidocui.com",
19
+ "bugs": {
20
+ "url": "https://github.com/rapi-doc/RapiDoc/issues"
21
+ },
22
+ "license": "MIT",
23
+ "author": "Mrinmoy Majumdar <mrin9@yahoo.com>",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/rapi-doc/RapiDoc.git",
27
+ "directory": "packages/rapipdf"
28
+ },
29
+ "files": [
30
+ "dist",
31
+ "src/node.d.ts",
32
+ "src/rapipdf.d.ts"
33
+ ],
34
+ "type": "module",
35
+ "main": "./dist/rapipdf-min.js",
36
+ "module": "./dist/rapipdf.js",
37
+ "types": "./src/rapipdf.d.ts",
38
+ "unpkg": "./dist/rapipdf-min.js",
39
+ "jsdelivr": "./dist/rapipdf-min.js",
40
+ "exports": {
41
+ ".": {
42
+ "types": "./src/rapipdf.d.ts",
43
+ "import": "./dist/rapipdf.js",
44
+ "default": "./dist/rapipdf-min.js"
45
+ },
46
+ "./node": {
47
+ "types": "./src/node.d.ts",
48
+ "import": "./dist/node.js"
49
+ },
50
+ "./dist/*": "./dist/*"
35
51
  },
36
52
  "scripts": {
37
- "build": "NODE_ENV=production webpack",
38
- "serve": "webpack-dev-server --mode=development",
39
- "lint": "./node_modules/eslint/bin/eslint.js ./src/**/*.js",
40
- "lint-fix": "./node_modules/eslint/bin/eslint.js --fix ./src/**/*.js"
53
+ "build": "vite build && vite build --config vite.config.es.mjs && vite build --config vite.config.node.mjs && node ../../scripts/capture-build-info.js",
54
+ "build:dev": "vite build --mode development",
55
+ "dev": "vite",
56
+ "test": "node --test tests/*.test.js",
57
+ "prepublishOnly": "npm run build"
58
+ },
59
+ "dependencies": {
60
+ "pdfmake": "^0.3.14"
41
61
  },
42
62
  "devDependencies": {
43
- "@babel/core": "^7.6.0",
44
- "@babel/preset-env": "^7.6.0",
45
- "babel-loader": "^8.0.6",
46
- "clean-webpack-plugin": "^3.0.0",
47
- "compression-webpack-plugin": "^3.1.0",
48
- "css-loader": "^3.4.2",
49
- "trim-right": "^1.0.1",
50
- "eslint": "^6.8.0",
51
- "eslint-config-airbnb": "^18.0.1",
52
- "eslint-import-resolver-webpack": "^0.12.1",
53
- "eslint-loader": "^3.0.3",
54
- "eslint-plugin-import": "^2.20.0",
55
- "file-loader": "^5.0.2",
56
- "filemanager-webpack-plugin": "^2.0.5",
57
- "html-webpack-plugin": "^3.2.0",
58
- "inspectpack": "^4.3.1",
59
- "style-loader": "^1.1.3",
60
- "webpack": "^4.41.6",
61
- "webpack-bundle-analyzer": "^3.6.0",
62
- "webpack-cli": "^3.3.11",
63
- "webpack-dev-server": "^3.10.3"
63
+ "@scalar/openapi-parser": "^0.29.20",
64
+ "marked": "^18.1.3",
65
+ "vite": "^8.3.6",
66
+ "yaml": "^2.9.1"
67
+ },
68
+ "engines": {
69
+ "node": ">=22.12.0"
64
70
  }
65
71
  }
package/src/node.d.ts ADDED
@@ -0,0 +1,82 @@
1
+ /**
2
+ * TypeScript type definitions for `rapipdf/node`.
3
+ */
4
+
5
+ /** The labels printed in the PDF. Any of them can be replaced. */
6
+ export type Localize = Record<string, string>;
7
+
8
+ /** What goes into the PDF and how it looks. Every option has a default (`DEFAULT_OPTIONS`). */
9
+ export interface PdfOptions {
10
+ /** Sort the tags by name (default: true). */
11
+ pdfSortTags?: boolean;
12
+ /** Color of headings and operation titles (default: #b44646). */
13
+ pdfPrimaryColor?: string;
14
+ /** Color of section labels and table headers (default: #005b96). */
15
+ pdfAlternateColor?: string;
16
+ /** Title on the cover page (default: "API Reference"). */
17
+ pdfTitle?: string;
18
+ /** Schemas as an indented object tree or as a table (default: "object"). */
19
+ pdfSchemaStyle?: "object" | "table";
20
+ /** Text at the bottom left of every page. */
21
+ pdfFooterText?: string;
22
+ /** Cover page with the API's title, version, description and contact (default: true). */
23
+ includeInfo?: boolean;
24
+ /** Table of contents (default: true). */
25
+ includeToc?: boolean;
26
+ /** Security schemes section (default: true). */
27
+ includeSecurity?: boolean;
28
+ /** Request and response examples (default: false). */
29
+ includeExample?: boolean;
30
+ /** The operations, with parameters, request bodies and responses (default: true). */
31
+ includeApiDetails?: boolean;
32
+ /** A closing list of every operation, by tag (default: false). */
33
+ includeApiList?: boolean;
34
+ /** Labels to replace. */
35
+ localize?: Localize;
36
+ }
37
+
38
+ export interface FontOptions {
39
+ /** A TrueType/OpenType file used in place of Roboto, for text Roboto has no glyphs for. */
40
+ font?: string;
41
+ /** A TrueType/OpenType file used in place of Roboto Mono. */
42
+ monoFont?: string;
43
+ }
44
+
45
+ /** A pdfmake document definition. */
46
+ export type DocDefinition = Record<string, unknown>;
47
+
48
+ export declare const DEFAULT_OPTIONS: Required<PdfOptions>;
49
+ export declare const DEFAULT_LOCALIZE: Localize;
50
+
51
+ /**
52
+ * A spec as a PDF. `spec` is a file path, an http(s) URL, the text of a spec (JSON or YAML) or a
53
+ * spec object. Rejects when the spec can't be loaded.
54
+ */
55
+ export declare function generatePdf(
56
+ spec: string | object,
57
+ options?: PdfOptions & FontOptions,
58
+ ): Promise<Buffer>;
59
+
60
+ /** Loads a spec and resolves every $ref (Swagger 2.0 is converted to OpenAPI 3). */
61
+ export declare function loadSpecFile(spec: string | object): Promise<Record<string, unknown>>;
62
+
63
+ /** The pdfmake document definition for a resolved spec. Pure: no file or network access. */
64
+ export declare function buildDocDefinition(
65
+ spec: Record<string, unknown>,
66
+ options?: PdfOptions,
67
+ ): DocDefinition;
68
+
69
+ /** Renders a document definition to a PDF. */
70
+ export declare function renderPdf(
71
+ docDefinition: DocDefinition,
72
+ options?: FontOptions,
73
+ ): Promise<Buffer>;
74
+
75
+ /** The spec's operations grouped by tag, as the sections read them. */
76
+ export declare function buildSpecModel(
77
+ spec: Record<string, unknown>,
78
+ sortTags?: boolean,
79
+ ): Record<string, unknown>;
80
+
81
+ /** Markdown as a list of pdfmake nodes. */
82
+ export declare function markdownToPdfmake(markdown: string): Record<string, unknown>[];
@@ -0,0 +1,50 @@
1
+ /**
2
+ * TypeScript type definitions for `rapipdf`: the `<rapi-pdf>` element.
3
+ */
4
+
5
+ /** `detail` of the `pdf-generated` event. */
6
+ export interface PdfGeneratedDetail {
7
+ /** What was done with the PDF. */
8
+ output: "open" | "download" | "blob";
9
+ }
10
+
11
+ /** `detail` of the `pdf-error` event. */
12
+ export interface PdfErrorDetail {
13
+ error: Error;
14
+ }
15
+
16
+ /**
17
+ * `<rapi-pdf>`: a spec URL field and a button that turns an OpenAPI or Swagger 2.0 spec into a PDF.
18
+ * While a PDF is being made the element has the `generating` attribute.
19
+ */
20
+ export declare class RapiPdf extends HTMLElement {
21
+ /** The `spec-url` attribute. */
22
+ specUrl: string | null;
23
+ /** The labels printed in the PDF: the defaults, with those of the `<template>` child over them. */
24
+ localize: Record<string, string>;
25
+ /** The name a downloaded PDF gets: the `file-name` attribute, with .pdf added when missing. */
26
+ readonly fileName: string;
27
+ /**
28
+ * Makes the PDF and opens it in a new tab, or downloads it when `output="download"` (also when
29
+ * the browser blocks the tab). Rejects when the spec can't be loaded.
30
+ * @param spec a URL, spec text or a spec object; default: the `spec-url` attribute
31
+ */
32
+ generatePdf(spec?: string | object): Promise<void>;
33
+ /**
34
+ * Makes the PDF and returns it, without opening or downloading anything.
35
+ * @param spec a URL, spec text or a spec object; default: the `spec-url` attribute
36
+ */
37
+ getPdfBlob(spec?: string | object): Promise<Blob>;
38
+ }
39
+
40
+ export default RapiPdf;
41
+
42
+ declare global {
43
+ interface HTMLElementTagNameMap {
44
+ "rapi-pdf": RapiPdf;
45
+ }
46
+ interface HTMLElementEventMap {
47
+ "pdf-generated": CustomEvent<PdfGeneratedDetail>;
48
+ "pdf-error": CustomEvent<PdfErrorDetail>;
49
+ }
50
+ }
package/.babelrc DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- { "targets": {"esmodules": true}}
6
- ]
7
- ],
8
- "plugins": [
9
- "@babel/plugin-syntax-dynamic-import"
10
- ]
11
- }
package/.eslintrc DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "extends": "airbnb-base",
3
- "settings": {
4
- "import/resolver":{
5
- "webpack":{
6
- "config":"webpack.config.js"
7
- }
8
- }
9
- },
10
- "env": {
11
- "browser": true,
12
- "node": true
13
- },
14
- "rules": {
15
- "max-len": [1, 300, 2, {"ignoreComments": true}],
16
- "no-debugger": 0,
17
- "no-plusplus": 0,
18
- "no-param-reassign": 0,
19
- "no-nested-ternary": 0,
20
- "no-continue": 0,
21
- "no-restricted-syntax" :0,
22
- "guard-for-in": 0,
23
- "no-loop-func": 0,
24
- "consistent-return": 0,
25
- "array-callback-return": 0,
26
- "prefer-destructuring": 0
27
- }
28
- }
package/dist/index.html DELETED
@@ -1,48 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
6
- <title>RapiPdf</title>
7
- <style>
8
- rapi-pdf {
9
- margin:2px;
10
- width:600px;
11
- }
12
- </style>
13
- </head>
14
-
15
- <body>
16
- <!--
17
- Some sample spec to try
18
- http://10.21.83.83:8080/api/swagger.json
19
- https://api.apis.guru/v2/specs/stripe.com/2019-08-14/swagger.json
20
- https://api.apis.guru/v2/specs/github.com/v3/swagger.json
21
- https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json
22
- https://petstore.swagger.io/v2/swagger.json
23
- https://assets.zuora.com/zuora-documentation/swagger.yaml <<< Large spec with lot of markdown
24
- -->
25
-
26
- <!--
27
- <rapi-pdf id='rapipdf' spec-url="./examples/specs/test.json" include-info="false" include-security="false" include-toc="false"> </rapi-pdf>
28
- -->
29
- <rapi-pdf id='rapipdf' spec-url="./specs/petstore.json" pdf-schema-style="table"> </rapi-pdf>
30
- <rapi-pdf id='rapipdf' spec-url="./specs/petstore.json" pdf-schema-style="object"> </rapi-pdf>
31
- <rapi-pdf id='rapipdf' spec-url="./specs/bitbucket.json"> </rapi-pdf>
32
- <rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml"> </rapi-pdf>
33
- <rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml" include-example="true", button-label="WITH EXAMPLE"> </rapi-pdf>
34
- <rapi-pdf id='rapipdf' spec-url="./specs/data-types.yaml" hide-input="true"> </rapi-pdf>
35
-
36
-
37
- <button onclick="changeSpec()">Change Spec</button>
38
- <script type="text/javascript">
39
- function changeSpec(){
40
- let el = document.getElementById("rapipdf");
41
- el.setAttribute('spec-url', 'set new attrib');
42
- }
43
- </script>
44
-
45
-
46
- <script type="text/javascript" src="rapipdf-min.js"></script></body>
47
-
48
- </html>
Binary file
Binary file
@@ -1 +0,0 @@
1
- {"version":3,"file":"rapipdf-min.js","sources":["webpack:///rapipdf-min.js"],"mappings":";;;;;AAMA;;;;;;;AAk4DA;AAqrNA;;;;;;;AAOA;;;;;;AAMA;;;;;AAKA;;;;;;;;;;;AAWA;;;;;;AAMA;;;;;;AAsqBA;;;;;;AA46mBA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqnMA;;;;;;AA40CA","sourceRoot":""}
Binary file