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

@openapi-generator-plus/types

Package Overview
Dependencies
Maintainers
0
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openapi-generator-plus/types - npm Package Compare versions

Comparing version 2.16.0 to 2.17.0

12

dist/native-types.d.ts

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

import { CodegenNativeType } from './types';
import { CodegenNativeType, CodegenNativeTypeInfo } from './types';
export type CodegenNativeTypeStringComposer = (nativeTypeStrings: string[]) => string;
export type CodegenNativeTypeComposer = (nativeTypes: CodegenNativeType[]) => string;
type DefaultCodegenNativeTypeInfoComposer = (nativeTypes: CodegenNativeType[]) => CodegenNativeTypeInfo | null;
export type CodegenNativeTypeInfoComposer = (nativeTypes: CodegenNativeType[], defaultComposer: DefaultCodegenNativeTypeInfoComposer) => CodegenNativeTypeInfo | null;
/**

@@ -11,2 +13,7 @@ * Transform the given native type.

export type CodegenNativeTypeTransformer = (nativeType: CodegenNativeType, nativeTypeString: string) => string;
/**
* Transform the native type info
* @param nativeType the native type
*/
export type CodegenNativeTypeInfoTransformer = (nativeType: CodegenNativeType) => CodegenNativeTypeInfo | null;
export interface CodegenNativeTypeTransformers {

@@ -30,2 +37,3 @@ /**

componentType?: CodegenNativeTypeTransformers | null;
info?: CodegenNativeTypeInfoTransformer | null;
}

@@ -42,2 +50,3 @@ export interface CodegenTransformingNativeTypeConstructor {

concreteType?: CodegenNativeTypeComposer;
info?: CodegenNativeTypeInfoComposer;
}

@@ -47,1 +56,2 @@ export interface CodegenComposingNativeTypeConstructor {

}
export {};

4

dist/type-guards.d.ts

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

import { CodegenAllOfSchema, CodegenAnyOfSchema, CodegenArraySchema, CodegenBooleanSchema, CodegenDiscriminatableSchema, CodegenDiscriminatorSchema, CodegenEnumSchema, CodegenInterfaceSchema, CodegenMapSchema, CodegenNamedSchema, CodegenNumericSchema, CodegenObjectLikeSchemas, CodegenObjectSchema, CodegenOneOfSchema, CodegenSchema, CodegenScope, CodegenStringSchema, CodegenWrapperSchema, CodegenSchemaUsage, CodegenHierarchySchema, CodegenOperation } from './types';
import { CodegenAllOfSchema, CodegenAnyOfSchema, CodegenArraySchema, CodegenBooleanSchema, CodegenDiscriminatableSchema, CodegenDiscriminatorSchema, CodegenEnumSchema, CodegenInterfaceSchema, CodegenMapSchema, CodegenNamedSchema, CodegenNumericSchema, CodegenObjectLikeSchemas, CodegenObjectSchema, CodegenOneOfSchema, CodegenSchema, CodegenScope, CodegenStringSchema, CodegenWrapperSchema, CodegenSchemaUsage, CodegenHierarchySchema, CodegenOperation, CodegenParameter, CodegenProperty } from './types';
export declare function isCodegenNumericSchema(schema: CodegenSchema): schema is CodegenNumericSchema;

@@ -23,1 +23,3 @@ export declare function isCodegenBooleanSchema(schema: CodegenSchema): schema is CodegenBooleanSchema;

export declare function isCodegenOperation(ob: unknown): ob is CodegenOperation;
export declare function isCodegenProperty(ob: unknown): ob is CodegenProperty;
export declare function isCodegenParameter(ob: unknown): ob is CodegenParameter;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isCodegenOperation = exports.isCodegenSchemaUsage = exports.isCodegenDiscriminatableSchema = exports.isCodegenDiscriminatorSchema = exports.isCodegenWrapperSchema = exports.isCodegenHierarchySchema = exports.isCodegenOneOfSchema = exports.isCodegenAnyOfSchema = exports.isCodegenAllOfSchema = exports.isCodegenCompositionSchema = exports.isCodegenScope = exports.isCodegenNamedSchema = exports.isCodegenObjectLikeSchema = exports.isCodegenInterfaceSchema = exports.isCodegenObjectSchema = exports.isCodegenEnumSchema = exports.isCodegenMapSchema = exports.isCodegenArraySchema = exports.isCodegenStringSchema = exports.isCodegenBooleanSchema = exports.isCodegenNumericSchema = void 0;
exports.isCodegenParameter = exports.isCodegenProperty = exports.isCodegenOperation = exports.isCodegenSchemaUsage = exports.isCodegenDiscriminatableSchema = exports.isCodegenDiscriminatorSchema = exports.isCodegenWrapperSchema = exports.isCodegenHierarchySchema = exports.isCodegenOneOfSchema = exports.isCodegenAnyOfSchema = exports.isCodegenAllOfSchema = exports.isCodegenCompositionSchema = exports.isCodegenScope = exports.isCodegenNamedSchema = exports.isCodegenObjectLikeSchema = exports.isCodegenInterfaceSchema = exports.isCodegenObjectSchema = exports.isCodegenEnumSchema = exports.isCodegenMapSchema = exports.isCodegenArraySchema = exports.isCodegenStringSchema = exports.isCodegenBooleanSchema = exports.isCodegenNumericSchema = void 0;
const types_1 = require("./types");

@@ -110,1 +110,23 @@ function isCodegenNumericSchema(schema) {

exports.isCodegenOperation = isCodegenOperation;
function isCodegenProperty(ob) {
if (typeof ob !== 'object') {
return false;
}
const anyParam = ob;
if (typeof anyParam.name !== 'string' || typeof anyParam.serializedName !== 'string' || typeof anyParam.overrides !== 'boolean') {
return false;
}
return true;
}
exports.isCodegenProperty = isCodegenProperty;
function isCodegenParameter(ob) {
if (typeof ob !== 'object') {
return false;
}
const anyParam = ob;
if (typeof anyParam.name !== 'string' || typeof anyParam.in !== 'string' || typeof anyParam.encoding !== 'object') {
return false;
}
return true;
}
exports.isCodegenParameter = isCodegenParameter;

@@ -23,2 +23,3 @@ import type { OpenAPI, OpenAPIV2, OpenAPIV3 } from 'openapi-types';

defaultRequestBodyIdentifier: string;
groupBy: 'path' | 'tag' | 'default';
};

@@ -163,2 +164,3 @@ }

defaultRequestBodyIdentifier?: string;
groupBy?: string;
};

@@ -206,5 +208,10 @@ };

produces: CodegenMediaType[] | null;
/** Tags that apply to the group as a whole, if any */
tags: string[] | null;
}
export interface CodegenOperation {
/** The name for this operation (safe as an identifier) */
name: string;
/** A name for this operation that is unique within the API. Often based on the `operationId`, but always safe as an identifier */
uniqueName: string;
httpMethod: string;

@@ -224,2 +231,3 @@ /** The operation path, relative to the containing CodegenOperationGroup */

formParams: CodegenParameters | null;
requiredParams: CodegenParameters | null;
requestBody: CodegenRequestBody | null;

@@ -360,2 +368,3 @@ securityRequirements: CodegenSecurityRequirements | null;

componentType?: CodegenNativeType;
info?: CodegenNativeTypeInfo;
}): CodegenNativeType;

@@ -389,5 +398,12 @@ }

componentType: CodegenNativeType | null;
/**
* Any extra information that a generator template might provide to help with code generation.
*/
info: CodegenNativeTypeInfo | null;
toString(): string;
equals(other: CodegenNativeType | undefined): boolean;
}
export interface CodegenNativeTypeInfo {
[key: string]: unknown;
}
export declare enum CodegenSchemaType {

@@ -720,2 +736,4 @@ OBJECT = "OBJECT",

schemaType: CodegenSchemaType;
/** The scope that the schema to name is scoped inside */
scope: CodegenScope | null;
}

@@ -725,2 +743,4 @@ export interface CodegenSchemaNameSuggestionOptions {

schemaType: CodegenSchemaType;
/** The scope that the schema to suggest a name for will probably be scoped inside */
scope: CodegenScope | null;
}

@@ -727,0 +747,0 @@ export interface CodegenTypeOptions {

{
"name": "@openapi-generator-plus/types",
"version": "2.16.0",
"version": "2.17.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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

import { CodegenNativeType } from './types'
import { CodegenNativeType, CodegenNativeTypeInfo } from './types'
export type CodegenNativeTypeStringComposer = (nativeTypeStrings: string[]) => string
export type CodegenNativeTypeComposer = (nativeTypes: CodegenNativeType[]) => string
type DefaultCodegenNativeTypeInfoComposer = (nativeTypes: CodegenNativeType[]) => CodegenNativeTypeInfo | null
export type CodegenNativeTypeInfoComposer = (nativeTypes: CodegenNativeType[], defaultComposer: DefaultCodegenNativeTypeInfoComposer) => CodegenNativeTypeInfo | null

@@ -14,2 +16,8 @@ /**

/**
* Transform the native type info
* @param nativeType the native type
*/
export type CodegenNativeTypeInfoTransformer = (nativeType: CodegenNativeType) => CodegenNativeTypeInfo | null
export interface CodegenNativeTypeTransformers {

@@ -33,2 +41,3 @@ /**

componentType?: CodegenNativeTypeTransformers | null
info?: CodegenNativeTypeInfoTransformer | null
}

@@ -47,2 +56,3 @@

concreteType?: CodegenNativeTypeComposer
info?: CodegenNativeTypeInfoComposer
}

@@ -49,0 +59,0 @@

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

import { CodegenAllOfSchema, CodegenAnyOfSchema, CodegenArraySchema, CodegenBooleanSchema, CodegenDiscriminatableSchema, CodegenDiscriminatorSchema, CodegenEnumSchema, CodegenInterfaceSchema, CodegenMapSchema, CodegenNamedSchema, CodegenNumericSchema, CodegenObjectLikeSchemas, CodegenObjectSchema, CodegenOneOfSchema, CodegenSchema, CodegenSchemaType, CodegenScope, CodegenStringSchema, CodegenWrapperSchema, CodegenSchemaUsage, CodegenHierarchySchema, CodegenOperation } from './types'
import { CodegenAllOfSchema, CodegenAnyOfSchema, CodegenArraySchema, CodegenBooleanSchema, CodegenDiscriminatableSchema, CodegenDiscriminatorSchema, CodegenEnumSchema, CodegenInterfaceSchema, CodegenMapSchema, CodegenNamedSchema, CodegenNumericSchema, CodegenObjectLikeSchemas, CodegenObjectSchema, CodegenOneOfSchema, CodegenSchema, CodegenSchemaType, CodegenScope, CodegenStringSchema, CodegenWrapperSchema, CodegenSchemaUsage, CodegenHierarchySchema, CodegenOperation, CodegenParameter, CodegenProperty } from './types'

@@ -110,1 +110,27 @@ export function isCodegenNumericSchema(schema: CodegenSchema): schema is CodegenNumericSchema {

}
export function isCodegenProperty(ob: unknown): ob is CodegenProperty {
if (typeof ob !== 'object') {
return false
}
const anyParam = ob as CodegenProperty
if (typeof anyParam.name !== 'string' || typeof anyParam.serializedName !== 'string' || typeof anyParam.overrides !== 'boolean') {
return false
}
return true
}
export function isCodegenParameter(ob: unknown): ob is CodegenParameter {
if (typeof ob !== 'object') {
return false
}
const anyParam = ob as CodegenParameter
if (typeof anyParam.name !== 'string' || typeof anyParam.in !== 'string' || typeof anyParam.encoding !== 'object') {
return false
}
return true
}

@@ -27,2 +27,3 @@ import type { OpenAPI, OpenAPIV2, OpenAPIV3 } from 'openapi-types'

defaultRequestBodyIdentifier: string
groupBy: 'path' | 'tag' | 'default'
}

@@ -189,2 +190,3 @@ }

defaultRequestBodyIdentifier?: string
groupBy?: string
}

@@ -239,6 +241,12 @@ }

produces: CodegenMediaType[] | null // TODO in OpenAPIV2 these are on the document, but not on OpenAPIV3
/** Tags that apply to the group as a whole, if any */
tags: string[] | null
}
export interface CodegenOperation {
/** The name for this operation (safe as an identifier) */
name: string
/** A name for this operation that is unique within the API. Often based on the `operationId`, but always safe as an identifier */
uniqueName: string
httpMethod: string

@@ -260,2 +268,3 @@ /** The operation path, relative to the containing CodegenOperationGroup */

formParams: CodegenParameters | null
requiredParams: CodegenParameters | null

@@ -416,2 +425,3 @@ requestBody: CodegenRequestBody | null

componentType?: CodegenNativeType
info?: CodegenNativeTypeInfo
}): CodegenNativeType

@@ -448,2 +458,7 @@ }

/**
* Any extra information that a generator template might provide to help with code generation.
*/
info: CodegenNativeTypeInfo | null
toString(): string

@@ -455,2 +470,6 @@

export interface CodegenNativeTypeInfo {
[key: string]: unknown
}
export enum CodegenSchemaType {

@@ -876,2 +895,4 @@ OBJECT = 'OBJECT',

schemaType: CodegenSchemaType
/** The scope that the schema to name is scoped inside */
scope: CodegenScope | null
}

@@ -882,2 +903,4 @@

schemaType: CodegenSchemaType
/** The scope that the schema to suggest a name for will probably be scoped inside */
scope: CodegenScope | null
}

@@ -884,0 +907,0 @@

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