@rxap/schematics-open-api 16.0.0-dev.12 → 16.0.0-dev.13
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/package.json +8 -8
- package/src/index.js +26 -29
- package/src/index.js.map +1 -1
- package/src/lib/clear-operation.js +5 -9
- package/src/lib/clear-operation.js.map +1 -1
- package/src/lib/config.js +7 -10
- package/src/lib/config.js.map +1 -1
- package/src/lib/generate-components.js +8 -9
- package/src/lib/generate-components.js.map +1 -1
- package/src/lib/generate-index-exports.js +3 -7
- package/src/lib/generate-index-exports.js.map +1 -1
- package/src/lib/generate-operation.js +24 -26
- package/src/lib/generate-operation.js.map +1 -1
- package/src/lib/generate-parameters.js +16 -18
- package/src/lib/generate-parameters.js.map +1 -1
- package/src/lib/generate-request-body.js +13 -14
- package/src/lib/generate-request-body.js.map +1 -1
- package/src/lib/generate-response.js +13 -14
- package/src/lib/generate-response.js.map +1 -1
- package/src/lib/load-open-api-config.js +16 -23
- package/src/lib/load-open-api-config.js.map +1 -1
- package/src/lib/types.js +3 -9
- package/src/lib/types.js.map +1 -1
- package/src/lib/utilities/any-schema-object.js +1 -5
- package/src/lib/utilities/any-schema-object.js.map +1 -1
- package/src/lib/utilities/get-parameter-type.js +4 -8
- package/src/lib/utilities/get-parameter-type.js.map +1 -1
- package/src/lib/utilities/get-reqeust-body.js +6 -10
- package/src/lib/utilities/get-reqeust-body.js.map +1 -1
- package/src/lib/utilities/get-request-body-type.js +8 -12
- package/src/lib/utilities/get-request-body-type.js.map +1 -1
- package/src/lib/utilities/get-response-type.js +8 -12
- package/src/lib/utilities/get-response-type.js.map +1 -1
- package/src/lib/utilities/get-response.js +3 -7
- package/src/lib/utilities/get-response.js.map +1 -1
- package/src/lib/utilities/has-operation-paramters.js +1 -5
- package/src/lib/utilities/has-operation-paramters.js.map +1 -1
- package/src/lib/utilities/has-operation-request-body.js +1 -5
- package/src/lib/utilities/has-operation-request-body.js.map +1 -1
- package/src/lib/utilities/http-request.js +3 -7
- package/src/lib/utilities/http-request.js.map +1 -1
- package/src/lib/utilities/ignore-operation.js +2 -7
- package/src/lib/utilities/ignore-operation.js.map +1 -1
- package/src/lib/utilities/is-collection-response.js +7 -11
- package/src/lib/utilities/is-collection-response.js.map +1 -1
- package/src/lib/utilities/is-http-method.js +1 -5
- package/src/lib/utilities/is-http-method.js.map +1 -1
- package/src/lib/utilities/is-open-api-schema-from-path.js +3 -7
- package/src/lib/utilities/is-open-api-schema-from-path.js.map +1 -1
- package/src/lib/utilities/is-operation-object.js +1 -5
- package/src/lib/utilities/is-operation-object.js.map +1 -1
- package/src/lib/utilities/is-reference-object.js +1 -5
- package/src/lib/utilities/is-reference-object.js.map +1 -1
- package/src/lib/utilities/is-without-parameters.js +1 -5
- package/src/lib/utilities/is-without-parameters.js.map +1 -1
- package/src/schematics/generate/const.js +5 -8
- package/src/schematics/generate/const.js.map +1 -1
- package/src/schematics/generate/create-directive.js +10 -14
- package/src/schematics/generate/create-directive.js.map +1 -1
- package/src/schematics/generate/generate-data-source.js +13 -17
- package/src/schematics/generate/generate-data-source.js.map +1 -1
- package/src/schematics/generate/generate-openapi-provider.js +9 -13
- package/src/schematics/generate/generate-openapi-provider.js.map +1 -1
- package/src/schematics/generate/generate-operation-command.js +105 -112
- package/src/schematics/generate/generate-operation-command.js.map +1 -1
- package/src/schematics/generate/generate-remote-method.js +27 -31
- package/src/schematics/generate/generate-remote-method.js.map +1 -1
- package/src/schematics/generate/index.js +38 -43
- package/src/schematics/generate/index.js.map +1 -1
- package/src/schematics/generate/options.js +1 -2
package/src/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/schematic/open-api/src/lib/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/schematic/open-api/src/lib/types.ts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MAAM,CAAE,GAAG,EAAE,KAAK,CAAE,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAChD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBAC5B,KAAK,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;aAC3C;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,SAAoC;IACjE,OAAO,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,SAAoC;IACxE,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;AACH,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsAnySchemaObject = void 0;
|
|
4
|
-
function IsAnySchemaObject(obj) {
|
|
1
|
+
export function IsAnySchemaObject(obj) {
|
|
5
2
|
return obj && obj['type'] && obj.type === 'any';
|
|
6
3
|
}
|
|
7
|
-
exports.IsAnySchemaObject = IsAnySchemaObject;
|
|
8
4
|
//# sourceMappingURL=any-schema-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-schema-object.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/any-schema-object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"any-schema-object.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/any-schema-object.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,iBAAiB,CAAC,GAAQ;IACxC,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC;AAClD,CAAC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
-
const config_1 = require("../config");
|
|
6
|
-
function GetParameterType(operation) {
|
|
1
|
+
import { classify } from '@rxap/schematics-utilities';
|
|
2
|
+
import { PARAMETER_FILE_SUFFIX } from '../config';
|
|
3
|
+
export function GetParameterType(operation) {
|
|
7
4
|
let parameterType = 'void';
|
|
8
5
|
if (operation.parameters && operation.parameters.length && operation.operationId) {
|
|
9
|
-
parameterType =
|
|
6
|
+
parameterType = classify([operation.operationId, PARAMETER_FILE_SUFFIX].join('-'));
|
|
10
7
|
}
|
|
11
8
|
return parameterType;
|
|
12
9
|
}
|
|
13
|
-
exports.GetParameterType = GetParameterType;
|
|
14
10
|
//# sourceMappingURL=get-parameter-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-parameter-type.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-parameter-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-parameter-type.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-parameter-type.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAElD,MAAM,UAAU,gBAAgB,CAAC,SAAoC;IAEnE,IAAI,aAAa,GAAG,MAAM,CAAC;IAE3B,IAAI,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,IAAI,SAAS,CAAC,WAAW,EAAE;QAChF,aAAa,GAAG,QAAQ,CAAC,CAAE,SAAS,CAAC,WAAW,EAAE,qBAAqB,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;KACtF;IAED,OAAO,aAAa,CAAC;AAEvB,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const is_reference_object_1 = require("./is-reference-object");
|
|
5
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
-
function GetRequestBody(operation) {
|
|
1
|
+
import { IsReferenceObject } from './is-reference-object';
|
|
2
|
+
import { IsRecord } from '@rxap/schematics-utilities';
|
|
3
|
+
export function GetRequestBody(operation) {
|
|
7
4
|
if (operation.requestBody) {
|
|
8
|
-
if (
|
|
5
|
+
if (IsReferenceObject(operation.requestBody)) {
|
|
9
6
|
throw new Error('Reference object are not supported in operation requestBody!');
|
|
10
7
|
}
|
|
11
8
|
const requestBodies = operation.requestBody.content;
|
|
12
|
-
if (
|
|
13
|
-
if (
|
|
9
|
+
if (IsRecord(requestBodies)) {
|
|
10
|
+
if (IsReferenceObject(requestBodies)) {
|
|
14
11
|
console.warn('Reference object are not supported in operation requestBody!');
|
|
15
12
|
}
|
|
16
13
|
else {
|
|
@@ -25,5 +22,4 @@ function GetRequestBody(operation) {
|
|
|
25
22
|
}
|
|
26
23
|
return null;
|
|
27
24
|
}
|
|
28
|
-
exports.GetRequestBody = GetRequestBody;
|
|
29
25
|
//# sourceMappingURL=get-reqeust-body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-reqeust-body.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-reqeust-body.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-reqeust-body.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-reqeust-body.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,MAAM,UAAU,cAAc,CAAC,SAAoC;IAEjE,IAAI,SAAS,CAAC,WAAW,EAAE;QAEzB,IAAI,iBAAiB,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE;YAC5C,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;SACjF;QAED,MAAM,aAAa,GAA0D,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;QAE3G,IAAI,QAAQ,CAAC,aAAa,CAAC,EAAE;YAE3B,IAAI,iBAAiB,CAAC,aAAa,CAAC,EAAE;gBACpC,OAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;aAC9E;iBAAM;gBACL,IAAI,aAAa,CAAC,kBAAkB,CAAC,EAAE;oBACrC,MAAM,MAAM,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,CAAC;oBAC3D,IAAI,MAAM,EAAE;wBACV,OAAO,MAAM,CAAC;qBACf;iBACF;aACF;SAEF;KAEF;IAED,OAAO,IAAI,CAAC;AAEd,CAAC"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
|
-
const config_1 = require("../config");
|
|
8
|
-
function GetRequestBodyType(operation) {
|
|
1
|
+
import { GetRequestBody } from './get-reqeust-body';
|
|
2
|
+
import { IsAnySchemaObject } from './any-schema-object';
|
|
3
|
+
import { classify } from '@rxap/schematics-utilities';
|
|
4
|
+
import { REQUEST_BODY_FILE_SUFFIX } from '../config';
|
|
5
|
+
export function GetRequestBodyType(operation) {
|
|
9
6
|
let requestBodyType = 'void';
|
|
10
7
|
if (operation.operationId) {
|
|
11
|
-
const requestBody =
|
|
8
|
+
const requestBody = GetRequestBody(operation);
|
|
12
9
|
if (requestBody === null) {
|
|
13
10
|
requestBodyType = 'void';
|
|
14
11
|
}
|
|
15
|
-
else if (!
|
|
16
|
-
requestBodyType =
|
|
12
|
+
else if (!IsAnySchemaObject(requestBody)) {
|
|
13
|
+
requestBodyType = classify([operation.operationId, REQUEST_BODY_FILE_SUFFIX].join('-'));
|
|
17
14
|
}
|
|
18
15
|
else {
|
|
19
16
|
requestBodyType = 'any';
|
|
@@ -21,5 +18,4 @@ function GetRequestBodyType(operation) {
|
|
|
21
18
|
}
|
|
22
19
|
return requestBodyType;
|
|
23
20
|
}
|
|
24
|
-
exports.GetRequestBodyType = GetRequestBodyType;
|
|
25
21
|
//# sourceMappingURL=get-request-body-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-request-body-type.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-request-body-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-request-body-type.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-request-body-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,MAAM,UAAU,kBAAkB,CAAC,SAAiC;IAElE,IAAI,eAAe,GAAG,MAAM,CAAC;IAE7B,IAAI,SAAS,CAAC,WAAW,EAAE;QAEzB,MAAM,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;QAE9C,IAAI,WAAW,KAAK,IAAI,EAAE;YACxB,eAAe,GAAG,MAAM,CAAC;SAC1B;aAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE;YAC1C,eAAe,GAAG,QAAQ,CAAC,CAAE,SAAS,CAAC,WAAW,EAAE,wBAAwB,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3F;aAAM;YACL,eAAe,GAAG,KAAK,CAAC;SACzB;KAEF;IAED,OAAO,eAAe,CAAC;AAEzB,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const any_schema_object_1 = require("./any-schema-object");
|
|
7
|
-
const get_response_1 = require("./get-response");
|
|
8
|
-
function GetResponseType(operation) {
|
|
1
|
+
import { classify } from '@rxap/schematics-utilities';
|
|
2
|
+
import { RESPONSE_FILE_SUFFIX } from '../config';
|
|
3
|
+
import { IsAnySchemaObject } from './any-schema-object';
|
|
4
|
+
import { GetResponse } from './get-response';
|
|
5
|
+
export function GetResponseType(operation) {
|
|
9
6
|
let responseType = 'void';
|
|
10
7
|
if (operation.operationId) {
|
|
11
|
-
const response =
|
|
8
|
+
const response = GetResponse(operation);
|
|
12
9
|
// only generate the response interface if the type is not any
|
|
13
|
-
if (response && !
|
|
14
|
-
responseType =
|
|
10
|
+
if (response && !IsAnySchemaObject(response)) {
|
|
11
|
+
responseType = classify([operation.operationId, RESPONSE_FILE_SUFFIX].join('-'));
|
|
15
12
|
}
|
|
16
13
|
else {
|
|
17
14
|
responseType = 'void';
|
|
@@ -19,5 +16,4 @@ function GetResponseType(operation) {
|
|
|
19
16
|
}
|
|
20
17
|
return responseType;
|
|
21
18
|
}
|
|
22
|
-
exports.GetResponseType = GetResponseType;
|
|
23
19
|
//# sourceMappingURL=get-response-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-response-type.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-response-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-response-type.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-response-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,UAAU,eAAe,CAAC,SAAoC;IAElE,IAAI,YAAY,GAAG,MAAM,CAAC;IAE1B,IAAI,SAAS,CAAC,WAAW,EAAE;QAEzB,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;QAExC,8DAA8D;QAC9D,IAAI,QAAQ,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE;YAC5C,YAAY,GAAG,QAAQ,CAAC,CAAE,SAAS,CAAC,WAAW,EAAE,oBAAoB,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SACpF;aAAM;YACL,YAAY,GAAG,MAAM,CAAC;SACvB;KAEF;IAED,OAAO,YAAY,CAAC;AAEtB,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.GetResponse = void 0;
|
|
4
|
-
const is_reference_object_1 = require("./is-reference-object");
|
|
5
|
-
function GetResponse(operation) {
|
|
1
|
+
import { IsReferenceObject } from './is-reference-object';
|
|
2
|
+
export function GetResponse(operation) {
|
|
6
3
|
if (operation.responses) {
|
|
7
4
|
let response = undefined;
|
|
8
5
|
if (operation.responses['default']) {
|
|
@@ -15,7 +12,7 @@ function GetResponse(operation) {
|
|
|
15
12
|
response = operation.responses['201'];
|
|
16
13
|
}
|
|
17
14
|
if (response) {
|
|
18
|
-
if (
|
|
15
|
+
if (IsReferenceObject(response)) {
|
|
19
16
|
console.warn('Reference object are not supported in operation responses!');
|
|
20
17
|
}
|
|
21
18
|
else {
|
|
@@ -30,5 +27,4 @@ function GetResponse(operation) {
|
|
|
30
27
|
}
|
|
31
28
|
return null;
|
|
32
29
|
}
|
|
33
|
-
exports.GetResponse = GetResponse;
|
|
34
30
|
//# sourceMappingURL=get-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-response.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-response.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/get-response.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,UAAU,WAAW,CAAC,SAAoC;IAE9D,IAAI,SAAS,CAAC,SAAS,EAAE;QAEvB,IAAI,QAAQ,GAAqE,SAAS,CAAC;QAE3F,IAAI,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;YAClC,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;SAC3C;aAAM,IAAI,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YACrC,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SACvC;aAAM,IAAI,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;YACrC,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SACvC;QAED,IAAI,QAAQ,EAAE;YAEZ,IAAI,iBAAiB,CAAC,QAAQ,CAAC,EAAE;gBAC/B,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;aAC5E;iBAAM;gBACL,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;oBAC5D,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC;oBAC3D,IAAI,MAAM,EAAE;wBACV,OAAO,MAAM,CAAC;qBACf;iBACF;aACF;SAEF;KAEF;IAED,OAAO,IAAI,CAAC;AAEd,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HasOperationParameters = void 0;
|
|
4
|
-
function HasOperationParameters(operation) {
|
|
1
|
+
export function HasOperationParameters(operation) {
|
|
5
2
|
return Array.isArray(operation.parameters) && operation.parameters.length !== 0;
|
|
6
3
|
}
|
|
7
|
-
exports.HasOperationParameters = HasOperationParameters;
|
|
8
4
|
//# sourceMappingURL=has-operation-paramters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-operation-paramters.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/has-operation-paramters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"has-operation-paramters.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/has-operation-paramters.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,sBAAsB,CAAC,SAAoC;IACzE,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HasOperationRequestBody = void 0;
|
|
4
|
-
function HasOperationRequestBody(operation) {
|
|
1
|
+
export function HasOperationRequestBody(operation) {
|
|
5
2
|
return !!operation.requestBody;
|
|
6
3
|
}
|
|
7
|
-
exports.HasOperationRequestBody = HasOperationRequestBody;
|
|
8
4
|
//# sourceMappingURL=has-operation-request-body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-operation-request-body.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/has-operation-request-body.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"has-operation-request-body.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/has-operation-request-body.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,uBAAuB,CAAC,SAAoC;IAC1E,OAAO,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC;AACjC,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const http = require("http");
|
|
5
|
-
const https = require("https");
|
|
6
|
-
function HttpRequest(url) {
|
|
1
|
+
import * as http from 'http';
|
|
2
|
+
import * as https from 'https';
|
|
3
|
+
export function HttpRequest(url) {
|
|
7
4
|
function callback(resolve, reject) {
|
|
8
5
|
return function (res) {
|
|
9
6
|
const { statusCode } = res;
|
|
@@ -53,5 +50,4 @@ function HttpRequest(url) {
|
|
|
53
50
|
});
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
|
-
exports.HttpRequest = HttpRequest;
|
|
57
53
|
//# sourceMappingURL=http-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-request.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/http-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-request.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/http-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,UAAU,WAAW,CAAI,GAAW;IAExC,SAAS,QAAQ,CAAC,OAA6B,EAAE,MAA4B;QAE3E,OAAO,UAAU,GAAyB;YAExC,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;YAC3B,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YAEhD,IAAI,KAAK,CAAC;YACV,wDAAwD;YACxD,oCAAoC;YACpC,IAAI,UAAU,KAAK,GAAG,EAAE;gBACtB,KAAK,GAAG,IAAI,KAAK,CAAC,mBAAmB;oBACnC,gBAAiB,UAAW,EAAE,CAAC,CAAC;aACnC;iBAAM,IA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AAC;KACJ;SAAM;QACL,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACxC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;KACJ;AAEH,CAAC"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IgnoreOperation = void 0;
|
|
4
|
-
function IgnoreOperation(tags = []) {
|
|
1
|
+
export function IgnoreOperation(tags = []) {
|
|
5
2
|
return operation => {
|
|
6
|
-
|
|
7
|
-
if ((_a = operation === null || operation === void 0 ? void 0 : operation.tags) === null || _a === void 0 ? void 0 : _a.length) {
|
|
3
|
+
if (operation?.tags?.length) {
|
|
8
4
|
return operation.tags.some(tag => tags.includes(tag));
|
|
9
5
|
}
|
|
10
6
|
return false;
|
|
11
7
|
};
|
|
12
8
|
}
|
|
13
|
-
exports.IgnoreOperation = IgnoreOperation;
|
|
14
9
|
//# sourceMappingURL=ignore-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/ignore-operation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ignore-operation.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/ignore-operation.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,OAAiB,EAAE;IACjD,OAAO,SAAS,CAAC,EAAE;QAEjB,IAAI,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;YAC3B,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;SACvD;QAED,OAAO,KAAK,CAAC;IAEf,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const response = (0, get_response_1.GetResponse)(operation);
|
|
9
|
-
if (response && !(0, any_schema_object_1.IsAnySchemaObject)(response)) {
|
|
10
|
-
if (!(0, is_reference_object_1.IsReferenceObject)(response)) {
|
|
1
|
+
import { IsAnySchemaObject } from './any-schema-object';
|
|
2
|
+
import { GetResponse } from './get-response';
|
|
3
|
+
import { IsReferenceObject } from './is-reference-object';
|
|
4
|
+
export function IsCollectionResponse(operation) {
|
|
5
|
+
const response = GetResponse(operation);
|
|
6
|
+
if (response && !IsAnySchemaObject(response)) {
|
|
7
|
+
if (!IsReferenceObject(response)) {
|
|
11
8
|
return response.type === 'array';
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
11
|
return false;
|
|
15
12
|
}
|
|
16
|
-
exports.IsCollectionResponse = IsCollectionResponse;
|
|
17
13
|
//# sourceMappingURL=is-collection-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-collection-response.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-collection-response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-collection-response.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-collection-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,UAAU,oBAAoB,CAAC,SAAoC;IAEvE,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IAExC,IAAI,QAAQ,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE;QAC5C,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE;YAChC,OAAO,QAAQ,CAAC,IAAI,KAAK,OAAO,CAAC;SAClC;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsHttpMethod = void 0;
|
|
4
|
-
function IsHttpMethod(method) {
|
|
1
|
+
export function IsHttpMethod(method) {
|
|
5
2
|
return ['get', 'put', 'post', 'delete', 'patch'].includes(method);
|
|
6
3
|
}
|
|
7
|
-
exports.IsHttpMethod = IsHttpMethod;
|
|
8
4
|
//# sourceMappingURL=is-http-method.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-http-method.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-http-method.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-http-method.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-http-method.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,OAAO,CAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const utilities_1 = require("@rxap/utilities");
|
|
5
|
-
function IsOpenApiSchemaFromPath(options) {
|
|
6
|
-
return !!options && (0, utilities_1.hasIndexSignature)(options) && !!options['path'];
|
|
1
|
+
import { hasIndexSignature } from '@rxap/utilities';
|
|
2
|
+
export function IsOpenApiSchemaFromPath(options) {
|
|
3
|
+
return !!options && hasIndexSignature(options) && !!options['path'];
|
|
7
4
|
}
|
|
8
|
-
exports.IsOpenApiSchemaFromPath = IsOpenApiSchemaFromPath;
|
|
9
5
|
//# sourceMappingURL=is-open-api-schema-from-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-open-api-schema-from-path.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-open-api-schema-from-path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-open-api-schema-from-path.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-open-api-schema-from-path.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,UAAU,uBAAuB,CAAC,OAAsB;IAC5D,OAAO,CAAC,CAAC,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsOperationObject = void 0;
|
|
4
|
-
function IsOperationObject(obj) {
|
|
1
|
+
export function IsOperationObject(obj) {
|
|
5
2
|
return !!obj && !!obj['operationId'];
|
|
6
3
|
}
|
|
7
|
-
exports.IsOperationObject = IsOperationObject;
|
|
8
4
|
//# sourceMappingURL=is-operation-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-operation-object.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-operation-object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-operation-object.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-operation-object.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,GAAQ;IACxC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsReferenceObject = void 0;
|
|
4
|
-
function IsReferenceObject(obj) {
|
|
1
|
+
export function IsReferenceObject(obj) {
|
|
5
2
|
return !!obj && !!obj['$ref'];
|
|
6
3
|
}
|
|
7
|
-
exports.IsReferenceObject = IsReferenceObject;
|
|
8
4
|
//# sourceMappingURL=is-reference-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-reference-object.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-reference-object.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-reference-object.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-reference-object.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,GAAS;IACzC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IsWithoutParameters = void 0;
|
|
4
|
-
function IsWithoutParameters(operation) {
|
|
1
|
+
export function IsWithoutParameters(operation) {
|
|
5
2
|
return !operation.parameters || !operation.parameters.length;
|
|
6
3
|
}
|
|
7
|
-
exports.IsWithoutParameters = IsWithoutParameters;
|
|
8
4
|
//# sourceMappingURL=is-without-parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-without-parameters.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-without-parameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-without-parameters.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/lib/utilities/is-without-parameters.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,mBAAmB,CAAC,SAAoC;IACtE,OAAO,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;AAC/D,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.REMOTE_METHOD_BASE_PATH = 'remote-methods';
|
|
7
|
-
exports.REMOTE_METHOD_FILE_SUFFIX = 'remote-method';
|
|
8
|
-
exports.COMMAND_BASE_PATH = 'commands';
|
|
1
|
+
export const DATA_SOURCE_BASE_PATH = 'data-sources';
|
|
2
|
+
export const DATA_SOURCE_FILE_SUFFIX = 'data-source';
|
|
3
|
+
export const REMOTE_METHOD_BASE_PATH = 'remote-methods';
|
|
4
|
+
export const REMOTE_METHOD_FILE_SUFFIX = 'remote-method';
|
|
5
|
+
export const COMMAND_BASE_PATH = 'commands';
|
|
9
6
|
//# sourceMappingURL=const.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/schematics/generate/const.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/schematics/generate/const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AACpD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAC;AACzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.CreateDirective = void 0;
|
|
4
|
-
const core_1 = require("@angular-devkit/core");
|
|
5
|
-
const ts_morph_1 = require("ts-morph");
|
|
1
|
+
import { strings } from '@angular-devkit/core';
|
|
2
|
+
import { Scope, Writers, } from 'ts-morph';
|
|
6
3
|
function AssertImportSpecifierStructureArray(obj) {
|
|
7
4
|
if (!obj || !Array.isArray(obj)) {
|
|
8
5
|
throw new Error('Should be a array of OptionalKind<ImportSpecifierStructure>');
|
|
9
6
|
}
|
|
10
7
|
}
|
|
11
|
-
const { classify, camelize, } =
|
|
12
|
-
function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, returnType, template, collection, withoutParameters, }) {
|
|
8
|
+
const { classify, camelize, } = strings;
|
|
9
|
+
export function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, returnType, template, collection, withoutParameters, }) {
|
|
13
10
|
const remoteMethodName = classify([name, 'remote-method'].join('-'));
|
|
14
11
|
if (!sourceFile.getClass(remoteMethodName)) {
|
|
15
12
|
console.warn(`A remote method class with the name '${remoteMethodName}' is not declared in the file '${filePath}'.`);
|
|
@@ -103,7 +100,7 @@ function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, r
|
|
|
103
100
|
directiveClassProperties.push({
|
|
104
101
|
name: 'parameters',
|
|
105
102
|
hasQuestionToken: true,
|
|
106
|
-
scope:
|
|
103
|
+
scope: Scope.Public,
|
|
107
104
|
type: parametersType,
|
|
108
105
|
// leadingTrivia: '// eslint-disable-next-line @angular-eslint/no-input-rename',
|
|
109
106
|
hasDeclareKeyword: true,
|
|
@@ -158,7 +155,7 @@ function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, r
|
|
|
158
155
|
hasQuestionToken: true,
|
|
159
156
|
hasDeclareKeyword: true,
|
|
160
157
|
// leadingTrivia: '// eslint-disable-next-line @angular-eslint/no-input-rename',
|
|
161
|
-
scope:
|
|
158
|
+
scope: Scope.Public,
|
|
162
159
|
type: `TemplateRef<RemoteMethodTemplateCollectionDirectiveErrorContext>`,
|
|
163
160
|
decorators: [
|
|
164
161
|
{
|
|
@@ -173,7 +170,7 @@ function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, r
|
|
|
173
170
|
hasDeclareKeyword: true,
|
|
174
171
|
// leadingTrivia: '// eslint-disable-next-line @angular-eslint/no-input-rename',
|
|
175
172
|
hasQuestionToken: true,
|
|
176
|
-
scope:
|
|
173
|
+
scope: Scope.Public,
|
|
177
174
|
type: 'TemplateRef<void>',
|
|
178
175
|
decorators: [
|
|
179
176
|
{
|
|
@@ -208,7 +205,7 @@ function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, r
|
|
|
208
205
|
hasDeclareKeyword: true,
|
|
209
206
|
type: `TemplateRef<RemoteMethodTemplateDirectiveErrorContext>`,
|
|
210
207
|
// leadingTrivia: '// eslint-disable-next-line @angular-eslint/no-input-rename',
|
|
211
|
-
scope:
|
|
208
|
+
scope: Scope.Public,
|
|
212
209
|
decorators: [
|
|
213
210
|
{
|
|
214
211
|
name: 'Input',
|
|
@@ -251,7 +248,7 @@ function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, r
|
|
|
251
248
|
decorators: [
|
|
252
249
|
{
|
|
253
250
|
name: 'Directive',
|
|
254
|
-
arguments:
|
|
251
|
+
arguments: Writers.object({
|
|
255
252
|
selector: (writer) => writer.quote(`[${selector}]`),
|
|
256
253
|
exportAs: (writer) => writer.quote(selector),
|
|
257
254
|
}),
|
|
@@ -276,7 +273,7 @@ function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, r
|
|
|
276
273
|
{
|
|
277
274
|
name: 'NgModule',
|
|
278
275
|
arguments: [
|
|
279
|
-
|
|
276
|
+
Writers.object({
|
|
280
277
|
declarations: `[ ${directiveName} ]`,
|
|
281
278
|
exports: `[ ${directiveName} ]`,
|
|
282
279
|
}),
|
|
@@ -289,5 +286,4 @@ function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, r
|
|
|
289
286
|
sourceFile.addClass(directiveModuleClassStructure);
|
|
290
287
|
sourceFile.addImportDeclarations(importStructure);
|
|
291
288
|
}
|
|
292
|
-
exports.CreateDirective = CreateDirective;
|
|
293
289
|
//# sourceMappingURL=create-directive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-directive.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/schematics/generate/create-directive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-directive.js","sourceRoot":"","sources":["../../../../../../../packages/schematic/open-api/src/schematics/generate/create-directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAQL,KAAK,EAEL,OAAO,GACR,MAAM,UAAU,CAAC;AAGlB,SAAS,mCAAmC,CAAC,GAAQ;IACnD,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;KAChF;AACH,CAAC;AAED,MAAM,EACJ,QAAQ,EACR,QAAQ,GACT,GAAG,OAAO,CAAC;AAEZ,MAAM,UAAU,eAAe,CAAC,EACE,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,EACN,cAAc,EACd,UAAU,EACV,QAAQ,EACR,UAAU,EACV,iBAAiB,GACM;IACvD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,CAAE,IAAI,EAAE,eAAe,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEvE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAC1C,OAAO,CAAC,IAAI,CAAC,wCAAyC,gBAAiB,kCAAmC,QAAS,IAAI,CAAC,CAAC;QACzH,OAAO;KACR;IAED,MAAM,kBAAkB,GAAG,CAAE,gBAAgB,CAAE,CAAC;IAEhD,IAAI,QAAQ,EAAE;QACZ,kBAAkB,CAAC,IAAI,C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