@scalar/workspace-store 0.28.1 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/client.d.ts +10 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +42 -2
- package/dist/client.js.map +2 -2
- package/dist/entities/auth/index.d.ts +75 -0
- package/dist/entities/auth/index.d.ts.map +1 -0
- package/dist/entities/auth/index.js +89 -0
- package/dist/entities/auth/index.js.map +7 -0
- package/dist/entities/auth/schema.d.ts +7318 -0
- package/dist/entities/auth/schema.d.ts.map +1 -0
- package/dist/entities/auth/schema.js +74 -0
- package/dist/entities/auth/schema.js.map +7 -0
- package/dist/entities/history/index.d.ts +93 -0
- package/dist/entities/history/index.d.ts.map +1 -0
- package/dist/entities/history/index.js +62 -0
- package/dist/entities/history/index.js.map +7 -0
- package/dist/entities/history/schema.d.ts +234 -0
- package/dist/entities/history/schema.d.ts.map +1 -0
- package/dist/{schemas/extensions/operation/x-scalar-history.js → entities/history/schema.js} +5 -6
- package/dist/{schemas/extensions/operation/x-scalar-history.js.map → entities/history/schema.js.map} +3 -3
- package/dist/events/definitions/auth.d.ts +14 -0
- package/dist/events/definitions/auth.d.ts.map +1 -1
- package/dist/mutators/auth.d.ts +10 -17
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +87 -57
- package/dist/mutators/auth.js.map +2 -2
- package/dist/mutators/index.d.ts +4 -12
- package/dist/mutators/index.d.ts.map +1 -1
- package/dist/mutators/index.js +1 -1
- package/dist/mutators/index.js.map +2 -2
- package/dist/mutators/operation.d.ts +2 -2
- package/dist/mutators/operation.d.ts.map +1 -1
- package/dist/mutators/operation.js +9 -16
- package/dist/mutators/operation.js.map +2 -2
- package/dist/mutators/server.d.ts.map +1 -1
- package/dist/mutators/server.js +0 -3
- package/dist/mutators/server.js.map +2 -2
- package/dist/persistence/index.d.ts +16 -3
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +47 -3
- package/dist/persistence/index.js.map +2 -2
- package/dist/plugins/bundler/index.d.ts +7 -0
- package/dist/plugins/bundler/index.d.ts.map +1 -1
- package/dist/plugins/bundler/index.js +17 -0
- package/dist/plugins/bundler/index.js.map +2 -2
- package/dist/plugins/client/persistence.d.ts.map +1 -1
- package/dist/plugins/client/persistence.js +12 -0
- package/dist/plugins/client/persistence.js.map +2 -2
- package/dist/resolve.d.ts +9 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +28 -0
- package/dist/resolve.js.map +7 -0
- package/dist/schemas/extensions/security/index.d.ts +2 -0
- package/dist/schemas/extensions/security/index.d.ts.map +1 -0
- package/dist/schemas/extensions/security/index.js +1 -0
- package/dist/schemas/extensions/security/index.js.map +7 -0
- package/dist/schemas/inmemory-workspace.d.ts +2952 -149
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/inmemory-workspace.js +5 -1
- package/dist/schemas/inmemory-workspace.js.map +2 -2
- package/dist/schemas/reference-config/index.d.ts +35 -149
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +35 -149
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts +5 -35
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/oauth-flow.js +1 -16
- package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
- package/dist/schemas/v3.1/strict/oauthflows.d.ts +0 -29
- package/dist/schemas/v3.1/strict/oauthflows.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +1245 -6744
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +2 -10
- package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
- package/dist/schemas/v3.1/strict/operation.d.ts +1 -70
- package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/operation.js +1 -7
- package/dist/schemas/v3.1/strict/operation.js.map +2 -2
- package/dist/schemas/v3.1/strict/ref-definitions.d.ts +0 -1
- package/dist/schemas/v3.1/strict/ref-definitions.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/ref-definitions.js +1 -3
- package/dist/schemas/v3.1/strict/ref-definitions.js.map +2 -2
- package/dist/schemas/v3.1/strict/schema.d.ts +50 -46
- package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/schema.js +5 -2
- package/dist/schemas/v3.1/strict/schema.js.map +2 -2
- package/dist/schemas/v3.1/strict/security-scheme.d.ts +3 -11
- package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/security-scheme.js +0 -7
- package/dist/schemas/v3.1/strict/security-scheme.js.map +2 -2
- package/dist/schemas/workspace.d.ts +245 -1043
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/dist/workspace-plugin.d.ts +8 -0
- package/dist/workspace-plugin.d.ts.map +1 -1
- package/package.json +26 -6
- package/dist/schemas/extensions/operation/x-scalar-history.d.ts +0 -217
- package/dist/schemas/extensions/operation/x-scalar-history.d.ts.map +0 -1
- package/dist/schemas/extensions/security/x-scalar-selected-security.d.ts +0 -17
- package/dist/schemas/extensions/security/x-scalar-selected-security.d.ts.map +0 -1
- package/dist/schemas/extensions/security/x-scalar-selected-security.js +0 -14
- package/dist/schemas/extensions/security/x-scalar-selected-security.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/schemas/v3.1/strict/schema.ts"],
|
|
4
|
-
"sourcesContent": ["import { Type } from '@scalar/typebox'\n\nimport { compose } from '@/schemas/compose'\nimport { type XInternal, XInternalSchema } from '@/schemas/extensions/document/x-internal'\nimport { type XScalarIgnore, XScalarIgnoreSchema } from '@/schemas/extensions/document/x-scalar-ignore'\nimport { XTags } from '@/schemas/extensions/document/x-tags'\nimport {\n type XAdditionalPropertiesName,\n XAdditionalPropertiesNameSchema,\n} from '@/schemas/extensions/schema/x-additional-properties-name'\nimport { type XEnumDescriptions, XEnumDescriptionsSchema } from '@/schemas/extensions/schema/x-enum-descriptions'\nimport { type XEnumVarNames, XEnumVarNamesSchema } from '@/schemas/extensions/schema/x-enum-varnames'\nimport { type XExamples, XExamplesSchema } from '@/schemas/extensions/schema/x-examples'\nimport { type XVariable, XVariableSchema } from '@/schemas/extensions/schema/x-variable'\nimport type { ExternalDocumentationObject } from '@/schemas/v3.1/strict/external-documentation'\nimport type { XMLObject } from '@/schemas/v3.1/strict/xml'\n\nimport type { DiscriminatorObject } from './discriminator'\nimport {\n DiscriminatorObjectRef,\n ExternalDocumentationObjectRef,\n SchemaObjectRef,\n XMLObjectRef,\n} from './ref-definitions'\nimport { type ReferenceType, reference } from './reference'\n\nconst schemaOrReference = Type.Union([SchemaObjectRef, reference(SchemaObjectRef)])\n\n/** We use this type to ensure that we are parsing a schema object as every property can be optional */\ntype _InternalType = CoreProperties & {\n __scalar_: string\n} & Extensions\n\n/**\n * Primitive types that don't have additional validation properties.\n * These types (null, boolean, string, number, integer, object, array) can be used\n * without additional validation constraints.\n *\n * TODO: Type array will actually validate against every union type but we can cross that bridge when we come to it\n */\nconst OtherTypes = Type.Object({\n type: Type.Union([\n Type.Literal('null'),\n Type.Literal('boolean'),\n Type.Array(\n Type.Union([\n Type.Literal('null'),\n Type.Literal('boolean'),\n Type.Literal('string'),\n Type.Literal('number'),\n Type.Literal('integer'),\n Type.Literal('object'),\n Type.Literal('array'),\n ]),\n ),\n ]),\n})\n\ntype OtherType = 'boolean' | 'null' | ('string' | 'number' | 'boolean' | 'object' | 'null' | 'integer' | 'array')[]\n\ntype OtherTypes = CoreProperties & {\n type: OtherType\n} & Extensions\n\nconst Extensions = compose(\n XScalarIgnoreSchema,\n XInternalSchema,\n XVariableSchema,\n XExamplesSchema,\n XEnumDescriptionsSchema,\n XEnumVarNamesSchema,\n XAdditionalPropertiesNameSchema,\n XTags,\n)\n\ntype Extensions = XScalarIgnore &\n XInternal &\n XVariable &\n XEnumDescriptions &\n XEnumVarNames &\n XExamples &\n XAdditionalPropertiesName &\n XTags\n\nconst CorePropertiesWithSchema = Type.Object({\n name: Type.Optional(Type.String()),\n /** A title for the schema. */\n title: Type.Optional(Type.String()),\n /** A description of the schema. */\n description: Type.Optional(Type.String()),\n /** Default value for the schema. */\n default: Type.Optional(Type.Unknown()),\n /** Array of allowed values. */\n enum: Type.Optional(Type.Array(Type.Unknown())),\n /** Constant value that must match exactly. */\n const: Type.Optional(Type.Unknown()),\n /** Media type for content validation. */\n contentMediaType: Type.Optional(Type.String()),\n /** Content encoding. */\n contentEncoding: Type.Optional(Type.String()),\n /** Schema for content validation. */\n contentSchema: Type.Optional(schemaOrReference),\n /** Whether the schema is deprecated. */\n deprecated: Type.Optional(Type.Boolean()),\n /** Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See Composition and Inheritance for more details. */\n discriminator: Type.Optional(DiscriminatorObjectRef),\n /** Whether the schema is read-only. */\n readOnly: Type.Optional(Type.Boolean()),\n /** Whether the schema is write-only. */\n writeOnly: Type.Optional(Type.Boolean()),\n /** This MAY be used only on property schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */\n xml: Type.Optional(XMLObjectRef),\n /** Additional external documentation for this schema. */\n externalDocs: Type.Optional(ExternalDocumentationObjectRef),\n /**\n * A free-form field to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.\n *\n * @deprecated The example field has been deprecated in favor of the JSON Schema examples keyword. Use of example is discouraged, and later versions of this specification may remove it.\n */\n example: Type.Optional(Type.Unknown()),\n /**\n * An array of examples of valid instances for this schema. This keyword follows the JSON Schema Draft 2020-12 specification.\n * Each example should be a valid instance of the schema.\n */\n examples: Type.Optional(Type.Array(Type.Unknown())),\n /** All schemas must be valid. */\n allOf: Type.Optional(Type.Array(schemaOrReference)),\n /** Exactly one schema must be valid. */\n oneOf: Type.Optional(Type.Array(schemaOrReference)),\n /** At least one schema must be valid. */\n anyOf: Type.Optional(Type.Array(schemaOrReference)),\n /** Schema must not be valid. */\n not: Type.Optional(schemaOrReference),\n})\n\ntype CoreProperties = {\n name?: string\n /** A title for the schema. */\n title?: string\n /** A description of the schema. */\n description?: string\n /** Default value for the schema. */\n default?: unknown\n /** Array of allowed values. */\n enum?: unknown[]\n /** Constant value that must match exactly. */\n const?: unknown\n /** Media type for content validation. */\n contentMediaType?: string\n /** Content encoding. */\n contentEncoding?: string\n /** Schema for content validation. */\n contentSchema?: ReferenceType<SchemaObject>\n /** Whether the schema is deprecated. */\n deprecated?: boolean\n /** Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See Composition and Inheritance for more details. */\n discriminator?: DiscriminatorObject\n /** Whether the schema is read-only. */\n readOnly?: boolean\n /** Whether the schema is write-only. */\n writeOnly?: boolean\n /** This MAY be used only on property schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */\n xml?: XMLObject\n /** Additional external documentation for this schema. */\n externalDocs?: ExternalDocumentationObject\n /**\n * A free-form field to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.\n *\n * @deprecated The example field has been deprecated in favor of the JSON Schema examples keyword. Use of example is discouraged, and later versions of this specification may remove it.\n */\n example?: unknown\n /**\n * An array of examples of valid instances for this schema. This keyword follows the JSON Schema Draft 2020-12 specification.\n * Each example should be a valid instance of the schema.\n */\n examples?: unknown[]\n /** All schemas must be valid. */\n allOf?: ReferenceType<SchemaObject>[]\n /** Exactly one schema must be valid. */\n oneOf?: ReferenceType<SchemaObject>[]\n /** At least one schema must be valid. */\n anyOf?: ReferenceType<SchemaObject>[]\n /** Schema must not be valid. */\n not?: ReferenceType<SchemaObject>\n}\n\n/**\n * Numeric validation properties for number and integer types.\n */\nconst NumericProperties = Type.Object({\n type: Type.Union([Type.Literal('number'), Type.Literal('integer')]),\n /** Different subtypes */\n format: Type.Optional(Type.String()),\n /** Number must be a multiple of this value. */\n multipleOf: Type.Optional(Type.Number()),\n /** Maximum value (inclusive). */\n maximum: Type.Optional(Type.Number()),\n /** Maximum value (exclusive). */\n exclusiveMaximum: Type.Optional(Type.Number({ minimum: 0 })),\n /** Minimum value (inclusive). */\n minimum: Type.Optional(Type.Number()),\n /** Minimum value (exclusive). */\n exclusiveMinimum: Type.Optional(Type.Number({ minimum: 0 })),\n})\n\ntype NumericObject = CoreProperties & {\n type: 'number' | 'integer'\n /** Different subtypes */\n format?:\n | 'int8'\n | 'int16'\n | 'int32'\n | 'int64'\n | 'uint8'\n | 'uint16'\n | 'uint32'\n | 'uint64'\n | 'double-int'\n | 'float'\n | 'double'\n | 'decimal'\n | 'decimal128'\n | 'sf-integer'\n | 'sf-decimal'\n | (string & {})\n /** Number must be a multiple of this value. */\n multipleOf?: number\n /** Maximum value (inclusive). */\n maximum?: number\n /** Maximum value (exclusive). */\n exclusiveMaximum?: number\n /** Minimum value (inclusive). */\n minimum?: number\n /** Minimum value (exclusive). */\n exclusiveMinimum?: number\n} & Extensions\n\n/**\n * String validation properties for string types.\n */\nconst StringValidationProperties = Type.Object({\n type: Type.Literal('string'),\n /** Different subtypes - allow any arbitrary string, this negates the purpose of having a union of formats so we type it in typescript instead */\n format: Type.Optional(Type.String()),\n /** Maximum string length. */\n maxLength: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Minimum string length. */\n minLength: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Regular expression pattern. */\n pattern: Type.Optional(Type.String()),\n})\n\n/**\n * Supported string formats in OpenAPI schemas.\n *\n * These provide better type safety for string format validation. We wanted to allow any arbitrary string\n * in the schema, so we type it in typescript instead. This gives us autocomplete while allowing any string!\n */\ntype StringFormat =\n // Date and time formats\n | 'date'\n | 'date-time'\n | 'date-time-local'\n | 'time'\n | 'time-local'\n | 'duration'\n | 'http-date'\n // Network formats\n | 'email'\n | 'idn-email'\n | 'hostname'\n | 'idn-hostname'\n | 'ipv4'\n | 'ipv6'\n | 'uri'\n | 'uri-reference'\n | 'uri-template'\n | 'iri'\n | 'iri-reference'\n | 'uuid'\n // Content formats\n | 'binary'\n | 'byte'\n | 'base64url'\n | 'html'\n | 'commonmark'\n | 'password'\n | 'regex'\n | 'json-pointer'\n | 'relative-json-pointer'\n | 'media-range'\n // Character formats\n | 'char'\n // Structured field string formats\n | 'sf-string'\n | 'sf-token'\n | 'sf-binary'\n | 'sf-boolean'\n | (string & {})\n\ntype StringObject = CoreProperties & {\n type: 'string'\n /** Different subtypes - allow any arbitrary string, this negates the purpose of having a union of formats so we type it in typescript instead */\n format?: StringFormat\n /** Maximum string length. */\n maxLength?: number\n /** Minimum string length. */\n minLength?: number\n /** Regular expression pattern. */\n pattern?: string\n} & Extensions\n\nconst ArrayValidationPropertiesWithSchema = Type.Object({\n type: Type.Literal('array'),\n /** Maximum number of items in array. */\n maxItems: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Minimum number of items in array. */\n minItems: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Whether array items must be unique. */\n uniqueItems: Type.Optional(Type.Boolean()),\n /** Schema for array items. */\n items: Type.Optional(schemaOrReference),\n /** Schema for tuple validation. */\n prefixItems: Type.Optional(Type.Array(schemaOrReference)),\n})\n\ntype ArrayObject = CoreProperties & {\n type: 'array'\n /** Maximum number of items in array. */\n maxItems?: number\n /** Minimum number of items in array. */\n minItems?: number\n /** Whether array items must be unique. */\n uniqueItems?: boolean\n /** Schema for array items. */\n items?: ReferenceType<SchemaObject>\n /** Schema for tuple validation. */\n prefixItems?: ReferenceType<SchemaObject>[]\n} & Extensions\n\nconst ObjectValidationPropertiesWithSchema = Type.Object({\n type: Type.Literal('object'),\n /** Maximum number of properties. */\n maxProperties: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Minimum number of properties. */\n minProperties: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Array of required property names. */\n required: Type.Optional(Type.Array(Type.String())),\n /** Object property definitions. */\n properties: Type.Optional(Type.Record(Type.String(), schemaOrReference)),\n /** Schema for additional properties. */\n additionalProperties: Type.Optional(Type.Union([Type.Boolean(), schemaOrReference])),\n /** Properties matching regex patterns. */\n patternProperties: Type.Optional(Type.Record(Type.String(), schemaOrReference)),\n})\n\ntype ObjectObject = CoreProperties & {\n type: 'object'\n /** Maximum number of properties. */\n maxProperties?: number\n /** Minimum number of properties. */\n minProperties?: number\n /** Array of required property names. */\n required?: string[]\n /** Object property definitions. */\n properties?: Record<string, ReferenceType<SchemaObject>>\n /** Schema for additional properties. */\n additionalProperties?: boolean | ReferenceType<SchemaObject>\n /** Properties matching regex patterns. */\n patternProperties?: Record<string, ReferenceType<SchemaObject>>\n} & Extensions\n\n/** Builds the recursive schema schema */\nexport const SchemaObjectSchemaDefinition = Type.Union([\n // Keep compositions first so they get priority when union is evaluated\n // Make sure there is always a required field so not all properties are optional\n // When all properties are optional (1) typescript will not throw any warnings/error and accepts anything\n // even a non resolved ref and (2) it will match any schema so it will not validate the refs correctly\n compose(Type.Object({ __scalar_: Type.String() }), CorePropertiesWithSchema, Extensions),\n compose(OtherTypes, CorePropertiesWithSchema, Extensions),\n compose(NumericProperties, CorePropertiesWithSchema, Extensions),\n compose(StringValidationProperties, CorePropertiesWithSchema, Extensions),\n compose(ObjectValidationPropertiesWithSchema, CorePropertiesWithSchema, Extensions),\n compose(ArrayValidationPropertiesWithSchema, CorePropertiesWithSchema, Extensions),\n])\n\nexport type SchemaObject = _InternalType | OtherTypes | NumericObject | StringObject | ObjectObject | ArrayObject\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,YAAY;AAErB,SAAS,eAAe;AACxB,SAAyB,uBAAuB;AAChD,SAA6B,2BAA2B;AACxD,SAAS,aAAa;AACtB;AAAA,EAEE;AAAA,OACK;AACP,SAAiC,+BAA+B;AAChE,SAA6B,2BAA2B;AACxD,SAAyB,uBAAuB;AAChD,SAAyB,uBAAuB;AAKhD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,
|
|
4
|
+
"sourcesContent": ["import { Type } from '@scalar/typebox'\n\nimport { compose } from '@/schemas/compose'\nimport { type XInternal, XInternalSchema } from '@/schemas/extensions/document/x-internal'\nimport { type XScalarIgnore, XScalarIgnoreSchema } from '@/schemas/extensions/document/x-scalar-ignore'\nimport { XTags } from '@/schemas/extensions/document/x-tags'\nimport {\n type XAdditionalPropertiesName,\n XAdditionalPropertiesNameSchema,\n} from '@/schemas/extensions/schema/x-additional-properties-name'\nimport { type XEnumDescriptions, XEnumDescriptionsSchema } from '@/schemas/extensions/schema/x-enum-descriptions'\nimport { type XEnumVarNames, XEnumVarNamesSchema } from '@/schemas/extensions/schema/x-enum-varnames'\nimport { type XExamples, XExamplesSchema } from '@/schemas/extensions/schema/x-examples'\nimport { type XVariable, XVariableSchema } from '@/schemas/extensions/schema/x-variable'\nimport type { ExternalDocumentationObject } from '@/schemas/v3.1/strict/external-documentation'\nimport type { XMLObject } from '@/schemas/v3.1/strict/xml'\n\nimport type { DiscriminatorObject } from './discriminator'\nimport {\n DiscriminatorObjectRef,\n ExternalDocumentationObjectRef,\n SchemaObjectRef,\n XMLObjectRef,\n} from './ref-definitions'\nimport { type ReferenceObject, ReferenceObjectSchema } from './reference'\n\nexport type SchemaReferenceType<Value> = Value | (ReferenceObject & { '$ref-value': unknown })\n\nconst schemaOrReference = Type.Union([\n SchemaObjectRef,\n compose(ReferenceObjectSchema, Type.Object({ '$ref-value': Type.Unknown() })),\n])\n\n/** We use this type to ensure that we are parsing a schema object as every property can be optional */\ntype _InternalType = CoreProperties & {\n __scalar_: string\n} & Extensions\n\n/**\n * Primitive types that don't have additional validation properties.\n * These types (null, boolean, string, number, integer, object, array) can be used\n * without additional validation constraints.\n *\n * TODO: Type array will actually validate against every union type but we can cross that bridge when we come to it\n */\nconst OtherTypes = Type.Object({\n type: Type.Union([\n Type.Literal('null'),\n Type.Literal('boolean'),\n Type.Array(\n Type.Union([\n Type.Literal('null'),\n Type.Literal('boolean'),\n Type.Literal('string'),\n Type.Literal('number'),\n Type.Literal('integer'),\n Type.Literal('object'),\n Type.Literal('array'),\n ]),\n ),\n ]),\n})\n\ntype OtherType = 'boolean' | 'null' | ('string' | 'number' | 'boolean' | 'object' | 'null' | 'integer' | 'array')[]\n\ntype OtherTypes = CoreProperties & {\n type: OtherType\n} & Extensions\n\nconst Extensions = compose(\n XScalarIgnoreSchema,\n XInternalSchema,\n XVariableSchema,\n XExamplesSchema,\n XEnumDescriptionsSchema,\n XEnumVarNamesSchema,\n XAdditionalPropertiesNameSchema,\n XTags,\n)\n\ntype Extensions = XScalarIgnore &\n XInternal &\n XVariable &\n XEnumDescriptions &\n XEnumVarNames &\n XExamples &\n XAdditionalPropertiesName &\n XTags\n\nconst CorePropertiesWithSchema = Type.Object({\n name: Type.Optional(Type.String()),\n /** A title for the schema. */\n title: Type.Optional(Type.String()),\n /** A description of the schema. */\n description: Type.Optional(Type.String()),\n /** Default value for the schema. */\n default: Type.Optional(Type.Unknown()),\n /** Array of allowed values. */\n enum: Type.Optional(Type.Array(Type.Unknown())),\n /** Constant value that must match exactly. */\n const: Type.Optional(Type.Unknown()),\n /** Media type for content validation. */\n contentMediaType: Type.Optional(Type.String()),\n /** Content encoding. */\n contentEncoding: Type.Optional(Type.String()),\n /** Schema for content validation. */\n contentSchema: Type.Optional(schemaOrReference),\n /** Whether the schema is deprecated. */\n deprecated: Type.Optional(Type.Boolean()),\n /** Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See Composition and Inheritance for more details. */\n discriminator: Type.Optional(DiscriminatorObjectRef),\n /** Whether the schema is read-only. */\n readOnly: Type.Optional(Type.Boolean()),\n /** Whether the schema is write-only. */\n writeOnly: Type.Optional(Type.Boolean()),\n /** This MAY be used only on property schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */\n xml: Type.Optional(XMLObjectRef),\n /** Additional external documentation for this schema. */\n externalDocs: Type.Optional(ExternalDocumentationObjectRef),\n /**\n * A free-form field to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.\n *\n * @deprecated The example field has been deprecated in favor of the JSON Schema examples keyword. Use of example is discouraged, and later versions of this specification may remove it.\n */\n example: Type.Optional(Type.Unknown()),\n /**\n * An array of examples of valid instances for this schema. This keyword follows the JSON Schema Draft 2020-12 specification.\n * Each example should be a valid instance of the schema.\n */\n examples: Type.Optional(Type.Array(Type.Unknown())),\n /** All schemas must be valid. */\n allOf: Type.Optional(Type.Array(schemaOrReference)),\n /** Exactly one schema must be valid. */\n oneOf: Type.Optional(Type.Array(schemaOrReference)),\n /** At least one schema must be valid. */\n anyOf: Type.Optional(Type.Array(schemaOrReference)),\n /** Schema must not be valid. */\n not: Type.Optional(schemaOrReference),\n})\n\ntype CoreProperties = {\n name?: string\n /** A title for the schema. */\n title?: string\n /** A description of the schema. */\n description?: string\n /** Default value for the schema. */\n default?: unknown\n /** Array of allowed values. */\n enum?: unknown[]\n /** Constant value that must match exactly. */\n const?: unknown\n /** Media type for content validation. */\n contentMediaType?: string\n /** Content encoding. */\n contentEncoding?: string\n /** Schema for content validation. */\n contentSchema?: SchemaReferenceType<SchemaObject>\n /** Whether the schema is deprecated. */\n deprecated?: boolean\n /** Adds support for polymorphism. The discriminator is used to determine which of a set of schemas a payload is expected to satisfy. See Composition and Inheritance for more details. */\n discriminator?: DiscriminatorObject\n /** Whether the schema is read-only. */\n readOnly?: boolean\n /** Whether the schema is write-only. */\n writeOnly?: boolean\n /** This MAY be used only on property schemas. It has no effect on root schemas. Adds additional metadata to describe the XML representation of this property. */\n xml?: XMLObject\n /** Additional external documentation for this schema. */\n externalDocs?: ExternalDocumentationObject\n /**\n * A free-form field to include an example of an instance for this schema. To represent examples that cannot be naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.\n *\n * @deprecated The example field has been deprecated in favor of the JSON Schema examples keyword. Use of example is discouraged, and later versions of this specification may remove it.\n */\n example?: unknown\n /**\n * An array of examples of valid instances for this schema. This keyword follows the JSON Schema Draft 2020-12 specification.\n * Each example should be a valid instance of the schema.\n */\n examples?: unknown[]\n /** All schemas must be valid. */\n allOf?: SchemaReferenceType<SchemaObject>[]\n /** Exactly one schema must be valid. */\n oneOf?: SchemaReferenceType<SchemaObject>[]\n /** At least one schema must be valid. */\n anyOf?: SchemaReferenceType<SchemaObject>[]\n /** Schema must not be valid. */\n not?: SchemaReferenceType<SchemaObject>\n}\n\n/**\n * Numeric validation properties for number and integer types.\n */\nconst NumericProperties = Type.Object({\n type: Type.Union([Type.Literal('number'), Type.Literal('integer')]),\n /** Different subtypes */\n format: Type.Optional(Type.String()),\n /** Number must be a multiple of this value. */\n multipleOf: Type.Optional(Type.Number()),\n /** Maximum value (inclusive). */\n maximum: Type.Optional(Type.Number()),\n /** Maximum value (exclusive). */\n exclusiveMaximum: Type.Optional(Type.Number({ minimum: 0 })),\n /** Minimum value (inclusive). */\n minimum: Type.Optional(Type.Number()),\n /** Minimum value (exclusive). */\n exclusiveMinimum: Type.Optional(Type.Number({ minimum: 0 })),\n})\n\ntype NumericObject = CoreProperties & {\n type: 'number' | 'integer'\n /** Different subtypes */\n format?:\n | 'int8'\n | 'int16'\n | 'int32'\n | 'int64'\n | 'uint8'\n | 'uint16'\n | 'uint32'\n | 'uint64'\n | 'double-int'\n | 'float'\n | 'double'\n | 'decimal'\n | 'decimal128'\n | 'sf-integer'\n | 'sf-decimal'\n | (string & {})\n /** Number must be a multiple of this value. */\n multipleOf?: number\n /** Maximum value (inclusive). */\n maximum?: number\n /** Maximum value (exclusive). */\n exclusiveMaximum?: number\n /** Minimum value (inclusive). */\n minimum?: number\n /** Minimum value (exclusive). */\n exclusiveMinimum?: number\n} & Extensions\n\n/**\n * String validation properties for string types.\n */\nconst StringValidationProperties = Type.Object({\n type: Type.Literal('string'),\n /** Different subtypes - allow any arbitrary string, this negates the purpose of having a union of formats so we type it in typescript instead */\n format: Type.Optional(Type.String()),\n /** Maximum string length. */\n maxLength: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Minimum string length. */\n minLength: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Regular expression pattern. */\n pattern: Type.Optional(Type.String()),\n})\n\n/**\n * Supported string formats in OpenAPI schemas.\n *\n * These provide better type safety for string format validation. We wanted to allow any arbitrary string\n * in the schema, so we type it in typescript instead. This gives us autocomplete while allowing any string!\n */\ntype StringFormat =\n // Date and time formats\n | 'date'\n | 'date-time'\n | 'date-time-local'\n | 'time'\n | 'time-local'\n | 'duration'\n | 'http-date'\n // Network formats\n | 'email'\n | 'idn-email'\n | 'hostname'\n | 'idn-hostname'\n | 'ipv4'\n | 'ipv6'\n | 'uri'\n | 'uri-reference'\n | 'uri-template'\n | 'iri'\n | 'iri-reference'\n | 'uuid'\n // Content formats\n | 'binary'\n | 'byte'\n | 'base64url'\n | 'html'\n | 'commonmark'\n | 'password'\n | 'regex'\n | 'json-pointer'\n | 'relative-json-pointer'\n | 'media-range'\n // Character formats\n | 'char'\n // Structured field string formats\n | 'sf-string'\n | 'sf-token'\n | 'sf-binary'\n | 'sf-boolean'\n | (string & {})\n\ntype StringObject = CoreProperties & {\n type: 'string'\n /** Different subtypes - allow any arbitrary string, this negates the purpose of having a union of formats so we type it in typescript instead */\n format?: StringFormat\n /** Maximum string length. */\n maxLength?: number\n /** Minimum string length. */\n minLength?: number\n /** Regular expression pattern. */\n pattern?: string\n} & Extensions\n\nconst ArrayValidationPropertiesWithSchema = Type.Object({\n type: Type.Literal('array'),\n /** Maximum number of items in array. */\n maxItems: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Minimum number of items in array. */\n minItems: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Whether array items must be unique. */\n uniqueItems: Type.Optional(Type.Boolean()),\n /** Schema for array items. */\n items: Type.Optional(schemaOrReference),\n /** Schema for tuple validation. */\n prefixItems: Type.Optional(Type.Array(schemaOrReference)),\n})\n\ntype ArrayObject = CoreProperties & {\n type: 'array'\n /** Maximum number of items in array. */\n maxItems?: number\n /** Minimum number of items in array. */\n minItems?: number\n /** Whether array items must be unique. */\n uniqueItems?: boolean\n /** Schema for array items. */\n items?: SchemaReferenceType<SchemaObject>\n /** Schema for tuple validation. */\n prefixItems?: SchemaReferenceType<SchemaObject>[]\n} & Extensions\n\nconst ObjectValidationPropertiesWithSchema = Type.Object({\n type: Type.Literal('object'),\n /** Maximum number of properties. */\n maxProperties: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Minimum number of properties. */\n minProperties: Type.Optional(Type.Integer({ minimum: 0 })),\n /** Array of required property names. */\n required: Type.Optional(Type.Array(Type.String())),\n /** Object property definitions. */\n properties: Type.Optional(Type.Record(Type.String(), schemaOrReference)),\n /** Schema for additional properties. */\n additionalProperties: Type.Optional(Type.Union([Type.Boolean(), schemaOrReference])),\n /** Properties matching regex patterns. */\n patternProperties: Type.Optional(Type.Record(Type.String(), schemaOrReference)),\n})\n\ntype ObjectObject = CoreProperties & {\n type: 'object'\n /** Maximum number of properties. */\n maxProperties?: number\n /** Minimum number of properties. */\n minProperties?: number\n /** Array of required property names. */\n required?: string[]\n /** Object property definitions. */\n properties?: Record<string, SchemaReferenceType<SchemaObject>>\n /** Schema for additional properties. */\n additionalProperties?: boolean | SchemaReferenceType<SchemaObject>\n /** Properties matching regex patterns. */\n patternProperties?: Record<string, SchemaReferenceType<SchemaObject>>\n} & Extensions\n\n/** Builds the recursive schema schema */\nexport const SchemaObjectSchemaDefinition = Type.Union([\n // Keep compositions first so they get priority when union is evaluated\n // Make sure there is always a required field so not all properties are optional\n // When all properties are optional (1) typescript will not throw any warnings/error and accepts anything\n // even a non resolved ref and (2) it will match any schema so it will not validate the refs correctly\n compose(Type.Object({ __scalar_: Type.String() }), CorePropertiesWithSchema, Extensions),\n compose(OtherTypes, CorePropertiesWithSchema, Extensions),\n compose(NumericProperties, CorePropertiesWithSchema, Extensions),\n compose(StringValidationProperties, CorePropertiesWithSchema, Extensions),\n compose(ObjectValidationPropertiesWithSchema, CorePropertiesWithSchema, Extensions),\n compose(ArrayValidationPropertiesWithSchema, CorePropertiesWithSchema, Extensions),\n])\n\nexport type SchemaObject = _InternalType | OtherTypes | NumericObject | StringObject | ObjectObject | ArrayObject\nexport type MaybeRefSchemaObject = SchemaReferenceType<SchemaObject>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AAErB,SAAS,eAAe;AACxB,SAAyB,uBAAuB;AAChD,SAA6B,2BAA2B;AACxD,SAAS,aAAa;AACtB;AAAA,EAEE;AAAA,OACK;AACP,SAAiC,+BAA+B;AAChE,SAA6B,2BAA2B;AACxD,SAAyB,uBAAuB;AAChD,SAAyB,uBAAuB;AAKhD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAA+B,6BAA6B;AAI5D,MAAM,oBAAoB,KAAK,MAAM;AAAA,EACnC;AAAA,EACA,QAAQ,uBAAuB,KAAK,OAAO,EAAE,cAAc,KAAK,QAAQ,EAAE,CAAC,CAAC;AAC9E,CAAC;AAcD,MAAM,aAAa,KAAK,OAAO;AAAA,EAC7B,MAAM,KAAK,MAAM;AAAA,IACf,KAAK,QAAQ,MAAM;AAAA,IACnB,KAAK,QAAQ,SAAS;AAAA,IACtB,KAAK;AAAA,MACH,KAAK,MAAM;AAAA,QACT,KAAK,QAAQ,MAAM;AAAA,QACnB,KAAK,QAAQ,SAAS;AAAA,QACtB,KAAK,QAAQ,QAAQ;AAAA,QACrB,KAAK,QAAQ,QAAQ;AAAA,QACrB,KAAK,QAAQ,SAAS;AAAA,QACtB,KAAK,QAAQ,QAAQ;AAAA,QACrB,KAAK,QAAQ,OAAO;AAAA,MACtB,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH,CAAC;AAQD,MAAM,aAAa;AAAA,EACjB;AAAA,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|
|
2
|
-
import { type XScalarSecretHTTP, type XScalarSecretToken } from '../../../schemas/extensions/security/x-scalar-security-secrets.js';
|
|
3
2
|
import type { OAuthFlowsObject } from '../../../schemas/v3.1/strict/oauthflows.js';
|
|
4
3
|
type Description = {
|
|
5
4
|
/** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */
|
|
@@ -12,7 +11,7 @@ export type ApiKeyObject = Description & {
|
|
|
12
11
|
name: string;
|
|
13
12
|
/** REQUIRED. The location of the API key. Valid values are "query", "header", or "cookie". */
|
|
14
13
|
in: 'query' | 'header' | 'cookie';
|
|
15
|
-
}
|
|
14
|
+
};
|
|
16
15
|
export type HttpObject = Description & {
|
|
17
16
|
/** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
|
|
18
17
|
type: 'http';
|
|
@@ -20,14 +19,14 @@ export type HttpObject = Description & {
|
|
|
20
19
|
scheme: 'basic' | 'bearer';
|
|
21
20
|
/** A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes. */
|
|
22
21
|
bearerFormat?: string;
|
|
23
|
-
}
|
|
22
|
+
};
|
|
24
23
|
export type OAuth2Object = Description & {
|
|
25
24
|
/** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
|
|
26
25
|
type: 'oauth2';
|
|
27
26
|
/** REQUIRED. An object containing configuration information for the flow types supported. */
|
|
28
27
|
flows: OAuthFlowsObject;
|
|
29
28
|
} & XDefaultScopes;
|
|
30
|
-
type OpenIdConnectObject = Description & {
|
|
29
|
+
export type OpenIdConnectObject = Description & {
|
|
31
30
|
/** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
|
|
32
31
|
type: 'openIdConnect';
|
|
33
32
|
/** REQUIRED. Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata. */
|
|
@@ -41,8 +40,6 @@ type OpenIdConnectObject = Description & {
|
|
|
41
40
|
export declare const SecuritySchemeObjectSchemaDefinition: import("@scalar/typebox").TUnion<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
42
41
|
/** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */
|
|
43
42
|
description: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
44
|
-
}>, import("@scalar/typebox").TObject<{
|
|
45
|
-
'x-scalar-secret-token': import("@scalar/typebox").TString;
|
|
46
43
|
}>, import("@scalar/typebox").TObject<{
|
|
47
44
|
/** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
|
|
48
45
|
type: import("@scalar/typebox").TLiteral<"apiKey">;
|
|
@@ -53,11 +50,6 @@ export declare const SecuritySchemeObjectSchemaDefinition: import("@scalar/typeb
|
|
|
53
50
|
}>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
54
51
|
/** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */
|
|
55
52
|
description: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
56
|
-
}>, import("@scalar/typebox").TObject<{
|
|
57
|
-
'x-scalar-secret-token': import("@scalar/typebox").TString;
|
|
58
|
-
}>, import("@scalar/typebox").TObject<{
|
|
59
|
-
'x-scalar-secret-username': import("@scalar/typebox").TString;
|
|
60
|
-
'x-scalar-secret-password': import("@scalar/typebox").TString;
|
|
61
53
|
}>, import("@scalar/typebox").TObject<{
|
|
62
54
|
/** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
|
|
63
55
|
type: import("@scalar/typebox").TLiteral<"http">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../../../src/schemas/v3.1/strict/security-scheme.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gDAAgD,C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;IAEhQ,uMAAuM;;;IArCzM,qGAAqG;;;IAsDnG,4HAA4H;;IAE5H,6FAA6F;;;;;IAxD/F,qGAAqG;;;IAwEnG,4HAA4H;;IAE5H,+FAA+F;;MAiBc,CAAA;AAEjH,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,mBAAmB,CAAA"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { Type } from "@scalar/typebox";
|
|
2
2
|
import { compose } from "../../../schemas/compose.js";
|
|
3
3
|
import { XDefaultScopesSchema } from "../../../schemas/extensions/security/x-default-scopes.js";
|
|
4
|
-
import {
|
|
5
|
-
XScalarSecretHTTPSchema,
|
|
6
|
-
XScalarSecretTokenSchema
|
|
7
|
-
} from "../../../schemas/extensions/security/x-scalar-security-secrets.js";
|
|
8
4
|
import { OAuthFlowsObjectRef } from "../../../schemas/v3.1/strict/ref-definitions.js";
|
|
9
5
|
const DescriptionSchema = Type.Object({
|
|
10
6
|
/** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */
|
|
@@ -12,7 +8,6 @@ const DescriptionSchema = Type.Object({
|
|
|
12
8
|
});
|
|
13
9
|
const ApiKeySchema = compose(
|
|
14
10
|
DescriptionSchema,
|
|
15
|
-
XScalarSecretTokenSchema,
|
|
16
11
|
Type.Object({
|
|
17
12
|
/** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
|
|
18
13
|
type: Type.Literal("apiKey"),
|
|
@@ -24,8 +19,6 @@ const ApiKeySchema = compose(
|
|
|
24
19
|
);
|
|
25
20
|
const HttpSchema = compose(
|
|
26
21
|
DescriptionSchema,
|
|
27
|
-
XScalarSecretTokenSchema,
|
|
28
|
-
XScalarSecretHTTPSchema,
|
|
29
22
|
Type.Object({
|
|
30
23
|
/** REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "mutualTLS", "oauth2", "openIdConnect". */
|
|
31
24
|
type: Type.Literal("http"),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/schemas/v3.1/strict/security-scheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { Type } from '@scalar/typebox'\n\nimport { compose } from '@/schemas/compose'\nimport { type XDefaultScopes, XDefaultScopesSchema } from '@/schemas/extensions/security/x-default-scopes'\nimport
|
|
5
|
-
"mappings": "AAAA,SAAS,YAAY;AAErB,SAAS,eAAe;AACxB,SAA8B,4BAA4B;
|
|
4
|
+
"sourcesContent": ["import { Type } from '@scalar/typebox'\n\nimport { compose } from '@/schemas/compose'\nimport { type XDefaultScopes, XDefaultScopesSchema } from '@/schemas/extensions/security/x-default-scopes'\nimport type { OAuthFlowsObject } from '@/schemas/v3.1/strict/oauthflows'\nimport { OAuthFlowsObjectRef } from '@/schemas/v3.1/strict/ref-definitions'\n\nconst DescriptionSchema = Type.Object({\n /** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */\n description: Type.Optional(Type.String()),\n})\n\ntype Description = {\n /** A description for security scheme. CommonMark syntax MAY be used for rich text representation. */\n description?: string\n}\n\nconst ApiKeySchema = compose(\n DescriptionSchema,\n Type.Object({\n /** REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\", \"openIdConnect\". */\n type: Type.Literal('apiKey'),\n /** REQUIRED. The name of the header, query or cookie parameter to be used. */\n name: Type.String(),\n /** REQUIRED. The location of the API key. Valid values are \"query\", \"header\", or \"cookie\". */\n in: Type.Union([Type.Literal('query'), Type.Literal('header'), Type.Literal('cookie')]),\n }),\n)\n\nexport type ApiKeyObject = Description & {\n /** REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\", \"openIdConnect\". */\n type: 'apiKey'\n /** REQUIRED. The name of the header, query or cookie parameter to be used. */\n name: string\n /** REQUIRED. The location of the API key. Valid values are \"query\", \"header\", or \"cookie\". */\n in: 'query' | 'header' | 'cookie'\n}\n\nconst HttpSchema = compose(\n DescriptionSchema,\n Type.Object({\n /** REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\", \"openIdConnect\". */\n type: Type.Literal('http'),\n /** REQUIRED. The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive, as defined in RFC7235. */\n scheme: Type.Union([Type.Literal('basic'), Type.Literal('bearer')]),\n /** A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes. */\n bearerFormat: Type.Optional(Type.String()),\n }),\n)\n\nexport type HttpObject = Description & {\n /** REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\", \"openIdConnect\". */\n type: 'http'\n /** REQUIRED. The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive, as defined in RFC7235. */\n scheme: 'basic' | 'bearer'\n /** A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes. */\n bearerFormat?: string\n}\n\nconst OAuth2 = compose(\n DescriptionSchema,\n Type.Object({\n /** REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\", \"openIdConnect\". */\n type: Type.Literal('oauth2'),\n /** REQUIRED. An object containing configuration information for the flow types supported. */\n flows: OAuthFlowsObjectRef,\n }),\n XDefaultScopesSchema,\n)\n\nexport type OAuth2Object = Description & {\n /** REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\", \"openIdConnect\". */\n type: 'oauth2'\n /** REQUIRED. An object containing configuration information for the flow types supported. */\n flows: OAuthFlowsObject\n} & XDefaultScopes\n\nconst OpenIdConnect = compose(\n DescriptionSchema,\n Type.Object({\n /** REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\", \"openIdConnect\". */\n type: Type.Literal('openIdConnect'),\n /** REQUIRED. Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata. */\n openIdConnectUrl: Type.String(),\n }),\n)\n\nexport type OpenIdConnectObject = Description & {\n /** REQUIRED. The type of the security scheme. Valid values are \"apiKey\", \"http\", \"mutualTLS\", \"oauth2\", \"openIdConnect\". */\n type: 'openIdConnect'\n /** REQUIRED. Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata. */\n openIdConnectUrl: string\n}\n\n/**\n * Defines a security scheme that can be used by the operations.\n *\n * Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, client credentials and authorization code) as defined in RFC6749, and [[OpenID-Connect-Core]]. Please note that as of 2020, the implicit flow is about to be deprecated by OAuth 2.0 Security Best Current Practice. Recommended for most use cases is Authorization Code Grant flow with PKCE.\n */\nexport const SecuritySchemeObjectSchemaDefinition = Type.Union([ApiKeySchema, HttpSchema, OAuth2, OpenIdConnect])\n\nexport type SecuritySchemeObject = ApiKeyObject | HttpObject | OAuth2Object | OpenIdConnectObject\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AAErB,SAAS,eAAe;AACxB,SAA8B,4BAA4B;AAE1D,SAAS,2BAA2B;AAEpC,MAAM,oBAAoB,KAAK,OAAO;AAAA;AAAA,EAEpC,aAAa,KAAK,SAAS,KAAK,OAAO,CAAC;AAC1C,CAAC;AAOD,MAAM,eAAe;AAAA,EACnB;AAAA,EACA,KAAK,OAAO;AAAA;AAAA,IAEV,MAAM,KAAK,QAAQ,QAAQ;AAAA;AAAA,IAE3B,MAAM,KAAK,OAAO;AAAA;AAAA,IAElB,IAAI,KAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,GAAG,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,QAAQ,CAAC,CAAC;AAAA,EACxF,CAAC;A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