vona-module-a-openapi 5.0.56 → 5.0.58
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/dist/index.js +11 -3
- package/dist/service/openapi.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BeanInfo, BeanBase, appResource, cast, LocaleModuleNameSeparator, appMetadata, BeanSimple, BeanScopeBase } from 'vona';
|
|
1
|
+
import { BeanInfo, BeanBase, appResource, beanFullNameFromOnionName, cast, LocaleModuleNameSeparator, appMetadata, BeanSimple, BeanScopeBase } from 'vona';
|
|
2
2
|
import { OpenAPIRegistry, OpenApiGeneratorV3, OpenApiGeneratorV31 } from '@cabloy/zod-to-openapi';
|
|
3
3
|
import { Bean, Service, Scope } from 'vona-module-a-bean';
|
|
4
4
|
import { Caching } from 'vona-module-a-caching';
|
|
@@ -93,6 +93,14 @@ const __ArgumentTypes = ['param', 'query', 'body', 'headers', 'fields', 'field',
|
|
|
93
93
|
let ServiceOpenapi = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
94
94
|
module: "a-openapi"
|
|
95
95
|
}), _dec$2(_class$2 = _dec2$2(_class$2 = class ServiceOpenapi extends BeanBase {
|
|
96
|
+
async clearAllCaches() {
|
|
97
|
+
const cacheOpenapiSchema = this.bean.summer.cache(beanFullNameFromOnionName('a-openapi:json', 'summerCache'));
|
|
98
|
+
await cacheOpenapiSchema.clear();
|
|
99
|
+
const cacheSwagger = this.bean.summer.cache(beanFullNameFromOnionName('a-swagger:swagger', 'summerCache'));
|
|
100
|
+
await cacheSwagger.clear();
|
|
101
|
+
const cacheRapidoc = this.bean.summer.cache(beanFullNameFromOnionName('a-swagger:rapidoc', 'summerCache'));
|
|
102
|
+
await cacheRapidoc.clear();
|
|
103
|
+
}
|
|
96
104
|
translate(apiObj, generateJsonScene) {
|
|
97
105
|
// paths
|
|
98
106
|
if (apiObj.paths) {
|
|
@@ -197,7 +205,7 @@ let ServiceOpenapi = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
|
197
205
|
}
|
|
198
206
|
// schema: independent
|
|
199
207
|
for (const sceneName of ['dto', 'entity']) {
|
|
200
|
-
const onionSlices = this.bean.onion[sceneName].
|
|
208
|
+
const onionSlices = this.bean.onion[sceneName].getOnionsEnabledCached();
|
|
201
209
|
for (const onionSlice of onionSlices) {
|
|
202
210
|
if (onionSlice.beanOptions.options?.independent) {
|
|
203
211
|
const schema = $schema(onionSlice.beanOptions.beanClass);
|
|
@@ -206,7 +214,7 @@ let ServiceOpenapi = (_dec$2 = Service(), _dec2$2 = BeanInfo({
|
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
216
|
// controller
|
|
209
|
-
for (const controller of this.bean.onion.controller.
|
|
217
|
+
for (const controller of this.bean.onion.controller.getOnionsEnabledCached()) {
|
|
210
218
|
this.collectController(registry, controller.beanOptions.module, controller.beanOptions.beanClass);
|
|
211
219
|
}
|
|
212
220
|
return registry;
|
|
@@ -5,6 +5,7 @@ import type { TypeGenerateJsonScene } from 'vona-module-a-openapiutils';
|
|
|
5
5
|
import { OpenAPIRegistry } from '@cabloy/zod-to-openapi';
|
|
6
6
|
import { BeanBase } from 'vona';
|
|
7
7
|
export declare class ServiceOpenapi extends BeanBase {
|
|
8
|
+
clearAllCaches(): Promise<void>;
|
|
8
9
|
translate(apiObj: OpenAPIObject30 | OpenAPIObject31, generateJsonScene: TypeGenerateJsonScene): void;
|
|
9
10
|
private _translateSchema;
|
|
10
11
|
private _translateErrorMessages;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-openapi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.58",
|
|
5
5
|
"title": "a-openapi",
|
|
6
6
|
"vonaModule": {
|
|
7
7
|
"capabilities": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@cabloy/zod-openapi": "^1.0.
|
|
39
|
-
"@cabloy/zod-query": "^2.0.
|
|
38
|
+
"@cabloy/zod-openapi": "^1.0.7",
|
|
39
|
+
"@cabloy/zod-query": "^2.0.4",
|
|
40
40
|
"@cabloy/zod-to-openapi": "^8.1.4",
|
|
41
41
|
"@zhennann/currency": "^2.0.0",
|
|
42
42
|
"openapi3-ts": "^4.5.0",
|