@scalar/workspace-store 0.68.2 → 0.68.3
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 +24 -0
- package/dist/channel-example/get-async-api-protocols.d.ts +3 -1
- package/dist/channel-example/get-async-api-protocols.d.ts.map +1 -1
- package/dist/channel-example/get-async-api-protocols.js +6 -2
- package/dist/channel-example/get-asyncapi-security-requirements.d.ts +14 -2
- package/dist/channel-example/get-asyncapi-security-requirements.d.ts.map +1 -1
- package/dist/channel-example/get-asyncapi-security-requirements.js +89 -32
- package/dist/channel-example/get-channel-connection-context.d.ts.map +1 -1
- package/dist/channel-example/get-channel-connection-context.js +3 -4
- package/dist/channel-example/get-channel-connection-security.d.ts +3 -2
- package/dist/channel-example/get-channel-connection-security.d.ts.map +1 -1
- package/dist/channel-example/get-channel-connection-security.js +4 -6
- package/dist/channel-example/get-channel-operations.d.ts.map +1 -1
- package/dist/channel-example/get-channel-operations.js +2 -1
- package/dist/channel-example/get-channel-parameters.d.ts.map +1 -1
- package/dist/channel-example/get-channel-parameters.js +2 -1
- package/dist/channel-example/index.d.ts +2 -2
- package/dist/channel-example/index.d.ts.map +1 -1
- package/dist/channel-example/index.js +2 -2
- package/dist/channel-example/resolve-channel.d.ts.map +1 -1
- package/dist/channel-example/resolve-channel.js +2 -1
- package/dist/channel-example/resolve-operation-channel.d.ts.map +1 -1
- package/dist/channel-example/resolve-operation-channel.js +4 -2
- package/dist/channel-example/resolve-operation-with-traits.d.ts +1 -3
- package/dist/channel-example/resolve-operation-with-traits.d.ts.map +1 -1
- package/dist/channel-example/resolve-operation-with-traits.js +3 -41
- package/dist/channel-example/servers.d.ts.map +1 -1
- package/dist/channel-example/servers.js +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +8 -4
- package/dist/entities/auth/schema.d.ts +5 -0
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/events/definitions/operation.d.ts +7 -0
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/helpers/asyncapi-chunk-groups.d.ts.map +1 -1
- package/dist/helpers/asyncapi-chunk-groups.js +8 -4
- package/dist/helpers/asyncapi-model-chunk-reference.d.ts.map +1 -1
- package/dist/helpers/asyncapi-model-chunk-reference.js +2 -1
- package/dist/helpers/auth-secret-fields.d.ts +11 -0
- package/dist/helpers/auth-secret-fields.d.ts.map +1 -1
- package/dist/helpers/auth-secret-fields.js +22 -0
- package/dist/helpers/encode-path-parameter.d.ts.map +1 -1
- package/dist/helpers/encode-path-parameter.js +11 -12
- package/dist/helpers/external-examples.d.ts.map +1 -1
- package/dist/helpers/external-examples.js +6 -3
- package/dist/helpers/get-boolean-schema.d.ts +7 -0
- package/dist/helpers/get-boolean-schema.d.ts.map +1 -0
- package/dist/helpers/get-boolean-schema.js +5 -0
- package/dist/helpers/get-resolved-ref-deep.d.ts.map +1 -1
- package/dist/helpers/normalize-boolean-schemas.d.ts.map +1 -1
- package/dist/helpers/normalize-boolean-schemas.js +6 -1
- package/dist/helpers/operation-examples.d.ts.map +1 -1
- package/dist/helpers/operation-examples.js +2 -1
- package/dist/helpers/querystring-parameter.d.ts.map +1 -1
- package/dist/helpers/querystring-parameter.js +6 -6
- package/dist/helpers/resolve-security-requirements.d.ts.map +1 -1
- package/dist/helpers/resolve-security-requirements.js +38 -19
- package/dist/helpers/resolve-traits.d.ts +3 -0
- package/dist/helpers/resolve-traits.d.ts.map +1 -0
- package/dist/helpers/resolve-traits.js +68 -0
- package/dist/helpers/serialize-stream-example.js +1 -1
- package/dist/helpers/use-external-examples.d.ts.map +1 -1
- package/dist/helpers/use-external-examples.js +10 -5
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +2 -1
- package/dist/mutators/operation/helpers/har-to-operation.d.ts.map +1 -1
- package/dist/mutators/operation/helpers/har-to-operation.js +4 -2
- package/dist/mutators/operation/operation.d.ts.map +1 -1
- package/dist/mutators/operation/operation.js +4 -2
- package/dist/mutators/operation/parameters.d.ts.map +1 -1
- package/dist/mutators/operation/parameters.js +23 -1
- package/dist/mutators/tag.d.ts.map +1 -1
- package/dist/mutators/tag.js +4 -2
- package/dist/navigation/get-navigation-options.js +6 -5
- package/dist/navigation/helpers/traverse-asyncapi-document.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.js +27 -20
- package/dist/navigation/helpers/traverse-paths.js +1 -1
- package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-schemas.js +2 -1
- package/dist/plugins/bundler/index.d.ts.map +1 -1
- package/dist/plugins/bundler/index.js +2 -1
- package/dist/plugins/bundler/openapi-document.d.ts.map +1 -1
- package/dist/plugins/bundler/openapi-document.js +2 -1
- package/dist/request-example/builder/body/build-multipart.d.ts.map +1 -1
- package/dist/request-example/builder/body/build-multipart.js +18 -16
- package/dist/request-example/builder/body/encode-multipart-body.d.ts.map +1 -1
- package/dist/request-example/builder/body/encode-multipart-body.js +2 -1
- package/dist/request-example/builder/body/get-request-body-example.d.ts.map +1 -1
- package/dist/request-example/builder/body/get-request-body-example.js +2 -1
- package/dist/request-example/builder/body/schema-value-coercion.d.ts.map +1 -1
- package/dist/request-example/builder/body/schema-value-coercion.js +4 -1
- package/dist/request-example/builder/header/build-request-parameters.d.ts.map +1 -1
- package/dist/request-example/builder/header/build-request-parameters.js +12 -2
- package/dist/request-example/builder/header/filter-disabled-properties.d.ts +3 -0
- package/dist/request-example/builder/header/filter-disabled-properties.d.ts.map +1 -0
- package/dist/request-example/builder/header/filter-disabled-properties.js +18 -0
- package/dist/request-example/builder/header/filter-global-cookies.d.ts +1 -1
- package/dist/request-example/builder/header/filter-global-cookies.d.ts.map +1 -1
- package/dist/request-example/builder/header/filter-global-cookies.js +15 -3
- package/dist/request-example/builder/header/is-param-disabled.d.ts +1 -1
- package/dist/request-example/builder/header/is-param-disabled.d.ts.map +1 -1
- package/dist/request-example/builder/header/is-param-disabled.js +3 -2
- package/dist/request-example/builder/helpers/get-example-from-schema.d.ts.map +1 -1
- package/dist/request-example/builder/helpers/get-example-from-schema.js +20 -16
- package/dist/request-example/builder/helpers/get-example.d.ts +2 -0
- package/dist/request-example/builder/helpers/get-example.d.ts.map +1 -1
- package/dist/request-example/builder/helpers/get-example.js +15 -5
- package/dist/request-example/builder/index.d.ts +1 -0
- package/dist/request-example/builder/index.d.ts.map +1 -1
- package/dist/request-example/builder/index.js +1 -0
- package/dist/request-example/builder/resolve-request-factory-url.d.ts.map +1 -1
- package/dist/request-example/builder/resolve-request-factory-url.js +9 -8
- package/dist/request-example/builder/security/secret-types.d.ts +13 -3
- package/dist/request-example/builder/security/secret-types.d.ts.map +1 -1
- package/dist/request-example/context/headers.js +1 -1
- package/dist/request-example/context/security/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/request-example/context/security/extract-security-scheme-secrets.js +63 -25
- package/dist/request-example/context/security/get-selected-security.js +1 -1
- package/dist/request-example/context/security/merge-security.d.ts.map +1 -1
- package/dist/request-example/context/security/merge-security.js +2 -1
- package/dist/request-example/index.d.ts +1 -1
- package/dist/request-example/index.d.ts.map +1 -1
- package/dist/request-example/index.js +1 -1
- package/dist/request-example/xml/get-xml-example.js +2 -1
- package/dist/request-example/xml/write-xml.d.ts.map +1 -1
- package/dist/request-example/xml/write-xml.js +6 -5
- package/dist/resolve.d.ts +1 -1
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +16 -1
- package/dist/schemas/extensions/example/x-disabled.d.ts +4 -0
- package/dist/schemas/extensions/example/x-disabled.d.ts.map +1 -1
- package/dist/schemas/extensions/example/x-disabled.js +3 -1
- package/dist/schemas/navigation.d.ts +1 -1
- package/dist/schemas/navigation.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/example.d.ts +3 -0
- package/dist/schemas/v3.1/strict/example.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +36 -6
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/example.d.ts +3 -0
- package/dist/schemas/v3.2/strict/example.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/openapi-document.d.ts +36 -6
- package/dist/schemas/v3.2/strict/openapi-document.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -2
- package/package.json +9 -9
|
@@ -28,7 +28,7 @@ const getEnabledOperationHeaderParameterNames = (operation, exampleName) => {
|
|
|
28
28
|
const names = new Set();
|
|
29
29
|
for (const ref of operation.parameters ?? []) {
|
|
30
30
|
const param = getResolvedRef(ref);
|
|
31
|
-
if (
|
|
31
|
+
if (param?.in !== 'header') {
|
|
32
32
|
continue;
|
|
33
33
|
}
|
|
34
34
|
const example = getExample(param, exampleName, undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAE/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAQlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAEV,kBAAkB,EAClB,sBAAsB,EAUtB,gBAAgB,EAChB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAE/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAQlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAEV,kBAAkB,EAClB,sBAAsB,EAUtB,gBAAgB,EAChB,0BAA0B,EAG3B,MAAM,iDAAiD,CAAA;AAGxD,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAEjF,KAAK,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,GAAG,sBAAsB,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAA;AACrG,KAAK,gBAAgB,GAAG;KACrB,CAAC,IAAI,gBAAgB,GAAG;QACvB,IAAI,EAAE,CAAC,CAAA;QACP,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,KAAK,CAAC,EAAE,MAAM,CAAA;KACf;CACF,CAAC,gBAAgB,CAAC,CAAA;AAuQnB,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,kBAAkB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EACvF,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,EACpB,oBAAoB,MAAM,KACzB,0BA2HF,CAAA"}
|
|
@@ -15,25 +15,55 @@ const SECRET_TO_INPUT_FIELD_MAP = {
|
|
|
15
15
|
'x-scalar-secret-auth-url': 'authorizationUrl',
|
|
16
16
|
'x-scalar-secret-token-url': 'tokenUrl',
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Keep only the defaults that would restore something. An empty default means Reset could only
|
|
20
|
+
* clear the field, which the clear action already does, so the key is left off entirely.
|
|
21
|
+
*/
|
|
22
|
+
const withSecretDefaults = (defaults) => {
|
|
23
|
+
const nonEmpty = Object.fromEntries(Object.entries(defaults).filter(([, value]) => typeof value === 'string' && value !== ''));
|
|
24
|
+
return Object.keys(nonEmpty).length ? { 'x-scalar-secret-defaults': nonEmpty } : {};
|
|
25
|
+
};
|
|
26
|
+
/** Only string values count; anything else falls through to the next source. */
|
|
27
|
+
const readString = (source, key) => {
|
|
28
|
+
const value = source[key];
|
|
29
|
+
return typeof value === 'string' ? value : undefined;
|
|
30
|
+
};
|
|
31
|
+
const mergeFlowSecrets = (properties, configSecrets, authStoreSecrets = {}, oauth2RedirectUri,
|
|
32
|
+
/**
|
|
33
|
+
* OpenID Connect passes the stored flow as both the config and the auth store, so its
|
|
34
|
+
* `x-scalar-secret-*` values are the user's own overrides and must not count as defaults.
|
|
35
|
+
*/
|
|
36
|
+
includeConfigSecretValues = true) => {
|
|
19
37
|
const clearedFields = properties.filter((property) => isSecretFieldCleared(authStoreSecrets, property));
|
|
38
|
+
const defaults = {};
|
|
20
39
|
const values = Object.fromEntries(properties.map((property) => {
|
|
21
40
|
// Preserve explicit clears, while legacy schema-filled empties still inherit defaults.
|
|
22
|
-
const authStoreValue =
|
|
23
|
-
const configValue =
|
|
24
|
-
const configInputValue =
|
|
25
|
-
? configSecrets[SECRET_TO_INPUT_FIELD_MAP[property]]
|
|
26
|
-
: undefined;
|
|
41
|
+
const authStoreValue = readString(authStoreSecrets, property);
|
|
42
|
+
const configValue = includeConfigSecretValues ? readString(configSecrets, property) : undefined;
|
|
43
|
+
const configInputValue = readString(configSecrets, SECRET_TO_INPUT_FIELD_MAP[property]);
|
|
27
44
|
// oauth2RedirectUri (top-level config option) is used as a global fallback for the redirect URI,
|
|
28
45
|
// applied only when neither the auth store nor per-scheme config have a value. This ensures
|
|
29
46
|
// the configured redirect URI persists when switching between documents with the same OAuth config,
|
|
30
47
|
// because each document starts with no stored redirect URI (authStoreValue === undefined).
|
|
31
|
-
const
|
|
48
|
+
const isRedirect = property === 'x-scalar-secret-redirect-uri';
|
|
49
|
+
// The value and its reset target share one fallback, so Reset always restores exactly what the
|
|
50
|
+
// field shows once the stored override is released.
|
|
51
|
+
const fallback = isRedirect
|
|
52
|
+
? (configValue ?? configInputValue ?? oauth2RedirectUri ?? '')
|
|
53
|
+
: configValue || configInputValue || '';
|
|
54
|
+
// The redirect URI and explicitly cleared fields keep an empty stored value instead of falling
|
|
55
|
+
// back. For the redirect URI this is the stored value ahead of the same fallback as above.
|
|
56
|
+
const value = isRedirect || isSecretFieldCleared(authStoreSecrets, property)
|
|
32
57
|
? (authStoreValue ?? configValue ?? configInputValue ?? oauth2RedirectUri ?? '')
|
|
33
|
-
: authStoreValue ||
|
|
58
|
+
: authStoreValue || fallback;
|
|
59
|
+
defaults[property] = fallback;
|
|
34
60
|
return [property, value];
|
|
35
61
|
}));
|
|
36
|
-
return {
|
|
62
|
+
return {
|
|
63
|
+
...values,
|
|
64
|
+
...(clearedFields.length ? { 'x-scalar-secret-cleared-fields': clearedFields } : {}),
|
|
65
|
+
...withSecretDefaults(defaults),
|
|
66
|
+
};
|
|
37
67
|
};
|
|
38
68
|
const storedSecret = (secrets, field) => {
|
|
39
69
|
const value = secrets && Reflect.get(secrets, field);
|
|
@@ -60,7 +90,7 @@ const extractCredentialsLocation = (configSecrets, authStoreSecrets = {}) => {
|
|
|
60
90
|
* Extract flow secrets and selected scopes for OAuth-like flows.
|
|
61
91
|
* Reused by both oauth2 and openIdConnect security schemes.
|
|
62
92
|
*/
|
|
63
|
-
const extractOAuthFlowSecrets = (flows, storeSecrets, oauth2RedirectUri) => {
|
|
93
|
+
const extractOAuthFlowSecrets = (flows, storeSecrets, oauth2RedirectUri, includeConfigSecretValues = true) => {
|
|
64
94
|
const selectedScopes = new Set();
|
|
65
95
|
const extractedFlows = objectEntries(flows ?? {}).reduce((acc, [key, flow]) => {
|
|
66
96
|
if (!isObject(flow)) {
|
|
@@ -80,7 +110,7 @@ const extractOAuthFlowSecrets = (flows, storeSecrets, oauth2RedirectUri) => {
|
|
|
80
110
|
'x-scalar-secret-redirect-uri',
|
|
81
111
|
'x-scalar-secret-token',
|
|
82
112
|
'x-scalar-secret-auth-url',
|
|
83
|
-
], flow, storeSecrets?.implicit, oauth2RedirectUri),
|
|
113
|
+
], flow, storeSecrets?.implicit, oauth2RedirectUri, includeConfigSecretValues),
|
|
84
114
|
...extractRefreshTokenSecret(storeSecrets?.implicit),
|
|
85
115
|
};
|
|
86
116
|
}
|
|
@@ -95,7 +125,7 @@ const extractOAuthFlowSecrets = (flows, storeSecrets, oauth2RedirectUri) => {
|
|
|
95
125
|
'x-scalar-secret-password',
|
|
96
126
|
'x-scalar-secret-token',
|
|
97
127
|
'x-scalar-secret-token-url',
|
|
98
|
-
], flow, storeSecrets?.password),
|
|
128
|
+
], flow, storeSecrets?.password, undefined, includeConfigSecretValues),
|
|
99
129
|
...extractCredentialsLocation(flow, storeSecrets?.password),
|
|
100
130
|
...extractRefreshTokenSecret(storeSecrets?.password),
|
|
101
131
|
};
|
|
@@ -109,7 +139,7 @@ const extractOAuthFlowSecrets = (flows, storeSecrets, oauth2RedirectUri) => {
|
|
|
109
139
|
'x-scalar-secret-client-secret',
|
|
110
140
|
'x-scalar-secret-token',
|
|
111
141
|
'x-scalar-secret-token-url',
|
|
112
|
-
], flow, storeSecrets?.clientCredentials),
|
|
142
|
+
], flow, storeSecrets?.clientCredentials, undefined, includeConfigSecretValues),
|
|
113
143
|
...extractCredentialsLocation(flow, storeSecrets?.clientCredentials),
|
|
114
144
|
...extractRefreshTokenSecret(storeSecrets?.clientCredentials),
|
|
115
145
|
};
|
|
@@ -123,7 +153,7 @@ const extractOAuthFlowSecrets = (flows, storeSecrets, oauth2RedirectUri) => {
|
|
|
123
153
|
'x-scalar-secret-client-secret',
|
|
124
154
|
'x-scalar-secret-token',
|
|
125
155
|
'x-scalar-secret-token-url',
|
|
126
|
-
], flow, storeSecrets?.deviceAuthorization),
|
|
156
|
+
], flow, storeSecrets?.deviceAuthorization, undefined, includeConfigSecretValues),
|
|
127
157
|
...extractCredentialsLocation(flow, storeSecrets?.deviceAuthorization),
|
|
128
158
|
...extractRefreshTokenSecret(storeSecrets?.deviceAuthorization),
|
|
129
159
|
};
|
|
@@ -139,7 +169,7 @@ const extractOAuthFlowSecrets = (flows, storeSecrets, oauth2RedirectUri) => {
|
|
|
139
169
|
'x-scalar-secret-token',
|
|
140
170
|
'x-scalar-secret-auth-url',
|
|
141
171
|
'x-scalar-secret-token-url',
|
|
142
|
-
], flow, storeSecrets?.authorizationCode, oauth2RedirectUri),
|
|
172
|
+
], flow, storeSecrets?.authorizationCode, oauth2RedirectUri, includeConfigSecretValues),
|
|
143
173
|
...extractCredentialsLocation(flow, storeSecrets?.authorizationCode),
|
|
144
174
|
...extractRefreshTokenSecret(storeSecrets?.authorizationCode),
|
|
145
175
|
};
|
|
@@ -156,29 +186,35 @@ scheme, authStore, name, documentSlug, oauth2RedirectUri) => {
|
|
|
156
186
|
// Handle API Key security schemes
|
|
157
187
|
if (scheme.type === 'apiKey') {
|
|
158
188
|
const storeSecrets = secrets?.type === 'apiKey' ? secrets : undefined;
|
|
189
|
+
const defaults = {
|
|
190
|
+
'x-scalar-secret-token': documentSecret(scheme, 'x-scalar-secret-token') || scheme.value || '',
|
|
191
|
+
};
|
|
159
192
|
return {
|
|
160
193
|
...scheme,
|
|
161
|
-
'x-scalar-secret-token': storedSecret(storeSecrets, 'x-scalar-secret-token') ??
|
|
162
|
-
|
|
194
|
+
'x-scalar-secret-token': storedSecret(storeSecrets, 'x-scalar-secret-token') ?? defaults['x-scalar-secret-token'],
|
|
195
|
+
...withSecretDefaults(defaults),
|
|
163
196
|
};
|
|
164
197
|
}
|
|
165
198
|
// Handle HTTP Auth security schemes (e.g., Basic, Bearer)
|
|
166
199
|
if (scheme.type === 'http') {
|
|
167
200
|
const storeSecrets = secrets?.type === 'http' ? secrets : undefined;
|
|
201
|
+
const defaults = {
|
|
202
|
+
'x-scalar-secret-token': documentSecret(scheme, 'x-scalar-secret-token') || scheme.token || '',
|
|
203
|
+
'x-scalar-secret-username': documentSecret(scheme, 'x-scalar-secret-username') || scheme.username || '',
|
|
204
|
+
'x-scalar-secret-password': documentSecret(scheme, 'x-scalar-secret-password') || scheme.password || '',
|
|
205
|
+
};
|
|
168
206
|
return {
|
|
169
207
|
...scheme,
|
|
170
|
-
'x-scalar-secret-token': storedSecret(storeSecrets, 'x-scalar-secret-token') ??
|
|
171
|
-
|
|
172
|
-
'x-scalar-secret-
|
|
173
|
-
|
|
174
|
-
'x-scalar-secret-password': storedSecret(storeSecrets, 'x-scalar-secret-password') ??
|
|
175
|
-
(documentSecret(scheme, 'x-scalar-secret-password') || scheme.password || ''),
|
|
208
|
+
'x-scalar-secret-token': storedSecret(storeSecrets, 'x-scalar-secret-token') ?? defaults['x-scalar-secret-token'],
|
|
209
|
+
'x-scalar-secret-username': storedSecret(storeSecrets, 'x-scalar-secret-username') ?? defaults['x-scalar-secret-username'],
|
|
210
|
+
'x-scalar-secret-password': storedSecret(storeSecrets, 'x-scalar-secret-password') ?? defaults['x-scalar-secret-password'],
|
|
211
|
+
...withSecretDefaults(defaults),
|
|
176
212
|
};
|
|
177
213
|
}
|
|
178
214
|
// Handle OAuth2 security schemes and all supported flows
|
|
179
215
|
if (scheme.type === 'oauth2') {
|
|
180
216
|
const storeSecrets = secrets?.type === 'oauth2' ? secrets : undefined;
|
|
181
|
-
const extracted = extractOAuthFlowSecrets(scheme.flows, storeSecrets, oauth2RedirectUri);
|
|
217
|
+
const extracted = extractOAuthFlowSecrets(scheme.flows, storeSecrets, oauth2RedirectUri, true);
|
|
182
218
|
const configuredDefaultScopes = Array.isArray(scheme['x-default-scopes'])
|
|
183
219
|
? scheme['x-default-scopes'].filter((scope) => typeof scope === 'string')
|
|
184
220
|
: [];
|
|
@@ -198,7 +234,9 @@ scheme, authStore, name, documentSlug, oauth2RedirectUri) => {
|
|
|
198
234
|
clientCredentials: storeSecrets?.clientCredentials,
|
|
199
235
|
authorizationCode: storeSecrets?.authorizationCode,
|
|
200
236
|
deviceAuthorization: storeSecrets?.deviceAuthorization,
|
|
201
|
-
}, storeSecrets, oauth2RedirectUri
|
|
237
|
+
}, storeSecrets, oauth2RedirectUri,
|
|
238
|
+
// The flows above are the stored flows themselves, so only discovered or input keys are defaults
|
|
239
|
+
false);
|
|
202
240
|
return {
|
|
203
241
|
...scheme,
|
|
204
242
|
...(objectEntries(extracted.flows).length ? { flows: extracted.flows } : {}),
|
|
@@ -2,7 +2,7 @@ import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref
|
|
|
2
2
|
import { isAuthOptional } from './is-auth-optional.js';
|
|
3
3
|
/** Extracts the default scopes for a security scheme (only OAuth2 schemes support this) */
|
|
4
4
|
const getDefaultScopes = (scheme) => {
|
|
5
|
-
if (
|
|
5
|
+
if (scheme?.type !== 'oauth2') {
|
|
6
6
|
return [];
|
|
7
7
|
}
|
|
8
8
|
return scheme['x-default-scopes'] ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-security.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/merge-security.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAgC,MAAM,4BAA4B,CAAA;AACxG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AAKtE,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAIjG,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"merge-security.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/merge-security.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,wBAAwB,EAAgC,MAAM,4BAA4B,CAAA;AACxG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AAKtE,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAIjG,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAA;AA4E9E;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GACxB,yBACI,gBAAgB,CAAC,iBAAiB,CAAC,GACnC,WAAW,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,CAAM,EACjE,uBAAuB,2BAA2B,CAAC,iBAAiB,CAAM,EAC1E,WAAW,SAAS,EACpB,cAAc,MAAM,EACpB,oBAAoB,MAAM,KACzB,qBA4DF,CAAA"}
|
|
@@ -35,8 +35,9 @@ const normalizeAsyncApiOAuthFlows = (flows) => {
|
|
|
35
35
|
}
|
|
36
36
|
// Prefer an OpenAPI-native `scopes` map if one is somehow already present, so we never drop it.
|
|
37
37
|
const resolved = getResolvedRef(flowValue);
|
|
38
|
-
if (!isObjectLike(resolved))
|
|
38
|
+
if (!isObjectLike(resolved)) {
|
|
39
39
|
return [flowKey, flowValue];
|
|
40
|
+
}
|
|
40
41
|
const { availableScopes, scopes: existingScopes, ...rest } = resolved;
|
|
41
42
|
return [flowKey, { ...rest, scopes: existingScopes ?? availableScopes ?? {} }];
|
|
42
43
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { ApiKeyObjectSecret, BuildRequestData, BuildRequestFailureCode, BuildRequestResult, EncryptionObjectSecret, GssapiObjectSecret, HttpObjectSecret, OAuth2ObjectSecret, OAuthFlowAuthorizationCodeSecret, OAuthFlowClientCredentialsSecret, OAuthFlowDeviceAuthorizationSecret, OAuthFlowImplicitSecret, OAuthFlowPasswordSecret, OAuthFlowsObjectSecret, OpenIdConnectObjectSecret, RequestPayload, ResolveRequestFactoryUrlError, ResolveRequestFactoryUrlResult, SaslObjectSecret, SecuritySchemeObjectSecret, X509ObjectSecret, } from './builder/index.js';
|
|
2
|
-
export { BUILD_REQUEST_FAILED, INVALID_REQUEST_FACTORY_URL, MISSING_REQUEST_SERVER_BASE, type RequestFactory, type SerializedFormProperty, buildDottedNestedRowPredicate, buildRequest, buildRequestSecurity, coerceLeafValueToSchemaType, coerceUntypedValue, deSerializeParameter, deSerializeSchemaValue, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSchemaExampleFromBody, getSelectedBodyContentType, getServerVariables, isEncryptionSchemeType, isParamDisabled, isSaslSchemeType, requestFactory, resolveExecutableRequestUrl, resolveLeafSchema, resolveRequestFactoryUrl, serializeContentValue, serializeCookieStyle, serializeDeepObjectStyle, serializeFormPropertyWithEncoding, serializeFormStyle, serializeFormStyleForCookies, serializeMultipartArray, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
2
|
+
export { BUILD_REQUEST_FAILED, INVALID_REQUEST_FACTORY_URL, MISSING_REQUEST_SERVER_BASE, type RequestFactory, type SerializedFormProperty, buildDottedNestedRowPredicate, buildRequest, buildRequestSecurity, coerceLeafValueToSchemaType, coerceUntypedValue, deSerializeParameter, deSerializeSchemaValue, filterDisabledProperties, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSchemaExampleFromBody, getSelectedBodyContentType, getServerVariables, isEncryptionSchemeType, isParamDisabled, isSaslSchemeType, requestFactory, resolveExecutableRequestUrl, resolveLeafSchema, resolveRequestFactoryUrl, serializeContentValue, serializeCookieStyle, serializeDeepObjectStyle, serializeFormPropertyWithEncoding, serializeFormStyle, serializeFormStyleForCookies, serializeMultipartArray, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
3
3
|
export { needsMultipartEncoding } from './builder/body/build-multipart.js';
|
|
4
4
|
export { buildRequestBody } from './builder/body/build-request-body.js';
|
|
5
5
|
export { serializeMultipartBody } from './builder/body/encode-multipart-body.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request-example/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,EAClC,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,cAAc,EACd,6BAA6B,EAC7B,8BAA8B,EAC9B,gBAAgB,EAChB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,6BAA6B,EAC7B,YAAY,EACZ,oBAAoB,EACpB,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,2BAA2B,EAC3B,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,iCAAiC,EACjC,kBAAkB,EAClB,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,oBA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ACV,cAAc,EACd,aAAa,EACb,qCAAqC,EACrC,6BAA6B,GAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,6BAA6B,EAC7B,gBAAgB,EAChB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AACjE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,KAAK,iBAAiB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BUILD_REQUEST_FAILED, INVALID_REQUEST_FACTORY_URL, MISSING_REQUEST_SERVER_BASE, buildDottedNestedRowPredicate, buildRequest, buildRequestSecurity, coerceLeafValueToSchemaType, coerceUntypedValue, deSerializeParameter, deSerializeSchemaValue, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSchemaExampleFromBody, getSelectedBodyContentType, getServerVariables, isEncryptionSchemeType, isParamDisabled, isSaslSchemeType, requestFactory, resolveExecutableRequestUrl, resolveLeafSchema, resolveRequestFactoryUrl, serializeContentValue, serializeCookieStyle, serializeDeepObjectStyle, serializeFormPropertyWithEncoding, serializeFormStyle, serializeFormStyleForCookies, serializeMultipartArray, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
1
|
+
export { BUILD_REQUEST_FAILED, INVALID_REQUEST_FACTORY_URL, MISSING_REQUEST_SERVER_BASE, buildDottedNestedRowPredicate, buildRequest, buildRequestSecurity, coerceLeafValueToSchemaType, coerceUntypedValue, deSerializeParameter, deSerializeSchemaValue, filterDisabledProperties, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSchemaExampleFromBody, getSelectedBodyContentType, getServerVariables, isEncryptionSchemeType, isParamDisabled, isSaslSchemeType, requestFactory, resolveExecutableRequestUrl, resolveLeafSchema, resolveRequestFactoryUrl, serializeContentValue, serializeCookieStyle, serializeDeepObjectStyle, serializeFormPropertyWithEncoding, serializeFormStyle, serializeFormStyleForCookies, serializeMultipartArray, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
2
2
|
export { needsMultipartEncoding } from './builder/body/build-multipart.js';
|
|
3
3
|
export { buildRequestBody } from './builder/body/build-request-body.js';
|
|
4
4
|
export { serializeMultipartBody } from './builder/body/encode-multipart-body.js';
|
|
@@ -213,7 +213,8 @@ const buildXmlExample = (value, input, options, evaluation) => {
|
|
|
213
213
|
}
|
|
214
214
|
const xml = schema.xml ?? {};
|
|
215
215
|
validateXmlMetadata(xml, context.path);
|
|
216
|
-
const
|
|
216
|
+
const elementKind = Array.isArray(data) && !xml.wrapped ? 'none' : 'element';
|
|
217
|
+
const kind = xml.nodeType ?? (xml.attribute ? 'attribute' : elementKind);
|
|
217
218
|
const selectedComponentName = context.depth === 0 && '$ref' in schema && typeof schema.$ref === 'string'
|
|
218
219
|
? componentNameFromRef(schema.$ref, context.path)
|
|
219
220
|
: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-xml.d.ts","sourceRoot":"","sources":["../../../src/request-example/xml/write-xml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,gBAAgB,EAAW,OAAO,EAAE,MAAM,YAAY,CAAA;AAUnF,4FAA4F;AAC5F,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE5E,uFAAuF;AACvF,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,EAAE,UAAS,eAAoB,KAAG,
|
|
1
|
+
{"version":3,"file":"write-xml.d.ts","sourceRoot":"","sources":["../../../src/request-example/xml/write-xml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,gBAAgB,EAAW,OAAO,EAAE,MAAM,YAAY,CAAA;AAUnF,4FAA4F;AAC5F,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE5E,uFAAuF;AACvF,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,EAAE,UAAS,eAAoB,KAAG,gBA6H1E,CAAA"}
|
|
@@ -10,7 +10,7 @@ export const writeXml = (nodes, options = {}) => {
|
|
|
10
10
|
const fail = (code, message, path) => {
|
|
11
11
|
diagnostics.push({ severity: 'error', code, message, path });
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const escapeXml = (value, attribute, path) => {
|
|
14
14
|
if (invalidCharacter.test(value)) {
|
|
15
15
|
fail('invalid-character', 'The value contains a character XML 1.0 cannot represent.', path);
|
|
16
16
|
}
|
|
@@ -27,7 +27,7 @@ export const writeXml = (nodes, options = {}) => {
|
|
|
27
27
|
}
|
|
28
28
|
if (node.type !== 'element') {
|
|
29
29
|
if (node.type === 'text') {
|
|
30
|
-
return
|
|
30
|
+
return escapeXml(node.value, false, path);
|
|
31
31
|
}
|
|
32
32
|
if (invalidCharacter.test(node.value)) {
|
|
33
33
|
fail('invalid-character', 'The CDATA contains a character XML 1.0 cannot represent.', path);
|
|
@@ -44,7 +44,8 @@ export const writeXml = (nodes, options = {}) => {
|
|
|
44
44
|
fail('invalid-name', `Invalid XML name: ${input.prefix ? `${input.prefix}:` : ''}${input.name}`, path);
|
|
45
45
|
}
|
|
46
46
|
let prefix = input.prefix ?? '';
|
|
47
|
-
const
|
|
47
|
+
const defaultNamespace = attribute ? '' : bindings.get('');
|
|
48
|
+
const namespace = input.namespace ?? (prefix ? bindings.get(prefix) : defaultNamespace) ?? '';
|
|
48
49
|
if (prefix === 'xmlns' || namespace === XMLNS_NAMESPACE || (attribute && !prefix && input.name === 'xmlns')) {
|
|
49
50
|
fail('reserved-namespace', 'Namespace declarations must be expressed through XML namespace metadata.', path);
|
|
50
51
|
}
|
|
@@ -87,11 +88,11 @@ export const writeXml = (nodes, options = {}) => {
|
|
|
87
88
|
fail('duplicate-attribute', `Duplicate XML attribute: ${qualified.name}`, path);
|
|
88
89
|
}
|
|
89
90
|
attributeNames.add(key);
|
|
90
|
-
return ` ${qualified.name}="${
|
|
91
|
+
return ` ${qualified.name}="${escapeXml(attribute.value, true, path)}"`;
|
|
91
92
|
})
|
|
92
93
|
.join('');
|
|
93
94
|
const namespaces = [...declarations]
|
|
94
|
-
.map(([prefix, uri]) => ` xmlns${prefix ? `:${prefix}` : ''}="${
|
|
95
|
+
.map(([prefix, uri]) => ` xmlns${prefix ? `:${prefix}` : ''}="${escapeXml(uri, true, path)}"`)
|
|
95
96
|
.join('');
|
|
96
97
|
const opening = `<${element.name}${namespaces}${attributes}`;
|
|
97
98
|
if (node.children.length === 0) {
|
package/dist/resolve.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ type ResolvedSchema<T> = T extends undefined ? undefined : Readonly<SchemaObject
|
|
|
11
11
|
$ref?: string;
|
|
12
12
|
}>;
|
|
13
13
|
export declare const resolve: {
|
|
14
|
-
schema: <T extends MaybeRefSchemaObject | undefined>(schema: T) => ResolvedSchema<T>;
|
|
14
|
+
schema: <T extends MaybeRefSchemaObject | boolean | undefined>(schema: T) => ResolvedSchema<T>;
|
|
15
15
|
};
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=resolve.d.ts.map
|
package/dist/resolve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEtF;;;;;;;GAOG;AACH,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,YAAY,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAoBrG,eAAO,MAAM,OAAO;aACT,CAAC,SAAS,oBAAoB,GAAG,OAAO,GAAG,SAAS,UAAU,CAAC,KAAG,cAAc,CAAC,CAAC,CAAC;CAc7F,CAAA"}
|
package/dist/resolve.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { getBooleanSchema } from './helpers/get-boolean-schema.js';
|
|
2
3
|
import { getResolvedRef, mergeSiblingReferences } from './helpers/get-resolved-ref.js';
|
|
3
4
|
import { compose } from './schemas/compose.js';
|
|
4
5
|
import { coerceValue } from './schemas/typebox-coerce.js';
|
|
@@ -10,12 +11,26 @@ import { SchemaObjectSchema } from './schemas/v3.2/strict/openapi-document.js';
|
|
|
10
11
|
* scope. `resolve.schema` runs once per property of every schema a render walks, and rebuilding the
|
|
11
12
|
* composite per call dominated that walk.
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
|
+
// Rendering also consumes AsyncAPI schemas. Keep boolean children intact until their own rows
|
|
15
|
+
// resolve them, without widening the object-based OpenAPI document validation types.
|
|
16
|
+
const displaySchemaObject = {
|
|
17
|
+
...SchemaObjectSchema,
|
|
18
|
+
$defs: {
|
|
19
|
+
...SchemaObjectSchema.$defs,
|
|
20
|
+
SchemaObject: Type.Union([SchemaObjectSchema.$defs.SchemaObject, Type.Boolean()]),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const resolvedSchemaSchema = compose(displaySchemaObject, Type.Object({ $ref: Type.Optional(Type.String()) }));
|
|
14
24
|
export const resolve = {
|
|
15
25
|
schema: (schema) => {
|
|
16
26
|
if (schema === undefined) {
|
|
17
27
|
return undefined;
|
|
18
28
|
}
|
|
29
|
+
// Resolve boolean targets before merging siblings, which assumes an object target.
|
|
30
|
+
const target = getResolvedRef(schema);
|
|
31
|
+
if (typeof target === 'boolean') {
|
|
32
|
+
return getBooleanSchema(target);
|
|
33
|
+
}
|
|
19
34
|
const resoled = getResolvedRef(schema, mergeSiblingReferences);
|
|
20
35
|
return coerceValue(resolvedSchemaSchema, resoled);
|
|
21
36
|
},
|
|
@@ -14,11 +14,15 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const XDisabledSchema: import("@scalar/typebox").TObject<{
|
|
16
16
|
'x-disabled': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
17
|
+
'x-scalar-disabled-properties': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TBoolean>>;
|
|
17
18
|
}>;
|
|
18
19
|
export type XDisabled = {
|
|
19
20
|
'x-disabled'?: boolean;
|
|
21
|
+
/** Per-property overrides keyed by JSON-encoded paths. The empty path stores the inherited default. */
|
|
22
|
+
'x-scalar-disabled-properties'?: Record<string, boolean>;
|
|
20
23
|
};
|
|
21
24
|
export declare const XDisabled: import("@scalar/validation").ObjectSchema<{
|
|
22
25
|
'x-disabled': import("@scalar/validation").OptionalSchema<import("@scalar/validation").BooleanSchema>;
|
|
26
|
+
'x-scalar-disabled-properties': import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").BooleanSchema>>;
|
|
23
27
|
}>;
|
|
24
28
|
//# sourceMappingURL=x-disabled.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-disabled.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/example/x-disabled.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"x-disabled.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/example/x-disabled.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe;;;EAG1B,CAAA;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,uGAAuG;IACvG,8BAA8B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACzD,CAAA;AAED,eAAO,MAAM,SAAS;;;EASrB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from '@scalar/typebox';
|
|
2
|
-
import { boolean, object, optional } from '@scalar/validation';
|
|
2
|
+
import { boolean, object, optional, record, string } from '@scalar/validation';
|
|
3
3
|
/**
|
|
4
4
|
* OpenAPI extension to control whether a parameter example is enabled (checkbox on) or disabled (checkbox off).
|
|
5
5
|
*
|
|
@@ -16,9 +16,11 @@ import { boolean, object, optional } from '@scalar/validation';
|
|
|
16
16
|
*/
|
|
17
17
|
export const XDisabledSchema = Type.Object({
|
|
18
18
|
'x-disabled': Type.Optional(Type.Boolean()),
|
|
19
|
+
'x-scalar-disabled-properties': Type.Optional(Type.Record(Type.String(), Type.Boolean())),
|
|
19
20
|
});
|
|
20
21
|
export const XDisabled = object({
|
|
21
22
|
'x-disabled': optional(boolean()),
|
|
23
|
+
'x-scalar-disabled-properties': optional(record(string(), boolean())),
|
|
22
24
|
}, {
|
|
23
25
|
typeName: 'XDisabled',
|
|
24
26
|
typeComment: 'Whether a parameter example is disabled in the API client',
|
|
@@ -141,7 +141,7 @@ export type TraversedAsyncApiChannel = BaseSchema & {
|
|
|
141
141
|
channelName: string;
|
|
142
142
|
/** Channel address for display and routing */
|
|
143
143
|
channelAddress: string;
|
|
144
|
-
/** Operations on the channel */
|
|
144
|
+
/** Operations and the complete visible message catalog on the channel */
|
|
145
145
|
children?: TraversedEntry[];
|
|
146
146
|
};
|
|
147
147
|
export declare const TraversedAsyncApiMessageSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/schemas/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;AAE9D,eAAO,MAAM,8BAA8B;;;EAGzC,CAAA;AAEF,KAAK,UAAU,GAAG;IAChB;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,iCAAiC;;;;;;;;IAQ7C,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG;IAC3C,IAAI,EAAE,UAAU,CAAA;IAChB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,uCAAuC;IACvC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;I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CAAA;CACtB,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,kBAAkB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,kBAAkB,GAClB,QAAQ,GACR,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,oBAAoB,GACpB,YAAY,GACZ,UAAU,GACV,YAAY,CAAA;AAEhB,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,MAAM,CAAA"}
|
|
@@ -1461,6 +1461,7 @@ export declare const ReferenceConfigSchema: import("@scalar/typebox").TObject<{
|
|
|
1461
1461
|
externalValue: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1462
1462
|
}>, import("@scalar/typebox").TObject<{
|
|
1463
1463
|
'x-disabled': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
1464
|
+
'x-scalar-disabled-properties': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TBoolean>>;
|
|
1464
1465
|
}>]>;
|
|
1465
1466
|
RequestBodyObject: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
1466
1467
|
description: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schemas/reference-config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAQ,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAA2C,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACvG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,EAAE,KAAK,UAAU,E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typebox").TObject<{
|
|
|
1447
1447
|
externalValue: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1448
1448
|
}>, import("@scalar/typebox").TObject<{
|
|
1449
1449
|
'x-disabled': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
1450
|
+
'x-scalar-disabled-properties': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TBoolean>>;
|
|
1450
1451
|
}>]>;
|
|
1451
1452
|
RequestBodyObject: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
1452
1453
|
description: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/schemas/reference-config/settings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEhE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/schemas/reference-config/settings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEhE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW1B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,QAAQ,CAKlD,CAAA"}
|
|
@@ -14,6 +14,7 @@ export declare const ExampleObjectSchemaDefinition: import("@scalar/typebox").TI
|
|
|
14
14
|
externalValue: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
15
15
|
}>, import("@scalar/typebox").TObject<{
|
|
16
16
|
'x-disabled': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
17
|
+
'x-scalar-disabled-properties': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TBoolean>>;
|
|
17
18
|
}>]>;
|
|
18
19
|
/**
|
|
19
20
|
* An object grouping an internal or external example value with basic summary and description metadata. This object is typically used in fields named examples (plural), and is a referenceable alternative to older example (singular) fields that do not support referencing or metadata.
|
|
@@ -38,5 +39,7 @@ export type ExampleObject = {
|
|
|
38
39
|
* example is "on" (checkbox checked) and will be sent.
|
|
39
40
|
*/
|
|
40
41
|
'x-disabled'?: boolean;
|
|
42
|
+
/** Per-property disabled overrides keyed by JSON-encoded value paths. */
|
|
43
|
+
'x-scalar-disabled-properties'?: Record<string, boolean>;
|
|
41
44
|
};
|
|
42
45
|
//# sourceMappingURL=example.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../../../src/schemas/v3.1/strict/example.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;IAEtC,yCAAyC;;IAEzC,oGAAoG;;IAEpG,6PAA6P;;IAE7P,+QAA+Q
|
|
1
|
+
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../../../../src/schemas/v3.1/strict/example.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;IAEtC,yCAAyC;;IAEzC,oGAAoG;;IAEpG,6PAA6P;;IAE7P,+QAA+Q;;;;;IAIlR,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oGAAoG;IACpG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6PAA6P;IAC7P,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,+QAA+Q;IAC/Q,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yEAAyE;IACzE,8BAA8B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACzD,CAAA"}
|