@kubb/plugin-solid-query 4.3.1 → 4.4.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/dist/chunk-DMmIE7y6.js +28 -0
- package/dist/{components-D0g890Z2.cjs → components-CHqaXKs-.cjs} +29 -29
- package/dist/components-CHqaXKs-.cjs.map +1 -0
- package/dist/{components-Coq1fmcl.js → components-Cp1BuWfr.js} +3 -3
- package/dist/components-Cp1BuWfr.js.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +12 -15
- package/dist/components.d.ts +12 -15
- package/dist/components.js +1 -1
- package/dist/{generators-D-_RURdc.js → generators-DnKjkxgk.js} +4 -4
- package/dist/generators-DnKjkxgk.js.map +1 -0
- package/dist/{generators-DSsFHoN2.cjs → generators-U3zy_ocI.cjs} +33 -33
- package/dist/generators-U3zy_ocI.cjs.map +1 -0
- package/dist/generators.cjs +2 -2
- package/dist/generators.d.cts +3 -3
- package/dist/generators.d.ts +3 -3
- package/dist/generators.js +2 -2
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-MNYQehp6.d.ts → types-C_UYwG2T.d.ts} +225 -206
- package/dist/{types-DjxPjdTZ.d.cts → types-DFPPpQGq.d.cts} +220 -201
- package/package.json +10 -10
- package/src/components/Mutation.tsx +13 -3
- package/src/components/MutationKey.tsx +3 -2
- package/src/components/Query.tsx +3 -2
- package/src/components/QueryKey.tsx +3 -2
- package/src/components/QueryOptions.tsx +3 -2
- package/src/generators/mutationGenerator.tsx +1 -1
- package/src/generators/queryGenerator.tsx +1 -1
- package/src/plugin.ts +1 -0
- package/dist/components-Coq1fmcl.js.map +0 -1
- package/dist/components-D0g890Z2.cjs.map +0 -1
- package/dist/generators-D-_RURdc.js.map +0 -1
- package/dist/generators-DSsFHoN2.cjs.map +0 -1
|
@@ -4,8 +4,9 @@ import { Operation, Operation as Operation$1 } from "oas/operation";
|
|
|
4
4
|
import { OpenAPIV3 } from "openapi-types";
|
|
5
5
|
import * as oas_normalize_lib_types0 from "oas-normalize/lib/types";
|
|
6
6
|
import BaseOas from "oas";
|
|
7
|
+
import { Fabric, FileManager } from "@kubb/react-fabric";
|
|
7
8
|
import { ConsolaInstance, LogLevel } from "consola";
|
|
8
|
-
import {
|
|
9
|
+
import { KubbNode } from "@kubb/react-fabric/types";
|
|
9
10
|
|
|
10
11
|
//#region ../oas/src/types.d.ts
|
|
11
12
|
type contentType = 'application/json' | (string & {});
|
|
@@ -47,17 +48,17 @@ declare class Oas<const TOAS = unknown> extends BaseOas {
|
|
|
47
48
|
* Abstract class that contains the building blocks for plugins to create their own Generator
|
|
48
49
|
* @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137
|
|
49
50
|
*/
|
|
50
|
-
declare abstract class BaseGenerator<TOptions
|
|
51
|
+
declare abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {
|
|
51
52
|
#private;
|
|
52
|
-
constructor(options?: TOptions
|
|
53
|
-
get options(): TOptions
|
|
53
|
+
constructor(options?: TOptions, context?: TContext);
|
|
54
|
+
get options(): TOptions;
|
|
54
55
|
get context(): TContext;
|
|
55
|
-
set options(options: TOptions
|
|
56
|
+
set options(options: TOptions);
|
|
56
57
|
abstract build(...params: unknown[]): unknown;
|
|
57
58
|
}
|
|
58
59
|
//#endregion
|
|
59
60
|
//#region ../core/src/fs/types.d.ts
|
|
60
|
-
type BasePath<T
|
|
61
|
+
type BasePath<T extends string = string> = `${T}/`;
|
|
61
62
|
type Import = {
|
|
62
63
|
/**
|
|
63
64
|
* Import name to be used
|
|
@@ -131,7 +132,7 @@ type BaseName = `${string}.${string}`;
|
|
|
131
132
|
* Path will be full qualified path to a specified file
|
|
132
133
|
*/
|
|
133
134
|
type Path = string;
|
|
134
|
-
type AdvancedPath<T
|
|
135
|
+
type AdvancedPath<T extends BaseName = BaseName> = `${BasePath}${T}`;
|
|
135
136
|
type OptionalPath = Path | undefined | null;
|
|
136
137
|
type File<TMeta extends object = object> = {
|
|
137
138
|
/**
|
|
@@ -220,7 +221,7 @@ type Logger = {
|
|
|
220
221
|
};
|
|
221
222
|
//#endregion
|
|
222
223
|
//#region ../core/src/utils/types.d.ts
|
|
223
|
-
type PossiblePromise<T
|
|
224
|
+
type PossiblePromise<T> = Promise<T> | T;
|
|
224
225
|
//#endregion
|
|
225
226
|
//#region ../core/src/types.d.ts
|
|
226
227
|
type InputPath = {
|
|
@@ -333,11 +334,11 @@ TName extends string = string,
|
|
|
333
334
|
/**
|
|
334
335
|
* Options of the plugin.
|
|
335
336
|
*/
|
|
336
|
-
TOptions
|
|
337
|
+
TOptions extends object = object,
|
|
337
338
|
/**
|
|
338
339
|
* Options of the plugin that can be used later on, see `options` inside your plugin config.
|
|
339
340
|
*/
|
|
340
|
-
TResolvedOptions extends object = TOptions
|
|
341
|
+
TResolvedOptions extends object = TOptions,
|
|
341
342
|
/**
|
|
342
343
|
* Context that you want to expose to other plugins.
|
|
343
344
|
*/
|
|
@@ -351,23 +352,23 @@ TResolvePathOptions extends object = object> = {
|
|
|
351
352
|
* Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`
|
|
352
353
|
*/
|
|
353
354
|
key: PluginKey<TName | string>;
|
|
354
|
-
options: TOptions
|
|
355
|
+
options: TOptions;
|
|
355
356
|
resolvedOptions: TResolvedOptions;
|
|
356
357
|
context: TContext;
|
|
357
358
|
resolvePathOptions: TResolvePathOptions;
|
|
358
359
|
};
|
|
359
360
|
type PluginKey<TName> = [name: TName, identifier?: string | number];
|
|
360
|
-
type UserPlugin<TOptions
|
|
361
|
+
type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
361
362
|
/**
|
|
362
363
|
* Unique name used for the plugin
|
|
363
364
|
* The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.
|
|
364
365
|
* @example @kubb/typescript
|
|
365
366
|
*/
|
|
366
|
-
name: TOptions
|
|
367
|
+
name: TOptions['name'];
|
|
367
368
|
/**
|
|
368
369
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
369
370
|
*/
|
|
370
|
-
options: TOptions
|
|
371
|
+
options: TOptions['resolvedOptions'];
|
|
371
372
|
/**
|
|
372
373
|
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
|
|
373
374
|
* Can be used to validate dependent plugins.
|
|
@@ -377,23 +378,23 @@ type UserPlugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions>
|
|
|
377
378
|
* Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.
|
|
378
379
|
*/
|
|
379
380
|
post?: Array<string>;
|
|
380
|
-
} & (TOptions
|
|
381
|
+
} & (TOptions['context'] extends never ? {
|
|
381
382
|
context?: never;
|
|
382
383
|
} : {
|
|
383
|
-
context: (this: TOptions
|
|
384
|
+
context: (this: TOptions['name'] extends 'core' ? null : Omit<PluginContext<TOptions>, 'addFile'>) => TOptions['context'];
|
|
384
385
|
});
|
|
385
|
-
type UserPluginWithLifeCycle<TOptions
|
|
386
|
-
type Plugin<TOptions
|
|
386
|
+
type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>;
|
|
387
|
+
type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
387
388
|
/**
|
|
388
389
|
* Unique name used for the plugin
|
|
389
390
|
* @example @kubb/typescript
|
|
390
391
|
*/
|
|
391
|
-
name: TOptions
|
|
392
|
+
name: TOptions['name'];
|
|
392
393
|
/**
|
|
393
394
|
* Internal key used when a developer uses more than one of the same plugin
|
|
394
395
|
* @private
|
|
395
396
|
*/
|
|
396
|
-
key: TOptions
|
|
397
|
+
key: TOptions['key'];
|
|
397
398
|
/**
|
|
398
399
|
* Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.
|
|
399
400
|
* Can be used to validate dependent plugins.
|
|
@@ -406,49 +407,49 @@ type Plugin<TOptions$1 extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
|
406
407
|
/**
|
|
407
408
|
* Options set for a specific plugin(see kubb.config.js), passthrough of options.
|
|
408
409
|
*/
|
|
409
|
-
options: TOptions
|
|
410
|
-
} & (TOptions
|
|
410
|
+
options: TOptions['resolvedOptions'];
|
|
411
|
+
} & (TOptions['context'] extends never ? {
|
|
411
412
|
context?: never;
|
|
412
413
|
} : {
|
|
413
|
-
context: TOptions
|
|
414
|
+
context: TOptions['context'];
|
|
414
415
|
});
|
|
415
|
-
type PluginWithLifeCycle<TOptions
|
|
416
|
-
type PluginLifecycle<TOptions
|
|
416
|
+
type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>;
|
|
417
|
+
type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
417
418
|
/**
|
|
418
419
|
* Start of the lifecycle of a plugin.
|
|
419
420
|
* @type hookParallel
|
|
420
421
|
*/
|
|
421
|
-
buildStart?: (this: PluginContext<TOptions
|
|
422
|
+
buildStart?: (this: PluginContext<TOptions>, Config: Config) => PossiblePromise<void>;
|
|
422
423
|
/**
|
|
423
424
|
* Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).
|
|
424
425
|
* Options can als be included.
|
|
425
426
|
* @type hookFirst
|
|
426
427
|
* @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'
|
|
427
428
|
*/
|
|
428
|
-
resolvePath?: (this: PluginContext<TOptions
|
|
429
|
+
resolvePath?: (this: PluginContext<TOptions>, baseName: BaseName, mode?: Mode, options?: TOptions['resolvePathOptions']) => OptionalPath;
|
|
429
430
|
/**
|
|
430
431
|
* Resolve to a name based on a string.
|
|
431
432
|
* Useful when converting to PascalCase or camelCase.
|
|
432
433
|
* @type hookFirst
|
|
433
434
|
* @example ('pet') => 'Pet'
|
|
434
435
|
*/
|
|
435
|
-
resolveName?: (this: PluginContext<TOptions
|
|
436
|
+
resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string;
|
|
436
437
|
/**
|
|
437
438
|
* End of the plugin lifecycle.
|
|
438
439
|
* @type hookParallel
|
|
439
440
|
*/
|
|
440
|
-
buildEnd?: (this: PluginContext<TOptions
|
|
441
|
+
buildEnd?: (this: PluginContext<TOptions>) => PossiblePromise<void>;
|
|
441
442
|
};
|
|
442
443
|
type PluginLifecycleHooks = keyof PluginLifecycle;
|
|
443
|
-
type PluginParameter<H
|
|
444
|
-
type ResolvePathParams<TOptions
|
|
444
|
+
type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>;
|
|
445
|
+
type ResolvePathParams<TOptions = object> = {
|
|
445
446
|
pluginKey?: Plugin['key'];
|
|
446
447
|
baseName: BaseName;
|
|
447
448
|
mode?: Mode;
|
|
448
449
|
/**
|
|
449
450
|
* Options to be passed to 'resolvePath' 3th parameter
|
|
450
451
|
*/
|
|
451
|
-
options?: TOptions
|
|
452
|
+
options?: TOptions;
|
|
452
453
|
};
|
|
453
454
|
type ResolveNameParams = {
|
|
454
455
|
name: string;
|
|
@@ -461,7 +462,8 @@ type ResolveNameParams = {
|
|
|
461
462
|
*/
|
|
462
463
|
type?: 'file' | 'function' | 'type' | 'const';
|
|
463
464
|
};
|
|
464
|
-
type PluginContext<TOptions
|
|
465
|
+
type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {
|
|
466
|
+
fabric: Fabric;
|
|
465
467
|
config: Config;
|
|
466
468
|
/**
|
|
467
469
|
* @deprecated
|
|
@@ -469,7 +471,7 @@ type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOption
|
|
|
469
471
|
fileManager: FileManager;
|
|
470
472
|
pluginManager: PluginManager;
|
|
471
473
|
addFile: (...file: Array<File>) => Promise<Array<ResolvedFile>>;
|
|
472
|
-
resolvePath: (params: ResolvePathParams<TOptions
|
|
474
|
+
resolvePath: (params: ResolvePathParams<TOptions['resolvePathOptions']>) => OptionalPath;
|
|
473
475
|
resolveName: (params: ResolveNameParams) => string;
|
|
474
476
|
logger: Logger;
|
|
475
477
|
/**
|
|
@@ -479,12 +481,12 @@ type PluginContext<TOptions$1 extends PluginFactoryOptions = PluginFactoryOption
|
|
|
479
481
|
/**
|
|
480
482
|
* Current plugin
|
|
481
483
|
*/
|
|
482
|
-
plugin: Plugin<TOptions
|
|
484
|
+
plugin: Plugin<TOptions>;
|
|
483
485
|
};
|
|
484
486
|
/**
|
|
485
487
|
* Specify the export location for the files and define the behavior of the output
|
|
486
488
|
*/
|
|
487
|
-
type Output<TOptions
|
|
489
|
+
type Output<TOptions> = {
|
|
488
490
|
/**
|
|
489
491
|
* Path to the output folder or file that will contain the generated code
|
|
490
492
|
*/
|
|
@@ -497,11 +499,11 @@ type Output<TOptions$1> = {
|
|
|
497
499
|
/**
|
|
498
500
|
* Add a banner text in the beginning of every file
|
|
499
501
|
*/
|
|
500
|
-
banner?: string | ((options: TOptions
|
|
502
|
+
banner?: string | ((options: TOptions) => string);
|
|
501
503
|
/**
|
|
502
504
|
* Add a footer text in the beginning of every file
|
|
503
505
|
*/
|
|
504
|
-
footer?: string | ((options: TOptions
|
|
506
|
+
footer?: string | ((options: TOptions) => string);
|
|
505
507
|
};
|
|
506
508
|
type GroupContext = {
|
|
507
509
|
group: string;
|
|
@@ -520,20 +522,21 @@ type Group = {
|
|
|
520
522
|
//#region ../core/src/PluginManager.d.ts
|
|
521
523
|
type RequiredPluginLifecycle = Required<PluginLifecycle>;
|
|
522
524
|
type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq';
|
|
523
|
-
type Executer<H
|
|
525
|
+
type Executer<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
524
526
|
message: string;
|
|
525
527
|
strategy: Strategy;
|
|
526
|
-
hookName: H
|
|
528
|
+
hookName: H;
|
|
527
529
|
plugin: Plugin;
|
|
528
530
|
parameters?: unknown[] | undefined;
|
|
529
531
|
output?: unknown;
|
|
530
532
|
};
|
|
531
|
-
type ParseResult<H
|
|
532
|
-
type SafeParseResult<H
|
|
533
|
+
type ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H];
|
|
534
|
+
type SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {
|
|
533
535
|
result: Result;
|
|
534
536
|
plugin: Plugin;
|
|
535
537
|
};
|
|
536
538
|
type Options$3 = {
|
|
539
|
+
fabric: Fabric;
|
|
537
540
|
logger: Logger;
|
|
538
541
|
/**
|
|
539
542
|
* @default Number.POSITIVE_INFINITY
|
|
@@ -545,20 +548,16 @@ type Events = {
|
|
|
545
548
|
executed: [executer: Executer];
|
|
546
549
|
error: [error: Error];
|
|
547
550
|
};
|
|
548
|
-
type GetFileProps<TOptions
|
|
551
|
+
type GetFileProps<TOptions = object> = {
|
|
549
552
|
name: string;
|
|
550
553
|
mode?: Mode;
|
|
551
554
|
extname: Extname;
|
|
552
555
|
pluginKey: Plugin['key'];
|
|
553
|
-
options?: TOptions
|
|
556
|
+
options?: TOptions;
|
|
554
557
|
};
|
|
555
558
|
declare class PluginManager {
|
|
556
559
|
#private;
|
|
557
560
|
readonly plugins: Set<Plugin<PluginFactoryOptions<string, object, object, any, object>>>;
|
|
558
|
-
/**
|
|
559
|
-
* @deprecated do not use from pluginManager
|
|
560
|
-
*/
|
|
561
|
-
readonly fileManager: FileManager;
|
|
562
561
|
readonly events: EventEmitter<Events>;
|
|
563
562
|
readonly config: Config;
|
|
564
563
|
readonly executed: Array<Executer>;
|
|
@@ -671,6 +670,170 @@ type FileMetaBase = {
|
|
|
671
670
|
pluginKey?: Plugin['key'];
|
|
672
671
|
};
|
|
673
672
|
//#endregion
|
|
673
|
+
//#region ../plugin-oas/src/generators/createReactGenerator.d.ts
|
|
674
|
+
type ReactGenerator<TOptions extends PluginFactoryOptions> = {
|
|
675
|
+
name: string;
|
|
676
|
+
type: 'react';
|
|
677
|
+
Operations: (props: OperationsProps<TOptions>) => KubbNode;
|
|
678
|
+
Operation: (props: OperationProps<TOptions>) => KubbNode;
|
|
679
|
+
Schema: (props: SchemaProps$1<TOptions>) => KubbNode;
|
|
680
|
+
};
|
|
681
|
+
//#endregion
|
|
682
|
+
//#region ../plugin-oas/src/generators/types.d.ts
|
|
683
|
+
type OperationsProps<TOptions extends PluginFactoryOptions> = {
|
|
684
|
+
/**
|
|
685
|
+
* @deprecated
|
|
686
|
+
*/
|
|
687
|
+
instance: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
688
|
+
options: TOptions['resolvedOptions'];
|
|
689
|
+
operations: Array<Operation$1>;
|
|
690
|
+
};
|
|
691
|
+
type OperationProps<TOptions extends PluginFactoryOptions> = {
|
|
692
|
+
/**
|
|
693
|
+
* @deprecated
|
|
694
|
+
*/
|
|
695
|
+
instance: Omit<OperationGenerator<TOptions>, 'build'>;
|
|
696
|
+
options: TOptions['resolvedOptions'];
|
|
697
|
+
operation: Operation$1;
|
|
698
|
+
};
|
|
699
|
+
type SchemaProps$1<TOptions extends PluginFactoryOptions> = {
|
|
700
|
+
instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions>, 'build'>;
|
|
701
|
+
options: TOptions['resolvedOptions'];
|
|
702
|
+
schema: {
|
|
703
|
+
name: string;
|
|
704
|
+
tree: Array<Schema>;
|
|
705
|
+
value: SchemaObject$1;
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
type Generator<TOptions extends PluginFactoryOptions> = CoreGenerator<TOptions> | ReactGenerator<TOptions>;
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region ../plugin-oas/src/generators/createGenerator.d.ts
|
|
711
|
+
type CoreGenerator<TOptions extends PluginFactoryOptions> = {
|
|
712
|
+
name: string;
|
|
713
|
+
type: 'core';
|
|
714
|
+
operations: (props: OperationsProps<TOptions>) => Promise<File[]>;
|
|
715
|
+
operation: (props: OperationProps<TOptions>) => Promise<File[]>;
|
|
716
|
+
schema: (props: SchemaProps$1<TOptions>) => Promise<File[]>;
|
|
717
|
+
};
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region ../plugin-oas/src/types.d.ts
|
|
720
|
+
type ResolvePathOptions = {
|
|
721
|
+
pluginKey?: Plugin['key'];
|
|
722
|
+
group?: {
|
|
723
|
+
tag?: string;
|
|
724
|
+
path?: string;
|
|
725
|
+
};
|
|
726
|
+
type?: ResolveNameParams['type'];
|
|
727
|
+
};
|
|
728
|
+
/**
|
|
729
|
+
* `propertyName` is the ref name + resolved with the nameResolver
|
|
730
|
+
* @example import { Pet } from './Pet'
|
|
731
|
+
*
|
|
732
|
+
* `originalName` is the original name used(in PascalCase), only used to remove duplicates
|
|
733
|
+
*
|
|
734
|
+
* `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
|
|
735
|
+
* @example import a type(plugin-ts) for a mock file(swagger-faker)
|
|
736
|
+
*/
|
|
737
|
+
type Ref = {
|
|
738
|
+
propertyName: string;
|
|
739
|
+
originalName: string;
|
|
740
|
+
path: OptionalPath;
|
|
741
|
+
pluginKey?: Plugin['key'];
|
|
742
|
+
};
|
|
743
|
+
type Refs = Record<string, Ref>;
|
|
744
|
+
type OperationSchema = {
|
|
745
|
+
/**
|
|
746
|
+
* Converted name, contains already `PathParams`, `QueryParams`, ...
|
|
747
|
+
*/
|
|
748
|
+
name: string;
|
|
749
|
+
schema: SchemaObject$1;
|
|
750
|
+
operation?: Operation$1;
|
|
751
|
+
/**
|
|
752
|
+
* OperationName in PascalCase, only being used in OperationGenerator
|
|
753
|
+
*/
|
|
754
|
+
operationName: string;
|
|
755
|
+
description?: string;
|
|
756
|
+
statusCode?: number;
|
|
757
|
+
keys?: string[];
|
|
758
|
+
keysToOmit?: string[];
|
|
759
|
+
withData?: boolean;
|
|
760
|
+
};
|
|
761
|
+
type OperationSchemas = {
|
|
762
|
+
pathParams?: OperationSchema & {
|
|
763
|
+
keysToOmit?: never;
|
|
764
|
+
};
|
|
765
|
+
queryParams?: OperationSchema & {
|
|
766
|
+
keysToOmit?: never;
|
|
767
|
+
};
|
|
768
|
+
headerParams?: OperationSchema & {
|
|
769
|
+
keysToOmit?: never;
|
|
770
|
+
};
|
|
771
|
+
request?: OperationSchema;
|
|
772
|
+
response: OperationSchema;
|
|
773
|
+
responses: Array<OperationSchema>;
|
|
774
|
+
statusCodes?: Array<OperationSchema>;
|
|
775
|
+
errors?: Array<OperationSchema>;
|
|
776
|
+
};
|
|
777
|
+
type ByTag = {
|
|
778
|
+
type: 'tag';
|
|
779
|
+
pattern: string | RegExp;
|
|
780
|
+
};
|
|
781
|
+
type ByOperationId = {
|
|
782
|
+
type: 'operationId';
|
|
783
|
+
pattern: string | RegExp;
|
|
784
|
+
};
|
|
785
|
+
type ByPath = {
|
|
786
|
+
type: 'path';
|
|
787
|
+
pattern: string | RegExp;
|
|
788
|
+
};
|
|
789
|
+
type ByMethod = {
|
|
790
|
+
type: 'method';
|
|
791
|
+
pattern: HttpMethod | RegExp;
|
|
792
|
+
};
|
|
793
|
+
type BySchemaName = {
|
|
794
|
+
type: 'schemaName';
|
|
795
|
+
pattern: string | RegExp;
|
|
796
|
+
};
|
|
797
|
+
type ByContentType = {
|
|
798
|
+
type: 'contentType';
|
|
799
|
+
pattern: string | RegExp;
|
|
800
|
+
};
|
|
801
|
+
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
802
|
+
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
803
|
+
type Override<TOptions> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
804
|
+
options: Partial<TOptions>;
|
|
805
|
+
};
|
|
806
|
+
//#endregion
|
|
807
|
+
//#region ../plugin-oas/src/OperationGenerator.d.ts
|
|
808
|
+
type Context$1<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
809
|
+
fabric: Fabric;
|
|
810
|
+
oas: Oas;
|
|
811
|
+
exclude: Array<Exclude$1> | undefined;
|
|
812
|
+
include: Array<Include> | undefined;
|
|
813
|
+
override: Array<Override<TOptions>> | undefined;
|
|
814
|
+
contentType: contentType | undefined;
|
|
815
|
+
pluginManager: PluginManager;
|
|
816
|
+
/**
|
|
817
|
+
* Current plugin
|
|
818
|
+
*/
|
|
819
|
+
plugin: Plugin<TPluginOptions>;
|
|
820
|
+
mode: Mode;
|
|
821
|
+
};
|
|
822
|
+
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context$1<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
823
|
+
#private;
|
|
824
|
+
getSchemas(operation: Operation$1, {
|
|
825
|
+
resolveName
|
|
826
|
+
}?: {
|
|
827
|
+
resolveName?: (name: string) => string;
|
|
828
|
+
}): OperationSchemas;
|
|
829
|
+
getOperations(): Promise<Array<{
|
|
830
|
+
path: string;
|
|
831
|
+
method: HttpMethod;
|
|
832
|
+
operation: Operation$1;
|
|
833
|
+
}>>;
|
|
834
|
+
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
835
|
+
}
|
|
836
|
+
//#endregion
|
|
674
837
|
//#region ../plugin-oas/src/SchemaMapper.d.ts
|
|
675
838
|
type SchemaKeywordMapper = {
|
|
676
839
|
object: {
|
|
@@ -888,96 +1051,9 @@ type Schema = {
|
|
|
888
1051
|
keyword: string;
|
|
889
1052
|
} | SchemaKeywordMapper[keyof SchemaKeywordMapper];
|
|
890
1053
|
//#endregion
|
|
891
|
-
//#region ../plugin-oas/src/types.d.ts
|
|
892
|
-
type ResolvePathOptions = {
|
|
893
|
-
pluginKey?: Plugin['key'];
|
|
894
|
-
group?: {
|
|
895
|
-
tag?: string;
|
|
896
|
-
path?: string;
|
|
897
|
-
};
|
|
898
|
-
type?: ResolveNameParams['type'];
|
|
899
|
-
};
|
|
900
|
-
/**
|
|
901
|
-
* `propertyName` is the ref name + resolved with the nameResolver
|
|
902
|
-
* @example import { Pet } from './Pet'
|
|
903
|
-
*
|
|
904
|
-
* `originalName` is the original name used(in PascalCase), only used to remove duplicates
|
|
905
|
-
*
|
|
906
|
-
* `pluginKey` can be used to override the current plugin being used, handy when you want to import a type/schema out of another plugin
|
|
907
|
-
* @example import a type(plugin-ts) for a mock file(swagger-faker)
|
|
908
|
-
*/
|
|
909
|
-
type Ref = {
|
|
910
|
-
propertyName: string;
|
|
911
|
-
originalName: string;
|
|
912
|
-
path: OptionalPath;
|
|
913
|
-
pluginKey?: Plugin['key'];
|
|
914
|
-
};
|
|
915
|
-
type Refs = Record<string, Ref>;
|
|
916
|
-
type OperationSchema = {
|
|
917
|
-
/**
|
|
918
|
-
* Converted name, contains already `PathParams`, `QueryParams`, ...
|
|
919
|
-
*/
|
|
920
|
-
name: string;
|
|
921
|
-
schema: SchemaObject$1;
|
|
922
|
-
operation?: Operation$1;
|
|
923
|
-
/**
|
|
924
|
-
* OperationName in PascalCase, only being used in OperationGenerator
|
|
925
|
-
*/
|
|
926
|
-
operationName: string;
|
|
927
|
-
description?: string;
|
|
928
|
-
statusCode?: number;
|
|
929
|
-
keys?: string[];
|
|
930
|
-
keysToOmit?: string[];
|
|
931
|
-
withData?: boolean;
|
|
932
|
-
};
|
|
933
|
-
type OperationSchemas = {
|
|
934
|
-
pathParams?: OperationSchema & {
|
|
935
|
-
keysToOmit?: never;
|
|
936
|
-
};
|
|
937
|
-
queryParams?: OperationSchema & {
|
|
938
|
-
keysToOmit?: never;
|
|
939
|
-
};
|
|
940
|
-
headerParams?: OperationSchema & {
|
|
941
|
-
keysToOmit?: never;
|
|
942
|
-
};
|
|
943
|
-
request?: OperationSchema;
|
|
944
|
-
response: OperationSchema;
|
|
945
|
-
responses: Array<OperationSchema>;
|
|
946
|
-
statusCodes?: Array<OperationSchema>;
|
|
947
|
-
errors?: Array<OperationSchema>;
|
|
948
|
-
};
|
|
949
|
-
type ByTag = {
|
|
950
|
-
type: 'tag';
|
|
951
|
-
pattern: string | RegExp;
|
|
952
|
-
};
|
|
953
|
-
type ByOperationId = {
|
|
954
|
-
type: 'operationId';
|
|
955
|
-
pattern: string | RegExp;
|
|
956
|
-
};
|
|
957
|
-
type ByPath = {
|
|
958
|
-
type: 'path';
|
|
959
|
-
pattern: string | RegExp;
|
|
960
|
-
};
|
|
961
|
-
type ByMethod = {
|
|
962
|
-
type: 'method';
|
|
963
|
-
pattern: HttpMethod | RegExp;
|
|
964
|
-
};
|
|
965
|
-
type BySchemaName = {
|
|
966
|
-
type: 'schemaName';
|
|
967
|
-
pattern: string | RegExp;
|
|
968
|
-
};
|
|
969
|
-
type ByContentType = {
|
|
970
|
-
type: 'contentType';
|
|
971
|
-
pattern: string | RegExp;
|
|
972
|
-
};
|
|
973
|
-
type Exclude$1 = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
974
|
-
type Include = ByTag | ByOperationId | ByPath | ByMethod | ByContentType;
|
|
975
|
-
type Override<TOptions$1> = (ByTag | ByOperationId | ByPath | ByMethod | BySchemaName | ByContentType) & {
|
|
976
|
-
options: Partial<TOptions$1>;
|
|
977
|
-
};
|
|
978
|
-
//#endregion
|
|
979
1054
|
//#region ../plugin-oas/src/SchemaGenerator.d.ts
|
|
980
|
-
type Context
|
|
1055
|
+
type Context<TOptions, TPluginOptions extends PluginFactoryOptions> = {
|
|
1056
|
+
fabric: Fabric;
|
|
981
1057
|
oas: Oas;
|
|
982
1058
|
pluginManager: PluginManager;
|
|
983
1059
|
/**
|
|
@@ -986,7 +1062,7 @@ type Context$1<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
|
|
|
986
1062
|
plugin: Plugin<TPluginOptions>;
|
|
987
1063
|
mode: Mode;
|
|
988
1064
|
include?: Array<'schemas' | 'responses' | 'requestBodies'>;
|
|
989
|
-
override: Array<Override<TOptions
|
|
1065
|
+
override: Array<Override<TOptions>> | undefined;
|
|
990
1066
|
contentType?: contentType;
|
|
991
1067
|
output?: string;
|
|
992
1068
|
};
|
|
@@ -1009,15 +1085,15 @@ type SchemaGeneratorOptions = {
|
|
|
1009
1085
|
* TODO TODO add docs
|
|
1010
1086
|
* @beta
|
|
1011
1087
|
*/
|
|
1012
|
-
schema?: (schemaProps: SchemaProps
|
|
1088
|
+
schema?: (schemaProps: SchemaProps, defaultSchemas: Schema[]) => Schema[] | undefined;
|
|
1013
1089
|
};
|
|
1014
1090
|
};
|
|
1015
|
-
type SchemaProps
|
|
1091
|
+
type SchemaProps = {
|
|
1016
1092
|
schemaObject?: SchemaObject$1;
|
|
1017
1093
|
name?: string;
|
|
1018
1094
|
parentName?: string;
|
|
1019
1095
|
};
|
|
1020
|
-
declare class SchemaGenerator<TOptions
|
|
1096
|
+
declare class SchemaGenerator<TOptions extends SchemaGeneratorOptions = SchemaGeneratorOptions, TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TOptions, Context<TOptions, TPluginOptions>> {
|
|
1021
1097
|
#private;
|
|
1022
1098
|
refs: Refs;
|
|
1023
1099
|
/**
|
|
@@ -1025,7 +1101,7 @@ declare class SchemaGenerator<TOptions$1 extends SchemaGeneratorOptions = Schema
|
|
|
1025
1101
|
* Delegates to getBaseTypeFromSchema internally and
|
|
1026
1102
|
* optionally adds a union with null.
|
|
1027
1103
|
*/
|
|
1028
|
-
parse(props: SchemaProps
|
|
1104
|
+
parse(props: SchemaProps): Schema[];
|
|
1029
1105
|
deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
|
|
1030
1106
|
find<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): SchemaKeywordMapper[T] | undefined;
|
|
1031
1107
|
static deepSearch<T extends keyof SchemaKeywordMapper>(tree: Schema[] | undefined, keyword: T): Array<SchemaKeywordMapper[T]>;
|
|
@@ -1035,63 +1111,6 @@ declare class SchemaGenerator<TOptions$1 extends SchemaGeneratorOptions = Schema
|
|
|
1035
1111
|
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
1036
1112
|
}
|
|
1037
1113
|
//#endregion
|
|
1038
|
-
//#region ../plugin-oas/src/generator.d.ts
|
|
1039
|
-
type OperationsProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
1040
|
-
instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
|
|
1041
|
-
options: TOptions$1['resolvedOptions'];
|
|
1042
|
-
operations: Array<Operation$1>;
|
|
1043
|
-
};
|
|
1044
|
-
type OperationProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
1045
|
-
instance: Omit<OperationGenerator<TOptions$1>, 'build'>;
|
|
1046
|
-
options: TOptions$1['resolvedOptions'];
|
|
1047
|
-
operation: Operation$1;
|
|
1048
|
-
};
|
|
1049
|
-
type SchemaProps<TOptions$1 extends PluginFactoryOptions> = {
|
|
1050
|
-
instance: Omit<SchemaGenerator<SchemaGeneratorOptions, TOptions$1>, 'build'>;
|
|
1051
|
-
options: TOptions$1['resolvedOptions'];
|
|
1052
|
-
schema: {
|
|
1053
|
-
name: string;
|
|
1054
|
-
tree: Array<Schema>;
|
|
1055
|
-
value: SchemaObject$1;
|
|
1056
|
-
};
|
|
1057
|
-
};
|
|
1058
|
-
type GeneratorOptions<TOptions$1 extends PluginFactoryOptions> = {
|
|
1059
|
-
name: string;
|
|
1060
|
-
operations?: (this: GeneratorOptions<TOptions$1>, props: OperationsProps<TOptions$1>) => Promise<File[]>;
|
|
1061
|
-
operation?: (this: GeneratorOptions<TOptions$1>, props: OperationProps<TOptions$1>) => Promise<File[]>;
|
|
1062
|
-
schema?: (this: GeneratorOptions<TOptions$1>, props: SchemaProps<TOptions$1>) => Promise<File[]>;
|
|
1063
|
-
};
|
|
1064
|
-
type Generator<TOptions$1 extends PluginFactoryOptions> = GeneratorOptions<TOptions$1>;
|
|
1065
|
-
//#endregion
|
|
1066
|
-
//#region ../plugin-oas/src/OperationGenerator.d.ts
|
|
1067
|
-
type Context<TOptions$1, TPluginOptions extends PluginFactoryOptions> = {
|
|
1068
|
-
oas: Oas;
|
|
1069
|
-
exclude: Array<Exclude$1> | undefined;
|
|
1070
|
-
include: Array<Include> | undefined;
|
|
1071
|
-
override: Array<Override<TOptions$1>> | undefined;
|
|
1072
|
-
contentType: contentType | undefined;
|
|
1073
|
-
pluginManager: PluginManager;
|
|
1074
|
-
/**
|
|
1075
|
-
* Current plugin
|
|
1076
|
-
*/
|
|
1077
|
-
plugin: Plugin<TPluginOptions>;
|
|
1078
|
-
mode: Mode;
|
|
1079
|
-
};
|
|
1080
|
-
declare class OperationGenerator<TPluginOptions extends PluginFactoryOptions = PluginFactoryOptions, TFileMeta extends FileMetaBase = FileMetaBase> extends BaseGenerator<TPluginOptions['resolvedOptions'], Context<TPluginOptions['resolvedOptions'], TPluginOptions>> {
|
|
1081
|
-
#private;
|
|
1082
|
-
getSchemas(operation: Operation$1, {
|
|
1083
|
-
resolveName
|
|
1084
|
-
}?: {
|
|
1085
|
-
resolveName?: (name: string) => string;
|
|
1086
|
-
}): OperationSchemas;
|
|
1087
|
-
getOperations(): Promise<Array<{
|
|
1088
|
-
path: string;
|
|
1089
|
-
method: HttpMethod;
|
|
1090
|
-
operation: Operation$1;
|
|
1091
|
-
}>>;
|
|
1092
|
-
build(...generators: Array<Generator<TPluginOptions>>): Promise<Array<File<TFileMeta>>>;
|
|
1093
|
-
}
|
|
1094
|
-
//#endregion
|
|
1095
1114
|
//#region ../plugin-client/src/types.d.ts
|
|
1096
1115
|
type Options$2 = {
|
|
1097
1116
|
/**
|
|
@@ -1342,5 +1361,5 @@ type ResolvedOptions = {
|
|
|
1342
1361
|
};
|
|
1343
1362
|
type PluginSolidQuery = PluginFactoryOptions<'plugin-solid-query', Options$1, ResolvedOptions, never, ResolvePathOptions>;
|
|
1344
1363
|
//#endregion
|
|
1345
|
-
export {
|
|
1346
|
-
//# sourceMappingURL=types-
|
|
1364
|
+
export { ReactGenerator as a, OperationSchemas as i, PluginSolidQuery as n, UserPluginWithLifeCycle as o, Transformer as r, Operation$1 as s, Options$1 as t };
|
|
1365
|
+
//# sourceMappingURL=types-DFPPpQGq.d.cts.map
|