@abp/ng.schematics 5.0.1 → 5.0.2
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 +3 -3
- package/collection.json +29 -29
- package/commands/api/files-enum/proxy/__namespace@dir__/__name@kebab__.enum.ts.template +8 -8
- package/commands/api/files-model/proxy/__namespace@dir__/models.ts.template +9 -9
- package/commands/api/files-service/proxy/__namespace@dir__/__name@kebab__.service.ts.template +25 -25
- package/commands/api/index.d.ts +2 -2
- package/commands/api/index.js +112 -112
- package/commands/api/schema.json +45 -45
- package/commands/proxy-add/index.d.ts +2 -2
- package/commands/proxy-add/index.js +41 -41
- package/commands/proxy-add/schema.json +45 -45
- package/commands/proxy-index/index.d.ts +4 -4
- package/commands/proxy-index/index.js +14 -14
- package/commands/proxy-index/schema.json +18 -18
- package/commands/proxy-refresh/index.d.ts +3 -3
- package/commands/proxy-refresh/index.js +27 -27
- package/commands/proxy-refresh/schema.json +45 -45
- package/commands/proxy-remove/index.d.ts +3 -3
- package/commands/proxy-remove/index.js +33 -33
- package/commands/proxy-remove/schema.json +45 -45
- package/constants/api.d.ts +1 -1
- package/constants/api.js +4 -4
- package/constants/index.d.ts +4 -4
- package/constants/index.js +16 -16
- package/constants/proxy.d.ts +4 -4
- package/constants/proxy.js +24 -24
- package/constants/system-types.d.ts +1 -1
- package/constants/system-types.js +27 -27
- package/constants/volo.d.ts +1 -1
- package/constants/volo.js +4 -4
- package/enums/binding-source-id.d.ts +6 -6
- package/enums/binding-source-id.js +10 -10
- package/enums/exception.d.ts +16 -16
- package/enums/exception.js +2 -2
- package/enums/import-keyword.d.ts +4 -4
- package/enums/import-keyword.js +8 -8
- package/enums/index.d.ts +4 -4
- package/enums/index.js +16 -16
- package/enums/method-modifier.d.ts +6 -6
- package/enums/method-modifier.js +10 -10
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/models/api-definition.d.ts +72 -72
- package/models/api-definition.js +2 -2
- package/models/generate-proxy-schema.d.ts +18 -18
- package/models/generate-proxy-schema.js +2 -2
- package/models/import.d.ts +11 -11
- package/models/import.js +13 -13
- package/models/index.d.ts +10 -10
- package/models/index.js +22 -22
- package/models/method.d.ts +31 -31
- package/models/method.js +61 -61
- package/models/model.d.ts +48 -48
- package/models/model.js +71 -71
- package/models/project.d.ts +5 -5
- package/models/project.js +2 -2
- package/models/proxy-config.d.ts +4 -4
- package/models/proxy-config.js +2 -2
- package/models/service.d.ts +21 -21
- package/models/service.js +11 -11
- package/models/tree.d.ts +1 -1
- package/models/tree.js +2 -2
- package/models/util.d.ts +7 -7
- package/models/util.js +2 -2
- package/package.json +1 -1
- package/test-setup.d.ts +1 -1
- package/test-setup.js +3 -3
- package/utils/angular/ast-utils.d.ts +115 -115
- package/utils/angular/ast-utils.js +598 -598
- package/utils/angular/change.d.ts +66 -66
- package/utils/angular/change.js +96 -96
- package/utils/angular/config.d.ts +455 -455
- package/utils/angular/config.js +70 -70
- package/utils/angular/dependencies.d.ts +23 -23
- package/utils/angular/dependencies.js +58 -58
- package/utils/angular/find-module.d.ts +35 -35
- package/utils/angular/find-module.js +105 -105
- package/utils/angular/index.d.ts +17 -17
- package/utils/angular/index.js +29 -29
- package/utils/angular/json-file.d.ts +23 -23
- package/utils/angular/json-file.js +61 -61
- package/utils/angular/json-utils.d.ts +14 -14
- package/utils/angular/json-utils.js +158 -158
- package/utils/angular/latest-versions.d.ts +18 -18
- package/utils/angular/latest-versions.js +26 -26
- package/utils/angular/lint-fix.d.ts +9 -9
- package/utils/angular/lint-fix.js +41 -41
- package/utils/angular/ng-ast-utils.d.ts +5 -5
- package/utils/angular/ng-ast-utils.js +75 -75
- package/utils/angular/parse-name.d.ts +13 -13
- package/utils/angular/parse-name.js +21 -21
- package/utils/angular/paths.d.ts +8 -8
- package/utils/angular/paths.js +21 -21
- package/utils/angular/project-targets.d.ts +9 -9
- package/utils/angular/project-targets.js +15 -15
- package/utils/angular/tsconfig.d.ts +16 -16
- package/utils/angular/tsconfig.js +62 -62
- package/utils/angular/validation.d.ts +4 -4
- package/utils/angular/validation.js +73 -73
- package/utils/angular/workspace-models.d.ts +159 -159
- package/utils/angular/workspace-models.js +29 -29
- package/utils/angular/workspace.d.ts +18 -18
- package/utils/angular/workspace.js +75 -75
- package/utils/api.d.ts +2 -2
- package/utils/api.js +8 -8
- package/utils/ast.d.ts +4 -4
- package/utils/ast.js +23 -23
- package/utils/barrel.d.ts +4 -4
- package/utils/barrel.js +92 -92
- package/utils/common.d.ts +6 -6
- package/utils/common.js +33 -33
- package/utils/enum.d.ts +18 -18
- package/utils/enum.js +40 -40
- package/utils/file.d.ts +2 -2
- package/utils/file.js +9 -9
- package/utils/generics.d.ts +24 -24
- package/utils/generics.js +87 -87
- package/utils/import.d.ts +3 -3
- package/utils/import.js +11 -11
- package/utils/index.d.ts +19 -19
- package/utils/index.js +31 -31
- package/utils/model.d.ts +11 -11
- package/utils/model.js +141 -141
- package/utils/namespace.d.ts +1 -1
- package/utils/namespace.js +18 -18
- package/utils/path.d.ts +2 -2
- package/utils/path.js +36 -36
- package/utils/rule.d.ts +4 -4
- package/utils/rule.js +27 -27
- package/utils/service.d.ts +6 -6
- package/utils/service.js +82 -82
- package/utils/source.d.ts +13 -13
- package/utils/source.js +162 -162
- package/utils/text.d.ts +9 -9
- package/utils/text.js +46 -46
- package/utils/tree.d.ts +13 -13
- package/utils/tree.js +56 -56
- package/utils/type.d.ts +12 -12
- package/utils/type.js +102 -102
- package/utils/workspace.d.ts +8 -8
- package/utils/workspace.js +66 -66
package/models/method.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { eMethodModifier } from '../enums';
|
|
2
|
-
import { ParameterInBody } from './api-definition';
|
|
3
|
-
import { Property } from './model';
|
|
4
|
-
import { Omissible } from './util';
|
|
5
|
-
export declare class Method {
|
|
6
|
-
body: Body;
|
|
7
|
-
signature: Signature;
|
|
8
|
-
constructor(options: MethodOptions);
|
|
9
|
-
}
|
|
10
|
-
export declare type MethodOptions = Method;
|
|
11
|
-
export declare class Signature {
|
|
12
|
-
generics: string;
|
|
13
|
-
modifier: eMethodModifier;
|
|
14
|
-
name: string;
|
|
15
|
-
parameters: Property[];
|
|
16
|
-
returnType: string;
|
|
17
|
-
constructor(options: SignatureOptions);
|
|
18
|
-
}
|
|
19
|
-
export declare type SignatureOptions = Omissible<Signature, 'generics' | 'modifier' | 'parameters' | 'returnType'>;
|
|
20
|
-
export declare class Body {
|
|
21
|
-
body?: string;
|
|
22
|
-
method: string;
|
|
23
|
-
params: string[];
|
|
24
|
-
requestType: string;
|
|
25
|
-
responseType: string;
|
|
26
|
-
url: string;
|
|
27
|
-
registerActionParameter: (param: ParameterInBody) => void;
|
|
28
|
-
constructor(options: BodyOptions);
|
|
29
|
-
private setUrlQuotes;
|
|
30
|
-
}
|
|
31
|
-
export declare type BodyOptions = Omissible<Omit<Body, 'registerActionParameter'>, 'params' | 'requestType'>;
|
|
1
|
+
import { eMethodModifier } from '../enums';
|
|
2
|
+
import { ParameterInBody } from './api-definition';
|
|
3
|
+
import { Property } from './model';
|
|
4
|
+
import { Omissible } from './util';
|
|
5
|
+
export declare class Method {
|
|
6
|
+
body: Body;
|
|
7
|
+
signature: Signature;
|
|
8
|
+
constructor(options: MethodOptions);
|
|
9
|
+
}
|
|
10
|
+
export declare type MethodOptions = Method;
|
|
11
|
+
export declare class Signature {
|
|
12
|
+
generics: string;
|
|
13
|
+
modifier: eMethodModifier;
|
|
14
|
+
name: string;
|
|
15
|
+
parameters: Property[];
|
|
16
|
+
returnType: string;
|
|
17
|
+
constructor(options: SignatureOptions);
|
|
18
|
+
}
|
|
19
|
+
export declare type SignatureOptions = Omissible<Signature, 'generics' | 'modifier' | 'parameters' | 'returnType'>;
|
|
20
|
+
export declare class Body {
|
|
21
|
+
body?: string;
|
|
22
|
+
method: string;
|
|
23
|
+
params: string[];
|
|
24
|
+
requestType: string;
|
|
25
|
+
responseType: string;
|
|
26
|
+
url: string;
|
|
27
|
+
registerActionParameter: (param: ParameterInBody) => void;
|
|
28
|
+
constructor(options: BodyOptions);
|
|
29
|
+
private setUrlQuotes;
|
|
30
|
+
}
|
|
31
|
+
export declare type BodyOptions = Omissible<Omit<Body, 'registerActionParameter'>, 'params' | 'requestType'>;
|
package/models/method.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Body = exports.Signature = exports.Method = void 0;
|
|
4
|
-
const enums_1 = require("../enums");
|
|
5
|
-
const text_1 = require("../utils/text");
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
7
|
-
const shouldQuote = require('should-quote');
|
|
8
|
-
class Method {
|
|
9
|
-
constructor(options) {
|
|
10
|
-
Object.assign(this, options);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.Method = Method;
|
|
14
|
-
class Signature {
|
|
15
|
-
constructor(options) {
|
|
16
|
-
this.generics = '';
|
|
17
|
-
this.modifier = enums_1.eMethodModifier.Public;
|
|
18
|
-
this.parameters = [];
|
|
19
|
-
this.returnType = '';
|
|
20
|
-
Object.assign(this, options);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.Signature = Signature;
|
|
24
|
-
class Body {
|
|
25
|
-
constructor(options) {
|
|
26
|
-
this.params = [];
|
|
27
|
-
this.requestType = 'any';
|
|
28
|
-
this.registerActionParameter = (param) => {
|
|
29
|
-
const { bindingSourceId, descriptorName, jsonName, name, nameOnMethod } = param;
|
|
30
|
-
const camelName = text_1.camel(name);
|
|
31
|
-
const paramName = jsonName || camelName;
|
|
32
|
-
const value = descriptorName
|
|
33
|
-
? shouldQuote(paramName)
|
|
34
|
-
? `${descriptorName}['${paramName}']`
|
|
35
|
-
: `${descriptorName}.${paramName}`
|
|
36
|
-
: nameOnMethod;
|
|
37
|
-
switch (bindingSourceId) {
|
|
38
|
-
case enums_1.eBindingSourceId.Model:
|
|
39
|
-
case enums_1.eBindingSourceId.Query:
|
|
40
|
-
this.params.push(paramName === value ? value : `${paramName}: ${value}`);
|
|
41
|
-
break;
|
|
42
|
-
case enums_1.eBindingSourceId.Body:
|
|
43
|
-
this.body = value;
|
|
44
|
-
break;
|
|
45
|
-
case enums_1.eBindingSourceId.Path:
|
|
46
|
-
// eslint-disable-next-line no-case-declarations
|
|
47
|
-
const regex = new RegExp('{(' + paramName + '|' + camelName + '|' + name + ')}', 'g');
|
|
48
|
-
this.url = this.url.replace(regex, '${' + value + '}');
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
Object.assign(this, options);
|
|
55
|
-
this.setUrlQuotes();
|
|
56
|
-
}
|
|
57
|
-
setUrlQuotes() {
|
|
58
|
-
this.url = /{/.test(this.url) ? `\`/${this.url}\`` : `'/${this.url}'`;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.Body = Body;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Body = exports.Signature = exports.Method = void 0;
|
|
4
|
+
const enums_1 = require("../enums");
|
|
5
|
+
const text_1 = require("../utils/text");
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
7
|
+
const shouldQuote = require('should-quote');
|
|
8
|
+
class Method {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
Object.assign(this, options);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.Method = Method;
|
|
14
|
+
class Signature {
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.generics = '';
|
|
17
|
+
this.modifier = enums_1.eMethodModifier.Public;
|
|
18
|
+
this.parameters = [];
|
|
19
|
+
this.returnType = '';
|
|
20
|
+
Object.assign(this, options);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Signature = Signature;
|
|
24
|
+
class Body {
|
|
25
|
+
constructor(options) {
|
|
26
|
+
this.params = [];
|
|
27
|
+
this.requestType = 'any';
|
|
28
|
+
this.registerActionParameter = (param) => {
|
|
29
|
+
const { bindingSourceId, descriptorName, jsonName, name, nameOnMethod } = param;
|
|
30
|
+
const camelName = text_1.camel(name);
|
|
31
|
+
const paramName = jsonName || camelName;
|
|
32
|
+
const value = descriptorName
|
|
33
|
+
? shouldQuote(paramName)
|
|
34
|
+
? `${descriptorName}['${paramName}']`
|
|
35
|
+
: `${descriptorName}.${paramName}`
|
|
36
|
+
: nameOnMethod;
|
|
37
|
+
switch (bindingSourceId) {
|
|
38
|
+
case enums_1.eBindingSourceId.Model:
|
|
39
|
+
case enums_1.eBindingSourceId.Query:
|
|
40
|
+
this.params.push(paramName === value ? value : `${paramName}: ${value}`);
|
|
41
|
+
break;
|
|
42
|
+
case enums_1.eBindingSourceId.Body:
|
|
43
|
+
this.body = value;
|
|
44
|
+
break;
|
|
45
|
+
case enums_1.eBindingSourceId.Path:
|
|
46
|
+
// eslint-disable-next-line no-case-declarations
|
|
47
|
+
const regex = new RegExp('{(' + paramName + '|' + camelName + '|' + name + ')}', 'g');
|
|
48
|
+
this.url = this.url.replace(regex, '${' + value + '}');
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
Object.assign(this, options);
|
|
55
|
+
this.setUrlQuotes();
|
|
56
|
+
}
|
|
57
|
+
setUrlQuotes() {
|
|
58
|
+
this.url = /{/.test(this.url) ? `\`/${this.url}\`` : `'/${this.url}'`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.Body = Body;
|
|
62
62
|
//# sourceMappingURL=method.js.map
|
package/models/model.d.ts
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { Import } from './import';
|
|
2
|
-
import { Options } from './util';
|
|
3
|
-
export declare class Model {
|
|
4
|
-
readonly imports: Import[];
|
|
5
|
-
readonly interfaces: Interface[];
|
|
6
|
-
readonly namespace: string;
|
|
7
|
-
readonly path: string;
|
|
8
|
-
constructor(options: ModelOptions);
|
|
9
|
-
}
|
|
10
|
-
export declare type ModelOptions = Options<Model, 'imports' | 'interfaces'>;
|
|
11
|
-
export declare class Interface {
|
|
12
|
-
readonly base: string | null;
|
|
13
|
-
readonly identifier: string;
|
|
14
|
-
readonly namespace: string;
|
|
15
|
-
readonly generics: Generic[];
|
|
16
|
-
readonly properties: Property[];
|
|
17
|
-
readonly ref: string;
|
|
18
|
-
constructor(options: InterfaceOptions);
|
|
19
|
-
}
|
|
20
|
-
export declare type InterfaceOptions = Options<Interface, 'generics' | 'properties'>;
|
|
21
|
-
declare abstract class TypeRef {
|
|
22
|
-
readonly refs: string[];
|
|
23
|
-
protected _type: string;
|
|
24
|
-
get type(): string;
|
|
25
|
-
set type(value: string);
|
|
26
|
-
protected _default: string;
|
|
27
|
-
get default(): string;
|
|
28
|
-
set default(value: string);
|
|
29
|
-
constructor(options: TypeRefOptions);
|
|
30
|
-
setDefault(value: string): void;
|
|
31
|
-
setType(value: string): void;
|
|
32
|
-
}
|
|
33
|
-
declare type TypeRefOptionalKeys = 'default' | 'refs';
|
|
34
|
-
declare type TypeRefOptions = Options<TypeRef, TypeRefOptionalKeys>;
|
|
35
|
-
export declare class Generic extends TypeRef {
|
|
36
|
-
constructor(options: GenericOptions);
|
|
37
|
-
}
|
|
38
|
-
export declare type GenericOptions = Options<Generic, TypeRefOptionalKeys>;
|
|
39
|
-
export declare class Property extends TypeRef {
|
|
40
|
-
readonly name: string;
|
|
41
|
-
private _optional;
|
|
42
|
-
get optional(): '' | '?';
|
|
43
|
-
set optional(value: '' | '?');
|
|
44
|
-
constructor(options: PropertyOptions);
|
|
45
|
-
setOptional(isOptional: boolean): void;
|
|
46
|
-
}
|
|
47
|
-
export declare type PropertyOptions = Options<Property, TypeRefOptionalKeys | 'optional'>;
|
|
48
|
-
export {};
|
|
1
|
+
import { Import } from './import';
|
|
2
|
+
import { Options } from './util';
|
|
3
|
+
export declare class Model {
|
|
4
|
+
readonly imports: Import[];
|
|
5
|
+
readonly interfaces: Interface[];
|
|
6
|
+
readonly namespace: string;
|
|
7
|
+
readonly path: string;
|
|
8
|
+
constructor(options: ModelOptions);
|
|
9
|
+
}
|
|
10
|
+
export declare type ModelOptions = Options<Model, 'imports' | 'interfaces'>;
|
|
11
|
+
export declare class Interface {
|
|
12
|
+
readonly base: string | null;
|
|
13
|
+
readonly identifier: string;
|
|
14
|
+
readonly namespace: string;
|
|
15
|
+
readonly generics: Generic[];
|
|
16
|
+
readonly properties: Property[];
|
|
17
|
+
readonly ref: string;
|
|
18
|
+
constructor(options: InterfaceOptions);
|
|
19
|
+
}
|
|
20
|
+
export declare type InterfaceOptions = Options<Interface, 'generics' | 'properties'>;
|
|
21
|
+
declare abstract class TypeRef {
|
|
22
|
+
readonly refs: string[];
|
|
23
|
+
protected _type: string;
|
|
24
|
+
get type(): string;
|
|
25
|
+
set type(value: string);
|
|
26
|
+
protected _default: string;
|
|
27
|
+
get default(): string;
|
|
28
|
+
set default(value: string);
|
|
29
|
+
constructor(options: TypeRefOptions);
|
|
30
|
+
setDefault(value: string): void;
|
|
31
|
+
setType(value: string): void;
|
|
32
|
+
}
|
|
33
|
+
declare type TypeRefOptionalKeys = 'default' | 'refs';
|
|
34
|
+
declare type TypeRefOptions = Options<TypeRef, TypeRefOptionalKeys>;
|
|
35
|
+
export declare class Generic extends TypeRef {
|
|
36
|
+
constructor(options: GenericOptions);
|
|
37
|
+
}
|
|
38
|
+
export declare type GenericOptions = Options<Generic, TypeRefOptionalKeys>;
|
|
39
|
+
export declare class Property extends TypeRef {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
private _optional;
|
|
42
|
+
get optional(): '' | '?';
|
|
43
|
+
set optional(value: '' | '?');
|
|
44
|
+
constructor(options: PropertyOptions);
|
|
45
|
+
setOptional(isOptional: boolean): void;
|
|
46
|
+
}
|
|
47
|
+
export declare type PropertyOptions = Options<Property, TypeRefOptionalKeys | 'optional'>;
|
|
48
|
+
export {};
|
package/models/model.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Property = exports.Generic = exports.Interface = exports.Model = void 0;
|
|
4
|
-
class Model {
|
|
5
|
-
constructor(options) {
|
|
6
|
-
this.imports = [];
|
|
7
|
-
this.interfaces = [];
|
|
8
|
-
Object.assign(this, options);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.Model = Model;
|
|
12
|
-
class Interface {
|
|
13
|
-
constructor(options) {
|
|
14
|
-
this.generics = [];
|
|
15
|
-
this.properties = [];
|
|
16
|
-
Object.assign(this, options);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.Interface = Interface;
|
|
20
|
-
class TypeRef {
|
|
21
|
-
constructor(options) {
|
|
22
|
-
this.refs = [];
|
|
23
|
-
this._type = '';
|
|
24
|
-
this._default = '';
|
|
25
|
-
Object.assign(this, options);
|
|
26
|
-
}
|
|
27
|
-
get type() {
|
|
28
|
-
return this._type;
|
|
29
|
-
}
|
|
30
|
-
set type(value) {
|
|
31
|
-
if (!value)
|
|
32
|
-
return;
|
|
33
|
-
this._type = value;
|
|
34
|
-
}
|
|
35
|
-
get default() {
|
|
36
|
-
return this._default;
|
|
37
|
-
}
|
|
38
|
-
set default(value) {
|
|
39
|
-
if (!value)
|
|
40
|
-
return;
|
|
41
|
-
this._default = ` = ${value}`;
|
|
42
|
-
}
|
|
43
|
-
setDefault(value) {
|
|
44
|
-
this.default = value;
|
|
45
|
-
}
|
|
46
|
-
setType(value) {
|
|
47
|
-
this.type = value;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
class Generic extends TypeRef {
|
|
51
|
-
constructor(options) {
|
|
52
|
-
super(options);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.Generic = Generic;
|
|
56
|
-
class Property extends TypeRef {
|
|
57
|
-
constructor(options) {
|
|
58
|
-
super(options);
|
|
59
|
-
this._optional = '';
|
|
60
|
-
}
|
|
61
|
-
get optional() {
|
|
62
|
-
return this.default ? '' : this._optional;
|
|
63
|
-
}
|
|
64
|
-
set optional(value) {
|
|
65
|
-
this._optional = value;
|
|
66
|
-
}
|
|
67
|
-
setOptional(isOptional) {
|
|
68
|
-
this.optional = isOptional ? '?' : '';
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.Property = Property;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Property = exports.Generic = exports.Interface = exports.Model = void 0;
|
|
4
|
+
class Model {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.imports = [];
|
|
7
|
+
this.interfaces = [];
|
|
8
|
+
Object.assign(this, options);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.Model = Model;
|
|
12
|
+
class Interface {
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.generics = [];
|
|
15
|
+
this.properties = [];
|
|
16
|
+
Object.assign(this, options);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.Interface = Interface;
|
|
20
|
+
class TypeRef {
|
|
21
|
+
constructor(options) {
|
|
22
|
+
this.refs = [];
|
|
23
|
+
this._type = '';
|
|
24
|
+
this._default = '';
|
|
25
|
+
Object.assign(this, options);
|
|
26
|
+
}
|
|
27
|
+
get type() {
|
|
28
|
+
return this._type;
|
|
29
|
+
}
|
|
30
|
+
set type(value) {
|
|
31
|
+
if (!value)
|
|
32
|
+
return;
|
|
33
|
+
this._type = value;
|
|
34
|
+
}
|
|
35
|
+
get default() {
|
|
36
|
+
return this._default;
|
|
37
|
+
}
|
|
38
|
+
set default(value) {
|
|
39
|
+
if (!value)
|
|
40
|
+
return;
|
|
41
|
+
this._default = ` = ${value}`;
|
|
42
|
+
}
|
|
43
|
+
setDefault(value) {
|
|
44
|
+
this.default = value;
|
|
45
|
+
}
|
|
46
|
+
setType(value) {
|
|
47
|
+
this.type = value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
class Generic extends TypeRef {
|
|
51
|
+
constructor(options) {
|
|
52
|
+
super(options);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.Generic = Generic;
|
|
56
|
+
class Property extends TypeRef {
|
|
57
|
+
constructor(options) {
|
|
58
|
+
super(options);
|
|
59
|
+
this._optional = '';
|
|
60
|
+
}
|
|
61
|
+
get optional() {
|
|
62
|
+
return this.default ? '' : this._optional;
|
|
63
|
+
}
|
|
64
|
+
set optional(value) {
|
|
65
|
+
this._optional = value;
|
|
66
|
+
}
|
|
67
|
+
setOptional(isOptional) {
|
|
68
|
+
this.optional = isOptional ? '?' : '';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.Property = Property;
|
|
72
72
|
//# sourceMappingURL=model.js.map
|
package/models/project.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { workspaces } from '@angular-devkit/core';
|
|
2
|
-
export interface Project {
|
|
3
|
-
name: string;
|
|
4
|
-
definition: workspaces.ProjectDefinition;
|
|
5
|
-
}
|
|
1
|
+
import { workspaces } from '@angular-devkit/core';
|
|
2
|
+
export interface Project {
|
|
3
|
+
name: string;
|
|
4
|
+
definition: workspaces.ProjectDefinition;
|
|
5
|
+
}
|
package/models/project.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=project.js.map
|
package/models/proxy-config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiDefinition } from './api-definition';
|
|
2
|
-
export interface ProxyConfig extends ApiDefinition {
|
|
3
|
-
generated: string[];
|
|
4
|
-
}
|
|
1
|
+
import { ApiDefinition } from './api-definition';
|
|
2
|
+
export interface ProxyConfig extends ApiDefinition {
|
|
3
|
+
generated: string[];
|
|
4
|
+
}
|
package/models/proxy-config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=proxy-config.js.map
|
package/models/service.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Controller, Type } from './api-definition';
|
|
2
|
-
import { Import } from './import';
|
|
3
|
-
import { Method } from './method';
|
|
4
|
-
import { Omissible } from './util';
|
|
5
|
-
export interface ServiceGeneratorParams {
|
|
6
|
-
targetPath: string;
|
|
7
|
-
solution: string;
|
|
8
|
-
types: Record<string, Type>;
|
|
9
|
-
apiName: string;
|
|
10
|
-
controllers: Controller[];
|
|
11
|
-
serviceImports: Record<string, string[]>;
|
|
12
|
-
}
|
|
13
|
-
export declare class Service {
|
|
14
|
-
apiName: string;
|
|
15
|
-
imports: Import[];
|
|
16
|
-
methods: Method[];
|
|
17
|
-
name: string;
|
|
18
|
-
namespace: string;
|
|
19
|
-
constructor(options: ServiceOptions);
|
|
20
|
-
}
|
|
21
|
-
export declare type ServiceOptions = Omissible<Service, 'imports' | 'methods'>;
|
|
1
|
+
import { Controller, Type } from './api-definition';
|
|
2
|
+
import { Import } from './import';
|
|
3
|
+
import { Method } from './method';
|
|
4
|
+
import { Omissible } from './util';
|
|
5
|
+
export interface ServiceGeneratorParams {
|
|
6
|
+
targetPath: string;
|
|
7
|
+
solution: string;
|
|
8
|
+
types: Record<string, Type>;
|
|
9
|
+
apiName: string;
|
|
10
|
+
controllers: Controller[];
|
|
11
|
+
serviceImports: Record<string, string[]>;
|
|
12
|
+
}
|
|
13
|
+
export declare class Service {
|
|
14
|
+
apiName: string;
|
|
15
|
+
imports: Import[];
|
|
16
|
+
methods: Method[];
|
|
17
|
+
name: string;
|
|
18
|
+
namespace: string;
|
|
19
|
+
constructor(options: ServiceOptions);
|
|
20
|
+
}
|
|
21
|
+
export declare type ServiceOptions = Omissible<Service, 'imports' | 'methods'>;
|
package/models/service.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Service = void 0;
|
|
4
|
-
class Service {
|
|
5
|
-
constructor(options) {
|
|
6
|
-
this.imports = [];
|
|
7
|
-
this.methods = [];
|
|
8
|
-
Object.assign(this, options);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.Service = Service;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Service = void 0;
|
|
4
|
+
class Service {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.imports = [];
|
|
7
|
+
this.methods = [];
|
|
8
|
+
Object.assign(this, options);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.Service = Service;
|
|
12
12
|
//# sourceMappingURL=service.js.map
|
package/models/tree.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type WriteOp = 'create' | 'overwrite';
|
|
1
|
+
export declare type WriteOp = 'create' | 'overwrite';
|
package/models/tree.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=tree.js.map
|
package/models/util.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare type Omissible<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
|
|
2
|
-
declare type ExcludeKeys<Type, Excluded> = Exclude<{
|
|
3
|
-
[Key in keyof Type]: Type[Key] extends Excluded ? never : Key;
|
|
4
|
-
}[keyof Type], never>;
|
|
5
|
-
declare type ExcludeMethods<Type> = Pick<Type, ExcludeKeys<Type, Function>>;
|
|
6
|
-
export declare type Options<T, K extends keyof ExcludeMethods<T>> = Omissible<ExcludeMethods<T>, K>;
|
|
7
|
-
export {};
|
|
1
|
+
export declare type Omissible<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
|
|
2
|
+
declare type ExcludeKeys<Type, Excluded> = Exclude<{
|
|
3
|
+
[Key in keyof Type]: Type[Key] extends Excluded ? never : Key;
|
|
4
|
+
}[keyof Type], never>;
|
|
5
|
+
declare type ExcludeMethods<Type> = Pick<Type, ExcludeKeys<Type, Function>>;
|
|
6
|
+
export declare type Options<T, K extends keyof ExcludeMethods<T>> = Omissible<ExcludeMethods<T>, K>;
|
|
7
|
+
export {};
|
package/models/util.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=util.js.map
|
package/package.json
CHANGED
package/test-setup.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import 'jest-preset-angular/setup-jest';
|
|
1
|
+
import 'jest-preset-angular/setup-jest';
|
package/test-setup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("jest-preset-angular/setup-jest");
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("jest-preset-angular/setup-jest");
|
|
4
4
|
//# sourceMappingURL=test-setup.js.map
|