vona-module-a-openapiutils 5.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016-present Vona
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,17 @@
1
+ /** scope: begin */
2
+ import { BeanScopeBase, type BeanScopeUtil } from 'vona';
3
+ export declare class ScopeModuleAOpenapiutils extends BeanScopeBase {
4
+ }
5
+ export interface ScopeModuleAOpenapiutils {
6
+ util: BeanScopeUtil;
7
+ }
8
+ import 'vona';
9
+ declare module 'vona' {
10
+ interface IBeanScopeRecord {
11
+ 'a-openapiutils': ScopeModuleAOpenapiutils;
12
+ }
13
+ interface IBeanScopeContainer {
14
+ openapiutils: ScopeModuleAOpenapiutils;
15
+ }
16
+ }
17
+ /** scope: end */
@@ -0,0 +1,18 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ /* eslint-disable */
8
+ /** scope: begin */
9
+ import { BeanScopeBase } from 'vona';
10
+ import { Scope } from 'vona-module-a-bean';
11
+ let ScopeModuleAOpenapiutils = class ScopeModuleAOpenapiutils extends BeanScopeBase {
12
+ };
13
+ ScopeModuleAOpenapiutils = __decorate([
14
+ Scope()
15
+ ], ScopeModuleAOpenapiutils);
16
+ export { ScopeModuleAOpenapiutils };
17
+ import 'vona';
18
+ /** scope: end */
@@ -0,0 +1,2 @@
1
+ export declare const __ThisModule__ = "a-openapiutils";
2
+ export { ScopeModuleAOpenapiutils as ScopeModule } from './index.ts';
@@ -0,0 +1,2 @@
1
+ export const __ThisModule__ = 'a-openapiutils';
2
+ export { ScopeModuleAOpenapiutils as ScopeModule } from "./index.js";
@@ -0,0 +1,3 @@
1
+ export * from './.metadata/index.ts';
2
+ export * from './lib/index.ts';
3
+ export * from './types/index.ts';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./.metadata/index.js";
2
+ export * from "./lib/index.js";
3
+ export * from "./types/index.js";
@@ -0,0 +1,2 @@
1
+ import type { MetadataKey } from 'vona';
2
+ export declare function setPublic(target: object, prop?: MetadataKey, _descriptor?: PropertyDescriptor, value?: boolean): void;
@@ -0,0 +1,6 @@
1
+ import { appMetadata } from 'vona';
2
+ import { SymbolOpenApiOptions } from "../../types/api.js";
3
+ export function setPublic(target, prop, _descriptor, value) {
4
+ const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
5
+ options.public = value;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './api.ts';
@@ -0,0 +1 @@
1
+ export * from "./api.js";
@@ -0,0 +1 @@
1
+ export * from './decorator/index.ts';
@@ -0,0 +1 @@
1
+ export * from "./decorator/index.js";
@@ -0,0 +1,39 @@
1
+ import type { OpenAPIObject as OpenAPIObject30, SchemaObject as SchemaObject30 } from 'openapi3-ts/oas30';
2
+ import type { OpenAPIObject as OpenAPIObject31, SchemaObject as SchemaObject31 } from 'openapi3-ts/oas31';
3
+ import type { VonaApplication } from 'vona';
4
+ import type z from 'zod';
5
+ import type { SchemaLikeCreate } from './decorator.ts';
6
+ export declare const SymbolOpenApiOptions: unique symbol;
7
+ export interface IOpenApiHeader {
8
+ name: string;
9
+ description?: string;
10
+ }
11
+ export interface IResponseHeaders {
12
+ [key: string]: string | string[];
13
+ }
14
+ export type TypeGenerateJsonScene = 'api' | 'rest';
15
+ export type TypeOpenApiVersion = 'V30' | 'V31';
16
+ export interface IOpenAPIObject {
17
+ V30: OpenAPIObject30;
18
+ V31: OpenAPIObject31;
19
+ }
20
+ export interface IOpenAPISchemaObject {
21
+ V30: SchemaObject30;
22
+ V31: SchemaObject31;
23
+ }
24
+ export type TypeSecuritySchemes = Record<string, ((this: VonaApplication) => object) | object>;
25
+ export interface IOpenApiOptions {
26
+ public?: boolean;
27
+ description?: string;
28
+ summary?: string;
29
+ httpCode?: number;
30
+ contentType?: TypeResponseContentType;
31
+ bodySchema?: z.ZodSchema;
32
+ bodySchemaWrapper?: SchemaLikeCreate | false;
33
+ exclude?: boolean;
34
+ tags?: string[];
35
+ operationId?: string;
36
+ headers?: IOpenApiHeader[];
37
+ setHeaders?: IResponseHeaders;
38
+ }
39
+ export type TypeResponseContentType = 'application/json' | 'application/xml' | 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain' | 'text/html' | 'application/octet-stream' | 'application/pdf' | 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp' | 'image/svg+xml' | 'image/bmp' | 'image/tiff' | 'image/vnd.microsoft.icon' | 'image/vnd.wap.wbmp' | 'image/x-icon' | 'image/x-jng' | 'image/x-ms-bmp' | 'image/x-portable-bitmap' | 'image/x-portable-graymap' | 'image/x-portable-pixmap' | 'image/x-xbitmap' | 'image/x-xpixmap' | 'image/x-xwindowdump' | 'image/bmp' | 'image/x-bmp' | 'image/x-xbitmap' | 'image/x-win-bitmap' | 'image/x-windows-bmp' | 'image/ms-bmp' | 'image/x-ms-bmp' | 'image/x-icon' | 'image/x-ico' | 'image/vnd.microsoft.icon' | 'image/ico' | 'image/icon' | 'text/css' | 'text/csv' | 'text/html' | 'text/javascript' | 'text/plain' | 'text/xml' | 'application/javascript' | 'application/ecmascript' | 'application/json' | 'application/ld+json' | 'application/manifest+json' | 'application/javascript' | 'application/x-javascript' | 'application/x-json' | 'application/x-ms-application';
@@ -0,0 +1 @@
1
+ export const SymbolOpenApiOptions = Symbol('SymbolOpenApiOptions');
@@ -0,0 +1,6 @@
1
+ import type { Constructable } from 'vona';
2
+ import type z from 'zod';
3
+ export type SchemaLikeCreate = (schema: any) => any;
4
+ export type SchemaLike = SchemaLikeCreate | z.ZodSchema | Constructable;
5
+ export declare const SymbolDecoratorRule: unique symbol;
6
+ export declare const SymbolDecoratorRuleColumn: unique symbol;
@@ -0,0 +1,2 @@
1
+ export const SymbolDecoratorRule = Symbol('SymbolDecoratorRule');
2
+ export const SymbolDecoratorRuleColumn = Symbol('SymbolDecoratorRuleColumn');
@@ -0,0 +1,2 @@
1
+ export * from './api.ts';
2
+ export * from './decorator.ts';
@@ -0,0 +1,2 @@
1
+ export * from "./api.js";
2
+ export * from "./decorator.js";
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "vona-module-a-openapiutils",
3
+ "type": "module",
4
+ "version": "5.0.1",
5
+ "title": "a-openapiutils",
6
+ "vonaModule": {
7
+ "dependencies": {}
8
+ },
9
+ "description": "",
10
+ "author": "",
11
+ "keywords": [
12
+ "Vona Module"
13
+ ],
14
+ "exports": {
15
+ ".": {
16
+ "types": [
17
+ "./src/index.ts",
18
+ "./dist/index.d.ts"
19
+ ],
20
+ "default": "./dist/index.js"
21
+ },
22
+ "./package.json": "./package.json"
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "static"
27
+ ],
28
+ "dependencies": {
29
+ "openapi3-ts": "^4.4.0"
30
+ },
31
+ "scripts": {
32
+ "clean": "rimraf dist tsconfig.build.tsbuildinfo",
33
+ "tsc:publish": "npm run clean && tsc -p tsconfig.build.json"
34
+ }
35
+ }