Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stoplight/types

Package Overview
Dependencies
Maintainers
7
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/types - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

__tests__/index.spec.d.ts

167

http.d.ts

@@ -1,149 +0,24 @@

import { INode } from './node';
import { ISchema } from './schema';
import { IServer } from './server';
export interface IHttpOperation extends INode {
method: string;
path: string;
responses: IHttpResponse[];
servers?: IServer[];
request?: IHttpRequestParams;
security?: HttpSecurityScheme[];
deprecated?: boolean;
import { Dictionary } from './basic';
import { IHttpOperation } from './http-spec';
export declare type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'options';
export declare type ExtendedHttpMethod = HttpMethod | 'copy' | 'link' | 'unlink' | 'purge' | 'lock' | 'unlock';
export interface IHttpLog<T = any> {
request: IHttpRequest<T>;
response?: IHttpResponse<T>;
operation?: IHttpOperation;
}
export interface IExample {
key: string;
summary?: string;
description?: string;
value?: any;
externalValue?: any;
export interface IHttpRequest<T = any> {
method: HttpMethod;
url: string;
baseUrl: string;
headers: HttpNameValue;
query: HttpNameValues;
body?: T;
}
export interface IHttpParam {
name: string;
style?: HttpParamStyles;
description?: string;
required?: boolean;
explode?: boolean;
deprecated?: boolean;
content: {
[mediaType: string]: IHttpContent;
};
export interface IHttpResponse<T = any> {
status: number;
headers: HttpNameValue;
body?: T;
}
export declare const enum HttpParamStyles {
Simple = "simple",
Matrix = "matrix",
Label = "label",
Form = "form",
SpaceDelimited = "spaceDelimited",
PipeDelimited = "pipeDelimited",
DeepObject = "deepObject"
}
export interface IHttpPathParam extends IHttpParam {
style?: HttpParamStyles.Label | HttpParamStyles.Matrix | HttpParamStyles.Simple;
}
export interface IHttpQueryParam extends IHttpParam {
style?: HttpParamStyles.Form | HttpParamStyles.SpaceDelimited | HttpParamStyles.PipeDelimited | HttpParamStyles.DeepObject;
allowEmptyValue?: boolean;
allowReserved?: boolean;
}
export interface IHttpHeaderParam extends IHttpParam {
style?: HttpParamStyles.Simple;
}
export interface IHttpCookieParam extends IHttpParam {
style?: HttpParamStyles.Form;
}
export interface IHttpEncoding {
property: string;
mediaType?: string;
headers?: IHttpHeaderParam[];
style: HttpParamStyles.Form | HttpParamStyles.SpaceDelimited | HttpParamStyles.PipeDelimited | HttpParamStyles.DeepObject;
explode?: boolean;
allowReserved?: boolean;
}
export interface IHttpContent {
mediaType: string;
schema?: ISchema;
examples?: IExample[];
encodings?: IHttpEncoding[];
}
export interface IHttpLink {
operationRef: string;
parameters: Array<{
name: string;
value?: any;
expression?: string;
}>;
requestBody?: any;
description?: string;
server?: IServer;
}
export interface IHttpRequestBody {
description?: string;
required?: boolean;
contents: IHttpContent[];
}
export interface IHttpRequestParams {
path?: IHttpPathParam[];
query?: IHttpQueryParam[];
headers?: IHttpHeaderParam[];
cookie?: IHttpCookieParam[];
body?: IHttpRequestBody;
}
export interface IHttpResponse {
code: string;
contents: IHttpContent[];
description?: string;
headers?: IHttpHeaderParam[];
links?: IHttpLink;
}
declare type HttpSecurityScheme = IApiKeySecurityScheme | IBearerSecurityScheme | IBasicSecurityScheme | IOauth2SecurityScheme | IOpenIdConnectSecurityScheme;
export interface ISecurityScheme {
description?: string;
}
export interface IApiKeySecurityScheme extends ISecurityScheme {
type: 'apiKey';
name: string;
in: 'query' | 'header' | 'cookie';
}
export interface IBearerSecurityScheme extends ISecurityScheme {
type: 'http';
scheme: 'bearer';
bearerFormat?: string;
}
export interface IBasicSecurityScheme extends ISecurityScheme {
type: 'http';
scheme: 'basic';
}
export interface IOpenIdConnectSecurityScheme extends ISecurityScheme {
type: 'openIdConnect';
openIdConnectUrl: string;
}
export interface IOauth2SecurityScheme extends ISecurityScheme {
type: 'oauth2';
flows: IOauthFlowObjects;
}
export interface IOauthFlowObjects {
implicit?: IOauth2ImplicitFlow;
password?: IOauth2PasswordFlow;
clientCredentials?: IOauth2ClientCredentialsFlow;
authorizationCode?: IOauth2AuthorizationCodeFlow;
}
export interface IOauth2Flow {
refreshUrl?: string;
scopes: Array<{
[name: string]: string;
}>;
}
export interface IOauth2ImplicitFlow extends IOauth2Flow {
authorizationUrl: string;
}
export interface IOauth2AuthorizationCodeFlow extends IOauth2Flow {
authorizationUrl: string;
tokenUrl: string;
}
export interface IOauth2PasswordFlow extends IOauth2Flow {
tokenUrl: string;
}
export interface IOauth2ClientCredentialsFlow extends IOauth2Flow {
tokenUrl: string;
}
export {};
export declare type HttpNameValue = Dictionary<string, string>;
export declare type HttpNameValues = Dictionary<string[], string>;

@@ -0,7 +1,9 @@

export * from './basic';
export * from './graph';
export * from './http-spec';
export * from './http';
export * from './logs';
export * from './node';
export * from './parsers';
export * from './schema';
export * from './server';
export * from './schemas';
export * from './servers';
export * from './validations';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./http"), exports);
tslib_1.__exportStar(require("./http-spec"), exports);
tslib_1.__exportStar(require("./logs"), exports);
tslib_1.__exportStar(require("./validations"), exports);
//# sourceMappingURL=index.js.map

@@ -9,1 +9,9 @@ export declare const enum LogLevel {

}
export declare const enum LogLevelLabel {
Trace = "trace",
Debug = "debug",
Info = "info",
Warn = "warn",
Error = "error",
Fatal = "fatal"
}
{
"name": "@stoplight/types",
"version": "2.0.0",
"version": "3.0.0",
"description": "Common typings for the Stoplight ecosystem.",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -1,5 +0,8 @@

import { IValidation } from './validations';
import { Dictionary } from './basic';
import { IValidationResult } from './validations';
export declare type SourceMapParser<T = any> = (value: string) => IParserResult<T>;
export declare type ObjPath = Array<string | number>;
export interface IPosition {
line: number;
column?: number;
}

@@ -10,9 +13,7 @@ export interface IPathPosition {

}
export interface IParserResultPointers {
[path: string]: IPathPosition;
}
export declare type IParserResultPointers = Dictionary<IPathPosition, string>;
export interface IParserResult<T = any> {
data: T;
pointers: IParserResultPointers;
validations: IValidation[];
validations: IValidationResult[];
}

@@ -1,9 +0,21 @@

import { LogLevel } from './logs';
import { IPathPosition } from './parsers';
export interface IValidation {
ruleId: string;
level?: LogLevel;
line?: number;
column?: number;
import { IPathPosition, ObjPath } from './parsers';
export declare enum ValidationSeverity {
Info = 30,
Warn = 40,
Error = 50
}
export declare enum ValidationSeverityLabel {
Info = "info",
Warn = "warn",
Error = "error"
}
export interface IValidationResult {
name: string;
severity: ValidationSeverity;
severityLabel: ValidationSeverityLabel;
message?: string;
description?: string;
path?: ObjPath;
location?: IPathPosition;
[key: string]: any;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ValidationSeverity;
(function (ValidationSeverity) {
ValidationSeverity[ValidationSeverity["Info"] = 30] = "Info";
ValidationSeverity[ValidationSeverity["Warn"] = 40] = "Warn";
ValidationSeverity[ValidationSeverity["Error"] = 50] = "Error";
})(ValidationSeverity = exports.ValidationSeverity || (exports.ValidationSeverity = {}));
var ValidationSeverityLabel;
(function (ValidationSeverityLabel) {
ValidationSeverityLabel["Info"] = "info";
ValidationSeverityLabel["Warn"] = "warn";
ValidationSeverityLabel["Error"] = "error";
})(ValidationSeverityLabel = exports.ValidationSeverityLabel || (exports.ValidationSeverityLabel = {}));
//# sourceMappingURL=validations.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc