@scalar/workspace-store 0.60.0 → 0.61.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 +48 -0
- package/README.md +6 -0
- package/dist/channel-example/build-connection-url.d.ts.map +1 -1
- package/dist/channel-example/build-connection-url.js +3 -3
- package/dist/channel-example/dedupe-requirements.d.ts +1 -1
- package/dist/channel-example/get-async-api-protocols.js +2 -2
- package/dist/channel-example/get-asyncapi-security-requirements.d.ts +1 -1
- package/dist/channel-example/get-channel-connection-security.d.ts +1 -1
- package/dist/channel-example/get-channel-operations.d.ts.map +1 -1
- package/dist/channel-example/get-channel-operations.js +4 -1
- package/dist/channel-example/get-channel-parameters.d.ts.map +1 -1
- package/dist/channel-example/get-channel-parameters.js +3 -1
- package/dist/channel-example/resolve-channel.d.ts.map +1 -1
- package/dist/channel-example/resolve-channel.js +2 -0
- package/dist/channel-example/resolve-operation-channel.d.ts.map +1 -1
- package/dist/channel-example/resolve-operation-channel.js +4 -0
- package/dist/channel-example/resolve-operation-with-traits.js +2 -2
- package/dist/channel-example/servers.d.ts.map +1 -1
- package/dist/channel-example/servers.js +3 -1
- package/dist/channel-example/types.d.ts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +3 -3
- package/dist/entities/auth/schema.d.ts +460 -20
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/entities/auth/schema.js +2 -2
- package/dist/events/definitions/auth.d.ts +2 -2
- package/dist/events/definitions/document.d.ts +1 -1
- package/dist/events/definitions/operation.d.ts +3 -2
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/server.d.ts +1 -1
- package/dist/events/old-definitions.d.ts +1 -1
- package/dist/helpers/create-chunk-writer.d.ts +6 -0
- package/dist/helpers/create-chunk-writer.d.ts.map +1 -0
- package/dist/helpers/create-chunk-writer.js +44 -0
- package/dist/helpers/dynamic-ref.d.ts +13 -2
- package/dist/helpers/dynamic-ref.d.ts.map +1 -1
- package/dist/helpers/dynamic-ref.js +20 -7
- package/dist/helpers/encode-chunk-name.d.ts +3 -0
- package/dist/helpers/encode-chunk-name.d.ts.map +1 -0
- package/dist/helpers/encode-chunk-name.js +9 -0
- package/dist/helpers/for-each-path-item-operation.d.ts +2 -2
- package/dist/helpers/get-first-server.d.ts +1 -1
- package/dist/helpers/get-resolved-ref.d.ts +6 -1
- package/dist/helpers/get-resolved-ref.d.ts.map +1 -1
- package/dist/helpers/get-resolved-ref.js +3 -10
- package/dist/helpers/is-non-optional-security-requirement.d.ts +1 -1
- package/dist/helpers/merge-object.d.ts +2 -2
- package/dist/helpers/merge-object.d.ts.map +1 -1
- package/dist/helpers/merge-object.js +2 -5
- package/dist/mutators/auth.d.ts +1 -1
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +9 -4
- package/dist/mutators/index.d.ts +10 -10
- package/dist/mutators/operation/body.js +2 -2
- package/dist/mutators/operation/helpers/fetch-request-to-har.d.ts.map +1 -1
- package/dist/mutators/operation/helpers/fetch-request-to-har.js +12 -2
- package/dist/mutators/operation/helpers/har-to-operation.d.ts +1 -1
- package/dist/mutators/operation/helpers/har-to-operation.d.ts.map +1 -1
- package/dist/mutators/operation/helpers/har-to-operation.js +9 -5
- package/dist/mutators/operation/helpers/sync-path-parameters.d.ts +2 -2
- package/dist/mutators/operation/history.js +2 -2
- package/dist/mutators/operation/operation.d.ts.map +1 -1
- package/dist/mutators/operation/operation.js +4 -0
- package/dist/mutators/operation/parameters.js +1 -1
- package/dist/mutators/server.d.ts +3 -3
- package/dist/mutators/server.js +1 -1
- package/dist/mutators/tag.d.ts.map +1 -1
- package/dist/mutators/tag.js +4 -0
- package/dist/navigation/helpers/get-openapi-object.d.ts +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-asyncapi-document.js +2 -2
- package/dist/navigation/helpers/traverse-description.d.ts +1 -1
- package/dist/navigation/helpers/traverse-document.d.ts +1 -1
- package/dist/navigation/helpers/traverse-examples.d.ts +12 -1
- package/dist/navigation/helpers/traverse-examples.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-examples.js +22 -1
- package/dist/navigation/helpers/traverse-paths.d.ts +1 -1
- package/dist/navigation/helpers/traverse-schemas.d.ts +1 -1
- package/dist/navigation/helpers/traverse-tags.d.ts +1 -1
- package/dist/navigation/helpers/traverse-webhooks.d.ts +1 -1
- package/dist/navigation/helpers/update-order-ids.d.ts +2 -2
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/types.d.ts +1 -1
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +10 -10
- package/dist/persistence/indexdb.d.ts.map +1 -1
- package/dist/persistence/indexdb.js +7 -5
- package/dist/persistence/migrations/v2-team-to-local.d.ts.map +1 -1
- package/dist/persistence/migrations/v2-team-to-local.js +3 -4
- package/dist/plugins/bundler/index.d.ts +5 -2
- package/dist/plugins/bundler/index.d.ts.map +1 -1
- package/dist/plugins/bundler/index.js +24 -26
- package/dist/request-example/builder/body/build-request-body.d.ts +2 -1
- package/dist/request-example/builder/body/build-request-body.d.ts.map +1 -1
- package/dist/request-example/builder/body/build-request-body.js +41 -5
- package/dist/request-example/builder/body/encode-multipart-body.d.ts +9 -0
- package/dist/request-example/builder/body/encode-multipart-body.d.ts.map +1 -0
- package/dist/request-example/builder/body/encode-multipart-body.js +29 -0
- package/dist/request-example/builder/body/get-request-body-example.d.ts +1 -1
- package/dist/request-example/builder/body/get-selected-body-content-type.d.ts +1 -1
- package/dist/request-example/builder/body/schema-value-coercion.d.ts +1 -1
- package/dist/request-example/builder/body/schema-value-coercion.js +1 -1
- package/dist/request-example/builder/body/serialize-form-property.d.ts +1 -1
- package/dist/request-example/builder/body/serialize-multipart-array.d.ts +16 -0
- package/dist/request-example/builder/body/serialize-multipart-array.d.ts.map +1 -0
- package/dist/request-example/builder/body/serialize-multipart-array.js +37 -0
- package/dist/request-example/builder/build-request.d.ts.map +1 -1
- package/dist/request-example/builder/build-request.js +12 -7
- package/dist/request-example/builder/header/build-request-parameters.d.ts +1 -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 +7 -1
- package/dist/request-example/builder/header/de-serialize-parameter.d.ts +1 -1
- package/dist/request-example/builder/header/de-serialize-parameter.d.ts.map +1 -1
- package/dist/request-example/builder/header/de-serialize-parameter.js +2 -1
- package/dist/request-example/builder/header/is-param-disabled.d.ts +1 -1
- package/dist/request-example/builder/header/serialize-parameter.d.ts.map +1 -1
- package/dist/request-example/builder/header/serialize-parameter.js +13 -14
- package/dist/request-example/builder/helpers/get-example-from-schema.d.ts +9 -1
- 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 +255 -20
- package/dist/request-example/builder/helpers/get-example.d.ts +1 -1
- package/dist/request-example/builder/helpers/get-example.js +2 -2
- package/dist/request-example/builder/helpers/get-resolved-url.d.ts +1 -1
- package/dist/request-example/builder/helpers/get-server-variables.d.ts +1 -1
- 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/request-factory.d.ts +2 -2
- package/dist/request-example/builder/security/broker-scheme-types.d.ts.map +1 -1
- package/dist/request-example/builder/security/broker-scheme-types.js +2 -2
- package/dist/request-example/builder/security/build-request-security.d.ts.map +1 -1
- package/dist/request-example/builder/security/build-request-security.js +3 -4
- package/dist/request-example/builder/security/secret-types.d.ts +13 -4
- package/dist/request-example/builder/security/secret-types.d.ts.map +1 -1
- package/dist/request-example/context/get-request-example-context.d.ts +3 -3
- package/dist/request-example/context/get-request-example-context.js +1 -1
- package/dist/request-example/context/headers.d.ts +1 -1
- package/dist/request-example/context/headers.js +1 -1
- package/dist/request-example/context/helpers/combine-params.d.ts +1 -1
- package/dist/request-example/context/security/extract-security-scheme-secrets.d.ts +16 -3
- 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 +21 -19
- package/dist/request-example/context/security/get-security-requirements.d.ts +2 -2
- package/dist/request-example/context/security/get-security-schemes.d.ts +1 -1
- package/dist/request-example/context/security/get-selected-security.d.ts +1 -1
- package/dist/request-example/context/security/is-auth-optional.d.ts +1 -1
- package/dist/request-example/context/security/merge-security.d.ts +3 -3
- package/dist/request-example/context/security/merge-security.d.ts.map +1 -1
- package/dist/request-example/context/security/merge-security.js +40 -11
- package/dist/request-example/context/servers.d.ts +2 -2
- package/dist/request-example/functions.d.ts.map +1 -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/resolve.d.ts +1 -1
- package/dist/resolve.js +1 -1
- package/dist/schemas/navigation.d.ts +4 -4
- package/dist/schemas/navigation.js +1 -1
- package/dist/schemas/reference-config/index.d.ts +92 -4
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +93 -5
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.js +1 -1
- package/dist/schemas/type-guards.d.ts +1 -1
- package/dist/schemas/v3.1/openapi/index.d.ts.map +1 -1
- package/dist/schemas/v3.1/openapi/index.js +11 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +210 -0
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/security-scheme.d.ts +13 -1
- package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/security-scheme.js +11 -1
- package/dist/schemas/v3.2/openapi/index.d.ts +2 -0
- package/dist/schemas/v3.2/openapi/index.d.ts.map +1 -1
- package/dist/schemas/v3.2/openapi/index.js +13 -1
- package/dist/schemas/v3.2/strict/oauth-flow.d.ts +23 -1
- package/dist/schemas/v3.2/strict/oauth-flow.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/oauth-flow.js +6 -1
- package/dist/schemas/v3.2/strict/oauthflows.d.ts +20 -0
- package/dist/schemas/v3.2/strict/oauthflows.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/openapi-document.d.ts +1439 -141
- package/dist/schemas/v3.2/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/openapi-document.js +2 -1
- package/dist/schemas/v3.2/strict/security-scheme.d.ts +29 -6
- package/dist/schemas/v3.2/strict/security-scheme.d.ts.map +1 -1
- package/dist/schemas/v3.2/strict/security-scheme.js +16 -3
- package/dist/schemas/workspace-specification/index.d.ts +1 -1
- package/dist/schemas/workspace.d.ts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +23 -27
- package/package.json +8 -8
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import type { SecurityScheme } from '@scalar/types/entities';
|
|
2
2
|
import type { AuthStore } from '@scalar/workspace-store/entities/auth';
|
|
3
3
|
import type { DeepPartial } from '@scalar/workspace-store/helpers/overrides-proxy';
|
|
4
|
-
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.
|
|
5
|
-
import type { SecuritySchemeObjectSecret } from '../../../request-example/builder/security/secret-types.js';
|
|
4
|
+
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
5
|
+
import type { BrokerApiKeyObject, EncryptionObjectSecret, SaslObjectSecret, SecuritySchemeObjectSecret } from '../../../request-example/builder/security/secret-types.js';
|
|
6
6
|
/** A combined scheme that includes both the auth store secrets and a deep partial of the config auth */
|
|
7
7
|
export type ConfigAuthScheme = SecuritySchemeObject & DeepPartial<SecurityScheme>;
|
|
8
|
+
type BrokerSchemeType = SaslObjectSecret['type'] | EncryptionObjectSecret['type'] | 'X509' | 'gssapi';
|
|
9
|
+
type BrokerAuthScheme = {
|
|
10
|
+
[T in BrokerSchemeType]: {
|
|
11
|
+
type: T;
|
|
12
|
+
description?: string;
|
|
13
|
+
username?: string;
|
|
14
|
+
password?: string;
|
|
15
|
+
token?: string;
|
|
16
|
+
};
|
|
17
|
+
}[BrokerSchemeType];
|
|
8
18
|
/** Extract the secrets from the config and the auth store */
|
|
9
|
-
export declare const extractSecuritySchemeSecrets: (scheme:
|
|
19
|
+
export declare const extractSecuritySchemeSecrets: (scheme: ConfigAuthScheme | BrokerAuthScheme | (BrokerApiKeyObject & {
|
|
20
|
+
value?: string;
|
|
21
|
+
}), authStore: AuthStore, name: string, documentSlug: string, oauth2RedirectUri?: string) => SecuritySchemeObjectSecret;
|
|
22
|
+
export {};
|
|
10
23
|
//# sourceMappingURL=extract-security-scheme-secrets.d.ts.map
|
|
@@ -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,
|
|
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;AAC/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,EAStB,gBAAgB,EAChB,0BAA0B,EAE3B,MAAM,iDAAiD,CAAA;AAExD,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;AAgMnB,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,0BA4HF,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isObject } from '@scalar/helpers/object/is-object';
|
|
2
2
|
import { objectEntries } from '@scalar/helpers/object/object-entries';
|
|
3
|
-
import { isEncryptionSchemeType, isSaslSchemeType } from '../../../request-example/builder/security/broker-scheme-types.js';
|
|
4
3
|
/**
|
|
5
4
|
* Maps x-scalar-secret fields to their corresponding input field names.
|
|
6
5
|
* This allows us to fall back to config values when auth store secrets are not available.
|
|
@@ -35,7 +34,7 @@ const mergeFlowSecrets = (properties, configSecrets, authStoreSecrets = {}, oaut
|
|
|
35
34
|
}));
|
|
36
35
|
/** Secret extensions are not part of the strict scheme types, so they are read the same way the OAuth flows read theirs */
|
|
37
36
|
const documentSecret = (scheme, property) => {
|
|
38
|
-
const value = scheme
|
|
37
|
+
const value = property in scheme ? Reflect.get(scheme, property) : undefined;
|
|
39
38
|
return typeof value === 'string' ? value : '';
|
|
40
39
|
};
|
|
41
40
|
const extractRefreshTokenSecret = (authStoreSecrets = {}) => {
|
|
@@ -133,10 +132,6 @@ export const extractSecuritySchemeSecrets = (
|
|
|
133
132
|
// Include the config fields
|
|
134
133
|
scheme, authStore, name, documentSlug, oauth2RedirectUri) => {
|
|
135
134
|
const secrets = authStore.getAuthSecrets(documentSlug, name);
|
|
136
|
-
// AsyncAPI broker schemes live outside the OpenAPI `SecuritySchemeObject` union, so their type
|
|
137
|
-
// (and any config credential fields) are read through this alias. Captured before the OpenAPI
|
|
138
|
-
// branches below, where `scheme` gets narrowed to `never` once all four OpenAPI types are handled.
|
|
139
|
-
const brokerScheme = scheme;
|
|
140
135
|
// Handle API Key security schemes
|
|
141
136
|
if (scheme.type === 'apiKey') {
|
|
142
137
|
const storeSecrets = secrets?.type === 'apiKey' ? secrets : undefined;
|
|
@@ -197,36 +192,43 @@ scheme, authStore, name, documentSlug, oauth2RedirectUri) => {
|
|
|
197
192
|
}
|
|
198
193
|
// SASL-style schemes (userPassword, plain, scramSha256, scramSha512): username + password,
|
|
199
194
|
// with the same config fallbacks as HTTP basic.
|
|
200
|
-
if (
|
|
201
|
-
|
|
195
|
+
if (scheme.type === 'userPassword' ||
|
|
196
|
+
scheme.type === 'plain' ||
|
|
197
|
+
scheme.type === 'scramSha256' ||
|
|
198
|
+
scheme.type === 'scramSha512') {
|
|
199
|
+
const storeSecrets = secrets?.type === scheme.type ? secrets : undefined;
|
|
202
200
|
return {
|
|
203
|
-
...
|
|
204
|
-
|
|
205
|
-
'x-scalar-secret-
|
|
201
|
+
...scheme,
|
|
202
|
+
type: scheme.type,
|
|
203
|
+
'x-scalar-secret-username': storeSecrets?.['x-scalar-secret-username'] || scheme.username || '',
|
|
204
|
+
'x-scalar-secret-password': storeSecrets?.['x-scalar-secret-password'] || scheme.password || '',
|
|
206
205
|
};
|
|
207
206
|
}
|
|
208
207
|
// X509: a client certificate + private key pair (PEM), stored in the auth store only.
|
|
209
|
-
if (
|
|
208
|
+
if (scheme.type === 'X509') {
|
|
210
209
|
const storeSecrets = secrets?.type === 'X509' ? secrets : undefined;
|
|
211
210
|
return {
|
|
212
|
-
...
|
|
211
|
+
...scheme,
|
|
212
|
+
type: scheme.type,
|
|
213
213
|
'x-scalar-secret-client-certificate': storeSecrets?.['x-scalar-secret-client-certificate'] || '',
|
|
214
214
|
'x-scalar-secret-private-key': storeSecrets?.['x-scalar-secret-private-key'] || '',
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
// Encryption schemes (symmetricEncryption, asymmetricEncryption): a single key value in the token slot.
|
|
218
|
-
if (
|
|
219
|
-
const storeSecrets = secrets?.type ===
|
|
218
|
+
if (scheme.type === 'symmetricEncryption' || scheme.type === 'asymmetricEncryption') {
|
|
219
|
+
const storeSecrets = secrets?.type === scheme.type ? secrets : undefined;
|
|
220
220
|
return {
|
|
221
|
-
...
|
|
222
|
-
|
|
221
|
+
...scheme,
|
|
222
|
+
type: scheme.type,
|
|
223
|
+
'x-scalar-secret-token': storeSecrets?.['x-scalar-secret-token'] || scheme.token || '',
|
|
223
224
|
};
|
|
224
225
|
}
|
|
225
226
|
// GSSAPI (Kerberos): the service name the client authenticates against.
|
|
226
|
-
if (
|
|
227
|
+
if (scheme.type === 'gssapi') {
|
|
227
228
|
const storeSecrets = secrets?.type === 'gssapi' ? secrets : undefined;
|
|
228
229
|
return {
|
|
229
|
-
...
|
|
230
|
+
...scheme,
|
|
231
|
+
type: scheme.type,
|
|
230
232
|
'x-scalar-secret-service-name': storeSecrets?.['x-scalar-secret-service-name'] || '',
|
|
231
233
|
};
|
|
232
234
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.
|
|
2
|
-
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.
|
|
1
|
+
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
2
|
+
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.2/strict/operation';
|
|
3
3
|
/**
|
|
4
4
|
* Compute what the security requirements should be for a request
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SecuritySchemeObjectSecret } from '../../../request-example/builder/security/secret-types.js';
|
|
2
2
|
import type { MergedSecuritySchemes } from '../../../request-example/context/security/merge-security.js';
|
|
3
|
-
import type { SecurityRequirementObject } from '../../../schemas/v3.
|
|
3
|
+
import type { SecurityRequirementObject } from '../../../schemas/v3.2/strict/security-requirement.js';
|
|
4
4
|
/**
|
|
5
5
|
* Get the selected security schemes from security requirements.
|
|
6
6
|
* Takes security requirement objects and resolves them to actual security scheme objects.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
|
|
2
2
|
import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth';
|
|
3
|
-
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.
|
|
3
|
+
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
4
4
|
type DefaultScopeScheme = {
|
|
5
5
|
type?: string;
|
|
6
6
|
'x-default-scopes'?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.
|
|
1
|
+
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
2
2
|
/** Determines if the authentication is optional */
|
|
3
3
|
export declare const isAuthOptional: (securityRequirements: NonNullable<OpenApiDocument["security"]>) => boolean;
|
|
4
4
|
//# sourceMappingURL=is-auth-optional.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
|
|
2
2
|
import type { AsyncApiComponentsObject } from '@scalar/types/asyncapi/3.1';
|
|
3
3
|
import type { AuthStore } from '@scalar/workspace-store/entities/auth';
|
|
4
|
-
import { type ComponentsObject } from '@scalar/workspace-store/schemas/v3.
|
|
4
|
+
import { type ComponentsObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
5
5
|
import type { SecuritySchemeObjectSecret } from '../../../request-example/builder/security/secret-types.js';
|
|
6
6
|
/** Document security merged with the config security schemes */
|
|
7
7
|
export type MergedSecuritySchemes = Record<string, SecuritySchemeObjectSecret>;
|
|
@@ -10,8 +10,8 @@ export type MergedSecuritySchemes = Record<string, SecuritySchemeObjectSecret>;
|
|
|
10
10
|
*
|
|
11
11
|
* AsyncAPI keeps its security schemes in the same `components.securitySchemes` slot and shares the
|
|
12
12
|
* `http`/`apiKey`/`oauth2`/`openIdConnect` shapes with OpenAPI, so we accept either spec's schemes
|
|
13
|
-
* here.
|
|
14
|
-
* AsyncAPI
|
|
13
|
+
* here. HTTP schemes are coerced into the OpenAPI shape, while broker credentials retain their
|
|
14
|
+
* AsyncAPI type and location.
|
|
15
15
|
*/
|
|
16
16
|
export declare const mergeSecurity: (documentSecuritySchemes: ComponentsObject["securitySchemes"] | NonNullable<AsyncApiComponentsObject["securitySchemes"]>, configSecuritySchemes: AuthenticationConfiguration["securitySchemes"], authStore: AuthStore, documentName: string, oauth2RedirectUri?: string) => MergedSecuritySchemes;
|
|
17
17
|
//# sourceMappingURL=merge-security.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-security.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/merge-security.ts"],"names":[],"mappings":"
|
|
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;AA0E9E;;;;;;;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"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { isObjectLike } from '@scalar/helpers/object/is-object';
|
|
1
2
|
import { objectEntries } from '@scalar/helpers/object/object-entries';
|
|
3
|
+
import { Type } from '@scalar/typebox';
|
|
2
4
|
import { deepClone } from '@scalar/workspace-store/helpers/deep-clone';
|
|
3
5
|
import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref';
|
|
4
6
|
import { mergeObjects } from '@scalar/workspace-store/helpers/merge-object';
|
|
5
7
|
import { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce';
|
|
6
|
-
import { SecuritySchemeObjectSchema, } from '@scalar/workspace-store/schemas/v3.
|
|
8
|
+
import { SecuritySchemeObjectSchema, } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
9
|
+
import { isEncryptionSchemeType, isSaslSchemeType } from '../../../request-example/builder/security/broker-scheme-types.js';
|
|
7
10
|
import { extractSecuritySchemeSecrets } from './extract-security-scheme-secrets.js';
|
|
8
11
|
const hasAvailableScopes = (flow) => {
|
|
9
12
|
const resolved = getResolvedRef(flow);
|
|
10
|
-
return
|
|
13
|
+
return resolved !== null && typeof resolved === 'object' && 'availableScopes' in resolved;
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* Rename each AsyncAPI OAuth2 flow's `availableScopes` map onto OpenAPI's `scopes`.
|
|
@@ -31,7 +34,10 @@ const normalizeAsyncApiOAuthFlows = (flows) => {
|
|
|
31
34
|
return [flowKey, flowValue];
|
|
32
35
|
}
|
|
33
36
|
// Prefer an OpenAPI-native `scopes` map if one is somehow already present, so we never drop it.
|
|
34
|
-
const
|
|
37
|
+
const resolved = getResolvedRef(flowValue);
|
|
38
|
+
if (!isObjectLike(resolved))
|
|
39
|
+
return [flowKey, flowValue];
|
|
40
|
+
const { availableScopes, scopes: existingScopes, ...rest } = resolved;
|
|
35
41
|
return [flowKey, { ...rest, scopes: existingScopes ?? availableScopes ?? {} }];
|
|
36
42
|
}));
|
|
37
43
|
};
|
|
@@ -48,6 +54,10 @@ const normalizeAsyncApiSecurityScheme = (scheme) => {
|
|
|
48
54
|
if (!(scheme && typeof scheme === 'object' && 'type' in scheme)) {
|
|
49
55
|
return scheme;
|
|
50
56
|
}
|
|
57
|
+
// HTTP authentication scheme names are case-insensitive, but the strict schema uses lowercase literals.
|
|
58
|
+
if (scheme.type === 'http' && 'scheme' in scheme && typeof scheme.scheme === 'string') {
|
|
59
|
+
return { ...scheme, scheme: scheme.scheme.toLowerCase() };
|
|
60
|
+
}
|
|
51
61
|
if (scheme.type === 'httpApiKey') {
|
|
52
62
|
return { ...scheme, type: 'apiKey' };
|
|
53
63
|
}
|
|
@@ -64,8 +74,8 @@ const normalizeAsyncApiSecurityScheme = (scheme) => {
|
|
|
64
74
|
*
|
|
65
75
|
* AsyncAPI keeps its security schemes in the same `components.securitySchemes` slot and shares the
|
|
66
76
|
* `http`/`apiKey`/`oauth2`/`openIdConnect` shapes with OpenAPI, so we accept either spec's schemes
|
|
67
|
-
* here.
|
|
68
|
-
* AsyncAPI
|
|
77
|
+
* here. HTTP schemes are coerced into the OpenAPI shape, while broker credentials retain their
|
|
78
|
+
* AsyncAPI type and location.
|
|
69
79
|
*/
|
|
70
80
|
export const mergeSecurity = (documentSecuritySchemes = {}, configSecuritySchemes = {}, authStore, documentName, oauth2RedirectUri) => {
|
|
71
81
|
/** Resolve any refs in the document security schemes */
|
|
@@ -77,18 +87,37 @@ export const mergeSecurity = (documentSecuritySchemes = {}, configSecurityScheme
|
|
|
77
87
|
return acc;
|
|
78
88
|
}, {});
|
|
79
89
|
/** Merge the config security schemes into the document security schemes */
|
|
80
|
-
const mergedSchemes = mergeObjects(resolvedDocumentSecuritySchemes, configSecuritySchemes)
|
|
90
|
+
const mergedSchemes = mergeObjects(resolvedDocumentSecuritySchemes, configSecuritySchemes);
|
|
81
91
|
/** Convert the config secrets to the new secret extensions */
|
|
82
92
|
return objectEntries(mergedSchemes).reduce((acc, [name, value]) => {
|
|
83
93
|
// Fold AsyncAPI-only types (e.g. `httpApiKey`) onto their OpenAPI equivalents before coercing,
|
|
84
94
|
// so the downstream apiKey/http/oauth2 machinery recognises them instead of rejecting the type.
|
|
85
95
|
const scheme = normalizeAsyncApiSecurityScheme(value);
|
|
86
|
-
//
|
|
96
|
+
// Broker schemes have no OpenAPI equivalent. Validate their shared fields separately so
|
|
97
|
+
// coercion cannot turn a broker credential into an HTTP authentication scheme.
|
|
98
|
+
const type = isObjectLike(scheme) && typeof scheme.type === 'string' ? scheme.type : undefined;
|
|
99
|
+
if (isSaslSchemeType(type) || isEncryptionSchemeType(type) || type === 'X509' || type === 'gssapi') {
|
|
100
|
+
const broker = coerceValue(Type.Object({
|
|
101
|
+
description: Type.Optional(Type.String()),
|
|
102
|
+
username: Type.Optional(Type.String()),
|
|
103
|
+
password: Type.Optional(Type.String()),
|
|
104
|
+
token: Type.Optional(Type.String()),
|
|
105
|
+
}), scheme);
|
|
106
|
+
acc[name] = extractSecuritySchemeSecrets({ ...broker, type }, authStore, name, documentName, oauth2RedirectUri);
|
|
107
|
+
return acc;
|
|
108
|
+
}
|
|
109
|
+
if (isObjectLike(scheme) && scheme.type === 'apiKey' && (scheme.in === 'user' || scheme.in === 'password')) {
|
|
110
|
+
const broker = coerceValue(Type.Object({
|
|
111
|
+
description: Type.Optional(Type.String()),
|
|
112
|
+
name: Type.Optional(Type.String()),
|
|
113
|
+
value: Type.Optional(Type.String()),
|
|
114
|
+
}), scheme);
|
|
115
|
+
acc[name] = extractSecuritySchemeSecrets({ ...broker, type: 'apiKey', in: scheme.in }, authStore, name, documentName, oauth2RedirectUri);
|
|
116
|
+
return acc;
|
|
117
|
+
}
|
|
118
|
+
// We coerce in case the scheme is missing any key fields like type.
|
|
87
119
|
const coerced = coerceValue(SecuritySchemeObjectSchema, scheme);
|
|
88
|
-
|
|
89
|
-
// `coerced` has already laundered the value into the OpenAPI shape (including any AsyncAPI scheme),
|
|
90
|
-
// so we narrow here to restore the extra fields without re-widening the type.
|
|
91
|
-
const merged = { ...coerced, ...scheme };
|
|
120
|
+
const merged = { ...(isObjectLike(scheme) ? scheme : {}), ...coerced };
|
|
92
121
|
acc[name] = extractSecuritySchemeSecrets(merged, authStore, name, documentName, oauth2RedirectUri);
|
|
93
122
|
return acc;
|
|
94
123
|
}, {});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.
|
|
1
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
2
2
|
import type { WorkspaceDocument } from '../../schemas.js';
|
|
3
|
-
import type { OperationObject } from '../../schemas/v3.
|
|
3
|
+
import type { OperationObject } from '../../schemas/v3.2/strict/operation.js';
|
|
4
4
|
/**
|
|
5
5
|
* Server processing options containing base URLs for resolving relative server URLs.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/request-example/functions.ts"],"names":[],"mappings":"AAsJA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAnCN,MAAM;;;;kBAMR,MAAM;;;;kBAMJ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAihBoC,CAAA;AAEjE,kHAAkH;AAClH,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,gBAAgB,CAAA;AAE/D,eAAO,MAAM,yBAAyB,GAAI,MAAM,mBAAmB,KAAG,
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/request-example/functions.ts"],"names":[],"mappings":"AAsJA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAnCN,MAAM;;;;kBAMR,MAAM;;;;kBAMJ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAihBoC,CAAA;AAEjE,kHAAkH;AAClH,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,gBAAgB,CAAA;AAE/D,eAAO,MAAM,yBAAyB,GAAI,MAAM,mBAAmB,KAAG,MAAwC,CAAA;AAE9G,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,EAAE,SAAS,mBAAmB,EASvE,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAoC,mBAAmB,EAAE,CAAA;AAC5F,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,IAAI,IAAI,mBACtB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { ApiKeyObjectSecret, BuildRequestData, BuildRequestFailureCode, BuildRequestResult, EncryptionObjectSecret, GssapiObjectSecret, HttpObjectSecret, OAuth2ObjectSecret, OAuthFlowAuthorizationCodeSecret, OAuthFlowClientCredentialsSecret, 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, serializeDeepObjectStyle, serializeFormPropertyWithEncoding, serializeFormStyle, serializeFormStyleForCookies, 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, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSchemaExampleFromBody, getSelectedBodyContentType, getServerVariables, isEncryptionSchemeType, isParamDisabled, isSaslSchemeType, requestFactory, resolveExecutableRequestUrl, resolveLeafSchema, resolveRequestFactoryUrl, serializeContentValue, serializeDeepObjectStyle, serializeFormPropertyWithEncoding, serializeFormStyle, serializeFormStyleForCookies, serializeMultipartArray, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
3
3
|
export type { MergedSecuritySchemes } from './context/index.js';
|
|
4
4
|
export { type BuildRequestExampleContext, combineParams, filterDisabledDefaultHeaders, getActiveEnvironment, getActiveProxyUrl, getDefaultHeaders, getRequestExampleContext, getSecurityRequirements, getSecuritySchemes, getSelectedSecurity, getSelectedServer, getServers, isAuthOptional, mergeSecurity, restoreConventionalDefaultHeaderNames, restoreConventionalHeaderName, } from './context/index.js';
|
|
5
5
|
export { CONTEXT_FUNCTION_NAMES, type ContextFunctionEntry, type ContextFunctionName, POPULAR_CONTEXT_FUNCTION_KEYS, contextFunctions, getContextFunctionComment, isContextFunctionName, } from './functions.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,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,wBAAwB,EACxB,iCAAiC,EACjC,kBAAkB,EAClB,4BAA4B,EAC5B,2BAA2B,EAC3B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EACL,KAAK,0BAA0B,EAC/B,aAAa,EACb,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,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"}
|
|
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,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,wBAAwB,EACxB,iCAAiC,EACjC,kBAAkB,EAClB,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EACL,KAAK,0BAA0B,EAC/B,aAAa,EACb,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,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"}
|
|
@@ -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, serializeDeepObjectStyle, serializeFormPropertyWithEncoding, serializeFormStyle, serializeFormStyleForCookies, 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, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSchemaExampleFromBody, getSelectedBodyContentType, getServerVariables, isEncryptionSchemeType, isParamDisabled, isSaslSchemeType, requestFactory, resolveExecutableRequestUrl, resolveLeafSchema, resolveRequestFactoryUrl, serializeContentValue, serializeDeepObjectStyle, serializeFormPropertyWithEncoding, serializeFormStyle, serializeFormStyleForCookies, serializeMultipartArray, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
2
2
|
export { combineParams, filterDisabledDefaultHeaders, getActiveEnvironment, getActiveProxyUrl, getDefaultHeaders, getRequestExampleContext, getSecurityRequirements, getSecuritySchemes, getSelectedSecurity, getSelectedServer, getServers, isAuthOptional, mergeSecurity, restoreConventionalDefaultHeaderNames, restoreConventionalHeaderName, } from './context/index.js';
|
|
3
3
|
export { CONTEXT_FUNCTION_NAMES, POPULAR_CONTEXT_FUNCTION_KEYS, contextFunctions, getContextFunctionComment, isContextFunctionName, } from './functions.js';
|
|
4
4
|
export { createVariablesStoreForRequest } from './variable-store/index.js';
|
package/dist/resolve.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MaybeRefSchemaObject, SchemaObject } from './schemas/v3.
|
|
1
|
+
import type { MaybeRefSchemaObject, SchemaObject } from './schemas/v3.2/strict/schema.js';
|
|
2
2
|
type ResolvedSchema<T> = T extends undefined ? undefined : SchemaObject & {
|
|
3
3
|
$ref?: string;
|
|
4
4
|
};
|
package/dist/resolve.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Type } from '@scalar/typebox';
|
|
|
2
2
|
import { getResolvedRef, mergeSiblingReferences } from './helpers/get-resolved-ref.js';
|
|
3
3
|
import { compose } from './schemas/compose.js';
|
|
4
4
|
import { coerceValue } from './schemas/typebox-coerce.js';
|
|
5
|
-
import { SchemaObjectSchema } from './schemas/v3.
|
|
5
|
+
import { SchemaObjectSchema } from './schemas/v3.2/strict/openapi-document.js';
|
|
6
6
|
export const resolve = {
|
|
7
7
|
schema: (schema) => {
|
|
8
8
|
if (schema === undefined) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import { type TLiteral } from '@scalar/typebox';
|
|
3
3
|
import type { AsyncApiInfoObject } from '@scalar/types/asyncapi/3.1';
|
|
4
|
-
import type { InfoObject } from '../schemas/v3.
|
|
5
|
-
import type { OperationObject } from '../schemas/v3.
|
|
6
|
-
import type { SchemaObject } from '../schemas/v3.
|
|
7
|
-
import type { TagObject } from '../schemas/v3.
|
|
4
|
+
import type { InfoObject } from '../schemas/v3.2/strict/info.js';
|
|
5
|
+
import type { OperationObject } from '../schemas/v3.2/strict/operation.js';
|
|
6
|
+
import type { SchemaObject } from '../schemas/v3.2/strict/schema.js';
|
|
7
|
+
import type { TagObject } from '../schemas/v3.2/strict/tag.js';
|
|
8
8
|
export declare const NavigationBaseSchemaDefinition: import("@scalar/typebox").TObject<{
|
|
9
9
|
id: import("@scalar/typebox").TString;
|
|
10
10
|
title: import("@scalar/typebox").TString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTTP_METHODS } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import { Type } from '@scalar/typebox';
|
|
3
3
|
import { compose } from '../schemas/compose.js';
|
|
4
|
-
import { TraversedEntryObjectRef } from '../schemas/v3.
|
|
4
|
+
import { TraversedEntryObjectRef } from '../schemas/v3.2/strict/ref-definitions.js';
|
|
5
5
|
export const NavigationBaseSchemaDefinition = Type.Object({
|
|
6
6
|
id: Type.String(),
|
|
7
7
|
title: Type.String(),
|