@scalar/api-reference 1.43.9 → 1.43.10

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.
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./SchemaProperty.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const SchemaProperty = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a4c1ff0a"]]);
4
+ const SchemaProperty = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-7ddcdaa6"]]);
5
5
  export {
6
6
  SchemaProperty as default
7
7
  };
@@ -20,7 +20,7 @@ export declare const isSecretKey: (key: string) => boolean;
20
20
  * @param current - The current schema object (source of truth for structure)
21
21
  * @param stored - The stored object containing secret values to restore
22
22
  */
23
- export declare const mergeSecrets: (current: unknown, stored: unknown) => void;
23
+ export declare const mergeSecuritySchemas: (current: unknown, stored: unknown, level?: number) => void;
24
24
  /**
25
25
  * Loads authentication schemes and selected security settings from local storage.
26
26
  *
@@ -1 +1 @@
1
- {"version":3,"file":"load-from-perssistance.d.ts","sourceRoot":"","sources":["../../src/helpers/load-from-perssistance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAYpE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,cAAc,KAAG,IAM7D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,OAA4C,CAAA;AAEtF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,EAAE,QAAQ,OAAO,KAAG,IAgBhE,CAAA;AA4CD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,cAAc,KAAG,IAkClE,CAAA"}
1
+ {"version":3,"file":"load-from-perssistance.d.ts","sourceRoot":"","sources":["../../src/helpers/load-from-perssistance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAYpE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,cAAc,KAAG,IAM7D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,OAA4C,CAAA;AAEtF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,OAAO,EAAE,QAAQ,OAAO,EAAE,QAAO,MAAU,KAAG,IAyB3F,CAAA;AA4CD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,cAAc,KAAG,IAiClE,CAAA"}
@@ -2,24 +2,25 @@ import { isClient } from "@scalar/api-client/v2/blocks/operation-code-sample";
2
2
  import { isObject } from "@scalar/helpers/object/is-object";
3
3
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
4
  import { clientStorage, authStorage } from "./storage.js";
5
- const SECRET_KEY_PREFIX = "x-scalar-secret-";
6
5
  const loadClientFromStorage = (store) => {
7
6
  const storedClient = clientStorage().get();
8
7
  if (isClient(storedClient) && !store.workspace["x-scalar-default-client"]) {
9
8
  store.update("x-scalar-default-client", storedClient);
10
9
  }
11
10
  };
12
- const isSecretKey = (key) => key.startsWith(SECRET_KEY_PREFIX);
13
- const mergeSecrets = (current, stored) => {
11
+ const mergeSecuritySchemas = (current, stored, level = 0) => {
14
12
  if (!isObject(current) || !isObject(stored)) {
15
13
  return;
16
14
  }
17
15
  for (const [key, storedValue] of Object.entries(stored)) {
18
- if (isSecretKey(key) && storedValue && current[key] === "") {
16
+ if (level === 0 && key === "type") {
17
+ continue;
18
+ }
19
+ if (typeof storedValue === "string" && storedValue !== "" || typeof storedValue === "number" || typeof storedValue === "boolean") {
19
20
  current[key] = storedValue;
20
21
  continue;
21
22
  }
22
- mergeSecrets(getResolvedRef(current[key]), storedValue);
23
+ mergeSecuritySchemas(getResolvedRef(current[key]), storedValue, level + 1);
23
24
  }
24
25
  };
25
26
  const restoreAuthSecretsFromStorage = (store) => {
@@ -34,7 +35,7 @@ const restoreAuthSecretsFromStorage = (store) => {
34
35
  for (const [key, storedScheme] of Object.entries(storedAuthSchemes)) {
35
36
  const currentScheme = getResolvedRef(securitySchemes[key]);
36
37
  if (isObject(currentScheme)) {
37
- mergeSecrets(currentScheme, storedScheme);
38
+ mergeSecuritySchemas(currentScheme, storedScheme);
38
39
  }
39
40
  }
40
41
  };
@@ -47,12 +48,12 @@ const loadAuthSchemesFromStorage = (store) => {
47
48
  console.warn("Active document not found in workspace, skipping auth schemes loading");
48
49
  return;
49
50
  }
50
- if (activeDocument["x-scalar-selected-security"]) {
51
- restoreAuthSecretsFromStorage(store);
52
- return;
53
- }
54
51
  const authPersistence = authStorage();
55
52
  const storedSelectedAuthSchemes = authPersistence.getSelectedSchemes(slug);
53
+ restoreAuthSecretsFromStorage(store);
54
+ if (activeDocument["x-scalar-selected-security"] !== void 0) {
55
+ return;
56
+ }
56
57
  const availableSchemes = new Set(Object.keys(activeDocument.components?.securitySchemes ?? {}));
57
58
  const selectedSchemes = storedSelectedAuthSchemes["x-scalar-selected-security"]?.selectedSchemes;
58
59
  const validSchemes = selectedSchemes?.filter((scheme) => isSchemeValid(scheme, availableSchemes));
@@ -64,11 +65,9 @@ const loadAuthSchemesFromStorage = (store) => {
64
65
  selectedSchemes: validSchemes
65
66
  };
66
67
  }
67
- restoreAuthSecretsFromStorage(store);
68
68
  };
69
69
  export {
70
- isSecretKey,
71
70
  loadAuthSchemesFromStorage,
72
71
  loadClientFromStorage,
73
- mergeSecrets
72
+ mergeSecuritySchemas
74
73
  };
package/dist/style.css CHANGED
@@ -512,7 +512,7 @@ code.property-detail-value[data-v-827ea49d] {
512
512
  text-decoration: line-through;
513
513
  }
514
514
 
515
- .property[data-v-a4c1ff0a] {
515
+ .property[data-v-7ddcdaa6] {
516
516
  color: var(--scalar-color-1);
517
517
  display: flex;
518
518
  flex-direction: column;
@@ -522,7 +522,7 @@ code.property-detail-value[data-v-827ea49d] {
522
522
  }
523
523
 
524
524
  /** Remove top padding for top level schema card */
525
- .property.property--level-0[data-v-a4c1ff0a]:has(
525
+ .property.property--level-0[data-v-7ddcdaa6]:has(
526
526
  > .property-rule
527
527
  > .schema-card
528
528
  > .schema-properties.schema-properties-open
@@ -531,25 +531,25 @@ code.property-detail-value[data-v-827ea49d] {
531
531
  ) {
532
532
  padding-top: 0;
533
533
  }
534
- .property--compact.property--level-0[data-v-a4c1ff0a],
535
- .property--compact.property--level-1[data-v-a4c1ff0a] {
534
+ .property--compact.property--level-0[data-v-7ddcdaa6],
535
+ .property--compact.property--level-1[data-v-7ddcdaa6] {
536
536
  padding: 8px 0;
537
537
  }
538
- .composition-panel .property.property.property.property--level-0[data-v-a4c1ff0a] {
538
+ .composition-panel .property.property.property.property--level-0[data-v-7ddcdaa6] {
539
539
  padding: 0px;
540
540
  }
541
541
  .property--compact.property--level-0
542
542
  .composition-panel
543
- .property--compact.property--level-1[data-v-a4c1ff0a] {
543
+ .property--compact.property--level-1[data-v-7ddcdaa6] {
544
544
  padding: 8px;
545
545
  }
546
546
 
547
547
  /* if a property doesn't have a heading, remove the top padding */
548
- .property[data-v-a4c1ff0a]:has(> .property-rule:nth-of-type(1)):not(.property--compact) {
548
+ .property[data-v-7ddcdaa6]:has(> .property-rule:nth-of-type(1)):not(.property--compact) {
549
549
  padding-top: 8px;
550
550
  padding-bottom: 8px;
551
551
  }
552
- .property--deprecated[data-v-a4c1ff0a] {
552
+ .property--deprecated[data-v-7ddcdaa6] {
553
553
  background: repeating-linear-gradient(
554
554
  -45deg,
555
555
  var(--scalar-background-2) 0,
@@ -559,53 +559,53 @@ code.property-detail-value[data-v-827ea49d] {
559
559
  );
560
560
  background-size: 100%;
561
561
  }
562
- .property--deprecated[data-v-a4c1ff0a] > * {
562
+ .property--deprecated[data-v-7ddcdaa6] > * {
563
563
  opacity: 0.75;
564
564
  }
565
- .property-description[data-v-a4c1ff0a] {
565
+ .property-description[data-v-7ddcdaa6] {
566
566
  margin-top: 6px;
567
567
  line-height: 1.4;
568
568
  font-size: var(--scalar-small);
569
569
  }
570
- .property-description[data-v-a4c1ff0a]:has(+ .property-rule) {
570
+ .property-description[data-v-7ddcdaa6]:has(+ .property-rule) {
571
571
  margin-bottom: 9px;
572
572
  }
573
- [data-v-a4c1ff0a] .property-description * {
573
+ [data-v-7ddcdaa6] .property-description * {
574
574
  color: var(--scalar-color-2) !important;
575
575
  }
576
- .property[data-v-a4c1ff0a]:not(:last-of-type) {
576
+ .property[data-v-7ddcdaa6]:not(:last-of-type) {
577
577
  border-bottom: var(--scalar-border-width) solid var(--scalar-border-color);
578
578
  }
579
- .property-description + .children[data-v-a4c1ff0a],
580
- .children + .property-rule[data-v-a4c1ff0a] {
579
+ .property-description + .children[data-v-7ddcdaa6],
580
+ .children + .property-rule[data-v-7ddcdaa6] {
581
581
  margin-top: 9px;
582
582
  }
583
- .children[data-v-a4c1ff0a] {
583
+ .children[data-v-7ddcdaa6] {
584
584
  display: flex;
585
585
  flex-direction: column;
586
586
  }
587
- .children .property--compact.property--level-1[data-v-a4c1ff0a] {
587
+ .children .property--compact.property--level-1[data-v-7ddcdaa6] {
588
588
  padding: 12px;
589
589
  }
590
- .property-example-value[data-v-a4c1ff0a] {
590
+ .property-example-value[data-v-7ddcdaa6] {
591
591
  all: unset;
592
592
  font-family: var(--scalar-font-code);
593
593
  padding: 6px;
594
594
  border-top: var(--scalar-border-width) solid var(--scalar-border-color);
595
595
  }
596
- .property-rule[data-v-a4c1ff0a] {
596
+ .property-rule[data-v-7ddcdaa6] {
597
597
  border-radius: var(--scalar-radius-lg);
598
598
  display: flex;
599
599
  flex-direction: column;
600
600
  }
601
- .property-rule[data-v-a4c1ff0a]
601
+ .property-rule[data-v-7ddcdaa6]
602
602
 
603
603
  .composition-panel .schema-card .schema-properties.schema-properties-open
604
604
  {
605
605
  border-top-left-radius: 0;
606
606
  border-top-right-radius: 0;
607
607
  }
608
- .property-rule[data-v-a4c1ff0a]
608
+ .property-rule[data-v-7ddcdaa6]
609
609
  .composition-panel > .schema-card > .schema-card-description {
610
610
  padding-left: 8px;
611
611
  padding-right: 8px;
@@ -615,29 +615,29 @@ code.property-detail-value[data-v-827ea49d] {
615
615
  margin-top: 0;
616
616
  }
617
617
  }
618
- .property-example[data-v-a4c1ff0a] {
618
+ .property-example[data-v-7ddcdaa6] {
619
619
  background: transparent;
620
620
  border: none;
621
621
  display: flex;
622
622
  flex-direction: row;
623
623
  gap: 8px;
624
624
  }
625
- .property-example-label[data-v-a4c1ff0a],
626
- .property-example-value[data-v-a4c1ff0a] {
625
+ .property-example-label[data-v-7ddcdaa6],
626
+ .property-example-value[data-v-7ddcdaa6] {
627
627
  padding: 3px 0 0 0;
628
628
  }
629
- .property-example-value[data-v-a4c1ff0a] {
629
+ .property-example-value[data-v-7ddcdaa6] {
630
630
  background: var(--scalar-background-2);
631
631
  border-top: 0;
632
632
  border-radius: var(--scalar-radius);
633
633
  padding: 3px 4px;
634
634
  }
635
- .property-name[data-v-a4c1ff0a] {
635
+ .property-name[data-v-7ddcdaa6] {
636
636
  font-family: var(--scalar-font-code);
637
637
  font-weight: var(--scalar-semibold);
638
638
  }
639
- .property-name-additional-properties[data-v-a4c1ff0a]::before,
640
- .property-name-pattern-properties[data-v-a4c1ff0a]::before {
639
+ .property-name-additional-properties[data-v-7ddcdaa6]::before,
640
+ .property-name-pattern-properties[data-v-7ddcdaa6]::before {
641
641
  text-transform: uppercase;
642
642
  font-size: var(--scalar-micro);
643
643
  display: inline-block;
@@ -648,11 +648,11 @@ code.property-detail-value[data-v-827ea49d] {
648
648
  background-color: var(--scalar-background-2);
649
649
  margin-right: 4px;
650
650
  }
651
- .property-name-pattern-properties[data-v-a4c1ff0a]::before {
651
+ .property-name-pattern-properties[data-v-7ddcdaa6]::before {
652
652
  content: 'regex';
653
653
  }
654
- .property-name-additional-properties[data-v-a4c1ff0a]::before {
655
- content: 'unknown';
654
+ .property-name-additional-properties[data-v-7ddcdaa6]::before {
655
+ content: 'unknown property name';
656
656
  }
657
657
 
658
658
  .section-header-label[data-v-f1ac6c38] {
@@ -10104,10 +10104,10 @@ to {
10104
10104
  white-space: nowrap;
10105
10105
  display: flex;
10106
10106
  }
10107
- [data-v-95e0197f] .cm-editor {
10107
+ [data-v-2dc74300] .cm-editor {
10108
10108
  padding: 0;
10109
10109
  }
10110
- [data-v-95e0197f] .cm-content {
10110
+ [data-v-2dc74300] .cm-content {
10111
10111
  font-family: var(--scalar-font);
10112
10112
  font-size: var(--scalar-small);
10113
10113
  background-color: #0000;
@@ -10116,21 +10116,21 @@ to {
10116
10116
  padding: 5px 8px;
10117
10117
  display: flex;
10118
10118
  }
10119
- [data-v-95e0197f] .cm-content:has(.cm-pill) {
10119
+ [data-v-2dc74300] .cm-content:has(.cm-pill) {
10120
10120
  padding: 5px 8px;
10121
10121
  }
10122
- [data-v-95e0197f] .cm-content .cm-pill:not(:last-of-type) {
10122
+ [data-v-2dc74300] .cm-content .cm-pill:not(:last-of-type) {
10123
10123
  margin-right: .5px;
10124
10124
  }
10125
- [data-v-95e0197f] .cm-content .cm-pill:not(:first-of-type) {
10125
+ [data-v-2dc74300] .cm-content .cm-pill:not(:first-of-type) {
10126
10126
  margin-left: .5px;
10127
10127
  }
10128
- [data-v-95e0197f] .cm-line {
10128
+ [data-v-2dc74300] .cm-line {
10129
10129
  text-overflow: ellipsis;
10130
10130
  padding: 0;
10131
10131
  overflow: hidden;
10132
10132
  }
10133
- .filemask[data-v-95e0197f] {
10133
+ .filemask[data-v-2dc74300] {
10134
10134
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--scalar-background-2) 20px);
10135
10135
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--scalar-background-2) 20px);
10136
10136
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--scalar-background-2) 20px);
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "vue",
21
21
  "vue3"
22
22
  ],
23
- "version": "1.43.9",
23
+ "version": "1.43.10",
24
24
  "engines": {
25
25
  "node": ">=20"
26
26
  },
@@ -85,21 +85,21 @@
85
85
  "microdiff": "^1.5.0",
86
86
  "nanoid": "^5.1.6",
87
87
  "vue": "^3.5.26",
88
+ "@scalar/api-client": "2.19.1",
89
+ "@scalar/components": "0.16.25",
88
90
  "@scalar/code-highlight": "0.2.2",
89
- "@scalar/components": "0.16.24",
90
91
  "@scalar/helpers": "0.2.8",
91
- "@scalar/api-client": "2.19.0",
92
- "@scalar/openapi-parser": "0.24.2",
93
92
  "@scalar/icons": "0.5.2",
94
- "@scalar/oas-utils": "0.6.21",
93
+ "@scalar/openapi-parser": "0.24.2",
94
+ "@scalar/oas-utils": "0.6.22",
95
+ "@scalar/sidebar": "0.7.15",
95
96
  "@scalar/openapi-types": "0.5.3",
96
- "@scalar/sidebar": "0.7.14",
97
- "@scalar/themes": "0.13.26",
98
97
  "@scalar/snippetz": "0.6.5",
99
- "@scalar/use-hooks": "0.3.6",
100
- "@scalar/workspace-store": "0.25.0",
98
+ "@scalar/themes": "0.13.26",
101
99
  "@scalar/types": "0.5.8",
102
- "@scalar/use-toasts": "0.9.1"
100
+ "@scalar/use-hooks": "0.3.6",
101
+ "@scalar/use-toasts": "0.9.1",
102
+ "@scalar/workspace-store": "0.25.1"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@hono/node-server": "^1.19.7",