@scalar/api-reference 1.35.4 → 1.35.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @scalar/api-reference
2
2
 
3
+ ## 1.35.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 4e7e8a9: fix: safely check for readonly/writeonly properties
8
+ - Updated dependencies [3bd1209]
9
+ - Updated dependencies [39bbc0e]
10
+ - Updated dependencies [1943b99]
11
+ - @scalar/json-magic@0.4.2
12
+ - @scalar/openapi-parser@0.20.5
13
+ - @scalar/oas-utils@0.4.28
14
+ - @scalar/workspace-store@0.15.5
15
+ - @scalar/api-client@2.5.32
16
+ - @scalar/components@0.14.33
17
+
3
18
  ## 1.35.4
4
19
 
5
20
  ### Patch Changes
@@ -5,7 +5,7 @@
5
5
  * ___/ / /___/ ___ |/ /___/ ___ |/ _, _/
6
6
  * /____/\____/_/ |_/_____/_/ |_/_/ |_|
7
7
  *
8
- * @scalar/api-reference 1.35.4
8
+ * @scalar/api-reference 1.35.5
9
9
  *
10
10
  * Website: https://scalar.com
11
11
  * GitHub: https://github.com/scalar/scalar
@@ -4206,9 +4206,12 @@ if(!bd(e)&&!Array.isArray(e))return e;if(o.has(e))return o.get(e)
4206
4206
  set(e,r,o,a){const i=Reflect.get(e,Cm,a)
4207
4207
  ;if("string"==typeof r&&r.startsWith("_")&&!(null==t?void 0:t.showInternal))return!0
4208
4208
  ;if(r===Am&&"string"==typeof i&&Sd(i)){const e=vd(i);if(0===e.length)return!1
4209
- ;const t=_m(n,e.slice(0,-1))
4210
- ;return!(!t||!bd(t)&&!Array.isArray(t))&&(t[e.at(-1)]=o,!0)}
4211
- return Reflect.set(e,r,o,a)},deleteProperty:(e,t)=>Reflect.deleteProperty(e,t),
4209
+ ;const t=()=>_m(n,e.slice(0,-1));return void 0===t()&&(!function(e,t){
4210
+ t.reduce(((e,t)=>(void 0===e[t]&&(isNaN(Number(t))?e[t]={}:e[t]=[]),e[t])),e)
4211
+ }(n,e.slice(0,-1)),
4212
+ console.warn(`Trying to set $ref-value for invalid reference: ${i}\n\nPlease fix your input file to fix this issue.`)),
4213
+ t()[e.at(-1)]=o,!0}return Reflect.set(e,r,o,a)},
4214
+ deleteProperty:(e,t)=>Reflect.deleteProperty(e,t),
4212
4215
  has:(e,n)=>!("string"==typeof n&&n.startsWith("_")&&!(null==t?void 0:t.showInternal))&&(n===Am&&Cm in e||Reflect.has(e,n)),
4213
4216
  ownKeys(e){
4214
4217
  const n=Reflect.ownKeys(e).filter((e=>"string"!=typeof e||!(e.startsWith("_")&&!(null==t?void 0:t.showInternal))))
@@ -5149,7 +5152,11 @@ schemas:o.definitions
5149
5152
  }),delete o.definitions,o=jm(o,(e=>("string"==typeof e.$ref&&e.$ref.startsWith("#/definitions/")&&(e.$ref=e.$ref.replace(/^#\/definitions\//,"#/components/schemas/")),
5150
5153
  e)))),
5151
5154
  o=jm(o,(e=>("file"===e.type&&(e.type="string",e.format="binary"),e))),Object.hasOwn(o,"parameters")){
5152
- o.components??(o.components={});const e={},t={}
5155
+ o=jm(o,(e=>{var t
5156
+ ;if("string"==typeof e.$ref&&e.$ref.startsWith("#/parameters/")){
5157
+ const n=e.$ref.split("/")[2],r=null==(t=o.parameters)?void 0:t[n]
5158
+ ;"body"===(null==r?void 0:r.in)||"formData"===(null==r?void 0:r.in)?e.$ref=e.$ref.replace(/^#\/parameters\//,"#/components/requestBodies/"):e.$ref=e.$ref.replace(/^#\/parameters\//,"#/components/parameters/")
5159
+ }return e})),o.components??(o.components={});const e={},t={}
5153
5160
  ;for(const[n,r]of Object.entries(o.parameters??{}))"body"===r.in?t[n]=ng(r,o.consumes??["application/json"]):"formData"===r.in?t[n]=rg(r):e[n]=Jm(r)
5154
5161
  ;Object.keys(e).length>0&&(o.components.parameters=e),
5155
5162
  Object.keys(t).length>0&&(o.components.requestBodies=t),delete o.parameters}
@@ -26849,9 +26856,10 @@ const t=Ac((()=>{if(!o_e(e.schema)||!e.schema.properties)return[]
26849
26856
  ;const i=t===(null==(o=e.discriminator)?void 0:o.propertyName),s=r===(null==(a=e.discriminator)?void 0:a.propertyName),l=n.has(t),c=n.has(r)
26850
26857
  ;if(i&&!s)return-1;if(!i&&s)return 1;if(e.orderRequiredPropertiesFirst){
26851
26858
  if(l&&!c)return-1;if(!l&&c)return 1}
26852
- return"alpha"===e.orderSchemaPropertiesBy?t.localeCompare(r):0
26853
- })).filter((t=>e.hideReadOnly?!(e.schema.properties&&!0===EN(e.schema.properties[t]).readOnly):!e.hideWriteOnly||!(e.schema.properties&&!0===EN(e.schema.properties[t]).writeOnly)))
26854
- })),n=e=>{const t=EN(e)
26859
+ return"alpha"===e.orderSchemaPropertiesBy?t.localeCompare(r):0})).filter((t=>{
26860
+ var n,r
26861
+ ;return e.hideReadOnly?!(e.schema.properties&&!0===(null==(n=EN(e.schema.properties[t]))?void 0:n.readOnly)):!e.hideWriteOnly||!(e.schema.properties&&!0===(null==(r=EN(e.schema.properties[t]))?void 0:r.writeOnly))
26862
+ }))})),n=e=>{const t=EN(e)
26855
26863
  ;return"object"==typeof t&&"string"==typeof t["x-additionalPropertiesName"]&&t["x-additionalPropertiesName"].trim().length>0?`${t["x-additionalPropertiesName"].trim()}*`:"propertyName*"
26856
26864
  };return(e,r)=>{
26857
26865
  return ql(),Wl(jl,null,[Ia(o_e)(e.schema)&&e.schema.properties?(ql(!0),Wl(jl,{
@@ -31644,7 +31652,7 @@ console.warn("scalar:update-references-config event has been deprecated, please
31644
31652
  "detail"in e&&Object.assign(r,e.detail)}),!1);return{app:o,
31645
31653
  getConfiguration:()=>r.configuration??{},updateConfiguration:e=>{
31646
31654
  r.configuration=e},destroy:a}}
31647
- ;console.info("@scalar/api-reference@1.35.4"),"object"==typeof window&&(window.Scalar={
31655
+ ;console.info("@scalar/api-reference@1.35.5"),"object"==typeof window&&(window.Scalar={
31648
31656
  createApiReference:BIe}),function(e,t){var n,r
31649
31657
  ;const o=e.querySelector("[data-spec]"),a=e.querySelector("[data-spec-url]")
31650
31658
  ;(null==t?void 0:t.darkMode)?null==(n=e.body)||n.classList.add("dark-mode"):null==(r=e.body)||r.classList.add("light-mode")
@@ -33680,7 +33688,7 @@ cs((()=>t.hotKeys.off(s))),(e,n)=>(ql(),Wl("div",zze,[ec("div",{
33680
33688
  class:Gr(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center",{
33681
33689
  "hidden opacity-0":e.numWorkspaceRequests<=1&&"modal"!==Ia(a)}])
33682
33690
  },["modal"!==Ia(a)?(ql(),
33683
- Wl("div",Vze,[oc(" Scalar App V"+ro(Ia("2.5.31"))+" Beta ",1),n[3]||(n[3]=ec("div",{
33691
+ Wl("div",Vze,[oc(" Scalar App V"+ro(Ia("2.5.32"))+" Beta ",1),n[3]||(n[3]=ec("div",{
33684
33692
  class:"mt-2"},[ec("a",{href:"https://github.com/scalar/scalar/issues/2669",
33685
33693
  target:"_blank"}," Roadmap ")],-1))])):ic("",!0),n[4]||(n[4]=ec("a",{
33686
33694
  class:"gitbook-show scalar-version-number",href:"https://www.scalar.com",