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

openapi3-ts

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi3-ts - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

.github/workflows/ci.yaml

6

Changelog.md
# Changelog: openapi3-ts
## Version 4.0.2
2023.03.30
- PR [#104](https://github.com/metadevpro/openapi3-ts/pull/104) Fix export for cjs by @RobinTail
## Version 4.0.1

@@ -4,0 +10,0 @@

2

dist/cjs/dsl/openapi-builder30.d.ts

@@ -1,2 +0,2 @@

import * as oa from '../model/openapi30.js';
import * as oa from '../model/openapi30';
export declare class OpenApiBuilder {

@@ -3,0 +3,0 @@ rootDoc: oa.OpenAPIObject;

@@ -1,2 +0,2 @@

import * as oa from '../model/openapi31.js';
import * as oa from '../model/openapi31';
export declare class OpenApiBuilder {

@@ -3,0 +3,0 @@ rootDoc: oa.OpenAPIObject;

@@ -1,2 +0,3 @@

export * from './model/index.js';
export * from './dsl/index.js';
export * as oas30 from "./oas30";
export * as oas31 from "./oas31";
export { Server, ServerVariable } from "./model/server";
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./model/index.js"), exports);
__exportStar(require("./dsl/index.js"), exports);
exports.ServerVariable = exports.Server = exports.oas31 = exports.oas30 = void 0;
exports.oas30 = require("./oas30");
exports.oas31 = require("./oas31");
var server_1 = require("./model/server");
Object.defineProperty(exports, "Server", { enumerable: true, get: function () { return server_1.Server; } });
Object.defineProperty(exports, "ServerVariable", { enumerable: true, get: function () { return server_1.ServerVariable; } });

@@ -1,2 +0,2 @@

import { ISpecificationExtension } from './specificationExtension';
import { ISpecificationExtension } from './specification-extension';
export interface ServerObject extends ISpecificationExtension {

@@ -3,0 +3,0 @@ url: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addExtension = exports.getExtension = void 0;
const specificationExtension_1 = require("./specificationExtension");
const specification_extension_1 = require("./specification-extension");
function getExtension(obj, extensionName) {

@@ -9,3 +9,3 @@ if (!obj) {

}
if (specificationExtension_1.SpecificationExtension.isValidExtension(extensionName)) {
if (specification_extension_1.SpecificationExtension.isValidExtension(extensionName)) {
return obj[extensionName];

@@ -17,3 +17,3 @@ }

function addExtension(obj, extensionName, extension) {
if (obj && specificationExtension_1.SpecificationExtension.isValidExtension(extensionName)) {
if (obj && specification_extension_1.SpecificationExtension.isValidExtension(extensionName)) {
obj[extensionName] = extension;

@@ -20,0 +20,0 @@ }

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

import { ServerObject } from './oas-common.js';
import { ISpecificationExtension } from './specificationExtension.js';
export * from './oas-common.js';
export { ISpecificationExtension, SpecificationExtension } from './specificationExtension.js';
import { ServerObject } from './oas-common';
import { ISpecificationExtension } from './specification-extension';
export * from './oas-common';
export { ISpecificationExtension, SpecificationExtension } from './specification-extension';
export interface OpenAPIObject extends ISpecificationExtension {

@@ -6,0 +6,0 @@ openapi: string;

@@ -18,8 +18,8 @@ "use strict";

exports.isSchemaObject = exports.isReferenceObject = exports.getPath = exports.SpecificationExtension = void 0;
const specificationExtension_js_1 = require("./specificationExtension.js");
__exportStar(require("./oas-common.js"), exports);
var specificationExtension_js_2 = require("./specificationExtension.js");
Object.defineProperty(exports, "SpecificationExtension", { enumerable: true, get: function () { return specificationExtension_js_2.SpecificationExtension; } });
const specification_extension_1 = require("./specification-extension");
__exportStar(require("./oas-common"), exports);
var specification_extension_2 = require("./specification-extension");
Object.defineProperty(exports, "SpecificationExtension", { enumerable: true, get: function () { return specification_extension_2.SpecificationExtension; } });
function getPath(pathsObject, path) {
if (specificationExtension_js_1.SpecificationExtension.isValidExtension(path)) {
if (specification_extension_1.SpecificationExtension.isValidExtension(path)) {
return undefined;

@@ -26,0 +26,0 @@ }

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

import { ServerObject } from './oas-common.js';
import { ISpecificationExtension } from './specificationExtension.js';
export * from './oas-common.js';
export { ISpecificationExtension, SpecificationExtension } from './specificationExtension.js';
import { ServerObject } from './oas-common';
import { ISpecificationExtension } from './specification-extension';
export * from './oas-common';
export { ISpecificationExtension, SpecificationExtension } from './specification-extension';
export interface OpenAPIObject extends ISpecificationExtension {

@@ -6,0 +6,0 @@ openapi: string;

@@ -18,8 +18,8 @@ "use strict";

exports.isSchemaObject = exports.isReferenceObject = exports.getPath = exports.SpecificationExtension = void 0;
const specificationExtension_js_1 = require("./specificationExtension.js");
__exportStar(require("./oas-common.js"), exports);
var specificationExtension_js_2 = require("./specificationExtension.js");
Object.defineProperty(exports, "SpecificationExtension", { enumerable: true, get: function () { return specificationExtension_js_2.SpecificationExtension; } });
const specification_extension_1 = require("./specification-extension");
__exportStar(require("./oas-common"), exports);
var specification_extension_2 = require("./specification-extension");
Object.defineProperty(exports, "SpecificationExtension", { enumerable: true, get: function () { return specification_extension_2.SpecificationExtension; } });
function getPath(pathsObject, path) {
if (specificationExtension_js_1.SpecificationExtension.isValidExtension(path)) {
if (specification_extension_1.SpecificationExtension.isValidExtension(path)) {
return undefined;

@@ -26,0 +26,0 @@ }

@@ -1,3 +0,3 @@

import { ServerObject, ServerVariableObject } from './oas-common.js';
import { IExtensionName, IExtensionType } from './specificationExtension.js';
import { ServerObject, ServerVariableObject } from './oas-common';
import { IExtensionName, IExtensionType } from './specification-extension';
export declare class Server implements ServerObject {

@@ -4,0 +4,0 @@ url: string;

@@ -1,2 +0,2 @@

import * as oa from '../model/openapi30.js';
import * as oa from '../model/openapi30';
export declare class OpenApiBuilder {

@@ -3,0 +3,0 @@ rootDoc: oa.OpenAPIObject;

@@ -1,2 +0,2 @@

import * as oa from '../model/openapi31.js';
import * as oa from '../model/openapi31';
export declare class OpenApiBuilder {

@@ -3,0 +3,0 @@ rootDoc: oa.OpenAPIObject;

@@ -1,2 +0,3 @@

export * from './model/index.js';
export * from './dsl/index.js';
export * as oas30 from "./oas30";
export * as oas31 from "./oas31";
export { Server, ServerVariable } from "./model/server";

@@ -1,2 +0,3 @@

export * from './model/index.js';
export * from './dsl/index.js';
export * as oas30 from "./oas30";
export * as oas31 from "./oas31";
export { Server, ServerVariable } from "./model/server";

@@ -1,2 +0,2 @@

import { ISpecificationExtension } from './specificationExtension';
import { ISpecificationExtension } from './specification-extension';
export interface ServerObject extends ISpecificationExtension {

@@ -3,0 +3,0 @@ url: string;

@@ -1,2 +0,2 @@

import { SpecificationExtension } from './specificationExtension';
import { SpecificationExtension } from './specification-extension';
export function getExtension(obj, extensionName) {

@@ -3,0 +3,0 @@ if (!obj) {

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

import { ServerObject } from './oas-common.js';
import { ISpecificationExtension } from './specificationExtension.js';
export * from './oas-common.js';
export { ISpecificationExtension, SpecificationExtension } from './specificationExtension.js';
import { ServerObject } from './oas-common';
import { ISpecificationExtension } from './specification-extension';
export * from './oas-common';
export { ISpecificationExtension, SpecificationExtension } from './specification-extension';
export interface OpenAPIObject extends ISpecificationExtension {

@@ -6,0 +6,0 @@ openapi: string;

@@ -1,4 +0,4 @@

import { SpecificationExtension } from './specificationExtension.js';
export * from './oas-common.js';
export { SpecificationExtension } from './specificationExtension.js';
import { SpecificationExtension } from './specification-extension';
export * from './oas-common';
export { SpecificationExtension } from './specification-extension';
export function getPath(pathsObject, path) {

@@ -5,0 +5,0 @@ if (SpecificationExtension.isValidExtension(path)) {

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

import { ServerObject } from './oas-common.js';
import { ISpecificationExtension } from './specificationExtension.js';
export * from './oas-common.js';
export { ISpecificationExtension, SpecificationExtension } from './specificationExtension.js';
import { ServerObject } from './oas-common';
import { ISpecificationExtension } from './specification-extension';
export * from './oas-common';
export { ISpecificationExtension, SpecificationExtension } from './specification-extension';
export interface OpenAPIObject extends ISpecificationExtension {

@@ -6,0 +6,0 @@ openapi: string;

@@ -1,4 +0,4 @@

import { SpecificationExtension } from './specificationExtension.js';
export * from './oas-common.js';
export { SpecificationExtension } from './specificationExtension.js';
import { SpecificationExtension } from './specification-extension';
export * from './oas-common';
export { SpecificationExtension } from './specification-extension';
export function getPath(pathsObject, path) {

@@ -5,0 +5,0 @@ if (SpecificationExtension.isValidExtension(path)) {

@@ -1,3 +0,3 @@

import { ServerObject, ServerVariableObject } from './oas-common.js';
import { IExtensionName, IExtensionType } from './specificationExtension.js';
import { ServerObject, ServerVariableObject } from './oas-common';
import { IExtensionName, IExtensionType } from './specification-extension';
export declare class Server implements ServerObject {

@@ -4,0 +4,0 @@ url: string;

{
"name": "openapi3-ts",
"version": "4.0.1",
"version": "4.0.2",
"description": "TS Model & utils for OpenAPI 3.x specification.",

@@ -14,12 +14,14 @@ "main": "dist/cjs/index.js",

"clean": "rimraf dist",
"build": "rimraf dist && npm run lint && tsc && tsc -p tsconfig-cjs.json",
"build:w": "BUILD_WATCH=true node build.mjs",
"build": "npm run build:mjs && npm run build:cjs",
"version": "node --version && npm --version && eslint --version && tsc --version && vitest --version",
"build:mjs": "tsc",
"build:cjs": "tsc -p tsconfig-cjs.json",
"build:all": "rimraf dist && npm run lint && npm run build && npm test",
"lint": "eslint src/**/*.ts",
"lint:fix": "eslint src/**/*.ts --fix",
"prepare": "npm run build",
"test:tdd": "vitest -w",
"test": "vitest",
"test:ci": "npm run test",
"cover:ci": "npm run cover",
"cover": "vitest --coverage"
"cover": "vitest --coverage",
"cover:ci": "npm run cover"
},

@@ -26,0 +28,0 @@ "keywords": [

@@ -22,9 +22,10 @@ # OpenApi3-TS

```typescript
import { OpenAPIObject, OpenApiBuilder } from "openapi3-ts";
import { oas31 } from "openapi3-ts";
```
Or direclty from the sources:
Or directly from sources:
```typescript
import { OpenAPIObject, OpenApiBuilder } from "openapi3-ts/src";
import { OpenAPIObject } from "openapi3-ts/src/model/openapi31";
import { OpenApiBuilder } from "openapi3-ts/src/dsl/openapi-builder31";
```

@@ -35,4 +36,3 @@

```javascript
import * as openapi31 from 'openapi3-ts';
import { oas31 } from 'openapi3-ts';
```

@@ -45,4 +45,3 @@

```typescript
import { OpenAPIObject } from "openapi3-ts/model/openapi30";
import { OpenApiBuilder } from "openapi3-ts/dsl/openapi-builder30";
import { oas30 } from "openapi3-ts";
```

@@ -53,4 +52,4 @@

```typescript
import { OpenAPIObject } from "openapi3-ts/src/model/openapi30";
import { OpenApiBuilder } from "openapi3-ts/src/dsl/openapi-builder30";
import { OpenAPIObject } from "openapi3-ts/src/model/openapi30";
import { OpenApiBuilder } from "openapi3-ts/src/dsl/openapi-builder30";
```

@@ -61,4 +60,3 @@

```javascript
import * as model from 'openapi3-ts/dist/cjs/model/openapi30';
import * as dsl from 'openapi3-ts/dist/cjs/dsl/openapi-builder30';
import { oas30 } from "openapi3-ts";
```

@@ -65,0 +63,0 @@

import { describe, expect, it } from 'vitest';
import { addExtension, getExtension } from '../model/oas-common.js';
import * as oa from '../model/openapi30.js';
import { OpenApiBuilder } from './openapi-builder30.js';
import { addExtension, getExtension } from '../model/oas-common';
import * as oa from '../model/openapi30';
import { OpenApiBuilder } from './openapi-builder30';

@@ -6,0 +6,0 @@ describe('OpenApiBuilder', () => {

import * as yaml from 'yaml';
import * as oa from '../model/openapi30.js';
import * as oa from '../model/openapi30';

@@ -4,0 +4,0 @@ // Internal DSL for building an OpenAPI 3.0.x contract

import { describe, expect, it } from 'vitest';
import { addExtension, getExtension } from '../model/oas-common';
import * as oa from '../model/openapi31.js';
import { OpenApiBuilder } from './openapi-builder31.js';
import * as oa from '../model/openapi31';
import { OpenApiBuilder } from './openapi-builder31';

@@ -6,0 +6,0 @@ describe('OpenApiBuilder', () => {

import * as yaml from 'yaml';
import * as oa from '../model/openapi31.js';
import * as oa from '../model/openapi31';

@@ -4,0 +4,0 @@ // Internal DSL for building an OpenAPI 3.1.x contract

import { describe, expect, it } from 'vitest';
import { OpenApiBuilder, Server, ServerVariable } from '.';
import { oas30, oas31, Server, ServerVariable } from '.';
describe('Top barrel', () => {
it('OpenApiBuilder is exported', () => {
const sut = OpenApiBuilder.create();
it('OpenApiBuilder v. 3.0 is exported', () => {
const sut = oas30.OpenApiBuilder.create();
expect(sut).not.toBeNull;
expect(sut.rootDoc.openapi).toBe("3.0.0");
});
it('OpenApiBuilder v. 3.1 is exported', () => {
const sut = oas31.OpenApiBuilder.create();
expect(sut).not.toBeNull;
expect(sut.rootDoc.openapi).toBe("3.1.0");
});
it('Server is exported', () => {

@@ -10,0 +16,0 @@ const sut = new Server('a', 'b');

@@ -1,2 +0,3 @@

export * from './model/index.js';
export * from './dsl/index.js';
export * as oas30 from "./oas30";
export * as oas31 from "./oas31";
export { Server, ServerVariable } from "./model/server"
/* eslint-disable @typescript-eslint/no-explicit-any */
import { ISpecificationExtension, SpecificationExtension } from './specificationExtension';
import { ISpecificationExtension, SpecificationExtension } from './specification-extension';

@@ -5,0 +5,0 @@ export interface ServerObject extends ISpecificationExtension {

import { describe, expect, it } from 'vitest';
import { addExtension } from './oas-common';
import { isReferenceObject, isSchemaObject, ReferenceObject, SchemaObject } from './openapi30';
import { IExtensionName, IExtensionType } from './SpecificationExtension';
import { ReferenceObject, SchemaObject, isReferenceObject, isSchemaObject } from './openapi30';
import { IExtensionName, IExtensionType } from './specification-extension';

@@ -6,0 +6,0 @@ describe('type-guards unit tests', () => {

@@ -6,7 +6,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

import { ServerObject } from './oas-common.js';
import { ISpecificationExtension, SpecificationExtension } from './specificationExtension.js';
import { ServerObject } from './oas-common';
import { ISpecificationExtension, SpecificationExtension } from './specification-extension';
export * from './oas-common.js';
export { ISpecificationExtension, SpecificationExtension } from './specificationExtension.js';
export * from './oas-common';
export { ISpecificationExtension, SpecificationExtension } from './specification-extension';

@@ -13,0 +13,0 @@ export interface OpenAPIObject extends ISpecificationExtension {

import { describe, expect, it } from 'vitest';
import {
ReferenceObject,
SchemaObject,
addExtension,
isReferenceObject,
isSchemaObject,
ReferenceObject,
SchemaObject
isSchemaObject
} from './openapi31';
import { IExtensionName, IExtensionType } from './SpecificationExtension';
import { IExtensionName, IExtensionType } from './specification-extension';

@@ -11,0 +11,0 @@ describe('type-guards unit tests', () => {

@@ -6,7 +6,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

import { ServerObject } from './oas-common.js';
import { ISpecificationExtension, SpecificationExtension } from './specificationExtension.js';
import { ServerObject } from './oas-common';
import { ISpecificationExtension, SpecificationExtension } from './specification-extension';
export * from './oas-common.js';
export { ISpecificationExtension, SpecificationExtension } from './specificationExtension.js';
export * from './oas-common';
export { ISpecificationExtension, SpecificationExtension } from './specification-extension';

@@ -256,3 +256,10 @@ export interface OpenAPIObject extends ISpecificationExtension {

export type SchemaObjectType = 'integer' | 'number' | 'string' | 'boolean' | 'object' | 'null' | 'array';
export type SchemaObjectType =
| 'integer'
| 'number'
| 'string'
| 'boolean'
| 'object'
| 'null'
| 'array';

@@ -259,0 +266,0 @@ export interface SchemaObject extends ISpecificationExtension {

@@ -1,3 +0,3 @@

import { ServerObject, ServerVariableObject } from './oas-common.js';
import { IExtensionName, IExtensionType } from './specificationExtension.js';
import { ServerObject, ServerVariableObject } from './oas-common';
import { IExtensionName, IExtensionType } from './specification-extension';

@@ -4,0 +4,0 @@ // Server & Server Variable

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