@scalar/workspace-store 0.36.0 → 0.38.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 +21 -0
- package/README.md +1 -1
- package/dist/client.d.ts +12 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +21 -3
- package/dist/client.js.map +2 -2
- package/dist/entities/auth/schema.d.ts +98 -0
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/entities/auth/schema.js +6 -1
- package/dist/entities/auth/schema.js.map +2 -2
- package/dist/helpers/apply-selective-updates.d.ts +2 -0
- package/dist/helpers/apply-selective-updates.d.ts.map +1 -1
- package/dist/helpers/apply-selective-updates.js +17 -3
- package/dist/helpers/apply-selective-updates.js.map +2 -2
- package/dist/schemas/extensions/security/index.d.ts +1 -1
- package/dist/schemas/extensions/security/index.d.ts.map +1 -1
- package/dist/schemas/extensions/security/x-scalar-security-secrets.d.ts +16 -0
- package/dist/schemas/extensions/security/x-scalar-security-secrets.d.ts.map +1 -1
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js +4 -0
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js.map +2 -2
- package/dist/schemas/extensions.d.ts +0 -1
- package/dist/schemas/extensions.d.ts.map +1 -1
- package/dist/schemas/extensions.js +1 -2
- package/dist/schemas/extensions.js.map +2 -2
- package/dist/schemas/inmemory-workspace.d.ts +24 -8
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/reference-config/index.d.ts +2 -0
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +2 -0
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +74 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +3 -1
- package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
- package/dist/schemas/workspace.d.ts +14 -37
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/dist/schemas/workspace.js +1 -15
- package/dist/schemas/workspace.js.map +2 -2
- package/dist/server.d.ts +76 -50
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +0 -51
- package/dist/server.js.map +2 -2
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/schemas/v3.1/strict/openapi-document.ts"],
|
|
4
|
-
"sourcesContent": ["import { type TSchema, Type } from '@scalar/typebox'\n\nimport { compose } from '@/schemas/compose'\nimport { extensions } from '@/schemas/extensions'\nimport {\n type XScalarEnvironments,\n xScalarEnvironmentsSchema,\n} from '@/schemas/extensions/document/x-scalar-environments'\nimport { type XScalarIcon, XScalarIconSchema } from '@/schemas/extensions/document/x-scalar-icon'\nimport { type XScalarIsDirty, XScalarIsDirtySchema } from '@/schemas/extensions/document/x-scalar-is-dirty'\nimport {\n type XScalarOriginalDocumentHash,\n XScalarOriginalDocumentHashSchema,\n} from '@/schemas/extensions/document/x-scalar-original-document-hash'\nimport {\n type XScalarActiveEnvironment,\n XScalarActiveEnvironmentSchema,\n} from '@/schemas/extensions/general/x-scalar-active-environment'\nimport { type XScalarCookies, xScalarCookiesSchema } from '@/schemas/extensions/general/x-scalar-cookies'\nimport { type XScalarOrder, XScalarOrderSchema } from '@/schemas/extensions/general/x-scalar-order'\nimport {\n type XScalarSelectedServer,\n XScalarSelectedServerSchema,\n} from '@/schemas/extensions/server/x-scalar-selected-server'\nimport { type XTagGroups, XTagGroupsSchema } from '@/schemas/extensions/tag/x-tag-groups'\nimport {\n TraversedDescriptionSchemaDefinition,\n type TraversedDocument,\n TraversedDocumentSchemaDefinition,\n TraversedEntrySchemaDefinition,\n TraversedOperationSchemaDefinition,\n TraversedSchemaSchemaDefinition,\n TraversedTagSchemaDefinition,\n TraversedWebhookSchemaDefinition,\n} from '@/schemas/navigation'\n\nimport { CallbackObjectSchemaDefinition } from './callback'\nimport { type ComponentsObject, ComponentsObjectSchemaDefinition, SecuritySchemesSchemaDefinition } from './components'\nimport { ContactObjectSchemaDefinition } from './contact'\nimport { DiscriminatorObjectSchemaDefinition } from './discriminator'\nimport { EncodingObjectSchemaDefinition } from './encoding'\nimport { ExampleObjectSchemaDefinition } from './example'\nimport { type ExternalDocumentationObject, ExternalDocumentationObjectSchemaDefinition } from './external-documentation'\nimport { HeaderObjectSchemaDefinition } from './header'\nimport { type InfoObject, InfoObjectSchemaDefinition } from './info'\nimport { LicenseObjectSchemaDefinition } from './license'\nimport { LinkObjectSchemaDefinition } from './link'\nimport { MediaTypeObjectSchemaDefinition } from './media-type'\nimport { OAuthFlowsObjectSchemaDefinition } from './oauthflows'\nimport { OperationObjectSchemaDefinition } from './operation'\nimport { ParameterObjectSchemaDefinition } from './parameter'\nimport { PathItemObjectSchemaDefinition } from './path-item'\nimport { type PathsObject, PathsObjectSchemaDefinition } from './paths'\nimport {\n ComponentsObjectRef,\n ExternalDocumentationObjectRef,\n InfoObjectRef,\n PathItemObjectRef,\n PathsObjectRef,\n REF_DEFINITIONS,\n SecurityRequirementObjectRef,\n ServerObjectRef,\n TagObjectRef,\n TraversedDocumentObjectRef,\n} from './ref-definitions'\nimport { RequestBodyObjectSchemaDefinition } from './request-body'\nimport { ResponseObjectSchemaDefinition } from './response'\nimport { ResponsesObjectSchemaDefinition } from './responses'\nimport { SchemaObjectSchemaDefinition } from './schema'\nimport { type SecurityRequirementObject, SecurityRequirementObjectSchemaDefinition } from './security-requirement'\nimport { SecuritySchemeObjectSchemaDefinition } from './security-scheme'\nimport { type ServerObject, ServerObjectSchemaDefinition } from './server'\nimport { ServerVariableObjectSchemaDefinition } from './server-variable'\nimport { type TagObject, TagObjectSchemaDefinition } from './tag'\nimport { XMLObjectSchemaDefinition } from './xml'\n\nexport const OpenApiExtensionsSchema = compose(\n Type.Partial(\n Type.Object({\n 'x-original-oas-version': Type.String(),\n 'x-scalar-original-source-url': Type.String(),\n [extensions.document.navigation]: TraversedDocumentObjectRef,\n }),\n ),\n XTagGroupsSchema,\n xScalarEnvironmentsSchema,\n XScalarSelectedServerSchema,\n XScalarIconSchema,\n XScalarOrderSchema,\n xScalarCookiesSchema,\n XScalarOriginalDocumentHashSchema,\n XScalarIsDirtySchema,\n XScalarActiveEnvironmentSchema,\n)\n\nexport type OpenAPIExtensions = Partial<{\n 'x-original-oas-version': string\n /** Original document source url / when loading a document from an external source */\n 'x-scalar-original-source-url': string\n [extensions.document.navigation]: TraversedDocument\n}> &\n XScalarOriginalDocumentHash &\n XTagGroups &\n XScalarEnvironments &\n XScalarActiveEnvironment &\n XScalarSelectedServer &\n XScalarIcon &\n XScalarOrder &\n XScalarCookies &\n XScalarIsDirty\n\nconst OpenApiDocumentSchemaDefinition = compose(\n Type.Object({\n /** REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI Document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI Document. This is not related to the API info.version string. */\n openapi: Type.String(),\n /** REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. */\n info: InfoObjectRef,\n /** The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI. */\n jsonSchemaDialect: Type.Optional(Type.String()),\n /** An array of Server Objects, which provide connectivity information to a target server. If the servers field is not provided, or is an empty array, the default value would be a Server Object with a url value of /. */\n servers: Type.Optional(Type.Array(ServerObjectRef)),\n /** The available paths and operations for the API. */\n paths: Type.Optional(PathsObjectRef),\n /** The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An example is available. */\n webhooks: Type.Optional(Type.Record(Type.String(), PathItemObjectRef)),\n /** An element to hold various Objects for the OpenAPI Description. */\n components: Type.Optional(ComponentsObjectRef),\n /** A declaration of which security mechanisms can be used across the API. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. Individual operations can override this definition. The list can be incomplete, up to being empty or absent. To make security explicitly optional, an empty security requirement ({}) can be included in the array. */\n security: Type.Optional(Type.Array(SecurityRequirementObjectRef)),\n /** A list of tags used by the OpenAPI Description with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique. */\n tags: Type.Optional(Type.Array(TagObjectRef)),\n /** Additional external documentation. */\n externalDocs: Type.Optional(ExternalDocumentationObjectRef),\n }),\n OpenApiExtensionsSchema,\n)\n\nexport type OpenApiDocument = {\n /** REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI Document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI Document. This is not related to the API info.version string. */\n openapi: string\n /** REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. */\n info: InfoObject\n /** The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI. */\n jsonSchemaDialect?: string\n /** An array of Server Objects, which provide connectivity information to a target server. If the servers field is not provided, or is an empty array, the default value would be a Server Object with a url value of /. */\n servers?: ServerObject[]\n /** The available paths and operations for the API. */\n paths?: PathsObject\n /** The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An example is available. */\n webhooks?: PathsObject\n /** An element to hold various Objects for the OpenAPI Description. */\n components?: ComponentsObject\n /** A declaration of which security mechanisms can be used across the API. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. Individual operations can override this definition. The list can be incomplete, up to being empty or absent. To make security explicitly optional, an empty security requirement ({}) can be included in the array. */\n security?: SecurityRequirementObject[]\n /** A list of tags used by the OpenAPI Description with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique. */\n tags?: TagObject[]\n /** Additional external documentation. */\n externalDocs?: ExternalDocumentationObject\n} & OpenAPIExtensions\n\n// ----- Module Definition ----\nconst module = Type.Module({\n [REF_DEFINITIONS.ComponentsObject]: ComponentsObjectSchemaDefinition,\n [REF_DEFINITIONS.SecurityRequirementObject]: SecurityRequirementObjectSchemaDefinition,\n [REF_DEFINITIONS.TagObject]: TagObjectSchemaDefinition,\n\n [REF_DEFINITIONS.CallbackObject]: CallbackObjectSchemaDefinition,\n [REF_DEFINITIONS.PathItemObject]: PathItemObjectSchemaDefinition,\n [REF_DEFINITIONS.PathsObject]: PathsObjectSchemaDefinition,\n [REF_DEFINITIONS.OperationObject]: OperationObjectSchemaDefinition,\n\n [REF_DEFINITIONS.SchemaObject]: SchemaObjectSchemaDefinition,\n\n [REF_DEFINITIONS.EncodingObject]: EncodingObjectSchemaDefinition,\n [REF_DEFINITIONS.MediaTypeObject]: MediaTypeObjectSchemaDefinition,\n [REF_DEFINITIONS.HeaderObject]: HeaderObjectSchemaDefinition,\n\n [REF_DEFINITIONS.ServerObject]: ServerObjectSchemaDefinition,\n [REF_DEFINITIONS.ExternalDocumentationObject]: ExternalDocumentationObjectSchemaDefinition,\n\n [REF_DEFINITIONS.InfoObject]: InfoObjectSchemaDefinition,\n [REF_DEFINITIONS.ContactObject]: ContactObjectSchemaDefinition,\n [REF_DEFINITIONS.LicenseObject]: LicenseObjectSchemaDefinition,\n [REF_DEFINITIONS.ResponseObject]: ResponseObjectSchemaDefinition,\n [REF_DEFINITIONS.ResponsesObject]: ResponsesObjectSchemaDefinition,\n [REF_DEFINITIONS.ParameterObject]: ParameterObjectSchemaDefinition,\n [REF_DEFINITIONS.ExampleObject]: ExampleObjectSchemaDefinition,\n [REF_DEFINITIONS.RequestBodyObject]: RequestBodyObjectSchemaDefinition,\n [REF_DEFINITIONS.SecuritySchemes]: SecuritySchemesSchemaDefinition,\n [REF_DEFINITIONS.SecuritySchemeObject]: SecuritySchemeObjectSchemaDefinition,\n [REF_DEFINITIONS.LinkObject]: LinkObjectSchemaDefinition,\n [REF_DEFINITIONS.XMLObject]: XMLObjectSchemaDefinition,\n [REF_DEFINITIONS.DiscriminatorObject]: DiscriminatorObjectSchemaDefinition,\n [REF_DEFINITIONS.OAuthFlowsObject]: OAuthFlowsObjectSchemaDefinition,\n [REF_DEFINITIONS.ServerVariableObject]: ServerVariableObjectSchemaDefinition,\n OpenApiDocument: OpenApiDocumentSchemaDefinition,\n\n // Navigation schemas\n [REF_DEFINITIONS.TraversedDescriptionObject]: TraversedDescriptionSchemaDefinition,\n [REF_DEFINITIONS.TraversedOperationObject]: TraversedOperationSchemaDefinition,\n [REF_DEFINITIONS.TraversedSchemaObject]: TraversedSchemaSchemaDefinition,\n [REF_DEFINITIONS.TraversedWebhookObject]: TraversedWebhookSchemaDefinition,\n [REF_DEFINITIONS.TraversedTagObject]: TraversedTagSchemaDefinition,\n [REF_DEFINITIONS.TraversedEntryObject]: TraversedEntrySchemaDefinition,\n [REF_DEFINITIONS.TraversedDocumentObject]: TraversedDocumentSchemaDefinition,\n\n // Enforces that all references are included in the module\n} satisfies Record<keyof typeof REF_DEFINITIONS, TSchema> & Record<'OpenApiDocument', TSchema>)\n\n// ----- Schemas ----\nexport const OpenAPIDocumentSchema = module.Import('OpenApiDocument')\n\nexport const ComponentsObjectSchema = module.Import('ComponentsObject')\nexport const SecurityRequirementObjectSchema = module.Import('SecurityRequirementObject')\nexport const TagObjectSchema = module.Import('TagObject')\n\nexport const CallbackObjectSchema = module.Import('CallbackObject')\nexport const PathItemObjectSchema = module.Import('PathItemObject')\nexport const PathsObjectSchema = module.Import('PathsObject')\nexport const OperationObjectSchema = module.Import('OperationObject')\n\nexport const SchemaObjectSchema = module.Import('SchemaObject')\n\nexport const EncodingObjectSchema = module.Import('EncodingObject')\nexport const MediaTypeObjectSchema = module.Import('MediaTypeObject')\nexport const HeaderObjectSchema = module.Import('HeaderObject')\n\nexport const ServerObjectSchema = module.Import('ServerObject')\nexport const ExternalDocumentationObjectSchema = module.Import('ExternalDocumentationObject')\n\nexport const InfoObjectSchema = module.Import('InfoObject')\nexport const ContactObjectSchema = module.Import('ContactObject')\nexport const LicenseObjectSchema = module.Import('LicenseObject')\nexport const ResponseObjectSchema = module.Import('ResponseObject')\nexport const ResponsesObjectSchema = module.Import('ResponsesObject')\nexport const ParameterObjectSchema = module.Import('ParameterObject')\nexport const ExampleObjectSchema = module.Import('ExampleObject')\nexport const RequestBodyObjectSchema = module.Import('RequestBodyObject')\nexport const SecuritySchemesSchema = module.Import('SecuritySchemes')\nexport const SecuritySchemeObjectSchema = module.Import('SecuritySchemeObject')\nexport const LinkObjectSchema = module.Import('LinkObject')\nexport const XMLObjectSchema = module.Import('XMLObject')\nexport const DiscriminatorObjectSchema = module.Import('DiscriminatorObject')\nexport const OAuthFlowsObjectSchema = module.Import('OAuthFlowsObject')\nexport const ServerVariableObjectSchema = module.Import('ServerVariableObject')\n\nexport const TraversedDescriptionSchema = module.Import('TraversedDescriptionObject')\nexport const TraversedEntrySchema = module.Import('TraversedEntryObject')\nexport const TraversedTagSchema = module.Import('TraversedTagObject')\nexport const TraversedOperationSchema = module.Import('TraversedOperationObject')\nexport const TraversedSchemaSchema = module.Import('TraversedSchemaObject')\nexport const TraversedWebhookSchema = module.Import('TraversedWebhookObject')\n\n// ----- Type re-exports ----\nexport type { ExternalDocumentationObject }\nexport type { InfoObject }\nexport type { PathsObject }\nexport type { SecurityRequirementObject }\nexport type { ServerObject }\nexport type { TagObject }\n\nexport type { CallbackObject } from './callback'\nexport type { ComponentsObject, SecuritySchemes } from './components'\nexport type { ContactObject } from './contact'\nexport type { DiscriminatorObject } from './discriminator'\nexport type { EncodingObject } from './encoding'\nexport type { ExampleObject } from './example'\nexport type { HeaderObject } from './header'\nexport type { LicenseObject } from './license'\nexport type { LinkObject } from './link'\nexport type { MediaTypeObject } from './media-type'\nexport type { OAuthFlow } from './oauth-flow'\nexport type { OAuthFlowsObject } from './oauthflows'\nexport type { OperationObject } from './operation'\nexport type { ParameterObject, ParameterWithContentObject, ParameterWithSchemaObject } from './parameter'\nexport type { PathItemObject } from './path-item'\nexport type { ReferenceType } from './reference'\nexport type { RequestBodyObject } from './request-body'\nexport type { ResponseObject } from './response'\nexport type { ResponsesObject } from './responses'\nexport type { SchemaObject, SchemaReferenceType } from './schema'\nexport type {\n ApiKeyObject,\n HttpObject,\n OAuth2Object,\n OpenIdConnectObject,\n SecuritySchemeObject,\n} from './security-scheme'\nexport type { ServerVariableObject } from './server-variable'\nexport type { XMLObject } from './xml'\n"],
|
|
5
|
-
"mappings": "AAAA,SAAuB,YAAY;AAEnC,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B;AAAA,EAEE;AAAA,OACK;AACP,SAA2B,yBAAyB;AACpD,SAA8B,4BAA4B;AAC1D;AAAA,EAEE;AAAA,OACK;AACP;AAAA,EAEE;AAAA,OACK;AACP,SAA8B,4BAA4B;AAC1D,SAA4B,0BAA0B;AACtD;AAAA,EAEE;AAAA,OACK;AACP,SAA0B,wBAAwB;AAClD;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,sCAAsC;AAC/C,SAAgC,kCAAkC,uCAAuC;AACzG,SAAS,qCAAqC;AAC9C,SAAS,2CAA2C;AACpD,SAAS,sCAAsC;AAC/C,SAAS,qCAAqC;AAC9C,SAA2C,mDAAmD;AAC9F,SAAS,oCAAoC;AAC7C,SAA0B,kCAAkC;AAC5D,SAAS,qCAAqC;AAC9C,SAAS,kCAAkC;AAC3C,SAAS,uCAAuC;AAChD,SAAS,wCAAwC;AACjD,SAAS,uCAAuC;AAChD,SAAS,uCAAuC;AAChD,SAAS,sCAAsC;AAC/C,SAA2B,mCAAmC;AAC9D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yCAAyC;AAClD,SAAS,sCAAsC;AAC/C,SAAS,uCAAuC;AAChD,SAAS,oCAAoC;AAC7C,SAAyC,iDAAiD;AAC1F,SAAS,4CAA4C;AACrD,SAA4B,oCAAoC;AAChE,SAAS,4CAA4C;AACrD,SAAyB,iCAAiC;AAC1D,SAAS,iCAAiC;AAEnC,MAAM,0BAA0B;AAAA,EACrC,KAAK;AAAA,IACH,KAAK,OAAO;AAAA,MACV,0BAA0B,KAAK,OAAO;AAAA,MACtC,gCAAgC,KAAK,OAAO;AAAA,MAC5C,CAAC,WAAW,SAAS,UAAU,GAAG;AAAA,IACpC,CAAC;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;
|
|
4
|
+
"sourcesContent": ["import { type TSchema, Type } from '@scalar/typebox'\n\nimport { compose } from '@/schemas/compose'\nimport { extensions } from '@/schemas/extensions'\nimport {\n type XScalarEnvironments,\n xScalarEnvironmentsSchema,\n} from '@/schemas/extensions/document/x-scalar-environments'\nimport { type XScalarIcon, XScalarIconSchema } from '@/schemas/extensions/document/x-scalar-icon'\nimport { type XScalarIsDirty, XScalarIsDirtySchema } from '@/schemas/extensions/document/x-scalar-is-dirty'\nimport {\n type XScalarOriginalDocumentHash,\n XScalarOriginalDocumentHashSchema,\n} from '@/schemas/extensions/document/x-scalar-original-document-hash'\nimport { type XScalarWatchMode, XScalarWatchModeSchema } from '@/schemas/extensions/document/x-scalar-watch-mode'\nimport {\n type XScalarActiveEnvironment,\n XScalarActiveEnvironmentSchema,\n} from '@/schemas/extensions/general/x-scalar-active-environment'\nimport { type XScalarCookies, xScalarCookiesSchema } from '@/schemas/extensions/general/x-scalar-cookies'\nimport { type XScalarOrder, XScalarOrderSchema } from '@/schemas/extensions/general/x-scalar-order'\nimport {\n type XScalarSelectedServer,\n XScalarSelectedServerSchema,\n} from '@/schemas/extensions/server/x-scalar-selected-server'\nimport { type XTagGroups, XTagGroupsSchema } from '@/schemas/extensions/tag/x-tag-groups'\nimport {\n TraversedDescriptionSchemaDefinition,\n type TraversedDocument,\n TraversedDocumentSchemaDefinition,\n TraversedEntrySchemaDefinition,\n TraversedOperationSchemaDefinition,\n TraversedSchemaSchemaDefinition,\n TraversedTagSchemaDefinition,\n TraversedWebhookSchemaDefinition,\n} from '@/schemas/navigation'\n\nimport { CallbackObjectSchemaDefinition } from './callback'\nimport { type ComponentsObject, ComponentsObjectSchemaDefinition, SecuritySchemesSchemaDefinition } from './components'\nimport { ContactObjectSchemaDefinition } from './contact'\nimport { DiscriminatorObjectSchemaDefinition } from './discriminator'\nimport { EncodingObjectSchemaDefinition } from './encoding'\nimport { ExampleObjectSchemaDefinition } from './example'\nimport { type ExternalDocumentationObject, ExternalDocumentationObjectSchemaDefinition } from './external-documentation'\nimport { HeaderObjectSchemaDefinition } from './header'\nimport { type InfoObject, InfoObjectSchemaDefinition } from './info'\nimport { LicenseObjectSchemaDefinition } from './license'\nimport { LinkObjectSchemaDefinition } from './link'\nimport { MediaTypeObjectSchemaDefinition } from './media-type'\nimport { OAuthFlowsObjectSchemaDefinition } from './oauthflows'\nimport { OperationObjectSchemaDefinition } from './operation'\nimport { ParameterObjectSchemaDefinition } from './parameter'\nimport { PathItemObjectSchemaDefinition } from './path-item'\nimport { type PathsObject, PathsObjectSchemaDefinition } from './paths'\nimport {\n ComponentsObjectRef,\n ExternalDocumentationObjectRef,\n InfoObjectRef,\n PathItemObjectRef,\n PathsObjectRef,\n REF_DEFINITIONS,\n SecurityRequirementObjectRef,\n ServerObjectRef,\n TagObjectRef,\n TraversedDocumentObjectRef,\n} from './ref-definitions'\nimport { RequestBodyObjectSchemaDefinition } from './request-body'\nimport { ResponseObjectSchemaDefinition } from './response'\nimport { ResponsesObjectSchemaDefinition } from './responses'\nimport { SchemaObjectSchemaDefinition } from './schema'\nimport { type SecurityRequirementObject, SecurityRequirementObjectSchemaDefinition } from './security-requirement'\nimport { SecuritySchemeObjectSchemaDefinition } from './security-scheme'\nimport { type ServerObject, ServerObjectSchemaDefinition } from './server'\nimport { ServerVariableObjectSchemaDefinition } from './server-variable'\nimport { type TagObject, TagObjectSchemaDefinition } from './tag'\nimport { XMLObjectSchemaDefinition } from './xml'\n\nexport const OpenApiExtensionsSchema = compose(\n Type.Partial(\n Type.Object({\n 'x-original-oas-version': Type.String(),\n 'x-scalar-original-source-url': Type.String(),\n [extensions.document.navigation]: TraversedDocumentObjectRef,\n }),\n ),\n XTagGroupsSchema,\n xScalarEnvironmentsSchema,\n XScalarSelectedServerSchema,\n XScalarIconSchema,\n XScalarOrderSchema,\n xScalarCookiesSchema,\n XScalarOriginalDocumentHashSchema,\n XScalarIsDirtySchema,\n XScalarActiveEnvironmentSchema,\n XScalarWatchModeSchema,\n)\n\nexport type OpenAPIExtensions = Partial<{\n 'x-original-oas-version': string\n /** Original document source url / when loading a document from an external source */\n 'x-scalar-original-source-url': string\n [extensions.document.navigation]: TraversedDocument\n}> &\n XScalarOriginalDocumentHash &\n XTagGroups &\n XScalarEnvironments &\n XScalarActiveEnvironment &\n XScalarSelectedServer &\n XScalarIcon &\n XScalarOrder &\n XScalarCookies &\n XScalarIsDirty &\n XScalarWatchMode\n\nconst OpenApiDocumentSchemaDefinition = compose(\n Type.Object({\n /** REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI Document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI Document. This is not related to the API info.version string. */\n openapi: Type.String(),\n /** REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. */\n info: InfoObjectRef,\n /** The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI. */\n jsonSchemaDialect: Type.Optional(Type.String()),\n /** An array of Server Objects, which provide connectivity information to a target server. If the servers field is not provided, or is an empty array, the default value would be a Server Object with a url value of /. */\n servers: Type.Optional(Type.Array(ServerObjectRef)),\n /** The available paths and operations for the API. */\n paths: Type.Optional(PathsObjectRef),\n /** The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An example is available. */\n webhooks: Type.Optional(Type.Record(Type.String(), PathItemObjectRef)),\n /** An element to hold various Objects for the OpenAPI Description. */\n components: Type.Optional(ComponentsObjectRef),\n /** A declaration of which security mechanisms can be used across the API. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. Individual operations can override this definition. The list can be incomplete, up to being empty or absent. To make security explicitly optional, an empty security requirement ({}) can be included in the array. */\n security: Type.Optional(Type.Array(SecurityRequirementObjectRef)),\n /** A list of tags used by the OpenAPI Description with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique. */\n tags: Type.Optional(Type.Array(TagObjectRef)),\n /** Additional external documentation. */\n externalDocs: Type.Optional(ExternalDocumentationObjectRef),\n }),\n OpenApiExtensionsSchema,\n)\n\nexport type OpenApiDocument = {\n /** REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI Document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI Document. This is not related to the API info.version string. */\n openapi: string\n /** REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. */\n info: InfoObject\n /** The default value for the $schema keyword within Schema Objects contained within this OAS document. This MUST be in the form of a URI. */\n jsonSchemaDialect?: string\n /** An array of Server Objects, which provide connectivity information to a target server. If the servers field is not provided, or is an empty array, the default value would be a Server Object with a url value of /. */\n servers?: ServerObject[]\n /** The available paths and operations for the API. */\n paths?: PathsObject\n /** The incoming webhooks that MAY be received as part of this API and that the API consumer MAY choose to implement. Closely related to the callbacks feature, this section describes requests initiated other than by an API call, for example by an out of band registration. The key name is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object describes a request that may be initiated by the API provider and the expected responses. An example is available. */\n webhooks?: PathsObject\n /** An element to hold various Objects for the OpenAPI Description. */\n components?: ComponentsObject\n /** A declaration of which security mechanisms can be used across the API. The list of values includes alternative Security Requirement Objects that can be used. Only one of the Security Requirement Objects need to be satisfied to authorize a request. Individual operations can override this definition. The list can be incomplete, up to being empty or absent. To make security explicitly optional, an empty security requirement ({}) can be included in the array. */\n security?: SecurityRequirementObject[]\n /** A list of tags used by the OpenAPI Description with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique. */\n tags?: TagObject[]\n /** Additional external documentation. */\n externalDocs?: ExternalDocumentationObject\n} & OpenAPIExtensions\n\n// ----- Module Definition ----\nconst module = Type.Module({\n [REF_DEFINITIONS.ComponentsObject]: ComponentsObjectSchemaDefinition,\n [REF_DEFINITIONS.SecurityRequirementObject]: SecurityRequirementObjectSchemaDefinition,\n [REF_DEFINITIONS.TagObject]: TagObjectSchemaDefinition,\n\n [REF_DEFINITIONS.CallbackObject]: CallbackObjectSchemaDefinition,\n [REF_DEFINITIONS.PathItemObject]: PathItemObjectSchemaDefinition,\n [REF_DEFINITIONS.PathsObject]: PathsObjectSchemaDefinition,\n [REF_DEFINITIONS.OperationObject]: OperationObjectSchemaDefinition,\n\n [REF_DEFINITIONS.SchemaObject]: SchemaObjectSchemaDefinition,\n\n [REF_DEFINITIONS.EncodingObject]: EncodingObjectSchemaDefinition,\n [REF_DEFINITIONS.MediaTypeObject]: MediaTypeObjectSchemaDefinition,\n [REF_DEFINITIONS.HeaderObject]: HeaderObjectSchemaDefinition,\n\n [REF_DEFINITIONS.ServerObject]: ServerObjectSchemaDefinition,\n [REF_DEFINITIONS.ExternalDocumentationObject]: ExternalDocumentationObjectSchemaDefinition,\n\n [REF_DEFINITIONS.InfoObject]: InfoObjectSchemaDefinition,\n [REF_DEFINITIONS.ContactObject]: ContactObjectSchemaDefinition,\n [REF_DEFINITIONS.LicenseObject]: LicenseObjectSchemaDefinition,\n [REF_DEFINITIONS.ResponseObject]: ResponseObjectSchemaDefinition,\n [REF_DEFINITIONS.ResponsesObject]: ResponsesObjectSchemaDefinition,\n [REF_DEFINITIONS.ParameterObject]: ParameterObjectSchemaDefinition,\n [REF_DEFINITIONS.ExampleObject]: ExampleObjectSchemaDefinition,\n [REF_DEFINITIONS.RequestBodyObject]: RequestBodyObjectSchemaDefinition,\n [REF_DEFINITIONS.SecuritySchemes]: SecuritySchemesSchemaDefinition,\n [REF_DEFINITIONS.SecuritySchemeObject]: SecuritySchemeObjectSchemaDefinition,\n [REF_DEFINITIONS.LinkObject]: LinkObjectSchemaDefinition,\n [REF_DEFINITIONS.XMLObject]: XMLObjectSchemaDefinition,\n [REF_DEFINITIONS.DiscriminatorObject]: DiscriminatorObjectSchemaDefinition,\n [REF_DEFINITIONS.OAuthFlowsObject]: OAuthFlowsObjectSchemaDefinition,\n [REF_DEFINITIONS.ServerVariableObject]: ServerVariableObjectSchemaDefinition,\n OpenApiDocument: OpenApiDocumentSchemaDefinition,\n\n // Navigation schemas\n [REF_DEFINITIONS.TraversedDescriptionObject]: TraversedDescriptionSchemaDefinition,\n [REF_DEFINITIONS.TraversedOperationObject]: TraversedOperationSchemaDefinition,\n [REF_DEFINITIONS.TraversedSchemaObject]: TraversedSchemaSchemaDefinition,\n [REF_DEFINITIONS.TraversedWebhookObject]: TraversedWebhookSchemaDefinition,\n [REF_DEFINITIONS.TraversedTagObject]: TraversedTagSchemaDefinition,\n [REF_DEFINITIONS.TraversedEntryObject]: TraversedEntrySchemaDefinition,\n [REF_DEFINITIONS.TraversedDocumentObject]: TraversedDocumentSchemaDefinition,\n\n // Enforces that all references are included in the module\n} satisfies Record<keyof typeof REF_DEFINITIONS, TSchema> & Record<'OpenApiDocument', TSchema>)\n\n// ----- Schemas ----\nexport const OpenAPIDocumentSchema = module.Import('OpenApiDocument')\n\nexport const ComponentsObjectSchema = module.Import('ComponentsObject')\nexport const SecurityRequirementObjectSchema = module.Import('SecurityRequirementObject')\nexport const TagObjectSchema = module.Import('TagObject')\n\nexport const CallbackObjectSchema = module.Import('CallbackObject')\nexport const PathItemObjectSchema = module.Import('PathItemObject')\nexport const PathsObjectSchema = module.Import('PathsObject')\nexport const OperationObjectSchema = module.Import('OperationObject')\n\nexport const SchemaObjectSchema = module.Import('SchemaObject')\n\nexport const EncodingObjectSchema = module.Import('EncodingObject')\nexport const MediaTypeObjectSchema = module.Import('MediaTypeObject')\nexport const HeaderObjectSchema = module.Import('HeaderObject')\n\nexport const ServerObjectSchema = module.Import('ServerObject')\nexport const ExternalDocumentationObjectSchema = module.Import('ExternalDocumentationObject')\n\nexport const InfoObjectSchema = module.Import('InfoObject')\nexport const ContactObjectSchema = module.Import('ContactObject')\nexport const LicenseObjectSchema = module.Import('LicenseObject')\nexport const ResponseObjectSchema = module.Import('ResponseObject')\nexport const ResponsesObjectSchema = module.Import('ResponsesObject')\nexport const ParameterObjectSchema = module.Import('ParameterObject')\nexport const ExampleObjectSchema = module.Import('ExampleObject')\nexport const RequestBodyObjectSchema = module.Import('RequestBodyObject')\nexport const SecuritySchemesSchema = module.Import('SecuritySchemes')\nexport const SecuritySchemeObjectSchema = module.Import('SecuritySchemeObject')\nexport const LinkObjectSchema = module.Import('LinkObject')\nexport const XMLObjectSchema = module.Import('XMLObject')\nexport const DiscriminatorObjectSchema = module.Import('DiscriminatorObject')\nexport const OAuthFlowsObjectSchema = module.Import('OAuthFlowsObject')\nexport const ServerVariableObjectSchema = module.Import('ServerVariableObject')\n\nexport const TraversedDescriptionSchema = module.Import('TraversedDescriptionObject')\nexport const TraversedEntrySchema = module.Import('TraversedEntryObject')\nexport const TraversedTagSchema = module.Import('TraversedTagObject')\nexport const TraversedOperationSchema = module.Import('TraversedOperationObject')\nexport const TraversedSchemaSchema = module.Import('TraversedSchemaObject')\nexport const TraversedWebhookSchema = module.Import('TraversedWebhookObject')\n\n// ----- Type re-exports ----\nexport type { ExternalDocumentationObject }\nexport type { InfoObject }\nexport type { PathsObject }\nexport type { SecurityRequirementObject }\nexport type { ServerObject }\nexport type { TagObject }\n\nexport type { CallbackObject } from './callback'\nexport type { ComponentsObject, SecuritySchemes } from './components'\nexport type { ContactObject } from './contact'\nexport type { DiscriminatorObject } from './discriminator'\nexport type { EncodingObject } from './encoding'\nexport type { ExampleObject } from './example'\nexport type { HeaderObject } from './header'\nexport type { LicenseObject } from './license'\nexport type { LinkObject } from './link'\nexport type { MediaTypeObject } from './media-type'\nexport type { OAuthFlow } from './oauth-flow'\nexport type { OAuthFlowsObject } from './oauthflows'\nexport type { OperationObject } from './operation'\nexport type { ParameterObject, ParameterWithContentObject, ParameterWithSchemaObject } from './parameter'\nexport type { PathItemObject } from './path-item'\nexport type { ReferenceType } from './reference'\nexport type { RequestBodyObject } from './request-body'\nexport type { ResponseObject } from './response'\nexport type { ResponsesObject } from './responses'\nexport type { SchemaObject, SchemaReferenceType } from './schema'\nexport type {\n ApiKeyObject,\n HttpObject,\n OAuth2Object,\n OpenIdConnectObject,\n SecuritySchemeObject,\n} from './security-scheme'\nexport type { ServerVariableObject } from './server-variable'\nexport type { XMLObject } from './xml'\n"],
|
|
5
|
+
"mappings": "AAAA,SAAuB,YAAY;AAEnC,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B;AAAA,EAEE;AAAA,OACK;AACP,SAA2B,yBAAyB;AACpD,SAA8B,4BAA4B;AAC1D;AAAA,EAEE;AAAA,OACK;AACP,SAAgC,8BAA8B;AAC9D;AAAA,EAEE;AAAA,OACK;AACP,SAA8B,4BAA4B;AAC1D,SAA4B,0BAA0B;AACtD;AAAA,EAEE;AAAA,OACK;AACP,SAA0B,wBAAwB;AAClD;AAAA,EACE;AAAA,EA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AAc;AACvD,MAAM,oCAAoC,OAAO,OAAO,6BAA6B;AAErF,MAAM,mBAAmB,OAAO,OAAO,YAAY;AACnD,MAAM,sBAAsB,OAAO,OAAO,eAAe;AACzD,MAAM,sBAAsB,OAAO,OAAO,eAAe;AACzD,MAAM,uBAAuB,OAAO,OAAO,gBAAgB;AAC3D,MAAM,wBAAwB,OAAO,OAAO,iBAAiB;AAC7D,MAAM,wBAAwB,OAAO,OAAO,iBAAiB;AAC7D,MAAM,sBAAsB,OAAO,OAAO,eAAe;AACzD,MAAM,0BAA0B,OAAO,OAAO,mBAAmB;AACjE,MAAM,wBAAwB,OAAO,OAAO,iBAAiB;AAC7D,MAAM,6BAA6B,OAAO,OAAO,sBAAsB;AACvE,MAAM,mBAAmB,OAAO,OAAO,YAAY;AACnD,MAAM,kBAAkB,OAAO,OAAO,WAAW;AACjD,MAAM,4BAA4B,OAAO,OAAO,qBAAqB;AACrE,MAAM,yBAAyB,OAAO,OAAO,kBAAkB;AAC/D,MAAM,6BAA6B,OAAO,OAAO,sBAAsB;AAEvE,MAAM,6BAA6B,OAAO,OAAO,4BAA4B;AAC7E,MAAM,uBAAuB,OAAO,OAAO,sBAAsB;AACjE,MAAM,qBAAqB,OAAO,OAAO,oBAAoB;AAC7D,MAAM,2BAA2B,OAAO,OAAO,0BAA0B;AACzE,MAAM,wBAAwB,OAAO,OAAO,uBAAuB;AACnE,MAAM,yBAAyB,OAAO,OAAO,wBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
import { type AvailableClients } from '@scalar/types/snippetz';
|
|
2
2
|
import { extensions } from '../schemas/extensions.js';
|
|
3
3
|
import { type XScalarEnvironments } from '../schemas/extensions/document/x-scalar-environments.js';
|
|
4
|
-
import { type XScalarWatchMode } from '../schemas/extensions/document/x-scalar-watch-mode.js';
|
|
5
4
|
import { type XScalarActiveEnvironment } from '../schemas/extensions/general/x-scalar-active-environment.js';
|
|
6
5
|
import { type XScalarCookies } from '../schemas/extensions/general/x-scalar-cookies.js';
|
|
7
6
|
import { type XScalarOrder } from '../schemas/extensions/general/x-scalar-order.js';
|
|
8
|
-
import { type XScalarSelectedServer } from '../schemas/extensions/server/x-scalar-selected-server.js';
|
|
9
7
|
import { type XScalarActiveProxy } from '../schemas/extensions/workspace/x-scalar-active-proxy.js';
|
|
10
8
|
import { type XScalarTabs } from '../schemas/extensions/workspace/x-scalar-tabs.js';
|
|
11
9
|
import { type OpenAPIExtensions, type OpenApiDocument } from './v3.1/strict/openapi-document.js';
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
}>, import("@scalar/typebox").TObject<{
|
|
15
|
-
'x-scalar-selected-server': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
16
|
-
}>, import("@scalar/typebox").TObject<{
|
|
17
|
-
'x-scalar-watch-mode': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
18
|
-
}>]>;
|
|
19
|
-
export type WorkspaceDocumentMeta = {
|
|
20
|
-
[extensions.document.activeAuth]?: string;
|
|
21
|
-
} & XScalarSelectedServer & XScalarWatchMode;
|
|
22
|
-
export declare const WorkspaceDocumentSchema: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
23
|
-
"x-scalar-active-auth": import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
24
|
-
}>, import("@scalar/typebox").TObject<{
|
|
25
|
-
'x-scalar-selected-server': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
26
|
-
}>, import("@scalar/typebox").TObject<{
|
|
27
|
-
'x-scalar-watch-mode': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
28
|
-
}>]>, import("@scalar/typebox").TImport<{
|
|
10
|
+
export type WorkspaceDocumentMeta = Omit<OpenAPIExtensions, 'x-original-oas-version' | 'x-scalar-original-source-url' | 'x-scalar-original-document-hash'>;
|
|
11
|
+
export declare const WorkspaceDocumentSchema: import("@scalar/typebox").TImport<{
|
|
29
12
|
ComponentsObject: import("@scalar/typebox").TObject<{
|
|
30
13
|
schemas: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"SchemaObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
31
14
|
$ref: import("@scalar/typebox").TString;
|
|
@@ -1300,6 +1283,8 @@ export declare const WorkspaceDocumentSchema: import("@scalar/typebox").TInterse
|
|
|
1300
1283
|
'x-scalar-is-dirty': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
1301
1284
|
}>, import("@scalar/typebox").TObject<{
|
|
1302
1285
|
'x-scalar-active-environment': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1286
|
+
}>, import("@scalar/typebox").TObject<{
|
|
1287
|
+
'x-scalar-watch-mode': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
1303
1288
|
}>]>]>;
|
|
1304
1289
|
TraversedDescriptionObject: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
1305
1290
|
id: import("@scalar/typebox").TString;
|
|
@@ -1423,8 +1408,8 @@ export declare const WorkspaceDocumentSchema: import("@scalar/typebox").TInterse
|
|
|
1423
1408
|
children: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TRef<"TraversedEntryObject">>>;
|
|
1424
1409
|
icon: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1425
1410
|
}>]>;
|
|
1426
|
-
}, "OpenApiDocument"
|
|
1427
|
-
export type WorkspaceDocument =
|
|
1411
|
+
}, "OpenApiDocument">;
|
|
1412
|
+
export type WorkspaceDocument = OpenApiDocument;
|
|
1428
1413
|
export declare const ColorModeSchema: import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"system">, import("@scalar/typebox").TLiteral<"light">, import("@scalar/typebox").TLiteral<"dark">]>;
|
|
1429
1414
|
export declare const WorkspaceMetaSchema: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
1430
1415
|
"x-scalar-color-mode": import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"system">, import("@scalar/typebox").TLiteral<"light">, import("@scalar/typebox").TLiteral<"dark">]>>;
|
|
@@ -1485,13 +1470,7 @@ export declare const WorkspaceSchema: import("@scalar/typebox").TIntersect<[impo
|
|
|
1485
1470
|
}>, import("@scalar/typebox").TObject<{
|
|
1486
1471
|
'x-scalar-active-proxy': import("@scalar/typebox").TOptional<import("@scalar/typebox").TUnion<[import("@scalar/typebox").TString, import("@scalar/typebox").TNull]>>;
|
|
1487
1472
|
}>]>, import("@scalar/typebox").TObject<{
|
|
1488
|
-
documents: import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").
|
|
1489
|
-
"x-scalar-active-auth": import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1490
|
-
}>, import("@scalar/typebox").TObject<{
|
|
1491
|
-
'x-scalar-selected-server': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1492
|
-
}>, import("@scalar/typebox").TObject<{
|
|
1493
|
-
'x-scalar-watch-mode': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
1494
|
-
}>]>, import("@scalar/typebox").TImport<{
|
|
1473
|
+
documents: import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TImport<{
|
|
1495
1474
|
ComponentsObject: import("@scalar/typebox").TObject<{
|
|
1496
1475
|
schemas: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"SchemaObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
1497
1476
|
$ref: import("@scalar/typebox").TString;
|
|
@@ -2766,6 +2745,8 @@ export declare const WorkspaceSchema: import("@scalar/typebox").TIntersect<[impo
|
|
|
2766
2745
|
'x-scalar-is-dirty': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
2767
2746
|
}>, import("@scalar/typebox").TObject<{
|
|
2768
2747
|
'x-scalar-active-environment': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
2748
|
+
}>, import("@scalar/typebox").TObject<{
|
|
2749
|
+
'x-scalar-watch-mode': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
2769
2750
|
}>]>]>;
|
|
2770
2751
|
TraversedDescriptionObject: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
2771
2752
|
id: import("@scalar/typebox").TString;
|
|
@@ -2889,15 +2870,9 @@ export declare const WorkspaceSchema: import("@scalar/typebox").TIntersect<[impo
|
|
|
2889
2870
|
children: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TRef<"TraversedEntryObject">>>;
|
|
2890
2871
|
icon: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
2891
2872
|
}>]>;
|
|
2892
|
-
}, "OpenApiDocument"
|
|
2873
|
+
}, "OpenApiDocument">>;
|
|
2893
2874
|
/** Active document is possibly undefined if we attempt to lookup with an invalid key */
|
|
2894
|
-
activeDocument: import("@scalar/typebox").TUnion<[import("@scalar/typebox").TUndefined, import("@scalar/typebox").
|
|
2895
|
-
"x-scalar-active-auth": import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
2896
|
-
}>, import("@scalar/typebox").TObject<{
|
|
2897
|
-
'x-scalar-selected-server': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
2898
|
-
}>, import("@scalar/typebox").TObject<{
|
|
2899
|
-
'x-scalar-watch-mode': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
2900
|
-
}>]>, import("@scalar/typebox").TImport<{
|
|
2875
|
+
activeDocument: import("@scalar/typebox").TUnion<[import("@scalar/typebox").TUndefined, import("@scalar/typebox").TImport<{
|
|
2901
2876
|
ComponentsObject: import("@scalar/typebox").TObject<{
|
|
2902
2877
|
schemas: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TUnion<[import("@scalar/typebox").TRef<"SchemaObject">, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
2903
2878
|
$ref: import("@scalar/typebox").TString;
|
|
@@ -4172,6 +4147,8 @@ export declare const WorkspaceSchema: import("@scalar/typebox").TIntersect<[impo
|
|
|
4172
4147
|
'x-scalar-is-dirty': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
4173
4148
|
}>, import("@scalar/typebox").TObject<{
|
|
4174
4149
|
'x-scalar-active-environment': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
4150
|
+
}>, import("@scalar/typebox").TObject<{
|
|
4151
|
+
'x-scalar-watch-mode': import("@scalar/typebox").TOptional<import("@scalar/typebox").TBoolean>;
|
|
4175
4152
|
}>]>]>;
|
|
4176
4153
|
TraversedDescriptionObject: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
4177
4154
|
id: import("@scalar/typebox").TString;
|
|
@@ -4295,7 +4272,7 @@ export declare const WorkspaceSchema: import("@scalar/typebox").TIntersect<[impo
|
|
|
4295
4272
|
children: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TRef<"TraversedEntryObject">>>;
|
|
4296
4273
|
icon: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
4297
4274
|
}>]>;
|
|
4298
|
-
}, "OpenApiDocument">]
|
|
4275
|
+
}, "OpenApiDocument">]>;
|
|
4299
4276
|
}>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
4300
4277
|
'x-scalar-environments': import("@scalar/typebox").TOptional<import("@scalar/typebox").TRecord<import("@scalar/typebox").TString, import("@scalar/typebox").TObject<{
|
|
4301
4278
|
description: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/schemas/workspace.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGjF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/schemas/workspace.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGjF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,0DAA0D,CAAA;AACjE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,+CAA+C,CAAA;AACzG,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,6CAA6C,CAAA;AACnG,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,sDAAsD,CAAA;AACxH,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,8CAA8C,CAAA;AAElG,OAAO,EAAyB,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEpH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,iBAAiB,EACjB,wBAAwB,GAAG,8BAA8B,GAAG,iCAAiC,CAC9F,CAAA;AAGD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;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MAAM,sBAAsB,GAAG,qBAAqB,GAAG,iBAAiB,CAAA"}
|
|
@@ -5,28 +5,15 @@ import { extensions } from "../schemas/extensions.js";
|
|
|
5
5
|
import {
|
|
6
6
|
xScalarEnvironmentsSchema
|
|
7
7
|
} from "../schemas/extensions/document/x-scalar-environments.js";
|
|
8
|
-
import { XScalarWatchModeSchema } from "../schemas/extensions/document/x-scalar-watch-mode.js";
|
|
9
8
|
import {
|
|
10
9
|
XScalarActiveEnvironmentSchema
|
|
11
10
|
} from "../schemas/extensions/general/x-scalar-active-environment.js";
|
|
12
11
|
import { xScalarCookiesSchema } from "../schemas/extensions/general/x-scalar-cookies.js";
|
|
13
12
|
import { XScalarOrderSchema } from "../schemas/extensions/general/x-scalar-order.js";
|
|
14
|
-
import {
|
|
15
|
-
XScalarSelectedServerSchema
|
|
16
|
-
} from "../schemas/extensions/server/x-scalar-selected-server.js";
|
|
17
13
|
import { XScalarActiveProxySchema } from "../schemas/extensions/workspace/x-scalar-active-proxy.js";
|
|
18
14
|
import { XScalarTabsSchema } from "../schemas/extensions/workspace/x-scalar-tabs.js";
|
|
19
15
|
import { OpenAPIDocumentSchema } from "./v3.1/strict/openapi-document.js";
|
|
20
|
-
const
|
|
21
|
-
Type.Partial(
|
|
22
|
-
Type.Object({
|
|
23
|
-
[extensions.document.activeAuth]: Type.String()
|
|
24
|
-
})
|
|
25
|
-
),
|
|
26
|
-
XScalarSelectedServerSchema,
|
|
27
|
-
XScalarWatchModeSchema
|
|
28
|
-
);
|
|
29
|
-
const WorkspaceDocumentSchema = Type.Intersect([WorkspaceDocumentMetaSchema, OpenAPIDocumentSchema]);
|
|
16
|
+
const WorkspaceDocumentSchema = OpenAPIDocumentSchema;
|
|
30
17
|
const ColorModeSchema = Type.Union([Type.Literal("system"), Type.Literal("light"), Type.Literal("dark")]);
|
|
31
18
|
const WorkspaceMetaSchema = Type.Partial(
|
|
32
19
|
compose(
|
|
@@ -58,7 +45,6 @@ const WorkspaceSchema = compose(
|
|
|
58
45
|
);
|
|
59
46
|
export {
|
|
60
47
|
ColorModeSchema,
|
|
61
|
-
WorkspaceDocumentMetaSchema,
|
|
62
48
|
WorkspaceDocumentSchema,
|
|
63
49
|
WorkspaceExtensionsSchema,
|
|
64
50
|
WorkspaceMetaSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/schemas/workspace.ts"],
|
|
4
|
-
"sourcesContent": ["import { Type } from '@scalar/typebox'\nimport { AVAILABLE_CLIENTS, type AvailableClients } from '@scalar/types/snippetz'\n\nimport { compose } from '@/schemas/compose'\nimport { extensions } from '@/schemas/extensions'\nimport {\n type XScalarEnvironments,\n xScalarEnvironmentsSchema,\n} from '@/schemas/extensions/document/x-scalar-environments'\nimport {
|
|
5
|
-
"mappings": "AAAA,SAAS,YAAY;AACrB,SAAS,yBAAgD;AAEzD,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B;AAAA,EAEE;AAAA,OACK;AACP
|
|
4
|
+
"sourcesContent": ["import { Type } from '@scalar/typebox'\nimport { AVAILABLE_CLIENTS, type AvailableClients } from '@scalar/types/snippetz'\n\nimport { compose } from '@/schemas/compose'\nimport { extensions } from '@/schemas/extensions'\nimport {\n type XScalarEnvironments,\n xScalarEnvironmentsSchema,\n} from '@/schemas/extensions/document/x-scalar-environments'\nimport {\n type XScalarActiveEnvironment,\n XScalarActiveEnvironmentSchema,\n} from '@/schemas/extensions/general/x-scalar-active-environment'\nimport { type XScalarCookies, xScalarCookiesSchema } from '@/schemas/extensions/general/x-scalar-cookies'\nimport { type XScalarOrder, XScalarOrderSchema } from '@/schemas/extensions/general/x-scalar-order'\nimport { type XScalarActiveProxy, XScalarActiveProxySchema } from '@/schemas/extensions/workspace/x-scalar-active-proxy'\nimport { type XScalarTabs, XScalarTabsSchema } from '@/schemas/extensions/workspace/x-scalar-tabs'\n\nimport { OpenAPIDocumentSchema, type OpenAPIExtensions, type OpenApiDocument } from './v3.1/strict/openapi-document'\n\nexport type WorkspaceDocumentMeta = Omit<\n OpenAPIExtensions,\n 'x-original-oas-version' | 'x-scalar-original-source-url' | 'x-scalar-original-document-hash'\n>\n\n// Note: use Type.Intersect to combine schemas here because Type.Compose does not work as expected with Modules\nexport const WorkspaceDocumentSchema = OpenAPIDocumentSchema\nexport type WorkspaceDocument = OpenApiDocument\n\nexport const ColorModeSchema = Type.Union([Type.Literal('system'), Type.Literal('light'), Type.Literal('dark')])\n\nexport const WorkspaceMetaSchema = Type.Partial(\n compose(\n Type.Object({\n [extensions.workspace.colorMode]: ColorModeSchema,\n [extensions.workspace.defaultClient]: Type.Union(AVAILABLE_CLIENTS.map((client) => Type.Literal(client))),\n [extensions.workspace.activeDocument]: Type.String(),\n [extensions.workspace.theme]: Type.String(),\n [extensions.workspace.sidebarWidth]: Type.Number({ default: 288 }),\n }),\n XScalarActiveProxySchema,\n ),\n)\n\nexport type ColorMode = 'system' | 'light' | 'dark'\n\nexport type WorkspaceMeta = {\n [extensions.workspace.colorMode]?: ColorMode\n [extensions.workspace.defaultClient]?: AvailableClients[number]\n [extensions.workspace.activeDocument]?: string\n [extensions.workspace.theme]?: string\n [extensions.workspace.sidebarWidth]?: number\n} & XScalarActiveProxy\n\nexport const WorkspaceExtensionsSchema = compose(\n xScalarEnvironmentsSchema,\n XScalarActiveEnvironmentSchema,\n XScalarOrderSchema,\n xScalarCookiesSchema,\n XScalarTabsSchema,\n)\n\nexport type WorkspaceExtensions = XScalarEnvironments &\n XScalarActiveEnvironment &\n XScalarOrder &\n XScalarCookies &\n XScalarTabs\n\nexport const WorkspaceSchema = compose(\n WorkspaceMetaSchema,\n Type.Object({\n documents: Type.Record(Type.String(), WorkspaceDocumentSchema),\n /** Active document is possibly undefined if we attempt to lookup with an invalid key */\n activeDocument: Type.Union([Type.Undefined(), WorkspaceDocumentSchema]),\n }),\n WorkspaceExtensionsSchema,\n)\n\nexport type Workspace = WorkspaceMeta & {\n documents: Record<string, WorkspaceDocument>\n activeDocument: WorkspaceDocument | undefined\n} & WorkspaceExtensions\n\nexport type DocumentMetaExtensions = WorkspaceDocumentMeta & OpenAPIExtensions\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AACrB,SAAS,yBAAgD;AAEzD,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B;AAAA,EAEE;AAAA,OACK;AACP;AAAA,EAEE;AAAA,OACK;AACP,SAA8B,4BAA4B;AAC1D,SAA4B,0BAA0B;AACtD,SAAkC,gCAAgC;AAClE,SAA2B,yBAAyB;AAEpD,SAAS,6BAA2E;AAQ7E,MAAM,0BAA0B;AAGhC,MAAM,kBAAkB,KAAK,MAAM,CAAC,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,OAAO,GAAG,KAAK,QAAQ,MAAM,CAAC,CAAC;AAExG,MAAM,sBAAsB,KAAK;AAAA,EACtC;AAAA,IACE,KAAK,OAAO;AAAA,MACV,CAAC,WAAW,UAAU,SAAS,GAAG;AAAA,MAClC,CAAC,WAAW,UAAU,aAAa,GAAG,KAAK,MAAM,kBAAkB,IAAI,CAAC,WAAW,KAAK,QAAQ,MAAM,CAAC,CAAC;AAAA,MACxG,CAAC,WAAW,UAAU,cAAc,GAAG,KAAK,OAAO;AAAA,MACnD,CAAC,WAAW,UAAU,KAAK,GAAG,KAAK,OAAO;AAAA,MAC1C,CAAC,WAAW,UAAU,YAAY,GAAG,KAAK,OAAO,EAAE,SAAS,IAAI,CAAC;AAAA,IACnE,CAAC;AAAA,IACD;AAAA,EACF;AACF;AAYO,MAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQO,MAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA,KAAK,OAAO;AAAA,IACV,WAAW,KAAK,OAAO,KAAK,OAAO,GAAG,uBAAuB;AAAA;AAAA,IAE7D,gBAAgB,KAAK,MAAM,CAAC,KAAK,UAAU,GAAG,uBAAuB,CAAC;AAAA,EACxE,CAAC;AAAA,EACD;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { NavigationOptions } from './navigation/get-navigation-options.js';
|
|
2
|
-
import { extensions } from './schemas/extensions.js';
|
|
3
|
-
import type { TraversedDocument } from './schemas/navigation.js';
|
|
4
2
|
import { type OpenApiDocument, type OperationObject, type PathsObject } from './schemas/v3.1/strict/openapi-document.js';
|
|
5
|
-
import type { WorkspaceDocumentMeta, WorkspaceMeta } from './schemas/workspace.js';
|
|
3
|
+
import type { Workspace, WorkspaceDocumentMeta, WorkspaceMeta } from './schemas/workspace.js';
|
|
6
4
|
export declare const WORKSPACE_FILE_NAME = "scalar-workspace.json";
|
|
7
5
|
type WorkspaceDocumentMetaInput = {
|
|
8
6
|
name: string;
|
|
@@ -23,7 +21,7 @@ type CreateServerWorkspaceStoreBase = {
|
|
|
23
21
|
meta?: WorkspaceMeta;
|
|
24
22
|
navigationOptions?: NavigationOptions;
|
|
25
23
|
};
|
|
26
|
-
type
|
|
24
|
+
type CreateServerWorkspaceStoreProps = ({
|
|
27
25
|
directory?: string;
|
|
28
26
|
mode: 'static';
|
|
29
27
|
} & CreateServerWorkspaceStoreBase) | ({
|
|
@@ -87,75 +85,103 @@ export declare function externalizePathReferences(document: OpenApiDocument, met
|
|
|
87
85
|
name: string;
|
|
88
86
|
directory: string;
|
|
89
87
|
}): Record<string, any>;
|
|
88
|
+
type ServerWorkspace = Omit<Workspace, 'activeDocument'>;
|
|
90
89
|
/**
|
|
91
|
-
*
|
|
90
|
+
* Server workspace store interface
|
|
92
91
|
*/
|
|
93
|
-
export
|
|
92
|
+
export type ServerWorkspaceStore = {
|
|
94
93
|
/**
|
|
95
|
-
*
|
|
94
|
+
* Loads and registers a document in the workspace.
|
|
96
95
|
*
|
|
97
|
-
*
|
|
98
|
-
* -
|
|
99
|
-
* -
|
|
100
|
-
* -
|
|
96
|
+
* Supported inputs include:
|
|
97
|
+
* - `url`: fetch and parse an OpenAPI document from a remote URL
|
|
98
|
+
* - `path`: read and parse an OpenAPI document from the filesystem
|
|
99
|
+
* - `document`: use an in-memory OpenAPI object directly
|
|
101
100
|
*
|
|
102
|
-
*
|
|
101
|
+
* If loading fails, the document is not added.
|
|
103
102
|
*
|
|
104
|
-
* @
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* await store.addDocument({
|
|
106
|
+
* url: 'https://example.com/openapi.json',
|
|
107
|
+
* name: 'petstore',
|
|
108
|
+
* })
|
|
109
|
+
*
|
|
110
|
+
* await store.addDocument({
|
|
111
|
+
* path: './specs/billing.yaml',
|
|
112
|
+
* name: 'billing',
|
|
113
|
+
* })
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* @param input - Source and metadata used to load and register the document
|
|
105
117
|
*/
|
|
106
|
-
|
|
118
|
+
addDocument: (input: WorkspaceDocumentInput, navigationOptions?: NavigationOptions) => Promise<void>;
|
|
107
119
|
/**
|
|
108
|
-
*
|
|
120
|
+
* Generates chunk files for all loaded documents.
|
|
121
|
+
*
|
|
122
|
+
* Only available in `static` mode. Writes chunk files for:
|
|
123
|
+
* - workspace metadata
|
|
124
|
+
* - components (schemas, parameters, responses, etc.)
|
|
125
|
+
* - operations (grouped by path and HTTP method)
|
|
109
126
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
127
|
+
* After generation, workspace references point to relative file paths.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* const store = await createServerWorkspaceStore({
|
|
132
|
+
* mode: 'static',
|
|
133
|
+
* outputPath: './dist/workspace',
|
|
134
|
+
* meta: { title: 'Docs' },
|
|
135
|
+
* })
|
|
136
|
+
*
|
|
137
|
+
* await store.generateWorkspaceChunks()
|
|
138
|
+
* ```
|
|
115
139
|
*
|
|
116
|
-
* @
|
|
140
|
+
* @throws {Error} If called when mode is not 'static'
|
|
117
141
|
*/
|
|
118
|
-
|
|
119
|
-
documents: Record<string, OpenApiDocument & {
|
|
120
|
-
[extensions.document.navigation]: TraversedDocument;
|
|
121
|
-
}>;
|
|
122
|
-
"x-scalar-color-mode"?: import("./schemas/workspace.js").ColorMode;
|
|
123
|
-
"x-scalar-default-client"?: import("@scalar/snippetz").AvailableClients[number];
|
|
124
|
-
"x-scalar-active-document"?: string;
|
|
125
|
-
"x-scalar-theme"?: string;
|
|
126
|
-
"x-scalar-sidebar-width"?: number;
|
|
127
|
-
'x-scalar-active-proxy'?: string | null;
|
|
128
|
-
};
|
|
142
|
+
generateWorkspaceChunks: () => Promise<void>;
|
|
129
143
|
/**
|
|
130
|
-
*
|
|
144
|
+
* Returns the current workspace payload.
|
|
131
145
|
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
146
|
+
* The payload contains workspace metadata plus sparse documents whose heavy
|
|
147
|
+
* sections are replaced by references:
|
|
148
|
+
* - in `ssr` mode, references resolve from in-memory assets
|
|
149
|
+
* - in `static` mode, references point to generated chunk files
|
|
134
150
|
*
|
|
135
151
|
* @example
|
|
136
152
|
* ```ts
|
|
137
|
-
*
|
|
138
|
-
* get('#/document-name/components/schemas/User')
|
|
153
|
+
* const workspace = store.getWorkspace()
|
|
139
154
|
*
|
|
140
|
-
* //
|
|
141
|
-
*
|
|
155
|
+
* // Read available document names
|
|
156
|
+
* const names = Object.keys(workspace.documents)
|
|
142
157
|
* ```
|
|
143
158
|
*
|
|
144
|
-
* @
|
|
145
|
-
* @returns The chunk data if found, undefined otherwise
|
|
159
|
+
* @returns Workspace metadata and document references used by the client
|
|
146
160
|
*/
|
|
147
|
-
|
|
161
|
+
getWorkspace: () => ServerWorkspace;
|
|
148
162
|
/**
|
|
149
|
-
*
|
|
163
|
+
* Resolves a chunk by JSON Pointer.
|
|
164
|
+
*
|
|
165
|
+
* Pointers can target component and operation chunks for loaded documents.
|
|
166
|
+
* Returns `undefined` when the pointer does not resolve.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* // Resolve a component chunk
|
|
171
|
+
* const userSchema = store.get('#/petstore/components/schemas/User')
|
|
150
172
|
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* 3. If successful, adds the document to the workspace using addDocumentSync
|
|
173
|
+
* // Resolve an operation chunk
|
|
174
|
+
* const listPets = store.get('#/petstore/operations/pets/get')
|
|
175
|
+
* ```
|
|
155
176
|
*
|
|
156
|
-
* @param
|
|
177
|
+
* @param pointer - JSON Pointer to the desired chunk
|
|
178
|
+
* @returns The resolved chunk, or `undefined` when not found
|
|
157
179
|
*/
|
|
158
|
-
|
|
159
|
-
}
|
|
180
|
+
get: (pointer: string) => unknown;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Create server state workspace store
|
|
184
|
+
*/
|
|
185
|
+
export declare function createServerWorkspaceStore(workspaceProps: CreateServerWorkspaceStoreProps): Promise<ServerWorkspaceStore>;
|
|
160
186
|
export {};
|
|
161
187
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AAI5E,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,wCAAwC,CAAA;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAG1F,eAAO,MAAM,mBAAmB,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@ async function createServerWorkspaceStore(workspaceProps) {
|
|
|
130
130
|
};
|
|
131
131
|
await Promise.all(workspaceProps.documents.map((document) => addDocument(document)));
|
|
132
132
|
return {
|
|
133
|
-
/**
|
|
134
|
-
* Generates workspace chunks by writing components and operations to the filesystem.
|
|
135
|
-
*
|
|
136
|
-
* This method is only available in static mode. It creates a directory structure containing:
|
|
137
|
-
* - A workspace file with metadata and document references
|
|
138
|
-
* - Component chunks split by type (schemas, parameters, etc)
|
|
139
|
-
* - Operation chunks split by path and HTTP method
|
|
140
|
-
*
|
|
141
|
-
* The generated workspace references will be relative file paths pointing to these chunks.
|
|
142
|
-
*
|
|
143
|
-
* @throws {Error} If called when mode is not 'static'
|
|
144
|
-
*/
|
|
145
133
|
generateWorkspaceChunks: async () => {
|
|
146
134
|
if (workspaceProps.mode !== "static") {
|
|
147
135
|
throw "Mode has to be set to `static` to generate filesystem workspace chunks";
|
|
@@ -170,38 +158,9 @@ async function createServerWorkspaceStore(workspaceProps) {
|
|
|
170
158
|
}
|
|
171
159
|
}
|
|
172
160
|
},
|
|
173
|
-
/**
|
|
174
|
-
* Returns the workspace document containing metadata and all sparse documents.
|
|
175
|
-
*
|
|
176
|
-
* The workspace document includes:
|
|
177
|
-
* - Global workspace metadata (theme, active document, etc)
|
|
178
|
-
* - Document metadata and sparse document
|
|
179
|
-
* - In SSR mode: References point to in-memory chunks
|
|
180
|
-
* - In static mode: References point to filesystem chunks
|
|
181
|
-
*
|
|
182
|
-
* @returns The complete workspace document
|
|
183
|
-
*/
|
|
184
161
|
getWorkspace: () => {
|
|
185
162
|
return workspace;
|
|
186
163
|
},
|
|
187
|
-
/**
|
|
188
|
-
* Retrieves a chunk of data from the workspace using a JSON Pointer
|
|
189
|
-
*
|
|
190
|
-
* A JSON Pointer is a string that references a specific location in a JSON document.
|
|
191
|
-
* Only components and operations chunks can be retrieved.
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* ```ts
|
|
195
|
-
* // Get a component
|
|
196
|
-
* get('#/document-name/components/schemas/User')
|
|
197
|
-
*
|
|
198
|
-
* // Get an operation
|
|
199
|
-
* get('#/document-name/operations/pets/get')
|
|
200
|
-
* ```
|
|
201
|
-
*
|
|
202
|
-
* @param pointer - The JSON Pointer string to locate the chunk
|
|
203
|
-
* @returns The chunk data if found, undefined otherwise
|
|
204
|
-
*/
|
|
205
164
|
get: (pointer) => {
|
|
206
165
|
const pointerPath = (() => {
|
|
207
166
|
if (pointer.startsWith("#")) {
|
|
@@ -219,16 +178,6 @@ async function createServerWorkspaceStore(workspaceProps) {
|
|
|
219
178
|
const path = parseJsonPointerSegments(pointerPath).map(escapeJsonPointer);
|
|
220
179
|
return getValueAtPath(assets, path);
|
|
221
180
|
},
|
|
222
|
-
/**
|
|
223
|
-
* Adds a new document to the workspace asynchronously.
|
|
224
|
-
*
|
|
225
|
-
* This function:
|
|
226
|
-
* 1. Loads the document using the provided input
|
|
227
|
-
* 2. Checks if the document loaded successfully
|
|
228
|
-
* 3. If successful, adds the document to the workspace using addDocumentSync
|
|
229
|
-
*
|
|
230
|
-
* @param input - The document input containing the document source and metadata
|
|
231
|
-
*/
|
|
232
181
|
addDocument
|
|
233
182
|
};
|
|
234
183
|
}
|