@scalar/workspace-store 0.21.0 → 0.22.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.
Files changed (156) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/client.d.ts +14 -2
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +8 -6
  5. package/dist/client.js.map +2 -2
  6. package/dist/events/bus.d.ts +1 -1
  7. package/dist/events/bus.d.ts.map +1 -1
  8. package/dist/events/bus.js.map +1 -1
  9. package/dist/events/definitions/auth.d.ts +2 -1
  10. package/dist/events/definitions/auth.d.ts.map +1 -1
  11. package/dist/events/definitions/document.d.ts +11 -0
  12. package/dist/events/definitions/document.d.ts.map +1 -1
  13. package/dist/events/definitions/index.d.ts +3 -1
  14. package/dist/events/definitions/index.d.ts.map +1 -1
  15. package/dist/events/definitions/operation.d.ts +20 -1
  16. package/dist/events/definitions/operation.d.ts.map +1 -1
  17. package/dist/events/definitions/tabs.d.ts +16 -1
  18. package/dist/events/definitions/tabs.d.ts.map +1 -1
  19. package/dist/events/definitions/tag.d.ts +15 -0
  20. package/dist/events/definitions/tag.d.ts.map +1 -0
  21. package/dist/events/definitions/tag.js +1 -0
  22. package/dist/events/definitions/tag.js.map +7 -0
  23. package/dist/events/definitions/ui.d.ts +118 -61
  24. package/dist/events/definitions/ui.d.ts.map +1 -1
  25. package/dist/events/index.d.ts +1 -1
  26. package/dist/events/index.d.ts.map +1 -1
  27. package/dist/events/index.js.map +2 -2
  28. package/dist/mutators/auth.d.ts +6 -1
  29. package/dist/mutators/auth.d.ts.map +1 -1
  30. package/dist/mutators/document.d.ts +3 -0
  31. package/dist/mutators/document.d.ts.map +1 -1
  32. package/dist/mutators/document.js +24 -0
  33. package/dist/mutators/document.js.map +2 -2
  34. package/dist/mutators/index.d.ts +28 -8
  35. package/dist/mutators/index.d.ts.map +1 -1
  36. package/dist/mutators/index.js +24 -1
  37. package/dist/mutators/index.js.map +2 -2
  38. package/dist/mutators/operation.d.ts +27 -8
  39. package/dist/mutators/operation.d.ts.map +1 -1
  40. package/dist/mutators/operation.js +75 -7
  41. package/dist/mutators/operation.js.map +2 -2
  42. package/dist/mutators/request.d.ts +2 -1
  43. package/dist/mutators/request.d.ts.map +1 -1
  44. package/dist/mutators/request.js.map +1 -1
  45. package/dist/mutators/server.d.ts.map +1 -1
  46. package/dist/mutators/server.js +1 -1
  47. package/dist/mutators/server.js.map +2 -2
  48. package/dist/mutators/tabs.d.ts +44 -0
  49. package/dist/mutators/tabs.d.ts.map +1 -0
  50. package/dist/mutators/tabs.js +133 -0
  51. package/dist/mutators/tabs.js.map +7 -0
  52. package/dist/mutators/tag.d.ts +12 -0
  53. package/dist/mutators/tag.d.ts.map +1 -0
  54. package/dist/mutators/tag.js +19 -0
  55. package/dist/mutators/tag.js.map +7 -0
  56. package/dist/navigation/get-navigation-options.js +4 -4
  57. package/dist/navigation/get-navigation-options.js.map +2 -2
  58. package/dist/navigation/helpers/get-openapi-object.d.ts +35 -0
  59. package/dist/navigation/helpers/get-openapi-object.d.ts.map +1 -0
  60. package/dist/navigation/helpers/get-openapi-object.js +31 -0
  61. package/dist/navigation/helpers/get-openapi-object.js.map +7 -0
  62. package/dist/navigation/helpers/get-operation-entries.d.ts +24 -0
  63. package/dist/navigation/helpers/get-operation-entries.d.ts.map +1 -0
  64. package/dist/navigation/helpers/get-operation-entries.js +33 -0
  65. package/dist/navigation/helpers/get-operation-entries.js.map +7 -0
  66. package/dist/navigation/helpers/get-parent-entry.d.ts +15 -0
  67. package/dist/navigation/helpers/get-parent-entry.d.ts.map +1 -0
  68. package/dist/navigation/helpers/get-parent-entry.js +13 -0
  69. package/dist/navigation/helpers/get-parent-entry.js.map +7 -0
  70. package/dist/navigation/helpers/traverse-description.d.ts +0 -1
  71. package/dist/navigation/helpers/traverse-description.d.ts.map +1 -1
  72. package/dist/navigation/helpers/traverse-description.js +0 -1
  73. package/dist/navigation/helpers/traverse-description.js.map +2 -2
  74. package/dist/navigation/helpers/traverse-document.js +1 -1
  75. package/dist/navigation/helpers/traverse-document.js.map +2 -2
  76. package/dist/navigation/helpers/traverse-paths.js +1 -1
  77. package/dist/navigation/helpers/traverse-paths.js.map +1 -1
  78. package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
  79. package/dist/navigation/helpers/traverse-tags.js +2 -2
  80. package/dist/navigation/helpers/traverse-tags.js.map +2 -2
  81. package/dist/navigation/helpers/utils.d.ts +2 -1
  82. package/dist/navigation/helpers/utils.d.ts.map +1 -1
  83. package/dist/navigation/helpers/utils.js.map +1 -1
  84. package/dist/navigation/index.d.ts +2 -1
  85. package/dist/navigation/index.d.ts.map +1 -1
  86. package/dist/navigation/index.js +5 -3
  87. package/dist/navigation/index.js.map +2 -2
  88. package/dist/schemas/extensions/operation/index.d.ts +4 -1
  89. package/dist/schemas/extensions/operation/index.d.ts.map +1 -1
  90. package/dist/schemas/extensions/operation/index.js +22 -0
  91. package/dist/schemas/extensions/operation/index.js.map +3 -3
  92. package/dist/schemas/extensions/operation/x-code-samples.d.ts +0 -5
  93. package/dist/schemas/extensions/operation/x-code-samples.d.ts.map +1 -1
  94. package/dist/schemas/extensions/operation/x-code-samples.js +0 -1
  95. package/dist/schemas/extensions/operation/x-code-samples.js.map +2 -2
  96. package/dist/schemas/extensions/operation/x-post-response.d.ts +0 -18
  97. package/dist/schemas/extensions/operation/x-post-response.d.ts.map +1 -1
  98. package/dist/schemas/extensions/operation/x-post-response.js.map +1 -1
  99. package/dist/schemas/extensions/tag/x-tag-groups.d.ts +2 -13
  100. package/dist/schemas/extensions/tag/x-tag-groups.d.ts.map +1 -1
  101. package/dist/schemas/extensions/tag/x-tag-groups.js +0 -1
  102. package/dist/schemas/extensions/tag/x-tag-groups.js.map +2 -2
  103. package/dist/schemas/extensions/workspace/index.d.ts +4 -0
  104. package/dist/schemas/extensions/workspace/index.d.ts.map +1 -0
  105. package/dist/schemas/extensions/workspace/index.js +15 -0
  106. package/dist/schemas/extensions/workspace/index.js.map +7 -0
  107. package/dist/schemas/extensions/workspace/x-scalar-tabs.d.ts +36 -0
  108. package/dist/schemas/extensions/workspace/x-scalar-tabs.d.ts.map +1 -0
  109. package/dist/schemas/extensions/workspace/x-scalar-tabs.js +16 -0
  110. package/dist/schemas/extensions/workspace/x-scalar-tabs.js.map +7 -0
  111. package/dist/schemas/inmemory-workspace.d.ts +5 -6
  112. package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
  113. package/dist/schemas/navigation.d.ts +8 -0
  114. package/dist/schemas/navigation.d.ts.map +1 -1
  115. package/dist/schemas/navigation.js.map +1 -1
  116. package/dist/schemas/reference-config/index.d.ts +2 -3
  117. package/dist/schemas/reference-config/index.d.ts.map +1 -1
  118. package/dist/schemas/reference-config/settings.d.ts +2 -3
  119. package/dist/schemas/reference-config/settings.d.ts.map +1 -1
  120. package/dist/schemas/v3.1/strict/header.d.ts +0 -45
  121. package/dist/schemas/v3.1/strict/header.d.ts.map +1 -1
  122. package/dist/schemas/v3.1/strict/header.js +1 -3
  123. package/dist/schemas/v3.1/strict/header.js.map +2 -2
  124. package/dist/schemas/v3.1/strict/oauth-flow.d.ts +0 -99
  125. package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
  126. package/dist/schemas/v3.1/strict/oauth-flow.js +0 -7
  127. package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
  128. package/dist/schemas/v3.1/strict/openapi-document.d.ts +71 -104
  129. package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
  130. package/dist/schemas/v3.1/strict/openapi-document.js +0 -1
  131. package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
  132. package/dist/schemas/v3.1/strict/parameter.d.ts +1 -101
  133. package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
  134. package/dist/schemas/v3.1/strict/parameter.js +1 -4
  135. package/dist/schemas/v3.1/strict/parameter.js.map +2 -2
  136. package/dist/schemas/v3.1/strict/ref-definitions.d.ts +0 -1
  137. package/dist/schemas/v3.1/strict/ref-definitions.d.ts.map +1 -1
  138. package/dist/schemas/v3.1/strict/ref-definitions.js +0 -2
  139. package/dist/schemas/v3.1/strict/ref-definitions.js.map +2 -2
  140. package/dist/schemas/v3.1/strict/schema.d.ts +28 -11
  141. package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
  142. package/dist/schemas/v3.1/strict/schema.js +2 -2
  143. package/dist/schemas/v3.1/strict/schema.js.map +2 -2
  144. package/dist/schemas/v3.1/strict/security-scheme.d.ts +1 -54
  145. package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
  146. package/dist/schemas/v3.1/strict/security-scheme.js +0 -5
  147. package/dist/schemas/v3.1/strict/security-scheme.js.map +2 -2
  148. package/dist/schemas/workspace-specification/config.d.ts +2 -3
  149. package/dist/schemas/workspace-specification/config.d.ts.map +1 -1
  150. package/dist/schemas/workspace-specification/index.d.ts +2 -3
  151. package/dist/schemas/workspace-specification/index.d.ts.map +1 -1
  152. package/dist/schemas/workspace.d.ts +35 -22
  153. package/dist/schemas/workspace.d.ts.map +1 -1
  154. package/dist/schemas/workspace.js +11 -6
  155. package/dist/schemas/workspace.js.map +2 -2
  156. package/package.json +50 -36
@@ -20,5 +20,16 @@ export type DocumentEvents = {
20
20
  * Makes sense for the doucments that have been loaded from a remote source
21
21
  */
22
22
  'document:update:watch-mode': boolean;
23
+ /**
24
+ * Create a new empty document in the workspace
25
+ */
26
+ 'document:create:empty-document': {
27
+ /** The name of the empty document to create */
28
+ name: string;
29
+ /** The icon of the empty document to create */
30
+ icon: string;
31
+ /** The callback to call when the document is created */
32
+ callback?: (success: boolean) => void;
33
+ };
23
34
  };
24
35
  //# sourceMappingURL=document.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,sBAAsB,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IAC/C;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,0BAA0B,EAAE,SAAS,CAAA;IACrC;;;;OAIG;IACH,4BAA4B,EAAE,OAAO,CAAA;CACtC,CAAA"}
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,iDAAiD;AACjD,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,sBAAsB,EAAE,WAAW,CAAC,UAAU,CAAC,CAAA;IAC/C;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,0BAA0B,EAAE,SAAS,CAAA;IACrC;;;;OAIG;IACH,4BAA4B,EAAE,OAAO,CAAA;IACrC;;OAEG;IACH,gCAAgC,EAAE;QAChC,+CAA+C;QAC/C,IAAI,EAAE,MAAM,CAAA;QACZ,+CAA+C;QAC/C,IAAI,EAAE,MAAM,CAAA;QACZ,wDAAwD;QACxD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;KACtC,CAAA;CACF,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import type { EnvironmentEvents } from '../../events/definitions/environment.js';
2
2
  import type { TabEvents } from '../../events/definitions/tabs.js';
3
+ import type { TagEvents } from '../../events/definitions/tag.js';
3
4
  import type { WorkspaceEvents } from '../../events/definitions/workspace.js';
4
5
  import type { AnalyticsEvents } from './analytics.js';
5
6
  import type { AuthEvents } from './auth.js';
@@ -9,6 +10,7 @@ import type { MetaEvents } from './meta.js';
9
10
  import type { OperationEvents } from './operation.js';
10
11
  import type { ServerEvents } from './server.js';
11
12
  import type { UIEvents } from './ui.js';
12
- export type ApiReferenceEvents = AuthEvents & AnalyticsEvents & CookieEvents & WorkspaceEvents & DocumentEvents & EnvironmentEvents & MetaEvents & OperationEvents & ServerEvents & TabEvents & UIEvents;
13
+ export type ApiReferenceEvents = AuthEvents & AnalyticsEvents & CookieEvents & WorkspaceEvents & DocumentEvents & EnvironmentEvents & MetaEvents & OperationEvents & ServerEvents & TabEvents & UIEvents & TagEvents;
13
14
  export type { CollectionType } from './common.js';
15
+ export type { CommandPaletteAction } from './ui.js';
14
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GACzC,eAAe,GACf,YAAY,GACZ,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,UAAU,GACV,eAAe,GACf,YAAY,GACZ,SAAS,GACT,QAAQ,CAAA;AAEV,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GACzC,eAAe,GACf,YAAY,GACZ,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,UAAU,GACV,eAAe,GACf,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,SAAS,CAAA;AAEX,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,YAAY,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
2
  import type { OperationExampleMeta, OperationMeta } from '../../mutators/index.js';
3
+ import type { OperationObject } from '../../schemas/v3.1/strict/operation.js';
3
4
  /** Event definitions for the operation */
4
5
  export type OperationEvents = {
5
6
  /**
@@ -9,6 +10,24 @@ export type OperationEvents = {
9
10
  'operation:send:request': {
10
11
  meta: OperationExampleMeta;
11
12
  };
13
+ /**
14
+ * Create a new operation at a specific path and method in the document.
15
+ * Triggers when the user creates a new endpoint via the command palette or other UI.
16
+ */
17
+ 'operation:create:operation': {
18
+ /** The document name where the operation should be created */
19
+ documentName: string;
20
+ /** The example key for the new operation */
21
+ exampleKey?: string;
22
+ /** The path for the new operation (will be normalized to start with /) */
23
+ path: string;
24
+ /** The HTTP method for the operation */
25
+ method: HttpMethod;
26
+ /** The operation object to create */
27
+ operation: OperationObject;
28
+ /** The callback to call when the operation is created */
29
+ callback?: (success: boolean) => void;
30
+ };
12
31
  /**
13
32
  * Update the summary for the operation.
14
33
  * Triggers when the user edits the summary/description for an endpoint.
@@ -32,7 +51,7 @@ export type OperationEvents = {
32
51
  method: HttpMethod;
33
52
  };
34
53
  /** Identifies the target operation by original method and path */
35
- meta: OperationMeta;
54
+ meta: OperationExampleMeta;
36
55
  };
37
56
  /**
38
57
  * Update the path for the operation.
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAErE,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAK5B;;;OAGG;IACH,wBAAwB,EAAE;QACxB,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAMD;;;;OAIG;IACH,0BAA0B,EAAE;QAC1B,uDAAuD;QACvD,OAAO,EAAE;YACP,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;QACD,kFAAkF;QAClF,IAAI,EAAE,aAAa,CAAA;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AA;IAED;;;OAGG;IACH,sCAAsC,EAAE;QACtC,gFAAgF;QAChF,KAAK,EAAE,MAAM,CAAA;QACb,2CAA2C;QAC3C,WAAW,EAAE,MAAM,CAAA;QACnB,wFAAwF;QACxF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;CACF,CAAA"}
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAK5B;;;OAGG;IACH,wBAAwB,EAAE;QACxB,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAMD;;;OAGG;IACH,4BAA4B,EAAE;QAC5B,8DAA8D;QAC9D,YAAY,EAAE,MAAM,CAAA;QACpB,4CAA4C;QAC5C,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,0EAA0E;QAC1E,IAAI,EAAE,MAAM,CAAA;QACZ,wCAAwC;QACxC,MAAM,EAAE,UAAU,CAAA;QAClB,qCAAqC;QACrC,SAAS,EAAE,eAAe,CAAA;QAC1B,yDAAyD;QACzD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;KACtC,CAAA;IAED;;;;OAIG;IACH,0BAA0B,EAAE;QAC1B,uDAAuD;QACvD,OAAO,EAAE;YACP,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;QACD,kFAAkF;QAClF,IAAI,EAAE,aAAa,CAAA;KACpB,CAAA;IAED;;;OAGG;IACH,yBAAyB,EAAE;QACzB,OAAO,EAAE;YACP,uCAAuC;YACvC,MAAM,EAAE,UAAU,CAAA;SACnB,CAAA;QACD,kEAAkE;Q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B,wFAAwF;QACxF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;CACF,CAAA"}
@@ -1,16 +1,29 @@
1
+ import type { XScalarTabs } from '../../schemas/extensions/workspace/x-scalar-tabs.js';
1
2
  /** Event definitions to control the tabs */
2
3
  export type TabEvents = {
4
+ /**
5
+ * Update the tabs of the workspace
6
+ */
7
+ 'tabs:update:tabs': XScalarTabs;
3
8
  /**
4
9
  * Add a new tab
5
10
  */
6
11
  'tabs:add:tab': {
7
12
  event: KeyboardEvent;
8
- };
13
+ } | undefined;
9
14
  /**
10
15
  * Closes the current tab
11
16
  */
12
17
  'tabs:close:tab': {
13
18
  event: KeyboardEvent;
19
+ } | {
20
+ index: number;
21
+ };
22
+ /**
23
+ * Closes all other tabs except the one at the given index
24
+ */
25
+ 'tabs:close:other-tabs': {
26
+ index: number;
14
27
  };
15
28
  /**
16
29
  * Navigates to the previous tab
@@ -29,6 +42,8 @@ export type TabEvents = {
29
42
  */
30
43
  'tabs:focus:tab': {
31
44
  event: KeyboardEvent;
45
+ } | {
46
+ index: number;
32
47
  };
33
48
  /**
34
49
  * Focuses the last tab
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/tabs.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,cAAc,EAAE;QACd,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,gBAAgB,EAAE;QAChB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,wBAAwB,EAAE;QACxB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,oBAAoB,EAAE;QACpB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,gBAAgB,EAAE;QAChB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,qBAAqB,EAAE;QACrB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;CACF,CAAA"}
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAA;AAE/E,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,kBAAkB,EAAE,WAAW,CAAA;IAC/B;;OAEG;IACH,cAAc,EACV;QACE,KAAK,EAAE,aAAa,CAAA;KACrB,GACD,SAAS,CAAA;IACb;;OAEG;IACH,gBAAgB,EAAE;QAAE,KAAK,EAAE,aAAa,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9D;;OAEG;IACH,uBAAuB,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C;;OAEG;IACH,wBAAwB,EAAE;QACxB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,oBAAoB,EAAE;QACpB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,gBAAgB,EAAE;QAAE,KAAK,EAAE,aAAa,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9D;;OAEG;IACH,qBAAqB,EAAE;QACrB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;CACF,CAAA"}
@@ -0,0 +1,15 @@
1
+ /** Event definitions for all things tag related */
2
+ export type TagEvents = {
3
+ /**
4
+ * Create a tag
5
+ */
6
+ 'tag:create:tag': {
7
+ /** The name of the tag to create */
8
+ name: string;
9
+ /** The name of the document to add the tag to */
10
+ documentName: string;
11
+ /** The callback to call when the tag is created */
12
+ callback?: (success: boolean) => void;
13
+ };
14
+ };
15
+ //# sourceMappingURL=tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/tag.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,gBAAgB,EAAE;QAChB,oCAAoC;QACpC,IAAI,EAAE,MAAM,CAAA;QACZ,iDAAiD;QACjD,YAAY,EAAE,MAAM,CAAA;QACpB,mDAAmD;QACnD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;KACtC,CAAA;CACF,CAAA"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=tag.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,92 +1,149 @@
1
1
  import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
- /** Event definitions to control the ui */
2
+ /**
3
+ * Available actions that can be triggered from the command palette.
4
+ * Each action may have an associated payload type.
5
+ */
6
+ type CommandPalettePayload = {
7
+ /** Trigger the import flow for OpenAPI, Swagger, Postman, or cURL */
8
+ 'import-from-openapi-swagger-postman-curl': undefined;
9
+ /** Create a new document in the workspace */
10
+ 'create-document': undefined;
11
+ /** Add a new tag to organize requests */
12
+ 'add-tag': undefined;
13
+ /** Create a new HTTP request */
14
+ 'create-request': undefined;
15
+ /** Add a new example to an existing request */
16
+ 'add-example': undefined;
17
+ /** Import a request from a cURL command string */
18
+ 'import-curl-command': {
19
+ /** The cURL command string to parse and import */
20
+ curl: string;
21
+ };
22
+ };
23
+ /**
24
+ * Type-safe command palette action with correlated action and payload.
25
+ * This ensures that when an action is dispatched, it must include the correct payload type.
26
+ *
27
+ * Example:
28
+ * - { action: 'create-document', payload: undefined }
29
+ * - { action: 'import-curl-command', payload: { curl: 'curl ...' } }
30
+ */
31
+ export type CommandPaletteAction<K extends keyof CommandPalettePayload = keyof CommandPalettePayload> = {
32
+ /** The action to perform */
33
+ action: K;
34
+ /** The payload for this action, typed based on the action */
35
+ payload: CommandPalettePayload[K];
36
+ /** Optional keyboard event that triggered this action */
37
+ event?: KeyboardEvent;
38
+ };
39
+ /**
40
+ * Common payload for keyboard-triggered events.
41
+ * Used when we need to track the original keyboard event for things like
42
+ * preventing default behavior or stopping propagation.
43
+ */
44
+ type KeyboardEventPayload = {
45
+ /** The keyboard event that triggered this action */
46
+ event: KeyboardEvent;
47
+ };
48
+ /**
49
+ * Common payload for navigation item operations.
50
+ * Navigation items include tags, operations, folders, etc. in the sidebar.
51
+ */
52
+ type NavigationItemPayload = {
53
+ /** The unique identifier of the navigation item */
54
+ id: string;
55
+ };
56
+ /**
57
+ * Event definitions for controlling the UI.
58
+ * These events are dispatched through the event bus to trigger UI actions
59
+ * across different components without tight coupling.
60
+ */
3
61
  export type UIEvents = {
4
62
  /**
5
- * Download the document from the store
63
+ * Download the OpenAPI document from the store.
64
+ * Supports multiple export formats for different use cases.
6
65
  */
7
66
  'ui:download:document': {
8
67
  /** Format to download the document in */
9
68
  format: 'json' | 'yaml' | 'direct';
10
69
  };
11
70
  /**
12
- * Focus the address bar
71
+ * Focus the address bar input field.
72
+ * Typically triggered by keyboard shortcuts for quick navigation.
13
73
  */
14
- 'ui:focus:address-bar': {
15
- event: KeyboardEvent;
16
- };
74
+ 'ui:focus:address-bar': KeyboardEventPayload;
17
75
  /**
18
- * Focus the send button
76
+ * Focus the send button to execute a request.
77
+ * Useful for keyboard-driven workflows.
19
78
  */
20
- 'ui:focus:send-button': {
21
- event: KeyboardEvent;
22
- };
79
+ 'ui:focus:send-button': KeyboardEventPayload;
23
80
  /**
24
- * Focus the search
81
+ * Focus the search input in the sidebar.
82
+ * Allows quick filtering of requests and tags.
25
83
  */
26
- 'ui:focus:search': {
27
- event: KeyboardEvent;
28
- };
84
+ 'ui:focus:search': KeyboardEventPayload;
29
85
  /**
30
- * Toggle the sidebar
86
+ * Toggle the sidebar visibility.
87
+ * Useful for maximizing content area on smaller screens.
31
88
  */
32
- 'ui:toggle:sidebar': {
33
- event: KeyboardEvent;
34
- };
89
+ 'ui:toggle:sidebar': KeyboardEventPayload;
35
90
  /**
36
- * Open the Api Client modal to a specific operation
91
+ * Open the API Client modal to a specific operation.
92
+ * This allows deep linking into specific endpoints from external sources.
37
93
  */
38
94
  'ui:open:client-modal': {
39
- /** The HTTP method of the operation to load */
95
+ /** The HTTP method of the operation to load (e.g., GET, POST) */
40
96
  method: HttpMethod;
41
- /** The path of the operation to load */
97
+ /** The path of the operation to load (e.g., /users/{id}) */
42
98
  path: string;
43
- /** The example name to load */
99
+ /** Optional example name to load for this operation */
44
100
  exampleName?: string;
45
101
  };
46
102
  /**
47
- * Close the client modal
103
+ * Close the API Client modal.
104
+ * Typically triggered by escape key or clicking outside the modal.
48
105
  */
49
- 'ui:close:client-modal': {
50
- event: KeyboardEvent;
51
- };
106
+ 'ui:close:client-modal': KeyboardEventPayload;
52
107
  /**
53
- * Open the command palette
108
+ * Hide the modal in modal mode.
109
+ * Generic close action for modal display contexts.
54
110
  */
55
- 'ui:open:command-palette': {
56
- action?: 'import' | 'addServer' | 'addCollection' | 'addTag' | 'addExample' | 'addOperation' | undefined;
57
- event?: KeyboardEvent;
58
- } | undefined;
59
- /** Set a navigation item's (such as a tag or operation) expanded state */
60
- 'toggle:nav-item': {
61
- /** The name of the nav item to toggle */
62
- id: string;
63
- /** Optional defined state for the nav item. */
64
- open?: boolean;
65
- };
66
- /** Select a navigation item. Run on sidebar clicks where a scroll handler would typically be expected */
67
- 'select:nav-item': {
68
- /** The id of the nav item to select */
69
- id: string;
70
- };
71
- /** Fired when a navigation item intersects with the viewport */
72
- 'intersecting:nav-item': {
73
- /** The id of the nav item that is intersecting */
74
- id: string;
75
- };
76
- /** Explicity scroll to a navigation item */
77
- 'scroll-to:nav-item': {
78
- /** The id of the nav item to scroll to */
79
- id: string;
80
- };
81
- /** Copy the url including anchor details for a navigation item */
82
- 'copy-url:nav-item': {
83
- /** The id of the nav item to copy the anchor url for */
84
- id: string;
85
- };
86
- /** On modal mode hide the modal */
87
111
  'hide:modal': undefined;
88
- 'import:curl': {
89
- value: string;
112
+ /**
113
+ * Open the command palette.
114
+ * Can optionally pre-fill with a specific action to execute.
115
+ * If undefined is passed, opens the palette without a pre-selected action.
116
+ */
117
+ 'ui:open:command-palette': CommandPaletteAction | undefined;
118
+ /**
119
+ * Toggle a navigation item's expanded state.
120
+ * Used for collapsible items like tags, folders, or operation groups.
121
+ */
122
+ 'toggle:nav-item': NavigationItemPayload & {
123
+ /** If provided, sets the state explicitly instead of toggling */
124
+ open?: boolean;
90
125
  };
126
+ /**
127
+ * Select a navigation item.
128
+ * Fired when clicking on a sidebar item where a scroll handler would typically be expected.
129
+ * This does not automatically scroll to the item.
130
+ */
131
+ 'select:nav-item': NavigationItemPayload;
132
+ /**
133
+ * Fired when a navigation item intersects with the viewport.
134
+ * Used for highlighting active sections in the sidebar during scrolling.
135
+ */
136
+ 'intersecting:nav-item': NavigationItemPayload;
137
+ /**
138
+ * Explicitly scroll to a navigation item in the content area.
139
+ * This will move the viewport to show the corresponding content.
140
+ */
141
+ 'scroll-to:nav-item': NavigationItemPayload;
142
+ /**
143
+ * Copy the URL with anchor details for a navigation item.
144
+ * Useful for sharing direct links to specific sections.
145
+ */
146
+ 'copy-url:nav-item': NavigationItemPayload;
91
147
  };
148
+ export {};
92
149
  //# sourceMappingURL=ui.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,0CAA0C;AAC1C,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,sBAAsB,EAAE;QACtB,yCAAyC;QACzC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;KACnC,CAAA;IACD;;OAEG;IACH,sBAAsB,EAAE;QACtB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG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B,CAAA;IAE5C;;;OAGG;IACH,sBAAsB,EAAE,oBAAoB,CAAA;IAE5C;;;OAGG;IACH,iBAAiB,EAAE,oBAAoB,CAAA;IAMvC;;;OAGG;IACH,mBAAmB,EAAE,oBAAoB,CAAA;IAMzC;;;OAGG;IACH,sBAAsB,EAAE;QACtB,iEAAiE;QACjE,MAAM,EAAE,UAAU,CAAA;QAClB,4DAA4D;QAC5D,IAAI,EAAE,MAAM,CAAA;QACZ,uDAAuD;QACvD,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IAED;;;OAGG;IACH,uBAAuB,EAAE,oBAAoB,CAAA;IAE7C;;;OAGG;IACH,YAAY,EAAE,SAAS,CAAA;IAMvB;;;;OAIG;IACH,yBAAyB,EAAE,oBAAoB,GAAG,SAAS,CAAA;IAM3D;;;OAGG;IACH,iBAAiB,EAAE,qBAAqB,GAAG;QACzC,iEAAiE;QACjE,IAAI,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;IAED;;;;OAIG;IACH,iBAAiB,EAAE,qBAAqB,CAAA;IAExC;;;OAGG;IACH,uBAAuB,EAAE,qBAAqB,CAAA;IAE9C;;;OAGG;IACH,oBAAoB,EAAE,qBAAqB,CAAA;IAE3C;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB,CAAA;CAC3C,CAAA"}
@@ -1,5 +1,5 @@
1
1
  export { type WorkspaceEventBus, createWorkspaceEventBus } from './bus.js';
2
- export type { ApiReferenceEvents, CollectionType } from './definitions/index.js';
2
+ export type { ApiReferenceEvents, CollectionType, CommandPaletteAction } from './definitions/index.js';
3
3
  export { onCustomEvent } from './listeners.js';
4
4
  export { emitCustomEvent } from './old-definitions.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAA;AACvE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAA;AACvE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/events/index.ts"],
4
- "sourcesContent": ["// biome-ignore lint/performance/noBarrelFile: Entry point for /events\nexport { type WorkspaceEventBus, createWorkspaceEventBus } from './bus'\nexport type { ApiReferenceEvents, CollectionType } from './definitions'\nexport { onCustomEvent } from './listeners'\nexport { emitCustomEvent } from './old-definitions'\n"],
5
- "mappings": "AACA,SAAiC,+BAA+B;AAEhE,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;",
4
+ "sourcesContent": ["export { type WorkspaceEventBus, createWorkspaceEventBus } from './bus'\nexport type { ApiReferenceEvents, CollectionType, CommandPaletteAction } from './definitions'\nexport { onCustomEvent } from './listeners'\nexport { emitCustomEvent } from './old-definitions'\n"],
5
+ "mappings": "AAAA,SAAiC,+BAA+B;AAEhE,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;",
6
6
  "names": []
7
7
  }
@@ -63,7 +63,12 @@ export declare const updateSelectedSecuritySchemes: (document: WorkspaceDocument
63
63
  * name: 'MyHttpAuth',
64
64
  * })
65
65
  */
66
- export declare const updateSecurityScheme: (document: WorkspaceDocument | null, { payload, name }: AuthEvents["auth:update:security-scheme"]) => import("../schemas/v3.1/strict/security-scheme.js").ApiKeyObject | import("../schemas/v3.1/strict/security-scheme.js").HttpObject | import("../schemas/v3.1/strict/security-scheme.js").OAuth2Object | import("../schemas/v3.1/strict/security-scheme.js").OpenIdConnectObject | undefined;
66
+ export declare const updateSecurityScheme: (document: WorkspaceDocument | null, { payload, name }: AuthEvents["auth:update:security-scheme"]) => import("../schemas/v3.1/strict/security-scheme.js").ApiKeyObject | import("../schemas/v3.1/strict/security-scheme.js").HttpObject | import("../schemas/v3.1/strict/security-scheme.js").OAuth2Object | ({
67
+ description?: string;
68
+ } & {
69
+ type: "openIdConnect";
70
+ openIdConnectUrl: string;
71
+ }) | undefined;
67
72
  /**
68
73
  * Sets the selected authentication tab (scheme) index for the given OpenAPI document or operation.
69
74
  * - When on the document level, updates the 'selectedIndex' on the document's x-scalar-selected-security extension.
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/mutators/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAI3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAGlD;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAChB;IACE,IAAI,EAAE,UAAU,CAAA;CACjB,GACD;IACE,IAAI,EAAE,WAAW,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;CACnB,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,iBAAiB,GAAG,IAAI,EAClC,4CAA4C,UAAU,CAAC,uCAAuC,CAAC,kBA+EhG,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,iBAAiB,GAAG,IAAI,EAClC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B,CAAC;;;;;cAc7D,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,iBAAiB,GAAG,IAAI,EAClC,iBAAiB,UAAU,CAAC,0BAA0B,CAAC,SA+BxD,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,iBAAiB,GAAG,IAAI,EAClC,4BAA4B,UAAU,CAAC,6BAA6B,CAAC,SAqCtE,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,iBAAiB,GAAG,IAAI,EAClC,WAAW,UAAU,CAAC,6BAA6B,CAAC,SA6DrD,CAAA"}
@@ -1,3 +1,5 @@
1
+ import type { WorkspaceStore } from '../client.js';
2
+ import type { DocumentEvents } from '../events/definitions/document.js';
1
3
  import type { WorkspaceDocument } from '../schemas.js';
2
4
  /**
3
5
  * Toggle setting selected security schemes at the operation level
@@ -10,4 +12,5 @@ export declare const updateWatchMode: (document: WorkspaceDocument | null, watch
10
12
  * Does not perform a sidebar rebuild for performance benefit
11
13
  */
12
14
  export declare const updateDocumentIcon: (document: WorkspaceDocument | null, icon: string) => void;
15
+ export declare const createEmptyDocument: (store: WorkspaceStore | null, payload: DocumentEvents["document:create:empty-document"]) => Promise<void>;
13
16
  //# sourceMappingURL=document.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/mutators/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAElD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,iBAAiB,GAAG,IAAI,SAMhE,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,UAAU,iBAAiB,GAAG,IAAI,EAAE,WAAW,OAAO,SAMrF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,iBAAiB,GAAG,IAAI,EAAE,MAAM,MAAM,SASlF,CAAA"}
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/mutators/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAElD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,iBAAiB,GAAG,IAAI,SAMhE,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,UAAU,iBAAiB,GAAG,IAAI,EAAE,WAAW,OAAO,SAMrF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,iBAAiB,GAAG,IAAI,EAAE,MAAM,MAAM,SASlF,CAAA;AAED,eAAO,MAAM,mBAAmB,GAC9B,OAAO,cAAc,GAAG,IAAI,EAC5B,SAAS,cAAc,CAAC,gCAAgC,CAAC,kBA4B1D,CAAA"}
@@ -17,7 +17,31 @@ const updateDocumentIcon = (document, icon) => {
17
17
  document["x-scalar-icon"] = icon;
18
18
  document["x-scalar-navigation"].icon = icon;
19
19
  };
20
+ const createEmptyDocument = async (store, payload) => {
21
+ if (!store) {
22
+ return;
23
+ }
24
+ if (store.workspace.documents[payload.name]) {
25
+ payload.callback?.(false);
26
+ return;
27
+ }
28
+ await store.addDocument({
29
+ name: payload.name,
30
+ document: {
31
+ openapi: "3.1.0",
32
+ info: { title: payload.name, version: "1.0.0" },
33
+ paths: {
34
+ "/": {
35
+ get: {}
36
+ }
37
+ },
38
+ "x-scalar-icon": payload.icon
39
+ }
40
+ });
41
+ payload.callback?.(true);
42
+ };
20
43
  export {
44
+ createEmptyDocument,
21
45
  toggleSecurity,
22
46
  updateDocumentIcon,
23
47
  updateWatchMode
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/mutators/document.ts"],
4
- "sourcesContent": ["import type { WorkspaceDocument } from '@/schemas'\n\n/**\n * Toggle setting selected security schemes at the operation level\n */\nexport const toggleSecurity = (document: WorkspaceDocument | null) => {\n if (!document) {\n return\n }\n\n document['x-scalar-set-operation-security'] = !document['x-scalar-set-operation-security']\n}\n\nexport const updateWatchMode = (document: WorkspaceDocument | null, watchMode: boolean) => {\n if (!document) {\n return\n }\n\n document['x-scalar-watch-mode'] = watchMode\n}\n\n/**\n * Update the document icon and also update the corresponding sidebar entry\n *\n * Does not perform a sidebar rebuild for performance benefit\n */\nexport const updateDocumentIcon = (document: WorkspaceDocument | null, icon: string) => {\n if (!document || !document['x-scalar-navigation']) {\n return\n }\n\n // Update the document icon\n document['x-scalar-icon'] = icon\n // Update the sidebar document icon\n document['x-scalar-navigation'].icon = icon\n}\n"],
5
- "mappings": "AAKO,MAAM,iBAAiB,CAAC,aAAuC;AACpE,MAAI,CAAC,UAAU;AACb;AAAA,EACF;AAEA,WAAS,iCAAiC,IAAI,CAAC,SAAS,iCAAiC;AAC3F;AAEO,MAAM,kBAAkB,CAAC,UAAoC,cAAuB;AACzF,MAAI,CAAC,UAAU;AACb;AAAA,EACF;AAEA,WAAS,qBAAqB,IAAI;AACpC;AAOO,MAAM,qBAAqB,CAAC,UAAoC,SAAiB;AACtF,MAAI,CAAC,YAAY,CAAC,SAAS,qBAAqB,GAAG;AACjD;AAAA,EACF;AAGA,WAAS,eAAe,IAAI;AAE5B,WAAS,qBAAqB,EAAE,OAAO;AACzC;",
4
+ "sourcesContent": ["import type { WorkspaceStore } from '@/client'\nimport type { DocumentEvents } from '@/events/definitions/document'\nimport type { WorkspaceDocument } from '@/schemas'\n\n/**\n * Toggle setting selected security schemes at the operation level\n */\nexport const toggleSecurity = (document: WorkspaceDocument | null) => {\n if (!document) {\n return\n }\n\n document['x-scalar-set-operation-security'] = !document['x-scalar-set-operation-security']\n}\n\nexport const updateWatchMode = (document: WorkspaceDocument | null, watchMode: boolean) => {\n if (!document) {\n return\n }\n\n document['x-scalar-watch-mode'] = watchMode\n}\n\n/**\n * Update the document icon and also update the corresponding sidebar entry\n *\n * Does not perform a sidebar rebuild for performance benefit\n */\nexport const updateDocumentIcon = (document: WorkspaceDocument | null, icon: string) => {\n if (!document || !document['x-scalar-navigation']) {\n return\n }\n\n // Update the document icon\n document['x-scalar-icon'] = icon\n // Update the sidebar document icon\n document['x-scalar-navigation'].icon = icon\n}\n\nexport const createEmptyDocument = async (\n store: WorkspaceStore | null,\n payload: DocumentEvents['document:create:empty-document'],\n) => {\n if (!store) {\n return\n }\n\n // Check if the document already exists\n // name should be unique\n if (store.workspace.documents[payload.name]) {\n payload.callback?.(false)\n return\n }\n\n await store.addDocument({\n name: payload.name,\n document: {\n openapi: '3.1.0',\n info: { title: payload.name, version: '1.0.0' },\n paths: {\n '/': {\n get: {},\n },\n },\n 'x-scalar-icon': payload.icon,\n },\n })\n\n payload.callback?.(true)\n}\n"],
5
+ "mappings": "AAOO,MAAM,iBAAiB,CAAC,aAAuC;AACpE,MAAI,CAAC,UAAU;AACb;AAAA,EACF;AAEA,WAAS,iCAAiC,IAAI,CAAC,SAAS,iCAAiC;AAC3F;AAEO,MAAM,kBAAkB,CAAC,UAAoC,cAAuB;AACzF,MAAI,CAAC,UAAU;AACb;AAAA,EACF;AAEA,WAAS,qBAAqB,IAAI;AACpC;AAOO,MAAM,qBAAqB,CAAC,UAAoC,SAAiB;AACtF,MAAI,CAAC,YAAY,CAAC,SAAS,qBAAqB,GAAG;AACjD;AAAA,EACF;AAGA,WAAS,eAAe,IAAI;AAE5B,WAAS,qBAAqB,EAAE,OAAO;AACzC;AAEO,MAAM,sBAAsB,OACjC,OACA,YACG;AACH,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAIA,MAAI,MAAM,UAAU,UAAU,QAAQ,IAAI,GAAG;AAC3C,YAAQ,WAAW,KAAK;AACxB;AAAA,EACF;AAEA,QAAM,MAAM,YAAY;AAAA,IACtB,MAAM,QAAQ;AAAA,IACd,UAAU;AAAA,MACR,SAAS;AAAA,MACT,MAAM,EAAE,OAAO,QAAQ,MAAM,SAAS,QAAQ;AAAA,MAC9C,OAAO;AAAA,QACL,KAAK;AAAA,UACH,KAAK,CAAC;AAAA,QACR;AAAA,MACF;AAAA,MACA,iBAAiB,QAAQ;AAAA,IAC3B;AAAA,EACF,CAAC;AAED,UAAQ,WAAW,IAAI;AACzB;",
6
6
  "names": []
7
7
  }
@@ -30,10 +30,19 @@ export declare function generateClientMutators(store: WorkspaceStore): {
30
30
  active: () => {
31
31
  requestMutators: {
32
32
  moveRequest: ({ source, destination, }: {
33
- source: import("../mutators/request.js").OperationIdentifier;
34
- destination: import("../mutators/request.js").OperationIdentifier;
33
+ source: {
34
+ path: string;
35
+ method: Exclude<import("@scalar/helpers/http/http-methods").HttpMethod, "head" | "options">;
36
+ };
37
+ destination: {
38
+ path: string;
39
+ method: Exclude<import("@scalar/helpers/http/http-methods").HttpMethod, "head" | "options">;
40
+ };
41
+ }) => boolean;
42
+ deleteRequest: ({ path, method }: {
43
+ path: string;
44
+ method: Exclude<import("@scalar/helpers/http/http-methods").HttpMethod, "head" | "options">;
35
45
  }) => boolean;
36
- deleteRequest: ({ path, method }: import("../mutators/request.js").OperationIdentifier) => boolean;
37
46
  };
38
47
  securitySchemeMutators: {
39
48
  addSecurityScheme: (name: string, securityScheme: import("../schemas/v3.1/strict/openapi-document.js").SecuritySchemeObject) => boolean;
@@ -52,10 +61,19 @@ export declare function generateClientMutators(store: WorkspaceStore): {
52
61
  doc: (name: string) => {
53
62
  requestMutators: {
54
63
  moveRequest: ({ source, destination, }: {
55
- source: import("../mutators/request.js").OperationIdentifier;
56
- destination: import("../mutators/request.js").OperationIdentifier;
64
+ source: {
65
+ path: string;
66
+ method: Exclude<import("@scalar/helpers/http/http-methods").HttpMethod, "head" | "options">;
67
+ };
68
+ destination: {
69
+ path: string;
70
+ method: Exclude<import("@scalar/helpers/http/http-methods").HttpMethod, "head" | "options">;
71
+ };
72
+ }) => boolean;
73
+ deleteRequest: ({ path, method }: {
74
+ path: string;
75
+ method: Exclude<import("@scalar/helpers/http/http-methods").HttpMethod, "head" | "options">;
57
76
  }) => boolean;
58
- deleteRequest: ({ path, method }: import("../mutators/request.js").OperationIdentifier) => boolean;
59
77
  };
60
78
  securitySchemeMutators: {
61
79
  addSecurityScheme: (name: string, securityScheme: import("../schemas/v3.1/strict/openapi-document.js").SecuritySchemeObject) => boolean;
@@ -69,9 +87,11 @@ export declare function generateClientMutators(store: WorkspaceStore): {
69
87
  };
70
88
  export { type AuthMeta, deleteSecurityScheme, updateSecurityScheme, updateSelectedAuthTab, updateSelectedScopes, updateSelectedSecuritySchemes, } from './auth.js';
71
89
  export { deleteCookie, upsertCookie } from './cookie.js';
72
- export { toggleSecurity, updateDocumentIcon, updateWatchMode } from './document.js';
90
+ export { createEmptyDocument, toggleSecurity, updateDocumentIcon, updateWatchMode } from './document.js';
73
91
  export { upsertEnvironment, upsertEnvironmentVariable, } from './environment.js';
74
- export { type OperationExampleMeta, type OperationMeta, addOperationParameter, addOperationRequestBodyFormRow, deleteAllOperationParameters, deleteOperationParameter, deleteOperationRequestBodyFormRow, updateOperationMethod, updateOperationParameter, updateOperationPath, updateOperationRequestBodyContentType, updateOperationRequestBodyExample, updateOperationRequestBodyFormRow, updateOperationSummary, } from './operation.js';
92
+ export { type OperationExampleMeta, type OperationMeta, addOperationParameter, addOperationRequestBodyFormRow, createOperation, deleteAllOperationParameters, deleteOperationParameter, deleteOperationRequestBodyFormRow, updateOperationMethod, updateOperationParameter, updateOperationPath, updateOperationRequestBodyContentType, updateOperationRequestBodyExample, updateOperationRequestBodyFormRow, updateOperationSummary, } from './operation.js';
75
93
  export { addServer, deleteServer, updateSelectedServer, updateServer, updateServerVariables, } from './server.js';
94
+ export { addTab, closeOtherTabs, closeTab, focusLastTab, focusTab, navigateNextTab, navigatePreviousTab, updateTabs, } from './tabs.js';
95
+ export { createTag } from './tag.js';
76
96
  export { updateActiveProxy, updateColorMode, updateTheme } from './workspace.js';
77
97
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mutators/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAI9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAE1E;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,cAAc;IAmGxD;;OAEG;;;gCAxFwB,YAAY,KAAG,OAAO;gCAatB,MAAM,KAAG,OAAO;;;;;;;IA6E3C;;;OAGG;;;;;;;;;;;;;;gCA7FwB,YAAY,KAAG,OAAO;gCAatB,MAAM,KAAG,OAAO;;;IAmF3C;;;;OAIG;gBACS,MAAM;;;;;;;;;;;;;gCArGS,YAAY,KAAG,OAAO;gCAatB,MAAM,KAAG,OAAO;;;EA0F9C;AAED,OAAO,EACL,KAAK,QAAQ,EACb,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAChF,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,qBAAqB,EACrB,8BAA8B,EAC9B,4BAA4B,EAC5B,wBAAwB,EACxB,iCAAiC,EACjC,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,qCAAqC,EACrC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,aAAa,CAAA;AACpB,OAAO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