@ahoo-wang/wow-generator 10.0.0-alpha.6 → 10.0.0-beta.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/README.md +17 -15
- package/README.zh-CN.md +16 -15
- package/dist/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +6 -10
- package/dist/cli.js.map +1 -1
- package/dist/codeGenerator-CADTvm2G.cjs +37 -0
- package/dist/codeGenerator-CADTvm2G.cjs.map +1 -0
- package/dist/{codeGenerator-CU1TGcUI.js → codeGenerator-Cxlr_VOh.js} +619 -539
- package/dist/codeGenerator-Cxlr_VOh.js.map +1 -0
- package/dist/emitters/manifestClients.d.cts +4 -2
- package/dist/emitters/manifestClients.d.ts +4 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/manifest/analyze.d.cts +58 -5
- package/dist/manifest/analyze.d.ts +58 -5
- package/dist/manifest/document.d.cts +12 -62
- package/dist/manifest/document.d.ts +12 -62
- package/package.json +14 -6
- package/dist/codeGenerator-CU1TGcUI.js.map +0 -1
- package/dist/codeGenerator-DzI0zCgM.cjs +0 -27
- package/dist/codeGenerator-DzI0zCgM.cjs.map +0 -1
|
@@ -2,9 +2,11 @@ import { ModuleSet } from '../emit/moduleBuilder.cjs';
|
|
|
2
2
|
import { ManifestModel } from '../manifest/analyze.cjs';
|
|
3
3
|
/** The entry of the client every generated module imports from. */
|
|
4
4
|
export declare const WOW_CLIENT = "@ahoo-wang/wow-client";
|
|
5
|
+
/** The entry of the service routes' client. */
|
|
6
|
+
export declare const WOW_CLIENT_ROUTES = "@ahoo-wang/wow-client/routes";
|
|
5
7
|
/**
|
|
6
|
-
* Describes every file a Manifest generates to its module
|
|
7
|
-
*
|
|
8
|
+
* Describes every file a Manifest generates to its module: the types of each
|
|
9
|
+
* bounded context, its error codes and wait
|
|
8
10
|
* helpers, and the aggregate, command and query clients of each aggregate,
|
|
9
11
|
* all on `@ahoo-wang/wow-client`.
|
|
10
12
|
*
|
|
@@ -2,9 +2,11 @@ import { ModuleSet } from '../emit/moduleBuilder.js';
|
|
|
2
2
|
import { ManifestModel } from '../manifest/analyze.js';
|
|
3
3
|
/** The entry of the client every generated module imports from. */
|
|
4
4
|
export declare const WOW_CLIENT = "@ahoo-wang/wow-client";
|
|
5
|
+
/** The entry of the service routes' client. */
|
|
6
|
+
export declare const WOW_CLIENT_ROUTES = "@ahoo-wang/wow-client/routes";
|
|
5
7
|
/**
|
|
6
|
-
* Describes every file a Manifest generates to its module
|
|
7
|
-
*
|
|
8
|
+
* Describes every file a Manifest generates to its module: the types of each
|
|
9
|
+
* bounded context, its error codes and wait
|
|
8
10
|
* helpers, and the aggregate, command and query clients of each aggregate,
|
|
9
11
|
* all on `@ahoo-wang/wow-client`.
|
|
10
12
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./codeGenerator-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./codeGenerator-CADTvm2G.cjs");exports.CodeGenerator=e.t,exports.ConsoleLogger=e.i,exports.DEFAULT_CONFIG_PATH=e.c,exports.EXIT_CODES=e.o,exports.GeneratorError=e.s,exports.SilentLogger=e.a;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as CodeGenerator, i as ConsoleLogger, c as DEFAULT_CONFIG_PATH, o as EXIT_CODES, s as GeneratorError, a as SilentLogger } from "./codeGenerator-
|
|
1
|
+
export { t as CodeGenerator, i as ConsoleLogger, c as DEFAULT_CONFIG_PATH, o as EXIT_CODES, s as GeneratorError, a as SilentLogger } from "./codeGenerator-Cxlr_VOh.js";
|
|
@@ -34,19 +34,34 @@ export type TextNumbersModel = true | {
|
|
|
34
34
|
export interface CommandModel {
|
|
35
35
|
readonly name: string;
|
|
36
36
|
readonly method: string;
|
|
37
|
-
/**
|
|
37
|
+
/** Its routes, as the Manifest lists them: the client sends it by them. */
|
|
38
|
+
readonly routes: readonly Route[];
|
|
39
|
+
/** Its route by id, and its route without one. */
|
|
38
40
|
readonly byIdPath?: {
|
|
39
|
-
readonly member: string;
|
|
40
41
|
readonly path: string;
|
|
41
42
|
};
|
|
42
43
|
readonly unaddressedPath?: {
|
|
43
|
-
readonly member: string;
|
|
44
44
|
readonly path: string;
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Of an aggregate whose id is its owner's, the method that sends it by no id
|
|
48
|
+
* to the caller's own aggregate (`addItemOwn`); `method` then sends it by id.
|
|
49
|
+
*/
|
|
50
|
+
readonly ownMethod?: string;
|
|
46
51
|
/** The body's type name, or undefined when its schema is unknown. */
|
|
47
52
|
readonly bodyType: string;
|
|
48
|
-
/** The body may be left out: its schema requires nothing. */
|
|
53
|
+
/** The body may be left out: its schema requires nothing the method takes. */
|
|
49
54
|
readonly bodyOptional: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The property of its body that names its aggregate (the Manifest's
|
|
57
|
+
* `idProperty`): the command then has no route by id, and its method no id.
|
|
58
|
+
*/
|
|
59
|
+
readonly idProperty?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Its `idProperty` is computed (`readOnly` in its schema): the service
|
|
62
|
+
* computes it from the body's fields, so the method takes the body without it.
|
|
63
|
+
*/
|
|
64
|
+
readonly idComputed?: boolean;
|
|
50
65
|
readonly creation: string;
|
|
51
66
|
readonly mounted: boolean;
|
|
52
67
|
readonly produces: readonly string[];
|
|
@@ -55,6 +70,11 @@ export interface CommandModel {
|
|
|
55
70
|
/** Its body has exact numbers, under `textNumbers.commands` of its aggregate. */
|
|
56
71
|
readonly bodyNumbers?: boolean;
|
|
57
72
|
}
|
|
73
|
+
/** A route of the Manifest: a method and a path, `{id}` the aggregate id. */
|
|
74
|
+
export interface Route {
|
|
75
|
+
readonly method: string;
|
|
76
|
+
readonly path: string;
|
|
77
|
+
}
|
|
58
78
|
/** A lifecycle command an aggregate lists. */
|
|
59
79
|
export interface LifecycleModel {
|
|
60
80
|
/** `wow.lifecycle.DeleteAggregate`, … */
|
|
@@ -62,6 +82,13 @@ export interface LifecycleModel {
|
|
|
62
82
|
/** The `LifecycleCommands` member. */
|
|
63
83
|
readonly member: string;
|
|
64
84
|
readonly method: string;
|
|
85
|
+
/** Its routes, as the Manifest lists them. */
|
|
86
|
+
readonly routes: readonly Route[];
|
|
87
|
+
/**
|
|
88
|
+
* Of an aggregate whose id is its owner's, the method that sends it by no id
|
|
89
|
+
* to the caller's own aggregate (`deleteAggregateOwn`).
|
|
90
|
+
*/
|
|
91
|
+
readonly ownMethod?: string;
|
|
65
92
|
/**
|
|
66
93
|
* The body's type, or undefined for a command without one: the type
|
|
67
94
|
* generated from the Manifest's `$defs` entry of the command's name when it
|
|
@@ -83,6 +110,11 @@ export interface AggregateModel {
|
|
|
83
110
|
/** The directory of its modules, relative to the output directory. */
|
|
84
111
|
readonly directory: string;
|
|
85
112
|
readonly ownership: string;
|
|
113
|
+
/**
|
|
114
|
+
* Where its id comes from: `assigned`, or `owner` for one whose id is its
|
|
115
|
+
* owner's, whose commands and state read also go by no id to the caller's own.
|
|
116
|
+
*/
|
|
117
|
+
readonly idSource: string;
|
|
86
118
|
readonly snapshot: boolean;
|
|
87
119
|
readonly stateType: string;
|
|
88
120
|
readonly stateFields: readonly string[];
|
|
@@ -118,13 +150,34 @@ export interface ContextModel {
|
|
|
118
150
|
readonly constantName: string;
|
|
119
151
|
readonly directory: string;
|
|
120
152
|
readonly errors: readonly {
|
|
121
|
-
readonly member: string;
|
|
122
153
|
readonly code: string;
|
|
123
154
|
readonly status: number;
|
|
124
155
|
readonly description?: string;
|
|
125
156
|
}[];
|
|
126
157
|
readonly subscriptions: readonly string[];
|
|
127
158
|
readonly aggregates: readonly AggregateModel[];
|
|
159
|
+
/** Its service routes, in the Manifest's order. */
|
|
160
|
+
readonly routes: readonly ServiceRouteModel[];
|
|
161
|
+
}
|
|
162
|
+
/** A parameter of a service route: a path variable or a query parameter, and its TypeScript type. */
|
|
163
|
+
export interface RouteParameterModel {
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly location: 'path' | 'query';
|
|
166
|
+
readonly type: string;
|
|
167
|
+
readonly required: boolean;
|
|
168
|
+
}
|
|
169
|
+
/** A service route: its name, where it is served, its parameters and the types of its body and its answer. */
|
|
170
|
+
export interface ServiceRouteModel {
|
|
171
|
+
readonly name: string;
|
|
172
|
+
readonly method: string;
|
|
173
|
+
readonly path: string;
|
|
174
|
+
readonly description?: string;
|
|
175
|
+
readonly deprecated: boolean;
|
|
176
|
+
readonly parameters: readonly RouteParameterModel[];
|
|
177
|
+
/** The body's type; absent when the route takes none. */
|
|
178
|
+
readonly requestType?: string;
|
|
179
|
+
/** The answer's type; absent when the route answers `204 No Content`. */
|
|
180
|
+
readonly responseType?: string;
|
|
128
181
|
}
|
|
129
182
|
/** What a Manifest generates, decided before anything is written. */
|
|
130
183
|
export interface ManifestModel {
|
|
@@ -34,19 +34,34 @@ export type TextNumbersModel = true | {
|
|
|
34
34
|
export interface CommandModel {
|
|
35
35
|
readonly name: string;
|
|
36
36
|
readonly method: string;
|
|
37
|
-
/**
|
|
37
|
+
/** Its routes, as the Manifest lists them: the client sends it by them. */
|
|
38
|
+
readonly routes: readonly Route[];
|
|
39
|
+
/** Its route by id, and its route without one. */
|
|
38
40
|
readonly byIdPath?: {
|
|
39
|
-
readonly member: string;
|
|
40
41
|
readonly path: string;
|
|
41
42
|
};
|
|
42
43
|
readonly unaddressedPath?: {
|
|
43
|
-
readonly member: string;
|
|
44
44
|
readonly path: string;
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Of an aggregate whose id is its owner's, the method that sends it by no id
|
|
48
|
+
* to the caller's own aggregate (`addItemOwn`); `method` then sends it by id.
|
|
49
|
+
*/
|
|
50
|
+
readonly ownMethod?: string;
|
|
46
51
|
/** The body's type name, or undefined when its schema is unknown. */
|
|
47
52
|
readonly bodyType: string;
|
|
48
|
-
/** The body may be left out: its schema requires nothing. */
|
|
53
|
+
/** The body may be left out: its schema requires nothing the method takes. */
|
|
49
54
|
readonly bodyOptional: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The property of its body that names its aggregate (the Manifest's
|
|
57
|
+
* `idProperty`): the command then has no route by id, and its method no id.
|
|
58
|
+
*/
|
|
59
|
+
readonly idProperty?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Its `idProperty` is computed (`readOnly` in its schema): the service
|
|
62
|
+
* computes it from the body's fields, so the method takes the body without it.
|
|
63
|
+
*/
|
|
64
|
+
readonly idComputed?: boolean;
|
|
50
65
|
readonly creation: string;
|
|
51
66
|
readonly mounted: boolean;
|
|
52
67
|
readonly produces: readonly string[];
|
|
@@ -55,6 +70,11 @@ export interface CommandModel {
|
|
|
55
70
|
/** Its body has exact numbers, under `textNumbers.commands` of its aggregate. */
|
|
56
71
|
readonly bodyNumbers?: boolean;
|
|
57
72
|
}
|
|
73
|
+
/** A route of the Manifest: a method and a path, `{id}` the aggregate id. */
|
|
74
|
+
export interface Route {
|
|
75
|
+
readonly method: string;
|
|
76
|
+
readonly path: string;
|
|
77
|
+
}
|
|
58
78
|
/** A lifecycle command an aggregate lists. */
|
|
59
79
|
export interface LifecycleModel {
|
|
60
80
|
/** `wow.lifecycle.DeleteAggregate`, … */
|
|
@@ -62,6 +82,13 @@ export interface LifecycleModel {
|
|
|
62
82
|
/** The `LifecycleCommands` member. */
|
|
63
83
|
readonly member: string;
|
|
64
84
|
readonly method: string;
|
|
85
|
+
/** Its routes, as the Manifest lists them. */
|
|
86
|
+
readonly routes: readonly Route[];
|
|
87
|
+
/**
|
|
88
|
+
* Of an aggregate whose id is its owner's, the method that sends it by no id
|
|
89
|
+
* to the caller's own aggregate (`deleteAggregateOwn`).
|
|
90
|
+
*/
|
|
91
|
+
readonly ownMethod?: string;
|
|
65
92
|
/**
|
|
66
93
|
* The body's type, or undefined for a command without one: the type
|
|
67
94
|
* generated from the Manifest's `$defs` entry of the command's name when it
|
|
@@ -83,6 +110,11 @@ export interface AggregateModel {
|
|
|
83
110
|
/** The directory of its modules, relative to the output directory. */
|
|
84
111
|
readonly directory: string;
|
|
85
112
|
readonly ownership: string;
|
|
113
|
+
/**
|
|
114
|
+
* Where its id comes from: `assigned`, or `owner` for one whose id is its
|
|
115
|
+
* owner's, whose commands and state read also go by no id to the caller's own.
|
|
116
|
+
*/
|
|
117
|
+
readonly idSource: string;
|
|
86
118
|
readonly snapshot: boolean;
|
|
87
119
|
readonly stateType: string;
|
|
88
120
|
readonly stateFields: readonly string[];
|
|
@@ -118,13 +150,34 @@ export interface ContextModel {
|
|
|
118
150
|
readonly constantName: string;
|
|
119
151
|
readonly directory: string;
|
|
120
152
|
readonly errors: readonly {
|
|
121
|
-
readonly member: string;
|
|
122
153
|
readonly code: string;
|
|
123
154
|
readonly status: number;
|
|
124
155
|
readonly description?: string;
|
|
125
156
|
}[];
|
|
126
157
|
readonly subscriptions: readonly string[];
|
|
127
158
|
readonly aggregates: readonly AggregateModel[];
|
|
159
|
+
/** Its service routes, in the Manifest's order. */
|
|
160
|
+
readonly routes: readonly ServiceRouteModel[];
|
|
161
|
+
}
|
|
162
|
+
/** A parameter of a service route: a path variable or a query parameter, and its TypeScript type. */
|
|
163
|
+
export interface RouteParameterModel {
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly location: 'path' | 'query';
|
|
166
|
+
readonly type: string;
|
|
167
|
+
readonly required: boolean;
|
|
168
|
+
}
|
|
169
|
+
/** A service route: its name, where it is served, its parameters and the types of its body and its answer. */
|
|
170
|
+
export interface ServiceRouteModel {
|
|
171
|
+
readonly name: string;
|
|
172
|
+
readonly method: string;
|
|
173
|
+
readonly path: string;
|
|
174
|
+
readonly description?: string;
|
|
175
|
+
readonly deprecated: boolean;
|
|
176
|
+
readonly parameters: readonly RouteParameterModel[];
|
|
177
|
+
/** The body's type; absent when the route takes none. */
|
|
178
|
+
readonly requestType?: string;
|
|
179
|
+
/** The answer's type; absent when the route answers `204 No Content`. */
|
|
180
|
+
readonly responseType?: string;
|
|
128
181
|
}
|
|
129
182
|
/** What a Manifest generates, decided before anything is written. */
|
|
130
183
|
export interface ManifestModel {
|
|
@@ -1,74 +1,24 @@
|
|
|
1
|
+
import { AggregateManifest, CommandManifest, ContextManifest, ErrorManifest, EventManifest, Manifest } from '@ahoo-wang/wow-client';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* A Wow V10 service Manifest (`GET /wow/manifest`, or the merged
|
|
4
|
+
* `manifest.json` of the build), typed as `@ahoo-wang/wow-client` types it:
|
|
5
|
+
* generated from the Manifest's own JSON Schema, so the generator reads the
|
|
6
|
+
* format as it is.
|
|
5
7
|
*/
|
|
6
|
-
export
|
|
7
|
-
readonly format: number;
|
|
8
|
-
readonly service?: {
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly version?: string;
|
|
11
|
-
};
|
|
12
|
-
readonly contexts: readonly ManifestContext[];
|
|
13
|
-
readonly errors?: readonly ManifestError[];
|
|
14
|
-
readonly $defs?: Readonly<Record<string, JsonSchema>>;
|
|
15
|
-
}
|
|
8
|
+
export type ManifestDocument = Manifest;
|
|
16
9
|
/** A bounded context of the Manifest. */
|
|
17
|
-
export
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly description?: string;
|
|
20
|
-
readonly aggregates?: readonly ManifestAggregate[];
|
|
21
|
-
readonly subscriptions?: readonly {
|
|
22
|
-
readonly name: string;
|
|
23
|
-
}[];
|
|
24
|
-
readonly errors?: readonly ManifestError[];
|
|
25
|
-
}
|
|
10
|
+
export type ManifestContext = ContextManifest;
|
|
26
11
|
/** An aggregate of a bounded context. */
|
|
27
|
-
export
|
|
28
|
-
readonly name: string;
|
|
29
|
-
readonly description?: string;
|
|
30
|
-
readonly state: {
|
|
31
|
-
readonly schema: string;
|
|
32
|
-
};
|
|
33
|
-
readonly snapshot?: {
|
|
34
|
-
readonly enabled?: boolean;
|
|
35
|
-
};
|
|
36
|
-
readonly commands?: readonly ManifestCommand[];
|
|
37
|
-
readonly events?: readonly ManifestEvent[];
|
|
38
|
-
readonly lifecycle?: readonly string[];
|
|
39
|
-
readonly queries?: readonly {
|
|
40
|
-
readonly model: string;
|
|
41
|
-
}[];
|
|
42
|
-
readonly ownership?: string;
|
|
43
|
-
}
|
|
12
|
+
export type ManifestAggregate = AggregateManifest;
|
|
44
13
|
/** A command of an aggregate. */
|
|
45
|
-
export
|
|
46
|
-
readonly name: string;
|
|
47
|
-
readonly schema: string;
|
|
48
|
-
readonly creation?: string;
|
|
49
|
-
readonly produces?: readonly string[];
|
|
50
|
-
readonly routes?: readonly {
|
|
51
|
-
readonly method: string;
|
|
52
|
-
readonly path: string;
|
|
53
|
-
}[];
|
|
54
|
-
readonly mounted?: boolean;
|
|
55
|
-
readonly description?: string;
|
|
56
|
-
}
|
|
14
|
+
export type ManifestCommand = CommandManifest;
|
|
57
15
|
/** An event of an aggregate. */
|
|
58
|
-
export
|
|
59
|
-
readonly name: string;
|
|
60
|
-
readonly revision?: number;
|
|
61
|
-
readonly schema: string;
|
|
62
|
-
}
|
|
16
|
+
export type ManifestEvent = EventManifest;
|
|
63
17
|
/** An error code of the Manifest. */
|
|
64
|
-
export
|
|
65
|
-
readonly code: string;
|
|
66
|
-
readonly status: number;
|
|
67
|
-
readonly description?: string;
|
|
68
|
-
}
|
|
18
|
+
export type ManifestError = ErrorManifest;
|
|
69
19
|
/** A JSON Schema 2020-12 of `$defs`, as the Manifest writes them. */
|
|
70
20
|
export type JsonSchema = Readonly<Record<string, unknown>>;
|
|
71
|
-
/** The Manifest format the generator reads
|
|
21
|
+
/** The Manifest format the generator reads. */
|
|
72
22
|
export declare const MANIFEST_FORMAT = 1;
|
|
73
23
|
/** The `$defs` key a schema reference points to, or undefined for another. */
|
|
74
24
|
export declare function schemaKey(ref: string): string | undefined;
|
|
@@ -1,74 +1,24 @@
|
|
|
1
|
+
import { AggregateManifest, CommandManifest, ContextManifest, ErrorManifest, EventManifest, Manifest } from '@ahoo-wang/wow-client';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* A Wow V10 service Manifest (`GET /wow/manifest`, or the merged
|
|
4
|
+
* `manifest.json` of the build), typed as `@ahoo-wang/wow-client` types it:
|
|
5
|
+
* generated from the Manifest's own JSON Schema, so the generator reads the
|
|
6
|
+
* format as it is.
|
|
5
7
|
*/
|
|
6
|
-
export
|
|
7
|
-
readonly format: number;
|
|
8
|
-
readonly service?: {
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly version?: string;
|
|
11
|
-
};
|
|
12
|
-
readonly contexts: readonly ManifestContext[];
|
|
13
|
-
readonly errors?: readonly ManifestError[];
|
|
14
|
-
readonly $defs?: Readonly<Record<string, JsonSchema>>;
|
|
15
|
-
}
|
|
8
|
+
export type ManifestDocument = Manifest;
|
|
16
9
|
/** A bounded context of the Manifest. */
|
|
17
|
-
export
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly description?: string;
|
|
20
|
-
readonly aggregates?: readonly ManifestAggregate[];
|
|
21
|
-
readonly subscriptions?: readonly {
|
|
22
|
-
readonly name: string;
|
|
23
|
-
}[];
|
|
24
|
-
readonly errors?: readonly ManifestError[];
|
|
25
|
-
}
|
|
10
|
+
export type ManifestContext = ContextManifest;
|
|
26
11
|
/** An aggregate of a bounded context. */
|
|
27
|
-
export
|
|
28
|
-
readonly name: string;
|
|
29
|
-
readonly description?: string;
|
|
30
|
-
readonly state: {
|
|
31
|
-
readonly schema: string;
|
|
32
|
-
};
|
|
33
|
-
readonly snapshot?: {
|
|
34
|
-
readonly enabled?: boolean;
|
|
35
|
-
};
|
|
36
|
-
readonly commands?: readonly ManifestCommand[];
|
|
37
|
-
readonly events?: readonly ManifestEvent[];
|
|
38
|
-
readonly lifecycle?: readonly string[];
|
|
39
|
-
readonly queries?: readonly {
|
|
40
|
-
readonly model: string;
|
|
41
|
-
}[];
|
|
42
|
-
readonly ownership?: string;
|
|
43
|
-
}
|
|
12
|
+
export type ManifestAggregate = AggregateManifest;
|
|
44
13
|
/** A command of an aggregate. */
|
|
45
|
-
export
|
|
46
|
-
readonly name: string;
|
|
47
|
-
readonly schema: string;
|
|
48
|
-
readonly creation?: string;
|
|
49
|
-
readonly produces?: readonly string[];
|
|
50
|
-
readonly routes?: readonly {
|
|
51
|
-
readonly method: string;
|
|
52
|
-
readonly path: string;
|
|
53
|
-
}[];
|
|
54
|
-
readonly mounted?: boolean;
|
|
55
|
-
readonly description?: string;
|
|
56
|
-
}
|
|
14
|
+
export type ManifestCommand = CommandManifest;
|
|
57
15
|
/** An event of an aggregate. */
|
|
58
|
-
export
|
|
59
|
-
readonly name: string;
|
|
60
|
-
readonly revision?: number;
|
|
61
|
-
readonly schema: string;
|
|
62
|
-
}
|
|
16
|
+
export type ManifestEvent = EventManifest;
|
|
63
17
|
/** An error code of the Manifest. */
|
|
64
|
-
export
|
|
65
|
-
readonly code: string;
|
|
66
|
-
readonly status: number;
|
|
67
|
-
readonly description?: string;
|
|
68
|
-
}
|
|
18
|
+
export type ManifestError = ErrorManifest;
|
|
69
19
|
/** A JSON Schema 2020-12 of `$defs`, as the Manifest writes them. */
|
|
70
20
|
export type JsonSchema = Readonly<Record<string, unknown>>;
|
|
71
|
-
/** The Manifest format the generator reads
|
|
21
|
+
/** The Manifest format the generator reads. */
|
|
72
22
|
export declare const MANIFEST_FORMAT = 1;
|
|
73
23
|
/** The `$defs` key a schema reference points to, or undefined for another. */
|
|
74
24
|
export declare function schemaKey(ref: string): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahoo-wang/wow-generator",
|
|
3
|
-
"version": "10.0.0-
|
|
3
|
+
"version": "10.0.0-beta.1",
|
|
4
4
|
"description": "Generates the typed TypeScript clients of a Wow service from its Manifest, and TypeScript models and Fetcher decorator clients from any OpenAPI 3 document (https://github.com/Ahoo-Wang/Wow).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wow",
|
|
@@ -64,7 +64,15 @@
|
|
|
64
64
|
"@ahoo-wang/fetcher": "^5.1.5 || ^6.0.0",
|
|
65
65
|
"@ahoo-wang/fetcher-decorator": "^5.1.5 || ^6.0.0",
|
|
66
66
|
"@ahoo-wang/fetcher-eventstream": "^5.1.5 || ^6.0.0",
|
|
67
|
-
"@ahoo-wang/wow-client": "~10.0.0-
|
|
67
|
+
"@ahoo-wang/wow-client": "~10.0.0-beta.1"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"@ahoo-wang/fetcher-decorator": {
|
|
71
|
+
"optional": true
|
|
72
|
+
},
|
|
73
|
+
"@ahoo-wang/fetcher-eventstream": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
68
76
|
},
|
|
69
77
|
"dependencies": {
|
|
70
78
|
"ts-morph": "^28.0.0",
|
|
@@ -83,14 +91,14 @@
|
|
|
83
91
|
"eslint": "^10.13.0",
|
|
84
92
|
"eslint-plugin-import-x": "^4.17.1",
|
|
85
93
|
"globals": "^17.13.0",
|
|
86
|
-
"prettier": "3.9.
|
|
94
|
+
"prettier": "3.9.10",
|
|
87
95
|
"typescript": "~6.0.3",
|
|
88
|
-
"typescript-eslint": "^8.
|
|
96
|
+
"typescript-eslint": "^8.72.0",
|
|
89
97
|
"unplugin-dts": "1.1.2",
|
|
90
|
-
"vite": "8.3.
|
|
98
|
+
"vite": "8.3.5",
|
|
91
99
|
"vite-bundle-analyzer": "^1.3.9",
|
|
92
100
|
"vitest": "^4.1.12",
|
|
93
|
-
"@ahoo-wang/wow-client": "~10.0.0-
|
|
101
|
+
"@ahoo-wang/wow-client": "~10.0.0-beta.1"
|
|
94
102
|
},
|
|
95
103
|
"scripts": {
|
|
96
104
|
"build": "vite build && pnpm test:package",
|