@scalar/workspace-store 0.49.3 → 0.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -0
- package/dist/client.d.ts +2 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +58 -25
- package/dist/entities/auth/schema.d.ts +25 -5
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/events/bus.d.ts +70 -0
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/bus.js +48 -11
- package/dist/events/definitions/analytics.d.ts +0 -12
- package/dist/events/definitions/analytics.d.ts.map +1 -1
- package/dist/events/definitions/auth.d.ts +44 -6
- package/dist/events/definitions/auth.d.ts.map +1 -1
- package/dist/events/definitions/index.d.ts +3 -2
- package/dist/events/definitions/index.d.ts.map +1 -1
- package/dist/events/definitions/log.d.ts +18 -0
- package/dist/events/definitions/log.d.ts.map +1 -0
- package/dist/events/definitions/log.js +1 -0
- package/dist/events/definitions/operation.d.ts +1 -1
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/ui.d.ts +18 -1
- package/dist/events/definitions/ui.d.ts.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/helpers/get-resolved-ref.d.ts +6 -0
- package/dist/helpers/get-resolved-ref.d.ts.map +1 -1
- package/dist/helpers/get-resolved-ref.js +9 -0
- package/dist/helpers/is-hidden.d.ts +8 -0
- package/dist/helpers/is-hidden.d.ts.map +1 -0
- package/dist/helpers/is-hidden.js +5 -0
- package/dist/helpers/merge-object.d.ts +1 -1
- package/dist/helpers/merge-object.d.ts.map +1 -1
- package/dist/mutators/auth.d.ts +22 -3
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +213 -37
- package/dist/mutators/cookie.d.ts.map +1 -1
- package/dist/mutators/cookie.js +3 -2
- package/dist/mutators/document.d.ts.map +1 -1
- package/dist/mutators/document.js +5 -4
- package/dist/mutators/environment.d.ts.map +1 -1
- package/dist/mutators/environment.js +12 -5
- package/dist/mutators/index.d.ts +4 -0
- package/dist/mutators/index.d.ts.map +1 -1
- package/dist/mutators/operation/body.d.ts.map +1 -1
- package/dist/mutators/operation/body.js +6 -2
- package/dist/mutators/operation/extensions.d.ts.map +1 -1
- package/dist/mutators/operation/extensions.js +5 -1
- package/dist/mutators/operation/history.d.ts.map +1 -1
- package/dist/mutators/operation/history.js +7 -3
- package/dist/mutators/operation/operation.d.ts.map +1 -1
- package/dist/mutators/operation/operation.js +15 -10
- package/dist/mutators/operation/parameters.d.ts.map +1 -1
- package/dist/mutators/operation/parameters.js +12 -5
- package/dist/mutators/server.d.ts.map +1 -1
- package/dist/mutators/server.js +2 -1
- package/dist/mutators/tag.d.ts.map +1 -1
- package/dist/mutators/tag.js +9 -4
- package/dist/navigation/get-navigation-options.d.ts +1 -1
- package/dist/navigation/get-navigation-options.d.ts.map +1 -1
- package/dist/navigation/get-navigation-options.js +1 -0
- package/dist/navigation/helpers/get-openapi-object.d.ts.map +1 -1
- package/dist/navigation/helpers/get-openapi-object.js +5 -0
- package/dist/navigation/helpers/traverse-document.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-document.js +8 -2
- package/dist/navigation/helpers/traverse-paths.d.ts +4 -2
- package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-paths.js +9 -6
- package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-schemas.js +9 -4
- package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-tags.js +2 -1
- package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-webhooks.js +4 -3
- package/dist/navigation/helpers/update-order-ids.d.ts.map +1 -1
- package/dist/navigation/helpers/update-order-ids.js +4 -1
- package/dist/navigation/types.d.ts +4 -0
- package/dist/navigation/types.d.ts.map +1 -1
- package/dist/persistence/index.d.ts +123 -80
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +233 -167
- package/dist/persistence/migrations/v2-team-to-local.d.ts +22 -5
- package/dist/persistence/migrations/v2-team-to-local.d.ts.map +1 -1
- package/dist/persistence/migrations/v2-team-to-local.js +195 -137
- package/dist/request-example/builder/body/build-request-body.d.ts.map +1 -1
- package/dist/request-example/builder/body/build-request-body.js +66 -2
- package/dist/request-example/builder/build-request.d.ts +24 -3
- package/dist/request-example/builder/build-request.d.ts.map +1 -1
- package/dist/request-example/builder/build-request.js +89 -18
- package/dist/request-example/builder/index.d.ts +2 -1
- package/dist/request-example/builder/index.d.ts.map +1 -1
- package/dist/request-example/builder/index.js +2 -1
- package/dist/request-example/builder/request-factory.d.ts.map +1 -1
- package/dist/request-example/builder/request-factory.js +5 -8
- package/dist/request-example/builder/resolve-request-factory-url.d.ts +18 -1
- package/dist/request-example/builder/resolve-request-factory-url.d.ts.map +1 -1
- package/dist/request-example/builder/resolve-request-factory-url.js +29 -4
- package/dist/request-example/context/environment.d.ts.map +1 -1
- package/dist/request-example/context/environment.js +2 -1
- package/dist/request-example/context/get-request-example-context.d.ts.map +1 -1
- package/dist/request-example/context/get-request-example-context.js +7 -0
- package/dist/request-example/context/headers.d.ts +28 -13
- package/dist/request-example/context/headers.d.ts.map +1 -1
- package/dist/request-example/context/headers.js +84 -19
- package/dist/request-example/context/index.d.ts +1 -0
- package/dist/request-example/context/index.d.ts.map +1 -1
- package/dist/request-example/context/index.js +1 -0
- package/dist/request-example/context/security/get-selected-security.d.ts.map +1 -1
- package/dist/request-example/context/security/get-selected-security.js +3 -6
- package/dist/request-example/context/servers.d.ts.map +1 -1
- package/dist/request-example/context/servers.js +3 -3
- package/dist/request-example/index.d.ts +3 -3
- package/dist/request-example/index.d.ts.map +1 -1
- package/dist/request-example/index.js +2 -2
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +1 -8
- package/dist/schemas/extensions/document/x-scalar-environments.d.ts +6 -6
- package/dist/schemas/extensions/document/x-scalar-original-source-url.d.ts +15 -0
- package/dist/schemas/extensions/document/x-scalar-original-source-url.d.ts.map +1 -0
- package/dist/schemas/extensions/document/x-scalar-original-source-url.js +16 -0
- package/dist/schemas/extensions/operation/x-badge.d.ts +2 -2
- package/dist/schemas/extensions/operation/x-scalar-stability.d.ts +1 -1
- package/dist/schemas/extensions/schema/x-enum-descriptions.d.ts +2 -2
- package/dist/schemas/extensions/security/x-scalar-credentials-location.d.ts +1 -1
- package/dist/schemas/extensions/security/x-use-pkce.d.ts +1 -1
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.d.ts +1 -1
- package/dist/schemas/inmemory-workspace.d.ts +3 -4631
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/inmemory-workspace.js +1 -15
- package/dist/schemas/reference-config/index.d.ts +6 -2
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +5 -1
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/type-guards.d.ts +24 -0
- package/dist/schemas/type-guards.d.ts.map +1 -0
- package/dist/schemas/type-guards.js +30 -0
- package/dist/schemas/v3.1/openapi/index.d.ts +4 -3
- package/dist/schemas/v3.1/openapi/index.d.ts.map +1 -1
- package/dist/schemas/v3.1/openapi/index.js +2 -3
- package/dist/schemas/v3.1/strict/encoding.d.ts +12 -0
- package/dist/schemas/v3.1/strict/encoding.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/encoding.js +11 -0
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +179 -39
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +2 -2
- package/dist/schemas/workspace-specification/index.d.ts +1 -1
- package/dist/schemas/workspace.d.ts +4 -4377
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/dist/schemas/workspace.js +0 -8
- package/dist/schemas.d.ts +2 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +1 -1
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAE7E,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,8DAA8D,CAAA;AAIrE,KAAK,kBAAkB,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;
|
|
1
|
+
{"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../src/request-example/context/security/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAE7E,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,8DAA8D,CAAA;AAIrE,KAAK,kBAAkB,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AA6DD;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,GAC9B,0BAA0B,gBAAgB,GAAG,SAAS,EACtD,2BAA2B,gBAAgB,GAAG,SAAS,EACvD,uBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAM,EACnE,kBAAiB,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAM,EACpE,0BAA0B,2BAA2B,CAAC,yBAAyB,CAAC,KAC/E,gBAgDF,CAAA"}
|
|
@@ -8,20 +8,17 @@ const getDefaultScopes = (scheme) => {
|
|
|
8
8
|
return scheme['x-default-scopes'] ?? [];
|
|
9
9
|
};
|
|
10
10
|
const applyDefaultScopes = (requirement, securitySchemes) => {
|
|
11
|
-
|
|
12
|
-
const hydratedRequirement = Object.fromEntries(Object.entries(requirement).map(([name, scopes]) => {
|
|
11
|
+
return Object.fromEntries(Object.entries(requirement).map(([name, scopes]) => {
|
|
13
12
|
if (Array.isArray(scopes) && scopes.length > 0) {
|
|
14
|
-
return [name, scopes];
|
|
13
|
+
return [name, [...scopes]];
|
|
15
14
|
}
|
|
16
15
|
const scheme = getResolvedRef(securitySchemes[name]);
|
|
17
16
|
const defaultScopes = scheme?.type === 'oauth2' ? scheme['x-default-scopes'] : undefined;
|
|
18
17
|
if (Array.isArray(defaultScopes) && defaultScopes.length > 0) {
|
|
19
|
-
didApplyDefaultScopes = true;
|
|
20
18
|
return [name, [...defaultScopes]];
|
|
21
19
|
}
|
|
22
|
-
return [name, scopes];
|
|
20
|
+
return [name, Array.isArray(scopes) ? [...scopes] : scopes];
|
|
23
21
|
}));
|
|
24
|
-
return didApplyDefaultScopes ? hydratedRequirement : requirement;
|
|
25
22
|
};
|
|
26
23
|
/**
|
|
27
24
|
* Builds a security requirement from the preferred security scheme configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../../src/request-example/context/servers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAEhG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"servers.d.ts","sourceRoot":"","sources":["../../../src/request-example/context/servers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAEhG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE;;GAEG;AACH,KAAK,uBAAuB,GAAG;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,OAAO,GAAE,uBAA4B,GAAG,YAAY,EAAE,CASrH;AAoED,eAAO,MAAM,iBAAiB,GAC5B,UAAU,iBAAiB,GAAG,IAAI,EAClC,WAAW,eAAe,GAAG,IAAI,EACjC,eAAe,YAAY,EAAE,GAAG,IAAI,EACpC,SAAS,YAAY,EAAE,KACtB,YAAY,GAAG,IAUjB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { combineUrlAndPath } from '@scalar/helpers/url/merge-urls';
|
|
2
|
+
import { isOpenApiDocument } from '../../schemas/type-guards.js';
|
|
2
3
|
/**
|
|
3
4
|
* Retrieves and processes servers from an OpenAPI document.
|
|
4
5
|
*
|
|
@@ -79,9 +80,8 @@ function processServerObject(server, options) {
|
|
|
79
80
|
return server;
|
|
80
81
|
}
|
|
81
82
|
export const getSelectedServer = (document, operation, configServers, servers) => {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
: (operation?.['x-scalar-selected-server'] ?? document?.['x-scalar-selected-server']);
|
|
83
|
+
const documentSelectedServer = isOpenApiDocument(document) ? document['x-scalar-selected-server'] : undefined;
|
|
84
|
+
const selectedServerUrl = configServers != null ? documentSelectedServer : (operation?.['x-scalar-selected-server'] ?? documentSelectedServer);
|
|
85
85
|
if (selectedServerUrl == null) {
|
|
86
86
|
return servers[0] ?? null;
|
|
87
87
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type { ApiKeyObjectSecret, HttpObjectSecret, OAuth2ObjectSecret, OAuthFlowAuthorizationCodeSecret, OAuthFlowClientCredentialsSecret, OAuthFlowImplicitSecret, OAuthFlowPasswordSecret, OAuthFlowsObjectSecret, OpenIdConnectObjectSecret, RequestPayload, SecuritySchemeObjectSecret, } from './builder/index.js';
|
|
2
|
-
export { type RequestFactory, buildRequest, buildRequestSecurity, deSerializeParameter, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSelectedBodyContentType, getServerVariables, requestFactory, serializeContentValue, serializeDeepObjectStyle, serializeFormStyle, serializeFormStyleForCookies, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
1
|
+
export type { ApiKeyObjectSecret, BuildRequestData, BuildRequestFailureCode, BuildRequestResult, HttpObjectSecret, OAuth2ObjectSecret, OAuthFlowAuthorizationCodeSecret, OAuthFlowClientCredentialsSecret, OAuthFlowImplicitSecret, OAuthFlowPasswordSecret, OAuthFlowsObjectSecret, OpenIdConnectObjectSecret, RequestPayload, ResolveRequestFactoryUrlError, ResolveRequestFactoryUrlResult, SecuritySchemeObjectSecret, } from './builder/index.js';
|
|
2
|
+
export { BUILD_REQUEST_FAILED, INVALID_REQUEST_FACTORY_URL, MISSING_REQUEST_SERVER_BASE, type RequestFactory, buildRequest, buildRequestSecurity, deSerializeParameter, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSelectedBodyContentType, getServerVariables, requestFactory, resolveExecutableRequestUrl, resolveRequestFactoryUrl, serializeContentValue, serializeDeepObjectStyle, serializeFormStyle, serializeFormStyleForCookies, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
3
3
|
export type { MergedSecuritySchemes } from './context/index.js';
|
|
4
|
-
export { type BuildRequestExampleContext, combineParams, getActiveEnvironment, getActiveProxyUrl, getRequestExampleContext, getSecurityRequirements, getSecuritySchemes, getSelectedSecurity, getSelectedServer, getServers, isAuthOptional, mergeSecurity, } from './context/index.js';
|
|
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';
|
|
6
6
|
export { createVariablesStoreForRequest } from './variable-store/index.js';
|
|
7
7
|
export type { VariableEntry, VariablesStore } from './variable-store/types.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,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,EAChC,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,cAAc,EACd,0BAA0B,GAC3B,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,KAAK,cAAc,EACnB,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,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,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,aAAa,
|
|
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,gBAAgB,EAChB,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,EAChC,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,cAAc,EACd,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,KAAK,cAAc,EACnB,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,wBAAwB,EACxB,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,4 +1,4 @@
|
|
|
1
|
-
export { buildRequest, buildRequestSecurity, deSerializeParameter, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSelectedBodyContentType, getServerVariables, requestFactory, serializeContentValue, serializeDeepObjectStyle, serializeFormStyle, serializeFormStyleForCookies, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
2
|
-
export { combineParams, getActiveEnvironment, getActiveProxyUrl, getRequestExampleContext, getSecurityRequirements, getSecuritySchemes, getSelectedSecurity, getSelectedServer, getServers, isAuthOptional, mergeSecurity, } from './context/index.js';
|
|
1
|
+
export { BUILD_REQUEST_FAILED, INVALID_REQUEST_FACTORY_URL, MISSING_REQUEST_SERVER_BASE, buildRequest, buildRequestSecurity, deSerializeParameter, filterGlobalCookie, getEnvironmentVariables, getExample, getExampleFromBody, getExampleFromSchema, getResolvedUrl, getSelectedBodyContentType, getServerVariables, requestFactory, resolveExecutableRequestUrl, resolveRequestFactoryUrl, serializeContentValue, serializeDeepObjectStyle, serializeFormStyle, serializeFormStyleForCookies, serializePipeDelimitedStyle, serializeSimpleStyle, serializeSpaceDelimitedStyle, } from './builder/index.js';
|
|
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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEtF,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,SAAS,GAAG,YAAY,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3F,eAAO,MAAM,OAAO;aACT,CAAC,SAAS,oBAAoB,GAAG,SAAS,UAAU,CAAC,KAAG,cAAc,CAAC,CAAC,CAAC;CAWnF,CAAA"}
|
package/dist/resolve.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { Type } from '@scalar/typebox';
|
|
2
|
-
import { getResolvedRef } from './helpers/get-resolved-ref.js';
|
|
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
5
|
import { SchemaObjectSchema } from './schemas/v3.1/strict/openapi-document.js';
|
|
6
|
-
const mergeSiblingReferences = (node) => {
|
|
7
|
-
const { '$ref-value': value, ...rest } = node;
|
|
8
|
-
return {
|
|
9
|
-
...value,
|
|
10
|
-
...rest,
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
6
|
export const resolve = {
|
|
14
7
|
schema: (schema) => {
|
|
15
8
|
if (schema === undefined) {
|
|
@@ -7,10 +7,10 @@ export declare const xScalarEnvVarSchema: import("@scalar/typebox").TObject<{
|
|
|
7
7
|
}>;
|
|
8
8
|
export declare const XScalarEnvVar: import("@scalar/validation").ObjectSchema<{
|
|
9
9
|
name: import("@scalar/validation").StringSchema;
|
|
10
|
-
value: import("@scalar/validation").UnionSchema<
|
|
10
|
+
value: import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").ObjectSchema<{
|
|
11
11
|
description: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
12
12
|
default: import("@scalar/validation").StringSchema;
|
|
13
|
-
}
|
|
13
|
+
}>, import("@scalar/validation").StringSchema]>;
|
|
14
14
|
}>;
|
|
15
15
|
/** A scalar environment variable */
|
|
16
16
|
export type XScalarEnvVar = {
|
|
@@ -36,10 +36,10 @@ export declare const XScalarEnvironment: import("@scalar/validation").ObjectSche
|
|
|
36
36
|
color: import("@scalar/validation").StringSchema;
|
|
37
37
|
variables: import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
38
38
|
name: import("@scalar/validation").StringSchema;
|
|
39
|
-
value: import("@scalar/validation").UnionSchema<
|
|
39
|
+
value: import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").ObjectSchema<{
|
|
40
40
|
description: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
41
41
|
default: import("@scalar/validation").StringSchema;
|
|
42
|
-
}
|
|
42
|
+
}>, import("@scalar/validation").StringSchema]>;
|
|
43
43
|
}>>;
|
|
44
44
|
}>;
|
|
45
45
|
/** An environment definition */
|
|
@@ -70,10 +70,10 @@ export declare const XScalarEnvironments: import("@scalar/validation").ObjectSch
|
|
|
70
70
|
color: import("@scalar/validation").StringSchema;
|
|
71
71
|
variables: import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
72
72
|
name: import("@scalar/validation").StringSchema;
|
|
73
|
-
value: import("@scalar/validation").UnionSchema<
|
|
73
|
+
value: import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").ObjectSchema<{
|
|
74
74
|
description: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
75
75
|
default: import("@scalar/validation").StringSchema;
|
|
76
|
-
}
|
|
76
|
+
}>, import("@scalar/validation").StringSchema]>;
|
|
77
77
|
}>>;
|
|
78
78
|
}>>>;
|
|
79
79
|
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema for the `x-scalar-original-source-url` OpenAPI extension.
|
|
3
|
+
* Tracks where the document was loaded from (file path or remote URL).
|
|
4
|
+
*/
|
|
5
|
+
export declare const XScalarOriginalSourceUrlSchema: import("@scalar/typebox").TObject<{
|
|
6
|
+
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
7
|
+
}>;
|
|
8
|
+
export type XScalarOriginalSourceUrl = Partial<{
|
|
9
|
+
/** Original document source URL when loaded from an external source. */
|
|
10
|
+
'x-scalar-original-source-url': string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const XScalarOriginalSourceUrl: import("@scalar/validation").ObjectSchema<{
|
|
13
|
+
'x-scalar-original-source-url': import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=x-scalar-original-source-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-scalar-original-source-url.d.ts","sourceRoot":"","sources":["../../../../src/schemas/extensions/document/x-scalar-original-source-url.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;EAK1C,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC;IAC7C,wEAAwE;IACxE,8BAA8B,EAAE,MAAM,CAAA;CACvC,CAAC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;EAUpC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Type } from '@scalar/typebox';
|
|
2
|
+
import { object, optional, string } from '@scalar/validation';
|
|
3
|
+
/**
|
|
4
|
+
* Schema for the `x-scalar-original-source-url` OpenAPI extension.
|
|
5
|
+
* Tracks where the document was loaded from (file path or remote URL).
|
|
6
|
+
*/
|
|
7
|
+
export const XScalarOriginalSourceUrlSchema = Type.Partial(Type.Object({
|
|
8
|
+
/** Original document source URL when loaded from an external source. */
|
|
9
|
+
'x-scalar-original-source-url': Type.String(),
|
|
10
|
+
}));
|
|
11
|
+
export const XScalarOriginalSourceUrl = object({
|
|
12
|
+
'x-scalar-original-source-url': optional(string({ typeComment: 'Original document source URL when loaded from an external source' })),
|
|
13
|
+
}, {
|
|
14
|
+
typeName: 'XScalarOriginalSourceUrl',
|
|
15
|
+
typeComment: 'Original document source URL when loaded from an external source.',
|
|
16
|
+
});
|
|
@@ -36,7 +36,7 @@ export type XBadge = {
|
|
|
36
36
|
};
|
|
37
37
|
export declare const XBadge: import("@scalar/validation").ObjectSchema<{
|
|
38
38
|
name: import("@scalar/validation").StringSchema;
|
|
39
|
-
position: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<
|
|
39
|
+
position: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"before">, import("@scalar/validation").LiteralSchema<"after">]>>;
|
|
40
40
|
color: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
41
41
|
}>;
|
|
42
42
|
export declare const XBadgesSchema: import("@scalar/typebox").TObject<{
|
|
@@ -103,7 +103,7 @@ export type XBadges = {
|
|
|
103
103
|
export declare const XBadges: import("@scalar/validation").ObjectSchema<{
|
|
104
104
|
'x-badges': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
105
105
|
name: import("@scalar/validation").StringSchema;
|
|
106
|
-
position: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<
|
|
106
|
+
position: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"before">, import("@scalar/validation").LiteralSchema<"after">]>>;
|
|
107
107
|
color: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
108
108
|
}>>>;
|
|
109
109
|
}>;
|
|
@@ -27,6 +27,6 @@ export type XScalarStability = {
|
|
|
27
27
|
'x-scalar-stability'?: XScalarStabilityValues;
|
|
28
28
|
};
|
|
29
29
|
export declare const XScalarStability: import("@scalar/validation").ObjectSchema<{
|
|
30
|
-
'x-scalar-stability': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<
|
|
30
|
+
'x-scalar-stability': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"deprecated">, import("@scalar/validation").LiteralSchema<"experimental">, import("@scalar/validation").LiteralSchema<"stable">]>>;
|
|
31
31
|
}>;
|
|
32
32
|
//# sourceMappingURL=x-scalar-stability.d.ts.map
|
|
@@ -46,7 +46,7 @@ export type XEnumDescriptions = {
|
|
|
46
46
|
'x-enum-descriptions'?: Record<string, string> | string[];
|
|
47
47
|
};
|
|
48
48
|
export declare const XEnumDescriptions: import("@scalar/validation").ObjectSchema<{
|
|
49
|
-
'x-enumDescriptions': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<
|
|
50
|
-
'x-enum-descriptions': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<
|
|
49
|
+
'x-enumDescriptions': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").StringSchema>, import("@scalar/validation").ArraySchema<import("@scalar/validation").StringSchema>]>>;
|
|
50
|
+
'x-enum-descriptions': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").StringSchema>, import("@scalar/validation").ArraySchema<import("@scalar/validation").StringSchema>]>>;
|
|
51
51
|
}>;
|
|
52
52
|
//# sourceMappingURL=x-enum-descriptions.d.ts.map
|
|
@@ -31,6 +31,6 @@ export type XScalarCredentialsLocation = {
|
|
|
31
31
|
'x-scalar-credentials-location'?: 'header' | 'body';
|
|
32
32
|
};
|
|
33
33
|
export declare const XScalarCredentialsLocation: import("@scalar/validation").ObjectSchema<{
|
|
34
|
-
'x-scalar-credentials-location': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<
|
|
34
|
+
'x-scalar-credentials-location': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"header">, import("@scalar/validation").LiteralSchema<"body">]>>;
|
|
35
35
|
}>;
|
|
36
36
|
//# sourceMappingURL=x-scalar-credentials-location.d.ts.map
|
|
@@ -11,6 +11,6 @@ export type XusePkce = {
|
|
|
11
11
|
'x-usePkce': 'SHA-256' | 'plain' | 'no';
|
|
12
12
|
};
|
|
13
13
|
export declare const XusePkce: import("@scalar/validation").ObjectSchema<{
|
|
14
|
-
'x-usePkce': import("@scalar/validation").UnionSchema<
|
|
14
|
+
'x-usePkce': import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"SHA-256">, import("@scalar/validation").LiteralSchema<"plain">, import("@scalar/validation").LiteralSchema<"no">]>;
|
|
15
15
|
}>;
|
|
16
16
|
//# sourceMappingURL=x-use-pkce.d.ts.map
|
|
@@ -16,6 +16,6 @@ export type XScalarActiveProxy = {
|
|
|
16
16
|
'x-scalar-active-proxy'?: string | null;
|
|
17
17
|
};
|
|
18
18
|
export declare const XScalarActiveProxy: import("@scalar/validation").ObjectSchema<{
|
|
19
|
-
'x-scalar-active-proxy': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<
|
|
19
|
+
'x-scalar-active-proxy': import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").StringSchema, import("@scalar/validation").NullableSchema]>>;
|
|
20
20
|
}>;
|
|
21
21
|
//# sourceMappingURL=x-scalar-active-proxy.d.ts.map
|