@kubb/plugin-oas 3.0.0-alpha.12 → 3.0.0-alpha.14
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/README.md +13 -0
- package/dist/OperationGenerator-BqfyX5-8.d.cts +554 -0
- package/dist/OperationGenerator-BqfyX5-8.d.ts +554 -0
- package/dist/{Schema-B1vcPGiK.d.ts → Schema-BgpIlA79.d.cts} +2 -2
- package/dist/{Schema-DoSFh7Qd.d.cts → Schema-ExMIJOhD.d.ts} +2 -2
- package/dist/{chunk-S6RFFHLW.cjs → chunk-2S2QRJPN.cjs} +4 -4
- package/dist/{chunk-S6RFFHLW.cjs.map → chunk-2S2QRJPN.cjs.map} +1 -1
- package/dist/chunk-6BDSF64V.cjs +97 -0
- package/dist/chunk-6BDSF64V.cjs.map +1 -0
- package/dist/chunk-A2T3ZQOU.js +93 -0
- package/dist/chunk-A2T3ZQOU.js.map +1 -0
- package/dist/{chunk-2X5GZFQP.js → chunk-B4WIB7UG.js} +4 -4
- package/dist/chunk-B4WIB7UG.js.map +1 -0
- package/dist/{chunk-4VKHSKYX.js → chunk-E2Z4IRAI.js} +4 -4
- package/dist/{chunk-4VKHSKYX.js.map → chunk-E2Z4IRAI.js.map} +1 -1
- package/dist/chunk-EJHTGW4H.js +6 -0
- package/dist/{chunk-WN5S6RCU.js.map → chunk-EJHTGW4H.js.map} +1 -1
- package/dist/{chunk-4WUMV7QX.js → chunk-OSKSFHO2.js} +3 -3
- package/dist/{chunk-4WUMV7QX.js.map → chunk-OSKSFHO2.js.map} +1 -1
- package/dist/chunk-SMB4EG6V.cjs +8 -0
- package/dist/{chunk-6AVEWDKE.cjs.map → chunk-SMB4EG6V.cjs.map} +1 -1
- package/dist/{chunk-XQPCA75E.cjs → chunk-XELSZPJC.cjs} +4 -4
- package/dist/{chunk-XQPCA75E.cjs.map → chunk-XELSZPJC.cjs.map} +1 -1
- package/dist/{chunk-47SNBYWH.cjs → chunk-YSPJF26N.cjs} +27 -27
- package/dist/chunk-YSPJF26N.cjs.map +1 -0
- package/dist/components.cjs +6 -6
- package/dist/components.d.cts +3 -5
- package/dist/components.d.ts +3 -5
- package/dist/components.js +3 -3
- package/dist/generators.cjs +15 -0
- package/dist/generators.cjs.map +1 -0
- package/dist/generators.d.cts +10 -0
- package/dist/generators.d.ts +10 -0
- package/dist/generators.js +6 -0
- package/dist/generators.js.map +1 -0
- package/dist/hooks.cjs +12 -12
- package/dist/hooks.d.cts +3 -4
- package/dist/hooks.d.ts +3 -4
- package/dist/hooks.js +3 -3
- package/dist/index.cjs +69 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +57 -93
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +9 -9
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +3 -3
- package/package.json +18 -10
- package/src/components/Schema.tsx +1 -2
- package/src/generators/index.ts +1 -0
- package/src/generators/jsonGenerator.ts +30 -0
- package/src/plugin.ts +63 -43
- package/src/types.ts +18 -12
- package/dist/OperationGenerator-By5WOmWB.d.ts +0 -165
- package/dist/OperationGenerator-Gd1X7wUz.d.cts +0 -165
- package/dist/SchemaMapper-sGcY1xL5.d.cts +0 -247
- package/dist/SchemaMapper-sGcY1xL5.d.ts +0 -247
- package/dist/chunk-2X5GZFQP.js.map +0 -1
- package/dist/chunk-47SNBYWH.cjs.map +0 -1
- package/dist/chunk-6AVEWDKE.cjs +0 -8
- package/dist/chunk-WN5S6RCU.js +0 -6
- package/dist/types-CZTUCaE5.d.cts +0 -145
- package/dist/types-CZTUCaE5.d.ts +0 -145
package/dist/components.cjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
require('./chunk-
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
3
|
+
require('./chunk-SMB4EG6V.cjs');
|
|
4
|
+
var chunkYSPJF26N_cjs = require('./chunk-YSPJF26N.cjs');
|
|
5
|
+
require('./chunk-XELSZPJC.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "Oas", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkYSPJF26N_cjs.Oas; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "Operation", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkYSPJF26N_cjs.Operation; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "Schema", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkYSPJF26N_cjs.Schema; }
|
|
20
20
|
});
|
|
21
21
|
//# sourceMappingURL=components.cjs.map
|
|
22
22
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.d.cts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { S as Schema } from './Schema-
|
|
1
|
+
import { S as Schema } from './Schema-BgpIlA79.cjs';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
|
|
4
4
|
import { KubbNode } from '@kubb/react/types';
|
|
5
|
-
import {
|
|
6
|
-
import './SchemaMapper-sGcY1xL5.cjs';
|
|
7
|
-
import '@kubb/fs/types';
|
|
5
|
+
import { b as OperationGenerator } from './OperationGenerator-BqfyX5-8.cjs';
|
|
8
6
|
import '@kubb/core';
|
|
9
|
-
import '
|
|
7
|
+
import '@kubb/fs/types';
|
|
10
8
|
import '@kubb/oas/parser';
|
|
11
9
|
|
|
12
10
|
type Props$1 = {
|
package/dist/components.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { S as Schema } from './Schema-
|
|
1
|
+
import { S as Schema } from './Schema-ExMIJOhD.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { Operation as Operation$1, Oas as Oas$1 } from '@kubb/oas';
|
|
4
4
|
import { KubbNode } from '@kubb/react/types';
|
|
5
|
-
import {
|
|
6
|
-
import './SchemaMapper-sGcY1xL5.js';
|
|
7
|
-
import '@kubb/fs/types';
|
|
5
|
+
import { b as OperationGenerator } from './OperationGenerator-BqfyX5-8.js';
|
|
8
6
|
import '@kubb/core';
|
|
9
|
-
import '
|
|
7
|
+
import '@kubb/fs/types';
|
|
10
8
|
import '@kubb/oas/parser';
|
|
11
9
|
|
|
12
10
|
type Props$1 = {
|
package/dist/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './chunk-
|
|
2
|
-
export { Oas, Operation, Schema } from './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
import './chunk-EJHTGW4H.js';
|
|
2
|
+
export { Oas, Operation, Schema } from './chunk-B4WIB7UG.js';
|
|
3
|
+
import './chunk-E2Z4IRAI.js';
|
|
4
4
|
//# sourceMappingURL=components.js.map
|
|
5
5
|
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk6BDSF64V_cjs = require('./chunk-6BDSF64V.cjs');
|
|
4
|
+
require('./chunk-SMB4EG6V.cjs');
|
|
5
|
+
require('./chunk-YSPJF26N.cjs');
|
|
6
|
+
require('./chunk-XELSZPJC.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "jsonGenerator", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunk6BDSF64V_cjs.jsonGenerator; }
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=generators.cjs.map
|
|
15
|
+
//# sourceMappingURL=generators.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.cjs"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { o as Generator, P as PluginOas } from './OperationGenerator-BqfyX5-8.cjs';
|
|
2
|
+
import '@kubb/core';
|
|
3
|
+
import '@kubb/fs/types';
|
|
4
|
+
import '@kubb/oas';
|
|
5
|
+
import '@kubb/react/types';
|
|
6
|
+
import '@kubb/oas/parser';
|
|
7
|
+
|
|
8
|
+
declare const jsonGenerator: Generator<PluginOas>;
|
|
9
|
+
|
|
10
|
+
export { jsonGenerator };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { o as Generator, P as PluginOas } from './OperationGenerator-BqfyX5-8.js';
|
|
2
|
+
import '@kubb/core';
|
|
3
|
+
import '@kubb/fs/types';
|
|
4
|
+
import '@kubb/oas';
|
|
5
|
+
import '@kubb/react/types';
|
|
6
|
+
import '@kubb/oas/parser';
|
|
7
|
+
|
|
8
|
+
declare const jsonGenerator: Generator<PluginOas>;
|
|
9
|
+
|
|
10
|
+
export { jsonGenerator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.js"}
|
package/dist/hooks.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkYSPJF26N_cjs = require('./chunk-YSPJF26N.cjs');
|
|
4
|
+
var chunkXELSZPJC_cjs = require('./chunk-XELSZPJC.cjs');
|
|
5
5
|
var react = require('@kubb/react');
|
|
6
6
|
|
|
7
7
|
// src/hooks/index.ts
|
|
8
|
-
|
|
8
|
+
chunkXELSZPJC_cjs.init_cjs_shims();
|
|
9
9
|
|
|
10
10
|
// src/hooks/useOas.ts
|
|
11
|
-
|
|
11
|
+
chunkXELSZPJC_cjs.init_cjs_shims();
|
|
12
12
|
function useOas() {
|
|
13
|
-
const { oas } = react.useContext(
|
|
13
|
+
const { oas } = react.useContext(chunkYSPJF26N_cjs.Oas.Context);
|
|
14
14
|
if (!oas) {
|
|
15
15
|
throw new Error("Oas is not defined");
|
|
16
16
|
}
|
|
@@ -18,9 +18,9 @@ function useOas() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
// src/hooks/useOperation.ts
|
|
21
|
-
|
|
21
|
+
chunkXELSZPJC_cjs.init_cjs_shims();
|
|
22
22
|
function useOperation() {
|
|
23
|
-
const { operation } = react.useContext(
|
|
23
|
+
const { operation } = react.useContext(chunkYSPJF26N_cjs.Operation.Context);
|
|
24
24
|
if (!operation) {
|
|
25
25
|
throw new Error("Operation is not defined");
|
|
26
26
|
}
|
|
@@ -28,10 +28,10 @@ function useOperation() {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// src/hooks/useOperationManager.ts
|
|
31
|
-
|
|
31
|
+
chunkXELSZPJC_cjs.init_cjs_shims();
|
|
32
32
|
function useOperationManager() {
|
|
33
33
|
const { plugin, pluginManager } = react.useApp();
|
|
34
|
-
const { generator } = react.useContext(
|
|
34
|
+
const { generator } = react.useContext(chunkYSPJF26N_cjs.Oas.Context);
|
|
35
35
|
if (!generator) {
|
|
36
36
|
throw new Error(`'generator' is not defined`);
|
|
37
37
|
}
|
|
@@ -132,9 +132,9 @@ function useOperationManager() {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
// src/hooks/useOperations.ts
|
|
135
|
-
|
|
135
|
+
chunkXELSZPJC_cjs.init_cjs_shims();
|
|
136
136
|
function useOperations({ method, path } = {}) {
|
|
137
|
-
const { operations } = react.useContext(
|
|
137
|
+
const { operations } = react.useContext(chunkYSPJF26N_cjs.Oas.Context);
|
|
138
138
|
if (!operations) {
|
|
139
139
|
throw new Error("Operations is not defined");
|
|
140
140
|
}
|
|
@@ -150,7 +150,7 @@ function useOperations({ method, path } = {}) {
|
|
|
150
150
|
|
|
151
151
|
Object.defineProperty(exports, "useSchema", {
|
|
152
152
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunkYSPJF26N_cjs.useSchema; }
|
|
154
154
|
});
|
|
155
155
|
exports.useOas = useOas;
|
|
156
156
|
exports.useOperation = useOperation;
|
package/dist/hooks.d.cts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Oas, Operation, HttpMethod } from '@kubb/oas';
|
|
2
2
|
import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
|
|
3
3
|
import * as KubbFile from '@kubb/fs/types';
|
|
4
|
-
import {
|
|
5
|
-
import { a as SchemaContextProps } from './Schema-
|
|
4
|
+
import { w as OperationSchemas } from './OperationGenerator-BqfyX5-8.cjs';
|
|
5
|
+
import { a as SchemaContextProps } from './Schema-BgpIlA79.cjs';
|
|
6
|
+
import '@kubb/react/types';
|
|
6
7
|
import '@kubb/oas/parser';
|
|
7
8
|
import 'react';
|
|
8
|
-
import '@kubb/react/types';
|
|
9
|
-
import './SchemaMapper-sGcY1xL5.cjs';
|
|
10
9
|
|
|
11
10
|
declare function useOas(): Oas;
|
|
12
11
|
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Oas, Operation, HttpMethod } from '@kubb/oas';
|
|
2
2
|
import { Plugin, ResolveNameParams, FileMetaBase } from '@kubb/core';
|
|
3
3
|
import * as KubbFile from '@kubb/fs/types';
|
|
4
|
-
import {
|
|
5
|
-
import { a as SchemaContextProps } from './Schema-
|
|
4
|
+
import { w as OperationSchemas } from './OperationGenerator-BqfyX5-8.js';
|
|
5
|
+
import { a as SchemaContextProps } from './Schema-ExMIJOhD.js';
|
|
6
|
+
import '@kubb/react/types';
|
|
6
7
|
import '@kubb/oas/parser';
|
|
7
8
|
import 'react';
|
|
8
|
-
import '@kubb/react/types';
|
|
9
|
-
import './SchemaMapper-sGcY1xL5.js';
|
|
10
9
|
|
|
11
10
|
declare function useOas(): Oas;
|
|
12
11
|
|
package/dist/hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Oas, Operation } from './chunk-
|
|
2
|
-
export { useSchema } from './chunk-
|
|
3
|
-
import { init_esm_shims } from './chunk-
|
|
1
|
+
import { Oas, Operation } from './chunk-B4WIB7UG.js';
|
|
2
|
+
export { useSchema } from './chunk-B4WIB7UG.js';
|
|
3
|
+
import { init_esm_shims } from './chunk-E2Z4IRAI.js';
|
|
4
4
|
import { useContext, useApp } from '@kubb/react';
|
|
5
5
|
|
|
6
6
|
// src/hooks/index.ts
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
|
|
6
|
-
var
|
|
3
|
+
var chunk2S2QRJPN_cjs = require('./chunk-2S2QRJPN.cjs');
|
|
4
|
+
var chunk6BDSF64V_cjs = require('./chunk-6BDSF64V.cjs');
|
|
5
|
+
require('./chunk-SMB4EG6V.cjs');
|
|
6
|
+
var chunkYSPJF26N_cjs = require('./chunk-YSPJF26N.cjs');
|
|
7
|
+
var chunkXELSZPJC_cjs = require('./chunk-XELSZPJC.cjs');
|
|
7
8
|
var core = require('@kubb/core');
|
|
8
9
|
var transformers = require('@kubb/core/transformers');
|
|
9
10
|
var path = require('path');
|
|
10
|
-
var react = require('@kubb/react');
|
|
11
11
|
|
|
12
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
|
|
@@ -15,10 +15,10 @@ var transformers__default = /*#__PURE__*/_interopDefault(transformers);
|
|
|
15
15
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
16
16
|
|
|
17
17
|
// src/index.ts
|
|
18
|
-
|
|
18
|
+
chunkXELSZPJC_cjs.init_cjs_shims();
|
|
19
19
|
|
|
20
20
|
// src/OperationGenerator.ts
|
|
21
|
-
|
|
21
|
+
chunkXELSZPJC_cjs.init_cjs_shims();
|
|
22
22
|
var OperationGenerator = class extends core.BaseGenerator {
|
|
23
23
|
#operationsByMethod = {};
|
|
24
24
|
get operationsByMethod() {
|
|
@@ -294,21 +294,26 @@ var OperationGenerator = class extends core.BaseGenerator {
|
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
// src/plugin.ts
|
|
297
|
-
|
|
297
|
+
chunkXELSZPJC_cjs.init_cjs_shims();
|
|
298
298
|
var pluginOasName = "plugin-oas";
|
|
299
299
|
var pluginOas = core.createPlugin((options) => {
|
|
300
300
|
const {
|
|
301
|
-
output = {
|
|
301
|
+
output = {
|
|
302
|
+
path: "schemas",
|
|
303
|
+
export: false,
|
|
304
|
+
exportType: "barrelNamed"
|
|
305
|
+
},
|
|
302
306
|
experimentalFilter: filter,
|
|
303
307
|
experimentalSort: sort,
|
|
304
308
|
validate = true,
|
|
309
|
+
generators = [chunk6BDSF64V_cjs.jsonGenerator],
|
|
305
310
|
serverIndex = 0,
|
|
306
311
|
contentType,
|
|
307
312
|
oasClass
|
|
308
313
|
} = options;
|
|
309
314
|
const getOas = async ({ config, logger, formatOptions }) => {
|
|
310
315
|
try {
|
|
311
|
-
const oas = await
|
|
316
|
+
const oas = await chunk2S2QRJPN_cjs.parseFromConfig(config, formatOptions, oasClass);
|
|
312
317
|
if (validate) {
|
|
313
318
|
await oas.valdiate();
|
|
314
319
|
}
|
|
@@ -316,18 +321,12 @@ var pluginOas = core.createPlugin((options) => {
|
|
|
316
321
|
} catch (e) {
|
|
317
322
|
const error = e;
|
|
318
323
|
logger.emit("warning", error?.message);
|
|
319
|
-
return
|
|
324
|
+
return chunk2S2QRJPN_cjs.parseFromConfig(config, {}, oasClass);
|
|
320
325
|
}
|
|
321
326
|
};
|
|
322
327
|
return {
|
|
323
328
|
name: pluginOasName,
|
|
324
|
-
output
|
|
325
|
-
path: "",
|
|
326
|
-
exportType: false
|
|
327
|
-
} : {
|
|
328
|
-
exportType: "barrelNamed",
|
|
329
|
-
...output
|
|
330
|
-
},
|
|
329
|
+
output,
|
|
331
330
|
options,
|
|
332
331
|
context() {
|
|
333
332
|
const { config, logger } = this;
|
|
@@ -337,16 +336,23 @@ var pluginOas = core.createPlugin((options) => {
|
|
|
337
336
|
},
|
|
338
337
|
async getSchemas({ includes } = {}) {
|
|
339
338
|
const oas = await this.getOas();
|
|
340
|
-
return
|
|
339
|
+
return chunkXELSZPJC_cjs.getSchemas({ oas, contentType, includes });
|
|
341
340
|
},
|
|
342
341
|
async getBaseURL() {
|
|
343
342
|
const oasInstance = await this.getOas();
|
|
344
|
-
|
|
345
|
-
return baseURL;
|
|
343
|
+
return oasInstance.api.servers?.at(serverIndex)?.url;
|
|
346
344
|
},
|
|
347
345
|
contentType
|
|
348
346
|
};
|
|
349
347
|
},
|
|
348
|
+
resolvePath(baseName, pathMode, options2) {
|
|
349
|
+
const root = path__default.default.resolve(this.config.root, this.config.output.path);
|
|
350
|
+
const mode = pathMode ?? core.FileManager.getMode(path__default.default.resolve(root, output.path));
|
|
351
|
+
if (mode === "single") {
|
|
352
|
+
return path__default.default.resolve(root, output.path);
|
|
353
|
+
}
|
|
354
|
+
return path__default.default.resolve(root, output.path, baseName);
|
|
355
|
+
},
|
|
350
356
|
async buildStart() {
|
|
351
357
|
if (!output) {
|
|
352
358
|
return;
|
|
@@ -360,100 +366,63 @@ var pluginOas = core.createPlugin((options) => {
|
|
|
360
366
|
}
|
|
361
367
|
});
|
|
362
368
|
await oas.dereference();
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
]
|
|
382
|
-
});
|
|
383
|
-
};
|
|
384
|
-
const promises = Object.entries(schemas).map(mapSchema);
|
|
385
|
-
await Promise.all(promises);
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
// src/generator.tsx
|
|
391
|
-
chunkXQPCA75E_cjs.init_cjs_shims();
|
|
392
|
-
var import_jsx_runtime = chunkXQPCA75E_cjs.__toESM(chunk47SNBYWH_cjs.require_jsx_runtime(), 1);
|
|
393
|
-
function createGenerator(parseOptions) {
|
|
394
|
-
return parseOptions;
|
|
395
|
-
}
|
|
396
|
-
function createReactGenerator(parseOptions) {
|
|
397
|
-
return {
|
|
398
|
-
...parseOptions,
|
|
399
|
-
async operations({ instance, options, operations, operationsByMethod }) {
|
|
400
|
-
if (!parseOptions.Operations) {
|
|
401
|
-
return [];
|
|
402
|
-
}
|
|
403
|
-
const { pluginManager, oas, plugin, mode } = instance.context;
|
|
404
|
-
const root = react.createRoot({
|
|
405
|
-
logger: pluginManager.logger
|
|
406
|
-
});
|
|
407
|
-
root.render(
|
|
408
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(react.App, { pluginManager, plugin, mode, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(chunk47SNBYWH_cjs.Oas, { oas, operations, generator: instance, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(parseOptions.Operations, { operations, instance, operationsByMethod, options }) }) })
|
|
369
|
+
const schemaGenerator = new chunkYSPJF26N_cjs.SchemaGenerator(
|
|
370
|
+
{
|
|
371
|
+
unknownType: "unknown",
|
|
372
|
+
dateType: "date",
|
|
373
|
+
transformers: {},
|
|
374
|
+
...this.plugin.options
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
oas,
|
|
378
|
+
pluginManager: this.pluginManager,
|
|
379
|
+
plugin: this.plugin,
|
|
380
|
+
contentType,
|
|
381
|
+
include: void 0,
|
|
382
|
+
override: void 0,
|
|
383
|
+
mode: "split",
|
|
384
|
+
output: output.path
|
|
385
|
+
}
|
|
409
386
|
);
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
387
|
+
const schemaFiles = await schemaGenerator.build(...generators);
|
|
388
|
+
await this.addFile(...schemaFiles);
|
|
389
|
+
const operationGenerator = new OperationGenerator(this.plugin.options, {
|
|
390
|
+
oas,
|
|
391
|
+
pluginManager: this.pluginManager,
|
|
392
|
+
plugin: this.plugin,
|
|
393
|
+
contentType,
|
|
394
|
+
exclude: void 0,
|
|
395
|
+
include: void 0,
|
|
396
|
+
override: void 0,
|
|
397
|
+
mode: "split"
|
|
419
398
|
});
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
);
|
|
423
|
-
return root.files;
|
|
424
|
-
},
|
|
425
|
-
async schema({ instance, schema, name, options }) {
|
|
426
|
-
if (!parseOptions.Schema) {
|
|
427
|
-
return [];
|
|
428
|
-
}
|
|
429
|
-
const { pluginManager, oas, plugin, mode } = instance.context;
|
|
430
|
-
const root = react.createRoot({
|
|
431
|
-
logger: pluginManager.logger
|
|
432
|
-
});
|
|
433
|
-
const tree = instance.parse({ schema, name });
|
|
434
|
-
root.render(
|
|
435
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(react.App, { pluginManager, plugin: { ...plugin, options }, mode, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(chunk47SNBYWH_cjs.Oas, { oas, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(chunk47SNBYWH_cjs.Oas.Schema, { name, value: schema, tree, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(parseOptions.Schema, { schema, options, instance, name }) }) }) })
|
|
436
|
-
);
|
|
437
|
-
return root.files;
|
|
399
|
+
const operationFiles = await operationGenerator.build(...generators);
|
|
400
|
+
await this.addFile(...operationFiles);
|
|
438
401
|
}
|
|
439
402
|
};
|
|
440
|
-
}
|
|
403
|
+
});
|
|
441
404
|
|
|
405
|
+
Object.defineProperty(exports, "createGenerator", {
|
|
406
|
+
enumerable: true,
|
|
407
|
+
get: function () { return chunk6BDSF64V_cjs.createGenerator; }
|
|
408
|
+
});
|
|
409
|
+
Object.defineProperty(exports, "createReactGenerator", {
|
|
410
|
+
enumerable: true,
|
|
411
|
+
get: function () { return chunk6BDSF64V_cjs.createReactGenerator; }
|
|
412
|
+
});
|
|
442
413
|
Object.defineProperty(exports, "SchemaGenerator", {
|
|
443
414
|
enumerable: true,
|
|
444
|
-
get: function () { return
|
|
415
|
+
get: function () { return chunkYSPJF26N_cjs.SchemaGenerator; }
|
|
445
416
|
});
|
|
446
417
|
Object.defineProperty(exports, "isKeyword", {
|
|
447
418
|
enumerable: true,
|
|
448
|
-
get: function () { return
|
|
419
|
+
get: function () { return chunkYSPJF26N_cjs.isKeyword; }
|
|
449
420
|
});
|
|
450
421
|
Object.defineProperty(exports, "schemaKeywords", {
|
|
451
422
|
enumerable: true,
|
|
452
|
-
get: function () { return
|
|
423
|
+
get: function () { return chunkYSPJF26N_cjs.schemaKeywords; }
|
|
453
424
|
});
|
|
454
425
|
exports.OperationGenerator = OperationGenerator;
|
|
455
|
-
exports.createGenerator = createGenerator;
|
|
456
|
-
exports.createReactGenerator = createReactGenerator;
|
|
457
426
|
exports.pluginOas = pluginOas;
|
|
458
427
|
exports.pluginOasName = pluginOasName;
|
|
459
428
|
//# sourceMappingURL=index.cjs.map
|