@scalar/workspace-store 0.18.1 → 0.19.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 +14 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +2 -2
- package/dist/events/definitions/auth.d.ts +59 -14
- package/dist/events/definitions/auth.d.ts.map +1 -1
- package/dist/events/definitions/operation.d.ts +200 -0
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/ui.d.ts +5 -0
- package/dist/events/definitions/ui.d.ts.map +1 -1
- package/dist/helpers/generate-unique-value.d.ts +40 -0
- package/dist/helpers/generate-unique-value.d.ts.map +1 -0
- package/dist/helpers/generate-unique-value.js +42 -0
- package/dist/helpers/generate-unique-value.js.map +7 -0
- package/dist/helpers/overrides-proxy.d.ts.map +1 -1
- package/dist/helpers/overrides-proxy.js +1 -1
- package/dist/helpers/overrides-proxy.js.map +2 -2
- package/dist/helpers/unpack-proxy.d.ts +1 -1
- package/dist/helpers/unpack-proxy.d.ts.map +1 -1
- package/dist/helpers/unpack-proxy.js.map +2 -2
- package/dist/mutators/auth.d.ts +210 -0
- package/dist/mutators/auth.d.ts.map +1 -0
- package/dist/mutators/auth.js +223 -0
- package/dist/mutators/auth.js.map +7 -0
- package/dist/mutators/index.d.ts +3 -1
- package/dist/mutators/index.d.ts.map +1 -1
- package/dist/mutators/index.js +38 -0
- package/dist/mutators/index.js.map +2 -2
- package/dist/mutators/operation.d.ts +313 -0
- package/dist/mutators/operation.d.ts.map +1 -0
- package/dist/mutators/operation.js +340 -0
- package/dist/mutators/operation.js.map +7 -0
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.d.ts +13 -0
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.d.ts.map +1 -0
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.js +9 -0
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.js.map +7 -0
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.d.ts +21 -0
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.d.ts.map +1 -0
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js +8 -0
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js.map +7 -0
- package/dist/schemas/extensions/security/x-scalar-selected-security.d.ts +17 -0
- package/dist/schemas/extensions/security/x-scalar-selected-security.d.ts.map +1 -0
- package/dist/schemas/extensions/security/x-scalar-selected-security.js +14 -0
- package/dist/schemas/extensions/security/x-scalar-selected-security.js.map +7 -0
- package/dist/schemas/inmemory-workspace.d.ts +32 -8
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/reference-config/index.d.ts +16 -4
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +16 -4
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +546 -138
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +4 -1
- package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
- package/dist/schemas/v3.1/strict/operation.d.ts +10 -6
- package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/operation.js +9 -7
- package/dist/schemas/v3.1/strict/operation.js.map +2 -2
- package/dist/schemas/v3.1/strict/request-body.d.ts +6 -3
- package/dist/schemas/v3.1/strict/request-body.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/request-body.js +15 -8
- package/dist/schemas/v3.1/strict/request-body.js.map +2 -2
- package/dist/schemas/workspace-specification/config.d.ts +16 -4
- package/dist/schemas/workspace-specification/config.d.ts.map +1 -1
- package/dist/schemas/workspace-specification/index.d.ts +16 -4
- package/dist/schemas/workspace-specification/index.d.ts.map +1 -1
- package/dist/schemas/workspace.d.ts +112 -28
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
|
+
import type { OperationExampleMeta, OperationMeta } from '../../mutators/index.js';
|
|
1
3
|
/** Event definitions for the operation */
|
|
2
4
|
export type OperationEvents = {
|
|
3
5
|
/**
|
|
@@ -7,5 +9,203 @@ export type OperationEvents = {
|
|
|
7
9
|
/** The name of the example to select */
|
|
8
10
|
name: string;
|
|
9
11
|
};
|
|
12
|
+
/** ------------------------------------------------------------------------------------------------
|
|
13
|
+
* Operation Actions
|
|
14
|
+
* ------------------------------------------------------------------------------------------------ */
|
|
15
|
+
/**
|
|
16
|
+
* Fires when the user requests to send the operation (e.g., triggers "Try It" or sends a request).
|
|
17
|
+
* Contains the OperationExampleMeta, which identifies the operation and the example variant to use.
|
|
18
|
+
*/
|
|
19
|
+
'operation:send:request': {
|
|
20
|
+
meta: OperationExampleMeta;
|
|
21
|
+
};
|
|
22
|
+
/** ------------------------------------------------------------------------------------------------
|
|
23
|
+
* Operation Draft Mutators
|
|
24
|
+
* ------------------------------------------------------------------------------------------------ */
|
|
25
|
+
/**
|
|
26
|
+
* Update the summary for the operation.
|
|
27
|
+
* Triggers when the user edits the summary/description for an endpoint.
|
|
28
|
+
* The new summary is provided in the payload, and meta identifies the operation by HTTP method and path.
|
|
29
|
+
*/
|
|
30
|
+
'operation:update:summary': {
|
|
31
|
+
/** The new summary string to set for the operation. */
|
|
32
|
+
payload: {
|
|
33
|
+
summary: string;
|
|
34
|
+
};
|
|
35
|
+
/** Operation identity for which the summary is being updated (method and path) */
|
|
36
|
+
meta: OperationMeta;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Update the HTTP method for the operation.
|
|
40
|
+
* Triggers when the user changes the HTTP verb (e.g., from GET to POST) in the UI for a given operation.
|
|
41
|
+
*/
|
|
42
|
+
'operation:update:method': {
|
|
43
|
+
payload: {
|
|
44
|
+
/** The new method for the operation */
|
|
45
|
+
method: HttpMethod;
|
|
46
|
+
};
|
|
47
|
+
/** Identifies the target operation by original method and path */
|
|
48
|
+
meta: OperationMeta;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Update the path for the operation.
|
|
52
|
+
* Triggers when the user changes the endpoint path for a given operation in the UI.
|
|
53
|
+
* - `payload.path` is the new path for the operation.
|
|
54
|
+
* - `meta` identifies the operation by its original method and path.
|
|
55
|
+
*/
|
|
56
|
+
'operation:update:path': {
|
|
57
|
+
payload: {
|
|
58
|
+
/** The new path for the operation */
|
|
59
|
+
path: string;
|
|
60
|
+
};
|
|
61
|
+
/** Identifies the target operation by original method and path */
|
|
62
|
+
meta: OperationMeta;
|
|
63
|
+
};
|
|
64
|
+
/** ------------------------------------------------------------------------------------------------
|
|
65
|
+
* Operation Parameters Mutators
|
|
66
|
+
* ------------------------------------------------------------------------------------------------ */
|
|
67
|
+
/**
|
|
68
|
+
* Add a parameter to the operation.
|
|
69
|
+
*/
|
|
70
|
+
'operation:add:parameter': {
|
|
71
|
+
/**
|
|
72
|
+
* The type of the parameter to add. Can be 'path', 'query', 'header', or 'cookie'.
|
|
73
|
+
*/
|
|
74
|
+
type: 'path' | 'query' | 'header' | 'cookie';
|
|
75
|
+
/**
|
|
76
|
+
* The payload containing the details of the parameter to add.
|
|
77
|
+
*/
|
|
78
|
+
payload: {
|
|
79
|
+
/** The name of the parameter to add */
|
|
80
|
+
key: string;
|
|
81
|
+
/** The example value for the parameter to add */
|
|
82
|
+
value: string;
|
|
83
|
+
/** Whether the parameter is enabled */
|
|
84
|
+
isEnabled: boolean;
|
|
85
|
+
};
|
|
86
|
+
/** Identifies the target operation and example variant for the added parameter */
|
|
87
|
+
meta: OperationExampleMeta;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Update a parameter of the operation.
|
|
91
|
+
* Triggers when the user updates an existing parameter (name, value, or enabled/disabled) in the UI for a given operation.
|
|
92
|
+
*/
|
|
93
|
+
'operation:update:parameter': {
|
|
94
|
+
/**
|
|
95
|
+
* The type of the parameter to update. Can be 'path', 'query', 'header', or 'cookie'.
|
|
96
|
+
*/
|
|
97
|
+
type: 'path' | 'query' | 'header' | 'cookie';
|
|
98
|
+
/**
|
|
99
|
+
* The zero-based index of the parameter of the given type being updated within the operation.
|
|
100
|
+
*/
|
|
101
|
+
index: number;
|
|
102
|
+
/**
|
|
103
|
+
* Partial payload with new properties for the parameter (optional).
|
|
104
|
+
* - key: The new name of the parameter (if being renamed).
|
|
105
|
+
* - value: The new example value for the parameter.
|
|
106
|
+
* - isEnabled: Whether the parameter is marked as enabled.
|
|
107
|
+
*/
|
|
108
|
+
payload: Partial<{
|
|
109
|
+
key: string;
|
|
110
|
+
value: string;
|
|
111
|
+
isEnabled: boolean;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Identifies the target operation and example variant for the updated parameter.
|
|
115
|
+
*/
|
|
116
|
+
meta: OperationExampleMeta;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Delete a parameter from an operation at the specified index and type.
|
|
120
|
+
* Fires when the user removes a parameter (by type and index) from an operation.
|
|
121
|
+
*/
|
|
122
|
+
'operation:delete:parameter': {
|
|
123
|
+
/** The type of the parameter to delete. Can be 'path', 'query', 'header', or 'cookie'. */
|
|
124
|
+
type: 'path' | 'query' | 'header' | 'cookie';
|
|
125
|
+
/** The zero-based index of the parameter of the given type to be deleted within the operation. */
|
|
126
|
+
index: number;
|
|
127
|
+
/** Identifies the target operation and example variant for the deleted parameter. */
|
|
128
|
+
meta: OperationExampleMeta;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Delete all parameters of a given type from the operation.
|
|
132
|
+
* Fires when the user removes all parameters of a specific type from an operation.
|
|
133
|
+
*/
|
|
134
|
+
'operation:delete-all:parameters': {
|
|
135
|
+
/** The type of the parameters to delete. Can be 'path', 'query', 'header', or 'cookie'. */
|
|
136
|
+
type: 'path' | 'query' | 'header' | 'cookie';
|
|
137
|
+
/** Identifies the target operation for the parameter deletion. */
|
|
138
|
+
meta: OperationMeta;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Update the selected request-body content type for the current example key.
|
|
142
|
+
* Triggers when the user selects a new content type for the request body in the UI.
|
|
143
|
+
*/
|
|
144
|
+
'operation:update:requestBody:contentType': {
|
|
145
|
+
payload: {
|
|
146
|
+
/** The new content type for the request body */
|
|
147
|
+
contentType: string;
|
|
148
|
+
};
|
|
149
|
+
/** Identifies the target operation and example variant for the updated content type */
|
|
150
|
+
meta: OperationExampleMeta;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Update the value for the request body example.
|
|
154
|
+
* Triggers when the user updates the example value for a specific request body content type.
|
|
155
|
+
*/
|
|
156
|
+
'operation:update:requestBody:value': {
|
|
157
|
+
payload: {
|
|
158
|
+
/** The new value for the request body example */
|
|
159
|
+
value: string | File | undefined;
|
|
160
|
+
};
|
|
161
|
+
/** The content type of the request body */
|
|
162
|
+
contentType: string;
|
|
163
|
+
/** Identifies the target operation and example variant for the updated request body value */
|
|
164
|
+
meta: OperationExampleMeta;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Add a form-data row to the request body example.
|
|
168
|
+
* Triggers when the user adds a new form-data row to the request body in the UI.
|
|
169
|
+
*/
|
|
170
|
+
'operation:add:requestBody:formRow': {
|
|
171
|
+
/** The payload containing the details of the form-data row to add */
|
|
172
|
+
payload: Partial<{
|
|
173
|
+
key: string;
|
|
174
|
+
value: string | File;
|
|
175
|
+
}>;
|
|
176
|
+
/** The content type of the request body */
|
|
177
|
+
contentType: string;
|
|
178
|
+
/** Identifies the target operation and example variant for the added form-data row */
|
|
179
|
+
meta: OperationExampleMeta;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Update a form-data row at the specified index for the request body example.
|
|
183
|
+
* Triggers when the user updates an existing form-data row (name, value) in the UI for a given operation.
|
|
184
|
+
*/
|
|
185
|
+
'operation:update:requestBody:formRow': {
|
|
186
|
+
/** The zero-based index of the form-data row to update within the operation. */
|
|
187
|
+
index: number;
|
|
188
|
+
/** The payload containing the details of the form-data row to update */
|
|
189
|
+
payload: Partial<{
|
|
190
|
+
key: string;
|
|
191
|
+
value?: string | File | null;
|
|
192
|
+
}>;
|
|
193
|
+
/** The content type of the request body */
|
|
194
|
+
contentType: string;
|
|
195
|
+
/** Identifies the target operation and example variant for the updated form-data row */
|
|
196
|
+
meta: OperationExampleMeta;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Delete a form-data row from the request body example.
|
|
200
|
+
* Triggers when the user removes a form-data row (by type and index) from the request body in the UI.
|
|
201
|
+
*/
|
|
202
|
+
'operation:delete:requestBody:formRow': {
|
|
203
|
+
/** The zero-based index of the form-data row to delete within the operation. */
|
|
204
|
+
index: number;
|
|
205
|
+
/** The content type of the request body */
|
|
206
|
+
contentType: string;
|
|
207
|
+
/** Identifies the target operation and example variant for the deleted form-data row */
|
|
208
|
+
meta: OperationExampleMeta;
|
|
209
|
+
};
|
|
10
210
|
};
|
|
11
211
|
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/operation.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,yBAAyB,EAAE;QACzB,wCAAwC;QACxC,IAAI,EAAE,MAAM,CAAA;KACb,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;AAErE,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAC5B;;OA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,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,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;SAAE,CAAC,CAAA;QAC/D,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"}
|
|
@@ -48,5 +48,10 @@ export type UIEvents = {
|
|
|
48
48
|
/** The id of the nav item to copy the anchor url for */
|
|
49
49
|
id: string;
|
|
50
50
|
};
|
|
51
|
+
/** On modal mode hide the modal */
|
|
52
|
+
'hide:modal': undefined;
|
|
53
|
+
'import:curl': {
|
|
54
|
+
value: string;
|
|
55
|
+
};
|
|
51
56
|
};
|
|
52
57
|
//# 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,mBAAmB,EAAE;QACnB,yCAAyC;QACzC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;KACnC,CAAA;IACD;;OAEG;IACH,aAAa,EAAE;QACb,+CAA+C;QAC/C,MAAM,EAAE,UAAU,CAAA;QAClB,wCAAwC;QACxC,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD;;OAEG;IACH,sBAAsB,EAClB,QAAQ,GACR,WAAW,GACX,eAAe,GACf,QAAQ,GACR,YAAY,GACZ,cAAc,GACd,SAAS,CAAA;IAEb,0EAA0E;IAC1E,iBAAiB,EAAE;QACjB,yCAAyC;QACzC,EAAE,EAAE,MAAM,CAAA;QACV,+CAA+C;QAC/C,IAAI,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;IAED,yGAAyG;IACzG,iBAAiB,EAAE;QACjB,uCAAuC;QACvC,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IAED,gEAAgE;IAChE,uBAAuB,EAAE;QACvB,kDAAkD;QAClD,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IAED,4CAA4C;IAC5C,oBAAoB,EAAE;QACpB,0CAA0C;QAC1C,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IAED,kEAAkE;IAClE,mBAAmB,EAAE;QACnB,wDAAwD;QACxD,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;CACF,CAAA"}
|
|
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,mBAAmB,EAAE;QACnB,yCAAyC;QACzC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;KACnC,CAAA;IACD;;OAEG;IACH,aAAa,EAAE;QACb,+CAA+C;QAC/C,MAAM,EAAE,UAAU,CAAA;QAClB,wCAAwC;QACxC,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IACD;;OAEG;IACH,sBAAsB,EAClB,QAAQ,GACR,WAAW,GACX,eAAe,GACf,QAAQ,GACR,YAAY,GACZ,cAAc,GACd,SAAS,CAAA;IAEb,0EAA0E;IAC1E,iBAAiB,EAAE;QACjB,yCAAyC;QACzC,EAAE,EAAE,MAAM,CAAA;QACV,+CAA+C;QAC/C,IAAI,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;IAED,yGAAyG;IACzG,iBAAiB,EAAE;QACjB,uCAAuC;QACvC,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IAED,gEAAgE;IAChE,uBAAuB,EAAE;QACvB,kDAAkD;QAClD,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IAED,4CAA4C;IAC5C,oBAAoB,EAAE;QACpB,0CAA0C;QAC1C,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IAED,kEAAkE;IAClE,mBAAmB,EAAE;QACnB,wDAAwD;QACxD,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IAED,mCAAmC;IACnC,YAAY,EAAE,SAAS,CAAA;IAEvB,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a unique value based on a given default value and a validation function.
|
|
3
|
+
*
|
|
4
|
+
* The process works as follows:
|
|
5
|
+
* 1. Optionally transform (e.g., slugify) the default value using a transformation function.
|
|
6
|
+
* 2. Check if this value is unique by executing the provided validation function.
|
|
7
|
+
* 3. If not unique, repeatedly append an incrementing integer (e.g., "my-name 1", "my-name 2", ...) and re-check uniqueness,
|
|
8
|
+
* up to a maximum number of attempts (maxRetries).
|
|
9
|
+
* 4. Returns the first unique value found or undefined if a unique value cannot be generated within the maximum retries.
|
|
10
|
+
*
|
|
11
|
+
* Example:
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Existing names in use
|
|
14
|
+
* const existing = new Set(['foo', 'foo 1', 'foo 2']);
|
|
15
|
+
* const uniqueName = generateUniqueValue({
|
|
16
|
+
* defaultValue: 'foo',
|
|
17
|
+
* validation: (value) => !existing.has(value),
|
|
18
|
+
* // transformation is optional, e.g. (val) => val.toLowerCase().replace(/[^\w]+/g, '-'),
|
|
19
|
+
* maxRetries: 10,
|
|
20
|
+
* });
|
|
21
|
+
* // uniqueName === 'foo 3'
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function generateUniqueValue({ defaultValue,
|
|
25
|
+
/** Check function to verify the uniqueness of the value */
|
|
26
|
+
validation,
|
|
27
|
+
/** Transformation function to transform the default value (such as into a slug) */
|
|
28
|
+
transformation, maxRetries, }: {
|
|
29
|
+
/**
|
|
30
|
+
* Value which will be used to derive a new unique value.
|
|
31
|
+
*/
|
|
32
|
+
defaultValue: string;
|
|
33
|
+
/** Validate if the new generated value is unique */
|
|
34
|
+
validation: (value: string) => Promise<boolean> | boolean;
|
|
35
|
+
/** Transform the default value to get a new value which will match the schema of the value we need to derive */
|
|
36
|
+
transformation?: (value: string) => string;
|
|
37
|
+
/** The maximum number of retry attempts to generate a unique value. */
|
|
38
|
+
maxRetries: number;
|
|
39
|
+
}): string | undefined;
|
|
40
|
+
//# sourceMappingURL=generate-unique-value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-unique-value.d.ts","sourceRoot":"","sources":["../../src/helpers/generate-unique-value.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,YAAY;AACZ,2DAA2D;AAC3D,UAAU;AACV,mFAAmF;AACnF,cAAc,EACd,UAAc,GACf,EAAE;IACD;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,oDAAoD;IACpD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;IACzD,gHAAgH;IAChH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAC1C,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAA;CACnB,sBAYA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function generateUniqueValue({
|
|
2
|
+
defaultValue,
|
|
3
|
+
/** Check function to verify the uniqueness of the value */
|
|
4
|
+
validation,
|
|
5
|
+
/** Transformation function to transform the default value (such as into a slug) */
|
|
6
|
+
transformation,
|
|
7
|
+
maxRetries = 5
|
|
8
|
+
}) {
|
|
9
|
+
const transformed = transformation?.(defaultValue) ?? defaultValue;
|
|
10
|
+
if (validation(transformed)) {
|
|
11
|
+
return transformed;
|
|
12
|
+
}
|
|
13
|
+
return incrementValue({
|
|
14
|
+
value: [transformed, 1],
|
|
15
|
+
validation,
|
|
16
|
+
maxRetries
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function incrementValue({
|
|
20
|
+
value,
|
|
21
|
+
validation,
|
|
22
|
+
maxRetries,
|
|
23
|
+
attempts = 0
|
|
24
|
+
}) {
|
|
25
|
+
if (attempts >= maxRetries) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const incremented = value.join(" ");
|
|
29
|
+
if (validation(incremented)) {
|
|
30
|
+
return incremented;
|
|
31
|
+
}
|
|
32
|
+
return incrementValue({
|
|
33
|
+
value: [value[0], value[1] + 1],
|
|
34
|
+
validation,
|
|
35
|
+
maxRetries,
|
|
36
|
+
attempts: attempts + 1
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
generateUniqueValue
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=generate-unique-value.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/helpers/generate-unique-value.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Generates a unique value based on a given default value and a validation function.\n *\n * The process works as follows:\n * 1. Optionally transform (e.g., slugify) the default value using a transformation function.\n * 2. Check if this value is unique by executing the provided validation function.\n * 3. If not unique, repeatedly append an incrementing integer (e.g., \"my-name 1\", \"my-name 2\", ...) and re-check uniqueness,\n * up to a maximum number of attempts (maxRetries).\n * 4. Returns the first unique value found or undefined if a unique value cannot be generated within the maximum retries.\n *\n * Example:\n * ```ts\n * // Existing names in use\n * const existing = new Set(['foo', 'foo 1', 'foo 2']);\n * const uniqueName = generateUniqueValue({\n * defaultValue: 'foo',\n * validation: (value) => !existing.has(value),\n * // transformation is optional, e.g. (val) => val.toLowerCase().replace(/[^\\w]+/g, '-'),\n * maxRetries: 10,\n * });\n * // uniqueName === 'foo 3'\n * ```\n */\nexport function generateUniqueValue({\n defaultValue,\n /** Check function to verify the uniqueness of the value */\n validation,\n /** Transformation function to transform the default value (such as into a slug) */\n transformation,\n maxRetries = 5,\n}: {\n /**\n * Value which will be used to derive a new unique value.\n */\n defaultValue: string\n /** Validate if the new generated value is unique */\n validation: (value: string) => Promise<boolean> | boolean\n /** Transform the default value to get a new value which will match the schema of the value we need to derive */\n transformation?: (value: string) => string\n /** The maximum number of retry attempts to generate a unique value. */\n maxRetries: number\n}) {\n const transformed = transformation?.(defaultValue) ?? defaultValue\n\n if (validation(transformed)) {\n return transformed\n }\n\n return incrementValue({\n value: [transformed, 1],\n validation,\n maxRetries,\n })\n}\n\n/**\n * Attempts to generate a unique value by appending and incrementing a counter to a base string.\n *\n * On each attempt, appends the next incrementing integer (e.g. \"foo 1\", \"foo 2\", etc.) to the original value,\n * and checks with the validation function whether the candidate value is unique.\n *\n * Continues until a unique value is found, or the maximum number of attempts is reached.\n *\n * Returns the first unique value found, or undefined if a unique value cannot be generated within maxRetries.\n *\n * Example:\n * ```ts\n * const existing = new Set(['bar', 'bar 1']);\n * const result = incrementValue({\n * value: ['bar', 1],\n * validation: (val) => !existing.has(val),\n * maxRetries: 5,\n * });\n * // result === \"bar 2\"\n * ```\n */\nfunction incrementValue({\n value,\n validation,\n maxRetries,\n attempts = 0,\n}: {\n value: [string, number] // [base value, next increment]\n validation: (value: string) => Promise<boolean> | boolean\n maxRetries: number\n attempts?: number\n}) {\n if (attempts >= maxRetries) {\n return\n }\n\n const incremented = value.join(' ')\n\n if (validation(incremented)) {\n return incremented\n }\n\n return incrementValue({\n value: [value[0], value[1] + 1],\n validation,\n maxRetries,\n attempts: attempts + 1,\n })\n}\n"],
|
|
5
|
+
"mappings": "AAuBO,SAAS,oBAAoB;AAAA,EAClC;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA,aAAa;AACf,GAWG;AACD,QAAM,cAAc,iBAAiB,YAAY,KAAK;AAEtD,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO;AAAA,EACT;AAEA,SAAO,eAAe;AAAA,IACpB,OAAO,CAAC,aAAa,CAAC;AAAA,IACtB;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAuBA,SAAS,eAAe;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AACb,GAKG;AACD,MAAI,YAAY,YAAY;AAC1B;AAAA,EACF;AAEA,QAAM,cAAc,MAAM,KAAK,GAAG;AAElC,MAAI,WAAW,WAAW,GAAG;AAC3B,WAAO;AAAA,EACT;AAEA,SAAO,eAAe;AAAA,IACpB,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;AAAA,IAC9B;AAAA,IACA;AAAA,IACA,UAAU,WAAW;AAAA,EACvB,CAAC;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides-proxy.d.ts","sourceRoot":"","sources":["../../src/helpers/overrides-proxy.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,eAA+B,CAAA;AAE9D;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,CAAC,CAAA;AAE1F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,QAAQ,CAAC,EACT,UAAU;IACR,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CAC3B,EACD,OAAM;IACJ,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAG5B,KACA,CAgEF,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,KAAK,OAAO,KAAG,OAErD,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"overrides-proxy.d.ts","sourceRoot":"","sources":["../../src/helpers/overrides-proxy.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,eAA+B,CAAA;AAE9D;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,CAAC,CAAA;AAE1F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,QAAQ,CAAC,EACT,UAAU;IACR,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CAC3B,EACD,OAAM;IACJ,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAG5B,KACA,CAgEF,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,KAAK,OAAO,KAAG,OAErD,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAUnD"}
|
|
@@ -49,7 +49,7 @@ const isOverridesProxyObject = (obj) => {
|
|
|
49
49
|
return typeof obj === "object" && obj !== null && obj[isOverridesProxy] === true;
|
|
50
50
|
};
|
|
51
51
|
function unpackOverridesProxy(input) {
|
|
52
|
-
if (input[isOverridesProxy]) {
|
|
52
|
+
if (typeof input === "object" && input !== null && input[isOverridesProxy]) {
|
|
53
53
|
return input[getOverridesTarget];
|
|
54
54
|
}
|
|
55
55
|
return input;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers/overrides-proxy.ts"],
|
|
4
|
-
"sourcesContent": ["import { isObject } from '@/helpers/general'\n\nconst isOverridesProxy = Symbol('isOverridesProxy')\nexport const getOverridesTarget = Symbol('getOverridesTarget')\n\n/**\n * Recursively makes all properties of a type optional.\n *\n * - If T is an object, recursively applies DeepPartial to each property, making them optional.\n * - Otherwise, T is returned as-is.\n *\n * @template T - The type to make deeply partial (optional).\n * @example\n * type Example = { a: { b: number } }\n * type PartialExample = DeepPartial<Example>\n * // Result: { a?: { b?: number } }\n */\nexport type DeepPartial<T> = T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T\n\n/**\n * Creates a proxy object that overlays \"overrides\" on top of a target object.\n *\n * - When reading a property, if an override exists, it is returned; otherwise, the original value is returned.\n * - When writing to a property, if an override exists, it is updated; otherwise, the original object is updated.\n * - This works recursively for nested objects, so overrides can be deeply partial.\n * - Special symbols are used to identify the proxy and to access the original target.\n *\n * @template T - The type of the target object.\n * @param target - The original object to proxy.\n * @param overrides - An optional object containing override values (deeply partial).\n * @returns A proxy object that reflects overrides on top of the target.\n *\n * @example\n * const original = { a: 1, b: { c: 2 } }\n * const overrides = { b: { c: 42 } }\n * const proxy = createOverridesProxy(original, { overrides })\n *\n * console.log(proxy.a) // 1 (from original)\n * console.log(proxy.b.c) // 42 (from overrides)\n *\n * proxy.a = 100\n * console.log(original.a) // 100\n *\n * proxy.b.c = 99\n * console.log(overrides.b.c) // 99\n */\nexport const createOverridesProxy = <T extends Record<string, unknown>>(\n target: T,\n options?: {\n overrides?: DeepPartial<T>\n },\n args: {\n cache: WeakMap<object, any>\n } = {\n cache: new WeakMap(),\n },\n): T => {\n if (!target || typeof target !== 'object') {\n return target\n }\n\n // Return existing proxy for the same target to ensure referential stability\n if (args.cache.has(target)) {\n return args.cache.get(target)!\n }\n\n const { overrides } = options ?? {}\n\n // Proxy handler to intercept get/set operations\n const handler: ProxyHandler<T> = {\n get(target, prop, receiver) {\n // Special symbol to identify this as an overrides proxy\n if (prop === isOverridesProxy) {\n return true\n }\n\n // Special symbol to access the original target object\n if (prop === getOverridesTarget) {\n return target\n }\n\n const value = Reflect.get(target, prop, receiver)\n\n // Return early if the value is already an overrides proxy\n if (isOverridesProxyObject(value)) {\n return value\n }\n\n // If the value is not an object, return the override if it exists, else the original value\n if (!isObject(value)) {\n return Reflect.get(overrides ?? {}, prop) ?? value\n }\n\n // For nested objects, recursively create a proxy with the corresponding overrides\n return createOverridesProxy(value, { overrides: Reflect.get(overrides ?? {}, prop) }, args)\n },\n\n set(target, prop, value, receiver) {\n // Prevent setting special symbols\n if (prop === isOverridesProxy || prop === getOverridesTarget) {\n return false\n }\n\n // If an override exists for this property, update it\n const hasOverride = overrides && Reflect.has(overrides, prop)\n\n if (hasOverride && overrides && typeof overrides === 'object') {\n ;(overrides as any)[prop] = value\n return true\n }\n\n // Otherwise, update the original target\n return Reflect.set(target, prop, value, receiver)\n },\n }\n\n // Return the proxy object\n const proxy = new Proxy<T>(target, handler)\n args.cache.set(target, proxy)\n return proxy\n}\n\nexport const isOverridesProxyObject = (obj: unknown): boolean => {\n return typeof obj === 'object' && obj !== null && (obj as { [isOverridesProxy]: boolean })[isOverridesProxy] === true\n}\n\n/**\n * Unpacks an object from the overrides proxy, returning the original (unproxied) target object.\n * If the input is not an overrides proxy, returns the object as-is.\n *\n * @param input - The potentially proxied object\n * @returns The original unproxied target object or the input object\n */\nexport function unpackOverridesProxy<T>(input: T): T {\n if ((input as T & {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AO;AAAA,MACT;AAGA,aAAO,QAAQ,IAAIA,SAAQ,MAAM,OAAO,QAAQ;AAAA,IAClD;AAAA,EACF;AAGA,QAAM,QAAQ,IAAI,MAAS,QAAQ,OAAO;AAC1C,OAAK,MAAM,IAAI,QAAQ,KAAK;AAC5B,SAAO;AACT;AAEO,MAAM,yBAAyB,CAAC,QAA0B;AAC/D,SAAO,OAAO,QAAQ,YAAY,QAAQ,QAAS,IAAwC,gBAAgB,MAAM;AACnH;AASO,SAAS,qBAAwB,OAAa;AACnD,
|
|
4
|
+
"sourcesContent": ["import { isObject } from '@/helpers/general'\n\nconst isOverridesProxy = Symbol('isOverridesProxy')\nexport const getOverridesTarget = Symbol('getOverridesTarget')\n\n/**\n * Recursively makes all properties of a type optional.\n *\n * - If T is an object, recursively applies DeepPartial to each property, making them optional.\n * - Otherwise, T is returned as-is.\n *\n * @template T - The type to make deeply partial (optional).\n * @example\n * type Example = { a: { b: number } }\n * type PartialExample = DeepPartial<Example>\n * // Result: { a?: { b?: number } }\n */\nexport type DeepPartial<T> = T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T\n\n/**\n * Creates a proxy object that overlays \"overrides\" on top of a target object.\n *\n * - When reading a property, if an override exists, it is returned; otherwise, the original value is returned.\n * - When writing to a property, if an override exists, it is updated; otherwise, the original object is updated.\n * - This works recursively for nested objects, so overrides can be deeply partial.\n * - Special symbols are used to identify the proxy and to access the original target.\n *\n * @template T - The type of the target object.\n * @param target - The original object to proxy.\n * @param overrides - An optional object containing override values (deeply partial).\n * @returns A proxy object that reflects overrides on top of the target.\n *\n * @example\n * const original = { a: 1, b: { c: 2 } }\n * const overrides = { b: { c: 42 } }\n * const proxy = createOverridesProxy(original, { overrides })\n *\n * console.log(proxy.a) // 1 (from original)\n * console.log(proxy.b.c) // 42 (from overrides)\n *\n * proxy.a = 100\n * console.log(original.a) // 100\n *\n * proxy.b.c = 99\n * console.log(overrides.b.c) // 99\n */\nexport const createOverridesProxy = <T extends Record<string, unknown>>(\n target: T,\n options?: {\n overrides?: DeepPartial<T>\n },\n args: {\n cache: WeakMap<object, any>\n } = {\n cache: new WeakMap(),\n },\n): T => {\n if (!target || typeof target !== 'object') {\n return target\n }\n\n // Return existing proxy for the same target to ensure referential stability\n if (args.cache.has(target)) {\n return args.cache.get(target)!\n }\n\n const { overrides } = options ?? {}\n\n // Proxy handler to intercept get/set operations\n const handler: ProxyHandler<T> = {\n get(target, prop, receiver) {\n // Special symbol to identify this as an overrides proxy\n if (prop === isOverridesProxy) {\n return true\n }\n\n // Special symbol to access the original target object\n if (prop === getOverridesTarget) {\n return target\n }\n\n const value = Reflect.get(target, prop, receiver)\n\n // Return early if the value is already an overrides proxy\n if (isOverridesProxyObject(value)) {\n return value\n }\n\n // If the value is not an object, return the override if it exists, else the original value\n if (!isObject(value)) {\n return Reflect.get(overrides ?? {}, prop) ?? value\n }\n\n // For nested objects, recursively create a proxy with the corresponding overrides\n return createOverridesProxy(value, { overrides: Reflect.get(overrides ?? {}, prop) }, args)\n },\n\n set(target, prop, value, receiver) {\n // Prevent setting special symbols\n if (prop === isOverridesProxy || prop === getOverridesTarget) {\n return false\n }\n\n // If an override exists for this property, update it\n const hasOverride = overrides && Reflect.has(overrides, prop)\n\n if (hasOverride && overrides && typeof overrides === 'object') {\n ;(overrides as any)[prop] = value\n return true\n }\n\n // Otherwise, update the original target\n return Reflect.set(target, prop, value, receiver)\n },\n }\n\n // Return the proxy object\n const proxy = new Proxy<T>(target, handler)\n args.cache.set(target, proxy)\n return proxy\n}\n\nexport const isOverridesProxyObject = (obj: unknown): boolean => {\n return typeof obj === 'object' && obj !== null && (obj as { [isOverridesProxy]: boolean })[isOverridesProxy] === true\n}\n\n/**\n * Unpacks an object from the overrides proxy, returning the original (unproxied) target object.\n * If the input is not an overrides proxy, returns the object as-is.\n *\n * @param input - The potentially proxied object\n * @returns The original unproxied target object or the input object\n */\nexport function unpackOverridesProxy<T>(input: T): T {\n if (\n typeof input === 'object' &&\n input !== null &&\n (input as T & { [isOverridesProxy]: boolean | undefined })[isOverridesProxy]\n ) {\n return (input as T & { [getOverridesTarget]: T })[getOverridesTarget]\n }\n\n return input\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB;AAEzB,MAAM,mBAAmB,OAAO,kBAAkB;AAC3C,MAAM,qBAAqB,OAAO,oBAAoB;AA2CtD,MAAM,uBAAuB,CAClC,QACA,SAGA,OAEI;AAAA,EACF,OAAO,oBAAI,QAAQ;AACrB,MACM;AACN,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,WAAO;AAAA,EACT;AAGA,MAAI,KAAK,MAAM,IAAI,MAAM,GAAG;AAC1B,WAAO,KAAK,MAAM,IAAI,MAAM;AAAA,EAC9B;AAEA,QAAM,EAAE,UAAU,IAAI,WAAW,CAAC;AAGlC,QAAM,UAA2B;AAAA,IAC/B,IAAIA,SAAQ,MAAM,UAAU;AAE1B,UAAI,SAAS,kBAAkB;AAC7B,eAAO;AAAA,MACT;AAGA,UAAI,SAAS,oBAAoB;AAC/B,eAAOA;AAAA,MACT;AAEA,YAAM,QAAQ,QAAQ,IAAIA,SAAQ,MAAM,QAAQ;AAGhD,UAAI,uBAAuB,KAAK,GAAG;AACjC,eAAO;AAAA,MACT;AAGA,UAAI,CAAC,SAAS,KAAK,GAAG;AACpB,eAAO,QAAQ,IAAI,aAAa,CAAC,GAAG,IAAI,KAAK;AAAA,MAC/C;AAGA,aAAO,qBAAqB,OAAO,EAAE,WAAW,QAAQ,IAAI,aAAa,CAAC,GAAG,IAAI,EAAE,GAAG,IAAI;AAAA,IAC5F;AAAA,IAEA,IAAIA,SAAQ,MAAM,OAAO,UAAU;AAEjC,UAAI,SAAS,oBAAoB,SAAS,oBAAoB;AAC5D,eAAO;AAAA,MACT;AAGA,YAAM,cAAc,aAAa,QAAQ,IAAI,WAAW,IAAI;AAE5D,UAAI,eAAe,aAAa,OAAO,cAAc,UAAU;AAC7D;AAAC,QAAC,UAAkB,IAAI,IAAI;AAC5B,eAAO;AAAA,MACT;AAGA,aAAO,QAAQ,IAAIA,SAAQ,MAAM,OAAO,QAAQ;AAAA,IAClD;AAAA,EACF;AAGA,QAAM,QAAQ,IAAI,MAAS,QAAQ,OAAO;AAC1C,OAAK,MAAM,IAAI,QAAQ,KAAK;AAC5B,SAAO;AACT;AAEO,MAAM,yBAAyB,CAAC,QAA0B;AAC/D,SAAO,OAAO,QAAQ,YAAY,QAAQ,QAAS,IAAwC,gBAAgB,MAAM;AACnH;AASO,SAAS,qBAAwB,OAAa;AACnD,MACE,OAAO,UAAU,YACjB,UAAU,QACT,MAA0D,gBAAgB,GAC3E;AACA,WAAQ,MAA0C,kBAAkB;AAAA,EACtE;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": ["target"]
|
|
7
7
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Unpacks special vue reactivity & override & detect-changes & magic proxy from an input object or array,
|
|
3
3
|
* returning the "raw" plain object or array.
|
|
4
4
|
*/
|
|
5
|
-
export declare const unpackProxyObject: <T
|
|
5
|
+
export declare const unpackProxyObject: <T>(input: T) => T;
|
|
6
6
|
//# sourceMappingURL=unpack-proxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpack-proxy.d.ts","sourceRoot":"","sources":["../../src/helpers/unpack-proxy.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"unpack-proxy.d.ts","sourceRoot":"","sources":["../../src/helpers/unpack-proxy.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,CACsB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers/unpack-proxy.ts"],
|
|
4
|
-
"sourcesContent": ["import { getRaw } from '@scalar/json-magic/magic-proxy'\nimport { toRaw } from 'vue'\n\nimport { unpackDetectChangesProxy } from '@/helpers/detect-changes-proxy'\nimport { unpackOverridesProxy } from '@/helpers/overrides-proxy'\n\n/**\n * Unpacks special vue reactivity & override & detect-changes & magic proxy from an input object or array,\n * returning the \"raw\" plain object or array.\n */\nexport const unpackProxyObject = <T
|
|
5
|
-
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,aAAa;AAEtB,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AAM9B,MAAM,oBAAoB,
|
|
4
|
+
"sourcesContent": ["import { getRaw } from '@scalar/json-magic/magic-proxy'\nimport { toRaw } from 'vue'\n\nimport { unpackDetectChangesProxy } from '@/helpers/detect-changes-proxy'\nimport { unpackOverridesProxy } from '@/helpers/overrides-proxy'\n\n/**\n * Unpacks special vue reactivity & override & detect-changes & magic proxy from an input object or array,\n * returning the \"raw\" plain object or array.\n */\nexport const unpackProxyObject = <T>(input: T): T =>\n unpackDetectChangesProxy(toRaw(getRaw(unpackOverridesProxy(input))))\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,aAAa;AAEtB,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AAM9B,MAAM,oBAAoB,CAAI,UACnC,yBAAyB,MAAM,OAAO,qBAAqB,KAAK,CAAC,CAAC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
|
+
import type { WorkspaceDocument } from '../schemas.js';
|
|
3
|
+
import type { SecurityRequirementObject } from '../schemas/v3.1/strict/security-requirement.js';
|
|
4
|
+
import type { SecuritySchemeObject } from '../schemas/v3.1/strict/security-scheme.js';
|
|
5
|
+
/**
|
|
6
|
+
* AuthMeta defines the meta information needed to specify whether the authentication operation
|
|
7
|
+
* is being performed at the document level (entire API), or for a specific operation (specific path and method).
|
|
8
|
+
*
|
|
9
|
+
* - If type is 'document', the operation applies to the whole OpenAPI document.
|
|
10
|
+
* - If type is 'operation', it targets a specific operation, identified by its path and method.
|
|
11
|
+
*/
|
|
12
|
+
export type AuthMeta = {
|
|
13
|
+
type: 'document';
|
|
14
|
+
} | {
|
|
15
|
+
type: 'operation';
|
|
16
|
+
path: string;
|
|
17
|
+
method: HttpMethod;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Updates the selected security schemes for either the entire document or a specific operation.
|
|
21
|
+
* - Adds newly created security schemes (if any) to the workspace document's components.
|
|
22
|
+
* - Ensures that each new scheme name is unique within the document by using `generateUniqueValue`.
|
|
23
|
+
* - Updates the `x-scalar-selected-security` property on the target (document or operation) to reflect the new set of selected security schemes.
|
|
24
|
+
* - Corrects and maintains the selected index so it points to a valid security scheme.
|
|
25
|
+
*
|
|
26
|
+
* @param document - The workspace OpenAPI document to mutate (can be null, in which case nothing happens)
|
|
27
|
+
* @param selectedSecuritySchemes - The current list of selected security scheme objects
|
|
28
|
+
* @param create - Array of new schemes to create, each with a name and a scheme definition
|
|
29
|
+
* @param meta - Location to update: whole document or a specific operation (`{ type: 'document' }` or `{ type: 'operation', path, method }`)
|
|
30
|
+
*
|
|
31
|
+
* Example usage:
|
|
32
|
+
* ```
|
|
33
|
+
* updateSelectedSecuritySchemes({
|
|
34
|
+
* document,
|
|
35
|
+
* selectedSecuritySchemes: [{ bearerAuth: [] }],
|
|
36
|
+
* create: [
|
|
37
|
+
* { name: 'ApiKeyAuth', scheme: { type: 'apiKey', in: 'header', name: 'X-API-Key' } }
|
|
38
|
+
* ],
|
|
39
|
+
* meta: { type: 'document' }
|
|
40
|
+
* })
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const updateSelectedSecuritySchemes: ({ document, selectedRequirements, newSchemes, meta, }: {
|
|
44
|
+
document: WorkspaceDocument | null;
|
|
45
|
+
selectedRequirements: SecurityRequirementObject[];
|
|
46
|
+
newSchemes: {
|
|
47
|
+
name: string;
|
|
48
|
+
scheme: SecuritySchemeObject;
|
|
49
|
+
}[];
|
|
50
|
+
meta: AuthMeta;
|
|
51
|
+
}) => void;
|
|
52
|
+
/**
|
|
53
|
+
* SecuritySchemeUpdate represents the possible updates that can be made
|
|
54
|
+
* to an OpenAPI security scheme object via UI interactions.
|
|
55
|
+
*
|
|
56
|
+
* - `http`: Updates to HTTP type schemes (e.g. basic, bearer), allowing token, username, and password changes.
|
|
57
|
+
* - `apiKey`: Updates to API Key type schemes, allowing the key name and its value to be updated.
|
|
58
|
+
* - `oauth2`: Updates to OAuth2 type schemes for each supported OAuth2 flow.
|
|
59
|
+
* - Can set various properties such as auth/token URLs, tokens, PKCE method, client credentials, etc.
|
|
60
|
+
*/
|
|
61
|
+
export type SecuritySchemeUpdate = {
|
|
62
|
+
type: 'http';
|
|
63
|
+
payload: Partial<{
|
|
64
|
+
token: string;
|
|
65
|
+
username: string;
|
|
66
|
+
password: string;
|
|
67
|
+
}>;
|
|
68
|
+
} | {
|
|
69
|
+
type: 'apiKey';
|
|
70
|
+
payload: Partial<{
|
|
71
|
+
name: string;
|
|
72
|
+
value: string;
|
|
73
|
+
}>;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'oauth2';
|
|
76
|
+
flow: 'implicit' | 'password' | 'clientCredentials' | 'authorizationCode';
|
|
77
|
+
payload: Partial<{
|
|
78
|
+
authUrl: string;
|
|
79
|
+
tokenUrl: string;
|
|
80
|
+
token: string;
|
|
81
|
+
redirectUrl: string;
|
|
82
|
+
clientId: string;
|
|
83
|
+
clientSecret: string;
|
|
84
|
+
usePkce: 'no' | 'SHA-256' | 'plain';
|
|
85
|
+
username: string;
|
|
86
|
+
password: string;
|
|
87
|
+
}>;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Updates a security scheme in the OpenAPI document's components object.
|
|
91
|
+
* Handles updates for HTTP, API Key, and OAuth2 types, saving secret information and configuration for UI-auth flows.
|
|
92
|
+
*
|
|
93
|
+
* @param document - The OpenAPI workspace document (can be null)
|
|
94
|
+
* @param data - The update information, including type and payload
|
|
95
|
+
* @param name - The name of the security scheme in document.components.securitySchemes
|
|
96
|
+
*
|
|
97
|
+
* Example usage:
|
|
98
|
+
*
|
|
99
|
+
* updateSecurityScheme({
|
|
100
|
+
* document,
|
|
101
|
+
* data: {
|
|
102
|
+
* type: 'http',
|
|
103
|
+
* payload: {
|
|
104
|
+
* username: 'user123',
|
|
105
|
+
* password: 'pw123',
|
|
106
|
+
* token: 'tokenval'
|
|
107
|
+
* }
|
|
108
|
+
* },
|
|
109
|
+
* name: 'MyHttpAuth',
|
|
110
|
+
* })
|
|
111
|
+
*/
|
|
112
|
+
export declare const updateSecurityScheme: ({ document, data, name, }: {
|
|
113
|
+
document: WorkspaceDocument | null;
|
|
114
|
+
data: SecuritySchemeUpdate;
|
|
115
|
+
name: string;
|
|
116
|
+
}) => void;
|
|
117
|
+
/**
|
|
118
|
+
* Sets the selected authentication tab (scheme) index for the given OpenAPI document or operation.
|
|
119
|
+
* - When on the document level, updates the 'x-selected-index' on the document's x-scalar-selected-security extension.
|
|
120
|
+
* - When on an operation (endpoint) level, updates the 'x-selected-index' for that operation's x-scalar-selected-security.
|
|
121
|
+
*
|
|
122
|
+
* Also initializes the x-scalar-selected-security extension if it does not exist.
|
|
123
|
+
*
|
|
124
|
+
* @param document The OpenAPI document object (may be null)
|
|
125
|
+
* @param index The index to set as selected
|
|
126
|
+
* @param meta Context where the selection applies ('document' or specific operation)
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* // Document-level tab selection
|
|
130
|
+
* updateSelectedAuthTab({
|
|
131
|
+
* document,
|
|
132
|
+
* index: 1,
|
|
133
|
+
* meta: { type: 'document' }
|
|
134
|
+
* });
|
|
135
|
+
*
|
|
136
|
+
* // Operation-level tab selection (e.g., GET /pets)
|
|
137
|
+
* updateSelectedAuthTab({
|
|
138
|
+
* document,
|
|
139
|
+
* index: 0,
|
|
140
|
+
* meta: { type: 'operation', path: '/pets', method: 'get' }
|
|
141
|
+
* });
|
|
142
|
+
*/
|
|
143
|
+
export declare const updateSelectedAuthTab: ({ document, index, meta, }: {
|
|
144
|
+
document: WorkspaceDocument | null;
|
|
145
|
+
index: number;
|
|
146
|
+
meta: AuthMeta;
|
|
147
|
+
}) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Updates the scopes for a specific security requirement in the selected security schemes of
|
|
150
|
+
* a document or operation.
|
|
151
|
+
*
|
|
152
|
+
* @param document - The OpenAPI WorkspaceDocument to update.
|
|
153
|
+
* @param id - An array of scheme names that uniquely identifies the target security requirement.
|
|
154
|
+
* For example: ['OAuth', 'ApiKeyAuth']
|
|
155
|
+
* @param name - The security scheme name to update scopes for (e.g., 'OAuth').
|
|
156
|
+
* @param scopes - The new list of scopes to set. For example: ['read:pets', 'write:pets']
|
|
157
|
+
* @param meta - The context specifying whether the update is at the document-level or operation-level.
|
|
158
|
+
*
|
|
159
|
+
* Example usage:
|
|
160
|
+
* ```ts
|
|
161
|
+
* // Suppose your document (or operation) x-scalar-selected-security looks like:
|
|
162
|
+
* // "x-scalar-selected-security": {
|
|
163
|
+
* // "x-selected-index": 0,
|
|
164
|
+
* // "x-schemes": [
|
|
165
|
+
* // { "OAuth": ["read:pets"] },
|
|
166
|
+
* // { "ApiKeyAuth": [] }
|
|
167
|
+
* // ]
|
|
168
|
+
* // }
|
|
169
|
+
*
|
|
170
|
+
* updateSelectedScopes({
|
|
171
|
+
* document,
|
|
172
|
+
* id: ["OAuth"], // identifies the scheme object: { "OAuth": [...] }
|
|
173
|
+
* name: "OAuth", // scheme name to update within this security requirement
|
|
174
|
+
* scopes: ["write:pets"], // new scopes array
|
|
175
|
+
* meta: { type: "document" }
|
|
176
|
+
* })
|
|
177
|
+
* // After, the first scheme becomes: { "OAuth": ["write:pets"] }
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
export declare const updateSelectedScopes: ({ document, id, name, scopes, meta, }: {
|
|
181
|
+
document: WorkspaceDocument | null;
|
|
182
|
+
id: string[];
|
|
183
|
+
name: string;
|
|
184
|
+
scopes: string[];
|
|
185
|
+
meta: AuthMeta;
|
|
186
|
+
}) => void;
|
|
187
|
+
/**
|
|
188
|
+
* Deletes one or more security schemes from an OpenAPI WorkspaceDocument,
|
|
189
|
+
* and removes all references to those schemes from selected security, document-level security,
|
|
190
|
+
* and operation-level security/selected security (e.g., on paths).
|
|
191
|
+
*
|
|
192
|
+
* Example usage:
|
|
193
|
+
*
|
|
194
|
+
* ```ts
|
|
195
|
+
* deleteSecurityScheme({
|
|
196
|
+
* document, // The OpenAPI document to update
|
|
197
|
+
* names: ['ApiKeyAuth', 'BearerAuth'], // The names of security schemes you want to delete
|
|
198
|
+
* });
|
|
199
|
+
* ```
|
|
200
|
+
*
|
|
201
|
+
* After running this function:
|
|
202
|
+
* - The named security schemes are removed from the components.securitySchemes section.
|
|
203
|
+
* - All document-level and operation-level security entries referencing those schemes are removed.
|
|
204
|
+
* - Any extended x-scalar-selected-security references to those schemes are also removed.
|
|
205
|
+
*/
|
|
206
|
+
export declare const deleteSecurityScheme: ({ document, names }: {
|
|
207
|
+
document: WorkspaceDocument | null;
|
|
208
|
+
names: string[];
|
|
209
|
+
}) => void;
|
|
210
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +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;AAInE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAEjF;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAChB;IACE,IAAI,EAAE,UAAU,CAAA;CACjB,GACD;IACE,IAAI,E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