@novice1/api-doc-json-helper 0.1.0

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) 2025 kisiwu
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.
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # @novice1/api-doc-json-helper
2
+
3
+ JSON schemas helpers for `@novice1/api-doc-generator` enabling compatibility with `@novice1/validator-json`.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @novice1/api-doc-json-helper
9
+ ```
10
+
11
+ ## OpenAPI Specification
12
+
13
+ ```ts
14
+ import {
15
+ OpenAPI
16
+ } from '@novice1/api-doc-generator';
17
+ import {
18
+ OpenAPIJsonHelper
19
+ } from '@novice1/api-doc-json-helper';
20
+ import routing from '@novice1/routing';
21
+
22
+ const openapi = new OpenAPI(OpenAPIJsonHelper);
23
+
24
+ const router = routing()
25
+ .get({
26
+ name: 'Main app',
27
+ path: '/app',
28
+ auth: true,
29
+ tags: ['default'],
30
+ parameters: {
31
+ query: {
32
+ '$schema': 'http://json-schema.org/draft-07/schema#',
33
+ type: 'object',
34
+ properties: {
35
+ version: {
36
+ type: 'string',
37
+ description: 'version number',
38
+ enum: ['1','2','3'],
39
+ default: '2'
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }, function (req, res) {
45
+ res.json(req.query.version)
46
+ });
47
+
48
+ // ...
49
+ ```
50
+
51
+ ### Recommended
52
+
53
+ Defining the property containing your schemas is [recommended](https://github.com/kisiwu/novice-validator-json?tab=readme-ov-file#good-practices).
54
+
55
+ ```ts
56
+ import {
57
+ OpenAPI
58
+ } from '@novice1/api-doc-generator';
59
+ import {
60
+ OpenAPIJsonHelper
61
+ } from '@novice1/api-doc-json-helper';
62
+ import routing from '@novice1/routing';
63
+
64
+ OpenAPIJsonHelper.schemaProperty = 'jsonSchemas' // recommended
65
+
66
+ const openapi = new OpenAPI(OpenAPIJsonHelper);
67
+
68
+ const router = routing()
69
+ .get({
70
+ name: 'Main app',
71
+ path: '/app',
72
+ auth: true,
73
+ tags: ['default'],
74
+ parameters: {
75
+ // recommended
76
+ jsonSchemas: {
77
+ query: {
78
+ '$schema': 'http://json-schema.org/draft-07/schema#',
79
+ type: 'object',
80
+ properties: {
81
+ version: {
82
+ type: 'string',
83
+ description: 'version number',
84
+ enum: ['1','2','3'],
85
+ default: '2'
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }, function (req, res) {
92
+ res.json(req.query.version)
93
+ });
94
+
95
+ //...
96
+ ```
97
+
98
+ ## References
99
+
100
+ - [@novice1/api-doc-generator](https://kisiwu.github.io/novice-api-doc-generator/latest/)
101
+ - [@novice1/validator-json](https://kisiwu.github.io/novice-validator-json/latest/)
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './openapi';
package/lib/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./openapi"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,oDAAyB"}
@@ -0,0 +1,45 @@
1
+ import { OpenAPIHelperInterface } from '@novice1/api-doc-generator';
2
+ import { AdditionalProperties, DiscriminatorObject, XMLObject, ExampleObject, ReferenceObject, EncodingObject } from '@novice1/api-doc-generator/lib/generators/openapi/definitions';
3
+ /**
4
+ * JSON schema (draft-07) helper for \@novice1/api-doc-generator
5
+ */
6
+ export declare class OpenAPIJsonHelper implements OpenAPIHelperInterface {
7
+ protected _schema: object;
8
+ protected _isRequired: boolean;
9
+ static schemaProperty: string;
10
+ constructor(schema?: object | unknown, isRequired?: boolean);
11
+ getFirstItem(): OpenAPIJsonHelper | undefined;
12
+ getChildren(): Record<string, OpenAPIJsonHelper>;
13
+ getAlternatives(): OpenAPIJsonHelper[];
14
+ hasStyle?(): boolean;
15
+ getStyle?(): string | undefined;
16
+ hasAdditionalProperties?(): boolean;
17
+ getAdditionalProperties?(): AdditionalProperties | undefined;
18
+ hasRef?(): boolean;
19
+ getRef?(): string | undefined;
20
+ hasDiscriminator?(): boolean;
21
+ getDiscriminator?(): DiscriminatorObject | undefined;
22
+ hasXml?(): boolean;
23
+ getXml?(): XMLObject | undefined;
24
+ hasExamples?(): boolean;
25
+ getExamples?(): Record<string, ExampleObject | ReferenceObject> | undefined;
26
+ hasEncoding?(): boolean;
27
+ getEncoding?(): Record<string, EncodingObject> | undefined;
28
+ isValid(): boolean;
29
+ getType(): string;
30
+ getDescription(): string;
31
+ isRequired(): boolean;
32
+ isUnique(): boolean;
33
+ hasDefaultValue(): boolean;
34
+ getDefaultValue(): unknown;
35
+ hasExampleValue(): boolean;
36
+ getExampleValue(): unknown;
37
+ isDeprecated(): boolean;
38
+ allowsEmptyValue(): boolean;
39
+ getEnum(): unknown[];
40
+ hasMin(): boolean;
41
+ hasMax(): boolean;
42
+ getMin(): number | undefined;
43
+ getMax(): number | undefined;
44
+ getUnit(): string;
45
+ }
package/lib/openapi.js ADDED
@@ -0,0 +1,222 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenAPIJsonHelper = void 0;
4
+ /**
5
+ * JSON schema (draft-07) helper for \@novice1/api-doc-generator
6
+ */
7
+ class OpenAPIJsonHelper {
8
+ constructor(schema = {}, isRequired) {
9
+ this._isRequired = false;
10
+ this._schema = {};
11
+ if (schema && typeof schema === 'object') {
12
+ const s = schema;
13
+ this._schema = s;
14
+ if (OpenAPIJsonHelper.schemaProperty && OpenAPIJsonHelper.schemaProperty in s) {
15
+ const s2 = s[OpenAPIJsonHelper.schemaProperty];
16
+ if (s2 && typeof s2 === 'object') {
17
+ this._schema = s2;
18
+ }
19
+ }
20
+ if (!('type' in this._schema)) {
21
+ this._schema = {
22
+ type: 'object',
23
+ properties: this._schema
24
+ };
25
+ }
26
+ }
27
+ if (isRequired) {
28
+ this._isRequired = isRequired;
29
+ }
30
+ }
31
+ getFirstItem() {
32
+ const schema = this._schema;
33
+ if ('items' in schema && typeof schema.items === 'object') {
34
+ return new OpenAPIJsonHelper(schema.items);
35
+ }
36
+ return;
37
+ }
38
+ getChildren() {
39
+ const r = {};
40
+ const schema = this._schema;
41
+ if ('properties' in schema && typeof schema.properties === 'object' && schema.properties) {
42
+ const properties = schema.properties;
43
+ for (const p in properties) {
44
+ const isRequired = 'required' in schema && Array.isArray(schema.required) && schema.required.includes(p);
45
+ r[p] = new OpenAPIJsonHelper(properties[p], isRequired);
46
+ }
47
+ }
48
+ return r;
49
+ }
50
+ getAlternatives() {
51
+ const r = [];
52
+ const schema = this._schema;
53
+ if ('oneOf' in schema && Array.isArray(schema.oneOf)) {
54
+ for (const p of schema.oneOf) {
55
+ r.push(new OpenAPIJsonHelper(p));
56
+ }
57
+ }
58
+ return r;
59
+ }
60
+ hasStyle() {
61
+ return false;
62
+ }
63
+ getStyle() {
64
+ return;
65
+ }
66
+ hasAdditionalProperties() {
67
+ const schema = this._schema;
68
+ return !!('additionalProperties' in schema && schema.additionalProperties);
69
+ }
70
+ getAdditionalProperties() {
71
+ const schema = this._schema;
72
+ return 'additionalProperties' in schema && schema.additionalProperties;
73
+ }
74
+ hasRef() {
75
+ const schema = this._schema;
76
+ return !!('$ref' in schema && typeof schema.$ref === 'string');
77
+ }
78
+ getRef() {
79
+ const schema = this._schema;
80
+ return '$ref' in schema && typeof schema.$ref === 'string' ? schema.$ref : undefined;
81
+ }
82
+ hasDiscriminator() {
83
+ return false;
84
+ }
85
+ getDiscriminator() {
86
+ return;
87
+ }
88
+ hasXml() {
89
+ return false;
90
+ }
91
+ getXml() {
92
+ return;
93
+ }
94
+ hasExamples() {
95
+ const schema = this._schema;
96
+ return !!('examples' in schema && Array.isArray(schema.examples));
97
+ }
98
+ getExamples() {
99
+ const schema = this._schema;
100
+ if ('examples' in schema && Array.isArray(schema.examples)) {
101
+ const r = {};
102
+ let i = 1;
103
+ for (const value of schema.examples) {
104
+ r[`${i}`] = {
105
+ value
106
+ };
107
+ i++;
108
+ }
109
+ return r;
110
+ }
111
+ return;
112
+ }
113
+ hasEncoding() {
114
+ return false;
115
+ }
116
+ getEncoding() {
117
+ return;
118
+ }
119
+ isValid() {
120
+ return !!(this._schema && typeof this._schema === 'object');
121
+ }
122
+ getType() {
123
+ let r = '';
124
+ if ('type' in this._schema && typeof this._schema.type === 'string') {
125
+ r = this._schema.type;
126
+ }
127
+ if ('format' in this._schema && typeof this._schema.format === 'string') {
128
+ r = this._schema.format;
129
+ }
130
+ return r;
131
+ }
132
+ getDescription() {
133
+ let r = '';
134
+ if ('description' in this._schema && typeof this._schema.description === 'string') {
135
+ r = this._schema.description;
136
+ }
137
+ return r;
138
+ }
139
+ isRequired() {
140
+ return this._isRequired;
141
+ }
142
+ isUnique() {
143
+ return !!('uniqueItems' in this._schema && this._schema.uniqueItems);
144
+ }
145
+ hasDefaultValue() {
146
+ return !!('default' in this._schema && typeof this._schema.default != 'undefined');
147
+ }
148
+ getDefaultValue() {
149
+ return 'default' in this._schema ? this._schema.default : undefined;
150
+ }
151
+ hasExampleValue() {
152
+ const schema = this._schema;
153
+ return !!('examples' in schema && Array.isArray(schema.examples) && schema.examples.length);
154
+ }
155
+ getExampleValue() {
156
+ const schema = this._schema;
157
+ if ('examples' in schema && Array.isArray(schema.examples) && schema.examples.length) {
158
+ return schema.examples[0];
159
+ }
160
+ return;
161
+ }
162
+ isDeprecated() {
163
+ return !!('deprecated' in this._schema && this._schema.deprecated);
164
+ }
165
+ allowsEmptyValue() {
166
+ let r = false;
167
+ if ('enum' in this._schema && Array.isArray(this._schema.enum)) {
168
+ const enume = this._schema.enum;
169
+ r = ['', null].some(v => enume.includes(v));
170
+ }
171
+ return r;
172
+ }
173
+ getEnum() {
174
+ let r = [];
175
+ if ('enum' in this._schema && Array.isArray(this._schema.enum)) {
176
+ r = this._schema.enum;
177
+ }
178
+ return r;
179
+ }
180
+ hasMin() {
181
+ return 'minProperties' in this._schema || 'minItems' in this._schema || 'minimum' in this._schema || 'minLength' in this._schema;
182
+ }
183
+ hasMax() {
184
+ return 'maxProperties' in this._schema || 'maxItems' in this._schema || 'maximum' in this._schema || 'maxLength' in this._schema;
185
+ }
186
+ getMin() {
187
+ if ('minProperties' in this._schema && typeof this._schema.minProperties === 'number') {
188
+ return this._schema.minProperties;
189
+ }
190
+ if ('minItems' in this._schema && typeof this._schema.minItems === 'number') {
191
+ return this._schema.minItems;
192
+ }
193
+ if ('minimum' in this._schema && typeof this._schema.minimum === 'number') {
194
+ return this._schema.minimum;
195
+ }
196
+ if ('minLength' in this._schema && typeof this._schema.minLength === 'number') {
197
+ return this._schema.minLength;
198
+ }
199
+ return;
200
+ }
201
+ getMax() {
202
+ if ('maxProperties' in this._schema && typeof this._schema.maxProperties === 'number') {
203
+ return this._schema.maxProperties;
204
+ }
205
+ if ('maxItems' in this._schema && typeof this._schema.maxItems === 'number') {
206
+ return this._schema.maxItems;
207
+ }
208
+ if ('maximum' in this._schema && typeof this._schema.maximum === 'number') {
209
+ return this._schema.maximum;
210
+ }
211
+ if ('maxLength' in this._schema && typeof this._schema.maxLength === 'number') {
212
+ return this._schema.maxLength;
213
+ }
214
+ return;
215
+ }
216
+ getUnit() {
217
+ return '';
218
+ }
219
+ }
220
+ exports.OpenAPIJsonHelper = OpenAPIJsonHelper;
221
+ OpenAPIJsonHelper.schemaProperty = '';
222
+ //# sourceMappingURL=openapi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.js","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":";;;AAUA;;GAEG;AACH,MAAa,iBAAiB;IAM1B,YAAY,SAA2B,EAAE,EAAE,UAAoB;QAJrD,gBAAW,GAAG,KAAK,CAAA;QAKzB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YACvC,MAAM,CAAC,GAAG,MAAiC,CAAA;YAC3C,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;YAChB,IAAI,iBAAiB,CAAC,cAAc,IAAI,iBAAiB,CAAC,cAAc,IAAI,CAAC,EAAE,CAAC;gBAC5E,MAAM,EAAE,GAAG,CAAC,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAA;gBAC9C,IAAI,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;oBAC/B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;gBACrB,CAAC;YACL,CAAC;YACD,IAAI,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,OAAO,GAAG;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,IAAI,CAAC,OAAO;i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AC,SAAS,CAAA;QACjC,CAAC;QACD,OAAM;IACV,CAAC;IACD,OAAO;QACH,OAAO,EAAE,CAAA;IACb,CAAC;;AAhOL,8CAkOC;AA9NU,gCAAc,GAAW,EAAE,AAAb,CAAa"}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@novice1/api-doc-json-helper",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "lint": "eslint ."
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/kisiwu/novice-api-doc-json-helper.git"
13
+ },
14
+ "author": "demingongo",
15
+ "license": "MIT",
16
+ "bugs": {
17
+ "url": "https://github.com/kisiwu/novice-api-doc-json-helper/issues"
18
+ },
19
+ "homepage": "https://github.com/kisiwu/novice-api-doc-json-helper#readme",
20
+ "keywords": [
21
+ "openapi",
22
+ "postman",
23
+ "swagger",
24
+ "json"
25
+ ],
26
+ "dependencies": {
27
+ "@novice1/api-doc-generator": "^0.2.8",
28
+ "tslib": "^2.8.1"
29
+ },
30
+ "devDependencies": {
31
+ "@eslint/eslintrc": "^3.3.1",
32
+ "@eslint/js": "^9.25.1",
33
+ "@stylistic/eslint-plugin-js": "^4.2.0",
34
+ "@types/node": "^22.14.1",
35
+ "@typescript-eslint/eslint-plugin": "^8.31.0",
36
+ "@typescript-eslint/parser": "^8.31.0",
37
+ "eslint": "^9.25.1",
38
+ "kaukau": "^4.1.5",
39
+ "ts-node": "^10.9.2",
40
+ "typescript": "^5.8.3"
41
+ }
42
+ }