@scalar/workspace-store 0.22.1 → 0.23.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.
- package/CHANGELOG.md +35 -0
- package/dist/events/definitions/document.d.ts +7 -0
- package/dist/events/definitions/document.d.ts.map +1 -1
- package/dist/events/definitions/operation.d.ts +29 -19
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/tag.d.ts +9 -2
- package/dist/events/definitions/tag.d.ts.map +1 -1
- package/dist/events/definitions/ui.d.ts +17 -4
- package/dist/events/definitions/ui.d.ts.map +1 -1
- package/dist/mutators/document.d.ts +6 -0
- package/dist/mutators/document.d.ts.map +1 -1
- package/dist/mutators/document.js +7 -0
- package/dist/mutators/document.js.map +2 -2
- package/dist/mutators/index.d.ts +3 -3
- package/dist/mutators/index.d.ts.map +1 -1
- package/dist/mutators/index.js +10 -6
- package/dist/mutators/index.js.map +2 -2
- package/dist/mutators/operation.d.ts +21 -19
- package/dist/mutators/operation.d.ts.map +1 -1
- package/dist/mutators/operation.js +118 -65
- package/dist/mutators/operation.js.map +2 -2
- package/dist/mutators/tag.d.ts +12 -0
- package/dist/mutators/tag.d.ts.map +1 -1
- package/dist/mutators/tag.js +40 -3
- package/dist/mutators/tag.js.map +2 -2
- package/dist/navigation/helpers/get-operation-entries.d.ts +5 -5
- package/dist/navigation/helpers/get-operation-entries.d.ts.map +1 -1
- package/dist/navigation/helpers/get-operation-entries.js.map +2 -2
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/index.js.map +2 -2
- package/dist/schemas/extensions/general/x-scalar-cookies.d.ts +7 -1
- package/dist/schemas/extensions/general/x-scalar-cookies.d.ts.map +1 -1
- package/dist/schemas/extensions/general/x-scalar-cookies.js +1 -0
- package/dist/schemas/extensions/general/x-scalar-cookies.js.map +2 -2
- package/dist/schemas/inmemory-workspace.d.ts +2 -0
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/reference-config/index.d.ts +1 -0
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +1 -0
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +34 -0
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/workspace-specification/config.d.ts +1 -0
- package/dist/schemas/workspace-specification/config.d.ts.map +1 -1
- package/dist/schemas/workspace-specification/index.d.ts +1 -0
- package/dist/schemas/workspace-specification/index.d.ts.map +1 -1
- package/dist/schemas/workspace.d.ts +9 -0
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.23.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#7474](https://github.com/scalar/scalar/pull/7474) [`10318b6`](https://github.com/scalar/scalar/commit/10318b6a59df49905225bdbd9e19044521cd4581) Thanks [@DemonHa](https://github.com/DemonHa)! - feat: implement sidebar actions
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#7467](https://github.com/scalar/scalar/pull/7467) [`f7c24e4`](https://github.com/scalar/scalar/commit/f7c24e4995580649dbc3cb87007a683f5dd91f7c) Thanks [@amritk](https://github.com/amritk)! - feat: client v2 handle path change with routing and conflict
|
|
12
|
+
|
|
13
|
+
- [#7519](https://github.com/scalar/scalar/pull/7519) [`3f797b6`](https://github.com/scalar/scalar/commit/3f797b67489e07c4f3bf34a39b2175ed2d6f1465) Thanks [@amritk](https://github.com/amritk)! - fix: client request param issues
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`f7c24e4`](https://github.com/scalar/scalar/commit/f7c24e4995580649dbc3cb87007a683f5dd91f7c), [`4ac6227`](https://github.com/scalar/scalar/commit/4ac62278d4205c34a1a302b756ef3632185876cf)]:
|
|
16
|
+
- @scalar/helpers@0.2.2
|
|
17
|
+
- @scalar/themes@0.13.26
|
|
18
|
+
- @scalar/json-magic@0.8.6
|
|
19
|
+
- @scalar/object-utils@1.2.16
|
|
20
|
+
- @scalar/code-highlight@0.2.1
|
|
21
|
+
|
|
22
|
+
## 0.22.2
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- [#7506](https://github.com/scalar/scalar/pull/7506) [`72cd82f`](https://github.com/scalar/scalar/commit/72cd82fb8df63a9e5d0db1202978aebfefd0457a) Thanks [@marcalexiei](https://github.com/marcalexiei)! - fix: use caret version for `yaml`
|
|
27
|
+
|
|
28
|
+
- [#7489](https://github.com/scalar/scalar/pull/7489) [`21aa62e`](https://github.com/scalar/scalar/commit/21aa62e2ebdd262cb5aa53658c3b659736660722) Thanks [@amritk](https://github.com/amritk)! - feat: added new helpers for building client v2 requests
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [[`72cd82f`](https://github.com/scalar/scalar/commit/72cd82fb8df63a9e5d0db1202978aebfefd0457a), [`21aa62e`](https://github.com/scalar/scalar/commit/21aa62e2ebdd262cb5aa53658c3b659736660722), [`72cd82f`](https://github.com/scalar/scalar/commit/72cd82fb8df63a9e5d0db1202978aebfefd0457a)]:
|
|
31
|
+
- @scalar/json-magic@0.8.5
|
|
32
|
+
- @scalar/helpers@0.2.1
|
|
33
|
+
- @scalar/types@0.5.2
|
|
34
|
+
- @scalar/object-utils@1.2.15
|
|
35
|
+
- @scalar/openapi-upgrader@0.1.6
|
|
36
|
+
- @scalar/snippetz@0.5.5
|
|
37
|
+
|
|
3
38
|
## 0.22.1
|
|
4
39
|
|
|
5
40
|
### Patch Changes
|
|
@@ -31,5 +31,12 @@ export type DocumentEvents = {
|
|
|
31
31
|
/** The callback to call when the document is created */
|
|
32
32
|
callback?: (success: boolean) => void;
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Delete a document from the workspace
|
|
36
|
+
*/
|
|
37
|
+
'document:delete:document': {
|
|
38
|
+
/** The name of the document to delete */
|
|
39
|
+
name: string;
|
|
40
|
+
};
|
|
34
41
|
};
|
|
35
42
|
//# 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;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
|
+
{"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;IACD;;OAEG;IACH,0BAA0B,EAAE;QAC1B,yCAAyC;QACzC,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;CACF,CAAA"}
|
|
@@ -1,6 +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/
|
|
3
|
+
import type { OperationObject } from '../../schemas/v3.1/strict/openapi-document.js';
|
|
4
4
|
/** Event definitions for the operation */
|
|
5
5
|
export type OperationEvents = {
|
|
6
6
|
/**
|
|
@@ -42,31 +42,40 @@ export type OperationEvents = {
|
|
|
42
42
|
meta: OperationMeta;
|
|
43
43
|
};
|
|
44
44
|
/**
|
|
45
|
-
* Update the HTTP method for the operation.
|
|
46
|
-
* Triggers when the user changes the HTTP verb (e.g., from GET to POST) in the UI for a given operation.
|
|
45
|
+
* Update the HTTP method or path for the operation.
|
|
46
|
+
* Triggers when the user changes the HTTP verb (e.g., from GET to POST) or path in the UI for a given operation.
|
|
47
|
+
* We send the full payload each time
|
|
47
48
|
*/
|
|
48
|
-
'operation:update:
|
|
49
|
+
'operation:update:pathMethod': {
|
|
49
50
|
payload: {
|
|
50
|
-
/** The new method for the operation */
|
|
51
|
+
/** The new or old method for the operation */
|
|
51
52
|
method: HttpMethod;
|
|
53
|
+
/** The new or old path for the operation */
|
|
54
|
+
path: string;
|
|
52
55
|
};
|
|
53
56
|
/** Identifies the target operation by original method and path */
|
|
54
|
-
meta:
|
|
57
|
+
meta: OperationMeta;
|
|
58
|
+
/** Callback, on completion */
|
|
59
|
+
callback: (status: 'conflict' | 'no-change' | 'success') => void;
|
|
55
60
|
};
|
|
56
61
|
/**
|
|
57
|
-
*
|
|
58
|
-
* Triggers when the user changes the endpoint path for a given operation in the UI.
|
|
59
|
-
* - `payload.path` is the new path for the operation.
|
|
60
|
-
* - `meta` identifies the operation by its original method and path.
|
|
62
|
+
* Delete an operation from the workspace
|
|
61
63
|
*/
|
|
62
|
-
'operation:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
path: string;
|
|
66
|
-
};
|
|
64
|
+
'operation:delete:operation': {
|
|
65
|
+
/** The document name where the operation should be deleted */
|
|
66
|
+
documentName: string;
|
|
67
67
|
/** Identifies the target operation by original method and path */
|
|
68
68
|
meta: OperationMeta;
|
|
69
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Delete an example from the operation
|
|
72
|
+
*/
|
|
73
|
+
'operation:delete:example': {
|
|
74
|
+
/** The document name where the operation should be deleted */
|
|
75
|
+
documentName: string;
|
|
76
|
+
/** Identifies the target operation by original method and path */
|
|
77
|
+
meta: OperationExampleMeta;
|
|
78
|
+
};
|
|
70
79
|
/** ------------------------------------------------------------------------------------------------
|
|
71
80
|
* Operation Parameters Mutators
|
|
72
81
|
* ------------------------------------------------------------------------------------------------ */
|
|
@@ -87,7 +96,7 @@ export type OperationEvents = {
|
|
|
87
96
|
/** The example value for the parameter to add */
|
|
88
97
|
value: string;
|
|
89
98
|
/** Whether the parameter is enabled */
|
|
90
|
-
|
|
99
|
+
isDisabled: boolean;
|
|
91
100
|
};
|
|
92
101
|
/** Identifies the target operation and example variant for the added parameter */
|
|
93
102
|
meta: OperationExampleMeta;
|
|
@@ -109,12 +118,12 @@ export type OperationEvents = {
|
|
|
109
118
|
* Partial payload with new properties for the parameter (optional).
|
|
110
119
|
* - key: The new name of the parameter (if being renamed).
|
|
111
120
|
* - value: The new example value for the parameter.
|
|
112
|
-
* -
|
|
121
|
+
* - isDisabled: Whether the parameter is marked as disabled.
|
|
113
122
|
*/
|
|
114
123
|
payload: Partial<{
|
|
115
124
|
key: string;
|
|
116
125
|
value: string;
|
|
117
|
-
|
|
126
|
+
isDisabled: boolean;
|
|
118
127
|
}>;
|
|
119
128
|
/**
|
|
120
129
|
* Identifies the target operation and example variant for the updated parameter.
|
|
@@ -194,7 +203,8 @@ export type OperationEvents = {
|
|
|
194
203
|
/** The payload containing the details of the form-data row to update */
|
|
195
204
|
payload: Partial<{
|
|
196
205
|
key: string;
|
|
197
|
-
value
|
|
206
|
+
value: string | File | null;
|
|
207
|
+
isDisabled: boolean;
|
|
198
208
|
}>;
|
|
199
209
|
/** The content type of the request body */
|
|
200
210
|
contentType: string;
|
|
@@ -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;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
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,wCAAwC,CAAA;AAE7E,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAK5B;;;OAGG;IACH,wBAAwB,EAAE;QACxB,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAMD;;;OAGG;IACH,4BAA4B,EAAE;QAC5B,8D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,CAAA;SACjC,CAAA;QACD,2CAA2C;QAC3C,WAAW,EAAE,MAAM,CAAA;QACnB,6FAA6F;QAC7F,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,mCAAmC,EAAE;QACnC,qEAAqE;QACrE,OAAO,EAAE,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC,CAAA;QACvD,2CAA2C;QAC3C,WAAW,EAAE,MAAM,CAAA;QACnB,sFAAsF;QACtF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,sCAAsC,EAAE;QACtC,gFAAgF;QAChF,KAAK,EAAE,MAAM,CAAA;QACb,wEAAwE;QACxE,OAAO,EAAE,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;YAAC,UAAU,EAAE,OAAO,CAAA;SAAE,CAAC,CAAA;QACnF,2CAA2C;QAC3C,WAAW,EAAE,MAAM,CAAA;QACnB,wFAAwF;QACxF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;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"}
|
|
@@ -8,8 +8,15 @@ export type TagEvents = {
|
|
|
8
8
|
name: string;
|
|
9
9
|
/** The name of the document to add the tag to */
|
|
10
10
|
documentName: string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Delete a tag from the workspace
|
|
14
|
+
*/
|
|
15
|
+
'tag:delete:tag': {
|
|
16
|
+
/** The document to delete the tag from */
|
|
17
|
+
documentName: string;
|
|
18
|
+
/** The name of the tag to delete */
|
|
19
|
+
name: string;
|
|
13
20
|
};
|
|
14
21
|
};
|
|
15
22
|
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -1 +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;
|
|
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;KACrB,CAAA;IACD;;OAEG;IACH,gBAAgB,EAAE;QAChB,0CAA0C;QAC1C,YAAY,EAAE,MAAM,CAAA;QACpB,oCAAoC;QACpC,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;CACF,CAAA"}
|
|
@@ -9,11 +9,24 @@ type CommandPalettePayload = {
|
|
|
9
9
|
/** Create a new document in the workspace */
|
|
10
10
|
'create-document': undefined;
|
|
11
11
|
/** Add a new tag to organize requests */
|
|
12
|
-
'add-tag':
|
|
12
|
+
'add-tag': {
|
|
13
|
+
/** The document id to add the tag to */
|
|
14
|
+
documentId?: string;
|
|
15
|
+
};
|
|
13
16
|
/** Create a new HTTP request */
|
|
14
|
-
'create-request':
|
|
17
|
+
'create-request': {
|
|
18
|
+
/** The document id to create the request in */
|
|
19
|
+
documentId?: string;
|
|
20
|
+
/** The tag id to add the request to (optional) */
|
|
21
|
+
tagId?: string;
|
|
22
|
+
};
|
|
15
23
|
/** Add a new example to an existing request */
|
|
16
|
-
'add-example':
|
|
24
|
+
'add-example': {
|
|
25
|
+
/** The document id to add the example to */
|
|
26
|
+
documentId?: string;
|
|
27
|
+
/** The operation id to add the example to */
|
|
28
|
+
operationId?: string;
|
|
29
|
+
};
|
|
17
30
|
/** Import a request from a cURL command string */
|
|
18
31
|
'import-curl-command': {
|
|
19
32
|
/** The cURL command string to parse and import */
|
|
@@ -71,7 +84,7 @@ export type UIEvents = {
|
|
|
71
84
|
* Focus the address bar input field.
|
|
72
85
|
* Typically triggered by keyboard shortcuts for quick navigation.
|
|
73
86
|
*/
|
|
74
|
-
'ui:focus:address-bar': KeyboardEventPayload;
|
|
87
|
+
'ui:focus:address-bar': KeyboardEventPayload | undefined;
|
|
75
88
|
/**
|
|
76
89
|
* Focus the send button to execute a request.
|
|
77
90
|
* Useful for keyboard-driven workflows.
|
|
@@ -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;;;GAGG;AACH,KAAK,qBAAqB,GAAG;IAC3B,qEAAqE;IACrE,0CAA0C,EAAE,SAAS,CAAA;IACrD,6CAA6C;IAC7C,iBAAiB,EAAE,SAAS,CAAA;IAC5B,yCAAyC;IACzC,SAAS,EAAE,
|
|
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;;;GAGG;AACH,KAAK,qBAAqB,GAAG;IAC3B,qEAAqE;IACrE,0CAA0C,EAAE,SAAS,CAAA;IACrD,6CAA6C;IAC7C,iBAAiB,EAAE,SAAS,CAAA;IAC5B,yCAAyC;IACzC,SAAS,EAAE;QACT,wCAAwC;QACxC,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA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AMzC;;;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"}
|
|
@@ -13,4 +13,10 @@ export declare const updateWatchMode: (document: WorkspaceDocument | null, watch
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const updateDocumentIcon: (document: WorkspaceDocument | null, icon: string) => void;
|
|
15
15
|
export declare const createEmptyDocument: (store: WorkspaceStore | null, payload: DocumentEvents["document:create:empty-document"]) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Deletes a document from the workspace by its name.
|
|
18
|
+
*
|
|
19
|
+
* Safely no-ops if the store is null.
|
|
20
|
+
*/
|
|
21
|
+
export declare const deleteDocument: (store: WorkspaceStore | null, payload: DocumentEvents["document:delete:document"]) => void;
|
|
16
22
|
//# 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,cAAc,EAAE,M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AAC,0BAA0B,CAAC,SAM/G,CAAA"}
|
|
@@ -40,8 +40,15 @@ const createEmptyDocument = async (store, payload) => {
|
|
|
40
40
|
});
|
|
41
41
|
payload.callback?.(true);
|
|
42
42
|
};
|
|
43
|
+
const deleteDocument = (store, payload) => {
|
|
44
|
+
if (!store) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
store.deleteDocument(payload.name);
|
|
48
|
+
};
|
|
43
49
|
export {
|
|
44
50
|
createEmptyDocument,
|
|
51
|
+
deleteDocument,
|
|
45
52
|
toggleSecurity,
|
|
46
53
|
updateDocumentIcon,
|
|
47
54
|
updateWatchMode
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mutators/document.ts"],
|
|
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;",
|
|
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\n/**\n * Deletes a document from the workspace by its name.\n *\n * Safely no-ops if the store is null.\n */\nexport const deleteDocument = (store: WorkspaceStore | null, payload: DocumentEvents['document:delete:document']) => {\n if (!store) {\n return\n }\n\n store.deleteDocument(payload.name)\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;AAOO,MAAM,iBAAiB,CAAC,OAA8B,YAAwD;AACnH,MAAI,CAAC,OAAO;AACV;AAAA,EACF;AAEA,QAAM,eAAe,QAAQ,IAAI;AACnC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/mutators/index.d.ts
CHANGED
|
@@ -87,11 +87,11 @@ export declare function generateClientMutators(store: WorkspaceStore): {
|
|
|
87
87
|
};
|
|
88
88
|
export { type AuthMeta, deleteSecurityScheme, updateSecurityScheme, updateSelectedAuthTab, updateSelectedScopes, updateSelectedSecuritySchemes, } from './auth.js';
|
|
89
89
|
export { deleteCookie, upsertCookie } from './cookie.js';
|
|
90
|
-
export { createEmptyDocument, toggleSecurity, updateDocumentIcon, updateWatchMode } from './document.js';
|
|
90
|
+
export { createEmptyDocument, deleteDocument, toggleSecurity, updateDocumentIcon, updateWatchMode } from './document.js';
|
|
91
91
|
export { upsertEnvironment, upsertEnvironmentVariable, } from './environment.js';
|
|
92
|
-
export { type OperationExampleMeta, type OperationMeta, addOperationParameter, addOperationRequestBodyFormRow, createOperation, deleteAllOperationParameters, deleteOperationParameter, deleteOperationRequestBodyFormRow,
|
|
92
|
+
export { type OperationExampleMeta, type OperationMeta, addOperationParameter, addOperationRequestBodyFormRow, createOperation, deleteAllOperationParameters, deleteOperation, deleteOperationExample, deleteOperationParameter, deleteOperationRequestBodyFormRow, updateOperationParameter, updateOperationPathMethod, updateOperationRequestBodyContentType, updateOperationRequestBodyExample, updateOperationRequestBodyFormRow, updateOperationSummary, } from './operation.js';
|
|
93
93
|
export { addServer, deleteServer, updateSelectedServer, updateServer, updateServerVariables, } from './server.js';
|
|
94
94
|
export { addTab, closeOtherTabs, closeTab, focusLastTab, focusTab, navigateNextTab, navigatePreviousTab, updateTabs, } from './tabs.js';
|
|
95
|
-
export { createTag } from './tag.js';
|
|
95
|
+
export { createTag, deleteTag } from './tag.js';
|
|
96
96
|
export { updateActiveProxy, updateColorMode, updateTheme } from './workspace.js';
|
|
97
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,EACp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B,EACtB,wBAAwB,EACxB,iCAAiC,EACjC,wBAAwB,EACxB,yBAAyB,EACzB,qCAAqC,EACrC,iCAAiC,EACjC,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,GACtB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,MAAM,EACN,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,UAAU,GACX,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/mutators/index.js
CHANGED
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
updateSelectedSecuritySchemes
|
|
83
83
|
} from "./auth.js";
|
|
84
84
|
import { deleteCookie, upsertCookie } from "./cookie.js";
|
|
85
|
-
import { createEmptyDocument, toggleSecurity, updateDocumentIcon, updateWatchMode } from "./document.js";
|
|
85
|
+
import { createEmptyDocument, deleteDocument, toggleSecurity, updateDocumentIcon, updateWatchMode } from "./document.js";
|
|
86
86
|
import {
|
|
87
87
|
upsertEnvironment,
|
|
88
88
|
upsertEnvironmentVariable
|
|
@@ -92,11 +92,12 @@ import {
|
|
|
92
92
|
addOperationRequestBodyFormRow,
|
|
93
93
|
createOperation,
|
|
94
94
|
deleteAllOperationParameters,
|
|
95
|
+
deleteOperation,
|
|
96
|
+
deleteOperationExample,
|
|
95
97
|
deleteOperationParameter,
|
|
96
98
|
deleteOperationRequestBodyFormRow,
|
|
97
|
-
updateOperationMethod,
|
|
98
99
|
updateOperationParameter,
|
|
99
|
-
|
|
100
|
+
updateOperationPathMethod,
|
|
100
101
|
updateOperationRequestBodyContentType,
|
|
101
102
|
updateOperationRequestBodyExample,
|
|
102
103
|
updateOperationRequestBodyFormRow,
|
|
@@ -119,7 +120,7 @@ import {
|
|
|
119
120
|
navigatePreviousTab,
|
|
120
121
|
updateTabs
|
|
121
122
|
} from "./tabs.js";
|
|
122
|
-
import { createTag } from "./tag.js";
|
|
123
|
+
import { createTag, deleteTag } from "./tag.js";
|
|
123
124
|
import { updateActiveProxy, updateColorMode, updateTheme } from "./workspace.js";
|
|
124
125
|
export {
|
|
125
126
|
addOperationParameter,
|
|
@@ -133,10 +134,14 @@ export {
|
|
|
133
134
|
createTag,
|
|
134
135
|
deleteAllOperationParameters,
|
|
135
136
|
deleteCookie,
|
|
137
|
+
deleteDocument,
|
|
138
|
+
deleteOperation,
|
|
139
|
+
deleteOperationExample,
|
|
136
140
|
deleteOperationParameter,
|
|
137
141
|
deleteOperationRequestBodyFormRow,
|
|
138
142
|
deleteSecurityScheme,
|
|
139
143
|
deleteServer,
|
|
144
|
+
deleteTag,
|
|
140
145
|
focusLastTab,
|
|
141
146
|
focusTab,
|
|
142
147
|
generateClientMutators,
|
|
@@ -146,9 +151,8 @@ export {
|
|
|
146
151
|
updateActiveProxy,
|
|
147
152
|
updateColorMode,
|
|
148
153
|
updateDocumentIcon,
|
|
149
|
-
updateOperationMethod,
|
|
150
154
|
updateOperationParameter,
|
|
151
|
-
|
|
155
|
+
updateOperationPathMethod,
|
|
152
156
|
updateOperationRequestBodyContentType,
|
|
153
157
|
updateOperationRequestBodyExample,
|
|
154
158
|
updateOperationRequestBodyFormRow,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mutators/index.ts"],
|
|
4
|
-
"sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: Mutators entry point */\nimport type { WorkspaceStore } from '@/client'\nimport { getDocument } from '@/mutators/helpers'\nimport { requestMutators } from '@/mutators/request'\nimport { securitySchemeMutators } from '@/mutators/security-schemes'\nimport type { ServerObject } from '@/schemas/v3.1/strict/openapi-document'\n\n/**\n * Generates a set of mutators for managing OpenAPI document and workspace state.\n *\n * @deprecated use the individual mutators instead, this will be removed after we move fully to the new store\n *\n * @param store - The workspace store containing all documents and workspace-level data\n * @returns An object with mutators for the workspace, the active document, and any named document\n */\nexport function generateClientMutators(store: WorkspaceStore) {\n /**\n * Provides mutator functions for managing an array of OpenAPI ServerObject entries.\n *\n * @param target - The array of ServerObject to mutate. If not provided, mutators will be no-ops.\n * @returns An object with addServer and deleteServer methods.\n */\n const serverMutators = (target?: ServerObject[]) => {\n /**\n * Adds a new ServerObject to the target array.\n * @param server - The ServerObject to add.\n * @returns true if the server was added, false if target is undefined.\n */\n const addServer = (server: ServerObject): boolean => {\n if (!target) {\n return false\n }\n target.push(server)\n return true\n }\n\n /**\n * Deletes a ServerObject at the specified index from the target array.\n * @param index - The index of the server to delete.\n * @returns true if the server was deleted, false if target is undefined.\n */\n const deleteServer = (url: string): boolean => {\n if (!target) {\n return false\n }\n const newTarget = [...target.filter((it) => it.url !== url)]\n target.splice(0, target.length)\n target.push(...newTarget)\n return true\n }\n\n return {\n addServer,\n deleteServer,\n }\n }\n\n /**\n * Returns mutators for a specific document by name.\n *\n * @param documentName - The name of the document to get mutators for\n * @returns An object containing mutators for requests, request examples, security schemes, environments, and cookies\n */\n const documentMutators = (documentName: string) => {\n const document = getDocument(store, documentName)\n\n if (document) {\n // Make sure the document has a servers array\n if (!document.servers) {\n document.servers = []\n }\n\n // Make sure the document has the securitySchema object\n if (!document.components) {\n document.components = {}\n }\n\n if (!document.components.securitySchemes) {\n document.components.securitySchemes = {}\n }\n }\n\n return {\n requestMutators: requestMutators(document),\n securitySchemeMutators: securitySchemeMutators(document?.components?.securitySchemes),\n serverMutators: serverMutators(document?.servers),\n }\n }\n\n /**\n * Returns mutators for the workspace-level configuration.\n *\n * @returns An object containing mutators for environments and cookies at the workspace level\n */\n const workspaceMutators = () => {\n const workspace = store.workspace\n\n // Make sure the workspace has a servers array\n if (!workspace['x-scalar-client-config-servers']) {\n workspace['x-scalar-client-config-servers'] = []\n }\n\n // Make sure the workspace has the securitySchema object\n if (!store.workspace['x-scalar-client-config-security-schemes']) {\n store.workspace['x-scalar-client-config-security-schemes'] = {}\n }\n\n return {\n serverMutators: serverMutators(store.workspace['x-scalar-client-config-servers']),\n securitySchemeMutators: securitySchemeMutators(store.workspace['x-scalar-client-config-security-schemes']),\n }\n }\n\n return {\n /**\n * Returns mutators for the workspace-level configuration.\n */\n workspace: () => workspaceMutators(),\n /**\n * Returns mutators for the currently active document.\n * Falls back to the first document if no active document is set.\n */\n active: () =>\n documentMutators(store.workspace['x-scalar-active-document'] ?? Object.keys(store.workspace.documents)[0] ?? ''),\n /**\n * Returns mutators for a specific document by name.\n *\n * @param name - The name of the document\n */\n doc: (name: string) => documentMutators(name),\n }\n}\n\nexport {\n type AuthMeta,\n deleteSecurityScheme,\n updateSecurityScheme,\n updateSelectedAuthTab,\n updateSelectedScopes,\n updateSelectedSecuritySchemes,\n} from './auth'\nexport { deleteCookie, upsertCookie } from './cookie'\nexport { createEmptyDocument, toggleSecurity, updateDocumentIcon, updateWatchMode } from './document'\nexport {\n upsertEnvironment,\n upsertEnvironmentVariable,\n} from './environment'\nexport {\n type OperationExampleMeta,\n type OperationMeta,\n addOperationParameter,\n addOperationRequestBodyFormRow,\n createOperation,\n deleteAllOperationParameters,\n
|
|
5
|
-
"mappings": "AAEA,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AAWhC,SAAS,uBAAuB,OAAuB;AAO5D,QAAM,iBAAiB,CAAC,WAA4B;AAMlD,UAAMA,aAAY,CAAC,WAAkC;AACnD,UAAI,CAAC,QAAQ;AACX,eAAO;AAAA,MACT;AACA,aAAO,KAAK,MAAM;AAClB,aAAO;AAAA,IACT;AAOA,UAAMC,gBAAe,CAAC,QAAyB;AAC7C,UAAI,CAAC,QAAQ;AACX,eAAO;AAAA,MACT;AACA,YAAM,YAAY,CAAC,GAAG,OAAO,OAAO,CAA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AAC,KAAK,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMjH,KAAK,CAAC,SAAiB,iBAAiB,IAAI;AAAA,EAC9C;AACF;AAEA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc,oBAAoB;AAC3C,SAAS,qBAAqB,gBAAgB,oBAAoB,uBAAuB;
|
|
4
|
+
"sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: Mutators entry point */\nimport type { WorkspaceStore } from '@/client'\nimport { getDocument } from '@/mutators/helpers'\nimport { requestMutators } from '@/mutators/request'\nimport { securitySchemeMutators } from '@/mutators/security-schemes'\nimport type { ServerObject } from '@/schemas/v3.1/strict/openapi-document'\n\n/**\n * Generates a set of mutators for managing OpenAPI document and workspace state.\n *\n * @deprecated use the individual mutators instead, this will be removed after we move fully to the new store\n *\n * @param store - The workspace store containing all documents and workspace-level data\n * @returns An object with mutators for the workspace, the active document, and any named document\n */\nexport function generateClientMutators(store: WorkspaceStore) {\n /**\n * Provides mutator functions for managing an array of OpenAPI ServerObject entries.\n *\n * @param target - The array of ServerObject to mutate. If not provided, mutators will be no-ops.\n * @returns An object with addServer and deleteServer methods.\n */\n const serverMutators = (target?: ServerObject[]) => {\n /**\n * Adds a new ServerObject to the target array.\n * @param server - The ServerObject to add.\n * @returns true if the server was added, false if target is undefined.\n */\n const addServer = (server: ServerObject): boolean => {\n if (!target) {\n return false\n }\n target.push(server)\n return true\n }\n\n /**\n * Deletes a ServerObject at the specified index from the target array.\n * @param index - The index of the server to delete.\n * @returns true if the server was deleted, false if target is undefined.\n */\n const deleteServer = (url: string): boolean => {\n if (!target) {\n return false\n }\n const newTarget = [...target.filter((it) => it.url !== url)]\n target.splice(0, target.length)\n target.push(...newTarget)\n return true\n }\n\n return {\n addServer,\n deleteServer,\n }\n }\n\n /**\n * Returns mutators for a specific document by name.\n *\n * @param documentName - The name of the document to get mutators for\n * @returns An object containing mutators for requests, request examples, security schemes, environments, and cookies\n */\n const documentMutators = (documentName: string) => {\n const document = getDocument(store, documentName)\n\n if (document) {\n // Make sure the document has a servers array\n if (!document.servers) {\n document.servers = []\n }\n\n // Make sure the document has the securitySchema object\n if (!document.components) {\n document.components = {}\n }\n\n if (!document.components.securitySchemes) {\n document.components.securitySchemes = {}\n }\n }\n\n return {\n requestMutators: requestMutators(document),\n securitySchemeMutators: securitySchemeMutators(document?.components?.securitySchemes),\n serverMutators: serverMutators(document?.servers),\n }\n }\n\n /**\n * Returns mutators for the workspace-level configuration.\n *\n * @returns An object containing mutators for environments and cookies at the workspace level\n */\n const workspaceMutators = () => {\n const workspace = store.workspace\n\n // Make sure the workspace has a servers array\n if (!workspace['x-scalar-client-config-servers']) {\n workspace['x-scalar-client-config-servers'] = []\n }\n\n // Make sure the workspace has the securitySchema object\n if (!store.workspace['x-scalar-client-config-security-schemes']) {\n store.workspace['x-scalar-client-config-security-schemes'] = {}\n }\n\n return {\n serverMutators: serverMutators(store.workspace['x-scalar-client-config-servers']),\n securitySchemeMutators: securitySchemeMutators(store.workspace['x-scalar-client-config-security-schemes']),\n }\n }\n\n return {\n /**\n * Returns mutators for the workspace-level configuration.\n */\n workspace: () => workspaceMutators(),\n /**\n * Returns mutators for the currently active document.\n * Falls back to the first document if no active document is set.\n */\n active: () =>\n documentMutators(store.workspace['x-scalar-active-document'] ?? Object.keys(store.workspace.documents)[0] ?? ''),\n /**\n * Returns mutators for a specific document by name.\n *\n * @param name - The name of the document\n */\n doc: (name: string) => documentMutators(name),\n }\n}\n\nexport {\n type AuthMeta,\n deleteSecurityScheme,\n updateSecurityScheme,\n updateSelectedAuthTab,\n updateSelectedScopes,\n updateSelectedSecuritySchemes,\n} from './auth'\nexport { deleteCookie, upsertCookie } from './cookie'\nexport { createEmptyDocument, deleteDocument, toggleSecurity, updateDocumentIcon, updateWatchMode } from './document'\nexport {\n upsertEnvironment,\n upsertEnvironmentVariable,\n} from './environment'\nexport {\n type OperationExampleMeta,\n type OperationMeta,\n addOperationParameter,\n addOperationRequestBodyFormRow,\n createOperation,\n deleteAllOperationParameters,\n deleteOperation,\n deleteOperationExample,\n deleteOperationParameter,\n deleteOperationRequestBodyFormRow,\n updateOperationParameter,\n updateOperationPathMethod,\n updateOperationRequestBodyContentType,\n updateOperationRequestBodyExample,\n updateOperationRequestBodyFormRow,\n updateOperationSummary,\n} from './operation'\nexport {\n addServer,\n deleteServer,\n updateSelectedServer,\n updateServer,\n updateServerVariables,\n} from './server'\nexport {\n addTab,\n closeOtherTabs,\n closeTab,\n focusLastTab,\n focusTab,\n navigateNextTab,\n navigatePreviousTab,\n updateTabs,\n} from './tabs'\nexport { createTag, deleteTag } from './tag'\nexport { updateActiveProxy, updateColorMode, updateTheme } from './workspace'\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AAWhC,SAAS,uBAAuB,OAAuB;AAO5D,QAAM,iBAAiB,CAAC,WAA4B;AAMlD,UAAMA,aAAY,CAAC,WAAkC;AACnD,UAAI,CAAC,QAAQ;AACX,eAAO;AAAA,MACT;AACA,aAAO,KAAK,MAAM;AAClB,aAAO;AAAA,IACT;AAOA,UAAMC,gBAAe,CAAC,QAAyB;AAC7C,UAAI,CAAC,QAAQ;AACX,eAAO;AAAA,MACT;AACA,YAAM,YAAY,CAAC,GAAG,OAAO,OAAO,CAAC,OAAO,GAAG,QAAQ,GAAG,CAAC;AAC3D,aAAO,OAAO,GAAG,OAAO,MAAM;AAC9B,aAAO,KAAK,GAAG,SAAS;AACxB,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,MACL,WAAAD;AAAA,MACA,cAAAC;AAAA,IACF;AAAA,EACF;AAQA,QAAM,mBAAmB,CAAC,iBAAyB;AACjD,UAAM,WAAW,YAAY,OAAO,YAAY;AAEhD,QAAI,UAAU;AAEZ,UAAI,CAAC,SAAS,SAAS;AACrB,iBAAS,UAAU,CAAC;AAAA,M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ACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,iBAAiB;AACrC,SAAS,mBAAmB,iBAAiB,mBAAmB;",
|
|
6
6
|
"names": ["addServer", "deleteServer"]
|
|
7
7
|
}
|
|
@@ -64,43 +64,45 @@ export declare const createOperation: (workspaceStore: WorkspaceStore | null, pa
|
|
|
64
64
|
*/
|
|
65
65
|
export declare const updateOperationSummary: (document: WorkspaceDocument | null, { meta, payload: { summary } }: OperationEvents["operation:update:summary"]) => void;
|
|
66
66
|
/**
|
|
67
|
-
* Updates the HTTP method of an operation and moves it to the new
|
|
67
|
+
* Updates the HTTP method and/or path of an operation and moves it to the new location.
|
|
68
68
|
* This function:
|
|
69
|
-
* 1. Moves the operation from the old method to the new method under paths
|
|
69
|
+
* 1. Moves the operation from the old method/path to the new method/path under paths
|
|
70
70
|
* 2. Updates x-scalar-order to maintain the operation's position in the sidebar
|
|
71
|
-
* 3.
|
|
71
|
+
* 3. Syncs path parameters when the path changes
|
|
72
72
|
*
|
|
73
|
-
* Safely no-ops if the document or operation does not exist.
|
|
73
|
+
* Safely no-ops if nothing has changed, or if the document or operation does not exist.
|
|
74
74
|
*
|
|
75
75
|
* Example:
|
|
76
76
|
* ```ts
|
|
77
|
-
*
|
|
77
|
+
* updateOperationPathMethod({
|
|
78
78
|
* document,
|
|
79
79
|
* store,
|
|
80
80
|
* meta: { method: 'get', path: '/users' },
|
|
81
|
-
* payload: { method: 'post' },
|
|
81
|
+
* payload: { method: 'post', path: '/api/users' },
|
|
82
82
|
* })
|
|
83
83
|
* ```
|
|
84
84
|
*/
|
|
85
|
-
export declare const
|
|
85
|
+
export declare const updateOperationPathMethod: (document: WorkspaceDocument | null, store: WorkspaceStore | null, { meta, payload: { method, path } }: OperationEvents["operation:update:pathMethod"], callback: OperationEvents["operation:update:pathMethod"]["callback"]) => void;
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
88
|
-
* parameters in `operation.parameters` with the placeholders present in the
|
|
89
|
-
* provided `path` (e.g. `/users/{id}`). When path parameters change,
|
|
90
|
-
* intelligently syncs them by preserving configurations for renamed parameters
|
|
91
|
-
* (detected by position) and existing parameters. Existing non-path parameters
|
|
92
|
-
* are preserved. The operation is removed from the old path location.
|
|
87
|
+
* Deletes an operation from the workspace
|
|
93
88
|
*
|
|
94
89
|
* Example:
|
|
95
90
|
* ```ts
|
|
96
|
-
*
|
|
91
|
+
* deleteOperation({
|
|
97
92
|
* document,
|
|
98
|
-
* meta: { method: 'get', path: '/users
|
|
99
|
-
* payload: { path: '/users/{userId}' },
|
|
93
|
+
* meta: { method: 'get', path: '/users' },
|
|
100
94
|
* })
|
|
101
95
|
* ```
|
|
102
96
|
*/
|
|
103
|
-
export declare const
|
|
97
|
+
export declare const deleteOperation: (workspace: WorkspaceStore | null, { meta, documentName }: OperationEvents["operation:delete:operation"]) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Deletes an example with the given exampleKey from operation parameters and request body.
|
|
100
|
+
*
|
|
101
|
+
* - Finds the target operation within the specified document and path/method.
|
|
102
|
+
* - Removes example values matching exampleKey from both parameter-level and content-level examples.
|
|
103
|
+
* - Safely no-ops if the document, operation, or request body does not exist.
|
|
104
|
+
*/
|
|
105
|
+
export declare const deleteOperationExample: (workspace: WorkspaceStore | null, { meta: { path, method, exampleKey }, documentName }: OperationEvents["operation:delete:example"]) => void;
|
|
104
106
|
/** ------------------------------------------------------------------------------------------------
|
|
105
107
|
* Operation Parameters Mutators
|
|
106
108
|
* ------------------------------------------------------------------------------------------------ */
|
|
@@ -115,7 +117,7 @@ export declare const updateOperationPath: (document: WorkspaceDocument | null, {
|
|
|
115
117
|
* document,
|
|
116
118
|
* type: 'query',
|
|
117
119
|
* meta: { method: 'get', path: '/search', exampleKey: 'default' },
|
|
118
|
-
* payload: { key: 'q', value: 'john',
|
|
120
|
+
* payload: { key: 'q', value: 'john', isDisabled: false },
|
|
119
121
|
* })
|
|
120
122
|
* ```
|
|
121
123
|
*/
|
|
@@ -133,7 +135,7 @@ export declare const addOperationParameter: (document: WorkspaceDocument | null,
|
|
|
133
135
|
* type: 'query',
|
|
134
136
|
* index: 0,
|
|
135
137
|
* meta: { method: 'get', path: '/search', exampleKey: 'default' },
|
|
136
|
-
* payload: { value: 'alice',
|
|
138
|
+
* payload: { value: 'alice', isDisabled: false },
|
|
137
139
|
* })
|
|
138
140
|
* ```
|
|
139
141
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/mutators/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/mutators/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAMnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAMrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAMlD;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,UAAU,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AA8GD;;;;;;;;;;;;;;;GA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